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 <
bootstate.h
>
4
#include <
console/console.h
>
5
#include <
fw_config.h
>
6
#include <gpio.h>
7
8
static
const
struct
pad_config
i2s_enable_pads
[] = {
9
/* Audio Codec INT N */
10
PAD_CFG_GPI_APIC
(
GPP_H3
,
NONE
, PLTRST, EDGE_BOTH, INVERT),
11
12
/* I2S0_SCLK */
13
PAD_CFG_NF
(
GPP_R0
,
NONE
, DEEP, NF2),
14
/* I2S0_SFRM */
15
PAD_CFG_NF
(
GPP_R1
,
NONE
, DEEP, NF2),
16
/* I2S0_TXD */
17
PAD_CFG_NF
(
GPP_R2
,
NONE
, DEEP, NF2),
18
/* I2S0_RXD */
19
PAD_CFG_NF
(
GPP_R3
,
NONE
, DEEP, NF2),
20
21
/* I2S2_SCLK */
22
PAD_CFG_NF
(
GPP_R4
,
NONE
, DEEP, NF2),
23
/* I2S2_SFRM */
24
PAD_CFG_NF
(
GPP_R5
,
NONE
, DEEP, NF2),
25
/* I2S2_TXD */
26
PAD_CFG_NF
(
GPP_R6
,
NONE
, DEEP, NF2),
27
/* I2S2_RXD */
28
PAD_CFG_NF
(
GPP_R7
,
NONE
, DEEP, NF2),
29
30
/* I2S_MCLK1_OUT */
31
PAD_CFG_NF
(
GPP_D19
,
NONE
, DEEP, NF1),
32
};
33
34
static
void
fw_config_handle
(
void
*
unused
)
35
{
36
if
(
fw_config_probe
(
FW_CONFIG
(
AUDIO
, ADL_MAX98373_ALC5682I_I2S))) {
37
printk
(
BIOS_INFO
,
"Configure GPIOs for I2S audio.\n"
);
38
gpio_configure_pads
(
i2s_enable_pads
,
ARRAY_SIZE
(
i2s_enable_pads
));
39
}
40
}
41
BOOT_STATE_INIT_ENTRY
(
BS_DEV_ENABLE
,
BS_ON_ENTRY
,
fw_config_handle
,
NULL
);
GPP_R4
#define GPP_R4
Definition:
gpio_soc_defs.h:673
GPP_R7
#define GPP_R7
Definition:
gpio_soc_defs.h:676
GPP_R3
#define GPP_R3
Definition:
gpio_soc_defs.h:672
GPP_R6
#define GPP_R6
Definition:
gpio_soc_defs.h:675
GPP_R0
#define GPP_R0
Definition:
gpio_soc_defs.h:669
GPP_R2
#define GPP_R2
Definition:
gpio_soc_defs.h:671
GPP_H3
#define GPP_H3
Definition:
gpio_soc_defs.h:219
GPP_R5
#define GPP_R5
Definition:
gpio_soc_defs.h:674
GPP_D19
#define GPP_D19
Definition:
gpio_soc_defs.h:271
GPP_R1
#define GPP_R1
Definition:
gpio_soc_defs.h:670
bootstate.h
BS_DEV_ENABLE
@ BS_DEV_ENABLE
Definition:
bootstate.h:82
BS_ON_ENTRY
@ BS_ON_ENTRY
Definition:
bootstate.h:95
ARRAY_SIZE
#define ARRAY_SIZE(a)
Definition:
helpers.h:12
printk
#define printk(level,...)
Definition:
stdlib.h:16
console.h
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
BIOS_INFO
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition:
loglevel.h:113
BOOT_STATE_INIT_ENTRY
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL)
i2s_enable_pads
static const struct pad_config i2s_enable_pads[]
Definition:
fw_config.c:8
fw_config_handle
static void fw_config_handle(void *unused)
Definition:
fw_config.c:34
AUDIO
@ AUDIO
Definition:
dramc_pi_api.h:49
NONE
@ NONE
Definition:
qup_se_handlers_common.h:196
gpio_configure_pads
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
PAD_CFG_NF
#define PAD_CFG_NF(pad, pull, rst, func)
Definition:
gpio_defs.h:197
PAD_CFG_GPI_APIC
#define PAD_CFG_GPI_APIC(pad, pull, rst, trig, inv)
Definition:
gpio_defs.h:376
NULL
#define NULL
Definition:
stddef.h:19
pad_config
Definition:
gpio.h:75
pad_config::unused
uint16_t unused
Definition:
padconfig.h:13
src
mainboard
intel
adlrvp
fw_config.c
Generated by
1.9.1