coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
iosf.h File Reference
#include <stdint.h>
#include <soc/pci_devs.h>
Include dependency graph for iosf.h:

Go to the source code of this file.

Macros

#define PCI_DEV(SEGBUS, DEV, FN)
 
#define IOSF_PCI_DEV   PCI_DEV(0, SOC_DEV, SOC_FUNC)
 
#define MCR_REG   0xd0
 
#define IOSF_OPCODE(x)   ((x) << 24)
 
#define IOSF_PORT(x)   ((0xff & (x)) << 16)
 
#define IOSF_REG(x)   ((0xff & (x)) << 8)
 
#define IOSF_REG_UPPER(x)   (((~0xff) & (x)))
 
#define IOSF_BYTE_EN_0   0x10
 
#define IOSF_BYTE_EN_1   0x20
 
#define IOSF_BYTE_EN_2   0x40
 
#define IOSF_BYTE_EN_3   0x80
 
#define IOSF_BYTE_EN    (IOSF_BYTE_EN_0 | IOSF_BYTE_EN_1 | IOSF_BYTE_EN_2 | IOSF_BYTE_EN_3)
 
#define MDR_REG   0xd4
 
#define MCRX_REG   0xd8
 
#define IOSF_PORT_AUNIT   0x00 /* IO Arbiter unit */
 
#define IOSF_PORT_CPU_BUS   0x02 /* CPU Bus Interface Controller */
 
#define IOSF_PORT_BUNIT   0x03 /* System Memory Arbiter/Bunit */
 
#define IOSF_PORT_PMC   0x04 /* Power Management Controller */
 
#define IOSF_PORT_SEC   0x44 /* SEC */
 
#define IOSF_PORT_0x45   0x45
 
#define IOSF_PORT_0x46   0x46
 
#define IOSF_PORT_0x47   0x47
 
#define IOSF_PORT_SCORE   0x48 /* SCORE */
 
#define IOSF_PORT_0x55   0x55
 
#define IOSF_PORT_0x58   0x58
 
#define IOSF_PORT_0x59   0x59
 
#define IOSF_PORT_0x5a   0x5a
 
#define IOSF_PORT_USHPHY   0x61 /* USB XHCI PHY */
 
#define IOSF_PORT_SCC   0x63 /* Storage Control Cluster */
 
#define IOSF_PORT_USBPHY   0x43 /* USB PHY */
 
#define IOSF_PORT_LPSS   0xa0 /* LPSS - Low Power Subsystem */
 
#define IOSF_PORT_0xa2   0xa2
 
#define IOSF_PORT_SSUS   0xa8 /* SUS */
 
#define IOSF_PORT_CCU   0xa9 /* Clock control unit. */
 
#define IOSF_OP_READ_BUNIT   0x10
 
#define IOSF_OP_WRITE_BUNIT   (IOSF_OP_READ_BUNIT | 1)
 
#define IOSF_OP_READ_PMC   0x06
 
#define IOSF_OP_WRITE_PMC   (IOSF_OP_READ_PMC | 1)
 
#define IOSF_OP_READ_SCORE   0x06
 
#define IOSF_OP_WRITE_SCORE   (IOSF_OP_READ_SCORE | 1)
 
#define IOSF_OP_READ_LPSS   0x06
 
#define IOSF_OP_WRITE_LPSS   (IOSF_OP_READ_LPSS | 1)
 
#define IOSF_OP_READ_0x58   0x06
 
#define IOSF_OP_WRITE_0x58   (IOSF_OP_READ_0x58 | 1)
 
#define IOSF_OP_READ_SCC   0x06
 
#define IOSF_OP_WRITE_SCC   (IOSF_OP_READ_SCC | 1)
 
#define IOSF_OP_READ_USBPHY   0x06
 
#define IOSF_OP_WRITE_USBPHY   (IOSF_OP_READ_USBPHY | 1)
 
#define BUNIT_BMBOUND   0x25
 
#define BUNIT_BMBOUND_HI   0x26
 
#define BUNIT_MMCONF_REG   0x27
 
#define BUNIT_BMISC   0x28
 
#define BUNIT_SMRWAC   0x2d
 
#define BUNIT_SMRRL   0x2e
 
#define BUNIT_SMRRH   0x2f
 
#define SAI_IA_UNTRUSTED   (1 << 0)
 
#define SAI_IA_SMM   (1 << 2)
 
#define SAI_IA_BOOT   (1 << 4)
 
#define LPSS_SIO_DMA1_CTL   0x280
 
#define LPSS_I2C1_CTL   0x288
 
#define LPSS_I2C2_CTL   0x290
 
#define LPSS_I2C3_CTL   0x298
 
#define LPSS_I2C4_CTL   0x2a0
 
#define LPSS_I2C5_CTL   0x2a8
 
#define LPSS_I2C6_CTL   0x2b0
 
#define LPSS_I2C7_CTL   0x2b8
 
#define LPSS_SIO_DMA2_CTL   0x240
 
#define LPSS_PWM1_CTL   0x248
 
#define LPSS_PWM2_CTL   0x250
 
#define LPSS_HSUART1_CTL   0x258
 
#define LPSS_HSUART2_CTL   0x260
 
#define LPSS_SPI_CTL   0x268
 
#define LPSS_CTL_ACPI_INT_EN   (1 << 21)
 
#define LPSS_CTL_PCI_CFG_DIS   (1 << 20)
 
#define LPSS_CTL_SNOOP   (1 << 18)
 
#define LPSS_CTL_NOSNOOP   (1 << 19)
 
#define LPSS_CTL_PM_CAP_PRSNT   (1 << 1)
 
#define SCC_SD_CTL   0x504
 
#define SCC_SDIO_CTL   0x508
 
#define SCC_MMC_CTL   0x500
 
#define SCC_CTL_PCI_CFG_DIS   (1 << 0)
 
#define SCC_CTL_ACPI_INT_EN   (1 << 1)
 
#define LPE_PCICFGCTR1   0x0500
 
#define LPE_PCICFGCTR1_PCI_CFG_DIS   (1 << 0)
 
#define LPE_PCICFGCTR1_ACPI_INT_EN   (1 << 1)
 
#define USBPHY_COMPBG   0x7f04
 

Functions

uint32_t iosf_bunit_read (int reg)
 
void iosf_bunit_write (int reg, uint32_t val)
 
uint32_t iosf_punit_read (int reg)
 
void iosf_punit_write (int reg, uint32_t val)
 
uint32_t iosf_score_read (int reg)
 
void iosf_score_write (int reg, uint32_t val)
 
uint32_t iosf_lpss_read (int reg)
 
void iosf_lpss_write (int reg, uint32_t val)
 
uint32_t iosf_port58_read (int reg)
 
void iosf_port58_write (int reg, uint32_t val)
 
uint32_t iosf_scc_read (int reg)
 
void iosf_scc_write (int reg, uint32_t val)
 
uint32_t iosf_usbphy_read (int reg)
 
void iosf_usbphy_write (int reg, uint32_t val)
 

Macro Definition Documentation

◆ BUNIT_BMBOUND

#define BUNIT_BMBOUND   0x25

Definition at line 108 of file iosf.h.

◆ BUNIT_BMBOUND_HI

#define BUNIT_BMBOUND_HI   0x26

Definition at line 116 of file iosf.h.

◆ BUNIT_BMISC

#define BUNIT_BMISC   0x28

Definition at line 118 of file iosf.h.

◆ BUNIT_MMCONF_REG

#define BUNIT_MMCONF_REG   0x27

Definition at line 117 of file iosf.h.

◆ BUNIT_SMRRH

#define BUNIT_SMRRH   0x2f

Definition at line 122 of file iosf.h.

◆ BUNIT_SMRRL

#define BUNIT_SMRRL   0x2e

Definition at line 121 of file iosf.h.

◆ BUNIT_SMRWAC

#define BUNIT_SMRWAC   0x2d

Definition at line 120 of file iosf.h.

◆ IOSF_BYTE_EN

#define IOSF_BYTE_EN    (IOSF_BYTE_EN_0 | IOSF_BYTE_EN_1 | IOSF_BYTE_EN_2 | IOSF_BYTE_EN_3)

Definition at line 40 of file iosf.h.

◆ IOSF_BYTE_EN_0

#define IOSF_BYTE_EN_0   0x10

Definition at line 36 of file iosf.h.

◆ IOSF_BYTE_EN_1

#define IOSF_BYTE_EN_1   0x20

Definition at line 37 of file iosf.h.

◆ IOSF_BYTE_EN_2

#define IOSF_BYTE_EN_2   0x40

Definition at line 38 of file iosf.h.

◆ IOSF_BYTE_EN_3

#define IOSF_BYTE_EN_3   0x80

Definition at line 39 of file iosf.h.

◆ IOSF_OP_READ_0x58

#define IOSF_OP_READ_0x58   0x06

Definition at line 96 of file iosf.h.

◆ IOSF_OP_READ_BUNIT

#define IOSF_OP_READ_BUNIT   0x10

Definition at line 88 of file iosf.h.

◆ IOSF_OP_READ_LPSS

#define IOSF_OP_READ_LPSS   0x06

Definition at line 94 of file iosf.h.

◆ IOSF_OP_READ_PMC

#define IOSF_OP_READ_PMC   0x06

Definition at line 90 of file iosf.h.

◆ IOSF_OP_READ_SCC

#define IOSF_OP_READ_SCC   0x06

Definition at line 98 of file iosf.h.

◆ IOSF_OP_READ_SCORE

#define IOSF_OP_READ_SCORE   0x06

Definition at line 92 of file iosf.h.

◆ IOSF_OP_READ_USBPHY

#define IOSF_OP_READ_USBPHY   0x06

Definition at line 100 of file iosf.h.

◆ IOSF_OP_WRITE_0x58

#define IOSF_OP_WRITE_0x58   (IOSF_OP_READ_0x58 | 1)

Definition at line 97 of file iosf.h.

◆ IOSF_OP_WRITE_BUNIT

#define IOSF_OP_WRITE_BUNIT   (IOSF_OP_READ_BUNIT | 1)

Definition at line 89 of file iosf.h.

◆ IOSF_OP_WRITE_LPSS

#define IOSF_OP_WRITE_LPSS   (IOSF_OP_READ_LPSS | 1)

Definition at line 95 of file iosf.h.

◆ IOSF_OP_WRITE_PMC

#define IOSF_OP_WRITE_PMC   (IOSF_OP_READ_PMC | 1)

Definition at line 91 of file iosf.h.

◆ IOSF_OP_WRITE_SCC

#define IOSF_OP_WRITE_SCC   (IOSF_OP_READ_SCC | 1)

Definition at line 99 of file iosf.h.

◆ IOSF_OP_WRITE_SCORE

#define IOSF_OP_WRITE_SCORE   (IOSF_OP_READ_SCORE | 1)

Definition at line 93 of file iosf.h.

◆ IOSF_OP_WRITE_USBPHY

#define IOSF_OP_WRITE_USBPHY   (IOSF_OP_READ_USBPHY | 1)

Definition at line 101 of file iosf.h.

◆ IOSF_OPCODE

#define IOSF_OPCODE (   x)    ((x) << 24)

Definition at line 32 of file iosf.h.

◆ IOSF_PCI_DEV

#define IOSF_PCI_DEV   PCI_DEV(0, SOC_DEV, SOC_FUNC)

Definition at line 29 of file iosf.h.

◆ IOSF_PORT

#define IOSF_PORT (   x)    ((0xff & (x)) << 16)

Definition at line 33 of file iosf.h.

◆ IOSF_PORT_0x45

#define IOSF_PORT_0x45   0x45

Definition at line 71 of file iosf.h.

◆ IOSF_PORT_0x46

#define IOSF_PORT_0x46   0x46

Definition at line 72 of file iosf.h.

◆ IOSF_PORT_0x47

#define IOSF_PORT_0x47   0x47

Definition at line 73 of file iosf.h.

◆ IOSF_PORT_0x55

#define IOSF_PORT_0x55   0x55

Definition at line 75 of file iosf.h.

◆ IOSF_PORT_0x58

#define IOSF_PORT_0x58   0x58

Definition at line 76 of file iosf.h.

◆ IOSF_PORT_0x59

#define IOSF_PORT_0x59   0x59

Definition at line 77 of file iosf.h.

◆ IOSF_PORT_0x5a

#define IOSF_PORT_0x5a   0x5a

Definition at line 78 of file iosf.h.

◆ IOSF_PORT_0xa2

#define IOSF_PORT_0xa2   0xa2

Definition at line 83 of file iosf.h.

◆ IOSF_PORT_AUNIT

#define IOSF_PORT_AUNIT   0x00 /* IO Arbiter unit */

Definition at line 66 of file iosf.h.

◆ IOSF_PORT_BUNIT

#define IOSF_PORT_BUNIT   0x03 /* System Memory Arbiter/Bunit */

Definition at line 68 of file iosf.h.

◆ IOSF_PORT_CCU

#define IOSF_PORT_CCU   0xa9 /* Clock control unit. */

Definition at line 85 of file iosf.h.

◆ IOSF_PORT_CPU_BUS

#define IOSF_PORT_CPU_BUS   0x02 /* CPU Bus Interface Controller */

Definition at line 67 of file iosf.h.

◆ IOSF_PORT_LPSS

#define IOSF_PORT_LPSS   0xa0 /* LPSS - Low Power Subsystem */

Definition at line 82 of file iosf.h.

◆ IOSF_PORT_PMC

#define IOSF_PORT_PMC   0x04 /* Power Management Controller */

Definition at line 69 of file iosf.h.

◆ IOSF_PORT_SCC

#define IOSF_PORT_SCC   0x63 /* Storage Control Cluster */

Definition at line 80 of file iosf.h.

◆ IOSF_PORT_SCORE

#define IOSF_PORT_SCORE   0x48 /* SCORE */

Definition at line 74 of file iosf.h.

◆ IOSF_PORT_SEC

#define IOSF_PORT_SEC   0x44 /* SEC */

Definition at line 70 of file iosf.h.

◆ IOSF_PORT_SSUS

#define IOSF_PORT_SSUS   0xa8 /* SUS */

Definition at line 84 of file iosf.h.

◆ IOSF_PORT_USBPHY

#define IOSF_PORT_USBPHY   0x43 /* USB PHY */

Definition at line 81 of file iosf.h.

◆ IOSF_PORT_USHPHY

#define IOSF_PORT_USHPHY   0x61 /* USB XHCI PHY */

Definition at line 79 of file iosf.h.

◆ IOSF_REG

#define IOSF_REG (   x)    ((0xff & (x)) << 8)

Definition at line 34 of file iosf.h.

◆ IOSF_REG_UPPER

#define IOSF_REG_UPPER (   x)    (((~0xff) & (x)))

Definition at line 35 of file iosf.h.

◆ LPE_PCICFGCTR1

#define LPE_PCICFGCTR1   0x0500

Definition at line 164 of file iosf.h.

◆ LPE_PCICFGCTR1_ACPI_INT_EN

#define LPE_PCICFGCTR1_ACPI_INT_EN   (1 << 1)

Definition at line 166 of file iosf.h.

◆ LPE_PCICFGCTR1_PCI_CFG_DIS

#define LPE_PCICFGCTR1_PCI_CFG_DIS   (1 << 0)

Definition at line 165 of file iosf.h.

◆ LPSS_CTL_ACPI_INT_EN

#define LPSS_CTL_ACPI_INT_EN   (1 << 21)

Definition at line 146 of file iosf.h.

◆ LPSS_CTL_NOSNOOP

#define LPSS_CTL_NOSNOOP   (1 << 19)

Definition at line 149 of file iosf.h.

◆ LPSS_CTL_PCI_CFG_DIS

#define LPSS_CTL_PCI_CFG_DIS   (1 << 20)

Definition at line 147 of file iosf.h.

◆ LPSS_CTL_PM_CAP_PRSNT

#define LPSS_CTL_PM_CAP_PRSNT   (1 << 1)

Definition at line 150 of file iosf.h.

◆ LPSS_CTL_SNOOP

#define LPSS_CTL_SNOOP   (1 << 18)

Definition at line 148 of file iosf.h.

◆ LPSS_HSUART1_CTL

#define LPSS_HSUART1_CTL   0x258

Definition at line 143 of file iosf.h.

◆ LPSS_HSUART2_CTL

#define LPSS_HSUART2_CTL   0x260

Definition at line 144 of file iosf.h.

◆ LPSS_I2C1_CTL

#define LPSS_I2C1_CTL   0x288

Definition at line 133 of file iosf.h.

◆ LPSS_I2C2_CTL

#define LPSS_I2C2_CTL   0x290

Definition at line 134 of file iosf.h.

◆ LPSS_I2C3_CTL

#define LPSS_I2C3_CTL   0x298

Definition at line 135 of file iosf.h.

◆ LPSS_I2C4_CTL

#define LPSS_I2C4_CTL   0x2a0

Definition at line 136 of file iosf.h.

◆ LPSS_I2C5_CTL

#define LPSS_I2C5_CTL   0x2a8

Definition at line 137 of file iosf.h.

◆ LPSS_I2C6_CTL

#define LPSS_I2C6_CTL   0x2b0

Definition at line 138 of file iosf.h.

◆ LPSS_I2C7_CTL

#define LPSS_I2C7_CTL   0x2b8

Definition at line 139 of file iosf.h.

◆ LPSS_PWM1_CTL

#define LPSS_PWM1_CTL   0x248

Definition at line 141 of file iosf.h.

◆ LPSS_PWM2_CTL

#define LPSS_PWM2_CTL   0x250

Definition at line 142 of file iosf.h.

◆ LPSS_SIO_DMA1_CTL

#define LPSS_SIO_DMA1_CTL   0x280

Definition at line 132 of file iosf.h.

◆ LPSS_SIO_DMA2_CTL

#define LPSS_SIO_DMA2_CTL   0x240

Definition at line 140 of file iosf.h.

◆ LPSS_SPI_CTL

#define LPSS_SPI_CTL   0x268

Definition at line 145 of file iosf.h.

◆ MCR_REG

#define MCR_REG   0xd0

Definition at line 31 of file iosf.h.

◆ MCRX_REG

#define MCRX_REG   0xd8

Definition at line 43 of file iosf.h.

◆ MDR_REG

#define MDR_REG   0xd4

Definition at line 42 of file iosf.h.

◆ PCI_DEV

#define PCI_DEV (   SEGBUS,
  DEV,
  FN 
)
Value:
( \
(((SEGBUS) & 0xFFF) << 20) | \
(((DEV) & 0x1F) << 15) | \
(((FN) & 0x07) << 12))

Definition at line 24 of file iosf.h.

◆ SAI_IA_BOOT

#define SAI_IA_BOOT   (1 << 4)

Definition at line 127 of file iosf.h.

◆ SAI_IA_SMM

#define SAI_IA_SMM   (1 << 2)

Definition at line 126 of file iosf.h.

◆ SAI_IA_UNTRUSTED

#define SAI_IA_UNTRUSTED   (1 << 0)

Definition at line 125 of file iosf.h.

◆ SCC_CTL_ACPI_INT_EN

#define SCC_CTL_ACPI_INT_EN   (1 << 1)

Definition at line 159 of file iosf.h.

◆ SCC_CTL_PCI_CFG_DIS

#define SCC_CTL_PCI_CFG_DIS   (1 << 0)

Definition at line 158 of file iosf.h.

◆ SCC_MMC_CTL

#define SCC_MMC_CTL   0x500

Definition at line 157 of file iosf.h.

◆ SCC_SD_CTL

#define SCC_SD_CTL   0x504

Definition at line 155 of file iosf.h.

◆ SCC_SDIO_CTL

#define SCC_SDIO_CTL   0x508

Definition at line 156 of file iosf.h.

◆ USBPHY_COMPBG

#define USBPHY_COMPBG   0x7f04

Definition at line 171 of file iosf.h.

Function Documentation

◆ iosf_bunit_read()

uint32_t iosf_bunit_read ( int  reg)

Definition at line 39 of file iosf.c.

References IOSF_READ, and iosf_read_port().

Here is the call graph for this function:

◆ iosf_bunit_write()

void iosf_bunit_write ( int  reg,
uint32_t  val 
)

Definition at line 44 of file iosf.c.

References IOSF_WRITE, iosf_write_port(), and val.

Here is the call graph for this function:

◆ iosf_lpss_read()

uint32_t iosf_lpss_read ( int  reg)

Definition at line 111 of file iosf.c.

References IOSF_READ, and iosf_read_port().

Here is the call graph for this function:

◆ iosf_lpss_write()

void iosf_lpss_write ( int  reg,
uint32_t  val 
)

Definition at line 116 of file iosf.c.

References IOSF_WRITE, iosf_write_port(), and val.

Here is the call graph for this function:

◆ iosf_port58_read()

uint32_t iosf_port58_read ( int  reg)

Definition at line 221 of file iosf.c.

References IOSF_READ, and iosf_read_port().

Here is the call graph for this function:

◆ iosf_port58_write()

void iosf_port58_write ( int  reg,
uint32_t  val 
)

Definition at line 226 of file iosf.c.

References IOSF_WRITE, iosf_write_port(), and val.

Here is the call graph for this function:

◆ iosf_punit_read()

uint32_t iosf_punit_read ( int  reg)

Definition at line 81 of file iosf.c.

References IOSF_READ, iosf_read_port(), and PMC.

Here is the call graph for this function:

◆ iosf_punit_write()

void iosf_punit_write ( int  reg,
uint32_t  val 
)

Definition at line 86 of file iosf.c.

References IOSF_WRITE, iosf_write_port(), PMC, and val.

Here is the call graph for this function:

◆ iosf_scc_read()

uint32_t iosf_scc_read ( int  reg)

Definition at line 141 of file iosf.c.

References IOSF_READ, and iosf_read_port().

Here is the call graph for this function:

◆ iosf_scc_write()

void iosf_scc_write ( int  reg,
uint32_t  val 
)

Definition at line 146 of file iosf.c.

References IOSF_WRITE, iosf_write_port(), and val.

Here is the call graph for this function:

◆ iosf_score_read()

uint32_t iosf_score_read ( int  reg)

Definition at line 131 of file iosf.c.

References IOSF_READ, and iosf_read_port().

Here is the call graph for this function:

◆ iosf_score_write()

void iosf_score_write ( int  reg,
uint32_t  val 
)

Definition at line 136 of file iosf.c.

References IOSF_WRITE, iosf_write_port(), and val.

Here is the call graph for this function:

◆ iosf_usbphy_read()

uint32_t iosf_usbphy_read ( int  reg)

Definition at line 91 of file iosf.c.

References IOSF_READ, and iosf_read_port().

Here is the call graph for this function:

◆ iosf_usbphy_write()

void iosf_usbphy_write ( int  reg,
uint32_t  val 
)

Definition at line 96 of file iosf.c.

References IOSF_WRITE, iosf_write_port(), and val.

Here is the call graph for this function: