* on SDCard, so we must read the MBR to get the start address and code
* length of the u-boot image, then calculate the address of the env.
*/
+#define ESDHC_BOOT_SIGNATURE_OFF 0x40
+#define ESDHC_BOOT_SIGNATURE 0x424f4f54
#define ESDHC_BOOT_IMAGE_SIZE 0x48
#define ESDHC_BOOT_IMAGE_ADDR 0x50
#define MBRDBR_BOOT_SIG_55 0x1fe
uchar *tmp_buf;
u32 blklen;
uchar val;
+#ifndef CONFIG_SPL_FSL_PBL
+ u32 val32;
+#endif
uint i, byte_num;
#endif
u32 offset, code_len;
hang();
}
+#ifdef CONFIG_SPL_FSL_PBL
val = *(tmp_buf + MBRDBR_BOOT_SIG_55);
if (0x55 != val) {
- puts("spl: mmc signature is not valid!!\n");
+ puts("spl: mmc MBR/DBR signature is not valid!!\n");
hang();
}
val = *(tmp_buf + MBRDBR_BOOT_SIG_AA);
if (0xAA != val) {
- puts("spl: mmc signature is not valid!!\n");
+ puts("spl: mmc MBR/DBR signature is not valid!!\n");
hang();
}
+#else
+ /*
+ * Booting from On-Chip ROM (eSDHC or eSPI), Document Number: AN3659, Rev. 2, 06/2012.
+ * Pre-PBL BootROMs (MPC8536E, MPC8569E, P2020, P1011, P1012, P1013, P1020, P1021, P1022)
+ * require custom BOOT signature on sector 0 and MBR/DBR signature is not required at all.
+ */
+ byte_num = 4;
+ val32 = 0;
+ for (i = 0; i < byte_num; i++) {
+ val = *(tmp_buf + ESDHC_BOOT_SIGNATURE_OFF + i);
+ val32 = (val32 << 8) + val;
+ }
+ if (val32 != ESDHC_BOOT_SIGNATURE) {
+ puts("spl: mmc BOOT signature is not valid!!\n");
+ hang();
+ }
+#endif
byte_num = 4;
offset = 0;