coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
romstage.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <amdblocks/acpimmio.h>
5 #include "gpio_ftns.h"
6 #include <SB800.h>
7 #include <sb_cimx.h>
8 
9 static void early_lpc_init(void)
10 {
11  /* PC Engines requires system boot when power is applied. This feature is
12  * controlled in PM_REG 5Bh register. "Always Power On" works by writing a
13  * value of 05h.
14  */
15  u8 bdata = pm_read8(SB_PMIOA_REG5B);
16  bdata &= 0xf8; //clear bits 0-2
17  bdata |= 0x05; //set bits 0,2
18  pm_write8(SB_PMIOA_REG5B, bdata);
19 
20  /* Multi-function pins switch to GPIO0-35, these pins are shared with PCI pins */
21  bdata = pm_read8(SB_PMIOA_REGEA);
22  bdata &= 0xfe; //clear bit 0
23  bdata |= 0x01; //set bit 0
24  pm_write8(SB_PMIOA_REGEA, bdata);
25 
26  //configure required GPIOs
37 }
38 
39 void board_BeforeAgesa(struct sysinfo *cb)
40 {
42 }
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
void configure_gpio(u8 gpio, u8 iomux_ftn, u8 setting)
Definition: gpio_ftns.c:8
#define GPIO_10
Definition: gpio_ftns.h:12
#define GPIO_OUTPUT
Definition: gpio_ftns.h:23
#define GPIO_191
Definition: gpio_ftns.h:21
#define GPIO_DATA_HIGH
Definition: gpio_ftns.h:27
#define GPIO_18
Definition: gpio_ftns.h:17
#define GPIO_DATA_LOW
Definition: gpio_ftns.h:26
#define GPIO_17
Definition: gpio_ftns.h:16
#define GPIO_INPUT
Definition: gpio_ftns.h:24
#define GPIO_16
Definition: gpio_ftns.h:15
#define GPIO_189
Definition: gpio_ftns.h:19
#define GPIO_FTN_1
Definition: gpio_ftns.h:22
#define GPIO_11
Definition: gpio_ftns.h:13
#define GPIO_190
Definition: gpio_ftns.h:20
#define GPIO_187
Definition: gpio_ftns.h:18
#define GPIO_15
Definition: gpio_ftns.h:14
void __weak board_BeforeAgesa(struct sysinfo *cb)
Definition: romstage.c:19
static void early_lpc_init(void)
Definition: romstage.c:9
uint8_t u8
Definition: stdint.h:45