aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
Commit message (Collapse)AuthorAgeFilesLines
* ar71xx: enable SGMII fixup on Mikrotik wAP ACEtienne Champetier2019-07-161-0/+16
| | | | | | | | | | | | | | | | fixes intermittent loss of connectivity on 1Gbit port, with log message: > 803x_aneg_done: SGMII link is not ok Thanks to David Bauer for pointing me in the right direction. I just had to figure out the right bus_id, which you find in this log: > ag71xx ag71xx.1: connected to PHY at gpio-1:00 [uid=004dd074, driver=Atheros 8031 ethernet] Fixes FS#2236 Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com> [Wrapped commit message - Fixed whitespace erors] Signed-off-by: David Bauer <mail@david-bauer.net>
* ar71xx: add v4.14 supportJohn Crispin2018-08-221-1/+1
| | | | | | adds v4.14 patches for testing but leaves v4.9 as default for now. Signed-off-by: John Crispin <john@phrozen.org>
* ar71xx: improve MikroTik wAP R supportThibaut VARÈNE2018-07-301-1/+62
| | | | | | | | | | | | | 81d446b045176e3e25bb0ef74e3d060b51a0a353 introduced incomplete support for this device. This patch attempts to correct the situation based on OEM source code. LED1-3 are GSM mode on OFW (2G/3G/4G) hence unassigned here. Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org> Tested-by: David Ehrmann <ehrmann@gmail.com>
* ar71xx: rbspi: mark rb911L user led as active lowThibaut VARÈNE2018-07-301-1/+4
| | | | | | | | | | | | The active_low flag was missing for the user LED. This LED is open drain (confirmed in OEM source) and open drain only makes sense for active low GPIOs. The two wireless LEDs mentioned in the comments are also #defined for future reference. Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org> Tested-by: Ryan Mounce <ryan@mounce.com.au>
* ar71xx: rbspi: fix RB wAP AC gpio conflict and LEDThibaut VARÈNE2018-07-301-10/+7
| | | | | | | | | | | | | | | e15c63a37574bd15ce3a6636c2f04741ab76f7b9 introduced code that was trying to register GPIO 1 as both an LED and a button. The OEM source makes it clear that LED1 is not wired to the SoC GPIOs. GPIO 1 is the reset button. Furthermore the (green) power led default state should also be defined, (matching OEM source), and it should be used by diag.sh since it's currently the only software-controllable LED. This patch fixes these issues and renames the corresponding #defines for clarity Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
* ar71xx: rbspi: clarify USB power gpios actionThibaut VARÈNE2018-07-301-10/+9
| | | | | | | | | | | | | | | The gpios that control power toggle for USB on the RouterBOARD devices are active low _off_ switches. When they are active (low), power is off. When they are inactive (high), power is on. Rename GPIO defines, set gpios to GPIOF_ACTIVE_LOW for consistency and reflect their true action in the display name. This brings openwrt code in line with OEM. Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org> Tested-by: Ryan Mounce <ryan@mounce.com.au>
* ar71xx: add support for MikroTik RB931-2nDThibaut VARÈNE2018-07-161-1/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the MikroTik RB931-2nD (hAP mini): https://mikrotik.com/product/RB931-2nD Specifications: * SoC: Qualcomm QCA9533 (650MHz) * RAM: 32MiB * Storage: 16MiB SPI NOR flash * Ethernet: 3x100M * Wireless: QCA9533 built-in, dual-chain 802.11b/g/n Installation: 1. Setup a DHCP/BOOTP Server with the following parameters: * DHCP-Option 66 (TFTP server name): pointing to a local TFTP server within the same subnet of the DHCP range * DHCP-Option 67 (Bootfile-Name): matching the initramfs filename of the to be booted image. The usable intramfs files are: - openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf - openwrt-ar71xx-mikrotik-vmlinux-initramfs-lzma.elf - openwrt-ar71xx-mikrotik-rb-nor-flash-16M-initramfs-kernel.bin 2. Press the reset button on the board and keep that pressed. 3. Connect the board to your local network via its Internet port. 4. Release the button after the LEDs on the board are turned off. Now the board should load and start the initramfs image from the TFTP server. 5. Now connect the board via either of its LAN ports (2 or 3). 6. Upload the sysupgrade image to the board with scp: $ scp openwrt-ar71xx-mikrotik-rb-nor-flash-16M-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/fw.bin 7. Log in to the running system listening on 192.168.1.1 via ssh as root (without password): $ ssh root@192.168.1.1 8. Flash the uploaded firmware file from the ssh session via the sysupgrade command: root@OpenWrt:~# sysupgrade /tmp/fw.bin Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
* ar71x: add support for Mikrotik Routerboard wAP RDavid Ehrmann2018-06-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for the Mikrotik wAP R (RBwAPR-2nD). The change is based on 3b15eb0 which added support for the wAP 2nD. This change lacks LED support. Specifications: - SoC: Qualcomm QCA9531 (650 MHz) - RAM: 64 MB - Storage: 16 MB NOR SPI flash - Wireless: built-in QCA9531, 802.11b/g/n 2x2:2 - Ethernet: 1x100Mbps - Power: 9-30V Passive PoE, 9-30V DC jack, 9-30V automotive jack - SIM card slot - Mini-PCIe slot Installation: 1. Login to the Mikrotik WebUI to backup your licence key 2. Change the following settings in System->Routerboard->Settings: - Boot device: try ethernet once then NAND - Boot protocol: DHCP - Force Backup Booter: checked 3. Setup a DHCP/BOOTP server with: - DHCP-Option 66 (TFTP server name) pointing to a local TFTP server within the same subnet of the DHCP range - DHCP-Option 67 (Bootfile-Name) matching the initramfs filename of the to be booted image, e.g. openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf 4. Power off the device 5. If this is the second attempt to boot OpenWRT or the boot device isn't "try ethernet once then NAND," press and hold the reset button while powered off. If this is the first attempt, this step isn't necessary. 6. Power on the device, holding the reset button for 15-20s if already pressed from the previous step. The board should load and start the initramfs image from the TFTP server. Login as root/without password to the started OpenWRT via SSH listing on IPv4 address 192.168.1.1. Use sysupgrade to install OpenWRT. Revert to RouterOS Use the "rbcfg" package on in OpenWRT: - rbcfg set boot_protocol bootp - rbcfg set boot_device ethnand - rbcfg apply Open Netinstall and reboot routerboard. Now Netinstall sees RouterBOARD and you can install RouterOS. If NetInstall gets stuck on Sending offer just wait for it to timeout and then close and open Netinstall again. Click on install again. In order for RouterOS to function properly, you need to restore license for the device. You can do that by including license in NetInstall. Signed-off-by: David Ehrmann <ehrmann@gmail.com>
* ar71xx: add support for the MikroTik RB911-2Hn/5Hn boardsGabor Juhos2018-01-221-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch adds support for the MikroTik RB911-2Hn (911 Lite2) and the RB911-5Hn (911 Lite5) boards: https://mikrotik.com/product/RB911-2Hn https://mikrotik.com/product/RB911-5Hn The two boards are using the same hardware design, the only difference between the two is the supported wireless band. Specifications: * SoC: Atheros AR9344 (600MHz) * RAM: 64MiB * Storage: 16 MiB SPI NOR flash * Ethernet: 1x100M (Passive PoE in) * Wireless: AR9344 built-in wireless MAC, single chain 802.11b/g/n (911-2Hn) or 802.11a/g/n (911-5Hn) Notes: * Older versions of these boards might be equipped with a NAND flash chip instead of the SPI NOR device. Those boards are not supported (yet). * The MikroTik RB911-5HnD (911 Lite5 Dual) board also uses the same hardware. Support for that can be added later with little effort probably. Installation: 1. Setup a DHCP/BOOTP Server with the following parameters: * DHCP-Option 66 (TFTP server name): pointing to a local TFTP server within the same subnet of the DHCP range * DHCP-Option 67 (Bootfile-Name): matching the initramfs filename of the to be booted image. The usable intramfs files are: - openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf - openwrt-ar71xx-mikrotik-vmlinux-initramfs-lzma.elf - openwrt-ar71xx-mikrotik-rb-nor-flash-16M-initramfs-kernel.bin 2. Press the reset button on the board and keep that pressed. 3. Connect the board to your local network via its ethernet port. 4. Release the button after the LEDs on the board are turned off. Now the board should load and start the initramfs image from the TFTP server. 5. Upload the sysupgrade image to the board with scp: $ scp openwrt-ar71xx-mikrotik-rb-nor-flash-16M-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/fw.bin 5. Log in to the running system listening on 192.168.1.1 via ssh as root (without password): $ ssh root@192.168.1.1 7. Flash the uploaded firmware file from the ssh session via the sysupgrade command: root@OpenWrt:~# sysupgrade /tmp/fw.bin Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
* ar71xx: mach-rbspi: return rb_info from rbspi_platform_setupGabor Juhos2018-01-221-13/+13
| | | | | | | | | | | | Modify the rbspi_platform_setup() function to return the pointer of the rb_info structure. This allows board specific setup routines to access the various fields of the information. It is useful for investigating the hardware option bits for example. Also update the board setup codes, to ensure that those handle the new return value correctly. Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
* ar71xx: mach-rbspi: simplify reset button registrationGabor Juhos2018-01-171-64/+30
| | | | | | | | | | | | The setup code defines four individual structures for the Reset buttons of the supported boards. The only difference between the definitions is the GPIO number used for the button. Replace the different structures with one generic variant, and add a helper function to simplify the button registration. Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
* ar71xx: add support for MikroTik RouterBOARD wAP G-5HacT2HnD (wAP AC)Roger Pueyo Centelles2018-01-151-3/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the MikroTik RouterBOARD wAP G-5HacT2HnD (wAP AC), a small weatherproof dual band, dual-radio 802.11ac wireless AP with integrated omnidirectional anntennae and one 10/100/1000 Mbps Ethernet ports. See https://mikrotik.com/product/RBwAPG-5HacT2HnD for more info. Specifications: - SoC: Qualcomm Atheros QCA9556 - RAM: 64 MB - Storage: 16 MB NOR - Wireless: · Atheros AR9550 (SoC) 802.11b/g/n 2x2:2, 2 dBi antennae · Qualcomm QCA9880 802.11a/n/ac 3x3:3, 2 dBi antennae - Ethernet: Atheros AG71xx (SoC, AR8033), 1x 1000/100/10 port, passive PoE in Working: - Board/system detection - Sysupgrade - Serial console - Ethernet - 2.4 GHz radio - 5 GHz radio - Reset button Not working: - LEDs (added according to Mikrotik's GPL sources but not functional) Unsupported: - ZT2046Q SPI temperature and voltage sensor Contributors: Giuseppe Tipaldi (@Ciusss89) Ricky (@rickydee) Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net> Signed-off-by: Daniel Golle <daniel@makrotopia.org> [daniel@makrotopia.org: whitespace fix, use PHYADDR instead of PHYMASK]
* ar71xx: complete support for RB mAP 2nDRobert Marko2017-11-141-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the MikroTik RouterBOARD mAP 2nD https://mikrotik.com/product/RBmAP2nD Specifications: - SoC: Qualcomm QCA9531 (650 MHz) - RAM: 64 MB - Storage: 16 MB NOR SPI flash - Wireless: builtin QCA9531, 2x2:2 - Ethernet: 2x100M (802.3af/at POE in and passive POE out on ETH2) - USB: microUSB type AB port This patch adds missing code to fully support mAP. Machfile already contained configuration for mAP 2nD, but device specific configuration like LEDs etc., was missing. Note: The POE LED works but doesn't turn on when POE passthrough is enabled, despite being configured with GPIO trigger. Installation 1. Login to the Mikrotik WebUI to backup your licence keys 2. Setup a DHCP/BOOTP server with: - DHCP-Option 66 (TFTP server name) pointing to a local TFTP server within the same subnet of the DHCP range - DHCP-Option 67 (Bootfile-Name) matching the initramfs filename of the to be booted image 3. Connect the port labeled internet to your local network 4. Keep the reset button pushed down and power on the board The board should load and start the initramfs image from the TFTP server. Login as root/without password to the started LEDE via SSH listing on IPv4 address 192.168.1.1. Use sysupgrade to install LEDE. Revert to RouterOS Use the "rbcfg" package on in LEDE: - rbcfg set boot_protocol bootp - rbcfg set boot_device ethnand - rbcfg apply Open Netinstall and reboot routerboard. Now Netinstall sees RouterBOARD and you can install RouterOS. If NetInstall gets stuck on Sending offer just wait for it to timeout and then close and open Netinstall again. Click on install again. In order for RouterOS to function properly, you need to restore license for the device. You can do that by including license in NetInstall. Signed-off-by: Robert Marko <robimarko@gmail.com>
* ar71xx: complete support for RB wAP 2nDRobert Marko2017-11-141-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the MikroTik RouterBOARD wAP https://mikrotik.com/product/RBwAP2nD Specifications: - SoC: Qualcomm QCA9533 (650 MHz) - RAM: 64 MB - Storage: 16 MB NOR SPI flash - Wireless: built-in QCA9533, 2x2:2 - Ethernet: 1x100M (802.3af/at POE in) This patch adds missing code to fully support wAP. Machfile already contained configuration for wAP 2nD but device specific configuration like LEDs etc. was missing. Installation: 1. Login to the Mikrotik WebUI to backup your licence keys 2. Setup a DHCP/BOOTP server with: - DHCP-Option 66 (TFTP server name) pointing to a local TFTP server within the same subnet of the DHCP range - DHCP-Option 67 (Bootfile-Name) matching the initramfs filename of the to be booted image 3. Connect the port labeled internet to your local network 4. Keep the reset button pushed down and power on the board The board should load and start the initramfs image from the TFTP server. Login as root/without password to the started LEDE via SSH listing on IPv4 address 192.168.1.1. Use sysupgrade to install LEDE. Revert to RouterOS Use the "rbcfg" package on in LEDE: - rbcfg set boot_protocol bootp - rbcfg set boot_device ethnand - rbcfg apply Open Netinstall and reboot routerboard. Now Netinstall sees RouterBOARD and you can install RouterOS. If NetInstall gets stuck on Sending offer just wait for it to timeout and then close and open Netinstall again. Click on install again. In order for RouterOS to function properly, you need to restore license for the device. You can do that by including license in NetInstall. Signed-off-by: Robert Marko <robimarko@gmail.com>
* ar71xx: mach-rbspi: fix 74x164 supportThibaut VARENE2017-11-031-0/+1
| | | | | | | | | | | | | The platform data was missing the num_registers element which is now mandatory in linux 4.9 Without this patch, the gpio probing would fail with: gpio gpiochip1: (74x164): tried to insert a GPIO chip with zero lines Fixes: #1106 Tested-by: Robert Marko <robimarko@gmail.com> Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
* ar71xx: add support for Mikrotik RB750P-PBr2Robert Marko2017-10-141-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifications: - SoC: Qualcomm QCA9531 (650MHz) - RAM: 64MB - Storage: 16MB NOR SPI flash - Ethernet: 5x100M (1 PoE in, 4 PoE out) - Outdoor use ready This ethernet router is based on the same platform as the hEX PoE lite. Installation 1. login to the Mikrotik WebUI to backup your licence keys 2. setup a DHCP/BOOTP Server with: * DHCP-Option 66 (TFTP server name) pointing to a local TFTP Server within the same subnet of the DHCP range * DHCP-Option 67 (Bootfile-Name) matching the initramfs filename of the to be booted image 3. connect the port labled internet to your local network 4. keep the reset button pushed down and power on the board The board should load and start the initramfs image from the TFTP Server. Login as root/without password to the started LEDE via ssh listing on IPv4 address 192.168.1.1. Use sysupgrade to install LEDE. Revert to RouterOS Use the "rbcfg" package on in LEDE: * rbcfg set boot_protocol bootp * rbcfg set boot_device ethnand * rbcfg apply Open Netinstall and reboot routerboard. Now netinstall sees routerboard and you can install RouterOS. If NetInstall gets stuck on Sending offer just wait for it to timeout and then close and open Netinstall again. Click on install again. In order for RouterOS to function properly, you need to restore license for the device. You can do that by including license in NetInstall Signed-off-by: Robert Marko <robimarko@gmail.com>
* ar71xx: fix section mismatchesHauke Mehrtens2017-10-111-1/+1
| | | | | | Fix some section mismatches found with kernel 4.9. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* ar71xx: add support for MikroTik hAP acRyan Mounce2017-03-231-0/+157
| | | | | | | | | | | This patch adds initial support for the MikroTik RouterBOARD hAP ac (RB962UiGS-5HacT2HnT). All functions are supported except: -SFP cage (eth1) is not working -WLAN LEDs are not working Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
* ar71xx: add support for MikroTik hAP ac liteRyan Mounce2017-03-231-5/+23
| | | | | | | | | | This patch adds support for the MikroTik RouterBOARD hAP ac lite (RB952Ui-5ac2nD). The hAP ac lite is nearly identical to the hAP, with an added QCA9887 5GHz radio. The 2.4GHz radio ID is also changed in the hAP ac lite. Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
* ar71xx: mikrotik: prepend "RouterBOARD" to machine name for NOR devicesThibaut VARENE2017-03-151-3/+15
| | | | | | | | | | | | When the device name doesn't already contain "RouterBOARD", this patch adds this string to the machine name. Most NOR devices already have "RouterBOARD" in their hardware-stored device name, but not all of them. This patch also makes the code more robust against buffer overflows. Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
* ar71xx: add support for RB LHG 5nDThibaut VARENE2017-03-151-31/+123
| | | | | | | | | | | | | | | | This patch adds support for the MikroTik RouterBOARD LHG 5 https://routerboard.com/RBLHG-5nD Specifications: - SoC: Atheros AR9344 (600MHz) - RAM: 64MB - Storage: 16MB NOR SPI flash - Wireless: builtin AR9344 5GHz, 2x2:2 - Ethernet: 1x100M Initial flash via initramfs, like all other RB devices. Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
* ar71xx: Enable mtdsplit support for RB SPI NOR devicesThibaut VARENE2017-02-221-14/+4
| | | | | | | | | | | | | | | | | | This patch enables mtdsplit for the MikroTik subtarget. It converts mach-rbspi.c to use a single "firmware" partition. Finally, it converts the SPI NOR profile to metadata images: the original combined-image format is gone, the images are now "standard" sysupgrade images with metadata appended. Note: kernel2minor apparently pads the kernel container to erase-block boundary, but this is undocumented behaviour, so we do not rely on it and call pad-to anyway. Note: in platform.sh, the boards are tested last in platform_check_image() as this should eventually become the "*)" default case when more devices switch to metadata images. Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
* ar71xx: add preliminary kernel support for several RB SPI NOR devicesThibaut VARENE2017-02-151-0/+178
| | | | | | | | | | | | | | | | | | | The cAP 2nD, mAP 2nD and wAP 2nD apparently all share the same QCA953x/SPI-NOR platform. This patch adds preliminary kernel support based on init data used in Mikrotik's linux-3.3.5 kernel patch. Since this is totally experimental and untested, the necessary glue in base-files has not been added, the code is provided as a starting point in case somebody with that hardware wants to help getting it supported. The cAP lite (cAPL 2nD) should also be supported once it is determined whether or not it uses the same board identifier as the mAP lite. Code has been successfully built and has no side effect (no impact on already supported devices). Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
* ar71xx: add support for RB750r2Thibaut VARENE2017-02-151-4/+9
| | | | | | | | | | | | | | | | This patch adds support for the MikroTik RouterBOARD hEX lite https://routerboard.com/RB750r2 Specifications: - SoC: Qualcomm QCA9531 (850MHz) - RAM: 64MB - Storage: 16MB NOR SPI flash - Ethernet: 5x100M (1 PoE in) This ethernet router is based on the same platform as the hEX PoE lite (it shares the same board identifier), but has no USB and no PoE out. Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
* ar71xx: add support for RB750UPr2Thibaut VARENE2017-02-151-19/+49
| | | | | | | | | | | | | | | | This patch adds support for the MikroTik RouterBOARD hEX PoE lite https://routerboard.com/RB750UPr2 Specifications: - SoC: Qualcomm QCA9531 (650MHz) - RAM: 64MB - Storage: 16MB NOR SPI flash - Ethernet: 5x100M (1 PoE in, 1 PoE out) - USB: Type A This ethernet router is based on the same platform as the wireless router hAP. Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
* ar71xx: add support for RB951Ui-2nDThibaut VARENE2017-02-151-1/+146
| | | | | | | | | | | | | | | This patch adds support for the MikroTik RouterBOARD hAP https://routerboard.com/RB951Ui-2nD Specifications: - SoC: Qualcomm QCA9531 (650MHz) - RAM: 64MB - Storage: 16MB NOR SPI flash - Wireless: builtin QCA9531, 2x2:2 - Ethernet: 5x100M (1 PoE in, 1 PoE out) - USB: Type A Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
* ar71xx: provide support for RB-941-2nD via mach-rbspi.cThibaut VARENE2017-02-151-0/+39
| | | | | | | | | This patch implements support for the hAP lite in mach-rbspi.c hAP lite was supported via mach-rb941.c, so this file is removed as well as the corresponding build bits. Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
* ar71xx: add support for RB mAP L-2nDThibaut VARENE2017-02-151-0/+279
This patch adds support for the MikroTik RouterBOARD mAP lite https://routerboard.com/RBmAPL-2nD Specifications: - SoC: Qualcomm QCA9533 (650MHz) - RAM: 64MB - Storage: 16MB NOR SPI flash - Wireless: builtin QCA9533, 2x2:2 - Ethernet: 1x100M This is another 16M SPI NOR mikrotik device. The machine file is named mach-rbspi.c because I plan to add support for several of the other spi-based RouterBOARD devices in subsequent patches: they share most of the hardware and thus the same codebase. Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>