Lines Matching refs:onenand
67 static struct s3c_onenand *onenand; variable
71 return readl(onenand->ahb_addr + cmd); in s3c_read_cmd()
76 writel(value, onenand->ahb_addr + cmd); in s3c_write_cmd()
101 writel(ONENAND_MEM_RESET_COLD, &onenand->reg->mem_reset); in s3c_onenand_reset()
103 stat = readl(&onenand->reg->int_err_stat); in s3c_onenand_reset()
107 stat = readl(&onenand->reg->int_err_stat); in s3c_onenand_reset()
108 writel(stat, &onenand->reg->int_err_ack); in s3c_onenand_reset()
111 writel(0x0, &onenand->reg->int_err_ack); in s3c_onenand_reset()
113 writel(0x0, &onenand->reg->ecc_err_stat); in s3c_onenand_reset()
118 struct onenand_chip *this = onenand->mtd->priv; in s3c_onenand_readw()
126 return readl(&onenand->reg->manufact_id); in s3c_onenand_readw()
128 return readl(&onenand->reg->device_id); in s3c_onenand_readw()
130 return readl(&onenand->reg->flash_ver_id); in s3c_onenand_readw()
132 return readl(&onenand->reg->data_buf_size); in s3c_onenand_readw()
134 return readl(&onenand->reg->tech); in s3c_onenand_readw()
136 return readl(&onenand->reg->mem_cfg); in s3c_onenand_readw()
150 if (reg < ONENAND_DATARAM && onenand->bootram_command) { in s3c_onenand_readw()
152 return readl(&onenand->reg->manufact_id); in s3c_onenand_readw()
154 return readl(&onenand->reg->device_id); in s3c_onenand_readw()
156 return readl(&onenand->reg->flash_ver_id); in s3c_onenand_readw()
167 struct onenand_chip *this = onenand->mtd->priv; in s3c_onenand_writew()
174 writel(value, &onenand->reg->mem_cfg); in s3c_onenand_writew()
192 onenand->bootram_command = 1; in s3c_onenand_writew()
197 &onenand->reg->mem_reset); in s3c_onenand_writew()
198 onenand->bootram_command = 0; in s3c_onenand_writew()
233 stat = readl(&onenand->reg->int_err_stat); in s3c_onenand_wait()
239 stat = readl(&onenand->reg->int_err_stat); in s3c_onenand_wait()
240 writel(stat, &onenand->reg->int_err_ack); in s3c_onenand_wait()
248 ecc = readl(&onenand->reg->ecc_err_stat); in s3c_onenand_wait()
284 mem_addr = onenand->mem_addr(fba, fpa, fsa); in s3c_onenand_command()
300 m = (unsigned int *) onenand->page_buf; in s3c_onenand_command()
301 s = (unsigned int *) onenand->oob_buf; in s3c_onenand_command()
319 writel(TSRF, &onenand->reg->trans_spare); in s3c_onenand_command()
328 writel(0, &onenand->reg->trans_spare); in s3c_onenand_command()
338 writel(TSRF, &onenand->reg->trans_spare); in s3c_onenand_command()
348 writel(0, &onenand->reg->trans_spare); in s3c_onenand_command()
381 p = (unsigned char *) onenand->page_buf; in s3c_get_bufferram()
385 p = (unsigned char *) onenand->oob_buf; in s3c_get_bufferram()
417 struct samsung_onenand *reg = (struct samsung_onenand *)onenand->base; in s3c_onenand_bbt_wait()
428 stat = readl(&onenand->reg->int_err_stat); in s3c_onenand_bbt_wait()
429 writel(stat, &onenand->reg->int_err_ack); in s3c_onenand_bbt_wait()
437 int ecc = readl(&onenand->reg->ecc_err_stat); in s3c_onenand_bbt_wait()
455 s3c_read_cmd(CMD_MAP_01(onenand->mem_addr(block, 0, 0))); in s3c_onenand_check_lock_status()
457 if (readl(&onenand->reg->int_err_stat) & LOCKED_BLK) { in s3c_onenand_check_lock_status()
459 writel(LOCKED_BLK, &onenand->reg->int_err_ack); in s3c_onenand_check_lock_status()
471 start_mem_addr = onenand->mem_addr(start, 0, 0); in s3c_onenand_do_lock_cmd()
473 end_mem_addr = onenand->mem_addr(end, 0, 0); in s3c_onenand_do_lock_cmd()
533 onenand = malloc(sizeof(struct s3c_onenand)); in s3c_onenand_init()
534 if (!onenand) in s3c_onenand_init()
537 onenand->page_buf = malloc(size * sizeof(char)); in s3c_onenand_init()
538 if (!onenand->page_buf) in s3c_onenand_init()
540 memset(onenand->page_buf, 0xff, size); in s3c_onenand_init()
542 onenand->oob_buf = malloc(128 * sizeof(char)); in s3c_onenand_init()
543 if (!onenand->oob_buf) in s3c_onenand_init()
545 memset(onenand->oob_buf, 0xff, 128); in s3c_onenand_init()
547 onenand->mtd = mtd; in s3c_onenand_init()
550 onenand->base = (void *)0xE7100000; in s3c_onenand_init()
551 onenand->ahb_addr = (void *)0xB0000000; in s3c_onenand_init()
553 onenand->mem_addr = s3c_mem_addr; in s3c_onenand_init()
554 onenand->reg = (struct samsung_onenand *)onenand->base; in s3c_onenand_init()