coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ramstage.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <bootstate.h>
4 #include <console/console.h>
5 #include <device/i2c_simple.h>
6 #include <soc/ramstage.h>
7 #include <variant/gpio.h>
8 
10 {
11  /* Configure pads prior to SiliconInit() in case there's any
12  * dependencies during hardware initialization. */
14  params->CdClock = 3;
15 }
16 
17 static void ioexpander_init(void *unused)
18 {
19  if (CONFIG(BOARD_INTEL_KBLRVP11))
20  return;
21 
22  printk(BIOS_DEBUG, "Programming TCA6424A I/O expander\n");
23 
24  /* I/O Expander 1, Port 0 Data */
26  0xF7);
27  /* Port 0 Configuration */
29  0xE0);
30 
31  /* Port 1 Data */
33  0x9E);
34  /* Port 1 Configuration */
36  0x8C);
37 
38  /* Port 2 Data */
40  0xDA);
41  /* Port 2 Configuration */
43  0x08);
44 
45  /* I/O Expander 2, Port 0 Data */
47  0xFF);
48  /* Port 0 Configuration */
50  0x00);
51 
52 }
53 
static struct sdram_info params
Definition: sdram_configs.c:83
@ BS_POST_DEVICE
Definition: bootstate.h:84
@ BS_ON_EXIT
Definition: bootstate.h:96
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define printk(level,...)
Definition: stdlib.h:16
__weak void mainboard_silicon_init_params(SILICON_INIT_UPD *params)
Definition: ramstage.c:162
BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_EXIT, init_store, NULL)
@ CONFIG
Definition: dsi_common.h:201
static int i2c_writeb(unsigned int bus, uint8_t slave, uint8_t reg, uint8_t data)
Write a byte with one segment in one frame.
Definition: i2c_simple.h:131
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
static const struct pad_config gpio_table[]
Definition: gpio.h:24
static void ioexpander_init(void *unused)
Definition: ramstage.c:17
#define IO_EXPANDER_P2DOUT
Definition: gpio.h:17
#define IO_EXPANDER_P0CONF
Definition: gpio.h:12
#define IO_EXPANDER_P0DOUT
Definition: gpio.h:13
#define IO_EXPANDER_P1CONF
Definition: gpio.h:14
#define IO_EXPANDER_BUS
Definition: gpio.h:10
#define IO_EXPANDER_P1DOUT
Definition: gpio.h:15
#define IO_EXPANDER_0_ADDR
Definition: gpio.h:11
#define IO_EXPANDER_1_ADDR
Definition: gpio.h:18
#define IO_EXPANDER_P2CONF
Definition: gpio.h:16
void gpio_configure_pads(const struct soc_amd_gpio *gpio_list_ptr, size_t size)
program a particular set of GPIO
Definition: gpio.c:307
#define FSP_SIL_UPD
Definition: ramstage.h:12
#define NULL
Definition: stddef.h:19