Kconfig: Add a CONFIG_IDE option

At present IDE support is controlled by CONFIG_CMD_IDE. Add a separate
CONFIG_IDE option so that IDE support can be enabled without requiring
the 'ide' command.

Update existing users and move the ide driver into drivers/block since
it should not be in common/.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2017-05-17 03:25:30 -06:00 committed by Tom Rini
parent 75eb9976b7
commit fc843a02ac
37 changed files with 60 additions and 53 deletions

2
README
View File

@ -1081,7 +1081,7 @@ The following options need to be configured:
disk/part_efi.c
CONFIG_MTD_PARTITIONS Memory Technology Device partition table.
If IDE or SCSI support is enabled (CONFIG_CMD_IDE or
If IDE or SCSI support is enabled (CONFIG_IDE or
CONFIG_SCSI) you must configure support for at
least one non-MTD partition type as well.

View File

@ -46,7 +46,7 @@ static struct stor_spec specs[ENUM_MAX] = { { 0, 0, 0, 0, NULL }, };
void dev_stor_init(void)
{
#if defined(CONFIG_CMD_IDE)
#if defined(CONFIG_IDE)
specs[ENUM_IDE].max_dev = CONFIG_SYS_IDE_MAXDEVICE;
specs[ENUM_IDE].enum_started = 0;
specs[ENUM_IDE].enum_ended = 0;

View File

@ -95,7 +95,7 @@
/*
* IDE Support on SATA ports
*/
#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE
#define __io
#define CONFIG_MVSATA_IDE
#define CONFIG_IDE_PREINIT
@ -110,12 +110,12 @@
#define CONFIG_SYS_ATA_STRIDE 4
/* Controller supports 48-bits LBA addressing */
#define CONFIG_LBA48
/* CONFIG_CMD_IDE requires some #defines for ATA registers */
/* CONFIG_IDE requires some #defines for ATA registers */
#define CONFIG_SYS_IDE_MAXBUS 2
#define CONFIG_SYS_IDE_MAXDEVICE 2
/* ATA registers base is at SATA controller base */
#define CONFIG_SYS_ATA_BASE_ADDR MV_SATA_BASE
#endif /* CONFIG_CMD_IDE */
#endif /* CONFIG_IDE */
/*
* I2C related stuff

View File

@ -8,7 +8,7 @@
*/
#include <common.h>
#if defined(CONFIG_CMD_IDE)
#if defined(CONFIG_IDE)
#include <mpc5xxx.h>
DECLARE_GLOBAL_DATA_PTR;

View File

@ -35,7 +35,7 @@ obj-y += cache.o
obj-y += extable.o
obj-y += interrupts.o
obj-$(CONFIG_CMD_KGDB) += kgdb.o
obj-$(CONFIG_CMD_IDE) += ide.o
obj-$(CONFIG_IDE) += ide.o
obj-y += stack.o
obj-y += time.o

View File

@ -88,7 +88,7 @@ int testdram(void)
return (0);
}
#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE
#include <ata.h>
int ide_preinit(void)
{
@ -133,7 +133,7 @@ void ide_set_reset(int idereset)
setbits_8(&ata->cr, 0x01);
}
}
#endif /* CONFIG_CMD_IDE */
#endif /* CONFIG_IDE */
#ifdef CONFIG_DRIVER_DM9000

View File

@ -81,7 +81,7 @@ int testdram(void)
return (0);
}
#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE
#include <ata.h>
int ide_preinit(void)
{
@ -126,4 +126,4 @@ void ide_set_reset(int idereset)
setbits_8(&ata->cr, 0x01);
}
}
#endif /* CONFIG_CMD_IDE */
#endif /* CONFIG_IDE */

View File

@ -88,7 +88,7 @@ int testdram(void)
return (0);
}
#if defined(CONFIG_CMD_IDE)
#if defined(CONFIG_IDE)
#include <ata.h>
int ide_preinit(void)

View File

@ -325,7 +325,7 @@ void pci_init_board(void)
}
#endif
#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE
#ifdef CONFIG_IDE_RESET
@ -369,7 +369,7 @@ void ide_set_reset(int idereset)
setbits_be32((void *)MPC5XXX_WU_GPIO_ENABLE, (1 << 25));
}
#endif /* CONFIG_IDE_RESET */
#endif /* CONFIG_CMD_IDE */
#endif /* CONFIG_IDE */
#ifdef CONFIG_OF_BOARD_SETUP
static void ft_delete_node(void *fdt, const char *compat)

View File

@ -259,7 +259,7 @@ void pci_init_board(void)
}
#endif
#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
#if defined(CONFIG_IDE) && defined(CONFIG_IDE_RESET)
void init_ide_reset (void)
{

View File

@ -176,7 +176,7 @@ int ft_board_setup(void *blob, bd_t *bd)
}
#endif /* CONFIG_OF_BOARD_SETUP */
#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
#if defined(CONFIG_IDE) && defined(CONFIG_IDE_RESET)
#define GPIO_PSC2_4 0x02000000UL
@ -206,4 +206,4 @@ void ide_set_reset(int idereset)
} else
setbits_be32(&wu_gpio->dvo, GPIO_PSC2_4);
}
#endif /* defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET) */
#endif /* defined(CONFIG_IDE) && defined(CONFIG_IDE_RESET) */

View File

@ -312,7 +312,7 @@ void pci_init_board(void)
}
#endif
#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
#if defined(CONFIG_IDE) && defined(CONFIG_IDE_RESET)
#if defined (CONFIG_MINIFAP)
#define SM501_POWER_MODE0_GATE 0x00000040UL

View File

@ -224,7 +224,7 @@ int misc_init_r(void)
return 0;
}
#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
#if defined(CONFIG_IDE) && defined(CONFIG_IDE_RESET)
void init_ide_reset(void)
{
debug("init_ide_reset\n");

View File

@ -486,6 +486,7 @@ config CMD_DEMO
config CMD_IDE
bool "ide - Support for IDE drivers"
select IDE
help
Provides an 'ide' command which allows accessing the IDE drive,
reseting the IDE interface, printing the partition table and

View File

@ -83,7 +83,7 @@ U_BOOT_CMD(
#undef CHECK_IDE_DEVICE
#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
#if defined(CONFIG_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
#define CHECK_IDE_DEVICE
#endif

View File

@ -145,7 +145,6 @@ obj-y += dlmalloc.o
ifdef CONFIG_SYS_MALLOC_F_LEN
obj-y += malloc_simple.o
endif
obj-$(CONFIG_CMD_IDE) += ide.o
obj-y += image.o
obj-$(CONFIG_ANDROID_BOOT_IMAGE) += image-android.o
obj-$(CONFIG_$(SPL_)OF_LIBFDT) += image-fdt.o

View File

@ -23,9 +23,7 @@
#include <dm.h>
#include <environment.h>
#include <fdtdec.h>
#if defined(CONFIG_CMD_IDE)
#include <ide.h>
#endif
#include <initcall.h>
#include <init_helpers.h>
#ifdef CONFIG_PS2KBD
@ -611,7 +609,7 @@ static int initr_post(void)
}
#endif
#if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_CMD_IDE)
#if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_IDE)
static int initr_pcmcia(void)
{
puts("PCMCIA:");
@ -620,7 +618,7 @@ static int initr_pcmcia(void)
}
#endif
#if defined(CONFIG_CMD_IDE)
#if defined(CONFIG_IDE)
static int initr_ide(void)
{
#ifdef CONFIG_IDE_8xx_PCCARD
@ -870,10 +868,10 @@ static init_fnc_t init_sequence_r[] = {
#ifdef CONFIG_POST
initr_post,
#endif
#if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_CMD_IDE)
#if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_IDE)
initr_pcmcia,
#endif
#if defined(CONFIG_CMD_IDE)
#if defined(CONFIG_IDE)
initr_ide,
#endif
#ifdef CONFIG_LAST_STAGE_INIT

View File

@ -59,3 +59,11 @@ config DWC_AHCI
Synopsys DWC AHCI module.
endmenu
config IDE
bool "Support IDE controllers"
help
Enables support for IDE (Integrated Drive Electronics) hard drives.
This allows access to raw blocks and filesystems on an IDE drive
from U-Boot. See also CMD_IDE which provides an 'ide' command for
performing various IDE operations.

View File

@ -17,6 +17,7 @@ obj-$(CONFIG_DM_SCSI) += scsi-uclass.o
obj-$(CONFIG_SCSI_AHCI) += ahci.o
obj-$(CONFIG_DWC_AHSATA) += dwc_ahsata.o
obj-$(CONFIG_FSL_SATA) += fsl_sata.o
obj-$(CONFIG_IDE) += ide.o
obj-$(CONFIG_IDE_FTIDE020) += ftide020.o
obj-$(CONFIG_LIBATA) += libata.o
obj-$(CONFIG_MVSATA_IDE) += mvsata_ide.o

View File

@ -17,7 +17,7 @@
* incorrect for the target board (e.g. the sequoia board requires 0).
* #define CONFIG_SYS_PCI_CACHE_LINE_SIZE 0
*
* #define CONFIG_CMD_IDE
* #define CONFIG_IDE
* #undef CONFIG_IDE_8xx_DIRECT
* #undef CONFIG_IDE_LED
* #undef CONFIG_IDE_RESET

View File

@ -17,7 +17,7 @@
#define CONFIG_PCMCIA
#endif
#if defined(CONFIG_CMD_IDE)
#if defined(CONFIG_IDE)
#define CONFIG_PCMCIA
#endif

View File

@ -9,7 +9,7 @@
#define CONFIG_PCMCIA
#endif
#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
#if defined(CONFIG_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
#define CONFIG_PCMCIA
#endif

View File

@ -15,7 +15,7 @@
#define CONFIG_PCMCIA
#endif
#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
#if defined(CONFIG_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
#define CONFIG_PCMCIA
#endif

View File

@ -1250,7 +1250,7 @@ int file_fat_detectfs(void)
return 1;
}
#if defined(CONFIG_CMD_IDE) || \
#if defined(CONFIG_IDE) || \
defined(CONFIG_CMD_SATA) || \
defined(CONFIG_SCSI) || \
defined(CONFIG_CMD_USB) || \

View File

@ -186,16 +186,16 @@
BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_SCSI
#endif
#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE
#define BOOTENV_SHARED_IDE BOOTENV_SHARED_BLKDEV(ide)
#define BOOTENV_DEV_IDE BOOTENV_DEV_BLKDEV
#define BOOTENV_DEV_NAME_IDE BOOTENV_DEV_NAME_BLKDEV
#else
#define BOOTENV_SHARED_IDE
#define BOOTENV_DEV_IDE \
BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_CMD_IDE
BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_IDE
#define BOOTENV_DEV_NAME_IDE \
BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_CMD_IDE
BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_IDE
#endif
#if defined(CONFIG_CMD_PCI_ENUM) || defined(CONFIG_DM_PCI)

View File

@ -43,7 +43,7 @@
#endif
/* Rather than repeat this expression each time, add a define for it */
#if defined(CONFIG_CMD_IDE) || \
#if defined(CONFIG_IDE) || \
defined(CONFIG_CMD_SATA) || \
defined(CONFIG_SCSI) || \
defined(CONFIG_CMD_USB) || \

View File

@ -38,7 +38,7 @@
* Command line configuration.
*/
#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE
/* ATA */
# define CONFIG_IDE_RESET 1
# define CONFIG_IDE_PREINIT 1

View File

@ -139,7 +139,7 @@
/*
* IDE
*/
#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE
#define __io
#define CONFIG_IDE_PREINIT
/* ED Mini V has an IDE-compatible SATA connector for port 1 */

View File

@ -87,14 +87,14 @@
/*
* SATA driver configuration
*/
#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE
#define __io
#define CONFIG_IDE_PREINIT
#define CONFIG_MVSATA_IDE_USE_PORT0
#define CONFIG_MVSATA_IDE_USE_PORT1
#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
#endif /* CONFIG_CMD_IDE */
#endif /* CONFIG_IDE */
/*
* RTC driver configuration

View File

@ -145,7 +145,7 @@
#undef CONFIG_RESET_PHY_R
#endif /* CONFIG_CMD_NET */
#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE
#undef CONFIG_IDE_LED
#undef CONFIG_SYS_IDE_MAXBUS
#define CONFIG_SYS_IDE_MAXBUS 1

View File

@ -411,10 +411,10 @@
"1m(u-boot);" \
"mpc5121.nand:-(data)"
#if defined(CONFIG_CMD_IDE) || defined(CONFIG_CMD_EXT2) || defined(CONFIG_CMD_USB)
#if defined(CONFIG_IDE) || defined(CONFIG_CMD_EXT2) || defined(CONFIG_CMD_USB)
#define CONFIG_SUPPORT_VFAT
#endif /* defined(CONFIG_CMD_IDE) */
#endif /* defined(CONFIG_IDE) */
/*
* Watchdog timeout = CONFIG_SYS_WATCHDOG_VALUE * 65536 / IPS clock.

View File

@ -79,12 +79,12 @@
#endif /* CONFIG_CMD_NET */
/* SATA driver configuration */
#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE
#define __io
#define CONFIG_IDE_PREINIT
#define CONFIG_MVSATA_IDE_USE_PORT0
#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
#endif /* CONFIG_CMD_IDE */
#endif /* CONFIG_IDE */
/* RTC driver configuration */
#ifdef CONFIG_CMD_DATE

View File

@ -25,9 +25,9 @@
* - AHCI controller is supported for QEMU '-M q35' target
*
* Default configuraion is to support the QEMU default x86 target
* Undefine CONFIG_CMD_IDE to support q35 target
* Undefine CONFIG_IDE to support q35 target
*/
#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE
#define CONFIG_SYS_IDE_MAXBUS 2
#define CONFIG_SYS_IDE_MAXDEVICE 4
#define CONFIG_SYS_ATA_BASE_ADDR 0

View File

@ -119,7 +119,7 @@
#endif
/* Compact flash Support */
#if defined(CONFIG_CMD_IDE)
#if defined(CONFIG_IDE)
#define CONFIG_IDE_RESET 1
#define CONFIG_SYS_PIO_MODE 1
#define CONFIG_SYS_IDE_MAXBUS 1 /* IDE bus */
@ -130,6 +130,6 @@
#define CONFIG_SYS_ATA_REG_OFFSET 0x1000 /* reg offset */
#define CONFIG_SYS_ATA_ALT_OFFSET 0x800 /* alternate register offset */
#define CONFIG_IDE_SWAP_IO
#endif /* CONFIG_CMD_IDE */
#endif /* CONFIG_IDE */
#endif /* __R7780RP_H */

View File

@ -90,13 +90,13 @@
/*
* SATA driver configuration
*/
#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE
#define __io
#define CONFIG_IDE_PREINIT
#define CONFIG_MVSATA_IDE_USE_PORT0
#define CONFIG_MVSATA_IDE_USE_PORT1
#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
#endif /* CONFIG_CMD_IDE */
#endif /* CONFIG_IDE */
#endif /* _CONFIG_SHEEVAPLUG_H */

View File

@ -16,7 +16,7 @@
* or try to generate a useful default
*/
#if defined(CONFIG_CMD_PCMCIA) || \
(defined(CONFIG_CMD_IDE) && \
(defined(CONFIG_IDE) && \
(defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT) ) )
#if !defined(CONFIG_PCMCIA_SLOT_A) && !defined(CONFIG_PCMCIA_SLOT_B)
@ -268,7 +268,7 @@ extern u_int *pcmcia_pgcrx[];
#define PCMCIA_PGCRX(slot) (*pcmcia_pgcrx[slot])
#endif
#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
#if defined(CONFIG_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
extern int check_ide_device(int slot);
#endif