diff options
author | Andrew Victor <linux@maxim.org.za> | 2008-09-21 16:30:02 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-09-21 17:58:36 -0400 |
commit | e505240b6a6fd47b84cfeb1272ffeacd3e0874b3 (patch) | |
tree | 4a1b9b3715bcf2f52c4ba86e1212c9edd09badfe /arch/arm/mach-at91/board-yl-9200.c | |
parent | a745a622434d9c3ff6505125b37fd6828ecadb87 (diff) |
[ARM] 5257/2: [AT91] Use SZ_ definitions and MTDPART_OFS_NXTBLK instead of hex-values
In the various AT91 board files, replace hard-coded size values (eg,
0x800000) with the SZ_ size definitions (eg, SZ_8M) from sizes.h
Also replace MTD partition offsets with MTDPART_OFS_NXTBLK.
Signed-off-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91/board-yl-9200.c')
-rw-r--r-- | arch/arm/mach-at91/board-yl-9200.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c index 36b380aad006..e22bf051f835 100644 --- a/arch/arm/mach-at91/board-yl-9200.c +++ b/arch/arm/mach-at91/board-yl-9200.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/gpio_keys.h> | 33 | #include <linux/gpio_keys.h> |
34 | #include <linux/input.h> | 34 | #include <linux/input.h> |
35 | 35 | ||
36 | #include <mach/hardware.h> | ||
37 | #include <asm/setup.h> | 36 | #include <asm/setup.h> |
38 | #include <asm/mach-types.h> | 37 | #include <asm/mach-types.h> |
39 | #include <asm/irq.h> | 38 | #include <asm/irq.h> |
@@ -42,6 +41,7 @@ | |||
42 | #include <asm/mach/map.h> | 41 | #include <asm/mach/map.h> |
43 | #include <asm/mach/irq.h> | 42 | #include <asm/mach/irq.h> |
44 | 43 | ||
44 | #include <mach/hardware.h> | ||
45 | #include <mach/board.h> | 45 | #include <mach/board.h> |
46 | #include <mach/gpio.h> | 46 | #include <mach/gpio.h> |
47 | #include <mach/at91rm9200_mc.h> | 47 | #include <mach/at91rm9200_mc.h> |
@@ -150,27 +150,27 @@ static struct mtd_partition __initdata yl9200_nand_partition[] = { | |||
150 | { | 150 | { |
151 | .name = "AT91 NAND partition 1, boot", | 151 | .name = "AT91 NAND partition 1, boot", |
152 | .offset = 0, | 152 | .offset = 0, |
153 | .size = 1 * SZ_256K | 153 | .size = SZ_256K |
154 | }, | 154 | }, |
155 | { | 155 | { |
156 | .name = "AT91 NAND partition 2, kernel", | 156 | .name = "AT91 NAND partition 2, kernel", |
157 | .offset = 1 * SZ_256K, | 157 | .offset = MTDPART_OFS_NXTBLK, |
158 | .size = 2 * SZ_1M - 1 * SZ_256K | 158 | .size = (2 * SZ_1M) - SZ_256K |
159 | }, | 159 | }, |
160 | { | 160 | { |
161 | .name = "AT91 NAND partition 3, filesystem", | 161 | .name = "AT91 NAND partition 3, filesystem", |
162 | .offset = 2 * SZ_1M, | 162 | .offset = MTDPART_OFS_NXTBLK, |
163 | .size = 14 * SZ_1M | 163 | .size = 14 * SZ_1M |
164 | }, | 164 | }, |
165 | { | 165 | { |
166 | .name = "AT91 NAND partition 4, storage", | 166 | .name = "AT91 NAND partition 4, storage", |
167 | .offset = 16 * SZ_1M, | 167 | .offset = MTDPART_OFS_NXTBLK, |
168 | .size = 16 * SZ_1M | 168 | .size = SZ_16M |
169 | }, | 169 | }, |
170 | { | 170 | { |
171 | .name = "AT91 NAND partition 5, ext-fs", | 171 | .name = "AT91 NAND partition 5, ext-fs", |
172 | .offset = 32 * SZ_1M, | 172 | .offset = MTDPART_OFS_NXTBLK, |
173 | .size = 32 * SZ_1M | 173 | .size = SZ_32M |
174 | } | 174 | } |
175 | }; | 175 | }; |
176 | 176 | ||
@@ -193,24 +193,24 @@ static struct atmel_nand_data __initdata yl9200_nand_data = { | |||
193 | * NOR Flash | 193 | * NOR Flash |
194 | */ | 194 | */ |
195 | #define YL9200_FLASH_BASE AT91_CHIPSELECT_0 | 195 | #define YL9200_FLASH_BASE AT91_CHIPSELECT_0 |
196 | #define YL9200_FLASH_SIZE 0x1000000 | 196 | #define YL9200_FLASH_SIZE SZ_16M |
197 | 197 | ||
198 | static struct mtd_partition yl9200_flash_partitions[] = { | 198 | static struct mtd_partition yl9200_flash_partitions[] = { |
199 | { | 199 | { |
200 | .name = "Bootloader", | 200 | .name = "Bootloader", |
201 | .size = 0x00040000, | ||
202 | .offset = 0, | 201 | .offset = 0, |
202 | .size = SZ_256K, | ||
203 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | 203 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
204 | }, | 204 | }, |
205 | { | 205 | { |
206 | .name = "Kernel", | 206 | .name = "Kernel", |
207 | .size = 0x001C0000, | 207 | .offset = MTDPART_OFS_NXTBLK, |
208 | .offset = 0x00040000, | 208 | .size = (2 * SZ_1M) - SZ_256K |
209 | }, | 209 | }, |
210 | { | 210 | { |
211 | .name = "Filesystem", | 211 | .name = "Filesystem", |
212 | .size = MTDPART_SIZ_FULL, | 212 | .offset = MTDPART_OFS_NXTBLK, |
213 | .offset = 0x00200000 | 213 | .size = MTDPART_SIZ_FULL |
214 | } | 214 | } |
215 | }; | 215 | }; |
216 | 216 | ||
@@ -390,10 +390,6 @@ static struct spi_board_info yl9200_spi_devices[] = { | |||
390 | #if defined(CONFIG_FB_S1D135XX) || defined(CONFIG_FB_S1D13XXX_MODULE) | 390 | #if defined(CONFIG_FB_S1D135XX) || defined(CONFIG_FB_S1D13XXX_MODULE) |
391 | #include <video/s1d13xxxfb.h> | 391 | #include <video/s1d13xxxfb.h> |
392 | 392 | ||
393 | #define AT91_FB_REG_BASE 0x80000000L | ||
394 | #define AT91_FB_REG_SIZE 0x200 | ||
395 | #define AT91_FB_VMEM_BASE 0x80200000L | ||
396 | #define AT91_FB_VMEM_SIZE 0x200000L | ||
397 | 393 | ||
398 | static void __init yl9200_init_video(void) | 394 | static void __init yl9200_init_video(void) |
399 | { | 395 | { |
@@ -516,29 +512,33 @@ static struct s1d13xxxfb_regval yl9200_s1dfb_initregs[] = | |||
516 | {S1DREG_COM_DISP_MODE, 0x01}, /* Display Mode Register, LCD only*/ | 512 | {S1DREG_COM_DISP_MODE, 0x01}, /* Display Mode Register, LCD only*/ |
517 | }; | 513 | }; |
518 | 514 | ||
519 | static u64 s1dfb_dmamask = DMA_BIT_MASK(32); | ||
520 | |||
521 | static struct s1d13xxxfb_pdata yl9200_s1dfb_pdata = { | 515 | static struct s1d13xxxfb_pdata yl9200_s1dfb_pdata = { |
522 | .initregs = yl9200_s1dfb_initregs, | 516 | .initregs = yl9200_s1dfb_initregs, |
523 | .initregssize = ARRAY_SIZE(yl9200_s1dfb_initregs), | 517 | .initregssize = ARRAY_SIZE(yl9200_s1dfb_initregs), |
524 | .platform_init_video = yl9200_init_video, | 518 | .platform_init_video = yl9200_init_video, |
525 | }; | 519 | }; |
526 | 520 | ||
521 | #define YL9200_FB_REG_BASE AT91_CHIPSELECT_7 | ||
522 | #define YL9200_FB_VMEM_BASE YL9200_FB_REG_BASE + SZ_2M | ||
523 | #define YL9200_FB_VMEM_SIZE SZ_2M | ||
524 | |||
527 | static struct resource yl9200_s1dfb_resource[] = { | 525 | static struct resource yl9200_s1dfb_resource[] = { |
528 | [0] = { /* video mem */ | 526 | [0] = { /* video mem */ |
529 | .name = "s1d13xxxfb memory", | 527 | .name = "s1d13xxxfb memory", |
530 | .start = AT91_FB_VMEM_BASE, | 528 | .start = YL9200_FB_VMEM_BASE, |
531 | .end = AT91_FB_VMEM_BASE + AT91_FB_VMEM_SIZE -1, | 529 | .end = YL9200_FB_VMEM_BASE + YL9200_FB_VMEM_SIZE -1, |
532 | .flags = IORESOURCE_MEM, | 530 | .flags = IORESOURCE_MEM, |
533 | }, | 531 | }, |
534 | [1] = { /* video registers */ | 532 | [1] = { /* video registers */ |
535 | .name = "s1d13xxxfb registers", | 533 | .name = "s1d13xxxfb registers", |
536 | .start = AT91_FB_REG_BASE, | 534 | .start = YL9200_FB_REG_BASE, |
537 | .end = AT91_FB_REG_BASE + AT91_FB_REG_SIZE -1, | 535 | .end = YL9200_FB_REG_BASE + SZ_512 -1, |
538 | .flags = IORESOURCE_MEM, | 536 | .flags = IORESOURCE_MEM, |
539 | }, | 537 | }, |
540 | }; | 538 | }; |
541 | 539 | ||
540 | static u64 s1dfb_dmamask = DMA_BIT_MASK(32); | ||
541 | |||
542 | static struct platform_device yl9200_s1dfb_device = { | 542 | static struct platform_device yl9200_s1dfb_device = { |
543 | .name = "s1d13806fb", | 543 | .name = "s1d13806fb", |
544 | .id = -1, | 544 | .id = -1, |