Unable to enable DSPI0 (SPI1) on LS1021a

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

Unable to enable DSPI0 (SPI1) on LS1021a

2,678 Views
macarrow
Contributor I

I am testing SPI on LS1021a using spidev. I've enabled dspi0 in dts please see below but have no luck. The thing is that if I change configuration to dspi1 (just for a sake of testing) driver is being loaded no problem.

Here is what happens: when I enable dspi0, status is being set to "okay", I can confirm that in dtb with fdtdump. But when this dtb is being loaded by kernel, status magically changes to "disabled" (checked it in EDT through /proc/device-tree).

At the same time dspi1 does not have such problem: if I replicate the conf below but for dspi1, it works as expected, spidev pops up in devs and status of dspi1 is "okay" as expected in EDT.

I am on SDK 1.8 and since there is no earlyprintk support for ls1021a in kernel 3.12 I do not really see what happens during fdt parsing.

So here is my question: how to enable dspi0 on ls1021a?

Here is my test setup: ls1021a-iot board, silicone seems to be ver 2, SDK 1.8, board boots from sdcard.

&dspi0 {

        bus-num = <0>;

        status = "okay";

        spidev0_0: spidev@0 {

                compatible = "rohm,dh2228fv";

                #address-cells = <1>;

                #size-cells = <1>;

                reg = <0>;

                spi-max-frequency = <1000000>;

        };

        spidev0_3: spidev@3 {

                compatible = "rohm,dh2228fv";

                #address-cells = <1>;

                #size-cells = <1>;

                reg = <3>;

                spi-max-frequency = <1000000>;

        };

};

0 Kudos
13 Replies

1,816 Views
dmitriyivanov
Contributor I

We have find problem on u-boot sources:

Watch on \arch\arm\cpu\armv7\ls102xa\fdt.c in u-boot,

function  ft_cpu_setup(void *blob, bd_t *bd), last few lines:

#ifdef CONFIG_QSPI_BOOT
off = fdt_node_offset_by_compat_reg(blob, FSL_IFC_COMPAT,
CONFIG_SYS_IFC_ADDR);
fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);
#else
off = fdt_node_offset_by_compat_reg(blob, FSL_QSPI_COMPAT,
QSPI0_BASE_ADDR);
fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);
/* off = fdt_node_offset_by_compat_reg(blob, FSL_DSPI_COMPAT,
DSPI1_BASE_ADDR);
fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);*/
#endif

Exactly commented lines disabled DSPI0, although they must switch off only DSPI1

0 Kudos

1,816 Views
dmitriyivanov
Contributor I

I have the same problem on LS1021A-TWR, rev.1 silicon, SDK 1.8. Use default rcw & u-boot.

Does anyone have some information about this problem?

0 Kudos

1,816 Views
dmitriyivanov
Contributor I

I know that SDK2.0 don`t support rev.1 silicon, but i try u-boot from SDK2.0 and DSPI0 successfully register master on SPI bus. So, there is some problem in SDK1.8.

If i use u-boot from SDK2.0 and try to load kernel & rootfs & dtb from SDK 1.8, then DSPI0 still OK, but ethernet don`t working.

0 Kudos

1,816 Views
ufedor
NXP Employee
NXP Employee

1) Have you checked that SPI1 siagnals are mutiplexed correctly?

Refer to the QorIQ LS1021A Reference Manual, Table 4-14. RCW field descriptions.

2) Which RCW source is used?

3) Which RCW is used?

0 Kudos

1,816 Views
macarrow
Contributor I

How does RCW affect dtb parsing/driver initialization?

Sorry for being not clear in my original post, the problem is that dspi0 being enabled in dtb, gets disabled somewhere during fdt parsing and kernel does not make an attempt to load the driver.

Here are my steps:

- updated ls1021a-iot.dts to enable dspi0 and add spidev there (please see my previous post)

- compiled ls1021a-iot-dts into dtb

- unpacked resulting dtb using fdtdump and verified that "status" for dspi0 is "okay"

- put dtb onto SD card and boot the system

- in Linux shell did "cat /proc/device-tree/soc/dspi@21000000/status" and got "disabled" as output

Why did dspi0 got disabled during fdt parsing in kernel?

I can not debug that part at the moment because kernel from SDK1.9 does not have earlyprintk support.

Yes, I did check mux and adjusted RCW accordingly (please see below)

Also if it was the case, dspi1 (SPI2) should not be initialized as most of SPI2 signals are not available on ls1021a-iot board and it is not enabled in RCW as far as I understand it and yet it does get initialized (please see my previous post)

RCW:

0608000a 00000000 00000000 00000000

20000000 08407900 60025a00 21046000

00000000 00000000 00000000 20024800

20024800 24bb1340 00000000 00000000

0 Kudos

1,816 Views
ufedor
NXP Employee
NXP Employee

Please answer:

2) Which RCW source is used?

0 Kudos

1,816 Views
macarrow
Contributor I

Sorry for missing that question and sorry for not being clear in my original post.

As I stated in my original post, system boots from SD card which means that RCW source is set to SDHC (SW2.1 is set to off i.e. cfg_rcw_src[0] is "0")

0 Kudos

1,816 Views
ufedor
NXP Employee
NXP Employee

What is the LS1021A silicon revision?

Please provide U-Boot log.

0 Kudos

1,816 Views
macarrow
Contributor I

Here is u-boot log below:

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

U-Boot SPL 2015.01+ls1+g3281947 (Feb 14 2016 - 01:55:05)

U-Boot 2015.01+ls1+g3281947 (Feb 14 2016 - 01:55:05)

CPU:   Freescale LayerScape LS1021E, Version: 2.0, (0x87081120)

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 20024800

       00000030: 20024800 24bb1340 00000000 00000000

Board: LS1021AIOT

CPLD:  V2.5

I2C:   ready

DRAM:  1 GiB

Using SERDES1 Protocol: 32 (0x20)

MMC:   FSL_SDHC: 0

EEPROM: NXID v1

PCIe1: Root Complex no link, regs @ 0x3400000

PCIe2: Root Complex no link, regs @ 0x3500000

In:    serial

Out:   serial

Err:   serial

SEC0: RNG instantiated

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).

SCSI:  Net:   eTSEC1 is in sgmii mode.

eTSEC2 is in sgmii mode.

eTSEC1, eTSEC2, eTSEC3

Hit any key to stop autoboot:  0

0 Kudos

1,816 Views
ufedor
NXP Employee
NXP Employee

Please try SDK 1.9 to eliminate a software bug possibility.

0 Kudos

1,816 Views
macarrow
Contributor I

Any update on this?

I've done some more tests: I've checked dtb using u-boot's fdt parser and everything looks like it supposed to be, "status" for "dspi0" is "okay". The thing is that when later call is being made to "of_device_is_available" it finds that "dspi" has "status" set to "disable" so it looks like either during fdt unflatting phase data gets corrupted.

0 Kudos

1,816 Views
macarrow
Contributor I

Please correct me if I am wrong but as per https://community.freescale.com/thread/383001 SDK 1.9 does not support ls1021a-iot board. How can I try it in this case?

0 Kudos

1,816 Views
ufedor
NXP Employee
NXP Employee
0 Kudos