summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2019-01-14 11:30:32 +0300
committerAnup Patel <anup@brainfault.org>2019-01-16 08:55:25 +0300
commit924a26d82fd948318619c6645865eaa0691640f9 (patch)
treeb31a748accbb5355991c028b5936800fbb2ca446 /include
parent5f097cbf0715e217cd2fb67731b10ec9a54ed4f3 (diff)
downloadopensbi-924a26d82fd948318619c6645865eaa0691640f9.tar.xz
include: Add documentation for sbi_scratch and friends
This patch adds doxygen style documentation for struct sbi_scratch and related helper macros/defines. Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_scratch.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/sbi/sbi_scratch.h b/include/sbi/sbi_scratch.h
index 25b00c3..ace1a0d 100644
--- a/include/sbi/sbi_scratch.h
+++ b/include/sbi/sbi_scratch.h
@@ -12,36 +12,58 @@
#include <sbi/riscv_asm.h>
+/** Offset of fw_start member in sbi_scratch */
#define SBI_SCRATCH_FW_START_OFFSET (0 * __SIZEOF_POINTER__)
+/** Offset of fw_size member in sbi_scratch */
#define SBI_SCRATCH_FW_SIZE_OFFSET (1 * __SIZEOF_POINTER__)
+/** Offset of next_arg1 member in sbi_scratch */
#define SBI_SCRATCH_NEXT_ARG1_OFFSET (2 * __SIZEOF_POINTER__)
+/** Offset of next_addr member in sbi_scratch */
#define SBI_SCRATCH_NEXT_ADDR_OFFSET (3 * __SIZEOF_POINTER__)
+/** Offset of next_mode member in sbi_scratch */
#define SBI_SCRATCH_NEXT_MODE_OFFSET (4 * __SIZEOF_POINTER__)
+/** Offset of warmboot_addr member in sbi_scratch */
#define SBI_SCRATCH_WARMBOOT_ADDR_OFFSET (5 * __SIZEOF_POINTER__)
+/** Offset of platform_addr member in sbi_scratch */
#define SBI_SCRATCH_PLATFORM_ADDR_OFFSET (6 * __SIZEOF_POINTER__)
+/** Offset of hartid_to_scratch member in sbi_scratch */
#define SBI_SCRATCH_HARTID_TO_SCRATCH_OFFSET (7 * __SIZEOF_POINTER__)
+/** Offset of ipi_type member in sbi_scratch */
#define SBI_SCRATCH_IPI_TYPE_OFFSET (8 * __SIZEOF_POINTER__)
+/** Maximum size of sbi_scratch */
#define SBI_SCRATCH_SIZE 256
#ifndef __ASSEMBLY__
#include <sbi/sbi_types.h>
+/** Representation of per-HART scratch space */
struct sbi_scratch {
+ /** Start (or base) address of firmware linked to OpenSBI library */
unsigned long fw_start;
+ /** Size (in bytes) of firmware linked to OpenSBI library */
unsigned long fw_size;
+ /** Arg1 (or 'a1' register) of next booting stage for this HART */
unsigned long next_arg1;
+ /** Address of next booting stage for this HART */
unsigned long next_addr;
+ /** Priviledge mode of next booting stage for this HART */
unsigned long next_mode;
+ /** Warm boot entry point address for this HART */
unsigned long warmboot_addr;
+ /** Address of sbi_platform */
unsigned long platform_addr;
+ /** Address of HART ID to sbi_scratch conversion function */
unsigned long hartid_to_scratch;
+ /** IPI type (or flags) */
unsigned long ipi_type;
} __attribute__((packed));
+/** Get pointer to sbi_scratch for current HART */
#define sbi_scratch_thishart_ptr() \
((struct sbi_scratch *)csr_read(mscratch))
+/** Get Arg1 of next booting stage for current HART */
#define sbi_scratch_thishart_arg1_ptr() \
((void *)(sbi_scratch_thishart_ptr()->next_arg1))