src/mainboard: Const'ify pci_devfn_t devices
Change-Id: I5bb1a819475383719dbda32d9b5fea63da1e6713 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/40611 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
parent
cfdac82661
commit
a4faec3b01
|
@ -35,7 +35,7 @@ void bootblock_mainboard_early_init(void)
|
|||
pm_io_write8(0x24, 1);
|
||||
|
||||
/* Set LPC decode enables. */
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x14, 3);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x14, 3);
|
||||
pci_write_config32(dev, 0x44, 0xff03ffd5);
|
||||
|
||||
/* enable SIO LPC decode */
|
||||
|
|
|
@ -41,9 +41,7 @@ static void bootblock_northbridge_init(void)
|
|||
static void enable_spi_prefetch(void)
|
||||
{
|
||||
u8 reg8;
|
||||
pci_devfn_t dev;
|
||||
|
||||
dev = PCI_DEV(0, 0x1f, 0);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 0);
|
||||
|
||||
reg8 = pci_read_config8(dev, 0xdc);
|
||||
reg8 &= ~(3 << 2);
|
||||
|
|
|
@ -29,20 +29,20 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
|
||||
int get_write_protect_state(void)
|
||||
{
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
return (pci_s_read_config32(dev, SATA_SP) >> FLAG_SPI_WP) & 1;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
return (pci_s_read_config32(dev, SATA_SP) >> FLAG_REC_MODE) & 1;
|
||||
}
|
||||
|
||||
void init_bootmode_straps(void)
|
||||
{
|
||||
u32 flags = 0;
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
|
||||
/* Write Protect: GPIO58 = GPIO_SPI_WP, active high */
|
||||
if (get_gpio(GPIO_SPI_WP))
|
||||
|
|
|
@ -30,20 +30,20 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
|
||||
int get_write_protect_state(void)
|
||||
{
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
return (pci_s_read_config32(dev, SATA_SP) >> FLAG_SPI_WP) & 1;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
return (pci_s_read_config32(dev, SATA_SP) >> FLAG_REC_MODE) & 1;
|
||||
}
|
||||
|
||||
void init_bootmode_straps(void)
|
||||
{
|
||||
u32 flags = 0;
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
|
||||
/* Write Protect: GPIO58 = GPIO_SPI_WP, active high */
|
||||
if (get_gpio(GPIO_SPI_WP))
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
void fill_lb_gpios(struct lb_gpios *gpios)
|
||||
{
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 0);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 0);
|
||||
u16 gen_pmcon_1 = pci_s_read_config32(dev, GEN_PMCON_1);
|
||||
|
||||
struct lb_gpio chromeos_gpios[] = {
|
||||
|
|
|
@ -60,7 +60,7 @@ int get_recovery_mode_switch(void)
|
|||
if (ec_rec_flag_good)
|
||||
return ec_in_rec_mode;
|
||||
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 0);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 0);
|
||||
u8 reg8 = pci_s_read_config8(dev, GEN_PMCON_3);
|
||||
|
||||
u8 ec_status = ec_read(EC_STATUS_REG);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
void fill_lb_gpios(struct lb_gpios *gpios)
|
||||
{
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 0);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 0);
|
||||
u16 gen_pmcon_1 = pci_s_read_config32(dev, GEN_PMCON_1);
|
||||
u8 lid = ec_read(0x83);
|
||||
|
||||
|
@ -44,20 +44,20 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
|
||||
int get_write_protect_state(void)
|
||||
{
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
return (pci_s_read_config32(dev, SATA_SP) >> FLAG_SPI_WP) & 1;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
return (pci_s_read_config32(dev, SATA_SP) >> FLAG_REC_MODE) & 1;
|
||||
}
|
||||
|
||||
void init_bootmode_straps(void)
|
||||
{
|
||||
u32 flags = 0;
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
|
||||
/* Write Protect: GPIO24 = KBC3_SPI_WP#, active high */
|
||||
if (get_gpio(GPIO_SPI_WP))
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
void fill_lb_gpios(struct lb_gpios *gpios)
|
||||
{
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 0);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 0);
|
||||
u16 gen_pmcon_1 = pci_s_read_config32(dev, GEN_PMCON_1);
|
||||
|
||||
struct lb_gpio chromeos_gpios[] = {
|
||||
|
@ -40,20 +40,20 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
|
||||
int get_write_protect_state(void)
|
||||
{
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
return (pci_s_read_config32(dev, SATA_SP) >> FLAG_SPI_WP) & 1;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
return (pci_s_read_config32(dev, SATA_SP) >> FLAG_REC_MODE) & 1;
|
||||
}
|
||||
|
||||
void init_bootmode_straps(void)
|
||||
{
|
||||
u32 flags = 0;
|
||||
pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
|
||||
|
||||
/* Write Protect: GPIO68 = CHP3_SPI_WP, active high */
|
||||
if (get_gpio(GPIO_SPI_WP))
|
||||
|
|
Loading…
Reference in New Issue