コード例 #1
0
static void __init wzrhpg450h_init(void)
{
	u8 *ee = (u8 *) KSEG1ADDR(0x1f051000);
	u8 *mac = (u8 *) ee + 2;

	ath79_register_m25p80_multi(&wzrhpg450h_flash_data);

	ath79_register_mdio(0, ~BIT(0));
	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ath79_eth0_data.speed = SPEED_1000;
	ath79_eth0_data.duplex = DUPLEX_FULL;
	ath79_eth0_data.phy_mask = BIT(0);

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

	ath79_register_gpio_keys_polled(-1, WZRHPG450H_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(wzrhpg450h_gpio_keys),
					wzrhpg450h_gpio_keys);

	ath79_register_eth(0);

	gpio_request_one(16, GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
			 "USB power");
	ath79_register_usb();

	ap91_pci_init(ee, NULL);
	ap9x_pci_get_wmac_data(0)->tx_gain_buffalo = true;
	ap9x_pci_get_wmac_data(1)->tx_gain_buffalo = true;
	ap9x_pci_setup_wmac_led_pin(0, 15);
	ap9x_pci_setup_wmac_leds(0, wzrhpg450h_wmac_leds_gpio,
				 ARRAY_SIZE(wzrhpg450h_wmac_leds_gpio));
}
コード例 #2
0
ファイル: dev-ap9x-pci.c プロジェクト: 3375967/openwrt
__init void ap9x_pci_setup_wmac_btns(unsigned wmac,
				     struct gpio_keys_button *btns,
				     unsigned num_btns, unsigned poll_interval)
{
	struct ath9k_platform_data *ap9x_wmac_data;

	if (!(ap9x_wmac_data = ap9x_pci_get_wmac_data(wmac)))
		return;

	ap9x_wmac_data->btns = btns;
	ap9x_wmac_data->num_btns = num_btns;
	ap9x_wmac_data->btn_poll_interval = poll_interval;
}
コード例 #3
0
ファイル: mach-mr900.c プロジェクト: Cherisher/source
static void __init mr900_setup(void)
{
    u8 *art = (u8 *)KSEG1ADDR(0x1fff0000);
    u8 mac[6], pcie_mac[6];
    struct ath9k_platform_data *pdata;

    ath79_eth0_pll_data.pll_1000 = 0xae000000;
    ath79_eth0_pll_data.pll_100 = 0xa0000101;
    ath79_eth0_pll_data.pll_10 = 0xa0001313;

    ath79_register_m25p80(NULL);

    ath79_register_leds_gpio(-1, ARRAY_SIZE(mr900_leds_gpio),
                             mr900_leds_gpio);
    ath79_register_gpio_keys_polled(-1, MR900_KEYS_POLL_INTERVAL,
                                    ARRAY_SIZE(mr900_gpio_keys),
                                    mr900_gpio_keys);

    ath79_init_mac(mac, art + MR900_MAC0_OFFSET, 1);
    ath79_register_wmac(art + MR900_WMAC_CALDATA_OFFSET, mac);
    ath79_init_mac(pcie_mac, art + MR900_MAC0_OFFSET, 16);
    ap91_pci_init(art + MR900_PCIE_CALDATA_OFFSET, pcie_mac);
    pdata = ap9x_pci_get_wmac_data(0);
    if (!pdata) {
        pr_err("mr900: unable to get address of wlan data\n");
        return;
    }
    pdata->use_eeprom = true;

    mr900_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN, 3, 3, 0, 0);
    ath79_register_mdio(0, 0x0);

    mdiobus_register_board_info(mr900_mdio0_info,
                                ARRAY_SIZE(mr900_mdio0_info));

    ath79_init_mac(ath79_eth0_data.mac_addr, art + MR900_MAC0_OFFSET, 0);

    /* GMAC0 is connected to the RMGII interface */
    ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
    ath79_eth0_data.phy_mask = BIT(5);
    ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;

    ath79_register_eth(0);
}
コード例 #4
0
ファイル: mach-rb750.c プロジェクト: 981213/openwrt
static void __init rb751_wlan_setup(void)
{
	u8 *hardconfig = (u8 *) KSEG1ADDR(RB751_HARDCONFIG);
	struct ath9k_platform_data *wmac_data;
	u16 tag_len;
	u8 *tag;
	u16 mac_len;
	u8 *mac;
	int err;

	wmac_data = ap9x_pci_get_wmac_data(0);
	if (!wmac_data) {
		pr_err("rb75x: unable to get address of wlan data\n");
		return;
	}

	ap9x_pci_setup_wmac_led_pin(0, 9);

	err = routerboot_find_tag(hardconfig, RB751_HARDCONFIG_SIZE,
				  RB_ID_WLAN_DATA, &tag, &tag_len);
	if (err) {
		pr_err("rb75x: no calibration data found\n");
		return;
	}

	err = rle_decode(tag, tag_len, (unsigned char *) wmac_data->eeprom_data,
			 sizeof(wmac_data->eeprom_data), NULL, NULL);
	if (err) {
		pr_err("rb75x: unable to decode wlan eeprom data\n");
		return;
	}

	err = routerboot_find_tag(hardconfig, RB751_HARDCONFIG_SIZE,
                                 RB_ID_MAC_ADDRESS_PACK, &mac, &mac_len);
	if (err) {
		pr_err("rb75x: no mac address found\n");
		return;
	}

	ap91_pci_init(NULL, mac);
}
コード例 #5
0
ファイル: mach-rb750.c プロジェクト: TELE-TWIN/openwrt
static void __init rb751_wlan_setup(void)
{
	u8 *hardconfig = (u8 *) KSEG1ADDR(RB751_HARDCONFIG);
	struct ath9k_platform_data *wmac_data;
	int dec_size;

	wmac_data = ap9x_pci_get_wmac_data(0);
	if (!wmac_data) {
		pr_err("rb75x: unable to get address of wlan data\n");
		return;
	}

	dec_size = decode_rle((char *) wmac_data->eeprom_data,
			      sizeof(wmac_data->eeprom_data),
			      hardconfig + RB751_CALDATA_OFFSET);
	if (dec_size != sizeof(wmac_data->eeprom_data)) {
		pr_err("rb75x: unable to decode wlan eeprom data\n");
		return;
	}

	ap91_pci_init(NULL, hardconfig + RB751_MAC_ADDRESS_OFFSET);
}