Lines Matching +full:- +full:j4

1 // SPDX-License-Identifier: GPL-2.0+
12 #include <asm/arch/mx6-pins.h>
16 #include <asm/mach-imx/boot_mode.h>
17 #include <asm/mach-imx/sata.h>
18 #include <asm/mach-imx/spi.h>
19 #include <asm/mach-imx/video.h>
107 clrsetbits_le32(&mxc_ccm->cs2cdr, in setup_gpmi_nand()
116 setbits_le32(&mxc_ccm->CCGR4, in setup_gpmi_nand()
124 setbits_le32(&mxc_ccm->CCGR0, MXC_CCM_CCGR0_APBHDMA_MASK); in setup_gpmi_nand()
200 return (bus == 0 && cs == 0) ? (IMX_GPIO_NR(3, 19)) : -1; in board_spi_cs_gpio()
211 /* configure eth0 PHY board-specific LED behavior */
217 if (phydev->phy_id == 0x1410dd1) { in board_phy_config()
220 * LED[0] (SPD:Amber) R16_3.3:0 to 0111: on-GbE link in board_phy_config()
221 * LED[1] (LNK:Green) R16_3.7:4 to 0001: on-link, blink-activity in board_phy_config()
232 else if (phydev->phy_id == 0x2000a231) { in board_phy_config()
243 if (phydev->drv->config) in board_phy_config()
244 phydev->drv->config(phydev); in board_phy_config()
252 struct mii_dev *bus = phydev->bus; in mv88e61xx_hw_reset()
256 bus->write(bus, 0x1c /*MV_GLOBAL2*/, 0, in mv88e61xx_hw_reset()
259 bus->write(bus, 0x1c /*MV_GLOBAL2*/, 0, in mv88e61xx_hw_reset()
263 /* RGMII delay - Physical Control register bit[15:14] */ in mv88e61xx_hw_reset()
265 /* forced 1000mbps full-duplex link */ in mv88e61xx_hw_reset()
266 bus->write(bus, 0x10 + CONFIG_MV88E61XX_CPU_PORT, 0, 1, 0xc0fe); in mv88e61xx_hw_reset()
267 phydev->autoneg = AUTONEG_DISABLE; in mv88e61xx_hw_reset()
268 phydev->speed = SPEED_1000; in mv88e61xx_hw_reset()
269 phydev->duplex = DUPLEX_FULL; in mv88e61xx_hw_reset()
271 /* LED configuration: 7:4-green (8=Activity) 3:0 amber (8=Link) */ in mv88e61xx_hw_reset()
272 bus->write(bus, 0x10, 0, 0x16, 0x8088); in mv88e61xx_hw_reset()
273 bus->write(bus, 0x11, 0, 0x16, 0x8088); in mv88e61xx_hw_reset()
274 bus->write(bus, 0x12, 0, 0x16, 0x8088); in mv88e61xx_hw_reset()
275 bus->write(bus, 0x13, 0, 0x16, 0x8088); in mv88e61xx_hw_reset()
286 if (test_bit(EECONFIG_ETH0, info->config)) { in board_eth_init()
305 env_set("ethprime", dev->name); in board_eth_init()
322 return i2c_set_bus_num(dev->bus) == 0 && in detect_i2c()
323 i2c_probe(dev->addr) == 0; in detect_i2c()
332 u32 reg = readl(&iomux->gpr[2]); in enable_lvds()
334 writel(reg, &iomux->gpr[2]); in enable_lvds()
346 .bus = -1,
366 /* Freescale MXC-LVDS1: HannStar HSD100PXN1-A00 w/ egalx_ts cont */
373 .name = "Hannstar-XGA",
387 /* DLC700JMG-T-4 */
408 /* DLC800FIG-T-3 */
462 reg = __raw_readl(&mxc_ccm->CCGR3); in setup_display()
464 writel(reg, &mxc_ccm->CCGR3); in setup_display()
467 reg = readl(&mxc_ccm->cs2cdr); in setup_display()
472 writel(reg, &mxc_ccm->cs2cdr); in setup_display()
474 reg = readl(&mxc_ccm->cscmr2); in setup_display()
476 writel(reg, &mxc_ccm->cscmr2); in setup_display()
478 reg = readl(&mxc_ccm->chsccdr); in setup_display()
481 writel(reg, &mxc_ccm->chsccdr); in setup_display()
492 writel(reg, &iomux->gpr[2]); in setup_display()
494 reg = readl(&iomux->gpr[3]); in setup_display()
498 writel(reg, &iomux->gpr[3]); in setup_display()
500 /* LVDS Backlight GPIO on LVDS connector - output low */ in setup_display()
528 * GPIO's as PERST# signals for its downstream ports - configure the GPIO's
555 /* store array of devs for later use in device-tree fixup */ in board_pci_fixup_dev()
556 pdev->devfn = dev; in board_pci_fixup_dev()
557 pdev->vendor = vendor; in board_pci_fixup_dev()
558 pdev->device = device; in board_pci_fixup_dev()
559 pdev->class = class; in board_pci_fixup_dev()
560 pdev->ppar = NULL; in board_pci_fixup_dev()
562 pdev->busno = ++pci_bridgeno; in board_pci_fixup_dev()
564 pdev->busno = 0; in board_pci_fixup_dev()
566 /* fixup RC - it should be 00:00.0 not 00:01.0 */ in board_pci_fixup_dev()
568 pdev->devfn = 0; in board_pci_fixup_dev()
572 if (pci_devs[i].busno == PCI_BUS(pdev->devfn)) { in board_pci_fixup_dev()
573 pdev->ppar = &pci_devs[i]; in board_pci_fixup_dev()
584 dw |= 0xaaa8; /* GPIO1-7 outputs */ in board_pci_fixup_dev()
588 dw |= 0xfe; /* GPIO1-7 output high */ in board_pci_fixup_dev()
608 serialnr->high = 0; in get_board_serial()
609 serialnr->low = simple_strtoul(serial, NULL, 10); in get_board_serial()
611 serialnr->high = 0; in get_board_serial()
612 serialnr->low = ventana_info.serial; in get_board_serial()
614 serialnr->high = 0; in get_board_serial()
615 serialnr->low = 0; in get_board_serial()
636 gd->ram_size = imx_ddr_size(); in dram_init()
644 clrsetbits_le32(&iomuxc_regs->gpr[1], in board_init()
649 gd->bd->bi_boot_params = PHYS_SDRAM + 0x100; in board_init()
695 if (info->model[0]) { in checkboard()
696 printf("Model: %s\n", info->model); in checkboard()
697 printf("MFGDate: %02x-%02x-%02x%02x\n", in checkboard()
698 info->mfgdate[0], info->mfgdate[1], in checkboard()
699 info->mfgdate[2], info->mfgdate[3]); in checkboard()
700 printf("Serial:%d\n", info->serial); in checkboard()
702 puts("Invalid EEPROM - board will not function fully\n"); in checkboard()
723 * see Table 8-11 and Table 5-9
725 * BOOT_CFG1[5] = 0 - raw NAND
726 * BOOT_CFG1[4] = 0 - default pad settings
727 * BOOT_CFG1[3:2] = 00 - devices = 1
728 * BOOT_CFG1[1:0] = 00 - Row Address Cycles = 3
729 * BOOT_CFG2[4:3] = 00 - Boot Search Count = 2
730 * BOOT_CFG2[2:1] = 01 - Pages In Block = 64
731 * BOOT_CFG2[0] = 0 - Reset time 12ms
768 if (8 << (ventana_info.nand_flash_size-1) >= 2048) in misc_init_r()
773 for (i = 0; i < (sizeof(str)-1) && info->model[i]; i++) in misc_init_r()
774 str[i] = tolower(info->model[i]); in misc_init_r()
777 sprintf(fdt, "%s-%s.dtb", cputype, str); in misc_init_r()
780 p = strchr(str, '-'); in misc_init_r()
785 sprintf(fdt, "%s-%s.dtb", cputype, str); in misc_init_r()
794 sprintf(fdt, "%s-%s.dtb", cputype, str); in misc_init_r()
799 if (test_bit(EECONFIG_ETH0, info->config) && in misc_init_r()
801 eth_env_set_enetaddr("ethaddr", info->mac0); in misc_init_r()
803 if (test_bit(EECONFIG_ETH1, info->config) && in misc_init_r()
805 eth_env_set_enetaddr("eth1addr", info->mac1); in misc_init_r()
808 /* board serial-number */ in misc_init_r()
809 sprintf(str, "%6d", info->serial); in misc_init_r()
813 sprintf(str, "%d", (int) (gd->ram_size >> 20)); in misc_init_r()
817 /* Set a non-initialized hwconfig based on board configuration */ in misc_init_r()
851 return -EINVAL; in ft_sethdmiinfmt()
853 off = fdt_node_offset_by_compatible(blob, -1, "nxp,tda1997x"); in ft_sethdmiinfmt()
876 return -EINVAL; in ft_sethdmiinfmt()
884 (PCI_BUS(x->devfn)<<16)| \
885 (PCI_DEV(x->devfn)<<11)| \
886 (PCI_FUNC(x->devfn)<<8) \
894 sprintf(node, "pcie@%d,%d,%d", PCI_BUS(dev->devfn), in fdt_add_pci_node()
895 PCI_DEV(dev->devfn), PCI_FUNC(dev->devfn)); in fdt_add_pci_node()
920 np = fdt_node_offset_by_compatible(blob, -1, "fsl,imx6q-pcie"); in fdt_add_pci_path()
927 dev = dev->ppar; in fdt_add_pci_path()
931 while (k--) { in fdt_add_pci_path()
942 * INTA/B/C/D are mis-mapped to its four slots (slot12-15). Because
944 * provide an irq-map via device-tree.
956 /* build irq-map based on host controllers map */ in fdt_fixup_gw16082()
957 host = fdt_node_offset_by_compatible(blob, -1, "fsl,imx6q-pcie"); in fdt_fixup_gw16082()
964 imap = fdt_getprop(blob, host, "interrupt-map", &len); in fdt_fixup_gw16082()
966 printf(" %s failed: invalid interrupt-map\n", in fdt_fixup_gw16082()
968 return -FDT_ERR_NOTFOUND; in fdt_fixup_gw16082()
973 irq[(fdt32_to_cpu(imap[(i*8)+3])-1)%4] = imap[(i*8)+6]; in fdt_fixup_gw16082()
983 d = dev->ppar; in fdt_fixup_gw16082()
984 while(d && d->ppar) { in fdt_fixup_gw16082()
985 b += PCI_DEV(d->devfn); in fdt_fixup_gw16082()
986 d = d->ppar; in fdt_fixup_gw16082()
989 /* create new irq mappings for slots12-15 in fdt_fixup_gw16082()
990 * <skt> <idsel> <slot> <skt-inta> <skt-intb> in fdt_fixup_gw16082()
992 * J4 AD29 13 INTC INTD in fdt_fixup_gw16082()
998 u32 addr = dev->busno << 16 | (12+i) << 11; in fdt_fixup_gw16082()
1013 imap_new[(i*32)+(0*8)+6] = irq[(15-(12+i)+b+0)%4]; in fdt_fixup_gw16082()
1014 imap_new[(i*32)+(1*8)+6] = irq[(15-(12+i)+b+1)%4]; in fdt_fixup_gw16082()
1015 imap_new[(i*32)+(2*8)+6] = irq[(15-(12+i)+b+2)%4]; in fdt_fixup_gw16082()
1016 imap_new[(i*32)+(3*8)+6] = irq[(15-(12+i)+b+3)%4]; in fdt_fixup_gw16082()
1018 fdt_setprop(blob, np, "interrupt-map", imap_new, in fdt_fixup_gw16082()
1024 fdt_setprop(blob, np, "interrupt-map-mask", reg, sizeof(reg)); in fdt_fixup_gw16082()
1025 fdt_setprop_cell(blob, np, "#interrupt-cells", 1); in fdt_fixup_gw16082()
1027 fdt_setprop_cell(blob, np, "#address-cells", 3); in fdt_fixup_gw16082()
1028 fdt_setprop_cell(blob, np, "#size-cells", 2); in fdt_fixup_gw16082()
1029 printf(" Added custom interrupt-map for GW16082\n"); in fdt_fixup_gw16082()
1034 /* The sky2 GigE MAC obtains it's MAC addr from device-tree by default */
1051 fdt_setprop(blob, np, "local-mac-address", mac_addr, in fdt_fixup_sky2()
1057 return -1; in fdt_fixup_sky2()
1074 * The GW16082 consists of a TI XIO2001 PCIe-to-PCI bridge and in ft_board_pci_fixup()
1075 * an EEPROM at i2c1-0x50. in ft_board_pci_fixup()
1077 if ((dev->vendor == PCI_VENDOR_ID_TI) && in ft_board_pci_fixup()
1078 (dev->device == 0x8240) && in ft_board_pci_fixup()
1088 else if ((dev->vendor == PCI_VENDOR_ID_MARVELL) && in ft_board_pci_fixup()
1089 (dev->device == 0x4380)) in ft_board_pci_fixup()
1101 int off = fdt_node_offset_by_compat_reg(blob, "fsl,imx6q-wdt", addr); in ft_board_wdog_fixup()
1104 fdt_delprop(blob, off, "ext-reset-output"); in ft_board_wdog_fixup()
1105 fdt_delprop(blob, off, "fsl,ext-reset-output"); in ft_board_wdog_fixup()
1113 * - mtd partitions based on mtdparts/mtdids env
1114 * - system-serial (board serial num from EEPROM)
1115 * - board (full model from EEPROM)
1116 * - peripherals removed from DTB if not loaded on board (per EEPROM config)
1129 { "fsl,imx6q-gpmi-nand", MTD_DEV_TYPE_NAND, }, /* NAND flash */ in ft_board_setup()
1137 for (i = sizeof(ventana_info.model) - 1; i > 0; i--) { in ft_board_setup()
1149 if (test_bit(EECONFIG_NAND, info->config)) { in ft_board_setup()
1165 fdt_setprop(blob, 0, "system-serial", env_get("serial#"), in ft_board_setup()
1168 /* board (model contains model from device-tree) */ in ft_board_setup()
1169 fdt_setprop(blob, 0, "board", info->model, in ft_board_setup()
1170 strlen((const char *)info->model) + 1); in ft_board_setup()
1181 * disable wdog node for GW51xx-A/B to work around in ft_board_setup()
1185 i = fdt_node_offset_by_compat_reg(blob, "fsl,imx6q-wdt", in ft_board_setup()
1191 /* GW51xx-E adds WDOG1_B external reset */ in ft_board_setup()
1198 if (info->model[4] == '2') { in ft_board_setup()
1202 i = fdt_node_offset_by_compatible(blob, -1, in ft_board_setup()
1203 "fsl,imx6q-pcie"); in ft_board_setup()
1206 "reset-gpio", NULL); in ft_board_setup()
1210 "fsl,imx6q-gpio", GPIO3_ADDR); in ft_board_setup()
1220 if (strstr((const char *)info->model, "SP318-B") || in ft_board_setup()
1221 strstr((const char *)info->model, "SP331-B")) in ft_board_setup()
1224 /* GW522x-B adds WDOG1_B external reset */ in ft_board_setup()
1229 /* GW520x-E adds WDOG1_B external reset */ in ft_board_setup()
1230 else if (info->model[4] == '0' && rev < 'E') in ft_board_setup()
1235 /* GW53xx-E adds WDOG1_B external reset */ in ft_board_setup()
1248 /* GW54xx-E adds WDOG2_B external reset */ in ft_board_setup()
1255 * isolate CSI0_DATA_EN for GW551x-A to work around errata in ft_board_setup()
1263 i = fdt_node_offset_by_compatible(blob, -1, in ft_board_setup()
1264 "fsl,imx-tda1997x-video"); in ft_board_setup()
1266 handle = fdt_getprop(blob, i, "pinctrl-0", in ft_board_setup()
1297 /* GW551x-C adds WDOG1_B external reset */ in ft_board_setup()
1317 if (hwconfig_subarg_cmp(arg, "mode", "pwm") && cfg->pwm_param) in ft_board_setup()
1323 cfg->pwm_param, i); in ft_board_setup()
1324 addr = PWM0_ADDR + (0x4000 * (cfg->pwm_param - 1)); in ft_board_setup()
1326 "fsl,imx6q-pwm", in ft_board_setup()
1333 /* remove no-1-8-v if UHS-I support is present */ in ft_board_setup()
1335 debug("Enabling UHS-I support\n"); in ft_board_setup()
1336 i = fdt_node_offset_by_compat_reg(blob, "fsl,imx6q-usdhc", in ft_board_setup()
1339 fdt_delprop(blob, i, "no-1-8-v"); in ft_board_setup()
1357 while (cfg->name) { in ft_board_setup()
1358 if (!test_bit(cfg->bit, info->config)) { in ft_board_setup()
1359 fdt_del_node_and_alias(blob, cfg->dtalias ? in ft_board_setup()
1360 cfg->dtalias : cfg->name); in ft_board_setup()