coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
bootblock.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <amdblocks/acpimmio.h>
4 #include <bootblock_common.h>
7 
8 #define SERIAL_DEV PNP_DEV(0x4E, NCT5104D_SP4)
9 
11 {
12  u32 reg32;
13 
14  /* Set auxiliary output clock frequency on OSCOUT1 pin to be 25MHz */
15  /* Set auxiliary output clock frequency on OSCOUT2 pin to be 48MHz */
16  reg32 = misc_read32(0x28);
17  reg32 &= 0xffc0ffff; // Clr bits [21:19] & [18:16]
18  reg32 |= 0x00010000; // Set bit 16 for 25MHz
19  misc_write32(0x28, reg32);
20 
21  /* Enable Auxiliary OSCOUT1/OSCOUT2 */
22  reg32 = misc_read32(0x40);
23  reg32 &= 0xffffff7b; // clear 2, 7
24  misc_write32(0x40, reg32);
25 
27  nuvoton_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
28 }
static uint32_t misc_read32(uint8_t reg)
Definition: acpimmio.h:266
static void misc_write32(uint8_t reg, uint32_t value)
Definition: acpimmio.h:281
__weak void bootblock_mainboard_early_init(void)
Definition: bootblock.c:16
#define SERIAL_DEV
Definition: bootblock.c:8
void nuvoton_enable_serial(pnp_devfn_t dev, u16 iobase)
Definition: early_serial.c:48
uint32_t u32
Definition: stdint.h:51
void nct5104d_enable_uartd(pnp_devfn_t dev)
Definition: early_init.c:28