From 136f148f61fb7d53f104abcf827a90bf8fa6c8f7 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Tue, 17 Apr 2012 15:36:11 +1000 Subject: m68knommu: move the 5307 platform code into the common ColdFire code directory All these separate directories for each ColdFire CPU SoC varient seems like overkill. The majority of them only contain a single small config file. Move these into the common ColdFire code directory. Signed-off-by: Greg Ungerer --- arch/m68k/Makefile | 1 - arch/m68k/platform/5307/Makefile | 20 ----- arch/m68k/platform/5307/config.c | 67 --------------- arch/m68k/platform/5307/nettel.c | 153 ----------------------------------- arch/m68k/platform/coldfire/Makefile | 5 +- arch/m68k/platform/coldfire/m5307.c | 67 +++++++++++++++ arch/m68k/platform/coldfire/nettel.c | 153 +++++++++++++++++++++++++++++++++++ 7 files changed, 224 insertions(+), 242 deletions(-) delete mode 100644 arch/m68k/platform/5307/Makefile delete mode 100644 arch/m68k/platform/5307/config.c delete mode 100644 arch/m68k/platform/5307/nettel.c create mode 100644 arch/m68k/platform/coldfire/m5307.c create mode 100644 arch/m68k/platform/coldfire/nettel.c (limited to 'arch/m68k') diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile index 65f5844225cf..02626a32c15f 100644 --- a/arch/m68k/Makefile +++ b/arch/m68k/Makefile @@ -115,7 +115,6 @@ core-$(CONFIG_M68000) += arch/m68k/platform/68328/ core-$(CONFIG_M68EZ328) += arch/m68k/platform/68EZ328/ core-$(CONFIG_M68VZ328) += arch/m68k/platform/68VZ328/ core-$(CONFIG_COLDFIRE) += arch/m68k/platform/coldfire/ -core-$(CONFIG_M5307) += arch/m68k/platform/5307/ core-$(CONFIG_M532x) += arch/m68k/platform/532x/ core-$(CONFIG_M5407) += arch/m68k/platform/5407/ core-$(CONFIG_M54xx) += arch/m68k/platform/54xx/ diff --git a/arch/m68k/platform/5307/Makefile b/arch/m68k/platform/5307/Makefile deleted file mode 100644 index fd08186a173a..000000000000 --- a/arch/m68k/platform/5307/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# -# Makefile for the m68knommu kernel. -# - -# -# If you want to play with the HW breakpoints then you will -# need to add define this, which will give you a stack backtrace -# on the console port whenever a DBG interrupt occurs. You have to -# set up you HW breakpoints to trigger a DBG interrupt: -# -# ccflags-y := -DTRAP_DBG_INTERRUPT -# asflags-y := -DTRAP_DBG_INTERRUPT -# - -asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 - -obj-y += config.o -obj-$(CONFIG_NETtel) += nettel.o -obj-$(CONFIG_CLEOPATRA) += nettel.o - diff --git a/arch/m68k/platform/5307/config.c b/arch/m68k/platform/5307/config.c deleted file mode 100644 index 93b484976ab3..000000000000 --- a/arch/m68k/platform/5307/config.c +++ /dev/null @@ -1,67 +0,0 @@ -/***************************************************************************/ - -/* - * linux/arch/m68knommu/platform/5307/config.c - * - * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com) - * Copyright (C) 2000, Lineo (www.lineo.com) - */ - -/***************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/***************************************************************************/ - -/* - * Some platforms need software versions of the GPIO data registers. - */ -unsigned short ppdata; -unsigned char ledbank = 0xff; - -/***************************************************************************/ - -struct mcf_gpio_chip mcf_gpio_chips[] = { - MCFGPS(PP, 0, 16, MCFSIM_PADDR, MCFSIM_PADAT, MCFSIM_PADAT), -}; - -unsigned int mcf_gpio_chips_size = ARRAY_SIZE(mcf_gpio_chips); - -/***************************************************************************/ - -void __init config_BSP(char *commandp, int size) -{ -#if defined(CONFIG_NETtel) || \ - defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA) - /* Copy command line from FLASH to local buffer... */ - memcpy(commandp, (char *) 0xf0004000, size); - commandp[size-1] = 0; -#endif - - mach_sched_init = hw_timer_init; - - /* Only support the external interrupts on their primary level */ - mcf_mapirq2imr(25, MCFINTC_EINT1); - mcf_mapirq2imr(27, MCFINTC_EINT3); - mcf_mapirq2imr(29, MCFINTC_EINT5); - mcf_mapirq2imr(31, MCFINTC_EINT7); - -#ifdef CONFIG_BDM_DISABLE - /* - * Disable the BDM clocking. This also turns off most of the rest of - * the BDM device. This is good for EMC reasons. This option is not - * incompatible with the memory protection option. - */ - wdebug(MCFDEBUG_CSR, MCFDEBUG_CSR_PSTCLK); -#endif -} - -/***************************************************************************/ diff --git a/arch/m68k/platform/5307/nettel.c b/arch/m68k/platform/5307/nettel.c deleted file mode 100644 index e925ea4602f8..000000000000 --- a/arch/m68k/platform/5307/nettel.c +++ /dev/null @@ -1,153 +0,0 @@ -/***************************************************************************/ - -/* - * nettel.c -- startup code support for the NETtel boards - * - * Copyright (C) 2009, Greg Ungerer (gerg@snapgear.com) - */ - -/***************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -/***************************************************************************/ - -/* - * Define the IO and interrupt resources of the 2 SMC9196 interfaces. - */ -#define NETTEL_SMC0_ADDR 0x30600300 -#define NETTEL_SMC0_IRQ 29 - -#define NETTEL_SMC1_ADDR 0x30600000 -#define NETTEL_SMC1_IRQ 27 - -/* - * We need some access into the SMC9196 registers. Define those registers - * we will need here (including the smc91x.h doesn't seem to give us these - * in a simple form). - */ -#define SMC91xx_BANKSELECT 14 -#define SMC91xx_BASEADDR 2 -#define SMC91xx_BASEMAC 4 - -/***************************************************************************/ - -static struct resource nettel_smc91x_0_resources[] = { - { - .start = NETTEL_SMC0_ADDR, - .end = NETTEL_SMC0_ADDR + 0x20, - .flags = IORESOURCE_MEM, - }, - { - .start = NETTEL_SMC0_IRQ, - .end = NETTEL_SMC0_IRQ, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct resource nettel_smc91x_1_resources[] = { - { - .start = NETTEL_SMC1_ADDR, - .end = NETTEL_SMC1_ADDR + 0x20, - .flags = IORESOURCE_MEM, - }, - { - .start = NETTEL_SMC1_IRQ, - .end = NETTEL_SMC1_IRQ, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device nettel_smc91x[] = { - { - .name = "smc91x", - .id = 0, - .num_resources = ARRAY_SIZE(nettel_smc91x_0_resources), - .resource = nettel_smc91x_0_resources, - }, - { - .name = "smc91x", - .id = 1, - .num_resources = ARRAY_SIZE(nettel_smc91x_1_resources), - .resource = nettel_smc91x_1_resources, - }, -}; - -static struct platform_device *nettel_devices[] __initdata = { - &nettel_smc91x[0], - &nettel_smc91x[1], -}; - -/***************************************************************************/ - -static u8 nettel_macdefault[] __initdata = { - 0x00, 0xd0, 0xcf, 0x00, 0x00, 0x01, -}; - -/* - * Set flash contained MAC address into SMC9196 core. Make sure the flash - * MAC address is sane, and not an empty flash. If no good use the Moreton - * Bay default MAC address instead. - */ - -static void __init nettel_smc91x_setmac(unsigned int ioaddr, unsigned int flashaddr) -{ - u16 *macp; - - macp = (u16 *) flashaddr; - if ((macp[0] == 0xffff) && (macp[1] == 0xffff) && (macp[2] == 0xffff)) - macp = (u16 *) &nettel_macdefault[0]; - - writew(1, NETTEL_SMC0_ADDR + SMC91xx_BANKSELECT); - writew(macp[0], ioaddr + SMC91xx_BASEMAC); - writew(macp[1], ioaddr + SMC91xx_BASEMAC + 2); - writew(macp[2], ioaddr + SMC91xx_BASEMAC + 4); -} - -/***************************************************************************/ - -/* - * Re-map the address space of at least one of the SMC ethernet - * parts. Both parts power up decoding the same address, so we - * need to move one of them first, before doing anything else. - */ - -static void __init nettel_smc91x_init(void) -{ - writew(0x00ec, MCF_MBAR + MCFSIM_PADDR); - mcf_setppdata(0, 0x0080); - writew(1, NETTEL_SMC0_ADDR + SMC91xx_BANKSELECT); - writew(0x0067, NETTEL_SMC0_ADDR + SMC91xx_BASEADDR); - mcf_setppdata(0x0080, 0); - - /* Set correct chip select timing for SMC9196 accesses */ - writew(0x1180, MCF_MBAR + MCFSIM_CSCR3); - - /* Set the SMC interrupts to be auto-vectored */ - mcf_autovector(NETTEL_SMC0_IRQ); - mcf_autovector(NETTEL_SMC1_IRQ); - - /* Set MAC addresses from flash for both interfaces */ - nettel_smc91x_setmac(NETTEL_SMC0_ADDR, 0xf0006000); - nettel_smc91x_setmac(NETTEL_SMC1_ADDR, 0xf0006006); -} - -/***************************************************************************/ - -static int __init init_nettel(void) -{ - nettel_smc91x_init(); - platform_add_devices(nettel_devices, ARRAY_SIZE(nettel_devices)); - return 0; -} - -arch_initcall(init_nettel); - -/***************************************************************************/ diff --git a/arch/m68k/platform/coldfire/Makefile b/arch/m68k/platform/coldfire/Makefile index cdd884e49f43..bfe71e0be215 100644 --- a/arch/m68k/platform/coldfire/Makefile +++ b/arch/m68k/platform/coldfire/Makefile @@ -23,10 +23,13 @@ obj-$(CONFIG_M5249) += m5249.o timers.o intc.o intc-5249.o reset.o 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) += timers.o intc.o reset.o +obj-$(CONFIG_M5307) += m5307.o timers.o intc.o reset.o obj-$(CONFIG_M532x) += timers.o intc-simr.o reset.o obj-$(CONFIG_M5407) += timers.o intc.o reset.o obj-$(CONFIG_M54xx) += sltimers.o intc-2.o +obj-$(CONFIG_NETtel) += nettel.o +obj-$(CONFIG_CLEOPATRA) += nettel.o + obj-y += pinmux.o gpio.o extra-y := head.o diff --git a/arch/m68k/platform/coldfire/m5307.c b/arch/m68k/platform/coldfire/m5307.c new file mode 100644 index 000000000000..93b484976ab3 --- /dev/null +++ b/arch/m68k/platform/coldfire/m5307.c @@ -0,0 +1,67 @@ +/***************************************************************************/ + +/* + * linux/arch/m68knommu/platform/5307/config.c + * + * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com) + * Copyright (C) 2000, Lineo (www.lineo.com) + */ + +/***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/***************************************************************************/ + +/* + * Some platforms need software versions of the GPIO data registers. + */ +unsigned short ppdata; +unsigned char ledbank = 0xff; + +/***************************************************************************/ + +struct mcf_gpio_chip mcf_gpio_chips[] = { + MCFGPS(PP, 0, 16, MCFSIM_PADDR, MCFSIM_PADAT, MCFSIM_PADAT), +}; + +unsigned int mcf_gpio_chips_size = ARRAY_SIZE(mcf_gpio_chips); + +/***************************************************************************/ + +void __init config_BSP(char *commandp, int size) +{ +#if defined(CONFIG_NETtel) || \ + defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA) + /* Copy command line from FLASH to local buffer... */ + memcpy(commandp, (char *) 0xf0004000, size); + commandp[size-1] = 0; +#endif + + mach_sched_init = hw_timer_init; + + /* Only support the external interrupts on their primary level */ + mcf_mapirq2imr(25, MCFINTC_EINT1); + mcf_mapirq2imr(27, MCFINTC_EINT3); + mcf_mapirq2imr(29, MCFINTC_EINT5); + mcf_mapirq2imr(31, MCFINTC_EINT7); + +#ifdef CONFIG_BDM_DISABLE + /* + * Disable the BDM clocking. This also turns off most of the rest of + * the BDM device. This is good for EMC reasons. This option is not + * incompatible with the memory protection option. + */ + wdebug(MCFDEBUG_CSR, MCFDEBUG_CSR_PSTCLK); +#endif +} + +/***************************************************************************/ diff --git a/arch/m68k/platform/coldfire/nettel.c b/arch/m68k/platform/coldfire/nettel.c new file mode 100644 index 000000000000..e925ea4602f8 --- /dev/null +++ b/arch/m68k/platform/coldfire/nettel.c @@ -0,0 +1,153 @@ +/***************************************************************************/ + +/* + * nettel.c -- startup code support for the NETtel boards + * + * Copyright (C) 2009, Greg Ungerer (gerg@snapgear.com) + */ + +/***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include + +/***************************************************************************/ + +/* + * Define the IO and interrupt resources of the 2 SMC9196 interfaces. + */ +#define NETTEL_SMC0_ADDR 0x30600300 +#define NETTEL_SMC0_IRQ 29 + +#define NETTEL_SMC1_ADDR 0x30600000 +#define NETTEL_SMC1_IRQ 27 + +/* + * We need some access into the SMC9196 registers. Define those registers + * we will need here (including the smc91x.h doesn't seem to give us these + * in a simple form). + */ +#define SMC91xx_BANKSELECT 14 +#define SMC91xx_BASEADDR 2 +#define SMC91xx_BASEMAC 4 + +/***************************************************************************/ + +static struct resource nettel_smc91x_0_resources[] = { + { + .start = NETTEL_SMC0_ADDR, + .end = NETTEL_SMC0_ADDR + 0x20, + .flags = IORESOURCE_MEM, + }, + { + .start = NETTEL_SMC0_IRQ, + .end = NETTEL_SMC0_IRQ, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct resource nettel_smc91x_1_resources[] = { + { + .start = NETTEL_SMC1_ADDR, + .end = NETTEL_SMC1_ADDR + 0x20, + .flags = IORESOURCE_MEM, + }, + { + .start = NETTEL_SMC1_IRQ, + .end = NETTEL_SMC1_IRQ, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device nettel_smc91x[] = { + { + .name = "smc91x", + .id = 0, + .num_resources = ARRAY_SIZE(nettel_smc91x_0_resources), + .resource = nettel_smc91x_0_resources, + }, + { + .name = "smc91x", + .id = 1, + .num_resources = ARRAY_SIZE(nettel_smc91x_1_resources), + .resource = nettel_smc91x_1_resources, + }, +}; + +static struct platform_device *nettel_devices[] __initdata = { + &nettel_smc91x[0], + &nettel_smc91x[1], +}; + +/***************************************************************************/ + +static u8 nettel_macdefault[] __initdata = { + 0x00, 0xd0, 0xcf, 0x00, 0x00, 0x01, +}; + +/* + * Set flash contained MAC address into SMC9196 core. Make sure the flash + * MAC address is sane, and not an empty flash. If no good use the Moreton + * Bay default MAC address instead. + */ + +static void __init nettel_smc91x_setmac(unsigned int ioaddr, unsigned int flashaddr) +{ + u16 *macp; + + macp = (u16 *) flashaddr; + if ((macp[0] == 0xffff) && (macp[1] == 0xffff) && (macp[2] == 0xffff)) + macp = (u16 *) &nettel_macdefault[0]; + + writew(1, NETTEL_SMC0_ADDR + SMC91xx_BANKSELECT); + writew(macp[0], ioaddr + SMC91xx_BASEMAC); + writew(macp[1], ioaddr + SMC91xx_BASEMAC + 2); + writew(macp[2], ioaddr + SMC91xx_BASEMAC + 4); +} + +/***************************************************************************/ + +/* + * Re-map the address space of at least one of the SMC ethernet + * parts. Both parts power up decoding the same address, so we + * need to move one of them first, before doing anything else. + */ + +static void __init nettel_smc91x_init(void) +{ + writew(0x00ec, MCF_MBAR + MCFSIM_PADDR); + mcf_setppdata(0, 0x0080); + writew(1, NETTEL_SMC0_ADDR + SMC91xx_BANKSELECT); + writew(0x0067, NETTEL_SMC0_ADDR + SMC91xx_BASEADDR); + mcf_setppdata(0x0080, 0); + + /* Set correct chip select timing for SMC9196 accesses */ + writew(0x1180, MCF_MBAR + MCFSIM_CSCR3); + + /* Set the SMC interrupts to be auto-vectored */ + mcf_autovector(NETTEL_SMC0_IRQ); + mcf_autovector(NETTEL_SMC1_IRQ); + + /* Set MAC addresses from flash for both interfaces */ + nettel_smc91x_setmac(NETTEL_SMC0_ADDR, 0xf0006000); + nettel_smc91x_setmac(NETTEL_SMC1_ADDR, 0xf0006006); +} + +/***************************************************************************/ + +static int __init init_nettel(void) +{ + nettel_smc91x_init(); + platform_add_devices(nettel_devices, ARRAY_SIZE(nettel_devices)); + return 0; +} + +arch_initcall(init_nettel); + +/***************************************************************************/ -- cgit