-#else
- u8 hwctl_org = hwctl;
- unsigned long timeo;
- u8 val;
-
- hwctl = 0x01;
- pdnb3_nand_write_byte (mtd, NAND_CMD_STATUS);
- hwctl = hwctl_org;
-
- reset_timer();
- while (1) {
- if (get_timer(0) > timeo) {
- printf("Timeout!");
- return 0;
- }
-
-val = pdnb3_nand_read_byte(mtd);
-/*printf("%s val: %x\n", __FUNCTION__, val);*/
- if (val & NAND_STATUS_READY)
- break;
- }
- return 1;
-#endif
-
-}
-
-static void alpr_select_chip(struct mtd_info *mtd, int chip)
-{
- alpr_chip = chip;
-}
-
-static int alpr_nand_wait(struct mtd_info *mtd, struct nand_chip *this, int state)
-{
- unsigned long timeo;
-
- if (state == FL_ERASING)
- timeo = CFG_HZ * 400;
- else
- timeo = CFG_HZ * 20;
-
- if ((state == FL_ERASING) && (this->options & NAND_IS_AND))
- this->cmdfunc(mtd, NAND_CMD_STATUS_MULTI, -1, -1);
- else
- this->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
-
- reset_timer();
-
- while (1) {
- if (get_timer(0) > timeo) {
- printf("Timeout!");
- return 0;
- }
-
- if (this->read_byte(mtd) & NAND_STATUS_READY)
- break;
- }
- return this->read_byte(mtd);