diff options
author | Greg Ungerer <gerg@uclinux.org> | 2012-04-17 01:41:02 -0400 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2012-05-20 07:22:07 -0400 |
commit | 453549d2e511a8490e04f91b084aa418f9f4e5d2 (patch) | |
tree | cf2438a853b3094ea1f79e86bffdd41d158beb04 /arch/m68k/platform/coldfire | |
parent | e33e73f560fcd612603b915357e5931d2217b1b2 (diff) |
m68knommu: move the 54xx 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 <gerg@uclinux.org>
Diffstat (limited to 'arch/m68k/platform/coldfire')
-rw-r--r-- | arch/m68k/platform/coldfire/Makefile | 3 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/firebee.c | 86 | ||||
-rw-r--r-- | arch/m68k/platform/coldfire/m54xx.c | 112 |
3 files changed, 200 insertions, 1 deletions
diff --git a/arch/m68k/platform/coldfire/Makefile b/arch/m68k/platform/coldfire/Makefile index d6089c11a682..76d389d9a84e 100644 --- a/arch/m68k/platform/coldfire/Makefile +++ b/arch/m68k/platform/coldfire/Makefile | |||
@@ -26,10 +26,11 @@ obj-$(CONFIG_M528x) += m528x.o pit.o intc-2.o reset.o | |||
26 | obj-$(CONFIG_M5307) += m5307.o timers.o intc.o reset.o | 26 | obj-$(CONFIG_M5307) += m5307.o timers.o intc.o reset.o |
27 | obj-$(CONFIG_M532x) += m532x.o timers.o intc-simr.o reset.o | 27 | obj-$(CONFIG_M532x) += m532x.o timers.o intc-simr.o reset.o |
28 | obj-$(CONFIG_M5407) += m5407.o timers.o intc.o reset.o | 28 | obj-$(CONFIG_M5407) += m5407.o timers.o intc.o reset.o |
29 | obj-$(CONFIG_M54xx) += sltimers.o intc-2.o | 29 | obj-$(CONFIG_M54xx) += m54xx.o sltimers.o intc-2.o |
30 | 30 | ||
31 | obj-$(CONFIG_NETtel) += nettel.o | 31 | obj-$(CONFIG_NETtel) += nettel.o |
32 | obj-$(CONFIG_CLEOPATRA) += nettel.o | 32 | obj-$(CONFIG_CLEOPATRA) += nettel.o |
33 | obj-$(CONFIG_FIREBEE) += firebee.o | ||
33 | 34 | ||
34 | obj-y += pinmux.o gpio.o | 35 | obj-y += pinmux.o gpio.o |
35 | extra-y := head.o | 36 | extra-y := head.o |
diff --git a/arch/m68k/platform/coldfire/firebee.c b/arch/m68k/platform/coldfire/firebee.c new file mode 100644 index 000000000000..46d50534f981 --- /dev/null +++ b/arch/m68k/platform/coldfire/firebee.c | |||
@@ -0,0 +1,86 @@ | |||
1 | /***************************************************************************/ | ||
2 | |||
3 | /* | ||
4 | * firebee.c -- extra startup code support for the FireBee boards | ||
5 | * | ||
6 | * Copyright (C) 2011, Greg Ungerer (gerg@snapgear.com) | ||
7 | */ | ||
8 | |||
9 | /***************************************************************************/ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/io.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | #include <linux/mtd/mtd.h> | ||
16 | #include <linux/mtd/partitions.h> | ||
17 | #include <linux/mtd/physmap.h> | ||
18 | #include <asm/coldfire.h> | ||
19 | #include <asm/mcfsim.h> | ||
20 | |||
21 | /***************************************************************************/ | ||
22 | |||
23 | /* | ||
24 | * 8MB of NOR flash fitted to the FireBee board. | ||
25 | */ | ||
26 | #define FLASH_PHYS_ADDR 0xe0000000 /* Physical address of flash */ | ||
27 | #define FLASH_PHYS_SIZE 0x00800000 /* Size of flash */ | ||
28 | |||
29 | #define PART_BOOT_START 0x00000000 /* Start at bottom of flash */ | ||
30 | #define PART_BOOT_SIZE 0x00040000 /* 256k in size */ | ||
31 | #define PART_IMAGE_START 0x00040000 /* Start after boot loader */ | ||
32 | #define PART_IMAGE_SIZE 0x006c0000 /* Most of flash */ | ||
33 | #define PART_FPGA_START 0x00700000 /* Start at offset 7MB */ | ||
34 | #define PART_FPGA_SIZE 0x00100000 /* 1MB in size */ | ||
35 | |||
36 | static struct mtd_partition firebee_flash_parts[] = { | ||
37 | { | ||
38 | .name = "dBUG", | ||
39 | .offset = PART_BOOT_START, | ||
40 | .size = PART_BOOT_SIZE, | ||
41 | }, | ||
42 | { | ||
43 | .name = "FPGA", | ||
44 | .offset = PART_FPGA_START, | ||
45 | .size = PART_FPGA_SIZE, | ||
46 | }, | ||
47 | { | ||
48 | .name = "image", | ||
49 | .offset = PART_IMAGE_START, | ||
50 | .size = PART_IMAGE_SIZE, | ||
51 | }, | ||
52 | }; | ||
53 | |||
54 | static struct physmap_flash_data firebee_flash_data = { | ||
55 | .width = 2, | ||
56 | .nr_parts = ARRAY_SIZE(firebee_flash_parts), | ||
57 | .parts = firebee_flash_parts, | ||
58 | }; | ||
59 | |||
60 | static struct resource firebee_flash_resource = { | ||
61 | .start = FLASH_PHYS_ADDR, | ||
62 | .end = FLASH_PHYS_ADDR + FLASH_PHYS_SIZE, | ||
63 | .flags = IORESOURCE_MEM, | ||
64 | }; | ||
65 | |||
66 | static struct platform_device firebee_flash = { | ||
67 | .name = "physmap-flash", | ||
68 | .id = 0, | ||
69 | .dev = { | ||
70 | .platform_data = &firebee_flash_data, | ||
71 | }, | ||
72 | .num_resources = 1, | ||
73 | .resource = &firebee_flash_resource, | ||
74 | }; | ||
75 | |||
76 | /***************************************************************************/ | ||
77 | |||
78 | static int __init init_firebee(void) | ||
79 | { | ||
80 | platform_device_register(&firebee_flash); | ||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | arch_initcall(init_firebee); | ||
85 | |||
86 | /***************************************************************************/ | ||
diff --git a/arch/m68k/platform/coldfire/m54xx.c b/arch/m68k/platform/coldfire/m54xx.c new file mode 100644 index 000000000000..20672dadb252 --- /dev/null +++ b/arch/m68k/platform/coldfire/m54xx.c | |||
@@ -0,0 +1,112 @@ | |||
1 | /***************************************************************************/ | ||
2 | |||
3 | /* | ||
4 | * linux/arch/m68knommu/platform/54xx/config.c | ||
5 | * | ||
6 | * Copyright (C) 2010, Philippe De Muyter <phdm@macqel.be> | ||
7 | */ | ||
8 | |||
9 | /***************************************************************************/ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/param.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <linux/mm.h> | ||
17 | #include <linux/bootmem.h> | ||
18 | #include <asm/pgalloc.h> | ||
19 | #include <asm/machdep.h> | ||
20 | #include <asm/coldfire.h> | ||
21 | #include <asm/m54xxsim.h> | ||
22 | #include <asm/mcfuart.h> | ||
23 | #include <asm/m54xxgpt.h> | ||
24 | #include <asm/mcfgpio.h> | ||
25 | #ifdef CONFIG_MMU | ||
26 | #include <asm/mmu_context.h> | ||
27 | #endif | ||
28 | |||
29 | /***************************************************************************/ | ||
30 | |||
31 | struct mcf_gpio_chip mcf_gpio_chips[] = { }; | ||
32 | |||
33 | unsigned int mcf_gpio_chips_size = ARRAY_SIZE(mcf_gpio_chips); | ||
34 | |||
35 | /***************************************************************************/ | ||
36 | |||
37 | static void __init m54xx_uarts_init(void) | ||
38 | { | ||
39 | /* enable io pins */ | ||
40 | __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD, | ||
41 | MCF_MBAR + MCF_PAR_PSC(0)); | ||
42 | __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD | MCF_PAR_PSC_RTS_RTS, | ||
43 | MCF_MBAR + MCF_PAR_PSC(1)); | ||
44 | __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD | MCF_PAR_PSC_RTS_RTS | | ||
45 | MCF_PAR_PSC_CTS_CTS, MCF_MBAR + MCF_PAR_PSC(2)); | ||
46 | __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD, | ||
47 | MCF_MBAR + MCF_PAR_PSC(3)); | ||
48 | } | ||
49 | |||
50 | /***************************************************************************/ | ||
51 | |||
52 | static void mcf54xx_reset(void) | ||
53 | { | ||
54 | /* disable interrupts and enable the watchdog */ | ||
55 | asm("movew #0x2700, %sr\n"); | ||
56 | __raw_writel(0, MCF_MBAR + MCF_GPT_GMS0); | ||
57 | __raw_writel(MCF_GPT_GCIR_CNT(1), MCF_MBAR + MCF_GPT_GCIR0); | ||
58 | __raw_writel(MCF_GPT_GMS_WDEN | MCF_GPT_GMS_CE | MCF_GPT_GMS_TMS(4), | ||
59 | MCF_MBAR + MCF_GPT_GMS0); | ||
60 | } | ||
61 | |||
62 | /***************************************************************************/ | ||
63 | |||
64 | #ifdef CONFIG_MMU | ||
65 | |||
66 | unsigned long num_pages; | ||
67 | |||
68 | static void __init mcf54xx_bootmem_alloc(void) | ||
69 | { | ||
70 | unsigned long start_pfn; | ||
71 | unsigned long memstart; | ||
72 | |||
73 | /* _rambase and _ramend will be naturally page aligned */ | ||
74 | m68k_memory[0].addr = _rambase; | ||
75 | m68k_memory[0].size = _ramend - _rambase; | ||
76 | |||
77 | /* compute total pages in system */ | ||
78 | num_pages = (_ramend - _rambase) >> PAGE_SHIFT; | ||
79 | |||
80 | /* page numbers */ | ||
81 | memstart = PAGE_ALIGN(_ramstart); | ||
82 | min_low_pfn = _rambase >> PAGE_SHIFT; | ||
83 | start_pfn = memstart >> PAGE_SHIFT; | ||
84 | max_low_pfn = _ramend >> PAGE_SHIFT; | ||
85 | high_memory = (void *)_ramend; | ||
86 | |||
87 | m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6; | ||
88 | module_fixup(NULL, __start_fixup, __stop_fixup); | ||
89 | |||
90 | /* setup bootmem data */ | ||
91 | m68k_setup_node(0); | ||
92 | memstart += init_bootmem_node(NODE_DATA(0), start_pfn, | ||
93 | min_low_pfn, max_low_pfn); | ||
94 | free_bootmem_node(NODE_DATA(0), memstart, _ramend - memstart); | ||
95 | } | ||
96 | |||
97 | #endif /* CONFIG_MMU */ | ||
98 | |||
99 | /***************************************************************************/ | ||
100 | |||
101 | void __init config_BSP(char *commandp, int size) | ||
102 | { | ||
103 | #ifdef CONFIG_MMU | ||
104 | mcf54xx_bootmem_alloc(); | ||
105 | mmu_context_init(); | ||
106 | #endif | ||
107 | mach_reset = mcf54xx_reset; | ||
108 | mach_sched_init = hw_timer_init; | ||
109 | m54xx_uarts_init(); | ||
110 | } | ||
111 | |||
112 | /***************************************************************************/ | ||