#include <fsl_caam.h>
#endif
#include <environment.h>
+#include <efi_loader.h>
DECLARE_GLOBAL_DATA_PTR;
}
}
+#if defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_IMX8MQ) || defined(CONFIG_IMX8MM) || defined(CONFIG_IMX8MN)
+bool serror_need_skip = true;
+void do_error(struct pt_regs *pt_regs, unsigned int esr)
+{
+ /* If stack is still in ROM reserved OCRAM not switch to SPL, it is the ROM SError */
+ ulong sp;
+ asm volatile("mov %0, sp" : "=r"(sp) : );
+
+ if (serror_need_skip &&
+ sp < 0x910000 && sp >= 0x900000) {
+
+ /* Check for ERR050342, imx8mq HDCP enabled parts */
+ if (is_imx8mq() && !(readl(OCOTP_BASE_ADDR + 0x450) & 0x08000000)) {
+ serror_need_skip = false;
+ return; /* Do nothing skip the SError in ROM */
+ }
+
+ /* Check for ERR050350, field return mode for imx8mq, mm and mn */
+ if (readl(OCOTP_BASE_ADDR + 0x630) & 0x1) {
+ serror_need_skip = false;
+ return; /* Do nothing skip the SError in ROM */
+ }
+ }
+
+ efi_restore_gd();
+ printf("\"Error\" handler, esr 0x%08x\n", esr);
+ show_regs(pt_regs);
+ panic("Resetting CPU ...\n");
+
+}
+#endif
+#endif
+
#if defined(CONFIG_IMX8MN)
enum env_location env_get_location(enum env_operation op, int prio)
{