bool has_erratum_a010151(void) { u32 svr = get_svr(); u32 soc = SVR_SOC_VER(svr); #ifdef CONFIG_ARM64 if (IS_SVR_DEV(svr, SVR_DEV(SVR_LS1043A))) return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); #endif switch (soc) { #ifdef CONFIG_ARM64 case SVR_LS2080A: case SVR_LS2085A: /* fallthrough */ case SVR_LS2088A: /* fallthrough */ case SVR_LS2081A: case SVR_LS1046A: case SVR_LS1012A: return IS_SVR_REV(svr, 1, 0); #endif #ifdef CONFIG_ARCH_LS1021A case SOC_VER_LS1020: case SOC_VER_LS1021: case SOC_VER_LS1022: case SOC_VER_SLS1020: return IS_SVR_REV(svr, 2, 0); #endif } return false; }
static void fdt_fixup_gic(void *blob) { int offset, err; u64 reg[8]; struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); unsigned int val; struct ccsr_scfg __iomem *scfg = (void *)CONFIG_SYS_FSL_SCFG_ADDR; int align_64k = 0; val = gur_in32(&gur->svr); if (!IS_SVR_DEV(val, SVR_DEV(SVR_LS1043A))) { align_64k = 1; } else if (SVR_REV(val) != REV1_0) { val = scfg_in32(&scfg->gic_align) & (0x01 << GIC_ADDR_BIT); if (!val) align_64k = 1; } offset = fdt_subnode_offset(blob, 0, "interrupt-controller@1400000"); if (offset < 0) { printf("WARNING: fdt_subnode_offset can't find node %s: %s\n", "interrupt-controller@1400000", fdt_strerror(offset)); return; } /* Fixup gic node align with 64K */ if (align_64k) { reg[0] = cpu_to_fdt64(GICD_BASE_64K); reg[1] = cpu_to_fdt64(GICD_SIZE_64K); reg[2] = cpu_to_fdt64(GICC_BASE_64K); reg[3] = cpu_to_fdt64(GICC_SIZE_64K); reg[4] = cpu_to_fdt64(GICH_BASE_64K); reg[5] = cpu_to_fdt64(GICH_SIZE_64K); reg[6] = cpu_to_fdt64(GICV_BASE_64K); reg[7] = cpu_to_fdt64(GICV_SIZE_64K); } else { /* Fixup gic node align with default */ reg[0] = cpu_to_fdt64(GICD_BASE); reg[1] = cpu_to_fdt64(GICD_SIZE); reg[2] = cpu_to_fdt64(GICC_BASE); reg[3] = cpu_to_fdt64(GICC_SIZE); reg[4] = cpu_to_fdt64(GICH_BASE); reg[5] = cpu_to_fdt64(GICH_SIZE); reg[6] = cpu_to_fdt64(GICV_BASE); reg[7] = cpu_to_fdt64(GICV_SIZE); } err = fdt_setprop(blob, offset, "reg", reg, sizeof(reg)); if (err < 0) { printf("WARNING: fdt_setprop can't set %s from node %s: %s\n", "reg", "interrupt-controller@1400000", fdt_strerror(err)); return; } return; }
static void fdt_fixup_msi(void *blob) { struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); unsigned int rev; rev = gur_in32(&gur->svr); if (!IS_SVR_DEV(rev, SVR_DEV(SVR_LS1043A))) return; rev = SVR_REV(rev); _fdt_fixup_msi_node(blob, "/soc/msi-controller1@1571000", 116, 111, rev); _fdt_fixup_msi_node(blob, "/soc/msi-controller2@1572000", 126, 121, rev); _fdt_fixup_msi_node(blob, "/soc/msi-controller3@1573000", 160, 155, rev); _fdt_fixup_pci_msi(blob, "/soc/pcie@3400000", rev); _fdt_fixup_pci_msi(blob, "/soc/pcie@3500000", rev); _fdt_fixup_pci_msi(blob, "/soc/pcie@3600000", rev); }