As of now, uboot doesn't have support for SMP.
Moreover, unleashed board has a E51 hart which
doesn't not support S mode.
We should only boot only 1 non-zero hart.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Conditionnally delegate page fault exceptions from M mode to S mode
based on the platform features.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
The sbi_hart_switch_mode() will be used by CPU hotplug. This means
if we have prints in sbi_hart_switch_mode() then these prints will
mix with Linux prints.
Being a runtime firmware, we should be verbose only at coldboot
time and error situations.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
commit d403c70fb1 breaks Linux
booting because of fewer exceptions delegated to S-mode. This
patch fixes Linux booting by having all required exceptions
delegated to S-mode.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Cleanup sbi_hart_boot_nexti() code, adding messages for clarity and
rename the function to sbi_hart_switch_mode() to reflect what the
function actually does.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
When S mode is not supported, simply clear mideleg and medeleg.
Otherwise, set delegation from M-mode to S-mode, removing the page
fault exceptions as those would not happen in M-mode.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Make it clear that the end of the FW execution was reached without the
hand being passed to any payload.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Allow a platform to report its supported features in more details.
The new features defined are:
* SBI_PLATFORM_HAS_PMP
* SBI_PLATFORM_HAS_SCOUNTEREN
* SBI_PLATFORM_HAS_MCOUNTEREN
In addition, define the macro SBI_PLATFORM_DEFAULT_FEATURES as the set
of features that are generally expected to be supported by a Linux
capable platform.
Operations touching the features controlled with these falgs are not
executed if the platform does not set the corresponding feature flags.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
We should not jump to next stage if next mode (S-mode or U-mode)
is not supported by HART.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Anup Patel <anup.patel@wdc.com>
On QEMU Virt, max supported HARTs are 8 but number of HARTs
actually depend on "-smp" command-line parameter passed to
QEMU. This creates problems in sbi_hart_wake_coldboot_harts()
because when number of HARTs are less than 8.
To tackle this, we introduce a bitmap to track HARTs waiting
for coldboot to finish. We wake only those HARTs who have
set their bit in coldboot bitmap.
Signed-off-by: Anup Patel <anup.patel@wdc.com>