summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-04-26 17:10:28 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-05-06 14:48:15 +0000
commit88dcb3179b4b78a2376609577ae4dd4327fb59c7 (patch)
tree9c1ae01959fb4d084ea30893a196687c7b611fff /src/mainboard
parenta2cf34129fb3b2a9302bb7cf06e4ee758b9bb85a (diff)
downloadcoreboot-88dcb3179b4b78a2376609577ae4dd4327fb59c7.tar.xz
src: Retype option API to use unsigned integers
The CMOS option system does not support negative integers. Thus, retype and rename the option API functions to reflect this. Change-Id: Id3480e5cfc0ec90674def7ef0919e0b7ac5b19b3 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/52672 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Felix Singer <felixsinger@posteo.net>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/asus/am1i-a/BiosCallOuts.c4
-rw-r--r--src/mainboard/asus/p8z77-m_pro/early_init.c6
-rw-r--r--src/mainboard/dell/optiplex_9010/sch5545_ec.c2
-rw-r--r--src/mainboard/getac/p470/early_init.c2
-rw-r--r--src/mainboard/ibase/mb899/superio_hwm.c18
-rw-r--r--src/mainboard/kontron/986lcd-m/early_init.c2
-rw-r--r--src/mainboard/kontron/986lcd-m/mainboard.c16
-rw-r--r--src/mainboard/kontron/bsl6/romstage.c2
-rw-r--r--src/mainboard/kontron/bsl6/variants/boxer26/romstage.c2
-rw-r--r--src/mainboard/kontron/ktqm77/mainboard.c4
-rw-r--r--src/mainboard/lenovo/t430s/variants/t430s/romstage.c2
-rw-r--r--src/mainboard/lenovo/t440p/romstage.c2
-rw-r--r--src/mainboard/lenovo/x60/smihandler.c4
-rw-r--r--src/mainboard/roda/rk886ex/early_init.c2
-rw-r--r--src/mainboard/siemens/chili/romstage.c4
-rw-r--r--src/mainboard/siemens/chili/variants/chili/romstage.c2
-rw-r--r--src/mainboard/supermicro/x10slm-f/mainboard.c2
17 files changed, 38 insertions, 38 deletions
diff --git a/src/mainboard/asus/am1i-a/BiosCallOuts.c b/src/mainboard/asus/am1i-a/BiosCallOuts.c
index e20f4f4cf7..1e91906a72 100644
--- a/src/mainboard/asus/am1i-a/BiosCallOuts.c
+++ b/src/mainboard/asus/am1i-a/BiosCallOuts.c
@@ -87,7 +87,7 @@ void board_FCH_InitReset(struct sysinfo *cb_NA, FCH_RESET_DATA_BLOCK *FchParams_
FchParams_reset->Mode = 6;
/* Read SATA speed setting from CMOS */
- FchParams_reset->SataSetMaxGen2 = get_int_option("sata_speed", 0);
+ FchParams_reset->SataSetMaxGen2 = get_uint_option("sata_speed", 0);
printk(BIOS_DEBUG, "Force SATA 3Gbps mode = %x\n", FchParams_reset->SataSetMaxGen2);
}
@@ -102,7 +102,7 @@ void board_FCH_InitEnv(struct sysinfo *cb_NA, FCH_DATA_BLOCK *FchParams_env)
FchParams_env->Hwm.HwmFchtsiAutoPoll = FALSE;/* 1 enable, 0 disable TSI Auto Polling */
/* Read SATA controller mode from CMOS */
- FchParams_env->Sata.SataClass = get_int_option("sata_mode", 0);
+ FchParams_env->Sata.SataClass = get_uint_option("sata_mode", 0);
switch ((SATA_CLASS)FchParams_env->Sata.SataClass) {
case SataLegacyIde:
diff --git a/src/mainboard/asus/p8z77-m_pro/early_init.c b/src/mainboard/asus/p8z77-m_pro/early_init.c
index d7125d62e5..78ad877715 100644
--- a/src/mainboard/asus/p8z77-m_pro/early_init.c
+++ b/src/mainboard/asus/p8z77-m_pro/early_init.c
@@ -69,15 +69,15 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
* 3 = Smart Auto : same than Auto, but if OS loads USB3 driver
* and reboots, it will keep the USB3.0 speed
*/
- int usb3_mode = get_int_option("usb3_mode", 1);
+ unsigned int usb3_mode = get_uint_option("usb3_mode", 1);
usb3_mode &= 0x3; /* ensure it's 0/1/2/3 only */
/* Load USB3 pre-OS xHCI driver */
- int usb3_drv = get_int_option("usb3_drv", 1);
+ unsigned int usb3_drv = get_uint_option("usb3_drv", 1);
usb3_drv &= 0x1; /* ensure it's 0/1 only */
/* Use USB3 xHCI streams */
- int usb3_streams = get_int_option("usb3_streams", 1);
+ unsigned int usb3_streams = get_uint_option("usb3_streams", 1);
usb3_streams &= 0x1; /* ensure it's 0/1 only */
struct pei_data pd = {
diff --git a/src/mainboard/dell/optiplex_9010/sch5545_ec.c b/src/mainboard/dell/optiplex_9010/sch5545_ec.c
index 9e25f18faa..60cde7d9af 100644
--- a/src/mainboard/dell/optiplex_9010/sch5545_ec.c
+++ b/src/mainboard/dell/optiplex_9010/sch5545_ec.c
@@ -656,7 +656,7 @@ void sch5545_ec_hwm_init(void *unused)
ec_read_write_reg(EC_HWM_LDN, 0x02fc, &val_2fc, WRITE_OP);
- unsigned int fan_speed_full = get_int_option("fan_full_speed", 0);
+ unsigned int fan_speed_full = get_uint_option("fan_full_speed", 0);
if (fan_speed_full) {
printk(BIOS_INFO, "Will set up fans to run at full speed\n");
ec_read_write_reg(EC_HWM_LDN, 0x0080, &val, READ_OP);
diff --git a/src/mainboard/getac/p470/early_init.c b/src/mainboard/getac/p470/early_init.c
index 1ca9b79c1e..c28d602115 100644
--- a/src/mainboard/getac/p470/early_init.c
+++ b/src/mainboard/getac/p470/early_init.c
@@ -35,7 +35,7 @@ void mainboard_lpc_decode(void)
{
int lpt_en = 0;
- if (get_int_option("lpt", 0))
+ if (get_uint_option("lpt", 0))
lpt_en = LPT_LPC_EN; /* enable LPT */
// decode range
diff --git a/src/mainboard/ibase/mb899/superio_hwm.c b/src/mainboard/ibase/mb899/superio_hwm.c
index e1189a595b..f2c313ecc6 100644
--- a/src/mainboard/ibase/mb899/superio_hwm.c
+++ b/src/mainboard/ibase/mb899/superio_hwm.c
@@ -48,17 +48,17 @@ struct temperature temperatures[] = {
void hwm_setup(void)
{
- int cpufan_control = 0, sysfan_control = 0;
- int cpufan_speed = 0, sysfan_speed = 0;
- int cpufan_temperature = 0, sysfan_temperature = 0;
+ unsigned int cpufan_control = 0, sysfan_control = 0;
+ unsigned int cpufan_speed = 0, sysfan_speed = 0;
+ unsigned int cpufan_temperature = 0, sysfan_temperature = 0;
- cpufan_control = get_int_option("cpufan_cruise_control", FAN_CRUISE_CONTROL_DISABLED);
- cpufan_speed = get_int_option("cpufan_speed", FAN_SPEED_5625);
- //cpufan_temperature = get_int_option("cpufan_temperature", FAN_TEMPERATURE_30DEGC);
+ cpufan_control = get_uint_option("cpufan_cruise_control", FAN_CRUISE_CONTROL_DISABLED);
+ cpufan_speed = get_uint_option("cpufan_speed", FAN_SPEED_5625);
+ //cpufan_temperature = get_uint_option("cpufan_temperature", FAN_TEMPERATURE_30DEGC);
- sysfan_control = get_int_option("sysfan_cruise_control", FAN_CRUISE_CONTROL_DISABLED);
- sysfan_speed = get_int_option("sysfan_speed", FAN_SPEED_5625);
- //sysfan_temperature = get_int_option("sysfan_temperature", FAN_TEMPERATURE_30DEGC);
+ sysfan_control = get_uint_option("sysfan_cruise_control", FAN_CRUISE_CONTROL_DISABLED);
+ sysfan_speed = get_uint_option("sysfan_speed", FAN_SPEED_5625);
+ //sysfan_temperature = get_uint_option("sysfan_temperature", FAN_TEMPERATURE_30DEGC);
// pnp_write_hwm5_index(HWM_BASE, 0x31, 0x20); // AVCC high limit
// pnp_write_hwm5_index(HWM_BASE, 0x34, 0x06); // VIN2 low limit
diff --git a/src/mainboard/kontron/986lcd-m/early_init.c b/src/mainboard/kontron/986lcd-m/early_init.c
index ff3babb45e..5bed24bec7 100644
--- a/src/mainboard/kontron/986lcd-m/early_init.c
+++ b/src/mainboard/kontron/986lcd-m/early_init.c
@@ -15,7 +15,7 @@ void mainboard_lpc_decode(void)
{
int lpt_en = 0;
- if (get_int_option("lpt", 0))
+ if (get_uint_option("lpt", 0))
lpt_en = LPT_LPC_EN; /* enable LPT */
pci_update_config16(PCI_DEV(0, 0x1f, 0), LPC_EN, ~LPT_LPC_EN, lpt_en);
diff --git a/src/mainboard/kontron/986lcd-m/mainboard.c b/src/mainboard/kontron/986lcd-m/mainboard.c
index f13731bcf2..f621f9bd7c 100644
--- a/src/mainboard/kontron/986lcd-m/mainboard.c
+++ b/src/mainboard/kontron/986lcd-m/mainboard.c
@@ -46,15 +46,15 @@ struct temperature temperatures[] = {
static void hwm_setup(void)
{
- int cpufan_control = 0, sysfan_control = 0;
- int cpufan_speed = 0, sysfan_speed = 0;
- int cpufan_temperature = 0, sysfan_temperature = 0;
+ unsigned int cpufan_control = 0, sysfan_control = 0;
+ unsigned int cpufan_speed = 0, sysfan_speed = 0;
+ unsigned int cpufan_temperature = 0, sysfan_temperature = 0;
- cpufan_control = get_int_option("cpufan_cruise_control", FAN_CRUISE_CONTROL_DISABLED);
- cpufan_speed = get_int_option("cpufan_speed", FAN_SPEED_5625);
+ cpufan_control = get_uint_option("cpufan_cruise_control", FAN_CRUISE_CONTROL_DISABLED);
+ cpufan_speed = get_uint_option("cpufan_speed", FAN_SPEED_5625);
- sysfan_control = get_int_option("sysfan_cruise_control", FAN_CRUISE_CONTROL_DISABLED);
- sysfan_speed = get_int_option("sysfan_speed", FAN_SPEED_5625);
+ sysfan_control = get_uint_option("sysfan_cruise_control", FAN_CRUISE_CONTROL_DISABLED);
+ sysfan_speed = get_uint_option("sysfan_speed", FAN_SPEED_5625);
nuvoton_hwm_select_bank(hwm_base, 0);
pnp_write_hwm5_index(hwm_base, 0x59, 0x20); /* Diode Selection */
@@ -139,7 +139,7 @@ static void mainboard_init(void *chip_info)
char cmos_option_name[] = "ethernetx";
snprintf(cmos_option_name, sizeof(cmos_option_name),
"ethernet%01d", i);
- int ethernet_disable = get_int_option(cmos_option_name, 0);
+ unsigned int ethernet_disable = get_uint_option(cmos_option_name, 0);
if (!ethernet_disable)
continue;
printk(BIOS_DEBUG, "Disabling Ethernet NIC #%d\n", i);
diff --git a/src/mainboard/kontron/bsl6/romstage.c b/src/mainboard/kontron/bsl6/romstage.c
index c5cba4d02c..f38734c25c 100644
--- a/src/mainboard/kontron/bsl6/romstage.c
+++ b/src/mainboard/kontron/bsl6/romstage.c
@@ -38,7 +38,7 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
memory_params->DqPinsInterleaved = true;
- const uint8_t ht = get_int_option("hyper_threading", memory_params->HyperThreading);
+ const uint8_t ht = get_uint_option("hyper_threading", memory_params->HyperThreading);
memory_params->HyperThreading = ht;
variant_memory_init_params(mupd);
diff --git a/src/mainboard/kontron/bsl6/variants/boxer26/romstage.c b/src/mainboard/kontron/bsl6/variants/boxer26/romstage.c
index d352522e90..1985d4ec18 100644
--- a/src/mainboard/kontron/bsl6/variants/boxer26/romstage.c
+++ b/src/mainboard/kontron/bsl6/variants/boxer26/romstage.c
@@ -14,7 +14,7 @@ void variant_memory_init_params(FSPM_UPD *const mupd)
for (i = 0; i < 3; ++i) {
nvram_var[sizeof(nvram_var) - 2] = '1' + i;
- u8 eth_enable = get_int_option(nvram_var, 1);
+ u8 eth_enable = get_uint_option(nvram_var, 1);
if (!eth_enable) {
printk(BIOS_INFO, "Disabling ethernet%u.\n", 1 + i);
mupd->FspmConfig.PcieRpEnableMask &= ~(1 << (i + 8));
diff --git a/src/mainboard/kontron/ktqm77/mainboard.c b/src/mainboard/kontron/ktqm77/mainboard.c
index 2d5063a694..f8ef53834f 100644
--- a/src/mainboard/kontron/ktqm77/mainboard.c
+++ b/src/mainboard/kontron/ktqm77/mainboard.c
@@ -149,7 +149,7 @@ static void mainboard_enable(struct device *dev)
/* Install custom int15 handler for VGA OPROM */
mainboard_interrupt_handlers(0x15, &int15_handler);
#endif
- unsigned int disable = get_int_option("ethernet1", 0);
+ unsigned int disable = get_uint_option("ethernet1", 0);
if (disable) {
struct device *nic = pcidev_on_root(0x1c, 2);
if (nic) {
@@ -157,7 +157,7 @@ static void mainboard_enable(struct device *dev)
nic->enabled = 0;
}
}
- disable = get_int_option("ethernet2", 0);
+ disable = get_uint_option("ethernet2", 0);
if (disable) {
struct device *nic = pcidev_on_root(0x1c, 3);
if (nic) {
diff --git a/src/mainboard/lenovo/t430s/variants/t430s/romstage.c b/src/mainboard/lenovo/t430s/variants/t430s/romstage.c
index ff041e7d49..efcd31558d 100644
--- a/src/mainboard/lenovo/t430s/variants/t430s/romstage.c
+++ b/src/mainboard/lenovo/t430s/variants/t430s/romstage.c
@@ -33,7 +33,7 @@ void mainboard_get_spd(spd_raw_data *spd, bool id_only)
void mainboard_early_init(int s3resume)
{
- u8 enable_peg = get_int_option("enable_dual_graphics", 0);
+ u8 enable_peg = get_uint_option("enable_dual_graphics", 0);
bool power_en = pmh7_dgpu_power_state();
diff --git a/src/mainboard/lenovo/t440p/romstage.c b/src/mainboard/lenovo/t440p/romstage.c
index 817797f67e..e605453fff 100644
--- a/src/mainboard/lenovo/t440p/romstage.c
+++ b/src/mainboard/lenovo/t440p/romstage.c
@@ -22,7 +22,7 @@ void mainboard_config_rcba(void)
void mb_late_romstage_setup(void)
{
- u8 enable_peg = get_int_option("enable_dual_graphics", 0);
+ u8 enable_peg = get_uint_option("enable_dual_graphics", 0);
bool power_en = pmh7_dgpu_power_state();
diff --git a/src/mainboard/lenovo/x60/smihandler.c b/src/mainboard/lenovo/x60/smihandler.c
index 20ca060d82..e1a97f57ee 100644
--- a/src/mainboard/lenovo/x60/smihandler.c
+++ b/src/mainboard/lenovo/x60/smihandler.c
@@ -22,8 +22,8 @@ static void mainboard_smi_save_cmos(void)
tmp70 = inb(0x70);
tmp72 = inb(0x72);
- set_int_option("tft_brightness", pci_read_config8(PCI_DEV(0, 2, 1), 0xf4));
- set_int_option("volume", ec_read(H8_VOLUME_CONTROL));
+ set_uint_option("tft_brightness", pci_read_config8(PCI_DEV(0, 2, 1), 0xf4));
+ set_uint_option("volume", ec_read(H8_VOLUME_CONTROL));
outb(tmp70, 0x70);
outb(tmp72, 0x72);
diff --git a/src/mainboard/roda/rk886ex/early_init.c b/src/mainboard/roda/rk886ex/early_init.c
index 8f6ceddc8b..76471ebe92 100644
--- a/src/mainboard/roda/rk886ex/early_init.c
+++ b/src/mainboard/roda/rk886ex/early_init.c
@@ -17,7 +17,7 @@ void mainboard_lpc_decode(void)
{
int lpt_en = 0;
- if (get_int_option("lpt", 0))
+ if (get_uint_option("lpt", 0))
lpt_en = LPT_LPC_EN; /* enable LPT */
pci_write_config16(PCI_DEV(0, 0x1f, 0), LPC_IO_DEC, 0x0007);
diff --git a/src/mainboard/siemens/chili/romstage.c b/src/mainboard/siemens/chili/romstage.c
index 330d8afdc2..ddcc2cc87c 100644
--- a/src/mainboard/siemens/chili/romstage.c
+++ b/src/mainboard/siemens/chili/romstage.c
@@ -24,9 +24,9 @@ void mainboard_memory_init_params(FSPM_UPD *memupd)
memupd->FspmConfig.EccSupport = 1;
memupd->FspmConfig.UserBd = BOARD_TYPE_MOBILE;
- const uint8_t vtd = get_int_option("vtd", 1);
+ const uint8_t vtd = get_uint_option("vtd", 1);
memupd->FspmTestConfig.VtdDisable = !vtd;
- const uint8_t ht = get_int_option("hyper_threading", memupd->FspmConfig.HyperThreading);
+ const uint8_t ht = get_uint_option("hyper_threading", memupd->FspmConfig.HyperThreading);
memupd->FspmConfig.HyperThreading = ht;
variant_romstage_params(memupd);
diff --git a/src/mainboard/siemens/chili/variants/chili/romstage.c b/src/mainboard/siemens/chili/variants/chili/romstage.c
index fadd2b77b5..d88301e404 100644
--- a/src/mainboard/siemens/chili/variants/chili/romstage.c
+++ b/src/mainboard/siemens/chili/variants/chili/romstage.c
@@ -7,7 +7,7 @@
void variant_romstage_params(FSPM_UPD *const mupd)
{
- const uint8_t eth_enable = get_int_option("ethernet1", 1);
+ const uint8_t eth_enable = get_uint_option("ethernet1", 1);
if (!eth_enable) {
printk(BIOS_DEBUG, "Disabling ethernet1.\n");
diff --git a/src/mainboard/supermicro/x10slm-f/mainboard.c b/src/mainboard/supermicro/x10slm-f/mainboard.c
index b584e9bd73..98548e33ba 100644
--- a/src/mainboard/supermicro/x10slm-f/mainboard.c
+++ b/src/mainboard/supermicro/x10slm-f/mainboard.c
@@ -30,7 +30,7 @@ static void hide_ast2400(void)
static void mainboard_enable(struct device *dev)
{
- if (get_int_option("hide_ast2400", false))
+ if (get_uint_option("hide_ast2400", false))
hide_ast2400();
}