sb/intel/x/sata.c: Use `get_int_option` for `sata_mode`
Change-Id: Ifd1f3969281e67d1a6ab7eb99dd048799c0cb17d Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/47108 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
This commit is contained in:
parent
8d94b36eed
commit
0a937754ee
|
@ -35,8 +35,7 @@ static void sata_read_resources(struct device *dev)
|
|||
|
||||
/* Assign fixed resources for IDE legacy mode */
|
||||
|
||||
u8 sata_mode = 0;
|
||||
get_option(&sata_mode, "sata_mode");
|
||||
u8 sata_mode = get_int_option("sata_mode", 0);
|
||||
if (sata_mode != 2)
|
||||
return;
|
||||
|
||||
|
@ -72,8 +71,7 @@ static void sata_read_resources(struct device *dev)
|
|||
static void sata_set_resources(struct device *dev)
|
||||
{
|
||||
/* work around bug in pci_dev_set_resources(), it bails out on FIXED */
|
||||
u8 sata_mode = 0;
|
||||
get_option(&sata_mode, "sata_mode");
|
||||
u8 sata_mode = get_int_option("sata_mode", 0);
|
||||
if (sata_mode == 2) {
|
||||
unsigned int i;
|
||||
for (i = PCI_BASE_ADDRESS_0; i <= PCI_BASE_ADDRESS_3; i += 4) {
|
||||
|
@ -92,7 +90,6 @@ static void sata_init(struct device *dev)
|
|||
u16 reg16;
|
||||
/* Get the chip configuration */
|
||||
config_t *config = dev->chip_info;
|
||||
u8 sata_mode;
|
||||
|
||||
printk(BIOS_DEBUG, "SATA: Initializing...\n");
|
||||
|
||||
|
@ -101,9 +98,8 @@ static void sata_init(struct device *dev)
|
|||
return;
|
||||
}
|
||||
|
||||
if (get_option(&sata_mode, "sata_mode") != CB_SUCCESS)
|
||||
/* Default to AHCI */
|
||||
sata_mode = 0;
|
||||
/* Default to AHCI */
|
||||
u8 sata_mode = get_int_option("sata_mode", 0);
|
||||
|
||||
/* SATA configuration */
|
||||
|
||||
|
@ -230,13 +226,11 @@ static void sata_enable(struct device *dev)
|
|||
/* Get the chip configuration */
|
||||
config_t *config = dev->chip_info;
|
||||
u16 map = 0;
|
||||
u8 sata_mode;
|
||||
|
||||
if (!config)
|
||||
return;
|
||||
|
||||
if (get_option(&sata_mode, "sata_mode") != CB_SUCCESS)
|
||||
sata_mode = 0;
|
||||
u8 sata_mode = get_int_option("sata_mode", 0);
|
||||
|
||||
/*
|
||||
* Set SATA controller mode early so the resource allocator can
|
||||
|
|
|
@ -142,7 +142,6 @@ static void sata_init(struct device *const dev)
|
|||
const u16 devid = pci_read_config16(dev, PCI_DEVICE_ID);
|
||||
const int is_mobile = (devid == PCI_DEVICE_ID_INTEL_82801IBM_IEM_SATA_IDE_P01) ||
|
||||
(devid == PCI_DEVICE_ID_INTEL_82801IBM_IEM_SATA_AHCI_P0145);
|
||||
u8 sata_mode;
|
||||
|
||||
printk(BIOS_DEBUG, "i82801ix_sata: initializing...\n");
|
||||
|
||||
|
@ -152,9 +151,8 @@ static void sata_init(struct device *const dev)
|
|||
return;
|
||||
}
|
||||
|
||||
if (get_option(&sata_mode, "sata_mode") != CB_SUCCESS)
|
||||
/* Default to AHCI */
|
||||
sata_mode = 0;
|
||||
/* Default to AHCI */
|
||||
u8 sata_mode = get_int_option("sata_mode", 0);
|
||||
|
||||
/*
|
||||
* TODO: In contrast to ICH7 and PCH code we don't set
|
||||
|
@ -225,14 +223,11 @@ static void sata_enable(struct device *dev)
|
|||
const config_t *const config = dev->chip_info;
|
||||
|
||||
u16 map = 0;
|
||||
u8 sata_mode;
|
||||
|
||||
if (!config)
|
||||
return;
|
||||
|
||||
if (get_option(&sata_mode, "sata_mode") != CB_SUCCESS)
|
||||
/* Default to AHCI */
|
||||
sata_mode = 0;
|
||||
u8 sata_mode = get_int_option("sata_mode", 0);
|
||||
|
||||
/*
|
||||
* Set SATA controller mode early so the resource allocator can
|
||||
|
|
|
@ -129,7 +129,6 @@ static void sata_init(struct device *const dev)
|
|||
|
||||
/* Get the chip configuration */
|
||||
const config_t *const config = dev->chip_info;
|
||||
u8 sata_mode;
|
||||
|
||||
printk(BIOS_DEBUG, "i82801jx_sata: initializing...\n");
|
||||
|
||||
|
@ -139,9 +138,8 @@ static void sata_init(struct device *const dev)
|
|||
return;
|
||||
}
|
||||
|
||||
if (get_option(&sata_mode, "sata_mode") != CB_SUCCESS)
|
||||
/* Default to AHCI */
|
||||
sata_mode = 0;
|
||||
/* Default to AHCI */
|
||||
u8 sata_mode = get_int_option("sata_mode", 0);
|
||||
|
||||
/*
|
||||
* TODO: In contrast to ICH7 and PCH code we don't set
|
||||
|
@ -202,14 +200,12 @@ static void sata_enable(struct device *dev)
|
|||
const config_t *const config = dev->chip_info;
|
||||
|
||||
u16 map = 0;
|
||||
u8 sata_mode;
|
||||
|
||||
if (!config)
|
||||
return;
|
||||
|
||||
if (get_option(&sata_mode, "sata_mode") != CB_SUCCESS)
|
||||
/* Default to AHCI */
|
||||
sata_mode = 0;
|
||||
/* Default to AHCI */
|
||||
u8 sata_mode = get_int_option("sata_mode", 0);
|
||||
|
||||
/*
|
||||
* Set SATA controller mode early so the resource allocator can
|
||||
|
|
|
@ -33,7 +33,6 @@ static void sata_init(struct device *dev)
|
|||
u16 reg16;
|
||||
/* Get the chip configuration */
|
||||
config_t *config = dev->chip_info;
|
||||
u8 sata_mode;
|
||||
|
||||
printk(BIOS_DEBUG, "SATA: Initializing...\n");
|
||||
|
||||
|
@ -42,9 +41,8 @@ static void sata_init(struct device *dev)
|
|||
return;
|
||||
}
|
||||
|
||||
if (get_option(&sata_mode, "sata_mode") != CB_SUCCESS)
|
||||
/* Default to AHCI */
|
||||
sata_mode = 0;
|
||||
/* Default to AHCI */
|
||||
u8 sata_mode = get_int_option("sata_mode", 0);
|
||||
|
||||
/* SATA configuration */
|
||||
|
||||
|
@ -172,13 +170,11 @@ static void sata_enable(struct device *dev)
|
|||
/* Get the chip configuration */
|
||||
config_t *config = dev->chip_info;
|
||||
u16 map = 0;
|
||||
u8 sata_mode;
|
||||
|
||||
if (!config)
|
||||
return;
|
||||
|
||||
if (get_option(&sata_mode, "sata_mode") != CB_SUCCESS)
|
||||
sata_mode = 0;
|
||||
u8 sata_mode = get_int_option("sata_mode", 0);
|
||||
|
||||
/*
|
||||
* Set SATA controller mode early so the resource allocator can
|
||||
|
|
Loading…
Reference in New Issue