Enabling Mikrobus spi in u-boot (ls1046a-frwy)

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

Enabling Mikrobus spi in u-boot (ls1046a-frwy)

Jump to solution
1,349 Views
james_browning
Contributor II

Hello,

I am trying to add support for a Mikrobus flash click in u-boot. I understand that to use the mikrobus spi bus we have to use the spi controller (not the qspi controller) and cs 0. I have ensured that both RCW[SPI_BASE] and RCW[SPI_EXT] are set to 0.  

I understand that the spi control register is at 0x2100000, but the ls1046a device trees that u-boot contains all label this as a dspi controller:

 

 

dspi0: dspi@2100000 {
compatible = "fsl,vf610-dspi";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x0 0x2100000 0x0 0x10000>;
interrupts = <0 64 0x4>;
clock-names = "dspi";
clocks = <&clockgen 4 0>;
num-cs = <6>;
big-endian;
status = "disabled";
};

 

 

 

But, none of the ls1046a-frwy documentation mentions any support for dspi, so I'm not sure if this is correct. I tried enabling this anyways, and I added the node for my flash click: 

 

 

/ {
model = "LS1046A FRWY Board";

aliases {
spi0 = &qspi;
spi1 = &dspi0;
};

};


&dspi0 {

bus-num = <1>;
status = "okay";

flash0: is25lp128@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-flash";
spi-max-frequency = <133000000>;
reg = <0>;
};
};

 

 

 

This allowed me to probe the device in u-boot with "sf probe 1:0", but, the wrong device id is returned resulting in error=-2. So I'm not sure why the id is being returned incorrectly, do I need to change the dspi controller node to a spi controller? If so, how is this done?

 

Thank you for your help.

0 Kudos
1 Solution
1,295 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the following dts definition in arch/arm/dts/fsl-ls1046a-qds.dtsi, please specify compatible = "jedec,spi-nor" in your dts file.

&dspi0 {
bus-num = <0>;
status = "okay";

dflash0: n25q128a {
#address-cells = <1>;
#size-cells = <1>;
compatible = "jedec,spi-nor";
spi-max-frequency = <1000000>; /* input clock */
spi-cpol;
spi-cpha;
reg = <0>;
};

dflash1: sst25wf040b {
#address-cells = <1>;
#size-cells = <1>;
compatible = "jedec,spi-nor";
spi-max-frequency = <3500000>;
spi-cpol;
spi-cpha;
reg = <1>;
};

...

View solution in original post

3 Replies
1,296 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the following dts definition in arch/arm/dts/fsl-ls1046a-qds.dtsi, please specify compatible = "jedec,spi-nor" in your dts file.

&dspi0 {
bus-num = <0>;
status = "okay";

dflash0: n25q128a {
#address-cells = <1>;
#size-cells = <1>;
compatible = "jedec,spi-nor";
spi-max-frequency = <1000000>; /* input clock */
spi-cpol;
spi-cpha;
reg = <0>;
};

dflash1: sst25wf040b {
#address-cells = <1>;
#size-cells = <1>;
compatible = "jedec,spi-nor";
spi-max-frequency = <3500000>;
spi-cpol;
spi-cpha;
reg = <1>;
};

...

1,280 Views
james_browning
Contributor II

Disregard my previous message, I got it to work! I had to set the "bus-num" property of the dspi controller to <0> instead of <1>.

0 Kudos
1,283 Views
james_browning
Contributor II

 Hi yipingwang,

Thank you for your response. I attempted this but I am getting the same error. The probe returns id: " ce, 30, 0c", whereas the expected id for is25lp128 should be "9d6018". I tried this both with cpha/cpol enabled and disabled but neither worked. This is what I have in my dts file now:

 

 

&dspi0 {

        bus-num = <1>;
        status = "okay";

        flash0: is25lp128@0 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "jedec,spi-nor";
                spi-max-frequency = <1000000>;
                reg = <0>;
        };
};

 

 

Thank you again

0 Kudos