From 7cf70397b8eeb0d3633ad46da3218f0cf6010a8e Mon Sep 17 00:00:00 2001 From: Robin Heinemann Date: Fri, 21 Aug 2020 19:49:38 +0200 Subject: [PATCH] [u-boot, linux] update linux to 5.8.1 and u-boot to v2020.07, closes #171 --- boot/sdboot.cmd | 2 + makefiles/host/bootfs.mk | 14 ++- makefiles/host/config/beta.mk | 2 +- makefiles/host/config/micro.mk | 2 +- ...-phy-for-zynq-style-USB-vbus-control.patch | 15 ++- patches/u-boot/microzed_changes.patch | 23 ---- patches/u-boot/z_turn_lite_support.patch | 100 +++++------------- 7 files changed, 46 insertions(+), 112 deletions(-) create mode 100644 boot/sdboot.cmd delete mode 100644 patches/u-boot/microzed_changes.patch diff --git a/boot/sdboot.cmd b/boot/sdboot.cmd new file mode 100644 index 00000000..56e50206 --- /dev/null +++ b/boot/sdboot.cmd @@ -0,0 +1,2 @@ +load mmc 0 0x2000000 uEnv.txt && env import -t 0x2000000 $filesize && boot + diff --git a/makefiles/host/bootfs.mk b/makefiles/host/bootfs.mk index 04053437..d4f0c0f6 100644 --- a/makefiles/host/bootfs.mk +++ b/makefiles/host/bootfs.mk @@ -1,13 +1,13 @@ ARCH = arm -LINUX_VERSION = v5.2.14 +LINUX_VERSION = v5.8.1 LINUX_SOURCE = build/linux-$(LINUX_VERSION).git -UBOOT_VERSION = v2019.07 +UBOOT_VERSION = v2020.07 UBOOT_SOURCE = build/u-boot-$(UBOOT_VERSION).git build/boot.fs/.install_stamp: $(LINUX_SOURCE)/arch/arm/boot/zImage $(UBOOT_SOURCE)/u-boot.img $(UBOOT_SOURCE)/spl/boot.bin build/boot.fs/devicetree.dtb \ - boot/axiom-$(DEVICE)/uEnv.txt build/boot.fs/devicetree.dts + boot/axiom-$(DEVICE)/uEnv.txt build/boot.fs/devicetree.dts build/boot.fs/boot.scr mkdir -p $(@D) ifeq ($(DEVICE),micro) @@ -51,6 +51,7 @@ $(LINUX_SOURCE)/arch/arm/boot/zImage: boot/kernel.config $(LINUX_SOURCE) # u-boot U_BOOT_MAKE = $(MAKE) -C $(UBOOT_SOURCE) CROSS_COMPILE=$(CROSS) ARCH=$(ARCH) U_BOOT_PATCHES = $(wildcard patches/u-boot/*.patch) +$(UBOOT_SOURCE)/.config: export DEVICE_TREE = $(U_BOOT_DEVICE_TREE) $(UBOOT_SOURCE)/.config: $(U_BOOT_PATCHES) @mkdir -p $(@D) rm -rf $(@D) @@ -61,17 +62,22 @@ $(UBOOT_SOURCE)/.config: $(U_BOOT_PATCHES) touch $(@D)/.scmversion # configure u-boot - +$(U_BOOT_MAKE) $(U_BOOT_DEFCONFIG) + +$(U_BOOT_MAKE) xilinx_zynq_virt_defconfig touch $@ +$(UBOOT_SOURCE)/u-boot.img: export DEVICE_TREE = $(U_BOOT_DEVICE_TREE) $(UBOOT_SOURCE)/u-boot.img: $(UBOOT_SOURCE)/.config +$(U_BOOT_MAKE) u-boot.img touch $@ +$(UBOOT_SOURCE)/spl/boot.bin: export DEVICE_TREE = $(U_BOOT_DEVICE_TREE) $(UBOOT_SOURCE)/spl/boot.bin: $(UBOOT_SOURCE)/.config $(UBOOT_SOURCE)/u-boot.img +$(U_BOOT_MAKE) spl/boot.bin touch $@ +build/boot.fs/boot.scr: boot/sdboot.cmd $(UBOOT_SOURCE)/spl/boot.bin + ./$(UBOOT_SOURCE)/tools/mkimage -c none -A arm -T script -d $< $@ + build/boot.fs/devicetree.dtb: boot/axiom-$(DEVICE)/devicetree.dts @mkdir -p $(@D) dtc -@ -I dts -O dtb -o $@ $< diff --git a/makefiles/host/config/beta.mk b/makefiles/host/config/beta.mk index 40fadcc7..565fa52a 100644 --- a/makefiles/host/config/beta.mk +++ b/makefiles/host/config/beta.mk @@ -1 +1 @@ -U_BOOT_DEFCONFIG = zynq_microzed_defconfig +U_BOOT_DEVICE_TREE = zynq-microzed diff --git a/makefiles/host/config/micro.mk b/makefiles/host/config/micro.mk index fb3e7efe..f0fb9f6b 100644 --- a/makefiles/host/config/micro.mk +++ b/makefiles/host/config/micro.mk @@ -1 +1 @@ -U_BOOT_DEFCONFIG = zynq_z_turn_lite_defconfig +U_BOOT_DEVICE_TREE = zynq-z-turn-lite diff --git a/patches/linux/add-ulpi-phy-for-zynq-style-USB-vbus-control.patch b/patches/linux/add-ulpi-phy-for-zynq-style-USB-vbus-control.patch index 12f2cb31..35e8320a 100644 --- a/patches/linux/add-ulpi-phy-for-zynq-style-USB-vbus-control.patch +++ b/patches/linux/add-ulpi-phy-for-zynq-style-USB-vbus-control.patch @@ -99,18 +99,15 @@ index a43c49369..0f7f6eb16 100644 struct usb_phy * otg_ulpi_create(struct usb_phy_io_ops *ops, unsigned int flags) -@@ -262,6 +293,7 @@ otg_ulpi_create(struct usb_phy_io_ops *ops, - phy->io_ops = ops; - phy->otg = otg; - phy->init = ulpi_init; +@@ -262,3 +293,4 @@ static void otg_ulpi_init(struct usb_phy *phy, struct usb_otg *otg, + phy->set_vbus = usbphy_set_vbus; otg->usb_phy = phy; otg->set_host = ulpi_set_host; -@@ -271,3 +303,70 @@ otg_ulpi_create(struct usb_phy_io_ops *ops, +@@ -271,2 +303,70 @@ devm_otg_ulpi_create(struct device *dev, } - EXPORT_SYMBOL_GPL(otg_ulpi_create); - + EXPORT_SYMBOL_GPL(devm_otg_ulpi_create); ++ +static int ulpi_phy_probe(struct platform_device *pdev) +{ + struct device_node *np = pdev->dev.of_node; @@ -183,11 +180,11 @@ index 63758c399..be9aaf54e 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h @@ -60,7 +60,8 @@ struct ci_hdrc_platform_data { - #define CI_HDRC_OVERRIDE_RX_BURST BIT(11) #define CI_HDRC_OVERRIDE_PHY_CONTROL BIT(12) /* Glue layer manages phy */ #define CI_HDRC_REQUIRES_ALIGNED_DMA BIT(13) #define CI_HDRC_IMX_IS_HSIC BIT(14) -+#define CI_HDRC_PHY_VBUS_CONTROL BIT(15) + #define CI_HDRC_PMQOS BIT(15) ++#define CI_HDRC_PHY_VBUS_CONTROL BIT(16) enum usb_dr_mode dr_mode; #define CI_HDRC_CONTROLLER_RESET_EVENT 0 #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 diff --git a/patches/u-boot/microzed_changes.patch b/patches/u-boot/microzed_changes.patch deleted file mode 100644 index 4c3e59eb..00000000 --- a/patches/u-boot/microzed_changes.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/configs/zynq_microzed_defconfig b/configs/zynq_microzed_defconfig -index 0af0f233dd..549e36835b 100644 ---- a/configs/zynq_microzed_defconfig -+++ b/configs/zynq_microzed_defconfig -@@ -8,8 +8,9 @@ CONFIG_FIT=y - CONFIG_FIT_SIGNATURE=y - CONFIG_FIT_VERBOSE=y - CONFIG_IMAGE_FORMAT_LEGACY=y -+CONFIG_BOOTDELAY=0 - CONFIG_SPL_STACK_R=y --CONFIG_SPL_OS_BOOT=y -+CONFIG_SPL_PAYLOAD="u-boot.img" - CONFIG_SPL_SPI_LOAD=y - CONFIG_SYS_PROMPT="Zynq> " - CONFIG_CMD_THOR_DOWNLOAD=y -@@ -28,7 +29,6 @@ CONFIG_CMD_TFTPPUT=y - CONFIG_CMD_CACHE=y - CONFIG_CMD_EXT4_WRITE=y - CONFIG_DEFAULT_DEVICE_TREE="zynq-microzed" --CONFIG_ENV_IS_IN_SPI_FLASH=y - CONFIG_NET_RANDOM_ETHADDR=y - CONFIG_SPL_DM_SEQ_ALIAS=y - CONFIG_DFU_MMC=y diff --git a/patches/u-boot/z_turn_lite_support.patch b/patches/u-boot/z_turn_lite_support.patch index 431dc019..b346dd4a 100644 --- a/patches/u-boot/z_turn_lite_support.patch +++ b/patches/u-boot/z_turn_lite_support.patch @@ -1,8 +1,8 @@ diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile -index 0e2ffdb87f..28edad53c8 100644 +index 9900b442..5018ac9d 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -185,6 +185,7 @@ dtb-$(CONFIG_ARCH_ZYNQ) += \ +@@ -248,6 +248,7 @@ dtb-$(CONFIG_ARCH_ZYNQ) += \ zynq-cse-qspi-single.dtb \ zynq-dlc20-rev1.0.dtb \ zynq-microzed.dtb \ @@ -12,7 +12,7 @@ index 0e2ffdb87f..28edad53c8 100644 zynq-syzygy-hub.dtb \ diff --git a/arch/arm/dts/zynq-z-turn-lite.dts b/arch/arm/dts/zynq-z-turn-lite.dts new file mode 100644 -index 0000000000..52dac527e6 +index 00000000..52dac527 --- /dev/null +++ b/arch/arm/dts/zynq-z-turn-lite.dts @@ -0,0 +1,71 @@ @@ -89,7 +89,7 @@ index 0000000000..52dac527e6 +}; diff --git a/board/xilinx/zynq/zynq-z-turn-lite/ps7_init_gpl.c b/board/xilinx/zynq/zynq-z-turn-lite/ps7_init_gpl.c new file mode 100644 -index 0000000000..8721b4f5bb +index 00000000..8721b4f5 --- /dev/null +++ b/board/xilinx/zynq/zynq-z-turn-lite/ps7_init_gpl.c @@ -0,0 +1,12120 @@ @@ -12213,74 +12213,26 @@ index 0000000000..8721b4f5bb + + + -diff --git a/configs/zynq_z_turn_lite_defconfig b/configs/zynq_z_turn_lite_defconfig -new file mode 100644 -index 0000000000..1ba547527f ---- /dev/null -+++ b/configs/zynq_z_turn_lite_defconfig -@@ -0,0 +1,65 @@ -+CONFIG_ARM=y -+CONFIG_ARCH_ZYNQ=y -+CONFIG_SYS_TEXT_BASE=0x4000000 -+CONFIG_SPL=y -+CONFIG_SPL_STACK_R_ADDR=0x200000 -+CONFIG_DISTRO_DEFAULTS=y -+CONFIG_FIT=y -+CONFIG_FIT_SIGNATURE=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_IMAGE_FORMAT_LEGACY=y -+CONFIG_BOOTDELAY=0 -+CONFIG_SPL_STACK_R=y +diff --git a/configs/xilinx_zynq_virt_defconfig b/configs/xilinx_zynq_virt_defconfig +index 5da7440a..e2db1d49 100644 +--- a/configs/xilinx_zynq_virt_defconfig ++++ b/configs/xilinx_zynq_virt_defconfig +@@ -18,7 +18,7 @@ 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_PAYLOAD="u-boot.img" -+CONFIG_SPL_SPI_LOAD=y -+CONFIG_SYS_PROMPT="Zynq> " -+CONFIG_CMD_THOR_DOWNLOAD=y -+CONFIG_CMD_DFU=y -+# CONFIG_CMD_FLASH is not set -+CONFIG_CMD_FPGA_LOADBP=y -+CONFIG_CMD_FPGA_LOADFS=y -+CONFIG_CMD_FPGA_LOADMK=y -+CONFIG_CMD_FPGA_LOADP=y -+CONFIG_CMD_GPIO=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_SF=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_DEFAULT_DEVICE_TREE="zynq-z-turn-lite" -+CONFIG_NET_RANDOM_ETHADDR=y -+CONFIG_SPL_DM_SEQ_ALIAS=y -+CONFIG_DFU_MMC=y -+CONFIG_DFU_RAM=y -+CONFIG_FPGA_XILINX=y -+CONFIG_FPGA_ZYNQPL=y -+CONFIG_DM_GPIO=y -+CONFIG_LED=y -+CONFIG_LED_GPIO=y -+CONFIG_MMC_SDHCI=y -+CONFIG_MMC_SDHCI_ZYNQ=y -+CONFIG_SPI_FLASH=y -+CONFIG_SF_DEFAULT_SPEED=30000000 -+CONFIG_SPI_FLASH_SPANSION=y -+CONFIG_SPI_FLASH_STMICRO=y -+CONFIG_SPI_FLASH_WINBOND=y -+CONFIG_PHY_MARVELL=y -+CONFIG_PHY_REALTEK=y -+CONFIG_PHY_XILINX=y -+CONFIG_MII=y -+CONFIG_ZYNQ_GEM=y -+CONFIG_ZYNQ_SERIAL=y -+CONFIG_ZYNQ_QSPI=y -+CONFIG_USB=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_ULPI_VIEWPORT=y -+CONFIG_USB_ULPI=y -+CONFIG_USB_GADGET=y -+CONFIG_USB_GADGET_MANUFACTURER="Xilinx" -+CONFIG_USB_GADGET_VENDOR_NUM=0x03FD -+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300 -+CONFIG_CI_UDC=y -+CONFIG_USB_GADGET_DOWNLOAD=y -+CONFIG_USB_FUNCTION_THOR=y + CONFIG_SPL_SPI_LOAD=y + # CONFIG_BOOTM_NETBSD is not set + CONFIG_CMD_IMLS=y +@@ -46,8 +46,7 @@ CONFIG_CMD_MTDPARTS_SPREAD=y + CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES=y + CONFIG_CMD_UBI=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_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 zynq-z-turn-lite" + CONFIG_SYS_RELOC_GD_ENV_ADDR=y + CONFIG_NET_RANDOM_ETHADDR=y + CONFIG_NETCONSOLE=y