static void __init imx7d_enet_phy_init(void) { if (IS_BUILTIN(CONFIG_PHYLIB)) { phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff, ar8031_phy_fixup); phy_register_fixup_for_uid(PHY_ID_BCM54220, 0xffffffff, bcm54220_phy_fixup); } }
static void __init imx6q_enet_phy_init(void) { if (IS_BUILTIN(CONFIG_PHYLIB)) { phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, ksz9021rn_phy_fixup); phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK, ksz9031rn_phy_fixup); phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff, ar8031_phy_fixup); phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef, ar8035_phy_fixup); } }
static void __init imx6q_sabrelite_init(void) { if (IS_ENABLED(CONFIG_PHYLIB)) phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, ksz9021rn_phy_fixup); imx6q_sabrelite_cko1_setup(); }
static void __init sama5_dt_device_init(void) { if (of_machine_is_compatible("atmel,sama5d3xcm") && IS_ENABLED(CONFIG_PHYLIB)) phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, ksz9021rn_phy_fixup); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); }
static int sabresd_coredevices_init(void) { sabresd_phy_reset(); phy_register_fixup_for_uid(PHY_ID_AR8031, AR_PHY_ID_MASK, ar8031_phy_fixup); return 0; }
static int nitrogen6x_coredevices_init(void) { if (!of_machine_is_compatible("fsl,imx6dl-nitrogen6x") && !of_machine_is_compatible("fsl,imx6q-nitrogen6x")) return 0; phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, ksz9021rn_phy_fixup); return 0; }
static int sabresd_coredevices_init(void) { if (!of_machine_is_compatible("fsl,imx6q-sabresd")) return 0; phy_register_fixup_for_uid(PHY_ID_AR8031, AR_PHY_ID_MASK, ar8031_phy_fixup); return 0; }
static void __init imx6q_init_machine(void) { if (of_machine_is_compatible("fsl,imx6q-sabrelite")) phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, ksz9021rn_phy_fixup); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); imx6q_pm_init(); }
static int e9_coredevices_init(void) { if (!of_machine_is_compatible("embedsky,e9")) return 0; phy_register_fixup_for_uid(PHY_ID_RTL8211E, PHY_ID_MASK, rtl8211e_phy_fixup); return 0; }
static int socfpga_console_init(void) { if (!of_machine_is_compatible("terasic,sockit")) return 0; if (IS_ENABLED(CONFIG_PHYLIB)) phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, phy_fixup); return 0; }
static int imx6sx_sdb_setup_fec(void) { void __iomem *gprbase = (void *)MX6_IOMUXC_BASE_ADDR + 0x4000; uint32_t val; struct clk *clk; phy_register_fixup_for_uid(PHY_ID_AR8031, AR_PHY_ID_MASK, ar8031_phy_fixup); /* Active high for ncp692 */ gpio_direction_output(IMX_GPIO_NR(4, 16), 1); clk = clk_lookup("enet_ptp_25m"); if (IS_ERR(clk)) goto err; clk_enable(clk); clk = clk_lookup("enet_ref"); if (IS_ERR(clk)) goto err; clk_enable(clk); clk = clk_lookup("enet2_ref_125m"); if (IS_ERR(clk)) goto err; clk_enable(clk); val = readl(gprbase + IOMUXC_GPR1); /* Use 125M anatop loopback REF_CLK1 for ENET1, clear gpr1[13], gpr1[17]*/ val &= ~(1 << 13); val &= ~(1 << 17); /* Use 125M anatop loopback REF_CLK1 for ENET2, clear gpr1[14], gpr1[18]*/ val &= ~(1 << 14); val &= ~(1 << 18); writel(val, gprbase + IOMUXC_GPR1); /* Enable the ENET power, active low */ gpio_direction_output(IMX_GPIO_NR(2, 6), 0); /* Reset AR8031 PHY */ gpio_direction_output(IMX_GPIO_NR(2, 7), 0); udelay(500); gpio_set_value(IMX_GPIO_NR(2, 7), 1); return 0; err: pr_err("Setting up DFEC\n"); return -EIO; }
static void microsom_eth_init(void) { void __iomem *iomux = (void *)MX6_IOMUXC_BASE_ADDR; u32 val; clk_set_rate(clk_lookup("enet_ref"), 25000000); val = readl(iomux + IOMUXC_GPR1); val |= IMX6Q_GPR1_ENET_CLK_SEL_ANATOP; writel(val, iomux + IOMUXC_GPR1); phy_register_fixup_for_uid(0x004dd072, 0xffffffef, ar8035_phy_fixup); }
static int sabrelite_coredevices_init(void) { if (!of_machine_is_compatible("fsl,imx6q-sabrelite") && !of_machine_is_compatible("fsl,imx6dl-sabrelite")) return 0; phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, ksz9021rn_phy_fixup); barebox_set_hostname("sabrelite"); return 0; }
static int hummingboard_device_init(void) { if (!of_machine_is_compatible("solidrun,hummingboard")) return 0; phy_register_fixup_for_uid(0x004dd072, 0xffffffef, ar8035_phy_fixup); /* enable USB VBUS */ gpio_direction_output(IMX_GPIO_NR(3, 22), 1); gpio_direction_output(IMX_GPIO_NR(1, 0), 1); barebox_set_hostname("hummingboard"); return 0; }
static int wandboard_device_init(void) { if (!of_machine_is_compatible("wand,imx6dl-wandboard") && !of_machine_is_compatible("wand,imx6q-wandboard")) return 0; phy_register_fixup_for_uid(PHY_ID_AR8031, AR_PHY_ID_MASK, ar8031_phy_fixup); barebox_set_hostname("wandboard"); imx6_bbu_internal_mmc_register_handler("mmc", "/dev/mmc2.barebox", BBU_HANDLER_FLAG_DEFAULT); return 0; }
static int nxp_imx6ull_evk_init(void) { if (!of_machine_is_compatible("fsl,imx6ull-14x14-evk")) return 0; phy_register_fixup_for_uid(PHY_ID_KSZ8081, MICREL_PHY_ID_MASK, ksz8081_phy_fixup); imx6_bbu_internal_mmc_register_handler("mmc", "/dev/mmc1.barebox", BBU_HANDLER_FLAG_DEFAULT); barebox_set_hostname("imx6ull-evk"); return 0; }
static int phytec_pfla02_init(void) { if (!of_machine_is_compatible("phytec,imx6q-pfla02") && !of_machine_is_compatible("phytec,imx6dl-pfla02") && !of_machine_is_compatible("phytec,imx6s-pfla02")) return 0; phyflex_err006282_workaround(); eth_phy_reset(); phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK, ksz9031rn_phy_fixup); imx6_bbu_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT); return 0; }
static int dfi_fs700_m60_init(void) { unsigned flag_spi = 0, flag_mmc = 0; if (!of_machine_is_compatible("dfi,fs700-m60")) return 0; phy_register_fixup_for_uid(PHY_ID_AR8031, AR_PHY_ID_MASK, ar8031_phy_fixup); if (bootsource_get() == BOOTSOURCE_SPI) flag_spi |= BBU_HANDLER_FLAG_DEFAULT; else flag_mmc |= BBU_HANDLER_FLAG_DEFAULT; imx6_bbu_internal_mmc_register_handler("mmc", "/dev/mmc3.boot0", flag_mmc); imx6_bbu_internal_spi_i2c_register_handler("spiflash", "/dev/m25p0", flag_spi); armlinux_set_architecture(MACH_TYPE_MX6Q_SABRESD); return 0; }
static void __init apx4devkit_init(void) { mxs_iomux_setup_multiple_pads(apx4devkit_pads, ARRAY_SIZE(apx4devkit_pads)); mx28_add_duart(); mx28_add_auart0(); mx28_add_auart1(); mx28_add_auart2(); mx28_add_auart3(); /* * Register fixup for the Micrel KS8031 PHY clock * (shares same ID with KS8051) */ phy_register_fixup_for_uid(PHY_ID_KS8051, MICREL_PHY_ID_MASK, apx4devkit_phy_fixup); mx28_add_fec(0, &mx28_fec_pdata); mx28_add_mxs_mmc(0, &apx4devkit_mmc_pdata); gpio_led_register_device(0, &apx4devkit_led_data); mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0); mx28_add_saif(0, &apx4devkit_mxs_saif_pdata[0]); mx28_add_saif(1, &apx4devkit_mxs_saif_pdata[1]); apx4devkit_add_regulators(); mx28_add_mxs_i2c(0); i2c_register_board_info(0, apx4devkit_i2c_boardinfo, ARRAY_SIZE(apx4devkit_i2c_boardinfo)); mxs_add_platform_device("mxs-sgtl5000", 0, NULL, 0, NULL, 0); }
static int realq7_enet_init(void) { if (!of_machine_is_compatible("dmo,imx6q-edmqmx6")) return 0; mxc_iomux_v3_setup_multiple_pads(realq7_pads_gpio, ARRAY_SIZE(realq7_pads_gpio)); gpio_direction_output(RQ7_GPIO_ENET_PHYADD2, 0); gpio_direction_output(RQ7_GPIO_ENET_MODE0, 1); gpio_direction_output(RQ7_GPIO_ENET_MODE1, 1); gpio_direction_output(RQ7_GPIO_ENET_MODE2, 1); gpio_direction_output(RQ7_GPIO_ENET_MODE3, 1); gpio_direction_output(RQ7_GPIO_ENET_EN_CLK125, 1); gpio_direction_output(25, 0); mdelay(50); gpio_direction_output(25, 1); mdelay(50); phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK, ksz9031rn_phy_fixup); return 0; }
static void __init imx6sx_enet_phy_init(void) { if (IS_BUILTIN(CONFIG_PHYLIB)) phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff, ar8031_phy_fixup); }
static void __init at91_dt_device_init(void) { char mb_rev = 255; int ret; if (of_machine_is_compatible("atmel,sama5ek")) { struct device_node *np; phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, ksz9021rn_phy_fixup); np = of_find_node_by_path("/"); if (np) { const char *mb_rev_tmp; ret = of_property_read_string(np, "atmel,mb-rev", &mb_rev_tmp); if (ret) { printk("AT91: error %d while looking for mb-rev property, " "let assume we are using the latest one\n", ret); } else { printk("AT91: mb rev: %s\n", mb_rev_tmp); mb_rev = mb_rev_tmp[0]; } } np = of_find_compatible_node(NULL, NULL, "atmel,at91sam9g45-isi"); if (np) { if (of_device_is_available(np)) { switch (mb_rev) { case 'A': case 'B': camera_set_gpio_pins(AT91_PIN_PE28, AT91_PIN_PE29); at91_config_isi(true, "pck2"); break; default: camera_set_gpio_pins(AT91_PIN_PE24, AT91_PIN_PE29); at91_config_isi(true, "pck1"); break; } } } np = of_find_compatible_node(NULL, NULL, "atmel,atmel_mxt_ts"); if (np) { if (of_device_is_available(np)) { __u8 manufacturer[4] = "Inlx"; __u8 monitor[14] = "AT043TN24"; /* set mXT224 and QT1070 IRQ lines as inputs */ gpio_direction_input(AT91_PIN_PE31); gpio_direction_input(AT91_PIN_PE30); /* set LCD configuration */ ek_lcdc_data.smem_len = 480 * 272 * 4; memcpy(ek_lcdc_data.default_monspecs->manufacturer, manufacturer, 4); memcpy(ek_lcdc_data.default_monspecs->monitor, monitor, 14); ek_lcdc_data.default_monspecs->hfmin = 14876; ek_lcdc_data.default_monspecs->hfmax = 17142; ek_lcdc_data.default_monspecs->vfmin = 50; ek_lcdc_data.default_monspecs->vfmax = 67; ek_lcdc_data.default_monspecs->modedb->name = "Inlx"; ek_lcdc_data.default_monspecs->modedb->xres = 480; ek_lcdc_data.default_monspecs->modedb->yres = 272; ek_lcdc_data.default_monspecs->modedb->pixclock = KHZ2PICOS(9000); ek_lcdc_data.default_monspecs->modedb->left_margin = 2; ek_lcdc_data.default_monspecs->modedb->right_margin = 2; ek_lcdc_data.default_monspecs->modedb->upper_margin = 2; ek_lcdc_data.default_monspecs->modedb->lower_margin = 2; ek_lcdc_data.default_monspecs->modedb->hsync_len = 41; ek_lcdc_data.default_monspecs->modedb->vsync_len = 11; } } } else if (of_machine_is_compatible("atmel,at91sam9x5ek")) { struct device_node *np; np = of_find_compatible_node(NULL, NULL, "atmel,at91sam9g45-isi"); if (np) { if (of_device_is_available(np)) { camera_set_gpio_pins(AT91_PIN_PA7, AT91_PIN_PA13); at91_config_isi(true, "pck0"); } } } of_platform_populate(NULL, of_default_bus_match_table, at91_auxdata_lookup, NULL); #if defined(CONFIG_SOC_CAMERA_OV2640) \ || defined(CONFIG_SOC_CAMERA_OV2640_MODULE) /* add ov2640 camera device */ platform_add_devices(devices, ARRAY_SIZE(devices)); #endif }
static void __init dns323_init(void) { /* Setup basic Orion functions. Need to be called early. */ orion5x_init(); /* Identify revision */ system_rev = dns323_identify_rev(); pr_info("DNS-323: Identified HW revision %c1\n", 'A' + system_rev); /* Just to be tricky, the 5182 has a completely different * set of MPP modes to the 5181. */ switch(system_rev) { case DNS323_REV_A1: orion5x_mpp_conf(dns323a_mpp_modes); writel(0, MPP_DEV_CTRL); /* DEV_D[31:16] */ break; case DNS323_REV_B1: orion5x_mpp_conf(dns323b_mpp_modes); break; case DNS323_REV_C1: orion5x_mpp_conf(dns323c_mpp_modes); break; } /* setup flash mapping * CS3 holds a 8 MB Spansion S29GL064M90TFIR4 */ orion5x_setup_dev_boot_win(DNS323_NOR_BOOT_BASE, DNS323_NOR_BOOT_SIZE); platform_device_register(&dns323_nor_flash); /* Sort out LEDs, Buttons and i2c devices */ switch(system_rev) { case DNS323_REV_A1: /* The 5181 power LED is active low and requires * DNS323_GPIO_LED_POWER1 to also be low. */ dns323ab_leds[0].active_low = 1; gpio_request(DNS323_GPIO_LED_POWER1, "Power Led Enable"); gpio_direction_output(DNS323_GPIO_LED_POWER1, 0); /* Fall through */ case DNS323_REV_B1: i2c_register_board_info(0, dns323ab_i2c_devices, ARRAY_SIZE(dns323ab_i2c_devices)); break; case DNS323_REV_C1: /* Hookup LEDs & Buttons */ dns323_gpio_leds.dev.platform_data = &dns323c_led_data; dns323_button_device.dev.platform_data = &dns323c_button_data; /* Hookup i2c devices and fan driver */ i2c_register_board_info(0, dns323c_i2c_devices, ARRAY_SIZE(dns323c_i2c_devices)); platform_device_register_simple("dns323c-fan", 0, NULL, 0); /* Register fixup for the PHY LEDs */ phy_register_fixup_for_uid(MARVELL_PHY_ID_88E1118, MARVELL_PHY_ID_MASK, dns323c_phy_fixup); } platform_device_register(&dns323_gpio_leds); platform_device_register(&dns323_button_device); /* * Configure peripherals. */ if (dns323_read_mac_addr() < 0) printk("DNS-323: Failed to read MAC address\n"); orion5x_ehci0_init(); orion5x_eth_init(&dns323_eth_data); orion5x_i2c_init(); orion5x_uart0_init(); /* Remaining GPIOs */ switch(system_rev) { case DNS323_REV_A1: /* Poweroff GPIO */ if (gpio_request(DNS323_GPIO_POWER_OFF, "POWEROFF") != 0 || gpio_direction_output(DNS323_GPIO_POWER_OFF, 0) != 0) pr_err("DNS-323: failed to setup power-off GPIO\n"); pm_power_off = dns323a_power_off; break; case DNS323_REV_B1: /* 5182 built-in SATA init */ orion5x_sata_init(&dns323_sata_data); /* The DNS323 rev B1 has flag to indicate the system is up. * Without this flag set, power LED will flash and cannot be * controlled via leds-gpio. */ if (gpio_request(DNS323_GPIO_SYSTEM_UP, "SYS_READY") == 0) gpio_direction_output(DNS323_GPIO_SYSTEM_UP, 1); /* Poweroff GPIO */ if (gpio_request(DNS323_GPIO_POWER_OFF, "POWEROFF") != 0 || gpio_direction_output(DNS323_GPIO_POWER_OFF, 0) != 0) pr_err("DNS-323: failed to setup power-off GPIO\n"); pm_power_off = dns323b_power_off; break; case DNS323_REV_C1: /* 5182 built-in SATA init */ orion5x_sata_init(&dns323_sata_data); /* Poweroff GPIO */ if (gpio_request(DNS323C_GPIO_POWER_OFF, "POWEROFF") != 0 || gpio_direction_output(DNS323C_GPIO_POWER_OFF, 0) != 0) pr_err("DNS-323: failed to setup power-off GPIO\n"); pm_power_off = dns323c_power_off; /* Now, -this- should theorically be done by the sata_mv driver * once I figure out what's going on there. Maybe the behaviour * of the LEDs should be somewhat passed via the platform_data. * for now, just whack the register and make the LEDs happy * * Note: AFAIK, rev B1 needs the same treatement but I'll let * somebody else test it. */ writel(0x5, ORION5X_SATA_VIRT_BASE | 0x2c); break; } }
static int sabrelite_coredevices_init(void) { phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, ksz9021rn_phy_fixup); return 0; }