Configure SDHC2 to be SPI on ls1012a

cancel
Showing results for 
Search instead for 
Did you mean: 

Configure SDHC2 to be SPI on ls1012a

278 Views
kai_wu
Contributor III

Hi,

I am tryin to configure SDHC2 port to be a SPI port on ls1012a(The SDHC2 is a multifunction port).  SPI is used to control a KSZ9897 ethernet switch.

I copyed the PBL data from reference board(ls1012ardb).

I made changes on RCW SDHC2_BASE_BASE[374-375] and SDHC2_BASE_BASE[376-377] in code warrior, see below.

pastedImage_3.png

And I copied the PBI commands from ls1012ardb reference board, see below:

pastedImage_7.png

After that I generate the PBL data file which is 160 bytes. After that I did byte swap on this file and then put it into my FLASH( QSPI flash, the binary is put at the address from 0x40000000 to 0x40000009f), I didn't change other parts of the flash, only the first 160 bytes are replaced by the new generated PBL file. After that I cannot boot my board any more. Once I restore the first 160 bytes using the PBL binary from reference board, it boots up again.    

I got SPI related information from ls1012a reference manual, see below.

pastedImage_12.png

I am wondering if my changes on the PBL data is correct? 

Or do I need to change the PBI commands as well? if true, what PBI commands I need to change?

There are many details which make me feel confused. Any help would be great.

Thx.

0 Kudos
3 Replies

148 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Kai Wu,

Please refer to the attached PBI commands which I generated by importing rcw_1000_default.bin(provided in LSDK 1906) into CodeWarrior.

Please check whether the attached PBL image can work on your target board, which I modified in LSDK according to your description.

Thanks,

Yiping

0 Kudos

148 Views
kai_wu
Contributor III

Hi Yiping,

Thanks for your help. I had some issues with my hardware last week.

I tried the rcw_1000_default.bin today and also the rcw_1000_default.bin.swapped. 

They are not working, the board is dead after using these rcw binary. 

But inspired by your reply.  

I changed the rcw source to be QSPI, then I used the binary file binary PBL_swapped_CRC_not_swapped generated by CodeWarrior. The board is turned on successfully( my RCW binary is taken from ls1012a-rdb board, I imported it to CW and made changes on it).

There is a LED on MISO port of SPI, When I tried to read some register value from the KSZ9897 switch, the led is turned on(it was never turned on before). This is the PBI data in my board.

pastedImage_7.png

Now I am going to try to debug the spi connection(driver in linux5.1) between ls1012a and KSZ9897 in uboto or in kernel with device tree.

0 Kudos

148 Views
kai_wu
Contributor III

Thx for your efficient reply. I will try them and let you know the reulst asap.    

0 Kudos