| OLD | NEW |
| (Empty) | |
| 1 /* |
| 2 * (C) Copyright 2006 Detlev Zundel, dzu@denx.de |
| 3 * (C) Copyright 2006 DENX Software Engineering |
| 4 * (C) Copyright 2011 NVIDIA Corporation <www.nvidia.com> |
| 5 * |
| 6 * See file CREDITS for list of people who contributed to this |
| 7 * project. |
| 8 * |
| 9 * This program is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU General Public License as |
| 11 * published by the Free Software Foundation; either version 2 of |
| 12 * the License, or (at your option) any later version. |
| 13 * |
| 14 * This program is distributed in the hope that it will be useful, |
| 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 * GNU General Public License for more details. |
| 18 * |
| 19 * You should have received a copy of the GNU General Public License |
| 20 * along with this program; if not, write to the Free Software |
| 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 22 * MA 02111-1307 USA |
| 23 */ |
| 24 |
| 25 #include <common.h> |
| 26 #include <asm/io.h> |
| 27 #include <nand.h> |
| 28 #include <asm/arch/gpio.h> |
| 29 #include <asm/arch/nvcommon.h> |
| 30 #include "../board.h" |
| 31 #include "tegra2_nand.h" |
| 32 |
| 33 #define NAND_PIO_CMD_TIMEOUT_MS 100 |
| 34 static int byte_count; |
| 35 |
| 36 static struct nand_ecclayout nand_soft_eccoob = { |
| 37 .oobfree = { |
| 38 {.offset = 40, .length = 24 }} |
| 39 }; |
| 40 |
| 41 /** |
| 42 * tegra2_nand_read_byte - [DEFAULT] read one byte from the chip |
| 43 * @mtd: MTD device structure |
| 44 * |
| 45 * Default read function for 8bit bus-width |
| 46 */ |
| 47 static uint8_t tegra2_nand_read_byte(struct mtd_info *mtd) |
| 48 { |
| 49 struct nand_chip *chip = mtd->priv; |
| 50 int dword_read; |
| 51 |
| 52 dword_read = readl(chip->IO_ADDR_R + NAND_RESP_0); |
| 53 dword_read = dword_read >> (8 * byte_count); |
| 54 byte_count ++; |
| 55 return (uint8_t) dword_read; |
| 56 } |
| 57 |
| 58 /** |
| 59 * tegra2_nand_write_buf - [DEFAULT] write buffer to chip |
| 60 * @mtd: MTD device structure |
| 61 * @buf: data buffer |
| 62 * @len: number of bytes to write |
| 63 * |
| 64 * Default write function for 8bit bus-width |
| 65 */ |
| 66 static void tegra2_nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, |
| 67 int len) |
| 68 { |
| 69 int i, j, l, l2; |
| 70 struct nand_chip *chip = mtd->priv; |
| 71 |
| 72 for (i = 0; i < len/4; i++) |
| 73 { |
| 74 l = ((int *)buf)[i]; |
| 75 writel(l, chip->IO_ADDR_W+ NAND_RESP_0); |
| 76 writel(NAND_CMD_GO+ NAND_CMD_PIO+ NAND_CMD_TX+ |
| 77 (NAND_CMD_TRANS_SIZE_BYTES4<<NAND_CMD_TRANS_SIZE_SHIFT) |
| 78 + NAND_CMD_A_VALID+ NAND_CMD_CE0, |
| 79 chip->IO_ADDR_W+ NAND_COMMAND_0); |
| 80 |
| 81 if (!tegra2_nand_waitfor_GO_cleared(mtd)) |
| 82 printf("Command timeout during write_buf\n"); |
| 83 } |
| 84 if ((len % 4) != 0) |
| 85 { |
| 86 l = 0; |
| 87 for (j=0; j<(len %4); j++) |
| 88 { |
| 89 l2 = (int) buf[i*4+j]; |
| 90 l |= (l2<< (8*j)); |
| 91 } |
| 92 writel(l, chip->IO_ADDR_W+ NAND_RESP_0); |
| 93 writel(NAND_CMD_GO+ NAND_CMD_PIO+NAND_CMD_TX+ |
| 94 (((len % 4)-1)<<NAND_CMD_TRANS_SIZE_SHIFT)+ |
| 95 NAND_CMD_A_VALID+ NAND_CMD_CE0, |
| 96 chip->IO_ADDR_W+ NAND_COMMAND_0); |
| 97 if (!tegra2_nand_waitfor_GO_cleared(mtd)) |
| 98 printf("Command timeout during write_buf\n"); |
| 99 } |
| 100 } |
| 101 |
| 102 /** |
| 103 * tegra2_nand_read_buf - [DEFAULT] read chip data into buffer |
| 104 * @mtd: MTD device structure |
| 105 * @buf: buffer to store date |
| 106 * @len: number of bytes to read |
| 107 * |
| 108 * Default read function for 8bit bus-width |
| 109 */ |
| 110 static void tegra2_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) |
| 111 { |
| 112 int i, j, l; |
| 113 struct nand_chip *chip = mtd->priv; |
| 114 int *buf_dword; |
| 115 |
| 116 buf_dword = (int *) buf; |
| 117 for (i = 0; i < len/4; i++) |
| 118 { |
| 119 writel(NAND_CMD_GO+ NAND_CMD_PIO+ NAND_CMD_RX+ |
| 120 (NAND_CMD_TRANS_SIZE_BYTES4<<NAND_CMD_TRANS_SIZE_SHIFT) |
| 121 + NAND_CMD_A_VALID+ NAND_CMD_CE0, |
| 122 chip->IO_ADDR_W+ NAND_COMMAND_0); |
| 123 if (!tegra2_nand_waitfor_GO_cleared(mtd)) |
| 124 printf("Command timeout during read_buf\n"); |
| 125 l = readl(chip->IO_ADDR_R+ NAND_RESP_0); |
| 126 buf_dword[i] = l; |
| 127 } |
| 128 if ((len % 4) != 0) |
| 129 { |
| 130 writel(NAND_CMD_GO+ NAND_CMD_PIO+NAND_CMD_RX+ |
| 131 (((len % 4)-1)<<NAND_CMD_TRANS_SIZE_SHIFT)+ |
| 132 NAND_CMD_A_VALID+ NAND_CMD_CE0, |
| 133 chip->IO_ADDR_W + NAND_COMMAND_0); |
| 134 if (!tegra2_nand_waitfor_GO_cleared(mtd)) |
| 135 printf("Command timeout during read_buf\n"); |
| 136 l = readl(chip->IO_ADDR_R+ NAND_RESP_0); |
| 137 for (j=0; j<(len %4); j++) |
| 138 { |
| 139 buf[i*4+j] = (char) (l>>(8*j)); |
| 140 } |
| 141 } |
| 142 } |
| 143 |
| 144 /* |
| 145 * = 1 - ready |
| 146 * 0 - not ready |
| 147 */ |
| 148 static int tegra2_nand_waitfor_GO_cleared(struct mtd_info *mtd) |
| 149 { |
| 150 struct nand_chip *this = mtd->priv; |
| 151 int i; |
| 152 |
| 153 for (i=0; i< NAND_PIO_CMD_TIMEOUT_MS * 1000; i++) |
| 154 { |
| 155 if (!(readl(this->IO_ADDR_R + NAND_CMD_REG1_0) & NAND_CMD_GO)) |
| 156 break; |
| 157 else |
| 158 udelay(1); |
| 159 } |
| 160 if (i== NAND_PIO_CMD_TIMEOUT_MS * 1000) |
| 161 return 0; |
| 162 return 1; |
| 163 } |
| 164 |
| 165 /* |
| 166 * = 1 - ready |
| 167 * 0 - not ready |
| 168 */ |
| 169 static int tegra2_nand_dev_ready(struct mtd_info *mtd) |
| 170 { |
| 171 register struct nand_chip *chip = mtd->priv; |
| 172 int status; |
| 173 |
| 174 writel(NAND_CMD_STATUS, chip->IO_ADDR_W + NAND_CMD_REG1_0); |
| 175 writel(NAND_CMD_GO+ NAND_CMD_CLE+ NAND_CMD_PIO+ NAND_CMD_RX+ |
| 176 (NAND_CMD_TRANS_SIZE_BYTES1<<NAND_CMD_TRANS_SIZE_SHIFT)+ |
| 177 NAND_CMD_CE0, |
| 178 chip->IO_ADDR_W+ NAND_COMMAND_0); |
| 179 if (!(tegra2_nand_waitfor_GO_cleared(mtd))) |
| 180 printf("NAND_CMD_STATUS command timeout\n"); |
| 181 udelay(1); |
| 182 status = readl(chip->IO_ADDR_R + NAND_RESP_0); |
| 183 if (status & NAND_STATUS_READY) |
| 184 return 1; |
| 185 return 0; |
| 186 } |
| 187 |
| 188 /* |
| 189 * hardware specific access to control-lines |
| 190 */ |
| 191 static void tegra2_nand_hwcontrol(struct mtd_info *mtd, int cmd, |
| 192 unsigned int ctrl) |
| 193 { |
| 194 } |
| 195 |
| 196 /** |
| 197 * tegra2_nand_command - [DEFAULT] Send command to NAND device |
| 198 * @mtd: MTD device structure |
| 199 * @command: the command to be sent |
| 200 * @column: the column address for this command, -1 if none |
| 201 * @page_addr: the page address for this command, -1 if none |
| 202 */ |
| 203 static void tegra2_nand_command(struct mtd_info *mtd, unsigned int command, |
| 204 int column, int page_addr) |
| 205 { |
| 206 register struct nand_chip *chip = mtd->priv; |
| 207 |
| 208 /* |
| 209 * Write out the command to the device. |
| 210 */ |
| 211 if (mtd->writesize < 2048) { |
| 212 /* Only command NAND_CMD_RESET or NAND_CMD_READID will come |
| 213 * here before mtd->writesize is initialized, we don't have |
| 214 * any action here because page size of NAND HY27UF084G2B |
| 215 * is 2048 bytes and mtd->writesize will be 2048 after |
| 216 * initialized. */ |
| 217 } |
| 218 else |
| 219 { |
| 220 /* Emulate NAND_CMD_READOOB */ |
| 221 if (command == NAND_CMD_READOOB) |
| 222 { |
| 223 column += mtd->writesize; |
| 224 command = NAND_CMD_READ0; |
| 225 } |
| 226 |
| 227 if (column != -1 || page_addr != -1) |
| 228 { |
| 229 /* Serially input address */ |
| 230 if (column != -1) |
| 231 { |
| 232 /* Adjust columns for 16 bit buswidth */ |
| 233 if (chip->options & NAND_BUSWIDTH_16) |
| 234 column >>= 1; |
| 235 } |
| 236 } |
| 237 } |
| 238 |
| 239 /* |
| 240 * program and erase have their own busy handlers |
| 241 * status and sequential in needs no delay |
| 242 */ |
| 243 switch (command) { |
| 244 case NAND_CMD_READID: |
| 245 writel(NAND_CMD_READID, chip->IO_ADDR_W + NAND_CMD_REG1_0); |
| 246 writel(NAND_CMD_GO+ NAND_CMD_CLE+ NAND_CMD_ALE+ NAND_CMD_PIO+ |
| 247 NAND_CMD_RX+ |
| 248 (NAND_CMD_TRANS_SIZE_BYTES4<<NAND_CMD_TRANS_SIZE_SHIFT) |
| 249 + NAND_CMD_CE0, |
| 250 chip->IO_ADDR_W + NAND_COMMAND_0); |
| 251 byte_count = 0; |
| 252 break; |
| 253 case NAND_CMD_READ0: |
| 254 writel(NAND_CMD_READ0, chip->IO_ADDR_W + NAND_CMD_REG1_0); |
| 255 writel(NAND_CMD_READSTART, chip->IO_ADDR_W + NAND_CMD_REG2_0); |
| 256 writel((page_addr <<16)+ (column & 0xFFFF), |
| 257 chip->IO_ADDR_W+ NAND_ADDR_REG1_0); |
| 258 writel(page_addr >>16, chip->IO_ADDR_W + NAND_ADDR_REG2_0); |
| 259 writel(NAND_CMD_GO+ NAND_CMD_CLE+ NAND_CMD_ALE+ NAND_CMD_PIO+ |
| 260 NAND_CMD_SEC_CMD+ NAND_CMD_CE0+ NAND_CMD_ALE_BYTES5, |
| 261 chip->IO_ADDR_W+ NAND_COMMAND_0); |
| 262 byte_count = 0; |
| 263 break; |
| 264 case NAND_CMD_SEQIN: |
| 265 writel(NAND_CMD_SEQIN, chip->IO_ADDR_W + NAND_CMD_REG1_0); |
| 266 writel(NAND_CMD_PAGEPROG, chip->IO_ADDR_W + NAND_CMD_REG2_0); |
| 267 writel((page_addr <<16)+ (column & 0xFFFF), |
| 268 chip->IO_ADDR_W+ NAND_ADDR_REG1_0); |
| 269 writel(page_addr >>16, chip->IO_ADDR_W + NAND_ADDR_REG2_0); |
| 270 writel(NAND_CMD_GO+ NAND_CMD_CLE+ NAND_CMD_ALE+ NAND_CMD_PIO+ |
| 271 NAND_CMD_SEC_CMD+ NAND_CMD_AFT_DAT+ NAND_CMD_CE0+ |
| 272 NAND_CMD_ALE_BYTES5, |
| 273 chip->IO_ADDR_W+ NAND_COMMAND_0); |
| 274 break; |
| 275 case NAND_CMD_PAGEPROG: |
| 276 writel(NAND_CMD_PAGEPROG, chip->IO_ADDR_W + NAND_CMD_REG1_0); |
| 277 writel(NAND_CMD_GO+NAND_CMD_CLE+NAND_CMD_CE0, |
| 278 chip->IO_ADDR_W + NAND_COMMAND_0); |
| 279 break; |
| 280 case NAND_CMD_ERASE1: |
| 281 writel(NAND_CMD_ERASE1, chip->IO_ADDR_W + NAND_CMD_REG1_0); |
| 282 writel(NAND_CMD_ERASE2, chip->IO_ADDR_W + NAND_CMD_REG2_0); |
| 283 writel(page_addr, chip->IO_ADDR_W + NAND_ADDR_REG1_0); |
| 284 writel(NAND_CMD_GO+ NAND_CMD_CLE+ NAND_CMD_ALE+ |
| 285 NAND_CMD_SEC_CMD+ NAND_CMD_CE0+ NAND_CMD_ALE_BYTES3, |
| 286 chip->IO_ADDR_W+ NAND_COMMAND_0); |
| 287 break; |
| 288 case NAND_CMD_RNDOUT: |
| 289 writel(NAND_CMD_RNDOUT, chip->IO_ADDR_W + NAND_CMD_REG1_0); |
| 290 writel(NAND_CMD_RNDOUTSTART, chip->IO_ADDR_W + NAND_CMD_REG2_0); |
| 291 writel((column & 0xFFFF), chip->IO_ADDR_W + NAND_ADDR_REG1_0); |
| 292 writel(NAND_CMD_GO+ NAND_CMD_CLE+ NAND_CMD_ALE+ NAND_CMD_PIO+ |
| 293 NAND_CMD_SEC_CMD+ NAND_CMD_CE0+ NAND_CMD_ALE_BYTES2, |
| 294 chip->IO_ADDR_W+ NAND_COMMAND_0); |
| 295 break; |
| 296 case NAND_CMD_ERASE2: |
| 297 return; |
| 298 case NAND_CMD_STATUS: |
| 299 writel(NAND_CMD_STATUS, chip->IO_ADDR_W + NAND_CMD_REG1_0); |
| 300 writel(NAND_CMD_GO+ NAND_CMD_CLE+ NAND_CMD_PIO+ NAND_CMD_RX+ |
| 301 (NAND_CMD_TRANS_SIZE_BYTES1<<NAND_CMD_TRANS_SIZE_SHIFT) |
| 302 +NAND_CMD_CE0, |
| 303 chip->IO_ADDR_W+ NAND_COMMAND_0); |
| 304 byte_count = 0; |
| 305 break; |
| 306 |
| 307 case NAND_CMD_RESET: |
| 308 writel(NAND_CMD_RESET, chip->IO_ADDR_W + NAND_CMD_REG1_0); |
| 309 writel(NAND_CMD_GO+NAND_CMD_CLE+NAND_CMD_CE0, |
| 310 chip->IO_ADDR_W + NAND_COMMAND_0); |
| 311 break; |
| 312 default: |
| 313 /* |
| 314 * If we don't have access to the busy pin, we apply the given |
| 315 * command delay |
| 316 */ |
| 317 if (!chip->dev_ready) |
| 318 { |
| 319 udelay(chip->chip_delay); |
| 320 return; |
| 321 } |
| 322 } |
| 323 if (!tegra2_nand_waitfor_GO_cleared(mtd)) |
| 324 printf("Command 0x%02X timeout\n", command); |
| 325 |
| 326 if (command == NAND_CMD_READ0) |
| 327 #ifdef CONFIG_NAND_tR_US |
| 328 udelay(CONFIG_NAND_tR_US); |
| 329 #else |
| 330 udelay(25); |
| 331 #endif |
| 332 else |
| 333 udelay(1); |
| 334 } |
| 335 |
| 336 /* |
| 337 * Board-specific NAND initialization. The following members of the |
| 338 * argument are board-specific (per include/linux/mtd/nand.h): |
| 339 * - IO_ADDR_R?: address to read the 8 I/O lines of the flash device |
| 340 * - IO_ADDR_W?: address to write the 8 I/O lines of the flash device |
| 341 * - cmd_ctrl: hardwarespecific function for accesing control-lines |
| 342 * - dev_ready: hardwarespecific function for accesing device ready/busy line |
| 343 * - enable_hwecc?: function to enable (reset) hardware ecc generator. Must |
| 344 * only be provided if a hardware ECC is available |
| 345 * - eccm.ode: mode of ecc, see defines |
| 346 * - chip_delay: chip dependent delay for transfering data from array to |
| 347 * read regs (tR) |
| 348 * - options: various chip options. They can partly be set to inform |
| 349 * nand_scan about special functionality. See the defines for further |
| 350 * explanation |
| 351 * Members with a "?" were not set in the merged testing-NAND branch, |
| 352 * so they are not set here either. |
| 353 */ |
| 354 int board_nand_init(struct nand_chip *nand) |
| 355 { |
| 356 int RegVal; |
| 357 |
| 358 /* Assert RESET to NAND controller */ |
| 359 RegVal = readl(NV_ADDRESS_MAP_CLK_RST_BASE + |
| 360 CLK_RST_CONTROLLER_RST_DEVICES_L_0); |
| 361 RegVal |= (1 << |
| 362 CLK_RST_CONTROLLER_RST_DEVICES_L_0_SWR_NDFLASH_RST_SHIFT); |
| 363 writel(RegVal, NV_ADDRESS_MAP_CLK_RST_BASE + |
| 364 CLK_RST_CONTROLLER_RST_DEVICES_L_0); |
| 365 |
| 366 /* enable clock to NAND controller */ |
| 367 RegVal = readl(NV_ADDRESS_MAP_CLK_RST_BASE + |
| 368 CLK_RST_CONTROLLER_CLK_OUT_ENB_L_0); |
| 369 RegVal |= (1 << |
| 370 CLK_RST_CONTROLLER_CLK_OUT_ENB_L_0_CLK_ENB_NDFLASH_SHIFT); |
| 371 writel(RegVal, NV_ADDRESS_MAP_CLK_RST_BASE + |
| 372 CLK_RST_CONTROLLER_CLK_OUT_ENB_L_0); |
| 373 |
| 374 /* Set clock divisor |
| 375 * 7 bits of d and 1 bit of h |
| 376 * divisor= (ddddddd + 1) + (h x 0.5) */ |
| 377 RegVal = readl(NV_ADDRESS_MAP_CLK_RST_BASE + |
| 378 CLK_RST_CONTROLLER_CLK_SOURCE_NDFLASH_0); |
| 379 RegVal &= |
| 380 ~CLK_RST_CONTROLLER_CLK_SOURCE_NDFLASH_0_NDFLASH_CLK_DIVISOR_MASK; |
| 381 /* 6 means the divisor is 4 based on above calculation */ |
| 382 RegVal |= 6; |
| 383 writel(RegVal, NV_ADDRESS_MAP_CLK_RST_BASE + |
| 384 CLK_RST_CONTROLLER_CLK_SOURCE_NDFLASH_0); |
| 385 udelay(1); |
| 386 |
| 387 /* Set clock source as PLLP_OUT0 */ |
| 388 RegVal = readl(NV_ADDRESS_MAP_CLK_RST_BASE + |
| 389 CLK_RST_CONTROLLER_CLK_SOURCE_NDFLASH_0); |
| 390 RegVal &= ~( |
| 391 CLK_RST_CONTROLLER_CLK_SOURCE_NDFLASH_0_NDFLASH_CLK_SRC_MASK << |
| 392 CLK_RST_CONTROLLER_CLK_SOURCE_NDFLASH_0_NDFLASH_CLK_SRC_SHIFT); |
| 393 RegVal |= |
| 394 CLK_RST_CONTROLLER_CLK_SOURCE_NDFLASH_0_NDFLASH_CLK_SRC_PLLP_OUT0; |
| 395 writel(RegVal, NV_ADDRESS_MAP_CLK_RST_BASE + |
| 396 CLK_RST_CONTROLLER_CLK_SOURCE_NDFLASH_0); |
| 397 udelay(2); |
| 398 |
| 399 /* Deassert RESET to NAND controller */ |
| 400 RegVal = readl(NV_ADDRESS_MAP_CLK_RST_BASE + |
| 401 CLK_RST_CONTROLLER_RST_DEVICES_L_0); |
| 402 RegVal &= ~(1 << |
| 403 CLK_RST_CONTROLLER_RST_DEVICES_L_0_SWR_NDFLASH_RST_SHIFT); |
| 404 writel(RegVal, NV_ADDRESS_MAP_CLK_RST_BASE + |
| 405 CLK_RST_CONTROLLER_RST_DEVICES_L_0); |
| 406 |
| 407 /* pinmux ATC_SEL uses NAND */ |
| 408 RegVal = readl(NV_ADDRESS_MAP_APB_MISC_BASE + |
| 409 APB_MISC_PP_PIN_MUX_CTL_A_0); |
| 410 RegVal &= ~(APB_MISC_PP_PIN_MUX_CTL_A_0_ATC_SEL_DEFAULT_MASK |
| 411 << APB_MISC_PP_PIN_MUX_CTL_A_0_ATC_SEL_SHIFT); |
| 412 RegVal |= (APB_MISC_PP_PIN_MUX_CTL_A_0_ATC_SEL_NAND |
| 413 << APB_MISC_PP_PIN_MUX_CTL_A_0_ATC_SEL_SHIFT); |
| 414 writel(RegVal, NV_ADDRESS_MAP_APB_MISC_BASE + |
| 415 APB_MISC_PP_PIN_MUX_CTL_A_0); |
| 416 |
| 417 RegVal = NAND_CONFIG_BUS_WIDTH_8BIT + NAND_CONFIG_PAGE_SIZE_2048; |
| 418 writel(RegVal, NAND_BASE + NAND_CONFIG_0); |
| 419 |
| 420 /* Frequence output of PLLP_OUT0 is set by BOOTROM to 216MHz |
| 421 * to CLK_RST_CONTROLLER_PLLP_BASE_0, |
| 422 * 216MHz / divisor 4 = 54MHZ |
| 423 * 1 clock = 18.5 ns */ |
| 424 |
| 425 /* Set timing for NAND device, defined in tegra2_seaboard.h. |
| 426 * If not defined, then use timing that was set by BOOTROM. */ |
| 427 #ifdef CONFIG_TEGRA2_NAND_TIMING |
| 428 writel(CONFIG_TEGRA2_NAND_TIMING, NAND_BASE + NAND_TIMING_0); |
| 429 #endif |
| 430 #ifdef CONFIG_TEGRA2_NAND_TIMING2 |
| 431 writel(CONFIG_TEGRA2_NAND_TIMING2, NAND_BASE + NAND_TIMING2_0); |
| 432 #endif |
| 433 #if (LINUX_MACH_TYPE == MACH_TYPE_SEABOARD) |
| 434 /* GPIO port H bit 3, H.03, GMI_AD11->MFG_MODE_R, */ |
| 435 tg2_gpio_direction_output(7, 3, 1); |
| 436 #endif |
| 437 #if (LINUX_MACH_TYPE == MACH_TYPE_HARMONY) |
| 438 /* GPIO port C bit 7, C.07, GMI_WP->NAND_WP */ |
| 439 tg2_gpio_direction_output(2, 7, 1); |
| 440 #endif |
| 441 nand->cmd_ctrl = tegra2_nand_hwcontrol; |
| 442 nand->dev_ready = tegra2_nand_dev_ready; |
| 443 nand->ecc.mode = NAND_ECC_NONE; |
| 444 nand->ecc.layout = &nand_soft_eccoob; |
| 445 nand->options = LP_OPTIONS; |
| 446 nand->cmdfunc = tegra2_nand_command; |
| 447 nand->read_byte = tegra2_nand_read_byte; |
| 448 nand->read_buf = tegra2_nand_read_buf; |
| 449 nand->write_buf = tegra2_nand_write_buf; |
| 450 return 0; |
| 451 } |
| OLD | NEW |