]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: uniphier: remove support for NOR Flash on support card
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 9 Jul 2020 06:08:17 +0000 (15:08 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 11 Jul 2020 12:30:21 +0000 (21:30 +0900)
I actually do not see this used these days because eMMC or NAND is used
for non-volatile devices. Dump the burden to maintain this crappy code.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
arch/arm/mach-uniphier/board_init.c
arch/arm/mach-uniphier/micro-support-card.c
arch/arm/mach-uniphier/sbc/sbc.c
configs/uniphier_ld4_sld8_defconfig
configs/uniphier_v7_defconfig
configs/uniphier_v8_defconfig
include/configs/uniphier.h

index 4f9cd6e722c15ecbbda2c33efaac45c76fb618f4..73b0f133ce0b44ec1056b8d83299b92f4ec71da0 100644 (file)
@@ -139,10 +139,6 @@ int board_init(void)
 
        led_puts("U3");
 
-       support_card_late_init();
-
-       led_puts("U4");
-
        uniphier_nand_reset_assert();
 
        led_puts("Uboo");
index b09ec54e1f1834301e7ea47270e3327158d3a3d4..fc266aae98fc2bef0c662ec1f24ac051879136b6 100644 (file)
@@ -5,7 +5,6 @@
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <config.h>
 #include <dm/of.h>
 #include <fdt_support.h>
 #include <linux/ctype.h>
@@ -107,102 +106,6 @@ void support_card_init(void)
        support_card_show_revision();
 }
 
-#if defined(CONFIG_MTD_NOR_FLASH)
-
-#include <mtd/cfi_flash.h>
-
-struct memory_bank {
-       phys_addr_t base;
-       unsigned long size;
-};
-
-static int mem_is_flash(const struct memory_bank *mem)
-{
-       const int loop = 128;
-       u32 *scratch_addr;
-       u32 saved_value;
-       int ret = 1;
-       int i;
-
-       /* just in case, use the tail of the memory bank */
-       scratch_addr = map_physmem(mem->base + mem->size - sizeof(u32) * loop,
-                                  sizeof(u32) * loop, MAP_NOCACHE);
-
-       for (i = 0; i < loop; i++, scratch_addr++) {
-               saved_value = readl(scratch_addr);
-               writel(~saved_value, scratch_addr);
-               if (readl(scratch_addr) != saved_value) {
-                       /* We assume no memory or SRAM here. */
-                       writel(saved_value, scratch_addr);
-                       ret = 0;
-                       break;
-               }
-       }
-
-       unmap_physmem(scratch_addr, MAP_NOCACHE);
-
-       return ret;
-}
-
-/* {address, size} */
-static const struct memory_bank memory_banks[] = {
-       {0x42000000, 0x01f00000},
-};
-
-static const struct memory_bank
-*flash_banks_list[CONFIG_SYS_MAX_FLASH_BANKS_DETECT];
-
-phys_addr_t cfi_flash_bank_addr(int i)
-{
-       return flash_banks_list[i]->base;
-}
-
-unsigned long cfi_flash_bank_size(int i)
-{
-       return flash_banks_list[i]->size;
-}
-
-static void detect_num_flash_banks(void)
-{
-       const struct memory_bank *memory_bank, *end;
-
-       cfi_flash_num_flash_banks = 0;
-
-       memory_bank = memory_banks;
-       end = memory_bank + ARRAY_SIZE(memory_banks);
-
-       for (; memory_bank < end; memory_bank++) {
-               if (cfi_flash_num_flash_banks >=
-                   CONFIG_SYS_MAX_FLASH_BANKS_DETECT)
-                       break;
-
-               if (mem_is_flash(memory_bank)) {
-                       flash_banks_list[cfi_flash_num_flash_banks] =
-                                                               memory_bank;
-
-                       debug("flash bank found: base = 0x%lx, size = 0x%lx\n",
-                             (unsigned long)memory_bank->base,
-                             (unsigned long)memory_bank->size);
-                       cfi_flash_num_flash_banks++;
-               }
-       }
-
-       debug("number of flash banks: %d\n", cfi_flash_num_flash_banks);
-}
-#else /* CONFIG_MTD_NOR_FLASH */
-static void detect_num_flash_banks(void)
-{
-};
-#endif /* CONFIG_MTD_NOR_FLASH */
-
-void support_card_late_init(void)
-{
-       if (!support_card_found)
-               return;
-
-       detect_num_flash_banks();
-}
-
 static const u8 ledval_num[] = {
        0x7e, /* 0 */
        0x0c, /* 1 */
index 04ed53981944667f3d75f36227dd7b5a35692d2c..519e67e3678a7182254cf61f0734c6fc863ce940 100644 (file)
@@ -20,7 +20,6 @@
 /* faster but LED does not work */
 #define SBCTRL0_SAVEPIN_MEM_VALUE      0x55450000
 #define SBCTRL1_SAVEPIN_MEM_VALUE      0x06057700
-/* NOR flash needs more wait counts than SRAM */
 #define SBCTRL2_SAVEPIN_MEM_VALUE      0x34000009
 #define SBCTRL4_SAVEPIN_MEM_VALUE      0x02110210
 
index cb1e8c9bb7e6c636b3f18a571d6951fb4cc5898f..3c9cab05faabfdb4432ac969ea2f0e6b3aa6102e 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_LOGLEVEL=6
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_CMD_CONFIG=y
-CONFIG_CMD_IMLS=y
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
@@ -44,8 +43,6 @@ CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=10
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_UNIPHIER=y
 CONFIG_MTD=y
-CONFIG_FLASH_CFI_DRIVER=y
-CONFIG_SYS_FLASH_CFI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_DENALI_DT=y
 CONFIG_SPL_NAND_DENALI=y
index 07c38a24adaa2ca92f22269fd3b18a8330bdd1ab..48958b1183a971b63cea247aec82ec2a95b549c9 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_LOGLEVEL=6
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_CMD_CONFIG=y
-CONFIG_CMD_IMLS=y
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
@@ -45,8 +44,6 @@ CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=10
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_UNIPHIER=y
 CONFIG_MTD=y
-CONFIG_FLASH_CFI_DRIVER=y
-CONFIG_SYS_FLASH_CFI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_DENALI_DT=y
 CONFIG_SPL_NAND_DENALI=y
index 9edb7ec4bfe09042defea0a8e1346fdd9affa522..9ab3e26b98f1974d0bc987490c21f231ea112800 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="env exist ${bootdev}preboot && run ${bootdev}preboot"
 CONFIG_LOGLEVEL=6
 CONFIG_CMD_CONFIG=y
-CONFIG_CMD_IMLS=y
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
@@ -45,8 +44,6 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ADMA=y
 CONFIG_MMC_SDHCI_CADENCE=y
 CONFIG_MTD=y
-CONFIG_FLASH_CFI_DRIVER=y
-CONFIG_SYS_FLASH_CFI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_DENALI_DT=y
 CONFIG_SNI_AVE=y
index 2e1204fc86c733c418cff390ce0e5b50beae7f03..03bbbab3cfc2622967a426e5b4f0e87694f034b5 100644 (file)
 
 #define CONFIG_ARMV7_PSCI_1_0
 
-/*-----------------------------------------------------------------------
- * MMU and Cache Setting
- *----------------------------------------------------------------------*/
-
 #define CONFIG_SYS_MALLOC_LEN          (4 * 1024 * 1024)
 
 #define CONFIG_TIMESTAMP
 
-/* FLASH related */
-
-#define CONFIG_SYS_MAX_FLASH_SECT      256
 #define CONFIG_SYS_MONITOR_BASE                0
 #define CONFIG_SYS_MONITOR_LEN         0x00200000      /* 2MB */
-#define CONFIG_SYS_FLASH_BASE          0
-
-/*
- * flash_toggle does not work for our support card.
- * We need to use flash_status_poll.
- */
-#define CONFIG_SYS_CFI_FLASH_STATUS_POLL
-
-#define CONFIG_FLASH_SHOW_PROGRESS     45 /* count down from 45/5: 9..1 */
-
-#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT 1
-
-/* serial console configuration */
 
 #define CONFIG_SYS_CBSIZE              1024    /* Console I/O Buffer Size */
 /* Boot Argument Buffer Size */