From patchwork Sun Jul 24 15:36:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastien Van Cauwenberghe X-Patchwork-Id: 652106 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ry7mN4NH6z9t0p for ; Mon, 25 Jul 2016 01:37:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=phUv9vt7; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B75BD8989C; Sun, 24 Jul 2016 15:37:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3vuBYeG3UrW7; Sun, 24 Jul 2016 15:37:04 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 3A7438980A; Sun, 24 Jul 2016 15:37:04 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 4E74B1C10B8 for ; Sun, 24 Jul 2016 15:37:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4ACD98A9BD for ; Sun, 24 Jul 2016 15:37:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ft+ANj3SiuB1 for ; Sun, 24 Jul 2016 15:37:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by whitealder.osuosl.org (Postfix) with ESMTPS id 1300D8B0BE for ; Sun, 24 Jul 2016 15:37:02 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id x83so13144352wma.3 for ; Sun, 24 Jul 2016 08:37:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=rAQycNbjZQ2gsn/SaGFYwoYwr2m2OkW7QdrhiFMpET8=; b=phUv9vt74HK6EkRSP9bVovGCRLDARW3mS7ug49382QCJ7tDN9LnFxV0fRmY6qQeSdP 1uYblBWkXLRkzUxB1nk21sBxa0KgQyroZX/avrD8OMEbvSjKO6ArG6adPcBXTEVck7Hx KGvNVbE5t5lW9pOrMoCDyFWz8xUFF3S9iO1P4TIOHexEYdrmB+otmQah4nzgH52HrLuz nj3GZEIUzelwXy03TYFpW+FLEk/GkWeFQh0+USke0lQESP31WgckxY09t770Ll/V0e2c HZ/56Kitrx1jeGEaXQMrs+rfQS1FnPSznMQJrOiBUEJur8RZgad5Lew0P/+HhrWsG28v iDUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=rAQycNbjZQ2gsn/SaGFYwoYwr2m2OkW7QdrhiFMpET8=; b=caqPNr87LCjDUQ5xzMTMual0B91QS2R+/an16VCNlSroor/ii81I1LenEkxIAUyObs tQqnmOo109CffUENVY77VH90iPxP3adzy/w3zK456nRKNw/DsZpFaMdndGybo1v8OrT2 o7zSYqkSSSuSjws1y1gA5r5PG/qTDMP6FHYfR4x9S5lkAQakNXSjP0h+gR3xMSNnykMF 7A15xaX+Nf2dSnE8BRYWjgHOMQk4ikRzujZF2xdVoGJlI40M4LY6vk6NAXupDZvuPpC/ oF6JDPOgASDPdE1M32bd0rhkeb8mMBCDOZJb5WdTCpsZImAm1QBN6Oj1LfXz7IdyR25f mx0g== X-Gm-Message-State: AEkoousbvWr+idBRybhjPFre1bbKPmt/6D50LYEvS5cgV3/vtgBVWP7ZB+ORYJBguH57fA== X-Received: by 10.28.207.197 with SMTP id f188mr14829043wmg.69.1469374620034; Sun, 24 Jul 2016 08:37:00 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:34fe:9f00:120b:a9ff:fec0:7078]) by smtp.gmail.com with ESMTPSA id gg10sm11174981wjd.4.2016.07.24.08.36.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Jul 2016 08:36:59 -0700 (PDT) To: buildroot@busybox.net From: Sebastien Van Cauwenberghe Message-ID: Date: Sun, 24 Jul 2016 17:36:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2] configs: add defconfig for Digilent Zybo X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This configuration allows out-of-the box Digilent Zybo support. It uses mainline U-boot and Linux kernel. This configuration generates a SD card image named sdcard.img. Signed-off-by: Sebastien Van Cauwenberghe --- board/digilent/zybo/genimage-zybo.cfg | 29 +++++++++++++ board/digilent/zybo/post-image.sh | 21 ++++++++++ board/digilent/zybo/readme.txt | 76 +++++++++++++++++++++++++++++++++++ board/digilent/zybo/system.bit | 0 board/digilent/zybo/uEnv.txt | 5 +++ configs/zynq_zybo_defconfig | 26 ++++++++++++ 6 files changed, 157 insertions(+) create mode 100644 board/digilent/zybo/genimage-zybo.cfg create mode 100755 board/digilent/zybo/post-image.sh create mode 100644 board/digilent/zybo/readme.txt create mode 100644 board/digilent/zybo/system.bit create mode 100644 board/digilent/zybo/uEnv.txt create mode 100644 configs/zynq_zybo_defconfig diff --git a/board/digilent/zybo/genimage-zybo.cfg b/board/digilent/zybo/genimage-zybo.cfg new file mode 100644 index 0000000..f39186d --- /dev/null +++ b/board/digilent/zybo/genimage-zybo.cfg @@ -0,0 +1,29 @@ +image boot.vfat { + vfat { + files = { + "BOOT.BIN", + "uEnv.txt", + "system.bit", + "zynq-zybo.dtb", + "u-boot-dtb.img", + "uImage" + } + } + size = 32M +} + +image sdcard.img { + hdimage { + } + + partition boot { + partition-type = 0xC + bootable = "true" + image = "boot.vfat" + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + } +} diff --git a/board/digilent/zybo/post-image.sh b/board/digilent/zybo/post-image.sh new file mode 100755 index 0000000..782ca2a --- /dev/null +++ b/board/digilent/zybo/post-image.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +BOARD_DIR="$(dirname $0)" +BOARD_NAME="$(basename ${BOARD_DIR})" +GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg" +GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" +OUTPUT_DIR="${O}/images" + +rm -rf "${GENIMAGE_TMP}" + +cp board/digilent/zybo/uEnv.txt ${BINARIES_DIR} +cp board/digilent/zybo/system.bit ${BINARIES_DIR} + +genimage \ + --rootpath "${TARGET_DIR}" \ + --tmppath "${GENIMAGE_TMP}" \ + --inputpath "${BINARIES_DIR}" \ + --outputpath "${BINARIES_DIR}" \ + --config "${GENIMAGE_CFG}" + +exit $? diff --git a/board/digilent/zybo/readme.txt b/board/digilent/zybo/readme.txt new file mode 100644 index 0000000..2a60a7cc --- /dev/null +++ b/board/digilent/zybo/readme.txt @@ -0,0 +1,76 @@ +Digilent Zybo +============= + +This is the Buildroot board support for the Digilent Zybo. The Zybo is +a development board based on the Xilinx Zynq-7000 based All-Programmable +System-On-Chip. + +Zybo information including schematics, reference designs, and manuals are +available from http://store.digilentinc.com/zybo-zynq-7000-arm-fpga-soc-trainer-board/ . + +If you want a custom FPGA bitstream to be loaded by U-Boot, copy it as +system.bit in board/digilent/zybo/. + +Steps to create a working system for Zybo: + +1) make zynq_zybo_defconfig +2) make +3) write your SD Card with the sdcard.img file using dd by doing + $ sudo dd if=output/images/sdcard.img of=/dev/sdX +4) insert the SD Card and power up your Zybo +5) Expect serial console on the second USB serial port exposed by the board + +The expected output: + + U-Boot SPL 2016.05 (May 20 2016 - 16:16:24) + mmc boot + Trying to boot from MMC1 + reading system.dtb + spl_load_image_fat_os: error reading image system.dtb, err - -1 + reading u-boot-dtb.img + reading u-boot-dtb.img + + + U-Boot 2016.05 (May 20 2016 - 16:16:24 +0200) + + Model: Zynq ZYBO Development Board + Board: Xilinx Zynq + I2C: ready + DRAM: ECC disabled 512 MiB + MMC: sdhci@e0100000: 0 + SF: Detected S25FL128S_64K with page size 256 Bytes, erase size 64 KiB, total 16 MiB + In: serial@e0001000 + Out: serial@e0001000 + Err: serial@e0001000 + Model: Zynq ZYBO Development Board + Board: Xilinx Zynq + Net: ZYNQ GEM: e000b000, phyaddr 0, interface rgmii-id + I2C EEPROM MAC address read failed + + Warning: ethernet@e000b000 (eth0) using random MAC address - 56:64:dd:a7:6d:94 + eth0: ethernet@e000b000 + ... + +Resulting system +---------------- +Once the build process is finished you will have an image called "sdcard.img" +in the output/images/ directory. + +The first partition is a FAT32 partition created at the beginning of the SD Card +that contains the following files : + /BOOT.BIN + /zynq-zybo.dtb + /uEnv.txt + /system.bit + /uImage + /u-boot-dtb.img + +The second partition is an ext4 partition that contains the root filesystem. + +You can alter the booting procedure by modifying the uEnv.txt file +in first partition of the SD card. It is a plain text file in format += one per line: + +kernel_image=myimage +modeboot=myboot +myboot=... diff --git a/board/digilent/zybo/system.bit b/board/digilent/zybo/system.bit new file mode 100644 index 0000000..e69de29 diff --git a/board/digilent/zybo/uEnv.txt b/board/digilent/zybo/uEnv.txt new file mode 100644 index 0000000..1042538 --- /dev/null +++ b/board/digilent/zybo/uEnv.txt @@ -0,0 +1,5 @@ +bootargs=root=/dev/mmcblk0p2 rootwait rw rootfstype=ext4 +fpga_image=system.bit +fpgaboot=if fatload mmc 0 0x1000000 ${fpga_image}; then echo Booting FPGA from ${fpga_image}; fpga info 0 && fpga loadb 0 0x1000000 $filesize; else echo FPGA image ${fpga_image} was not found, skipping...; fi; +kernel_image=uImage +sdboot=echo Booting from SD...; run fpgaboot; fatload mmc 0 0x1000000 ${kernel_image} && fatload mmc 0 0x2000000 zynq-zybo.dtb && bootm 0x1000000 - 0x2000000 diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig new file mode 100644 index 0000000..8ab152f --- /dev/null +++ b/configs/zynq_zybo_defconfig @@ -0,0 +1,26 @@ +BR2_arm=y +BR2_cortex_a9=y +BR2_ARM_ENABLE_NEON=y +BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/digilent/zybo/post-image.sh" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.6.4" +BR2_LINUX_KERNEL_DEFCONFIG="multi_v7" +BR2_LINUX_KERNEL_UIMAGE=y +BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="zynq-zybo" +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_VERSION=y +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.05" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="zynq_zybo" +BR2_TARGET_UBOOT_NEEDS_DTC=y +BR2_TARGET_UBOOT_FORMAT_DTB_IMG=y +BR2_TARGET_UBOOT_SPL=y +BR2_TARGET_UBOOT_ZYNQ_IMAGE=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_UBOOT_TOOLS=y