blob: 9f1d62e7dde39e95044b125f2a68e9ece36a76e4 [file] [log] [blame]
Lukas Auer515b9342019-08-21 21:14:44 +02001/* SPDX-License-Identifier: BSD-2-Clause */
2/*
3 * Copyright (c) 2019 Western Digital Corporation or its affiliates.
4 *
5 * Based on include/sbi/{fw_dynamic.h,sbi_scratch.h} from the OpenSBI project.
6 */
7#ifndef OPENSBI_H
8#define OPENSBI_H
9
10/** Expected value of info magic ('OSBI' ascii string in hex) */
11#define FW_DYNAMIC_INFO_MAGIC_VALUE 0x4942534f
12
13/** Maximum supported info version */
14#define FW_DYNAMIC_INFO_VERSION 0x1
15
16/** Possible next mode values */
17#define FW_DYNAMIC_INFO_NEXT_MODE_U 0x0
18#define FW_DYNAMIC_INFO_NEXT_MODE_S 0x1
19#define FW_DYNAMIC_INFO_NEXT_MODE_M 0x3
20
21enum sbi_scratch_options {
22 /** Disable prints during boot */
23 SBI_SCRATCH_NO_BOOT_PRINTS = (1 << 0),
24};
25
26/** Representation dynamic info passed by previous booting stage */
27struct fw_dynamic_info {
28 /** Info magic */
29 unsigned long magic;
30 /** Info version */
31 unsigned long version;
32 /** Next booting stage address */
33 unsigned long next_addr;
34 /** Next booting stage mode */
35 unsigned long next_mode;
36 /** Options for OpenSBI library */
37 unsigned long options;
38} __packed;
39
40#endif