From 716ca530e1c4515d8683c9d5be3d56b301758b66 Mon Sep 17 00:00:00 2001 From: James <> Date: Wed, 4 Nov 2015 11:49:21 +0000 Subject: trunk-47381 --- package/boot/uboot-imx6/Makefile | 132 +++++++++++++++++++++ .../patches/100-wandboard-enable-fit.patch | 10 ++ .../patches/110-wandboard-owrt-env.patch | 89 ++++++++++++++ 3 files changed, 231 insertions(+) create mode 100644 package/boot/uboot-imx6/Makefile create mode 100644 package/boot/uboot-imx6/patches/100-wandboard-enable-fit.patch create mode 100644 package/boot/uboot-imx6/patches/110-wandboard-owrt-env.patch (limited to 'package/boot/uboot-imx6') diff --git a/package/boot/uboot-imx6/Makefile b/package/boot/uboot-imx6/Makefile new file mode 100644 index 0000000..7074da9 --- /dev/null +++ b/package/boot/uboot-imx6/Makefile @@ -0,0 +1,132 @@ +# +# Copyright (C) 2013-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=u-boot +PKG_VERSION:=2014.04 +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://mirror2.openwrt.org/sources \ + ftp://ftp.denx.de/pub/u-boot +PKG_MD5SUM:=6d2116d1385a66e9a59742caa9d62a54 + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define uboot/Default + TITLE:= + CONFIG:= + IMAGE:= +endef + +define uboot/nitrogen6dl + TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 1GB board +endef + +define uboot/nitrogen6dl2g + TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 2GB board +endef + +define uboot/nitrogen6q + TITLE:=U-Boot for Nitrogen6x/SABRE Lite (MX6Q/1GB) +endef + +define uboot/nitrogen6q2g + TITLE:=U-Boot for Nitrogen6x i.MX6Quad 2GB board +endef + +define uboot/nitrogen6s + TITLE:=U-Boot for Nitrogen6x i.MX6Solo 512MB board +endef + +define uboot/nitrogen6s1g + TITLE:=U-Boot for Nitrogen6x i.MX6Solo 1GB board +endef + +define uboot/wandboard_dl + TITLE:=U-Boot for the Wandboard Dual Lite +endef + +define uboot/wandboard_quad + TITLE:=U-Boot for the Wandboard Quad +endef + +define uboot/wandboard_solo + TITLE:=U-Boot for the Wandboard Solo +endef + +UBOOTS := \ + nitrogen6dl \ + nitrogen6dl2g \ + nitrogen6q \ + nitrogen6q2g \ + nitrogen6s \ + nitrogen6s1g \ + wandboard_dl \ + wandboard_quad \ + wandboard_solo + +define Package/uboot/template +define Package/uboot-imx6-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_imx6 + TITLE:=$(2) + URL:=http://www.denx.de/wiki/U-Boot + VARIANT:=$(1) + MAINTAINER:=Luka Perkov +endef +endef + +define BuildUBootPackage + $(eval $(uboot/Default)) + $(eval $(uboot/$(1))) + $(call Package/uboot/template,$(1),$(TITLE)) +endef + +ifdef BUILD_VARIANT +$(eval $(call uboot/$(BUILD_VARIANT))) +UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) +UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) +endif + +define Build/Configure + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + $(UBOOT_CONFIG)_config +endef + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) +endef + +define Package/uboot/install/default + $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) + $(CP) \ + $(PKG_BUILD_DIR)/u-boot.imx \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.imx +endef + +define Package/uboot/install/template +define Package/uboot-imx6-$(1)/install + $(call Package/uboot/install/default,$(2)) +endef +endef + +$(foreach u,$(UBOOTS), \ + $(eval $(call Package/uboot/install/template,$(u),$(u))) \ +) + +$(foreach u,$(UBOOTS), \ + $(eval $(call BuildUBootPackage,$(u))) \ + $(eval $(call BuildPackage,uboot-imx6-$(u))) \ +) diff --git a/package/boot/uboot-imx6/patches/100-wandboard-enable-fit.patch b/package/boot/uboot-imx6/patches/100-wandboard-enable-fit.patch new file mode 100644 index 0000000..894ccf0 --- /dev/null +++ b/package/boot/uboot-imx6/patches/100-wandboard-enable-fit.patch @@ -0,0 +1,10 @@ +--- a/include/configs/wandboard.h ++++ b/include/configs/wandboard.h +@@ -238,4 +238,7 @@ + #define CONFIG_CMD_CACHE + #endif + ++#define CONFIG_FIT ++#define CONFIG_FIT_VERBOSE ++ + #endif /* __CONFIG_H * */ diff --git a/package/boot/uboot-imx6/patches/110-wandboard-owrt-env.patch b/package/boot/uboot-imx6/patches/110-wandboard-owrt-env.patch new file mode 100644 index 0000000..7bef453 --- /dev/null +++ b/package/boot/uboot-imx6/patches/110-wandboard-owrt-env.patch @@ -0,0 +1,89 @@ +--- a/include/configs/wandboard.h ++++ b/include/configs/wandboard.h +@@ -49,7 +49,7 @@ + #define CONFIG_CMD_BMODE + #define CONFIG_CMD_SETEXPR + +-#define CONFIG_BOOTDELAY 5 ++#define CONFIG_BOOTDELAY 3 + + #define CONFIG_SYS_MEMTEST_START 0x10000000 + #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M) +@@ -102,13 +102,15 @@ + + #if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S) + #define CONFIG_DEFAULT_FDT_FILE "imx6dl-wandboard.dtb" ++#define CONFIG_OWRT_NAME "openwrt-imx6-imx6dl-wandboard-fit-uImage.itb" + #elif defined(CONFIG_MX6Q) + #define CONFIG_DEFAULT_FDT_FILE "imx6q-wandboard.dtb" ++#define CONFIG_OWRT_NAME "openwrt-imx6-imx6q-wandboard-fit-uImage.itb" + #endif + + #define CONFIG_EXTRA_ENV_SETTINGS \ + "script=boot.scr\0" \ +- "image=zImage\0" \ ++ "image=" CONFIG_OWRT_NAME "\0" \ + "console=ttymxc0\0" \ + "splashpos=m,m\0" \ + "fdt_high=0xffffffff\0" \ +@@ -137,11 +139,11 @@ + "mmcargs=setenv bootargs console=${console},${baudrate} " \ + "root=${mmcroot}\0" \ + "loadbootscript=" \ +- "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ ++ "ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ + "bootscript=echo Running bootscript from mmc ...; " \ + "source\0" \ +- "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ +- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ ++ "loaduimage=ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \ ++ "loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ + "mmcboot=echo Booting from mmc ...; " \ + "run mmcargs; " \ + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ +@@ -155,31 +157,7 @@ + "fi; " \ + "fi; " \ + "else " \ +- "bootz; " \ +- "fi;\0" \ +- "netargs=setenv bootargs console=${console},${baudrate} " \ +- "root=/dev/nfs " \ +- "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ +- "netboot=echo Booting from net ...; " \ +- "run netargs; " \ +- "if test ${ip_dyn} = yes; then " \ +- "setenv get_cmd dhcp; " \ +- "else " \ +- "setenv get_cmd tftp; " \ +- "fi; " \ +- "${get_cmd} ${image}; " \ +- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ +- "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ +- "bootz ${loadaddr} - ${fdt_addr}; " \ +- "else " \ +- "if test ${boot_fdt} = try; then " \ +- "bootz; " \ +- "else " \ +- "echo WARN: Cannot load the DT; " \ +- "fi; " \ +- "fi; " \ +- "else " \ +- "bootz; " \ ++ "bootm; " \ + "fi;\0" + + #define CONFIG_BOOTCOMMAND \ +@@ -189,10 +167,10 @@ + "else " \ + "if run loadimage; then " \ + "run mmcboot; " \ +- "else run netboot; " \ ++ "else echo WARN: Can not boot the image; " \ + "fi; " \ + "fi; " \ +- "else run netboot; fi" ++ "fi" + + /* Miscellaneous configurable options */ + #define CONFIG_SYS_LONGHELP -- cgit v1.2.3