diff options
author | Adriana Kobylak <anoo@linux.vnet.ibm.com> | 2017-08-07 16:20:37 -0500 |
---|---|---|
committer | Andrew Jeffery <andrew@aj.id.au> | 2017-08-24 13:33:42 +0930 |
commit | 4b96bad5f6f69b838b7a7b660f66fcaed84aa37a (patch) | |
tree | 983efc1ef4822aefd9d967aae668fd7e3ca38107 /arch | |
parent | a5e0a21ed4b62ab4d8ff09f70b751db0f46ddaac (diff) | |
download | talos-obmc-uboot-4b96bad5f6f69b838b7a7b660f66fcaed84aa37a.tar.gz talos-obmc-uboot-4b96bad5f6f69b838b7a7b660f66fcaed84aa37a.zip |
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>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-aspeed/flash.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-aspeed/flash.c b/arch/arm/mach-aspeed/flash.c index 9c5ead6fd7..e1e3cf8d7f 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); } |