diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2009-04-15 15:19:21 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-04-27 12:50:18 -0400 |
commit | 3e9c18e1dc71b9a0fac302e2defe99d850ad3d79 (patch) | |
tree | 9fbb7ba5d7a62cc71c2b294dad940169539beef1 /arch | |
parent | d0e47fba054a55e0066c6ae2c807d98d086af5a9 (diff) |
davinci: DM644x: NAND: update partitioning
Update NAND partitioning for the dm6446 evm, unmasking the hidden
data at the beginning and letting the kernel be updated from Linux.
- This is boot-compatible with TI's software (U-Boot 1.20 and both
the 2.6.10 and 2.6.18 kernels), in terms of startup and loading
kernels from flash.
- In the same way, it's also boot-compatible with mainline U-Boot,
which stores U-Boot params in block 0 not block 16.
- It's not quite compatible with systems that previously used NAND
partitions to hold (filesystem) data. The compatibilities are a
bit different based on which kernel was used previously
+ Users of TI/MV kernels no longer see mtd2 "params"
(mainline u-boot env is in a different place)
* Filesystem is now mtd2 ... vs mtd3
+ Users of GIT kernels now see mtd0 and mtd1 partitions
* Filesystem partition starts 640 KBytes earlier
* Filesystem is now mtd2 ... vs mtd0
* Linux now *uses* the flash-resident BBT
* Removes annoying slowdown/hiccup during boot
* Potentially ~64KB less space available with TI/MV kernels
If you *used* NAND partitions from Linux, there is no solution that's
fully compatible with all previous kernels in those respects ... ergo
this "best compromise". It'd be good to back back up the filesystem
data; or, carry your own backwards-compatibility patch for awhile.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-davinci/board-dm644x-evm.c | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index 5387e6b20405..c039674fe99e 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c | |||
@@ -16,11 +16,12 @@ | |||
16 | #include <linux/gpio.h> | 16 | #include <linux/gpio.h> |
17 | #include <linux/leds.h> | 17 | #include <linux/leds.h> |
18 | #include <linux/memory.h> | 18 | #include <linux/memory.h> |
19 | #include <linux/etherdevice.h> | ||
19 | 20 | ||
20 | #include <linux/i2c.h> | 21 | #include <linux/i2c.h> |
21 | #include <linux/i2c/pcf857x.h> | 22 | #include <linux/i2c/pcf857x.h> |
22 | #include <linux/i2c/at24.h> | 23 | #include <linux/i2c/at24.h> |
23 | #include <linux/etherdevice.h> | 24 | |
24 | #include <linux/mtd/mtd.h> | 25 | #include <linux/mtd/mtd.h> |
25 | #include <linux/mtd/nand.h> | 26 | #include <linux/mtd/nand.h> |
26 | #include <linux/mtd/partitions.h> | 27 | #include <linux/mtd/partitions.h> |
@@ -113,20 +114,49 @@ static struct platform_device davinci_evm_norflash_device = { | |||
113 | .resource = &davinci_evm_norflash_resource, | 114 | .resource = &davinci_evm_norflash_resource, |
114 | }; | 115 | }; |
115 | 116 | ||
117 | /* DM644x EVM includes a 64 MByte small-page NAND flash (16K blocks). | ||
118 | * It may used instead of the (default) NOR chip to boot, using TI's | ||
119 | * tools to install the secondary boot loader (UBL) and U-Boot. | ||
120 | */ | ||
116 | struct mtd_partition davinci_evm_nandflash_partition[] = { | 121 | struct mtd_partition davinci_evm_nandflash_partition[] = { |
117 | /* 5 MB space at the beginning for bootloader and kernel */ | 122 | /* Bootloader layout depends on whose u-boot is installed, but we |
123 | * can hide all the details. | ||
124 | * - block 0 for u-boot environment ... in mainline u-boot | ||
125 | * - block 1 for UBL (plus up to four backup copies in blocks 2..5) | ||
126 | * - blocks 6...? for u-boot | ||
127 | * - blocks 16..23 for u-boot environment ... in TI's u-boot | ||
128 | */ | ||
129 | { | ||
130 | .name = "bootloader", | ||
131 | .offset = 0, | ||
132 | .size = SZ_256K + SZ_128K, | ||
133 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
134 | }, | ||
135 | /* Kernel */ | ||
118 | { | 136 | { |
119 | .name = "NAND filesystem", | 137 | .name = "kernel", |
120 | .offset = 5 * SZ_1M, | 138 | .offset = MTDPART_OFS_APPEND, |
139 | .size = SZ_4M, | ||
140 | .mask_flags = 0, | ||
141 | }, | ||
142 | /* File system (older GIT kernels started this on the 5MB mark) */ | ||
143 | { | ||
144 | .name = "filesystem", | ||
145 | .offset = MTDPART_OFS_APPEND, | ||
121 | .size = MTDPART_SIZ_FULL, | 146 | .size = MTDPART_SIZ_FULL, |
122 | .mask_flags = 0, | 147 | .mask_flags = 0, |
123 | } | 148 | } |
149 | /* A few blocks at end hold a flash BBT ... created by TI's CCS | ||
150 | * using flashwriter_nand.out, but ignored by TI's versions of | ||
151 | * Linux and u-boot. We boot faster by using them. | ||
152 | */ | ||
124 | }; | 153 | }; |
125 | 154 | ||
126 | static struct davinci_nand_pdata davinci_evm_nandflash_data = { | 155 | static struct davinci_nand_pdata davinci_evm_nandflash_data = { |
127 | .parts = davinci_evm_nandflash_partition, | 156 | .parts = davinci_evm_nandflash_partition, |
128 | .nr_parts = ARRAY_SIZE(davinci_evm_nandflash_partition), | 157 | .nr_parts = ARRAY_SIZE(davinci_evm_nandflash_partition), |
129 | .ecc_mode = NAND_ECC_HW, | 158 | .ecc_mode = NAND_ECC_HW, |
159 | .options = NAND_USE_FLASH_BBT, | ||
130 | }; | 160 | }; |
131 | 161 | ||
132 | static struct resource davinci_evm_nandflash_resource[] = { | 162 | static struct resource davinci_evm_nandflash_resource[] = { |
@@ -151,14 +181,14 @@ static struct platform_device davinci_evm_nandflash_device = { | |||
151 | .resource = davinci_evm_nandflash_resource, | 181 | .resource = davinci_evm_nandflash_resource, |
152 | }; | 182 | }; |
153 | 183 | ||
154 | static u64 davinci_fb_dma_mask = DMA_32BIT_MASK; | 184 | static u64 davinci_fb_dma_mask = DMA_BIT_MASK(32); |
155 | 185 | ||
156 | static struct platform_device davinci_fb_device = { | 186 | static struct platform_device davinci_fb_device = { |
157 | .name = "davincifb", | 187 | .name = "davincifb", |
158 | .id = -1, | 188 | .id = -1, |
159 | .dev = { | 189 | .dev = { |
160 | .dma_mask = &davinci_fb_dma_mask, | 190 | .dma_mask = &davinci_fb_dma_mask, |
161 | .coherent_dma_mask = DMA_32BIT_MASK, | 191 | .coherent_dma_mask = DMA_BIT_MASK(32), |
162 | }, | 192 | }, |
163 | .num_resources = 0, | 193 | .num_resources = 0, |
164 | }; | 194 | }; |