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>;
};
};