Skip to content

Commit

Permalink
nxp: imx7d-6sx: add rom_start relocation
Browse files Browse the repository at this point in the history
Add the Kconfig options and use the aliased
addresses for the bootcode regions of the IMX7D
and IMX6SX SOCs to allow the Linux rproc
framework to load the irq-vectors into
the correct memory areas.

Activating this option might enlarge the bin
file if the zephyr,flash and rom_start chosen
region addresses are not matching.

It is up to the user to enable this feature
based on code location choices (OCRAM, DDR, TCM...).

Signed-off-by: Jérémy LOCHE - MAKEEN Energy <[email protected]>
  • Loading branch information
jlh-makeen authored and carlescufi committed May 16, 2024
1 parent 8ef8e8b commit 724be84
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
5 changes: 3 additions & 2 deletions dts/arm/nxp/nxp_imx6sx_m4.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
};
};

tcml:memory@1fff8000 {
/* TCML 0x1fff8000 is aliased at 0 */
tcml:memory@0 {
compatible = "nxp,imx-itcm";
reg = <0x1fff8000 DT_SIZE_K(32)>;
reg = <0x00000000 DT_SIZE_K(32)>;
};

tcmu:memory@20000000 {
Expand Down
5 changes: 3 additions & 2 deletions dts/arm/nxp/nxp_imx7d_m4.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@
reg = <0x20200000 DT_SIZE_K(128)>;
};

ocram_s_code: code@20180000 {
/* OCRAM_S 0x20180000 is aliased at 0 */
ocram_s_code: code@0 {
compatible = "nxp,imx-code-bus";
reg = <0x20180000 DT_SIZE_K(32)>;
reg = <0x00000000 DT_SIZE_K(32)>;
};

ocram_s_sys: memory@180000 {
Expand Down
14 changes: 14 additions & 0 deletions soc/nxp/imx/imx6sx/Kconfig.defconfig.mcimx6x_m4
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,18 @@ if SOC_MCIMX6X_M4
config FPU
default y


#-By default ROM_START is relocated to address 0 in a 1K region, allowing imx_rproc
# to translate it to TCM_L address
#-Select the relocation if the chosen flash is not the TCML
#-Disable this option if you use the bin format as this choice will enlarge it.
# This is due to relocation of the irq-vectors in a different memory region than
# the chosen zephyr,flash and all the address span in between
# will be filled in the bin file.
config ROMSTART_RELOCATION_ROM
default n

config ROMSTART_REGION_ADDRESS
default $(dt_nodelabel_reg_addr_hex,tcml)

endif # SOC_MCIMX6X_M4
13 changes: 13 additions & 0 deletions soc/nxp/imx/imx7d/Kconfig.defconfig.mcimx7d_m4
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,17 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC
config GPIO
default y

#-By default ROM_START is relocated to address 0 in a 1K region, allowing imx_rproc
# to translate it to OCRAM_S address
#-Select the relocation if the chosen flash is not the OCRAM_S
#-Disable this option if you use the bin format as this choice will enlarge it.
# This is due to relocation of the irq-vectors in a different memory region than
# the chosen zephyr,flash and all the address span in between
# will be filled in the bin file.
config ROMSTART_RELOCATION_ROM
default n

config ROMSTART_REGION_ADDRESS
default $(dt_nodelabel_reg_addr_hex,ocram_s_code)

endif # SOC_MCIMX7D_M4

0 comments on commit 724be84

Please sign in to comment.