/* boot search related variables and definitions */
static int g_boot_search_count = 4;
+static int g_boot_secondary_offset;
static int g_boot_search_stride;
static int g_pages_per_stride;
boot_stream2_address = ((maxsize - boot_stream1_address) / 2 +
boot_stream1_address);
- if (boot_cfg->secondary_boot_stream_off_in_MB)
+ if (g_boot_secondary_offset)
boot_stream2_address =
- (loff_t)boot_cfg->secondary_boot_stream_off_in_MB * 1024 * 1024;
+ (loff_t)g_boot_secondary_offset * 1024 * 1024;
max_boot_stream_size = boot_stream2_address - boot_stream1_address;
return (*(int *)(data + off) == fingerprint);
}
+static int fuse_secondary_boot(u32 bank, u32 word, u32 mask, u32 off)
+{
+ int err;
+ u32 val;
+ int ret;
+
+ err = fuse_read(bank, word, &val);
+ if (err)
+ return 0;
+
+ val = (val & mask) >> off;
+
+ if (val > 10)
+ return 0;
+
+ switch (val) {
+ case 0:
+ ret = 4;
+ break;
+ case 1:
+ ret = 1;
+ break;
+ default:
+ ret = 2 << val;
+ break;
+ }
+
+ return ret;
+};
+
static int fuse_to_search_count(u32 bank, u32 word, u32 mask, u32 off)
{
int err;
g_boot_search_count);
}
+ if (plat_config.misc_flags & FIRMWARE_SECONDARY_FIXED_ADDR) {
+ if (is_imx8mn())
+ g_boot_secondary_offset = fuse_secondary_boot(2, 1, 0xff0000, 16);
+ }
+
cmd = argv[1];
--argc;
++argv;