u-boot: Integrate upstream UBI and MTD patches

Adriana Kobylak (2):
      Add MTD support to Aspeed Flash driver
      Add optional MTD and UBI support to ast-common

Change-Id: I9f8b9d2e725f9d2f86f67c9dc52929086dff187a
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/common/recipes-bsp/u-boot/files/0002-Add-MTD-support-to-Aspeed-Flash-driver.patch b/common/recipes-bsp/u-boot/files/0002-Add-MTD-support-to-Aspeed-Flash-driver.patch
deleted file mode 100644
index 54ca792..0000000
--- a/common/recipes-bsp/u-boot/files/0002-Add-MTD-support-to-Aspeed-Flash-driver.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From e0943f339fcb502444135f880a3e630b8e42b004 Mon Sep 17 00:00:00 2001
-From: Adriana Kobylak <anoo@linux.vnet.ibm.com>
-Date: Mon, 7 Aug 2017 12:17:27 -0500
-Subject: [PATCH u-boot v2016.07-aspeed-openbmc] Add MTD support to Aspeed Flash driver
-
-Add support to the aspeed flash driver to enable the common mtd layer
-through CONFIG_FLASH_CFI_MTD.
-
-This enables the flash to be used by u-boot mtd drivers including
-the mtdparts and ubi commands.
-
-Signed-off-by: Adriana Kobylak <anoo@linux.vnet.ibm.com>
-Acked-by: Milton Miller <miltonm@us.ibm.com>
----
- arch/arm/mach-aspeed/flash.c | 20 ++++++++++++++++++++
- 1 file changed, 20 insertions(+)
-
-diff --git a/arch/arm/mach-aspeed/flash.c b/arch/arm/mach-aspeed/flash.c
-index 9c5ead6..e1e3cf8 100644
---- a/arch/arm/mach-aspeed/flash.c
-+++ b/arch/arm/mach-aspeed/flash.c
-@@ -124,6 +124,22 @@ flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];		/* FLASH chips info */
- /* specificspi */
- #define SpecificSPI_N25Q512	0x00000001
- 
-+#ifdef CONFIG_FLASH_CFI_MTD
-+static uint flash_verbose=1;
-+void flash_set_verbose(uint v)
-+{
-+	flash_verbose = v;
-+}
-+
-+unsigned long flash_sector_size(flash_info_t *info, flash_sect_t sect)
-+{
-+	if (sect != (info->sector_count - 1))
-+		return info->start[sect + 1] - info->start[sect];
-+	else
-+		return info->start[0] + info->size - info->start[sect];
-+}
-+#endif
-+
- /*-----------------------------------------------------------------------*/
- static u32 ast_spi_calculate_divisor(u32 max_speed_hz)
- {
-@@ -1372,6 +1388,10 @@ unsigned long flash_init (void)
- 		       flash_get_info(CONFIG_ENV_ADDR_REDUND));
- #endif
- 
-+#ifdef CONFIG_FLASH_CFI_MTD
-+	cfi_mtd_init();
-+#endif
-+
- 	return (size);
- }
- 
--- 
-1.8.2.2
-
diff --git a/common/recipes-bsp/u-boot/files/0003-Add-MTD-and-UBI-support-to-ast-g5.patch b/common/recipes-bsp/u-boot/files/0003-Add-MTD-and-UBI-support-to-ast-g5.patch
deleted file mode 100644
index dee4fd6..0000000
--- a/common/recipes-bsp/u-boot/files/0003-Add-MTD-and-UBI-support-to-ast-g5.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 88f9b7ab5e2f99054b8f3a4173296e0cb9129067 Mon Sep 17 00:00:00 2001
-From: Adriana Kobylak <anoo@linux.vnet.ibm.com>
-Date: Sun, 30 Jul 2017 16:13:43 -0500
-Subject: [PATCH u-boot v2016.07-aspeed-openbmc] Add MTD and UBI support to ast-g5
-
-Add MTD and UBI support to the default g5 include, conditioned to
-having MTDPARTS_DEFAULT defined.
-
-This allows platforms to enable this support if desired without
-adding it by default since it increases the size of u-boot.
-
-Signed-off-by: Adriana Kobylak <anoo@linux.vnet.ibm.com>
----
- include/configs/ast-g5-ncsi.h | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/include/configs/ast-g5-ncsi.h b/include/configs/ast-g5-ncsi.h
-index 12d6684..b126e6e 100644
---- a/include/configs/ast-g5-ncsi.h
-+++ b/include/configs/ast-g5-ncsi.h
-@@ -28,4 +28,14 @@
- 
- #define CONFIG_HW_WATCHDOG
- 
-+/* MTD and UBI */
-+#ifdef MTDPARTS_DEFAULT
-+#define CONFIG_FLASH_CFI_MTD
-+#define CONFIG_CMD_UBI
-+#define CONFIG_RBTREE
-+#define CONFIG_MTD_DEVICE
-+#define CONFIG_MTD_PARTITIONS
-+#define CONFIG_CMD_MTDPARTS
-+#endif
-+
- #endif	/* __AST_G5_NCSI_CONFIG_H */
--- 
-1.8.2.2
-
diff --git a/common/recipes-bsp/u-boot/u-boot.inc b/common/recipes-bsp/u-boot/u-boot.inc
index 1089ec4..a11fb7b 100644
--- a/common/recipes-bsp/u-boot/u-boot.inc
+++ b/common/recipes-bsp/u-boot/u-boot.inc
@@ -1,6 +1,6 @@
 LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
 
-SRCREV = "a5e0a21ed4b62ab4d8ff09f70b751db0f46ddaac"
+SRCREV = "1b3fb9515dcd280fca764b2521f152ca04d04701"
 UBRANCH = "v2016.07-aspeed-openbmc"
 SRC_URI = "git://git@github.com/openbmc/u-boot.git;branch=${UBRANCH};protocol=https"
 
@@ -8,8 +8,6 @@
 
 SRC_URI += "${@bb.utils.contains('MACHINE_FEATURES', 'obmc-ubi-fs', \
     'file://0001-config-ast-common-hack-bootopts.patch \
-     file://0002-Add-MTD-support-to-Aspeed-Flash-driver.patch \
-     file://0003-Add-MTD-and-UBI-support-to-ast-g5.patch \
      file://0004-config-ast-common-ubi-bootops.patch', '', d)}"
 
 PV = "v2016.07+git${SRCPV}"