@@ -87,3 +87,12 @@ ENTRY(__asm_flush_l3_dcache)
mov lr, x29
ret
ENDPROC(__asm_flush_l3_dcache)
+
+ENTRY(save_boot_params)
+/*
+ * void set_boot_params(uint64_t x0, uint64_t x1, uint64_t x2, uint64_t x3)
+ */
+ adr x4, bl33_info
+ str x0, [x4]
+ b save_boot_params_ret
+ENDPROC(save_boot_params)
new file mode 100644
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2020 Broadcom.
+ *
+ */
+
+#ifndef BL33_INFO_H
+#define BL33_INFO_H
+#include <asm/io.h>
+
+/* Increase version number each time this file is modified */
+#define BL33_INFO_VERSION 1
+
+struct chip_info {
+ unsigned int chip_id;
+ unsigned int rev_id;
+};
+
+struct bl33_info {
+ unsigned int version;
+ struct chip_info chip;
+};
+
+extern struct bl33_info *bl33_info;
+
+#endif
@@ -8,6 +8,7 @@
#include <asm/io.h>
#include <asm/system.h>
#include <asm/armv8/mmu.h>
+#include <asm/arch-bcmns3/bl33_info.h>
static struct mm_region ns3_mem_map[] = {
{
@@ -33,8 +34,17 @@ struct mm_region *mem_map = ns3_mem_map;
DECLARE_GLOBAL_DATA_PTR;
+/*
+ * Force the bl33_info to the data-section, as .bss will not be valid
+ * when save_boot_params is invoked.
+ */
+struct bl33_info *bl33_info __section(".data");
+
int board_init(void)
{
+ if (bl33_info->version != BL33_INFO_VERSION)
+ printf("*** warning: ATF BL31 and u-boot not in sync! ***\n");
+
return 0;
}