Ejemplo n.º 1
0
static void __init rb750_setup(void)
{
	ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				     AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				     AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				     AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				     AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 1);

	ath79_register_mdio(0, 0x0);

	/* LAN ports */
	ath79_register_eth(1);

	/* WAN port */
	ath79_register_eth(0);

	rb750_leds_data.num_leds = ARRAY_SIZE(rb750_leds);
	rb750_leds_data.leds = rb750_leds;
	rb750_leds_data.latch_change = rb750_latch_change;
	platform_device_register(&rb750_leds_device);

	rb750_nand_data.nce_line = RB750_NAND_NCE;
	rb750_nand_data.enable_pins = rb750_nand_enable_pins;
	rb750_nand_data.disable_pins = rb750_nand_disable_pins;
	rb750_nand_data.latch_change = rb750_latch_change;
	platform_device_register(&rb750_nand_device);
}
Ejemplo n.º 2
0
static void __init MK5_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

		/* Disable hardware control LAN1 and LAN2 LEDs, enabling GPIO14 and GPIO15 */
	ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
		AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
		AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
		AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(MK5_leds_gpio),
		MK5_leds_gpio);

	ath79_register_gpio_keys_polled(-1, MK5_KEYS_POLL_INTERVAL,
		ARRAY_SIZE(MK5_gpio_keys),
		MK5_gpio_keys);


	ath79_register_usb();

	ath79_register_m25p80(&MK5_flash_data);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);


	ath79_register_mdio(0, 0x0);
	ath79_register_eth(0);

	ath79_register_wmac(ee, mac);
}
Ejemplo n.º 3
0
static void __init zcn_1523h_generic_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f7e0004);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

	ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	ath79_register_m25p80(NULL);

	ath79_register_leds_gpio(0, ARRAY_SIZE(zcn_1523h_leds_gpio),
					zcn_1523h_leds_gpio);

	ath79_register_gpio_keys_polled(-1, ZCN_1523H_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(zcn_1523h_gpio_keys),
					zcn_1523h_gpio_keys);

	ap91_pci_init(ee, mac);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1);

	ath79_register_mdio(0, 0x0);

	/* LAN1 port */
	ath79_register_eth(0);
}
Ejemplo n.º 4
0
static void __init carambola2_common_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);

	/* Disable UART, enabling GPIO 9 and GPIO 10 */
	ath79_gpio_function_disable(AR933X_GPIO_FUNC_UART_EN);
	/* Enabling internal CS1, disable GPIO 9 */
	ath79_gpio_function_enable(AR933X_GPIO_FUNC_SPI_CS_EN1);

	ath79_register_m25p80i_multi(NULL);
	ath79_register_wmac(art + CARAMBOLA2_CALDATA_OFFSET,
			    art + CARAMBOLA2_WMAC_MAC_OFFSET);

	ath79_setup_ar933x_phy4_switch(true, true);

	ath79_init_mac(ath79_eth0_data.mac_addr, art + CARAMBOLA2_MAC0_OFFSET, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, art + CARAMBOLA2_MAC1_OFFSET, 0);

	ath79_register_mdio(0, 0x0);

	/* LAN ports */
	ath79_register_eth(1);

	/* WAN port */
	ath79_register_eth(0);

	// spi_register_board_info(ath79_spi_info, ARRAY_SIZE(ath79_spi_info));
}
Ejemplo n.º 5
0
static void __init som9331_setup(void)
{
    u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
    u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

    ath79_setup_ar933x_phy4_switch(true, true);

    ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
                    AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
                    AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
                    AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
                    AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

    ath79_register_m25p80(&som9331_flash_data);
    ath79_register_leds_gpio(-1, ARRAY_SIZE(som9331_leds_gpio),
                 som9331_leds_gpio);
    ath79_register_gpio_keys_polled(-1, SOM9331_KEYS_POLL_INTERVAL,
                    ARRAY_SIZE(som9331_gpio_keys),
                    som9331_gpio_keys);

    ath79_register_usb();

    ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
    ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);

    ath79_register_mdio(0, 0x0);

    /* LAN ports */
    ath79_register_eth(1);

    /* WAN port */
    ath79_register_eth(0);

    ath79_register_wmac(ee, mac);
}
Ejemplo n.º 6
0
static void __init om2p_setup(void)
{
	u8 *mac1 = (u8 *)KSEG1ADDR(0x1ffc0000);
	u8 *mac2 = (u8 *)KSEG1ADDR(0x1ffc0000 + ETH_ALEN);
	u8 *ee = (u8 *)KSEG1ADDR(0x1ffc1000);

	ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	ath79_register_m25p80(&om2p_flash_data);

	ath79_register_mdio(0, ~OM2P_WAN_PHYMASK);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);

	ath79_register_eth(0);
	ath79_register_eth(1);

	ap91_pci_init(ee, NULL);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(om2p_leds_gpio),
				 om2p_leds_gpio);

	ath79_register_gpio_keys_polled(-1, OM2P_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(om2p_gpio_keys),
					om2p_gpio_keys);
}
Ejemplo n.º 7
0
static void __init whrhpg300n_setup(void)
{
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
	u8 *mac = (u8 *) KSEG1ADDR(ee + WHRHPG300N_MAC_OFFSET);

	ath79_register_m25p80(NULL);

	ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(whrhpg300n_leds_gpio),
				 whrhpg300n_leds_gpio);

	ath79_register_gpio_keys_polled(-1, WHRHPG300N_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(whrhpg300n_gpio_keys),
					whrhpg300n_gpio_keys);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1);

	ath79_register_mdio(0, 0x0);

	/* LAN ports */
	ath79_register_eth(1);
	/* WAN port */
	ath79_register_eth(0);

	ap9x_pci_setup_wmac_led_pin(0, 1);

	ap91_pci_init(ee, mac);
}
Ejemplo n.º 8
0
static void __init common_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee = ath79_get_eeprom();

	/* Disable hardware control LAN1 and LAN2 LEDs, enabling GPIO14 and GPIO15 */
	ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				    AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN);

	/* disable PHY_SWAP and PHY_ADDR_SWAP bits */
	ath79_setup_ar933x_phy4_switch(false, false);

	ath79_register_m25p80(&tl_mr11u_flash_data);
	ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_mr11u_leds_gpio),
				 tl_mr11u_leds_gpio);

	ath79_register_usb();

	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);

	ath79_register_mdio(0, 0x0);
	ath79_register_eth(0);

	ath79_register_wmac(ee, mac);
}
Ejemplo n.º 9
0
static void __init tl_wa901nd_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
	u8 *ee  = (u8 *) KSEG1ADDR(0x1fff1000);

	ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	/*
	 * ath79_eth0 would be the WAN port, but is not connected on
	 * the TL-WA901ND. ath79_eth1 connects to the internal switch chip,
	 * however we have a single LAN port only.
	 */
	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
	ath79_register_mdio(0, 0x0);
	ath79_register_eth(1);

	ath79_register_m25p80(&tl_wa901nd_flash_data);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wa901nd_leds_gpio),
				 tl_wa901nd_leds_gpio);

	ath79_register_gpio_keys_polled(-1, TL_WA901ND_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(tl_wa901nd_gpio_keys),
					tl_wa901nd_gpio_keys);

	ap91_pci_init(ee, mac);
}
Ejemplo n.º 10
0
static void __init ds_setup(void)
{
	u32 t;

	ds_common_setup();

	ath79_register_leds_gpio(-1, ARRAY_SIZE(ds_leds_gpio),
				 ds_leds_gpio);
	ath79_register_gpio_keys_polled(-1, DS_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(ds_gpio_keys),
					ds_gpio_keys);
	ath79_register_usb();

	/* use the swtich_led directly form sysfs */
	ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
								AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
								AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
								AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
								AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	//Disable the Function for some pins to have GPIO functionality active
	// GPIO6-7-8 and GPIO11
	ath79_gpio_function_setup(AR933X_GPIO_FUNC_JTAG_DISABLE | AR933X_GPIO_FUNC_I2S_MCK_EN, 0);

	ath79_gpio_function2_setup(AR933X_GPIO_FUNC2_JUMPSTART_DISABLE, 0);

	printk("Setting DogStick2 GPIO\n");

	t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP);
	t |= AR933X_BOOTSTRAP_MDIO_GPIO_EN;
	ath79_reset_wr(AR933X_RESET_REG_BOOTSTRAP, t);

	// Put the avr reset to high 
	if (gpio_request_one(DS_GPIO_AVR_RESET_DS2,
	    GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, "OE-1") != 0)
		printk("Error setting GPIO OE\n");
	gpio_unexport(DS_GPIO_AVR_RESET_DS2);
	gpio_free(DS_GPIO_AVR_RESET_DS2);

	// enable OE of level shifter
	if (gpio_request_one(DS_GPIO_OE,
	    GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, "OE-1") != 0)
		printk("Error setting GPIO OE\n");

	if (gpio_request_one(DS_GPIO_UART_ENA,
	    GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, "UART-ENA") != 0)
		printk("Error setting GPIO Uart Enable\n");

	// enable OE of level shifter
	if (gpio_request_one(DS_GPIO_OE2,
	    GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, "OE-2") != 0)
		printk("Error setting GPIO OE2\n");
}
Ejemplo n.º 11
0
static void __init carambola2_setup(void)
{
	carambola2_common_setup();

	ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(carambola2_leds_gpio),
				 carambola2_leds_gpio);
	ath79_register_gpio_keys_polled(-1, CARAMBOLA2_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(carambola2_gpio_keys),
					carambola2_gpio_keys);
	ath79_register_usb();
}
Ejemplo n.º 12
0
static void __init hornet_ub_gpio_setup(void)
{
	u32 t;

	ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				     AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				     AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				     AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				     AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP);
	t |= AR933X_BOOTSTRAP_MDIO_GPIO_EN;
	ath79_reset_wr(AR933X_RESET_REG_BOOTSTRAP, t);

	ath79_set_usb_power_gpio(HORNET_UB_GPIO_USB_POWER, GPIOF_OUT_INIT_HIGH,
				"USB power");
}
Ejemplo n.º 13
0
static void __init om2p_lc_setup(void)
{
	u8 *mac1 = (u8 *)KSEG1ADDR(0x1ffc0000);
	u8 *mac2 = (u8 *)KSEG1ADDR(0x1ffc0000 + ETH_ALEN);
	u8 *art = (u8 *)KSEG1ADDR(0x1ffc1000);
	u32 t;

	ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				    AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				    AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				    AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				    AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP);
	t |= AR933X_BOOTSTRAP_MDIO_GPIO_EN;
	ath79_reset_wr(AR933X_RESET_REG_BOOTSTRAP, t);

	ath79_register_m25p80(&om2p_lc_flash_data);

	om2p_leds_gpio[0].gpio = OM2P_LC_GPIO_LED_POWER;
	om2p_leds_gpio[1].gpio = OM2P_LC_GPIO_LED_RED;
	om2p_leds_gpio[2].gpio = OM2P_LC_GPIO_LED_YELLOW;
	om2p_leds_gpio[3].gpio = OM2P_LC_GPIO_LED_GREEN;
	om2p_leds_gpio[4].gpio = OM2P_LC_GPIO_LED_LAN;
	om2p_leds_gpio[5].gpio = OM2P_LC_GPIO_LED_WAN;
	ath79_register_leds_gpio(-1, ARRAY_SIZE(om2p_leds_gpio),
				 om2p_leds_gpio);

	om2p_gpio_keys[0].gpio = OM2P_LC_GPIO_BTN_RESET;
	ath79_register_gpio_keys_polled(-1, OM2P_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(om2p_gpio_keys),
					om2p_gpio_keys);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);

	ath79_register_mdio(0, 0x0);

	ath79_register_eth(0);
	ath79_register_eth(1);

	ath79_register_wmac(art, NULL);
}
Ejemplo n.º 14
0
static void __init cf_e380ac_v1v2_common_setup(unsigned long art_ofs)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f000000 + art_ofs);

	cf_exxxn_common_setup(art_ofs, CF_E380AC_V1V2_GPIO_EXT_WDT);

	ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN);

	ath79_register_mdio(0, 0x0);
	mdiobus_register_board_info(cf_e380ac_v1v2_mdio0_info,
				    ARRAY_SIZE(cf_e380ac_v1v2_mdio0_info));

	/* LAN */
	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ath79_eth0_data.phy_mask = BIT(0);
	ath79_eth0_pll_data.pll_1000 = 0xbe000000;
	ath79_eth0_pll_data.pll_100 = 0xb0000101;
	ath79_eth0_pll_data.pll_10 = 0xb0001313;
	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
	ath79_register_eth(0);

	ap91_pci_init(mac + 0x5000, NULL);

	/* Disable JTAG (enables GPIO0-3) */
	ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);

	ath79_gpio_direction_select(CF_E380AC_V1V2_GPIO_LED_LAN, true);
	ath79_gpio_direction_select(CF_E380AC_V1V2_GPIO_LED_WLAN2G, true);
	ath79_gpio_direction_select(CF_E380AC_V1V2_GPIO_LED_WLAN5G, true);

	ath79_gpio_output_select(CF_E380AC_V1V2_GPIO_LED_LAN, 0);
	ath79_gpio_output_select(CF_E380AC_V1V2_GPIO_LED_WLAN2G, 0);
	ath79_gpio_output_select(CF_E380AC_V1V2_GPIO_LED_WLAN5G, 0);

	/* For J7-4 */
	ath79_gpio_function_disable(AR934X_GPIO_FUNC_CLK_OBS4_EN);

	ath79_register_gpio_keys_polled(-1, CF_EXXXN_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(cf_e380ac_v1v2_gpio_keys),
					cf_e380ac_v1v2_gpio_keys);
}
Ejemplo n.º 15
0
static void __init dir_600_a1_setup(void)
{
	const char *nvram = (char *) KSEG1ADDR(DIR_600_A1_NVRAM_ADDR);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
	u8 mac_buff[6];
	u8 *mac = NULL;

	if (ath79_nvram_parse_mac_addr(nvram, DIR_600_A1_NVRAM_SIZE,
				       "lan_mac=", mac_buff) == 0) {
		ath79_init_mac(ath79_eth0_data.mac_addr, mac_buff, 0);
		ath79_init_mac(ath79_eth1_data.mac_addr, mac_buff, 1);
		mac = mac_buff;
	}

	ath79_register_m25p80(NULL);

	ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(dir_600_a1_leds_gpio),
				 dir_600_a1_leds_gpio);

	ath79_register_gpio_keys_polled(-1, DIR_600_A1_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(dir_600_a1_gpio_keys),
					dir_600_a1_gpio_keys);

	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1);

	ath79_register_mdio(0, 0x0);

	/* LAN ports */
	ath79_register_eth(1);

	/* WAN port */
	ath79_register_eth(0);

	ap91_pci_init(ee, mac);
}
Ejemplo n.º 16
0
static void __init tl_wa901nd_setup(void)
{
	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);

	ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				    AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	common_setup();

	ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wa901nd_leds_gpio),
				 tl_wa901nd_leds_gpio);

	ath79_register_gpio_keys_polled(-1, TL_WA901ND_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(tl_wa901nd_gpio_keys),
					tl_wa901nd_gpio_keys);

    tplink_register_ap91_wmac1(0x1000, mac, 0);
}
Ejemplo n.º 17
0
static void __init weio_setup(void)
{
	weio_common_setup();

	ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	platform_device_register(&weio_i2c_gpio);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(weio_leds_gpio),
				weio_leds_gpio);

	ath79_register_gpio_keys_polled(-1, WEIO_KEYS_POLL_INTERVAL,
				ARRAY_SIZE(weio_gpio_keys),
				weio_gpio_keys);

	ath79_register_usb();
}
Ejemplo n.º 18
0
static void __init dir_505_a1_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(DIR_505A1_ART_ADDRESS);
	u8 lan_mac[ETH_ALEN];
	u8 wan_mac[ETH_ALEN];

	ath79_setup_ar933x_phy4_switch(false, false);

	ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
		AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
		AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
		AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
		AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	gpio_request_one(DIR_505A1_GPIO_WAN_LED_ENABLE,
		GPIOF_OUT_INIT_LOW, "WAN LED enable");

	ath79_register_leds_gpio(-1, ARRAY_SIZE(dir_505_a1_leds_gpio),
		dir_505_a1_leds_gpio);

	ath79_register_gpio_keys_polled(1, DIR_505A1_KEYS_POLL_INTERVAL,
		ARRAY_SIZE(dir_505_a1_gpio_keys),
		dir_505_a1_gpio_keys);

	ath79_register_m25p80(NULL);

	ath79_register_usb();

	dir_505_a1_read_ascii_mac(lan_mac, DIR_505A1_LAN_MAC_ADDRESS);
	dir_505_a1_read_ascii_mac(wan_mac, DIR_505A1_WAN_MAC_ADDRESS);

	ath79_init_mac(ath79_eth0_data.mac_addr, wan_mac, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, lan_mac, 0);

	ath79_register_mdio(0, 0x0);
	ath79_register_eth(1);
	ath79_register_eth(0);

	ath79_register_wmac(art + DIR_505A1_CALDATA_OFFSET, lan_mac);
}
Ejemplo n.º 19
0
static void __init ds_setup(void)
{
	u32 t=0;

	ds_common_setup();

	ath79_register_leds_gpio(-1, ARRAY_SIZE(ds_leds_gpio), ds_leds_gpio);
	ath79_register_gpio_keys_polled(-1, DS_KEYS_POLL_INTERVAL,
			ARRAY_SIZE(ds_gpio_keys), ds_gpio_keys);
	ath79_register_usb();

	// use the swtich_led directly form sysfs
	ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
	                            AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
	                            AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
	                            AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN);

	/*
	 * Disable the Function for some pins to have GPIO functionality active
	 * GPIO6-7-8 and GPIO11
	 */
	ath79_gpio_function_setup(GPIO_FUNC_SET, GPIO_FUNC_CLEAR);

	ath79_gpio_function2_setup(GPIO_FUNC2_SET, GPIO_FUNC2_CLEAR);

	pr_info("mach-linino: setting GPIO\n");

	/* Enable GPIO26 instead of MDC function */
	t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP);
	t |= AR933X_BOOTSTRAP_MDIO_GPIO_EN;
	ath79_reset_wr(AR933X_RESET_REG_BOOTSTRAP, t);

	/* enable OE of level shifters */
	ds_setup_level_shifter_oe();
	/* enable uart */
	ds_setup_uart_enable();

	/* Register Software SPI controller */
	ds_register_spi();
}
Ejemplo n.º 20
0
static void __init tew_712br_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(TEW_712BR_ART_ADDRESS);
	u8 *mac = (u8 *) KSEG1ADDR(TEW_712BR_MAC_PART_ADDRESS);
	u8 lan_mac[ETH_ALEN];
	u8 wan_mac[ETH_ALEN];

	ath79_setup_ar933x_phy4_switch(false, false);

	ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				    AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				    AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				    AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				    AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	gpio_request_one(TEW_712BR_GPIO_WAN_LED_ENABLE,
			 GPIOF_OUT_INIT_LOW, "WAN LED enable");

	ath79_register_leds_gpio(-1, ARRAY_SIZE(tew_712br_leds_gpio),
				 tew_712br_leds_gpio);

	ath79_register_gpio_keys_polled(1, TEW_712BR_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(tew_712br_gpio_keys),
					tew_712br_gpio_keys);

	ath79_register_m25p80(NULL);

	ath79_parse_ascii_mac(mac + TEW_712BR_LAN_MAC_OFFSET, lan_mac);
	ath79_parse_ascii_mac(mac + TEW_712BR_WAN_MAC_OFFSET, wan_mac);

	ath79_init_mac(ath79_eth0_data.mac_addr, wan_mac, 0);
	ath79_init_mac(ath79_eth1_data.mac_addr, lan_mac, 0);

	ath79_register_mdio(0, 0x0);
	ath79_register_eth(1);
	ath79_register_eth(0);

	ath79_register_wmac(art + TEW_712BR_CALDATA_OFFSET, wan_mac);
}
Ejemplo n.º 21
0
static void __init cf_e38xac_common_setup(unsigned long art_ofs)
{
	cf_exxxn_common_setup(art_ofs, CF_E38XAC_GPIO_EXT_WDT);

	ath79_register_pci();

	/* Disable JTAG (enables GPIO0-3) */
	ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);

	ath79_gpio_direction_select(CF_E38XAC_GPIO_LED_LAN, true);
	ath79_gpio_direction_select(CF_E38XAC_GPIO_LED_WLAN2G, true);
	ath79_gpio_direction_select(CF_E38XAC_GPIO_LED_WLAN5G, true);

	ath79_gpio_output_select(CF_E38XAC_GPIO_LED_LAN, 0);
	ath79_gpio_output_select(CF_E38XAC_GPIO_LED_WLAN2G, 0);
	ath79_gpio_output_select(CF_E38XAC_GPIO_LED_WLAN5G, 0);

	/* For J7-4 */
	ath79_gpio_function_disable(AR934X_GPIO_FUNC_CLK_OBS4_EN);

	ath79_register_gpio_keys_polled(-1, CF_EXXXN_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(cf_e38xac_gpio_keys),
					cf_e38xac_gpio_keys);
}
Ejemplo n.º 22
0
static void __init ubnt_airgateway_setup(void)
{
	u32 t;
	u8 *mac0 = (u8 *) KSEG1ADDR(0x1fff0000);
	u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);


	ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
				     AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
				     AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
				     AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
				     AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);

	t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP);
	t |= AR933X_BOOTSTRAP_MDIO_GPIO_EN;
	ath79_reset_wr(AR933X_RESET_REG_BOOTSTRAP, t);

	ath79_register_m25p80(NULL);
	ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_airgateway_gpio_leds),
				 ubnt_airgateway_gpio_leds);

	ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(airgateway_gpio_keys),
					airgateway_gpio_keys);

	ath79_init_mac(ath79_eth1_data.mac_addr, mac0, 0);
	ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);

	ath79_register_mdio(0, 0x0);

	ath79_register_eth(1);
	ath79_register_eth(0);

	ath79_register_wmac(ee, NULL);
}