Lines Matching refs:nor

99 	struct spi_nor	*nor[HIFMC_MAX_CHIP_NUM];  member
147 static int hisi_spi_nor_prep(struct spi_nor *nor) in hisi_spi_nor_prep() argument
149 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_prep()
170 static void hisi_spi_nor_unprep(struct spi_nor *nor) in hisi_spi_nor_unprep() argument
172 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_unprep()
179 static int hisi_spi_nor_op_reg(struct spi_nor *nor, in hisi_spi_nor_op_reg() argument
182 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_op_reg()
202 static int hisi_spi_nor_read_reg(struct spi_nor *nor, u8 opcode, u8 *buf, in hisi_spi_nor_read_reg() argument
205 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_read_reg()
209 ret = hisi_spi_nor_op_reg(nor, opcode, len, FMC_OP_READ_DATA_EN); in hisi_spi_nor_read_reg()
217 static int hisi_spi_nor_write_reg(struct spi_nor *nor, u8 opcode, in hisi_spi_nor_write_reg() argument
220 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_write_reg()
226 return hisi_spi_nor_op_reg(nor, opcode, len, FMC_OP_WRITE_DATA_EN); in hisi_spi_nor_write_reg()
229 static int hisi_spi_nor_dma_transfer(struct spi_nor *nor, loff_t start_off, in hisi_spi_nor_dma_transfer() argument
232 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_dma_transfer()
240 reg |= (nor->addr_width == 4) ? SPI_NOR_ADDR_MODE_4BYTES in hisi_spi_nor_dma_transfer()
250 if_type = hisi_spi_nor_get_if_type(nor->read_proto); in hisi_spi_nor_dma_transfer()
252 if_type = hisi_spi_nor_get_if_type(nor->write_proto); in hisi_spi_nor_dma_transfer()
255 reg |= OP_CFG_DUMMY_NUM(nor->read_dummy >> 3); in hisi_spi_nor_dma_transfer()
261 ? OP_CTRL_RD_OPCODE(nor->read_opcode) in hisi_spi_nor_dma_transfer()
262 : OP_CTRL_WR_OPCODE(nor->program_opcode); in hisi_spi_nor_dma_transfer()
268 static ssize_t hisi_spi_nor_read(struct spi_nor *nor, loff_t from, size_t len, in hisi_spi_nor_read() argument
271 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_read()
279 ret = hisi_spi_nor_dma_transfer(nor, in hisi_spi_nor_read()
282 dev_warn(nor->dev, "DMA read timeout\n"); in hisi_spi_nor_read()
291 static ssize_t hisi_spi_nor_write(struct spi_nor *nor, loff_t to, in hisi_spi_nor_write() argument
294 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_write()
303 ret = hisi_spi_nor_dma_transfer(nor, in hisi_spi_nor_write()
306 dev_warn(nor->dev, "DMA write timeout\n"); in hisi_spi_nor_write()
337 struct spi_nor *nor; in hisi_spi_nor_register() local
342 nor = devm_kzalloc(dev, sizeof(*nor), GFP_KERNEL); in hisi_spi_nor_register()
343 if (!nor) in hisi_spi_nor_register()
346 nor->dev = dev; in hisi_spi_nor_register()
347 spi_nor_set_flash_node(nor, np); in hisi_spi_nor_register()
368 nor->priv = priv; in hisi_spi_nor_register()
369 nor->controller_ops = &hisi_controller_ops; in hisi_spi_nor_register()
371 ret = spi_nor_scan(nor, NULL, &hwcaps); in hisi_spi_nor_register()
375 mtd = &nor->mtd; in hisi_spi_nor_register()
381 host->nor[host->num_chip] = nor; in hisi_spi_nor_register()
391 mtd_device_unregister(&host->nor[i]->mtd); in hisi_spi_nor_unregister_all()