SATA support with IOT Gateway of LS1021A

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

SATA support with IOT Gateway of LS1021A

Jump to solution
2,396 Views
yuqianli
Contributor I

Hi

I am trying test the LS1021a IOT Gateway SATA function, but i found the default uboot and uImage can not recognized that. and the datasheet(LS1021A-IOTGS20.pdf) of IOT Gateway said "SATA not support on current SDK", i am use QorIQ-SDK-V1.7-20141218-yocto_RDS_20150302

i saw a link(SATA on TWR-LS1021A ) mentioned LS1021A IOT TWR have such issue, but there is a service pack to fix it, my question is does the IOT Gateway SDK have such patch or not? how can add the SATA support?

Thanks

Labels (1)
Tags (1)
0 Kudos
1 Solution
1,625 Views
yipingwang
NXP TechSupport
NXP TechSupport

Missing one patch related with SATA, please refer to 0003-ls1021a-ahci-restore-PORT_CMD-value.patch.

You could get the following message when Kernel boot up.

root@ls1021atwr:~# dmesg | grep -i SATA

[  552.609899] ahci 3200000.sata: AHCI 0001.0300 1 slots 1 ports ? Gbps 0x1 impl platform mode

[  552.616921] ahci 3200000.sata: flags: 64bit ncq sntf pm clo only pmp fbs pio slum part ccc

[  552.623972] ahci 3200000.sata: port 0 is not capable of FBS

[  552.631248] ata1: SATA max UDMA/133 mmio [mem 0x03200000-0x0320ffff] port 0x100 irq 133

[  553.202528] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

In addition, for LS1021A CPU Rev 1.0 target, there is hardware erratum on the silicon to support SATA 3.0 devices, there is problem with the performance data, we still suggest customers use SATA 2.0 devices on LS1021A CPU Rev 1.0 target. The SATA problem is resolved in LS1021A Rev 2.0 CPU, you could consider about it if possible.

Thanks,

Yiping

View solution in original post

0 Kudos
5 Replies
1,626 Views
yuqianli
Contributor I

really need a answer, does anyone have solution on that, thank you

0 Kudos
1,626 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Yuqian Li,

Please refer to the following solution.

RCW:

Please refer to Patch 0001-ls1021a-add-SATA-serdes-workaround.patch and 0023-ls1021atwr-fix-RCW-for-SATA.patch.

Please add PBI commands as the following and configure SRDS_PLL_PD_S1 as 0.

write 0xea085c, 0x00502880

write 0xea0560, 0x80800000

If you use the Yocto SDK to generate RCW, refer to the following.

$bitbake rcw -c patch -f

Go to folder build_<platform>_release/tmp/work/<platform>-fsl-linux-gnueabi/rcw/git-r0/git to modify RCW configuration as ls1020qds.

$bitbake rcw

Regenerate RCW.

U-BOOT:

Please refer to patches 0001-ls1021a-ahci-fix-some-settings-to-make-SATA-Gen2-wor.patch and 0019-ls1021a-ahci-Add-SATA-support-for-QDS-TWR-board.patch.

Please modify and rebuild u-boot.

$ bitbake u-boot -c patch -f

Go to the folder build_<platform>_release/tmp/work/<platform>fsl-linux-gnueabi/u-boot-ls1/2014.07-r0/git/ to modify the platform configuration file refer to ls1021aqds, and rebuild u-boot.

$bitbake u-boot -c compile -f

$bitbake u-boot

Kernel:

Please refer to patches 0001-ahci-added-freescale-AHCI-to-platform-compatible-lis.patch and 0002-arm-ls1021a-added-SATA-support.patch.

Please get Kernel source and modify dts file

$bitbake virtual/kernel -c patch -f

Go to  Kernel source in build_<platform>_release/tmp/work/<platform>-fsl-linux-gnueabi/linux-ls1/3.12-r0/git

Apply patch 0001-ahci-added-freescale-AHCI-to-platform-compatible-lis.patch and 0002-arm-ls1021a-added-SATA-support.patch.

Rebuild Kernel

$ cp arch/arm/configs/ls1021a_defconfig .config

$ make ARCH=arm menuconfig

Got the folder build_<platform>_release

$bitbake virtual/kernel -c compile -f

$bitbake virtual/kernel

Please adjust the above procedure according to your real environment.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,626 Views
yuqianli
Contributor I

Hi Yiping,

Now i got the uboot working with sata, but i followed your instruction to patched kernel and enabled

+CONFIG_SATA_AHCI=y

+CONFIG_SATA_AHCI_PLATFORM=y

in kernel, also, i tried to enabled the "Freescale 3.0Gbps SATA support " in kernel configuration, but always got following issue

--------

|   LD      kernel/built-in.o

| drivers/ata/sata_fsl.c: In function 'sata_fsl_probe':

| drivers/ata/sata_fsl.c:1478:2: error: implicit declaration of function 'of_iomap' [-Werror=implicit-function-declaration]

|   hcr_base = of_iomap(ofdev->dev.of_node, 0);

|   ^

| drivers/ata/sata_fsl.c:1478:11: warning: assignment makes pointer from integer without a cast [enabled by default]

|   hcr_base = of_iomap(ofdev->dev.of_node, 0);

|            ^

| drivers/ata/sata_fsl.c:1503:2: error: implicit declaration of function 'irq_of_parse_and_map' [-Werror=implicit-function-declaration]

|   irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);

|   ^

| drivers/ata/sata_fsl.c: In function 'sata_fsl_remove':

| drivers/ata/sata_fsl.c:1590:2: error: implicit declaration of function 'irq_dispose_mapping' [-Werror=implicit-function-declaration]

|   irq_dispose_mapping(host_priv->irq);

|   ^

| cc1: some warnings being treated as errors

| make[2]: *** [drivers/ata/sata_fsl.o] Error 1

| make[1]: *** [drivers/ata] Error 2

| make: *** [drivers] Error 2

| make: *** Waiting for unfinished jobs....

| ERROR: oe_runmake failed

| WARNING: exit code 1 from a shell command.

| ERROR: Function failed: do_compile (log file is located at /home/liyq/QorIQ-SDK-V1.7-20141218-yocto_RDS_20150302/build_ls1021aiot_release/tmp/work/ls1021aiot-fsl-linux-gnueabi/linux-ls1/3.12-r0/temp/log.do_compile.27529)

ERROR: Task 4 (/home/liyq/QorIQ-SDK-V1.7-20141218-yocto_RDS_20150302/meta-fsl-arm/recipes-kernel/linux/linux-ls1_3.12.bb, do_compile) failed with exit code '1'

NOTE: Tasks Summary: Attempted 219 tasks of which 218 didn't need to be rerun and 1 failed.

-------------

when i removed the "Freescale 3.0Gbps SATA support", i can got a kernel success built, when the kernel booting up, i can saw following message

-------

[   21.627318] ata1: SATA link down (SStatus 1 SControl 300)

[   21.632741] ata1: exception Emask 0x10 SAct 0x0 SErr 0x0 action 0xe frozen t4

[   21.639866] ata1: irq_stat 0x00000040, connection status changed

[   21.645872] ata1: hard resetting link

[   22.397305] ata1: SATA link down (SStatus 0 SControl 300)

[   22.402688] ata1: EH complete

-------

kernel can not mount the hard disk as a SCSI disk, what is wrong in there, should i need do more patch in kernel for support SATA of IOT GW?

Thank you.

0 Kudos
1,626 Views
yipingwang
NXP TechSupport
NXP TechSupport

Missing one patch related with SATA, please refer to 0003-ls1021a-ahci-restore-PORT_CMD-value.patch.

You could get the following message when Kernel boot up.

root@ls1021atwr:~# dmesg | grep -i SATA

[  552.609899] ahci 3200000.sata: AHCI 0001.0300 1 slots 1 ports ? Gbps 0x1 impl platform mode

[  552.616921] ahci 3200000.sata: flags: 64bit ncq sntf pm clo only pmp fbs pio slum part ccc

[  552.623972] ahci 3200000.sata: port 0 is not capable of FBS

[  552.631248] ata1: SATA max UDMA/133 mmio [mem 0x03200000-0x0320ffff] port 0x100 irq 133

[  553.202528] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

In addition, for LS1021A CPU Rev 1.0 target, there is hardware erratum on the silicon to support SATA 3.0 devices, there is problem with the performance data, we still suggest customers use SATA 2.0 devices on LS1021A CPU Rev 1.0 target. The SATA problem is resolved in LS1021A Rev 2.0 CPU, you could consider about it if possible.

Thanks,

Yiping

0 Kudos
1,626 Views
yuqianli
Contributor I

Hi Yiping

Thanks for your great reply :smileyhappy:

I followed your manual to patched the rcw, and got compiled rcw binary file named is rcw_1000_sdboot.bin, also, i have compiled uboot as your instruction, but still not get SATA working here is uboot output when it booting up

U-Boot SPL 2014.07+ls1+g659b6a2 (Oct 16 2015 - 16:38:54)

------------

U-Boot 2014.07+ls1+g659b6a2 (Oct 16 2015 - 16:38:54)

CPU:   Freescale LayerScape LS1021E, Version: 1.0, (0x87081110)

Clock Configuration:

       CPU0(ARMV7):1000 MHz,

       Bus:300  MHz, DDR:800  MHz (1600 MT/s data rate),

Reset Configuration Word (RCW):

       00000000: 0608000a 00000000 00000000 00000000

       00000010: 20000000 08407900 60025a00 21046000

       00000020: 00000000 00000000 00000000 00038000

       00000030: 20024800 881b1340 00000000 00000000

Board: LS1021AIOT

CPLD:  V2.3

I2C:   ready

DRAM:  1 GiB

Using SERDES1 Protocol: 32 (0x20)

MMC:   FSL_SDHC: 0

EEPROM: CRC mismatch (270f74f4 != ffffffff)

In:    serial

Out:   serial

Err:   serial

SATA link 0 timeout.

AHCI 0001.0300 1 slots 1 ports ? Gbps 0x1 impl SATA mode

flags: 64bit ncq pm clo only pmp fbss pio slum part ccc

scanning bus for devices...

Found 0 device(s).

Net:   eTSEC1 is in sgmii mode.

eTSEC2 is in sgmii mode.

Phy not found

PHY reset timed out

eTSEC1, eTSEC2 [PRIME], eTSEC3

Hit any key to stop autoboot:  0

Device: FSL_SDHC

Manufacturer ID: 3

OEM: 5344

Name: SU08G

Tran Speed: 50000000

Rd Block Len: 512

SD version 3.0

High Capacity: Yes

Capacity: 7.4 GiB

Bus Width: 4-bit

-------------

for  how to write the uboot to sd card, i have followed this link http://cache.freescale.com/files/soft_dev_tools/doc/support_info/LS1021A-SDK-V1.1-ARM-SOURCE_RMF.txt​ "sudo dd if=u-boot-ls1021aiot.bin of=/dev/sdb bs=512 seek=8 conv=notrunc oflag=dsync", i got a question, how i can write the rcw file to sd card? or, it is already packaged into uboot?

here is my rcw file

$ cat rcw_1000_sdboot.rcw

-------------

/*

* LS1021ATWR RCW for SerDes Protocol 0x20

*

* 3G configuration -- 1 RGMII + 2 SGMII

*

* Frequencies:

*

* Sys Clock: 100 MHz

* DDR_Refclock: 100 MHz

* SDREFCLK_FSEL: 100 MHz

*

* Core -- 1000 MHz (Mul 10 )

* Platform - 300 MHz (Mul 3)

* DDR -- 800 MHz (Mul 8)

* SGMII -- 125MHz

* PCIE -- 100MHz

*

* Serdes Lanes information

* A PCIe*1

* B SGMII1

* C PCIe*1

* D SGMII2

*

* Boot from SD card.

*

*/

#include <../ls1021aqds/ls1021a.rcwi>

#include <serdes_sata.rcw>

SYS_PLL_RAT=3

MEM_PLL_RAT=8

CGA_PLL1_RAT=10

SRDS_PRTCL_S1=32

SRDS_PLL_PD_S1=0

SRDS_DIV_PEX=1

USB3_REFCLK_SEL=2

USB3_CLK_FSEL=57

A7_ACE_CLKDIV=2

A7_DBG_CLKDIV=2

HWA_CGA_M1_CLK_SEL=1

PBI_SRC=6

DP_DIV=1

OCN_DIV=1

IFC_MODE=37

DRAM_LAT=1

SYS_PLL_SPD=1

UART_BASE=7

IFC_GRP_A_EXT=1

IFC_GRP_E1_EXT=1

IFC_GRP_F_EXT=1

IFC_GRP_G_EXT=1

EC1=4

EC2=2

QE-TDMA=6

QE-TDMB=6

SDHC=0

DVDD_VSEL=2

LVDD_VSEL=1

EVDD_VSEL=2

BVDD_VSEL=2

#define PCIE1_ENABLED

#define PCIE2_ENABLED

#include <../ls1021aqds/pcie_link_training.rcw>

#include <../ls1021aqds/uboot_address.rcw>

and serdes_sata.rcw contents

$cat serdes_sata.rcw

/*

* PBI Commands for Serdes lane B SATA settings on LS1021A.

*/

.pbi

write 0xea085c, 0x00502880

write 0xea0560, 0x80800000

.end

-------------------

Thank you

0 Kudos