I have updated lpddr4x_timing.c and spl.c in the existing board/freescale/imx93_evk u-boot source folder to reflect custom DRAM and PMIC integrations. I was able to build the flash binary file and successfully deploy it on the eMMC storage.
Is there any guidance for creating a custom board configuration for u-boot?
I have been trying to create a separate configuration for the custom board, in the source tree, using the steps outlined below:
cp -R board/freescale/imx93_evk board/freescale/imx93_som
cp include/configs/imx93_evk.h include/configs/imx93_som.h
cp arch/arm/dts/imx93-11x11-evk.dts arch/arm/dts/imx93-11x11-som.dts
cp arch/arm/dts/imx93-11x11-evk-u-boot.dtsi arch/arm/dts/imx93-11x11-som-u-boot.dtsi
Updated board/freescale/imx93_som/Kconfig with this content:
if TARGET_IMX93_11X11_SOM
config SYS_BOARD
default "imx93_som"
config SYS_VENDOR
default "freescale"
config SYS_CONFIG_NAME
default "imx93_som"
choice
prompt "Select DDR Type"
default IMX93_EVK_LPDDR4X if TARGET_IMX93_11X11_SOM
config IMX93_EVK_LPDDR4X
bool "Using LPDDR4X Timing and PMIC voltage"
select IMX9_LPDDR4X
help
Select the LPDDR4X timing and 0.6V VDDQ
config IMX93_EVK_LPDDR4
bool "Using LPDDR4 Timing and PMIC voltage"
select IMX9_LPDDR4X
help
Select the LPDDR4 timing and 1.1V VDDQ
endchoice
endif
Updated arch/arm/mach-imx/imx9/Kconfig with the following addition:
...
config TARGET_IMX93_11X11_SOM
bool "imx93_11x11_som"
select OF_BOARD_FIXUP
select IMX93
...
source "board/freescale/imx93_som/Kconfig"
...
Updated arch/arm/dts/Makefile and added an entry for a custom dts file:
dtb-$(CONFIG_ARCH_IMX9) += \
imx93-11x11-evk.dtb \
imx93-11x11-som.dtb \
imx93-14x14-evk.dtb \
imx93-9x9-qsb.dtb \
imx93-9x9-qsb-ontat-wvga-panel.dtb \
imx91p-11x11-evk.dtb \
imx91p-9x9-qsb-ontat-wvga-panel.dtb \
imx91p-9x9-qsb-spinand.dtb
Updated .config file with the following changes:
29,30c29,30
< CONFIG_SYS_BOARD="imx93_evk"
< CONFIG_SYS_CONFIG_NAME="imx93_evk"
---
> CONFIG_SYS_BOARD="imx93_som"
> CONFIG_SYS_CONFIG_NAME="imx93_som"
195c195
< CONFIG_DEFAULT_DEVICE_TREE="imx93-11x11-evk"
---
> CONFIG_DEFAULT_DEVICE_TREE="imx93-11x11-som"
202c202
< CONFIG_TARGET_IMX93_11X11_EVK=y
---
> # CONFIG_TARGET_IMX93_11X11_EVK is not set
206,207c206
< CONFIG_IMX93_EVK_LPDDR4X=y
< # CONFIG_IMX93_EVK_LPDDR4 is not set
---
> CONFIG_TARGET_IMX93_11X11_SOM=y
431c430
< CONFIG_DEFAULT_FDT_FILE="imx93-11x11-evk.dtb"
---
> CONFIG_DEFAULT_FDT_FILE="imx93-11x11-som.dtb"
936c935
< CONFIG_OF_LIST="imx93-11x11-evk"
---
> CONFIG_OF_LIST="imx93-11x11-som"
938c937
< CONFIG_SPL_OF_LIST="imx93-11x11-evk"
---
> CONFIG_SPL_OF_LIST="imx93-11x11-som"
However, I get the following error when trying to make a build:
...
AR spl/fs/built-in.o
LDS spl/u-boot-spl.lds
LD spl/u-boot-spl
aarch64-poky-linux-ld.bfd: board/freescale/imx93_som/spl.o: in function `spl_dram_init':
/home/user/controls/Uboot/user-som/source/board/freescale/imx93_som/spl.c:76: undefined reference to `dram_timing'
aarch64-poky-linux-ld.bfd: /home/user/controls/Uboot/user-som/source/board/freescale/imx93_som/spl.c:76: undefined reference to `dram_timing'
make[2]: *** [/home/user/controls/Uboot/user-som/source/scripts/Makefile.spl:528: spl/u-boot-spl] Error 1
make[1]: *** [/home/user/controls/Uboot/user-som/source/Makefile:2044: spl/u-boot-spl] Error 2
make[1]: Leaving directory '/home/user/controls/Uboot/user-som/artifacts'
make: *** [Makefile:177: sub-make] Error 2
make: Leaving directory '/home/user/controls/Uboot/user-som/source'
Did I miss anything?
Any input appreciated, thanks in advance.