aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuanxiao Dong <chuanxiao.dong@intel.com>2010-08-09 11:59:23 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-08-10 19:28:38 -0400
commit24c3fa36dedd12616c273bfa4adfed3bb652637f (patch)
tree0d0c60aeac278945b9d60e928e3eddb8e84a595d
parent5c0eb90094d64d56df8be23bb75d48e63c96c180 (diff)
nand/denali: use iowrite32() to replace denali_write32()
denali_write32() just implements a debug function for iowrite32(), only print out the write value. Remove this function since it's useless Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r--drivers/mtd/nand/denali.c138
1 files changed, 62 insertions, 76 deletions
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index ab960efb67f0..4ab9d89eae56 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -132,20 +132,6 @@ static uint32_t read_interrupt_status(struct denali_nand_info *denali);
132 132
133#define DEBUG_DENALI 0 133#define DEBUG_DENALI 0
134 134
135/* This is a wrapper for writing to the denali registers.
136 * this allows us to create debug information so we can
137 * observe how the driver is programming the device.
138 * it uses standard linux convention for (val, addr) */
139static void denali_write32(uint32_t value, void *addr)
140{
141 iowrite32(value, addr);
142
143#if DEBUG_DENALI
144 printk(KERN_INFO "wrote: 0x%x -> 0x%x\n", value,
145 (uint32_t)((uint32_t)addr & 0x1fff));
146#endif
147}
148
149/* Certain operations for the denali NAND controller use 135/* Certain operations for the denali NAND controller use
150 * an indexed mode to read/write data. The operation is 136 * an indexed mode to read/write data. The operation is
151 * performed by writing the address value of the command 137 * performed by writing the address value of the command
@@ -155,15 +141,15 @@ static void denali_write32(uint32_t value, void *addr)
155static void index_addr(struct denali_nand_info *denali, 141static void index_addr(struct denali_nand_info *denali,
156 uint32_t address, uint32_t data) 142 uint32_t address, uint32_t data)
157{ 143{
158 denali_write32(address, denali->flash_mem); 144 iowrite32(address, denali->flash_mem);
159 denali_write32(data, denali->flash_mem + 0x10); 145 iowrite32(data, denali->flash_mem + 0x10);
160} 146}
161 147
162/* Perform an indexed read of the device */ 148/* Perform an indexed read of the device */
163static void index_addr_read_data(struct denali_nand_info *denali, 149static void index_addr_read_data(struct denali_nand_info *denali,
164 uint32_t address, uint32_t *pdata) 150 uint32_t address, uint32_t *pdata)
165{ 151{
166 denali_write32(address, denali->flash_mem); 152 iowrite32(address, denali->flash_mem);
167 *pdata = ioread32(denali->flash_mem + 0x10); 153 *pdata = ioread32(denali->flash_mem + 0x10);
168} 154}
169 155
@@ -191,7 +177,7 @@ static void read_status(struct denali_nand_info *denali)
191 /* initiate a device status read */ 177 /* initiate a device status read */
192 cmd = MODE_11 | BANK(denali->flash_bank); 178 cmd = MODE_11 | BANK(denali->flash_bank);
193 index_addr(denali, cmd | COMMAND_CYCLE, 0x70); 179 index_addr(denali, cmd | COMMAND_CYCLE, 0x70);
194 denali_write32(cmd | STATUS_CYCLE, denali->flash_mem); 180 iowrite32(cmd | STATUS_CYCLE, denali->flash_mem);
195 181
196 /* update buffer with status value */ 182 /* update buffer with status value */
197 write_byte_to_buf(denali, ioread32(denali->flash_mem + 0x10)); 183 write_byte_to_buf(denali, ioread32(denali->flash_mem + 0x10));
@@ -213,7 +199,7 @@ static void reset_bank(struct denali_nand_info *denali)
213 clear_interrupts(denali); 199 clear_interrupts(denali);
214 200
215 bank = device_reset_banks[denali->flash_bank]; 201 bank = device_reset_banks[denali->flash_bank];
216 denali_write32(bank, denali->flash_reg + DEVICE_RESET); 202 iowrite32(bank, denali->flash_reg + DEVICE_RESET);
217 203
218 irq_status = wait_for_irq(denali, irq_mask); 204 irq_status = wait_for_irq(denali, irq_mask);
219 205
@@ -230,11 +216,11 @@ static uint16_t denali_nand_reset(struct denali_nand_info *denali)
230 __FILE__, __LINE__, __func__); 216 __FILE__, __LINE__, __func__);
231 217
232 for (i = 0 ; i < LLD_MAX_FLASH_BANKS; i++) 218 for (i = 0 ; i < LLD_MAX_FLASH_BANKS; i++)
233 denali_write32(reset_complete[i] | operation_timeout[i], 219 iowrite32(reset_complete[i] | operation_timeout[i],
234 denali->flash_reg + intr_status_addresses[i]); 220 denali->flash_reg + intr_status_addresses[i]);
235 221
236 for (i = 0 ; i < LLD_MAX_FLASH_BANKS; i++) { 222 for (i = 0 ; i < LLD_MAX_FLASH_BANKS; i++) {
237 denali_write32(device_reset_banks[i], 223 iowrite32(device_reset_banks[i],
238 denali->flash_reg + DEVICE_RESET); 224 denali->flash_reg + DEVICE_RESET);
239 while (!(ioread32(denali->flash_reg + 225 while (!(ioread32(denali->flash_reg +
240 intr_status_addresses[i]) & 226 intr_status_addresses[i]) &
@@ -247,7 +233,7 @@ static uint16_t denali_nand_reset(struct denali_nand_info *denali)
247 } 233 }
248 234
249 for (i = 0; i < LLD_MAX_FLASH_BANKS; i++) 235 for (i = 0; i < LLD_MAX_FLASH_BANKS; i++)
250 denali_write32(reset_complete[i] | operation_timeout[i], 236 iowrite32(reset_complete[i] | operation_timeout[i],
251 denali->flash_reg + intr_status_addresses[i]); 237 denali->flash_reg + intr_status_addresses[i]);
252 238
253 return PASS; 239 return PASS;
@@ -345,14 +331,14 @@ static void nand_onfi_timing_set(struct denali_nand_info *denali,
345 (ioread32(denali->flash_reg + DEVICE_ID) == 0x88)) 331 (ioread32(denali->flash_reg + DEVICE_ID) == 0x88))
346 acc_clks = 6; 332 acc_clks = 6;
347 333
348 denali_write32(acc_clks, denali->flash_reg + ACC_CLKS); 334 iowrite32(acc_clks, denali->flash_reg + ACC_CLKS);
349 denali_write32(re_2_we, denali->flash_reg + RE_2_WE); 335 iowrite32(re_2_we, denali->flash_reg + RE_2_WE);
350 denali_write32(re_2_re, denali->flash_reg + RE_2_RE); 336 iowrite32(re_2_re, denali->flash_reg + RE_2_RE);
351 denali_write32(we_2_re, denali->flash_reg + WE_2_RE); 337 iowrite32(we_2_re, denali->flash_reg + WE_2_RE);
352 denali_write32(addr_2_data, denali->flash_reg + ADDR_2_DATA); 338 iowrite32(addr_2_data, denali->flash_reg + ADDR_2_DATA);
353 denali_write32(en_lo, denali->flash_reg + RDWR_EN_LO_CNT); 339 iowrite32(en_lo, denali->flash_reg + RDWR_EN_LO_CNT);
354 denali_write32(en_hi, denali->flash_reg + RDWR_EN_HI_CNT); 340 iowrite32(en_hi, denali->flash_reg + RDWR_EN_HI_CNT);
355 denali_write32(cs_cnt, denali->flash_reg + CS_SETUP_CNT); 341 iowrite32(cs_cnt, denali->flash_reg + CS_SETUP_CNT);
356} 342}
357 343
358/* queries the NAND device to see what ONFI modes it supports. */ 344/* queries the NAND device to see what ONFI modes it supports. */
@@ -387,13 +373,13 @@ static void get_samsung_nand_para(struct denali_nand_info *denali,
387{ 373{
388 if (device_id == 0xd3) { /* Samsung K9WAG08U1A */ 374 if (device_id == 0xd3) { /* Samsung K9WAG08U1A */
389 /* Set timing register values according to datasheet */ 375 /* Set timing register values according to datasheet */
390 denali_write32(5, denali->flash_reg + ACC_CLKS); 376 iowrite32(5, denali->flash_reg + ACC_CLKS);
391 denali_write32(20, denali->flash_reg + RE_2_WE); 377 iowrite32(20, denali->flash_reg + RE_2_WE);
392 denali_write32(12, denali->flash_reg + WE_2_RE); 378 iowrite32(12, denali->flash_reg + WE_2_RE);
393 denali_write32(14, denali->flash_reg + ADDR_2_DATA); 379 iowrite32(14, denali->flash_reg + ADDR_2_DATA);
394 denali_write32(3, denali->flash_reg + RDWR_EN_LO_CNT); 380 iowrite32(3, denali->flash_reg + RDWR_EN_LO_CNT);
395 denali_write32(2, denali->flash_reg + RDWR_EN_HI_CNT); 381 iowrite32(2, denali->flash_reg + RDWR_EN_HI_CNT);
396 denali_write32(2, denali->flash_reg + CS_SETUP_CNT); 382 iowrite32(2, denali->flash_reg + CS_SETUP_CNT);
397 } 383 }
398} 384}
399 385
@@ -405,15 +391,15 @@ static void get_toshiba_nand_para(struct denali_nand_info *denali)
405 /* spare area size for some kind of Toshiba NAND device */ 391 /* spare area size for some kind of Toshiba NAND device */
406 if ((ioread32(denali->flash_reg + DEVICE_MAIN_AREA_SIZE) == 4096) && 392 if ((ioread32(denali->flash_reg + DEVICE_MAIN_AREA_SIZE) == 4096) &&
407 (ioread32(denali->flash_reg + DEVICE_SPARE_AREA_SIZE) == 64)) { 393 (ioread32(denali->flash_reg + DEVICE_SPARE_AREA_SIZE) == 64)) {
408 denali_write32(216, denali->flash_reg + DEVICE_SPARE_AREA_SIZE); 394 iowrite32(216, denali->flash_reg + DEVICE_SPARE_AREA_SIZE);
409 tmp = ioread32(denali->flash_reg + DEVICES_CONNECTED) * 395 tmp = ioread32(denali->flash_reg + DEVICES_CONNECTED) *
410 ioread32(denali->flash_reg + DEVICE_SPARE_AREA_SIZE); 396 ioread32(denali->flash_reg + DEVICE_SPARE_AREA_SIZE);
411 denali_write32(tmp, 397 iowrite32(tmp,
412 denali->flash_reg + LOGICAL_PAGE_SPARE_SIZE); 398 denali->flash_reg + LOGICAL_PAGE_SPARE_SIZE);
413#if SUPPORT_15BITECC 399#if SUPPORT_15BITECC
414 denali_write32(15, denali->flash_reg + ECC_CORRECTION); 400 iowrite32(15, denali->flash_reg + ECC_CORRECTION);
415#elif SUPPORT_8BITECC 401#elif SUPPORT_8BITECC
416 denali_write32(8, denali->flash_reg + ECC_CORRECTION); 402 iowrite32(8, denali->flash_reg + ECC_CORRECTION);
417#endif 403#endif
418 } 404 }
419} 405}
@@ -426,22 +412,22 @@ static void get_hynix_nand_para(struct denali_nand_info *denali,
426 switch (device_id) { 412 switch (device_id) {
427 case 0xD5: /* Hynix H27UAG8T2A, H27UBG8U5A or H27UCG8VFA */ 413 case 0xD5: /* Hynix H27UAG8T2A, H27UBG8U5A or H27UCG8VFA */
428 case 0xD7: /* Hynix H27UDG8VEM, H27UCG8UDM or H27UCG8V5A */ 414 case 0xD7: /* Hynix H27UDG8VEM, H27UCG8UDM or H27UCG8V5A */
429 denali_write32(128, denali->flash_reg + PAGES_PER_BLOCK); 415 iowrite32(128, denali->flash_reg + PAGES_PER_BLOCK);
430 denali_write32(4096, denali->flash_reg + DEVICE_MAIN_AREA_SIZE); 416 iowrite32(4096, denali->flash_reg + DEVICE_MAIN_AREA_SIZE);
431 denali_write32(224, denali->flash_reg + DEVICE_SPARE_AREA_SIZE); 417 iowrite32(224, denali->flash_reg + DEVICE_SPARE_AREA_SIZE);
432 main_size = 4096 * 418 main_size = 4096 *
433 ioread32(denali->flash_reg + DEVICES_CONNECTED); 419 ioread32(denali->flash_reg + DEVICES_CONNECTED);
434 spare_size = 224 * 420 spare_size = 224 *
435 ioread32(denali->flash_reg + DEVICES_CONNECTED); 421 ioread32(denali->flash_reg + DEVICES_CONNECTED);
436 denali_write32(main_size, 422 iowrite32(main_size,
437 denali->flash_reg + LOGICAL_PAGE_DATA_SIZE); 423 denali->flash_reg + LOGICAL_PAGE_DATA_SIZE);
438 denali_write32(spare_size, 424 iowrite32(spare_size,
439 denali->flash_reg + LOGICAL_PAGE_SPARE_SIZE); 425 denali->flash_reg + LOGICAL_PAGE_SPARE_SIZE);
440 denali_write32(0, denali->flash_reg + DEVICE_WIDTH); 426 iowrite32(0, denali->flash_reg + DEVICE_WIDTH);
441#if SUPPORT_15BITECC 427#if SUPPORT_15BITECC
442 denali_write32(15, denali->flash_reg + ECC_CORRECTION); 428 iowrite32(15, denali->flash_reg + ECC_CORRECTION);
443#elif SUPPORT_8BITECC 429#elif SUPPORT_8BITECC
444 denali_write32(8, denali->flash_reg + ECC_CORRECTION); 430 iowrite32(8, denali->flash_reg + ECC_CORRECTION);
445#endif 431#endif
446 break; 432 break;
447 default: 433 default:
@@ -586,9 +572,9 @@ static void denali_set_intr_modes(struct denali_nand_info *denali,
586 __FILE__, __LINE__, __func__); 572 __FILE__, __LINE__, __func__);
587 573
588 if (INT_ENABLE) 574 if (INT_ENABLE)
589 denali_write32(1, denali->flash_reg + GLOBAL_INT_ENABLE); 575 iowrite32(1, denali->flash_reg + GLOBAL_INT_ENABLE);
590 else 576 else
591 denali_write32(0, denali->flash_reg + GLOBAL_INT_ENABLE); 577 iowrite32(0, denali->flash_reg + GLOBAL_INT_ENABLE);
592} 578}
593 579
594/* validation function to verify that the controlling software is making 580/* validation function to verify that the controlling software is making
@@ -609,10 +595,10 @@ static void denali_irq_init(struct denali_nand_info *denali)
609 int_mask = DENALI_IRQ_ALL; 595 int_mask = DENALI_IRQ_ALL;
610 596
611 /* Clear all status bits */ 597 /* Clear all status bits */
612 denali_write32(0xFFFF, denali->flash_reg + INTR_STATUS0); 598 iowrite32(0xFFFF, denali->flash_reg + INTR_STATUS0);
613 denali_write32(0xFFFF, denali->flash_reg + INTR_STATUS1); 599 iowrite32(0xFFFF, denali->flash_reg + INTR_STATUS1);
614 denali_write32(0xFFFF, denali->flash_reg + INTR_STATUS2); 600 iowrite32(0xFFFF, denali->flash_reg + INTR_STATUS2);
615 denali_write32(0xFFFF, denali->flash_reg + INTR_STATUS3); 601 iowrite32(0xFFFF, denali->flash_reg + INTR_STATUS3);
616 602
617 denali_irq_enable(denali, int_mask); 603 denali_irq_enable(denali, int_mask);
618} 604}
@@ -626,10 +612,10 @@ static void denali_irq_cleanup(int irqnum, struct denali_nand_info *denali)
626static void denali_irq_enable(struct denali_nand_info *denali, 612static void denali_irq_enable(struct denali_nand_info *denali,
627 uint32_t int_mask) 613 uint32_t int_mask)
628{ 614{
629 denali_write32(int_mask, denali->flash_reg + INTR_EN0); 615 iowrite32(int_mask, denali->flash_reg + INTR_EN0);
630 denali_write32(int_mask, denali->flash_reg + INTR_EN1); 616 iowrite32(int_mask, denali->flash_reg + INTR_EN1);
631 denali_write32(int_mask, denali->flash_reg + INTR_EN2); 617 iowrite32(int_mask, denali->flash_reg + INTR_EN2);
632 denali_write32(int_mask, denali->flash_reg + INTR_EN3); 618 iowrite32(int_mask, denali->flash_reg + INTR_EN3);
633} 619}
634 620
635/* This function only returns when an interrupt that this driver cares about 621/* This function only returns when an interrupt that this driver cares about
@@ -648,7 +634,7 @@ static inline void clear_interrupt(struct denali_nand_info *denali,
648 634
649 intr_status_reg = intr_status_addresses[denali->flash_bank]; 635 intr_status_reg = intr_status_addresses[denali->flash_bank];
650 636
651 denali_write32(irq_mask, denali->flash_reg + intr_status_reg); 637 iowrite32(irq_mask, denali->flash_reg + intr_status_reg);
652} 638}
653 639
654static void clear_interrupts(struct denali_nand_info *denali) 640static void clear_interrupts(struct denali_nand_info *denali)
@@ -800,8 +786,8 @@ static void setup_ecc_for_xfer(struct denali_nand_info *denali, bool ecc_en,
800 transfer_spare_flag = transfer_spare ? TRANSFER_SPARE_REG__FLAG : 0; 786 transfer_spare_flag = transfer_spare ? TRANSFER_SPARE_REG__FLAG : 0;
801 787
802 /* Enable spare area/ECC per user's request. */ 788 /* Enable spare area/ECC per user's request. */
803 denali_write32(ecc_en_flag, denali->flash_reg + ECC_ENABLE); 789 iowrite32(ecc_en_flag, denali->flash_reg + ECC_ENABLE);
804 denali_write32(transfer_spare_flag, 790 iowrite32(transfer_spare_flag,
805 denali->flash_reg + TRANSFER_SPARE_REG); 791 denali->flash_reg + TRANSFER_SPARE_REG);
806} 792}
807 793
@@ -844,14 +830,14 @@ static int denali_send_pipeline_cmd(struct denali_nand_info *denali,
844 830
845 if (op == DENALI_WRITE && access_type != SPARE_ACCESS) { 831 if (op == DENALI_WRITE && access_type != SPARE_ACCESS) {
846 cmd = MODE_01 | addr; 832 cmd = MODE_01 | addr;
847 denali_write32(cmd, denali->flash_mem); 833 iowrite32(cmd, denali->flash_mem);
848 } else if (op == DENALI_WRITE && access_type == SPARE_ACCESS) { 834 } else if (op == DENALI_WRITE && access_type == SPARE_ACCESS) {
849 /* read spare area */ 835 /* read spare area */
850 cmd = MODE_10 | addr; 836 cmd = MODE_10 | addr;
851 index_addr(denali, (uint32_t)cmd, access_type); 837 index_addr(denali, (uint32_t)cmd, access_type);
852 838
853 cmd = MODE_01 | addr; 839 cmd = MODE_01 | addr;
854 denali_write32(cmd, denali->flash_mem); 840 iowrite32(cmd, denali->flash_mem);
855 } else if (op == DENALI_READ) { 841 } else if (op == DENALI_READ) {
856 /* setup page read request for access type */ 842 /* setup page read request for access type */
857 cmd = MODE_10 | addr; 843 cmd = MODE_10 | addr;
@@ -863,7 +849,7 @@ static int denali_send_pipeline_cmd(struct denali_nand_info *denali,
863 */ 849 */
864 if (access_type == SPARE_ACCESS) { 850 if (access_type == SPARE_ACCESS) {
865 cmd = MODE_01 | addr; 851 cmd = MODE_01 | addr;
866 denali_write32(cmd, denali->flash_mem); 852 iowrite32(cmd, denali->flash_mem);
867 } else { 853 } else {
868 index_addr(denali, (uint32_t)cmd, 854 index_addr(denali, (uint32_t)cmd,
869 0x2000 | op | page_count); 855 0x2000 | op | page_count);
@@ -881,7 +867,7 @@ static int denali_send_pipeline_cmd(struct denali_nand_info *denali,
881 status = FAIL; 867 status = FAIL;
882 } else { 868 } else {
883 cmd = MODE_01 | addr; 869 cmd = MODE_01 | addr;
884 denali_write32(cmd, denali->flash_mem); 870 iowrite32(cmd, denali->flash_mem);
885 } 871 }
886 } 872 }
887 } 873 }
@@ -902,7 +888,7 @@ static int write_data_to_flash_mem(struct denali_nand_info *denali,
902 /* write the data to the flash memory */ 888 /* write the data to the flash memory */
903 buf32 = (uint32_t *)buf; 889 buf32 = (uint32_t *)buf;
904 for (i = 0; i < len / 4; i++) 890 for (i = 0; i < len / 4; i++)
905 denali_write32(*buf32++, denali->flash_mem + 0x10); 891 iowrite32(*buf32++, denali->flash_mem + 0x10);
906 return i*4; /* intent is to return the number of bytes read */ 892 return i*4; /* intent is to return the number of bytes read */
907} 893}
908 894
@@ -1100,7 +1086,7 @@ static void denali_enable_dma(struct denali_nand_info *denali, bool en)
1100 if (en) 1086 if (en)
1101 reg_val = DMA_ENABLE__FLAG; 1087 reg_val = DMA_ENABLE__FLAG;
1102 1088
1103 denali_write32(reg_val, denali->flash_reg + DMA_ENABLE); 1089 iowrite32(reg_val, denali->flash_reg + DMA_ENABLE);
1104 ioread32(denali->flash_reg + DMA_ENABLE); 1090 ioread32(denali->flash_reg + DMA_ENABLE);
1105} 1091}
1106 1092
@@ -1447,16 +1433,16 @@ static void denali_hw_init(struct denali_nand_info *denali)
1447 SPARE_AREA_SKIP_BYTES); 1433 SPARE_AREA_SKIP_BYTES);
1448 denali_irq_init(denali); 1434 denali_irq_init(denali);
1449 denali_nand_reset(denali); 1435 denali_nand_reset(denali);
1450 denali_write32(0x0F, denali->flash_reg + RB_PIN_ENABLED); 1436 iowrite32(0x0F, denali->flash_reg + RB_PIN_ENABLED);
1451 denali_write32(CHIP_EN_DONT_CARE__FLAG, 1437 iowrite32(CHIP_EN_DONT_CARE__FLAG,
1452 denali->flash_reg + CHIP_ENABLE_DONT_CARE); 1438 denali->flash_reg + CHIP_ENABLE_DONT_CARE);
1453 1439
1454 denali_write32(0x0, denali->flash_reg + SPARE_AREA_SKIP_BYTES); 1440 iowrite32(0x0, denali->flash_reg + SPARE_AREA_SKIP_BYTES);
1455 denali_write32(0xffff, denali->flash_reg + SPARE_AREA_MARKER); 1441 iowrite32(0xffff, denali->flash_reg + SPARE_AREA_MARKER);
1456 1442
1457 /* Should set value for these registers when init */ 1443 /* Should set value for these registers when init */
1458 denali_write32(0, denali->flash_reg + TWO_ROW_ADDR_CYCLES); 1444 iowrite32(0, denali->flash_reg + TWO_ROW_ADDR_CYCLES);
1459 denali_write32(1, denali->flash_reg + ECC_ENABLE); 1445 iowrite32(1, denali->flash_reg + ECC_ENABLE);
1460} 1446}
1461 1447
1462/* Althogh controller spec said SLC ECC is forceb to be 4bit, 1448/* Althogh controller spec said SLC ECC is forceb to be 4bit,
@@ -1718,7 +1704,7 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
1718 /* if MLC OOB size is large enough, use 15bit ECC*/ 1704 /* if MLC OOB size is large enough, use 15bit ECC*/
1719 denali->nand.ecc.layout = &nand_15bit_oob; 1705 denali->nand.ecc.layout = &nand_15bit_oob;
1720 denali->nand.ecc.bytes = ECC_15BITS; 1706 denali->nand.ecc.bytes = ECC_15BITS;
1721 denali_write32(15, denali->flash_reg + ECC_CORRECTION); 1707 iowrite32(15, denali->flash_reg + ECC_CORRECTION);
1722 } else if (denali->mtd.oobsize < (denali->bbtskipbytes + 1708 } else if (denali->mtd.oobsize < (denali->bbtskipbytes +
1723 ECC_8BITS * (denali->mtd.writesize / 1709 ECC_8BITS * (denali->mtd.writesize /
1724 ECC_SECTOR_SIZE))) { 1710 ECC_SECTOR_SIZE))) {
@@ -1728,7 +1714,7 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
1728 } else { 1714 } else {
1729 denali->nand.ecc.layout = &nand_8bit_oob; 1715 denali->nand.ecc.layout = &nand_8bit_oob;
1730 denali->nand.ecc.bytes = ECC_8BITS; 1716 denali->nand.ecc.bytes = ECC_8BITS;
1731 denali_write32(8, denali->flash_reg + ECC_CORRECTION); 1717 iowrite32(8, denali->flash_reg + ECC_CORRECTION);
1732 } 1718 }
1733 1719
1734 denali->nand.ecc.bytes *= denali->devnum; 1720 denali->nand.ecc.bytes *= denali->devnum;