summaryrefslogtreecommitdiff
path: root/platform/generic/include
diff options
context:
space:
mode:
authorAnup Patel <[email protected]>2020-04-28 09:23:30 +0530
committerAnup Patel <[email protected]>2020-05-01 10:33:05 +0530
commitf1aa9e54e00006ae70aeac638d5b75093520f65d (patch)
tree34ca3d90e5ef4c62062ced3119852e27eb11cb79 /platform/generic/include
parent4d063538f0493916dc6263276c4c84f31446db41 (diff)
platform: Add generic FDT based platform support
We add generic FDT based platform support which provides platform specific functionality based on the FDT passed by previous booting stage. By default, the generic FDT platform makes following assumptions: 1. platform FW_TEXT_START is 0x80000000 2. platform features are default 3. platform stack size is default 4. platform has no quirks or work-arounds The above assumptions (except 1) can be overridden by adding special platform callbacks which will be called based on the FDT root node compatible string. By default, we compile OpenSBI generic platform as follows: $ make PLATFORM=generic For a non-standard FW_TEXT_START, we can compile OpenSBI generic platform as follows: $ make PLATFORM=generic FW_TEXT_START=<non_standard_text_start> Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]>
Diffstat (limited to 'platform/generic/include')
-rw-r--r--platform/generic/include/platform_override.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/platform/generic/include/platform_override.h b/platform/generic/include/platform_override.h
new file mode 100644
index 00000000..1262627e
--- /dev/null
+++ b/platform/generic/include/platform_override.h
@@ -0,0 +1,26 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2020 Western Digital Corporation or its affiliates.
+ *
+ * Authors:
+ * Anup Patel <[email protected]>
+ */
+
+#ifndef __PLATFORM_OVERRIDE_H__
+#define __PLATFORM_OVERRIDE_H__
+
+#include <sbi/sbi_types.h>
+
+struct platform_override {
+ const struct fdt_match *match_table;
+ u64 (*features)(const struct fdt_match *match);
+ u64 (*tlbr_flush_limit)(const struct fdt_match *match);
+ int (*early_init)(bool cold_boot, const struct fdt_match *match);
+ int (*final_init)(bool cold_boot, const struct fdt_match *match);
+ void (*early_exit)(const struct fdt_match *match);
+ void (*final_exit)(const struct fdt_match *match);
+ int (*system_reset)(u32 reset_type, const struct fdt_match *match);
+};
+
+#endif