All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] Add support for Digilent Zybo (Xilinx Zynq-7000)
@ 2016-05-22 15:43 Sebastien Van Cauwenberghe
  0 siblings, 0 replies; 6+ messages in thread
From: Sebastien Van Cauwenberghe @ 2016-05-22 15:43 UTC (permalink / raw
  To: buildroot

[PATCH] Add support for Digilent Zybo (Xilinx Zynq-7000)

Signed-off-by: Sebastien Van Cauwenberghe <svancau@gmail.com>
---
 board/digilent/zybo/readme.txt                     | 75 ++++++++++++++++++++++
 .../0001-Modify-U-boot-env-for-Zybo-boot.patch     | 45 +++++++++++++
 configs/zynq_zybo_defconfig                        | 25 ++++++++
 3 files changed, 145 insertions(+)
 create mode 100644 board/digilent/zybo/readme.txt
 create mode 100644 board/digilent/zybo/uboot/0001-Modify-U-boot-env-for-Zybo-boot.patch
 create mode 100644 configs/zynq_zybo_defconfig

diff --git a/board/digilent/zybo/readme.txt b/board/digilent/zybo/readme.txt
new file mode 100644
index 0000000..f9ff939
--- /dev/null
+++ b/board/digilent/zybo/readme.txt
@@ -0,0 +1,75 @@
+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/ .
+
+Steps to create a working system for Zybo:
+
+1) make zynq_zybo_defconfig
+2) make
+3) copy files BOOT.BIN, u-boot-dtb.img, rootfs.cpio.uboot,
+	uImage, zynq-zybo.dtb into your SD card
+4) boot your Zybo
+
+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 at e0100000: 0
+ SF: Detected S25FL128S_64K with page size 256 Bytes, erase size 64 KiB, total 16 MiB
+ In:    serial at e0001000
+ Out:   serial at e0001000
+ Err:   serial at 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 at e000b000 (eth0) using random MAC address - 56:64:dd:a7:6d:94
+ eth0: ethernet at e000b000
+ ...
+
+Resulting system
+----------------
+A FAT32 partition should be created at the beginning of the SD Card
+and the following files should be installed:
+	/BOOT.BIN
+	/zynq-zybo.dtb
+	/uImage
+	/rootfs-cpio.uboot
+	/u-boot-dtb.img
+
+
+All needed files can be taken from output/images/
+
+BOOT.BIN, uImage and u-boot-dtb.img are direct copies of the same files
+available on output/images/
+
+There is a patch attached that redefines the U-Boot's environment
+to work with Buildroot out-of-the-box.
+
+You can alter the booting procedure by creating a file uEnv.txt
+in the root of the SD card. It is a plain text file in format
+<key>=<value> one per line:
+
+kernel_image=myimage
+modeboot=myboot
+myboot=...
+
+The serial console is accessible on the host on /dev/ttyUSB1 at 115200 bauds.
+
diff --git a/board/digilent/zybo/uboot/0001-Modify-U-boot-env-for-Zybo-boot.patch b/board/digilent/zybo/uboot/0001-Modify-U-boot-env-for-Zybo-boot.patch
new file mode 100644
index 0000000..74f44cb
--- /dev/null
+++ b/board/digilent/zybo/uboot/0001-Modify-U-boot-env-for-Zybo-boot.patch
@@ -0,0 +1,45 @@
+From e5df2c908d69c51a1a6cf02225fee10920c9ca01 Mon Sep 17 00:00:00 2001
+From: Sebastien Van Cauwenberghe <svancau@gmail.com>
+Date: Sun, 22 May 2016 15:25:24 +0200
+Subject: [PATCH] Modify U-boot env for Zybo boot
+
+---
+ include/configs/zynq_zybo.h | 24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+diff --git a/include/configs/zynq_zybo.h b/include/configs/zynq_zybo.h
+index 637b1c5..d488a69 100644
+--- a/include/configs/zynq_zybo.h
++++ b/include/configs/zynq_zybo.h
+@@ -28,4 +28,28 @@
+
+ #include <configs/zynq-common.h>
+
++#undef CONFIG_EXTRA_ENV_SETTINGS
++#define CONFIG_EXTRA_ENV_SETTINGS \
++   "envload=mmc info && if fatload mmc 0 0x1000 uEnv.txt;"\
++   " then echo Importing uEnv.txt; env import -t 0x1000"  \
++   " $filesize; fi;\0"                                    \
++   "bootcmd=run envload; run $modeboot\0"                 \
++   "modeboot=sdboot\0"                                    \
++   "baudrate=115200\0"                                    \
++   "bootenv=uEnv.txt\0"                                   \
++   "devicetree_image=zynq-zybo.dtb\0"                     \
++   "kernel_image=uImage\0"                                \
++   "ramdisk_image=rootfs.cpio.uboot\0"                    \
++   "fpga_image=system.bit\0"                              \
++   "sdboot=echo Booting from SD...; run fpgaboot;"        \
++   " fatload mmc 0 0x1000000 ${kernel_image}"             \
++   " && fatload mmc 0 0x2000000 ${ramdisk_image}"         \
++   " && fatload mmc 0 0x3000000 ${devicetree_image}"      \
++   " && bootm 0x1000000 0x2000000 0x3000000\0"            \
++   "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;\0"
++
+ #endif /* __CONFIG_ZYNQ_ZYBO_H */
+--
+2.5.5
+
diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig
new file mode 100644
index 0000000..e2c8841
--- /dev/null
+++ b/configs/zynq_zybo_defconfig
@@ -0,0 +1,25 @@
+BR2_arm=y
+BR2_cortex_a9=y
+BR2_ARM_ENABLE_NEON=y
+# BR2_COMPILER_PARANOID_UNSAFE_PATH is not set
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_6=y
+BR2_BINUTILS_VERSION_2_26_X=y
+BR2_GCC_VERSION_5_X=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
+BR2_LINUX_KERNEL=y
+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_CPIO=y
+BR2_TARGET_ROOTFS_CPIO_GZIP=y
+BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_PATCH="$(TOPDIR)/board/digilent/zybo/uboot"
+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
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] Add support for Digilent Zybo (Xilinx Zynq-7000)
@ 2016-05-22 15:50 Sebastien Van Cauwenberghe
  2016-06-12 20:12 ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastien Van Cauwenberghe @ 2016-05-22 15:50 UTC (permalink / raw
  To: buildroot

[PATCH] Add support for Digilent Zybo (Xilinx Zynq-7000)

Signed-off-by: Sebastien Van Cauwenberghe <svancau@gmail.com>
---
 board/digilent/zybo/readme.txt                     | 75 ++++++++++++++++++++++
 .../0001-Modify-U-boot-env-for-Zybo-boot.patch     | 45 +++++++++++++
 configs/zynq_zybo_defconfig                        | 25 ++++++++
 3 files changed, 145 insertions(+)
 create mode 100644 board/digilent/zybo/readme.txt
 create mode 100644 board/digilent/zybo/uboot/0001-Modify-U-boot-env-for-Zybo-boot.patch
 create mode 100644 configs/zynq_zybo_defconfig

diff --git a/board/digilent/zybo/readme.txt b/board/digilent/zybo/readme.txt
new file mode 100644
index 0000000..f9ff939
--- /dev/null
+++ b/board/digilent/zybo/readme.txt
@@ -0,0 +1,75 @@
+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/ .
+
+Steps to create a working system for Zybo:
+
+1) make zynq_zybo_defconfig
+2) make
+3) copy files BOOT.BIN, u-boot-dtb.img, rootfs.cpio.uboot,
+	uImage, zynq-zybo.dtb into your SD card
+4) boot your Zybo
+
+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 at e0100000: 0
+ SF: Detected S25FL128S_64K with page size 256 Bytes, erase size 64 KiB, total 16 MiB
+ In:    serial at e0001000
+ Out:   serial at e0001000
+ Err:   serial at 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 at e000b000 (eth0) using random MAC address - 56:64:dd:a7:6d:94
+ eth0: ethernet at e000b000
+ ...
+
+Resulting system
+----------------
+A FAT32 partition should be created at the beginning of the SD Card
+and the following files should be installed:
+	/BOOT.BIN
+	/zynq-zybo.dtb
+	/uImage
+	/rootfs-cpio.uboot
+	/u-boot-dtb.img
+
+
+All needed files can be taken from output/images/
+
+BOOT.BIN, uImage and u-boot-dtb.img are direct copies of the same files
+available on output/images/
+
+There is a patch attached that redefines the U-Boot's environment
+to work with Buildroot out-of-the-box.
+
+You can alter the booting procedure by creating a file uEnv.txt
+in the root of the SD card. It is a plain text file in format
+<key>=<value> one per line:
+
+kernel_image=myimage
+modeboot=myboot
+myboot=...
+
+The serial console is accessible on the host on /dev/ttyUSB1 at 115200 bauds.
+
diff --git a/board/digilent/zybo/uboot/0001-Modify-U-boot-env-for-Zybo-boot.patch b/board/digilent/zybo/uboot/0001-Modify-U-boot-env-for-Zybo-boot.patch
new file mode 100644
index 0000000..74f44cb
--- /dev/null
+++ b/board/digilent/zybo/uboot/0001-Modify-U-boot-env-for-Zybo-boot.patch
@@ -0,0 +1,45 @@
+From e5df2c908d69c51a1a6cf02225fee10920c9ca01 Mon Sep 17 00:00:00 2001
+From: Sebastien Van Cauwenberghe <svancau@gmail.com>
+Date: Sun, 22 May 2016 15:25:24 +0200
+Subject: [PATCH] Modify U-boot env for Zybo boot
+
+---
+ include/configs/zynq_zybo.h | 24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+diff --git a/include/configs/zynq_zybo.h b/include/configs/zynq_zybo.h
+index 637b1c5..d488a69 100644
+--- a/include/configs/zynq_zybo.h
++++ b/include/configs/zynq_zybo.h
+@@ -28,4 +28,28 @@
+
+ #include <configs/zynq-common.h>
+
++#undef CONFIG_EXTRA_ENV_SETTINGS
++#define CONFIG_EXTRA_ENV_SETTINGS \
++   "envload=mmc info && if fatload mmc 0 0x1000 uEnv.txt;"\
++   " then echo Importing uEnv.txt; env import -t 0x1000"  \
++   " $filesize; fi;\0"                                    \
++   "bootcmd=run envload; run $modeboot\0"                 \
++   "modeboot=sdboot\0"                                    \
++   "baudrate=115200\0"                                    \
++   "bootenv=uEnv.txt\0"                                   \
++   "devicetree_image=zynq-zybo.dtb\0"                     \
++   "kernel_image=uImage\0"                                \
++   "ramdisk_image=rootfs.cpio.uboot\0"                    \
++   "fpga_image=system.bit\0"                              \
++   "sdboot=echo Booting from SD...; run fpgaboot;"        \
++   " fatload mmc 0 0x1000000 ${kernel_image}"             \
++   " && fatload mmc 0 0x2000000 ${ramdisk_image}"         \
++   " && fatload mmc 0 0x3000000 ${devicetree_image}"      \
++   " && bootm 0x1000000 0x2000000 0x3000000\0"            \
++   "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;\0"
++
+ #endif /* __CONFIG_ZYNQ_ZYBO_H */
+--
+2.5.5
+
diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig
new file mode 100644
index 0000000..e2c8841
--- /dev/null
+++ b/configs/zynq_zybo_defconfig
@@ -0,0 +1,25 @@
+BR2_arm=y
+BR2_cortex_a9=y
+BR2_ARM_ENABLE_NEON=y
+# BR2_COMPILER_PARANOID_UNSAFE_PATH is not set
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_6=y
+BR2_BINUTILS_VERSION_2_26_X=y
+BR2_GCC_VERSION_5_X=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
+BR2_LINUX_KERNEL=y
+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_CPIO=y
+BR2_TARGET_ROOTFS_CPIO_GZIP=y
+BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_PATCH="$(TOPDIR)/board/digilent/zybo/uboot"
+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
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] Add support for Digilent Zybo (Xilinx Zynq-7000)
  2016-05-22 15:50 [Buildroot] [PATCH] Add support for Digilent Zybo (Xilinx Zynq-7000) Sebastien Van Cauwenberghe
@ 2016-06-12 20:12 ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2016-06-12 20:12 UTC (permalink / raw
  To: buildroot

Hello,

Thanks a lot for this contribution! See below for a number of comments.

On Sun, 22 May 2016 17:50:56 +0200, Sebastien Van Cauwenberghe wrote:
> [PATCH] Add support for Digilent Zybo (Xilinx Zynq-7000)

Not need to repeat the title of the commit in the commit log. Also, the
commit title should rather be:

	configs: add defconfig for Digilent Zybo

> diff --git a/board/digilent/zybo/readme.txt b/board/digilent/zybo/readme.txt
> new file mode 100644
> index 0000000..f9ff939
> --- /dev/null
> +++ b/board/digilent/zybo/readme.txt
> @@ -0,0 +1,75 @@
> +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/ .
> +
> +Steps to create a working system for Zybo:
> +
> +1) make zynq_zybo_defconfig
> +2) make
> +3) copy files BOOT.BIN, u-boot-dtb.img, rootfs.cpio.uboot,
> +	uImage, zynq-zybo.dtb into your SD card

Please use genimage to generate a ready-to-use SD card image. You can
check many of the other board configurations in Buildroot that are
doing this.

Also, why do you use an initramfs for the rootfs rather than the more
traditional ext4 partition next to the FAT partition? This would be the
preferred method for the defconfig in Buildroot.

> +Resulting system
> +----------------
> +A FAT32 partition should be created at the beginning of the SD Card
> +and the following files should be installed:
> +	/BOOT.BIN
> +	/zynq-zybo.dtb
> +	/uImage
> +	/rootfs-cpio.uboot
> +	/u-boot-dtb.img
> +
> +
> +All needed files can be taken from output/images/
> +
> +BOOT.BIN, uImage and u-boot-dtb.img are direct copies of the same files
> +available on output/images/

All of this can be simplified once you generate a complete SD card
image with genimage.

> +There is a patch attached that redefines the U-Boot's environment
> +to work with Buildroot out-of-the-box.

Why do you patch the U-Boot built-in environment instead of providing
an uEnv.txt file?

> +The serial console is accessible on the host on /dev/ttyUSB1 at 115200 bauds.

Saying it's on /dev/ttyUSB1 on the host is wrong. It might be on your
machine, but it might be on ttyUSB0 on mine, or on ttyUSB2. There is no
point in giving this information, since you don't know.

> diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig
> new file mode 100644
> index 0000000..e2c8841
> --- /dev/null
> +++ b/configs/zynq_zybo_defconfig
> @@ -0,0 +1,25 @@
> +BR2_arm=y
> +BR2_cortex_a9=y
> +BR2_ARM_ENABLE_NEON=y
> +# BR2_COMPILER_PARANOID_UNSAFE_PATH is not set

Please leave this option to the default.

> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_6=y
> +BR2_BINUTILS_VERSION_2_26_X=y

Please leave this to the default.

> +BR2_GCC_VERSION_5_X=y

Ditto.

> +BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
> +BR2_LINUX_KERNEL=y

Please use a fixed kernel version.

> +BR2_LINUX_KERNEL_DEFCONFIG="multi_v7"
> +BR2_LINUX_KERNEL_UIMAGE=y
> +BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"

Can you try to use zImage instead, which is now the standard format on
ARM?

> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="zynq-zybo"
> +BR2_TARGET_ROOTFS_CPIO=y
> +BR2_TARGET_ROOTFS_CPIO_GZIP=y
> +BR2_TARGET_ROOTFS_CPIO_UIMAGE=y

As suggested above, what about using an ext4 filesystem instead?

> +BR2_TARGET_UBOOT=y

Please used a fixed version of U-Boot.

> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_PATCH="$(TOPDIR)/board/digilent/zybo/uboot"
> +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

Could you rework your patch according to the above suggestions? With
those suggestions taken into account, your patch could be merged in
Buildroot.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] Add support for Digilent Zybo (Xilinx Zynq-7000)
       [not found] <526113c1-b1c6-f391-4c9f-1e84b4f2d6d1@gmail.com>
@ 2016-06-27 10:09 ` Sebastien Van Cauwenberghe
  2016-06-27 11:39   ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastien Van Cauwenberghe @ 2016-06-27 10:09 UTC (permalink / raw
  To: buildroot

Hi Thomas, list,

I have some questions regarding the patch and how to make it more fit,
you'll find them below.

On 06/12/2016 10:12 PM, Thomas Petazzoni wrote:

>> +
>> +1) make zynq_zybo_defconfig
>> +2) make
>> +3) copy files BOOT.BIN, u-boot-dtb.img, rootfs.cpio.uboot,
>> +	uImage, zynq-zybo.dtb into your SD card
> 
> Please use genimage to generate a ready-to-use SD card image. You can
> check many of the other board configurations in Buildroot that are
> doing this.
> 
> Also, why do you use an initramfs for the rootfs rather than the more
> traditional ext4 partition next to the FAT partition? This would be the
> preferred method for the defconfig in Buildroot.
>
I will go to ext4 but (as a beginner), I'll first investigate what is wrong with ext4
not booting (maybe mmc/ext4 compiled as a module).

In this case, I guess a board specific defconfig should be used ?

>> +Resulting system
>> +----------------
>> +A FAT32 partition should be created at the beginning of the SD Card
>> +and the following files should be installed:
>> +	/BOOT.BIN
>> +	/zynq-zybo.dtb
>> +	/uImage
>> +	/rootfs-cpio.uboot
>> +	/u-boot-dtb.img
>> +
>> +
>> +All needed files can be taken from output/images/
>> +
>> +BOOT.BIN, uImage and u-boot-dtb.img are direct copies of the same files
>> +available on output/images/
> 
> All of this can be simplified once you generate a complete SD card
> image with genimage.
>
Done genimage is really easier to prepare sd afterwards :)

>> +There is a patch attached that redefines the U-Boot's environment
>> +to work with Buildroot out-of-the-box.
> 
> Why do you patch the U-Boot built-in environment instead of providing
> an uEnv.txt file?
> 
I saw loading uEnv.txt was a board specific stuff and should be subject to patch anyways
so I added the environment in there so I can use the board without sd card but with 
the flash memory.

>> +The serial console is accessible on the host on /dev/ttyUSB1 at 115200 bauds.
> 
> Saying it's on /dev/ttyUSB1 on the host is wrong. It might be on your
> machine, but it might be on ttyUSB0 on mine, or on ttyUSB2. There is no
> point in giving this information, since you don't know.
> 
Wrong phrasing, USB connection exposes two USB-to-serial interfaces (one for JTAG and one for UART), to get the console you need
to use the second one. I'll correct this explanation.

>> diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig
>> new file mode 100644
>> index 0000000..e2c8841
>> --- /dev/null
>> +++ b/configs/zynq_zybo_defconfig
>> @@ -0,0 +1,25 @@
>> +BR2_arm=y
>> +BR2_cortex_a9=y
>> +BR2_ARM_ENABLE_NEON=y
>> +# BR2_COMPILER_PARANOID_UNSAFE_PATH is not set
> 
> Please leave this option to the default.
> 
>> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_6=y
>> +BR2_BINUTILS_VERSION_2_26_X=y
> 
> Please leave this to the default.
> 
>> +BR2_GCC_VERSION_5_X=y
> 
> Ditto.
> 
>> +BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
>> +BR2_LINUX_KERNEL=y
> 
> Please use a fixed kernel version.
> 
You mean, not "Use the latest kernel" option but "Specific version" and provide a version number ?

>> +BR2_LINUX_KERNEL_DEFCONFIG="multi_v7"
>> +BR2_LINUX_KERNEL_UIMAGE=y
>> +BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"
> 
> Can you try to use zImage instead, which is now the standard format on
> ARM?
>
Apparently the uImage is all I can use easily with the Zynq, maybe with another
defconfig in U-boot for this board, I'll be able to use zImages ?
 
>> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
>> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="zynq-zybo"
>> +BR2_TARGET_ROOTFS_CPIO=y
>> +BR2_TARGET_ROOTFS_CPIO_GZIP=y
>> +BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
> 
> As suggested above, what about using an ext4 filesystem instead?
> 
>> +BR2_TARGET_UBOOT=y
> 
> Please used a fixed version of U-Boot.
> 
>> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
>> +BR2_TARGET_UBOOT_PATCH="$(TOPDIR)/board/digilent/zybo/uboot"
>> +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
> 
> Could you rework your patch according to the above suggestions? With
> those suggestions taken into account, your patch could be merged in
> Buildroot.

It's ongoing, thanks for your time ;)
S?bastien

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] Add support for Digilent Zybo (Xilinx Zynq-7000)
  2016-06-27 10:09 ` Sebastien Van Cauwenberghe
@ 2016-06-27 11:39   ` Thomas Petazzoni
  2016-06-27 15:29     ` Sebastien Van Cauwenberghe
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2016-06-27 11:39 UTC (permalink / raw
  To: buildroot

Hello Sebastien,

On Mon, 27 Jun 2016 12:09:16 +0200, Sebastien Van Cauwenberghe wrote:


> > Also, why do you use an initramfs for the rootfs rather than the more
> > traditional ext4 partition next to the FAT partition? This would be the
> > preferred method for the defconfig in Buildroot.
> >  
> I will go to ext4 but (as a beginner), I'll first investigate what is wrong with ext4
> not booting (maybe mmc/ext4 compiled as a module).
> 
> In this case, I guess a board specific defconfig should be used ?

You mean the defconfig for your platform does not have ext4 support
built-in? That would be weird.

But if that's really the case, don't add a board specific defconfig.
Instead, use the existing defconfig, and provide a defconfig fragment
(option BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES) to enable ext4/mmc as
needed.

> > All of this can be simplified once you generate a complete SD card
> > image with genimage.
> >  
> Done genimage is really easier to prepare sd afterwards :)

Indeed, that's the whole point of genimage!

> >> +There is a patch attached that redefines the U-Boot's environment
> >> +to work with Buildroot out-of-the-box.  
> > 
> > Why do you patch the U-Boot built-in environment instead of providing
> > an uEnv.txt file?
> >   
> I saw loading uEnv.txt was a board specific stuff and should be subject to patch anyways
> so I added the environment in there so I can use the board without sd card but with 
> the flash memory.

So the default environment is not already loading a uEnv.txt file or
executing some default script from the MMC ?

If that's the case, then indeed, you need to patch the default
environment.

> >> +The serial console is accessible on the host on /dev/ttyUSB1 at 115200 bauds.  
> > 
> > Saying it's on /dev/ttyUSB1 on the host is wrong. It might be on your
> > machine, but it might be on ttyUSB0 on mine, or on ttyUSB2. There is no
> > point in giving this information, since you don't know.
> >   
> Wrong phrasing, USB connection exposes two USB-to-serial interfaces (one for JTAG and one for UART), to get the console you need
> to use the second one. I'll correct this explanation.

OK.

> >> +BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
> >> +BR2_LINUX_KERNEL=y  
> > 
> > Please use a fixed kernel version.
> >   
> You mean, not "Use the latest kernel" option but "Specific version" and provide a version number ?

Yes.

> >> +BR2_LINUX_KERNEL_DEFCONFIG="multi_v7"
> >> +BR2_LINUX_KERNEL_UIMAGE=y
> >> +BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"  
> > 
> > Can you try to use zImage instead, which is now the standard format on
> > ARM?
> >  
> Apparently the uImage is all I can use easily with the Zynq, maybe with another
> defconfig in U-boot for this board, I'll be able to use zImages ?

Hum, you really don't have the "bootz" command in U-Boot? For a modern
U-Boot, this seems weird.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] Add support for Digilent Zybo (Xilinx Zynq-7000)
  2016-06-27 11:39   ` Thomas Petazzoni
@ 2016-06-27 15:29     ` Sebastien Van Cauwenberghe
  0 siblings, 0 replies; 6+ messages in thread
From: Sebastien Van Cauwenberghe @ 2016-06-27 15:29 UTC (permalink / raw
  To: buildroot

Hi Thomas, list,

>>> Also, why do you use an initramfs for the rootfs rather than the more
>>> traditional ext4 partition next to the FAT partition? This would be the
>>> preferred method for the defconfig in Buildroot.
>>>  
>> I will go to ext4 but (as a beginner), I'll first investigate what is wrong with ext4
>> not booting (maybe mmc/ext4 compiled as a module).
>>
Inadequate bootargs were used, now it works without changing defconfig.

>>>> +There is a patch attached that redefines the U-Boot's environment
>>>> +to work with Buildroot out-of-the-box.  
>>>
>>> Why do you patch the U-Boot built-in environment instead of providing
>>> an uEnv.txt file?
>>>
>> I saw loading uEnv.txt was a board specific stuff and should be subject to patch anyways
>> so I added the environment in there so I can use the board without sd card but with 
>> the flash memory.
> 
> So the default environment is not already loading a uEnv.txt file or
> executing some default script from the MMC ?
> 
> If that's the case, then indeed, you need to patch the default
> environment.
> 
I'll give a try to use uEnv.txt as it's also in the common Zynq configurations.
I just hope it's not loaded too late, otherwise, patch it will be :).

>>>
>>> Can you try to use zImage instead, which is now the standard format on
>>> ARM?
>>>  
>> Apparently the uImage is all I can use easily with the Zynq, maybe with another
>> defconfig in U-boot for this board, I'll be able to use zImages ?
> 
> Hum, you really don't have the "bootz" command in U-Boot? For a modern
> U-Boot, this seems weird.
It's in U-boot but not enabled in the defconfig for this board, so I don't know which
is better, change the defconfig U-boot or just live with the uImage instead of zImage.
Or maybe FIT image ? I just don't know what to use...

Thanks for your time
S?bastien

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-06-27 15:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-22 15:50 [Buildroot] [PATCH] Add support for Digilent Zybo (Xilinx Zynq-7000) Sebastien Van Cauwenberghe
2016-06-12 20:12 ` Thomas Petazzoni
     [not found] <526113c1-b1c6-f391-4c9f-1e84b4f2d6d1@gmail.com>
2016-06-27 10:09 ` Sebastien Van Cauwenberghe
2016-06-27 11:39   ` Thomas Petazzoni
2016-06-27 15:29     ` Sebastien Van Cauwenberghe
  -- strict thread matches above, loose matches on Subject: below --
2016-05-22 15:43 Sebastien Van Cauwenberghe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.