LS1046A custom board using LSDK 21.08 boot process stalls

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

LS1046A custom board using LSDK 21.08 boot process stalls

Jump to solution
3,496 Views
Daves_Garage
Contributor IV

Hi, I'm looking for suggestions on how to solve a boot-up process on a custom LS1046A board I'm working on. I'm using the LSDK 21.08 platform, and have enabled debugging, as well as added code to track progression through the stages of the boot-up process, and I'm not able to make my way into u-boot.

The output from my diagnostic terminal looks like this:

NOTICE:  --------------------------------------------------------------
NOTICE:                    TFA BOOTLOADER STARTED
NOTICE:  --------------------------------------------------------------
INFO:    BL1: v2.4(debug):7d8a5dfde1-dirty
INFO:    BL1: Built : 06:31:12, Oct 13 2022
INFO:    soc_early_init()->soc_errata()
INFO:    SoC workaround for Errata A008850 Early-Phase was applied
INFO:    SoC workaround for Errata A010539 was applied
INFO:    RCW BOOT SRC is QSPI
INFO:    SoC workaround for DDR Errata A008511 was applied
INFO:    SoC workaround for DDR Errata A009803 was applied
INFO:    SoC workaround for DDR Errata A009942 was applied
INFO:    SoC workaround for DDR Errata A010165 was applied
INFO:    soc_early_init()->i2c_init()
INFO:    init_ddr()
INFO:    platform clock 600000000
INFO:    DDR PLL1 1400000000
INFO:    DDR PLL2 300000000
INFO:    Calling: dram_init()
INFO:    dram_init() - CONFIG_STATIC_DDR is SET
INFO:    Getting STATIC register values for DDR
INFO:    ------------------------------

NOTICE:  FIRST MEMORY IN NOR FLASH...
NOTICE:  40000000:      55AA55AA
NOTICE:  40000004:      0001EE01
NOTICE:  40000008:      0E000E0C
NOTICE:  4000000C:      0000000E
NOTICE:  40000010:      00000000
NOTICE:  40000014:      00000000
NOTICE:  40000018:      88880000
NOTICE:  4000001C:      1200C000
NOTICE:  40000020:      00000040
NOTICE:  40000024:      000000C1
NOTICE:  40000028:      00000000
NOTICE:  4000002C:      00000000
NOTICE:  40000030:      00000000
NOTICE:  40000034:      00880300
NOTICE:  40000038:      00410420
NOTICE:  4000003C:      01310024
NOTICE:  40000040:      96000000
NOTICE:  40000044:      01000000
NOTICE:  40000048:      5C015709
NOTICE:  4000004C:      00001020
NOTICE:        SOFTWARE BUILT WITH STATIC DDR VALUES FOR TARGET:
NOTICE:               ***     DEVELOPMENT BOARD     ***
NOTICE:  --------------------------------------------------------------
INFO:    fixed static size = 0x100000000
INFO:    Time before programming controller 107 ms
INFO:    Program controller registers
INFO:    ------------------------------
INFO:    Preparing to program registers
INFO:    Some registers programmed, preparing for ERRATAs
INFO:    Skipping: ERRATA_DDR_A009663
INFO:    Finishing registers, preparing for more ERRATAs
INFO:    Programming: ERRATA_DDR_A009803
INFO:    Programming: ERRATA_DDR_A008511
INFO:    Programming: ERRATA_DDR_A009942
WARNING: Warning: Optimal CPO value not set.
INFO:    Programming: ERRATA_DDR_A010165
INFO:    Controller released...
INFO:    total size 4 GB
INFO:    Need to wait up to 1520 ms
INFO:    Waiting is over...
INFO:    Programming: ERRATA_DDR_A009803
INFO:    Skipping: ERRATA_DDR_A009663
INFO:    Programming: ERRATA_DDR_A009942
INFO:    Reading debug[9] as 0x1c001b00
INFO:    Reading debug[10] as 0x1d001d00
INFO:    Reading debug[11] as 0x20002000
INFO:    Reading debug[12] as 0x21002100
INFO:    cpo_min 0x1b
INFO:    cpo_max 0x21
INFO:    debug[28] 0x70006f
WARNING: Warning: A009942 requires setting cpo_sample to 0x45
INFO:    Controller Registers read-back
INFO:    ------------------------------
INFO:    *0x1080000 = 0xff
INFO:    *0x1080080 = 0x80040412
INFO:    *0x1080100 = 0x2161100
INFO:    *0x1080104 = 0xd1770004
INFO:    *0x1080108 = 0xf3fc8265
INFO:    *0x108010c = 0x5941a0
INFO:    *0x1080110 = 0xe5000000
INFO:    *0x1080114 = 0x401140
INFO:    *0x1080118 = 0x1030631
INFO:    *0x108011c = 0x100000
INFO:    *0x1080120 = 0x600081f
INFO:    *0x1080124 = 0x1ffe07ff
INFO:    *0x1080128 = 0x4321dcba
INFO:    *0x1080130 = 0x2800000
INFO:    *0x1080160 = 0x220002
INFO:    *0x1080164 = 0x5401400
INFO:    *0x108016c = 0x26600000
INFO:    *0x1080170 = 0x8a090705
INFO:    *0x1080174 = 0xc675f606
INFO:    *0x1080190 = 0x6070809
INFO:    *0x1080194 = 0x90a0a08
INFO:    *0x1080220 = 0x500
INFO:    *0x1080224 = 0x8000000
INFO:    *0x1080250 = 0x5447a00
INFO:    *0x1080270 = 0xffff
INFO:    *0x1080280 = 0xeeeedeee
INFO:    *0x1080284 = 0xeeedeede
INFO:    *0x1080288 = 0x11112111
INFO:    *0x108028c = 0x11121121
INFO:    *0x1080290 = 0x21de0001
INFO:    *0x1080400 = 0x8
INFO:    *0x1080404 = 0x9c00009c
INFO:    *0x1080408 = 0x220c008
INFO:    *0x108040c = 0x200000
INFO:    *0x1080b20 = 0x8080
INFO:    *0x1080b24 = 0x80000000
INFO:    *0x1080b28 = 0x80080000
INFO:    *0x1080b2c = 0x80
INFO:    *0x1080bf8 = 0x20502
INFO:    *0x1080bfc = 0x100
INFO:    *0x1080f04 = 0x2
INFO:    *0x1080f08 = 0xf
INFO:    *0x1080f0c = 0x14000c20
INFO:    *0x1080f24 = 0x1d001d00
INFO:    *0x1080f28 = 0x1c001d00
INFO:    *0x1080f2c = 0x1d001c00
INFO:    *0x1080f30 = 0x1d001d00
INFO:    *0x1080f34 = 0x1d004000
INFO:    *0x1080f48 = 0x1
INFO:    *0x1080f4c = 0x94000000
INFO:    *0x1080f50 = 0xe000d00
INFO:    *0x1080f54 = 0xe000d00
INFO:    *0x1080f58 = 0xd000e00
INFO:    *0x1080f5c = 0xd000d00
INFO:    *0x1080f60 = 0xd000000
INFO:    *0x1080f64 = 0x9000
INFO:    *0x1080f68 = 0x20
INFO:    *0x1080f70 = 0x70006f
INFO:    *0x1080f94 = 0x80000000
INFO:    *0x1080f9c = 0x36003600
INFO:    *0x1080fa0 = 0x35003700
INFO:    *0x1080fa4 = 0x35003400
INFO:    *0x1080fa8 = 0x34003700
INFO:    *0x1080fac = 0x35000000
INFO:    *0x1080fb0 = 0x3
INFO:    *0x1080fb4 = 0x1f1c1b1e
INFO:    *0x1080fb8 = 0x1d1c1e1b
INFO:    *0x1080fbc = 0x1f1c1c1f
INFO:    *0x1080fc0 = 0x1d1d1d1b
INFO:    *0x1080fc4 = 0x1f1d1d1f
INFO:    *0x1080fc8 = 0x1c1d1e1d
INFO:    *0x1080fcc = 0x1f1f1e20
INFO:    *0x1080fd0 = 0x1d1e201d
INFO:    *0x1080fd4 = 0x1f1d191f
INFO:    *0x1080fd8 = 0x1d1e1e1b
INFO:    *0x1080fdc = 0x1f1c1b1e
INFO:    *0x1080fe0 = 0x1c1d1d1b
INFO:    *0x1080fe4 = 0x1f1d1b1d
INFO:    *0x1080fe8 = 0x1d1c1b17
INFO:    *0x1080fec = 0x1f201d1f
INFO:    *0x1080ff0 = 0x1d20201e
INFO:    *0x1080ff4 = 0x1f1e1c1f
INFO:    *0x1080ff8 = 0x1d1f1e1c
INFO:    *0x1080ffc = 0x1f000000
INFO:    ------------------------------

NOTICE:  After programming controller: 4 GB DDR4, 64-bit, CL=15, ECC on

INFO:    Time used by DDR driver 1062 ms
INFO:    SoC workaround for Errata A008850 Post-Phase was applied
INFO:    RCW BOOT SRC is QSPI
NOTICE:  BL2: v2.4(debug):7d8a5dfde1-dirty
NOTICE:  BL2: Built : 06:31:12, Oct 13 2022
INFO:    bl2_arch_setup()
INFO:    bl2_plat_preload_setup()
INFO:    mem_access_setup(): Configuring TrustZone Controller
COMPREHENSIVE DDR MEMORY TESTING
---------------------------------------------------------------------
Starting Address: 82000000
Ending Address  : 82000078
0x82000000 ....................passed
0x82000008 ....................passed
0x82000010 ....................passed
0x82000018 ....................passed
0x82000020 ....................passed
0x82000028 ....................passed
0x82000030 ....................passed
0x82000038 ....................passed
0x82000040 ....................passed
0x82000048 ....................passed
0x82000050 ....................passed
0x82000058 ....................passed
0x82000060 ....................passed
0x82000068 ....................passed
0x82000070 ....................passed
0x82000078 ....................passed
---------------------------------------------------------------------

INFO:    BL2: Doing platform setup
INFO:    BL2: Loading image id 3
INFO:    load_auth_image()
INFO:    load_auth_image_internal()
INFO:    load_image()
INFO:    io_read() - 1. pre assert
INFO:    io_read() - 2. post assert
INFO:    io_read() - 3. handle assignment
INFO:    io_read() - 4. device read
INFO:    io_read() - 5. finished
INFO:    io_read() - 1. pre assert
INFO:    io_read() - 2. post assert
INFO:    io_read() - 3. handle assignment
INFO:    io_read() - 4. device read
INFO:    io_read() - 5. finished
INFO:    io_read() - 1. pre assert
INFO:    io_read() - 2. post assert
INFO:    io_read() - 3. handle assignment
INFO:    io_read() - 4. device read
INFO:    io_read() - 5. finished
INFO:    Made past finding the size of the image...
NOTICE:  IMAGE DATA LOAD
NOTICE:  --------------------------------
NOTICE:   id:           3
NOTICE:   start addr:   0xfbe00000
NOTICE:   size:         0xc63d
NOTICE:   end addr:     0xfbe0c63d
NOTICE:  --------------------------------
INFO:    io_read() - 1. pre assert
INFO:    io_read() - 2. post assert
INFO:    io_read() - 3. handle assignment
INFO:    io_read() - 4. device read
INFO:    io_read() - 1. pre assert
INFO:    io_read() - 2. post assert
INFO:    io_read() - 3. handle assignment
INFO:    io_read() - 4. device read
INFO:    io_read() - 5. finished
INFO:    io_read() - 5. finished
INFO:    Image id=3 loaded: 0xfbe00000 - 0xfbe0c63d
INFO:    Image loaded with return value of : 0
INFO:    BL2: Loading image id 5
INFO:    load_auth_image()
INFO:    load_auth_image_internal()
INFO:    load_image()
INFO:    io_read() - 1. pre assert
INFO:    io_read() - 2. post assert
INFO:    io_read() - 3. handle assignment
INFO:    io_read() - 4. device read
INFO:    io_read() - 5. finished
INFO:    io_read() - 1. pre assert
INFO:    io_read() - 2. post assert
INFO:    io_read() - 3. handle assignment
INFO:    io_read() - 4. device read
INFO:    io_read() - 5. finished
INFO:    io_read() - 1. pre assert
INFO:    io_read() - 2. post assert
INFO:    io_read() - 3. handle assignment
INFO:    io_read() - 4. device read
INFO:    io_read() - 5. finished
INFO:    io_read() - 1. pre assert
INFO:    io_read() - 2. post assert
INFO:    io_read() - 3. handle assignment
INFO:    io_read() - 4. device read
INFO:    io_read() - 5. finished
INFO:    io_read() - 1. pre assert
INFO:    io_read() - 2. post assert
INFO:    io_read() - 3. handle assignment
INFO:    io_read() - 4. device read
INFO:    io_read() - 5. finished
INFO:    Made past finding the size of the image...
NOTICE:  IMAGE DATA LOAD
NOTICE:  --------------------------------
NOTICE:   id:           5
NOTICE:   start addr:   0x82000000
NOTICE:   size:         0xc6ad2
NOTICE:   end addr:     0x820c6ad2
NOTICE:  --------------------------------
INFO:    io_read() - 1. pre assert
INFO:    io_read() - 2. post assert
INFO:    io_read() - 3. handle assignment
INFO:    io_read() - 4. device read
INFO:    io_read() - 1. pre assert
INFO:    io_read() - 2. post assert
INFO:    io_read() - 3. handle assignment
INFO:    io_read() - 4. device read
INFO:    io_read() - 5. finished
INFO:    io_read() - 5. finished
INFO:    Image id=5 loaded: 0x82000000 - 0x820c6ad2
INFO:    Image loaded with return value of : 0
INFO:    BL2: Getting Parameters platform next BL process
INFO:    BL2: Flushing next parameters
INFO:    BL2: returning from bl2_load_images()
NOTICE:  BL2: Booting BL31
INFO:    Entry point address = 0xfbe00000
INFO:    SPSR = 0x3cd
INFO:    Argument #0 = 0x1000c3c8
INFO:    Argument #1 = 0xf1e2d3c4b5a6978
INFO:    Argument #2 = 0x0
INFO:    Argument #3 = 0x1000c3f8
INFO:    Argument #4 = 0x227f3fff
INFO:    Argument #5 = 0x0
INFO:    Argument #6 = 0x0
INFO:    Argument #7 = 0x0
NOTICE:  BL31: v2.4(debug):7d8a5dfde1-dirty
NOTICE:  BL31: Built : 06:31:22, Oct 13 2022
INFO:    BL31: Initialising Platform
INFO:    bl31_platform_setup()
INFO:    ARM GICv2 driver initialized
INFO:    BL31: Initialising Helper Libraries
INFO:    BL31: Initializing runtime services
INFO:    BL31: cortex_a72: CPU workaround for 859971 was applied
WARNING: BL31: cortex_a72: CPU workaround for 1319367 was missing!
INFO:    BL31: cortex_a72: CPU workaround for cve_2017_5715 was applied
INFO:    BL31: cortex_a72: CPU workaround for cve_2018_3639 was applied
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x82000000
INFO:    SPSR = 0x3c9
INFO:    Argument #0 = 0x0
INFO:    Argument #1 = 0x0
INFO:    Argument #2 = 0x0
INFO:    Argument #3 = 0x0
INFO:    Argument #4 = 0x0
INFO:    Argument #5 = 0x0
INFO:    Argument #6 = 0x0
INFO:    Argument #7 = 0x0

 

I don't understand the value of the Arguments.

It also looks like u-boot gets it's information about DDR4 from the TF-A code, so I don't see why this wouldn't work.

Also, since BL2 and BL3 are running (which looks like they're running from DDR4) I don't see why u-boot wouldn't run as well.

Can somebody point me in the right direction?  Has anybody else run into this type of behavior?

Any input is helpful.  Thanks.

0 Kudos
Reply
1 Solution
3,432 Views
Daves_Garage
Contributor IV

Thought I'd drop back here and see if anyone else had a similar problem.  Turns out my custom board was stalling when it hit the following group of erratum fixes in `/arch/arm/cpu/armv8/fsl-layerscape/soc.c`, within u-boot...

There's a string of them here:

Daves_Garage_0-1667509575849.pngDaves_Garage_0-1667509575849.png

 

and another here:

Daves_Garage_1-1667509613810.pngDaves_Garage_1-1667509613810.png

 

and by simply commenting the calls out, and wrapping the function in an `#if 0 ... #endif' conditional, the whole thing compiled, and got me into u-boot... what a journey!   So much time playing around with this.

I admit, the process was convoluted because I didn't have a slick way of debugging via JTAG, so I couldn't single step my way through the code and find the problem... Once I got the JTAG fixed, it took less than an hour to setup CodeWarrior and start single stepping my way into u-boot, which is how I found the problem...

Hopefully someone else can use this as a bit of help.

-Dave

View solution in original post

0 Kudos
Reply
3 Replies
3,433 Views
Daves_Garage
Contributor IV

Thought I'd drop back here and see if anyone else had a similar problem.  Turns out my custom board was stalling when it hit the following group of erratum fixes in `/arch/arm/cpu/armv8/fsl-layerscape/soc.c`, within u-boot...

There's a string of them here:

Daves_Garage_0-1667509575849.pngDaves_Garage_0-1667509575849.png

 

and another here:

Daves_Garage_1-1667509613810.pngDaves_Garage_1-1667509613810.png

 

and by simply commenting the calls out, and wrapping the function in an `#if 0 ... #endif' conditional, the whole thing compiled, and got me into u-boot... what a journey!   So much time playing around with this.

I admit, the process was convoluted because I didn't have a slick way of debugging via JTAG, so I couldn't single step my way through the code and find the problem... Once I got the JTAG fixed, it took less than an hour to setup CodeWarrior and start single stepping my way into u-boot, which is how I found the problem...

Hopefully someone else can use this as a bit of help.

-Dave

0 Kudos
Reply
3,245 Views
hongyuanz
Contributor IV

debugging via JTAG ,  What are the requirements for JTAG..?

 

0 Kudos
Reply
3,225 Views
Daves_Garage
Contributor IV

To debug with JTAG, you need CodeWarrior and a TAP device.  There are a lot of threads here that describe the process, as well as links to application notes that can help.

In the above thread, I was referring to how difficult things were to debug because I couldn't use the JTAG interface to debug.  On the LS1046A, if you don't connect TRST to the processor reset externally, your JTAG will not work.  It took a long time to discover this, so I was trying to debug firmware using printf() statements, and uploading the firmware to the QSPI NOR flash using a dedicated programmer (DediProg).

This was certainly NOT the best way to do things.  Once I connected the TRST to the reset input of the processor, my JTAG interface worked, and I was able to single-step my way through compiled code.

This is when I found the problem.

Hope this helps,

Dave

0 Kudos
Reply