void ft_board_setup(void *fdt, bd_t *bd) { static const char disabled[] = "disabled"; u32 reg = readl(HB_SREG_A9_PWRDOM_STAT); if (!(reg & PWRDOM_STAT_SATA)) do_fixup_by_compat(fdt, "calxeda,hb-ahci", "status", disabled, sizeof(disabled), 1); if (!(reg & PWRDOM_STAT_EMMC)) do_fixup_by_compat(fdt, "calxeda,hb-sdhci", "status", disabled, sizeof(disabled), 1); }
int ft_board_setup(void *blob, bd_t *bd) { u64 base[CONFIG_NR_DRAM_BANKS]; u64 size[CONFIG_NR_DRAM_BANKS]; u8 reg; /* fixup DT for the two DDR banks */ base[0] = gd->bd->bi_dram[0].start; size[0] = gd->bd->bi_dram[0].size; base[1] = gd->bd->bi_dram[1].start; size[1] = gd->bd->bi_dram[1].size; fdt_fixup_memory_banks(blob, base, size, 2); ft_cpu_setup(blob, bd); #ifdef CONFIG_SYS_DPAA_FMAN fdt_fixup_fman_ethernet(blob); fdt_fixup_board_enet(blob); #endif reg = QIXIS_READ(brdcfg[0]); reg = (reg & QIXIS_LBMAP_MASK) >> QIXIS_LBMAP_SHIFT; /* Disable IFC if QSPI is enabled */ if (reg == 0xF) do_fixup_by_compat(blob, "fsl,ifc", "status", "disabled", 8 + 1, 1); return 0; }
void fdt_fixup_muram (void *blob) { ulong data[2]; data[0] = 0; data[1] = QE_MURAM_SIZE - 2 * sizeof(unsigned long); do_fixup_by_compat(blob, "fsl,qe-muram-data", "reg", data, sizeof (data), 0); }
static void fdt_board_fixup_qe_usb(void *blob, bd_t *bd) { u8 *bcsr = (u8 *)CONFIG_SYS_BCSR_BASE; if (hwconfig_subarg_cmp("qe_usb", "speed", "low")) clrbits_8(&bcsr[17], BCSR17_nUSBLOWSPD); else setbits_8(&bcsr[17], BCSR17_nUSBLOWSPD); if (hwconfig_subarg_cmp("qe_usb", "mode", "peripheral")) { clrbits_8(&bcsr[17], BCSR17_USBVCC); clrbits_8(&bcsr[17], BCSR17_USBMODE); do_fixup_by_compat(blob, "fsl,mpc8569-qe-usb", "mode", "peripheral", sizeof("peripheral"), 1); } else { setbits_8(&bcsr[17], BCSR17_USBVCC); setbits_8(&bcsr[17], BCSR17_USBMODE); } clrbits_8(&bcsr[17], BCSR17_nUSBEN); }
void do_fixup_by_compat_u32(void *fdt, const char *compat, const char *prop, u32 val, int create) { val = cpu_to_fdt32(val); do_fixup_by_compat(fdt, compat, prop, &val, 4, create); }
int ft_board_setup(void *blob, bd_t *bd) { phys_addr_t base; phys_size_t size; #if defined(CONFIG_TARGET_P1020RDB_PD) || defined(CONFIG_TARGET_P1020RDB_PC) const char *soc_usb_compat = "fsl-usb2-dr"; int usb_err, usb1_off, usb2_off; #endif #if defined(CONFIG_SDCARD) || defined(CONFIG_SPIFLASH) int err; #endif ft_cpu_setup(blob, bd); base = env_get_bootm_low(); size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); FT_FSL_PCI_SETUP; #ifdef CONFIG_QE do_fixup_by_compat(blob, "fsl,qe", "status", "okay", sizeof("okay"), 0); #if defined(CONFIG_TARGET_P1025RDB) || defined(CONFIG_TARGET_P1021RDB) fdt_board_fixup_qe_pins(blob); #endif #endif #if defined(CONFIG_HAS_FSL_DR_USB) fsl_fdt_fixup_dr_usb(blob, bd); #endif #if defined(CONFIG_SDCARD) || defined(CONFIG_SPIFLASH) /* Delete eLBC node as it is muxed with USB2 controller */ if (hwconfig("usb2")) { const char *soc_elbc_compat = "fsl,p1020-elbc"; int off = fdt_node_offset_by_compatible(blob, -1, soc_elbc_compat); if (off < 0) { printf("WARNING: could not find compatible node %s\n", soc_elbc_compat); return off; } err = fdt_del_node(blob, off); if (err < 0) { printf("WARNING: could not remove %s\n", soc_elbc_compat); return err; } return 0; } #endif #if defined(CONFIG_TARGET_P1020RDB_PD) || defined(CONFIG_TARGET_P1020RDB_PC) /* Delete USB2 node as it is muxed with eLBC */ usb1_off = fdt_node_offset_by_compatible(blob, -1, soc_usb_compat); if (usb1_off < 0) { printf("WARNING: could not find compatible node %s\n", soc_usb_compat); return usb1_off; } usb2_off = fdt_node_offset_by_compatible(blob, usb1_off, soc_usb_compat); if (usb2_off < 0) { printf("WARNING: could not find compatible node %s\n", soc_usb_compat); return usb2_off; } usb_err = fdt_del_node(blob, usb2_off); if (usb_err < 0) { printf("WARNING: could not remove %s\n", soc_usb_compat); return usb_err; } #endif return 0; }