diff options
Diffstat (limited to 'arch/arm/mach-s3c2410')
-rw-r--r-- | arch/arm/mach-s3c2410/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/clock.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/common-smdk.c | 134 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/common-smdk.h | 15 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/mach-anubis.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/mach-rx3715.c | 35 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/mach-smdk2410.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/mach-smdk2440.c | 17 |
9 files changed, 205 insertions, 24 deletions
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig index ed07c4149d82..ce7d81000695 100644 --- a/arch/arm/mach-s3c2410/Kconfig +++ b/arch/arm/mach-s3c2410/Kconfig | |||
@@ -50,9 +50,15 @@ config MACH_N30 | |||
50 | 50 | ||
51 | <http://zoo.weinigel.se/n30>. | 51 | <http://zoo.weinigel.se/n30>. |
52 | 52 | ||
53 | config MACH_SMDK | ||
54 | bool | ||
55 | help | ||
56 | Common machine code for SMDK2410 and SMDK2440 | ||
57 | |||
53 | config ARCH_SMDK2410 | 58 | config ARCH_SMDK2410 |
54 | bool "SMDK2410/A9M2410" | 59 | bool "SMDK2410/A9M2410" |
55 | select CPU_S3C2410 | 60 | select CPU_S3C2410 |
61 | select MACH_SMDK | ||
56 | help | 62 | help |
57 | Say Y here if you are using the SMDK2410 or the derived module A9M2410 | 63 | Say Y here if you are using the SMDK2410 or the derived module A9M2410 |
58 | <http://www.fsforth.de> | 64 | <http://www.fsforth.de> |
@@ -60,6 +66,7 @@ config ARCH_SMDK2410 | |||
60 | config ARCH_S3C2440 | 66 | config ARCH_S3C2440 |
61 | bool "SMDK2440" | 67 | bool "SMDK2440" |
62 | select CPU_S3C2440 | 68 | select CPU_S3C2440 |
69 | select MACH_SMDK | ||
63 | help | 70 | help |
64 | Say Y here if you are using the SMDK2440. | 71 | Say Y here if you are using the SMDK2440. |
65 | 72 | ||
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile index 1b3b476e5637..3e5712db6b52 100644 --- a/arch/arm/mach-s3c2410/Makefile +++ b/arch/arm/mach-s3c2410/Makefile | |||
@@ -48,3 +48,5 @@ obj-$(CONFIG_MACH_VR1000) += mach-vr1000.o usb-simtec.o | |||
48 | obj-$(CONFIG_MACH_RX3715) += mach-rx3715.o | 48 | obj-$(CONFIG_MACH_RX3715) += mach-rx3715.o |
49 | obj-$(CONFIG_MACH_OTOM) += mach-otom.o | 49 | obj-$(CONFIG_MACH_OTOM) += mach-otom.o |
50 | obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o | 50 | obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o |
51 | |||
52 | obj-$(CONFIG_MACH_SMDK) += common-smdk.o \ No newline at end of file | ||
diff --git a/arch/arm/mach-s3c2410/clock.c b/arch/arm/mach-s3c2410/clock.c index fec02c92f95f..b7f85e6d6b76 100644 --- a/arch/arm/mach-s3c2410/clock.c +++ b/arch/arm/mach-s3c2410/clock.c | |||
@@ -249,7 +249,7 @@ static int s3c24xx_upll_enable(struct clk *clk, int enable) | |||
249 | 249 | ||
250 | /* if we started the UPLL, then allow to settle */ | 250 | /* if we started the UPLL, then allow to settle */ |
251 | 251 | ||
252 | if (enable && !(orig & S3C2410_CLKSLOW_UCLK_OFF)) | 252 | if (enable && (orig & S3C2410_CLKSLOW_UCLK_OFF)) |
253 | udelay(200); | 253 | udelay(200); |
254 | 254 | ||
255 | return 0; | 255 | return 0; |
diff --git a/arch/arm/mach-s3c2410/common-smdk.c b/arch/arm/mach-s3c2410/common-smdk.c new file mode 100644 index 000000000000..36b8291b5e03 --- /dev/null +++ b/arch/arm/mach-s3c2410/common-smdk.c | |||
@@ -0,0 +1,134 @@ | |||
1 | /* linux/arch/arm/mach-s3c2410/common-smdk.c | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Common code for SMDK2410 and SMDK2440 boards | ||
7 | * | ||
8 | * http://www.fluff.org/ben/smdk2440/ | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/types.h> | ||
17 | #include <linux/interrupt.h> | ||
18 | #include <linux/list.h> | ||
19 | #include <linux/timer.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | |||
23 | #include <linux/mtd/mtd.h> | ||
24 | #include <linux/mtd/nand.h> | ||
25 | #include <linux/mtd/nand_ecc.h> | ||
26 | #include <linux/mtd/partitions.h> | ||
27 | |||
28 | #include <asm/mach/arch.h> | ||
29 | #include <asm/mach/map.h> | ||
30 | #include <asm/mach/irq.h> | ||
31 | |||
32 | #include <asm/hardware.h> | ||
33 | #include <asm/io.h> | ||
34 | #include <asm/irq.h> | ||
35 | |||
36 | #include <asm/arch/regs-gpio.h> | ||
37 | |||
38 | #include <asm/arch/nand.h> | ||
39 | |||
40 | #include "devs.h" | ||
41 | #include "pm.h" | ||
42 | |||
43 | /* NAND parititon from 2.4.18-swl5 */ | ||
44 | |||
45 | static struct mtd_partition smdk_default_nand_part[] = { | ||
46 | [0] = { | ||
47 | .name = "Boot Agent", | ||
48 | .size = SZ_16K, | ||
49 | .offset = 0, | ||
50 | }, | ||
51 | [1] = { | ||
52 | .name = "S3C2410 flash parition 1", | ||
53 | .offset = 0, | ||
54 | .size = SZ_2M, | ||
55 | }, | ||
56 | [2] = { | ||
57 | .name = "S3C2410 flash partition 2", | ||
58 | .offset = SZ_4M, | ||
59 | .size = SZ_4M, | ||
60 | }, | ||
61 | [3] = { | ||
62 | .name = "S3C2410 flash partition 3", | ||
63 | .offset = SZ_8M, | ||
64 | .size = SZ_2M, | ||
65 | }, | ||
66 | [4] = { | ||
67 | .name = "S3C2410 flash partition 4", | ||
68 | .offset = SZ_1M * 10, | ||
69 | .size = SZ_4M, | ||
70 | }, | ||
71 | [5] = { | ||
72 | .name = "S3C2410 flash partition 5", | ||
73 | .offset = SZ_1M * 14, | ||
74 | .size = SZ_1M * 10, | ||
75 | }, | ||
76 | [6] = { | ||
77 | .name = "S3C2410 flash partition 6", | ||
78 | .offset = SZ_1M * 24, | ||
79 | .size = SZ_1M * 24, | ||
80 | }, | ||
81 | [7] = { | ||
82 | .name = "S3C2410 flash partition 7", | ||
83 | .offset = SZ_1M * 48, | ||
84 | .size = SZ_16M, | ||
85 | } | ||
86 | }; | ||
87 | |||
88 | static struct s3c2410_nand_set smdk_nand_sets[] = { | ||
89 | [0] = { | ||
90 | .name = "NAND", | ||
91 | .nr_chips = 1, | ||
92 | .nr_partitions = ARRAY_SIZE(smdk_default_nand_part), | ||
93 | .partitions = smdk_default_nand_part, | ||
94 | }, | ||
95 | }; | ||
96 | |||
97 | /* choose a set of timings which should suit most 512Mbit | ||
98 | * chips and beyond. | ||
99 | */ | ||
100 | |||
101 | static struct s3c2410_platform_nand smdk_nand_info = { | ||
102 | .tacls = 20, | ||
103 | .twrph0 = 60, | ||
104 | .twrph1 = 20, | ||
105 | .nr_sets = ARRAY_SIZE(smdk_nand_sets), | ||
106 | .sets = smdk_nand_sets, | ||
107 | }; | ||
108 | |||
109 | /* devices we initialise */ | ||
110 | |||
111 | static struct platform_device __initdata *smdk_devs[] = { | ||
112 | &s3c_device_nand, | ||
113 | }; | ||
114 | |||
115 | void __init smdk_machine_init(void) | ||
116 | { | ||
117 | /* Configure the LEDs (even if we have no LED support)*/ | ||
118 | |||
119 | s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP); | ||
120 | s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP); | ||
121 | s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP); | ||
122 | s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP); | ||
123 | |||
124 | s3c2410_gpio_setpin(S3C2410_GPF4, 1); | ||
125 | s3c2410_gpio_setpin(S3C2410_GPF5, 1); | ||
126 | s3c2410_gpio_setpin(S3C2410_GPF6, 1); | ||
127 | s3c2410_gpio_setpin(S3C2410_GPF7, 1); | ||
128 | |||
129 | s3c_device_nand.dev.platform_data = &smdk_nand_info; | ||
130 | |||
131 | platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs)); | ||
132 | |||
133 | s3c2410_pm_init(); | ||
134 | } | ||
diff --git a/arch/arm/mach-s3c2410/common-smdk.h b/arch/arm/mach-s3c2410/common-smdk.h new file mode 100644 index 000000000000..0e3a3be330a3 --- /dev/null +++ b/arch/arm/mach-s3c2410/common-smdk.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* linux/arch/arm/mach-s3c2410/common-smdk.h | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Common code for SMDK2410 and SMDK2440 boards | ||
7 | * | ||
8 | * http://www.fluff.org/ben/smdk2440/ | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | extern void smdk_machine_init(void); | ||
diff --git a/arch/arm/mach-s3c2410/mach-anubis.c b/arch/arm/mach-s3c2410/mach-anubis.c index 3e327b8e46be..cc97fbf66291 100644 --- a/arch/arm/mach-s3c2410/mach-anubis.c +++ b/arch/arm/mach-s3c2410/mach-anubis.c | |||
@@ -232,8 +232,8 @@ static void anubis_nand_select(struct s3c2410_nand_set *set, int slot) | |||
232 | 232 | ||
233 | static struct s3c2410_platform_nand anubis_nand_info = { | 233 | static struct s3c2410_platform_nand anubis_nand_info = { |
234 | .tacls = 25, | 234 | .tacls = 25, |
235 | .twrph0 = 80, | 235 | .twrph0 = 55, |
236 | .twrph1 = 80, | 236 | .twrph1 = 40, |
237 | .nr_sets = ARRAY_SIZE(anubis_nand_sets), | 237 | .nr_sets = ARRAY_SIZE(anubis_nand_sets), |
238 | .sets = anubis_nand_sets, | 238 | .sets = anubis_nand_sets, |
239 | .select_chip = anubis_nand_select, | 239 | .select_chip = anubis_nand_select, |
diff --git a/arch/arm/mach-s3c2410/mach-rx3715.c b/arch/arm/mach-s3c2410/mach-rx3715.c index 0260ed5ab946..306afc1d7cd3 100644 --- a/arch/arm/mach-s3c2410/mach-rx3715.c +++ b/arch/arm/mach-s3c2410/mach-rx3715.c | |||
@@ -32,6 +32,11 @@ | |||
32 | #include <linux/serial_core.h> | 32 | #include <linux/serial_core.h> |
33 | #include <linux/serial.h> | 33 | #include <linux/serial.h> |
34 | 34 | ||
35 | #include <linux/mtd/mtd.h> | ||
36 | #include <linux/mtd/nand.h> | ||
37 | #include <linux/mtd/nand_ecc.h> | ||
38 | #include <linux/mtd/partitions.h> | ||
39 | |||
35 | #include <asm/mach/arch.h> | 40 | #include <asm/mach/arch.h> |
36 | #include <asm/mach/map.h> | 41 | #include <asm/mach/map.h> |
37 | #include <asm/mach/irq.h> | 42 | #include <asm/mach/irq.h> |
@@ -46,6 +51,7 @@ | |||
46 | #include <asm/arch/regs-gpio.h> | 51 | #include <asm/arch/regs-gpio.h> |
47 | #include <asm/arch/regs-lcd.h> | 52 | #include <asm/arch/regs-lcd.h> |
48 | 53 | ||
54 | #include <asm/arch/nand.h> | ||
49 | #include <asm/arch/fb.h> | 55 | #include <asm/arch/fb.h> |
50 | 56 | ||
51 | #include "clock.h" | 57 | #include "clock.h" |
@@ -170,12 +176,39 @@ static struct s3c2410fb_mach_info rx3715_lcdcfg __initdata = { | |||
170 | }, | 176 | }, |
171 | }; | 177 | }; |
172 | 178 | ||
179 | static struct mtd_partition rx3715_nand_part[] = { | ||
180 | [0] = { | ||
181 | .name = "Whole Flash", | ||
182 | .offset = 0, | ||
183 | .size = MTDPART_SIZ_FULL, | ||
184 | .mask_flags = MTD_WRITEABLE, | ||
185 | } | ||
186 | }; | ||
187 | |||
188 | static struct s3c2410_nand_set rx3715_nand_sets[] = { | ||
189 | [0] = { | ||
190 | .name = "Internal", | ||
191 | .nr_chips = 1, | ||
192 | .nr_partitions = ARRAY_SIZE(rx3715_nand_part), | ||
193 | .partitions = rx3715_nand_part, | ||
194 | }, | ||
195 | }; | ||
196 | |||
197 | static struct s3c2410_platform_nand rx3715_nand_info = { | ||
198 | .tacls = 25, | ||
199 | .twrph0 = 50, | ||
200 | .twrph1 = 15, | ||
201 | .nr_sets = ARRAY_SIZE(rx3715_nand_sets), | ||
202 | .sets = rx3715_nand_sets, | ||
203 | }; | ||
204 | |||
173 | static struct platform_device *rx3715_devices[] __initdata = { | 205 | static struct platform_device *rx3715_devices[] __initdata = { |
174 | &s3c_device_usb, | 206 | &s3c_device_usb, |
175 | &s3c_device_lcd, | 207 | &s3c_device_lcd, |
176 | &s3c_device_wdt, | 208 | &s3c_device_wdt, |
177 | &s3c_device_i2c, | 209 | &s3c_device_i2c, |
178 | &s3c_device_iis, | 210 | &s3c_device_iis, |
211 | &s3c_device_nand, | ||
179 | }; | 212 | }; |
180 | 213 | ||
181 | static struct s3c24xx_board rx3715_board __initdata = { | 214 | static struct s3c24xx_board rx3715_board __initdata = { |
@@ -185,6 +218,8 @@ static struct s3c24xx_board rx3715_board __initdata = { | |||
185 | 218 | ||
186 | static void __init rx3715_map_io(void) | 219 | static void __init rx3715_map_io(void) |
187 | { | 220 | { |
221 | s3c_device_nand.dev.platform_data = &rx3715_nand_info; | ||
222 | |||
188 | s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc)); | 223 | s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc)); |
189 | s3c24xx_init_clocks(16934000); | 224 | s3c24xx_init_clocks(16934000); |
190 | s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs)); | 225 | s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs)); |
diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c index 1e76e1fdfcea..2db932d72c5a 100644 --- a/arch/arm/mach-s3c2410/mach-smdk2410.c +++ b/arch/arm/mach-s3c2410/mach-smdk2410.c | |||
@@ -28,7 +28,8 @@ | |||
28 | * Ben Dooks <ben@simtec.co.uk> | 28 | * Ben Dooks <ben@simtec.co.uk> |
29 | * | 29 | * |
30 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA | 30 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA |
31 | * 20-Sep-2005 BJD Added static to non-exported items | 31 | * 20-Sep-2005 BJD Added static to non-exported items |
32 | * 01-Apr-2006 BJD Moved init code to common smdk | ||
32 | * | 33 | * |
33 | ***********************************************************************/ | 34 | ***********************************************************************/ |
34 | 35 | ||
@@ -54,6 +55,8 @@ | |||
54 | #include "devs.h" | 55 | #include "devs.h" |
55 | #include "cpu.h" | 56 | #include "cpu.h" |
56 | 57 | ||
58 | #include "common-smdk.h" | ||
59 | |||
57 | static struct map_desc smdk2410_iodesc[] __initdata = { | 60 | static struct map_desc smdk2410_iodesc[] __initdata = { |
58 | /* nothing here yet */ | 61 | /* nothing here yet */ |
59 | }; | 62 | }; |
@@ -107,11 +110,6 @@ static void __init smdk2410_map_io(void) | |||
107 | s3c24xx_set_board(&smdk2410_board); | 110 | s3c24xx_set_board(&smdk2410_board); |
108 | } | 111 | } |
109 | 112 | ||
110 | static void __init smdk2410_init_irq(void) | ||
111 | { | ||
112 | s3c24xx_init_irq(); | ||
113 | } | ||
114 | |||
115 | MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch | 113 | MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch |
116 | * to SMDK2410 */ | 114 | * to SMDK2410 */ |
117 | /* Maintainer: Jonas Dietsche */ | 115 | /* Maintainer: Jonas Dietsche */ |
@@ -119,7 +117,8 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switc | |||
119 | .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, | 117 | .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, |
120 | .boot_params = S3C2410_SDRAM_PA + 0x100, | 118 | .boot_params = S3C2410_SDRAM_PA + 0x100, |
121 | .map_io = smdk2410_map_io, | 119 | .map_io = smdk2410_map_io, |
122 | .init_irq = smdk2410_init_irq, | 120 | .init_irq = s3c24xx_init_irq, |
121 | .init_machine = smdk_machine_init, | ||
123 | .timer = &s3c24xx_timer, | 122 | .timer = &s3c24xx_timer, |
124 | MACHINE_END | 123 | MACHINE_END |
125 | 124 | ||
diff --git a/arch/arm/mach-s3c2410/mach-smdk2440.c b/arch/arm/mach-s3c2410/mach-smdk2440.c index f4315721c3b8..5fffd1d51047 100644 --- a/arch/arm/mach-s3c2410/mach-smdk2440.c +++ b/arch/arm/mach-s3c2410/mach-smdk2440.c | |||
@@ -53,7 +53,8 @@ | |||
53 | #include "clock.h" | 53 | #include "clock.h" |
54 | #include "devs.h" | 54 | #include "devs.h" |
55 | #include "cpu.h" | 55 | #include "cpu.h" |
56 | #include "pm.h" | 56 | |
57 | #include "common-smdk.h" | ||
57 | 58 | ||
58 | static struct map_desc smdk2440_iodesc[] __initdata = { | 59 | static struct map_desc smdk2440_iodesc[] __initdata = { |
59 | /* ISA IO Space map (memory space selected by A24) */ | 60 | /* ISA IO Space map (memory space selected by A24) */ |
@@ -197,21 +198,9 @@ static void __init smdk2440_map_io(void) | |||
197 | 198 | ||
198 | static void __init smdk2440_machine_init(void) | 199 | static void __init smdk2440_machine_init(void) |
199 | { | 200 | { |
200 | /* Configure the LEDs (even if we have no LED support)*/ | ||
201 | |||
202 | s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP); | ||
203 | s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP); | ||
204 | s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP); | ||
205 | s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP); | ||
206 | |||
207 | s3c2410_gpio_setpin(S3C2410_GPF4, 0); | ||
208 | s3c2410_gpio_setpin(S3C2410_GPF5, 0); | ||
209 | s3c2410_gpio_setpin(S3C2410_GPF6, 0); | ||
210 | s3c2410_gpio_setpin(S3C2410_GPF7, 0); | ||
211 | |||
212 | s3c24xx_fb_set_platdata(&smdk2440_lcd_cfg); | 201 | s3c24xx_fb_set_platdata(&smdk2440_lcd_cfg); |
213 | 202 | ||
214 | s3c2410_pm_init(); | 203 | smdk_machine_init(); |
215 | } | 204 | } |
216 | 205 | ||
217 | MACHINE_START(S3C2440, "SMDK2440") | 206 | MACHINE_START(S3C2440, "SMDK2440") |