This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6442: Build uboot for AM42x

Part Number: AM6442

Hi, 

I have an SD card image which I received with the EVM I purchased TMDS64GPEVM3.

I'm trying to build u-boot for my PCB, which includes a XAM6442ASFGGAALV processor.

My PCB actually starts U-boot with the EVM's SD card.

In order to build u-boot, I'm doing the following steps:

Clone the following repositories:

     git://git.ti.com/k3-image-gen/k3-image-gen.git, tag 08.00.00.004

     git://git.ti.com/atf/arm-trusted-firmware.git, tag 08.00.00.004

    https://github.com/OP-TEE/optee_os.git

    git://git.ti.com/ti-u-boot/ti-u-boot.git,  tag 08.00.00.004

Build ATF:

     make CROSS_COMPILE=aarch64-linux-gnu- ARCH=aarch64 PLAT=k3 TARGET_BOARD=generic SPD=opteed

Build OPTEE:

     make ARCH=arm PLATFORM=k3-am64x CROSS_COMPILE32=arm-linux-gnueabihf- CFG_ARM64_core=y

Build SYSFW (k3-image-gen repo):

     make CROSS_COMPILE=arm-linux-gnueabihf- SOC=am64x

Build U-boot:

     R5:

          make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am64x_evm_r5_defconfig
          make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

     A53:

          make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- am64x_evm_a53_defconfig
          make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- ATF=<bl31.bin from ATF build> TEE=<tee-pager_v2.bin from optee build>

After all these build, I overwrite SD files: tiboot3.bin, tispl.bin, u-boot.img and sysfw.itb with the ones I built.

This is the console output:

U-Boot SPL 2021.01 (Oct 03 2021 - 13:29:28 +0300)
EEPROM not available at 80, trying to read at 81
Reading on-board EEPROM at 0x51 failed 1
SYSFW ABI: 3.1 (firmware rev 0x0015 '21.5.0--v2021.05 (Terrific Llam')
SPL initial stack usage: 13392 bytes
Trying to boot from MMC2
Starting ATF on ARM64 core...

NOTICE: BL31: v2.5(release):08.00.00.004
NOTICE: BL31: Built : 13:20:28, Oct 3 2021
Unhandled Exception in EL3.
x30 = 0x00000000701a5cd8
x0 = 0x0000000000000001
x1 = 0x00000000701a9010
x2 = 0x00000000701a9000
x3 = 0x00000000701a9050
x4 = 0x0000000032401000
x5 = 0x0000000000000040
x6 = 0x00000000701b0788
x7 = 0x0000000000000000
x8 = 0x00000000701bffff
x9 = 0x00000000701b0958
x10 = 0x0000000032c80000
x11 = 0x0000000000000000
x12 = 0x0204000020100580
x13 = 0x52a84041215c0237
x14 = 0x04000010620c06b6
x15 = 0x6180800000040180
x16 = 0xba10018548280502
x17 = 0x00000000701a0614
x18 = 0x0000000000000004
x19 = 0x00000000701a822b
x20 = 0x00000000701aa370
x21 = 0x0000000000000000
x22 = 0x0000000000000000
x23 = 0x0000000000000000
x24 = 0x38288ce698a00438
x25 = 0x8069a0185de8d0c1
x26 = 0xd022020282240045
x27 = 0x9d8b29f512410084
x28 = 0x08261195d1100128
x29 = 0x00000000701aa300
scr_el3 = 0x0000000000000238
sctlr_el3 = 0x0000000030cd183f
cptr_el3 = 0x0000000000000000
tcr_el3 = 0x0000000080803520
daif = 0x00000000000003c0
mair_el3 = 0x00000000004404ff
spsr_el3 = 0x00000000600002cc
elr_el3 = 0x00000000701a2cb0
ttbr0_el3 = 0x00000000701b0a80
esr_el3 = 0x0000000096000010
far_el3 = 0x0000000032401000
spsr_el1 = 0x00000000561bd7e5
elr_el1 = 0xbb0000120000090c
spsr_abt = 0x000000006410bb2d
spsr_und = 0x0000000002184f8a
spsr_irq = 0x00000000221c3cd8
spsr_fiq = 0x000000003611df24
sctlr_el1 = 0x0000000000c50838
actlr_el1 = 0x0000000000000000
cpacr_el1 = 0x0000000000000000
csselr_el1 = 0x0000000000000000
sp_el1 = 0x0090001002048200
esr_el1 = 0x000000000f6c7073
ttbr0_el1 = 0xbe4c4504001060a0
ttbr1_el1 = 0x3b00221961915619
mair_el1 = 0x44e048e000098aa4
amair_el1 = 0x0000000000000000
tcr_el1 = 0x0000000000000000
tpidr_el1 = 0x0314180310212040
tpidr_el0 = 0x8300300500980203
tpidrro_el0 = 0x8380400105a24b64
par_el1 = 0x4200001000c54083
mpidr_el1 = 0x0000000080000000
afsr0_el1 = 0x0000000000000000
afsr1_el1 = 0x0000000000000000
contextidr_el1 = 0x0000000000000000
vbar_el1 = 0x0000000000000000
cntp_ctl_el0 = 0x0000000000000000
cntp_cval_el0 = 0xe863004477c983fb
cntv_ctl_el0 = 0x0000000000000002
cntv_cval_el0 = 0x7ddfd95980287c31
cntkctl_el1 = 0x0000000000000000
sp_el0 = 0x00000000701aa300
isr_el1 = 0x0000000000000000
dacr32_el2 = 0x000000006100b82a
ifsr32_el2 = 0x0000000000001036
cpuectlr_el1 = 0x0000000000000040
cpumerrsr_el1 = 0x00000000111806b1
l2merrsr_el1 = 0x00000000122412e0

Now, If I use tiboot3.bin and tispl.bin received in the SD card, and I overwrite sysfw.itb and u-boot.img with the ones I built, uboot does starts.

What am I doing wrong?

Thanks

  • I found the problem, I used TARGET_BOARD=generic instead of TARGET_BOARD=lite in ATF compilation.

  • Hi Alvaro,
    It is good to know you had the u-boot build issue resolved.
    Best,
    -Hong

  • Thanks!

    Now I'm working on the DDR training.

    I generated a k3-am64-ddr-config.dtsi and board_ddrReginit.h files using DDR SUBSYSTEM REGISTER CONFIGURATION tool.

    Following the documentation, I should call DDR_init function, but I could not find the function definition in uboot repository.

    What am I missing?

    I cloned the uboot from:

    git://git.ti.com/ti-u-boot/ti-u-boot.git (tag 08.00.00.004)

  • Hi Alvaro,

    K3 u-boot starts using Driver Model (DM) for DDR configurations, where some specific u-boot DDR files for AM64x:
    a). drivers/ram/k3-ddrss/: DDR driver
    b). doc/device-tree-bindings/memory-controller/k3-j721e-ddrss.txt: readme for DDR DT node
    c). arch/arm/dts/k3-am64-ddr.dtsi: DDR DT for AM64x
    d1). arch/arm/dts/k3-am64-evm-ddr4-1600MTs.dtsi: DDR DT instantiation for AM64x GP EVM
    d2). arch/arm/dts/k3-am64-sk-lp4-1333MTs.dtsi: DDR DT instantiation for AM64x SK board

    With DM enabled in R5 SPL for DDR configuration in K3 (i.e. AM64x), the DDR configuration would be updating the item (d), which is generated with DDR configuration tool.

    - AM64x GP EVM example:
    /arch/arm/dts/k3-am642-r5-evm.dts
    #include "k3-am642.dtsi"
    #include "k3-am64-evm-ddr4-1600MTs.dtsi"
    #include "k3-am64-ddr.dtsi"
    
    - AM64x SK board example:
    /arch/arm/dts/k3-am642-r5-sk.dts
    #include "k3-am642.dtsi"
    #include "k3-am64-sk-lp4-1333MTs.dtsi"
    #include "k3-am64-ddr.dtsi"

    Hope it helps for your DDR customization for your board.
    Best,
    -Hong

  • Thanks for the response.

    I added the dtsi output to my u-boot repository, and included it in k3-am642-r5-evm.dts

    #include "k3-am642.dtsi"
    #include "k3-am64-ddr-config.dtsi" /*DDR tool output*/
    #include "k3-am64-ddr.dtsi"
    

    I still have memory crashes in my linux.

    I'm not sure if this is caused because of bad parameters in the DDR config tool, or because I'm missing something.

    Can you confirm that all action needed with the DDR config tool output is to include the dtsi file in my R5 devicetree?

    The board_ddrReginit.h file can be ignored?

    No need to call to DDR_init function?

    Thanks again.

  • Hi Alvaro,
    dev.ti.com/.../README.md
    - k3-am64-ddr-config.dtsi: dtsi DDR node for R5 SPL in u-boot
    - board_ddrReginit.h: for MCU+ SDK (RTOS), together with DDR_init()
    One additional reference on AM64x\AM243x DDR Board Design and Layout Guidelines:
    www.ti.com/.../spracu1

    Best,
    -Hong