Lines Matching full:device

30 /* JEDEC Device ID: Memory type and Capacity */
65 static void w25qxx_lock(struct rt_mtd_nor_device *device) in w25qxx_lock() argument
67 struct spi_flash_mtd *mtd = (struct spi_flash_mtd *)device; in w25qxx_lock()
71 static void w25qxx_unlock(struct rt_mtd_nor_device *device) in w25qxx_unlock() argument
73 struct spi_flash_mtd *mtd = (struct spi_flash_mtd *)device; in w25qxx_unlock()
77 static rt_uint8_t w25qxx_read_status(struct rt_mtd_nor_device *device) in w25qxx_read_status() argument
79 struct spi_flash_mtd *mtd = (struct spi_flash_mtd *)device; in w25qxx_read_status()
83 static void w25qxx_wait_busy(struct rt_mtd_nor_device *device) in w25qxx_wait_busy() argument
85 while( w25qxx_read_status(device) & (0x01)); in w25qxx_wait_busy()
88 static rt_err_t w25qxx_read_id(struct rt_mtd_nor_device *device) in w25qxx_read_id() argument
93 struct spi_flash_mtd *mtd = (struct spi_flash_mtd *)device; in w25qxx_read_id()
95 w25qxx_lock(device); in w25qxx_read_id()
107 w25qxx_unlock(device); in w25qxx_read_id()
112 static rt_size_t w25qxx_read(struct rt_mtd_nor_device *device, rt_off_t offset, rt_uint8_t *buffer,… in w25qxx_read() argument
114 struct spi_flash_mtd *mtd = (struct spi_flash_mtd *)device; in w25qxx_read()
117 if((offset + length) > device->block_end * FLASH_BLOCK_SIZE) in w25qxx_read()
121 w25qxx_lock(device); in w25qxx_read()
134 w25qxx_unlock(device); in w25qxx_read()
138 static rt_size_t w25qxx_write(struct rt_mtd_nor_device *device, rt_off_t offset, const rt_uint8_t *… in w25qxx_write() argument
140 struct spi_flash_mtd *mtd = (struct spi_flash_mtd *)device; in w25qxx_write()
145 if((offset + length) > device->block_end * FLASH_BLOCK_SIZE) in w25qxx_write()
148 w25qxx_lock(device); in w25qxx_write()
152 w25qxx_wait_busy(device); // wait erase done. in w25qxx_write()
181 w25qxx_wait_busy(device); in w25qxx_write()
191 w25qxx_unlock(device); in w25qxx_write()
196 static rt_err_t w25qxx_erase_block(struct rt_mtd_nor_device *device, rt_off_t offset, rt_uint32_t l… in w25qxx_erase_block() argument
198 struct spi_flash_mtd *mtd = (struct spi_flash_mtd *)device; in w25qxx_erase_block()
206 if((offset + length) > device->block_end * FLASH_BLOCK_SIZE) in w25qxx_erase_block()
210 if(length % device->block_size != 0) in w25qxx_erase_block()
216 w25qxx_lock(device); in w25qxx_erase_block()
220 w25qxx_wait_busy(device); // wait erase done. in w25qxx_erase_block()
228 w25qxx_wait_busy(device); // wait erase done. in w25qxx_erase_block()
236 w25qxx_unlock(device); in w25qxx_erase_block()
271 FLASH_TRACE("spi device %s not found!\r\n", spi_device_name); in w25qxx_mtd_init()
286 /* Init Flash device */ in w25qxx_mtd_init()