[Yocto LS1028] BL2 for custom board

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

[Yocto LS1028] BL2 for custom board

1,095 Views
imuguruza
Contributor III

Hi there,

 

I am triying to bringup a custom board based on the LS1028ARDB eval board.

In the custom board I own, we have replaced the DDR4 for a DDR3.

I already see that the DDR3 is working using a custom RCW + PBI. So now the next step I want to is to create a custom BL2 for booting up a yocto compilation based on kirkstone version.

For such purpose, I have patched the ddr_init.c file of the atf repo, this "ddr_cfg_regs " construct: https://github.com/nxp-qoriq/atf/blob/lf_v2.6/plat/nxp/soc-ls1028a/ls1028ardb/ddr_init.c#L15

 

Now I am trying to boot that BL2 and I see the next error

 

 

NOTICE:  Fixed DDR on board
ERROR:   Found training error(s): 0x2000
ERROR:   Error: Waiting for D_INIT timeout.
ERROR:   Writing DDR register(s) failed
ERROR:   Programing DDRC error
ERROR:   DDR init failed.
NOTICE:  BL2: v2.6(release):custom
NOTICE:  BL2: Built : 06:37:22, Jun  7 2022
ERROR:   Asserting as the DDR is not initialized yet.ERROR:   SD read error - DMA error = 10000000
ERROR:   Read error = fffffffb
ERROR:   BL2: Failed to load image id 3 (-5)

Error reading from serial device

 

I have added the option BUILD_STRING = "custom" to check that the BL2 I am running is mine.

 

In order to make the DDR work do I need to edit any other function/value in the ddr_init.c or any other file in the ATF source?

@yipingwangmay be you can provide some valuable info...

thanks,

imuguruza

 

#ls1028 #layerscape #yocto #atf #tf-a

0 Kudos
10 Replies

1,033 Views
yipingwang
NXP TechSupport
NXP TechSupport

Did you define CONFIG_STATIC_DDR in the configuration file?

Have you used CodeWarrior to verify your DDR configuration parameters?

You could create a bareboard project, then modify CW initialization file with your custom DDR configuration parameters, then check whether the bareboard can run successfully in DDR memory.

0 Kudos

910 Views
imuguruza
Contributor III

Hi @yipingwang ,

Yes, I have successfuly passed the DDR tests, and I am using the imported values to initialize the DDR using the CONFIG_STATIC_DDR  parameter in atf compilation (added in plaform.mk file.)

 

imuguruza

0 Kudos

871 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please download LSDK 21.08 pre-built image and run it on your custom board.

wget https://www.nxp.com/lgfiles/sdk/lsdk2108/lsdk2108_yocto_tiny_LS_arm64.itb

Under u-boot

=>tftp 0x82000000 lsdk2108_yocto_tiny_LS_arm64.itb

=>bootm 0x82000000#ls1028ardb

0 Kudos

834 Views
imuguruza
Contributor III

Hi @yipingwang 

I have tried doing so, but as eth interface is not working properly, I have stored the file in the part 2 of the SD Card (ext4). Then, I have loaded using extload command but does not boot, the file is being read properly as the size of the binary is the same, comparing to the size printed after doing "wget & ls -la .itb":

imuguruza_5-1686233456218.png

imuguruza_7-1686233551402.png

 

 

Apart from that, I have been reviewing many things:

  • First we had a look in the DDR routing, we are sure that is well done and haven’t seen any remarkable mistake or issue.
  • We have downgraded the DDR speed to 1300MHz and face the same crash.
  • We have tuned the ODT endings, as we have seen that they are not optimal, this has improved the performance of the DDR during big data chunk writes.
  • We have translated this to the ddr_init file of the ATF BL sources.
  • I have downgraded the RAM size in u.boot’s dtsi of the ls1028a, to 1Gb (Not sure If this can be related)

Now, I want to comment some things.

  1. I have noticed that u-boot does not see the complete 1GB of RAM at its startup (same happens with the eval board, it sees 3.9Gb). I was wondering if this is due to BLs being loaded at a reserved space in the RAM.

imuguruza_1-1686233286986.png

 

  1. I have performed a RAM test, in that memory region, using u-boot’s “mtest” command: “mtest 0x80000000 0xbbe00000”. I don’t see any error, if I undergo with the test crashes.

imuguruza_2-1686233301131.png

 

3. I have run my DT and Kernel in the eval board (even though kernel crashes at some point at init) using the evalboard bl2_sd and fip. So this means that in my custom board, at least, I should get the same result.

imuguruza_3-1686233330824.png

imuguruza_4-1686233338148.png

 

Also, I have tried to use:

    1. Bl2_sd of my custom board and fip_uboot of the eval board in my custom board, with little success, does not load u-boot, it hans at BL31
    2. Bl2_sd of eval board and fip_uboot of the cutom board in the eval board, with little success, does not load u-boot, it hangs at BL31

imuguruza_0-1686233228314.png

 

After checking all this my conclusions are that some of this could be wrong:

  1. I am using some environment variable in uboot wrong, and u-boot tries to access/load kernel or dt in a RAM address that it shouldn’t. This is the most likely in my opinion
  2. I need to tune something else in ATF or Uboot to make a proper use of the RAM, taking into account that my RAM size is just 1GB, below the 2GB of RAM that the first RAM Bank has in the SoC

Thanks,

imuguruza

0 Kudos

761 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please execute the following command and let me know the result.

=>ext2load mmc 0:2 0xa0000000 lsdk2108_yocto_tiny_LS_arm64.itb

=>bootm 0x82000000#ls1028ardb

0 Kudos

1,011 Views
imuguruza
Contributor III

Hi,

After playing a bit with the config, I have achieved to boot Uboot.

Now I am facing a problem when I try to boot the Kernel. My card has 1GB of RAM so I have changed the addresses where the Kernel and the device tree are being loaded.

Checking the Reference Manual, the RAM address starts at 0x8000_0000, so it should end at 0xBFFF_FFFF.

imuguruza_0-1685374993138.png

Could be this the source of the error?

 

Thanks,

imuguruza



 

0 Kudos

972 Views
imuguruza
Contributor III

Hi again @yipingwang ,

I havre tried from address 0x8f000000 at the kernel does not boot... But at least now I don't get a crash... I Don't now if this helps at all....

imuguruza_0-1685522807902.png

 

imuguruza

 

Tags (1)
0 Kudos

949 Views
yipingwang
NXP TechSupport
NXP TechSupport

Do you have LS1028ARDB demo board, if yes, please test whether Kernel and dtb images can run on LS1028ARDB.

If you don't have LS1028ARDB, please attach your Kernel and dtb images to me, I will do the verification.

0 Kudos

984 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please download Kernel image to 0x82000000, then boot from 0x82000000.

0 Kudos

977 Views
imuguruza
Contributor III

Hi,

I have tried it, with little success @yipingwang :

imuguruza_1-1685521250999.png

 

 

imuguruza

 

0 Kudos