bool soc_has_dp_ddr(void) { struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); u32 svr = gur_in32(&gur->svr); /* LS2085A, LS2088A, LS2048A has DP_DDR */ if ((SVR_SOC_VER(svr) == SVR_LS2085A) || (SVR_SOC_VER(svr) == SVR_LS2088A) || (SVR_SOC_VER(svr) == SVR_LS2048A)) return true; return false; }
bool has_erratum_a010151(void) { u32 svr = get_svr(); u32 soc = SVR_SOC_VER(svr); switch (soc) { #ifdef CONFIG_ARM64 case SVR_LS2080A: case SVR_LS2085A: case SVR_LS1046A: case SVR_LS1012A: return IS_SVR_REV(svr, 1, 0); case SVR_LS1043A: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); #endif #ifdef CONFIG_LS102XA 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; }
bool has_erratum_a004477(void) { u32 svr = get_svr(); u32 soc = SVR_SOC_VER(svr); switch (soc) { #ifdef CONFIG_PPC case SVR_P1010: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); case SVR_P1022: case SVR_9131: case SVR_9132: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); case SVR_P2020: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1); case SVR_B4860: case SVR_B4420: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); case SVR_P4080: return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0); #endif } return false; }
bool has_dual_phy(void) { u32 svr = get_svr(); u32 soc = SVR_SOC_VER(svr); switch (soc) { #ifdef CONFIG_PPC case SVR_T1023: case SVR_T1024: case SVR_T1013: case SVR_T1014: return IS_SVR_REV(svr, 1, 0); case SVR_T1040: case SVR_T1042: case SVR_T1020: case SVR_T1022: case SVR_T2080: case SVR_T2081: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); case SVR_T4240: case SVR_T4160: case SVR_T4080: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); #endif } return false; }
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; }
bool has_erratum_a006261(void) { u32 svr = get_svr(); u32 soc = SVR_SOC_VER(svr); switch (soc) { #ifdef CONFIG_PPC case SVR_P1010: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); case SVR_P2041: case SVR_P2040: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1) || IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1); case SVR_P3041: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1) || IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1); case SVR_P5010: case SVR_P5020: case SVR_P5021: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); case SVR_T4240: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); case SVR_P5040: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1); #endif } return false; }
bool has_erratum_a007798(void) { #ifdef CONFIG_PPC return SVR_SOC_VER(get_svr()) == SVR_T4240 && IS_SVR_REV(get_svr(), 2, 0); #endif return false; }
u32 determine_mp_bootpg(unsigned int *pagesize) { u32 bootpg; #ifdef CONFIG_SYS_FSL_ERRATUM_A004468 u32 svr = get_svr(); u32 granule_size, check; struct law_entry e; #endif /* use last 4K of mapped memory */ bootpg = ((gd->ram_size > CONFIG_MAX_MEM_MAPPED) ? CONFIG_MAX_MEM_MAPPED : gd->ram_size) + CONFIG_SYS_SDRAM_BASE - 4096; if (pagesize) *pagesize = 4096; #ifdef CONFIG_SYS_FSL_ERRATUM_A004468 /* * Erratum A004468 has two parts. The 3-way interleaving applies to T4240, * to be fixed in rev 2.0. The 2-way interleaving applies to many SoCs. But * the way boot page chosen in u-boot avoids hitting this erratum. So only * thw workaround for 3-way interleaving is needed. * * To make sure boot page translation works with 3-Way DDR interleaving * enforce a check for the following constrains * 8K granule size requires BRSIZE=8K and * bootpg >> log2(BRSIZE) %3 == 1 * 4K and 1K granule size requires BRSIZE=4K and * bootpg >> log2(BRSIZE) %3 == 0 */ if (SVR_SOC_VER(svr) == SVR_T4240 && SVR_MAJ(svr) < 2) { e = find_law(bootpg); switch (e.trgt_id) { case LAW_TRGT_IF_DDR_INTLV_123: granule_size = fsl_ddr_get_intl3r() & 0x1f; if (granule_size == FSL_DDR_3WAY_8KB_INTERLEAVING) { if (pagesize) *pagesize = 8192; bootpg &= 0xffffe000; /* align to 8KB */ check = bootpg >> 13; while ((check % 3) != 1) check--; bootpg = check << 13; debug("Boot page (8K) at 0x%08x\n", bootpg); break; } else { bootpg &= 0xfffff000; /* align to 4KB */ check = bootpg >> 12; while ((check % 3) != 0) check--; bootpg = check << 12; debug("Boot page (4K) at 0x%08x\n", bootpg); } break; default: break; }
void sdram_init(void) { ccsr_ddr_t *ddr = (ccsr_ddr_t *)CONFIG_SYS_MPC8xxx_DDR_ADDR; ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR; u32 ddr_ratio; unsigned long ddr_freq_mhz; ddr_ratio = in_be32(&gur->porpllsr) & MPC85xx_PORPLLSR_DDR_RATIO; ddr_ratio = ddr_ratio >> MPC85xx_PORPLLSR_DDR_RATIO_SHIFT; ddr_freq_mhz = (CONFIG_SYS_CLK_FREQ * ddr_ratio) / 1000000; /* mask off E bit */ u32 svr = SVR_SOC_VER(mfspr(SPRN_SVR)); __raw_writel(CONFIG_SYS_DDR_CONTROL | SDRAM_CFG_32_BE, &ddr->sdram_cfg); __raw_writel(CONFIG_SYS_DDR_CS0_BNDS, &ddr->cs0_bnds); __raw_writel(CONFIG_SYS_DDR_CS0_CONFIG, &ddr->cs0_config); __raw_writel(CONFIG_SYS_DDR_CONTROL_2, &ddr->sdram_cfg_2); __raw_writel(CONFIG_SYS_DDR_DATA_INIT, &ddr->sdram_data_init); if (ddr_freq_mhz < 700) { __raw_writel(CONFIG_SYS_DDR_TIMING_3_667, &ddr->timing_cfg_3); __raw_writel(CONFIG_SYS_DDR_TIMING_0_667, &ddr->timing_cfg_0); __raw_writel(CONFIG_SYS_DDR_TIMING_1_667, &ddr->timing_cfg_1); __raw_writel(CONFIG_SYS_DDR_TIMING_2_667, &ddr->timing_cfg_2); __raw_writel(CONFIG_SYS_DDR_MODE_1_667, &ddr->sdram_mode); __raw_writel(CONFIG_SYS_DDR_MODE_2_667, &ddr->sdram_mode_2); __raw_writel(CONFIG_SYS_DDR_INTERVAL_667, &ddr->sdram_interval); __raw_writel(CONFIG_SYS_DDR_CLK_CTRL_667, &ddr->sdram_clk_cntl); __raw_writel(CONFIG_SYS_DDR_WRLVL_CONTROL_667, &ddr->ddr_wrlvl_cntl); } else { __raw_writel(CONFIG_SYS_DDR_TIMING_3_800, &ddr->timing_cfg_3); __raw_writel(CONFIG_SYS_DDR_TIMING_0_800, &ddr->timing_cfg_0); __raw_writel(CONFIG_SYS_DDR_TIMING_1_800, &ddr->timing_cfg_1); __raw_writel(CONFIG_SYS_DDR_TIMING_2_800, &ddr->timing_cfg_2); __raw_writel(CONFIG_SYS_DDR_MODE_1_800, &ddr->sdram_mode); __raw_writel(CONFIG_SYS_DDR_MODE_2_800, &ddr->sdram_mode_2); __raw_writel(CONFIG_SYS_DDR_INTERVAL_800, &ddr->sdram_interval); __raw_writel(CONFIG_SYS_DDR_CLK_CTRL_800, &ddr->sdram_clk_cntl); __raw_writel(CONFIG_SYS_DDR_WRLVL_CONTROL_800, &ddr->ddr_wrlvl_cntl); } __raw_writel(CONFIG_SYS_DDR_TIMING_4, &ddr->timing_cfg_4); __raw_writel(CONFIG_SYS_DDR_TIMING_5, &ddr->timing_cfg_5); __raw_writel(CONFIG_SYS_DDR_ZQ_CONTROL, &ddr->ddr_zq_cntl); /* P1014 and it's derivatives support max 16bit DDR width */ if (svr == SVR_P1014) { __raw_writel(ddr->sdram_cfg & ~SDRAM_CFG_DBW_MASK, &ddr->sdram_cfg); __raw_writel(ddr->sdram_cfg | SDRAM_CFG_16_BE, &ddr->sdram_cfg); /* For CS0_BNDS we divide the start and end address by 2, so we can just * shift the entire register to achieve the desired result and the mask * the value so we don't write reserved fields */ __raw_writel((CONFIG_SYS_DDR_CS0_BNDS >> 1) & 0x0fff0fff, &ddr->cs0_bnds); }
bool soc_has_aiop(void) { struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); u32 svr = gur_in32(&gur->svr); /* LS2085A has AIOP */ if (SVR_SOC_VER(svr) == SVR_LS2085A) return true; return false; }
int probecpu (void) { uint svr; uint ver; svr = get_svr(); ver = SVR_SOC_VER(svr); gd->cpu = identify_cpu(ver); return 0; }
bool has_erratum_a008751(void) { u32 svr = get_svr(); u32 soc = SVR_SOC_VER(svr); switch (soc) { #ifdef CONFIG_ARM64 case SVR_LS2080A: case SVR_LS2085A: return IS_SVR_REV(svr, 1, 0); #endif } return false; }
enum srds_prtcl serdes_get_prtcl(int cfg, int lane) { enum srds_prtcl prtcl; u32 svr = get_svr(); u32 ver = SVR_SOC_VER(svr); if (!serdes_lane_enabled(lane)) return NONE; prtcl = serdes_cfg_tbl[cfg][lane]; /* P2040[e] does not support XAUI */ if (ver == SVR_P2040 && prtcl == XAUI_FM1) prtcl = NONE; return prtcl; }
bool has_erratum_a005697(void) { u32 svr = get_svr(); u32 soc = SVR_SOC_VER(svr); switch (soc) { #ifdef CONFIG_PPC case SVR_9131: case SVR_9132: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); #endif #ifdef ONFIG_ARM64 case SVR_LS1012A: return IS_SVR_REV(svr, 1, 0); #endif } return false; }
int fsl_cpu_numcores(void) { void __iomem *pic = (void __iomem *)MPC8xxx_PIC_ADDR; struct cpu_type *cpu; uint svr; uint ver; int tmp; svr = get_svr(); ver = SVR_SOC_VER(svr); cpu = identify_cpu(ver); /* better to query feature reporting register than just assume 1 */ if (cpu == &cpu_type_unknown) { tmp = in_be32(pic + MPC85xx_PIC_FRR_OFFSET); tmp = (tmp & MPC8xxx_PICFRR_NCPU_MASK) >> MPC8xxx_PICFRR_NCPU_SHIFT; tmp += 1; } else {
int is_serdes_prtcl_valid(u32 prtcl) { int i; u32 svr = get_svr(); u32 ver = SVR_SOC_VER(svr); if (prtcl > ARRAY_SIZE(serdes_cfg_tbl)) return 0; /* P2040[e] does not support XAUI */ if (ver == SVR_P2040 && prtcl == XAUI_FM1) return 0; for (i = 0; i < SRDS_MAX_LANES; i++) { if (serdes_cfg_tbl[prtcl][i] != NONE) return 1; } return 0; }
static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { __maybe_unused u32 svr = get_svr(); #if defined(CONFIG_FSL_SATA_V2) && defined(CONFIG_FSL_SATA_ERRATUM_A001) if (IS_SVR_REV(svr, 1, 0)) { switch (SVR_SOC_VER(svr)) { case SVR_P1013: case SVR_P1013_E: case SVR_P1022: case SVR_P1022_E: puts("Work-around for Erratum SATA A001 enabled\n"); } } #endif #if defined(CONFIG_SYS_P4080_ERRATUM_SERDES8) puts("Work-around for Erratum SERDES8 enabled\n"); #endif #if defined(CONFIG_SYS_P4080_ERRATUM_CPU22) puts("Work-around for Erratum CPU22 enabled\n"); #endif return 0; }
int checkcpu (void) { sys_info_t sysinfo; uint pvr, svr; uint ver; uint major, minor; struct cpu_type *cpu; char buf1[32], buf2[32]; #if defined(CONFIG_DDR_CLK_FREQ) || defined(CONFIG_FSL_CORENET) ccsr_gur_t __iomem *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); #endif /* * Cornet platforms use ddr sync bit in RCW to indicate sync vs async * mode. Previous platform use ddr ratio to do the same. This * information is only for display here. */ #ifdef CONFIG_FSL_CORENET #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2 u32 ddr_sync = 0; /* only async mode is supported */ #else u32 ddr_sync = ((gur->rcwsr[5]) & FSL_CORENET_RCWSR5_DDR_SYNC) >> FSL_CORENET_RCWSR5_DDR_SYNC_SHIFT; #endif /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */ #else /* CONFIG_FSL_CORENET */ #ifdef CONFIG_DDR_CLK_FREQ u32 ddr_ratio = ((gur->porpllsr) & MPC85xx_PORPLLSR_DDR_RATIO) >> MPC85xx_PORPLLSR_DDR_RATIO_SHIFT; #else u32 ddr_ratio = 0; #endif /* CONFIG_DDR_CLK_FREQ */ #endif /* CONFIG_FSL_CORENET */ unsigned int i, core, nr_cores = cpu_numcores(); u32 mask = cpu_mask(); #ifdef CONFIG_HETROGENOUS_CLUSTERS unsigned int j, dsp_core, dsp_numcores = cpu_num_dspcores(); u32 dsp_mask = cpu_dsp_mask(); #endif svr = get_svr(); major = SVR_MAJ(svr); minor = SVR_MIN(svr); #if defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) && defined(CONFIG_E6500) if (SVR_SOC_VER(svr) == SVR_T4080) { ccsr_rcpm_t *rcpm = (void __iomem *)(CONFIG_SYS_FSL_CORENET_RCPM_ADDR); setbits_be32(&gur->devdisr2, FSL_CORENET_DEVDISR2_DTSEC1_6 || FSL_CORENET_DEVDISR2_DTSEC1_9); setbits_be32(&gur->devdisr3, FSL_CORENET_DEVDISR3_PCIE3); setbits_be32(&gur->devdisr5, FSL_CORENET_DEVDISR5_DDR3); /* It needs SW to disable core4~7 as HW design sake on T4080 */ for (i = 4; i < 8; i++) cpu_disable(i); /* request core4~7 into PH20 state, prior to entering PCL10 * state, all cores in cluster should be placed in PH20 state. */ setbits_be32(&rcpm->pcph20setr, 0xf0); /* put the 2nd cluster into PCL10 state */ setbits_be32(&rcpm->clpcl10setr, 1 << 1); } #endif if (cpu_numcores() > 1) { #ifndef CONFIG_MP puts("Unicore software on multiprocessor system!!\n" "To enable mutlticore build define CONFIG_MP\n"); #endif volatile ccsr_pic_t *pic = (void *)(CONFIG_SYS_MPC8xxx_PIC_ADDR); printf("CPU%d: ", pic->whoami); } else { puts("CPU: "); } cpu = gd->arch.cpu; puts(cpu->name); if (IS_E_PROCESSOR(svr)) puts("E"); printf(", Version: %d.%d, (0x%08x)\n", major, minor, svr); pvr = get_pvr(); ver = PVR_VER(pvr); major = PVR_MAJ(pvr); minor = PVR_MIN(pvr); printf("Core: "); switch(ver) { case PVR_VER_E500_V1: case PVR_VER_E500_V2: puts("e500"); break; case PVR_VER_E500MC: puts("e500mc"); break; case PVR_VER_E5500: puts("e5500"); break; case PVR_VER_E6500: puts("e6500"); break; default: puts("Unknown"); break; } printf(", Version: %d.%d, (0x%08x)\n", major, minor, pvr); if (nr_cores > CONFIG_MAX_CPUS) { panic("\nUnexpected number of cores: %d, max is %d\n", nr_cores, CONFIG_MAX_CPUS); } get_sys_info(&sysinfo); #ifdef CONFIG_SYS_FSL_SINGLE_SOURCE_CLK if (sysinfo.diff_sysclk == 1) puts("Single Source Clock Configuration\n"); #endif puts("Clock Configuration:"); for_each_cpu(i, core, nr_cores, mask) { if (!(i & 3)) printf ("\n "); printf("CPU%d:%-4s MHz, ", core, strmhz(buf1, sysinfo.freq_processor[core])); } #ifdef CONFIG_HETROGENOUS_CLUSTERS for_each_cpu(j, dsp_core, dsp_numcores, dsp_mask) { if (!(j & 3)) printf("\n "); printf("DSP CPU%d:%-4s MHz, ", j, strmhz(buf1, sysinfo.freq_processor_dsp[dsp_core])); } #endif printf("\n CCB:%-4s MHz,", strmhz(buf1, sysinfo.freq_systembus)); printf("\n"); #ifdef CONFIG_FSL_CORENET if (ddr_sync == 1) { printf(" DDR:%-4s MHz (%s MT/s data rate) " "(Synchronous), ", strmhz(buf1, sysinfo.freq_ddrbus/2), strmhz(buf2, sysinfo.freq_ddrbus)); } else { printf(" DDR:%-4s MHz (%s MT/s data rate) " "(Asynchronous), ", strmhz(buf1, sysinfo.freq_ddrbus/2), strmhz(buf2, sysinfo.freq_ddrbus)); } #else switch (ddr_ratio) { case 0x0: printf(" DDR:%-4s MHz (%s MT/s data rate), ", strmhz(buf1, sysinfo.freq_ddrbus/2), strmhz(buf2, sysinfo.freq_ddrbus)); break; case 0x7: printf(" DDR:%-4s MHz (%s MT/s data rate) " "(Synchronous), ", strmhz(buf1, sysinfo.freq_ddrbus/2), strmhz(buf2, sysinfo.freq_ddrbus)); break; default: printf(" DDR:%-4s MHz (%s MT/s data rate) " "(Asynchronous), ", strmhz(buf1, sysinfo.freq_ddrbus/2), strmhz(buf2, sysinfo.freq_ddrbus)); break; } #endif #if defined(CONFIG_FSL_LBC) if (sysinfo.freq_localbus > LCRR_CLKDIV) { printf("LBC:%-4s MHz\n", strmhz(buf1, sysinfo.freq_localbus)); } else { printf("LBC: unknown (LCRR[CLKDIV] = 0x%02lx)\n", sysinfo.freq_localbus); } #endif #if defined(CONFIG_FSL_IFC) printf("IFC:%-4s MHz\n", strmhz(buf1, sysinfo.freq_localbus)); #endif #ifdef CONFIG_CPM2 printf("CPM: %s MHz\n", strmhz(buf1, sysinfo.freq_systembus)); #endif #ifdef CONFIG_QE printf(" QE:%-4s MHz\n", strmhz(buf1, sysinfo.freq_qe)); #endif #if defined(CONFIG_SYS_CPRI) printf(" "); printf("CPRI:%-4s MHz", strmhz(buf1, sysinfo.freq_cpri)); #endif #if defined(CONFIG_SYS_MAPLE) printf("\n "); printf("MAPLE:%-4s MHz, ", strmhz(buf1, sysinfo.freq_maple)); printf("MAPLE-ULB:%-4s MHz, ", strmhz(buf1, sysinfo.freq_maple_ulb)); printf("MAPLE-eTVPE:%-4s MHz\n", strmhz(buf1, sysinfo.freq_maple_etvpe)); #endif #ifdef CONFIG_SYS_DPAA_FMAN for (i = 0; i < CONFIG_SYS_NUM_FMAN; i++) { printf(" FMAN%d: %s MHz\n", i + 1, strmhz(buf1, sysinfo.freq_fman[i])); } #endif #ifdef CONFIG_SYS_DPAA_QBMAN printf(" QMAN: %s MHz\n", strmhz(buf1, sysinfo.freq_qman)); #endif #ifdef CONFIG_SYS_DPAA_PME printf(" PME: %s MHz\n", strmhz(buf1, sysinfo.freq_pme)); #endif puts("L1: D-cache 32 KiB enabled\n I-cache 32 KiB enabled\n"); #ifdef CONFIG_FSL_CORENET /* Display the RCW, so that no one gets confused as to what RCW * we're actually using for this boot. */ puts("Reset Configuration Word (RCW):"); for (i = 0; i < ARRAY_SIZE(gur->rcwsr); i++) { u32 rcw = in_be32(&gur->rcwsr[i]); if ((i % 4) == 0) printf("\n %08x:", i * 4); printf(" %08x", rcw); } puts("\n"); #endif return 0; }
static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { __maybe_unused u32 svr = get_svr(); #if defined(CONFIG_FSL_SATA_V2) && defined(CONFIG_FSL_SATA_ERRATUM_A001) if (IS_SVR_REV(svr, 1, 0)) { switch (SVR_SOC_VER(svr)) { case SVR_P1013: case SVR_P1022: puts("Work-around for Erratum SATA A001 enabled\n"); } } #endif #if defined(CONFIG_SYS_P4080_ERRATUM_SERDES8) puts("Work-around for Erratum SERDES8 enabled\n"); #endif #if defined(CONFIG_SYS_P4080_ERRATUM_SERDES9) puts("Work-around for Erratum SERDES9 enabled\n"); #endif #if defined(CONFIG_SYS_P4080_ERRATUM_SERDES_A005) puts("Work-around for Erratum SERDES-A005 enabled\n"); #endif #if defined(CONFIG_SYS_P4080_ERRATUM_CPU22) if (SVR_MAJ(svr) < 3) puts("Work-around for Erratum CPU22 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_CPU_A011 /* * NMG_CPU_A011 applies to P4080 rev 1.0, 2.0, fixed in 3.0 * also applies to P3041 rev 1.0, 1.1, P2041 rev 1.0, 1.1 */ if (SVR_SOC_VER(svr) != SVR_P4080 || SVR_MAJ(svr) < 3) puts("Work-around for Erratum CPU-A011 enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_CPU_A003999) puts("Work-around for Erratum CPU-A003999 enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_DDR_A003474) puts("Work-around for Erratum DDR-A003473 enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_DDR_MSYNC_IN) puts("Work-around for DDR MSYNC_IN Erratum enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_ESDHC111) puts("Work-around for Erratum ESDHC111 enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_ESDHC135) puts("Work-around for Erratum ESDHC135 enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_ESDHC136) puts("Work-around for Erratum ESDHC136 enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_ESDHC_A001) puts("Work-around for Erratum ESDHC-A001 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_CPC_A002 puts("Work-around for Erratum CPC-A002 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_CPC_A003 puts("Work-around for Erratum CPC-A003 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_ELBC_A001 puts("Work-around for Erratum ELBC-A001 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_DDR_A003 puts("Work-around for Erratum DDR-A003 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_DDR_115 puts("Work-around for Erratum DDR115 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_DDR111_DDR134 puts("Work-around for Erratum DDR111 enabled\n"); puts("Work-around for Erratum DDR134 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_IFC_A002769 puts("Work-around for Erratum IFC-A002769 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_P1010_A003549 puts("Work-around for Erratum P1010-A003549 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_IFC_A003399 puts("Work-around for Erratum IFC A-003399 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_DDR120 if ((SVR_MAJ(svr) == 1) || IS_SVR_REV(svr, 2, 0)) puts("Work-around for Erratum NMG DDR120 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_LBC103 puts("Work-around for Erratum NMG_LBC103 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_ETSEC129 if ((SVR_MAJ(svr) == 1) || IS_SVR_REV(svr, 2, 0)) puts("Work-around for Erratum NMG ETSEC129 enabled\n"); #endif return 0; }
int checkcpu (void) { sys_info_t sysinfo; uint pvr, svr; uint fam; uint ver; uint major, minor; struct cpu_type *cpu; char buf1[32], buf2[32]; #ifdef CONFIG_DDR_CLK_FREQ volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); u32 ddr_ratio = ((gur->porpllsr) & MPC85xx_PORPLLSR_DDR_RATIO) >> MPC85xx_PORPLLSR_DDR_RATIO_SHIFT; #else u32 ddr_ratio = 0; #endif int i; svr = get_svr(); ver = SVR_SOC_VER(svr); major = SVR_MAJ(svr); #ifdef CONFIG_MPC8536 major &= 0x7; /* the msb of this nibble is a mfg code */ #endif minor = SVR_MIN(svr); #if (CONFIG_NUM_CPUS > 1) volatile ccsr_pic_t *pic = (void *)(CONFIG_SYS_MPC85xx_PIC_ADDR); printf("CPU%d: ", pic->whoami); #else puts("CPU: "); #endif cpu = identify_cpu(ver); if (cpu) { puts(cpu->name); if (IS_E_PROCESSOR(svr)) puts("E"); } else { puts("Unknown"); } printf(", Version: %d.%d, (0x%08x)\n", major, minor, svr); pvr = get_pvr(); fam = PVR_FAM(pvr); ver = PVR_VER(pvr); major = PVR_MAJ(pvr); minor = PVR_MIN(pvr); printf("Core: "); switch (fam) { case PVR_FAM(PVR_85xx): puts("E500"); break; default: puts("Unknown"); break; } if (PVR_MEM(pvr) == 0x03) puts("MC"); printf(", Version: %d.%d, (0x%08x)\n", major, minor, pvr); get_sys_info(&sysinfo); puts("Clock Configuration:"); for (i = 0; i < CONFIG_NUM_CPUS; i++) { if (!(i & 3)) printf ("\n "); printf("CPU%d:%-4s MHz, ", i,strmhz(buf1, sysinfo.freqProcessor[i])); } printf("\n CCB:%-4s MHz,\n", strmhz(buf1, sysinfo.freqSystemBus)); switch (ddr_ratio) { case 0x0: printf(" DDR:%-4s MHz (%s MT/s data rate), ", strmhz(buf1, sysinfo.freqDDRBus/2), strmhz(buf2, sysinfo.freqDDRBus)); break; case 0x7: printf(" DDR:%-4s MHz (%s MT/s data rate) (Synchronous), ", strmhz(buf1, sysinfo.freqDDRBus/2), strmhz(buf2, sysinfo.freqDDRBus)); break; default: printf(" DDR:%-4s MHz (%s MT/s data rate) (Asynchronous), ", strmhz(buf1, sysinfo.freqDDRBus/2), strmhz(buf2, sysinfo.freqDDRBus)); break; } if (sysinfo.freqLocalBus > LCRR_CLKDIV) printf("LBC:%-4s MHz\n", strmhz(buf1, sysinfo.freqLocalBus)); else printf("LBC: unknown (LCRR[CLKDIV] = 0x%02lx)\n", sysinfo.freqLocalBus); #ifdef CONFIG_CPM2 printf("CPM: %s MHz\n", strmhz(buf1, sysinfo.freqSystemBus)); #endif #ifdef CONFIG_QE printf(" QE:%-4s MHz\n", strmhz(buf1, sysinfo.freqQE)); #endif puts("L1: D-cache 32 kB enabled\n I-cache 32 kB enabled\n"); return 0; }
int init_sata(int dev) { u32 length, align; cmd_hdr_tbl_t *cmd_hdr; u32 cda; u32 val32; fsl_sata_reg_t *reg; u32 sig; int i; fsl_sata_t *sata; if (dev < 0 || dev > (CONFIG_SYS_SATA_MAX_DEVICE - 1)) { printf("the sata index %d is out of ranges\n\r", dev); return -1; } #ifdef CONFIG_MPC85xx if ((dev == 0) && (!is_serdes_configured(SATA1))) { printf("SATA%d [dev = %d] is not enabled\n", dev+1, dev); return -1; } if ((dev == 1) && (!is_serdes_configured(SATA2))) { printf("SATA%d [dev = %d] is not enabled\n", dev+1, dev); return -1; } #endif /* Allocate SATA device driver struct */ sata = (fsl_sata_t *)malloc(sizeof(fsl_sata_t)); if (!sata) { printf("alloc the sata device struct failed\n\r"); return -1; } /* Zero all of the device driver struct */ memset((void *)sata, 0, sizeof(fsl_sata_t)); /* Save the private struct to block device struct */ sata_dev_desc[dev].priv = (void *)sata; sprintf(sata->name, "SATA%d", dev); /* Set the controller register base address to device struct */ reg = (fsl_sata_reg_t *)(fsl_sata_info[dev].sata_reg_base); sata->reg_base = reg; /* Allocate the command header table, 4 bytes aligned */ length = sizeof(struct cmd_hdr_tbl); align = SATA_HC_CMD_HDR_TBL_ALIGN; sata->cmd_hdr_tbl_offset = (void *)malloc(length + align); if (!sata) { printf("alloc the command header failed\n\r"); return -1; } cmd_hdr = (cmd_hdr_tbl_t *)(((u32)sata->cmd_hdr_tbl_offset + align) & ~(align - 1)); sata->cmd_hdr = cmd_hdr; /* Zero all of the command header table */ memset((void *)sata->cmd_hdr_tbl_offset, 0, length + align); /* Allocate command descriptor for all command */ length = sizeof(struct cmd_desc) * SATA_HC_MAX_CMD; align = SATA_HC_CMD_DESC_ALIGN; sata->cmd_desc_offset = (void *)malloc(length + align); if (!sata->cmd_desc_offset) { printf("alloc the command descriptor failed\n\r"); return -1; } sata->cmd_desc = (cmd_desc_t *)(((u32)sata->cmd_desc_offset + align) & ~(align - 1)); /* Zero all of command descriptor */ memset((void *)sata->cmd_desc_offset, 0, length + align); /* Link the command descriptor to command header */ for (i = 0; i < SATA_HC_MAX_CMD; i++) { cda = ((u32)sata->cmd_desc + SATA_HC_CMD_DESC_SIZE * i) & ~(CMD_HDR_CDA_ALIGN - 1); cmd_hdr->cmd_slot[i].cda = cpu_to_le32(cda); } /* To have safe state, force the controller offline */ val32 = in_le32(®->hcontrol); val32 &= ~HCONTROL_ONOFF; val32 |= HCONTROL_FORCE_OFFLINE; out_le32(®->hcontrol, val32); /* Wait the controller offline */ ata_wait_register(®->hstatus, HSTATUS_ONOFF, 0, 1000); #if defined(CONFIG_FSL_SATA_V2) && defined(CONFIG_FSL_SATA_ERRATUM_A001) /* * For P1022/1013 Rev1.0 silicon, after power on SATA host * controller is configured in legacy mode instead of the * expected enterprise mode. software needs to clear bit[28] * of HControl register to change to enterprise mode from * legacy mode. */ { u32 svr = get_svr(); if (IS_SVR_REV(svr, 1, 0) && ((SVR_SOC_VER(svr) == SVR_P1022) || (SVR_SOC_VER(svr) == SVR_P1022_E) || (SVR_SOC_VER(svr) == SVR_P1013) || (SVR_SOC_VER(svr) == SVR_P1013_E))) { out_le32(®->hstatus, 0x20000000); out_le32(®->hcontrol, 0x00000100); } } #endif /* Set the command header base address to CHBA register to tell DMA */ out_le32(®->chba, (u32)cmd_hdr & ~0x3); /* Snoop for the command header */ val32 = in_le32(®->hcontrol); val32 |= HCONTROL_HDR_SNOOP; out_le32(®->hcontrol, val32); /* Disable all of interrupts */ val32 = in_le32(®->hcontrol); val32 &= ~HCONTROL_INT_EN_ALL; out_le32(®->hcontrol, val32); /* Clear all of interrupts */ val32 = in_le32(®->hstatus); out_le32(®->hstatus, val32); /* Set the ICC, no interrupt coalescing */ out_le32(®->icc, 0x01000000); /* No PM attatched, the SATA device direct connect */ out_le32(®->cqpmp, 0); /* Clear SError register */ val32 = in_le32(®->serror); out_le32(®->serror, val32); /* Clear CER register */ val32 = in_le32(®->cer); out_le32(®->cer, val32); /* Clear DER register */ val32 = in_le32(®->der); out_le32(®->der, val32); /* No device detection or initialization action requested */ out_le32(®->scontrol, 0x00000300); /* Configure the transport layer, default value */ out_le32(®->transcfg, 0x08000016); /* Configure the link layer, default value */ out_le32(®->linkcfg, 0x0000ff34); /* Bring the controller online */ val32 = in_le32(®->hcontrol); val32 |= HCONTROL_ONOFF; out_le32(®->hcontrol, val32); mdelay(100); /* print sata device name */ if (!dev) printf("%s ", sata->name); else printf(" %s ", sata->name); /* Wait PHY RDY signal changed for 500ms */ ata_wait_register(®->hstatus, HSTATUS_PHY_RDY, HSTATUS_PHY_RDY, 500); /* Check PHYRDY */ val32 = in_le32(®->hstatus); if (val32 & HSTATUS_PHY_RDY) { sata->link = 1; } else { sata->link = 0; printf("(No RDY)\n\r"); return -1; } /* Wait for signature updated, which is 1st D2H */ ata_wait_register(®->hstatus, HSTATUS_SIGNATURE, HSTATUS_SIGNATURE, 10000); if (val32 & HSTATUS_SIGNATURE) { sig = in_le32(®->sig); debug("Signature updated, the sig =%08x\n\r", sig); sata->ata_device_type = ata_dev_classify(sig); } /* Check the speed */ val32 = in_le32(®->sstatus); if ((val32 & SSTATUS_SPD_MASK) == SSTATUS_SPD_GEN1) printf("(1.5 Gbps)\n\r"); else if ((val32 & SSTATUS_SPD_MASK) == SSTATUS_SPD_GEN2) printf("(3 Gbps)\n\r"); return 0; }
int checkcpu(void) { sys_info_t sysinfo; uint pvr, svr; uint ver; uint major, minor; uint lcrr; /* local bus clock ratio register */ uint clkdiv; /* clock divider portion of lcrr */ volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; volatile ccsr_gur_t *gur = &immap->im_gur; puts("Freescale PowerPC\n"); pvr = get_pvr(); ver = PVR_VER(pvr); major = PVR_MAJ(pvr); minor = PVR_MIN(pvr); puts("CPU:\n"); puts(" Core: "); switch (ver) { case PVR_VER(PVR_86xx): { uint msscr0 = mfspr(MSSCR0); printf("E600 Core %d", (msscr0 & 0x20) ? 1 : 0 ); if (gur->pordevsr & MPC86xx_PORDEVSR_CORE1TE) puts("\n Core1Translation Enabled"); debug(" (MSSCR0=%x, PORDEVSR=%x)", msscr0, gur->pordevsr); } break; default: puts("Unknown"); break; } printf(", Version: %d.%d, (0x%08x)\n", major, minor, pvr); svr = get_svr(); ver = SVR_SOC_VER(svr); major = SVR_MAJ(svr); minor = SVR_MIN(svr); puts(" System: "); switch (ver) { case SVR_8641: if (SVR_SUBVER(svr) == 1) { puts("8641D"); } else { puts("8641"); } break; case SVR_8610: puts("8610"); break; default: puts("Unknown"); break; } printf(", Version: %d.%d, (0x%08x)\n", major, minor, svr); get_sys_info(&sysinfo); puts(" Clocks: "); printf("CPU:%4lu MHz, ", sysinfo.freqProcessor / 1000000); printf("MPX:%4lu MHz, ", sysinfo.freqSystemBus / 1000000); printf("DDR:%4lu MHz, ", sysinfo.freqSystemBus / 2000000); #if defined(CONFIG_SYS_LBC_LCRR) lcrr = CONFIG_SYS_LBC_LCRR; #else { volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; volatile ccsr_lbc_t *lbc = &immap->im_lbc; lcrr = lbc->lcrr; } #endif clkdiv = lcrr & 0x0f; if (clkdiv == 2 || clkdiv == 4 || clkdiv == 8) { printf("LBC:%4lu MHz\n", sysinfo.freqSystemBus / 1000000 / clkdiv); } else { printf(" LBC: unknown (lcrr: 0x%08x)\n", lcrr); } puts(" L2: "); if (get_l2cr() & 0x80000000) puts("Enabled\n"); else puts("Disabled\n"); return 0; }
int checkcpu (void) { sys_info_t sysinfo; uint lcrr; /* local bus clock ratio register */ uint clkdiv; /* clock divider portion of lcrr */ uint pvr, svr; uint fam; uint ver; uint major, minor; struct cpu_type *cpu; #ifdef CONFIG_DDR_CLK_FREQ volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR); u32 ddr_ratio = ((gur->porpllsr) & 0x00003e00) >> 9; #else u32 ddr_ratio = 0; #endif svr = get_svr(); ver = SVR_SOC_VER(svr); major = SVR_MAJ(svr); #ifdef CONFIG_MPC8536 major &= 0x7; /* the msb of this nibble is a mfg code */ #endif minor = SVR_MIN(svr); puts("CPU: "); cpu = identify_cpu(ver); if (cpu) { puts(cpu->name); if (IS_E_PROCESSOR(svr)) puts("E"); } else { puts("Unknown"); } printf(", Version: %d.%d, (0x%08x)\n", major, minor, svr); pvr = get_pvr(); fam = PVR_FAM(pvr); ver = PVR_VER(pvr); major = PVR_MAJ(pvr); minor = PVR_MIN(pvr); printf("Core: "); switch (fam) { case PVR_FAM(PVR_85xx): puts("E500"); break; default: puts("Unknown"); break; } printf(", Version: %d.%d, (0x%08x)\n", major, minor, pvr); get_sys_info(&sysinfo); puts("Clock Configuration:\n"); printf(" CPU:%4lu MHz, ", DIV_ROUND_UP(sysinfo.freqProcessor,1000000)); printf("CCB:%4lu MHz,\n", DIV_ROUND_UP(sysinfo.freqSystemBus,1000000)); switch (ddr_ratio) { case 0x0: printf(" DDR:%4lu MHz (%lu MT/s data rate), ", DIV_ROUND_UP(sysinfo.freqDDRBus,2000000), DIV_ROUND_UP(sysinfo.freqDDRBus,1000000)); break; case 0x7: printf(" DDR:%4lu MHz (%lu MT/s data rate) (Synchronous), ", DIV_ROUND_UP(sysinfo.freqDDRBus, 2000000), DIV_ROUND_UP(sysinfo.freqDDRBus, 1000000)); break; default: printf(" DDR:%4lu MHz (%lu MT/s data rate) (Asynchronous), ", DIV_ROUND_UP(sysinfo.freqDDRBus, 2000000), DIV_ROUND_UP(sysinfo.freqDDRBus,1000000)); break; } #if defined(CFG_LBC_LCRR) lcrr = CFG_LBC_LCRR; #else { volatile ccsr_lbc_t *lbc = (void *)(CFG_MPC85xx_LBC_ADDR); lcrr = lbc->lcrr; } #endif clkdiv = lcrr & 0x0f; if (clkdiv == 2 || clkdiv == 4 || clkdiv == 8) { #if defined(CONFIG_MPC8548) || defined(CONFIG_MPC8544) || \ defined(CONFIG_MPC8572) || defined(CONFIG_MPC8536) /* * Yes, the entire PQ38 family use the same * bit-representation for twice the clock divider values. */ clkdiv *= 2; #endif printf("LBC:%4lu MHz\n", DIV_ROUND_UP(sysinfo.freqSystemBus, 1000000) / clkdiv); } else { printf("LBC: unknown (lcrr: 0x%08x)\n", lcrr); } #ifdef CONFIG_CPM2 printf("CPM: %lu Mhz\n", sysinfo.freqSystemBus / 1000000); #endif puts("L1: D-cache 32 kB enabled\n I-cache 32 kB enabled\n"); return 0; }
static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_CPU_A011 extern int enable_cpu_a011_workaround; #endif __maybe_unused u32 svr = get_svr(); #if defined(CONFIG_FSL_SATA_V2) && defined(CONFIG_FSL_SATA_ERRATUM_A001) if (IS_SVR_REV(svr, 1, 0)) { switch (SVR_SOC_VER(svr)) { case SVR_P1013: case SVR_P1022: puts("Work-around for Erratum SATA A001 enabled\n"); } } #endif #if defined(CONFIG_SYS_P4080_ERRATUM_SERDES8) puts("Work-around for Erratum SERDES8 enabled\n"); #endif #if defined(CONFIG_SYS_P4080_ERRATUM_SERDES9) puts("Work-around for Erratum SERDES9 enabled\n"); #endif #if defined(CONFIG_SYS_P4080_ERRATUM_SERDES_A005) puts("Work-around for Erratum SERDES-A005 enabled\n"); #endif #if defined(CONFIG_SYS_P4080_ERRATUM_CPU22) if (SVR_MAJ(svr) < 3) puts("Work-around for Erratum CPU22 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_CPU_A011 /* * NMG_CPU_A011 applies to P4080 rev 1.0, 2.0, fixed in 3.0 * also applies to P3041 rev 1.0, 1.1, P2041 rev 1.0, 1.1 * The SVR has been checked by cpu_init_r(). */ if (enable_cpu_a011_workaround) puts("Work-around for Erratum CPU-A011 enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_CPU_A003999) puts("Work-around for Erratum CPU-A003999 enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_DDR_A003474) puts("Work-around for Erratum DDR-A003474 enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_DDR_MSYNC_IN) puts("Work-around for DDR MSYNC_IN Erratum enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_ESDHC111) puts("Work-around for Erratum ESDHC111 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A004468 puts("Work-around for Erratum A004468 enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_ESDHC135) puts("Work-around for Erratum ESDHC135 enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_ESDHC13) if (SVR_MAJ(svr) < 3) puts("Work-around for Erratum ESDHC13 enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_ESDHC_A001) puts("Work-around for Erratum ESDHC-A001 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_CPC_A002 puts("Work-around for Erratum CPC-A002 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_CPC_A003 puts("Work-around for Erratum CPC-A003 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_ELBC_A001 puts("Work-around for Erratum ELBC-A001 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_DDR_A003 puts("Work-around for Erratum DDR-A003 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_DDR_115 puts("Work-around for Erratum DDR115 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_DDR111_DDR134 puts("Work-around for Erratum DDR111 enabled\n"); puts("Work-around for Erratum DDR134 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_IFC_A002769 puts("Work-around for Erratum IFC-A002769 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_P1010_A003549 puts("Work-around for Erratum P1010-A003549 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_IFC_A003399 puts("Work-around for Erratum IFC A-003399 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_DDR120 if ((SVR_MAJ(svr) == 1) || IS_SVR_REV(svr, 2, 0)) puts("Work-around for Erratum NMG DDR120 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_LBC103 puts("Work-around for Erratum NMG_LBC103 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_ETSEC129 if ((SVR_MAJ(svr) == 1) || IS_SVR_REV(svr, 2, 0)) puts("Work-around for Erratum NMG ETSEC129 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A004508 puts("Work-around for Erratum A004508 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A004510 puts("Work-around for Erratum A004510 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_SRIO_A004034 puts("Work-around for Erratum SRIO-A004034 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A_004934 puts("Work-around for Erratum A004934 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A005871 if (IS_SVR_REV(svr, 1, 0)) puts("Work-around for Erratum A005871 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A006475 if (SVR_MAJ(get_svr()) == 1) puts("Work-around for Erratum A006475 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A006384 if (SVR_MAJ(get_svr()) == 1) puts("Work-around for Erratum A006384 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A004849 /* This work-around is implemented in PBI, so just check for it */ check_erratum_a4849(svr); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A004580 /* This work-around is implemented in PBI, so just check for it */ check_erratum_a4580(svr); #endif #ifdef CONFIG_SYS_P4080_ERRATUM_PCIE_A003 puts("Work-around for Erratum PCIe-A003 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_USB14 puts("Work-around for Erratum USB14 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A007186 if (has_erratum_a007186()) puts("Work-around for Erratum A007186 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A006593 puts("Work-around for Erratum A006593 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A006379 if (has_erratum_a006379()) puts("Work-around for Erratum A006379 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_SEC_A003571 if (IS_SVR_REV(svr, 1, 0)) puts("Work-around for Erratum A003571 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A005812 puts("Work-around for Erratum A-005812 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A005125 puts("Work-around for Erratum A005125 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A007075 if (has_erratum_a007075()) puts("Work-around for Erratum A007075 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A007798 if (has_erratum_a007798()) puts("Work-around for Erratum A007798 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A004477 if (has_erratum_a004477()) puts("Work-around for Erratum A004477 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_I2C_A004447 if ((SVR_SOC_VER(svr) == SVR_8548 && IS_SVR_REV(svr, 3, 1)) || (SVR_REV(svr) <= CONFIG_SYS_FSL_A004447_SVR_REV)) puts("Work-around for Erratum I2C-A004447 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A006261 if (has_erratum_a006261()) puts("Work-around for Erratum A006261 enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A007212 check_erratum_a007212(); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A005434 puts("Work-around for Erratum A-005434 enabled\n"); #endif #if defined(CONFIG_SYS_FSL_ERRATUM_A008044) && \ defined(CONFIG_A008044_WORKAROUND) if (IS_SVR_REV(svr, 1, 0)) puts("Work-around for Erratum A-008044 enabled\n"); #endif #if defined(CONFIG_SYS_FSL_B4860QDS_XFI_ERR) && defined(CONFIG_B4860QDS) puts("Work-around for Erratum XFI on B4860QDS enabled\n"); #endif #ifdef CONFIG_SYS_FSL_ERRATUM_A009663 puts("Work-around for Erratum A009663 enabled\n"); #endif return 0; }
int checkcpu(void) { sys_info_t sysinfo; uint pvr, svr; uint ver; uint major, minor; char buf1[32], buf2[32]; volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; volatile ccsr_gur_t *gur = &immap->im_gur; struct cpu_type *cpu; uint msscr0 = mfspr(MSSCR0); svr = get_svr(); ver = SVR_SOC_VER(svr); major = SVR_MAJ(svr); minor = SVR_MIN(svr); puts("CPU: "); cpu = identify_cpu(ver); if (cpu) { puts(cpu->name); } else { puts("Unknown"); } printf(", Version: %d.%d, (0x%08x)\n", major, minor, svr); puts("Core: "); pvr = get_pvr(); ver = PVR_E600_VER(pvr); major = PVR_E600_MAJ(pvr); minor = PVR_E600_MIN(pvr); printf("E600 Core %d", (msscr0 & 0x20) ? 1 : 0 ); if (gur->pordevsr & MPC86xx_PORDEVSR_CORE1TE) puts("\n Core1Translation Enabled"); debug(" (MSSCR0=%x, PORDEVSR=%x)", msscr0, gur->pordevsr); printf(", Version: %d.%d, (0x%08x)\n", major, minor, pvr); get_sys_info(&sysinfo); puts("Clock Configuration:\n"); printf(" CPU:%-4s MHz, ", strmhz(buf1, sysinfo.freqProcessor)); printf("MPX:%-4s MHz\n", strmhz(buf1, sysinfo.freqSystemBus)); printf(" DDR:%-4s MHz (%s MT/s data rate), ", strmhz(buf1, sysinfo.freqSystemBus / 2), strmhz(buf2, sysinfo.freqSystemBus)); if (sysinfo.freqLocalBus > LCRR_CLKDIV) { printf("LBC:%-4s MHz\n", strmhz(buf1, sysinfo.freqLocalBus)); } else { printf("LBC: unknown (LCRR[CLKDIV] = 0x%02lx)\n", sysinfo.freqLocalBus); } puts("L1: D-cache 32 KB enabled\n"); puts(" I-cache 32 KB enabled\n"); puts("L2: "); if (get_l2cr() & 0x80000000) { #if defined(CONFIG_MPC8610) puts("256"); #elif defined(CONFIG_MPC8641) puts("512"); #endif puts(" KB enabled\n"); } else { puts("Disabled\n"); } return 0; }