2 * This file is part of the coreboot project.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
16 #include <arch/exception.h>
17 #include <arch/stages.h>
18 #include <bootblock_common.h>
19 #include <console/console.h>
20 #include <program_loading.h>
21 #include <soc/clock.h>
22 #include <soc/nvidia/tegra/apbmisc.h>
23 #include <soc/pinmux.h>
24 #include <soc/power.h>
25 #include <timestamp.h>
26 #include <vendorcode/google/chromeos/chromeos.h>
28 /* called from assembly in bootblock_asm.S */
29 void tegra124_main(void);
31 static void run_next_stage(void *entry
)
34 clock_cpu0_config(entry
);
36 power_enable_and_ungate_cpu();
38 /* Repair RAM on cluster0 and cluster1 after CPU is powered on. */
41 clock_cpu0_remove_reset();
46 void tegra124_main(void)
48 // enable pinmux clamp inputs
49 clamp_tristate_inputs();
51 // enable JTAG at the earliest stage
56 // Serial out, tristate off.
57 pinmux_set_config(PINMUX_KB_ROW9_INDEX
, PINMUX_KB_ROW9_FUNC_UA3
);
58 // Serial in, tristate_on.
59 pinmux_set_config(PINMUX_KB_ROW10_INDEX
, PINMUX_KB_ROW10_FUNC_UA3
|
62 // Mux some pins away from uart A.
63 pinmux_set_config(PINMUX_UART2_CTS_N_INDEX
,
64 PINMUX_UART2_CTS_N_FUNC_UB3
|
66 pinmux_set_config(PINMUX_UART2_RTS_N_INDEX
,
67 PINMUX_UART2_RTS_N_FUNC_UB3
);
69 if (CONFIG(BOOTBLOCK_CONSOLE
)) {
76 bootblock_mainboard_init();
78 pinmux_set_config(PINMUX_CORE_PWR_REQ_INDEX
,
79 PINMUX_CORE_PWR_REQ_FUNC_PWRON
);
80 pinmux_set_config(PINMUX_CPU_PWR_REQ_INDEX
,
81 PINMUX_CPU_PWR_REQ_FUNC_CPU
);
82 pinmux_set_config(PINMUX_PWR_INT_N_INDEX
,
83 PINMUX_PWR_INT_N_FUNC_PMICINTR
|
91 void platform_prog_run(struct prog
*prog
)
93 run_next_stage(prog_entry(prog
));