coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mainboard.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3
#include <
console/console.h
>
4
#include <
device/device.h
>
5
#include <
option.h
>
6
#include <types.h>
7
8
/*
9
* Hiding the AST2400 might be desirable to reduce attack surface.
10
*
11
* The PCIe root port that the AST2400 is on is disabled, but the
12
* AST2400 itself likely remains in an enabled state.
13
*
14
* The AST2400 is also attached to the LPC. That interface does not get
15
* disabled.
16
*/
17
static
void
hide_ast2400
(
void
)
18
{
19
struct
device
*dev =
pcidev_on_root
(0x1c, 0);
20
if
(!dev)
21
return
;
22
23
/*
24
* Marking this device as disabled means that the southbridge code
25
* will properly disable the root port when it configures it later.
26
*/
27
dev->
enabled
= 0;
28
printk
(
BIOS_INFO
,
"The AST2400 is now set to be hidden.\n"
);
29
}
30
31
static
void
mainboard_enable
(
struct
device
*dev)
32
{
33
if
(
get_uint_option
(
"hide_ast2400"
,
false
))
34
hide_ast2400
();
35
}
36
37
struct
chip_operations
mainboard_ops
= {
38
CHIP_NAME
(
"X10SLM+-F"
)
39
.enable_dev =
mainboard_enable
,
40
};
mainboard_ops
struct chip_operations mainboard_ops
Definition:
mainboard.c:19
printk
#define printk(level,...)
Definition:
stdlib.h:16
console.h
pcidev_on_root
DEVTREE_CONST struct device * pcidev_on_root(uint8_t dev, uint8_t fn)
Definition:
device_const.c:260
device.h
CHIP_NAME
#define CHIP_NAME(X)
Definition:
device.h:32
BIOS_INFO
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition:
loglevel.h:113
get_uint_option
unsigned int get_uint_option(const char *name, const unsigned int fallback)
Definition:
option.c:116
option.h
chip_operations
Definition:
device.h:23
device
Definition:
device.h:107
device::enabled
unsigned int enabled
Definition:
device.h:122
hide_ast2400
static void hide_ast2400(void)
Definition:
mainboard.c:17
mainboard_enable
static void mainboard_enable(struct device *dev)
Definition:
mainboard.c:31
src
mainboard
supermicro
x10slm-f
mainboard.c
Generated by
1.9.1