Patrick Georgi | d1e50f9 | 2020-03-04 15:00:05 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Ronald G. Minnich | e0e784a | 2014-11-26 19:25:47 +0000 | [diff] [blame] | 2 | |
| 3 | /* |
Ronald G. Minnich | e0e784a | 2014-11-26 19:25:47 +0000 | [diff] [blame] | 4 | * 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 Wang | 26f725e | 2018-10-11 17:42:49 +0800 | [diff] [blame] | 11 | #include <arch/smp/smp.h> |
Xiang Wang | 820dcfc | 2018-07-19 17:35:39 +0800 | [diff] [blame] | 12 | #include <mcall.h> |
Ronald G. Minnich | e0e784a | 2014-11-26 19:25:47 +0000 | [diff] [blame] | 13 | |
Xiang Wang | 820dcfc | 2018-07-19 17:35:39 +0800 | [diff] [blame] | 14 | void stage_entry(int hart_id, void *fdt) |
Ronald G. Minnich | e0e784a | 2014-11-26 19:25:47 +0000 | [diff] [blame] | 15 | { |
Xiang Wang | 820dcfc | 2018-07-19 17:35:39 +0800 | [diff] [blame] | 16 | HLS()->hart_id = hart_id; |
| 17 | HLS()->fdt = fdt; |
| 18 | smp_pause(CONFIG_RISCV_WORKING_HARTID); |
Jonathan Neuschäfer | 042a833 | 2018-02-16 13:36:47 +0100 | [diff] [blame] | 19 | |
Ronald G. Minnich | e0e784a | 2014-11-26 19:25:47 +0000 | [diff] [blame] | 20 | main(); |
| 21 | } |