diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-flash.c')
-rw-r--r-- | arch/arm/mach-omap2/board-flash.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c index fd38c05bb47f..c32c06828f08 100644 --- a/arch/arm/mach-omap2/board-flash.c +++ b/arch/arm/mach-omap2/board-flash.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * board-sdp-flash.c | 2 | * board-flash.c |
3 | * Modified from mach-omap2/board-3430sdp-flash.c | 3 | * Modified from mach-omap2/board-3430sdp-flash.c |
4 | * | 4 | * |
5 | * Copyright (C) 2009 Nokia Corporation | 5 | * Copyright (C) 2009 Nokia Corporation |
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/mtd/physmap.h> | 17 | #include <linux/mtd/physmap.h> |
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <plat/irqs.h> | ||
19 | 20 | ||
20 | #include <plat/gpmc.h> | 21 | #include <plat/gpmc.h> |
21 | #include <plat/nand.h> | 22 | #include <plat/nand.h> |
@@ -73,11 +74,11 @@ __init board_nor_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs) | |||
73 | + FLASH_SIZE_SDPV1 - 1; | 74 | + FLASH_SIZE_SDPV1 - 1; |
74 | } | 75 | } |
75 | if (err < 0) { | 76 | if (err < 0) { |
76 | printk(KERN_ERR "NOR: Can't request GPMC CS\n"); | 77 | pr_err("NOR: Can't request GPMC CS\n"); |
77 | return; | 78 | return; |
78 | } | 79 | } |
79 | if (platform_device_register(&board_nor_device) < 0) | 80 | if (platform_device_register(&board_nor_device) < 0) |
80 | printk(KERN_ERR "Unable to register NOR device\n"); | 81 | pr_err("Unable to register NOR device\n"); |
81 | } | 82 | } |
82 | 83 | ||
83 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ | 84 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ |
@@ -139,12 +140,16 @@ static struct omap_nand_platform_data board_nand_data = { | |||
139 | }; | 140 | }; |
140 | 141 | ||
141 | void | 142 | void |
142 | __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs) | 143 | __init board_nand_init(struct mtd_partition *nand_parts, |
144 | u8 nr_parts, u8 cs, int nand_type) | ||
143 | { | 145 | { |
144 | board_nand_data.cs = cs; | 146 | board_nand_data.cs = cs; |
145 | board_nand_data.parts = nand_parts; | 147 | board_nand_data.parts = nand_parts; |
146 | board_nand_data.nr_parts = nr_parts; | 148 | board_nand_data.nr_parts = nr_parts; |
149 | board_nand_data.devsize = nand_type; | ||
147 | 150 | ||
151 | board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT; | ||
152 | board_nand_data.gpmc_irq = OMAP_GPMC_IRQ_BASE + cs; | ||
148 | gpmc_nand_init(&board_nand_data); | 153 | gpmc_nand_init(&board_nand_data); |
149 | } | 154 | } |
150 | #else | 155 | #else |
@@ -189,12 +194,12 @@ unmap: | |||
189 | } | 194 | } |
190 | 195 | ||
191 | /** | 196 | /** |
192 | * sdp3430_flash_init - Identify devices connected to GPMC and register. | 197 | * board_flash_init - Identify devices connected to GPMC and register. |
193 | * | 198 | * |
194 | * @return - void. | 199 | * @return - void. |
195 | */ | 200 | */ |
196 | void board_flash_init(struct flash_partitions partition_info[], | 201 | void board_flash_init(struct flash_partitions partition_info[], |
197 | char chip_sel_board[][GPMC_CS_NUM]) | 202 | char chip_sel_board[][GPMC_CS_NUM], int nand_type) |
198 | { | 203 | { |
199 | u8 cs = 0; | 204 | u8 cs = 0; |
200 | u8 norcs = GPMC_CS_NUM + 1; | 205 | u8 norcs = GPMC_CS_NUM + 1; |
@@ -208,7 +213,7 @@ void board_flash_init(struct flash_partitions partition_info[], | |||
208 | */ | 213 | */ |
209 | idx = get_gpmc0_type(); | 214 | idx = get_gpmc0_type(); |
210 | if (idx >= MAX_SUPPORTED_GPMC_CONFIG) { | 215 | if (idx >= MAX_SUPPORTED_GPMC_CONFIG) { |
211 | printk(KERN_ERR "%s: Invalid chip select: %d\n", __func__, cs); | 216 | pr_err("%s: Invalid chip select: %d\n", __func__, cs); |
212 | return; | 217 | return; |
213 | } | 218 | } |
214 | config_sel = (unsigned char *)(chip_sel_board[idx]); | 219 | config_sel = (unsigned char *)(chip_sel_board[idx]); |
@@ -232,23 +237,20 @@ void board_flash_init(struct flash_partitions partition_info[], | |||
232 | } | 237 | } |
233 | 238 | ||
234 | if (norcs > GPMC_CS_NUM) | 239 | if (norcs > GPMC_CS_NUM) |
235 | printk(KERN_INFO "NOR: Unable to find configuration " | 240 | pr_err("NOR: Unable to find configuration in GPMC\n"); |
236 | "in GPMC\n"); | ||
237 | else | 241 | else |
238 | board_nor_init(partition_info[0].parts, | 242 | board_nor_init(partition_info[0].parts, |
239 | partition_info[0].nr_parts, norcs); | 243 | partition_info[0].nr_parts, norcs); |
240 | 244 | ||
241 | if (onenandcs > GPMC_CS_NUM) | 245 | if (onenandcs > GPMC_CS_NUM) |
242 | printk(KERN_INFO "OneNAND: Unable to find configuration " | 246 | pr_err("OneNAND: Unable to find configuration in GPMC\n"); |
243 | "in GPMC\n"); | ||
244 | else | 247 | else |
245 | board_onenand_init(partition_info[1].parts, | 248 | board_onenand_init(partition_info[1].parts, |
246 | partition_info[1].nr_parts, onenandcs); | 249 | partition_info[1].nr_parts, onenandcs); |
247 | 250 | ||
248 | if (nandcs > GPMC_CS_NUM) | 251 | if (nandcs > GPMC_CS_NUM) |
249 | printk(KERN_INFO "NAND: Unable to find configuration " | 252 | pr_err("NAND: Unable to find configuration in GPMC\n"); |
250 | "in GPMC\n"); | ||
251 | else | 253 | else |
252 | board_nand_init(partition_info[2].parts, | 254 | board_nand_init(partition_info[2].parts, |
253 | partition_info[2].nr_parts, nandcs); | 255 | partition_info[2].nr_parts, nandcs, nand_type); |
254 | } | 256 | } |