移植Linux到ZYNQ

@

博客说明

| 撰写日期 | 2019.09.06
---|:--😐---
| 完稿日期 | 2019.09.06
| 最近维护 | 暂无
| 本文作者 | multimicro
| 联系方式 | multimicro@qq.com
| 资料链接 | 本文无附件资料
| GitHub| https://github.com/wifialan/
| 原文链接| https://blog.csdn.net/multimicro/article/details/100585223

开发环境

环境说明 详细信息 备注信息
操作系统 Windows_x64、Manjaro18.04 KDE、Debian
Vivado版本 2018.3 官网地址
开发板型号 ZYNQ7010(米联客 MiZ701N 黑色版本)
编译器版本 gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf 官网地址
编译器路径 /opt/toolschain/linaro/bin/arm-linux-gnueabihf- 绝对路径
Xilinx uboot版本 u-boot-xlnx-v2018.3 官网地址
Xilinx kernel版本 linux-xlnx-v2018.3 官网地址
文件系统 linaro-precise-ubuntu-desktop-20121124-560 官网地址
SD卡型号 SanDisk C10 A1至尊高速移动版 16GB 参考链接

0. SD卡制作

参考ZYNQ的Linux Linaro系统镜像制作SD卡启动

1. 移植u-boot

1.1 流程概述

网上移植u-boot的教程比较多,这里仅说明一下u-boot的编译流程,本博客采用的是2018.3版本。

  1. 打开vivado 2018.3,按照ZYNQ开发_Vivado_裸机开发流程建立起一个工程,由于本博客是要求从SD卡启动,所以,在ZYNQ的IP内需要勾选上SD卡外设。然后编译工程,产生bit文件。
  2. 提前说一下这一步,从vivado内打开Xilinx SDK工具,记得导入bit文件。然后建立u-boot所需要的FSBL工程,详情参考ZYNQ的Linux Linaro系统镜像制作SD卡启动,最终生成的BOOT.bin文件默认在此文件夹下:
    在这里插入图片描述
  3. 编译uboot工程,产生u-boot.elf文件,供给步骤2所需

1.2 编译uboot

git 下来Xilinx公司提供的uboot工程:

proxychains4 git clone https://github.com/Xilinx/u-boot-xlnx.git

前面的proxychains4是走的终端代理,不走代理的话,直接克隆即可。走代理的方式详情参考重装Ubuntu18.04后的系统配置工作总结里面内容。
在这里插入图片描述
根据自己使用的vivado版本进行检出对应的tag文件,不清楚tag名称的,可以使用git tag命令查看
*
然后检出tag文件内容使用

git checkout xilinx-v2018.3
git checkout -b xilinx-v2018.3

在这里插入图片描述
此时的uboot版本和vivado版本一致,可以进行后续工作。
在此之前要更改一个配置文件

vim configs/zynq_zc702_defconfig

在这里插入图片描述
禁掉此行,否则uboot会在FLASH里面读取配置文件。然后

vim arch/arm/dts/zynq-zc702.dts

更改频率,这个频率就是在vivado建立工程时的晶振频率50MHz
在这里插入图片描述
然后在终端里面

make CROSS_COMPILE=/opt/toolschain/linaro/bin/arm-linux-gnueabihf- ARCH=arm zynq_zc702_defconfig

在这里插入图片描述

make CROSS_COMPILE=/opt/toolschain/linaro/bin/arm-linux-gnueabihf- ARCH=arm menuconfig
make CROSS_COMPILE=/opt/toolschain/linaro/bin/arm-linux-gnueabihf- ARCH=arm -j8

最后产生了u-boot文件
在这里插入图片描述
执行命令,生成elf文件

cp u-boot u-boot.elf

然后用此u-boot.elf完成上述步骤2
在这里插入图片描述

1.3 测试uboot运行情况

此SD卡里面有完整的BOOT.bin、devicetree.dtb、uEnv.txt、uImage文件,所以打印出的情况是下面这种(截选部分打印信息)

U-Boot 2018.01-dirty (Sep 06 2019 - 18:55:56 +0800) Xilinx Zynq ZC702

Model: Zynq ZC702 Development Board
Board: Xilinx Zynq
Silicon: v3.1
I2C:   ready
DRAM:  ECC disabled 1 GiB
MMC:   sdhci@e0100000: 0 (SD)
Using default environment

In:    serial@e0001000
Out:   serial@e0001000
Err:   serial@e0001000
Net:   ZYNQ GEM: e000b000, phyaddr 7, interface rgmii-id
eth0: ethernet@e000b000
reading uEnv.txt
398 bytes read in 11 ms (35.2 KiB/s)
Importing environment from SD ...
Hit any key to stop autoboot:  0
Device: sdhci@e0100000
Manufacturer ID: 3
OEM: 5344
Name: SC16G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.8 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading uEnv.txt
398 bytes read in 10 ms (38.1 KiB/s)
Loaded environment from uEnv.txt
Importing environment from SD ...
Running uenvcmd ...
Copying Linux from SD to RAM...
reading uImage
3966200 bytes read in 204 ms (18.5 MiB/s)
reading devicetree.dtb

2. 移植uImage

2.1 编译uImage

和uboot步骤一样,先git下来uImage代码工程,不用代理就把proxychains4取掉

proxychains4 git clone https://github.com/Xilinx/linux-xlnx.git

检出2018.3版本,

git checkout xilinx-v2018.3
git checkout -b xilinx-v2018.3

在这里插入图片描述
检出完成
在这里插入图片描述
然后执行以下步骤:

make CROSS_COMPILE=/opt/toolschain/linaro/bin/arm-linux-gnueabihf- ARCH=arm clean
make CROSS_COMPILE=/opt/toolschain/linaro/bin/arm-linux-gnueabihf- ARCH=arm xilinx_zynq_defconfig

在这里插入图片描述

make CROSS_COMPILE=/opt/toolschain/linaro/bin/arm-linux-gnueabihf- ARCH=arm menuconfig

在可视化配置面板中,需要转到此位置进行更改一些配置
  Kernel hacking->
      [ ]Kernel low-level debugging functiongs(read help!)
按照红框里面的配置更改
在这里插入图片描述
配置完成,开始编译uImage

make CROSS_COMPILE=/opt/toolschain/linaro/bin/arm-linux-gnueabihf- ARCH=arm -j8
make CROSS_COMPILE=/opt/toolschain/linaro/bin/arm-linux-gnueabihf- ARCH=arm uImage LOADADDR=0x00008000

在这里插入图片描述
此时uImage编译完成

2.2 制作设备树文件

linux-xlnx/arch/arm/boot/dts目录内新建一个名为zynq-7010.dts文件,文件内容:

/dts-v1/;
/include/ "zynq-7000.dtsi"

/ {
    model = "HLF";
    compatible = "ALINX,zynq", "xlnx,zynq-7000";

    aliases {
        ethernet0 = &gem0;
        serial0 = &uart1;
        spi0 = &qspi;
        mmc0 = &sdhci0;
    };

    memory@0 {
        device_type = "memory";
        reg = <0x0 0x20000000>;
    };

    chosen {
        bootargs = "";
        stdout-path = "serial0:115200n8";
    };

    usb_phy0: phy0 {
        compatible = "usb-nop-xceiv";
        #phy-cells = <0>;
        reset-gpios = <&gpio0 46 1>;
    };
};

&clkc {
    ps-clk-frequency = <50000000>;
};

&gem0 {
    status = "okay";
    phy-mode = "rgmii-id";
    phy-handle = <&ethernet_phy>;

    ethernet_phy: ethernet-phy@0 {
        reg = <0>;
	device_type = "ethernet-phy";
    };
};

&qspi {
    u-boot,dm-pre-reloc;
    status = "okay";
};

&sdhci0 {
	u-boot,dm-pre-reloc;
	status = "okay";
	broken-mmc-highspeed;
	clock-frequency = <20000000>;
	disable-wp;
	no-1-8-v;
};

&uart1 {
	u-boot,dm-pre-reloc;
	status = "okay";
};

&usb0 {
	u-boot,dm-pre-reloc;
	status = "okay";
	usb-phy = <&usb_phy0>;
};

然后在uImage工程的顶层目录里面,执行以下命令:

./scripts/dtc/dtc -I dts -O dtb -o ./arch/arm/boot/devicetree.dtb ./arch/arm/boot/dts/zynq-7010.dts

产生了devicetree.dtb文件
在这里插入图片描述

2.3 启动配置文件制作uEnv.txt

随便找个位置新建一个uEnv.txt 文件,文件内写入boot的配置信息:

uenvcmd=run linaro_sdboot

linaro_sdboot=echo Copying Linux from SD to RAM... && \
fatload mmc 0 0x3000000 ${kernel_image} && \
fatload mmc 0 0x2A00000 ${devicetree_image} && \
if fatload mmc 0 0x2000000 ${ramdisk_image}; \
then bootm 0x3000000 0x2000000 0x2A00000; \
else bootm 0x3000000 - 0x2A00000; fi

bootargs=console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait

2.4测试uImage

uImage文件、devicetree.dtb文件和uEnv.txt拷贝到SD卡里面,此时SD卡里面共有四个文件
为了以防没有执行权限,在linxu下面进入SD卡的boot文件夹里面执行以下命令

sudo chmod 777 *

虽然执行完也是下面模样,哈哈哈,但不影响执行
在这里插入图片描述
现在插入SD卡,上电看一下打印出的信息:
注:文件系统已经移植好了,所以后面可以看到挂载文件系统的信息。

U-Boot 2018.01-dirty (Sep 06 2019 - 20:31:16 +0800) Xilinx Zynq ZC702

Model: Zynq ZC702 Development Board
Board: Xilinx Zynq
Silicon: v3.1
I2C:   ready
DRAM:  ECC disabled 1 GiB
MMC:   sdhci@e0100000: 0 (SD)
Using default environment

In:    serial@e0001000
Out:   serial@e0001000
Err:   serial@e0001000
Net:   ZYNQ GEM: e000b000, phyaddr 7, interface rgmii-id
eth0: ethernet@e000b000
reading uEnv.txt
398 bytes read in 11 ms (35.2 KiB/s)
Importing environment from SD ...
Hit any key to stop autoboot:  0
Device: sdhci@e0100000
Manufacturer ID: 3
OEM: 5344
Name: SC16G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.8 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading uEnv.txt
398 bytes read in 11 ms (35.2 KiB/s)
Loaded environment from uEnv.txt
Importing environment from SD ...
Running uenvcmd ...
Copying Linux from SD to RAM...
reading uImage
3966200 bytes read in 254 ms (14.9 MiB/s)
reading devicetree.dtb
9279 bytes read in 16 ms (565.4 KiB/s)
** Unable to read file uramdisk.image.gz **
## Booting kernel from Legacy Image at 03000000 ...
   Image Name:   Linux-4.14.0-xilinx-dirty
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3966136 Bytes = 3.8 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02a00000
   Booting using the fdt blob at 0x2a00000
   Loading Kernel Image ... OK
   Loading Device Tree to 1fffa000, end 1ffff43e ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 4.14.0-xilinx-dirty (china@alan) (gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05)) #2 SMP PREEMPT Fri Sep 6 21:44:47 CST 2019
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: HLF
bootconsole [earlycon0] enabled
Memory policy: Data cache writealloc
cma: Reserved 16 MiB at 0x3f000000
random: fast init done
percpu: Embedded 16 pages/cpu @ef7ce000 s34764 r8192 d22580 u65536
Built 1 zonelists, mobility grouping on.  Total pages: 260608
Kernel command line: console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1012892K/1048576K available (6144K kernel code, 238K rwdata, 1560K rodata, 1024K init, 153K bss, 19300K reserved, 16384K cma-reserved, 245760K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
    lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc0700000   (7136 kB)
      .init : 0xc0900000 - 0xc0a00000   (1024 kB)
      .data : 0xc0a00000 - 0xc0a3b8c0   ( 239 kB)
       .bss : 0xc0a3b8c0 - 0xc0a61d84   ( 154 kB)
Preemptible hierarchical RCU implementation.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
        Tasks RCU enabled.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
efuse mapped to f0802000
slcr mapped to f0804000
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
zynq_clock_init: clkc starts at f0804100
Zynq clock init
sched_clock: 64 bits at 325MHz, resolution 3ns, wraps every 4398046511103ns
clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4af477f6aa, max_idle_ns: 440795207830 ns
Switching to timer-based delay loop, resolution 3ns
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 551318127 ns
timer #0 at f080c000, irq=17
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 650.00 BogoMIPS (lpj=3250000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100060
Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
smp: Brought up 1 node, 2 CPUs
SMP: Total of 2 processors activated (1300.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 512 (order: 3, 32768 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xf0880000
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 25, base_baud = 6250000) is a xuartps
▒▒k▒▒▒▒[ttyPS0] enabled
console [ttyPS0] enabled
bootconsole [earlycon0] disabled
bootconsole [earlycon0] disabled
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
usb_phy_generic phy0: phy0 supply vcc not found, using dummy regulator
media: Linux media interface: v0.10
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
FPGA manager framework
fpga-region fpga-full: FPGA Region probed
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: no interrupt-affinity property for /pmu@f8891000, guessing.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
workingset: timestamp_bits=30 max_order=18 bucket_order=0
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
bounce: pool size: 64 pages
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
io scheduler mq-deadline registered
io scheduler kyber registered
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac:        DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
brd: module loaded
loop: module loaded
zynq-qspi e000d000.spi: couldn't determine configuration info
zynq-qspi e000d000.spi: about dual memories. defaulting to single memory
libphy: Fixed MDIO Bus: probed
CAN device driver interface
libphy: MACB_mii_bus: probed
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 27 (00:0a:35:00:01:22)
RTL8211E Gigabit Ethernet e000b000.ethernet-ffffffff:00: attached PHY driver [RTL8211E Gigabit Ethernet] (mii_bus:phy_addr=e000b000.ethernet-ffffffff:00, irq=POLL)
e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
chipidea-usb2 e0002000.usb: e0002000.usb supply vbus not found, using dummy regulator
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
i2c /dev entries driver
IR NEC protocol handler initialized
IR RC5(x/sz) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
IR SANYO protocol handler initialized
IR Sharp protocol handler initialized
IR MCE Keyboard/mouse protocol handler initialized
IR XMP protocol handler initialized
cdns-wdt f8005000.watchdog: Xilinx Watchdog Timer at f0990000 with timeout 10s
EDAC MC: ECC not enabled
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on e0100000.mmc [e0100000.mmc] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
fpga_manager fpga0: Xilinx Zynq FPGA Manager registered
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20170425 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20170425)
can: broadcast manager protocol (rev 20170425 t)
can: netlink gateway (rev 20170425) max_hops=1
Registering SWP/SWPB emulation handler
hctosys: unable to open rtc device (rtc0)
of_cfs_init
of_cfs_init: OK
ALSA device list:
  No soundcards found.
Waiting for root device /dev/mmcblk0p2...
mmc0: new SDHC card at address aaaa
mmcblk0: mmc0:aaaa SC16G 14.8 GiB
 mmcblk0: p1 p2
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
init: hwclock main process (685) terminated with status 1
init: ureadahead main process (686) terminated with status 5
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, aborting
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, aborting
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, aborting

Last login: Thu Jan  1 00:00:09 UTC 1970 on tty1
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, aborting
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, aborting
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, aborting
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, aborting
cat: /var/lib/update-notifier/fsck-at-reboot: No such file or directory
run-parts: /etc/update-motd.d/98-fsck-at-reboot exited with return code 1
Welcome to Linaro 12.11 (GNU/Linux 4.14.0-xilinx-dirty armv7l)

 * Documentation:  https://wiki.linaro.org/

0 packages can be updated.
0 updates are security updates.

0 packages can be updated.
0 updates are security updates.
0 packages can be updated.
0 updates are security updates.

root@linaro-ubuntu-desktop:~# pwd
/root
root@linaro-ubuntu-desktop:~# cd /
root@linaro-ubuntu-desktop:/#  ls -al
total 88
drwxr-xr-x  23 root root  4096 Jan  1 00:02 .
drwxr-xr-x  23 root root  4096 Jan  1 00:02 ..
drwxr-xr-x   2 root root  4096 Nov 24  2012 .disk
drwxr-xr-x   2 root root  4096 Nov 24  2012 bin
drwxr-xr-x   2 root root  4096 Oct 20  2012 boot
drwxr-xr-x  10 root root  2940 Jan  1 00:00 dev
drwxr-xr-x 128 root root  4096 Jan  1 00:00 etc
drwxr-xr-x   3 root root  4096 Nov 24  2012 home
drwxr-xr-x  17 root root  4096 Nov 24  2012 lib
drwx------   2 root root 16384 Sep  6  2019 lost+found
drwxr-xr-x   2 root root  4096 Nov 24  2012 media
drwxr-xr-x   2 root root  4096 Oct 20  2012 mnt
drwxr-xr-x   2 root root  4096 Nov 24  2012 opt
dr-xr-xr-x  82 root root     0 Jan  1 00:00 proc
drwx------   4 root root  4096 Jan  1  1970 root
drwxr-xr-x  12 root root   480 Jan  1 00:00 run
drwxr-xr-x   2 root root  4096 Nov 24  2012 sbin
drwxr-xr-x   2 root root  4096 Mar  5  2012 selinux
drwxr-xr-x   2 root root  4096 Nov 24  2012 srv
dr-xr-xr-x  12 root root     0 Jan  1 00:00 sys
drwxrwxrwt   4 root root  4096 Jan  1 00:00 tmp
drwxr-xr-x  10 root root  4096 Nov 24  2012 usr
drwxr-xr-x  13 root root  4096 Jan  1  1970 var
root@linaro-ubuntu-desktop:/#

可以看到kernel可以挂载上文件系统,但是有错误的打印信息
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, aborting
目前不清楚为何,查了好多资料,才算是打印的少了,之前的一直不停的在打印,网上有人说是SD卡的速度太快了,我在设备树中降低的SD卡的速度后,算是可以挂载上文件系统了,但在成功挂载前还是会出现这种情况,不知道是为何。若有大神了解原因,还请不吝赐教,在此感谢!


3移植文件系统

下载好文件系统后,在文件系统所在文件夹内执行以下命令:

sudo tar --strip-components=3 -C /run/media/china/rootfs -xzpf linaro-precise-ubuntu-desktop-20120723-305.tar.gz binary/boot/filesystem.dir

注意,红框里的路径要保持一致方可
在这里插入图片描述

暂存问题

挂载文件系统时,打印出如下错误信息

mmcblk0: error -110 sending status command, retrying
mmcblk0: error -110 sending status command, aborting

维护日志

| 维护日期 | 维护内容
---|:--😐---
| 暂无 | 暂无

参考资料

  1. ZYNQ的Linux Linaro系统镜像制作SD卡启动
  2. Topic: SD card works during u-boot, but not after kernel starts (mmc0: error -110 whil)
  3. ZYNQ跑系统 系列(一) 传统方式移植linux
  4. 2017.1-2017.4 Zynq UltraScale+ MPSoC: Linux mmcblk0 error -110 sending stop command, original cmd response 0x900, card status 0xe00 when using Swissbit SD card
  5. U-Boot中Distro_bootcmd的实现分析
  6. Xilinx zynq-7000系列FPGA移植Linux操作系统详细教程
  7. Xilinx Wiki
posted @ 2019-09-06 22:38  multimicro  阅读(4318)  评论(0编辑  收藏  举报