• Home
  • Raw
  • Download

Lines Matching refs:geom

198 #define NS_IS_INITIALIZED(ns) ((ns)->geom.totsz != 0)
208 (((ns)->regs.row << (ns)->geom.pgshift) + ((ns)->regs.row * (ns)->geom.oobsz) + (ns)->regs.column)
211 #define NS_RAW_OFFSET_OOB(ns) (NS_RAW_OFFSET(ns) + ns->geom.pgsz)
343 } geom; member
589 ns->pages_written = vzalloc(ns->geom.pgnum); in alloc_device()
595 ns->file_buf = kmalloc(ns->geom.pgszoob, GFP_KERNEL); in alloc_device()
605 ns->pages = vmalloc(ns->geom.pgnum * sizeof(union ns_mem)); in alloc_device()
610 for (i = 0; i < ns->geom.pgnum; i++) { in alloc_device()
614 ns->geom.pgszoob, 0, 0, NULL); in alloc_device()
644 for (i = 0; i < ns->geom.pgnum; i++) { in free_device()
684 ns->geom.totsz = mtd->size; in init_nandsim()
685 ns->geom.pgsz = mtd->writesize; in init_nandsim()
686 ns->geom.oobsz = mtd->oobsize; in init_nandsim()
687 ns->geom.secsz = mtd->erasesize; in init_nandsim()
688 ns->geom.pgszoob = ns->geom.pgsz + ns->geom.oobsz; in init_nandsim()
689 ns->geom.pgnum = div_u64(ns->geom.totsz, ns->geom.pgsz); in init_nandsim()
690 ns->geom.totszoob = ns->geom.totsz + (uint64_t)ns->geom.pgnum * ns->geom.oobsz; in init_nandsim()
691 ns->geom.secshift = ffs(ns->geom.secsz) - 1; in init_nandsim()
692 ns->geom.pgshift = chip->page_shift; in init_nandsim()
693 ns->geom.oobshift = ffs(ns->geom.oobsz) - 1; in init_nandsim()
694 ns->geom.pgsec = ns->geom.secsz / ns->geom.pgsz; in init_nandsim()
695 ns->geom.secszoob = ns->geom.secsz + ns->geom.oobsz * ns->geom.pgsec; in init_nandsim()
698 if (ns->geom.pgsz == 512) { in init_nandsim()
702 } else if (ns->geom.pgsz == 2048) { in init_nandsim()
704 } else if (ns->geom.pgsz == 4096) { in init_nandsim()
707 NS_ERR("init_nandsim: unknown page size %u\n", ns->geom.pgsz); in init_nandsim()
712 if (ns->geom.totsz <= (32 << 20)) { in init_nandsim()
713 ns->geom.pgaddrbytes = 3; in init_nandsim()
714 ns->geom.secaddrbytes = 2; in init_nandsim()
716 ns->geom.pgaddrbytes = 4; in init_nandsim()
717 ns->geom.secaddrbytes = 3; in init_nandsim()
720 if (ns->geom.totsz <= (128 << 20)) { in init_nandsim()
721 ns->geom.pgaddrbytes = 4; in init_nandsim()
722 ns->geom.secaddrbytes = 2; in init_nandsim()
724 ns->geom.pgaddrbytes = 5; in init_nandsim()
725 ns->geom.secaddrbytes = 3; in init_nandsim()
735 remains = ns->geom.totsz; in init_nandsim()
738 uint64_t part_sz = (uint64_t)parts[i] * ns->geom.secsz; in init_nandsim()
774 (unsigned long long)ns->geom.totsz >> 20); in init_nandsim()
775 printk("page size: %u bytes\n", ns->geom.pgsz); in init_nandsim()
776 printk("OOB area size: %u bytes\n", ns->geom.oobsz); in init_nandsim()
777 printk("sector size: %u KiB\n", ns->geom.secsz >> 10); in init_nandsim()
778 printk("pages number: %u\n", ns->geom.pgnum); in init_nandsim()
779 printk("pages per sector: %u\n", ns->geom.pgsec); in init_nandsim()
781 printk("bits in sector size: %u\n", ns->geom.secshift); in init_nandsim()
782 printk("bits in page size: %u\n", ns->geom.pgshift); in init_nandsim()
783 printk("bits in OOB size: %u\n", ns->geom.oobshift); in init_nandsim()
785 (unsigned long long)ns->geom.totszoob >> 10); in init_nandsim()
786 printk("page address bytes: %u\n", ns->geom.pgaddrbytes); in init_nandsim()
787 printk("sector address bytes: %u\n", ns->geom.secaddrbytes); in init_nandsim()
794 ns->buf.byte = kmalloc(ns->geom.pgszoob, GFP_KERNEL); in init_nandsim()
797 ns->geom.pgszoob); in init_nandsim()
801 memset(ns->buf.byte, 0xFF, ns->geom.pgszoob); in init_nandsim()
839 offset = erase_block_no * ns->geom.secsz; in parse_badblocks()
1189 if (ns->regs.count < (ns->geom.pgaddrbytes - ns->geom.secaddrbytes)) in accept_addr_byte()
1193 ns->geom.pgaddrbytes + in accept_addr_byte()
1194 ns->geom.secaddrbytes)); in accept_addr_byte()
1493 pos = (loff_t)ns->regs.row * ns->geom.pgszoob + ns->regs.column + ns->regs.off; in read_page()
1527 for (i = 0; i < ns->geom.pgsec; i++) in erase_sector()
1536 for (i = 0; i < ns->geom.pgsec; i++) { in erase_sector()
1562 off = (loff_t)ns->regs.row * ns->geom.pgszoob + ns->regs.column + ns->regs.off; in prog_page()
1565 memset(ns->file_buf, 0xff, ns->geom.pgszoob); in prog_page()
1577 loff_t pos = (loff_t)ns->regs.row * ns->geom.pgszoob; in prog_page()
1578 tx = write_file(ns, ns->cfile, ns->file_buf, ns->geom.pgszoob, pos); in prog_page()
1579 if (tx != ns->geom.pgszoob) { in prog_page()
1608 memset(mypage->byte, 0xFF, ns->geom.pgszoob); in prog_page()
1632 if (action != ACTION_SECERASE && ns->regs.row >= ns->geom.pgnum) { in do_state_action()
1645 if (ns->regs.column >= (ns->geom.pgszoob - ns->regs.off)) { in do_state_action()
1649 num = ns->geom.pgszoob - ns->regs.off - ns->regs.column; in do_state_action()
1657 else if (ns->regs.off < ns->geom.pgsz) in do_state_action()
1663 NS_UDELAY(input_cycle * ns->geom.pgsz / 1000 / busdiv); in do_state_action()
1677 if (ns->regs.row >= ns->geom.pgnum - ns->geom.pgsec in do_state_action()
1678 || (ns->regs.row & ~(ns->geom.secsz - 1))) { in do_state_action()
1684 8 * (ns->geom.pgaddrbytes - ns->geom.secaddrbytes)) | ns->regs.column; in do_state_action()
1687 erase_block_no = ns->regs.row >> (ns->geom.secshift - ns->geom.pgshift); in do_state_action()
1717 num = ns->geom.pgszoob - ns->regs.off - ns->regs.column; in do_state_action()
1734 NS_UDELAY(output_cycle * ns->geom.pgsz / 1000 / busdiv); in do_state_action()
1754 NS_DBG("do_state_action: set internal offset to %d\n", ns->geom.pgsz/2); in do_state_action()
1755 ns->regs.off = ns->geom.pgsz/2; in do_state_action()
1759 NS_DBG("do_state_action: set internal offset to %d\n", ns->geom.pgsz); in do_state_action()
1760 ns->regs.off = ns->geom.pgsz; in do_state_action()
1864 ns->regs.num = ns->geom.pgszoob - ns->regs.off - ns->regs.column; in switch_state()
1868 ns->regs.num = ns->geom.idbytes; in switch_state()
1890 ns->regs.num = ns->geom.pgaddrbytes; in switch_state()
1894 ns->regs.num = ns->geom.secaddrbytes; in switch_state()
1903 ns->regs.num = ns->geom.pgaddrbytes - ns->geom.secaddrbytes; in switch_state()
2062 ns->regs.num = ns->geom.pgaddrbytes; in ns_nand_write_byte()
2065 ns->regs.num = ns->geom.secaddrbytes; in ns_nand_write_byte()
2292 nand->geom.idbytes = 4; in ns_init_module()
2294 nand->geom.idbytes = 2; in ns_init_module()