Skip to contentSkip to conversation

amcore: add support for amcore board

PATCH New Angelo Dureghello 1 participant 1 message Jan 22, 2013 m68k architecture

lore
Share & tools
lore
#0 lore raw

PATCH v4 2/2 amcore: add support for amcore board

---
Changes for v2:
- None
Changes for v3:
- Fix code format issues
Changes for v4:
- Added MAINTAINERS file entry
- Removed all unnecessary blank lines
- Added get_ram_size in sdram init
- Reused already existing sdram test routine
- Removed custom flash.c, used std mtd/CFI driver

---
 MAINTAINERS                        |    4 +
 board/sysam/amcore/Makefile        |   43 ++++++
 board/sysam/amcore/amcore.c        |  160 +++++++++++++++++++++
 board/sysam/amcore/config.mk       |   23 +++
 board/sysam/amcore/u-boot.lds      |  101 ++++++++++++++
 boards.cfg                         |    1 +
 include/configs/amcore.h           |  220 +++++++++++++++++++++++++++++
 7 files changed, 552 insertions(+), 0 deletions(-)
MAINTAINERS +4 -0
index 28c052d..1d27cb7 100644
@@ -1137,6 +1137,10 @@ Wolfgang Wegner <[email protected]>
 
 	astro_mcf5373l	MCF5373L
 
+Angelo Dureghello <[email protected]>
+
+	amcore		mcf5307
+
 #########################################################################
 # AVR32 Systems:							#
 #									#
arch/m68k/cpu/mcf530x/Makefile new file +48 -0

48 lines not on this page · raw message

arch/m68k/cpu/mcf530x/config.mk new file +30 -0
new file mode 100644
index 0000000..924cd7f
@@ -0,0 +1,30 @@
+#
+# Copyright (c) 2012 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
+
+cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
+is5307:=$(shell grep CONFIG_M5307 $(TOPDIR)/include/$(cfg))
+
+ifneq (,$(findstring CONFIG_M5307,$(is5307)))
+PLATFORM_CPPFLAGS += -mcpu=5307
+endif
arch/m68k/cpu/mcf530x/cpu.c new file +53 -0

53 lines not on this page · raw message

arch/m68k/cpu/mcf530x/cpu.h new file +33 -0
new file mode 100644
index 0000000..fd47f9a
@@ -0,0 +1,33 @@
+/*
+ *  cpu.h
+ *
+ *  Copyright (c) 2012 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., 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 +175 -0

175 lines not on this page · raw message

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

44 lines not on this page · raw message

arch/m68k/cpu/mcf530x/speed.c new file +38 -0
new file mode 100644
index 0000000..94a8116
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2012 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)
+{
+#if defined(CONFIG_M5307)
+	gd->bus_clk = CONFIG_SYS_CLK;
+	gd->cpu_clk = CONFIG_SYS_CPU_CLK;
+#endif
+
+	return 0;
+}
arch/m68k/cpu/mcf530x/start.S new file +271 -0

271 lines not on this page · raw message

arch/m68k/include/asm/cache.h +2 -1
index f9e2d15..dd932c3 100644
@@ -31,7 +31,8 @@
 #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 +23 -0
index 2aab463..e9bd1e6 100644
@@ -256,6 +256,29 @@
 #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		(in_be32(MMAP_INTC))
+#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 +134 -0

134 lines not on this page · raw message

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

86 lines not on this page · raw message

arch/m68k/include/asm/timer.h +2 -1
index 1a5de05..528bce3 100644
@@ -33,7 +33,8 @@
 /****************************************************************************/
 /* DMA Timer module registers */
 typedef struct dtimer_ctrl {
-#if defined(CONFIG_M5249) || defined(CONFIG_M5253) || defined(CONFIG_M5272)
+#if defined(CONFIG_M5249) || defined(CONFIG_M5253) || \
+    defined(CONFIG_M5272) || defined(CONFIG_M5307)
 	u16 tmr;		/* 0x00 Mode register */
 	u16 res1;		/* 0x02 */
 	u16 trr;		/* 0x04 Reference register */
arch/m68k/lib/time.c +1 -0
index a0e2441..7476970 100644
@@ -27,6 +27,7 @@
 
 #include <asm/timer.h>
 #include <asm/immap.h>
+#include <asm/io.h>
 #include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;
board/sysam/amcore/Makefile new file +43 -0

43 lines not on this page · raw message

board/sysam/amcore/amcore.c new file +159 -0

159 lines not on this page · raw message

board/sysam/amcore/config.mk new file +23 -0
new file mode 100644
index 0000000..cb45c2c
@@ -0,0 +1,23 @@
+#
+# 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
+#
+
+CONFIG_SYS_TEXT_BASE = 0xffc00000
board/sysam/amcore/u-boot.lds new file +101 -0

101 lines not on this page · raw message

boards.cfg +1 -0
index e4b0d44..6e9b952 100644
@@ -388,6 +388,7 @@ M5271EVB                     m68k        mcf52x2     m5271evb            freesca
 M5272C3                      m68k        mcf52x2     m5272c3             freescale
 M5275EVB                     m68k        mcf52x2     m5275evb            freescale
 M5282EVB                     m68k        mcf52x2     m5282evb            freescale
+amcore                       m68k        mcf530x     amcore              sysam
 astro_mcf5373l               m68k        mcf532x     mcf5373l            astro
 M53017EVB                    m68k        mcf532x     m53017evb           freescale
 M5329AFEE                    m68k        mcf532x     m5329evb            freescale      -           M5329EVB:NANDFLASH_SIZE=0
include/configs/amcore.h new file +220 -0

220 lines not on this page · raw message