• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/mtd/onenand/

Lines Matching refs:this

71 #define ONENAND_CORE_SPARE(flash, this, offset)				\
72 ((flash->data) + (this->chipsize) + (offset >> 5))
74 #define ONENAND_MAIN_AREA(this, offset) \
75 (this->base + ONENAND_DATARAM + offset)
77 #define ONENAND_SPARE_AREA(this, offset) \
78 (this->base + ONENAND_SPARERAM + offset)
80 #define ONENAND_GET_WP_STATUS(this) \
81 (readw(this->base + ONENAND_REG_WP_STATUS))
83 #define ONENAND_SET_WP_STATUS(v, this) \
84 (writew(v, this->base + ONENAND_REG_WP_STATUS))
124 * @this: OneNAND device structure
130 static void onenand_lock_handle(struct onenand_chip *this, int cmd)
135 status = ONENAND_GET_WP_STATUS(this);
136 block_lock_scheme = !(this->options & ONENAND_HAS_CONT_LOCK);
142 ONENAND_SET_WP_STATUS(ONENAND_WP_US, this);
144 ONENAND_SET_WP_STATUS(status | ONENAND_WP_US, this);
149 ONENAND_SET_WP_STATUS(ONENAND_WP_LS, this);
151 ONENAND_SET_WP_STATUS(status | ONENAND_WP_LS, this);
156 ONENAND_SET_WP_STATUS(ONENAND_WP_LTS, this);
158 ONENAND_SET_WP_STATUS(status | ONENAND_WP_LTS, this);
168 * @this: OneNAND device structure
173 static void onenand_bootram_handle(struct onenand_chip *this, int cmd)
177 writew(manuf_id, this->base);
178 writew(device_id, this->base + 2);
179 writew(version_id, this->base + 4);
190 * @this: OneNAND device structure
195 static void onenand_update_interrupt(struct onenand_chip *this, int cmd)
222 writew(interrupt, this->base + ONENAND_REG_INTERRUPT);
251 * @this: OneNAND device structure
260 static void onenand_data_handle(struct onenand_chip *this, int cmd,
264 struct onenand_flash *flash = this->priv;
281 die = readw(this->base + ONENAND_REG_START_ADDRESS2);
296 dest = ONENAND_MAIN_AREA(this, main_offset);
298 writew(boundary[die], this->base + ONENAND_DATARAM);
305 src = ONENAND_CORE_SPARE(flash, this, offset);
306 dest = ONENAND_SPARE_AREA(this, spare_offset);
311 src = ONENAND_MAIN_AREA(this, main_offset);
314 boundary[die] = readw(this->base + ONENAND_DATARAM);
319 int off = i * this->subpagesize;
320 if (!memcmp(src + off, ffchars, this->subpagesize))
322 if (memcmp(dest + off, ffchars, this->subpagesize) &&
323 onenand_check_overwrite(dest + off, src + off, this->subpagesize))
325 memcpy(dest + off, src + off, this->subpagesize);
330 src = ONENAND_SPARE_AREA(this, spare_offset);
335 dest = ONENAND_CORE_SPARE(flash, this, offset);
347 if (FLEXONENAND(this)) {
354 memset(ONENAND_CORE_SPARE(flash, this, offset), 0xff,
365 * @this: OneNAND device structure
370 static void onenand_command_handle(struct onenand_chip *this, int cmd)
381 onenand_lock_handle(this, cmd);
389 block = (int) readw(this->base + ONENAND_REG_START_ADDRESS1);
393 block += this->chipsize >> (this->erase_shift + 1);
398 page = (int) readw(this->base + ONENAND_REG_START_ADDRESS8);
400 bufferram = (int) readw(this->base + ONENAND_REG_START_BUFFER);
408 offset = onenand_addr(this, block);
411 offset += page << this->page_shift;
413 onenand_data_handle(this, cmd, dataram, offset);
415 onenand_update_interrupt(this, cmd);
427 struct onenand_chip *this = info->mtd.priv;
430 if (addr < this->base + ONENAND_DATARAM) {
431 onenand_bootram_handle(this, value);
435 if (addr == this->base + ONENAND_REG_COMMAND)
436 onenand_command_handle(this, value);
549 struct onenand_chip *this = info->mtd.priv;
550 struct onenand_flash *flash = this->priv;