aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2019-07-11 17:41:42 +1000
committerStewart Smith <stewart@linux.ibm.com>2019-07-15 13:48:33 +1000
commitf68b949dbc64ee866d630d9f873e1f725ace09c2 (patch)
tree6fd6f966dbd7e846684152b6507ea0b90b9abd37
parent218eb321d0b3ad4dcc78fa816ad804a6c226cd25 (diff)
downloadskiboot-f68b949dbc64ee866d630d9f873e1f725ace09c2.zip
skiboot-f68b949dbc64ee866d630d9f873e1f725ace09c2.tar.gz
skiboot-f68b949dbc64ee866d630d9f873e1f725ace09c2.tar.bz2
core/platform: Add finalise_dt() callback
Previously the platform.exit() callback was called before we created the flattened device tree blob for Linux. Some platforms used this to add various DT properties and this was broken in commit Fixes: 9fc0c1287ada ("Move FSP specific op-panel calls to platform.exit()") which moved the exit callback to after the DTB had been created. The logic for moving the time of the exit call makes some sense since we want to terminate the IPMI watchdog timer as late as possible, but we still need a way for the platform modify the DTB as late as possible. This patch adds another platform callback (yay!) called finalise_dt() which can be used to graft stuff into the DT. Suggested-by: Vaidyanathan Srinivasan <svaidy@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Vaidyanathan Srinivasan <svaidy@linux.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r--core/init.c3
-rw-r--r--include/platform.h6
2 files changed, 9 insertions, 0 deletions
diff --git a/core/init.c b/core/init.c
index d0f28f2..271736b 100644
--- a/core/init.c
+++ b/core/init.c
@@ -579,6 +579,9 @@ void __noreturn load_and_boot_kernel(bool is_reboot)
add_fast_reboot_dt_entries();
+ if (platform.finalise_dt)
+ platform.finalise_dt(is_reboot);
+
/* Create the device tree blob to boot OS. */
fdt = create_dtb(dt_root, false);
if (!fdt) {
diff --git a/include/platform.h b/include/platform.h
index 0326e1a..da27c03 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -253,7 +253,13 @@ struct platform {
int (*resource_loaded)(enum resource_id id, uint32_t idx);
/*
+ * Executed just prior to creating the dtb for the kernel.
+ */
+ void (*finalise_dt)(bool is_reboot);
+
+ /*
* Executed just prior to handing control over to the payload.
+ * Used to terminate watchdogs, etc.
*/
void (*exit)(void);