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 <assert.h>
4 #include <arch/exception.h>
5 #include <arch/stages.h>
6 #include <bootblock_common.h>
7 #include <console/console.h>
8 #include <program_loading.h>
9 #include <soc/clock.h>
11 #include <soc/pinmux.h>
12 #include <soc/power.h>
13 #include <timestamp.h>
14 #include <vendorcode/google/chromeos/chromeos.h>
15 
16 /* called from assembly in bootblock_asm.S */
17 void tegra124_main(void);
18 
19 static void run_next_stage(void *entry)
20 {
21  ASSERT(entry);
22  clock_cpu0_config(entry);
23 
25 
26  /* Repair RAM on cluster0 and cluster1 after CPU is powered on. */
27  ram_repair();
28 
30 
32 }
33 
34 void tegra124_main(void)
35 {
36  // enable pinmux clamp inputs
38 
39  // enable JTAG at the earliest stage
40  enable_jtag();
41 
43 
44  // Serial out, tristate off.
45  pinmux_set_config(PINMUX_KB_ROW9_INDEX, PINMUX_KB_ROW9_FUNC_UA3);
46  // Serial in, tristate_on.
47  pinmux_set_config(PINMUX_KB_ROW10_INDEX, PINMUX_KB_ROW10_FUNC_UA3 |
50  // Mux some pins away from uart A.
51  pinmux_set_config(PINMUX_UART2_CTS_N_INDEX,
52  PINMUX_UART2_CTS_N_FUNC_UB3 |
54  pinmux_set_config(PINMUX_UART2_RTS_N_INDEX,
55  PINMUX_UART2_RTS_N_FUNC_UB3);
56 
57  if (CONFIG(BOOTBLOCK_CONSOLE)) {
58  console_init();
60  }
61 
62  clock_init();
63 
65 
66  pinmux_set_config(PINMUX_CORE_PWR_REQ_INDEX,
67  PINMUX_CORE_PWR_REQ_FUNC_PWRON);
68  pinmux_set_config(PINMUX_CPU_PWR_REQ_INDEX,
69  PINMUX_CPU_PWR_REQ_FUNC_CPU);
70  pinmux_set_config(PINMUX_PWR_INT_N_INDEX,
71  PINMUX_PWR_INT_N_FUNC_PMICINTR |
73 
74  timestamp_init(0);
75 
76  run_romstage();
77 }
78 
80 {
82 }
void enable_jtag(void)
Definition: apbmisc.c:10
void clamp_tristate_inputs(void)
Definition: apbmisc.c:15
void exception_init(void)
Definition: exception.c:120
#define ASSERT(x)
Definition: assert.h:44
@ CONFIG
Definition: dsi_common.h:201
void console_init(void)
Definition: init.c:49
__weak void bootblock_mainboard_init(void)
Definition: bootblock.c:19
void timestamp_init(uint64_t base)
Definition: timestamp.c:146
@ PINMUX_INPUT_ENABLE
Definition: pinmux.h:17
@ PINMUX_PULL_UP
Definition: pinmux.h:14
void power_enable_and_ungate_cpu(void)
Definition: power.c:52
void ram_repair(void)
void pinmux_set_config(int pin_index, uint32_t config)
Definition: pinmux.c:10
static void * prog_entry(const struct prog *prog)
void run_romstage(void)
Definition: prog_loaders.c:18
void platform_prog_run(struct prog *prog)
Definition: bootblock.c:104
void tegra124_main(void)
Definition: bootblock.c:34
static void run_next_stage(void *entry)
Definition: bootblock.c:19
void clock_cpu0_remove_reset(void)
Definition: clock.c:505
void clock_halt_avp(void)
Definition: clock.c:530
void clock_early_uart(void)
Definition: clock.c:386
void clock_init(void)
Definition: clock.c:539
void clock_cpu0_config(void *entry)
Definition: clock.c:472