diff options
| author | Ben Dooks <ben-linux@fluff.org> | 2006-04-02 05:00:09 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-04-02 05:00:09 -0400 |
| commit | dee9b2e932ef7c8f19540ad67e425fae30f33421 (patch) | |
| tree | 7f30e943b2cff1ab0f948cbb68b7ee412b5c8173 | |
| parent | 66ce229fe057e35275a5f5176b29ed70795506a1 (diff) | |
[ARM] 3442/1: [S3C2410] SMDK: NAND device setup
Patch from Ben Dooks
Add SMDK2410/SMDK2440 NAND device information
and default partition table.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| -rw-r--r-- | arch/arm/mach-s3c2410/common-smdk.c | 85 |
1 files changed, 84 insertions, 1 deletions
diff --git a/arch/arm/mach-s3c2410/common-smdk.c b/arch/arm/mach-s3c2410/common-smdk.c index f903dc2ab29b..36b8291b5e03 100644 --- a/arch/arm/mach-s3c2410/common-smdk.c +++ b/arch/arm/mach-s3c2410/common-smdk.c | |||
| @@ -20,6 +20,11 @@ | |||
| 20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
| 21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
| 22 | 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 | |||
| 23 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
| 24 | #include <asm/mach/map.h> | 29 | #include <asm/mach/map.h> |
| 25 | #include <asm/mach/irq.h> | 30 | #include <asm/mach/irq.h> |
| @@ -27,12 +32,86 @@ | |||
| 27 | #include <asm/hardware.h> | 32 | #include <asm/hardware.h> |
| 28 | #include <asm/io.h> | 33 | #include <asm/io.h> |
| 29 | #include <asm/irq.h> | 34 | #include <asm/irq.h> |
| 30 | #include <asm/mach-types.h> | ||
| 31 | 35 | ||
| 32 | #include <asm/arch/regs-gpio.h> | 36 | #include <asm/arch/regs-gpio.h> |
| 33 | 37 | ||
| 38 | #include <asm/arch/nand.h> | ||
| 39 | |||
| 40 | #include "devs.h" | ||
| 34 | #include "pm.h" | 41 | #include "pm.h" |
| 35 | 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 | |||
| 36 | void __init smdk_machine_init(void) | 115 | void __init smdk_machine_init(void) |
| 37 | { | 116 | { |
| 38 | /* Configure the LEDs (even if we have no LED support)*/ | 117 | /* Configure the LEDs (even if we have no LED support)*/ |
| @@ -47,5 +126,9 @@ void __init smdk_machine_init(void) | |||
| 47 | s3c2410_gpio_setpin(S3C2410_GPF6, 1); | 126 | s3c2410_gpio_setpin(S3C2410_GPF6, 1); |
| 48 | s3c2410_gpio_setpin(S3C2410_GPF7, 1); | 127 | s3c2410_gpio_setpin(S3C2410_GPF7, 1); |
| 49 | 128 | ||
| 129 | s3c_device_nand.dev.platform_data = &smdk_nand_info; | ||
| 130 | |||
| 131 | platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs)); | ||
| 132 | |||
| 50 | s3c2410_pm_init(); | 133 | s3c2410_pm_init(); |
| 51 | } | 134 | } |
