矿板EBAZ4205之SD卡启动

目录

  • 环境
  • 准备
  • 工程
  • uboot
  • 设备树
  • 启动
  • 仓库

为了测试自制的Xilinx JTAG,弄了个矿板,灰常的便宜,在某宝上弄的,只要30多,加邮费40多。网上看了下,这个板子似乎还是比较火的,不少针对它的使用文章,今天本文也来简单描述下使用的过程。

环境

硬件: 矿板芯片为 xc7z010clg400-1
软件: Vivado 2017.4

准备

1、由于采用J4供电,故需要短接D24;
2、SD卡启动需要将 R2578 电阻换到 R2577 上;
3、焊接SD卡座,串口和JTAG口

工程

主要配置 nand 、SD卡、uart1、网口
矿板EBAZ4205之SD卡启动_第1张图片
网口配置成emio,包括mdio
矿板EBAZ4205之SD卡启动_第2张图片
网口为百兆
矿板EBAZ4205之SD卡启动_第3张图片
DDR3 为 MT41K128M16 JT-125, 大小为256M
矿板EBAZ4205之SD卡启动_第4张图片
nand 时序
矿板EBAZ4205之SD卡启动_第5张图片
网口为 百兆 MII 接口,四根数据线,
矿板EBAZ4205之SD卡启动_第6张图片
FCLK_CLK0 和 FCLK_RESET0_N 暂未使用,可以不添加,添加的话需要在生成的顶层文件 system_wrapper.v 中注释输出接口。
矿板EBAZ4205之SD卡启动_第7张图片
约束文件

set_property IOSTANDARD LVCMOS33 [get_ports ENET0_MII_RX_CLK]
set_property IOSTANDARD LVCMOS33 [get_ports ENET0_MII_TX_CLK]
set_property IOSTANDARD LVCMOS33 [get_ports FCLK_CLK0]
set_property IOSTANDARD LVCMOS33 [get_ports {ENET0_MII_TX_EN[0]}]
set_property IOSTANDARD LVCMOS33 [get_ports ENET0_MII_RX_DV]
set_property PACKAGE_PIN U14 [get_ports ENET0_MII_RX_CLK]
set_property PACKAGE_PIN U15 [get_ports ENET0_MII_TX_CLK]
set_property IOSTANDARD LVCMOS33 [get_ports {ENET0_MII_RXD[3]}]
set_property IOSTANDARD LVCMOS33 [get_ports {ENET0_MII_RXD[2]}]
set_property IOSTANDARD LVCMOS33 [get_ports {ENET0_MII_RXD[1]}]
set_property IOSTANDARD LVCMOS33 [get_ports {ENET0_MII_RXD[0]}]
set_property PACKAGE_PIN V17 [get_ports {ENET0_MII_RXD[2]}]
set_property PACKAGE_PIN Y17 [get_ports {ENET0_MII_RXD[3]}]
set_property PACKAGE_PIN Y16 [get_ports {ENET0_MII_RXD[0]}]
set_property PACKAGE_PIN V16 [get_ports {ENET0_MII_RXD[1]}]
set_property IOSTANDARD LVCMOS33 [get_ports {ENET0_MII_TXD[3]}]
set_property IOSTANDARD LVCMOS33 [get_ports {ENET0_MII_TXD[2]}]
set_property IOSTANDARD LVCMOS33 [get_ports {ENET0_MII_TXD[1]}]
set_property IOSTANDARD LVCMOS33 [get_ports {ENET0_MII_TXD[0]}]
set_property PACKAGE_PIN Y19 [get_ports {ENET0_MII_TXD[3]}]
set_property PACKAGE_PIN W18 [get_ports {ENET0_MII_TXD[0]}]
set_property PACKAGE_PIN Y18 [get_ports {ENET0_MII_TXD[1]}]
set_property PACKAGE_PIN V18 [get_ports {ENET0_MII_TXD[2]}]
set_property PACKAGE_PIN W19 [get_ports {ENET0_MII_TX_EN[0]}]
set_property PACKAGE_PIN W16 [get_ports ENET0_MII_RX_DV]
set_property IOSTANDARD LVCMOS33 [get_ports {led[0]}]
set_property PACKAGE_PIN W13 [get_ports {led[0]}]
set_property IOSTANDARD LVCMOS33 [get_ports MDIO_ETHERNET_mdc]
set_property IOSTANDARD LVCMOS33 [get_ports MDIO_ETHERNET_mdio_io]
set_property PACKAGE_PIN W15 [get_ports MDIO_ETHERNET_mdc]
set_property PACKAGE_PIN Y14 [get_ports MDIO_ETHERNET_mdio_io]

uboot

版本 u-boot-xlnx-xilinx-v2018.3
修改 zynq-zc702.dts 文件

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

设备树

设备树修改添加

&gem0 {
	local-mac-address = [00 0a 35 00 00 00];
	phy-mode = "gmii";
	status = "okay";
	xlnx,ptp-enet-clock = <0x69f6bcb>;
	phy-handle = <&ethernet_phy>;
	
	ethernet_phy: ethernet-phy@0 {
		reg = <0>;
		device_type = "ethernet-phy";
	};
};

&nand0 {
	arm,nand-cycle-t0 = <0x4>;
	arm,nand-cycle-t1 = <0x4>;
	arm,nand-cycle-t2 = <0x2>;
	arm,nand-cycle-t3 = <0x2>;
	arm,nand-cycle-t4 = <0x2>;
	arm,nand-cycle-t5 = <0x2>;
	arm,nand-cycle-t6 = <0x4>;
	status = "okay";
	pinctrl-names = "default";

    partition@0 {
        label = "nand-fsbl-uboot";
        reg = <0x0 0x300000>;
    };
    partition@1 {
        label = "nand-linux";
        reg = <0x300000 0x500000>;
    };
    partition@2 {
        label = "nand-device-tree";
        reg = <0x800000 0x20000>;
    };
    partition@3 {
        label = "nand-rootfs";
        reg = <0x820000 0xa00000>;
    };
    partition@4 {
        label = "nand-jffs2";
        reg = <0x1220000 0x1000000>;
    };
    partition@5 {
        label = "nand-bitstream";
        reg = <0x2220000 0x800000>;
    };
    partition@6 {
        label = "nand-allrootfs";
        reg = <0x2a20000 0x4000000>;
    };
    partition@7 {
        label = "nand-release";
        reg = <0x6a20000 0x13e0000>;
    };
    partition@8 {
        label = "nand-reserve";
        reg = <0x7e00000 0x200000>;
    };
};

内核编译没啥,就不说了,文件系统去官方wiki上找一个,或者用其他开发板的都可以。

将这5个文件放入SD卡中,插上SD卡,上电即可启动进入系统
BOOT.bin
devicetree.dtb
uEnv.txt
uramdisk.image.gz
zImage

uEnv.txt 文件内容

bootcmd=setenv bootargs "root=/dev/ram0 rw init=/linuxrc  console=ttyPS0,115200" &&load mmc 0  ${ramdisk_load_address}  uramdisk.image.gz && load mmc 0  ${devicetree_load_address} devicetree.dtb && load mmc 0  ${kernel_load_address} zImage && bootz ${kernel_load_address}  ${ramdisk_load_address} ${devicetree_load_address}

文本使用的是米尔的文件系统,未作修改,进入系统需要配置ip才能使用网口。

启动

uboot网口也是ok的
矿板EBAZ4205之SD卡启动_第8张图片
矿板EBAZ4205之SD卡启动_第9张图片

仓库

相关工程及可用固件见 git 仓库
github:
https://github.com/feitingfj/EBAZ4205_PRO
码云:
https://gitee.com/feitingfj/ebaz4205_pro

矿板原理图等资料
https://github.com/feitingfj/EBAZ4205

你可能感兴趣的:(linux,zynq,arm,嵌入式,linux)