Lines Matching refs:spi_flash

117 	struct spi_flash	*spi_flash;  in spi_dataflash_erase()  local
125 spi_flash = dev_get_uclass_priv(dev); in spi_dataflash_erase()
126 spi = spi_flash->spi; in spi_dataflash_erase()
128 blocksize = spi_flash->page_size << 3; in spi_dataflash_erase()
135 div_u64_rem(len, spi_flash->page_size, &rem); in spi_dataflash_erase()
138 dev->name, len, spi_flash->page_size); in spi_dataflash_erase()
141 div_u64_rem(offset, spi_flash->page_size, &rem); in spi_dataflash_erase()
144 dev->name, offset, spi_flash->page_size); in spi_dataflash_erase()
161 pageaddr = div_u64(offset, spi_flash->page_size); in spi_dataflash_erase()
191 offset += spi_flash->page_size; in spi_dataflash_erase()
192 len -= spi_flash->page_size; in spi_dataflash_erase()
211 struct spi_flash *spi_flash; in spi_dataflash_read() local
218 spi_flash = dev_get_uclass_priv(dev); in spi_dataflash_read()
219 spi = spi_flash->spi; in spi_dataflash_read()
229 addr = (((unsigned)offset / spi_flash->page_size) in spi_dataflash_read()
231 + ((unsigned)offset % spi_flash->page_size); in spi_dataflash_read()
267 struct spi_flash *spi_flash; in spi_dataflash_write() local
276 spi_flash = dev_get_uclass_priv(dev); in spi_dataflash_write()
277 spi = spi_flash->spi; in spi_dataflash_write()
284 pageaddr = ((unsigned)offset / spi_flash->page_size); in spi_dataflash_write()
285 to = ((unsigned)offset % spi_flash->page_size); in spi_dataflash_write()
286 if (to + len > spi_flash->page_size) in spi_dataflash_write()
287 writelen = spi_flash->page_size - to; in spi_dataflash_write()
320 if (writelen != spi_flash->page_size) { in spi_dataflash_write()
405 if (remaining > spi_flash->page_size) in spi_dataflash_write()
406 writelen = spi_flash->page_size; in spi_dataflash_write()
419 struct spi_flash *spi_flash; in add_dataflash() local
423 spi_flash = dev_get_uclass_priv(dev); in add_dataflash()
427 spi_flash->name = name; in add_dataflash()
428 spi_flash->page_size = pagesize; in add_dataflash()
429 spi_flash->size = nr_pages * pagesize; in add_dataflash()
430 spi_flash->erase_size = pagesize; in add_dataflash()
433 printf("SPI DataFlash: Detected %s with page size ", spi_flash->name); in add_dataflash()
434 print_size(spi_flash->page_size, ", erase size "); in add_dataflash()
435 print_size(spi_flash->erase_size, ", total "); in add_dataflash()
436 print_size(spi_flash->size, ""); in add_dataflash()
585 struct spi_flash *spi_flash; in spi_dataflash_probe() local
589 spi_flash = dev_get_uclass_priv(dev); in spi_dataflash_probe()
590 spi_flash->spi = spi; in spi_dataflash_probe()
591 spi_flash->dev = dev; in spi_dataflash_probe()