Skip to contentSkip to conversation

ARM: zynq: Start to use unified configurations

PATCH New Michal Simek 2 participants 4 messages Mar 9, 2020 – Apr 6, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover ARM: zynq: Start to use unified configurations

Hi,

over the time there are a lot of zynq configurations which are almost the same. It just increasing amount of time for building/testing/maintaining that's why this patch starts to use xilinx_zynq_virt_defconfig which is all in one configurations which can be used on all zynq board.
The series contains two patches.
The first which setup device tree name for SPL FIT image selection. The second which removes all xilinx/avnet/myirtech configurations with extending defconfig and OF_LIST which ensures that u-boot.img contains DTS files for all these boards.

Thanks,
Michal

Changes in v2:
- Add tags from Tom and Simon
- Fix azure/gitlab/travis builds - azure untested
- hooks updated by https://github.com/swarren/uboot-test-hooks/pull/29
- Update documentation

Michal Simek (2):
Makefile: Add environment variable DEVICE_TREE to header
ARM: zynq: Switch to single zynq configurations

 .azure-pipelines.yml                   |  6 +-
 .gitlab-ci.yml                         |  6 +-
 .travis.yml                            |  6 +-
 Makefile                               | 14 ++++-
 arch/arm/mach-zynq/spl.c               |  8 ++-
 configs/xilinx_zynq_virt_defconfig     | 19 +++++-
 configs/zynq_cc108_defconfig           | 61 ------------------
 configs/zynq_dlc20_rev1_0_defconfig    | 76 ----------------------
 configs/zynq_microzed_defconfig        | 66 -------------------
 configs/zynq_minized_defconfig         | 67 --------------------
 configs/zynq_picozed_defconfig         | 54 ----------------
 configs/zynq_z_turn_defconfig          | 67 --------------------
 configs/zynq_zc702_defconfig           | 83 ------------------------
 configs/zynq_zc706_defconfig           | 87 --------------------------
 configs/zynq_zc770_xm010_defconfig     | 61 ------------------
 configs/zynq_zc770_xm011_defconfig     | 48 --------------
 configs/zynq_zc770_xm011_x16_defconfig | 48 --------------
 configs/zynq_zc770_xm012_defconfig     | 50 ---------------
 configs/zynq_zc770_xm013_defconfig     | 53 ----------------
 configs/zynq_zed_defconfig             | 70 ---------------------
 configs/zynq_zybo_defconfig            | 69 --------------------
 configs/zynq_zybo_z7_defconfig         | 66 -------------------
 doc/board/xilinx/zynq.rst              |  3 +-
 23 files changed, 48 insertions(+), 1040 deletions(-)
 delete mode 100644 configs/zynq_cc108_defconfig
 delete mode 100644 configs/zynq_dlc20_rev1_0_defconfig
 delete mode 100644 configs/zynq_microzed_defconfig
 delete mode 100644 configs/zynq_minized_defconfig
 delete mode 100644 configs/zynq_picozed_defconfig
 delete mode 100644 configs/zynq_z_turn_defconfig
 delete mode 100644 configs/zynq_zc702_defconfig
 delete mode 100644 configs/zynq_zc706_defconfig
 delete mode 100644 configs/zynq_zc770_xm010_defconfig
 delete mode 100644 configs/zynq_zc770_xm011_defconfig
 delete mode 100644 configs/zynq_zc770_xm011_x16_defconfig
 delete mode 100644 configs/zynq_zc770_xm012_defconfig
 delete mode 100644 configs/zynq_zc770_xm013_defconfig
 delete mode 100644 configs/zynq_zed_defconfig
 delete mode 100644 configs/zynq_zybo_defconfig
 delete mode 100644 configs/zynq_zybo_z7_defconfig
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/2 Makefile: Add environment variable DEVICE_TREE to header

Users have option to overwrite default device tree (CONFIG_DEFAULT_DEVICE_TREE) via environment variable DEVICE_TREE.

Feature has been added long time ago by commit 74de8c9a1672 ("dts/Makefile: Build the user specified dts") for a little bit different reason.

But this variable can be also used for different purpose like choosing proper configuration from FIT image in SPL.
And this is the functionality I would like to use on Xilinx Zynq devices that current u-boot.img can be composed in the same way based on OF_LIST and different configuration is taken based on platform specific SPL. SPL requires low level ps7_init_gpl configuration that's why different boards require different SPL with fixed board_fit_config_name_match().

---

Changes in v2:
- Add tags from Tom and Simon

I have done it in this way but maybe there is any smarter way how this can be done. Also macro name can change if you want.

---
 Makefile                 | 14 +++++++++++++-
 arch/arm/mach-zynq/spl.c |  8 ++++++--
 2 files changed, 19 insertions(+), 3 deletions(-)
Makefile +13 -1
index 55aa90cf17fa..97166aefbf50 100644
@@ -483,6 +483,7 @@ endif
 version_h := include/generated/version_autogenerated.h
 timestamp_h := include/generated/timestamp_autogenerated.h
 defaultenv_h := include/generated/defaultenv_autogenerated.h
+dt_h := include/generated/dt.h
 
 no-dot-config-targets := clean clobber mrproper distclean \
 			 help %docs check% coccicheck \
@@ -1768,7 +1769,7 @@ endif
 # prepare2 creates a makefile if using a separate output directory
 prepare2: prepare3 outputmakefile cfg
 
-prepare1: prepare2 $(version_h) $(timestamp_h) \
+prepare1: prepare2 $(version_h) $(timestamp_h) $(dt_h) \
                    include/config/auto.conf
 ifeq ($(wildcard $(LDSCRIPT)),)
 	@echo >&2 "  Could not find linker script."
@@ -1834,12 +1835,23 @@ define filechk_defaultenv.h
 	 xxd -i ; echo ", 0x00" ; )
 endef
 
+define filechk_dt.h
+	(if test -n "$${DEVICE_TREE}"; then \
+		echo \#define DEVICE_TREE \"$(DEVICE_TREE)\"; \
+	else \
+		echo \#define DEVICE_TREE CONFIG_DEFAULT_DEVICE_TREE; \
+	fi)
+endef
+
 $(version_h): include/config/uboot.release FORCE
 	$(call filechk,version.h)
 
 $(timestamp_h): $(srctree)/Makefile FORCE
 	$(call filechk,timestamp.h)
 
+$(dt_h): $(srctree)/Makefile FORCE
+	$(call filechk,dt.h)
+
 $(defaultenv_h): $(CONFIG_DEFAULT_ENV_FILE:"%"=%) FORCE
 	$(call filechk,defaultenv.h)
 
arch/arm/mach-zynq/spl.c +6 -2
index 96ba90fb7a76..e89e46c1038d 100644
@@ -6,6 +6,7 @@
 #include <debug_uart.h>
 #include <hang.h>
 #include <spl.h>
+#include <generated/dt.h>
 
 #include <asm/io.h>
 #include <asm/spl.h>
@@ -89,8 +90,11 @@ void spl_board_prepare_for_boot(void)
 int board_fit_config_name_match(const char *name)
 {
 	/* Just empty function now - can't decide what to choose */
-	debug("%s: %s\n", __func__, name);
+	debug("%s: Check %s, default %s\n", __func__, name, DEVICE_TREE);
 
-	return 0;
+	if (!strcmp(name, DEVICE_TREE))
+		return 0;
+
+	return -1;
 }
 #endif
Signature · 1 line
2.25.1
#2 lore raw

PATCH v2 2/2 ARM: zynq: Switch to single zynq configurations

In reply to Michal Simek

There are a lot of zynq configurations which can be merged together and use only one for all. The similar change has been done for ZynqMP by commit be1b6c32d940 ("arm64: zynqmp: Use zynqmp_virt platform")

Build SPL with u-boot.img for zc706 like this.
export DEVICE_TREE=zynq-zc706 && make xilinx_zynq_virt_defconfig && make -j8 u-boot.img is generic for all boards.

Tested on Zybo, zc702, zc706, zc770-xm011-x16, cc108 and microzed.

Update zynq platform

---

Changes in v2:
- Fix azure/gitlab/travis builds - azure untested
- hooks updated by https://github.com/swarren/uboot-test-hooks/pull/29
- Update documentation

 .azure-pipelines.yml                   |  6 +-
 .gitlab-ci.yml                         |  6 +-
 .travis.yml                            |  6 +-
 configs/xilinx_zynq_virt_defconfig     | 19 +++++-
 configs/zynq_cc108_defconfig           | 61 ------------------
 configs/zynq_dlc20_rev1_0_defconfig    | 76 ----------------------
 configs/zynq_microzed_defconfig        | 66 -------------------
 configs/zynq_minized_defconfig         | 67 --------------------
 configs/zynq_picozed_defconfig         | 54 ----------------
 configs/zynq_z_turn_defconfig          | 67 --------------------
 configs/zynq_zc702_defconfig           | 83 ------------------------
 configs/zynq_zc706_defconfig           | 87 --------------------------
 configs/zynq_zc770_xm010_defconfig     | 61 ------------------
 configs/zynq_zc770_xm011_defconfig     | 48 --------------
 configs/zynq_zc770_xm011_x16_defconfig | 48 --------------
 configs/zynq_zc770_xm012_defconfig     | 50 ---------------
 configs/zynq_zc770_xm013_defconfig     | 53 ----------------
 configs/zynq_zed_defconfig             | 70 ---------------------
 configs/zynq_zybo_defconfig            | 69 --------------------
 configs/zynq_zybo_z7_defconfig         | 66 -------------------
 doc/board/xilinx/zynq.rst              |  3 +-
 21 files changed, 29 insertions(+), 1037 deletions(-)
 delete mode 100644 configs/zynq_cc108_defconfig
 delete mode 100644 configs/zynq_dlc20_rev1_0_defconfig
 delete mode 100644 configs/zynq_microzed_defconfig
 delete mode 100644 configs/zynq_minized_defconfig
 delete mode 100644 configs/zynq_picozed_defconfig
 delete mode 100644 configs/zynq_z_turn_defconfig
 delete mode 100644 configs/zynq_zc702_defconfig
 delete mode 100644 configs/zynq_zc706_defconfig
 delete mode 100644 configs/zynq_zc770_xm010_defconfig
 delete mode 100644 configs/zynq_zc770_xm011_defconfig
 delete mode 100644 configs/zynq_zc770_xm011_x16_defconfig
 delete mode 100644 configs/zynq_zc770_xm012_defconfig
 delete mode 100644 configs/zynq_zc770_xm013_defconfig
 delete mode 100644 configs/zynq_zed_defconfig
 delete mode 100644 configs/zynq_zybo_defconfig
 delete mode 100644 configs/zynq_zybo_z7_defconfig
.azure-pipelines.yml +3 -3
index 86480581a24e..2ec8009bfbc2 100644
@@ -227,11 +227,11 @@ jobs:
           TEST_PY_BD: "qemu-x86_64"
           TEST_PY_TEST_SPEC: "not sleep"
           BUILDMAN: "^qemu-x86_64$"
-        zynq_zc702:
-          TEST_PY_BD: "zynq_zc702"
+        xilinx_zynq_virt:
+          TEST_PY_BD: "xilinx_zynq_virt"
           TEST_PY_ID: "--id qemu"
           TEST_PY_TEST_SPEC: "not sleep"
-          BUILDMAN: "^zynq_zc702$"
+          BUILDMAN: "^xilinx_zynq_virt$"
         xilinx_versal_virt:
           TEST_PY_BD: "xilinx_versal_virt"
           TEST_PY_ID: "--id qemu"
.gitlab-ci.yml +3 -3
index 55943bb3a245..89033587f240 100644
@@ -320,13 +320,13 @@ qemu-x86_64 test.py:
     BUILDMAN: "^qemu-x86_64$"
   <<: *buildman_and_testpy_dfn
 
-zynq_zc702 test.py:
+xilinx_zynq_virt test.py:
   tags: [ 'all' ]
   variables:
-    TEST_PY_BD: "zynq_zc702"
+    TEST_PY_BD: "xilinx_zynq_virt"
     TEST_PY_TEST_SPEC: "not sleep"
     TEST_PY_ID: "--id qemu"
-    BUILDMAN: "^zynq_zc702$"
+    BUILDMAN: "^xilinx_zynq_virt$"
   <<: *buildman_and_testpy_dfn
 
 xilinx_versal_virt test.py:
.travis.yml +3 -3
index 7ab855acb212..7b239d68d7c7 100644
@@ -504,13 +504,13 @@ matrix:
           BUILDMAN="^qemu-x86_64$"
           TOOLCHAIN="i386"
           BUILD_ROM="yes"
-    - name: "test/py zynq_zc702"
+    - name: "test/py xilinx_zynq_virt"
       env:
-        - TEST_PY_BD="zynq_zc702"
+        - TEST_PY_BD="xilinx_zynq_virt"
           TEST_PY_TEST_SPEC="not sleep"
           QEMU_TARGET="arm-softmmu"
           TEST_PY_ID="--id qemu"
-          BUILDMAN="^zynq_zc702$"
+          BUILDMAN="^xilinx_zynq_virt$"
     - name: "test/py xilinx_versal_virt"
       env:
         - TEST_PY_BD="xilinx_versal_virt"
configs/xilinx_zynq_virt_defconfig +18 -1
index ece619f239b2..2e9f3a0f7508 100644
@@ -11,13 +11,17 @@ CONFIG_SYS_LDSCRIPT="arch/arm/mach-zynq/u-boot.lds"
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_PRINT=y
+CONFIG_SPL_LOAD_FIT=y
 CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_USE_PREBOOT=y
 CONFIG_SPL_STACK_R=y
+CONFIG_SPL_FPGA_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x100000
 # CONFIG_BOOTM_NETBSD is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_DFU=y
@@ -28,12 +32,14 @@ CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND_LOCK_UNLOCK=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_OF_BOARD=y
+CONFIG_DEFAULT_DEVICE_TREE="zynq-zc706"
+CONFIG_OF_LIST="zynq-zc702 zynq-zc706 zynq-zc770-xm010 zynq-zc770-xm011 zynq-zc770-xm011-x16 zynq-zc770-xm012 zynq-zc770-xm013 zynq-cc108 zynq-microzed zynq-minized zynq-picozed zynq-zed zynq-zturn zynq-zybo zynq-zybo-z7 zynq-dlc20-rev1.0"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
@@ -52,11 +58,19 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
+CONFIG_MTD=y
+CONFIG_MTD_NOR_FLASH=y
+CONFIG_FLASH_CFI_DRIVER=y
+CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
+CONFIG_SYS_FLASH_CFI=y
+CONFIG_MTD_RAW_NAND=y
+CONFIG_NAND_ZYNQ=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_SPI_FLASH_SST=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_PHY_MARVELL=y
 CONFIG_PHY_REALTEK=y
@@ -64,6 +78,7 @@ CONFIG_PHY_XILINX=y
 CONFIG_MII=y
 CONFIG_ZYNQ_GEM=y
 CONFIG_ZYNQ_SERIAL=y
+CONFIG_ZYNQ_SPI=y
 CONFIG_ZYNQ_QSPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
@@ -76,3 +91,5 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_THOR=y
+CONFIG_DISPLAY=y
+CONFIG_SPL_GZIP=y
configs/zynq_cc108_defconfig deleted +0 -61

61 lines not on this page · raw message

configs/zynq_dlc20_rev1_0_defconfig deleted +0 -76

76 lines not on this page · raw message

configs/zynq_microzed_defconfig deleted +0 -66

66 lines not on this page · raw message

configs/zynq_minized_defconfig deleted +0 -67

67 lines not on this page · raw message

configs/zynq_picozed_defconfig deleted +0 -54

54 lines not on this page · raw message

configs/zynq_z_turn_defconfig deleted +0 -67

67 lines not on this page · raw message

configs/zynq_zc702_defconfig deleted +0 -83

83 lines not on this page · raw message

configs/zynq_zc706_defconfig deleted +0 -87

87 lines not on this page · raw message

configs/zynq_zc770_xm010_defconfig deleted +0 -61

61 lines not on this page · raw message

configs/zynq_zc770_xm011_defconfig deleted +0 -48

48 lines not on this page · raw message

configs/zynq_zc770_xm011_x16_defconfig deleted +0 -48

48 lines not on this page · raw message

configs/zynq_zc770_xm012_defconfig deleted +0 -50

50 lines not on this page · raw message

configs/zynq_zc770_xm013_defconfig deleted +0 -53

53 lines not on this page · raw message

configs/zynq_zed_defconfig deleted +0 -70

70 lines not on this page · raw message

configs/zynq_zybo_defconfig deleted +0 -69

69 lines not on this page · raw message

configs/zynq_zybo_z7_defconfig deleted +0 -66

66 lines not on this page · raw message

doc/board/xilinx/zynq.rst +2 -1
index 3f0513ed362a..6a09df1d15f8 100644
@@ -32,7 +32,8 @@ Building
 
 configure and build for zc702 board::
 
-   $ make zynq_zc702_config
+   $ export DEVICE_TREE=zynq-zc702
+   $ make xilinx_zynq_virt_defconfig
    $ make
 
 Bootmode
Signature · 1 line
2.25.1
#3 lore raw

v2 cover ARM: zynq: Start to use unified configurations

In reply to Michal Simek

po 9. 3. 2020 v 14:29 odes?latel Michal Simek <[email protected]> napsal:

Quoted 67 lines

Hi,

over the time there are a lot of zynq configurations which are almost the same. It just increasing amount of time for building/testing/maintaining that's why this patch starts to use xilinx_zynq_virt_defconfig which is all in one configurations which can be used on all zynq board.
The series contains two patches.
The first which setup device tree name for SPL FIT image selection. The second which removes all xilinx/avnet/myirtech configurations with extending defconfig and OF_LIST which ensures that u-boot.img contains DTS files for all these boards.

Thanks,
Michal

Changes in v2:
- Add tags from Tom and Simon
- Fix azure/gitlab/travis builds - azure untested
- hooks updated by https://github.com/swarren/uboot-test-hooks/pull/29
- Update documentation

Michal Simek (2):
Makefile: Add environment variable DEVICE_TREE to header
ARM: zynq: Switch to single zynq configurations

 .azure-pipelines.yml                   |  6 +-
 .gitlab-ci.yml                         |  6 +-
 .travis.yml                            |  6 +-
 Makefile                               | 14 ++++-
 arch/arm/mach-zynq/spl.c               |  8 ++-
 configs/xilinx_zynq_virt_defconfig     | 19 +++++-
 configs/zynq_cc108_defconfig           | 61 ------------------
 configs/zynq_dlc20_rev1_0_defconfig    | 76 ----------------------
 configs/zynq_microzed_defconfig        | 66 -------------------
 configs/zynq_minized_defconfig         | 67 --------------------
 configs/zynq_picozed_defconfig         | 54 ----------------
 configs/zynq_z_turn_defconfig          | 67 --------------------
 configs/zynq_zc702_defconfig           | 83 ------------------------
 configs/zynq_zc706_defconfig           | 87 --------------------------
 configs/zynq_zc770_xm010_defconfig     | 61 ------------------
 configs/zynq_zc770_xm011_defconfig     | 48 --------------
 configs/zynq_zc770_xm011_x16_defconfig | 48 --------------
 configs/zynq_zc770_xm012_defconfig     | 50 ---------------
 configs/zynq_zc770_xm013_defconfig     | 53 ----------------
 configs/zynq_zed_defconfig             | 70 ---------------------
 configs/zynq_zybo_defconfig            | 69 --------------------
 configs/zynq_zybo_z7_defconfig         | 66 -------------------
 doc/board/xilinx/zynq.rst              |  3 +-
 23 files changed, 48 insertions(+), 1040 deletions(-)
 delete mode 100644 configs/zynq_cc108_defconfig
 delete mode 100644 configs/zynq_dlc20_rev1_0_defconfig
 delete mode 100644 configs/zynq_microzed_defconfig
 delete mode 100644 configs/zynq_minized_defconfig
 delete mode 100644 configs/zynq_picozed_defconfig
 delete mode 100644 configs/zynq_z_turn_defconfig
 delete mode 100644 configs/zynq_zc702_defconfig
 delete mode 100644 configs/zynq_zc706_defconfig
 delete mode 100644 configs/zynq_zc770_xm010_defconfig
 delete mode 100644 configs/zynq_zc770_xm011_defconfig
 delete mode 100644 configs/zynq_zc770_xm011_x16_defconfig
 delete mode 100644 configs/zynq_zc770_xm012_defconfig
 delete mode 100644 configs/zynq_zc770_xm013_defconfig
 delete mode 100644 configs/zynq_zed_defconfig
 delete mode 100644 configs/zynq_zybo_defconfig
 delete mode 100644 configs/zynq_zybo_z7_defconfig
Quoted 3 lines

--
2.25.1

Applied both.
M

Signature · 5 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs