Lines Matching refs:hospi
155 OSPI_HandleTypeDef hospi; member
206 hal_ret = HAL_OSPI_Command(&dev_data->hospi, cmd, HAL_OSPI_TIMEOUT_DEFAULT_VALUE); in ospi_send_cmd()
228 hal_ret = HAL_OSPI_Command(&dev_data->hospi, cmd, HAL_OSPI_TIMEOUT_DEFAULT_VALUE); in ospi_read_access()
235 hal_ret = HAL_OSPI_Receive_DMA(&dev_data->hospi, data); in ospi_read_access()
237 hal_ret = HAL_OSPI_Receive_IT(&dev_data->hospi, data); in ospi_read_access()
269 hal_ret = HAL_OSPI_Command(&dev_data->hospi, cmd, HAL_OSPI_TIMEOUT_DEFAULT_VALUE); in ospi_write_access()
276 hal_ret = HAL_OSPI_Transmit_DMA(&dev_data->hospi, (uint8_t *)data); in ospi_write_access()
278 hal_ret = HAL_OSPI_Transmit_IT(&dev_data->hospi, (uint8_t *)data); in ospi_write_access()
390 hal_ret = HAL_OSPI_Command(&dev_data->hospi, &cmd, in stm32_ospi_read_jedec_id()
399 hal_ret = HAL_OSPI_Receive(&dev_data->hospi, dev_data->jedec_id, in stm32_ospi_read_jedec_id()
463 hal_ret = HAL_OSPI_Command(&dev_data->hospi, &cmd, HAL_OSPI_TIMEOUT_DEFAULT_VALUE); in stm32_ospi_read_sfdp()
469 hal_ret = HAL_OSPI_Receive(&dev_data->hospi, (uint8_t *)data, in stm32_ospi_read_sfdp()
531 static int stm32_ospi_mem_erased(OSPI_HandleTypeDef *hospi, uint8_t nor_mode, uint8_t nor_rate) in stm32_ospi_mem_erased() argument
563 if (HAL_OSPI_Command(hospi, &s_command, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { in stm32_ospi_mem_erased()
569 if (HAL_OSPI_AutoPolling(hospi, &s_config, STM32_OSPI_BULK_ERASE_MAX_TIME) != HAL_OK) { in stm32_ospi_mem_erased()
582 static int stm32_ospi_mem_ready(OSPI_HandleTypeDef *hospi, uint8_t nor_mode, uint8_t nor_rate) in stm32_ospi_mem_ready() argument
613 if (HAL_OSPI_Command(hospi, &s_command, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { in stm32_ospi_mem_ready()
619 if (HAL_OSPI_AutoPolling(hospi, &s_config, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { in stm32_ospi_mem_ready()
628 static int stm32_ospi_write_enable(OSPI_HandleTypeDef *hospi, uint8_t nor_mode, uint8_t nor_rate) in stm32_ospi_write_enable() argument
645 if (HAL_OSPI_Command(hospi, &s_command, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { in stm32_ospi_write_enable()
671 if (HAL_OSPI_Command(hospi, &s_command, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { in stm32_ospi_write_enable()
682 if (HAL_OSPI_AutoPolling(hospi, &s_config, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { in stm32_ospi_write_enable()
691 static int stm32_ospi_write_cfg2reg_dummy(OSPI_HandleTypeDef *hospi, in stm32_ospi_write_cfg2reg_dummy() argument
706 if (HAL_OSPI_Command(hospi, &s_command, in stm32_ospi_write_cfg2reg_dummy()
712 if (HAL_OSPI_Transmit(hospi, &transmit_data, in stm32_ospi_write_cfg2reg_dummy()
722 static int stm32_ospi_write_cfg2reg_io(OSPI_HandleTypeDef *hospi, in stm32_ospi_write_cfg2reg_io() argument
736 if (HAL_OSPI_Command(hospi, &s_command, in stm32_ospi_write_cfg2reg_io()
742 if (HAL_OSPI_Transmit(hospi, &op_enable, in stm32_ospi_write_cfg2reg_io()
752 static int stm32_ospi_read_cfg2reg(OSPI_HandleTypeDef *hospi, in stm32_ospi_read_cfg2reg() argument
769 if (HAL_OSPI_Command(hospi, &s_command, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { in stm32_ospi_read_cfg2reg()
774 if (HAL_OSPI_Receive(hospi, value, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { in stm32_ospi_read_cfg2reg()
799 if (stm32_ospi_write_enable(&dev_data->hospi, in stm32_ospi_config_mem()
806 if (stm32_ospi_write_cfg2reg_dummy(&dev_data->hospi, in stm32_ospi_config_mem()
811 if (stm32_ospi_mem_ready(&dev_data->hospi, in stm32_ospi_config_mem()
816 if (stm32_ospi_write_enable(&dev_data->hospi, in stm32_ospi_config_mem()
826 if (stm32_ospi_write_cfg2reg_io(&dev_data->hospi, in stm32_ospi_config_mem()
836 dev_data->hospi.Init.MemoryType = HAL_OSPI_MEMTYPE_MACRONIX; in stm32_ospi_config_mem()
837 dev_data->hospi.Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_ENABLE; in stm32_ospi_config_mem()
838 if (HAL_OSPI_Init(&dev_data->hospi) != HAL_OK) { in stm32_ospi_config_mem()
844 if (stm32_ospi_mem_ready(&dev_data->hospi, in stm32_ospi_config_mem()
851 if (stm32_ospi_read_cfg2reg(&dev_data->hospi, in stm32_ospi_config_mem()
862 if (stm32_ospi_mem_ready(&dev_data->hospi, in stm32_ospi_config_mem()
904 if (HAL_OSPI_Command(&dev_data->hospi, in stm32_ospi_mem_reset()
912 if (HAL_OSPI_Command(&dev_data->hospi, in stm32_ospi_mem_reset()
923 if (HAL_OSPI_Command(&dev_data->hospi, in stm32_ospi_mem_reset()
931 if (HAL_OSPI_Command(&dev_data->hospi, in stm32_ospi_mem_reset()
940 if (HAL_OSPI_Command(&dev_data->hospi, in stm32_ospi_mem_reset()
948 if (HAL_OSPI_Command(&dev_data->hospi, in stm32_ospi_mem_reset()
1007 if (stm32_ospi_mem_ready(&dev_data->hospi, in flash_stm32_ospi_erase()
1026 ret = stm32_ospi_write_enable(&dev_data->hospi, in flash_stm32_ospi_erase()
1047 ret = stm32_ospi_mem_erased(&dev_data->hospi, in flash_stm32_ospi_erase()
1115 ret = stm32_ospi_mem_ready(&dev_data->hospi, in flash_stm32_ospi_erase()
1278 ret = stm32_ospi_mem_ready(&dev_data->hospi, in flash_stm32_ospi_write()
1288 ret = stm32_ospi_write_enable(&dev_data->hospi, in flash_stm32_ospi_write()
1318 ret = stm32_ospi_mem_ready(&dev_data->hospi, in flash_stm32_ospi_write()
1348 HAL_OSPI_IRQHandler(&dev_data->hospi); in flash_stm32_ospi_isr()
1385 void HAL_OSPI_ErrorCallback(OSPI_HandleTypeDef *hospi) in HAL_OSPI_ErrorCallback() argument
1388 CONTAINER_OF(hospi, struct flash_stm32_ospi_data, hospi); in HAL_OSPI_ErrorCallback()
1400 void HAL_OSPI_CmdCpltCallback(OSPI_HandleTypeDef *hospi) in HAL_OSPI_CmdCpltCallback() argument
1403 CONTAINER_OF(hospi, struct flash_stm32_ospi_data, hospi); in HAL_OSPI_CmdCpltCallback()
1413 void HAL_OSPI_RxCpltCallback(OSPI_HandleTypeDef *hospi) in HAL_OSPI_RxCpltCallback() argument
1416 CONTAINER_OF(hospi, struct flash_stm32_ospi_data, hospi); in HAL_OSPI_RxCpltCallback()
1426 void HAL_OSPI_TxCpltCallback(OSPI_HandleTypeDef *hospi) in HAL_OSPI_TxCpltCallback() argument
1429 CONTAINER_OF(hospi, struct flash_stm32_ospi_data, hospi); in HAL_OSPI_TxCpltCallback()
1439 void HAL_OSPI_StatusMatchCallback(OSPI_HandleTypeDef *hospi) in HAL_OSPI_StatusMatchCallback() argument
1442 CONTAINER_OF(hospi, struct flash_stm32_ospi_data, hospi); in HAL_OSPI_StatusMatchCallback()
1452 void HAL_OSPI_TimeOutCallback(OSPI_HandleTypeDef *hospi) in HAL_OSPI_TimeOutCallback() argument
1455 CONTAINER_OF(hospi, struct flash_stm32_ospi_data, hospi); in HAL_OSPI_TimeOutCallback()
1663 ret = stm32_ospi_write_enable(&data->hospi, OSPI_SPI_MODE, OSPI_STR_TRANSFER); in stm32_ospi_enable_qe()
1675 ret = stm32_ospi_mem_ready(&data->hospi, OSPI_SPI_MODE, OSPI_STR_TRANSFER); in stm32_ospi_enable_qe()
1979 __HAL_LINKDMA(&dev_data->hospi, hdma, hdma); in flash_stm32_ospi_init()
2035 dev_data->hospi.Init.FifoThreshold = 4; in flash_stm32_ospi_init()
2036 dev_data->hospi.Init.ClockPrescaler = prescaler; in flash_stm32_ospi_init()
2039 dev_data->hospi.Init.DeviceSize = find_lsb_set(dev_cfg->flash_size) - 2; in flash_stm32_ospi_init()
2042 dev_data->hospi.Init.DeviceSize = find_lsb_set(dev_cfg->flash_size) - 1; in flash_stm32_ospi_init()
2044 dev_data->hospi.Init.DualQuad = HAL_OSPI_DUALQUAD_DISABLE; in flash_stm32_ospi_init()
2045 dev_data->hospi.Init.ChipSelectHighTime = 2; in flash_stm32_ospi_init()
2046 dev_data->hospi.Init.FreeRunningClock = HAL_OSPI_FREERUNCLK_DISABLE; in flash_stm32_ospi_init()
2047 dev_data->hospi.Init.ClockMode = HAL_OSPI_CLOCK_MODE_0; in flash_stm32_ospi_init()
2049 dev_data->hospi.Init.WrapSize = HAL_OSPI_WRAP_NOT_SUPPORTED; in flash_stm32_ospi_init()
2053 dev_data->hospi.Init.MemoryType = HAL_OSPI_MEMTYPE_MACRONIX; in flash_stm32_ospi_init()
2054 dev_data->hospi.Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_ENABLE; in flash_stm32_ospi_init()
2056 dev_data->hospi.Init.MemoryType = HAL_OSPI_MEMTYPE_MICRON; in flash_stm32_ospi_init()
2057 dev_data->hospi.Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_DISABLE; in flash_stm32_ospi_init()
2059 dev_data->hospi.Init.ChipSelectBoundary = 0; in flash_stm32_ospi_init()
2061 dev_data->hospi.Init.DelayBlockBypass = HAL_OSPI_DELAY_BLOCK_BYPASSED; in flash_stm32_ospi_init()
2063 dev_data->hospi.Init.DelayBlockBypass = HAL_OSPI_DELAY_BLOCK_USED; in flash_stm32_ospi_init()
2066 dev_data->hospi.Init.Refresh = 0; in flash_stm32_ospi_init()
2069 if (HAL_OSPI_Init(&dev_data->hospi) != HAL_OK) { in flash_stm32_ospi_init()
2080 if (dev_data->hospi.Instance == OCTOSPI1) { in flash_stm32_ospi_init()
2088 } else if (dev_data->hospi.Instance == OCTOSPI2) { in flash_stm32_ospi_init()
2100 if (HAL_OSPIM_Config(&dev_data->hospi, &ospi_mgr_cfg, in flash_stm32_ospi_init()
2111 if (HAL_OSPI_DLYB_SetConfig(&dev_data->hospi, &ospi_delay_block_cfg) != HAL_OK) { in flash_stm32_ospi_init()
2123 (void)HAL_XSPI_DLYB_GetClockPeriod(&dev_data->hospi, &xspi_delay_block_cfg); in flash_stm32_ospi_init()
2127 if (HAL_XSPI_DLYB_SetConfig(&dev_data->hospi, &xspi_delay_block_cfg) != HAL_OK) { in flash_stm32_ospi_init()
2145 if (stm32_ospi_mem_ready(&dev_data->hospi, in flash_stm32_ospi_init()
2324 .hospi = {