diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-flash.c')
-rw-r--r-- | arch/arm/mach-omap2/board-flash.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c index e642acf9cad0..020b96b91f73 100644 --- a/arch/arm/mach-omap2/board-flash.c +++ b/arch/arm/mach-omap2/board-flash.c | |||
@@ -18,13 +18,15 @@ | |||
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | 19 | ||
20 | #include <plat/cpu.h> | 20 | #include <plat/cpu.h> |
21 | #include <plat/gpmc.h> | 21 | #include "gpmc.h" |
22 | #include <linux/platform_data/mtd-nand-omap2.h> | 22 | #include <linux/platform_data/mtd-nand-omap2.h> |
23 | #include <linux/platform_data/mtd-onenand-omap2.h> | 23 | #include <linux/platform_data/mtd-onenand-omap2.h> |
24 | #include <plat/tc.h> | 24 | #include <plat/tc.h> |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
27 | #include "board-flash.h" | 27 | #include "board-flash.h" |
28 | #include "gpmc-onenand.h" | ||
29 | #include "gpmc-nand.h" | ||
28 | 30 | ||
29 | #define REG_FPGA_REV 0x10 | 31 | #define REG_FPGA_REV 0x10 |
30 | #define REG_FPGA_DIP_SWITCH_INPUT2 0x60 | 32 | #define REG_FPGA_DIP_SWITCH_INPUT2 0x60 |
@@ -104,36 +106,35 @@ __init board_onenand_init(struct mtd_partition *onenand_parts, | |||
104 | defined(CONFIG_MTD_NAND_OMAP2_MODULE) | 106 | defined(CONFIG_MTD_NAND_OMAP2_MODULE) |
105 | 107 | ||
106 | /* Note that all values in this struct are in nanoseconds */ | 108 | /* Note that all values in this struct are in nanoseconds */ |
107 | static struct gpmc_timings nand_timings = { | 109 | struct gpmc_timings nand_default_timings[1] = { |
110 | { | ||
111 | .sync_clk = 0, | ||
108 | 112 | ||
109 | .sync_clk = 0, | 113 | .cs_on = 0, |
114 | .cs_rd_off = 36, | ||
115 | .cs_wr_off = 36, | ||
110 | 116 | ||
111 | .cs_on = 0, | 117 | .adv_on = 6, |
112 | .cs_rd_off = 36, | 118 | .adv_rd_off = 24, |
113 | .cs_wr_off = 36, | 119 | .adv_wr_off = 36, |
114 | 120 | ||
115 | .adv_on = 6, | 121 | .we_off = 30, |
116 | .adv_rd_off = 24, | 122 | .oe_off = 48, |
117 | .adv_wr_off = 36, | ||
118 | 123 | ||
119 | .we_off = 30, | 124 | .access = 54, |
120 | .oe_off = 48, | 125 | .rd_cycle = 72, |
126 | .wr_cycle = 72, | ||
121 | 127 | ||
122 | .access = 54, | 128 | .wr_access = 30, |
123 | .rd_cycle = 72, | 129 | .wr_data_mux_bus = 0, |
124 | .wr_cycle = 72, | 130 | }, |
125 | |||
126 | .wr_access = 30, | ||
127 | .wr_data_mux_bus = 0, | ||
128 | }; | 131 | }; |
129 | 132 | ||
130 | static struct omap_nand_platform_data board_nand_data = { | 133 | static struct omap_nand_platform_data board_nand_data; |
131 | .gpmc_t = &nand_timings, | ||
132 | }; | ||
133 | 134 | ||
134 | void | 135 | void |
135 | __init board_nand_init(struct mtd_partition *nand_parts, | 136 | __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs, |
136 | u8 nr_parts, u8 cs, int nand_type) | 137 | int nand_type, struct gpmc_timings *gpmc_t) |
137 | { | 138 | { |
138 | board_nand_data.cs = cs; | 139 | board_nand_data.cs = cs; |
139 | board_nand_data.parts = nand_parts; | 140 | board_nand_data.parts = nand_parts; |
@@ -141,7 +142,7 @@ __init board_nand_init(struct mtd_partition *nand_parts, | |||
141 | board_nand_data.devsize = nand_type; | 142 | board_nand_data.devsize = nand_type; |
142 | 143 | ||
143 | board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT; | 144 | board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT; |
144 | gpmc_nand_init(&board_nand_data); | 145 | gpmc_nand_init(&board_nand_data, gpmc_t); |
145 | } | 146 | } |
146 | #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ | 147 | #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ |
147 | 148 | ||
@@ -238,5 +239,6 @@ void __init board_flash_init(struct flash_partitions partition_info[], | |||
238 | pr_err("NAND: Unable to find configuration in GPMC\n"); | 239 | pr_err("NAND: Unable to find configuration in GPMC\n"); |
239 | else | 240 | else |
240 | board_nand_init(partition_info[2].parts, | 241 | board_nand_init(partition_info[2].parts, |
241 | partition_info[2].nr_parts, nandcs, nand_type); | 242 | partition_info[2].nr_parts, nandcs, |
243 | nand_type, nand_default_timings); | ||
242 | } | 244 | } |