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>
5 #include <delay.h>
6 #include <device/device.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  * Southstation using SB GPIO 17/18 to control the Red/Green LED
27  * These two LEDs can be used to show the OS booting status.
28  */
29 static void southstation_led_init(void)
30 {
31  /* multi-function pins switch to GPIO0-35 */
32  pm_write8(0xea, (pm_read8(0xea) & 0xfe) | 1);
33 
34  /* select IOMux to function2, corresponds to GPIO */
35  iomux_write8(0x11, (iomux_read8(0x11) & 0xfc) | 2);
36  iomux_write8(0x12, (iomux_read8(0x12) & 0xfc) | 2);
37 
38  /* Lighting test */
39  gpio_100_write8(0x11, 0x08); //output high
40  gpio_100_write8(0x12, 0x08);
41  mdelay(100);
42  gpio_100_write8(0x11, 0x48); //output low
43  gpio_100_write8(0x12, 0x48);
44 }
45 
46 /**********************************************
47  * Enable the dedicated functions of the board.
48  **********************************************/
49 static void mainboard_enable(struct device *dev)
50 {
51  pirq_setup();
52 
54 
55  /*
56  * Initialize ASF registers to an arbitrary address because someone
57  * long ago set things up this way inside the SPD read code. The
58  * SPD read code has been made generic and moved out of the board
59  * directory, so the ASF init is being done here.
60  */
61  pm_write8(0x29, 0x80);
62  pm_write8(0x28, 0x61);
63 }
64 
67 };
struct chip_operations mainboard_ops
Definition: mainboard.c:19
static uint8_t pm_read8(uint8_t reg)
Definition: acpimmio.h:166
static void pm_write8(uint8_t reg, uint8_t value)
Definition: acpimmio.h:181
static uint8_t iomux_read8(uint8_t reg)
static void gpio_100_write8(uint8_t reg, uint8_t value)
static void iomux_write8(uint8_t reg, uint8_t value)
static const u8 mainboard_intr_data[]
Definition: mainboard.c:9
static void mainboard_enable(struct device *dev)
Definition: mainboard.c:49
static void southstation_led_init(void)
Southstation using SB GPIO 17/18 to control the Red/Green LED These two LEDs can be used to show the ...
Definition: mainboard.c:29
static void pirq_setup(void)
Definition: mainboard.c:20
void mdelay(unsigned int msecs)
Definition: delay.c:2
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