Commit Graph

61 Commits (d6d9f582907630c77309a13a42781010adfff441)

Author SHA1 Message Date
David Bauer d6d9f58290 ipq806x: use switch trigger for WAN LED on NETGEAR boards
With this commit, the WAN LED is triggered by the switch port state
instead of the eth0 netdev.
Otherwise, the LED is always illuminated, regardless of the WAN port
link state.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 70d5989c9c)
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Jeff Kletsky b3770eaca3 mtd: base-files: Unify dual-firmware devices (Linksys)
Consistently handle boot-count reset and upgrade across
ipq40xx, ipq806x, kirkwood, mvebu

Dual-firmware devices often utilize a specific MTD partition
to record the number of times the boot loader has initiated boot.

Most of these devices are NAND, typically with a 2k erase size.
When this code was ported to the ipq40xx platform, the device in hand
used NOR for this partition, with a 16-byte "record" size. As the
implementation of `mtd resetbc` is by-platform, the hard-coded nature
of this change prevented proper operation of a NAND-based device.

* Unified the "NOR" variant with the rest of the Linksys variants

* Added logging to indicate success and failure

* Provided a meaningful return value for scripting

* "Protected" the use of `mtd resetbc` in start-up scripts so that
   failure does not end the boot sequence

* Moved Linksys-specific actions into common `/etc/init.d/bootcount`

For upgrade, these devices need to determine which partition to flash,
as well as set certain U-Boot envirnment variables to change the next
boot to the newly flashed version.

* Moved upgrade-related environment changes out of bootcount

* Combined multiple flashes of environment into single one

* Current-partition detection now handles absence of `boot_part`

Runtime-tested: Linksys EA8300

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[checkpatch.pl fixes, traded split strings for 80+ chars per line]
5 years ago
INAGAKI Hiroshi 9c7fd17f4a ipq806x: fix LED configuration for NEC Aterm WG2600HP
NEC WG2600HP uses port1 on QCA8337 as a WAN port, so "0x2" should
be used as a portmask instead of "0x1e" for "WAN" LED configuration.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years ago
INAGAKI Hiroshi 51fe956c4f ipq806x: add support for Buffalo WXR-2533DHP
Buffalo WXR-2533DHP is a 2.4/5 GHz band 11ac router, based on Qualcomm
IPQ8064.

The U-Boot on WXR-2533DHP employs a complicated dual firmware
protection scheme against corruptions of the kernel and rootfs
images. See the notes in buffalo.sh for details.

specifications:

- Qualcomm IPQ8064 (384 - 1,400 MHz, 2C2T)
- 512 MB of RAM (DDR3)
- 256 MB of Flash (NAND)
- 4T4R 2.4/5 GHz Wlan (QCA9980)
- 5x 10/100/1000 Mbps Ethernet
- 10x LEDs, 8x keys (6x buttons, 2x slide-switches)
- 2x USB 3.0 Type-A
- 12VDC/4A AC Adapter
- UART through-hole on PCB
  - J3: Vcc, GND, TX, RX from USB port side
  - 115200n8

Boot instructions for the initramfs image:

1. Prepare the TFTP server with the initramfs image renamed to
   "wxr2300dhp-initramfs.uImage" and IP address "192.168.11.10".
2. Press the "AOSS" button while powering on the WXR-2533DHP.
3. Wait until the "Wireless" LED flashes before releasing the AOSS button.
   The WXR-2533DHP will grab the image from TFTP server and will boot it.

Flashing instructions:

To persistently write the firmware, flash an openwrt sysupgrade image
from inside the initramfs, for example transfer
via `scp <sysupgrade> root@192.168.1.1:/tmp` and flash on the device
with `sysupgrade -n /tmp/<sysupgrade>`. Then wait ~120 seconds to
let it finish the flashing process.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [reworded message]
5 years ago
Christian Lamparter 330965b342 ipq806x: add ath10k calibration data MAC addresses patching
Ben Greear reported in his patch:
|Subject: netgear r7800: Fix mac address of radios.
|
|Reloading the driver causes the phyX to change, and that
|caused the MAC address to change.

This is because all ODM/OEMs except QCA bothered to write
the correct MAC address for the ath10k wifi into the
calibration data.

This patch copies over the MAC patching helper functions from ipq40xx's
target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
file and converts all the devices to patch the correct MACs into the
extracted calibration data before it gets sent to the driver, which sets
up the device with the correct MAC address. It also removes the entries
in the 10_fix_wifi_mac file as they have served their purpose for good.

Please note the C2600: There is conflicting information on what
the offset for the second wifi is supposed to be. This patch uses
what was specified in 10_fix_wifi_mac.

According to Ben Greear this method is save to use with the
stock firmware too. As he explained that the stock firmware
messes up rx-bssid mask calculation when the MAC is changed
after the first vif is created.

Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Petr Štetiar 9da6cd40eb apm821xx, ath79, ipq40xx, ipq806x, lantiq, ramips: base-files: Use generic diag.sh
I wanted to add status LEDs support to my imx6 based board and have found out,
that I could use diag.sh script found in ramips platform, which seems to be
also shared in a few other platforms:

 4801276bc2078c5bcf03003c831e3b0a target/linux/ramips/base-files/etc/diag.sh
 4801276bc2078c5bcf03003c831e3b0a target/linux/ipq40xx/base-files/etc/diag.sh
 4801276bc2078c5bcf03003c831e3b0a target/linux/ath79/base-files/etc/diag.sh

And @chunkeey suggested to me, that I can also add lantiq, ipq806x and
apm821xx to the list of platforms which could share this generic
diag.sh.

I've extended the base diag.sh in a way, that if it detects any of the
DTS LED aliases, then it would use the generic DTS set_led_state code.
The code in platform's diag.sh has moved to base-files package in this
commit:

 base-files: diag.sh: Make it more generic towards DTS so it could be reused

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Tested-by: Christian Lamparter <chunkeey@gmail.com> (apm821xx and ipq40xx)
6 years ago
Ram Chandra Jangir dc6af37544 ipq806x: Add support for IPQ8064 AP161 board
Specification:
   - SoC: Qualcomm Atheros IPQ8064 ARM-v7 Dual Core SMP CPU
   - RAM: 512MB DDR3 System Memory
   - NOR Flash: 32MB SPI NOR
   - NAND Flash: 256MB NAND
   - Ethernet: 5 x 1G via QCA8337N
   - USB: 2 x USB 3.0 SuperSpeed
   - PCIe: 3x Mini PCIe 2.0 Slots
	   Three PCIE2.0 connectors can connect two or three radio cards
           such as the CUS260 for 2.4 GHz WLAN and the CUS239 for 802.11ac WLAN

 How to flash via u-boot console:
   tftpboot 0x44000000 openwrt-ipq806x-qcom_ipq8064-ap161-squashfs-nand-factory.bin
   nand erase  0x1340000 0x4000000
   nand write  0x44000000 0x1340000 $filesize
   setenv bootargs ‘console=ttyMSM0,115200 ubi.mtd=ubi root=/dev/ubiblock0_1’
   saveenv
   bootm

 Further upgrades via sysupgrade.

 Tested on IPQ8064 AP161 Board:
   1) NAND boot
   2) Tested USB and PCIe interfaces
   3) WDOG test
   4) cpu frequency scaling
   5) ethernet, 2G and 5G WiFi
   6) ubi sysupgrade

Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
6 years ago
Ben Greear 38167cb7f4 hotplug: Allow configuring radio name.
This way the radio (phy) name can be the same through module reloads.

To set the desired name:

uci set wireless.@wifi-device[0].phyname=wiphy0

I guess this only works on ipq6086 boards as I could not find a more
generic place to put this.  Maybe someone can improve it.

Signed-off-by: Ben Greear <greearb@candelatech.com>
6 years ago
Mathias Kresin dd448cd276 treewide: fix upgrade led handling
The upgrade led is only used if a running led is defined. If no running
led is defined, the upgrade led is ignored and upgrade isn't indicated
at all.

Instead, turn off the running led prior to turning the upgrade led on.
In most cases there isn't any visual change, but it allows to use an
independent led for upgrade indication.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Aleksandr V. Piskunov 36fea5a7b9 ipq806x: fix numbering for Netgear R7800 LAN ports
Netgear R7800 switch LAN ports are numbered backwards in LuCI,
i.e. numbering is not corresponding to the actual physical port labels,
patch fixes that.

Signed-off-by: Aleksandr V. Piskunov <aleksandr.v.piskunov@gmail.com>
[merged with existing board using the same config]
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years ago
Stefan Lippers-Hollmann 7c7ca66109 ipq806x: switch the NBG6817 wlan LEDs from amber to white
The original device support patch configured the amber wlan LEDs (which
are meant as error indicator by the OEM) controlled by the SOC's GPIO
as wlan traffic indicators, as the correct white wlan LEDs are
connected to GPIOs controlled by the QCA9984/ ath10k wlan cards were
not accessible. The recent addition of GPIO/ LED support to ath10k now
makes it possible to use the correct white LEDs instead - and
"mac80211: ath10k: use tpt LED trigger by default" also enables them by
default. While both LEDs are independent of each other (two separate
LEDs sharing one light tunnel), triggering both on wlan traffic is not
the intended behaviour (bright yellow light).

Tested on the ZyXEL NBG6817.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
INAGAKI Hiroshi 4645a6d318 ipq806x: add support for NEC Aterm WG2600HP
NEC Aterm WG2600HP is a 2.4/5 GHz band 11ac router, based on Qualcomm
IPQ8064.

Specification:

- IPQ8064 (384 - 1,400 MHz)
- 512 MB of RAM
- 32 MB of Flash (SPI)
- 4T4R 2.4/5 GHz
- 5x 10/100/1000 Mbps Ethernet
- 12x LEDs, 4x keys
- 1x USB 3.0 Type-A
- UART header on PCB
  - RX, TX, NC, GND, Vcc from power connector side
  - baudrate: 115200 bps

Flash instruction using initramfs image:
1. Connect serial cable to UART header
2. Connect power cable and turn on the router
3. When the "Press the [f] key and hit [enter] to enter failsafe mode"
message is displayed on the console, press the "f" key and Enter key
sequentially to enter the failsafe mode
4. create fw_env.config file with following contents on failsafe mode:
  /dev/mtd9 0x0 0x10000 0x10000
5. Execute following commands to add and change the environment
variables of U-Boot
  fw_setenv ipaddr "192.168.0.1"
  fw_setenv serverip "192.168.0.2"
  fw_setenv autostart "yes"
  fw_setenv bootcmd "tftpboot 0x44000000 wg2600hp-initramfs.bin;
  bootipq"
6. Set the IP address of the computer to 192.168.0.2, connect to the LAN
port of WG2600HP, and start the TFTP server on the computer
7. Rename OpenWrt initramfs image for WG2600HP to
"wg2600hp-initramfs.bin" and place it in the TFTP directory
8. Remove power cable from WG2600HP, reconnect it and restart WG2600HP
9. WG2600HP downloads initramfs image from TFTP server on the computer,
loads it and boot with initramfs image
10. On the initramfs image, execute "mtd erase firmware" to erase stock
firmware and execute sysupgrade with the sysupgrade image
11. Wait ~180 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Christian Mehlis 0c7e78930b ipq806x: add support for Compex WPQ864
Hardware highlights:
- SoC: Qualcomm Atheros IPQ8064/5 ARM Dual Core CPU
- RAM: (512MB or 1GB) DDR3 System Memory
- Storage: 32MB NOR (Cypress S25FL256S1)
           256MB NAND (Micron MT29F2G08ABBEAH4)
- Ethernet: 5 x 1G via QCA8337N
- USB: 1 x USB 2.0/3.0 + 1 x USB 2.0 on mini PCIe3 socket
- PCIe: 3x mini PCIe (third mini PCIE3 is PCIe/USB shared)
- SIM Card Slot: 2 x Slot
- Buttons: Reset Button
- LEDs: 18x, 8x GPIO controllable
- Buzzer

The correct amount of RAM will be passed by the bootloader.

In contrast to the documentation provided by Compex, the third PCIe
doesn't use GPIO16 for PERST. Instead, GPIO3 is shared and used as PERST
for PCIe0 and PCIe2.

So far, no one was able to get USB 3.0 working with the 1GB RAM version,
while it works fine for my 512MB version. Since USB 3.0 doesn't work with
the Compex firmware for the 1G variant either, it could be a hardware
issue with these boards.

OpenWrt will be installed to the NAND flash. Make sure to have a full
working image on the NOR flash. It will be the backup in case anything
goes wrong.

It has been observed that an image loaded via tftpboot might have
bitflips. Hence the extra step to create a crc32 checksum to allow to
compare the checksum with the one from the source file prior to flashing.

In all cases it is necessary to set the following u-boot parameter to an
empty (whitespace) value, to ensure that the chosen bootargs of the dts
isn't overwritten or set to bogus - not working - values:

  (IPQ) # set bootargs " "
  (IPQ) # set fsbootargs " "
  (IPQ) # saveenv

The sysupgrade image can be installed directly on flash using u-boot (put
jumper in JP13 (leave JP9 open) to boot from nand):

  (IPQ) # set serverip 192.168.1.20
  (IPQ) # set ipaddr 192.168.1.1

  (IPQ) # tftpboot 0x42000000 openwrt-ipq806x-compex_wpq864-squashfs-nand-factory.bin
  (IPQ) # crc32 0x42000000 $filesize

  (IPQ) # nand erase 0x1340000 0x4000000
  (IPQ) # nand write 0x42000000 0x1340000 $filesize

The initramfs image can be started using:

  (IPQ) # set fdt_high 0x48000000
  (IPQ) # tftpboot 0x44000000 openwrt-ipq806x-compex_wpq864-initramfs-fit-uImage.itb
  (IPQ) # bootm 0x44000000

Signed-off-by: Christian Mehlis <christian@m3hlis.de>
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
John Crispin b7f115f22a ipq806x: drop ipq40xx support
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Dongming Han 04d3308b62 ipq806x: add support for GL.iNet GL-B1300
This patch adds support for GL.iNet GL-B1300

Specification:
- SOC:        IPQ4028 / QCA Dakota
- RAM:        256 MiB
- FLASH:      32 MiB
- ETH:        Qualcomm Atheros QCA8075 Gigabit Switch (2 x LAN, 1 x WAN)
- USB:        1 x 3.0 (via Synopsys DesignWare DWC3 controller in the SoC)
- WLAN1:      Qualcomm Atheros QCA4028 2.4GHz 802.11bgn 2:2x2
- WLAN2:      Qualcomm Atheros QCA4028 5GHz 802.11a/n/ac 2:2x2
- INPUT:      one reset and one WPS button
- LEDS:       3 leds: Power, WIFI(only for 2.4G currently), and one reserved
- UART:       1 x UART on PCB (3.3V, TX, RX, GND) - 115200 8N1

Installation:
Method 1:
- use serial port to stop uboot
- uboot command: run lf
Method 2:
- push down reset button and power on
- wait until three leds constantly on then release
- upgrade by uboot web at http://192.168.1.1
Note:
- the sysupgrade image need to be renamed to lede-gl-b1300.bin in both method.
- the sysupgrade image can be automatically downloaded if tftp server at
  192.168.1.2 have that file.
- the wifi led will be flashing when writing image.

Signed-off-by: Dongming Han <handongming@gl-inet.com>
6 years ago
David Bauer 1113fcdc80 ipq806x: mark AVM FB4040 switchport as untagged
This commit marks the CPUs switchport explicit as untagged.
Otherwise, an eth0.1 interface is created and the devices
LAN-ports are not working.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Sven Eckelmann 86e18f6706 ipq806x: add support for OpenMesh A42
* QCA IPQ401x
* 256 MB of RAM
* 32 MB of SPI NOR flash (s25fl256s1)
  - 2x 15 MB available; but one of the 15 MB regions is the recovery image
* 2T2R 2.4 GHz
  - QCA4019 hw1.0 (SoC)
  - requires special BDF in QCA4019/hw1.0/board-2.bin with
    bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=OM-A42
* 2T2R 5 GHz
  - QCA4019 hw1.0 (SoC)
  - requires special BDF in QCA4019/hw1.0/board-2.bin with
    bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=OM-A42
* multi-color LED (controlled via red/green/blue GPIOs)
* 1x button (reset; kmod-input-gpio-keys compatible)
* external watchdog
  - triggered GPIO
* 1x USB (xHCI)
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* 2x gigabit ethernet
* powered only via POE
  - 802.3af POE on Ethernet 1
  - 18-24v passive POE (mode B) on Ethernet 2

The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the factory image to the u-boot when the device boots up.

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
6 years ago
Luis Araneda 7293499f71 ipq806x: Sort occurrences of boardame alphabetically
This restores the alphabetical sort that was present
before the renaming of boardname.

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
6 years ago
Luis Araneda 33f09cf151 ipq806x: convert to dt-based board-detection
Use the generic board detection method:
- Board name: First compatible string from the device tree
- Board model: Model property from the device tree

Change occurrences of board name in userspace by the compatible
string, and removed target specific board detection script

Replace the definition of SUPPORTED_DEVICES in Device/Default
to extract the dt compatible string from each device definition.
Additionally, for devices supported by lede-17.01, append
the value of BOARD_NAME to SUPPORTED_DEVICES in the device
definition.

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
6 years ago
Luis Araneda 09e13bd341 ipq806x: add a helper variable with the vendor name stripped
This will allow to maintain the current syntax for LEDs config
when switching to a device tree compatible string boardname.

None of the current boards use a comma in the boardname, so they
will be unaffected.

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
6 years ago
Christian Lamparter da6fdce365 base-files: unify get_dt_led helper function
Lantiq and IPQ806X (which includes IPQ40XX) both define the
same custom function {ipq806x|lantiq}_get_dt_led.

This patch moves the function into the base-file package at
lib/functions/leds.sh to make it more accessible for other
targets as well.

Cc: Mathias Kresin <dev@kresin.me>
Cc: John Crispin <john@phrozen.org>
Cc: Hannu Nyman <hannu.nyman@iki.fi>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Roman Yeryomin 156f2df879 ipq806x: ipq4019: add ap-dk01.1-c1 board support
AP-DK01.1-C1 is QCA dev board with:
- ipq4018 quad core ARM @716.8MHz, 2x2 dual (11n+11ac) radio
- 256MB RAM
- 32MB SPI flash
- QCA8075 multiport ethernet phy (WAN port, 4x LAN ports)

First installation via u-boot:
sf probe
sf erase 0x180000 0x1a00000
tftpboot 0x84000000 lede-ipq806x-AP-DK01.1-C1-squashfs-sysupgrade.bin
sf write 0x84000000 0x180000 $filesize

Further upgrades via sysupgrade.

Changes:
- add partitions
- set memory size to 256MB
- add reserved memory mapping
- add correct compatible string
- add image generation
- extract pre-cal data from ART partition

Compile and run tested.
Wirespeed NAT can be achieved with spreading rx interrupts over different
cores. Wifi speed is ~550Mbps @5GHz in open air.

Note:
AP-DK01.1-C1 is fully compatible with AP-DK01.2-C1, which has
ipq4028 instead of ipq4018 on board.

Changes since v2:
- based on dts(i) rework/cleanup submitted:
  http://lists.infradead.org/pipermail/lede-dev/2017-October/009596.html
- precise reserved memory mapping
- more precise description
- compatible string

Signed-off-by: Roman Yeryomin <roman@advem.lv>
7 years ago
Stefan Lippers-Hollmann 189433e543 ipq806x: nbg6817: sync MAC addresses to the upstream values
The ZyXEL NBG6817 calculates all MAC addresses based on the ethaddr
value stored in the U-Boot environment (0:APPSBLENV). No MAC addresses
are stored in the ART partition and the generated MAC addresses for the
wlan interfaces alternate randomly between 12:34:56:78:90:12 and
00:03:7f:12:34:56.

interface	  new/ OEM MAC	old MAC

wlan-2.4g (phy1): ethaddr	undefined
wlan-5g   (phy0): ethaddr + 1	undefined
lan             : ethaddr + 2	ethaddr
wan             : ethaddr + 3	ethaddr + 1

This patch defines stable MAC addresses for the wlan interfaces for
the first time instead of generating them at random. The previously
defined values for lan/ wan are changed to follow the settings of the
OEM firmware.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
7 years ago
Baptiste Jonglez 5889f92f7d ipq806x: Archer C2600: fix switch ports numbering
The order of LAN ports shown in Luci is reversed compared to what is
written on the case of the device.  Fix the order so that they match.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
7 years ago
Mathias Kresin f12a32630f treewide: use the generic board_name function
Use the generic function instead ot the target specific ones.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Pavel Kubelun 189239ade3 ipq806x: qca99xx: fix wifi calibration
As of now OTP is being correctly parsed and the driver requires to parse pre-caldata to follow corresponding routine.

Rename cal file into pre-calfile so the board initialized correctly with API 2 board data (board-2.bin).

Also remove the now unneeded for qca9984 board.bin symlink to 5GHz calfile.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
7 years ago
Jo-Philipp Wich 3c3f7cfe4d ipq806x: fix EA8500 switch configuration
Do not assign the CPU port twice, this confuses LuCI and possible other
programs relying on topology information in board.json.

Ref: https://github.com/openwrt/luci/issues/1086

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Christian Lamparter 1cb406d019 ipq806x: add ipq4019 fritz4040 support
This patch adds support for AVM FRITZ!Box 4040.

hardware highlights:

SOC:	IPQ4018 / QCA Dakota
CPU:	Quad-Core ARMv7 Processor rev 5 (v7l) Cortex-A7
DRAM:	256 MiB Nanya NT5CC128M16IP
FLASH:	32 MiB MXIC MX25L25635FMI
ETH:	Qualcomm Atheros QCA8075 Gigabit Switch (4 x LAN, 1 x WAN)
USB:	1 x 3.0 (via Synopsys DesignWare DWC3 controller in the SoC)
	1 x 2.0 (via Synopsys DesignWare DWC3 controller in the SoC)
WLAN1:	Qualcomm Atheros QCA4018 2.4GHz 802.11bgn 2:2x2
WLAN2:	Qualcomm Atheros QCA4018 5GHz 802.11a/n/ac 2:2x2
INPUT:	one WLAN and one WPS button
LEDS:	Power, WAN/Internet, WIFI, INFO (red and amber) and LAN.
Serial:
	WARNING: The serial port needs a TTL/RS-232 v3.3 level converter!
        The Serial setting is 115200-8-N-1. The SoC's serial port is right
	next to the MXIC FLASH chip. The board has a unpopulated 1x4 0.1"
	header for it. Use a multimeter to figure out the pinout!

This board currently needs an additional u-boot image in order to boot
properly. Booting with EVA isn't possible ATM.

Install Procedure:
 0. It's highly recommended to connect to the serial port.
    The serial settings are listed above.
 1. install a u-boot image for AVM Fritz!Box 4040
    (see <https://github.com/chunkeey/FritzBox-4040-UBOOT/releases> and
    <https://github.com/chunkeey/FritzBox-4040-UBOOT/blob/master/upload-to-f4040.sh>)
 2. upload the initramfs.itb image via tftp (u-boot listens to
    192.168.1.1 - use binary transfer mode!)
 3. connect to the FB4040 and use sysupgrade sysupgrade.bin
    to install the image.

Works:
	- Switch and Ethernet (99%)
        - Buttons (WLAN, WPS)
        - FLASH (1 x 32MiB NOR Chip)
        - WLAN2G and WLAN5G
        - CPUFREQ scaling
        - PRNG
        - serial
        - Crypto Accelerator
        - sysupgrade (Read the flash instructions to avoid bricking)
        - full LEDE Install (Read the flash instructions to avoid bricking)
	- LEDs (Power, WAN, Info (red and amber), LAN)
          The LEDs are connected to the QCA8075 LED ports.
	  The AR40xx driver contains a gpio-controller to
	  handle these special "GPIOs".
        - USB Both 3.0 and 2.0 ports
        - many packages from other ARMv7 boards
          (This does include the RaspberryPi Model 2!)
        - ...

Not planned:
	- WAN<->LAN short-cut
	- Qualcomm Secure Execution Environment
        - ...

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Jo-Philipp Wich ea269c37b8 ar71xx/ipq806x/mediatek/mvebu: fix network defaults
After "73d923e base-files: emit tagged switch configuration by default"
some default network configurations are broken because the lan and wan
ifnames are forcibly set to untagged netdevs.

Adjust the offending set_interfaces_lan_wan() calls to use the proper
tagged device names.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Hannu Nyman c980147527 ipq806x: fix wireless macs
Commit 71a39b8 ("ipq806x: Fix wireless support for Netgear Nighthawk X4S
D7800") added a trailing TAB char after the backslash which prevents
the assignment of the correct MACs for wifi devices.

Fixes: FS#451

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
[reworded commit message]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Zhang Jingye 71a39b8690 ipq806x: Fix wireless support for Netgear Nighthawk X4S D7800
D7800 has a simular hardware to R7800 and uses dual QCA9980 for both 2.4GHz and 5GHz band.
However there is no proper initialization for them, which causes a kernel panic due to failed firmware loading.

This patch adds d7800 to ath10k caldata extraction list.
I can get two functional wireless bands after making change to it.

Signed-off-by: Zhang Jingye <934526987@qq.com>
7 years ago
Mathias Kresin 3228c2a682 ipq806x: more dts cleanup
Remove the wifi5g LED from the the d7800, r7500 and r7800. Albeit this
GPIO is mentioned in the GPL tarball, it doesn't do anything. The
2.4/5 GHz LEDs are connected to the wifi chips and not be controlled
from the the userspace.

Use the LEDs names/colours as they are used in the board manuals. Merge
redundant LED configurations. Use the phy[0|1]tpt trigger for the
wireless LEDs. Remove the workarounds for the not controllable wireless
LEDs.

Fix spi compatible strings and remove superfluous spi-max-frequency
parameters.

If there are two power leds, use one for indicating normal operation and
one for failsafe/upgrade. Keep the on/off state of the main power led
during boot.

Use the usb pinmux settings from the nbg6817 gpl sources.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Henryk Heisig e3caadc69d ipq806x: clean up dts files
Set the pinmux to the values found in the GPL tarballs of the boards.
Remove pinmux which are is not used (like nand pinmux for spi
flash boards).

This allows to use the wan orange led of the C2600 which had a wrong
pinmux before. Might fix buttons or leds of other boards as well.

Fix the LED color and the ledswitch key code of the C2600. Rename the
ledgnr to ledswitch.

Add support for indication the boot state using LEDs to the D7800,
NBG6817, R7500 and R7500v2.

Change GPIO active to readable values in D7800, EA8500, R7500,
R7500v2 and R7800.

Change gpioexport to gpio pinmux.

Add proper "drive strenght" to i2c4_pins and use it for RPM on
C2600, D7800, EA8500, R7500, R7500v2.

Remove pcie pinmux from D7800.

Move pinctrl to correct place in NBG6817 and R7800.

Signed-off-by: Henryk Heisig <hyniu@o2.pl>
8 years ago
Sebastian Quilitz ae79c41286 ipq806x: add support for TP-Link Archer VR2600v
This router is similar to the C2600. Ethernet on WAN + LAN, switch,
sysupgrade, LEDs, buttons and WiFi on 2G + 5G do work. The xDSL modem
and the POTS/DECT interface are not supported yet.

It is not possible to flash LEDE via the TP-Link webinterface. The
image need to be signed. The first 0x200 bytes of the image is the
TP-Link header including the signature. The signature is not validated
by the bootloader. The LEDE image is zeroed in this area.

To install LEDE it is necessary to solder a four pin header to JP2.
Connect a serial interface to this header and interrupt the autostart
of kernel. Transfer the sysupgrade image via TFTP and write it to the
serial flash at 0x320000.

Signed-off-by: Sebastian Quilitz <zeraphim@x-pantion.de>
8 years ago
Henryk Heisig c380772c19 ipq806x: c2600: change wan and lan led trigger to swconfig port
Signed-off-by: Henryk Heisig <hyniu@o2.pl>
8 years ago
Pavel Kubelun 5aace5a5fb ipq806x: fixes for R7800 and C2600
Updating spi pins configuration in R7800 and C2600 DTs
Adding more usb power pin export and gsbi6 in R7800 DT
Updating and fixing leds

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
8 years ago
Pavel Kubelun bf7166e545 ipq806x: fix leds, sata port for Netgear R7800 and minor fixes - renamed leds in correct color accordance - blink power led with white during boot and with amber when flashing firmware - fixed usb leds - enabled unused wps and rfkill leds as wlan leds. Now rfkill led is for 2.4GHz and wps - 5GHz WIFI - removed unneeded bootargs - removed unneeded pci pins from R7800 DT (driver already handles it in proper way) and add tx offsetting - nand ecc step size - fixed sata ports
Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
8 years ago
Cezary Jackiewicz dafbc94f95 ipq806x: TP-Link Archer C2600: convert old usbdev trigger to new usbport
Signed-off-by: Cezary Jackiewicz <cezary@eko.one.pl>
8 years ago
André Valentin a0ed7af6c6 ipq806x/nbg6817: add support for ZyXEL NBG6817
CPU: 2x1.8GHz ARM, RAM: 512MiB
Storage: 4MiB serial Flash, 3.9GiB MMC
NIC: 2x1GBit/s, Switch with 5 external and 2 internal ports
WiFi: Dualband, ath10k 2.4GHz, 5GHz MU-MIMO

For installation copy xx-mmcblk0p4-kernel.bin and xx-mmcblk0p5-rootfs-full.bin
to device. Then run:
cat xx-mmcblk0p4-kernel.bin > /dev/mmc0blk0p4
cat xx-mmcblk0p5-rootfs-full.bin > /dev/mmc0blk0p5
reboot -f

For debugging serial console is easily visible on board, no soldering needed.

Signed-off-by: André Valentin <avalentin@marcant.net>
8 years ago
Henryk Heisig bcfb535730 ipq806x: C2600: change leds colour name
Signed-off-by: Henryk Heisig hyniu@o2.pl
8 years ago
Henryk Heisig 4bdf615878 ipq806x: add support for indicating the boot and upgrade state using four leds
Signed-off-by: Henryk Heisig hyniu@o2.pl
8 years ago
Pavel Kubelun 9677bfbb0f ipq806x: fix wlan mac for Netgear R7800
Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
8 years ago
Cezary Jackiewicz 9417293366 ipq806x: Archer C2600: Renaming LED accordance with the standard
Signed-off-by: Cezary Jackiewicz <cezary.jackiewicz@gmail.com>
8 years ago
Alexis Green c34f953fef ipq806x: Build image for Netgear Nighthawk X4 R7500v2
Signed-off-by: Alexis Green <alexis@cessp.it>
[Jo-Philipp Wich: add missing DEVICE_TITLE, fix model name in commit title]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Adrian Panella 184087f4f1 ipq806x: enable ieee80211 phy hotplug and patch macaddress
Calibration data for QCA99x0 in this device has bogus macaddress.
The data cannot be modified directly, as it breaks checksum control.
Instead change the macaddress from phy add hotplug event.

Signed-off-by: Adrian Panella <ianchi74@outlook.com>
8 years ago
Pavel Kubelun 823242185b ipq806x: add initial support for Netgear R7800
Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
8 years ago
Adrian Panella 3d067c0132 ipq806x: base-files: add support for Linksys EA8500
Signed-off-by: Adrian Panella <ianchi74@outlook.com>
8 years ago
Signed-off-by: Henryk Heisig 8ee30ade17 ipq806x: add diag.sh script
Signed-off-by: Henryk Heisig <hyniu@o2.pl>
8 years ago
Ash Benz 7d963efc40 ipq806x/base-files: extract ath10k caldata
Signed-off-by: Ash Benz <ash.benz@bk.ru>
8 years ago
Ash Benz 98b50f0bef ipq806x/base-files: Add Archer C2600 LEDs and board
Signed-off-by: Ash Benz <ash.benz@bk.ru>
8 years ago