Lines Matching refs:reg

34 	uint32_t reg = 0U;  in cdns_nand_wait_idle()  local
38 reg = mmio_read_32(CNF_CMDREG(CTRL_STATUS)); in cdns_nand_wait_idle()
39 } while (CNF_GET_CTRL_BUSY(reg) != 0U); in cdns_nand_wait_idle()
45 uint32_t reg = 0U; in cdns_nand_wait_thread_ready() local
49 reg = mmio_read_32(CNF_CMDREG(TRD_STATUS)); in cdns_nand_wait_thread_ready()
50 reg &= (1U << (uint32_t)thread_id); in cdns_nand_wait_thread_ready()
51 } while (reg != 0U); in cdns_nand_wait_thread_ready()
71 uint32_t reg = 0U; in cdns_nand_last_opr_status() local
74 reg = mmio_read_32(CNF_CTRLPARAM(FEATURE)); in cdns_nand_last_opr_status()
75 nthreads = CNF_GET_NTHREADS(reg); in cdns_nand_last_opr_status()
90 reg = mmio_read_32(CNF_CMDREG(CMD_STAT)); in cdns_nand_last_opr_status()
91 } while ((reg & CNF_CMPLT) == 0U); in cdns_nand_last_opr_status()
94 if ((reg & err_mask) == 1U) { in cdns_nand_last_opr_status()
95 ERROR("%s, CMD_STATUS:0x%x\n", __func__, reg); in cdns_nand_last_opr_status()
114 uint32_t reg = (CNF_WORK_MODE_PIO << CNF_CMDREG0_CT); in cdns_nand_set_feature() local
116 reg |= (thread_id << CNF_CMDREG0_TRD); in cdns_nand_set_feature()
117 reg |= (CNF_DEF_VOL_ID << CNF_CMDREG0_VOL); in cdns_nand_set_feature()
118 reg |= (CNF_INT_DIS << CNF_CMDREG0_INTR); in cdns_nand_set_feature()
119 reg |= (CNF_CT_SET_FEATURE << CNF_CMDREG0_CMD); in cdns_nand_set_feature()
120 mmio_write_32(CNF_CMDREG(CMD_REG0), reg); in cdns_nand_set_feature()
136 uint32_t reg = (CNF_WORK_MODE_PIO << CNF_CMDREG0_CT); in cdns_nand_reset() local
138 reg |= (thread_id << CNF_CMDREG0_TRD); in cdns_nand_reset()
139 reg |= (CNF_DEF_VOL_ID << CNF_CMDREG0_VOL); in cdns_nand_reset()
140 reg |= (CNF_INT_DIS << CNF_CMDREG0_INTR); in cdns_nand_reset()
141 reg |= (CNF_CT_RESET_ASYNC << CNF_CMDREG0_CMD); in cdns_nand_reset()
142 mmio_write_32(CNF_CMDREG(CMD_REG0), reg); in cdns_nand_reset()
211 uint32_t reg = 0U; in cdns_nand_update_dev_info() local
222 reg = mmio_read_32(CNF_CTRLPARAM(MFR_ID)); in cdns_nand_update_dev_info()
223 dev_info.mfr_id = FIELD_GET(CNF_MFR_ID_MASK, reg); in cdns_nand_update_dev_info()
224 dev_info.dev_id = FIELD_GET(CNF_DEV_ID_MASK, reg); in cdns_nand_update_dev_info()
229 reg = mmio_read_32(CNF_CTRLPARAM(DEV_PARAMS0)); in cdns_nand_update_dev_info()
230 dev_info.type = CNF_GET_DEV_TYPE(reg); in cdns_nand_update_dev_info()
236 dev_info.nluns = CNF_GET_NLUNS(reg); in cdns_nand_update_dev_info()
239 reg = mmio_read_32(CNF_CTRLCFG(DEV_LAYOUT)); in cdns_nand_update_dev_info()
240 dev_info.npages_per_block = CNF_GET_NPAGES_PER_BLOCK(reg); in cdns_nand_update_dev_info()
244 reg = mmio_read_32(CNF_CTRLCFG(TRANS_CFG1)); in cdns_nand_update_dev_info()
245 dev_info.sector_size = CNF_GET_SCTR_SIZE(reg); in cdns_nand_update_dev_info()
246 dev_info.last_sector_size = CNF_GET_LAST_SCTR_SIZE(reg); in cdns_nand_update_dev_info()
249 reg = mmio_read_32(CNF_CTRLPARAM(DEV_AREA)); in cdns_nand_update_dev_info()
250 dev_info.page_size = CNF_GET_PAGE_SIZE(reg); in cdns_nand_update_dev_info()
251 dev_info.spare_size = CNF_GET_SPARE_SIZE(reg); in cdns_nand_update_dev_info()
274 uint32_t reg = 0U; in cdns_nand_host_init() local
281 reg = mmio_read_32(CNF_CMDREG(CTRL_STATUS)); in cdns_nand_host_init()
284 if (CNF_GET_INIT_COMP(reg)) in cdns_nand_host_init()
334 uint32_t reg = (CNF_WORK_MODE_PIO << CNF_CMDREG0_CT); in cdns_nand_erase() local
336 reg |= (CNF_DEF_TRD << CNF_CMDREG0_TRD); in cdns_nand_erase()
337 reg |= (CNF_DEF_VOL_ID << CNF_CMDREG0_VOL); in cdns_nand_erase()
338 reg |= (CNF_INT_DIS << CNF_CMDREG0_INTR); in cdns_nand_erase()
339 reg |= (CNF_CT_ERASE << CNF_CMDREG0_CMD); in cdns_nand_erase()
340 reg |= (((size-1) & 0xFF) << CNF_CMDREG0_CMD); in cdns_nand_erase()
341 mmio_write_32(CNF_CMDREG(CMD_REG0), reg); in cdns_nand_erase()
396 uint32_t reg = (CNF_WORK_MODE_PIO << CNF_CMDREG0_CT); in cdns_nand_read_page() local
398 reg |= (CNF_DEF_TRD << CNF_CMDREG0_TRD); in cdns_nand_read_page()
399 reg |= (CNF_DEF_VOL_ID << CNF_CMDREG0_VOL); in cdns_nand_read_page()
400 reg |= (CNF_INT_DIS << CNF_CMDREG0_INTR); in cdns_nand_read_page()
401 reg |= (CNF_DMA_MASTER_SEL << CNF_CMDREG0_DMA); in cdns_nand_read_page()
402 reg |= (CNF_CT_PAGE_READ << CNF_CMDREG0_CMD); in cdns_nand_read_page()
403 reg |= (((CNF_READ_SINGLE_PAGE - 1) & 0xFF) << CNF_CMDREG0_CMD); in cdns_nand_read_page()
404 mmio_write_32(CNF_CMDREG(CMD_REG0), reg); in cdns_nand_read_page()