All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] u-boot device model SPI + SPI Flash
@ 2015-10-21 10:55 Hoefle Marco
  2015-10-21 16:28 ` Jagan Teki
  0 siblings, 1 reply; 21+ messages in thread
From: Hoefle Marco @ 2015-10-21 10:55 UTC (permalink / raw)
  To: u-boot


 Hello,
I saw that here is also a mailing list dedicated to device model issues but it looks obsolete (last post February 2014) so I am using this forum.

I hav?e a?problem?nearly identically to
http://lists.denx.de/pipermail/u-boot/2015-April/210754.html


The SPI?initialization?does not work:??

Invalid bus 0 (err=-19)
*** Warning - spi_flash_probe() failed, using default environment


This is the device tree compiled into u-boot:

U-Boot> fdt addr 0x8FEB8A7C
U-Boot> fdt print
/ {
??????? #address-cells = <0x00000001>;
??????? #size-cells = <0x00000001>;
??????? aliases {
??????????????? serial0 = "serial at 40600000";
??????????????? spi0 = "/axi_quad_spi at 44a00000";
??????? };
??????? memory {
??????????????? device_type = "memory";
??????????????? reg = <0x80000000 0x10000000>;
??????? };
??????? axi_quad_spi at 44a00000 {
??????????????? compatible = "xlnx,xps-spi-2.00.a";
??????????????? reg = <0x44a00000 0x00010000>;
??????????????? spi-max-frequency = <0x423a35c7>;
??????????????? #address-cells = <0x00000001>;
??????????????? #size-cells = <0x00000000>;
??????????????? status = "okay";
??????????????? is-dual = <0x00000000>;
??????????????? num-cs = <0x00000001>;
??????????????? flash at 0 {
??????????????????????? compatible = "n25q128a11";
??????????????????????? reg = <0x00000000>;
??????????????????????? spi-tx-bus-width = <0x00000001>;
??????????????????????? spi-rx-bus-width = <0x00000004>;
??????????????????????? spi-max-frequency = <0x0d3ed78e>;
??????????????????????? #address-cells = <0x00000001>;
??????????????????????? #size-cells = <0x00000001>;
??????????????????????? partition at qspi-fsbl-uboot {
??????????????????????????????? label = "qspi-fsbl-uboot";
??????????????????????????????? reg = <0x00000000 0x00100000>;
??????????????????????? };
??????????????????????? partition at qspi-linux {
??????????????????????????????? label = "qspi-linux";
??????????????????????????????? reg = <0x00100000 0x00500000>;
??????????????????????? };
??????????????????????? partition at qspi-device-tree {
??????????????????????????????? label = "qspi-device-tree";
??????????????????????????????? reg = <0x00600000 0x00020000>;
??????????????????????? };
??????????????????????? partition at qspi-rootfs {
??????????????????????????????? label = "qspi-rootfs";
??????????????????????????????? reg = <0x00620000 0x005e0000>;
??????????????????????? };
??????????????????????? partition at qspi-bitstream {
??????????????????????????????? label = "qspi-bitstream";
??????????????????????????????? reg = <0x00c00000 0x00400000>;
??????????????????????? };
??????????????? };
??????? };
};

Has anybody an idea how to debug this further?
Thanks,
Marco?


      

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-10-21 10:55 [U-Boot] u-boot device model SPI + SPI Flash Hoefle Marco
@ 2015-10-21 16:28 ` Jagan Teki
  2015-10-21 16:40   ` Hoefle Marco
  0 siblings, 1 reply; 21+ messages in thread
From: Jagan Teki @ 2015-10-21 16:28 UTC (permalink / raw)
  To: u-boot

On 21 October 2015 at 16:25, Hoefle Marco <Marco.Hoefle@nanotronic.ch> wrote:
>
>  Hello,
> I saw that here is also a mailing list dedicated to device model issues but it looks obsolete (last post February 2014) so I am using this forum.

Please note its driver model - not a device model.

>
> I have a problem nearly identically to
> http://lists.denx.de/pipermail/u-boot/2015-April/210754.html
>
>
> The SPI initialization does not work:
>
> Invalid bus 0 (err=-19)
> *** Warning - spi_flash_probe() failed, using default environment

Which board it is? dts file name?

>
>
> This is the device tree compiled into u-boot:
>
> U-Boot> fdt addr 0x8FEB8A7C
> U-Boot> fdt print
> / {
>         #address-cells = <0x00000001>;
>         #size-cells = <0x00000001>;
>         aliases {
>                 serial0 = "serial at 40600000";
>                 spi0 = "/axi_quad_spi at 44a00000";
>         };
>         memory {
>                 device_type = "memory";
>                 reg = <0x80000000 0x10000000>;
>         };
>         axi_quad_spi at 44a00000 {
>                 compatible = "xlnx,xps-spi-2.00.a";

Do you need zynq spi or qspi driver there is no compatible string with
"xlnx,xps-spi-2.00.a" do know which source you're using?

>                 reg = <0x44a00000 0x00010000>;
>                 spi-max-frequency = <0x423a35c7>;
>                 #address-cells = <0x00000001>;
>                 #size-cells = <0x00000000>;
>                 status = "okay";
>                 is-dual = <0x00000000>;
>                 num-cs = <0x00000001>;
>                 flash at 0 {
>                         compatible = "n25q128a11";
>                         reg = <0x00000000>;
>                         spi-tx-bus-width = <0x00000001>;
>                         spi-rx-bus-width = <0x00000004>;
>                         spi-max-frequency = <0x0d3ed78e>;
>                         #address-cells = <0x00000001>;
>                         #size-cells = <0x00000001>;
>                         partition at qspi-fsbl-uboot {
>                                 label = "qspi-fsbl-uboot";
>                                 reg = <0x00000000 0x00100000>;
>                         };
>                         partition at qspi-linux {
>                                 label = "qspi-linux";
>                                 reg = <0x00100000 0x00500000>;
>                         };
>                         partition at qspi-device-tree {
>                                 label = "qspi-device-tree";
>                                 reg = <0x00600000 0x00020000>;
>                         };
>                         partition at qspi-rootfs {
>                                 label = "qspi-rootfs";
>                                 reg = <0x00620000 0x005e0000>;
>                         };
>                         partition at qspi-bitstream {
>                                 label = "qspi-bitstream";
>                                 reg = <0x00c00000 0x00400000>;
>                         };
>                 };
>         };
> };
>
> Has anybody an idea how to debug this further?
> Thanks,
> Marco
>
>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

-- 
Jagan | openedev.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-10-21 16:28 ` Jagan Teki
@ 2015-10-21 16:40   ` Hoefle Marco
  2015-10-21 16:45     ` Jagan Teki
  0 siblings, 1 reply; 21+ messages in thread
From: Hoefle Marco @ 2015-10-21 16:40 UTC (permalink / raw)
  To: u-boot

Hello Jagan,
Thank you for your reply.
Please find my comments bellow. I missed to mention that I am using mainline 2015.07


> -----Original Message-----
> From: Jagan Teki [mailto:jteki at openedev.com]
> Sent: Mittwoch, 21. Oktober 2015 18:28
> To: Hoefle Marco <Marco.Hoefle@nanotronic.ch>
> Cc: u-boot at lists.denx.de
> Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
> 
> On 21 October 2015 at 16:25, Hoefle Marco <Marco.Hoefle@nanotronic.ch>
> wrote:
> >
> >  Hello,
> > I saw that here is also a mailing list dedicated to device model issues but it
> looks obsolete (last post February 2014) so I am using this forum.
> 
> Please note its driver model - not a device model.
Ok
> 
> >
> > I have a problem nearly identically to
> > http://lists.denx.de/pipermail/u-boot/2015-April/210754.html
> >
> >
> > The SPI initialization does not work:
> >
> > Invalid bus 0 (err=-19)
> > *** Warning - spi_flash_probe() failed, using default environment
> 
> Which board it is? dts file name?
It is a custom dts file. It is for a Microblaze CPU in an Artix FPGA. The dts reflects that one below
> 
> >
> >
> > This is the device tree compiled into u-boot:
> >
> > U-Boot> fdt addr 0x8FEB8A7C
> > U-Boot> fdt print
> > / {
> >         #address-cells = <0x00000001>;
> >         #size-cells = <0x00000001>;
> >         aliases {
> >                 serial0 = "serial at 40600000";
> >                 spi0 = "/axi_quad_spi at 44a00000";
> >         };
> >         memory {
> >                 device_type = "memory";
> >                 reg = <0x80000000 0x10000000>;
> >         };
> >         axi_quad_spi at 44a00000 {
> >                 compatible = "xlnx,xps-spi-2.00.a";
> 
> Do you need zynq spi or qspi driver there is no compatible string with
> "xlnx,xps-spi-2.00.a" do know which source you're using?
This driver is used:
u-boot/drivers/spi/xilinx_spi.c


> 
> >                 reg = <0x44a00000 0x00010000>;
> >                 spi-max-frequency = <0x423a35c7>;
> >                 #address-cells = <0x00000001>;
> >                 #size-cells = <0x00000000>;
> >                 status = "okay";
> >                 is-dual = <0x00000000>;
> >                 num-cs = <0x00000001>;
> >                 flash at 0 {
> >                         compatible = "n25q128a11";
> >                         reg = <0x00000000>;
> >                         spi-tx-bus-width = <0x00000001>;
> >                         spi-rx-bus-width = <0x00000004>;
> >                         spi-max-frequency = <0x0d3ed78e>;
> >                         #address-cells = <0x00000001>;
> >                         #size-cells = <0x00000001>;
> >                         partition at qspi-fsbl-uboot {
> >                                 label = "qspi-fsbl-uboot";
> >                                 reg = <0x00000000 0x00100000>;
> >                         };
> >                         partition at qspi-linux {
> >                                 label = "qspi-linux";
> >                                 reg = <0x00100000 0x00500000>;
> >                         };
> >                         partition at qspi-device-tree {
> >                                 label = "qspi-device-tree";
> >                                 reg = <0x00600000 0x00020000>;
> >                         };
> >                         partition at qspi-rootfs {
> >                                 label = "qspi-rootfs";
> >                                 reg = <0x00620000 0x005e0000>;
> >                         };
> >                         partition at qspi-bitstream {
> >                                 label = "qspi-bitstream";
> >                                 reg = <0x00c00000 0x00400000>;
> >                         };
> >                 };
> >         };
> > };
> >
> > Has anybody an idea how to debug this further?
> > Thanks,
> > Marco
> >
> >
> >
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot at lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
> 
> --
> Jagan | openedev.
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-10-21 16:40   ` Hoefle Marco
@ 2015-10-21 16:45     ` Jagan Teki
  2015-10-22  6:16       ` Hoefle Marco
  0 siblings, 1 reply; 21+ messages in thread
From: Jagan Teki @ 2015-10-21 16:45 UTC (permalink / raw)
  To: u-boot

On 21 October 2015 at 22:10, Hoefle Marco <Marco.Hoefle@nanotronic.ch> wrote:
> Hello Jagan,
> Thank you for your reply.
> Please find my comments bellow. I missed to mention that I am using mainline 2015.07
>
>
>> -----Original Message-----
>> From: Jagan Teki [mailto:jteki at openedev.com]
>> Sent: Mittwoch, 21. Oktober 2015 18:28
>> To: Hoefle Marco <Marco.Hoefle@nanotronic.ch>
>> Cc: u-boot at lists.denx.de
>> Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
>>
>> On 21 October 2015 at 16:25, Hoefle Marco <Marco.Hoefle@nanotronic.ch>
>> wrote:
>> >
>> >  Hello,
>> > I saw that here is also a mailing list dedicated to device model issues but it
>> looks obsolete (last post February 2014) so I am using this forum.
>>
>> Please note its driver model - not a device model.
> Ok
>>
>> >
>> > I have a problem nearly identically to
>> > http://lists.denx.de/pipermail/u-boot/2015-April/210754.html
>> >
>> >
>> > The SPI initialization does not work:
>> >
>> > Invalid bus 0 (err=-19)
>> > *** Warning - spi_flash_probe() failed, using default environment
>>
>> Which board it is? dts file name?
> It is a custom dts file. It is for a Microblaze CPU in an Artix FPGA. The dts reflects that one below
>>
>> >
>> >
>> > This is the device tree compiled into u-boot:
>> >
>> > U-Boot> fdt addr 0x8FEB8A7C
>> > U-Boot> fdt print
>> > / {
>> >         #address-cells = <0x00000001>;
>> >         #size-cells = <0x00000001>;
>> >         aliases {
>> >                 serial0 = "serial at 40600000";
>> >                 spi0 = "/axi_quad_spi at 44a00000";
>> >         };
>> >         memory {
>> >                 device_type = "memory";
>> >                 reg = <0x80000000 0x10000000>;
>> >         };
>> >         axi_quad_spi at 44a00000 {
>> >                 compatible = "xlnx,xps-spi-2.00.a";
>>
>> Do you need zynq spi or qspi driver there is no compatible string with
>> "xlnx,xps-spi-2.00.a" do know which source you're using?
> This driver is used:
> u-boot/drivers/spi/xilinx_spi.c

In that case, use the compatible in your dts as below

static const struct udevice_id xilinx_spi_ids[] = {
        { .compatible = "xlnx,xilinx-spi" },
        { }
};

Or if you want to change it on driver update your compatible string on
above udevice_id

>
>
>>
>> >                 reg = <0x44a00000 0x00010000>;
>> >                 spi-max-frequency = <0x423a35c7>;
>> >                 #address-cells = <0x00000001>;
>> >                 #size-cells = <0x00000000>;
>> >                 status = "okay";
>> >                 is-dual = <0x00000000>;
>> >                 num-cs = <0x00000001>;
>> >                 flash at 0 {
>> >                         compatible = "n25q128a11";
>> >                         reg = <0x00000000>;
>> >                         spi-tx-bus-width = <0x00000001>;
>> >                         spi-rx-bus-width = <0x00000004>;
>> >                         spi-max-frequency = <0x0d3ed78e>;
>> >                         #address-cells = <0x00000001>;
>> >                         #size-cells = <0x00000001>;
>> >                         partition at qspi-fsbl-uboot {
>> >                                 label = "qspi-fsbl-uboot";
>> >                                 reg = <0x00000000 0x00100000>;
>> >                         };
>> >                         partition at qspi-linux {
>> >                                 label = "qspi-linux";
>> >                                 reg = <0x00100000 0x00500000>;
>> >                         };
>> >                         partition at qspi-device-tree {
>> >                                 label = "qspi-device-tree";
>> >                                 reg = <0x00600000 0x00020000>;
>> >                         };
>> >                         partition at qspi-rootfs {
>> >                                 label = "qspi-rootfs";
>> >                                 reg = <0x00620000 0x005e0000>;
>> >                         };
>> >                         partition at qspi-bitstream {
>> >                                 label = "qspi-bitstream";
>> >                                 reg = <0x00c00000 0x00400000>;
>> >                         };
>> >                 };
>> >         };
>> > };
>> >
>> > Has anybody an idea how to debug this further?

thanks!

-- 
Jagan | openedev.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-10-21 16:45     ` Jagan Teki
@ 2015-10-22  6:16       ` Hoefle Marco
  2015-10-23 10:12         ` Hoefle Marco
  0 siblings, 1 reply; 21+ messages in thread
From: Hoefle Marco @ 2015-10-22  6:16 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: Jagan Teki [mailto:jteki at openedev.com]
> Sent: Mittwoch, 21. Oktober 2015 18:45
> To: Hoefle Marco <Marco.Hoefle@nanotronic.ch>
> Cc: u-boot at lists.denx.de
> Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
> 
> On 21 October 2015 at 22:10, Hoefle Marco <Marco.Hoefle@nanotronic.ch>
> wrote:
> > Hello Jagan,
> > Thank you for your reply.
> > Please find my comments bellow. I missed to mention that I am using
> > mainline 2015.07
> >
> >
> >> -----Original Message-----
> >> From: Jagan Teki [mailto:jteki at openedev.com]
> >> Sent: Mittwoch, 21. Oktober 2015 18:28
> >> To: Hoefle Marco <Marco.Hoefle@nanotronic.ch>
> >> Cc: u-boot at lists.denx.de
> >> Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
> >>
> >> On 21 October 2015 at 16:25, Hoefle Marco
> >> <Marco.Hoefle@nanotronic.ch>
> >> wrote:
> >> >
> >> >  Hello,
> >> > I saw that here is also a mailing list dedicated to device model
> >> > issues but it
> >> looks obsolete (last post February 2014) so I am using this forum.
> >>
> >> Please note its driver model - not a device model.
> > Ok
> >>
> >> >
> >> > I have a problem nearly identically to
> >> > http://lists.denx.de/pipermail/u-boot/2015-April/210754.html
> >> >
> >> >
> >> > The SPI initialization does not work:
> >> >
> >> > Invalid bus 0 (err=-19)
> >> > *** Warning - spi_flash_probe() failed, using default environment
> >>
> >> Which board it is? dts file name?
> > It is a custom dts file. It is for a Microblaze CPU in an Artix FPGA.
> > The dts reflects that one below
> >>
> >> >
> >> >
> >> > This is the device tree compiled into u-boot:
> >> >
> >> > U-Boot> fdt addr 0x8FEB8A7C
> >> > U-Boot> fdt print
> >> > / {
> >> >         #address-cells = <0x00000001>;
> >> >         #size-cells = <0x00000001>;
> >> >         aliases {
> >> >                 serial0 = "serial at 40600000";
> >> >                 spi0 = "/axi_quad_spi at 44a00000";
> >> >         };
> >> >         memory {
> >> >                 device_type = "memory";
> >> >                 reg = <0x80000000 0x10000000>;
> >> >         };
> >> >         axi_quad_spi at 44a00000 {
> >> >                 compatible = "xlnx,xps-spi-2.00.a";
> >>
> >> Do you need zynq spi or qspi driver there is no compatible string
> >> with "xlnx,xps-spi-2.00.a" do know which source you're using?
> > This driver is used:
> > u-boot/drivers/spi/xilinx_spi.c
> 
> In that case, use the compatible in your dts as below
> 
> static const struct udevice_id xilinx_spi_ids[] = {
>         { .compatible = "xlnx,xilinx-spi" },
>         { }
> };
That was a copy paste failure, sorry for that. The reason was that in  the meanwhile I tried the original Xilinx driver from their github tree. They have the tag: compatible = "xlnx,xps-spi-2.00.a"

However, I changed back to have mainline code only an put a few printfs to it:
U-Boot 2015.07--33711bdd4a4dce942fb5ae85a68899a8357bdd94---dirty (Oct 22 2015 - 07:57:35 +0200)

DRAM:  256 MiB
uclass_find_device_by_seq: 0 -1
uclass_find_device_by_seq: 0 0
   - -1 -1
   - not found
env_relocate: 267
spi_flash_probe: 410
busnum: 0, cs: 0, max_hz: 50000000
spi_setup_slave: 336
spi_get_bus_and_cs: 248
uclass_find_device_by_seq: 0 0
   - -1 -1
   - not found
uclass_find_device_by_seq: 1 0
   - -1 -1
   - not found
Invalid bus 0 (err=-19)
*** Warning - spi_flash_probe() failed, using default environment


U-Boot> fdt addr 0x8FEB89FC
U-Boot> fdt print
/ {
        #address-cells = <0x00000001>;
        #size-cells = <0x00000001>;
        aliases {
                serial0 = "/serial at 40600000";
                spi0 = "/axi_quad_spi at 44a00000";
        };
        memory {
                device_type = "memory";
                reg = <0x80000000 0x10000000>;
        };
        serial at 40600000 {
                clock-frequency = <0x05f5e100>;
                compatible = "xlnx,xps-uartlite-1.00.a";
                current-speed = <0x0001c200>;
        };
        axi_quad_spi at 44a00000 {
                compatible = "xlnx,xilinx-spi";
                reg = <0x44a00000 0x00010000>;
                spi-max-frequency = <0x423a35c7>;
                #address-cells = <0x00000001>;
                #size-cells = <0x00000000>;
                status = "okay";
                is-dual = <0x00000000>;
                num-cs = <0x00000001>;
                flash at 0 {
                        compatible = "n25q128a11";
                        reg = <0x00000000>;
                        spi-tx-bus-width = <0x00000001>;
                        spi-rx-bus-width = <0x00000004>;
                        spi-max-frequency = <0x0d3ed78e>;
                        #address-cells = <0x00000001>;
                        #size-cells = <0x00000001>;
                        partition at qspi-fsbl-uboot {
                                label = "qspi-fsbl-uboot";
                                reg = <0x00000000 0x00100000>;
                        };
                        partition at qspi-linux {
                                label = "qspi-linux";
                                reg = <0x00100000 0x00500000>;
                        };
                        partition at qspi-device-tree {
                                label = "qspi-device-tree";
                                reg = <0x00600000 0x00020000>;
                        };
                        partition at qspi-rootfs {
                                label = "qspi-rootfs";
                                reg = <0x00620000 0x005e0000>;
                        };
                        partition at qspi-bitstream {
                                label = "qspi-bitstream";
                                reg = <0x00c00000 0x00400000>;
                        };
                };
        };
};
U-Boot> dm tree
Class       Probed   Name
----------------------------------------
 root        [ + ]    root_driver
 spi         [   ]    `-- axi_quad_spi at 44a00000

Btw, it seems that dm tree has a bug. It crashes on this line:
ret = test_cmd->cmd(test_cmd, flag, argc, argv);

I did a quick hack on this to get the output. I will investigate this further and tell you the result if you wish.



> Or if you want to change it on driver update your compatible string on above
> udevice_id
> 
> >
> >
> >>
> >> >                 reg = <0x44a00000 0x00010000>;
> >> >                 spi-max-frequency = <0x423a35c7>;
> >> >                 #address-cells = <0x00000001>;
> >> >                 #size-cells = <0x00000000>;
> >> >                 status = "okay";
> >> >                 is-dual = <0x00000000>;
> >> >                 num-cs = <0x00000001>;
> >> >                 flash at 0 {
> >> >                         compatible = "n25q128a11";
> >> >                         reg = <0x00000000>;
> >> >                         spi-tx-bus-width = <0x00000001>;
> >> >                         spi-rx-bus-width = <0x00000004>;
> >> >                         spi-max-frequency = <0x0d3ed78e>;
> >> >                         #address-cells = <0x00000001>;
> >> >                         #size-cells = <0x00000001>;
> >> >                         partition at qspi-fsbl-uboot {
> >> >                                 label = "qspi-fsbl-uboot";
> >> >                                 reg = <0x00000000 0x00100000>;
> >> >                         };
> >> >                         partition at qspi-linux {
> >> >                                 label = "qspi-linux";
> >> >                                 reg = <0x00100000 0x00500000>;
> >> >                         };
> >> >                         partition at qspi-device-tree {
> >> >                                 label = "qspi-device-tree";
> >> >                                 reg = <0x00600000 0x00020000>;
> >> >                         };
> >> >                         partition at qspi-rootfs {
> >> >                                 label = "qspi-rootfs";
> >> >                                 reg = <0x00620000 0x005e0000>;
> >> >                         };
> >> >                         partition at qspi-bitstream {
> >> >                                 label = "qspi-bitstream";
> >> >                                 reg = <0x00c00000 0x00400000>;
> >> >                         };
> >> >                 };
> >> >         };
> >> > };
> >> >
> >> > Has anybody an idea how to debug this further?
> 
> thanks!
> 
> --
> Jagan | openedev.
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-10-22  6:16       ` Hoefle Marco
@ 2015-10-23 10:12         ` Hoefle Marco
  2015-10-23 10:20           ` Jagan Teki
  0 siblings, 1 reply; 21+ messages in thread
From: Hoefle Marco @ 2015-10-23 10:12 UTC (permalink / raw)
  To: u-boot

Maybe somebody has a valid u-boot dts file for a microblaze system with an SPI core? That would helpful.
We want to move from a parallel nor flash to a SPI flash for FPGA config, u-boot, Linux Kernel and rootfs.
The last missing part is u-boot. The kernel dts file is ok and the mtd partitions are set up correctly.


 
> > -----Original Message-----
> > From: Jagan Teki [mailto:jteki at openedev.com]
> > Sent: Mittwoch, 21. Oktober 2015 18:45
> > To: Hoefle Marco <Marco.Hoefle@nanotronic.ch>
> > Cc: u-boot at lists.denx.de
> > Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
> >
> > On 21 October 2015 at 22:10, Hoefle Marco <Marco.Hoefle@nanotronic.ch>
> > wrote:
> > > Hello Jagan,
> > > Thank you for your reply.
> > > Please find my comments bellow. I missed to mention that I am using
> > > mainline 2015.07
> > >
> > >
> > >> -----Original Message-----
> > >> From: Jagan Teki [mailto:jteki at openedev.com]
> > >> Sent: Mittwoch, 21. Oktober 2015 18:28
> > >> To: Hoefle Marco <Marco.Hoefle@nanotronic.ch>
> > >> Cc: u-boot at lists.denx.de
> > >> Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
> > >>
> > >> On 21 October 2015 at 16:25, Hoefle Marco
> > >> <Marco.Hoefle@nanotronic.ch>
> > >> wrote:
> > >> >
> > >> >  Hello,
> > >> > I saw that here is also a mailing list dedicated to device model
> > >> > issues but it
> > >> looks obsolete (last post February 2014) so I am using this forum.
> > >>
> > >> Please note its driver model - not a device model.
> > > Ok
> > >>
> > >> >
> > >> > I have a problem nearly identically to
> > >> > http://lists.denx.de/pipermail/u-boot/2015-April/210754.html
> > >> >
> > >> >
> > >> > The SPI initialization does not work:
> > >> >
> > >> > Invalid bus 0 (err=-19)
> > >> > *** Warning - spi_flash_probe() failed, using default environment
> > >>
> > >> Which board it is? dts file name?
> > > It is a custom dts file. It is for a Microblaze CPU in an Artix FPGA.
> > > The dts reflects that one below
> > >>
> > >> >
> > >> >
> > >> > This is the device tree compiled into u-boot:
> > >> >
> > >> > U-Boot> fdt addr 0x8FEB8A7C
> > >> > U-Boot> fdt print
> > >> > / {
> > >> >         #address-cells = <0x00000001>;
> > >> >         #size-cells = <0x00000001>;
> > >> >         aliases {
> > >> >                 serial0 = "serial at 40600000";
> > >> >                 spi0 = "/axi_quad_spi at 44a00000";
> > >> >         };
> > >> >         memory {
> > >> >                 device_type = "memory";
> > >> >                 reg = <0x80000000 0x10000000>;
> > >> >         };
> > >> >         axi_quad_spi at 44a00000 {
> > >> >                 compatible = "xlnx,xps-spi-2.00.a";
> > >>
> > >> Do you need zynq spi or qspi driver there is no compatible string
> > >> with "xlnx,xps-spi-2.00.a" do know which source you're using?
> > > This driver is used:
> > > u-boot/drivers/spi/xilinx_spi.c
> >
> > In that case, use the compatible in your dts as below
> >
> > static const struct udevice_id xilinx_spi_ids[] = {
> >         { .compatible = "xlnx,xilinx-spi" },
> >         { }
> > };
> That was a copy paste failure, sorry for that. The reason was that in  the
> meanwhile I tried the original Xilinx driver from their github tree. They have
> the tag: compatible = "xlnx,xps-spi-2.00.a"
> 
> However, I changed back to have mainline code only an put a few printfs to
> it:
> U-Boot 2015.07--33711bdd4a4dce942fb5ae85a68899a8357bdd94---dirty (Oct
> 22 2015 - 07:57:35 +0200)
> 
> DRAM:  256 MiB
> uclass_find_device_by_seq: 0 -1
> uclass_find_device_by_seq: 0 0
>    - -1 -1
>    - not found
> env_relocate: 267
> spi_flash_probe: 410
> busnum: 0, cs: 0, max_hz: 50000000
> spi_setup_slave: 336
> spi_get_bus_and_cs: 248
> uclass_find_device_by_seq: 0 0
>    - -1 -1
>    - not found
> uclass_find_device_by_seq: 1 0
>    - -1 -1
>    - not found
> Invalid bus 0 (err=-19)
> *** Warning - spi_flash_probe() failed, using default environment
> 
> 
> U-Boot> fdt addr 0x8FEB89FC
> U-Boot> fdt print
> / {
>         #address-cells = <0x00000001>;
>         #size-cells = <0x00000001>;
>         aliases {
>                 serial0 = "/serial at 40600000";
>                 spi0 = "/axi_quad_spi at 44a00000";
>         };
>         memory {
>                 device_type = "memory";
>                 reg = <0x80000000 0x10000000>;
>         };
>         serial at 40600000 {
>                 clock-frequency = <0x05f5e100>;
>                 compatible = "xlnx,xps-uartlite-1.00.a";
>                 current-speed = <0x0001c200>;
>         };
>         axi_quad_spi at 44a00000 {
>                 compatible = "xlnx,xilinx-spi";
>                 reg = <0x44a00000 0x00010000>;
>                 spi-max-frequency = <0x423a35c7>;
>                 #address-cells = <0x00000001>;
>                 #size-cells = <0x00000000>;
>                 status = "okay";
>                 is-dual = <0x00000000>;
>                 num-cs = <0x00000001>;
>                 flash at 0 {
>                         compatible = "n25q128a11";
>                         reg = <0x00000000>;
>                         spi-tx-bus-width = <0x00000001>;
>                         spi-rx-bus-width = <0x00000004>;
>                         spi-max-frequency = <0x0d3ed78e>;
>                         #address-cells = <0x00000001>;
>                         #size-cells = <0x00000001>;
>                         partition at qspi-fsbl-uboot {
>                                 label = "qspi-fsbl-uboot";
>                                 reg = <0x00000000 0x00100000>;
>                         };
>                         partition at qspi-linux {
>                                 label = "qspi-linux";
>                                 reg = <0x00100000 0x00500000>;
>                         };
>                         partition at qspi-device-tree {
>                                 label = "qspi-device-tree";
>                                 reg = <0x00600000 0x00020000>;
>                         };
>                         partition at qspi-rootfs {
>                                 label = "qspi-rootfs";
>                                 reg = <0x00620000 0x005e0000>;
>                         };
>                         partition at qspi-bitstream {
>                                 label = "qspi-bitstream";
>                                 reg = <0x00c00000 0x00400000>;
>                         };
>                 };
>         };
> };
> U-Boot> dm tree
> Class       Probed   Name
> ----------------------------------------
>  root        [ + ]    root_driver
>  spi         [   ]    `-- axi_quad_spi at 44a00000
> 
> Btw, it seems that dm tree has a bug. It crashes on this line:
> ret = test_cmd->cmd(test_cmd, flag, argc, argv);
> 
> I did a quick hack on this to get the output. I will investigate this further and
> tell you the result if you wish.
> 
> 
> 
> > Or if you want to change it on driver update your compatible string on
> > above udevice_id
> >
> > >
> > >
> > >>
> > >> >                 reg = <0x44a00000 0x00010000>;
> > >> >                 spi-max-frequency = <0x423a35c7>;
> > >> >                 #address-cells = <0x00000001>;
> > >> >                 #size-cells = <0x00000000>;
> > >> >                 status = "okay";
> > >> >                 is-dual = <0x00000000>;
> > >> >                 num-cs = <0x00000001>;
> > >> >                 flash at 0 {
> > >> >                         compatible = "n25q128a11";
> > >> >                         reg = <0x00000000>;
> > >> >                         spi-tx-bus-width = <0x00000001>;
> > >> >                         spi-rx-bus-width = <0x00000004>;
> > >> >                         spi-max-frequency = <0x0d3ed78e>;
> > >> >                         #address-cells = <0x00000001>;
> > >> >                         #size-cells = <0x00000001>;
> > >> >                         partition at qspi-fsbl-uboot {
> > >> >                                 label = "qspi-fsbl-uboot";
> > >> >                                 reg = <0x00000000 0x00100000>;
> > >> >                         };
> > >> >                         partition at qspi-linux {
> > >> >                                 label = "qspi-linux";
> > >> >                                 reg = <0x00100000 0x00500000>;
> > >> >                         };
> > >> >                         partition at qspi-device-tree {
> > >> >                                 label = "qspi-device-tree";
> > >> >                                 reg = <0x00600000 0x00020000>;
> > >> >                         };
> > >> >                         partition at qspi-rootfs {
> > >> >                                 label = "qspi-rootfs";
> > >> >                                 reg = <0x00620000 0x005e0000>;
> > >> >                         };
> > >> >                         partition at qspi-bitstream {
> > >> >                                 label = "qspi-bitstream";
> > >> >                                 reg = <0x00c00000 0x00400000>;
> > >> >                         };
> > >> >                 };
> > >> >         };
> > >> > };
> > >> >
> > >> > Has anybody an idea how to debug this further?
> >
> > thanks!
> >
> > --
> > Jagan | openedev.
> >
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-10-23 10:12         ` Hoefle Marco
@ 2015-10-23 10:20           ` Jagan Teki
  2015-10-26 13:51             ` Michal Simek
  0 siblings, 1 reply; 21+ messages in thread
From: Jagan Teki @ 2015-10-23 10:20 UTC (permalink / raw)
  To: u-boot

On 23 October 2015 at 15:42, Hoefle Marco <Marco.Hoefle@nanotronic.ch> wrote:
> Maybe somebody has a valid u-boot dts file for a microblaze system with an SPI core? That would helpful.
> We want to move from a parallel nor flash to a SPI flash for FPGA config, u-boot, Linux Kernel and rootfs.
> The last missing part is u-boot. The kernel dts file is ok and the mtd partitions are set up correctly.

I even grepped on linux/arch/microblaze couldn't get much info, So
added Michal he well aware of this
may be he can help.

>> > -----Original Message-----
>> > From: Jagan Teki [mailto:jteki at openedev.com]
>> > Sent: Mittwoch, 21. Oktober 2015 18:45
>> > To: Hoefle Marco <Marco.Hoefle@nanotronic.ch>
>> > Cc: u-boot at lists.denx.de
>> > Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
>> >
>> > On 21 October 2015 at 22:10, Hoefle Marco <Marco.Hoefle@nanotronic.ch>
>> > wrote:
>> > > Hello Jagan,
>> > > Thank you for your reply.
>> > > Please find my comments bellow. I missed to mention that I am using
>> > > mainline 2015.07
>> > >
>> > >
>> > >> -----Original Message-----
>> > >> From: Jagan Teki [mailto:jteki at openedev.com]
>> > >> Sent: Mittwoch, 21. Oktober 2015 18:28
>> > >> To: Hoefle Marco <Marco.Hoefle@nanotronic.ch>
>> > >> Cc: u-boot at lists.denx.de
>> > >> Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
>> > >>
>> > >> On 21 October 2015 at 16:25, Hoefle Marco
>> > >> <Marco.Hoefle@nanotronic.ch>
>> > >> wrote:
>> > >> >
>> > >> >  Hello,
>> > >> > I saw that here is also a mailing list dedicated to device model
>> > >> > issues but it
>> > >> looks obsolete (last post February 2014) so I am using this forum.
>> > >>
>> > >> Please note its driver model - not a device model.
>> > > Ok
>> > >>
>> > >> >
>> > >> > I have a problem nearly identically to
>> > >> > http://lists.denx.de/pipermail/u-boot/2015-April/210754.html
>> > >> >
>> > >> >
>> > >> > The SPI initialization does not work:
>> > >> >
>> > >> > Invalid bus 0 (err=-19)
>> > >> > *** Warning - spi_flash_probe() failed, using default environment
>> > >>
>> > >> Which board it is? dts file name?
>> > > It is a custom dts file. It is for a Microblaze CPU in an Artix FPGA.
>> > > The dts reflects that one below
>> > >>
>> > >> >
>> > >> >
>> > >> > This is the device tree compiled into u-boot:
>> > >> >
>> > >> > U-Boot> fdt addr 0x8FEB8A7C
>> > >> > U-Boot> fdt print
>> > >> > / {
>> > >> >         #address-cells = <0x00000001>;
>> > >> >         #size-cells = <0x00000001>;
>> > >> >         aliases {
>> > >> >                 serial0 = "serial at 40600000";
>> > >> >                 spi0 = "/axi_quad_spi at 44a00000";
>> > >> >         };
>> > >> >         memory {
>> > >> >                 device_type = "memory";
>> > >> >                 reg = <0x80000000 0x10000000>;
>> > >> >         };
>> > >> >         axi_quad_spi at 44a00000 {
>> > >> >                 compatible = "xlnx,xps-spi-2.00.a";
>> > >>
>> > >> Do you need zynq spi or qspi driver there is no compatible string
>> > >> with "xlnx,xps-spi-2.00.a" do know which source you're using?
>> > > This driver is used:
>> > > u-boot/drivers/spi/xilinx_spi.c
>> >
>> > In that case, use the compatible in your dts as below
>> >
>> > static const struct udevice_id xilinx_spi_ids[] = {
>> >         { .compatible = "xlnx,xilinx-spi" },
>> >         { }
>> > };
>> That was a copy paste failure, sorry for that. The reason was that in  the
>> meanwhile I tried the original Xilinx driver from their github tree. They have
>> the tag: compatible = "xlnx,xps-spi-2.00.a"
>>
>> However, I changed back to have mainline code only an put a few printfs to
>> it:
>> U-Boot 2015.07--33711bdd4a4dce942fb5ae85a68899a8357bdd94---dirty (Oct
>> 22 2015 - 07:57:35 +0200)
>>
>> DRAM:  256 MiB
>> uclass_find_device_by_seq: 0 -1
>> uclass_find_device_by_seq: 0 0
>>    - -1 -1
>>    - not found
>> env_relocate: 267
>> spi_flash_probe: 410
>> busnum: 0, cs: 0, max_hz: 50000000
>> spi_setup_slave: 336
>> spi_get_bus_and_cs: 248
>> uclass_find_device_by_seq: 0 0
>>    - -1 -1
>>    - not found
>> uclass_find_device_by_seq: 1 0
>>    - -1 -1
>>    - not found
>> Invalid bus 0 (err=-19)
>> *** Warning - spi_flash_probe() failed, using default environment
>>
>>
>> U-Boot> fdt addr 0x8FEB89FC
>> U-Boot> fdt print
>> / {
>>         #address-cells = <0x00000001>;
>>         #size-cells = <0x00000001>;
>>         aliases {
>>                 serial0 = "/serial at 40600000";
>>                 spi0 = "/axi_quad_spi at 44a00000";
>>         };
>>         memory {
>>                 device_type = "memory";
>>                 reg = <0x80000000 0x10000000>;
>>         };
>>         serial at 40600000 {
>>                 clock-frequency = <0x05f5e100>;
>>                 compatible = "xlnx,xps-uartlite-1.00.a";
>>                 current-speed = <0x0001c200>;
>>         };
>>         axi_quad_spi at 44a00000 {
>>                 compatible = "xlnx,xilinx-spi";
>>                 reg = <0x44a00000 0x00010000>;
>>                 spi-max-frequency = <0x423a35c7>;
>>                 #address-cells = <0x00000001>;
>>                 #size-cells = <0x00000000>;
>>                 status = "okay";
>>                 is-dual = <0x00000000>;
>>                 num-cs = <0x00000001>;
>>                 flash at 0 {
>>                         compatible = "n25q128a11";
>>                         reg = <0x00000000>;
>>                         spi-tx-bus-width = <0x00000001>;
>>                         spi-rx-bus-width = <0x00000004>;
>>                         spi-max-frequency = <0x0d3ed78e>;
>>                         #address-cells = <0x00000001>;
>>                         #size-cells = <0x00000001>;
>>                         partition at qspi-fsbl-uboot {
>>                                 label = "qspi-fsbl-uboot";
>>                                 reg = <0x00000000 0x00100000>;
>>                         };
>>                         partition at qspi-linux {
>>                                 label = "qspi-linux";
>>                                 reg = <0x00100000 0x00500000>;
>>                         };
>>                         partition at qspi-device-tree {
>>                                 label = "qspi-device-tree";
>>                                 reg = <0x00600000 0x00020000>;
>>                         };
>>                         partition at qspi-rootfs {
>>                                 label = "qspi-rootfs";
>>                                 reg = <0x00620000 0x005e0000>;
>>                         };
>>                         partition at qspi-bitstream {
>>                                 label = "qspi-bitstream";
>>                                 reg = <0x00c00000 0x00400000>;
>>                         };
>>                 };
>>         };
>> };
>> U-Boot> dm tree
>> Class       Probed   Name
>> ----------------------------------------
>>  root        [ + ]    root_driver
>>  spi         [   ]    `-- axi_quad_spi at 44a00000
>>
>> Btw, it seems that dm tree has a bug. It crashes on this line:
>> ret = test_cmd->cmd(test_cmd, flag, argc, argv);
>>
>> I did a quick hack on this to get the output. I will investigate this further and
>> tell you the result if you wish.
>>
>>
>>
>> > Or if you want to change it on driver update your compatible string on
>> > above udevice_id
>> >
>> > >
>> > >
>> > >>
>> > >> >                 reg = <0x44a00000 0x00010000>;
>> > >> >                 spi-max-frequency = <0x423a35c7>;
>> > >> >                 #address-cells = <0x00000001>;
>> > >> >                 #size-cells = <0x00000000>;
>> > >> >                 status = "okay";
>> > >> >                 is-dual = <0x00000000>;
>> > >> >                 num-cs = <0x00000001>;
>> > >> >                 flash at 0 {
>> > >> >                         compatible = "n25q128a11";
>> > >> >                         reg = <0x00000000>;
>> > >> >                         spi-tx-bus-width = <0x00000001>;
>> > >> >                         spi-rx-bus-width = <0x00000004>;
>> > >> >                         spi-max-frequency = <0x0d3ed78e>;
>> > >> >                         #address-cells = <0x00000001>;
>> > >> >                         #size-cells = <0x00000001>;
>> > >> >                         partition at qspi-fsbl-uboot {
>> > >> >                                 label = "qspi-fsbl-uboot";
>> > >> >                                 reg = <0x00000000 0x00100000>;
>> > >> >                         };
>> > >> >                         partition at qspi-linux {
>> > >> >                                 label = "qspi-linux";
>> > >> >                                 reg = <0x00100000 0x00500000>;
>> > >> >                         };
>> > >> >                         partition at qspi-device-tree {
>> > >> >                                 label = "qspi-device-tree";
>> > >> >                                 reg = <0x00600000 0x00020000>;
>> > >> >                         };
>> > >> >                         partition at qspi-rootfs {
>> > >> >                                 label = "qspi-rootfs";
>> > >> >                                 reg = <0x00620000 0x005e0000>;
>> > >> >                         };
>> > >> >                         partition at qspi-bitstream {
>> > >> >                                 label = "qspi-bitstream";
>> > >> >                                 reg = <0x00c00000 0x00400000>;
>> > >> >                         };
>> > >> >                 };
>> > >> >         };
>> > >> > };
>> > >> >
>> > >> > Has anybody an idea how to debug this further?

-- 
Jagan | openedev.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-10-23 10:20           ` Jagan Teki
@ 2015-10-26 13:51             ` Michal Simek
  2015-10-27 11:12               ` Hoefle Marco
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Simek @ 2015-10-26 13:51 UTC (permalink / raw)
  To: u-boot

On 10/23/2015 12:20 PM, Jagan Teki wrote:
> On 23 October 2015 at 15:42, Hoefle Marco <Marco.Hoefle@nanotronic.ch> wrote:
>> Maybe somebody has a valid u-boot dts file for a microblaze system with an SPI core? That would helpful.
>> We want to move from a parallel nor flash to a SPI flash for FPGA config, u-boot, Linux Kernel and rootfs.
>> The last missing part is u-boot. The kernel dts file is ok and the mtd partitions are set up correctly.
> 
> I even grepped on linux/arch/microblaze couldn't get much info, So
> added Michal he well aware of this
> may be he can help.


http://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools/2015-2.html

ac701 bsp and I expect also Kc705.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-10-26 13:51             ` Michal Simek
@ 2015-10-27 11:12               ` Hoefle Marco
  2015-10-27 11:37                 ` Michal Simek
  0 siblings, 1 reply; 21+ messages in thread
From: Hoefle Marco @ 2015-10-27 11:12 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: Michal Simek [mailto:michal.simek at xilinx.com]
> Sent: Montag, 26. Oktober 2015 14:52
> To: Jagan Teki <jteki@openedev.com>; Hoefle Marco
> <Marco.Hoefle@nanotronic.ch>; Michal Simek <michal.simek@xilinx.com>
> Cc: u-boot at lists.denx.de
> Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
> 
> On 10/23/2015 12:20 PM, Jagan Teki wrote:
> > On 23 October 2015 at 15:42, Hoefle Marco <Marco.Hoefle@nanotronic.ch>
> wrote:
> >> Maybe somebody has a valid u-boot dts file for a microblaze system with
> an SPI core? That would helpful.
> >> We want to move from a parallel nor flash to a SPI flash for FPGA config,
> u-boot, Linux Kernel and rootfs.
> >> The last missing part is u-boot. The kernel dts file is ok and the mtd
> partitions are set up correctly.
> >
> > I even grepped on linux/arch/microblaze couldn't get much info, So
> > added Michal he well aware of this may be he can help.
> 
> 
> http://www.xilinx.com/support/download/index.html/content/xilinx/en/do
> wnloadNav/embedded-design-tools/2015-2.html
> 
> ac701 bsp and I expect also Kc705.

I downloaded the AC701 bsp file but it is not a valid archive. Do I need to use  (and learn how to use) the 3 GB pertalinux tools to build u-boot for Microblaze?
The u-boot config for the AC701 and the dts file would probably sufficient.

> Thanks,
> Michal
> 
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-10-27 11:12               ` Hoefle Marco
@ 2015-10-27 11:37                 ` Michal Simek
  2015-10-27 12:52                   ` Hoefle Marco
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Simek @ 2015-10-27 11:37 UTC (permalink / raw)
  To: u-boot

On 10/27/2015 12:12 PM, Hoefle Marco wrote:
> 
> 
>> -----Original Message-----
>> From: Michal Simek [mailto:michal.simek at xilinx.com]
>> Sent: Montag, 26. Oktober 2015 14:52
>> To: Jagan Teki <jteki@openedev.com>; Hoefle Marco
>> <Marco.Hoefle@nanotronic.ch>; Michal Simek <michal.simek@xilinx.com>
>> Cc: u-boot at lists.denx.de
>> Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
>>
>> On 10/23/2015 12:20 PM, Jagan Teki wrote:
>>> On 23 October 2015 at 15:42, Hoefle Marco <Marco.Hoefle@nanotronic.ch>
>> wrote:
>>>> Maybe somebody has a valid u-boot dts file for a microblaze system with
>> an SPI core? That would helpful.
>>>> We want to move from a parallel nor flash to a SPI flash for FPGA config,
>> u-boot, Linux Kernel and rootfs.
>>>> The last missing part is u-boot. The kernel dts file is ok and the mtd
>> partitions are set up correctly.
>>>
>>> I even grepped on linux/arch/microblaze couldn't get much info, So
>>> added Michal he well aware of this may be he can help.
>>
>>
>> http://www.xilinx.com/support/download/index.html/content/xilinx/en/do
>> wnloadNav/embedded-design-tools/2015-2.html
>>
>> ac701 bsp and I expect also Kc705.
> 
> I downloaded the AC701 bsp file but it is not a valid archive. Do I need to use  (and learn how to use) the 3 GB pertalinux tools to build u-boot for Microblaze?
> The u-boot config for the AC701 and the dts file would probably sufficient.

it is tar.gz just rename it.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-10-27 11:37                 ` Michal Simek
@ 2015-10-27 12:52                   ` Hoefle Marco
  2015-10-27 14:50                     ` Michal Simek
  0 siblings, 1 reply; 21+ messages in thread
From: Hoefle Marco @ 2015-10-27 12:52 UTC (permalink / raw)
  To: u-boot

Ok renaming it worked and I could extract the petalinux bsp. Thanks for the hint.
The dts I found is very similar to the one we use successfully in the mainline Linux Kernel. There SPI + SPI Flash are working.

However, I think (please correct me if I am wrong) the petalinux u-boot config does not use driver model + dts.
I think the previous method does not work anymore in mainline u-boot as the spi driver has already been ported.
If I do not use these defines:
# define CONFIG_DM
# define CONFIG_DM_SPI
# define CONFIG_OF_SPI

I'l get a compilation error.
So I think it would be a good change to test the u-boot driver model with the Xilinx SPI driver. I am happy to play the guinea pic ;-)

I think currently it is something with the u-boot dts parsing as none of the functions provided by xilinx_spi.c are called.
I attached the currently used u-boot configuration + u-boot dts.





> -----Original Message-----
> From: Michal Simek [mailto:michal.simek at xilinx.com]
> Sent: Dienstag, 27. Oktober 2015 12:37
> To: Hoefle Marco <Marco.Hoefle@nanotronic.ch>; Michal Simek
> <michal.simek@xilinx.com>; Jagan Teki <jteki@openedev.com>
> Cc: u-boot at lists.denx.de
> Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
> 
> On 10/27/2015 12:12 PM, Hoefle Marco wrote:
> >
> >
> >> -----Original Message-----
> >> From: Michal Simek [mailto:michal.simek at xilinx.com]
> >> Sent: Montag, 26. Oktober 2015 14:52
> >> To: Jagan Teki <jteki@openedev.com>; Hoefle Marco
> >> <Marco.Hoefle@nanotronic.ch>; Michal Simek
> <michal.simek@xilinx.com>
> >> Cc: u-boot at lists.denx.de
> >> Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
> >>
> >> On 10/23/2015 12:20 PM, Jagan Teki wrote:
> >>> On 23 October 2015 at 15:42, Hoefle Marco
> >>> <Marco.Hoefle@nanotronic.ch>
> >> wrote:
> >>>> Maybe somebody has a valid u-boot dts file for a microblaze system
> >>>> with
> >> an SPI core? That would helpful.
> >>>> We want to move from a parallel nor flash to a SPI flash for FPGA
> >>>> config,
> >> u-boot, Linux Kernel and rootfs.
> >>>> The last missing part is u-boot. The kernel dts file is ok and the
> >>>> mtd
> >> partitions are set up correctly.
> >>>
> >>> I even grepped on linux/arch/microblaze couldn't get much info, So
> >>> added Michal he well aware of this may be he can help.
> >>
> >>
> >>
> http://www.xilinx.com/support/download/index.html/content/xilinx/en/d
> >> o wnloadNav/embedded-design-tools/2015-2.html
> >>
> >> ac701 bsp and I expect also Kc705.
> >
> > I downloaded the AC701 bsp file but it is not a valid archive. Do I need to
> use  (and learn how to use) the 3 GB pertalinux tools to build u-boot for
> Microblaze?
> > The u-boot config for the AC701 and the dts file would probably sufficient.
> 
> it is tar.gz just rename it.
> 
> Thanks,
> Michal
 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: microblaze-generic.h
Type: text/x-chdr
Size: 11862 bytes
Desc: microblaze-generic.h
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151027/0ae46e01/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: microblaze-generic_defconfig
Type: application/octet-stream
Size: 218 bytes
Desc: microblaze-generic_defconfig
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151027/0ae46e01/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: microblaze-generic.dts
Type: audio/vnd.dts
Size: 1288 bytes
Desc: microblaze-generic.dts
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151027/0ae46e01/attachment.bin>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-10-27 12:52                   ` Hoefle Marco
@ 2015-10-27 14:50                     ` Michal Simek
  2015-10-27 15:03                       ` Hoefle Marco
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Simek @ 2015-10-27 14:50 UTC (permalink / raw)
  To: u-boot

Hi Marco,

petalinux 2015.4 will be released with SPI DM model. I have just debug
it and it is working fine but it requires some changes in the mainline
to get it work properly. It is not working properly on Microblaze.
I expect there is no problem to use this driver on zynq.

Just give me some time to send all I have in our tree. I will push that
core changes to xilinx git tree soon too.

Thanks,
Michal

On 10/27/2015 01:52 PM, Hoefle Marco wrote:
> Ok renaming it worked and I could extract the petalinux bsp. Thanks for the hint.
> The dts I found is very similar to the one we use successfully in the mainline Linux Kernel. There SPI + SPI Flash are working.
> 
> However, I think (please correct me if I am wrong) the petalinux u-boot config does not use driver model + dts.
> I think the previous method does not work anymore in mainline u-boot as the spi driver has already been ported.
> If I do not use these defines:
> # define CONFIG_DM
> # define CONFIG_DM_SPI
> # define CONFIG_OF_SPI
> 
> I'l get a compilation error.
> So I think it would be a good change to test the u-boot driver model with the Xilinx SPI driver. I am happy to play the guinea pic ;-)
> 
> I think currently it is something with the u-boot dts parsing as none of the functions provided by xilinx_spi.c are called.
> I attached the currently used u-boot configuration + u-boot dts.
> 
> 
> 
> 
> 
>> -----Original Message-----
>> From: Michal Simek [mailto:michal.simek at xilinx.com]
>> Sent: Dienstag, 27. Oktober 2015 12:37
>> To: Hoefle Marco <Marco.Hoefle@nanotronic.ch>; Michal Simek
>> <michal.simek@xilinx.com>; Jagan Teki <jteki@openedev.com>
>> Cc: u-boot at lists.denx.de
>> Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
>>
>> On 10/27/2015 12:12 PM, Hoefle Marco wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Michal Simek [mailto:michal.simek at xilinx.com]
>>>> Sent: Montag, 26. Oktober 2015 14:52
>>>> To: Jagan Teki <jteki@openedev.com>; Hoefle Marco
>>>> <Marco.Hoefle@nanotronic.ch>; Michal Simek
>> <michal.simek@xilinx.com>
>>>> Cc: u-boot at lists.denx.de
>>>> Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
>>>>
>>>> On 10/23/2015 12:20 PM, Jagan Teki wrote:
>>>>> On 23 October 2015 at 15:42, Hoefle Marco
>>>>> <Marco.Hoefle@nanotronic.ch>
>>>> wrote:
>>>>>> Maybe somebody has a valid u-boot dts file for a microblaze system
>>>>>> with
>>>> an SPI core? That would helpful.
>>>>>> We want to move from a parallel nor flash to a SPI flash for FPGA
>>>>>> config,
>>>> u-boot, Linux Kernel and rootfs.
>>>>>> The last missing part is u-boot. The kernel dts file is ok and the
>>>>>> mtd
>>>> partitions are set up correctly.
>>>>>
>>>>> I even grepped on linux/arch/microblaze couldn't get much info, So
>>>>> added Michal he well aware of this may be he can help.
>>>>
>>>>
>>>>
>> http://www.xilinx.com/support/download/index.html/content/xilinx/en/d
>>>> o wnloadNav/embedded-design-tools/2015-2.html
>>>>
>>>> ac701 bsp and I expect also Kc705.
>>>
>>> I downloaded the AC701 bsp file but it is not a valid archive. Do I need to
>> use  (and learn how to use) the 3 GB pertalinux tools to build u-boot for
>> Microblaze?
>>> The u-boot config for the AC701 and the dts file would probably sufficient.
>>
>> it is tar.gz just rename it.
>>
>> Thanks,
>> Michal
>  
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-10-27 14:50                     ` Michal Simek
@ 2015-10-27 15:03                       ` Hoefle Marco
  2015-10-29  8:22                         ` Michal Simek
  0 siblings, 1 reply; 21+ messages in thread
From: Hoefle Marco @ 2015-10-27 15:03 UTC (permalink / raw)
  To: u-boot

Hello Michal,
ok I will then stop trying to get SPI working on mainline and watch your commits on 
https://github.com/Xilinx/u-boot-xlnx

We have a custom Artix Board here and I would be happy to test your commits on our hardware.
Thanks,
Marco



________________________________________
Von: Michal Simek <michal.simek@xilinx.com>
Gesendet: Dienstag, 27. Oktober 2015 15:50
An: Hoefle Marco; Michal Simek; Jagan Teki
Cc: u-boot at lists.denx.de
Betreff: Re: [U-Boot] u-boot device model SPI + SPI Flash

Hi Marco,

petalinux 2015.4 will be released with SPI DM model. I have just debug
it and it is working fine but it requires some changes in the mainline
to get it work properly. It is not working properly on Microblaze.
I expect there is no problem to use this driver on zynq.

Just give me some time to send all I have in our tree. I will push that
core changes to xilinx git tree soon too.

Thanks,
Michal

On 10/27/2015 01:52 PM, Hoefle Marco wrote:
> Ok renaming it worked and I could extract the petalinux bsp. Thanks for the hint.
> The dts I found is very similar to the one we use successfully in the mainline Linux Kernel. There SPI + SPI Flash are working.
>
> However, I think (please correct me if I am wrong) the petalinux u-boot config does not use driver model + dts.
> I think the previous method does not work anymore in mainline u-boot as the spi driver has already been ported.
> If I do not use these defines:
> # define CONFIG_DM
> # define CONFIG_DM_SPI
> # define CONFIG_OF_SPI
>
> I'l get a compilation error.
> So I think it would be a good change to test the u-boot driver model with the Xilinx SPI driver. I am happy to play the guinea pic ;-)
>
> I think currently it is something with the u-boot dts parsing as none of the functions provided by xilinx_spi.c are called.
> I attached the currently used u-boot configuration + u-boot dts.
>
>
>
>
>
>> -----Original Message-----
>> From: Michal Simek [mailto:michal.simek at xilinx.com]
>> Sent: Dienstag, 27. Oktober 2015 12:37
>> To: Hoefle Marco <Marco.Hoefle@nanotronic.ch>; Michal Simek
>> <michal.simek@xilinx.com>; Jagan Teki <jteki@openedev.com>
>> Cc: u-boot at lists.denx.de
>> Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
>>
>> On 10/27/2015 12:12 PM, Hoefle Marco wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Michal Simek [mailto:michal.simek at xilinx.com]
>>>> Sent: Montag, 26. Oktober 2015 14:52
>>>> To: Jagan Teki <jteki@openedev.com>; Hoefle Marco
>>>> <Marco.Hoefle@nanotronic.ch>; Michal Simek
>> <michal.simek@xilinx.com>
>>>> Cc: u-boot at lists.denx.de
>>>> Subject: Re: [U-Boot] u-boot device model SPI + SPI Flash
>>>>
>>>> On 10/23/2015 12:20 PM, Jagan Teki wrote:
>>>>> On 23 October 2015 at 15:42, Hoefle Marco
>>>>> <Marco.Hoefle@nanotronic.ch>
>>>> wrote:
>>>>>> Maybe somebody has a valid u-boot dts file for a microblaze system
>>>>>> with
>>>> an SPI core? That would helpful.
>>>>>> We want to move from a parallel nor flash to a SPI flash for FPGA
>>>>>> config,
>>>> u-boot, Linux Kernel and rootfs.
>>>>>> The last missing part is u-boot. The kernel dts file is ok and the
>>>>>> mtd
>>>> partitions are set up correctly.
>>>>>
>>>>> I even grepped on linux/arch/microblaze couldn't get much info, So
>>>>> added Michal he well aware of this may be he can help.
>>>>
>>>>
>>>>
>> http://www.xilinx.com/support/download/index.html/content/xilinx/en/d
>>>> o wnloadNav/embedded-design-tools/2015-2.html
>>>>
>>>> ac701 bsp and I expect also Kc705.
>>>
>>> I downloaded the AC701 bsp file but it is not a valid archive. Do I need to
>> use  (and learn how to use) the 3 GB pertalinux tools to build u-boot for
>> Microblaze?
>>> The u-boot config for the AC701 and the dts file would probably sufficient.
>>
>> it is tar.gz just rename it.
>>
>> Thanks,
>> Michal
>
>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-10-27 15:03                       ` Hoefle Marco
@ 2015-10-29  8:22                         ` Michal Simek
  2015-11-03  9:08                           ` Hoefle Marco
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Simek @ 2015-10-29  8:22 UTC (permalink / raw)
  To: u-boot

Hi,

On 10/27/2015 04:03 PM, Hoefle Marco wrote:
> Hello Michal,
> ok I will then stop trying to get SPI working on mainline and watch your commits on 
> https://github.com/Xilinx/u-boot-xlnx
> 
> We have a custom Artix Board here and I would be happy to test your commits on our hardware.

I have sent patches to mainline mailing list and also update xilinx tree.

petalinux bsp which uses this configuration should be out at the end of Nov.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-10-29  8:22                         ` Michal Simek
@ 2015-11-03  9:08                           ` Hoefle Marco
  2015-11-04 12:04                             ` Michal Simek
  0 siblings, 1 reply; 21+ messages in thread
From: Hoefle Marco @ 2015-11-03  9:08 UTC (permalink / raw)
  To: u-boot

Hello Michal,
I saw a change on this file drivers/mtd/spi/sf-uclass.c regarding the dm problem.
I replaced this file on mainline u-boot but the result is the same.
Is there anything else to change?
I looked at your here:
https://github.com/Xilinx/u-boot-xlnx/commits/master/drivers/spi

Thanks,
Marco


________________________________________
Von: Michal Simek <michal.simek@xilinx.com>
Gesendet: Donnerstag, 29. Oktober 2015 09:22
An: Hoefle Marco; Michal Simek; Jagan Teki
Cc: u-boot at lists.denx.de; emanuel stiebler
Betreff: Re: AW: [U-Boot] u-boot device model SPI + SPI Flash

Hi,

On 10/27/2015 04:03 PM, Hoefle Marco wrote:
> Hello Michal,
> ok I will then stop trying to get SPI working on mainline and watch your commits on
> https://github.com/Xilinx/u-boot-xlnx
>
> We have a custom Artix Board here and I would be happy to test your commits on our hardware.

I have sent patches to mainline mailing list and also update xilinx tree.

petalinux bsp which uses this configuration should be out at the end of Nov.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-11-03  9:08                           ` Hoefle Marco
@ 2015-11-04 12:04                             ` Michal Simek
  2015-11-05 14:40                               ` Hoefle Marco
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Simek @ 2015-11-04 12:04 UTC (permalink / raw)
  To: u-boot

Hi,

you have to change microblaze configuration to enable DM. If you look at
xilinx git tree then you will have all patches what you need.
Unfortunatelly there is no configuration for SPI DM because petalinux is
not using microblaze-generic configuration.
When I have time I will try to fix this but that's why I don't have now.

Thanks,
Michal

On 11/03/2015 10:08 AM, Hoefle Marco wrote:
> Hello Michal,
> I saw a change on this file drivers/mtd/spi/sf-uclass.c regarding the dm problem.
> I replaced this file on mainline u-boot but the result is the same.
> Is there anything else to change?
> I looked at your here:
> https://github.com/Xilinx/u-boot-xlnx/commits/master/drivers/spi
> 
> Thanks,
> Marco
> 
> 
> ________________________________________
> Von: Michal Simek <michal.simek@xilinx.com>
> Gesendet: Donnerstag, 29. Oktober 2015 09:22
> An: Hoefle Marco; Michal Simek; Jagan Teki
> Cc: u-boot at lists.denx.de; emanuel stiebler
> Betreff: Re: AW: [U-Boot] u-boot device model SPI + SPI Flash
> 
> Hi,
> 
> On 10/27/2015 04:03 PM, Hoefle Marco wrote:
>> Hello Michal,
>> ok I will then stop trying to get SPI working on mainline and watch your commits on
>> https://github.com/Xilinx/u-boot-xlnx
>>
>> We have a custom Artix Board here and I would be happy to test your commits on our hardware.
> 
> I have sent patches to mainline mailing list and also update xilinx tree.
> 
> petalinux bsp which uses this configuration should be out at the end of Nov.
> 
> Thanks,
> Michal
> 
> 
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-11-04 12:04                             ` Michal Simek
@ 2015-11-05 14:40                               ` Hoefle Marco
  2015-11-05 15:18                                 ` Michal Simek
  0 siblings, 1 reply; 21+ messages in thread
From: Hoefle Marco @ 2015-11-05 14:40 UTC (permalink / raw)
  To: u-boot

Hello Michal,
I have already adapted microblaze-generic.h accordingly (I think):
#define CONFIG_DM
#define CONFIG_DM_SPI 1
# define CONFIG_DM_SPI_FLASH 1

Only with these settings u-boot xilinx_spi.c will compile.
Without DM driver wont compile and with DM SPI does not work.
Thanks,
Marco


________________________________________
Von: Michal Simek <michal.simek@xilinx.com>
Gesendet: Mittwoch, 4. November 2015 13:04
An: Hoefle Marco; Michal Simek; Jagan Teki
Cc: u-boot at lists.denx.de; emanuel stiebler
Betreff: Re: AW: AW: [U-Boot] u-boot device model SPI + SPI Flash

Hi,

you have to change microblaze configuration to enable DM. If you look at
xilinx git tree then you will have all patches what you need.
Unfortunatelly there is no configuration for SPI DM because petalinux is
not using microblaze-generic configuration.
When I have time I will try to fix this but that's why I don't have now.

Thanks,
Michal

On 11/03/2015 10:08 AM, Hoefle Marco wrote:
> Hello Michal,
> I saw a change on this file drivers/mtd/spi/sf-uclass.c regarding the dm problem.
> I replaced this file on mainline u-boot but the result is the same.
> Is there anything else to change?
> I looked at your here:
> https://github.com/Xilinx/u-boot-xlnx/commits/master/drivers/spi
>
> Thanks,
> Marco
>
>
> ________________________________________
> Von: Michal Simek <michal.simek@xilinx.com>
> Gesendet: Donnerstag, 29. Oktober 2015 09:22
> An: Hoefle Marco; Michal Simek; Jagan Teki
> Cc: u-boot at lists.denx.de; emanuel stiebler
> Betreff: Re: AW: [U-Boot] u-boot device model SPI + SPI Flash
>
> Hi,
>
> On 10/27/2015 04:03 PM, Hoefle Marco wrote:
>> Hello Michal,
>> ok I will then stop trying to get SPI working on mainline and watch your commits on
>> https://github.com/Xilinx/u-boot-xlnx
>>
>> We have a custom Artix Board here and I would be happy to test your commits on our hardware.
>
> I have sent patches to mainline mailing list and also update xilinx tree.
>
> petalinux bsp which uses this configuration should be out at the end of Nov.
>
> Thanks,
> Michal
>
>
>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-11-05 14:40                               ` Hoefle Marco
@ 2015-11-05 15:18                                 ` Michal Simek
  2015-11-17 10:17                                   ` Hoefle Marco
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Simek @ 2015-11-05 15:18 UTC (permalink / raw)
  To: u-boot

Hi,

On 11/05/2015 03:40 PM, Hoefle Marco wrote:
> Hello Michal,
> I have already adapted microblaze-generic.h accordingly (I think):
> #define CONFIG_DM
> #define CONFIG_DM_SPI 1
> # define CONFIG_DM_SPI_FLASH 1
> 
> Only with these settings u-boot xilinx_spi.c will compile.
> Without DM driver wont compile and with DM SPI does not work.

I have sent some files to Marco which are working for me.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-11-05 15:18                                 ` Michal Simek
@ 2015-11-17 10:17                                   ` Hoefle Marco
  2015-11-17 10:23                                     ` Michal Simek
  0 siblings, 1 reply; 21+ messages in thread
From: Hoefle Marco @ 2015-11-17 10:17 UTC (permalink / raw)
  To: u-boot

Hello Michal, hello Jagan,
for me the Microblaze SPI port in mainline u-boot does not work with DM.
I used Michal's files and modified the addresses and changed Full Ethernet to Ethernet lite and uart to uartlite to match the hardware here. This was not a big step as both Hardware configurations are very similar.
The changes between v2016.01-rc1 and the changed/added files are attached as patch.

Still the same error:
U-Boot 2016.01--95f642905f8dd7c07ac9f5ed49fe14291ab1fb15---00002-g95f6429-dirty (Nov 17 2015 - 10:57:55 +0100)

DRAM:  256 MiB
Invalid bus 0 (err=-19)
*** Warning - spi_flash_probe() failed, using default environment


In Michal's files the dts file is split into several files. Here is the resulting tree directly from the u-boot console:

=> fdt addr 0x8044fda0
=> fdt print
/ {
        #address-cells = <0x00000001>;
        #size-cells = <0x00000001>;
        compatible = "xlnx,microblaze";
        model = "Xilinx-AC701-AXI-full-2015.4";
        cpus {
                #address-cells = <0x00000001>;
                #cpus = <0x00000001>;
                #size-cells = <0x00000000>;
                cpu at 0 {
                        bus-handle = <0x00000001>;
                        clock-frequency = <0x05f5e100>;
                        clocks = <0x00000002>;
                        compatible = "xlnx,microblaze-9.5";
                        d-cache-baseaddr = <0x80000000>;
                        d-cache-highaddr = <0x8fffffff>;
                        d-cache-line-size = <0x00000020>;
                        d-cache-size = <0x00004000>;
                        device_type = "cpu";
                        i-cache-baseaddr = <0x80000000>;
                        i-cache-highaddr = <0x8fffffff>;
                        i-cache-line-size = <0x00000010>;
                        i-cache-size = <0x00004000>;
                        interrupt-handle = <0x00000003>;
                        model = "microblaze,9.5";
                        timebase-frequency = <0x05f5e100>;
                        xlnx,addr-tag-bits = <0x00000010>;
                        xlnx,allow-dcache-wr = <0x00000001>;
                        xlnx,allow-icache-wr = <0x00000001>;
                        xlnx,area-optimized = <0x00000000>;
                        xlnx,async-interrupt = <0x00000001>;
                        xlnx,avoid-primitives = <0x00000000>;
                        xlnx,base-vectors = <0x00000000>;
                        xlnx,branch-target-cache-size = <0x00000000>;
                        xlnx,cache-byte-size = <0x00004000>;
                        xlnx,d-axi = <0x00000001>;
                        xlnx,d-lmb = <0x00000001>;
                        xlnx,d-lmb-mon = <0x00000000>;
                        xlnx,data-size = <0x00000020>;
                        xlnx,dc-axi-mon = <0x00000000>;
                        xlnx,dcache-addr-tag = <0x00000010>;
                        xlnx,dcache-always-used = <0x00000001>;
                        xlnx,dcache-byte-size = <0x00004000>;
                        xlnx,dcache-data-width = <0x00000000>;
                        xlnx,dcache-force-tag-lutram = <0x00000000>;
                        xlnx,dcache-line-len = <0x00000008>;
                        xlnx,dcache-use-writeback = <0x00000000>;
                        xlnx,dcache-victims = <0x00000000>;
                        xlnx,debug-counter-width = <0x00000020>;
                        xlnx,debug-enabled = <0x00000001>;
                        xlnx,debug-event-counters = <0x00000005>;
                        xlnx,debug-external-trace = <0x00000000>;
                        xlnx,debug-latency-counters = <0x00000001>;
                        xlnx,debug-profile-size = <0x00000000>;
                        xlnx,debug-trace-size = <0x00002000>;
                        xlnx,div-zero-exception = <0x00000001>;
                        xlnx,dp-axi-mon = <0x00000000>;
                        xlnx,dynamic-bus-sizing = <0x00000000>;
                        xlnx,ecc-use-ce-exception = <0x00000000>;
                        xlnx,edge-is-positive = <0x00000001>;
                        xlnx,enable-discrete-ports = <0x00000000>;
                        xlnx,endianness = <0x00000001>;
                        xlnx,fault-tolerant = <0x00000000>;
                        xlnx,fpu-exception = <0x00000000>;
                        xlnx,freq = <0x05f5e100>;
                        xlnx,fsl-exception = <0x00000000>;
                        xlnx,fsl-links = <0x00000000>;
                        xlnx,i-axi = <0x00000000>;
                        xlnx,i-lmb = <0x00000001>;
                        xlnx,i-lmb-mon = <0x00000000>;
                        xlnx,ic-axi-mon = <0x00000000>;
                        xlnx,icache-always-used = <0x00000001>;
                        xlnx,icache-data-width = <0x00000000>;
                        xlnx,icache-force-tag-lutram = <0x00000000>;
                        xlnx,icache-line-len = <0x00000004>;
                        xlnx,icache-streams = <0x00000001>;
                        xlnx,icache-victims = <0x00000008>;
                        xlnx,ill-opcode-exception = <0x00000001>;
                        xlnx,imprecise-exceptions = <0x00000000>;
                        xlnx,interconnect = <0x00000002>;
                        xlnx,interrupt-is-edge = <0x00000000>;
                        xlnx,interrupt-mon = <0x00000000>;
                        xlnx,ip-axi-mon = <0x00000000>;
                        xlnx,lockstep-select = <0x00000000>;
                        xlnx,lockstep-slave = <0x00000000>;
                        xlnx,mmu-dtlb-size = <0x00000004>;
                        xlnx,mmu-itlb-size = <0x00000002>;
                        xlnx,mmu-privileged-instr = <0x00000000>;
                        xlnx,mmu-tlb-access = <0x00000003>;
                        xlnx,mmu-zones = <0x00000002>;
                        xlnx,num-sync-ff-clk = <0x00000002>;
                        xlnx,num-sync-ff-clk-debug = <0x00000002>;
                        xlnx,num-sync-ff-clk-irq = <0x00000001>;
                        xlnx,num-sync-ff-dbg-clk = <0x00000001>;
                        xlnx,number-of-pc-brk = <0x00000001>;
                        xlnx,number-of-rd-addr-brk = <0x00000000>;
                        xlnx,number-of-wr-addr-brk = <0x00000000>;
                        xlnx,opcode-0x0-illegal = <0x00000001>;
                        xlnx,optimization = <0x00000000>;
                        xlnx,pc-width = <0x00000020>;
                        xlnx,pvr = <0x00000002>;
                        xlnx,pvr-user1 = <0x00000000>;
                        xlnx,pvr-user2 = <0x00000000>;
                        xlnx,reset-msr = <0x00000000>;
                        xlnx,sco = <0x00000000>;
                        xlnx,trace = <0x00000000>;
                        xlnx,unaligned-exceptions = <0x00000001>;
                        xlnx,use-barrel = <0x00000001>;
                        xlnx,use-branch-target-cache = <0x00000001>;
                        xlnx,use-config-reset = <0x00000000>;
                        xlnx,use-dcache = <0x00000001>;
                        xlnx,use-div = <0x00000001>;
                        xlnx,use-ext-brk = <0x00000000>;
                        xlnx,use-ext-nm-brk = <0x00000000>;
                        xlnx,use-extended-fsl-instr = <0x00000000>;
                        xlnx,use-fpu = <0x00000000>;
                        xlnx,use-hw-mul = <0x00000002>;
                        xlnx,use-icache = <0x00000001>;
                        xlnx,use-interrupt = <0x00000002>;
                        xlnx,use-mmu = <0x00000003>;
                        xlnx,use-msr-instr = <0x00000001>;
                        xlnx,use-pcmp-instr = <0x00000001>;
                        xlnx,use-reorder-instr = <0x00000001>;
                        xlnx,use-stack-protection = <0x00000000>;
                };
        };
        clocks {
                #address-cells = <0x00000001>;
                #size-cells = <0x00000000>;
                clk_cpu at 0 {
                        #clock-cells = <0x00000000>;
                        clock-frequency = <0x05f5e100>;
                        clock-output-names = "clk_cpu";
                        compatible = "fixed-clock";
                        reg = <0x00000000>;
                        linux,phandle = <0x00000002>;
                        phandle = <0x00000002>;
                };
                clk_bus_0 at 1 {
                        #clock-cells = <0x00000000>;
                        clock-frequency = <0x05f5e100>;
                        clock-output-names = "clk_bus_0";
                        compatible = "fixed-clock";
                        reg = <0x00000001>;
                };
        };
        amba_pl {
                #address-cells = <0x00000001>;
                #size-cells = <0x00000001>;
                compatible = "simple-bus";
                ranges;
                linux,phandle = <0x00000001>;
                phandle = <0x00000001>;
                interrupt-controller at 41200000 {
                        #interrupt-cells = <0x00000002>;
                        compatible = "xlnx,xps-intc-1.00.a";
                        interrupt-controller;
                        reg = <0x41200000 0x00010000>;
                        xlnx,kind-of-intr = <0x00000001>;
                        xlnx,num-intr-inputs = <0x00000003>;
                        linux,phandle = <0x00000003>;
                        phandle = <0x00000003>;
                };
                serial at 40600000 {
                        clock-frequency = <0x05f5e100>;
                        compatible = "xlnx,xps-uartlite-1.00.a";
                        current-speed = <0x0001c200>;
                };
                axi_quad_spi at 44a10000 {
                        compatible = "xlnx,xps-spi-2.00.a";
                        interrupt-parent = <0x00000003>;
                        interrupts = <0x00000000 0x00000000>;
                        reg = <0x44a00000 0x00010000>;
                        xlnx,num-ss-bits = <0x00000001>;
                        #address-cells = <0x00000001>;
                        #size-cells = <0x00000000>;
                        flash at 0 {
                                compatible = "micron,n25q256a13";
                                reg = <0x00000000>;
                                #address-cells = <0x00000001>;
                                #size-cells = <0x00000001>;
                                spi-max-frequency = <0x017d7840>;
                                partition at 0x00000000 {
                                        label = "fpga";
                                        reg = <0x00000000 0x00a00000>;
                                };
                                partition at 0x00a00000 {
                                        label = "boot";
                                        reg = <0x00a00000 0x00060000>;
                                };
                                partition at 0x00a60000 {
                                        label = "bootenv";
                                        reg = <0x00a60000 0x00040000>;
                                };
                                partition at 0x00aa0000 {
                                        label = "kernel";
                                        reg = <0x00aa0000 0x00c00000>;
                                };
                                partition at 0x016a0000 {
                                        label = "spare";
                                        reg = <0x016a0000 0x00000000>;
                                };
                        };
                };
        };
        aliases {
                serial0 = "/amba_pl/serial at 40600000";
                spi0 = "/amba_pl/axi_quad_spi at 44a10000";
        };
        chosen {
                bootargs = "console=ttyUL0,115200 earlyprintk";
        };
        memory {
                device_type = "memory";
                reg = <0x80000000 0x10000000>;
        };
};


Any hints how to debug this further?
Marco


________________________________________
Von: Michal Simek <michal.simek@xilinx.com>
Gesendet: Donnerstag, 5. November 2015 16:18
An: Hoefle Marco; Michal Simek; Jagan Teki
Cc: u-boot at lists.denx.de; emanuel stiebler
Betreff: Re: AW: AW: AW: [U-Boot] u-boot device model SPI + SPI Flash

Hi,

On 11/05/2015 03:40 PM, Hoefle Marco wrote:
> Hello Michal,
> I have already adapted microblaze-generic.h accordingly (I think):
> #define CONFIG_DM
> #define CONFIG_DM_SPI 1
> # define CONFIG_DM_SPI_FLASH 1
>
> Only with these settings u-boot xilinx_spi.c will compile.
> Without DM driver wont compile and with DM SPI does not work.

I have sent some files to Marco which are working for me.

Thanks,
Michal



-------------- next part --------------
A non-text attachment was scrubbed...
Name: spi_flash_dbg.patch
Type: text/x-patch
Size: 34807 bytes
Desc: spi_flash_dbg.patch
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151117/18c6e31d/attachment.bin>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-11-17 10:17                                   ` Hoefle Marco
@ 2015-11-17 10:23                                     ` Michal Simek
  2015-11-17 10:30                                       ` Hoefle Marco
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Simek @ 2015-11-17 10:23 UTC (permalink / raw)
  To: u-boot

Hi,

On 17.11.2015 11:17, Hoefle Marco wrote:
> Hello Michal, hello Jagan,
> for me the Microblaze SPI port in mainline u-boot does not work with DM.
> I used Michal's files and modified the addresses and changed Full Ethernet to Ethernet lite and uart to uartlite to match the hardware here. This was not a big step as both Hardware configurations are very similar.
> The changes between v2016.01-rc1 and the changed/added files are attached as patch.
> 
> Still the same error:
> U-Boot 2016.01--95f642905f8dd7c07ac9f5ed49fe14291ab1fb15---00002-g95f6429-dirty (Nov 17 2015 - 10:57:55 +0100)
> 
> DRAM:  256 MiB
> Invalid bus 0 (err=-19)
> *** Warning - spi_flash_probe() failed, using default environment

is this u-boot with my DTB or yours? It is not visible if this is dtb
which you use in your config. Definitely check that dtb you use setup
aliases.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] u-boot device model SPI + SPI Flash
  2015-11-17 10:23                                     ` Michal Simek
@ 2015-11-17 10:30                                       ` Hoefle Marco
  0 siblings, 0 replies; 21+ messages in thread
From: Hoefle Marco @ 2015-11-17 10:30 UTC (permalink / raw)
  To: u-boot

Hello Michal,
Yours is the basis. I need to modify it.
Please see the files in the attachment.
Thanks,
Marco

________________________________________
Von: Michal Simek <michal.simek@xilinx.com>
Gesendet: Dienstag, 17. November 2015 11:23
An: Hoefle Marco; Michal Simek; Jagan Teki
Cc: u-boot at lists.denx.de; emanuel stiebler
Betreff: Re: AW: AW: AW: AW: [U-Boot] u-boot device model SPI + SPI Flash

Hi,

On 17.11.2015 11:17, Hoefle Marco wrote:
> Hello Michal, hello Jagan,
> for me the Microblaze SPI port in mainline u-boot does not work with DM.
> I used Michal's files and modified the addresses and changed Full Ethernet to Ethernet lite and uart to uartlite to match the hardware here. This was not a big step as both Hardware configurations are very similar.
> The changes between v2016.01-rc1 and the changed/added files are attached as patch.
>
> Still the same error:
> U-Boot 2016.01--95f642905f8dd7c07ac9f5ed49fe14291ab1fb15---00002-g95f6429-dirty (Nov 17 2015 - 10:57:55 +0100)
>
> DRAM:  256 MiB
> Invalid bus 0 (err=-19)
> *** Warning - spi_flash_probe() failed, using default environment

is this u-boot with my DTB or yours? It is not visible if this is dtb
which you use in your config. Definitely check that dtb you use setup
aliases.

Thanks,
Michal


-------------- next part --------------
A non-text attachment was scrubbed...
Name: microblaze-generic.dts
Type: audio/vnd.dts
Size: 138 bytes
Desc: microblaze-generic.dts
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151117/a3acdd1e/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pl.dtsi
Type: application/octet-stream
Size: 5345 bytes
Desc: pl.dtsi
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151117/a3acdd1e/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: system-conf.dtsi
Type: application/octet-stream
Size: 1058 bytes
Desc: system-conf.dtsi
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151117/a3acdd1e/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: system-top.dts
Type: audio/vnd.dts
Size: 139 bytes
Desc: system-top.dts
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151117/a3acdd1e/attachment-0003.bin>

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2015-11-17 10:30 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-21 10:55 [U-Boot] u-boot device model SPI + SPI Flash Hoefle Marco
2015-10-21 16:28 ` Jagan Teki
2015-10-21 16:40   ` Hoefle Marco
2015-10-21 16:45     ` Jagan Teki
2015-10-22  6:16       ` Hoefle Marco
2015-10-23 10:12         ` Hoefle Marco
2015-10-23 10:20           ` Jagan Teki
2015-10-26 13:51             ` Michal Simek
2015-10-27 11:12               ` Hoefle Marco
2015-10-27 11:37                 ` Michal Simek
2015-10-27 12:52                   ` Hoefle Marco
2015-10-27 14:50                     ` Michal Simek
2015-10-27 15:03                       ` Hoefle Marco
2015-10-29  8:22                         ` Michal Simek
2015-11-03  9:08                           ` Hoefle Marco
2015-11-04 12:04                             ` Michal Simek
2015-11-05 14:40                               ` Hoefle Marco
2015-11-05 15:18                                 ` Michal Simek
2015-11-17 10:17                                   ` Hoefle Marco
2015-11-17 10:23                                     ` Michal Simek
2015-11-17 10:30                                       ` Hoefle Marco

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.