Commit Graph

39 Commits (a0c0ad728c11751a30bb2c56e9cf54f8d2fe5fd1)

Author SHA1 Message Date
Christian Lamparter a0c0ad728c ipq40xx: fix usbport trigger on the RT-AC58U with USB 2.0 devices
This patch partially reverts
"ipq40xx: remove unnecessary usb nodes in DTS for ASUS RT-AC58U"
as the change removed the usb2 port-trigger, so the LED would no
longer light-up when a USB 2.0 was inserted into the USB port.

Fixes: d0efb1ba95 ("ipq40xx: remove unnecessary usb nodes in DTS for ASUS RT-AC58U")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Adrian Schmutzler 9c7025b779 ipq40xx: build DEVICE_DTS based on SOC and device name
This patch uses the SOC variable to calculate DTS names automatically
based on the SOC and the device definition node name.

This reduces redundancy and (by having to choose DTS name
appropriately) will unify the naming of a device in different places
(image/Makefile, DTS name, compatible, image name). This is supposed
to make life easier for developers and reviewers.

Since the kernel uses a "soc-device.dts" scheme for this target, we
use this for the derivation of DEVICE_DTS, too, and rename the files
not having followed it so far.

Note that for some devices the kernel itself is inconsistent, leaving
us with a manual overwrite for ap.dk01.1-c1 and ap.dk04.1-c1.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo d0efb1ba95 ipq40xx: remove unnecessary usb nodes in DTS for ASUS RT-AC58U
RT-AC58U has single USB 3.0 port, and only usb3_port1 is actually used.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo 8083969405 ipq40xx: improve ASUS RT-AC58U support
This patch does the following:

- move WiFi LED setup to DTS
- fix LAN/WAN MAC addresses and add label MAC address
- wan5G -> wlan5G, power -> led_power
- increase flash SPI frequency to 30MHz

MAC addresses are stored in Factory partition at:
0x1006: WiFi 2.4GHz, WAN (label_mac)
0x5006: WiFi 5GHz, LAN (label_mac +4)

By improving flash speed,
`time dd if=/dev/mtdblock8 of=/dev/null bs=2k`
is reduced from 7m 10.26s to 5m 9.52s.
Using higher frequencies did not improve speed further.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
David Bauer 102c8c55f2 ipq40xx: add support for Aruba AP-303
Hardware
--------

SoC:   Qualcomm IPQ4029
RAM:   512M DDR3
FLASH: - 128MB NAND (Macronix MX30LF1G18AC)
       - 4MB SPI-NOR (Macronix MX25R3235F)
TPM:   Atmel AT97SC3203
BLE:   Texas Instruments CC2540T
       attached to ttyMSM0
ETH:   Atheros AR8035
LED:   WiFi (amber / green)
       System (red / green)
BTN:   Reset

To connect to the serial console, you can solder to the labled pads next
to the USB port or use your Aruba supplied UARt adapter.

Do NOT plug a standard USB cable into the Console labled USB-port!
Aruba/HPE simply put UART on the micro-USB pins. You can solder yourself
an adapter cable:

VCC - NC
 D+ - TX
 D- - RX
GND - GND

The console setting in bootloader and OS is 9600 8N1. Voltage level is
3.3V.

To enable a full list of commands in the U-Boot "help" command, execute
the literal "diag" command.

Installation
------------

1. Get the OpenWrt initramfs image. Rename it to ipq40xx.ari and put it
   into the TFTP server root directory. Configure the TFTP server to
   be reachable at 192.168.1.75/24. Connect the machine running the TFTP
   server to the ethernet port of the access point.

2. Connect to the serial console. Interrupt autobooting by pressing
   Enter when prompted.

3. Configure the bootargs and bootcmd for OpenWrt.
   $ setenv bootargs_openwrt "setenv bootargs console=ttyMSM1,9600n8"
   $ setenv nandboot_openwrt "run bootargs_openwrt; ubi part aos1;
     ubi read 0x85000000 kernel; bootm 0x85000000"
   $ setenv ramboot_openwrt "run bootargs_openwrt;
     setenv ipaddr 192.168.1.105; setenv serverip 192.168.1.75;
     netget; set fdt_high 0x87000000; bootm"
   $ setenv bootcmd "run nandboot_openwrt"
   $ saveenv

4. Load OpenWrt into RAM:
   $ run ramboot_openwrt

5. After OpenWrt booted, transfer the OpenWrt sysupgrade image to the
   /tmp folder on the device.

6. Flash OpenWrt:
   $ ubidetach -p /dev/mtd1
   $ ubiformat /dev/mtd1
   $ sysupgrade -n /tmp/openwrt-sysupgrade.bin

To go back to the stock firmware, simply reset the bootcmd in the
bootloader to the original value:

  $ setenv bootcmd "boot"
  $ saveenv

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Robert Marko 146eb4925c ipq40xx: add support for Crisis Innovation Lab MeshPoint.One
MeshPoint.One is Wi-Fi hotspot and smart IoT gateway (based upon
Jalapeno module from 8Devices).

MeshPoint.One (https://meshpointone.com) is a unique Wi-Fi hotspot and
smart city gateway that can be installed and powered from street
lighting (even solar power in the future).  MeshPoint provides up to 27
hours of interrupted Wi-Fi and IoT services from internal battery even
when external power is not available.  MeshPoint.One can be used for
disaster relief efforts in order to provide instant Wi-Fi coverage that
can be easily expanded by just adding more devices that create wide area
mesh network.  MeshPoint.One devices have standard Luci UI for
management.

Features:
- 1x 1Gpbs WAN
- 1x 1Gbps LAN
- POE input (eth0)
- POE output (eth1)
- Sensor for temperature, humidity and pressure (Bosch BME280)
- current, voltage and power measurement via TI INA230
- Hardware real time clock
- optional power via Li-Ion battery
- micro USB port with USB to serial chip for easy OpenWrt terminal
  access
- I2C header for connecting additional sensors

Installation:
-------------
Simply flash the sysupgrade image from stock firmware.

Or use the built in Web recovery into bootloader:
Hold Reset button for 5 to 20 seconds or use UART and httpd command.
Web UI will appear on 192.168.2.100 by default.
For web recovery use the factory.ubi image.

Signed-off-by: Damir Samardzic <damir.samardzic@sartura.hr>
Signed-off-by: Damir Franusic <damir.franusic@sartura.hr>
Signed-off-by: Valent Turkovic <valent@meshpoint.me>
Signed-off-by: Robert Marko <robert@meshpoint.me>
[commit description long line wrap, usb->USB]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Robert Marko c550b1acfc ipq40xx: use DTSI for Jalapeno
Lets move common code for Jalapeno into DTSI, this way Jalapeno based
boards don't introduce duplicate code.

While at it, lets also fix some style issues and update to current DTS
style.

Signed-off-by: Robert Marko <robert@meshpoint.me>
[commit description long line wrap]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Kristian Evensen 6ab84579c6 ipq40xx: u4019: use reset-gpios instead of phy-reset-gpio
Use reset-gpio instead of the custom phy-reset-gpio property to do phy
reset on the U4019. phy-reset-gpio was incorrectly introduced when we
added support for the U4019, and will be deprecated.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
5 years ago
Daniel Danzberger 8db4496443 ipq40xx: wpj419: use reset-gpios property for phy reset
The old GPIO based phy reset (phy-reset-gpio) will be removed form
the ipq40xx mdio driver in the future.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
5 years ago
Daniel Danzberger affe633be4 ipq40xx: ipq4019: Add new device Compex WPJ419
This device contains 2 flash devices. One NOR (32M) and one NAND (128M).
U-boot and caldata are on the NOR, the firmware on the NAND.

    SoC:    IPQ4019
    CPU:    4x 710MHz ARMv7
    RAM:    256MB
    FLASH:  NOR:32MB NAND:128MB
    ETH:    2x GMAC Gigabit
    POE:    802.3 af/at POE, IEEE802.3af/IEEE802.3at(48-56V)
    WIFI:   1x 2.4Ghz Atheros qca4019 2x2 MU-MIMO
            1x 5.0Ghz Atheros qca4019 2x2 MU-MIMO
    USB:    1x 3.0
    PCI:    1x Mini PCIe
    SIM:    1x Slot
    SD:     1x MicroSD slot
    BTN:    Reset
    LED:    - Power
            - Ethernet
    UART:  1x Serial Port 4 Pin Connector (UART)
           1x Serial Port 6 Pin Connector (High Speed UART)
    POWER: 12V 2A

Installation
------------
Initial flashing can only be done via u-boot using the following commands:

tftpboot openwrt-ipq40xx-generic-compex_wpj419-squashfs-nand-factory.ubi
nand erase.chip; nand write ${fileaddr} 0x0 ${filesize}
res

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
5 years ago
Adrian Schmutzler 0b2a2f4380 ipq40xx: add label MAC address for Netgear EX6100v2/EX6150v2
This is based on the EX6150v2, which should be identical to
the EX6100v2:

The device bears two MAC addresses ("MAC 1" and "MAC 2") that
correspond to phy0 and phy1.

The ethernet MAC address (gmac0) is the same as phy0.
As this one is accessible via local-mac-address in gmac0, the
latter is used for label-mac-device.

(Although this is a one-port, gmac1 also has a local-mac-address
assigned. This has the same vendor part as the other addresses,
but completely different data for the device part.)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
David Bauer 7f187229a8 ipq40xx: add support for AVM FRITZ!Repeater 1200
Hardware
--------
SoC:   Qualcomm IPQ4019
RAM:   256M DDR3
FLASH: 128M NAND
WiFi:  2T2R IPQ4019 bgn
       2T2R IPQ4019 a/n/ac
ETH:   Atheros AR8033 RGMII PHY
BTN:   1x Connect (WPS)
LED:   Power (green/red/yellow)

Installation
------------

1. Grab the uboot for the Device from the 'u-boot-fritz1200'
   subdirectory. Place it in the same directory as the 'eva_ramboot.py'
   script. It is located in the 'scripts/flashing' subdirectory of the
   OpenWRT tree.

2. Assign yourself the IP address 192.168.178.10/24. Connect your
   Computer to one of the boxes LAN ports.

3. Connect Power to the Box. As soon as the LAN port of your computer
   shows link, load the U-Boot to the box using following command.

   > ./eva_ramboot.py --offset 0x85000000 192.168.178.1 uboot-fritz1200.bin

4. The U-Boot will now start. Now assign yourself the IP address
   192.168.1.70/24. Copy the OpenWRT initramfs (!) image to a TFTP
   server root directory and rename it to 'FRITZ1200.bin'.

5. The Box will now boot OpenWRT from RAM. This can take up to two
   minutes.

6. Copy the U-Boot and the OpenWRT sysupgrade (!) image to the Box using
   scp. SSH into the Box and first write the Bootloader to both previous
   kernel partitions.

   > mtd write /path/to/uboot-fritz1200.bin uboot0
   > mtd write /path/to/uboot-fritz1200.bin uboot1

7. Remove the AVM filesystem partitions to make room for our kernel +
   rootfs + overlayfs.

   > ubirmvol /dev/ubi0 --name=avm_filesys_0
   > ubirmvol /dev/ubi0 --name=avm_filesys_1

8. Flash OpenWRT peristently using sysupgrade.

   > sysupgrade -n /path/to/openwrt-sysupgrade.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Kristian Evensen 6f6c00cfc9 ipq40xx: Add support for Unielec U4019
This commit adds support for the 32MB storage/512MB RAM version of the U4019
IPQ4019-based board from Unielec. The board has the following specifications:

* Qualcomm IPQ4019 (running at 717MHz)
* 512MB DDR3 RAM (optional 256MB/1GB)
* 32MB SPI NOR (optional 8/16MB or NAND)
* Five gigabit ports (Qualcomm QCA8075)
* 1x 2.4 GHz wifi (QCA4019 hw1.0)
* 1x 5 Ghz wifi (QCA4019 hw1.0)
* 1x mini-PCIe slot (only USB-pins connected)
* 1x SIM slot (mini-SIM)
* 1x USB2.0 port
* 1x button
* 1x controllable LED
* 1x micro SD-card reader

Working:
* Ethernet
* Wifi
* USB-port
* mini-PCIe slot + SIM slot
* Button
* Sysupgrade

Not working:
* SD card slot (no upstream support)

Installation instructions:

In order to install OpenWRT on the U4019, you need to go via the
initramfs-image. The installation steps are as follows:

* Connect to board via serial (header exposed and clearly marked).
* Interrupt bootloader by pressing a button.
* Copy the initramfs-image to your tftp folder, call the file C0A80079.img.
* Give the network interface connected to the U4019 the address
192.168.0.156/24.
* Start your tftp-server and run tftpboot on the board.
* Run bootm when the file has been transferred, to boot OpenWRT.
* Once OpenWRT has booted, copy the sysupgrade-image to the device and run
sysupgrade to install OpenWRT on the U4019.

Notes:

- Since IPQ4019 has been moved to 4.19, I have not added support for kernel
4.14.

- There is a bug with hardware encryption on IPQ4019, causing poor performance
with TCP and ipsec (see for example FS#2355). In order to improve performance,
I have disabled hardware encryption in the DTS. We can enable hw. enc. once/if
bug is fixed.

- In order for Ethernet to work, the phy has to be reset by setting gpio 47
low/high. Adding support for phy reset via gpio required patching the
mdio-driver, and the code added comes from the vendor driver. I do not know if
patching the driver is an acceptable approach or not.

v1->v2:
* Do not use wildcard as identifier in the board.d-scripts (thanks
Adrian Schmutzler).

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
5 years ago
Adrian Schmutzler 332b1f46e9 ipq40xx: add label MAC address for FritzBox 4040
The CWMP-Account on the device's label contains the eth0 MAC
address.

This only changes 4.19 files as label-mac-device is introduced
after 19.07 branch, so there won't be a 4.14 release anymore.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Christian Lamparter 50da717e85 ipq40xx: spi-gpio: convert deprecated binding
The old gpio-{sck,miso and mosi} binding is
deprecated in favour of {sck,miso and mosi}-gpios.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Jeff Kletsky 819e7946b0 ipq40xx: Add support for Linksys EA8300 (Dallas)
The Linksys EA8300 is based on QCA4019 and QCA9888 and provides three,
independent radios. NAND provides two, alternate kernel/firmware
images with fail-over provided by the OEM U-Boot.

Installation:

  "Factory" images may be installed directly through the OEM GUI.

Hardware Highlights:

  * IPQ4019 at 717 MHz (4 CPUs)
  * 256 MB NAND (Winbond W29N02GV, 8-bit parallel)
  * 256 MB RAM
  * Three, fully-functional radios; `iw phy` reports (FCC/US, -CT):
      * 2.4 GHz radio at 30 dBm
      * 5 GHz radio on ch. 36-64 at 23 dBm
      * 5 GHz radio on ch. 100-144 at 23 dBm (DFS), 149-165 at 30 dBm
      #{ managed } <= 16, #{ AP, mesh point } <= 16, #{ IBSS } <= 1
      * All two-stream, MCS 0-9
  * 4x GigE LAN, 1x GigE Internet Ethernet jacks with port lights
  * USB3, single port on rear with LED
  * WPS and reset buttons
  * Four status lights on top
  * Serial pads internal (unpopulated)

  "Linksys Dallas WiFi AP router based on Qualcomm AP DK07.1-c1"

Implementation Notes:

  The OEM flash layout is preserved at this time with 3 MB kernel and
  ~69 MB UBIFS for each firmware version. The sysdiag (1 MB) and
  syscfg (56 MB) partitions are untouched, available as read-only.

Serial Connectivity:

  Serial connectivity is *not* required to flash.

  Serial may be accessed by opening the device and connecting
  a 3.3-V adapter using 115200, 8n1. U-Boot access is good,
  including the ability to load images over TFTP and
  either run or flash them.

  Looking at the top of the board, from the front of the unit,
  J3 can be found on the right edge of the board, near the rear

      |
   J3 |
  |-| |
  |O| | (3.3V seen, open-circuit)
  |O| | TXD
  |O| | RXD
  |O| |
  |O| | GND
  |-| |
      |

Unimplemented:

    * serial1 "ttyQHS0" (serial0 works as console)
    * Bluetooth; Qualcomm CSR8811 (potentially conected to serial1)

Other Notes:

    https://wikidevi.com/wiki/Linksys_EA8300 states

        FCC docs also cover the Linksys EA8250. According to the
	RF Test Report BT BR+EDR, "All models are identical except
	for the EA8300 supports 256QAM and the EA8250 disable 256QAM."

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years ago
Steve Glennon 9b0eb4d260 ipq40xx: Fix reboot on EnGenius ENS620EXT
This patch works around an issue where reboot would cause the AP
to power down and not reboot.

The ipq4019 restart controller reboot causes the system
to power down and not recover. Fix is to disable the restart
controller in the device tree and the device reverts to
using the watchdog to perform the reset.

The real problem is due to the buggy bootloader that ships
with the device. Steve Glennon reported in the PR for this
patch: <https://github.com/openwrt/openwrt/pull/2009> that:

"the problem was due to a bad u-boot that ships with the device.

Using the u-boot that comes with 3.5.5.3 EnGenius factory
software now allows the old code (using the do_msm_reboot)
to reboot successfully.

On to the bad news:
Well 3.5.5.3 is a bad path. Finally managed to recover. You
CANNOT use prior EnGenius firmware to downgrade.

Findings:

* They now password protect the serial console with a new, unkown
  password.
* They changed the protection on their walled-garden. I have to
  use the ssh admin@ip /bin/sh --login to get out of their
  walled-garden.
* Attempts to flash the original 3.0.0 or 3.0.1 EnGenius firmware
  fail through the UI and sysupgrade. Their firmware update GUI now
  seem to detect regular openwrt images, but they fail to flash
  Attempts to flash a normal OpenWrt image with sysupgrade fail.
[..]

Attempts to sysupgrade with EnGenius firmware fail with the same
"mandatory section(s) missing" error, so you cannot downgrade to
3.0.0 or 3.0.1."

Signed-off-by: Steve Glennon <s.glennon@cablelabs.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [added valuable
findings from github discussion]
5 years ago
Steve Glennon dc4f6b896f ipq40xx: add support for EnGenius ENS620EXT
Hardware
--------
CPU:   Qualcomm IPQ4018
RAM:   256M
FLASH: 32M SPI NOR W25Q256
ETH:   QCA8075
WiFi2: IPQ4018 2T2R 2SS b/g/n
WiFi5: IPQ4018 2T2R 2SS n/ac
LED:    - Power amber
        - LAN1(PoE) green
        - LAN2 green
        - Wi-Fi 2.4GHz green
        - Wi-Fi 5GHz green
BTN:    - WPS
UART:  115200n8 3.3V J1
       VCC(1) - GND(2) - TX(3) - RX(4)

Added basic support to get the device up and running for a sysupgrade
image only.
There is currently no way back to factory firmware, so this is a one-way
street to OpenWRT.
Install from factory condition is convoluted, and may brick your device:
1) Enable SSH and disable the CLI on the factory device from the web user
   interface (Management->Advanced)
2) Reboot the device
3) Override the default, limited SSH shell:
   a) Get into the ssh shell:
      ssh admin@192.168.1.1 /bin/sh --login
   b) Change the dropbear script to disable the limited shell. At the
      empty command prompt type:
        sed -i '/login_ssh/s/^/#/g’ dropbear
        /etc/init.d/dropbear restart
        exit
4) ssh in to a (now-) normal OpenWRT SSH session
5) Flash your built image
   a) scp openwrt-ipq40xx-engenius_ens620ext-squashfs-sysupgrade.bin
      admin@192.168.1.1:/tmp/
   b) ssh admin@192.168.1.1
   c) sysupgrade -n
      /tmp/openwrt-ipq40xx-engenius_ens620ext-squashfs-sysupgrade.bin
6) After flash completes (it may say "Upgrade failed" followed by
   "Upgrade completed") and device reboots, log in to newly flashed
   system. Note you will now need to ssh as root rather than admin.

Signed-off-by: Steve Glennon <s.glennon@cablelabs.com>
[whitespace fixes, reordered partitions, removed rng node from 4.14,
fixed 901-arm-boot-add-dts-files.patch]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Marius Genheimer 41a86debe3 ipq40xx: limit frequencies for Asus Lyra
The Asus Lyra has filters in the antenna paths which limits
the usable frequencies on both 5GHz radios.

Signed-off-by: Marius Genheimer <mail@f0wl.cc>
5 years ago
David Bauer 148d29d47b ipq40xx: add support for AVM FRITZ!Repeater 3000
Hardware
--------
CPU:   Qualcomm IPQ4019
RAM:   256M (NANYA NT5CC128M16JR-EK)
FLASH: 128M NAND (Macronix MX30LF1G18AC-XKI)
ETH:   Qualcomm QCA8072
WiFi2: IPQ4019 2T2R 2SS b/g/n
WiFi5: IPQ4019 2T2R 2SS n/ac
WiFi5: QCA9984 4T4R 4SS n/ac
LED:    - Connect green/blue/red
        - Power green
BTN:   WPS/Connect
UART:  115200n8 3.3V
       VCC - RX - TX - GND (Square is VCC)

Installation
------------
1. Grab the uboot for the Device from the 'u-boot-fritz3000'
   subdirectory. Place it in the same directory as the 'eva_ramboot.py'
   script. It is located in the 'scripts/flashing' subdirectory of the
   OpenWRT tree.

2. Assign yourself the IP address 192.168.178.10/24. Connect your
   Computer to one of the boxes LAN ports.

3. Connect Power to the Box. As soon as the LAN port of your computer
   shows link, load the U-Boot to the box using following command.

   > ./eva_ramboot.py --offset 0x85000000 192.168.178.1 uboot-fritz3000.bin

4. The U-Boot will now start. Now assign yourself the IP address
   192.168.1.70/24. Copy the OpenWRT initramfs (!) image to a TFTP
   server root directory and rename it to 'FRITZ3000.bin'.

5. The Box will now boot OpenWRT from RAM. This can take up to two
   minutes.

6. Copy the U-Boot and the OpenWRT sysupgrade (!) image to the Box using
   scp. SSH into the Box and first write the Bootloader to both previous
   kernel partitions.

   > mtd write /path/to/uboot-fritz3000.bin uboot0
   > mtd write /path/to/uboot-fritz3000.bin uboot1

7. Remove the AVM filesystem partitions to make room for our kernel +
   rootfs + overlayfs.

   > ubirmvol /dev/ubi0 --name=avm_filesys_0
   > ubirmvol /dev/ubi0 --name=avm_filesys_1

8. Flash OpenWRT peristently using sysupgrade.

   > sysupgrade -n /path/to/openwrt-sysupgrade.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 93601d647f ipq40xx: fix FRITZBox 7530 NAND controller node
This removes the 'cs-gpios' property from the AVM FRITZ!Box 7530 NAND
controller node. As pointed out by Christian Lamparter, the property is
not needed by the Qualcomm NAND controller driver.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Piotr Dymacz ff8a8074b2 ipq40xx: add ath10k-calibration-variant in AP120C-AC DTS
Use 'ath10k-calibration-variant' (with the value sent upstream) for the
second (5 GHz) radio in AP120C-AC board DTS. First radio uses the same
BDF as in one of Qualcomm reference designs.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
David Bauer 95b0c07a61 ipq40xx: add support for FritzBox 7530
Hardware
--------
CPU:   Qualcomm IPQ4019
RAM:   256M
FLASH: 128M NAND
ETH:   QCA8075
VDSL:  Intel/Lantiq VRX518 PCIe attached
       currently not supported
DECT:  Dialog SC14448
       currently not supported
WiFi2: IPQ4019 2T2R 2SS b/g/n
WiFi5: IPQ4019 2T2R 2SS n/ac
LED:    - Power/DSL green
        - WLAN green
        - FON/DECT green
        - Connect/WPS green
        - Info green
        - Info red
BTN:    - WLAN
        - FON
        - WPS/Connect
UART:  115200n8 3.3V (located under the Dialog chip)
       VCC - RX - TX - GND (Square is VCC)

Installation
------------
1. Grab the uboot for the Device from the 'u-boot-fritz7530'
   subdirectory. Place it in the same directory as the 'eva_ramboot.py'
   script. It is located in the 'scripts/flashing' subdirectory of the
   OpenWRT tree.

2. Assign yourself the IP address 192.168.178.10/24. Connect your
   Computer to one of the boxes LAN ports.

3. Connect Power to the Box. As soon as the LAN port of your computer
   shows link, load the U-Boot to the box using following command.

   > ./eva_ramboot.py --offset 0x85000000 192.168.178.1 uboot-fritz7530.bin

4. The U-Boot will now start. Now assign yourself the IP address
   192.168.1.70/24. Copy the OpenWRT initramfs (!) image to a TFTP
   server root directory and rename it to 'FRITZ7530.bin'.

5. The Box will now boot OpenWRT from RAM. This can take up to two
   minutes.

6. Copy the U-Boot and the OpenWRT sysupgrade (!) image to the Box using
   scp. SSH into the Box and first write the Bootloader to both previous
   kernel partitions.

   > mtd write /path/to/uboot-fritz7530.bin uboot0
   > mtd write /path/to/uboot-fritz7530.bin uboot1

7. Remove the AVM filesystem partitions to make room for our kernel +
   rootfs + overlayfs.

   > ubirmvol /dev/ubi0 --name=avm_filesys_0
   > ubirmvol /dev/ubi0 --name=avm_filesys_1

8. Flash OpenWRT peristently using sysupgrade.

   > sysupgrade -n /path/to/openwrt-sysupgrade.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
[removed pcie-dts range node, refreshed on top of AP120-AC/E2600AC]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
张鹏 bbab33724d ipq40xx: add support for Qxwlan E2600AC C1 and C2
Qxwlan E2600AC C1 based on IPQ4019

Specifications:
SOC:	Qualcomm IPQ4019
DRAM:	256 MiB
FLASH:	32 MiB Winbond W25Q256
ETH:	Qualcomm QCA8075
WLAN:	5G + 5G/2.4G
	* 2T2R 2.4/5 GHz
	 - QCA4019 hw1.0 (SoC)
	* 2T2R 5 GHz
	 - QCA4019 hw1.0 (SoC)
INPUT:  Reset buutton
LED:	1x Power ,6 driven by gpio
SERIAL: UART (J5)
UUSB:	USB3.0
POWER:	1x DC jack for main power input (9-24 V)
SLOT:	Pcie (J25), sim card (J11), SD card (J51)

Flash instruction (using U-Boot CLI and tftp server):

 - Configure PC with static IP 192.168.1.10 and tftp server.
 - Rename "sysupgrade" filename to "firmware.bin" and place it in tftp
   server directory.
 - Connect PC with one of RJ45 ports, power up the board and press
   "enter" key to access U-Boot CLI.
 - Use the following command to update the device to OpenWrt: "run lfw".

Flash instruction (using U-Boot web-based recovery):

 - Configure PC with static IP 192.168.1.xxx(2-254)/24.
 - Connect PC with one of RJ45 ports, press the reset button, power up
   the board and keep button pressed for around 6-7 seconds, until LEDs
   start flashing.
 - Open your browser and enter 192.168.1.1, select "sysupgrade" image
   and click the upgrade button.

Qxwlan E2600AC C2 based on IPQ4019

Specifications:
SOC:	Qualcomm IPQ4019
DRAM:	256 MiB
NOR:	16 MiB Winbond W25Q128
NAND:	128MiB Micron MT29F1G08ABAEAWP
ETH:	Qualcomm QCA8075
WLAN:	5G + 5G/2.4G
	* 2T2R 2.4/5 GHz
	 - QCA4019 hw1.0 (SoC)
	* 2T2R 5 GHz
	 - QCA4019 hw1.0 (SoC)
INPUT:  Reset buutton
LED:	1x Power, 6 driven by gpio
SERIAL: UART (J5)
USB:	USB3.0
POWER:	1x DC jack for main power input (9-24 V)
SLOT:	Pcie (J25), sim card (J11), SD card (J51)

Flash instruction (using U-Boot CLI and tftp server):

 - Configure PC with static IP 192.168.1.10 and tftp server.
 - Rename "ubi" filename to "ubi-firmware.bin" and place it in tftp
   server directory.
 - Connect PC with one of RJ45 ports, power up the board and press
   "enter" key to access U-Boot CLI.
 - Use the following command to update the device to OpenWrt: "run lfw".

Flash instruction (using U-Boot web-based recovery):

 - Configure PC with static IP 192.168.1.xxx(2-254)/24.
 - Connect PC with one of RJ45 ports, press the reset button, power up
   the board and keep button pressed for around 6-7 seconds, until LEDs
   start flashing.
 - Open your browser and enter 192.168.1.1, select "ubi" image
   and click the upgrade button.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
[ added rng node. whitespace fixes, ported 02_network,
ipq-wifi Makefile, misc dts fixes, trivial message changes ]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Piotr Dymacz c568c6dc09 ipq40xx: add support for ALFA Network AP120C-AC
ALFA Network AP120C-AC is a dual-band ceiling AP, based on Qualcomm
IPQ4018 + QCA8075 platform.

Specification:

- Qualcomm IPQ4018 (717 MHz)
- 256 MB of RAM (DDR3)
- 16 MB (SPI NOR) + 128 MB (SPI NAND) of flash
- 2x Gbps Ethernet, with 802.3af PoE support in one port
- 2T2R 2.4/5 GHz (IPQ4018), with ext. FEMs (QFE1952, QFE1922)
- 3x U.FL connectors
- 1x 1.8 dBi (Bluetooth) and 2x 3/5 dBi dual-band (Wi-Fi) antennas
- Atmel/Microchip AT97SC3205T TPM module (I2C bus)
- TI CC2540 Bluetooth LE module (USB 2.0 bus)
- 4x LED (all driven by GPIO)
- 1x button (reset)
- 1x USB 2.0 (optional, not installed in indoor version)
- DC jack for main power input (12 V)
- UART header available on PCB (2.0 mm pitch)

Flash instruction:

1. This board uses dual-image feature (128 MB NAND is divided into two
   64 MB partitions: 'rootfs1' and 'rootfs2').
2. Before update, make sure your device is running firmware no older
   than v1.1 (previous versions have incompatible U-Boot).
3. Use 'factory' image in vendor GUI or for sysupgrade tool, without
   preserving settings.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Marius Genheimer 9ad3967f14 ipq40xx: add support for ASUS Lyra
SoC:   Qualcomm IPQ4019 (Dakota) 717 MHz, 4 cores
RAM:   256 MiB (Nanya NT5CC128M16IP-DI)
FLASH: 128 MiB (Macronix NAND)
WiFi0: Qualcomm IPQ4019 b/g/n 2x2
WiFi1: Qualcomm IPQ4019 a/n/ac 2x2
WiFi2: Qualcomm Atheros QCA9886 a/n/ac
BT:    Atheros AR3012
IN:    WPS Button, Reset Button
OUT:   RGB-LED via TI LP5523 9-channel Controller
UART:  Front of Device - 115200 N-8
       Pinout 3.3v - RX - TX - GND (Square is VCC)

Installation:
1. Transfer OpenWRT-initramfs image to the device via SSH to /tmp.
Login credentials are identical to the Web UI.

2. Login to the device via SSH.

3. Flash the initramfs image using

> mtd-write -d linux -i openwrt-image-file

4. Power-cycle the device and wait for OpenWRT to boot.

5. From there flash the OpenWRT-sysupgrade image.

Ethernet-Ports: Although labeled identically, the port next to
the power socket is the LAN port and the other one is WAN. This
is the same behavior as in the stock firmware.

Signed-off-by: Marius Genheimer <mail@f0wl.cc>
[Dropped setup_mac 02_network in favour of 05_set_iface_mac_ipq40xx.sh,
reorderd 02_network entries, added board.bin WA for the QCA9886 from ath79,
minor dts touchup, added rng to 4.19 dts]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Christian Lamparter 5ee9763aaa ipq40xx: ea6350v3: 4.19: enable pseudo rng support
Robert Marko made a big effort to enable the rng on all
ipq40xx for 4.19, so let's continue the quest.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Oever González a873b29284 ipq40xx: add support for Linksys EA6350v3
Specifications:
SOC: Qualcomm IPQ4018
RAM: 256 MiB Samsung K4B2G1646F-BYK0
FLASH1: MX25L1605D 2 MB
FLASH2: Winbond W25N01GV 128Mb
ETH: Qualcomm QCA8075
WLAN0: Qualcomm Atheros QCA4018 2.4GHz 802.11b/g/n 2x2
WLAN1: Qualcomm Atheros QCA4018 5GHz 802.11n/ac W2 2x2
INPUT: WPS, Reset
LED: Status - Green
SERIAL: Header at J19, Beneath DC Power Jack
        1-VCC ; 2-TX ; 3-RX; 4-GND;
        Serial 115200-8-N-1.

Tested and working:
- USB (requires extra packages)
- LAN Ethernet (Correct MAC-address)
- WAN Ethernet (Correct MAC-address)
- 2.4 GHz WiFi (Correct MAC-address)
- 5 GHz WiFi (Correct MAC-address)
- Factory installation from Web UI
- OpenWRT sysupgrade
- LED
- Reset Button

Need Testing:
- WPS button

Install via Web UI:
- Attach to a LAN port on the router.
- Connect to the Linksys Smart WiFi Page (default 192.168.1.1) and login
- Select the connectivity tab on the left
- In the manual update box on the right
- Select browse, and browse to
  openwrt-ipq40xx-linksys_ea6350v3-squashfs-factory.bin
- Click update.
- Read and accept the warning
- The router LED will start blinking. When the router LED goes solid, you
  can now navigate to 192.168.1.1 to your new OpenWrt installation.

Sysupgrade:
- Flash the sysupgrade image as usual. Please: try to do a reset everytime
  you can (doing it with LuCI is easy and can be done in the same step).

Recovery (Automatic):
- If the device fails to boot after install or upgrade, whilst the unit is
  turned on:
1 - Wait 15 seconds
2 - Switch Off and Wait 10 seconds
3 - Switch on
4 - Repeat steps 1 to 3, 3 times then go to 5.
5 - U-boot will have now erased the failed update and switched back to the
    last working firmware - you should be able to access your router on
    LAN.

Recovery (Manual):
- The steps for manual recovery are the same as the generic u-boot tftp
  client method.

Back To Stock:
- Use the generic recovery using the tftp client method to flash the
  "civic.img". Also you can strip-and-pad the original image and use
  the generic "mtd" method by flashing over the "kernel" partition.
* Just be careful to flash in the partition that the device is currently
  booted.

Signed-off-by: Ryan Pannell <ryan@osukl.com>
Signed-off-by: Oever González <notengobattery@gmail.com>
[minor edits, removed second compatible of nand, added dtb entry to 4.19]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Christian Lamparter b2e1333de3 ipq40xx: 4.19: fix pcie wifi unit-address of the MR33 and A62
The unit address should be wifi@1,0 since the device is located
at 0000:01:00.0.

Reported-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Petr Štetiar 540a7d1ecc ipq40xx: dts: Unify naming of gpio-led nodes
In DTS Checklist[1] we're now demanding proper generic node names, as
the name of a node should reflect the function of the device and use
generic name for that[2]. Everybody seems to be copy&pasting from DTS
files available in the repository today, so let's unify that naming
there as well and provide proper examples.

1. https://openwrt.org/submitting-patches#dts_checklist
2. https://github.com/devicetree-org/devicetree-specification/blob/master/source/devicetree-basics.rst#generic-names-recommendation

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [split up]
5 years ago
Petr Štetiar 98c6c8cdfe ipq40xx: dts: Unify naming of gpio-keys nodes
In DTS Checklist[1] we're now demanding proper generic node names, as
the name of a node should reflect the function of the device and use
generic name for that[2]. Everybody seems to be copy&pasting from DTS
files available in the repository today, so let's unify that naming
there as well and provide proper examples.

1. https://openwrt.org/submitting-patches#dts_checklist
2. https://github.com/devicetree-org/devicetree-specification/blob/master/source/devicetree-basics.rst#generic-names-recommendation

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [split up]
5 years ago
Christian Lamparter ef5ff08662 ipq40xx: convert to device-tree based USB LED trigger
Thanks to the ledtrig-usb.c the USB LED trigger can be
setup in the device-tree definition for the Asus RT-AC58U
and ZyXEL NBG6617.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Christian Lamparter a5ac9030ed ipq40xx: MR33: device-tree update
- 4.19 no longer refuses to initialize the mdio bus if
   a phy is not connected.

 - fix partition unit-address

 - restrict partition offset and size to 32-bit integers.

 - add note to warn people not to mess with the ubi
   partition size.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Christian Lamparter a2501ebfb0 ipq40xx: remove qcom,ipq4019 on all devices
Upstream commit:
80483c3abf8 ("ARM: qcom: Cleanup/Remove unnecessary board file")
removed all the platform device compatibles stating that:
"This patch removes the unnecessary board file. The generic machine
definition is sufficient for the Qualcomm platforms."

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Christian Lamparter 00dd84ca2e ipq40xx: rt-ac58u: fix device-tree snafu
- make the device userspace integration (WIFI,MAC,sysupgrade)
   work again by renaming the ubi to UBI_DEV as a temporary measure.
   In the future, once 4.14 support is dropped, this can all be
   refactored again. *sigh*

 - use the wifi0 and wifi1 labels

 - follow Device-Tree Release v0.2 2.2.2 Generic Names Recommendation

 - fix duplicated partition node-names

 - remove qcom,ipq4019 platform compatible. it's no longer needed
   (and wrong because the chip is a qcom,ipq4018).

Fixes: 4c67f3ad78d ("ipq40xx: Adapt 4.19 DTS for upstream SPI-NAND driver")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Robert Marko 077a63db1d ipq40xx: 4.19: Enable pseudo random number generator
IPQ40xx series has a HW pseudo random number generator built in.
It already has a node in the upstream ipq4019.dtsi so we just need to enable it.
Its driver has been rewritten to use crypto API so we dont have char interface like under 4.14 kernel.

Signed-off-by: Robert Marko <robimarko@gmail.com>
5 years ago
Robert Marko 59485f7486 ipq40xx: files-4.19: Clear some DTC warnings
DTC was throwing warnings like this:
image-qcom-ipq4018-jalapeno.dtb: Warning (avoid_unnecessary_addr_size): /soc/spi@78b5000/m25p80@0: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property
image-qcom-ipq4018-jalapeno.dtb: Warning (avoid_unnecessary_addr_size): /soc/spi@78b5000/spi-nand@1: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

So lets fix this for our downstream boards.

Signed-off-by: Robert Marko <robimarko@gmail.com>
5 years ago
Robert Marko c29c8838a1 ipq40xx: Use upstream SPI-NAND driver instead of MT29F
Since 4.19 upstream kernel provides generic SPI-NAND
framework and vendor specific drivers.
Since only users of MT29F are 2 boards with Winbond
W25N01GV SPI-NAND for which support has been backported
from 4.20 we can drop the ever stuck in staging MT29F
driver and instead use the upstream driver.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [squashed]
5 years ago
Robert Marko 96b69c2e9a ipq40xx: Add files for 4.19
This copies over files from 4.14

Signed-off-by: Robert Marko <robimarko@gmail.com>
5 years ago