1 /* SPDX-License-Identifier: GPL-2.0-only */
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>
10 #include <soc/nvidia/tegra/apbmisc.h>
11 #include <soc/pinmux.h>
12 #include <soc/power.h>
13 #include <timestamp.h>
14 #include <vendorcode/google/chromeos/chromeos.h>
16 /* called from assembly in bootblock_asm.S */
17 void tegra124_main(void);
19 static void run_next_stage(void *entry
)
22 clock_cpu0_config(entry
);
24 power_enable_and_ungate_cpu();
26 /* Repair RAM on cluster0 and cluster1 after CPU is powered on. */
29 clock_cpu0_remove_reset();
34 void tegra124_main(void)
36 // enable pinmux clamp inputs
37 clamp_tristate_inputs();
39 // enable JTAG at the earliest stage
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
);
57 if (CONFIG(BOOTBLOCK_CONSOLE
)) {
64 bootblock_mainboard_init();
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
|
79 void platform_prog_run(struct prog
*prog
)
81 run_next_stage(prog_entry(prog
));