soc: Remove copyright notices
[coreboot.git] / src / soc / nvidia / tegra124 / bootblock.c
blob80718393ddcd6df3687a38dbbc0e39c52faa5d9f
1 /*
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.
15 #include <assert.h>
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)
33 ASSERT(entry);
34 clock_cpu0_config(entry);
36 power_enable_and_ungate_cpu();
38 /* Repair RAM on cluster0 and cluster1 after CPU is powered on. */
39 ram_repair();
41 clock_cpu0_remove_reset();
43 clock_halt_avp();
46 void tegra124_main(void)
48 // enable pinmux clamp inputs
49 clamp_tristate_inputs();
51 // enable JTAG at the earliest stage
52 enable_jtag();
54 clock_early_uart();
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 |
60 PINMUX_PULL_UP |
61 PINMUX_INPUT_ENABLE);
62 // Mux some pins away from uart A.
63 pinmux_set_config(PINMUX_UART2_CTS_N_INDEX,
64 PINMUX_UART2_CTS_N_FUNC_UB3 |
65 PINMUX_INPUT_ENABLE);
66 pinmux_set_config(PINMUX_UART2_RTS_N_INDEX,
67 PINMUX_UART2_RTS_N_FUNC_UB3);
69 if (CONFIG(BOOTBLOCK_CONSOLE)) {
70 console_init();
71 exception_init();
74 clock_init();
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 |
84 PINMUX_INPUT_ENABLE);
86 timestamp_init(0);
88 run_romstage();
91 void platform_prog_run(struct prog *prog)
93 run_next_stage(prog_entry(prog));