forked from Mirrors/opensbi

Currently, the default payload for FW_PAYLOAD is embedded fw_payload.S itself. This means people have to hack fw_payload.S if they want to have some temporary S-mode test code. This patch adds a separate dummy payload for FW_PAYLOAD which can be easily hacked for some S-mode testing. Signed-off-by: Anup Patel <anup.patel@wdc.com>
32 lines
532 B
C
32 lines
532 B
C
/*
|
|
* Copyright (c) 2018 Western Digital Corporation or its affiliates.
|
|
*
|
|
* Authors:
|
|
* Anup Patel <anup.patel@wdc.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <sbi/sbi_ecall_interface.h>
|
|
|
|
#define wfi() \
|
|
do { \
|
|
__asm__ __volatile__ ("wfi" ::: "memory"); \
|
|
} while (0)
|
|
|
|
static void sbi_puts(const char *str)
|
|
{
|
|
while (*str) {
|
|
SBI_ECALL_1(SBI_ECALL_CONSOLE_PUTCHAR, *str);
|
|
str++;
|
|
}
|
|
}
|
|
|
|
void dummy_main(unsigned long a0, unsigned long a1)
|
|
{
|
|
sbi_puts("\nDummy Payload\n");
|
|
|
|
while (1)
|
|
wfi();
|
|
}
|