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-only */
2 
3 #include <amdblocks/acpimmio.h>
4 #include <device/device.h>
6 #include <device/mmio.h>
8 
9 static const u8 mainboard_intr_data[] = {
10  [0x00] = 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* INTA# - INTH# */
11  [0x08] = 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F, /* Misc-nil, 0, 1, 2, INT from Serial irq */
12  [0x10] = 0x09, 0x1F, 0x1F, 0x10, 0x1F, 0x12, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
13  0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
14  0x12, 0x11, 0x12, 0x11, 0x12, 0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
15  0x11, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
16  0x10, 0x11, 0x12, 0x13
17 };
18 
19 /* PIRQ Setup */
20 static void pirq_setup(void)
21 {
23 }
24 
25 /**********************************************
26  * Enable the dedicated functions of the board.
27  **********************************************/
28 static void mainboard_enable(struct device *dev)
29 {
30  pirq_setup();
31 
32  /* Power off unused clock pins of GPP PCIe devices
33  * GPP CLK0 connected to unpopulated mini PCIe slot
34  * GPP CLK1 connected to ethernet chip
35  */
36  misc_write8(0, 0xff);
37  /* GPP CLK2 connected to the external USB3 controller */
38  misc_write8(1, 0x0f);
39  misc_write8(2, 0);
40  misc_write8(3, 0);
41  /* SLT_GFX_CLK connected to PCIe slot */
42  misc_write8(4, 0xf0);
43 
44  /*
45  * Initialize ASF registers to an arbitrary address because someone
46  * long ago set things up this way inside the SPD read code. The
47  * SPD read code has been made generic and moved out of the board
48  * directory, so the ASF init is being done here.
49  */
50  pm_write8(0x29, 0x80);
51  pm_write8(0x28, 0x61);
52 }
53 
56 };
struct chip_operations mainboard_ops
Definition: mainboard.c:19
static void pm_write8(uint8_t reg, uint8_t value)
Definition: acpimmio.h:181
static void misc_write8(uint8_t reg, uint8_t value)
Definition: acpimmio.h:271
static const u8 mainboard_intr_data[]
Definition: mainboard.c:9
static void mainboard_enable(struct device *dev)
Definition: mainboard.c:28
static void pirq_setup(void)
Definition: mainboard.c:20
const u8 * intr_data_ptr
Definition: amd_pci_util.c:13
uint8_t u8
Definition: stdint.h:45
void(* enable_dev)(struct device *dev)
Definition: device.h:24
Definition: device.h:107