uboot-kirkwood: update to 2019.01
[openwrt/openwrt.git] / package / boot / uboot-kirkwood / patches / 007-nsa310-uboot-generic.patch
index 3384c5ee28f4989cc1263b8d9d4003556231778a..25d252d13fd5ea400d3ccf0649147201218ee868 100644 (file)
@@ -23,31 +23,26 @@ Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
 NOTE: this patch is ready for upstream, LEDE-specific parts are in
       another patch
 
-diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
-index 9205b1e..819bd3b 100644
 --- a/arch/arm/mach-kirkwood/Kconfig
 +++ b/arch/arm/mach-kirkwood/Kconfig
-@@ -53,6 +53,9 @@ config TARGET_GOFLEXHOME
+@@ -56,6 +56,9 @@ config TARGET_GOFLEXHOME
  config TARGET_NAS220
-       bool "BlackArmor NAS220"
+       bool "BlackArmor NAS220"
 
 +config TARGET_NSA310
 +      bool "Zyxel NSA310 Board"
 +
  config TARGET_NSA310S
-       bool "Zyxel NSA310S"
+       bool "Zyxel NSA310S"
 
-@@ -77,6 +80,7 @@ source "board/raidsonic/ib62x0/Kconfig"
+@@ -86,6 +89,7 @@ source "board/raidsonic/ib62x0/Kconfig"
  source "board/Seagate/dockstar/Kconfig"
  source "board/Seagate/goflexhome/Kconfig"
  source "board/Seagate/nas220/Kconfig"
 +source "board/zyxel/nsa310/Kconfig"
  source "board/zyxel/nsa310s/Kconfig"
-
- endif
-diff --git a/board/zyxel/nsa310/Kconfig b/board/zyxel/nsa310/Kconfig
-new file mode 100644
-index 0000000..145ade6
+ source "board/alliedtelesis/SBx81LIFKW/Kconfig"
+ source "board/alliedtelesis/SBx81LIFXCAT/Kconfig"
 --- /dev/null
 +++ b/board/zyxel/nsa310/Kconfig
 @@ -0,0 +1,12 @@
@@ -63,9 +58,6 @@ index 0000000..145ade6
 +      default "nsa310"
 +
 +endif
-diff --git a/board/zyxel/nsa310/MAINTAINERS b/board/zyxel/nsa310/MAINTAINERS
-new file mode 100644
-index 0000000..d09f1ab
 --- /dev/null
 +++ b/board/zyxel/nsa310/MAINTAINERS
 @@ -0,0 +1,6 @@
@@ -75,9 +67,6 @@ index 0000000..d09f1ab
 +F:    board/zyxel/nsa310/
 +F:    include/configs/nsa310.h
 +F:    configs/nsa310_defconfig
-diff --git a/board/zyxel/nsa310/Makefile b/board/zyxel/nsa310/Makefile
-new file mode 100644
-index 0000000..dfe93cc
 --- /dev/null
 +++ b/board/zyxel/nsa310/Makefile
 @@ -0,0 +1,12 @@
@@ -93,9 +82,6 @@ index 0000000..dfe93cc
 +#
 +
 +obj-y := nsa310.o
-diff --git a/board/zyxel/nsa310/kwbimage.cfg b/board/zyxel/nsa310/kwbimage.cfg
-new file mode 100644
-index 0000000..f60e1d2
 --- /dev/null
 +++ b/board/zyxel/nsa310/kwbimage.cfg
 @@ -0,0 +1,166 @@
@@ -265,9 +251,6 @@ index 0000000..f60e1d2
 +
 +# End of Header extension
 +DATA 0x0 0x0
-diff --git a/board/zyxel/nsa310/nsa310.c b/board/zyxel/nsa310/nsa310.c
-new file mode 100644
-index 0000000..eee3f1a
 --- /dev/null
 +++ b/board/zyxel/nsa310/nsa310.c
 @@ -0,0 +1,190 @@
@@ -461,9 +444,6 @@ index 0000000..eee3f1a
 +      }
 +}
 +#endif
-diff --git a/board/zyxel/nsa310/nsa310.h b/board/zyxel/nsa310/nsa310.h
-new file mode 100644
-index 0000000..6634a4f
 --- /dev/null
 +++ b/board/zyxel/nsa310/nsa310.h
 @@ -0,0 +1,56 @@
@@ -501,19 +481,19 @@ index 0000000..6634a4f
 +/* GPIO's */
 +#define SYS_GREEN_LED         (1 << 28)
 +#define SYS_RED_LED           (1 << 29)
-+#define SATA1_GREEN_LED               (1 << 41)
-+#define SATA1_RED_LED         (1 << 42)
++#define SATA1_GREEN_LED               (1ULL << 41)
++#define SATA1_RED_LED         (1ULL << 42)
 +#define SATA2_GREEN_LED               (1 << 12)
 +#define SATA2_RED_LED         (1 << 13)
 +#define USB_GREEN_LED         (1 << 15)
 +#define USB_RED_LED           (1 << 21)
-+#define COPY_GREEN_LED                (1 << 39)
-+#define COPY_RED_LED          (1 << 40)
++#define COPY_GREEN_LED                (1ULL << 39)
++#define COPY_RED_LED          (1ULL << 40)
 +
 +#define NSA310_OE_LOW   (0)
 +#define NSA310_VAL_LOW    (SYS_GREEN_LED)
-+#define NSA310_OE_HIGH                ((COPY_GREEN_LED | COPY_RED_LED | \
-+                                   SATA1_GREEN_LED | SATA1_RED_LED))
++#define NSA310_OE_HIGH                (((COPY_GREEN_LED | COPY_RED_LED | \
++                                   SATA1_GREEN_LED | SATA1_RED_LED)) >> 32UL)
 +#define NSA310_VAL_HIGH               (0)
 +
 +/* PHY related */
@@ -523,37 +503,52 @@ index 0000000..6634a4f
 +#define MV88E1318_RGMII_RXTM_CTRL     (1 << 5)
 +
 +#endif /* __NSA310_H */
-diff --git a/configs/nsa310_defconfig b/configs/nsa310_defconfig
-new file mode 100644
-index 0000000..d26ef35
 --- /dev/null
 +++ b/configs/nsa310_defconfig
-@@ -0,0 +1,19 @@
+@@ -0,0 +1,40 @@
 +CONFIG_ARM=y
 +CONFIG_KIRKWOOD=y
++CONFIG_SYS_TEXT_BASE=0x600000
 +CONFIG_TARGET_NSA310=y
++CONFIG_IDENT_STRING="\nZyXEL NSA310 1-Bay Power Media Server"
++CONFIG_NR_DRAM_BANKS=2
 +CONFIG_BOOTDELAY=3
 +CONFIG_SYS_PROMPT="NSA310> "
 +# CONFIG_CMD_IMLS is not set
 +# CONFIG_CMD_FLASH is not set
++CONFIG_MVGBE=y
++CONFIG_MII=y
 +CONFIG_SYS_NS16550=y
 +CONFIG_CMD_FDT=y
 +CONFIG_OF_LIBFDT=y
 +CONFIG_CMD_SETEXPR=y
 +CONFIG_CMD_DHCP=y
-+CONFIG_CMD_NAND=y
++CONFIG_CMD_MII=y
 +CONFIG_CMD_PING=y
++CONFIG_CMD_DNS=y
++CONFIG_CMD_SNTP=y
 +CONFIG_CMD_USB=y
++CONFIG_CMD_DATE=y
 +CONFIG_CMD_EXT2=y
++CONFIG_CMD_EXT4=y
 +CONFIG_CMD_FAT=y
++CONFIG_CMD_JFFS2=y
++CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0x0c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi)"
++CONFIG_CMD_MTDPARTS=y
++CONFIG_CMD_ENV=y
++CONFIG_CMD_NAND=y
++CONFIG_EFI_PARTITION=y
++CONFIG_ENV_IS_IN_NAND=y
++CONFIG_CMD_UBI=y
 +CONFIG_USB=y
++CONFIG_USB_EHCI_HCD=y
 +CONFIG_USB_STORAGE=y
-diff --git a/include/configs/nsa310.h b/include/configs/nsa310.h
-new file mode 100644
-index 0000000..86ef825
++CONFIG_LZMA=y
++CONFIG_LZO=y
++CONFIG_SYS_LONGHELP=y
 --- /dev/null
 +++ b/include/configs/nsa310.h
-@@ -0,0 +1,168 @@
+@@ -0,0 +1,117 @@
 +/* Copyright (C) 2015-2016 bodhi <mibodhi@gmail.com>
 + *
 + * Based on
@@ -587,17 +582,11 @@ index 0000000..86ef825
 +#define _CONFIG_NSA310_H
 +
 +/*
-+ * Version number information
-+ */
-+
-+#define CONFIG_IDENT_STRING   "\nZyXEL NSA310 1-Bay Power Media Server \n"
-+
-+/*
 + * High Level Configuration Options (easy to change)
 + */
 +#define CONFIG_FEROCEON_88FR131               /* CPU Core subversion */
 +#define CONFIG_KW88F6281              /* SOC Name */
-+#define CONFIG_MACH_NSA310            /* Machine type */
++
 +#define CONFIG_SKIP_LOWLEVEL_INIT     /* disable board lowlevel_init */
 +
 +/*
@@ -608,20 +597,7 @@ index 0000000..86ef825
 +/*
 + * Commands configuration
 + */
-+#define CONFIG_SYS_NO_FLASH           /* Declare no flash (NOR/SPI) */
-+#define CONFIG_SYS_MVFS                 /* Picks up Filesystem from mv-common.h */
-+#define CONFIG_CMD_DHCP
-+#define CONFIG_CMD_ENV
-+#define CONFIG_CMD_IDE
-+#define CONFIG_CMD_MII
-+#define CONFIG_CMD_NAND
-+#define CONFIG_CMD_PING
-+#define CONFIG_CMD_USB
-+#define CONFIG_CMD_DATE
-+#define CONFIG_SYS_LONGHELP
 +#define CONFIG_PREBOOT
-+#define CONFIG_SYS_HUSH_PARSER
-+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
 +
 +/*
 + * mv-common.h should be defined after CMD configs since it used them
@@ -629,18 +605,11 @@ index 0000000..86ef825
 + */
 +#include "mv-common.h"
 +
-+/* Remove or override few declarations from mv-common.h */
-+#undef CONFIG_SYS_PROMPT      /* previously defined in mv-common.h */
-+#define CONFIG_SYS_PROMPT     "NSA310> "      /* Command Prompt */
-+
 +/*
 + * Environment variables configurations
 + */
 +#ifdef CONFIG_CMD_NAND
-+#define CONFIG_ENV_IS_IN_NAND           1
 +#define CONFIG_ENV_SECT_SIZE            0x20000         /* 128K */
-+#else
-+#define CONFIG_ENV_IS_NOWHERE           1               /* if env in SDRAM */
 +#endif
 +
 +/* max 4k env size is enough, but in case of nand
@@ -658,16 +627,10 @@ index 0000000..86ef825
 +      "ubi read 0x800000 kernel; " \
 +      "bootm 0x800000"
 +
-+#define CONFIG_MTDPARTS \
-+      "mtdparts=orion_nand:" \
-+      "0x0c0000(uboot)," \
-+      "0x80000(uboot_env)," \
-+      "0x7ec0000(ubi)\0"
-+
 +#define CONFIG_EXTRA_ENV_SETTINGS \
 +      "console=console=ttyS0,115200\0"        \
 +      "mtdids=nand0=orion_nand\0"             \
-+      "mtdparts="CONFIG_MTDPARTS              \
++      "mtdparts="CONFIG_MTDPARTS_DEFAULT "\0" \
 +      "bootargs_root=\0"
 +
 +/*
@@ -678,7 +641,6 @@ index 0000000..86ef825
 +#define CONFIG_NET_MULTI
 +#define CONFIG_MVGBE_PORTS            {1, 0}  /* enable port 0 only */
 +#define CONFIG_PHY_BASE_ADR           0x1
-+#define CONFIG_PHY_GIGE
 +#define CONFIG_RESET_PHY_R
 +#endif /* CONFIG_CMD_NET */
 +
@@ -693,32 +655,14 @@ index 0000000..86ef825
 +/*
 + * File system
 + */
-+#define CONFIG_CMD_EXT2
-+#define CONFIG_CMD_EXT4
-+#define CONFIG_CMD_FAT
-+#define CONFIG_CMD_JFFS2
 +#define CONFIG_JFFS2_NAND
 +#define CONFIG_JFFS2_LZO
-+#define CONFIG_CMD_UBI
-+#define CONFIG_CMD_UBIFS
-+#define CONFIG_RBTREE
-+#define CONFIG_MTD_DEVICE               /* needed for mtdparts commands */
-+#define CONFIG_MTD_PARTITIONS
-+#define CONFIG_CMD_MTDPARTS
-+#define CONFIG_LZO
-+
-+/*
-+ * EFI partition
-+ */
-+#define CONFIG_EFI_PARTITION
 +
 +/*
 + *  Date Time
 + */
 +#ifdef CONFIG_CMD_DATE
 +#define CONFIG_RTC_MV
-+#define CONFIG_CMD_SNTP
-+#define CONFIG_CMD_DNS
 +#endif /* CONFIG_CMD_DATE */
 +
 +#endif /* _CONFIG_NSA310_H */