diff options
author | Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> | 2010-12-16 14:51:30 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-21 09:53:34 -0500 |
commit | 9f15d2caca102c4b79e34562296bcbf982665cb2 (patch) | |
tree | d6f4d232eb242db0353d0cc311b949e5d05cb96c /arch | |
parent | 7decaa557a20f48aabef35f817ec16ef563567b0 (diff) |
ARM: 6447/3: sa1100: Put nanoEngine support back in the kernel
Adds Bright Star Engineering's nanoEngine board support to the kernel.
Also:
- Adds the nanoEngine memory chip to arch/arm/mach-sa1100/cpu-sa1110.c
(Micron MT48LC8M16A2TG-75).
- Increase in the sdram_params->name[] field length to accomodate the
name of the memory chip.
- Clean up of header content and order of
arch/arm/mach-sa1100/cpu-sa1110.c
Signed-off-by: Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-sa1100/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/cpu-sa1110.c | 33 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/nanoengine.c | 112 |
4 files changed, 142 insertions, 13 deletions
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig index 5da8c35aa0de..3563d4637f6e 100644 --- a/arch/arm/mach-sa1100/Kconfig +++ b/arch/arm/mach-sa1100/Kconfig | |||
@@ -118,6 +118,14 @@ config SA1100_LART | |||
118 | (also known as the LART). See <http://www.lartmaker.nl/> for | 118 | (also known as the LART). See <http://www.lartmaker.nl/> for |
119 | information on the LART. | 119 | information on the LART. |
120 | 120 | ||
121 | config SA1100_NANOENGINE | ||
122 | bool "nanoEngine" | ||
123 | select CPU_FREQ_SA1110 | ||
124 | help | ||
125 | Say Y here if you are using the Bright Star Engineering nanoEngine. | ||
126 | See <http://www.brightstareng.com/arm/nanoeng.htm> for information | ||
127 | on the BSE nanoEngine. | ||
128 | |||
121 | config SA1100_PLEB | 129 | config SA1100_PLEB |
122 | bool "PLEB" | 130 | bool "PLEB" |
123 | select CPU_FREQ_SA1100 | 131 | select CPU_FREQ_SA1100 |
diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile index 89349c1dd7a6..8029fe25bfcc 100644 --- a/arch/arm/mach-sa1100/Makefile +++ b/arch/arm/mach-sa1100/Makefile | |||
@@ -37,6 +37,8 @@ obj-$(CONFIG_SA1100_JORNADA720_SSP) += jornada720_ssp.o | |||
37 | obj-$(CONFIG_SA1100_LART) += lart.o | 37 | obj-$(CONFIG_SA1100_LART) += lart.o |
38 | led-$(CONFIG_SA1100_LART) += leds-lart.o | 38 | led-$(CONFIG_SA1100_LART) += leds-lart.o |
39 | 39 | ||
40 | obj-$(CONFIG_SA1100_NANOENGINE) += nanoengine.o | ||
41 | |||
40 | obj-$(CONFIG_SA1100_PLEB) += pleb.o | 42 | obj-$(CONFIG_SA1100_PLEB) += pleb.o |
41 | 43 | ||
42 | obj-$(CONFIG_SA1100_SHANNON) += shannon.o | 44 | obj-$(CONFIG_SA1100_SHANNON) += shannon.o |
diff --git a/arch/arm/mach-sa1100/cpu-sa1110.c b/arch/arm/mach-sa1100/cpu-sa1110.c index 7252874d328b..8251af277c1a 100644 --- a/arch/arm/mach-sa1100/cpu-sa1110.c +++ b/arch/arm/mach-sa1100/cpu-sa1110.c | |||
@@ -16,28 +16,24 @@ | |||
16 | * | 16 | * |
17 | * The SDRAM type can be passed on the command line as cpu_sa1110.sdram=type | 17 | * The SDRAM type can be passed on the command line as cpu_sa1110.sdram=type |
18 | */ | 18 | */ |
19 | #include <linux/moduleparam.h> | ||
20 | #include <linux/types.h> | ||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/sched.h> | ||
23 | #include <linux/cpufreq.h> | 19 | #include <linux/cpufreq.h> |
24 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
25 | #include <linux/init.h> | 21 | #include <linux/init.h> |
26 | #include <linux/io.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/moduleparam.h> | ||
24 | #include <linux/types.h> | ||
27 | 25 | ||
28 | #include <mach/hardware.h> | ||
29 | #include <asm/cputype.h> | 26 | #include <asm/cputype.h> |
30 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
31 | #include <asm/system.h> | 28 | |
29 | #include <mach/hardware.h> | ||
32 | 30 | ||
33 | #include "generic.h" | 31 | #include "generic.h" |
34 | 32 | ||
35 | #undef DEBUG | 33 | #undef DEBUG |
36 | 34 | ||
37 | static struct cpufreq_driver sa1110_driver; | ||
38 | |||
39 | struct sdram_params { | 35 | struct sdram_params { |
40 | const char name[16]; | 36 | const char name[20]; |
41 | u_char rows; /* bits */ | 37 | u_char rows; /* bits */ |
42 | u_char cas_latency; /* cycles */ | 38 | u_char cas_latency; /* cycles */ |
43 | u_char tck; /* clock cycle time (ns) */ | 39 | u_char tck; /* clock cycle time (ns) */ |
@@ -107,6 +103,15 @@ static struct sdram_params sdram_tbl[] __initdata = { | |||
107 | .twr = 8, | 103 | .twr = 8, |
108 | .refresh = 64000, | 104 | .refresh = 64000, |
109 | .cas_latency = 3, | 105 | .cas_latency = 3, |
106 | }, { /* Micron MT48LC8M16A2TG-75 */ | ||
107 | .name = "MT48LC8M16A2TG-75", | ||
108 | .rows = 12, | ||
109 | .tck = 8, | ||
110 | .trcd = 20, | ||
111 | .trp = 20, | ||
112 | .twr = 8, | ||
113 | .refresh = 64000, | ||
114 | .cas_latency = 3, | ||
110 | }, | 115 | }, |
111 | }; | 116 | }; |
112 | 117 | ||
@@ -336,7 +341,9 @@ static int __init sa1110_cpu_init(struct cpufreq_policy *policy) | |||
336 | return 0; | 341 | return 0; |
337 | } | 342 | } |
338 | 343 | ||
339 | static struct cpufreq_driver sa1110_driver = { | 344 | /* sa1110_driver needs __refdata because it must remain after init registers |
345 | * it with cpufreq_register_driver() */ | ||
346 | static struct cpufreq_driver sa1110_driver __refdata = { | ||
340 | .flags = CPUFREQ_STICKY, | 347 | .flags = CPUFREQ_STICKY, |
341 | .verify = sa11x0_verify_speed, | 348 | .verify = sa11x0_verify_speed, |
342 | .target = sa1110_target, | 349 | .target = sa1110_target, |
@@ -369,14 +376,14 @@ static int __init sa1110_clk_init(void) | |||
369 | if (!name[0]) { | 376 | if (!name[0]) { |
370 | if (machine_is_assabet()) | 377 | if (machine_is_assabet()) |
371 | name = "TC59SM716-CL3"; | 378 | name = "TC59SM716-CL3"; |
372 | |||
373 | if (machine_is_pt_system3()) | 379 | if (machine_is_pt_system3()) |
374 | name = "K4S641632D"; | 380 | name = "K4S641632D"; |
375 | |||
376 | if (machine_is_h3100()) | 381 | if (machine_is_h3100()) |
377 | name = "KM416S4030CT"; | 382 | name = "KM416S4030CT"; |
378 | if (machine_is_jornada720()) | 383 | if (machine_is_jornada720()) |
379 | name = "K4S281632B-1H"; | 384 | name = "K4S281632B-1H"; |
385 | if (machine_is_nanoengine()) | ||
386 | name = "MT48LC8M16A2TG-75"; | ||
380 | } | 387 | } |
381 | 388 | ||
382 | sdram = sa1110_find_sdram(name); | 389 | sdram = sa1110_find_sdram(name); |
diff --git a/arch/arm/mach-sa1100/nanoengine.c b/arch/arm/mach-sa1100/nanoengine.c new file mode 100644 index 000000000000..e4a03099e2a3 --- /dev/null +++ b/arch/arm/mach-sa1100/nanoengine.c | |||
@@ -0,0 +1,112 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-sa1100/nanoengine.c | ||
3 | * | ||
4 | * Bright Star Engineering's nanoEngine board init code. | ||
5 | * | ||
6 | * Copyright (C) 2009 Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/init.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/mtd/mtd.h> | ||
17 | #include <linux/mtd/partitions.h> | ||
18 | #include <linux/root_dev.h> | ||
19 | |||
20 | #include <asm/mach-types.h> | ||
21 | #include <asm/setup.h> | ||
22 | |||
23 | #include <asm/mach/arch.h> | ||
24 | #include <asm/mach/flash.h> | ||
25 | #include <asm/mach/map.h> | ||
26 | #include <asm/mach/serial_sa1100.h> | ||
27 | |||
28 | #include <mach/hardware.h> | ||
29 | |||
30 | #include "generic.h" | ||
31 | |||
32 | /* Flash bank 0 */ | ||
33 | static struct mtd_partition nanoengine_partitions[] = { | ||
34 | { | ||
35 | .name = "nanoEngine boot firmware and parameter table", | ||
36 | .size = 0x00010000, /* 32K */ | ||
37 | .offset = 0, | ||
38 | .mask_flags = MTD_WRITEABLE, | ||
39 | }, { | ||
40 | .name = "kernel/initrd reserved", | ||
41 | .size = 0x002f0000, | ||
42 | .offset = 0x00010000, | ||
43 | .mask_flags = MTD_WRITEABLE, | ||
44 | }, { | ||
45 | .name = "experimental filesystem allocation", | ||
46 | .size = 0x00100000, | ||
47 | .offset = 0x00300000, | ||
48 | .mask_flags = MTD_WRITEABLE, | ||
49 | } | ||
50 | }; | ||
51 | |||
52 | static struct flash_platform_data nanoengine_flash_data = { | ||
53 | .map_name = "jedec_probe", | ||
54 | .parts = nanoengine_partitions, | ||
55 | .nr_parts = ARRAY_SIZE(nanoengine_partitions), | ||
56 | }; | ||
57 | |||
58 | static struct resource nanoengine_flash_resources[] = { | ||
59 | { | ||
60 | .start = SA1100_CS0_PHYS, | ||
61 | .end = SA1100_CS0_PHYS + SZ_32M - 1, | ||
62 | .flags = IORESOURCE_MEM, | ||
63 | }, { | ||
64 | .start = SA1100_CS1_PHYS, | ||
65 | .end = SA1100_CS1_PHYS + SZ_32M - 1, | ||
66 | .flags = IORESOURCE_MEM, | ||
67 | } | ||
68 | }; | ||
69 | |||
70 | static struct map_desc nanoengine_io_desc[] __initdata = { | ||
71 | { | ||
72 | /* System Registers */ | ||
73 | .virtual = 0xf0000000, | ||
74 | .pfn = __phys_to_pfn(0x10000000), | ||
75 | .length = 0x00100000, | ||
76 | .type = MT_DEVICE | ||
77 | }, { | ||
78 | /* Internal PCI Config Space */ | ||
79 | .virtual = 0xf1000000, | ||
80 | .pfn = __phys_to_pfn(0x18A00000), | ||
81 | .length = 0x00100000, | ||
82 | .type = MT_DEVICE | ||
83 | } | ||
84 | }; | ||
85 | |||
86 | static void __init nanoengine_map_io(void) | ||
87 | { | ||
88 | sa1100_map_io(); | ||
89 | iotable_init(nanoengine_io_desc, ARRAY_SIZE(nanoengine_io_desc)); | ||
90 | |||
91 | sa1100_register_uart(0, 1); | ||
92 | sa1100_register_uart(1, 2); | ||
93 | sa1100_register_uart(2, 3); | ||
94 | Ser1SDCR0 |= SDCR0_UART; | ||
95 | /* disable IRDA -- UART2 is used as a normal serial port */ | ||
96 | Ser2UTCR4 = 0; | ||
97 | Ser2HSCR0 = 0; | ||
98 | } | ||
99 | |||
100 | static void __init nanoengine_init(void) | ||
101 | { | ||
102 | sa11x0_register_mtd(&nanoengine_flash_data, nanoengine_flash_resources, | ||
103 | ARRAY_SIZE(nanoengine_flash_resources)); | ||
104 | } | ||
105 | |||
106 | MACHINE_START(NANOENGINE, "BSE nanoEngine") | ||
107 | .boot_params = 0xc0000000, | ||
108 | .map_io = nanoengine_map_io, | ||
109 | .init_irq = sa1100_init_irq, | ||
110 | .timer = &sa1100_timer, | ||
111 | .init_machine = nanoengine_init, | ||
112 | MACHINE_END | ||