summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2017-08-15 20:08:42 -0500
committerAdriana Kobylak <anoo@us.ibm.com>2017-08-18 11:52:24 -0500
commit6d4ec4128ef813f26b6ec73c68e71272ce31fb6b (patch)
tree4c60d8512cf59a42696784ba853741318c31cc41
parentdfd2dd23f2d80f03125a99c20a80f01f19f055a3 (diff)
downloadtalos-openbmc-6d4ec4128ef813f26b6ec73c68e71272ce31fb6b.tar.gz
talos-openbmc-6d4ec4128ef813f26b6ec73c68e71272ce31fb6b.zip
u-boot: 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. Change-Id: Ib95d778fdb88ec0e62a8f53e651795b4f40041d9 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
-rw-r--r--meta-phosphor/common/recipes-bsp/u-boot/files/0002-Add-MTD-support-to-Aspeed-Flash-driver.patch58
-rw-r--r--meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc3
2 files changed, 60 insertions, 1 deletions
diff --git a/meta-phosphor/common/recipes-bsp/u-boot/files/0002-Add-MTD-support-to-Aspeed-Flash-driver.patch b/meta-phosphor/common/recipes-bsp/u-boot/files/0002-Add-MTD-support-to-Aspeed-Flash-driver.patch
new file mode 100644
index 000000000..54ca792bd
--- /dev/null
+++ b/meta-phosphor/common/recipes-bsp/u-boot/files/0002-Add-MTD-support-to-Aspeed-Flash-driver.patch
@@ -0,0 +1,58 @@
+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/meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc b/meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc
index 03b7a6130..1eddea350 100644
--- a/meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc
+++ b/meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc
@@ -5,7 +5,8 @@ UBRANCH = "v2016.07-aspeed-openbmc"
SRC_URI = "git://git@github.com/openbmc/u-boot.git;branch=${UBRANCH};protocol=https"
SRC_URI += "${@bb.utils.contains('MACHINE_FEATURES', 'obmc-ubi-fs', \
- 'file://0001-config-ast-common-hack-bootopts.patch', '', d)}"
+ 'file://0001-config-ast-common-hack-bootopts.patch \
+ file://0002-Add-MTD-support-to-Aspeed-Flash-driver.patch', '', d)}"
PV = "v2016.07+git${SRCPV}"
OpenPOWER on IntegriCloud