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
bt_i2s_enable_pads
[] = {
9
PAD_CFG_NF
(
GPP_VGPIO_30
,
NONE
, DEEP, NF3),
/* BT_I2S_BCLK */
10
PAD_CFG_NF
(
GPP_VGPIO_31
,
NONE
, DEEP, NF3),
/* BT_I2S_SYNC */
11
PAD_CFG_NF
(
GPP_VGPIO_32
,
NONE
, DEEP, NF3),
/* BT_I2S_SDO */
12
PAD_CFG_NF
(
GPP_VGPIO_33
,
NONE
, DEEP, NF3),
/* BT_I2S_SDI */
13
PAD_CFG_NF
(
GPP_VGPIO_34
,
NONE
, DEEP, NF1),
/* SSP2_SCLK */
14
PAD_CFG_NF
(
GPP_VGPIO_35
,
NONE
, DEEP, NF1),
/* SSP2_SFRM */
15
PAD_CFG_NF
(
GPP_VGPIO_36
,
NONE
, DEEP, NF1),
/* SSP_TXD */
16
PAD_CFG_NF
(
GPP_VGPIO_37
,
NONE
, DEEP, NF1),
/* SSP_RXD */
17
};
18
19
static
const
struct
pad_config
bt_i2s_disable_pads
[] = {
20
PAD_NC
(
GPP_VGPIO_30
,
NONE
),
21
PAD_NC
(
GPP_VGPIO_31
,
NONE
),
22
PAD_NC
(
GPP_VGPIO_32
,
NONE
),
23
PAD_NC
(
GPP_VGPIO_33
,
NONE
),
24
PAD_NC
(
GPP_VGPIO_34
,
NONE
),
25
PAD_NC
(
GPP_VGPIO_35
,
NONE
),
26
PAD_NC
(
GPP_VGPIO_36
,
NONE
),
27
PAD_NC
(
GPP_VGPIO_37
,
NONE
),
28
};
29
30
static
void
fw_config_handle
(
void
*
unused
)
31
{
32
if
(!
fw_config_is_provisioned
() ||
fw_config_probe
(
FW_CONFIG
(
AUDIO
, AUDIO_UNKNOWN))) {
33
printk
(
BIOS_INFO
,
"Disable BT offload audio related GPIO pins.\n"
);
34
gpio_configure_pads
(
bt_i2s_disable_pads
,
ARRAY_SIZE
(
bt_i2s_disable_pads
));
35
return
;
36
}
37
38
if
(
fw_config_probe
(
FW_CONFIG
(
AUDIO
, NAU88L25B_I2S))) {
39
printk
(
BIOS_INFO
,
"BT offload enabled over I2S with NAU88L25B\n"
);
40
gpio_configure_pads
(
bt_i2s_enable_pads
,
ARRAY_SIZE
(
bt_i2s_enable_pads
));
41
}
42
43
}
44
BOOT_STATE_INIT_ENTRY
(
BS_DEV_ENABLE
,
BS_ON_ENTRY
,
fw_config_handle
,
NULL
);
GPP_VGPIO_37
#define GPP_VGPIO_37
Definition:
gpio_soc_defs.h:351
GPP_VGPIO_32
#define GPP_VGPIO_32
Definition:
gpio_soc_defs.h:346
GPP_VGPIO_36
#define GPP_VGPIO_36
Definition:
gpio_soc_defs.h:350
GPP_VGPIO_31
#define GPP_VGPIO_31
Definition:
gpio_soc_defs.h:345
GPP_VGPIO_34
#define GPP_VGPIO_34
Definition:
gpio_soc_defs.h:348
GPP_VGPIO_35
#define GPP_VGPIO_35
Definition:
gpio_soc_defs.h:349
GPP_VGPIO_30
#define GPP_VGPIO_30
Definition:
gpio_soc_defs.h:344
GPP_VGPIO_33
#define GPP_VGPIO_33
Definition:
gpio_soc_defs.h:347
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_is_provisioned
bool fw_config_is_provisioned(void)
Definition:
fw_config.c:83
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)
bt_i2s_disable_pads
static const struct pad_config bt_i2s_disable_pads[]
Definition:
fw_config.c:19
fw_config_handle
static void fw_config_handle(void *unused)
Definition:
fw_config.c:30
bt_i2s_enable_pads
static const struct pad_config bt_i2s_enable_pads[]
Definition:
fw_config.c:8
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_NC
#define PAD_NC(pin)
Definition:
gpio_defs.h:263
PAD_CFG_NF
#define PAD_CFG_NF(pad, pull, rst, func)
Definition:
gpio_defs.h:197
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
google
brya
variants
brask
fw_config.c
Generated by
1.9.1