SATA on LS1021A-TWR in Linux

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SATA on LS1021A-TWR in Linux

ソリューションへジャンプ
1,645件の閲覧回数
borisk2
Contributor I

Hi,

I am using the LS1021A-TWR board, and I am trying to get SATA to work. I am using an existing openembedded setup on a host computer, so I am not sure which version of the SDK was originally downloaded. The layers are (from around october 2020):
poky @ dunfell-23.0.3-58-g2aed817e09
meta-openembedded @ 2a5c534d2b (dunfell)
meta-freescale @ 2.1-2310-gcdb2f3d9 (dunfell)

The switches on the board are on in default place, except that I changed two to make it boot from the SD card instead.

I can detect the SATA disk in U-boot, so the hardware seems to be working.

However, Linux fails with setting up SATA during boot, and this fails even if there is no sata disk attached. Some relevant lines:
[ 1.382553] ahci-qoriq 3200000.sata: 3200000.sata supply ahci not found, using dummy regulator
[ 1.391259] ahci-qoriq 3200000.sata: 3200000.sata supply phy not found, using dummy regulator
[ 1.399797] ahci-qoriq 3200000.sata: 3200000.sata supply target not found, using dummy regulator
[ 1.408711] ahci-qoriq 3200000.sata: AHCI 0001.0300 1 slots 1 ports ? Gbps 0x1 impl platform mode
[ 1.417559] ahci-qoriq 3200000.sata: flags: 64bit ncq sntf pm clo only pmp fbs pio slum part ccc
[ 1.426406] ahci-qoriq 3200000.sata: port 0 is not capable of FBS
[ 1.432587] ahci-qoriq 3200000.sata: Rejecting highmem page from CMA.
[ 1.439027] ahci-qoriq 3200000.sata: failed to start port 0 (errno=-12)
[ 1.445799] ahci-qoriq: probe of 3200000.sata failed with error -12

I am not sure what "supply ahci not found" means, or what the cause of it can be.

So it seems it is a Linux driver problem? In the kernel menuconfig, under "Device Drivers" -> "Serial ATA and Parallel ATA drivers (libata)" there were several SATA drivers selected. I tried to remove all except "Platform AHCI SATA support" and "Freescale QorIQ AHCI SATA support", but I still get the same error as above. If I also include the "Freescale i.MX AHCI SATA support", I get an additional line in the boot log that it loads that driver, but otherwise the same behaviour.

I have seen some other posts on this forum related to SATA on LS1021A-TWR, but they are all for much older versions of the SDK, and in those cases they could not detect the SATA disk in U-boot either, but I  can. In one older post, https://community.nxp.com/t5/Layerscape/SATA-support-with-IOT-Gateway-of-LS1021A/m-p/394403, several patches are mentioned. I looked at them but except for one they all seemed to be fixed or no longer relevant since the code had changed a lot. One patch, 0003-ls1021a-ahci-restore-PORT_CMD-value.patch, does not seem to be implemented in the version of the kernel I am using. However, the code has changed somewhat since that patch was created, so I am not sure if it is still relevant.

I attached a boot log from start until the Linux login prompt shows up.

Anyone knows what the problem might be and how I might solve it?

0 件の賞賛
返信
1 解決策
1,634件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

Please add below context on U-Boot bootargs

cma=64m@0xa0000000

For example

=>setenv bootargs "root=/dev/ram0 rw console=ttyS0,115200 ramdisk_size=10000000 cma=64m@0xa0000000"

元の投稿で解決策を見る

2 返答(返信)
1,623件の閲覧回数
borisk2
Contributor I

Thanks @yipingwang for the suggestion! It solved the problem, so now sata is working. Since I use extlinux I needed to add the cma argument in the extlinux.conf.

0 件の賞賛
返信
1,635件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

Please add below context on U-Boot bootargs

cma=64m@0xa0000000

For example

=>setenv bootargs "root=/dev/ram0 rw console=ttyS0,115200 ramdisk_size=10000000 cma=64m@0xa0000000"