Building u-boot for a custom imx93 based board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Building u-boot for a custom imx93 based board

Jump to solution
3,838 Views
abt
Contributor III

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.

0 Kudos
Reply
1 Solution
3,794 Views
abt
Contributor III

My problem has been solved. I was missing a step.

View solution in original post

0 Kudos
Reply
6 Replies
2,872 Views
Victory777
Contributor I

Hi @abt 

I am currently stuck at the same error you got :

aarch64-poky-linux-ld.bfd: board/freescale/imx93_som/spl.o: in function `spl_dram_init':
/home/user/uboot-imx-2023.04-A1/board/freescale/imx93_som/spl.c:78:(.text.spl_dram_init+0xc): undefined reference to `dram_timing'
aarch64-poky-linux-ld.bfd: /home/user/uboot-imx-2023.04-A1/board/freescale/imx93_som/spl.c:78:(.text.spl_dram_init+0x10): undefined reference to `dram_timing'
make[1]: *** [scripts/Makefile.spl:528: spl/u-boot-spl] Error 1

I have added the missing step in red and also updated the Makefile as you have mentionned before but still stuck at the same error.
Is there any other missing step  for resolving this error please ?

0 Kudos
Reply
2,832 Views
abt
Contributor III

I would try updating some additional variables in .config file as shown below:

CONFIG_DEFAULT_DEVICE_TREE="imx93-som"
CONFIG_OF_LIST="imx93-som"
CONFIG_SPL_OF_LIST="imx93-som"

Regards

 

0 Kudos
Reply
3,733 Views
eik3
Contributor II

Hi @abt,

What was the missing step?

Thanks in advance.

0 Kudos
Reply
3,795 Views
abt
Contributor III

My problem has been solved. I was missing a step.

0 Kudos
Reply
3,384 Views
dpog
Contributor V
Hi @abt,
I'm currently stuck at the same problem, do you recall what your missing step was?
0 Kudos
Reply
3,360 Views
abt
Contributor III

Here is the missing step in red:

cp -R board/freescale/imx93_evk/ board/freescale/imx93_som
mv board/freescale/imx93_som/imx93_evk.c board/freescale/imx93_som/imx93_som.c
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

I forgot to also mention these changes:

diff --git a/board/freescale/imx93_som/Makefile b/board/freescale/imx93_som/Makefile
index b6b978dd..4710b954 100644
--- a/board/freescale/imx93_som/Makefile
+++ b/board/freescale/imx93_som/Makefile
@@ -4,7 +4,7 @@
 # SPDX-License-Identifier:      GPL-2.0+
 #
 
-obj-y += imx93_evk.o
+obj-y += imx93_som.o
 
 ifdef CONFIG_SPL_BUILD
 obj-y += spl.o

 

0 Kudos
Reply