Lines Matching full:base

39 static void flash_deinit(XSPI_Type *base, CACHE64_CTRL_Type *cache)  in flash_deinit()  argument
41 if (base == XSPI0) { in flash_deinit()
44 } else if (base == XSPI1) { in flash_deinit()
49 base->MCR &= ~XSPI_MCR_MDIS_MASK; in flash_deinit()
54 while ((base->SR & XSPI_SR_BUSY_MASK) != 0U) { in flash_deinit()
57 base->MCR |= XSPI_MCR_MDIS_MASK; in flash_deinit()
60 static void flash_init(XSPI_Type *base, CACHE64_CTRL_Type *cache) in flash_init() argument
63 base->MCR |= XSPI_MCR_MDIS_MASK; in flash_init()
65 base->MCR |= XSPI_MCR_SWRSTSD_MASK | XSPI_MCR_SWRSTHD_MASK; in flash_init()
69 base->MCR &= ~(XSPI_MCR_SWRSTSD_MASK | XSPI_MCR_SWRSTHD_MASK); in flash_init()
70 base->MCR |= XSPI_MCR_IPS_TG_RST_MASK | XSPI_MCR_MDIS_MASK; in flash_init()
71 base->MCR &= ~XSPI_MCR_ISD3FA_MASK; in flash_init()
72 base->MCR &= ~XSPI_MCR_MDIS_MASK; in flash_init()
73 base->MCR |= XSPI_MCR_MDIS_MASK; in flash_init()
74 base->MCR |= XSPI_MCR_ISD3FA_MASK; in flash_init()
75 base->MCR &= ~XSPI_MCR_MDIS_MASK; in flash_init()
77 base->MCR |= XSPI_MCR_MDIS_MASK; in flash_init()
78 base->SMPR = (((base->SMPR) & (~XSPI_SMPR_DLLFSMPFA_MASK)) | in flash_init()
80 base->MCR &= ~XSPI_MCR_MDIS_MASK; in flash_init()
82 base->DLLCR[0] &= in flash_init()
86 base->DLLCR[0] &= in flash_init()
89 base->DLLCR[0] |= XSPI_DLLCR_SLV_EN_MASK | XSPI_DLLCR_SLAVE_AUTO_UPDT_MASK; in flash_init()
91 base->DLLCR[0] |= in flash_init()
98 base->DLLCR[0] |= XSPI_DLLCR_SLV_UPD_MASK; in flash_init()
99 base->DLLCR[0] |= XSPI_DLLCR_DLLEN_MASK; in flash_init()
100 base->DLLCR[0] &= ~XSPI_DLLCR_SLV_UPD_MASK; in flash_init()
102 while ((base->DLLSR & XSPI_DLLSR_SLVA_LOCK_MASK) == 0UL) { in flash_init()
114 void xspi_setup_clock(XSPI_Type *base, uint32_t src, uint32_t divider) in xspi_setup_clock() argument
116 if (base == XSPI0) { in xspi_setup_clock()
124 flash_deinit(base, CACHE64_CTRL0); in xspi_setup_clock()
137 flash_init(base, CACHE64_CTRL0); in xspi_setup_clock()
139 } else if (base == XSPI1) { in xspi_setup_clock()
146 flash_deinit(base, CACHE64_CTRL1); in xspi_setup_clock()
159 flash_init(base, CACHE64_CTRL1); in xspi_setup_clock()