Lines Matching refs:iobase
61 uint32_t mec_hal_espi_fc_en_status(struct mec_espi_io_regs *iobase) in mec_hal_espi_fc_en_status() argument
63 return (iobase->FCSTS & 0x3u); in mec_hal_espi_fc_en_status()
66 void mec_hal_espi_fc_ready_set(struct mec_espi_io_regs *iobase) in mec_hal_espi_fc_ready_set() argument
68 iobase->FCRDY = MEC_BIT(MEC_ESPI_IO_FCRDY_FC_READY_Pos); in mec_hal_espi_fc_ready_set()
71 int mec_hal_espi_fc_is_ready(struct mec_espi_io_regs *iobase) in mec_hal_espi_fc_is_ready() argument
73 if (iobase->FCRDY & MEC_BIT(MEC_ESPI_IO_FCRDY_FC_READY_Pos)) { in mec_hal_espi_fc_is_ready()
80 int mec_hal_espi_fc_is_busy(struct mec_espi_io_regs *iobase) in mec_hal_espi_fc_is_busy() argument
82 if (iobase->FCCFG & MEC_BIT(MEC_ESPI_IO_FCCFG_BUSY_Pos)) { in mec_hal_espi_fc_is_busy()
96 void mec_hal_espi_fc_op_start(struct mec_espi_io_regs *iobase, uint32_t flags) in mec_hal_espi_fc_op_start() argument
98 iobase->FCSTS = MEC_ESPI_FC_ERR_ALL | MEC_BIT(MEC_ESPI_IO_FCSTS_DONE_Pos); in mec_hal_espi_fc_op_start()
101 iobase->FCIEN |= MEC_BIT(MEC_ESPI_IO_FCIEN_DONE_Pos); in mec_hal_espi_fc_op_start()
103 iobase->FCIEN &= (uint32_t)~MEC_BIT(MEC_ESPI_IO_FCIEN_DONE_Pos); in mec_hal_espi_fc_op_start()
106 iobase->FCCTL |= MEC_BIT(MEC_ESPI_IO_FCCTL_START_Pos); in mec_hal_espi_fc_op_start()
109 void mec_hal_espi_fc_op_abort(struct mec_espi_io_regs *iobase) in mec_hal_espi_fc_op_abort() argument
111 iobase->FCCTL |= MEC_BIT(MEC_ESPI_IO_FCCTL_ABORT_Pos); in mec_hal_espi_fc_op_abort()
114 void mec_hal_espi_fc_intr_ctrl(struct mec_espi_io_regs *iobase, uint32_t msk, uint8_t en) in mec_hal_espi_fc_intr_ctrl() argument
118 if (!iobase) { in mec_hal_espi_fc_intr_ctrl()
130 iobase->FCIEN |= r; in mec_hal_espi_fc_intr_ctrl()
132 iobase->FCIEN &= ~r; in mec_hal_espi_fc_intr_ctrl()
136 uint32_t mec_hal_espi_fc_status(struct mec_espi_io_regs *iobase) in mec_hal_espi_fc_status() argument
138 if (!iobase) { in mec_hal_espi_fc_status()
142 return iobase->FCSTS; in mec_hal_espi_fc_status()
145 void mec_hal_espi_fc_status_clr(struct mec_espi_io_regs *iobase, uint32_t msk) in mec_hal_espi_fc_status_clr() argument
147 if (!iobase) { in mec_hal_espi_fc_status_clr()
151 iobase->FCSTS = msk; in mec_hal_espi_fc_status_clr()
165 uint32_t mec_hal_espi_fc_max_read_req_sz(struct mec_espi_io_regs *iobase) in mec_hal_espi_fc_max_read_req_sz() argument
169 exp = ((iobase->FCCFG & MEC_ESPI_IO_FCCFG_MAX_RD_REQ_SZ_Msk) >> in mec_hal_espi_fc_max_read_req_sz()
181 uint32_t mec_hal_espi_fc_max_pld_sz(struct mec_espi_io_regs *iobase) in mec_hal_espi_fc_max_pld_sz() argument
185 exp = (iobase->FCCFG & MEC_ESPI_IO_FCCFG_MAX_PLD_SZ_Msk) >> MEC_ESPI_IO_FCCFG_MAX_PLD_SZ_Pos; in mec_hal_espi_fc_max_pld_sz()
200 uint32_t mec_hal_espi_fc_get_erase_sz(struct mec_espi_io_regs *iobase) in mec_hal_espi_fc_get_erase_sz() argument
205 if (!iobase) { in mec_hal_espi_fc_get_erase_sz()
210 (uint8_t)((iobase->FCCFG & MEC_ESPI_IO_FCCFG_EBSZ_Msk) >> MEC_ESPI_IO_FCCFG_EBSZ_Pos); in mec_hal_espi_fc_get_erase_sz()
241 int mec_hal_espi_fc_check_erase_sz(struct mec_espi_io_regs *iobase, uint32_t ersz_bytes) in mec_hal_espi_fc_check_erase_sz() argument
243 uint32_t ersz = mec_hal_espi_fc_get_erase_sz(iobase); in mec_hal_espi_fc_check_erase_sz()
266 int mec_hal_espi_fc_xfr_start(struct mec_espi_io_regs *iobase, in mec_hal_espi_fc_xfr_start() argument
272 if (!iobase || !pxfr || !pxfr->byte_len || !pxfr->buf_addr in mec_hal_espi_fc_xfr_start()
281 if (mec_hal_espi_fc_is_ready(iobase)) { in mec_hal_espi_fc_xfr_start()
285 if (mec_hal_espi_fc_is_busy(iobase)) { in mec_hal_espi_fc_xfr_start()
308 iobase->FCIEN &= (uint32_t)~MEC_BIT(MEC_ESPI_IO_FCIEN_DONE_Pos); in mec_hal_espi_fc_xfr_start()
309 iobase->FCSTS = MEC_ESPI_FC_ERR_ALL | MEC_BIT(MEC_ESPI_IO_FCSTS_DONE_Pos); in mec_hal_espi_fc_xfr_start()
310 iobase->FCFA = pxfr->flash_addr; in mec_hal_espi_fc_xfr_start()
311 iobase->FCBA = pxfr->buf_addr; in mec_hal_espi_fc_xfr_start()
312 iobase->FCLEN = xfr_len; in mec_hal_espi_fc_xfr_start()
314 iobase->FCIEN |= MEC_BIT(MEC_ESPI_IO_FCIEN_DONE_Pos); in mec_hal_espi_fc_xfr_start()
317 iobase->FCCTL = ((((uint32_t)pxfr->tag << MEC_ESPI_IO_FCCTL_TAG_Pos) in mec_hal_espi_fc_xfr_start()