Lines Matching refs:reg
29 uint32_t reg = 0U; in cdns_nand_wait_idle() local
33 reg = mmio_read_32(CNF_CMDREG(CTRL_STATUS)); in cdns_nand_wait_idle()
34 } while (CNF_GET_CTRL_BUSY(reg) != 0U); in cdns_nand_wait_idle()
40 uint32_t reg = 0U; in cdns_nand_wait_thread_ready() local
44 reg = mmio_read_32(CNF_CMDREG(TRD_STATUS)); in cdns_nand_wait_thread_ready()
45 reg &= (1U << (uint32_t)thread_id); in cdns_nand_wait_thread_ready()
46 } while (reg != 0U); in cdns_nand_wait_thread_ready()
53 uint32_t reg = 0U; in cdns_nand_last_opr_status() local
56 reg = mmio_read_32(CNF_CTRLPARAM(FEATURE)); in cdns_nand_last_opr_status()
57 nthreads = CNF_GET_NTHREADS(reg); in cdns_nand_last_opr_status()
72 reg = mmio_read_32(CNF_CMDREG(CMD_STAT)); in cdns_nand_last_opr_status()
73 } while ((reg & CNF_CMPLT) == 0U); in cdns_nand_last_opr_status()
76 if ((reg & err_mask) == 1U) { in cdns_nand_last_opr_status()
77 ERROR("%s, CMD_STATUS:0x%x\n", __func__, reg); in cdns_nand_last_opr_status()
96 uint32_t reg = (CNF_WORK_MODE_PIO << CNF_CMDREG0_CT); in cdns_nand_set_feature() local
98 reg |= (thread_id << CNF_CMDREG0_TRD); in cdns_nand_set_feature()
99 reg |= (CNF_DEF_VOL_ID << CNF_CMDREG0_VOL); in cdns_nand_set_feature()
100 reg |= (CNF_INT_DIS << CNF_CMDREG0_INTR); in cdns_nand_set_feature()
101 reg |= (CNF_CT_SET_FEATURE << CNF_CMDREG0_CMD); in cdns_nand_set_feature()
102 mmio_write_32(CNF_CMDREG(CMD_REG0), reg); in cdns_nand_set_feature()
117 uint32_t reg = (CNF_WORK_MODE_PIO << CNF_CMDREG0_CT); in cdns_nand_reset() local
119 reg |= (thread_id << CNF_CMDREG0_TRD); in cdns_nand_reset()
120 reg |= (CNF_DEF_VOL_ID << CNF_CMDREG0_VOL); in cdns_nand_reset()
121 reg |= (CNF_INT_DIS << CNF_CMDREG0_INTR); in cdns_nand_reset()
122 reg |= (CNF_CT_RESET_ASYNC << CNF_CMDREG0_CMD); in cdns_nand_reset()
123 mmio_write_32(CNF_CMDREG(CMD_REG0), reg); in cdns_nand_reset()
135 uint32_t reg = mmio_read_32(CNF_MINICTRL(DLL_PHY_CTRL)); in cdns_nand_set_opr_mode() local
137 reg &= ~(1 << CNF_DLL_PHY_RST_N); in cdns_nand_set_opr_mode()
138 mmio_write_32(CNF_MINICTRL(DLL_PHY_CTRL), reg); in cdns_nand_set_opr_mode()
159 reg |= (1 << CNF_DLL_PHY_EXT_RD_MODE); in cdns_nand_set_opr_mode()
160 reg |= (1 << CNF_DLL_PHY_EXT_WR_MODE); in cdns_nand_set_opr_mode()
174 reg |= (1 << CNF_DLL_PHY_RST_N); in cdns_nand_set_opr_mode()
175 mmio_write_32(CNF_MINICTRL(DLL_PHY_CTRL), reg); in cdns_nand_set_opr_mode()
208 uint32_t reg = 0U; in cdns_nand_update_dev_info() local
211 reg = mmio_read_32(CNF_CTRLPARAM(DEV_PARAMS0)); in cdns_nand_update_dev_info()
212 dev_info.type = CNF_GET_DEV_TYPE(reg); in cdns_nand_update_dev_info()
217 dev_info.nluns = CNF_GET_NLUNS(reg); in cdns_nand_update_dev_info()
220 reg = mmio_read_32(CNF_CTRLCFG(DEV_LAYOUT)); in cdns_nand_update_dev_info()
221 dev_info.npages_per_block = CNF_GET_NPAGES_PER_BLOCK(reg); in cdns_nand_update_dev_info()
224 reg = mmio_read_32(CNF_CTRLCFG(TRANS_CFG1)); in cdns_nand_update_dev_info()
225 dev_info.sector_size = CNF_GET_SCTR_SIZE(reg); in cdns_nand_update_dev_info()
226 dev_info.last_sector_size = CNF_GET_LAST_SCTR_SIZE(reg); in cdns_nand_update_dev_info()
229 reg = mmio_read_32(CNF_CTRLPARAM(DEV_AREA)); in cdns_nand_update_dev_info()
230 dev_info.page_size = CNF_GET_PAGE_SIZE(reg); in cdns_nand_update_dev_info()
231 dev_info.spare_size = CNF_GET_SPARE_SIZE(reg); in cdns_nand_update_dev_info()
251 uint32_t reg = 0U; in cdns_nand_host_init() local
256 reg = mmio_read_32(CNF_CMDREG(CTRL_STATUS)); in cdns_nand_host_init()
257 } while (CNF_GET_INIT_COMP(reg) == 0); in cdns_nand_host_init()
268 reg = mmio_read_32(CNF_DI(CONTROL)); in cdns_nand_host_init()
269 reg |= (1 << CNF_DI_PAR_EN); in cdns_nand_host_init()
270 reg |= (1 << CNF_DI_CRC_EN); in cdns_nand_host_init()
271 mmio_write_32(CNF_DI(CONTROL), reg); in cdns_nand_host_init()
275 reg = mmio_read_32(CNF_CTRLCFG(DEV_STAT)); in cdns_nand_host_init()
276 reg = reg & ~1; in cdns_nand_host_init()
277 mmio_write_32(CNF_CTRLCFG(DEV_STAT), reg); in cdns_nand_host_init()
304 uint32_t reg = (CNF_WORK_MODE_PIO << CNF_CMDREG0_CT); in cdns_nand_erase() local
306 reg |= (CNF_DEF_TRD << CNF_CMDREG0_TRD); in cdns_nand_erase()
307 reg |= (CNF_DEF_VOL_ID << CNF_CMDREG0_VOL); in cdns_nand_erase()
308 reg |= (CNF_INT_DIS << CNF_CMDREG0_INTR); in cdns_nand_erase()
309 reg |= (CNF_CT_ERASE << CNF_CMDREG0_CMD); in cdns_nand_erase()
310 reg |= (((size-1) & 0xFF) << CNF_CMDREG0_CMD); in cdns_nand_erase()
311 mmio_write_32(CNF_CMDREG(CMD_REG0), reg); in cdns_nand_erase()
347 uint32_t reg = (CNF_WORK_MODE_PIO << CNF_CMDREG0_CT); in cdns_nand_read_page() local
349 reg |= (CNF_DEF_TRD << CNF_CMDREG0_TRD); in cdns_nand_read_page()
350 reg |= (CNF_DEF_VOL_ID << CNF_CMDREG0_VOL); in cdns_nand_read_page()
351 reg |= (CNF_INT_DIS << CNF_CMDREG0_INTR); in cdns_nand_read_page()
352 reg |= (CNF_DMA_MASTER_SEL << CNF_CMDREG0_DMA); in cdns_nand_read_page()
353 reg |= (CNF_CT_PAGE_READ << CNF_CMDREG0_CMD); in cdns_nand_read_page()
354 reg |= (((CNF_READ_SINGLE_PAGE-1) & 0xFF) << CNF_CMDREG0_CMD); in cdns_nand_read_page()
355 mmio_write_32(CNF_CMDREG(CMD_REG0), reg); in cdns_nand_read_page()