element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Software Application Development Setting up UBI rootfs in QSPI from U-boot
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 3 replies
  • Subscribers 311 subscribers
  • Views 1613 views
  • Users 0 members are here
Related

Setting up UBI rootfs in QSPI from U-boot

Former Member
Former Member over 11 years ago

I'm trying to use u-boot to copy a complete OpenEmbedded linux OS (using the meta-zynq layer from milosoftware) from the SD card to the QSPI flash of the zedboard. I copied the bootloader, the linux kernel and the device tree to the flash so that the Linux kernel successfully boots from QSPI flash. But now I fail to correctly setup the UBI rootfs in flash from u-boot.

As far as I understand (following http://lists.denx.de/pipermail/u-boot/2011-April/089620.html), I first have to set up some mtd partitions using the "mtdparts" command and then use the "ubi" command to install the ubifs.
First I have to set the mtdids environment variable of u-boot, but I have no clue what I have to use as mtd-id. Whatever I tried, when calling mtdparts at the u-boot prompt, I receive the error message "Device nor0 not found". As an example I tried: setenv mtdids nor0=spi32766.0.

From the u-boot command line I can successfully access the flash using "sf probe 0 0 0" and "sf write ...", but mtdparts complains as described above.

How do I correctly set the mtdids?
Does I have to enabled more u-boot features? I already enable support for MTD and UBI.
Thanks!

In the u-boot-xlnx config I added:

#define CONFIG_CMD_UBI
#define CONFIG_CMD_UBIFS
#define CONFIG_RBTREE
#define CONFIG_MTD_DEVICE
#define CONFIG_MTD_PARTITIONS
#define CONFIG_CMD_MTDPARTS
#define CONFIG_LZO

When booting the kernel from SD I see the following printout:

xqspips e000d000.qspi: master is unqueued, this is deprecated
xqspips e000d000.qspi: at 0xE000D000 mapped to 0xE0810000, irq=51
...
m25p80 spi32766.0: s25fl256s1 (32768 Kbytes)
5 ofpart partitions found on MTD device spi32766.0
Creating 5 MTD partitions on "spi32766.0":
0x000000000000-0x000000060000 : "qspi-bootloader"
0x000000060000-0x000000070000 : "qspi-u-boot-env"
0x000000070000-0x000000080000 : "qspi-device-tree"
0x000000080000-0x000000480000 : "qspi-linux"
0x000000880000-0x000002000000 : "qspi-rootfs"

My devicetree looks sth like

                qspi0: qspi@e000d000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        bus-num = <0>;
                        compatible = "xlnx,ps7-qspi-1.00.a";
                        interrupt-parent = <&gic>;
                        interrupts = <0 19 4>;
                        clock-names = "ref_clk", "aper_clk";
                        clocks = <&clkc 10>, <&clkc 43>;
                        is-dual = <0>;
                        num-chip-select = <1>;
                        reg = <0xe000d000 0x1000>;
                        xlnx,fb-clk = <0x1>;
                        xlnx,qspi-clk-freq-hz = <0xbebc200>;
                        xlnx,qspi-mode = <0x0>;
                        primary_flash: ps7-qspi@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
                                compatible = "s25fl256s1";
                                reg = <0x0>;
                                spi-max-frequency = <50000000>;
                                partition@qspi-bootloader {
                                        label = "qspi-bootloader";
                                        reg = <0x0 0x60000>;
                                };
                                partition@qspi-u-boot-env {
                                        label = "qspi-u-boot-env";
                                        reg = <0x60000 0x10000>;
                                };
                                partition@qspi-device-tree {
                                        label = "qspi-device-tree";
                                        reg = <0x70000 0x10000>;
                                };
                                partition@qspi-linux {
                                        label = "qspi-linux";
                                        reg = <0x80000 0x400000>;
                                };
                                partition@qspi-rootfs {
                                        label = "qspi-rootfs";
                                        reg = <0x880000 0x1780000>;
                                };
                        };

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 11 years ago

    You have to flash the rootfs ubi image with "ubiformat -f <imagename.ubi> /dev/mtdX".

    The bootloader and kernel in that layer are ready to go and boot from that - there's nothing you need to to manually.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago

    You don't need UBI support in the bootloader - unless you want to put the kernel image INSIDE the rootfs partition.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago

    I understand that I could flash the rootfs using ubiformat when I have a running linux. But I would like to also have the possibility to flash the rootfs with u-boot in case I don't have a running linux yet. The idea is that a customer can update or repair the linux in the flash with a newer version from SD card. As far as I see, u-boot has the capability to do that, but I don't know how to correctly configure the mtdids.

    It seems that u-boot 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube