Compare commits

...

4 Commits

Author SHA1 Message Date
Martin Gysel
4bb922cb08 drivers: flash: stm32 ospi: do not invalidate bet at end of loop
This modification prevents the bet pointer from being nulled at the end
of the loop, which would otherwise render the search for a suitable
erase type ineffective. It also optimize the loop as it omits
unnecessary operations.

Without this change, the erase size defaults to one sector. If the chip
defines fewer than JESD216_NUM_ERASE_TYPES (=4) erase types, this
behavior still works, as the resulting command will correspond to a
sector erase operation. However, if the chip defines all erase types,
the resulting command will be the one specified in the erase type. But
since bet is nulled, the erase size will incorrectly default to the
sector size.

Signed-off-by: Martin Gysel <me@bearsh.org>
(cherry picked from commit c42c8a4da4)
2025-12-16 16:27:50 +00:00
Yong Cong Sin
cffdb1d8cf driver: i2c: i2c_dw: clear block mode on init
Depending on the IP's `IC_TX_CMD_BLOCK_DEFAULT` parameter, we
might have to clear the `TX_CMD_BLOCK` bit on init so that
Controller mode works.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit a028d8fafc)
2025-12-12 16:31:15 +02:00
Furkan Akkiz
260d76b698 manifest: Update hal_adi revision
Update hal_adi revision to get HAL fix commits. One of the fix commits
addresses an issue where the MAX32650 system clock frequency value was
not set correctly, which could lead to improper operation of
time-dependent functions.

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
(cherry picked from commit 2385641f12)
2025-12-12 16:31:05 +02:00
Derek Snell
7b0ad6bd9d boards: nxp: mimxrt1180_evk: fix directory for Jlink script
Fixes path to the script file so the script is used with "west debug".

Signed-off-by: Derek Snell <derek.snell@nxp.com>
(cherry picked from commit 6044d455e4)
2025-12-12 16:30:54 +02:00
4 changed files with 24 additions and 19 deletions

View File

@@ -7,14 +7,15 @@
# Note1: Suggest developers use Secure Provisioning Tool(SPT) to download RT1180 image
# SPT can be downloaded on NXP web: https://www.nxp.com/design/design-center/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-secure-provisioning-tool:MCUXPRESSO-SECURE-PROVISIONING
# Details about the usage of SPT on MIMXRT1180-EVK board can be referred on chapter 7 of getting start with Mcuxpresso SDK for MIMXRT1180-EVK doc in SDK package.
set(JLINKSCRIPTDIR ${CMAKE_CURRENT_LIST_DIR}/jlinkscript)
if(CONFIG_SOC_MIMXRT1189_CM33 OR CONFIG_SECOND_CORE_MCUX)
board_runner_args(linkserver "--device=MIMXRT1189xxxxx:MIMXRT1180-EVK")
board_runner_args(jlink "--device=MIMXRT1189xxx8_M33" "--reset-after-load" "--tool-opt=-jlinkscriptfile jlinkscript/evkmimxrt1180_cm33.jlinkscript")
board_runner_args(jlink "--device=MIMXRT1189xxx8_M33" "--reset-after-load" "--tool-opt=-jlinkscriptfile ${JLINKSCRIPTDIR}/evkmimxrt1180_cm33.jlinkscript")
elseif(CONFIG_SOC_MIMXRT1189_CM7)
# Note: Only support run cm7 image when debugging due to default boot core on board is cm33 core
board_runner_args(linkserver "--device=MIMXRT1189xxxxx:MIMXRT1180-EVK")
board_runner_args(linkserver "--core=cm7")
board_runner_args(jlink "--device=MIMXRT1189xxx8_M7" "--speed=4000" "--no-reset" "--tool-opt=-jlinkscriptfile jlinkscript/evkmimxrt1180_cm7.jlinkscript" "--tool-opt=-ir")
board_runner_args(jlink "--device=MIMXRT1189xxx8_M7" "--speed=4000" "--no-reset" "--tool-opt=-jlinkscriptfile ${JLINKSCRIPTDIR}/evkmimxrt1180_cm7.jlinkscript" "--tool-opt=-ir")
endif()
include(${ZEPHYR_BASE}/boards/common/linkserver.board.cmake)

View File

@@ -1293,24 +1293,23 @@ static int flash_stm32_ospi_erase(const struct device *dev, off_t addr,
&& ((bet == NULL)
|| (etp->exp > bet->exp))) {
bet = etp;
cmd_erase.Instruction = bet->cmd;
} else if (bet == NULL) {
/* Use the default sector erase cmd */
if (dev_cfg->data_mode == OSPI_OPI_MODE) {
cmd_erase.Instruction = SPI_NOR_OCMD_SE;
} else {
cmd_erase.Instruction =
(stm32_ospi_hal_address_size(dev) ==
HAL_OSPI_ADDRESS_32_BITS)
? SPI_NOR_CMD_SE_4B
: SPI_NOR_CMD_SE;
}
}
/* Avoid using wrong erase type,
* if zero entries are found in erase_types
*/
bet = NULL;
}
if (bet != NULL) {
cmd_erase.Instruction = bet->cmd;
} else {
/* Use the default sector erase cmd */
if (dev_cfg->data_mode == OSPI_OPI_MODE) {
cmd_erase.Instruction = SPI_NOR_OCMD_SE;
} else {
cmd_erase.Instruction = (stm32_ospi_hal_address_size(dev) ==
HAL_OSPI_ADDRESS_32_BITS)
? SPI_NOR_CMD_SE_4B
: SPI_NOR_CMD_SE;
}
}
LOG_DBG("Sector/Block Erase addr 0x%x, asize 0x%x amode 0x%x instr 0x%x",
cmd_erase.Address, cmd_erase.AddressSize,
cmd_erase.AddressMode, cmd_erase.Instruction);

View File

@@ -1294,6 +1294,11 @@ static int i2c_dw_initialize(const struct device *dev)
uint32_t reg_base = get_regs(dev);
clear_bit_enable_en(reg_base);
/*
* depending on the IP configuration, we may have to disable block mode in
* controller mode
*/
clear_bit_enable_block(reg_base);
/* verify that we have a valid DesignWare register first */
if (read_comp_type(reg_base) != I2C_DW_MAGIC_KEY) {

View File

@@ -144,7 +144,7 @@ manifest:
groups:
- fs
- name: hal_adi
revision: eeb155f7382343438114605963ae64436cc53434
revision: 4a189d5d2d20267084d9066cd0c4548dd730f809
path: modules/hal/adi
groups:
- hal