Skip to content

Commit

Permalink
Kconfig: Add a CONFIG_IDE option
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sjg20 authored and trini committed May 22, 2017
1 parent 75eb997 commit fc843a0
Show file tree
Hide file tree
Showing 37 changed files with 60 additions and 53 deletions.
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion api/api_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-kirkwood/include/mach/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/cpu/mpc5xxx/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
#include <common.h>

#if defined(CONFIG_CMD_IDE)
#if defined(CONFIG_IDE)
#include <mpc5xxx.h>

DECLARE_GLOBAL_DATA_PTR;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions board/freescale/m5253demo/m5253demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ int testdram(void)
return (0);
}

#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE
#include <ata.h>
int ide_preinit(void)
{
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions board/freescale/m5253evbe/m5253evbe.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int testdram(void)
return (0);
}

#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE
#include <ata.h>
int ide_preinit(void)
{
Expand Down Expand Up @@ -126,4 +126,4 @@ void ide_set_reset(int idereset)
setbits_8(&ata->cr, 0x01);
}
}
#endif /* CONFIG_CMD_IDE */
#endif /* CONFIG_IDE */
2 changes: 1 addition & 1 deletion board/freescale/m54455evb/m54455evb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions board/intercontrol/digsy_mtc/digsy_mtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void pci_init_board(void)
}
#endif

#ifdef CONFIG_CMD_IDE
#ifdef CONFIG_IDE

#ifdef CONFIG_IDE_RESET

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion board/jupiter/jupiter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions board/phytec/pcm030/pcm030.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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) */
2 changes: 1 addition & 1 deletion board/tqc/tqm5200/tqm5200.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion board/v38b/v38b.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions cmd/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/pcmcia.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions common/board_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:");
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions drivers/block/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 1 addition & 0 deletions drivers/block/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion drivers/block/sil680.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/pcmcia/marubun_pcmcia.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define CONFIG_PCMCIA
#endif

#if defined(CONFIG_CMD_IDE)
#if defined(CONFIG_IDE)
#define CONFIG_PCMCIA
#endif

Expand Down
2 changes: 1 addition & 1 deletion drivers/pcmcia/mpc8xx_pcmcia.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion drivers/pcmcia/tqm8xx_pcmcia.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion fs/fat/fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) || \
Expand Down
6 changes: 3 additions & 3 deletions include/config_distro_bootcmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion include/config_fallbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) || \
Expand Down
2 changes: 1 addition & 1 deletion include/configs/M5253DEMO.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/configs/edminiv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions include/configs/ib62x0.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/configs/lsxl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/configs/mpc5121ads.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions include/configs/nsa310s.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit fc843a0

Please sign in to comment.