Skip to contentSkip to conversation

add support for mcf5307

PATCH New Angelo Dureghello 2 participants 2 messages Oct 2, 2011 – Oct 6, 2011 m68k architecture

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 add support for mcf5307

Add support for mcf5307 cpu.

---
Changes for v5:
- updated to current remote master

 arch/m68k/cpu/mcf530x/Makefile     |   48 +++++++
 arch/m68k/cpu/mcf530x/config.mk    |   25 ++++
 arch/m68k/cpu/mcf530x/cpu.c        |   48 +++++++
 arch/m68k/cpu/mcf530x/cpu.h        |   33 +++++
 arch/m68k/cpu/mcf530x/cpu_init.c   |  162 +++++++++++++++++++++++
 arch/m68k/cpu/mcf530x/interrupts.c |   42 ++++++
 arch/m68k/cpu/mcf530x/speed.c      |   36 +++++
 arch/m68k/cpu/mcf530x/start.S      |  253 ++++++++++++++++++++++++++++++++++++
 arch/m68k/include/asm/cache.h      |    2 +-
 arch/m68k/include/asm/immap.h      |   22 +++
 arch/m68k/include/asm/immap_5307.h |   78 +++++++++++
 arch/m68k/include/asm/m5307.h      |  124 ++++++++++++++++++
 arch/m68k/include/asm/timer.h      |    2 +-
 include/common.h                   |    6 +-
 14 files changed, 876 insertions(+), 5 deletions(-)
arch/m68k/cpu/mcf530x/Makefile new file +48 -0
new file mode 100644
index 0000000..3c5a1c2
@@ -0,0 +1,48 @@
+#
+# Copyright (c) 2011 Angelo Dureghello <[email protected]>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+# CFLAGS += -DET_DEBUG
+
+LIB	= $(obj)lib$(CPU).o
+
+START	= start.o
+COBJS	= interrupts.o cpu.o speed.o cpu_init.o
+
+SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
+START	:= $(addprefix $(obj),$(START))
+
+all:	$(obj).depend $(START) $(LIB)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
arch/m68k/cpu/mcf530x/config.mk new file +25 -0
new file mode 100644
index 0000000..2ba1644
@@ -0,0 +1,25 @@
+#
+# Copyright (c) 2011 Angelo Dureghello <[email protected]>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+PLATFORM_RELFLAGS += -ffixed-d7 -msep-data
+
+PLATFORM_CPPFLAGS += -m5307 -fPIC
arch/m68k/cpu/mcf530x/cpu.c new file +48 -0

48 lines not on this page · raw message

arch/m68k/cpu/mcf530x/cpu.h new file +33 -0
new file mode 100644
index 0000000..c1227eb
@@ -0,0 +1,33 @@
+/*
+ *  cpu.h
+ *
+ *  Copyright (c) 2009 Freescale Semiconductor, Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef _CPU_H_
+#define _CPU_H_
+
+#include <command.h>
+
+/* Use this to create board specific reset functions */
+void board_reset(void) __attribute__((__weak__));
+
+#endif /* _CPU_H_ */
arch/m68k/cpu/mcf530x/cpu_init.c new file +162 -0

162 lines not on this page · raw message

arch/m68k/cpu/mcf530x/interrupts.c new file +42 -0

42 lines not on this page · raw message

arch/m68k/cpu/mcf530x/speed.c new file +36 -0
new file mode 100644
index 0000000..426bd9e
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2011 Angelo Dureghello <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/processor.h>
+#include <asm/immap.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* get_clocks() fills in gd->cpu_clock and gd->bus_clk */
+int get_clocks (void)
+{
+	gd->cpu_clk = CONFIG_SYS_CLK;
+	gd->bus_clk = gd->cpu_clk / 2;
+
+	return (0);
+}
arch/m68k/cpu/mcf530x/start.S new file +253 -0

253 lines not on this page · raw message

arch/m68k/include/asm/cache.h +1 -1
index 7c84e48..e447f3c 100644
@@ -31,7 +31,7 @@
 #define CONFIG_CF_V2
 #endif
 
-#if defined(CONFIG_MCF532x) || defined(CONFIG_MCF5301x)
+#if defined(CONFIG_MCF530x) || defined(CONFIG_MCF532x) || defined(CONFIG_MCF5301x)
 #define CONFIG_CF_V3
 #endif
 
arch/m68k/include/asm/immap.h +22 -0
index e83ce08..bc43f13 100644
@@ -256,6 +256,28 @@
 #endif
 #endif				/* CONFIG_M5282 */
 
+#ifdef CONFIG_M5307
+#include <asm/immap_5307.h>
+#include <asm/m5307.h>
+
+#define CONFIG_SYS_UART_BASE		(MMAP_UART0 + (CONFIG_SYS_UART_PORT * 0x40))
+
+#define CONFIG_SYS_INTR_BASE		(MMAP_INTC)
+#define CONFIG_SYS_NUM_IRQS		(64)
+
+/* Timer */
+#ifdef CONFIG_MCFTMR
+#define CONFIG_SYS_UDELAY_BASE		(MMAP_DTMR0)
+#define CONFIG_SYS_TMR_BASE		(MMAP_DTMR1)
+#define CONFIG_SYS_TMRPND_REG		(mbar_readLong(MCFSIM_IPR))
+#define CONFIG_SYS_TMRINTR_NO		(31)
+#define CONFIG_SYS_TMRINTR_MASK	(0x00000400)
+#define CONFIG_SYS_TMRINTR_PEND	(CONFIG_SYS_TMRINTR_MASK)
+#define CONFIG_SYS_TMRINTR_PRI		(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL7 | MCFSIM_ICR_PRI3)
+#define CONFIG_SYS_TIMER_PRESCALER	(((gd->bus_clk / 1000000) - 1) << 8)
+#endif
+#endif				/* CONFIG_M5307 */
+
 #if defined(CONFIG_MCF5301x)
 #include <asm/immap_5301x.h>
 #include <asm/m5301x.h>
arch/m68k/include/asm/immap_5307.h new file +78 -0

78 lines not on this page · raw message

arch/m68k/include/asm/m5307.h new file +124 -0

124 lines not on this page · raw message

arch/m68k/include/asm/timer.h +1 -1
index 1a5de05..8516c8f 100644
@@ -33,7 +33,7 @@
 /****************************************************************************/
 /* DMA Timer module registers */
 typedef struct dtimer_ctrl {
-#if defined(CONFIG_M5249) || defined(CONFIG_M5253) || defined(CONFIG_M5272)
+#if defined(CONFIG_M5307) || defined(CONFIG_M5249) || defined(CONFIG_M5253) || defined(CONFIG_M5272)
 	u16 tmr;		/* 0x00 Mode register */
 	u16 res1;		/* 0x02 */
 	u16 trr;		/* 0x04 Reference register */
include/common.h +3 -3
index aeb2d84..5c70913 100644
@@ -243,8 +243,8 @@ typedef void (interrupt_handler_t)(void *);
 
 void	hang		(void) __attribute__ ((noreturn));
 
-int	timer_init(void);
-int	cpu_init(void);
+//int	timer_init(void);
+//int	cpu_init(void);
 
 /* */
 phys_size_t initdram (int);
@@ -595,7 +595,7 @@ void	get_sys_info  ( sys_info_t * );
 #if defined(CONFIG_8xx) || defined(CONFIG_8260)
 void	cpu_init_f    (volatile immap_t *immr);
 #endif
-#if defined(CONFIG_4xx) || defined(CONFIG_MPC85xx) || defined(CONFIG_MCF52x2) ||defined(CONFIG_MPC86xx)
+#if defined(CONFIG_4xx) || defined(CONFIG_MPC85xx) || defined(CONFIG_MCF52x2) || defined (CONFIG_MCF5307) || defined(CONFIG_MPC86xx)
 void	cpu_init_f    (void);
 #endif
 
#1 lore raw

PATCH v5 1/1 add support for mcf5307

Dear Angelo Dureghello,

Quoted 7 lines · In message <[email protected]> you wrote:

Add support for mcf5307 cpu.

---
Changes for v5:
- updated to current remote master

Quoted 15 lines
 arch/m68k/cpu/mcf530x/Makefile     |   48 +++++++
 arch/m68k/cpu/mcf530x/config.mk    |   25 ++++
 arch/m68k/cpu/mcf530x/cpu.c        |   48 +++++++
 arch/m68k/cpu/mcf530x/cpu.h        |   33 +++++
 arch/m68k/cpu/mcf530x/cpu_init.c   |  162 +++++++++++++++++++++++
 arch/m68k/cpu/mcf530x/interrupts.c |   42 ++++++
 arch/m68k/cpu/mcf530x/speed.c      |   36 +++++
 arch/m68k/cpu/mcf530x/start.S      |  253 ++++++++++++++++++++++++++++++++++++
 arch/m68k/include/asm/cache.h      |    2 +-
 arch/m68k/include/asm/immap.h      |   22 +++
 arch/m68k/include/asm/immap_5307.h |   78 +++++++++++
 arch/m68k/include/asm/m5307.h      |  124 ++++++++++++++++++
 arch/m68k/include/asm/timer.h      |    2 +-
 include/common.h                   |    6 +-
 14 files changed, 876 insertions(+), 5 deletions(-)

Checkpatch says: total: 34 errors, 37 warnings, 911 lines checked

Please cleanup and resubmit. Thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There are very few personal problems that cannot be solved through  a
suitable application of high explosives.