coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
fw_config.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#include <arch/mmio.h>
4
#include <
bootstate.h
>
5
#include <
fw_config.h
>
6
#include <
gpio.h
>
7
#include <
intelblocks/gpio.h
>
8
9
#define PAD_CFG_DW2_OFFSET (2 * sizeof(uint32_t))
10
#define VCCIOSEL_1V8 (1 << 8)
11
12
static
void
fw_config_handle
(
void
*unused)
13
{
14
void
*pad_conf_offset =
gpio_dwx_address
(
GPP_D17
) +
PAD_CFG_DW2_OFFSET
;
15
uint32_t
pad_conf =
read32
(pad_conf_offset);
16
17
if
(
fw_config_probe
(
FW_CONFIG
(AUDIO_AMP, RT1015P_AUTO))) {
18
pad_conf |=
VCCIOSEL_1V8
;
19
write32
(pad_conf_offset, pad_conf);
20
}
21
}
22
BOOT_STATE_INIT_ENTRY
(
BS_DEV_ENABLE
,
BS_ON_ENTRY
,
fw_config_handle
,
NULL
);
GPP_D17
#define GPP_D17
Definition:
gpio_soc_defs.h:269
write32
static void write32(void *addr, uint32_t val)
Definition:
mmio.h:40
read32
static uint32_t read32(const void *addr)
Definition:
mmio.h:22
bootstate.h
BS_DEV_ENABLE
@ BS_DEV_ENABLE
Definition:
bootstate.h:82
BS_ON_ENTRY
@ BS_ON_ENTRY
Definition:
bootstate.h:95
fw_config.h
FW_CONFIG
#define FW_CONFIG(__field, __option)
Definition:
fw_config.h:28
fw_config_probe
bool fw_config_probe(const struct fw_config *match)
Definition:
fw_config.c:62
BOOT_STATE_INIT_ENTRY
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL)
VCCIOSEL_1V8
#define VCCIOSEL_1V8
Definition:
fw_config.c:10
PAD_CFG_DW2_OFFSET
#define PAD_CFG_DW2_OFFSET
Definition:
fw_config.c:9
fw_config_handle
static void fw_config_handle(void *unused)
Definition:
fw_config.c:12
gpio_dwx_address
void * gpio_dwx_address(const gpio_t pad)
Definition:
gpio.c:398
gpio.h
gpio.h
NULL
#define NULL
Definition:
stddef.h:19
uint32_t
unsigned int uint32_t
Definition:
stdint.h:14
src
mainboard
google
dedede
fw_config.c
Generated by
1.9.1