coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
chip.c File Reference
#include <acpi/acpi.h>
#include <acpi/acpi_device.h>
#include <acpi/acpigen.h>
#include <arch/cpu.h>
#include <bootstate.h>
#include <cbmem.h>
#include <console/console.h>
#include <device/pnp.h>
#include <ec/acpi/ec.h>
#include <intelblocks/cpulib.h>
#include <pc80/keyboard.h>
#include <stdint.h>
#include "commands.h"
#include "ec.h"
#include "chip.h"
Include dependency graph for chip.c:

Go to the source code of this file.

Macros

#define UCSI_MIN_ALLOC_REGION_LEN   CBMEM_SM_ROOT_SIZE
 

Functions

static void wilco_ec_post_complete (void *unused)
 
 BOOT_STATE_INIT_ENTRY (BS_PAYLOAD_LOAD, BS_ON_EXIT, wilco_ec_post_complete, NULL)
 
static void wilco_ec_post_memory_init (void *unused)
 
 BOOT_STATE_INIT_ENTRY (BS_PRE_DEVICE, BS_ON_EXIT, wilco_ec_post_memory_init, NULL)
 
static void wilco_ec_post_video_init (void *unused)
 
 BOOT_STATE_INIT_ENTRY (BS_DEV_INIT, BS_ON_EXIT, wilco_ec_post_video_init, NULL)
 
static void wilco_ec_post_logo_displayed (void *unused)
 
 BOOT_STATE_INIT_ENTRY (BS_POST_DEVICE, BS_ON_EXIT, wilco_ec_post_logo_displayed, NULL)
 
static void wilco_ec_resume (void *unused)
 
 BOOT_STATE_INIT_ENTRY (BS_OS_RESUME, BS_ON_ENTRY, wilco_ec_resume, NULL)
 
static int wilco_set_cpu_id (void)
 
static void wilco_ec_init (struct device *dev)
 
static void wilco_ec_resource (struct device *dev, int index, size_t base, size_t size)
 
static void wilco_ec_read_resources (struct device *dev)
 
static void wilco_ec_fill_ssdt_generator (const struct device *dev)
 
static const char * wilco_ec_acpi_name (const struct device *dev)
 
static void wilco_ec_enable_dev (struct device *dev)
 

Variables

static struct fieldlist ucsi_region_fields []
 
static const size_t ucsi_region_len = ARRAY_SIZE(ucsi_region_fields)
 
static struct device_operations ops
 
static struct pnp_info info []
 
struct chip_operations ec_google_wilco_ops
 

Macro Definition Documentation

◆ UCSI_MIN_ALLOC_REGION_LEN

#define UCSI_MIN_ALLOC_REGION_LEN   CBMEM_SM_ROOT_SIZE

Definition at line 24 of file chip.c.

Function Documentation

◆ BOOT_STATE_INIT_ENTRY() [1/5]

BOOT_STATE_INIT_ENTRY ( BS_DEV_INIT  ,
BS_ON_EXIT  ,
wilco_ec_post_video_init  ,
NULL   
)

◆ BOOT_STATE_INIT_ENTRY() [2/5]

BOOT_STATE_INIT_ENTRY ( BS_OS_RESUME  ,
BS_ON_ENTRY  ,
wilco_ec_resume  ,
NULL   
)

◆ BOOT_STATE_INIT_ENTRY() [3/5]

BOOT_STATE_INIT_ENTRY ( BS_PAYLOAD_LOAD  ,
BS_ON_EXIT  ,
wilco_ec_post_complete  ,
NULL   
)

◆ BOOT_STATE_INIT_ENTRY() [4/5]

BOOT_STATE_INIT_ENTRY ( BS_POST_DEVICE  ,
BS_ON_EXIT  ,
wilco_ec_post_logo_displayed  ,
NULL   
)

◆ BOOT_STATE_INIT_ENTRY() [5/5]

BOOT_STATE_INIT_ENTRY ( BS_PRE_DEVICE  ,
BS_ON_EXIT  ,
wilco_ec_post_memory_init  ,
NULL   
)

◆ wilco_ec_acpi_name()

static const char* wilco_ec_acpi_name ( const struct device dev)
static

Definition at line 210 of file chip.c.

◆ wilco_ec_enable_dev()

static void wilco_ec_enable_dev ( struct device dev)
static

Definition at line 227 of file chip.c.

◆ wilco_ec_fill_ssdt_generator()

◆ wilco_ec_init()

◆ wilco_ec_post_complete()

static void wilco_ec_post_complete ( void unused)
static

Definition at line 83 of file chip.c.

References BIOS_PROGRESS_POST_COMPLETE, KB_BIOS_PROGRESS, and wilco_ec_send().

Here is the call graph for this function:

◆ wilco_ec_post_logo_displayed()

static void wilco_ec_post_logo_displayed ( void unused)
static

Definition at line 104 of file chip.c.

References BIOS_PROGRESS_LOGO_DISPLAYED, KB_BIOS_PROGRESS, and wilco_ec_send().

Here is the call graph for this function:

◆ wilco_ec_post_memory_init()

static void wilco_ec_post_memory_init ( void unused)
static

Definition at line 90 of file chip.c.

References BIOS_PROGRESS_MEMORY_INIT, KB_BIOS_PROGRESS, and wilco_ec_send().

Here is the call graph for this function:

◆ wilco_ec_post_video_init()

static void wilco_ec_post_video_init ( void unused)
static

Definition at line 97 of file chip.c.

References BIOS_PROGRESS_VIDEO_INIT, KB_BIOS_PROGRESS, and wilco_ec_send().

Here is the call graph for this function:

◆ wilco_ec_read_resources()

static void wilco_ec_read_resources ( struct device dev)
static

Definition at line 169 of file chip.c.

References wilco_ec_resource().

Here is the call graph for this function:

◆ wilco_ec_resource()

static void wilco_ec_resource ( struct device dev,
int  index,
size_t  base,
size_t  size 
)
static

Definition at line 160 of file chip.c.

References resource::base, base, resource::flags, resource::index, IORESOURCE_ASSIGNED, IORESOURCE_FIXED, IORESOURCE_IO, new_resource(), and resource::size.

Referenced by wilco_ec_read_resources().

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

◆ wilco_ec_resume()

static void wilco_ec_resume ( void unused)
static

Definition at line 111 of file chip.c.

References KB_RESTORE, and wilco_ec_send_noargs().

Here is the call graph for this function:

◆ wilco_set_cpu_id()

static int wilco_set_cpu_id ( void  )
static

Definition at line 117 of file chip.c.

References cpu_get_cpuid(), cpu_read_topology(), and wilco_ec_set_cpuid().

Referenced by wilco_ec_init().

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

Variable Documentation

◆ ec_google_wilco_ops

struct chip_operations ec_google_wilco_ops
Initial value:
= {
.enable_dev = wilco_ec_enable_dev,
}
static void wilco_ec_enable_dev(struct device *dev)
Definition: chip.c:227

Definition at line 227 of file chip.c.

◆ info

struct pnp_info info[]
static
Initial value:
= {
{ NULL, 0, 0, 0, }
}
#define NULL
Definition: stddef.h:19

Definition at line 210 of file chip.c.

◆ ops

struct device_operations ops
static
Initial value:
= {
.init = wilco_ec_init,
.read_resources = wilco_ec_read_resources,
.set_resources = noop_set_resources,
.acpi_fill_ssdt = wilco_ec_fill_ssdt_generator,
.acpi_name = wilco_ec_acpi_name,
}
static void wilco_ec_fill_ssdt_generator(const struct device *dev)
Definition: chip.c:181
static const char * wilco_ec_acpi_name(const struct device *dev)
Definition: chip.c:210
static void wilco_ec_init(struct device *dev)
Definition: chip.c:125
static void wilco_ec_read_resources(struct device *dev)
Definition: chip.c:169
static void noop_set_resources(struct device *dev)
Definition: device.h:74

Definition at line 210 of file chip.c.

◆ ucsi_region_fields

struct fieldlist ucsi_region_fields[]
static

Definition at line 1 of file chip.c.

Referenced by wilco_ec_fill_ssdt_generator().

◆ ucsi_region_len

const size_t ucsi_region_len = ARRAY_SIZE(ucsi_region_fields)
static

Definition at line 81 of file chip.c.

Referenced by wilco_ec_fill_ssdt_generator().