blob: c7340b2719b97a5b9ad756e07083e0a2e3afd1b9 [file] [log] [blame]
Patrick Georgid1e50f92020-03-04 15:00:05 +01001/* SPDX-License-Identifier: GPL-2.0-only */
Ronald G. Minniche0e784a2014-11-26 19:25:47 +00002
3/*
Ronald G. Minniche0e784a2014-11-26 19:25:47 +00004 * Entry points must be placed at the location the previous stage jumps
5 * to (the lowest address in the stage image). This is done by giving
6 * stage_entry() its own section in .text and placing it first in the
7 * linker script.
8 */
9
10#include <arch/stages.h>
Xiang Wang26f725e2018-10-11 17:42:49 +080011#include <arch/smp/smp.h>
Xiang Wang820dcfc2018-07-19 17:35:39 +080012#include <mcall.h>
Ronald G. Minniche0e784a2014-11-26 19:25:47 +000013
Xiang Wang820dcfc2018-07-19 17:35:39 +080014void stage_entry(int hart_id, void *fdt)
Ronald G. Minniche0e784a2014-11-26 19:25:47 +000015{
Xiang Wang820dcfc2018-07-19 17:35:39 +080016 HLS()->hart_id = hart_id;
17 HLS()->fdt = fdt;
18 smp_pause(CONFIG_RISCV_WORKING_HARTID);
Jonathan Neuschäfer042a8332018-02-16 13:36:47 +010019
Ronald G. Minniche0e784a2014-11-26 19:25:47 +000020 main();
21}