Exemplo n.º 1
0
/*
 * Init the mAP hardware.
 * The mAP 2nD has two ethernet ports, PoE output, SSR for LED
 * multiplexing and USB port.
 */
static void __init rbmap_setup(void)
{
	u32 flags = RBSPI_HAS_USB | RBSPI_HAS_WLAN0 |
			RBSPI_HAS_SSR | RBSPI_HAS_POE;

	if (!rbspi_platform_setup())
		return;

	rbspi_spi_cs_gpios[1] = RBMAP_GPIO_SSR_CS;
	rbspi_peripherals_setup(flags);

	/* GMAC1 is HW MAC, WLAN0 MAC is HW MAC + 2 */
	rbspi_network_setup(flags, 0, 2, 0);

	if (flags & RBSPI_HAS_POE)
		gpio_request_one(RBMAP_GPIO_POE_POWER,
				GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED,
				"POE power");

	if (flags & RBSPI_HAS_USB)
		gpio_request_one(RBMAP_GPIO_USB_PWROFF,
				GPIOF_OUT_INIT_HIGH | GPIOF_ACTIVE_LOW |
					GPIOF_EXPORT_DIR_FIXED,
				"USB power off");

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

	/* mAP 2nD has a single reset button as gpio 16 */
	rbspi_register_reset_button(RBMAP_GPIO_BTN_RESET);
}
Exemplo n.º 2
0
/*
 * The hAP, hAP ac lite, hEX lite and hEX PoE lite share the same platform
 */
static void __init rbspi_952_750r2_setup(u32 flags)
{
	if (flags & RBSPI_HAS_SSR)
		rbspi_spi_cs_gpios[1] = RB952_GPIO_SSR_CS;

	rbspi_peripherals_setup(flags);

	/*
	 * GMAC1 is HW MAC + 1, WLAN0 MAC IS HW MAC + 5 (hAP),
	 * WLAN1 MAC IS HW MAC + 6 (hAP ac lite)
	 */
	rbspi_network_setup(flags, 1, 5, 6);

	if (flags & RBSPI_HAS_USB)
		gpio_request_one(RB952_GPIO_USB_PWROFF, GPIOF_ACTIVE_LOW |
				GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
				"USB power off");

	if (flags & RBSPI_HAS_POE)
		gpio_request_one(RB952_GPIO_POE_POWER,
				GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
				"POE power");

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

	/* These devices have a single reset button as gpio 16 */
	rbspi_register_reset_button(RB952_GPIO_BTN_RESET);
}
Exemplo n.º 3
0
/*
 * The hAP, hEX lite and hEX PoE lite share the same platform
 */
static void __init rbspi_952_750r2_setup(u32 flags)
{
	if (flags & RBSPI_HAS_SSR)
		rbspi_spi_cs_gpios[1] = RB952_GPIO_SSR_CS;

	rbspi_peripherals_setup(flags);

	/* GMAC1 is HW MAC + 1, WLAN MAC IS HW MAC + 5 */
	rbspi_network_setup(flags, 1, 5);

	if (flags & RBSPI_HAS_USB)
		gpio_request_one(RB952_GPIO_USB_POWER,
				GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
				"USB power");

	if (flags & RBSPI_HAS_POE)
		gpio_request_one(RB952_GPIO_POE_POWER,
				GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
				"POE power");

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

	/* These devices have a single reset button as gpio 16 */
	ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(rbspi_gpio_keys_reset16),
					rbspi_gpio_keys_reset16);
}
Exemplo n.º 4
0
/*
 * Init the wAP hardware (EXPERIMENTAL).
 * The wAP 2nD has a single ethernet port.
 */
static void __init rbwap_setup(void)
{
	u32 flags = RBSPI_HAS_WLAN;

	if (rbspi_platform_setup())
		return;

	rbspi_peripherals_setup(flags);

	/* GMAC1 is HW MAC, WLAN MAC is HW MAC + 1 */
	rbspi_network_setup(flags, 0, 1);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(rbwap_leds), rbwap_leds);
}
Exemplo n.º 5
0
/*
 * Init the LHG hardware (AR9344).
 * The LHG 5nD has a single ethernet port connected to PHY0.
 * Wireless is provided via 5GHz WLAN1.
 */
static void __init rblhg_setup(void)
{
	u32 flags = RBSPI_HAS_WLAN1 | RBSPI_HAS_MDIO1;

	if (!rbspi_platform_setup())
		return;

	rbspi_peripherals_setup(flags);

	/* GMAC1 is HW MAC, WLAN1 MAC is HW MAC + 1 */
	rbspi_network_setup(flags, 0, 0, 1);

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

	rbspi_register_reset_button(RBLHG_GPIO_BTN_RESET);
}
Exemplo n.º 6
0
/*
 * Init the hAP lite hardware (QCA953x).
 * The 941-2nD (hAP lite) has 4 ethernet ports, with port 2-4
 * being assigned to LAN on the casing, and port 1 being assigned
 * to "internet" (WAN) on the casing. Port 1 is connected to PHY3.
 * Since WAN is neither PHY0 nor PHY4, we cannot use GMAC0 with this device.
 */
static void __init rbhapl_setup(void)
{
	u32 flags = RBSPI_HAS_WLAN0;

	if (!rbspi_platform_setup())
		return;

	rbspi_peripherals_setup(flags);

	/* GMAC1 is HW MAC, WLAN0 MAC is HW MAC + 4 */
	rbspi_network_setup(flags, 0, 4, 0);

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

	/* hAP lite has a single reset button as gpio 16 */
	rbspi_register_reset_button(RBHAPL_GPIO_BTN_RESET);
}
Exemplo n.º 7
0
/*
 * Init the wAP hardware.
 * The wAP 2nD has a single ethernet port.
 */
static void __init rbwap_setup(void)
{
	u32 flags = RBSPI_HAS_WLAN0;

	if (!rbspi_platform_setup())
		return;

	rbspi_peripherals_setup(flags);

	/* GMAC1 is HW MAC, WLAN0 MAC is HW MAC + 1 */
	rbspi_network_setup(flags, 0, 1, 0);

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

	/* wAP has a single reset button as GPIO 16 */
	rbspi_register_reset_button(RBWAP_GPIO_BTN_RESET);
}
Exemplo n.º 8
0
/*
 * Init the cAP hardware (EXPERIMENTAL).
 * The cAP 2nD has a single ethernet port, and a global LED switch.
 */
static void __init rbcap_setup(void)
{
	u32 flags = RBSPI_HAS_WLAN0;

	if (!rbspi_platform_setup())
		return;

	rbspi_peripherals_setup(flags);

	/* GMAC1 is HW MAC, WLAN0 MAC is HW MAC + 1 */
	rbspi_network_setup(flags, 0, 1, 0);

	gpio_request_one(RBCAP_GPIO_LED_ALL,
			 GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
			 "LEDs enable");

	ath79_register_leds_gpio(-1, ARRAY_SIZE(rbcap_leds), rbcap_leds);
}
Exemplo n.º 9
0
/*
 * Init the hAP mini hardware (QCA953x).
 * The 931-2nD (hAP mini) has 3 ethernet ports, with port 2-3
 * being assigned to LAN on the casing, and port 1 being assigned
 * to "internet" (WAN) on the casing. Port 1 is connected to PHY2.
 * Since WAN is neither PHY0 nor PHY4, we cannot use GMAC0 with this device.
 */
static void __init rb931_setup(void)
{
	u32 flags = RBSPI_HAS_WLAN0;

	if (!rbspi_platform_setup())
		return;

	rbspi_peripherals_setup(flags);

	/* GMAC1 is HW MAC, WLAN0 MAC is HW MAC + 3 */
	rbspi_network_setup(flags, 0, 3, 0);

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

	/* hAP mini has two buttons */
	ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(rb931_gpio_keys),
					rb931_gpio_keys);
}
Exemplo n.º 10
0
/*
 * Init the hAP lite hardware.
 * The 941-2nD (hAP lite) has 4 ethernet ports, with port 2-4
 * being assigned to LAN on the casing, and port 1 being assigned
 * to "internet" (WAN) on the casing. Port 1 is connected to PHY3.
 * Since WAN is neither PHY0 nor PHY4, we cannot use GMAC0 with this device.
 */
static void __init rbhapl_setup(void)
{
	u32 flags = RBSPI_HAS_WLAN;

	if (rbspi_platform_setup())
		return;

	rbspi_peripherals_setup(flags);

	/* GMAC1 is HW MAC, WLAN MAC is HW MAC + 4 */
	rbspi_network_setup(flags, 0, 4);

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

	/* hAP lite has a single reset button as gpio 16 */
	ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(rbspi_gpio_keys_reset16),
					rbspi_gpio_keys_reset16);
}
Exemplo n.º 11
0
/*
 * Init the mAP hardware (EXPERIMENTAL).
 * The mAP 2nD has two ethernet ports, PoE output and an SSR for LED
 * multiplexing.
 */
static void __init rbmap_setup(void)
{
	u32 flags = RBSPI_HAS_WLAN | RBSPI_HAS_SSR | RBSPI_HAS_POE;

	if (rbspi_platform_setup())
		return;

	rbspi_spi_cs_gpios[1] = RBMAP_GPIO_SSR_CS;
	rbspi_peripherals_setup(flags);

	/* GMAC1 is HW MAC, WLAN MAC is HW MAC + 2 */
	rbspi_network_setup(flags, 0, 2);

	if (flags & RBSPI_HAS_POE)
		gpio_request_one(RBMAP_GPIO_POE_POWER,
				GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
				"POE power");

	ath79_register_leds_gpio(-1, ARRAY_SIZE(rbmap_leds), rbmap_leds);
}
Exemplo n.º 12
0
/*
 * Init the mAP lite hardware (QCA953x).
 * The mAP L-2nD (mAP lite) has a single ethernet port, connected to PHY0.
 * Trying to use GMAC0 in direct mode was unsucessful, so we're
 * using SW_ONLY_MODE, which connects PHY0 to MAC1 on the internal
 * switch, which is connected to GMAC1 on the SoC. GMAC0 is unused.
 */
static void __init rbmapl_setup(void)
{
	u32 flags = RBSPI_HAS_WLAN0;

	if (!rbspi_platform_setup())
		return;

	rbspi_peripherals_setup(flags);

	/* GMAC1 is HW MAC, WLAN0 MAC is HW MAC + 1 */
	rbspi_network_setup(flags, 0, 1, 0);

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

	/* mAP lite has a single reset button as gpio 16 */
	rbspi_register_reset_button(RBMAPL_GPIO_BTN_RESET);

	/* clear internal multiplexing */
	ath79_gpio_output_select(RBMAPL_GPIO_LED_ETH, AR934X_GPIO_OUT_GPIO);
	ath79_gpio_output_select(RBMAPL_GPIO_LED_POWER, AR934X_GPIO_OUT_GPIO);
}
Exemplo n.º 13
0
/* 
 * Init the mAP lite hardware.
 * The mAP L-2nD (mAP lite) has a single ethernet port, connected to PHY0.
 * Trying to use GMAC0 in direct mode was unsucessful, so we're
 * using SW_ONLY_MODE, which connects PHY0 to MAC1 on the internal
 * switch, which is connected to GMAC1 on the SoC. GMAC0 is unused.
 */
static void __init rbmapl_setup(void)
{
	u32 flags = RBSPI_HAS_WLAN;

	if (rbspi_platform_setup())
		return;

	rbspi_peripherals_setup(flags);

	/* GMAC1 is HW MAC, WLAN MAC is HW MAC + 1 */
	rbspi_network_setup(flags, 0, 1);

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

	/* mAP lite has a single reset button as gpio 16 */
	ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
					ARRAY_SIZE(rbspi_gpio_keys_reset16),
					rbspi_gpio_keys_reset16);

	/* clear internal multiplexing */
	ath79_gpio_output_select(RBMAPL_GPIO_LED_ETH, AR934X_GPIO_OUT_GPIO);
	ath79_gpio_output_select(RBMAPL_GPIO_LED_POWER, AR934X_GPIO_OUT_GPIO);
}
Exemplo n.º 14
0
/*
 * Init the wAP R hardware.
 * The wAP R-2nD has a single ethernet port and a mini PCIe slot.
 * The OEM source shows it has usb (used over PCIe for LTE devices),
 * and the 'control' GPIO is assumed to be an output pin not tied to an LED.
 */
static void __init rbwapr_setup(void)
{
	u32 flags = RBSPI_HAS_WLAN0 | RBSPI_HAS_USB | RBSPI_HAS_PCI;

	if (!rbspi_platform_setup())
		return;

	rbspi_peripherals_setup(flags);

	/* GMAC1 is HW MAC, WLAN0 MAC is HW MAC + 1 */
	rbspi_network_setup(flags, 0, 1, 0);

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

	gpio_request_one(RBWAPR_GPIO_PCIE_PWROFF, GPIOF_OUT_INIT_HIGH |
			GPIOF_ACTIVE_LOW | GPIOF_EXPORT_DIR_FIXED,
			"PCIE power off");

	gpio_request_one(RBWAPR_GPIO_CONTROL, GPIOF_OUT_INIT_LOW |
			GPIOF_ACTIVE_LOW | GPIOF_EXPORT_DIR_FIXED,
			"control");

	rbspi_register_reset_button(RBWAPR_GPIO_BTN_RESET);
}