coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
fch.c File Reference
#include "psp_verstage.h"
#include <amdblocks/acpimmio.h>
#include <amdblocks/espi.h>
#include <amdblocks/i2c.h>
#include <amdblocks/spi.h>
#include <arch/exception.h>
#include <arch/hlt.h>
#include <arch/io.h>
#include <bl_uapp/bl_errorcodes_public.h>
#include <bl_uapp/bl_syscall_public.h>
#include <console/console.h>
#include <soc/i2c.h>
#include <soc/southbridge.h>
#include <stdint.h>
Include dependency graph for fch.c:

Go to the source code of this file.

Functions

static void i2c3_set_bar (void *bar)
 
static void i2c2_set_bar (void *bar)
 
static void espi_set_bar (void *bar)
 
static void iomux_set_bar (void *bar)
 
static void misc_set_bar (void *bar)
 
static void gpio_set_bar (void *bar)
 
static void io_set_bar (void *bar)
 
u8 io_read8 (u16 reg)
 
void io_write8 (u16 reg, u8 value)
 
static void aoac_set_bar (void *bar)
 
uintptr_tmap_spi_rom (void)
 
static uint32_t map_fch_devices (void)
 
uint32_t unmap_fch_devices (void)
 
uint32_t verstage_soc_early_init (void)
 
void verstage_soc_espi_init (void)
 
void verstage_soc_i2c_init (void)
 
void verstage_soc_aoac_init (void)
 
void verstage_soc_spi_init (void)
 

Variables

static uintptr_t io_bar
 
struct {
   const char *   name
 
   struct {
      enum fch_io_device   device
 
      uint32_t   arg0
 
   }   args
 
   void(*   set_bar )(void *bar)
 
   void *   _bar
 
bar_map []
 

Function Documentation

◆ aoac_set_bar()

static void aoac_set_bar ( void bar)
static

Definition at line 66 of file fch.c.

References acpimmio_aoac.

◆ espi_set_bar()

static void espi_set_bar ( void bar)
static

Definition at line 29 of file fch.c.

References espi_update_static_bar().

Here is the call graph for this function:

◆ gpio_set_bar()

static void gpio_set_bar ( void bar)
static

Definition at line 44 of file fch.c.

References acpimmio_gpio0.

◆ i2c2_set_bar()

static void i2c2_set_bar ( void bar)
static

Definition at line 24 of file fch.c.

References i2c_set_bar().

Here is the call graph for this function:

◆ i2c3_set_bar()

static void i2c3_set_bar ( void bar)
static

Definition at line 19 of file fch.c.

References i2c_set_bar().

Here is the call graph for this function:

◆ io_read8()

u8 io_read8 ( u16  reg)

Definition at line 56 of file fch.c.

References io_bar, and read8().

Referenced by inb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ io_set_bar()

static void io_set_bar ( void bar)
static

Definition at line 51 of file fch.c.

References io_bar.

◆ io_write8()

void io_write8 ( u16  reg,
u8  value 
)

Definition at line 61 of file fch.c.

References io_bar, value, and write8().

Referenced by outb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iomux_set_bar()

static void iomux_set_bar ( void bar)
static

Definition at line 34 of file fch.c.

References acpimmio_iomux.

◆ map_fch_devices()

static uint32_t map_fch_devices ( void  )
static

Definition at line 106 of file fch.c.

References args, ARRAY_SIZE, bar_map, BIOS_ERR, name, printk, and svc_map_fch_dev().

Referenced by verstage_soc_early_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ map_spi_rom()

uintptr_t* map_spi_rom ( void  )

Definition at line 91 of file fch.c.

References addr, BIOS_DEBUG, NULL, printk, svc_get_spi_rom_info(), and svc_map_spi_rom().

Referenced by boot_device_ro().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ misc_set_bar()

static void misc_set_bar ( void bar)
static

Definition at line 39 of file fch.c.

References acpimmio_misc.

◆ unmap_fch_devices()

uint32_t unmap_fch_devices ( void  )

Definition at line 126 of file fch.c.

References args, ARRAY_SIZE, bar_map, BIOS_ERR, name, NULL, printk, and svc_unmap_fch_dev().

Referenced by Main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ verstage_soc_aoac_init()

void verstage_soc_aoac_init ( void  )

Definition at line 169 of file fch.c.

References BIOS_DEBUG, enable_aoac_devices(), and printk.

Referenced by Main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ verstage_soc_early_init()

uint32_t verstage_soc_early_init ( void  )

Definition at line 150 of file fch.c.

References map_fch_devices().

Referenced by Main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ verstage_soc_espi_init()

void verstage_soc_espi_init ( void  )

Definition at line 155 of file fch.c.

References BIOS_DEBUG, CONFIG, espi_setup(), and printk.

Referenced by Main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ verstage_soc_i2c_init()

void verstage_soc_i2c_init ( void  )

Definition at line 163 of file fch.c.

References BIOS_DEBUG, i2c_soc_early_init(), and printk.

Referenced by Main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ verstage_soc_spi_init()

void verstage_soc_spi_init ( void  )

Definition at line 175 of file fch.c.

References BIOS_DEBUG, fch_spi_config_modes(), printk, and show_spi_speeds_and_modes().

Referenced by Main().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ _bar

void* _bar

Definition at line 78 of file fch.c.

◆ arg0

uint32_t arg0

Definition at line 75 of file fch.c.

Referenced by handle_sbi().

◆ 

◆ 

struct { ... } bar_map[]
Initial value:
= {
{"IOMUX", {FCH_IO_DEVICE_IOMUX}, iomux_set_bar},
{"MISC", {FCH_IO_DEVICE_MISC}, misc_set_bar},
{"GPIO", {FCH_IO_DEVICE_GPIO}, gpio_set_bar},
{"IO", {FCH_IO_DEVICE_IOPORT}, io_set_bar},
{"eSPI", {FCH_IO_DEVICE_ESPI}, espi_set_bar},
{"I2C2", {FCH_IO_DEVICE_I2C, 2}, i2c2_set_bar},
{"I2C3", {FCH_IO_DEVICE_I2C, 3}, i2c3_set_bar},
{"SPI", {FCH_IO_DEVICE_SPI}, spi_set_base},
{"AOAC", {FCH_IO_DEVICE_AOAC}, aoac_set_bar},
}
static void iomux_set_bar(void *bar)
Definition: fch.c:34
static void misc_set_bar(void *bar)
Definition: fch.c:39
static void aoac_set_bar(void *bar)
Definition: fch.c:66
static void espi_set_bar(void *bar)
Definition: fch.c:29
static void io_set_bar(void *bar)
Definition: fch.c:51
static void i2c2_set_bar(void *bar)
Definition: fch.c:24
static void i2c3_set_bar(void *bar)
Definition: fch.c:19
static void gpio_set_bar(void *bar)
Definition: fch.c:44
void spi_set_base(void *base)
Definition: fch_spi_util.c:14

Referenced by map_fch_devices(), and unmap_fch_devices().

◆ device

◆ io_bar

uintptr_t io_bar
static

Definition at line 49 of file fch.c.

Referenced by io_read8(), io_set_bar(), and io_write8().

◆ name

const char* name

Definition at line 72 of file fch.c.

Referenced by map_fch_devices(), and unmap_fch_devices().

◆ set_bar

void(* set_bar) (void *bar) ( void bar)

Definition at line 77 of file fch.c.