• Home
  • Raw
  • Download

Lines Matching refs:this

127 static int __gpmi_enable_clk(struct gpmi_nand_data *this, bool v)  in __gpmi_enable_clk()  argument
134 clk = this->resources.clock[i]; in __gpmi_enable_clk()
150 clk_disable_unprepare(this->resources.clock[i - 1]); in __gpmi_enable_clk()
157 int gpmi_init(struct gpmi_nand_data *this) in gpmi_init() argument
159 struct resources *r = &this->resources; in gpmi_init()
162 ret = gpmi_enable_clk(this); in gpmi_init()
174 GPMI_IS_MX23(this) || GPMI_IS_MX28(this)); in gpmi_init()
198 gpmi_disable_clk(this); in gpmi_init()
205 void gpmi_dump_info(struct gpmi_nand_data *this) in gpmi_dump_info() argument
207 struct resources *r = &this->resources; in gpmi_dump_info()
208 struct bch_geometry *geo = &this->bch_geometry; in gpmi_dump_info()
212 dev_err(this->dev, "Show GPMI registers :\n"); in gpmi_dump_info()
215 dev_err(this->dev, "offset 0x%.3x : 0x%.8x\n", i * 0x10, reg); in gpmi_dump_info()
219 dev_err(this->dev, "Show BCH registers :\n"); in gpmi_dump_info()
222 dev_err(this->dev, "offset 0x%.3x : 0x%.8x\n", i * 0x10, reg); in gpmi_dump_info()
224 dev_err(this->dev, "BCH Geometry :\n" in gpmi_dump_info()
250 int bch_set_geometry(struct gpmi_nand_data *this) in bch_set_geometry() argument
252 struct resources *r = &this->resources; in bch_set_geometry()
253 struct bch_geometry *bch_geo = &this->bch_geometry; in bch_set_geometry()
262 if (common_nfc_set_geometry(this)) in bch_set_geometry()
272 ret = gpmi_enable_clk(this); in bch_set_geometry()
282 GPMI_IS_MX23(this) || GPMI_IS_MX28(this)); in bch_set_geometry()
289 | BF_BCH_FLASH0LAYOUT0_ECC0(ecc_strength, this) in bch_set_geometry()
290 | BF_BCH_FLASH0LAYOUT0_GF(gf_len, this) in bch_set_geometry()
291 | BF_BCH_FLASH0LAYOUT0_DATA0_SIZE(block_size, this), in bch_set_geometry()
295 | BF_BCH_FLASH0LAYOUT1_ECCN(ecc_strength, this) in bch_set_geometry()
296 | BF_BCH_FLASH0LAYOUT1_GF(gf_len, this) in bch_set_geometry()
297 | BF_BCH_FLASH0LAYOUT1_DATAN_SIZE(block_size, this), in bch_set_geometry()
307 gpmi_disable_clk(this); in bch_set_geometry()
326 static int gpmi_nfc_compute_hardware_timing(struct gpmi_nand_data *this, in gpmi_nfc_compute_hardware_timing() argument
330 struct resources *r = &this->resources; in gpmi_nfc_compute_hardware_timing()
331 struct nand_chip *nand = &this->nand; in gpmi_nfc_compute_hardware_timing()
332 struct nand_timing target = this->timing; in gpmi_nfc_compute_hardware_timing()
857 static void gpmi_compute_edo_timing(struct gpmi_nand_data *this, in gpmi_compute_edo_timing() argument
860 struct resources *r = &this->resources; in gpmi_compute_edo_timing()
862 int mode = this->timing_mode; in gpmi_compute_edo_timing()
863 int dll_threshold = this->devdata->max_chain_delay; in gpmi_compute_edo_timing()
917 static int enable_edo_mode(struct gpmi_nand_data *this, int mode) in enable_edo_mode() argument
919 struct resources *r = &this->resources; in enable_edo_mode()
920 struct nand_chip *nand = &this->nand; in enable_edo_mode()
921 struct mtd_info *mtd = &this->mtd; in enable_edo_mode()
953 this->flags &= ~GPMI_TIMING_INIT_OK; in enable_edo_mode()
955 this->flags |= GPMI_ASYNC_EDO_ENABLED; in enable_edo_mode()
956 this->timing_mode = mode; in enable_edo_mode()
958 dev_info(this->dev, "enable the asynchronous EDO mode %d\n", mode); in enable_edo_mode()
964 dev_err(this->dev, "mode:%d ,failed in set feature.\n", mode); in enable_edo_mode()
968 int gpmi_extra_init(struct gpmi_nand_data *this) in gpmi_extra_init() argument
970 struct nand_chip *chip = &this->nand; in gpmi_extra_init()
973 if (GPMI_IS_MX6(this) && chip->onfi_version) { in gpmi_extra_init()
984 return enable_edo_mode(this, mode); in gpmi_extra_init()
990 void gpmi_begin(struct gpmi_nand_data *this) in gpmi_begin() argument
992 struct resources *r = &this->resources; in gpmi_begin()
1001 ret = gpmi_enable_clk(this); in gpmi_begin()
1003 dev_err(this->dev, "We failed in enable the clk\n"); in gpmi_begin()
1008 if (this->flags & GPMI_TIMING_INIT_OK) in gpmi_begin()
1010 this->flags |= GPMI_TIMING_INIT_OK; in gpmi_begin()
1012 if (this->flags & GPMI_ASYNC_EDO_ENABLED) in gpmi_begin()
1013 gpmi_compute_edo_timing(this, &hw); in gpmi_begin()
1015 gpmi_nfc_compute_hardware_timing(this, &hw); in gpmi_begin()
1073 void gpmi_end(struct gpmi_nand_data *this) in gpmi_end() argument
1075 gpmi_disable_clk(this); in gpmi_end()
1079 void gpmi_clear_bch(struct gpmi_nand_data *this) in gpmi_clear_bch() argument
1081 struct resources *r = &this->resources; in gpmi_clear_bch()
1086 int gpmi_is_ready(struct gpmi_nand_data *this, unsigned chip) in gpmi_is_ready() argument
1088 struct resources *r = &this->resources; in gpmi_is_ready()
1092 if (GPMI_IS_MX23(this)) { in gpmi_is_ready()
1095 } else if (GPMI_IS_MX28(this) || GPMI_IS_MX6(this)) { in gpmi_is_ready()
1100 if (GPMI_IS_MX6(this)) in gpmi_is_ready()
1107 dev_err(this->dev, "unknown arch.\n"); in gpmi_is_ready()
1111 static inline void set_dma_type(struct gpmi_nand_data *this, in set_dma_type() argument
1114 this->last_dma_type = this->dma_type; in set_dma_type()
1115 this->dma_type = type; in set_dma_type()
1118 int gpmi_send_command(struct gpmi_nand_data *this) in gpmi_send_command() argument
1120 struct dma_chan *channel = get_dma_chan(this); in gpmi_send_command()
1123 int chip = this->current_chip; in gpmi_send_command()
1129 | BF_GPMI_CTRL0_CS(chip, this) in gpmi_send_command()
1130 | BF_GPMI_CTRL0_LOCK_CS(LOCK_CS_ENABLE, this) in gpmi_send_command()
1133 | BF_GPMI_CTRL0_XFER_COUNT(this->command_length); in gpmi_send_command()
1142 sgl = &this->cmd_sgl; in gpmi_send_command()
1144 sg_init_one(sgl, this->cmd_buffer, this->command_length); in gpmi_send_command()
1145 dma_map_sg(this->dev, sgl, 1, DMA_TO_DEVICE); in gpmi_send_command()
1153 set_dma_type(this, DMA_FOR_COMMAND); in gpmi_send_command()
1154 return start_dma_without_bch_irq(this, desc); in gpmi_send_command()
1157 int gpmi_send_data(struct gpmi_nand_data *this) in gpmi_send_data() argument
1160 struct dma_chan *channel = get_dma_chan(this); in gpmi_send_data()
1161 int chip = this->current_chip; in gpmi_send_data()
1172 | BF_GPMI_CTRL0_CS(chip, this) in gpmi_send_data()
1173 | BF_GPMI_CTRL0_LOCK_CS(LOCK_CS_ENABLE, this) in gpmi_send_data()
1175 | BF_GPMI_CTRL0_XFER_COUNT(this->upper_len); in gpmi_send_data()
1183 prepare_data_dma(this, DMA_TO_DEVICE); in gpmi_send_data()
1184 desc = dmaengine_prep_slave_sg(channel, &this->data_sgl, in gpmi_send_data()
1191 set_dma_type(this, DMA_FOR_WRITE_DATA); in gpmi_send_data()
1192 return start_dma_without_bch_irq(this, desc); in gpmi_send_data()
1195 int gpmi_read_data(struct gpmi_nand_data *this) in gpmi_read_data() argument
1198 struct dma_chan *channel = get_dma_chan(this); in gpmi_read_data()
1199 int chip = this->current_chip; in gpmi_read_data()
1205 | BF_GPMI_CTRL0_CS(chip, this) in gpmi_read_data()
1206 | BF_GPMI_CTRL0_LOCK_CS(LOCK_CS_ENABLE, this) in gpmi_read_data()
1208 | BF_GPMI_CTRL0_XFER_COUNT(this->upper_len); in gpmi_read_data()
1217 prepare_data_dma(this, DMA_FROM_DEVICE); in gpmi_read_data()
1218 desc = dmaengine_prep_slave_sg(channel, &this->data_sgl, in gpmi_read_data()
1225 set_dma_type(this, DMA_FOR_READ_DATA); in gpmi_read_data()
1226 return start_dma_without_bch_irq(this, desc); in gpmi_read_data()
1229 int gpmi_send_page(struct gpmi_nand_data *this, in gpmi_send_page() argument
1232 struct bch_geometry *geo = &this->bch_geometry; in gpmi_send_page()
1238 struct dma_chan *channel = get_dma_chan(this); in gpmi_send_page()
1239 int chip = this->current_chip; in gpmi_send_page()
1251 | BF_GPMI_CTRL0_CS(chip, this) in gpmi_send_page()
1252 | BF_GPMI_CTRL0_LOCK_CS(LOCK_CS_ENABLE, this) in gpmi_send_page()
1270 set_dma_type(this, DMA_FOR_WRITE_ECC_PAGE); in gpmi_send_page()
1271 return start_dma_with_bch_irq(this, desc); in gpmi_send_page()
1274 int gpmi_read_page(struct gpmi_nand_data *this, in gpmi_read_page() argument
1277 struct bch_geometry *geo = &this->bch_geometry; in gpmi_read_page()
1283 struct dma_chan *channel = get_dma_chan(this); in gpmi_read_page()
1284 int chip = this->current_chip; in gpmi_read_page()
1293 | BF_GPMI_CTRL0_CS(chip, this) in gpmi_read_page()
1294 | BF_GPMI_CTRL0_LOCK_CS(LOCK_CS_ENABLE, this) in gpmi_read_page()
1313 | BF_GPMI_CTRL0_CS(chip, this) in gpmi_read_page()
1314 | BF_GPMI_CTRL0_LOCK_CS(LOCK_CS_ENABLE, this) in gpmi_read_page()
1338 | BF_GPMI_CTRL0_CS(chip, this) in gpmi_read_page()
1339 | BF_GPMI_CTRL0_LOCK_CS(LOCK_CS_ENABLE, this) in gpmi_read_page()
1352 set_dma_type(this, DMA_FOR_READ_ECC_PAGE); in gpmi_read_page()
1353 return start_dma_with_bch_irq(this, desc); in gpmi_read_page()