Commit Graph

23383 Commits (fbd4214bb0727268aa535af5b600d38939ec8dbc)

Author SHA1 Message Date
Adrian Schmutzler 1e55df2e41 oxnas: use vendor_model scheme for ox810se
Most newer targets have been converted to consistently use
vendor_model scheme for device definitions/image names, ox820 is
using it as well, so let's just convert ox810se for consistency.

While at it, use generic setup for DEVICE_DTS and add SUPPORTED_DEVICES.
The latter have been introduced for ox820 already in
cf7896117b ("oxnas: enable image metadata by setting SUPPORTED_DEVICES")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Hauke Mehrtens 64de3076c3 lantiq: Fix warning in SPI driver
This fixes a warning in the SPI driver at bootup. This warning is seen
in kernel 5.4 on lantiq deives.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Phi Nguyen eda9751d86 ipq40xx: support reset button for WPJ419
Compex WPJ419 has a reset button on a GPIO pin.

Signed-off-by: Phi Nguyen <phind.uet@gmail.com>
4 years ago
Adrian Schmutzler b057862e24 Revert "ramips: fix flash layout for TP-Link TL-WR841N v14"
This reverts commit 1623defbdb.

As already stated in the reverted patch, the OEM firmware will
properly recreate the config partition if it is overwritten by
OpenWrt.

The main reason for adding the partition was the image size
restriction imposed by the 0x3d0000 limitation of the TFTP
flashing process. Addressing this by shrinking the firmware
partition is not a good solution to that problem, though:

1. For a working image, the size of the content has to be smaller
   than the available space, so empty erase blocks will remain.

2. Conceptually, the restriction is on the image, so it makes sense
   to implement it in the same way, and not via the partitioning.
   Users could e.g. do initial flash with TFTP restriction with
   an older image, and then sysupgrade into a newer one, so TFTP
   restriction does not apply.

3. The (content) size of the recovery image is enforced to 0x3d0000
   by the tplink-v2-image command in combination with
   TPLINK_FLASHLAYOUT (flash layout in mktplinkfw2.c) anyway.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 0a5d74fa68 arc770: use generic 02_sysinfo
Currently arc770 sets a board name from compatible for no apparent
reason. Just use the compatible directly instead.

This theoretically removes a board name "generic" when no compatible
was present, however, there is no case where this "generic" board
name was actually used.

This also fixes an issue where snps,axs101 would not have been
properly detected anyway, as its case was not set up syntactically
correct.

Fixes: 576621f1e3 ("linux: add support of Synopsys ARC770-based boards")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 3c190ef112 archs38: use generic 02_sysinfo
Currently archs38 sets a board name from compatible for no apparent
reason. Just use the compatible directly instead.

This theoretically removes a board name "generic" when no compatible
was present, however, there is no case where this "generic" board
name was actually used.

This also fixes an issue where snps,axs103 would not have been
properly detected anyway, as its case was not set up syntactically
correct.

Fixes: 73015c4cb3 ("linux: add support of Synopsys ARCHS38-based boards")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 9662b9d688 ramips: switch MT7620 subtarget to 5.4
MT7620 seems to work fine with kernel 5.4. Set the default kernel
version to 5.4 to bring this to a broader audience.

Tested on Archer C2 v1 / Archer C20i

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer 4cd5ce5a7f ramips: increase SPI frequency for MT7620 Archer
Increase the SPI frequency for the MT7620 based TP-Link Archer
series to 30MHz.

TP-Link uses different SPI flash chips for the same board
revision, so be conservative to not break boards with a
different chip. 30MHz should be well supported by all chips.

Tested on Archer C2 v1 (GD25Q64B) and Archer C20i (W25Q64FV).

Archer C20i (before)
====================
root@OpenWrt:~# time dd if=/dev/mtd1 of=/tmp/test.bin bs=64k
122+0 records in
122+0 records out
real	0m 15.30s
user	0m 0.00s
sys	0m 15.29s

Archer C20i (after)
===================
root@OpenWrt:~# time dd if=/dev/mtd1 of=/tmp/test.bin bs=64k
122+0 records in
122+0 records out
real	0m 5.99s
user	0m 0.00s
sys	0m 5.98s

Signed-off-by: David Bauer <mail@david-bauer.net>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 9a9cdc65c4 ath79: re-enable image generation for GL-AR750S
The bootloader only writes the first 2MB of the image to the NOR flash
when installing the NAND factory image. The bootloader is capable of
booting larger kernels as it boots from the memory mapped SPI flash.

Disable the NAND factory image. The NAND can be bootstrapped by writing
the NAND initramfs image using the NOR upgrade method in the bootloader
web-recovery and sysupgrading from there. The NOR variant is not
affected.

Also refactor the partition definitions in the DTS to make them less
annoying to read.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler 5e86877f36 ath79: correctly define WiFi switch for TL-WR841ND v8
The TL-WR841ND v8 feature a WiFi switch instead of a button.
This adds the corresponding input-type to prevent booting into
failsafe regularly.

This has been defined correctly in ar71xx, but was overlooked
when migrating to ath79. In contrast, the TL-WR842ND v2, which
has the key set up as switch in ar71xx, actually has a button.
The TL-MR3420 v2 has a button as well and is set up correctly
for both targets. (Information based on TP-Link user guide)

Note:

While looking into this, I found that support PR for TL-MR3420 v2
switched reset button to ACTIVE_HIGH. However, the other two
device still use ACTIVE_LOW. This seems strange, but I cannot
verify it lacking the affected devices.

Fixes: FS#2733
Fixes: 9601d94138 ("add support for TP-Link TL-WR841N/ND v8")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 42dc5c2a3f ramips: improve LED support for D-Link DIR-615 D series
This patch adds a trigger for the WAN LED and enhances support for
the WiFi LED by enabling activity indication.

This is based on bug report feedback (see reference below).

While at it, update the LED node names in DTS file.

Fixes: FS#732

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 05c74e4000 omap: derive DEVICE_DTS from device name
In most cases the DEVICE_DTS name can be derived easily from the
node name, so let's do this to enforce harmonized names where
possible.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler eff0a0e39e apm821xx: derive DEVICE_DTS from device name
The DEVICE_DTS variable always matches the device definition name,
just with "_" replaced by "-". Thus, create a DEVICE_DTS definition
in Device/Default and drop all the individual statements.

If necessary in the future, local DEVICE_DTS will still overwrite
that default.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler a2fee73e27 bcm47xx: fix switch setup for Linksys WRT610N v2
WRT610N V2 is not detected by the initial network configuration script.
The switch remains unconfigured and wlan/lan vlans are not created.

This adds the correct setup for the device.

Fixes: FS#1869

Suggested-by: Alessandro Radicati
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 683193cfb7 layerscape: fix indent
Fix indent to be consistent with the rest of the file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Nelson Cai 6269f10ea4 ramips: fix network setup for Ubiquiti ER-X/ER-X-SFP
The function name ucidef_set_interface_lan_wan does not exist,
use the proper name by adding an "s" and thereby fix network
setup on these devices.

Fixes: 22468cc40c (ramips: erx and erx-sfp: fix missing WAN interface)

Signed-off-by: Nelson Cai <niphor@gmail.com>
[commit message/title facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Dustin Gathmann d5a148f5c8 lantiq/xrx200: make WLAN button responsive on Fritzbox 7360 & 7362
Pressing the 'WLAN' button should enable/disable wireless activity.
Currently, the button is mapped to the KEY_WLAN, which will not
have this effect.
This patch changes the mapping of the WLAN button, so a button
press will emit an action for the 'rfkill' key instead of 'wlan'.
Apparently, this is what stock OpenWRT expects.

This fix is analogous to the preceding patch for Fritzbox 3370.

Signed-off-by: Dustin Gathmann <dzsoftware@posteo.org>
4 years ago
Dustin Gathmann 0ee30adb46 lantiq/xrx200: fix WLAN button actions for Fritzbox 3370
The WLAN button actions are reversed, i.e. pressing the button emits a
'released' action, and vice versa.
This can easily be checked by adding
logger -t button_action "$BUTTON $ACTION"
as the second line of /etc/rc.button/rfkill, and using logread to read
the events (assuming the preceding patch has been applied).
Defining the GPIO as ACTIVE_LOW corrects this behavior.

Signed-off-by: Dustin Gathmann <dzsoftware@posteo.org>
4 years ago
Dustin Gathmann a53bf63756 lantiq/xrx200: make WLAN button responsive on Fritzbox 3370
Pressing the 'WLAN' button should enable/disable wireless activity.
However, on the Fritzbox 3370 this doesn't have an effect.
This patch changes the mapping of the physical WLAN button, so a button
press will emit an action for the 'rfkill' key instead of 'wlan'.
Apparently, this is what stock OpenWRT expects, and also what is
implemented for most other devices.

Signed-off-by: Dustin Gathmann <dzsoftware@posteo.org>
4 years ago
Alexander Müller 1623defbdb ramips: fix flash layout for TP-Link TL-WR841N v14
The config partition was missing from the flash layout of the device.

Although the stock firmware resets a corrupted config partition to the
default values, the TFTP flash with an image bigger than 0x3d0000 will
truncate the image as the bootloader only copies 0x3d0000 bytes to flash
during TFTP flashing.

Fixed by adding the config partition and shrinking the firmware
partition.

Fixes: 3fd97c522b ("ramips: add support for TP-Link TL-WR841n v14")

Signed-off-by: Alexander Müller <donothingloop@gmail.com>
4 years ago
Adrian Schmutzler 2e4626ae77 ramips: remove incorrect mtd-eeprom for TP-Link TL-WR841N v14
The factory partition on this device is only 64k in size, so having
mediatek,mtd-eeprom = <&factory 0x10000> would place the EEPROM data
after the end of the flash. As can be verified against the TP-Link
GPL sources, which contain the EEPROM data as binary blob, the actual
address for the EEPROM data is 0x0.

Since 0x0 is default for MT7628, the incorrect line is just removed.

This error is the reason for the abysmal Wifi performance that people
are complaining about for the WR841Nv14.

Fixes: 3fd97c522b ("ramips: add support for TP-Link TL-WR841n v14")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 612d5282b5 ramips: don't create switch config for VIXMINI
Don't create UCI switch config for the GL.iNet microuter-N300 and
VIXMINI. These devices only have a single LAN port.
Creating the switch config makes usage of VLANs more complicated,
as they would have to be configured on the MAC as well as the "switch".

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler b78a266888 lantiq: move 01_led_migration script to subtargets
Split the /etc/uci-defaults/01_led_migration scripts into subtargets
as already done for most of the other base-files.

While this introduces a minor amount of code duplication, it still
is considered an improvement, as device-specific settings are kept
together in the subtargets' base-files and the script at hand can be
removed entirely for two of the subtargets not needing it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Martin Schiller 4d8552c265 lantiq: move dsl related base-files into own package
It does not make sense to install this components on lantiq systems
where the dsl subsystem is not needed/used.

This also makes it possible to use the files also on other targets.
(hopefully ipq401x / FritzBox 7530 in the near future)

Signed-off-by: Martin Schiller <ms.3headeddevs@gmail.com>
4 years ago
Adrian Schmutzler 1de9cac2f9 ramips: move redundant console setup to mt7621 SoC DTSI
For mt7621, console is set up via DTS bootargs individually in
device DTS/DTSI files. However, 44 of 74 statements use the
following setting:

	chosen {
		bootargs = "console=ttyS0,57600";
	};

Therefore, don't repeat ourselves and move that definition to the SoC
DTSI file to serve as a default value.

This patch is cosmetic.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
John Audia b6443367d8 kernel: bump 5.4 to 5.4.52
update_kernel.sh refreshed all patches, no human interaction was needed

Build system: x86_64
Run-tested: Netgear R7800 (ipq806x)

Signed-off-by: John Audia <graysky@archlinux.us>
4 years ago
Salvatore Mesoraca 2a43ab4a18 ramips: add arl_table support for MT7530
Use switch.h API to expose MT7530's ARL table to
user space.

Signed-off-by: Salvatore Mesoraca <salvatore@samknows.com>
4 years ago
Alberto Bursi 480003e9eb mvebu: add Kobol Helios 4 device
The Helios 4 is a NAS from Kobol
that is powered by an Armada 38x
MicroSOM from Solidrun, similarly
to Clearfog.

This device has:
-Armada 38x CPU
 (dual core ARMv7 1.6 Ghz)
-2 GB of ECC RAM
-Gigabit ethernet (Marvell)
-2x USB 3.0 ports
-4x Sata 3.0 ports
-i2c header (J9 |>GND|SDA|SCL|VCC)
-2x 3-pin fan headers with PWM
-micro-usb port is a TTL/UART to
 USB converter connected to TTL
-MicroSD card slot
-System, 4xSata and 1xUSB LEDs

NOT WORKING: fan control

Fan Control requires a kernel patch
that is available in the Armbian
project (the "default firmware"
of this device) and named
mvebu-gpio-remove-hardcoded
-timer-assignment
This patch isn't acceptable
by OpenWrt, it should be upstreamed.
I also have that patch in my own
local OpenWrt builds,
in case you want a more
clean and less confusing patch
for upstreaming.

To install, write the disk image
on a micro SD card with dd or
win32 disk imager, insert the
card in the slot.
Check that the dip switch battery
for boot selection is as follows
Switch 1 and 2 down/off, switches
3, 4, 5 up/on.

Signed-off-by: Alberto Bursi <bobafetthotmail@gmail.com>
4 years ago
Mateus B. Cassiano 73e8f23579 ramips: add support for D-Link DIR-867/DIR-882 A1
This patch adds support for D-Link DIR-867 A1 and D-Link DIR-882 A1. Given
the similarity of these devices, this patch also introduces a common DTS
shared between DIR-867 A1, DIR-878 A1 and DIR-882 A1.

Specifications:
* Board: AP-MTKH7-0002
* SoC: MediaTek MT7621AT
* RAM: 128 MB (DDR3)
* Flash: 16 MB (SPI NOR)
* WiFi: MediaTek MT7615N (x2)
* Switch: 1 WAN, 4 LAN (Gigabit)
* Ports: 1 USB 2.0, 1 USB 3.0
* Buttons: Reset, WiFi Toggle, WPS
* LEDs: Power (green/orange), Internet (green/orange), WiFi 2.4G (green),
        WiFi 5G (green), USB 2.0 (green), USB 3.0 (green)

Notes:
* WiFi 2.4G and WiFi 5G LEDs are wired directly to the wireless chips
* DIR-867 wireless chips are limited to 3x3 streams at hardware level
* USB ports and related LEDs available only on DIR-882

Serial port:
* Parameters: 57600, 8N1
* Location: J1 header (close to the Reset, WiFi and WPS buttons)
* Pinout: 1 - VCC
          2 - RXD
          3 - TXD
          4 - GND

Installation:
* D-Link Recovery GUI: power down the router, press and hold the reset
  button, then re-plug it. Keep the reset button pressed until the power
  LED starts flashing orange, manually assign a static IP address under
  the 192.168.0.xxx subnet (e.g. 192.168.0.2) and go to http://192.168.0.1

* Some modern browsers may have problems flashing via the Recovery GUI,
  if that occurs consider uploading the firmware through cURL:

    curl -v -i -F "firmware=@file.bin" 192.168.0.1

Signed-off-by: Mateus B. Cassiano <mbc07@live.com>
[move DEVICE_VARIANT to individual definitions]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Santiago Rodriguez-Papa ed087cba8a ramips: add support for Linksys EA7300 v1
Specifications:

* SoC:      MediaTek MT7621A              (880 MHz 2c/4t)
* RAM:      Nanya NT5CC128M16IP-DIT       (256M DDR3-1600)
* Flash:    Macronix MX30LF1G18AC-TI      (128M NAND)
* Eth:      MediaTek MT7621A              (10/100/1000 Mbps x5)
* Radio:    MT7615N                       (2.4 GHz & 5 GHz)
            4 antennae: 1 internal and 3 non-deatachable
* USB:      3.0 (x1)
* LEDs:
    White   (x1 logo)
    Green   (x6 eth + wps)
    Orange  (x5, hardware-bound)
* Buttons:
    Reset   (x1)
    WPS     (x1)

Everything works! Been running it for a couple weeks now and haven't had
any problems. Please let me know if you run into any.

Installation:

Flash factory image through GUI.

This might fail due to the A/B nature of this device. When flashing, OEM
firmware writes over the non-booted partition. If booted from 'A',
flashing over 'B' won't work. To get around this, you should flash the
OEM image over itself. This will then boot the router from 'B' and
allow you to flash OpenWRT without problems.

Reverting to factory firmware:

Hard-reset the router three times to force it to boot from 'B.' This is
where the stock firmware resides. To remove any traces of OpenWRT from
your router simply flash the OEM image at this point.

Signed-off-by: Santiago Rodriguez-Papa <contact@rodsan.dev>
[use v1 only, minor DTS adjustments, use LINKSYS_HWNAME and add it to
DEVICE_VARS, wrap DEVICE_PACKAGES, adjust commit message/title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 95a05b12d7 ramips: provide common definition for ELECOM WRC GS devices
Add a common definition for ELECOM WRC "GS" devices to mt7621.mk
to not repeat the same assignments five times.

To keep the naming consistent, slightly rename the DTSI and the
factory image recipe as well.

Note that elecom_wrc-1167ghbk2-s uses a slightly different build
recipe for the factory image, so we keep it separate.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: INAGAKI Hiroshi <musashino.open@gmail.com> [WRC-1750GSV]
4 years ago
INAGAKI Hiroshi a79f55e7e0 ramips: add support for ELECOM WRC-1750GS/GSV
ELECOM WRC-1750GS is a 2.4/5 GHz band 11ac (Wi-Fi 5) router, based on
MT7621A.

WRC-1750GSV has the same hardware with WRC-1750GS.

Specification:

- SoC		: MediaTek MT7621A
- RAM		: DDR3 128 MiB
- Flash		: SPI-NOR 16 MiB
- WLAN		: 2.4/5 GHz 3T3R (2x MediaTek MT7615)
- Ethernet	: 10/100/1000 Mbps x5
  - Switch	: MediaTek MT7530 (SoC)
- LED/keys	: 4x/6x (2x buttons, 1x slide-switch)
- UART		: through-hole on PCB
  - J4: 3.3V, GND, TX, RX from ethernet port side
  - 57600n8
- Power		: 12VDC, 1.5A

Flash instruction using factory image:

1. Boot WRC-1750GS (or WRC-1750GSV) normally
2. Access to "http://192.168.2.1/" and open firmware update page
   ("ファームウェア更新")
3. Select the OpenWrt factory image and click apply ("適用") button
   for WRC-1750GS : wrc-1750gs-squashfs-factory.bin
   for WRC-1750GSV: wrc-1750gsv-squashfs-factory.bin
4. Wait ~120 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
4 years ago
John Crispin eff87b8f93 mediatek: backport latest pci/e driver from upstream
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
John Crispin 5a5031e70b mediatek: generate UBI images for the rev board
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
John Crispin ea2884e018 mediatek: minor fix to eip97 driver
This patch makes the driver work on the newer v2.3 core.

Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
Adrian Schmutzler 9f3415d30b ath79: harmonize model names for Ubiquiti devices
This harmonizes the model names for the ath79 Ubiquiti devices by
applying a few minor cosmetic adjustments:

- Removes hyphens where they are not found in the product names
  (Ubiquiti uses hyphens only for the abbreviated version names
  like UAP-AC-PRO which we don't use anyway.)

- Add (XM) suffix for DTS model strings to help with distinguishing
  them from their XW counterparts.

- Remove DEVICE_VARIANT for LAP-120 which actually was an alternate
  device name.

- Generally make DTS model names and those from generic-ubnt.mk
  more consistent.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Vieno Hakkerinen 8c7e9cc6b5 ath79: add support for Ubiquiti PowerBridge M
This adds support for the Ubiquiti PowerBridge M, which has the same
board/LEDs as the Bullet M XM, but different case and antennas.

Specifications:
- AR7241 SoC @ 400 MHz
- 64 MB RAM
- 8 MB SPI flash
- 1x 10/100 Mbps Ethernet, 24 Vdc PoE-in
- Internal antenna: 25 dBi
- POWER/LAN green LEDs
- 4x RSSI LEDs (red, orange, green, green)
- UART (115200 8N1) on PCB

Flashing via WebUI:
Upload the factory image via the stock firmware web UI.

Attention: airOS firmware versions >= 5.6 have a new bootloader with
an incompatible partition table!

Please downgrade to <= 5.5 _before_ flashing OpenWrt!
Refer to the device's Wiki page for further information.

Flashing via TFTP:
Same procedure as other Bullet M (XM) boards.

- Use a pointy tool (e.g., pen cap, paper clip) and keep the reset
button on the device or on the PoE supply pressed
- Power on the device via PoE (keep reset button pressed)
- Keep pressing until LEDs flash alternatively LED1+LED3 =>
LED2+LED4 => LED1+LED3, etc.
- Release reset button
- The device starts a TFTP server at 192.168.1.20
- Set a static IP on the computer (e.g., 192.168.1.21/24)
- Upload via tftp the factory image:
$ tftp 192.168.1.20
  tftp> bin
  tftp> trace
  tftp> put openwrt-ath79-generic-xxxxx-ubnt_powerbridge-m-squashfs-factory.bin

Signed-off-by: Vieno Hakkerinen <vieno@hakkerinen.eu>
4 years ago
John Crispin 9da2b56760 ipq40xx: fix ethernet vlan double tagging
As the the SoC uses implicit vlan tagging for dual MAC support, the
offload feature breaks when using double tagging.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
John Crispin 2557d2eb4c ipq40xx: merge all ar40xx patches into one single patch
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
Adrian Schmutzler 3635f7efc1 ipq806x: really fix aliases node for Qualcomm IPQ8064/DB149
Having looked at this again, it appears that only gsbi2_serial
is actually enabled for this device, so the entry in the broken
aliases node was correct.

Therefore, this needs to set its own serial0 instead of inheriting
"serial0 = &gsbi4_serial;" from DTSI. Do this with the correctly
named aliases node now.

Fixes: c83f7b6d21 ("ipq806x: fix aliases node name for Qualcomm
IPQ8064/DB149")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler e363470d1a ipq806x: use consistent DT labels for gsbiX_serial
Kernel uses the label gsbiX_serial, so let's adjust our labels to
this naming scheme.

This is cosmetic, and actually only already existing gsbi4_serial
has been used at all.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler c83f7b6d21 ipq806x: fix aliases node name for Qualcomm IPQ8064/DB149
This device uses a node incorrectly named "alias" instead of
"aliases" since it was introduced.

Remove it without replacement, as the definitions in it don't
seem to be required anyway:

The serial0 definition has never been effective anyway and this
would be the only device deviating from the common setting
"serial0 = &gsbi4_serial;" for ipq8064. (So, maybe the wrong
node prevented us from finding out about the wrong serial
definition?)

The mdio-gpio0 alias was supposed to be removed in d2a2eb7e48
anyway, the redundant definition in the alias node was just
overlooked back then.

Fixes: 0fd202f3e5 ("ipq806x: add db149 dts files")
Fixes: d2a2eb7e48 ("ipq806x: replace caf nss-gmac driver by upstream stmmac")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Roger Pueyo Centelles 26fda610f3 ath79: use rgmii-id instead of rgmii in ubnt,lap-120
Since commit 6f2e1b7485 (ath79: disable delays on AT803X config init)
the incoming incoming traffic on the ubnt,lap-120 devices Ethernet
port was not making it through. Using rgmii-id instead of rgmii (same
configuration as ubnt,litebeam-ac-gen2) fixes it.

Fixes FS#2893.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
4 years ago
Mathieu Martin-Borret d7233b0a6a ramips: add support for D-Link DIR-878 A1
Specifications:

    SoC: MT7621AT
    RAM: 128MB
    Flash: 16MB NOR SPI flash
    WiFi: MT7615N (2.4GHz) and MT7615N (5Ghz)
    LAN: 5x1000M
    Firmware layout is Uboot with extra 96 bytes in header
    Base PCB is AP-MTKH7-0002
    LEDs Power Green,Power Orange,Internet Green,Internet Orange
    LEDs "2.4G" Green & "5G" Green connected directly to wifi module
    Buttons Reset,WPS,WIFI

Flashing instructions:

Upload image via emergency recovery mode
Push and hold reset button (on the back of the device) until power led
starts flashing (about 10 secs or so) while powering the device on.
Give it ~30 seconds, to boot the recovery mode GUI
Connect your client computer to LAN1 of the device
Set your client IP address manually to 192.168.0.2 / 255.255.255.0.
Call the recovery page for the device at http://192.168.0.1
Use the provided emergency web GUI to upload and flash a new firmware to
the device. Some browsers/OS combinations are known not to work, so if
you don't see the percentage complete displayed and moving within a few
seconds, restart the procedure from scratch and try anoher one,
or try the command line way.

Alternative method using command line on Linux:
curl -v -i -F "firmware=@openwrt-xxxx-squashfs-factory.bin" 192.168.0.1

Signed-off-by: Mathieu Martin-Borret <mathieu.mb@protonmail.com>
[use of generic uimage-padhdr in image generation code]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Mathieu Martin-Borret 96761ecc2f kernel: mtdsplit_uimage: add SGE parser
Adding SGE parser for SGE (T&W) Shenzhen Gongjin Electronics
to add 96 bytes padding the the firmware image

Signed-off-by: Mathieu Martin-Borret <mathieu.mb@protonmail.com>
4 years ago
David Bauer 0485fb3925 rockchip: don't disable timer LED trigger
The timer LED trigger is enabled in all targets (except for lantiq
xway-legacy). It's necessary for the OpenWrt preinit LED pattern to
work.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer 875a04478c rockchip: use downstream GPIO button implementation
Use the OpenWrt netlink GPIO button implementation to forward button
presses to procd. This is necessary to make failsafe-mode access
using a button possible.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler eb15b0e0c9 bcm47xx: disable image for Linksys WRT160n v3
The device can only hold 3.6 MB, but newer images (since 18.06)
are bigger, so flashing a new version fails.

This disables default build for this device based on the bug report
referenced below.

Fixes: FS#1963

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 11478524a2 ramips: consolidate Netgear devices for mt7628
This creates a common DTSI and shared image definition for the
relatively similar Netgear devices for mt7628 platform.

As a side effect, this raises SPI flash frequency for the R6120,
as it's expected to work there as well if it works for R6080 and
R6020.

Based on the data from the other devices, it also seems probable
the 5g MAC address for R6120 could be extracted from the caldata,
and the mtd-mac-address there could be dropped.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Chuanhong Guo 28893f5878 ath79: fix dsa binding for TP-Link TL-WR941ND v2
upstream changed dt-bindings for marvell 88e6060 to use mdio-device
and dropped support for legacy bindings.
fix it in our local dts.

Fixes: FS#2524
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Chuanhong Guo 0997342f24 ath79: qihoo,c301: use phy-supply for usb vbus
Linux phy subsystem provides support for a phy regulator defined via
phy-supply property. Use it to turn on usb power only when usb is
probed.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Tomasz Maciej Nowak 2dc5ce622a mvebu: add support for MACCHIATObin Single Shot
Add support for Marvell MACCHIATObin Single Shot, cortex-a72 based
Marvell ARMADA 8040 Community board. Single Shot was broken as the
device tree is different on the Double Shot Board.

Specifications:
- Quad core Cortex-A72 (up to 2GHz)
- DDR4 DIMM slot with optional ECC and single/dual chip select support
- Dual 10GbE (1/2.5/10GbE) SFP+
  2.5GbE (1/2.5GbE) via SFP
  1GbE via copper
- SPI Flash
- 3 X SATA 3.0 connectors
- MicroSD connector
- eMMC
- PCI x4 3.0 slot
- USB 2.0 Headers (Internal)
- USB 3.0 connector
- Console port (UART) over microUSB connector
- 20-pin Connector for CPU JTAG debugger
- 2 X UART Headers
- 12V input via DC Jack
- ATX type power connector
- Form Factor: Mini-ITX (170 mm x 170 mm)

More details at http://macchiatobin.net

Installation:

Write the Image to your Micro SD Card and insert it in the
MACCHIATObin Single Shot SD Card Slot.

In the U-Boot Environment:
   1. reset U-Boot environment:
      env default -a
      saveenv

   2. prepare U-Boot with boot script:
      setenv bootcmd "load mmc 1:1 0x4d00000 boot.scr; source 0x4d00000"
      saveenv

   or manually (hanging lines indicate wrapped one-line command):
      setenv fdt_name armada-8040-mcbin-singleshot.dtb
      setenv image_name Image
      setenv bootcmd 'mmc dev 1; ext4load mmc 1:1 $kernel_addr
         $image_name;ext4load mmc 1:1 $fdt_addr $fdt_name;setenv
         bootargs $console root=/dev/mmcblk1p2 rw rootwait; booti
         $kernel_addr - $fdt_addr'
      saveenv

   On newer Bootloaders (18.12) the Variables have been changed, use:
      setenv fdt_name armada-8040-mcbin-singleshot.dtb
      setenv image_name Image
      setenv bootcmd 'mmc dev 1; ext4load mmc 1:1 $kernel_addr_r
         $image_name;ext4load mmc 1:1 $fdt_addr_r $fdt_name;setenv
         bootargs $console root=/dev/mmcblk1p2 rw rootwait; booti
         $kernel_addr_r - $fdt_addr_r'

Reported-by: Alexandra Alth <alexandra@alth.de>
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
Tested-by: Alexandra Alth <alexandra@alth.de>
[add specs and installation as provided by Alexandra Alth]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 479adb0929 ramips: consolidate recipes with uimage_padhdr
There are already two very similar recipes using uimage_padhdr
in ramips target, and a third one is about to be added.

Make the recipe more generic, so redefinitions are not necessary
anymore.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Bjørn Mork <bjorn@mork.no> [Zyxel WAP6805]
4 years ago
Adrian Schmutzler 9faf9f8f23 mvebu: fix support for Marvell 8040 MACCHIATOBin
Between kernels 4.20 and 5.0, a new variant of this board has been
introduced ("Single Shot"), and the existing one has been renamed
with the appendix "Double Shot". [1]
This also adjusted the first compatible in the list:

marvell,armada8040-mcbin -> marvell,armada8040-mcbin-doubleshot

This patch updates the OpenWrt implementation of this device by
adjusting the relevant references to that compatible (i.e., our
board name).

To still provide support for 4.19 with our setup, this adds a
small patch to change the compatible there as well.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b1f0bbe2700051886b954192b6c1751233fe0f52

Cc: Tomasz Maciej Nowak <tomek_n@o2.pl>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Daniel González Cabanelas cef9e5a49f bcm63xx: R5010UNv2: fix flash partitions for 16MB flash
The router Nucom R5010UN v2 has the partitions defined for a 8MB flash,
but the flash chip is 16MB size. We are wasting half of the flash.

Fix it and use generic names for partitions.

Fixes: 474cde6123 ("brcm63xx: probe SPI flash through DT")

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
4 years ago
Roman Yeryomin 2ca084ccaa build: improve ccache support
Set CCACHE_DIR to $(TOPDIR)/.ccache and CCACHE_BASEDIR to $(TOPDIR).
This allows to do clean and dirclean. Cache hit rate for test build
after dirclean is ~65%.
If CCACHE is enabled stats are printed out at the end of building process.
CCACHE_DIR config variable allows to override default, which could be useful
when sharing cache with many builds.
cacheclean make target allows to clean the cache.

Changes from v1:
- remove ccache directory using CCACHE_DIR variable
- remove ccache leftovers from sdk and toolchain make files
- introduce CONFIG_CCACHE_DIR variable
- introduce cacheclean make target

Signed-off-by: Roman Yeryomin <roman@advem.lv>
4 years ago
DENG Qingfang 23de93a521 ramips: mt7621: refactor set affinity script
The current one only looks for mt76x2e and mt7603e, and
does not work for 2 or more same Wi-Fi chips.
Refactor the script to cover those cases.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
Yangbo Lu 2a5460b11b layerscape: define IMAGE_SIZE and LS_SYSUPGRADE_IMAGE_SIZE
Define 64m IMAGE_SIZE for flash firmware.bin since the flash size
is 64MB. Define 48m LS_SYSUPGRADE_IMAGE_SIZE for flash sysupgrade.bin
which contains maximum 16MB kernel and 32MB rootfs according to
memory map.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu 0841b68c91 layerscape: support sysupgrade for SD card ext4 rootfs
Support sysupgrade for SD card ext4 rootfs.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu c4d0e57e16 layerscape: support sysupgrade for squashfs rootfs
Support sysupgrade for all Layerscape boards with squashfs
rootfs.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu 3a99b624d8 layerscape: fix board name for SD card boot
Many Layerscape boards support both flash boot and SD card boot.
And different firmware and sysupgrade.bin are built for the two
boot methods. To identify them, a fix could be done on board name
by adding a postfix "-sdboot" for SD card boot.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu 3a3b9ded50 layerscape: add compatible for board ls1043ardb
Backport a dts patch which added compatible for ls1043ardb.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu 5ca8903631 layerscape: convert to squashfs rootfs for QSPI NOR boot
There had been an issue in Layerscape QSPI driver for very long
time, which made squashfs,jffs2 rootfs not work on QSPI NOR.
And the ubifs had been used as a workaround.
Now the issue has been fixed. So convert to use squashfs,jffs2
rootfs on QSPI NOR for Layerscape boards (LS1012ARDB/LS1046ARDB/
LS1088ARDB), and update u-boot bootargs for booting.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Petr Štetiar df09cc6ddb toolchain/wrapper.sh: fix remaining shellcheck warnings
Fixes following warnings:

 In target/toolchain/files/wrapper.sh line 18:
 REALNAME=$(readlink -f $0)
                        ^-- SC2086: Double quote to prevent globbing and word splitting.
 --
 In target/toolchain/files/wrapper.sh line 20:
 REALNAME_BASE=$(basename $REALNAME)
                          ^-------^ SC2086: Double quote to prevent globbing and word splitting.
 --
 In target/toolchain/files/wrapper.sh line 21:
 REALNAME_DIR=$(dirname $REALNAME)
                        ^-------^ SC2086: Double quote to prevent globbing and word splitting.
 --
 In target/toolchain/files/wrapper.sh line 74:
 		exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $GCC_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_CFLAGS $TARGET_ROOTFS_CFLAGS "$@"
                     ^-----------------------^ SC2086: Double quote to prevent globbing and word splitting.
 --
 In target/toolchain/files/wrapper.sh line 77:
 		exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $LD_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_LDFLAGS "$@"
                      ^-----------------------^ SC2086: Double quote to prevent globbing and word splitting.
 --
 In target/toolchain/files/wrapper.sh line 80:
 		exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $TARGET_FUNDAMENTAL_ASFLAGS "$@"
                      ^-----------------------^ SC2086: Double quote to prevent globbing and word splitting.
 --
 In target/toolchain/files/wrapper.sh line 83:
 		exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin "$@"
                      ^-----------------------^ SC2086: Double quote to prevent globbing and word splitting.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Rosen Penev d8e6a92e7c toolchain/wrapper.sh: Replace read with read -r
Without -r, backslashes would get mangled.

Found with shellcheck.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Alexey Dobrovolsky ecda6b791b ramips: kernel: fix awake-rt305x-dwc2 patch
At this point in v5.4 kernel we cannot use dwc2_readl() and
dwc2_writel() since they rely on the value hsotg->needs_byte_swap
which cannot be obtained before the controller wakes up.
We should use readl() and writel() to wake up the controller before
calling dwc2_check_core_endianness().

Fixes: 6be0da90a1 ("ramips: refresh patches")
Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>
[fixed Fixes: tag]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Pawel Dembicki 67ce9aedd6 kirkwood: add support for Check Point L-50
This patch adds support for the Check Point L-50 from 600/1100 series
routers.

Specification:
-CPU: Marvell Kirkwood 88F6281 1200MHz
-RAM: 512MB
-Flash: NAND 512MB
-WiFi: mPCIe card based on Atheros AR9287 b/g/n
-WAN: 1 Gigabit Port (Marvell 88E1116R PHY)
-LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+4))
-USB: 2x USB2.0
-Express card slot
-SD card slot
-Serial console: RJ-45 115200 8n1
-Unsupported DSL

Known issues:
-DSL not supported
-Expresscard not tested

Installation:

Step one -> backup:
make backup u-boot and env for revert stock posibility
make backup dsl_mac_addr, dmz_mac_addr, eth1addr, ethaddr and all lanX_mac_addr

Step two -> Use kwboot tool to upload openwrt u-boot to RAM:

run kwboot: "kwboot -B 115200 /dev/ttyUSB0 -b u-boot.kwb -p -t"
end start u-boot

Step three -> Restore macs (e.g. below):
setenv eth1addr 00:1C:XX:XX:XX:6C
setenv ethaddr 00:1C:XX:XX:XX:6B
setenv lan1_mac_addr 00:1C:XX:XX:XX:6C
setenv lan2_mac_addr 00:1C:XX:XX:XX:6D
setenv lan3_mac_addr 00:1C:XX:XX:XX:6E
setenv lan4_mac_addr 00:1C:XX:XX:XX:6F
setenv lan5_mac_addr 00:1C:XX:XX:XX:70
setenv lan6_mac_addr 00:1C:XX:XX:XX:71
setenv lan7_mac_addr 00:1C:XX:XX:XX:72
setenv lan8_mac_addr 00:1C:XX:XX:XX:73
setenv dmz_mac_addr 00:1C:XX:XX:XX:74
setenv dsl_mac_addr 00:1C:XX:XX:XX:75

Step four -> flash u-boot:
mw 0x0800000 0xffff 0x100000
nand erase 0x0 100000
tftp 0x0800000 openwrt-kirkwood-l50-u-boot.kwb
nand write 0x0800000 0x0 0x100000
saveenv

Step five -> run initramfs image:

tftpboot 0x02000000 openwrt.bin; bootm 0x02000000;

Step six -> install sysupgrade OpenWrt image:

copy to /tmp/ sysupgrade image
run sysupgrade

Back to stock:
Restore original u-boot end env.
Install factory image via stock u-boot.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
4 years ago
John Audia 039fd27173 kernel: bump 5.4 to 5.4.51
update via update_kernel.sh -v -u 5.4

Removed upstreamed patches:
 350-MIPS-Add-missing-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch

Script refreshed patches:
 902-debloat_proc.patch
 904-debloat_dma_buf.patch

Attempted merge conflict in following patches:
 0024-MIPS-lantiq-revert-DSA-switch-driver-PMU-clock-chang.patch

Build system: x86_64
Build tested: ipq806x (Netgear R7800)

Signed-off-by: John Audia <graysky@archlinux.us>
[fixed sha256sum of the tarball]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Pawel Dembicki f93267bccf ipq806x: enable Linksys EA8500 eth1 interface
At this moment Linksys EA8500 uses only eth0.

This patch change switch registers, which allow to use eth1 as lan
and eth0 as wan. The method work with similar Linksys EA7500V1
and it work with EA8500.

Suggested-by: Sungbo Eo <mans0n@gorani.run>
Tested-by: Brian Onn <brian.a.onn@gmail.com>
Tested-by: Adrian Panella <ianchi74@outlook.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
4 years ago
Adrian Schmutzler bc85cc2b42 ath79: disable TP-Link TL-WR941ND v2
The support for this device's Marvell MV88E6060 switch has been
reported to be broken with kernels 4.19/5.4 (see bug report).

Since this a 4/32 device and it has been confirmed to be working
with stable 19.07 release (kernel 4.14), and since fixing it does
not seem trivial, let's just disable it in master.

Fixes: FS#2524

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Tim Thorpe edbc8e5512 ramips: add support for Netgear R6020
This adds support for the Netgear R6020, aka Netgear AC750.

The R6020 appears to be the same hardware as the Netgear R6080,
aka Netgear AC1000, but it has a slightly different flash layout,
and no USB ports.

Specification:

SoC: MediaTek MT7628 (580 MHz)
Flash: 8 MiB
RAM: 64 MiB
Wireless: 2.4Ghz (builtin) and 5Ghz (MT7612E)
LAN speed: 10/100
LAN ports: 4
WAN speed: 10/100
WAN ports: 1
UART (57600 8N1) on PCB

MAC addresses based on vendor firmware:
LAN      *:88   0x4
WAN      *:89
WLAN2    *:88   0x4
WLAN5    *:8a   0x8004

The factory partition might have been corrupted beforehand. However,
the comparison of vendor firmware and OpenWrt still allowed to retrieve
a meaningful assignment that also matches the other similar devices.

Installation:

Flashing OpenWRT from stock firmware requires nmrpflash. Use an ethernet
cable to connect to LAN port 1 of the R6020, and power the R6020 off.
From the connected workstation, run
`nmrpflash -i eth0 -f openwrt-ramips-mt76x8-netgear_r6020-squashfs-factory.img`,
replacing eth0 with the appropriate interface (can be identified by
running `nmrpflash -L`). Then power on the R6020. After flashing has finished,
power cycle the R6020, and it will boot into OpenWRT. Once OpenWRT has been
installed, subsequent flashes can use the web interface and sysupgrade files.

Signed-off-by: Tim Thorpe <timfthorpe@gmail.com>
[slightly extend commit message, fix whitespaces in DTS, align From:
with Signed-off-by]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Willem van den Akker 0df71e01cf lantiq: set correct gphy pins for Zyxel P-2812
This fixes the gphy LED pins for Zyxel P-2812 devices. The have
been accidentally altered during a tidy-up operation (see Fixes:
below).

No ports were available, dmesg reported:

[ 0.658577] pinctrl-xway 1e100b10.pinmux: pin io5 already requested by
            1e100bb0.stp; cannot claim for 1e108000.eth
[ 0.667566] pinctrl-xway 1e100b10.pinmux: pin-5 (1e108000.eth) status -22
[ 0.685238] lantiq,xrx200-net 1e108000.eth: Error applying setting,
            reverse things back
[ 0.693270] lantiq,xrx200-net: probe of 1e108000.eth failed with error -22

Fixes: FS#3188
Fixes: 660200e53d ("lantiq: dts: assign the GPHY LED pins to the
Ethernet controller node")

Suggested-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Willem van den Akker <wvdakker@wilsoft.nl>
[commit message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Woodhouse f632747704 mediatek: fix bashism in gen_banana_pi_img.sh
There was a bashism in the script. This fixes the script so that it
doesn't actually require bash, and can be run with any POSIX shell as
its shebang suggests.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
4 years ago
Sungbo Eo 36105880ee mediatek: re-add u3phy2 phy-switch patch
This patch is required for pcie@2,0 in mt7623 to work. The patch was originally
added in kernel 4.14, but it has not been ported to 4.19 and later.

Fixes: FS#3217
Tested-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo 923792369e mediatek: do not create device nodes in uci-defaults script
Since commit 298814e6be ("base-files: config_generate: split macaddr with
multiple ifaces") uci MAC address setup will create a device node for each
member iface. But this script might override the device nodes and interfere
with the MAC address setup.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Petr Štetiar c7b750e7ac treewide: kernel: drop redundant USB_EHCI_HCD=n config symbol
Commit e53ec043ba ("kirkwood: move usb support to modules") has moved
this config symbol into generic configs, so it could be removed from
other configs.

Suggested-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Sebastian Schaper 361c670a46 ath79: add support for D-Link DAP-1330/DAP-1365 A1
Port device support for DAP-1330 from the ar71xx target to ath79.

Additionally, images are generated for the European through-socket
case variant DAP-1365. Both devices run the same vendor firmware, the
only difference being the DAP_SIGNATURE field in the factory header.
The vendor's Web UI will display a model string stored in the flash.

Specifications:

 * QCA9533, 8 MiB Flash, 64 MiB RAM
 * One Ethernet Port (10/100)
 * Wall-plug style case (DAP-1365 with additional socket)
 * LED bargraph RSSI indicator

Installation:

 * Web UI: http://192.168.0.50 (or different address obtained via DHCP)
   There is no password set by default
 * Recovery Web UI: Keep reset button pressed during power-on
   until LED starts flashing red, upgrade via http://192.168.0.50
 * Some modern browsers may have problems flashing via the Web UI,
   if this occurs consider booting to recovery mode and flashing via:
   curl -F \
     files=@openwrt-ath79-generic-dlink_dap-1330-a1-squashfs-factory.bin \
     http://192.168.0.50/cgi/index

The device will use the same MAC address for both wired and wireless
interfaces, however it is stored at two different locations in the flash.

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
4 years ago
Sungbo Eo 358aec7775 ath79: add support for Arduino Yun
Arduino Yun is a microcontroller development board, based on Atmel
ATmega32u4 and Atheros AR9331.

Specifications:
- MCU: ATmega32U4
- SoC: AR9331
- RAM: DDR2 64MB
- Flash: SPI NOR 16MB
- WiFi:
  - 2.4GHz: SoC internal
- Ethernet: 1x 10/100Mbps
- USB: 1x 2.0
- MicroSD: 1x SDHC

Notes:
- Stock firmware is based on OpenWrt AA.
- The SoC UART can be accessed only through the MCU.
  YunSerialTerminal is recommended for access to serial console.
- Stock firmware uses non-standard 250000 baudrate by default.
- The MCU can be reprogrammed from the SoC with avrdude linuxgpio.

Installation:
1.  Update U-Boot environment variables to adapt to new partition scheme.
    > setenv bootcmd "run addboard; run addtty; run addparts; run addrootfs; bootm 0x9f050000 || bootm 0x9fea0000"
    > setenv mtdparts "spi0.0:256k(u-boot)ro,64k(u-boot-env),15936k(firmware),64k(nvram),64k(art)ro"
    > saveenv
2.  Boot into stock firmware normally and perform sysupgrade with
    sysupgrade image.
    # sysupgrade -n -F /tmp/sysupgrade.bin

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
David Woodhouse af9932c9b7 mediatek: Implement sysupgrade support for Banana Pi R2
Based on work by Alexey Loukianov <lx2@lexa2.ru> and others.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
4 years ago
David Woodhouse e19ffb25d9 mediatek: store MAC address in boot partition on Banana Pi R2
Like many boards, the Banana Pi R2 doesn't have permanant storage of
its MAC address, and we store the first random one that the kernel
generates in order to use it later and at least be consistent.

Store it in the FAT boot partition, just as the U7623 board (and others)
do.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
4 years ago
David Woodhouse 7adc29f59e mediatek: add SD card image creation for Banana Pi R2
Based on work by Alexey Loukianov <lx2@lexa2.ru> and others.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
4 years ago
David Woodhouse 91e43a1d7a mediatek: enable SATA for mt7623
The MT7623 SoC has the same SATA block as the MT7622, so enable it in
MT7623 builds too and add it to the DEVICE_PACKAGES for those boards.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
4 years ago
David Woodhouse c848bc6cd5 mediatek/mt7623: unify features and packages, add ext4 and usb
The supported MT7623 boards are mostly identical (what with being a
System-on-Chip and all), so unify the DEVICE_PACKAGES for them, and add
ext4 and usb support for them.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
4 years ago
David Woodhouse c07d0d7f3e mediatek: mt7623: refresh 5.4 kernel config
Some options were not explicitly specified, causing the kernel build to
drop to interactive mode. Set the missing options.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
4 years ago
Sebastian Schaper 14599c5945 ath79: add support for D-Link DCH-G020 Rev. A1
The DCH-G020 is a Smart Home Gateway for Z-Wave devices.

Specifications:

 * QCA9531, 16 MiB Flash, 64 MiB RAM
 * On-Board USB SD3503A Z-Wave dongle
 * GL850 USB 2.0 Hub (one rear port, internal Z-Wave)
 * Two Ethernet Ports (10/100)

Installation:

 * Web UI: http://192.168.0.60 (or different address obtained via DHCP)
   Login with 'admin' and the 6-digit PIN Code from the bottom label
 * Recovery Web UI: Keep reset button pressed during power-on
   until LED starts flashing red, upgrade via http://192.168.0.60
 * Some modern browsers may have problems flashing via the Web UI,
   if this occurs consider booting to recovery mode and flashing via:
   curl -F \
     files=@openwrt-ath79-generic-dlink_dch-g020-a1-squashfs-factory.bin \
     http://192.168.0.60/cgi/index

Known issues:

 * Real-Time-Clock is not working as there is currently no matching driver
   It is still included in the dts as compatible = "pericom,pt7c43390";
 * openzwave was tested on v19.07 (running MinOZW as a proof-of-concept),
   but the package grew too big as lots of device pictures were included,
   thus any use of Z-Wave is up to the user (e.g. extroot and domoticz)

The device will use the same MAC address for both wired and wireless
interfaces, however it is stored at two different locations in the flash.

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
4 years ago
John Audia 3e992ea790 ipq806x: compile in schedutil governor
Gives users a third option to augment ondemand and performance. Kernel
docs[1] explain differences and this PR empowers users w/ the choice to
select between the older ondemand and newer and more simplistic schedutil
should they wish to use one that is not the performance governor.

1. Documentation/admin-guide/pm/cpufreq.rst

Signed-off-by: John Audia <graysky@archlinux.us>
[fixed From: to match SoB:]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Furkan Alaca 541faf2c93 ramips: mt7621: use lzma-loader for ra21s & rg21s
The rg21s fails to boot if the kernel is larger than about
2,376 KiB. The ra21s is virtually identical hardware.
Enabling lzma-loader resolves the issue on both the rg21s
and ra21s (see FS#3057 on the issue tracker).

Fixes: FS#3057
Signed-off-by: Furkan Alaca <furkan.alaca@queensu.ca>
4 years ago
Sergei Burakov 4dc9ad4af8 ramips: add support for ZyXEL Keenetic Lite Rev.B
Device specification:

SoC: RT5350
CPU Frequency: 360 MHz
Flash Chip: Macronix MX25L6406E (8192 KiB)
RAM: Winbond W9825G6JH-6 (32768 KiB)
5x 10/100 Mbps Ethernet (4x LAN, 1x WAN)
1x external antenna
UART (J1) header on PCB (57800 8n1)
Wireless: SoC-intergated: 2.4GHz 802.11bgn
USB: None
8x LED, 2x button

Flash instruction:

Configure PC with static IP 192.168.99.8/24 and start TFTP server.
Rename "openwrt-ramips-rt305x-zyxel_keenetic-lite-b-squashfs-sysupgrade.bin"
to "rt305x_firmware.bin" and place it in TFTP server directory.
Connect PC with one of LAN ports, press the reset button, power up
the router and keep button pressed until power LED start blinking.
Router will download file from TFTP server, write it to flash and reboot.

Signed-off-by: Sergei Burakov <senior.anonymous@ya.ru>
4 years ago
Adrian Schmutzler 9e6257c26c ramips: move adslr_g7 in image/mt7621.mk to keep sorting
Move this device to the top to maintain alphabetic sorting in the
file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 7de08be913 ramips: add missing kmod-mt7615-firmware for TP-Link RE500 v1
Adding this has been overlooked when rebasing the commit prior to
merge.

Fixes: ba0f4f0cfd ("ramips: add support for TP-Link RE500 v1")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler f3921acdf0 ipq40xx: fix patches on dts Makefile
The patches for arch/arm/boot/dts/Makefile have not been updated
in a syntactically correct way (just body was changed). Fix it.

Fixes: 4a77a060ab ("ipq40xx: add support for Buffalo WTR-M2133HP")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Bjørn Mork c1794d653c ramips: add support for ZyXEL WAP6805 (Altibox WiFi+)
Hardware
--------
SoC:   MediaTek MT7621ST
WiFi:  MediaTek MT7603
       Quantenna QT3840BC
Flash: 128M NAND
RAM:   64M
LED:   Dual colour red and green
BTN:   Reset
       WPS
Eth:   4 x 10/100/1000 connected to MT7621 internal switch
       MT7621 RGMII port connected to Quantenna module
GPIO:  Power/reset of Quantenna module

Quantenna module
----------------

The Quantenna QT3840BC (or QV840) is a separate SoC running
another Linux installation.  It is mounted on a wide mini-PCIe
form factor module, but is connected to the RGMII port of
the MT7621.  It loads both a second uboot stage and an os
image from the MT7621 using tftp.  The module is configured
using Quantenna specific RPC calls over IP, using 802.1q
over the RGMII link to support multiple SSIDs.

There is no support for using this module as a WiFi device
in OpenWrt. A package with basic firmware and management
tools is being prepared.

Serial ports
------------

Two serial ports with headers:

RRJ1 - 115200 8N1 - Connected to the Quantenna console
J1   -  57600 8N1 - Connected to the MT7621 console

Both share pinout with many other Zyxel/Mitrastar devices:

1 - NC (VDD)
2 - TX
3 - RX
4 - NC (no pin)
5 - GND

Dual system partitions
----------------------

The vendor firmware and boot loader use a dual partition
scheme storing a counter in the header of each partition. The
partition with the highest number will be selected for boot.

OpenWrt does not support this scheme and will always use the
first OS partition.  It will reset both counters to zero the
first time sysupgrade is run, making sure the first partition
is selected by the boot loader.

Installation from vendor firmware
---------------------------------

1. Run a DHCP server. The WAP6805 is configured as a client device
   and does not have a default static IP address. Make a note of
   which address it is assigned

2. tftp the OpenWrt initramfs-kernel.bin image to this address.
   Wait for the WAP6805 to reboot.

3. ssh to the OpenWrt initramfs system on 192.168.1.1. Make a
   backup of all mtd partitions now.  The last used OEM image is
   still present in either "Kernel" or "Kernel2" at this point,
   and can be restored later if you save a copy.

4. sysupgrade to the OpenWrt sysupgrade.bin image.

Installation from U-Boot
------------------------

This requires serial console access

1. Copy the OpenWrt initramfs-kernel.bin image as "ras.bin" to
   your tftp server directory.  Configure the server address as
   192.168.0.33/24

2. Hit ESC when the message "Hit ESC key to stop autoboot"
   appears

3. Type "ATGU" + Enter, and then "2" immediately after pressing enter.

4. Answer Y to the question "Erase Linux in Flash then burn new
   one. Are you sure?", and answer the address/filename questions.
   Defaults:
        Input device IP (192.168.0.2)
        Input server IP (192.168.0.33)
        Input Linux Kernel filename ("ras.bin")

5. Wait until after you see the message "Done!" and power cycle
   the device.  It will hang after flashing.

6. Continue with step 3 and 4 from the vendor firmware procedure.

Notes on the WAP6805 U-Boot
---------------------------
The bootloader has been modified with both ZyXELs zyloader and the
device specific dual partition scheme.  These changes appear to have
broken a few things.  The zyloader shell claims to support a number
of ZyXEL AT commands, but not all of them work.  The image selection
scheme is unreliable and inconsistent.  A limited U-Boot menu is
available - and used by the above U-Boot install procedure.  But
direct booting into an uploaded image does not work, neither with
ram nor with flash.  Flashing works, but requires a hard reset after
it is finished.

Reverting to OEM firmware
-------------------------

The OEM firmware can be restored by using mtd write from OpenWrt,
flashing it to the "Kernel" partition. E.g.

  ssh root@192.168.1.1 "mtd -r -e Kernel write - Kernel" < oem.bin

OEM firmwares for the WAP6805 are not avaible for public download,
so a backup of the original installation is required.  See above.

Alternatively, firmware for the WAP6806 (Armor X1) may be used. This
is exactly the same hardware.  But the branding features do obviously
differ.

LED controller
--------------

Hardware implementation is unknown.  The dual-color LED is controlled
by 3 GPIOs:

  4: red
  7: blinking green
 13: green

Enabling both red and green makes the LED appear yellow.

The boot loader enables hardware blinking, causing the green LED to blink
slowly on power-on, until the OpenWrt boot mode starts a faster software
blink.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
[fix alphabetic sorting for image build statement]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Pawel Dembicki 20c7abd4b7 ipq806x: add support for Linksys EA7500 V1
This patch adds support for the Linksys EA7500 V1 router.

Specification:
 - CPU: Qualcomm IPQ8064
 - RAM: 256MB
 - Flash: NAND 128MB
 - WiFi: QCA9982 an+ac + QCA9983 bgn
 - Ethernet: 5 GBE Ports (WAN+ 4xLAN) (QCA8337)
 - USB: 1x USB 3.0 1x USB2.0
 - Serial console: RJ-45 115200 8n1 (1V8 Voltage level)
 - 2 Buttons
 - 1 LED

Known issues:
 - Some devices won't flash via web gui

Installation:
- Newer stock images doesn't allow to install custom firmware.
- Please downgrade software to 1.1.2 version. Official firmware:
https://downloads.linksys.com/downloads/firmware/FW_EA7500_1.1.2.172843_prod.gpg.img
- Do it two times to downgrade all stored images.
- Apply factory image via web-gui.

Serial + TFTP method:
 - downgrade to 1.1.2 two times
 - connect ehternet and serial cable
 - set ip address of tftp server to 192.168.1.254
 - put openwrt factory image to tftp folder and rename it to macan.bin
 - stop device while booting in u-boot
 - run command: "run flashimg"
 - run command: "setenv boot_part 1"
 - run command "saveenv"
 - reset

Back to stock:
- Please use old non-gpg image like this 1.1.2:
https://downloads.linksys.com/downloads/firmware/FW_EA7500_1.1.2.172843_prod.img
- ssh to router and copy image to tmp
- use sysupgrade -n -F

Tested by github users: @jack338c and @grzesiczek1

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[removed i2c4_pins, mdio0_pins, nand_pins, rgmii2_pins from DTSI]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Yanase Yuki 4a77a060ab ipq40xx: add support for Buffalo WTR-M2133HP
Buffalo WTR-M2133HP is a Tri-Band router based on IPQ4019.

Specification
-------------
- SoC: Qualcomm IPQ4019
- RAM: 512MiB
- Flash Memory: NAND 128MiB (MXIC MX30LF1G18AC)
- Wi-Fi: Qualcomm IPQ4019 (2.4GHz, 1ch - 13ch)
- Wi-Fi: Qualcomm IPQ4019 (5GHz, 36ch - 64ch)
- Wi-Fi: Qualcomm QCA9984 (2T2R, 5GHz, 100ch - 140ch)
- Ethernet: 4x 10/100/1000 Mbps (1x WAN, 3x LAN)
- LED: 4x white LED, 4x orange LED, 1x blue LED
- USB: 1x USB 3.0 port
- Input: 2x tactile switch, 2x slide switch (2x SP3T)
- Serial console: 115200bps, pinheader JP5 on PCB
- Power: DC 12V 2A

Flash instruction
-----------------
1. Set up a TFTP server (IP address: 192.168.11.10)
2. Rename "initramfs-fit-uImage.itb" to "WTR-M2133HP-initramfs.uImage"
   and put it into the TFTP server directory.
3. Connect the TFTP server and WTR-M2133HP.
4. Hold down the AOSS button, then power on the router.
5. After booting OpenWrt initramfs image, connect to the router by SSH.
6. Transfer "squashfs-nand-factory.ubi" to the router.
7. Execute the following commands.
    # ubidetach -p /dev/mtd15
    # ubiformat /dev/mtd15 -f /tmp/openwrt-ipq40xx-generic-buffalo_wtr-m2133hp-squashfs-nand-factory.ubi
    # fw_setenv bootcmd bootipq
8. Perform reboot.

Recover to stock firmware
-------------------------
1. Execute the following command.
    # fw_setenv bootcmd bootbf
2. Reboot and wait several minutes.

Signed-off-by: Yanase Yuki <dev@zpc.sakura.ne.jp>
4 years ago
Pawel Dembicki d2c3131b3f kirkwood: add support for Zyxel NSA310S
Zyxel NSA310S is a NAS based on Marvell kirkwood SoC.

Specification:
 - Processor Marvell 88F6702 1 GHz
 - 256MB RAM
 - 128MB NAND
 - 1x GBE LAN port (PHY: Marvell 88E1318)
 - 2x USB 2.0
 - 1x SATA
 - 3x button
 - 7x leds
 - serial on J1 connector (115200 8N1) (GND-NOPIN-RX-TX-VCC)

Known issues:
 - no kernel module for RTC. [*]
 - buzzer (connected to MPP43) need to be drived by 1kHz signal
 - no kernel module for internal MCU connected via I2C[**]

[*]
Karoly Pocsi made simple, unofficial driver for HT1382.
It can be found here:
https://www.madadmin.com/zyxel-nsa320s-es-debian-linux-4-resz/

[**]
Karoly Pocsi found how CPU talk with MCU:
It is possible to query the MCU-controlled fan speed and temperature:
i2cget -y 0x0 0x0a 0x07
i2cget -y 0x0 0x0a 0x08
The first value (0x07) is the temperature in ° C, the second (0x08) is
the time in milliseconds to complete one fan revolution (rpm = 60,000 / value).
Info translated from:
https://www.madadmin.com/zyxel-nsa320s-es-debian-linux-4-resz/

Installation:

TFTP:
1. Run serial console and go to u-boot.
2. Copy u-boot via tftp and write to NAND:
	=> mw 0x0800000 0xffff 0x100000
	=> nand erase 0x0 100000
	=> setenv ipaddr 192.168.1.2
	=> setenv serverip 192.168.1.4
	=> tftp 0x0800000 nsa310s-u-boot.kwb
	=> nand write 0x0800000 0x0 0x100000
	=> reset
3. Run new u-Boot, repair bootcmd and restore MAC address from sticker
	=> setenv ethaddr AA:BB:CC:DD:EE:FF
	=> saveenv
4. Copy and run initramfs image
	=> setenv ipaddr 192.168.1.2
	=> setenv serverip 192.168.1.4
	=> tftpboot zyxel_nsa310s-initramfs-uImage
	=> bootm 0x800000
5. Download sysupgrade image and perform sysupgrade

USB:

1. Prepare usb fat32 drive with u-boot.kwb and initramfs image.
   Stick it to USB 2.0 port.
2. Run serial console and go to u-boot.
3. Copy u-boot from usb and write to NAND:
	=> mw 0x0800000 0xffff 0x100000
	=> nand erase 0x0 100000
	=> usb start
	=> fatload usb 0 0x0800000 u-boot.kwb
	=> nand write 0x0800000 0x0 0x100000
	=> reset
4. Run new u-Boot, repair bootcmd and restore MAC address from sticker
	=> setenv ethaddr AA:BB:CC:DD:EE:FF
	=> saveenv
5. Copy and run initramfs image:
	=> usb start
	=> fatload usb 0 0x0800000 initramfs-uImage
	=> bootm 0x800000
6. Download sysupgrade image and perform sysupgrade.

Based on work ThBexx <thomas.beckler@hotmail.com>
DTS based on dropped support in 0ebdf0c.

Tested-by: Lech Perczak <lech.perczak@gmail.com>
Reviewed-by: Lech Perczak <lech.perczak@gmail.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[NSA310s -> NSA310S in DEVICE_MODEL]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Andrey Bondar ba59021d64 ath79: add support for 8devices Lima board
Specification:

  • 650/600/216 MHz (CPU/DDR/AHB)
  • 64 MB of RAM (DDR2)
  • 32 MB of FLASH
  • 2T2R 2.4 GHz
  • 2x 10/100 Mbps Ethernet
  • 1x USB 2.0 Host socket
  • 1x miniPCIe slot
  • UART for serial console
  • 14x GPIO

Flash instructions:

Upgrading from ar71xx target:

  • Upload image into the board:
    scp openwrt-ath79-generic-8dev_lima-squashfs-sysupgrade.bin
    root@192.168.1.1/tmp/
  • Run sysupgrade
    sysupgrade -F /tmp/openwrt-ath79-generic-8dev_lima-squashfs-sysupgrade.bin

Upgrading from u-boot:

  • Set up tftp server with
    openwrt-ath79-generic-8dev_lima-initramfs-kernel.bin
  • Go to u-boot (reboot and press ESC when prompted)
  • Set TFTP server IP
    setenv serverip 192.168.1.254
  • Set device ip from the same subnet
    setenv ipaddr 192.168.1.1
  • Copy new firmware to board
    tftpboot 0x82000000 initramfs.bin
  • Boot OpenWRT
    bootm 0x82000000
  • Upload image openwrt-ath79-generic-8dev_lima-squashfs-sysupgrade.bin into
    the board
  • Run sysupgrade.

Signed-off-by: Andrey Bondar <a.bondar@8devices.com>
4 years ago
Sergio E. Nemirowski 645b1ec3e2 build: add 'make kernel_xconfig' command
This adds the kernel_xconfig make target.

Signed-off-by: Sergio E. Nemirowski <sergio@outerface.net>
4 years ago
Dongming Han f103321349 ipq40xx: add support for GL.iNet GL-S1300
Specifications:
SOC:        Qualcomm IPQ4029 (DAKOTA) ARM Quad-Core
RAM:        512 MiB
FLASH1:     16 MiB NOR - SPI0
FLASH2:     8 GiB eMMC
ETH:        Qualcomm QCA8075
WLAN1:      Qualcomm Atheros QCA4029 2.4GHz 802.11b/g/n 2x2
WLAN2:      Qualcomm Atheros QCA4029 5GHz 802.11n/ac W2 2x2
INPUT:      Reset, WPS
LED:        Power, Mesh, WLAN
UART1:      On board pin header near to LED (3.3V, TX, RX, GND), 3.3V without pin - 115200 8N1
UART2:      On board with BLE module
SPI1:       On board socket for Zigbee module

Install via tftp
- NB: need to flash transition image firstly

Firstly install transition image:
(IPQ40xx) # tftpboot 0x84000000 s1300-factory-to-openwrt.img
(IPQ40xx) # sf probe && imgaddr=0x84000000 && source :script

Secondly install openwrt sysupgrade bin:
(IPQ40xx) # run lf

Revert to factory image:
(IPQ40xx) # tftpboot 0x84000000 s1300-openwrt-to-factory.img
(IPQ40xx) # sf probe && imgaddr=0x84000000 && source :script

The kernel and rootfs of factory firmware are on eMMC, and openwrt
firmware is on NOR flash. The transition image includes U-boot
and partition table, which decides where to load kernel and rootfs.
After you firstly install openwrt image, you can switch between
factory and openwrt firmware by flashing transition image.

Signed-off-by: Dongming Han <handongming@gl-inet.com>
4 years ago
Emir Efe Kucuk 53a1fede1f ramips: Add support for Xiaomi Mi Router(Black,R2100)
The Xiaomi Mi Router AC2100 is a *black* cylindrical router that shares many
characteristics (apart from its looks and the GPIO ports) with the 6-antenna
*white* "Xiaomi Redmi Router AC2100"

See the visual comparison of the two routers here:
https://github.com/emirefek/openwrt-R2100/raw/imgcdn/rm2100-r2100.jpg

Specification of R2100:
- CPU: MediaTek MT7621A
- RAM: 128 MB DDR3
- FLASH: 128 MB ESMT NAND
- WIFI: 2x2 802.11bgn (MT7603)
- WIFI: 4x4 802.11ac (MT7615)
- ETH: 3xLAN+1xWAN 1000base-T
- LED: Power, WAN in Yellow and Blue
- UART: On board (Don't know where is should be confirmed by anybody else)
- Modified u-boot

Hacking of official firmware process is same at both RM2100 and R2100.
Thanks to @namidairo

Here is the detailed guide Hack: https://github.com/impulse/ac2100-openwrt-guide
Guide is written for MacOS but it will work at linux.
needed packages: python3(with scapy), netcat, http server, telnet client

1. Run PPPoE&exploit to get nc and wget busybox, get telnet and wget firmware
2. mtd write openwrt-ramips-mt7621-xiaomi_mi-router-ac2100-kernel1.bin kernel1
3. nvram set uart_en=1
4. nvram set bootdelay=5
5. nvram set flag_try_sys1_failed=1
6. nvram commit
7. mtd -r write openwrt-ramips-mt7621-xiaomi_mi-router-ac2100-rootfs0.bin rootfs0

other than these I specified in here. Everything is same with:
f3792690c4
Thanks for all community and especially for this device:
@Ilyas @scp07 @namidairo @Percy @thorsten97 @impulse (names@forum.openwrt.com)

MAC Locations:
WAN *:b5 = factory 0xe006
LAN *:b6 = factory 0xe000
WIFI 5ghz *:b8 = factory 0x8004
WIFI 2.4ghz *:b7 = factory 0x0004

Signed-off-by: Emir Efe Kucuk <emirefek@gmail.com>
[refactored common image bits into Device/xiaomi-ac2100, fixed From:]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Thibaut VARÈNE 78fffc2dfd generic: platform/mikrotik: add partial AR71xx cpufreq support
This patch adds cpu frequency setting for AR724x and AR7161.
It is unknown if all the AR71xx devices support the same value range,
so support is only enabled for AR7161 at this stage.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE a874c87f4c generic: platform/mikrotik: add board_revision tag
Tag was discovered exploring the hard_config of a "r2" board.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 0217a9be0d generic: platform/mikrotik: graceful fallback for cpufreq_index
The current code would return an error on ath79 when the SoC isn't known
to the driver. Return the raw hex value instead, as happens with non
supported targets.
Also return the correctly incremented value from
sc_tag_cpufreq_ath79_arraysize()

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 2714a4faab generic: platform/mikrotik: match RouterBOOT nomenclature
RouterBOOT cpu frequency settings are letter-indexed. Follow the
same logic for the sysfs interface.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 5c4b431a3c generic: platform/mikrotik: fix routerboot_tag_show_u32s()
The routine would only accurately print out the first word.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Fixes: 5ecf7d96 ("generic: routerboot sysfs platform driver")
4 years ago
Davide Fioravanti 8c13ebd3ad ramips: add support for Edimax Gemini RE23S
Hardware
--------
SoC:   Mediatek MT7621AT (880 MHz, 2 cores 4 threads)
RAM:   128MB
FLASH: 16MB NOR (Macronix MX25L12805D)
ETH:   1x 10/100/1000 Mbps Ethernet (MT7530)
WIFI:
  - 2.4GHz: 1x MT7615 (4x4:4)
  - 5GHz:   1x MT7615 (4x4:4)
  - 4 antennas: 2 external detachable and 2 internal
BTN:
  - 1x Reset button
  - 1x WPS button
LEDS:
  - 1x Green led (Power)
  - 1x Green-Amber-Red led (Wifi)
UART:
  - 57600-8-N-1

Everything works correctly.

Installation
------------
Flash the factory image directly from OEM web interface.
(You can login using these credentials: admin/1234)

Restore OEM Firmware
--------------------
Flash the OEM "bin" firmware directly from LUCI.
The firmware is downloadable from the OEM web page.
Warning: Remember to not keep settings!
Warning2: Remember to force the flash.

Restoring procedure tested with RE23_1.08.bin

MAC addresses
-------------
factory 0x4     *:24
factory 0x8004  *:25
Cimage  0x07    *:24
Cimage  0x0D    *:24
Cimage  0x13    *:24
Cimage  0x19    *:25

No other addresses were found in factory partition.

Since the label contains both the 2.4GHz and 5GHz mac address I decided
to set the 5GHz one as label-mac-device. Moreover it also corresponds
to the lan mac address.

Notes
-----
The wifi led in the OEM firmware changes colour depending on the signal
strength. This can be done in OpenWrt but just for one interface.
So for now will not be any default action for this led.

If you want to open the case, pay attention to the antenna placed on
the bottom part of the front cover.
The wire is a bit short and it breaks easily. (I broke it)

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
[fix two typos and add extended MAC address section to commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Hauke Mehrtens 66e04abbb6 ar71xx: Fix mikrotik NAND compile problem
This Fixes the folowing compile error:
drivers/mtd/nand/rb91x_nand.c: In function 'rb91x_nand_remove':
drivers/mtd/nand/rb91x_nand.c:445:16: error: 'rbni' undeclared (first use in this function)
  nand_release(&rbni->chip);

Fixes: ce958dd88a ("kernel: Update kernel 4.14 to version 4.14.187")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Petr Štetiar ae2d249056 ath79: nand: disable images for glinet_gl-ar750s
Fixes following build failures:

 WARNING: Image file glinet_gl-ar750s-nor-kernel.bin is too big
 WARNING: Image file glinet_gl-ar750s-nor-nand-kernel.bin is too big

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Andrey Bondar 326e488c7b ath79: add support for 8devices Rambutan board
Rambutan is a Wifi module based on QCA9550/9557
http://www.8devices.com/products/rambutan

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
- 2x USB2.0 host
- 2x UART
- SPI, I2C, GPIO

Flash instructions:

Upgrade from ar71xx target:
 sysupgrade -F /tmp/openwrt-ath79-nand-8dev_rambutan-squashfs-sysupgrade.tar
or upgrade from GUI (don't save config)

Use factory image to flash from U-Boot:
 tftpboot 80060000 openwrt-ath79-nand-8dev_rambutan-squashfs-factory.ubi
 nand erase.part ubi
 nand write 80060000 ubi ${filesize}

Signed-off-by: Petr Štetiar <ynezz@true.cz> [copy&pasted missing commit description]
Signed-off-by: Andrey Bondar <a.bondar@8devices.com>
4 years ago
Adrian Schmutzler 7cb721c03f ramips: use WiFi LED DT triggers for TP-Link RE650 v1
This moves WiFi LED triggers from 01_leds to device tree.

While at it, convert the labels there to lower case; this is
more commonly used and the change will actually remove competition
between DT trigger and leftover uci config on already installed
systems.

Suggested-by: Georgi Vlaev <georgi.vlaev@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer d8ab3216e6 ath79: switch to kernel 5.4
As the reported major bugs are ironed out, switch to the new kernel to
begin testing with a broader audience.

Signed-off-by: David Bauer <mail@david-bauer.net>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Aleksander Jan Bajkowski f496939f15 lantiq: set port numbers corresponding to reg value
Fix inconsistencies found in DTS files and sort ethernet ports based on
updated names.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
[squash two separate patches, rephrase commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Aleksander Jan Bajkowski 3866fefa38 lantiq: remove redundant includes from fritz736x DTS files
The removed lines are already included in vr9_avm_fritz736x.dtsi

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
[rephrase commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Christoph Krapp ba0f4f0cfd ramips: add support for TP-Link RE500 v1
This device uses the same hardware as RE650 v1 which got supported in
8c51dde.

Hardware specification:

- SoC 880 MHz - MediaTek MT7621AT
- 128 MB of DDR3 RAM
- 16 MB - Winbond 25Q128FVSG
- 4T4R 2.4 GHz - MediaTek MT7615E
- 4T4R 5 GHz - MediaTek MT7615E
- 1x 1 Gbps Ethernet - MT7621AT integrated
- 7x LEDs (Power, 2G, 5G, WPS(x2), Lan(x2))
- 4x buttons (Reset, Power, WPS, LED)
- UART header (J1) - 2:GND, 3:RX, 4:TX
  Serial console @ 57600,8n1

Flash instructions:

Upload
openwrt-ramips-mt7621-tplink_re500-v1-squashfs-factory.bin
from the RE500 web interface.

TFTP recovery to stock firmware:

Unfortunately, I can't find an easy way to recover the RE
without opening the device and using modified binaries. The
TFTP upload will only work if selected from u-boot, which
means you have to open the device and attach to the serial
console. The TFTP update procedure does *not* accept the
published vendor firmware binaries. However, it allows to
flash kernel + rootfs binaries, and this works if you have
a backup of the original contents of the flash. It's probably
possible to create special image out of the vendor binaries
and use that as recovery image.

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
[remove dts-v1 in DTSI, do not touch WiFi LEDs for RE650, keep
state_default in DTS files, fix label-mac-device, use lower case
for WiFi LEDs]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Martin Blumenstingl 982468de35 lantiq: dts: Move the &usb_vbus nodes out of &gpio
Move the USB VBUS regulator nodes out of the GPIO controller node. This
fixes a problem where the "regulator-fixed" driver wasn't probed for
these regulators because the GPIO driver doesn't scan the child-nodes
and based on the dt-bindings documentation it's not supposed to.

This fixed the following error reported by Luca Olivetti:
  ...
  dwc2 1e101000.usb: DWC OTG Controller
  dwc2 1e101000.usb: new USB bus registered, assigned bus number 1
  dwc2 1e101000.usb: irq 62, io mem 0x1e101000
  dwc2 1e101000.usb: startup error -517
  dwc2 1e101000.usb: USB bus 1 deregistered
  dwc2 1e101000.usb: dwc2_hcd_init() FAILED, returning -517

Fixes: FS#1634
Cc: Luca Olivetti <luca@ventoso.org>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 years ago
Matthew Gyurgyik bb14d44039 kernel/pcengines-apu2: detect apuv4 board
Upstream commit 3d00da1de3 ("platform/x86: pcengines-apuv2: detect apuv4
board")

On 5.4, this module fails on APUv4 due to non-matching DMI data. With this
patch, the module will match DMI data for the APUv4.

Signed-off-by: Matthew Gyurgyik <matthew@gyurgyik.io>
[include upstream patch description]
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Lars Wessels f855eb91b3 lantiq: added switch-config for ARV752DPW
Add missing switch config (4 LAN-Ports + CPU).

Grey WAN port (used for ADSL) is not part of the switch.

Signed-off-by: Lars Wessels <software@bytebox.org>
[rework commit message]
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Lars Wessels 702366a30b lantiq: wifi mac fix for ARV752DPW
Set wifi mac from flash partition 'board_config' to
match the label on the device (Easybox 802).

Currently the wifi mac is always set to 00:0c:43:28:60:00.
eth0 and WiFi will now share the same mac (as in original firmware).

Signed-off-by: Lars Wessels <software@bytebox.org>
[improve commit message]
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Sunguk Lee 2d378703f1 ramips: reduce spi-max-frequency for ipTIME A8004T
Reduce spi-max-frequency for ipTIME A8004T and disable
m25p,fast-read option.

A8004T uses `en25qh128` for the MTD.
This flash memory would allow 80MHz, sometimes kernel received
wrong id value in initramfs installed router.
(kernel expected `1c 70 18 1c 70 18`, but one of cases, it
was `9c 70 18 1c 70 18`)

In this case, openwrt can't detect the partition information,
it would write the inccorect data to the firmware partition and
also it would occur the bootlooping after sysupgrade.

Signed-off-by: Sunguk Lee <d3m3vilurr@gmail.com>
[minor commit title/message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 883250014d ipq806x: move serial0 to DTSI files
All device DTS files in the target set the serial0 property to the
same value (*). So, let's move the definitions to the DTSI files.

That's also where the kernel defines it (qcom-ipq8064-v1.0.dtsi).

* The only exception is ipq8064-db149, which defines
  "serial0 = &uart2;", but inside a block called "alias" instead of
  "aliases". It must be assumed that this is broken anyway, so we
  don't touch it here.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 74e339f118 ipq806x: move stdout-path to DTSI files
All device DTS files in the target set the stdout-path to the same
value. So, let's move the definitions to the DTSI files.

That's also where the kernel defines it (qcom-ipq8064-v1.0.dtsi).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler ed761344d2 ipq806x: disentangle and clean up SoC DTSI files
So far, the DTSI files on ipq806x had a linear inheritance:

  qcom-ipq8064.dtsi
  v
  qcom-ipq8064-v1.0.dtsi
  v
  qcom-ipq8064-v2.0.dtsi
  v
  qcom-ipq8065.dtsi

This poses problems when one wants to set something that is specific
to an architecture closer to the top of the tree.

In this patch, we remove the chain-like inheritance and have all
other files derived from qcom-ipq8064.dtsi (changing this name to
something more generic is not possible due to upstream use).

The removal of inheritance will require a few entries to be copied
from qcom-ipq8064-v2.0.dtsi to qcom-ipq8065.dtsi. However, it also
opens an opportunity for some clean-up:

- Many definitions can be improved by just using the innermost labels.

- Instead of disabling the CPU_SPC node for ipq8065, it is now off by
  default and enabled where needed.

- Instead of patching phy-tx0-term-offset into qcom-ipq8064.dtsi and
  then having it changed for qcom-ipq8064-v2.0/qcom-ipq8065, just have
  the appropriate settings done in the lower DTSI files directly.

- For the opp_table0 adjustments for ipq8065, just redefine what's
  changed, but don't add all the untouched properties again.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo 19c8f11d92 ipq806x: move common pinmux nodes to SoC DTSI
As almost same pinmux nodes are repeated in each device dts,
let's define them once in the ipq8064 dtsi and remove the rest.

* uart0_pins : Did not touch.
* i2c4_pins  : This node seems to be not used at all in dts.
               Added the most common form in the dtsi. Did not touch rpm_pins.
* spi_pins   : The common mux node is already present in the dtsi.
               Removed the duplicate nodes from dts.
* nand_pins  : Moved the entire node.
* mdio0_pins : Moved the common mux node.
* rgmii2_pins: Moved the common mux node. "pins" property is overrided in ap161.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Hauke Mehrtens 014d3f593a ar71xx: Fix mikrotik NAND compile problem
There is one closing bracket too much.

Fixes: ce958dd88a ("kernel: Update kernel 4.14 to version 4.14.187")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Scott Roberts d31bbe40e2 mvebu: config define i2c pxa slave
We are setting CONFIG_I2C_PXA is not set
If you do set pxa to y then you have issues if you do not have
CONFIG_I2C_PXA_SLAVE is not set

Fixes: dd13add3ce ("kernel: i2c-pxa: remove slave")
Signed-off-by: Scott Roberts <ttocsr@gmail.com>
4 years ago
Daniel González Cabanelas a902e6a657 mvebu: LS421DE: use automatic fan control with thermal zones
The Buffalo Linkstation LS421DE has a chassis fan for cooling two internal
hard drives. Currently there is no control over this fan, running always
at fixed medium speed.

With the recent jump to the kernel 5.4, now we can monitor the hard drive
temperature and control the fan with thermal zones.

Install the kmod-hwmon-drivetemp module and wire up a thermal zone on the
dts file to allow automatic fan control by the kernel.

Tested succesfully using a single Crucial BX500 SSD drive.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
4 years ago
Hauke Mehrtens 68d9cb8214 kernel: Update kernel 5.4 to version 5.4.50
Run tested: ath79, ipq40xx
Build tested: ath79, ipq40xx

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens 6062d85892 kernel: Update kernel 4.19 to version 4.19.131
Fixes:
- CVE-2020-10757

The "mtd: rawnand: Pass a nand_chip object to nand_release()" commit was
backported which needed some adaptations to other code.

Run tested: ath79
Build tested: ath79

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens ce958dd88a kernel: Update kernel 4.14 to version 4.14.187
Fixes:
- CVE-2020-10757

The "mtd: rawnand: Pass a nand_chip object to nand_release()" commit was
backported which needed some adaptations to other code.

Build tested: ramips

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens 4bb5e331a7 kernel: Fix ath79 DSP exception at bootup
This resolves a hazard between a mtc0 and a mfc0 instruction after
activating the DSP support. Without this fix the CPU could use the old
value again and the DSP support would not be active.

Fixes: FS#2928, FS#2899
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [ath79/tl-wdr3600; ath79/tl-wdr4300]
Tested-by: David Bauer <mail@david-bauer.net> [ocedo_koala/ocedo_raccoon]
4 years ago
Antti Seppälä a175bc8f36 ath79: add support for GL.iNet GL-MiFi
Add support for the ar71xx supported GL.iNet GL-MiFi to ath79.

Specifications:
 - Atheros AR9331
 - 64 MB of RAM
 - 16 MB of FLASH (SPI NOR)
 - 2x 10/100/1000 Mbps Ethernet
 - 2.4GHz (AR9330), 802.11b/g/n
 - 1x USB 2.0 (vbus driven by GPIO)
 - 4x LED, driven by GPIO
 - 1x button (reset)
 - 1x mini pci-e slot (vcc driven by GPIO)

Flash instructions:

Vendor software is based on openwrt so you can flash the sysupgrade
image via the vendor GUI or using command line sysupgrade utility.
Make sure to not save configuration over reflash as uci settings
differ between versions.

Note on MAC addresses:

Even though the platform is capable to providing separate MAC addresses
to the interfaces vendor firmware does not seem to take advantage of
that. It appears that there is only single unique pre-programmed
address in the art partition and vendor firmware uses that for
every interface (eth0/eth1/wlan0). Similar behaviour has also been
implemented in this patch.

Note on GPIOs:

In vendor firmware the gpio controlling mini pci-e slot is named
3gcontrol while it actually controls power supply to the entire mini
pci-e slot. Therefore a more descriptive name (minipcie) was chosen.
Also during development of this patch it became apparent that the
polarity of the signal is actually active low rather than active high
that can be found in vendor firmware.

Acknowledgements:

This patch is based on earlier work[1] done by Kyson Lok. Since the
initial mailing-list submission the patch has been modified to comply
with current openwrt naming schemes and dts conventions.

[1] http://lists.openwrt.org/pipermail/openwrt-devel/2018-September/019576.html

Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
4 years ago
John Audia 472f5b1474 ipq806x: refresh config
Based on "make kernel_menuconfig CONFIG_TARGET=generic" and 5.4.49

CONFIG_LEDS_TRIGGER_DISK has been removed by the refresh and added
back manually in order to not revert f93fcf8923 ("ipq806x: enable
disk-activity LED trigger").

Signed-off-by: John Audia <graysky@archlinux.us>
[extend commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo 91472dc2ce kirkwood: support for button in Pogoplug V4
Pogoplug V4 has a reset button on a GPIO pin.
To use it, kmod-gpio-button-hotplug package needs to be installed.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Adrian Schmutzler b123ffdf6e ath79: drop redundant status for gpio target-wide
All definitions of gpio in SoC DTSI files do not set status, i.e.
have it enabled. This drops all remaining redundant "status = okay"
definitions in descendent files (mostly older ones).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler dc1280ef65 ath79: enable gpio on ar933x by default
All other SoC DTSI files have gpio enabled by default, only
ar9330/ar9331 disable it by default, only to have it enabled again
afterwards for each individual device.

So, do not disable it in the first place, and drop all device-specific
status statements afterwards.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Leon M. George a0bb356612 ath79: add support for Compex WPJ344
Specifications:

SoC: AR9344
DRAM: 128MB DDR2
Flash: 16MB SPI-NOR
2 Gigabit ethernet ports
2×2 2.4GHz on-board radio
miniPCIe slot that supports 5GHz radio
PoE 48V IEEE 802.3af/at - 24V passive optional
USB 2.0 header

Installation:

To install, either start tftp in bin/targets/ath79/generic/ and use
the u-boot prompt over UART:

tftpboot 0x80500000 openwrt-ath79-generic-compex_wpj344-16m-squashfs-sysupgrade.bin
erase 0x9f030000 +$filesize
erase 0x9f680000 +1
cp.b $fileaddr 0x9f030000 $filesize
boot

The cpximg file can be used with sysupgrade in the stock firmware (add
SSH key in luci for root access) or with the built-in cpximg loader.
The cpximg loader can be started either by holding the reset button
during power up or by entering the u-boot prompt and entering 'cpximg'.
Once it's running, a TFTP-server under 192.168.1.1 will accept the image
appropriate for the board revision that is etched on the board.

For example, if the board is labelled '6A08':

tftp -v -m binary 192.168.1.1 -c put openwrt-ath79-generic-compex_wpj344-16m-squashfs-cpximg-6a08.bin

MAC addresses:

<&uboot 0x2e010>  *:99  (label)
<&uboot 0x2e018>  *:9a
<&uboot 0x2e020>  *:9b
<&uboot 0x2e028>  *:9c

Only the first two are used (for ethernet), the WiFi modules have
separate (valid) addresses. The latter two addresses are not used.

Signed-off-by: Leon M. George <leon@georgemail.eu>
[minor commit message adjustments, drop gpio in DTS, DTS style fixes,
sorting, drop unused cpximg recipe]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo 736995ce19 ath79: rearrange nand node by register address
All other nodes in the DTS are placed in order of address space. Harmonize
the nand nodes as well.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Rowan Border 33fae8421e ramips: add support for TP-Link RE220 v2
TP-Link RE220 v2 is a wireless range extender with Ethernet and 2.4G and 5G
WiFi with internal antennas. It's based on MediaTek MT7628AN+MT7610EN.

This port of OpenWRT leverages work done by Andreas Böhler <dev@aboehler.at>
for the TP-Link RE200 v2 as both devices share the same SoC, flash layout
and GPIO pinout.

Specifications

MediaTek MT7628AN (580 Mhz)
64 MB of RAM
8 MB of FLASH
2T2R 2.4 GHz and 1T1R 5 GHz
1x 10/100 Mbps Ethernet
UART header on PCB (57600 8n1)
8x LED (GPIO-controlled), 2x button
There are 2.4G and 5G LEDs in red and green which are controlled separately.

Web Interface Installation

It is possible to upgrade to OpenWrt via the web interface. Simply flash
the -factory.bin from OEM. In contrast to a stock firmware, this will not
overwrite U-Boot.

Signed-off-by: Rowan Border <rowanjborder@gmail.com>
4 years ago
Kevin Darbyshire-Bryant d59dc14515 kernel: cake: backport upstream tweaks & fixes
From upstream:
b8392808eb3f sch_cake: add RFC 8622 LE PHB support to CAKE diffserv handling
3f608f0c4136 sch_cake: fix a few style nits
8c95eca0bb8c sch_cake: don't call diffserv parsing code when it is not needed
9208d2863ac6 sch_cake: don't try to reallocate or unshare skb unconditionally

From netdev not yet accepted:
sch_cake: fix IP protocol handling in the presence of VLAN tags

The VLAN tag handling is actually wider than just cake so upstream are
working out how to fix it generically.  We fix it here just for cake.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
Kevin Darbyshire-Bryant 77cd8f64ca kernel: cake: backport unused var patch to 5.4
This was backported to 4.19 and I clearly expected it to land in 5.4 but
it didn't (5.5) so backport it to 5.4 for consistency.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
Kevin Darbyshire-Bryant 4ca4c94267 kernel: cake: skb hash backport to 419
Commit 7b4877c204 backported to 5.4 only,
backport to 4.19 as well.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
Kevin Darbyshire-Bryant 3fda01a51e kernel: cake: renumber backport patches
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
David Bauer 5667ccbf16 ramips: remove duplicate MAC assignment case
Cudy WR1000 and Wavlink WL-WN577A2 store WAN as well as label MAC address
at the same position in flash.

Suggested-by: Sungbo Eo <mans0n@gorani.run>
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer 1ba0466d43 package: add ravpower-mcu package
This package allows to read battery status information and control the
power state of the RAVPower RP-WD009 power management IC.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer e959048c12 ramips: add support for RAVPower RP-WD009
The RAVPower RP-WD009 is a batter-powered pocket sized router with SD
card lot and USB port.

Hardware
--------
CPU:   MediaTek MT7628AN
RAM:   64M DDR2
FLASH: 16M GigaDevices SPI-NOR
WLAN:  MediaTek MT7628AN 2T2R b/g/n
       MediaTek MT7610E  1T1R n/ac
ETH:   1x FastEthernet
SD:    SD Card slot
USB:   USB 2.0

Custom PMIC on the I2C bus (address 0x0a).

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

1. Press and hold down the reset button.

2. Power up the Device. Keep pressing the reset button for 10
   more seconds until the Globe LED lights up.

3. Attach your Computer to the Ethernet port. Assign yourself the
   address 10.10.10.1/24.

4. Access the recovery page at 10.10.10.128 and upload the OpenWrt
   factory image.

5. The flashing will take around 1 minute. The device will reboot
   automatically into OpenWrt.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer f49063ba92 ath79: replace custom uImageArcher generation
The replaces the custom uImageArcher build step with the generic uImage
build step. The only different between these two is the difference in
the generated name.

Tested on: TP-Link Archer C59 v1

Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Lars Wessels dbaf0d20bb ramips: add support for WAVLINK WL-WN577A2
This commit adds support for the Wavlink WL-WN577A2 (black case) dual-band
wall-plug wireless router. In Germany this device is sold under the brand
name Maginon WL-755 (white case):

Device specifications:

- CPU: MediaTek MT7628AN (580MHz)
- Flash: 8MB
- RAM: 64MB
- Bootloader: U-Boot
- Ethernet: 2x 10/100 Mbps (Ralink RT3050)
- 2.4 GHz: 802.11b/g/n SoC
- 5 GHz: 802.11a/n/ac MT7610E
- Antennas: internal
- 4 green LEDs: 1 programmable (WPS) + LAN, WAN, POWER
- Buttons: Reset, WPS
- Small sliding power switch

Flashing instructions (U-boot):

- Configure a TFTP server on your PC/Laptop and set its IP
  to 192.168.10.100

- Rename the OpenWrt image to firmware.bin and place it in the
  root folder of the TFTP server

- Power off (using the small sliding power switch on the left
  side) the device and connect an ethernet cable from its LAN
  or WAN port to your PC/Laptop

- Press the WPS button (and keep it pressed)

- Power on the device (using the small power switch)

- After a few seconds, when the WAN/LAN LED stops blinking
  very fast, release the WPS button

- Flashing OpenWrt takes less than a minute, system will
  reboot automatically

- After reboot the WPS LED will indicate the current OpenWrt
  running status

Signed-off-by: Lars Wessels <software@bytebox.org>
[removed unused labels - fix whitespace errors - wrap commit message]
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler 5234593462 mvebu: move definition of factory.img out of Device/Default
The Device/Default definition in mvebu defines an IMAGE/factory.img
which is not included in IMAGES, and only used twice in the
individual definitions. Move it out of the default definition
to keep it closer to the reassignment of IMAGES and make it more
consistent with respect to other values of IMAGE/factory.img

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 0127de9547 ipq806x: set IMAGES in Device/Default definition
The Device/Default definition sets a default IMAGE/sysupgrade.bin,
but does not enable it by setting IMAGES. This is not consistent,
and has led to IMAGES being defined at various other places in the
file.

Thus, this patch consolidates the default value for IMAGES by putting
it in Device/Default. Since it's still overwritten where necessary,
this patch is cosmetic.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler e8afeaabc0 ipq40xx: set IMAGES in Device/Default definition
The Device/Default definition sets a default IMAGE/sysupgrade.bin,
but does not enable it by setting IMAGES. This is not consistent,
and has led to IMAGES being defined at various other places in the
file.

Thus, this patch consolidates the default value for IMAGES by putting
it in Device/Default. Since it's still overwritten where necessary,
this patch is cosmetic.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 8819faff47 ath79: do not build TP-Link tiny images by default
For quite some time, the tiny (4M flash) TP-Link sysupgrade and
factory images cannot be built anymore by the buildbots, just
the initramfs-kernel.bin files are still there.

Disable these images for the buildbots and prevent useless builds.

Note that these devices still build fine with default settings,
even for kernel 5.4.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago