Skip to contentSkip to conversation

ColdFire: Add MCF5441x CPU and MCF54418TWR ColdFire development board support

PATCH New Alison Wang 1 participant 3 messages Oct 19, 2012 m68k architecture

lore
Share & tools
lore
#0 lore raw

cover ColdFire: Add MCF5441x CPU and MCF54418TWR ColdFire development board support

This series contains the support for MCF5441x CPU and MCF54418TWR ColdFire development board.

Alison Wang (2):
ColdFire: Add MCF5441x CPU support
ColdFire: Add Freescale MCF54418TWR ColdFire development board support

 arch/m68k/cpu/mcf5445x/config.mk      |   10 +
 arch/m68k/cpu/mcf5445x/cpu.c          |   17 +
 arch/m68k/cpu/mcf5445x/cpu_init.c     |  313 +++++++++++--
 arch/m68k/cpu/mcf5445x/speed.c        |   80 +++-
 arch/m68k/cpu/mcf5445x/start.S        |  273 ++++++++++-
 arch/m68k/include/asm/cache.h         |   11 +-
 arch/m68k/include/asm/immap.h         |   43 ++-
 arch/m68k/include/asm/immap_5441x.h   |  387 ++++++++++++++
 arch/m68k/include/asm/m5441x.h        |  887 +++++++++++++++++++++++++++++++++
 board/freescale/m54418twr/Makefile    |   43 ++
 board/freescale/m54418twr/config.mk   |   25 +
 board/freescale/m54418twr/m54418twr.c |  130 +++++
 board/freescale/m54418twr/u-boot.lds  |   97 ++++
 boards.cfg                            |    6 +
 doc/README.m54418twr                  |  245 +++++++++
 include/configs/M54418TWR.h           |  448 +++++++++++++++++
 16 files changed, 2961 insertions(+), 54 deletions(-)
 create mode 100644 arch/m68k/include/asm/immap_5441x.h
 create mode 100644 arch/m68k/include/asm/m5441x.h
 create mode 100644 board/freescale/m54418twr/Makefile
 create mode 100644 board/freescale/m54418twr/config.mk
 create mode 100644 board/freescale/m54418twr/m54418twr.c
 create mode 100644 board/freescale/m54418twr/u-boot.lds
 create mode 100644 doc/README.m54418twr
 create mode 100644 include/configs/M54418TWR.h
#1 lore raw

PATCH 1/2 ColdFire: Add MCF5441x CPU support

Add MCF5441x CPU support.

The MCF5441x devices are a family of highly-integrated 32-bit microprocessors based on the Version 4m ColdFire microarchitecture, comprising of the V4 integer core, memory management unit(MMU) and enchanced multiply-accumulate unit(EMAC).

---
 arch/m68k/cpu/mcf5445x/config.mk    |   10 +
 arch/m68k/cpu/mcf5445x/cpu.c        |   17 +
 arch/m68k/cpu/mcf5445x/cpu_init.c   |  313 +++++++++++--
 arch/m68k/cpu/mcf5445x/speed.c      |   80 +++-
 arch/m68k/cpu/mcf5445x/start.S      |  273 +++++++++++-
 arch/m68k/include/asm/cache.h       |   11 +-
 arch/m68k/include/asm/immap.h       |   43 ++-
 arch/m68k/include/asm/immap_5441x.h |  387 +++++++++++++++
 arch/m68k/include/asm/m5441x.h      |  887 +++++++++++++++++++++++++++++++++++
 9 files changed, 1967 insertions(+), 54 deletions(-)
 create mode 100644 arch/m68k/include/asm/immap_5441x.h
 create mode 100644 arch/m68k/include/asm/m5441x.h
arch/m68k/cpu/mcf5445x/config.mk +10 -0
index 61a731e..0c48783 100644
@@ -4,6 +4,8 @@
 # (C) Copyright 2000-2004
 # Wolfgang Denk, DENX Software Engineering, wd at denx.de.
 #
+# Copyright 2011-2012 Freescale Semiconductor, Inc.
+#
 # See file CREDITS for list of people who contributed to this
 # project.
 #
@@ -24,7 +26,15 @@
 #
 
 PLATFORM_RELFLAGS += -ffixed-d7 -msep-data
+
+cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
+is5441x:=$(shell grep CONFIG_MCF5441x $(TOPDIR)/include/$(cfg))
+
+ifneq (,$(findstring CONFIG_MCF5441x,$(is5441x)))
+PLATFORM_CPPFLAGS += -mcpu=54418 -fPIC
+else
 PLATFORM_CPPFLAGS += -mcpu=54455 -fPIC
+endif
 
 ifneq (,$(findstring -linux-,$(shell $(CC) --version)))
 ifneq (,$(findstring GOT,$(shell $(LD) --help)))
arch/m68k/cpu/mcf5445x/cpu.c +17 -0
index adfc708..b612cda 100644
@@ -39,6 +39,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	rcm_t *rcm = (rcm_t *) (MMAP_RCM);
 	udelay(1000);
+	out_8(&rcm->rcr, RCM_RCR_FRCRSTOUT);
+	udelay(10000);
 	setbits_8(&rcm->rcr, RCM_RCR_SOFTRST);
 
 	/* we don't return! */
@@ -74,6 +76,21 @@ int checkcpu(void)
 	case 0x4f:
 		id = 54450;
 		break;
+	case 0x9F:
+		id = 54410;
+		break;
+	case 0xA0:
+		id = 54415;
+		break;
+	case 0xA1:
+		id = 54416;
+		break;
+	case 0xA2:
+		id = 54417;
+		break;
+	case 0xA3:
+		id = 54418;
+		break;
 	}
 
 	if (id) {
arch/m68k/cpu/mcf5445x/cpu_init.c +280 -33

394 lines not on this page · raw message

arch/m68k/cpu/mcf5445x/speed.c +76 -4

102 lines not on this page · raw message

arch/m68k/cpu/mcf5445x/start.S +263 -10

385 lines not on this page · raw message

arch/m68k/include/asm/cache.h +5 -6
index 5c9bb30..f9e2d15 100644
@@ -1,7 +1,7 @@
 /*
  * ColdFire cache
  *
- * Copyright (C) 2004-2010 Freescale Semiconductor, Inc.
+ * Copyright 2004-2012 Freescale Semiconductor, Inc.
  * TsiChung Liew (Tsi-Chung.Liew at freescale.com)
  *
  * See file CREDITS for list of people who contributed to this
@@ -37,10 +37,9 @@
 
 #if defined(CONFIG_MCF547x_8x) || defined(CONFIG_MCF5445x)
 #define CONFIG_CF_V4
-#if defined(CONFIG_MCF5441x)
+#elif defined(CONFIG_MCF5441x)
 #define CONFIG_CF_V4E		/* Four Extra ACRn */
 #endif
-#endif
 
 /* ***** CACR ***** */
 /* V2 Core */
@@ -87,7 +86,7 @@
 #endif				/* CONFIG_CF_V3 */
 
 /* V4 Core */
-#ifdef CONFIG_CF_V4
+#if defined(CONFIG_CF_V4) || defined(CONFIG_CF_V4E)
 
 #define CF_CACR_DEC		(1 << 31)
 #define CF_CACR_DW		(1 << 30)
@@ -113,7 +112,7 @@
 #define CF_CACR_IDSP		(1 << 7)
 #define CF_CACR_EUSP		(1 << 5)
 
-#ifdef CONFIG_MCF5445x
+#if defined(CONFIG_MCF5445x) || defined(CONFIG_MCF5441x)
 #define CF_CACR_IVO		(1 << 20)
 #define CF_CACR_SPA		(1 << 14)
 #else
@@ -148,7 +147,7 @@
 #endif				/* CONFIG_CF_V2 */
 
 /* V4 Core */
-#ifdef CONFIG_CF_V4
+#if defined(CONFIG_CF_V4) || defined(CONFIG_CF_V4E)
 #define CF_ACR_AMM		(1 << 10)
 #define CF_ACR_SP		(1 << 3)
 #endif				/* CONFIG_CF_V4 */
arch/m68k/include/asm/immap.h +42 -1

55 lines not on this page · raw message

arch/m68k/include/asm/immap_5441x.h new file +387 -0

387 lines not on this page · raw message

arch/m68k/include/asm/m5441x.h new file +887 -0

887 lines not on this page · raw message

Signature · 1 line
1.6.4
#2 lore raw

PATCH 2/2 ColdFire: Add Freescale MCF54418TWR ColdFire development board support

Add Freescale MCF54418TWR ColdFire development board support.

---
 board/freescale/m54418twr/Makefile    |   43 ++++
 board/freescale/m54418twr/config.mk   |   25 ++
 board/freescale/m54418twr/m54418twr.c |  130 ++++++++++
 board/freescale/m54418twr/u-boot.lds  |   97 +++++++
 boards.cfg                            |    6 +
 doc/README.m54418twr                  |  245 ++++++++++++++++++
 include/configs/M54418TWR.h           |  448 +++++++++++++++++++++++++++++++++
 7 files changed, 994 insertions(+), 0 deletions(-)
 create mode 100644 board/freescale/m54418twr/Makefile
 create mode 100644 board/freescale/m54418twr/config.mk
 create mode 100644 board/freescale/m54418twr/m54418twr.c
 create mode 100644 board/freescale/m54418twr/u-boot.lds
 create mode 100644 doc/README.m54418twr
 create mode 100644 include/configs/M54418TWR.h
board/freescale/m54418twr/Makefile new file +43 -0
new file mode 100644
index 0000000..1e53f48
@@ -0,0 +1,43 @@
+# Copyright 2010-2012 Freescale Semiconductor, Inc.
+# TsiChung Liew (Tsi-Chung.Liew at freescale.com)
+#
+# 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
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS	= $(BOARD).o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
board/freescale/m54418twr/config.mk new file +25 -0
new file mode 100644
index 0000000..a592335
@@ -0,0 +1,25 @@
+# Copyright 2010-2012 Freescale Semiconductor, Inc.
+# TsiChung Liew (Tsi-Chung.Liew at freescale.com)
+#
+# 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
+#
+
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
board/freescale/m54418twr/m54418twr.c new file +130 -0

130 lines not on this page · raw message

board/freescale/m54418twr/u-boot.lds new file +97 -0

97 lines not on this page · raw message

boards.cfg +6 -0
index df62251..ad455d7 100644
@@ -379,6 +379,12 @@ M53017EVB                    m68k        mcf532x     m53017evb           freesca
 M5329AFEE                    m68k        mcf532x     m5329evb            freescale      -           M5329EVB:NANDFLASH_SIZE=0
 M5329BFEE                    m68k        mcf532x     m5329evb            freescale      -           M5329EVB:NANDFLASH_SIZE=16
 M5373EVB                     m68k        mcf532x     m5373evb            freescale      -           M5373EVB:NANDFLASH_SIZE=16
+M54418TWR                    m68k        mcf5445x    m54418twr           freescale      -           M54418TWR:CF_SBF,SYS_SERIAL_BOOT,SYS_TEXT_BASE=0x47E00000,SYS_INPUT_CLKSRC=50000000
+M54418TWR_nand_mii           m68k        mcf5445x    m54418twr           freescale      -           M54418TWR:SYS_NAND_BOOT,SYS_TEXT_BASE=0x47E00000,SYS_INPUT_CLKSRC=25000000
+M54418TWR_nand_rmii          m68k        mcf5445x    m54418twr           freescale      -           M54418TWR:SYS_NAND_BOOT,SYS_TEXT_BASE=0x47E00000,SYS_INPUT_CLKSRC=50000000
+M54418TWR_nand_rmii_lowfreq  m68k        mcf5445x    m54418twr           freescale      -           M54418TWR:SYS_NAND_BOOT,LOW_MCFCLK,SYS_TEXT_BASE=0x47E00000,SYS_INPUT_CLKSRC=50000000
+M54418TWR_serial_mii         m68k        mcf5445x    m54418twr           freescale      -           M54418TWR:CF_SBF,SYS_SERIAL_BOOT,SYS_TEXT_BASE=0x47E00000,SYS_INPUT_CLKSRC=25000000
+M54418TWR_serial_rmii        m68k        mcf5445x    m54418twr           freescale      -           M54418TWR:CF_SBF,SYS_SERIAL_BOOT,SYS_TEXT_BASE=0x47E00000,SYS_INPUT_CLKSRC=50000000
 M54451EVB                    m68k        mcf5445x    m54451evb           freescale      -           M54451EVB:SYS_TEXT_BASE=0x00000000,SYS_INPUT_CLKSRC=24000000
 M54451EVB_stmicro            m68k        mcf5445x    m54451evb           freescale      -           M54451EVB:CF_SBF,SYS_STMICRO_BOOT,SYS_TEXT_BASE=0x47e00000,SYS_INPUT_CLKSRC=24000000
 M54455EVB                    m68k        mcf5445x    m54455evb           freescale      -           M54455EVB:SYS_ATMEL_BOOT,SYS_TEXT_BASE=0x04000000,SYS_INPUT_CLKSRC=33333333
doc/README.m54418twr new file +245 -0

245 lines not on this page · raw message

include/configs/M54418TWR.h new file +448 -0

448 lines not on this page · raw message

Signature · 1 line
1.6.4