AnsweredAssumed Answered

Understanding the layerscape 1012a qspi flash layout?

Question asked by Tim Hammer on Jun 13, 2018
Latest reply on Jun 17, 2018 by ufedor

The qoriq_memory_layout.txt file I found in the LSDK flexbuild/docs/ directory shows the 64Mbyte layout “on all QorIQ platforms”. However, the FRDM-LS1012AGSG.pdf document (LS1012A Freedom board Getting Started Guide) shows a much different layout (and also seems to have incorrect start and end addresses?).

 

Working with my LS1012A-Freedom board, I have successfully written

  • a PBL image (RCW & PBI) to offset 0x00000000
  • a U-Boot image to offset 0x00100000
  • a U-Boot Environment image to offset 0x00300000
  • kernel/dtb/initramd ITB image to offset 0x01000000

So I feel confident those are correct. They match the entries in the flexbuild doc (but only the first two match what is in the Getting Started Guide).

 

Based on the Getting Started Guide, I initially wrote my kernel/dtb/initramd ITB file to 0x00500000. After writing my kernel/dtb/initramd ITB to the proper offset, it appeared that the write to 0x00500000 had “broken” the PFE firmware:

PFE Firmware: Bad firmware image (not a FIT image)

 

I was a bit frustrated at that point and chose to just program a complete firmware image from flexbuild into the QSPI flash to recover the board. So I have not confirmed the 0x00400000 offset in the flexbuild doc as being correct for the PPA firmware.

 

In addition to the proper offsets, I would also like to confirm that the PFE Firmware error I saw would be fixed by writing the proper PPA firmware image to the proper address. The Getting Started Guide flash layout says that the PFE binary is in the same 1Mbyte block as the U-Boot boot loader binary. But the flexbuild text file does not call out the PFE binary as a separate entity.

When I build using the Yocto-based distribution (based on YP 2.5), there is a file created in the tmp/deploy/images/{board}/ directory: ppa-{board}-{timestamp}.itb.
Is this the correct file to write to the PPA firmware address in the QSPI flash?

 

I have learned that the RCW/PBI file needs to be byte-swapped before being written into the QSPI flash. Is there a reason why this step has not been included in the Yocto recipe that builds it?
Do any of the other components also need to be byte-swapped? I do not think the U-Boot binary or environment need it, as I have successfully written them. I have also successfully written a kernel image without swapping. However, since I have not been successful with the PPA, I would like to confirm the requirement for it.

 

Finally, is there any way to modify the placement of the U-Boot binary, U-Boot environment, and PPA FIT image in the QSPI? If we will never need the currently allocated amount of space for each item, I could shift everything down and have more memory for a small kernel/dtb/rootfs image, or use a smaller QSPI flash part.
I have looked through the PBL configuration documents I have found, but I do not see anything that indicates it is possible. The PBI data used to create the PBL image does have a file uboot_address.rcw with commands to write some values:


write 0x570604, 0x40100000
write 0x57015c, 0x50100000
write 0x570600, 0x00000000

 

Based on the file name, I thought it might be what I was looking for, but the values do not make sense with either layout I have seen. Nor do the addresses to which the values are witten make much sense- according to the LS1012A reference manual (assuming these addresses are in the SCFG memory map), address 0x604 and 0x600 are in the scratch read/write registers, and 0x15c is the register for the QSPI clock source/enable/disable. Perhaps the PBL code uses these locations differently, but I have not found anything that helps me understand that. And I have found nothing about the PPA firmware location.


I appreciate any and all help with these questions.

Outcomes