m68knommu: add support for ColdFire 5373 CPU family
cover m68knommu: add support for ColdFire 5373 CPU family
The following patches add support for the ColdFire 5373 CPU family. At this stage it is very much an RFC really, I don't have any 5373 hardware to even test it on.
It is based on ideas taken from Gachet Daniel's patch set that added support for the M5373EVB. But these patches are quite different. I could see from his changes that the 5373 CPU family is very similar to the 532x family. So these patches morph the current 532x CPU family support to be able to also support the 5373 family.
Would be really great if someone could actually test that these work.
PATCH 1/4 m68knommu: create and use a common M53xx ColdFire class of CPUs
From: Greg Ungerer <[email protected]>
The current CONFIG_M532x support definitions are actually common to a larger set of version 3 ColdFire CPU types. In the future we want to add support for the 537x family. It is very similar to the 532x internally, and will be able to use most of the same definitions.
Create a CONFIG_M53xx option that is enabled to support any of the common 532x and 537x CPU types. Convert the current users of CONFIG_M532x to use CONFIG_M53xx instead.
---
arch/m68k/Kconfig.cpu | 4 ++++
arch/m68k/include/asm/dma.h | 2 +-
arch/m68k/include/asm/m53xxacr.h | 4 ++--
arch/m68k/include/asm/{m532xsim.h => m53xxsim.h} | 10 +++++-----
arch/m68k/include/asm/mcfgpio.h | 10 +++++-----
arch/m68k/include/asm/mcfsim.h | 4 ++--
arch/m68k/include/asm/mcftimer.h | 2 +-
arch/m68k/platform/coldfire/timers.c | 2 +-
8 files changed, 21 insertions(+), 17 deletions(-)
rename arch/m68k/include/asm/{m532xsim.h => m53xxsim.h} (99%)arch/m68k/Kconfig.cpu +4 -0
@@ -223,9 +223,13 @@ config M5307 help Motorola ColdFire 5307 processor support. +config M53xx + bool + config M532x bool "MCF532x" depends on !MMU + select M53xx select HAVE_CACHE_CB help Freescale (Motorola) ColdFire 532x processor support.
arch/m68k/include/asm/dma.h +1 -1
@@ -39,7 +39,7 @@#define MAX_M68K_DMA_CHANNELS 4#elif defined(CONFIG_M5272 )#define MAX_M68K_DMA_CHANNELS 1 -#elif defined(CONFIG_M532x) +#elif defined(CONFIG_M53xx)#define MAX_M68K_DMA_CHANNELS 0#else #define MAX_M68K_DMA_CHANNELS 2
arch/m68k/include/asm/m53xxacr.h +2 -2
@@ -55,8 +55,8 @@#define CACHE_SIZE 0x2000/* 8k of unified cache */ #define ICACHE_SIZE CACHE_SIZE#define DCACHE_SIZE CACHE_SIZE -#elif defined(CONFIG_M532x) -#define CACHE_SIZE 0x4000/* 32k of unified cache */ +#elif defined(CONFIG_M53xx) +#define CACHE_SIZE 0x4000/* 16k of unified cache */ #define ICACHE_SIZE CACHE_SIZE#define DCACHE_SIZE CACHE_SIZE#endif
arch/m68k/include/asm/m53xxsim.h renamed from arch/m68k/include/asm/m532xsim.h +5 -5
@@ -1,15 +1,15 @@/****************************************************************************/ /* -* m532xsim.h -- ColdFire 5329 registers +* m53xxsim.h -- ColdFire 5329 registers */ /****************************************************************************/ -#ifndef m532xsim_h -#define m532xsim_h +#ifndef m53xxsim_h +#define m53xxsim_h/****************************************************************************/ -#define CPU_NAME "COLDFIRE(m532x)" +#define CPU_NAME "COLDFIRE(m53xx)"#define CPU_INSTR_PER_JIFFY 3#define MCF_BUSCLK (MCF_CLK / 3)
@@ -1238,4 +1238,4 @@#define MCFEPORT_EPFR (0xFC094006)/********************************************************************/ -#endif /* m532xsim_h */ +#endif /* m53xxsim_h */
arch/m68k/include/asm/mcfgpio.h +5 -5
@@ -104,7 +104,7 @@ static inline void gpio_free(unsigned gpio)#if defined(CONFIG_M5206 ) || defined(CONFIG_M5206e) || \ defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ - defined(CONFIG_M532x) || defined(CONFIG_M54xx) || \ + defined(CONFIG_M53xx) || defined(CONFIG_M54xx) || \ defined(CONFIG_M5441x)/* These parts have GPIO organized by 8 bit ports */
@@ -139,7 +139,7 @@ static inline void gpio_free(unsigned gpio)#if defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ - defined(CONFIG_M532x) || defined(CONFIG_M5441x) + defined(CONFIG_M53xx) || defined(CONFIG_M5441x)/* * These parts have an 'Edge' Port module (external interrupt/GPIO) which uses * read-modify-write to change an output and a GPIO module which has separate
@@ -195,7 +195,7 @@ static inline u32 __mcfgpio_ppdr(unsigned gpio)return MCFSIM2_GPIO1READ ;#elif defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ - defined(CONFIG_M532x) || defined(CONFIG_M5441x) + defined(CONFIG_M53xx) || defined(CONFIG_M5441x)#if !defined(CONFIG_M5441x)if (gpio <8 )return MCFEPORT_EPPDR ;
@@ -237,7 +237,7 @@ static inline u32 __mcfgpio_podr(unsigned gpio)return MCFSIM2_GPIO1WRITE ;#elif defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ - defined(CONFIG_M532x) || defined(CONFIG_M5441x) + defined(CONFIG_M53xx) || defined(CONFIG_M5441x)#if !defined(CONFIG_M5441x)if (gpio <8 )return MCFEPORT_EPDR ;
@@ -279,7 +279,7 @@ static inline u32 __mcfgpio_pddr(unsigned gpio)return MCFSIM2_GPIO1ENABLE ;#elif defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ - defined(CONFIG_M532x) || defined(CONFIG_M5441x) + defined(CONFIG_M53xx) || defined(CONFIG_M5441x)#if !defined(CONFIG_M5441x)if (gpio <8 )return MCFEPORT_EPDDR ;
arch/m68k/include/asm/mcfsim.h +2 -2
@@ -36,8 +36,8 @@#elif defined(CONFIG_M5307 )#include <asm/m5307sim.h> #include <asm/mcfintc.h> -#elif defined(CONFIG_M532x) -#include <asm/m532xsim.h> +#elif defined(CONFIG_M53xx) +#include <asm/m53xxsim.h> #elif defined(CONFIG_M5407 )#include <asm/m5407sim.h> #include <asm/mcfintc.h>
arch/m68k/include/asm/mcftimer.h +1 -1
@@ -19,7 +19,7 @@#define MCFTIMER_TRR 0x04/* Timer Reference (r/w) */ #define MCFTIMER_TCR 0x08/* Timer Capture reg (r/w) */ #define MCFTIMER_TCN 0x0C/* Timer Counter reg (r/w) */ -#if defined(CONFIG_M532x) || defined(CONFIG_M5441x) +#if defined(CONFIG_M53xx) || defined(CONFIG_M5441x)#define MCFTIMER_TER 0x03/* Timer Event reg (r/w) */ #else #define MCFTIMER_TER 0x11/* Timer Event reg (r/w) */
arch/m68k/platform/coldfire/timers.c +1 -1
@@ -36,7 +36,7 @@*/ void coldfire_profile_init (void ); -#if defined(CONFIG_M532x) || defined(CONFIG_M5441x) +#if defined(CONFIG_M53xx) || defined(CONFIG_M5441x)#define __raw_readtrr __raw_readl#define __raw_writetrr __raw_writel#else
Signature · 1 line
1.7.0.4
PATCH 2/4 m68knommu: make ColdFire M532x platform support more v3 generic
In reply to [email protected]From: Greg Ungerer <[email protected]>
The M532x CPU platform support can be used on more ColdFire CPU families than just the 532x types. So rename and reconfigure it to reflect that. The ColdFire 537x family has virtualy identical internals to the 532x, and so it will be able to share this code when we add support for them.
---
arch/m68k/platform/coldfire/Makefile | 2 +-
arch/m68k/platform/coldfire/{m532x.c => m53xx.c} | 18 +++++++++---------
2 files changed, 10 insertions(+), 10 deletions(-)
rename arch/m68k/platform/coldfire/{m532x.c => m53xx.c} (98%)arch/m68k/platform/coldfire/Makefile +1 -1
@@ -25,7 +25,7 @@ obj-$(CONFIG_M527x) += m527x.o pit.o intc-2.o reset.o obj-$(CONFIG_M5272) += m5272.o intc-5272.o timers.o obj-$(CONFIG_M528x) += m528x.o pit.o intc-2.o reset.o obj-$(CONFIG_M5307) += m5307.o timers.o intc.o reset.o -obj-$(CONFIG_M532x) += m532x.o timers.o intc-simr.o reset.o +obj-$(CONFIG_M53xx) += m53xx.o timers.o intc-simr.o reset.o obj-$(CONFIG_M5407) += m5407.o timers.o intc.o reset.o obj-$(CONFIG_M54xx) += m54xx.o sltimers.o intc-2.o obj-$(CONFIG_M5441x) += m5441x.o pit.o intc-simr.o reset.o
arch/m68k/platform/coldfire/m53xx.c renamed from arch/m68k/platform/coldfire/m532x.c +9 -9
@@ -1,7 +1,7 @@/***************************************************************************/ /* -* linux/arch/m68knommu/platform/532x/config.c +* m53xx.c -- platform support for ColdFire 53xx based boards * * Copyright (C) 1999-2002, Greg Ungerer ([email protected]) * Copyright (C) 2000, Lineo (www.lineo.com)
@@ -153,7 +153,7 @@ static struct clk * const disable_clks[] __initconst = { }; -static void __init m532x_clk_init (void ) +static void __init m53xx_clk_init (void ) {unsigned i;
@@ -169,7 +169,7 @@ static void __init m532x_clk_init(void)#if IS_ENABLED (CONFIG_SPI_COLDFIRE_QSPI ) -static void __init m532x_qspi_init (void ) +static void __init m53xx_qspi_init (void ) {/* setup QSPS pins for QSPI with gpio CS control */ writew (0x01f0 ,MCFGPIO_PAR_QSPI );
@@ -179,7 +179,7 @@ static void __init m532x_qspi_init(void)/***************************************************************************/ -static void __init m532x_uarts_init (void ) +static void __init m53xx_uarts_init (void ) {/* UART GPIO initialization */ writew (readw (MCFGPIO_PAR_UART ) |0x0FFF ,MCFGPIO_PAR_UART );
@@ -187,7 +187,7 @@ static void __init m532x_uarts_init(void)/***************************************************************************/ -static void __init m532x_fec_init (void ) +static void __init m53xx_fec_init (void ) {u8 v;
@@ -217,11 +217,11 @@ void __init config_BSP(char *commandp, int size) }#endif mach_sched_init = hw_timer_init; -m532x_clk_init (); -m532x_uarts_init (); -m532x_fec_init (); +m53xx_clk_init (); +m53xx_uarts_init (); +m53xx_fec_init ();#if IS_ENABLED (CONFIG_SPI_COLDFIRE_QSPI ) -m532x_qspi_init (); +m53xx_qspi_init ();#endif #ifdef CONFIG_BDM_DISABLE
Signature · 1 line
1.7.0.4
PATCH 3/4 m68knommu: add support for the ColdFire 537x family of CPUs
In reply to [email protected]From: Greg Ungerer <[email protected]>
The ColdFire 537x family is very similar internally to the ColdFire 532x family. So with just a little extra configuration we can configure and target them as well.
--- arch/m68k/Kconfig.cpu | 8 ++++++++ arch/m68k/Makefile | 1 + 2 files changed, 9 insertions(+), 0 deletions(-)
arch/m68k/Kconfig.cpu +8 -0
@@ -234,6 +234,14 @@ config M532x help Freescale (Motorola) ColdFire 532x processor support. +config M537x + bool "MCF537x" + depends on !MMU + select M53xx + select HAVE_CACHE_CB + help + Freescale ColdFire 537x processor support. + config M5407 bool "MCF5407" depends on !MMU
arch/m68k/Makefile +1 -0
@@ -45,6 +45,7 @@ cpuflags-$(CONFIG_M5441x) := $(call cc-option,-mcpu=54455,-mcfv4e) cpuflags-$(CONFIG_M54xx) := $(call cc-option,-mcpu=5475,-m5200) cpuflags-$(CONFIG_M5407) := $(call cc-option,-mcpu=5407,-m5200) cpuflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307) +cpuflags-$(CONFIG_M537x) := $(call cc-option,-mcpu=537x,-m5307) cpuflags-$(CONFIG_M5307) := $(call cc-option,-mcpu=5307,-m5200) cpuflags-$(CONFIG_M528x) := $(call cc-option,-mcpu=528x,-m5307) cpuflags-$(CONFIG_M5275) := $(call cc-option,-mcpu=5275,-m5307)
Signature · 1 line
1.7.0.4
PATCH 4/4 m68knommu: add support for configuring a Freescale M5373EVB board
In reply to [email protected]From: Greg Ungerer <[email protected]>
Add a configuration switch for supporting the Freescale M5373EVB board. It is based on the newly added ColdFire 537x CPU support.
--- arch/m68k/Kconfig.machine | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
arch/m68k/Kconfig.machine +7 -0
@@ -359,6 +359,13 @@ config COBRA5329 help Support for the senTec COBRA5329 board. +config M5373EVB + bool "Freescale M5373EVB board support" + depends on M537x + select FREESCALE + help + Support for the Freescale M5373EVB board. + config M5407C3 bool "Motorola M5407C3 board support" depends on M5407
Signature · 1 line
1.7.0.4