aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-mxs
diff options
context:
space:
mode:
authorMichael Heimpold <mhei@heimpold.de>2018-02-10 14:05:10 +0100
committerJohn Crispin <john@phrozen.org>2018-02-13 10:01:52 +0100
commitdc263cd125f9ea58b797d888ea39118059ba5da0 (patch)
treee9e3d722b55bb1ac784fb56d750c540945e27417 /package/boot/uboot-mxs
parentf34b118b356a8a698c3dbe31ddd074e9a3521235 (diff)
downloadupstream-dc263cd125f9ea58b797d888ea39118059ba5da0.tar.gz
upstream-dc263cd125f9ea58b797d888ea39118059ba5da0.tar.bz2
upstream-dc263cd125f9ea58b797d888ea39118059ba5da0.zip
packages: uboot-mxs: bump to 2017.11
Also update the U-Boot BSP patch for I2SE Duckbill devices. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Diffstat (limited to 'package/boot/uboot-mxs')
-rw-r--r--package/boot/uboot-mxs/Makefile4
-rw-r--r--package/boot/uboot-mxs/patches/001-add-i2se-duckbill.patch408
2 files changed, 292 insertions, 120 deletions
diff --git a/package/boot/uboot-mxs/Makefile b/package/boot/uboot-mxs/Makefile
index 92cf9e6b27..cd752bb81a 100644
--- a/package/boot/uboot-mxs/Makefile
+++ b/package/boot/uboot-mxs/Makefile
@@ -8,10 +8,10 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
-PKG_VERSION:=2016.01
+PKG_VERSION:=2017.11
PKG_RELEASE:=1
-PKG_HASH:=e5792fba9399d9804aa2ef667f14ff771e2cdece72367d340250265bf095a5d5
+PKG_HASH:=6a018fd3caf58f3dcfa23ee989a82bd35df03af71872b9dca8c6d758a0d26c05
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
diff --git a/package/boot/uboot-mxs/patches/001-add-i2se-duckbill.patch b/package/boot/uboot-mxs/patches/001-add-i2se-duckbill.patch
index 91f583f36e..15217b57ee 100644
--- a/package/boot/uboot-mxs/patches/001-add-i2se-duckbill.patch
+++ b/package/boot/uboot-mxs/patches/001-add-i2se-duckbill.patch
@@ -1,20 +1,40 @@
-From 4d9a32780ec795b9edc83c7b3a1e947cec49a5a4 Mon Sep 17 00:00:00 2001
+From 25de6430219d3f3698d709c10358fbea17b24cf1 Mon Sep 17 00:00:00 2001
From: Michael Heimpold <mhei@heimpold.de>
-Date: Sat, 15 Aug 2015 20:26:18 +0200
-Subject: [PATCH] Add support for I2SE Duckbill boards
+Date: Fri, 21 Apr 2017 11:08:19 +0200
+Subject: [PATCH] arm: mxs: add support for I2SE's Duckbill boards
+
+The Duckbill devices are small, pen-drive sized boards based on
+NXP's i.MX28 SoC. While the initial variants (Duckbill series) were
+equipped with a micro SD card slot only, the latest generation
+(Duckbill 2 series) have an additional internal eMMC onboard.
+
+Both device generations consists of four "family members":
+
+- Duckbill/Duckbill 2: generic board, intended to be used as
+ baseboard for custom designs and/or as development board
+
+- Duckbill EnOcean/Duckbill 2 EnOcean: come with an EnOcean
+ daugther board equipped with the popular TCM310 module
+
+- Duckbill 485/Duckbill 2 485: as the name implies, these
+ devices are intended to be used as Ethernet - RS485 converters
+
+- Duckbill SPI/Duckbill 2 SPI: not sold separately, but used
+ in I2SE's development kits for Green PHY HomePlug Powerline
+ communication
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
- arch/arm/Kconfig | 6 ++
- arch/arm/include/asm/mach-types.h | 13 +++
- board/i2se/duckbill/Kconfig | 15 ++++
- board/i2se/duckbill/MAINTAINERS | 6 ++
- board/i2se/duckbill/Makefile | 12 +++
- board/i2se/duckbill/duckbill.c | 112 +++++++++++++++++++++++
- board/i2se/duckbill/iomux.c | 125 ++++++++++++++++++++++++++
- configs/duckbill_defconfig | 9 ++
- include/configs/duckbill.h | 177 +++++++++++++++++++++++++++++++++++++
- 9 files changed, 475 insertions(+)
+ arch/arm/Kconfig | 9 +-
+ board/i2se/duckbill/Kconfig | 15 +++
+ board/i2se/duckbill/MAINTAINERS | 6 ++
+ board/i2se/duckbill/Makefile | 12 +++
+ board/i2se/duckbill/duckbill.c | 181 ++++++++++++++++++++++++++++++++++++
+ board/i2se/duckbill/iomux.c | 157 +++++++++++++++++++++++++++++++
+ configs/duckbill_defconfig | 31 +++++++
+ include/configs/duckbill.h | 199 ++++++++++++++++++++++++++++++++++++++++
+ 8 files changed, 609 insertions(+), 1 deletion(-)
create mode 100644 board/i2se/duckbill/Kconfig
create mode 100644 board/i2se/duckbill/MAINTAINERS
create mode 100644 board/i2se/duckbill/Makefile
@@ -23,57 +43,43 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
create mode 100644 configs/duckbill_defconfig
create mode 100644 include/configs/duckbill.h
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index 30e71b2..b77e778 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -178,6 +178,11 @@ config TARGET_MX28EVK
- select CPU_ARM926EJS
+@@ -373,6 +373,12 @@ config TARGET_MX28EVK
select SUPPORT_SPL
+ select BOARD_EARLY_INIT_F
+config TARGET_DUCKBILL
-+ bool "Support I2SE Duckbill"
++ bool "Support duckbill"
+ select CPU_ARM926EJS
+ select SUPPORT_SPL
++ select BOARD_EARLY_INIT_F
+
config TARGET_MX23_OLINUXINO
bool "Support mx23_olinuxino"
select CPU_ARM926EJS
-@@ -926,6 +931,7 @@ source "board/genesi/mx51_efikamx/Kconfi
- source "board/gumstix/pepper/Kconfig"
+@@ -1250,6 +1256,7 @@ source "board/gumstix/pepper/Kconfig"
source "board/h2200/Kconfig"
source "board/hisilicon/hikey/Kconfig"
+ source "board/hisilicon/poplar/Kconfig"
+source "board/i2se/duckbill/Kconfig"
source "board/imx31_phycore/Kconfig"
- source "board/isee/igep0033/Kconfig"
- source "board/maxbcm/Kconfig"
---- a/arch/arm/include/asm/mach-types.h
-+++ b/arch/arm/include/asm/mach-types.h
-@@ -1109,6 +1109,7 @@ extern unsigned int __machine_arch_type;
- #define MACH_TYPE_COLIBRI_T30 4493
- #define MACH_TYPE_APALIS_T30 4513
- #define MACH_TYPE_OMAPL138_LCDK 2495
-+#define MACH_TYPE_DUCKBILL 4754
+ source "board/isee/igep003x/Kconfig"
+ source "board/olimex/mx23_olinuxino/Kconfig"
+@@ -1279,7 +1286,7 @@ source "arch/arm/Kconfig.debug"
+ endmenu
- #ifdef CONFIG_ARCH_EBSA110
- # ifdef machine_arch_type
-@@ -14262,6 +14263,18 @@ extern unsigned int __machine_arch_type;
- # define machine_is_apalis_t30() (0)
- #endif
+ config SPL_LDSCRIPT
+- default "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" if TARGET_APX4DEVKIT || TARGET_BG0900 || TARGET_M28EVK || TARGET_MX23_OLINUXINO || TARGET_MX23EVK || TARGET_MX28EVK || TARGET_SANSA_FUZE_PLUS || TARGET_SC_SPS_1 || TARGET_TS4600 || TARGET_XFI3
++ default "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" if TARGET_APX4DEVKIT || TARGET_BG0900 || TARGET_M28EVK || TARGET_MX23_OLINUXINO || TARGET_MX23EVK || TARGET_MX28EVK || TARGET_DUCKBILL || TARGET_SANSA_FUZE_PLUS || TARGET_SC_SPS_1 || TARGET_TS4600 || TARGET_XFI3
+ default "arch/arm/cpu/arm1136/u-boot-spl.lds" if CPU_ARM1136
+ default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64
-+#ifdef CONFIG_MACH_DUCKBILL
-+# ifdef machine_arch_type
-+# undef machine_arch_type
-+# define machine_arch_type __machine_arch_type
-+# else
-+# define machine_arch_type MACH_TYPE_DUCKBILL
-+# endif
-+# define machine_is_duckbill() (machine_arch_type == MACH_TYPE_DUCKBILL)
-+#else
-+# define machine_is_duckbill() (0)
-+#endif
-+
- /*
- * These have not yet been registered
- */
+diff --git a/board/i2se/duckbill/Kconfig b/board/i2se/duckbill/Kconfig
+new file mode 100644
+index 0000000..98c1e46
--- /dev/null
+++ b/board/i2se/duckbill/Kconfig
@@ -0,0 +1,15 @@
@@ -92,6 +98,9 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+ default "duckbill"
+
+endif
+diff --git a/board/i2se/duckbill/MAINTAINERS b/board/i2se/duckbill/MAINTAINERS
+new file mode 100644
+index 0000000..5496baa
--- /dev/null
+++ b/board/i2se/duckbill/MAINTAINERS
@@ -0,0 +1,6 @@
@@ -101,11 +110,14 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+F: board/i2se/duckbill/
+F: include/configs/duckbill.h
+F: configs/duckbill_defconfig
+diff --git a/board/i2se/duckbill/Makefile b/board/i2se/duckbill/Makefile
+new file mode 100644
+index 0000000..66baec4
--- /dev/null
+++ b/board/i2se/duckbill/Makefile
@@ -0,0 +1,12 @@
+#
-+# (C) Copyright 2014-2015
++# (C) Copyright 2014-2017
+# Michael Heimpold, mhei@heimpold.de.
+#
+# SPDX-License-Identifier: GPL-2.0+
@@ -116,13 +128,16 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+else
+obj-y := iomux.o
+endif
+diff --git a/board/i2se/duckbill/duckbill.c b/board/i2se/duckbill/duckbill.c
+new file mode 100644
+index 0000000..caeb903
--- /dev/null
+++ b/board/i2se/duckbill/duckbill.c
-@@ -0,0 +1,112 @@
+@@ -0,0 +1,181 @@
+/*
+ * I2SE Duckbill board
+ *
-+ * (C) Copyright 2014-2015 Michael Heimpold <mhei@heimpold.de>
++ * (C) Copyright 2014-2017 Michael Heimpold <mhei@heimpold.de>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
@@ -134,17 +149,19 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+#include <asm/arch/iomux-mx28.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/sys_proto.h>
++#include <asm/setup.h>
++#include <fdt_support.h>
+#include <linux/mii.h>
+#include <miiphy.h>
+#include <netdev.h>
+#include <errno.h>
-+
-+#define GPIO_PHY_RESET MX28_PAD_SSP0_DATA7__GPIO_2_7
-+#define GPIO_LED_GREEN MX28_PAD_AUART1_TX__GPIO_3_5
-+#define GPIO_LED_RED MX28_PAD_AUART1_RX__GPIO_3_4
++#include <fuse.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
++static u32 system_rev;
++static u32 serialno;
++
+/*
+ * Functions
+ */
@@ -184,14 +201,20 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
++ unsigned int reset_gpio;
+ int ret;
+
+ ret = cpu_eth_init(bis);
+
++ if (system_rev == 1)
++ reset_gpio = MX28_PAD_SSP0_DATA7__GPIO_2_7;
++ else
++ reset_gpio = MX28_PAD_GPMI_ALE__GPIO_0_26;
++
+ /* Reset PHY */
-+ gpio_direction_output(GPIO_PHY_RESET, 0);
++ gpio_direction_output(reset_gpio, 0);
+ udelay(200);
-+ gpio_set_value(GPIO_PHY_RESET, 1);
++ gpio_set_value(reset_gpio, 1);
+
+ /* give PHY some time to get out of the reset */
+ udelay(10000);
@@ -209,20 +232,81 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+{
+ mac[0] = 0x00;
+ mac[1] = 0x01;
++ mac[2] = 0x87;
++}
++#endif
++
++#ifdef CONFIG_OF_BOARD_SETUP
++int ft_board_setup(void *blob, bd_t *bd)
++{
++ uint8_t enetaddr[6];
++ u32 mac = 0;
++
++ enetaddr[0] = 0x00;
++ enetaddr[1] = 0x01;
++ enetaddr[2] = 0x87;
+
-+ if (dev_id == 1) /* Let MAC1 be MAC0 + 1 by default */
-+ mac[5] += 1;
++#ifdef CONFIG_MXS_OCOTP
++ /* only Duckbill SPI has a MAC for the QCA7k */
++ fuse_read(0, 1, &mac);
++#endif
++
++ if (mac != 0) {
++ enetaddr[3] = (mac >> 16) & 0xff;
++ enetaddr[4] = (mac >> 8) & 0xff;
++ enetaddr[5] = mac & 0xff;
++
++ fdt_find_and_setprop(blob,
++ "/apb@80000000/apbh@80000000/ssp@80014000/ethernet@0",
++ "local-mac-address", enetaddr, 6, 1);
++ }
++
++ return 0;
++}
++#endif
++
++#ifdef CONFIG_REVISION_TAG
++u32 get_board_rev(void)
++{
++ return system_rev;
++}
++#endif
++
++#ifdef CONFIG_SERIAL_TAG
++void get_board_serial(struct tag_serialnr *serialnr)
++{
++ serialnr->low = serialno;
++ serialnr->high = 0;
+}
+#endif
+
+int misc_init_r(void)
+{
-+ char *s = getenv("serial#");
++ unsigned int led_red_gpio;
++ char *s;
+
-+ /* enable red LED to indicate a running bootloader */
-+ gpio_direction_output(GPIO_LED_RED, 1);
++ /* Board revision detection */
++ gpio_direction_input(MX28_PAD_LCD_D17__GPIO_1_17);
+
-+ puts("Board: I2SE Duckbill\n");
++ /* MX28_PAD_LCD_D17__GPIO_1_17: v1 = pull-down, v2 = pull-up */
++ system_rev =
++ gpio_get_value(MX28_PAD_LCD_D17__GPIO_1_17);
++ system_rev += 1;
++
++ /* enable red LED to indicate a running bootloader */
++ if (system_rev == 1)
++ led_red_gpio = MX28_PAD_AUART1_RX__GPIO_3_4;
++ else
++ led_red_gpio = MX28_PAD_SAIF0_LRCLK__GPIO_3_21;
++ gpio_direction_output(led_red_gpio, 1);
++
++ if (system_rev == 1)
++ puts("Board: I2SE Duckbill\n");
++ else
++ puts("Board: I2SE Duckbill 2\n");
++
++ serialno = env_get_ulong("serial#", 10, 0);
++ s = env_get("serial#");
+ if (s && s[0]) {
+ puts("Serial: ");
+ puts(s);
@@ -231,13 +315,16 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+
+ return 0;
+}
+diff --git a/board/i2se/duckbill/iomux.c b/board/i2se/duckbill/iomux.c
+new file mode 100644
+index 0000000..b3c4d92
--- /dev/null
+++ b/board/i2se/duckbill/iomux.c
-@@ -0,0 +1,125 @@
+@@ -0,0 +1,157 @@
+/*
+ * I2SE Duckbill IOMUX setup
+ *
-+ * Copyright (C) 2013-2015 Michael Heimpold <mhei@heimpold.de>
++ * Copyright (C) 2013-2017 Michael Heimpold <mhei@heimpold.de>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
@@ -245,6 +332,7 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+#include <common.h>
+#include <config.h>
+#include <asm/io.h>
++#include <asm/gpio.h>
+#include <asm/arch/iomux-mx28.h>
+#include <asm/arch/imx-regs.h>
+#include <asm/arch/sys_proto.h>
@@ -253,12 +341,13 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+#define MUX_CONFIG_ENET (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP)
+#define MUX_CONFIG_EMI (MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_NOPULL)
+
++/* For all revisions */
+const iomux_cfg_t iomux_setup[] = {
+ /* DUART */
+ MX28_PAD_PWM0__DUART_RX,
+ MX28_PAD_PWM1__DUART_TX,
+
-+ /* SD card */
++ /* eMMC (v2) or SD card (v1) */
+ MX28_PAD_SSP0_DATA0__SSP0_D0 | MUX_CONFIG_SSP0,
+ MX28_PAD_SSP0_DATA1__SSP0_D1 | MUX_CONFIG_SSP0,
+ MX28_PAD_SSP0_DATA2__SSP0_D2 | MUX_CONFIG_SSP0,
@@ -280,10 +369,6 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+ MX28_PAD_ENET0_TXD1__ENET0_TXD1 | MUX_CONFIG_ENET,
+ MX28_PAD_ENET_CLK__CLKCTRL_ENET | MUX_CONFIG_ENET,
+
-+ /* PHY reset */
-+ MX28_PAD_SSP0_DATA7__GPIO_2_7 |
-+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
-+
+ /* EMI */
+ MX28_PAD_EMI_D00__EMI_DATA0 | MUX_CONFIG_EMI,
+ MX28_PAD_EMI_D01__EMI_DATA1 | MUX_CONFIG_EMI,
@@ -336,11 +421,38 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+ MX28_PAD_EMI_CE1N__EMI_CE1N | MUX_CONFIG_EMI,
+ MX28_PAD_EMI_CKE__EMI_CKE | MUX_CONFIG_EMI,
+
++ /* Revision pin(s) */
++ MX28_PAD_LCD_D17__GPIO_1_17,
++};
++
++/* For revision 1 only */
++const iomux_cfg_t iomux_setup_v1[] = {
++ /* PHY reset */
++ MX28_PAD_SSP0_DATA7__GPIO_2_7 |
++ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
++
+ /* LEDs */
+ MX28_PAD_AUART1_RX__GPIO_3_4,
+ MX28_PAD_AUART1_TX__GPIO_3_5,
+};
+
++/* For revision 2 only */
++const iomux_cfg_t iomux_setup_v2[] = {
++ /* eMMC (v2) */
++ MX28_PAD_SSP0_DATA4__SSP0_D4 | MUX_CONFIG_SSP0,
++ MX28_PAD_SSP0_DATA5__SSP0_D5 | MUX_CONFIG_SSP0,
++ MX28_PAD_SSP0_DATA6__SSP0_D6 | MUX_CONFIG_SSP0,
++ MX28_PAD_SSP0_DATA7__SSP0_D7 | MUX_CONFIG_SSP0,
++
++ /* PHY reset */
++ MX28_PAD_GPMI_ALE__GPIO_0_26 |
++ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
++
++ /* LEDs */
++ MX28_PAD_SAIF0_LRCLK__GPIO_3_21,
++ MX28_PAD_SAIF0_MCLK__GPIO_3_20,
++};
++
+#define HW_DRAM_CTL29 (0x74 >> 2)
+#define CS_MAP 0xf
+#define COLUMN_SIZE 0x2
@@ -358,22 +470,57 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+void board_init_ll(const uint32_t arg, const uint32_t *resptr)
+{
+ mxs_common_spl_init(arg, resptr, iomux_setup, ARRAY_SIZE(iomux_setup));
++
++ gpio_direction_input(MX28_PAD_LCD_D17__GPIO_1_17);
++
++ if (gpio_get_value(MX28_PAD_LCD_D17__GPIO_1_17))
++ mxs_iomux_setup_multiple_pads(iomux_setup_v2, ARRAY_SIZE(iomux_setup_v2));
++ else
++ mxs_iomux_setup_multiple_pads(iomux_setup_v1, ARRAY_SIZE(iomux_setup_v1));
+}
+diff --git a/configs/duckbill_defconfig b/configs/duckbill_defconfig
+new file mode 100644
+index 0000000..2adce92
--- /dev/null
+++ b/configs/duckbill_defconfig
-@@ -0,0 +1,9 @@
+@@ -0,0 +1,31 @@
+CONFIG_ARM=y
+CONFIG_TARGET_DUCKBILL=y
++CONFIG_SPL_GPIO_SUPPORT=y
++CONFIG_SPL_LIBCOMMON_SUPPORT=y
++CONFIG_SPL_LIBGENERIC_SUPPORT=y
++CONFIG_SPL_SERIAL_SUPPORT=y
++CONFIG_BOOTDELAY=1
++# CONFIG_CONSOLE_MUX is not set
++CONFIG_SYS_CONSOLE_IS_IN_ENV=y
++CONFIG_VERSION_VARIABLE=y
++# CONFIG_DISPLAY_BOARDINFO is not set
++# CONFIG_EFI_LOADER is not set
++CONFIG_ARCH_MISC_INIT=y
+CONFIG_SPL=y
-+CONFIG_SYS_EXTRA_OPTIONS="ENV_IS_IN_MMC"
++CONFIG_HUSH_PARSER=y
++CONFIG_CMD_BOOTZ=y
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
-+# CONFIG_SPI_FLASH is not set
-+# CONFIG_CMD_FPGA is not set
++CONFIG_CMD_MMC=y
++CONFIG_CMD_GPIO=y
++CONFIG_CMD_DHCP=y
++CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
++CONFIG_CMD_CACHE=y
++CONFIG_CMD_EXT4=y
++CONFIG_CMD_EXT4_WRITE=y
++CONFIG_CMD_FAT=y
++CONFIG_CMD_FS_GENERIC=y
++CONFIG_ENV_IS_IN_MMC=y
++CONFIG_MMC_MXS=y
++CONFIG_OF_LIBFDT=y
+diff --git a/include/configs/duckbill.h b/include/configs/duckbill.h
+new file mode 100644
+index 0000000..f9374c6
--- /dev/null
+++ b/include/configs/duckbill.h
-@@ -0,0 +1,177 @@
+@@ -0,0 +1,199 @@
+/*
+ * Copyright (C) 2014-2015 Michael Heimpold <mhei@heimpold.de>
+ *
@@ -391,22 +538,7 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+#define CONFIG_SYS_MXS_VDD5V_ONLY
+
+/* U-Boot Commands */
-+#define CONFIG_SYS_NO_FLASH
-+#define CONFIG_DISPLAY_CPUINFO
-+#define CONFIG_DOS_PARTITION
-+
-+#define CONFIG_CMD_BOOTZ
-+#define CONFIG_CMD_CACHE
-+#define CONFIG_CMD_DHCP
-+#define CONFIG_CMD_EXT4
-+#define CONFIG_CMD_EXT4_WRITE
-+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_FUSE
-+#define CONFIG_CMD_GPIO
-+#define CONFIG_CMD_I2C
-+#define CONFIG_CMD_MII
-+#define CONFIG_CMD_MMC
-+#define CONFIG_CMD_SPI
+#define CONFIG_CMD_UNZIP
+
+/* Memory configuration */
@@ -417,7 +549,6 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+
+/* Environment is in MMC */
+#define CONFIG_ENV_OVERWRITE
-+#define CONFIG_ENV_IS_IN_MMC 1
+#define CONFIG_ENV_SIZE (128 * 1024)
+#define CONFIG_ENV_OFFSET (128 * 1024)
+#define CONFIG_ENV_OFFSET_REDUND (256 * 1024)
@@ -454,29 +585,70 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+#define CONFIG_BOOTFILE "zImage"
+#define CONFIG_LOADADDR 0x42000000
+#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
++#define CONFIG_REVISION_TAG
++#define CONFIG_SERIAL_TAG
++#define CONFIG_OF_BOARD_SETUP
++#define CONFIG_BOOT_RETRY_TIME 120 /* retry autoboot after 120 seconds */
++#define CONFIG_AUTOBOOT_KEYED
++#define CONFIG_AUTOBOOT_PROMPT "Autobooting in %d seconds, " \
++ "press <c> to stop\n"
++#define CONFIG_AUTOBOOT_DELAY_STR "\x63" /* allows retry after retry time */
++#define CONFIG_AUTOBOOT_STOP_STR " " /* stop autoboot with <Space> */
++#define CONFIG_RESET_TO_RETRY /* reset board to retry booting */
+
+/* Extra Environment */
+#define CONFIG_EXTRA_ENV_SETTINGS \
-+ "update_sd_firmware_filename=openwrt-mxs-root.ext4\0" \
-+ "update_sd_firmware=" \
++ "mmc_part2_offset=1000\0" \
++ "mmc_part3_offset=19000\0" \
++ "update_openwrt_firmware_filename=openwrt-mxs-root.ext4\0" \
++ "update_openwrt_firmware=" \
+ "if mmc rescan; then " \
-+ "if tftp ${update_sd_firmware_filename}; then " \
-+ "setexpr fw_sz ${filesize} / 200; " \
-+ "setexpr fw_sz ${fw_sz} + 1; " \
-+ "mmc dev ${mmcdev} 3; " \
-+ "mmc write ${loadaddr} 0 ${fw_sz}; " \
-+ "mmc dev ${mmcdev} 2; " \
-+ "mmc write ${loadaddr} 0 ${fw_sz}; " \
-+ "mmc dev ${mmcdev}; " \
-+ "fi; " \
++ "if tftp ${update_openwrt_firmware_filename}; then " \
++ "setexpr fw_sz ${filesize} + 1ff; " \
++ "setexpr fw_sz ${fw_sz} / 200; " \
++ "mmc write ${loadaddr} ${mmc_part2_offset} ${fw_sz}; " \
++ "mmc write ${loadaddr} ${mmc_part3_offset} ${fw_sz}; " \
++ "fi; " \
+ "fi\0" \
++ "update_fw_filename_prefix=emmc.img.\0" \
++ "update_fw_filename_suffix=.gz\0" \
++ "update_fw_parts=0x6\0" \
++ "update_fw_fsize_uncompressed=4000000\0" \
++ "gzwrite_wbuf=100000\0" \
++ "update_emmc_firmware=" \
++ "setexpr i ${update_fw_parts}; setexpr error 0; " \
++ "while itest ${i} -gt 0; do " \
++ "echo Transfering firmware image part ${i} of ${update_fw_parts}; " \
++ "if itest ${i} -le 9; then " \
++ "setenv j 0${i}; " \
++ "else " \
++ "setenv j ${i}; " \
++ "fi; " \
++ "if tftp ${loadaddr} ${update_fw_basedir}${update_fw_filename_prefix}${j}${update_fw_filename_suffix}; then " \
++ "setexpr k ${i} - 1; " \
++ "setexpr offset ${update_fw_fsize_uncompressed} * ${k}; " \
++ "if gzwrite mmc ${mmcdev} ${loadaddr} ${filesize} ${gzwrite_wbuf} ${offset}; then " \
++ "setexpr i ${i} - 1; " \
++ "else " \
++ "setexpr i 0; " \
++ "setexpr error 1; " \
++ "fi; " \
++ "else " \
++ "setexpr i 0; " \
++ "setexpr error 1; " \
++ "fi; " \
++ "done; setenv i; setenv j; setenv k; setenv fsize; setenv filesize; setenv offset; " \
++ "if test ${error} -eq 1; then " \
++ "echo Firmware Update FAILED; " \
++ "else " \
++ "echo Firmware Update OK; " \
++ "fi; setenv error\0" \
+ "erase_mmc=mmc erase 0 2\0" \
+ "erase_env1=mmc erase 100 100\0" \
+ "erase_env2=mmc erase 200 100\0" \
-+ "script=boot.scr\0" \
+ "image=zImage\0" \
+ "console=ttyAMA0\0" \
-+ "fdt_file=imx28-duckbill.dtb\0" \
++ "fdt_file=imx28-duckbill-2.dtb\0" \
+ "fdt_addr=0x41000000\0" \
+ "boot_fdt=try\0" \
+ "ip_dyn=yes\0" \
@@ -487,10 +659,6 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+ "mmcargs=setenv bootargs console=${console},${baudrate} " \
+ "root=${mmcroot} " \
+ "rootwait bootsys=${bootsys} panic=1\0" \
-+ "loadbootscript=" \
-+ "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
-+ "bootscript=echo Running bootscript from mmc ...; " \
-+ "source\0" \
+ "loadimage=ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${image}\0" \
+ "loadfdt=ext4load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/${fdt_file}\0" \
+ "mmcboot=echo Booting from mmc ...; " \
@@ -509,7 +677,8 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+ "fi; " \
+ "else " \
+ "bootz; " \
-+ "fi;\0" \
++ "fi\0" \
++ "nfsroot=/\0" \
+ "netargs=setenv bootargs console=${console},${baudrate} " \
+ "root=/dev/nfs " \
+ "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
@@ -521,7 +690,7 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+ "setenv get_cmd tftp; " \
+ "fi; " \
+ "${get_cmd} ${image}; " \
-+ "if test ${boot_fdt} = yes; then " \
++ "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
+ "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
+ "bootz ${loadaddr} - ${fdt_addr}; " \
+ "else " \
@@ -533,21 +702,24 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+ "fi; " \
+ "else " \
+ "bootz; " \
-+ "fi;\0"
++ "fi\0"
+
+#define CONFIG_BOOTCOMMAND \
-+ "mmc dev ${mmcdev}; if mmc rescan; then " \
-+ "if run loadbootscript; then " \
-+ "run bootscript; " \
++ "mmc dev ${mmcdev}; " \
++ "if mmc rescan; then " \
++ "if run loadimage; then " \
++ "run mmcboot; " \
+ "else " \
-+ "if run loadimage; then " \
-+ "run mmcboot; " \
-+ "else run netboot; " \
-+ "fi; " \
++ "run netboot; " \
+ "fi; " \
-+ "else run netboot; fi"
++ "else " \
++ "run netboot; " \
++ "fi"
+
+/* The rest of the configuration is shared */
+#include <configs/mxs.h>
+
+#endif /* __CONFIGS_DUCKBILL_H__ */
+--
+2.7.4
+