Commit e856bdcf by Masahiro Yamada Committed by Tom Rini

flash: complete CONFIG_SYS_NO_FLASH move with renaming

We repeated partial moves for CONFIG_SYS_NO_FLASH, but this is not completed. Finish this work by the tool. During this move, let's rename it to CONFIG_MTD_NOR_FLASH. Actually, we have more instances of "#ifndef CONFIG_SYS_NO_FLASH" than those of "#ifdef CONFIG_SYS_NO_FLASH". Flipping the logic will make the code more readable. Besides, negative meaning symbols do not fit in obj-$(CONFIG_...) style Makefiles. This commit was created as follows: [1] Edit "default n" to "default y" in the config entry in common/Kconfig. [2] Run "tools/moveconfig.py -y -r HEAD SYS_NO_FLASH" [3] Rename the instances in defconfigs by the following: find . -path './configs/*_defconfig' | xargs sed -i \ -e '/CONFIG_SYS_NO_FLASH=y/d' \ -e 's/# CONFIG_SYS_NO_FLASH is not set/CONFIG_MTD_NOR_FLASH=y/' [4] Change the conditionals by the following: find . -name '*.[ch]' | xargs sed -i \ -e 's/ifndef CONFIG_SYS_NO_FLASH/ifdef CONFIG_MTD_NOR_FLASH/' \ -e 's/ifdef CONFIG_SYS_NO_FLASH/ifndef CONFIG_MTD_NOR_FLASH/' \ -e 's/!defined(CONFIG_SYS_NO_FLASH)/defined(CONFIG_MTD_NOR_FLASH)/' \ -e 's/defined(CONFIG_SYS_NO_FLASH)/!defined(CONFIG_MTD_NOR_FLASH)/' [5] Modify the following manually - Rename the rest of instances - Remove the description from README - Create the new Kconfig entry in drivers/mtd/Kconfig - Remove the old Kconfig entry from common/Kconfig - Remove the garbage comments from include/configs/*.h Signed-off-by: 's avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent a931e997
......@@ -2780,19 +2780,6 @@ The following options need to be configured:
this is instead controlled by the value of
/config/load-environment.
- Parallel Flash support:
CONFIG_SYS_NO_FLASH
Traditionally U-Boot was run on systems with parallel NOR
flash. This option is used to disable support for parallel NOR
flash. This option should be defined if the board does not have
parallel flash.
If this option is not defined one of the generic flash drivers
(e.g. CONFIG_FLASH_CFI_DRIVER or CONFIG_ST_SMI) must be
selected or the board must provide an implementation of the
flash API (see include/flash.h).
- DataFlash Support:
CONFIG_HAS_DATAFLASH
......
......@@ -1463,7 +1463,7 @@ void select_ldb_di_clock_source(enum ldb_di_clock clk)
}
#endif
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
void enable_eim_clk(unsigned char enable)
{
u32 reg;
......
......@@ -75,7 +75,7 @@ int board_eth_init(bd_t *bis)
}
#endif
#if !defined(CONFIG_SYS_NO_FLASH)
#if defined(CONFIG_MTD_NOR_FLASH)
#include <mtd/cfi_flash.h>
......@@ -157,11 +157,11 @@ static void detect_num_flash_banks(void)
debug("number of flash banks: %d\n", cfi_flash_num_flash_banks);
}
#else /* CONFIG_SYS_NO_FLASH */
#else /* CONFIG_MTD_NOR_FLASH */
static void detect_num_flash_banks(void)
{
};
#endif /* CONFIG_SYS_NO_FLASH */
#endif /* CONFIG_MTD_NOR_FLASH */
void support_card_late_init(void)
{
......
......@@ -21,7 +21,7 @@
DECLARE_GLOBAL_DATA_PTR;
#if !defined(CONFIG_SYS_NO_FLASH)
#if defined(CONFIG_MTD_NOR_FLASH)
extern flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */
#endif
......@@ -124,7 +124,7 @@ int board_early_init_f(void)
int misc_init_r(void)
{
#if !defined(CONFIG_SYS_NO_FLASH)
#if defined(CONFIG_MTD_NOR_FLASH)
uint pbcr;
int size_val = 0;
#endif
......@@ -136,7 +136,7 @@ int misc_init_r(void)
#endif
u32 reg;
#if !defined(CONFIG_SYS_NO_FLASH)
#if defined(CONFIG_MTD_NOR_FLASH)
/* Re-do flash sizing to get full correct info */
/* adjust flash start and offset */
......@@ -176,7 +176,7 @@ int misc_init_r(void)
CONFIG_ENV_ADDR_REDUND + 2*CONFIG_ENV_SECT_SIZE - 1,
&flash_info[0]);
#endif
#endif /* CONFIG_SYS_NO_FLASH */
#endif /* CONFIG_MTD_NOR_FLASH */
/*
* USB suff...
......
......@@ -166,14 +166,14 @@ static void at91sam9263ek_lcd_hw_init(void)
#include <nand.h>
#include <version.h>
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
extern flash_info_t flash_info[];
#endif
void lcd_show_board_info(void)
{
ulong dram_size, nand_size;
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
ulong flash_size;
#endif
int i;
......@@ -192,7 +192,7 @@ void lcd_show_board_info(void)
nand_size = 0;
for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
nand_size += nand_info[i]->size;
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
flash_size = 0;
for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++)
flash_size += flash_info[i].size;
......@@ -200,7 +200,7 @@ void lcd_show_board_info(void)
lcd_printf (" %ld MB SDRAM, %ld MB NAND",
dram_size >> 20,
nand_size >> 20 );
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
lcd_printf (",\n %ld MB NOR",
flash_size >> 20);
#endif
......
......@@ -68,7 +68,7 @@ void sama5d3xek_nand_hw_init(void)
}
#endif
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
static void sama5d3xek_nor_hw_init(void)
{
struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
......@@ -236,7 +236,7 @@ int board_init(void)
#ifdef CONFIG_NAND_ATMEL
sama5d3xek_nand_hw_init();
#endif
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
sama5d3xek_nor_hw_init();
#endif
#ifdef CONFIG_CMD_USB
......
......@@ -29,7 +29,7 @@ int checkboard(void)
#if defined(CONFIG_BFIN_MAC)
static void board_init_enetaddr(uchar *mac_addr)
{
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
/* we cram the MAC in the last flash sector */
uchar *board_mac_addr = (uchar *)0x203F0096;
if (is_valid_ethaddr(board_mac_addr)) {
......@@ -136,7 +136,7 @@ int misc_init_r(void)
board_init_enetaddr(enetaddr);
#endif
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
/* we use the last sector for the MAC address / POST LDR */
extern flash_info_t flash_info[];
flash_protect(FLAG_PROTECT_SET, 0x203F0000, 0x203FFFFF, &flash_info[0]);
......
......@@ -26,7 +26,7 @@ int checkboard(void)
#ifdef CONFIG_BFIN_MAC
static void board_init_enetaddr(uchar *mac_addr)
{
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
/* we cram the MAC in the last flash sector */
uchar *board_mac_addr = (uchar *)0x203F0096;
if (is_valid_ethaddr(board_mac_addr)) {
......@@ -50,7 +50,7 @@ int misc_init_r(void)
board_init_enetaddr(enetaddr);
#endif
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
/* we use the last sector for the MAC address / POST LDR */
extern flash_info_t flash_info[];
flash_protect(FLAG_PROTECT_SET, 0x203F0000, 0x203FFFFF, &flash_info[0]);
......
......@@ -29,7 +29,7 @@ int checkboard(void)
#ifdef CONFIG_BFIN_MAC
static void board_init_enetaddr(uchar *mac_addr)
{
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
/* we cram the MAC in the last flash sector */
uchar *board_mac_addr = (uchar *)0x203F0000;
if (is_valid_ethaddr(board_mac_addr)) {
......@@ -54,7 +54,7 @@ int misc_init_r(void)
board_init_enetaddr(enetaddr);
#endif
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
/* we use the last sector for the MAC address / POST LDR */
extern flash_info_t flash_info[];
flash_protect(FLAG_PROTECT_SET, 0x203F0000, 0x203FFFFF, &flash_info[0]);
......
......@@ -36,7 +36,7 @@ int checkboard(void)
#ifdef CONFIG_BFIN_MAC
static void board_init_enetaddr(uchar *mac_addr)
{
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
/* we cram the MAC in the last flash sector */
uchar *board_mac_addr = (uchar *)0x202F0000;
if (is_valid_ethaddr(board_mac_addr)) {
......@@ -63,7 +63,7 @@ int misc_init_r(void)
board_init_enetaddr(enetaddr);
#endif
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
/* we use the last sector for the MAC address / POST LDR */
extern flash_info_t flash_info[];
flash_protect(FLAG_PROTECT_SET, 0x202F0000, 0x202FFFFF, &flash_info[0]);
......
......@@ -151,7 +151,7 @@ void dsp_ddr_configure(void)
int board_early_init_r(void)
{
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
int flash_esel = find_tlb_idx((void *)flashbase, 1);
......
......@@ -9,7 +9,7 @@
#include <asm/mmu.h>
struct law_entry law_table[] = {
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_IFC),
#endif
#ifdef CONFIG_SYS_BMAN_MEM_PHYS
......
......@@ -9,7 +9,7 @@
#include <asm/mmu.h>
struct law_entry law_table[] = {
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_IFC),
#endif
#ifdef CONFIG_SYS_BMAN_MEM_PHYS
......
......@@ -9,7 +9,7 @@
#include <asm/mmu.h>
struct law_entry law_table[] = {
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_IFC),
#endif
#ifdef CONFIG_SYS_BMAN_MEM_PHYS
......
......@@ -9,7 +9,7 @@
#include <asm/mmu.h>
struct law_entry law_table[] = {
#ifndef CONFIG_SYS_NO_FLASH
#ifdef CONFIG_MTD_NOR_FLASH
SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_IFC),
#endif
#ifdef CONFIG_SYS_BMAN_MEM_PHYS
......
......@@ -136,7 +136,7 @@ void s_init(void)
/* SCIF Init */
pin_init();
#if !defined(CONFIG_SYS_NO_FLASH)
#if defined(CONFIG_MTD_NOR_FLASH)
struct rcar_lbsc *lbsc = (struct rcar_lbsc *)LBSC_BASE;
struct rcar_dbsc3 *dbsc3_0 = (struct rcar_dbsc3 *)DBSC3_0_BASE;
......@@ -300,7 +300,7 @@ void s_init(void)
/* This locks the access to the PHY unit registers */
writel(0x00000000, &dbsc3_0->dbpdlck);
#endif /* CONFIG_SYS_NO_FLASH */
#endif /* CONFIG_MTD_NOR_FLASH */
}
......@@ -368,21 +368,21 @@ int board_init(void)
gpio_request(GPIO_FN_A17, NULL);
gpio_request(GPIO_FN_A18, NULL);
gpio_request(GPIO_FN_A19, NULL);
#if defined(CONFIG_SYS_NO_FLASH)
#if !defined(CONFIG_MTD_NOR_FLASH)
gpio_request(GPIO_FN_MOSI_IO0, NULL);
gpio_request(GPIO_FN_MISO_IO1, NULL);
gpio_request(GPIO_FN_IO2, NULL);
gpio_request(GPIO_FN_IO3, NULL);
gpio_request(GPIO_FN_SPCLK, NULL);
gpio_request(GPIO_FN_SSL, NULL);
#else /* CONFIG_SYS_NO_FLASH */
#else /* CONFIG_MTD_NOR_FLASH */
gpio_request(GPIO_FN_A20, NULL);
gpio_request(GPIO_FN_A21, NULL);
gpio_request(GPIO_FN_A22, NULL);
gpio_request(GPIO_FN_A23, NULL);
gpio_request(GPIO_FN_A24, NULL);
gpio_request(GPIO_FN_A25, NULL);
#endif /* CONFIG_SYS_NO_FLASH */
#endif /* CONFIG_MTD_NOR_FLASH */
gpio_request(GPIO_FN_CS1_A26, NULL);
gpio_request(GPIO_FN_EX_CS0, NULL);
......
......@@ -31,7 +31,7 @@
#include <flash.h>
#ifdef CONFIG_SYS_NO_FLASH
#ifndef CONFIG_MTD_NOR_FLASH
# define OFFSET_ADJUSTMENT 0
#else
# define OFFSET_ADJUSTMENT (flash_info[id.num].start[0])
......
......@@ -25,7 +25,7 @@ int find_dev_and_part(const char *id, struct mtd_device **dev,
u8 *part_num, struct part_info **part);
#endif