All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jagan Teki <jteki@openedev.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] u-boot device model SPI + SPI Flash
Date: Fri, 23 Oct 2015 15:50:47 +0530	[thread overview]
Message-ID: <CAD6G_RSneOKMH4ZkTDu9uqTmiRtGR_Wuo_J4bMJvftP+oRsjMw@mail.gmail.com> (raw)
In-Reply-To: <7a85439a92f64a71a5f2b08b3fdc4576@LysExc01.nanotronic.local>

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.

  reply	other threads:[~2015-10-23 10:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAD6G_RSneOKMH4ZkTDu9uqTmiRtGR_Wuo_J4bMJvftP+oRsjMw@mail.gmail.com \
    --to=jteki@openedev.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.