From 68b5d34f69421264de6e5d77760fcc2bfe9ee687 Mon Sep 17 00:00:00 2001 From: Mantas Pucka Date: Mon, 8 May 2017 13:28:38 +0300 Subject: ar71xx: add support for 8devices Rambutan development board Rambutan is a Wifi module based on QCA9550/9557 http://www.8devices.com/products/rambutan This commit adds basic support for Rambutan development kit Specification: - 720/600/200 MHz (CPU/DDR/AHB) - 128 MB of DDR2 RAM - 128 MB of NAND Flash - 1x 100Mbps Ethernet - 1x 1000Mbps Ethernet (PHY on dev-kit) - 1x Wifi radio 2x2 MIMO, dualband 2.4 and 5 GHz - 2x U.FL connectors on module, chip antennas on dev-kit - 1x miniPCIe slot - 1x USB2.0 host socket + 1x USB2.0 pins on 2.54mm header Flash instructions: Stock firmware is OpenWrt, so use: sysupgrade -n /tmp/lede-ar71xx-nand-rambutan-squashfs-sysupgrade.tar or upgarde from GUI (don't save config) Use factory image to flash from U-Boot: tftpboot 80060000 lede-ar71xx-nand-rambutan-squashfs-factory.ubi nand erase.part ubi nand write 80060000 ubi ${filesize} Signed-off-by: Mantas Pucka [split support in uboot-envtools package into a separate commit, fixed alphabetical order in lib/preinit/05_set_iface_mac_ar71xx] Signed-off-by: Piotr Dymacz --- .../ar71xx/files/arch/mips/ath79/mach-rambutan.c | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-rambutan.c (limited to 'target/linux/ar71xx/files/arch/mips/ath79/mach-rambutan.c') diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rambutan.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rambutan.c new file mode 100644 index 0000000000..103aeb44b9 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rambutan.c @@ -0,0 +1,90 @@ +/* + * 8devices Rambutan board support + * + * Copyright (C) 2017 Mantas Pucka + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include "common.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-spi.h" +#include "dev-nfc.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" +#include "pci.h" + +static struct at803x_platform_data rambutan_ar8032_data = { + .has_reset_gpio = 1, + .reset_gpio = 17, +}; + +static struct mdio_board_info rambutan_mdio0_info[] = { + { + .bus_id = "ag71xx-mdio.0", + .phy_addr = 0, + .platform_data = &rambutan_ar8032_data, + }, +}; + +static struct at803x_platform_data rambutan_ar8033_data = { + .has_reset_gpio = 1, + .reset_gpio = 23, +}; + +static struct mdio_board_info rambutan_mdio1_info[] = { + { + .bus_id = "ag71xx-mdio.1", + .phy_addr = 0, + .platform_data = &rambutan_ar8033_data, + }, +}; + +static void __init rambutan_setup(void) +{ + ath79_nfc_set_ecc_mode(AR934X_NFC_ECC_HW); + ath79_register_nfc(); + ath79_register_usb(); + ath79_register_pci(); + ath79_register_wmac_simple(); + + mdiobus_register_board_info(rambutan_mdio0_info, + ARRAY_SIZE(rambutan_mdio0_info)); + mdiobus_register_board_info(rambutan_mdio1_info, + ARRAY_SIZE(rambutan_mdio1_info)); + ath79_register_mdio(0, 0x0); + ath79_register_mdio(1, 0x0); + + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(0); + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_register_eth(0); + + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; + ath79_eth1_data.phy_mask = BIT(0); + ath79_eth1_data.mii_bus_dev = &ath79_mdio1_device.dev; + ath79_eth1_pll_data.pll_1000 = 0x17000000; + ath79_eth1_pll_data.pll_10 = 0x1313; + ath79_register_eth(1); +} + +MIPS_MACHINE(ATH79_MACH_RAMBUTAN, "RAMBUTAN", "8devices Rambutan board", + rambutan_setup); + -- cgit v1.2.3