u32 end_tag;
};
+struct msg_get_rsts {
+ struct bcm2835_mbox_hdr hdr;
+ struct bcm2835_mbox_tag_get_rsts get_rsts;
+ u32 end_tag;
+};
+
+/* Dump a message. */
+#ifdef BCM2835_MBOX_DUMP_MESSAGES
+#define BCM2835_MBOX_DUMP_MSG(msg) { \
+ u32 *p = msg; \
+ int i; \
+ printf("%s:%d", __func__, __LINE__); \
+ if (msg->hdr.code == 0) \
+ printf(" req"); \
+ else if (msg->hdr.code == 0x80000000) \
+ printf(" resp"); \
+ else if (msg->hdr.code == 0x80000000) \
+ printf(" err"); \
+ else \
+ printf(" WAT‽"); \
+ for (i = 0; i < sizeof(*(msg)) / sizeof(*p); i++) \
+ printf(" 0x%08X", p[i]); \
+ printf("\n"); \
+}
+#else
+#define BCM2835_MBOX_DUMP_MSG(msg)
+#endif
+
#ifdef CONFIG_ARM64
#define DTB_DIR "broadcom/"
#else
return fw_dtb_pointer & ~0xffff;
}
+static void get_rsts(void)
+{
+ ALLOC_CACHE_ALIGN_BUFFER(struct msg_get_rsts, msg, 1);
+ int ret;
+ char rsts_string[11] = { 0 };
+
+ BCM2835_MBOX_INIT_HDR(msg);
+ BCM2835_MBOX_INIT_TAG(&msg->get_rsts, GET_RSTS);
+
+ BCM2835_MBOX_DUMP_MSG(msg);
+
+ ret = bcm2835_mbox_call_prop(BCM2835_MBOX_PROP_CHAN, &msg->hdr);
+ if (ret) {
+ printf("bcm2835: Could not query RSTS value\n");
+ /* Ignore the error, let's carry on. */
+ return;
+ }
+
+ BCM2835_MBOX_DUMP_MSG(msg);
+
+ snprintf(rsts_string, sizeof(rsts_string), "0x%08X",
+ msg->get_rsts.body.resp.rsts);
+ env_set("reg_rsts", rsts_string);
+
+ return;
+}
+
static void set_usbethaddr(void)
{
ALLOC_CACHE_ALIGN_BUFFER(struct msg_get_mac_address, msg, 1);
set_fdt_addr();
set_fdtfile();
set_usbethaddr();
+ get_rsts();
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
set_board_info();
#endif