Commit Graph

22082 Commits (d3c0a944059bb0d45c3b56278249100258378b0c)

Author SHA1 Message Date
Adrian Schmutzler f45a16dead ramips: allow to set switchdev by board in ramips_set_preinit_iface
This adds the option to determine switchdev by board when setting
preinit iface for failsafe. The patch reorganizes the code to use
functions for setting correct switchdev based on SOC and board,
which is supposed to improve readability and maintainability.

In this patch, the ramips_switchdev_from_board function is added
without specifying an actual device using it. This is meant to
make the life of device supporters waiting for merge easier, as
there is less to rebase and keep track of.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo 38bdfcdb87 ramips: add support for ipTIME A104ns
ipTIME A104ns is a 2.4/5GHz band AC750 router, based on MediaTek MT7620A.

Specifications:
- SoC: MT7620A
- RAM: DDR2 64MB
- Flash: SPI NOR 8MB
- WiFi:
  - 2.4GHz: SoC internal
  - 5GHz: MT7610EN
- Ethernet: 5x 10/100Mbps
  - Switch: SoC internal
- USB: 1x 2.0
- UART:
  - J2: 3.3V, TX, RX, GND (3.3V is the square pad) / 57600 8N1

Installation via web interface:
1.  Flash **initramfs** image through the stock web interface.
2.  Boot into OpenWrt and perform sysupgrade with sysupgrade image.

Revert to stock firmware:
1.  Perform sysupgrade with stock image.

In contrast to to-be-supported A1004ns, the A104ns has no usable
value in 0x1fc40 (uboot), so wan_mac needs to be calculated.
Also note that GPIOs for the LEDs really are inverted compared to
the A1004ns.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[moved state_default to device DTS, reordered properties in wmac,
added comment about wan_mac and LED GPIOs]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo 01d39cd18c ath79: migrate LED paths of TL-WDR4300 board
TL-WDR4300 board uses only green LED names in DTSI.
This patch adds migration for them.

The actual LED colors on the devices have been reported to vary
across subrevisions (v1.x). Despite, the USB LEDs on the back might
have different color than the other LEDs on the front.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[extended commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 2708d58c1d ramips: add label MAC address for Edimax RG21S
The Edimax RG21S has a label which bears two MAC addresses:
2.4 GHz (n) and 5 GHz (n+1)

The complete MAC address setup is as follows:
2.4 GHz  *:83  factory 0x4, u-boot-env wlanaddr
5 GHz    *:84  factory 0x8004
LAN      *:83  u-boot-env ethaddr
WAN      *:85  u-boot-env wanaddr

Since 2.4 GHz is the first address on the label and the same
as used for ethernet, take this one for label MAC address.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Birger Koblitz c79df949ab ramips: increase SPI frequency for Edimax RG21S
This increases SPI frequency from the relatively low 10 MHz to 40 MHz.

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
[added commit title/message, split patch]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Birger Koblitz 8007853f79 ramips: remove unnecessary nodes in DTS for Edimax RG21S
This sdhci and i2c nodes were copy-pasted, but are not needed as
the device does not provide that functionality. Remove them.

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
[added commit title/message, split patch]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 9e1e432469 ar71xx: indicate upgrade using system LED
This enables the system LED to indicate a running firmware upgrade. This
pattern is used on most platforms provided by the generic base-files
package. ar71xx uses it's own implementation for the system-LED, where
the upgrade case is not yet implemented.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer 16b01fb1b9 mpc85xx: add support for Enterasys WS-AP3710i
Hardware
--------

SoC:   NXP P1020 (2x e500 @ 800MHz)
RAM:   256M DDR3 (Micron)
FLASH: 32M NOR (Spansion S29GL128S)
BTN:   1x Reset
WiFi:  1x Atheros AR9590 2.4 bgn 3x3
       2x Atheros AR9590 5.0 an 3x3
ETH:   1x Gigabit Ethernet (Atheros AR8033)
LED:   System (green/red) - Radio{0,1} (green)
       LAN (connected to PHY)
        - GE blue
        - FE green

Serial is a Cisco-compatible RJ45 next to the ethernet port.
115200-N-8 are the settings for OS and U-Boot.

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

1. Grab the OpenWrt initramfs, rename it to 01C8A8C0.img. Place it in
   the root directory of a TFTP server and serve it at
   192.168.200.200/24.

2. Connect to the serial port and boot the AP. Stop autoboot in U-Boot
   by pressing Enter when prompted. Credentials are identical to the one
   in the APs interface. By default it is admin / new2day.

3. Set the bootcmd so the AP can boot OpenWrt by executing

   $ setenv boot_openwrt "setenv bootargs;
     cp.b 0xee000000 0x1000000 0x1000000; bootm 0x1000000"
   $ setenv bootcmd "run boot_openwrt"
   $ saveenv

   If you plan on going back to the vendor firmware - the bootcmd for it
   is stored in the boot_flash variable.

4. Load the initramfs image to RAM and boot by executing

   $ tftpboot 0x1000000 192.168.200.200:01C8A8C0.img; bootm

5. Make a backup of the "firmware" partition if you ever wish to go back
   to the vendor firmware.

6. Upload the OpenWrt sysupgrade image via SCP to the devices /tmp
   folder.

7. Flash OpenWrt using sysupgrade.

   $ sysupgrade -n /tmp/openwrt-sysupgrade.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
DENG Qingfang 1b7199c90c ramips: add support for JCG JHR-AC876M
JCG JHR-AC876M is an AC2600M router

Hardware specs:
  SoC: MT7621AT
  2.4GHz: MT7615N 4x4 @ PCIe0
  5GHz: MT7615N 4x4 @ PCIe1
  Flash: Winbond W25Q128JVSQ 16MiB
  RAM: Nanya NT5CB128M16 256MiB
  USB 2.0 and 3.0 ports
  6 LEDs, 3 of which are connected to SoC GPIO
  Reset and WPS buttons

Flash instructions:
Stock to OpenWrt:
  Upload factory.bin in stock firmware's upgrade page,
  do not preserve settings

OpenWrt to stock:
  Push and hold the reset button for 5s while power cycling to
  enter recovery mode;
  Visit 192.168.1.1 and upload stock firmware

MAC addresses map:
  0x0004  *:1c  wlan2g/wan/label
  0x8004  *:20  wlan5g
  0xe000  *:1b  lan
  0xe006  *:1a  not used in stock fw

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
Adrian Schmutzler 0bf4d681d4 ramips: allow JCG_MAXSIZE in kiB in Build/jcg-header
This allows JCG_MAXSIZE to be specified in kilobytes. This makes
this value more consistent and easier comparable with other size
variables.

This also changes the only occurence of the variable, for Cudy WR1000.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo a972b1fb5f ramips: add support for ipTIME A6ns-M
ipTIME A6ns-M is a 2.4/5GHz band AC1900 router, based on MediaTek MT7621A.

Specifications:
- SoC: MT7621AT
- RAM: DDR3 128MB
- Flash: SPI NOR 16MB
- WiFi:
  - 2.4GHz: MT7615
  - 5GHz: MT7615
- Ethernet: 5x 10/100/1000Mbps
  - Switch: SoC internal
- UART:
  - J4: 3.3V, TX, RX, GND (3.3V is the square pad) / 57600 8N1

Installation via web interface:
1.  Flash **initramfs** image through the stock web interface.
2.  Boot into OpenWrt and perform sysupgrade with sysupgrade image.

Revert to stock firmware:
1.  Perform sysupgrade with stock image.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Adrian Schmutzler 5cda133d99 ramips: DTS style improvements for mt7621_wevo_w2914ns-v2.dtsi
This does several trivial DTS style improvements:

- Move device name compatible to DTS files (and fix compatible in
  11acnas.dts)
- Remove xhci node as status is set to okay in mt7621.dtsi already
- 0x0 instead of 0x0000
- Simplify state_default node definition

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo 0375c076b6 ramips: add support for ZIO FREEZIO
ZIO FREEZIO is a 2.4/5GHz band AC1200 router, based on MediaTek MT7621A.

Specifications:
- SoC: MT7621AT
- RAM: DDR3 128MB
- Flash: SPI NOR 16MB
- WiFi:
  - 2.4GHz: MT7603EN
  - 5GHz: MT7612EN
- Ethernet: 5x 10/100/1000Mbps
  - Switch: SoC internal
- USB: 1x 3.0
- UART:
  - J4: 3.3V, RX, TX, GND (3.3V is the square pad) / 57600 8N1

Notes:
- FREEZIO has almost the same board as WeVO W2914NS v2.
- Stock firmware is based on OpenWrt BB.

MAC addresses in factory partition:
0x0004: WiFi 2.4GHz (label_mac-8)
0x002e: WAN (label_mac)
0x8004: WiFi 5GHz (label_mac-4)
0xe000: LAN (label_mac+1)

Installation via web interface:
1.  Access web admin page and turn on "OpenWrt UI mode".
2.  Flash sysupgrade image through LuCI, with the "Keep settings" option
    OFF.

Revert to stock firmware:
1.  Perform sysupgrade with stock image.
    Make sure to NOT preserve settings.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[rebase, use mt7621_wevo_w2914ns-v2.dtsi]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Roman Bazalevsky 69fff339e9 sunxi: add support for FriendlyARM Nano PI NEO Air dev board
Hardware:

  Allwinner H3 upto 1.2GHz
  512MB DDR3 RAM
  8GB on-board eMMC - mountable, can be used as boot with custom boot.scr
  microSD-card slot
  WiFi 802.11n (AP6212A) - working
  Bluetooth (AP6212A) - not working for now
  Micro-USB OTG + 2*USB headers
  UART 3.3V - working
  GPIO/I2C/SPI 2.54mm headers

Standard sunxi SD-card installation procedure - copy image to SD card,
insert in into slot and boot. First time you will need UART adapter to
enable on-board wireless (or just build custom image with enabled WiFi).

To boot from eMMC:

  - boot from SD
  - copy SD image to emmc (dd bs=... if=.... of=/dev/mmcblk2)
  - mount eMMC boot partition and replace boot script on it
  - unmount, reboot

To use i2c, spi and more uarts - replace dtb on boot partition with
fixed one (use dtc or fdt-tools).

Signed-off-by: Roman Bazalevsky <rvb@rvb.name>
[rebase onto device name consolidation patches]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 3a4ad758f5 sunxi: construct DTS name from device node name and SOC
The device part in the SUNXI_DTS variable always corresponds to
device node name. This is another redundancy that can be removed
by calculating the DTS name from a newly introduced SUNXI_SOC
variable and the node name.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler a4cdb537b1 sunxi: use vendor_device scheme for device definitions
This changes device definition to resemble the vendor_device scheme
already present for the majority of device compatible strings.

By doing this, we achieve several advantages at once:
- Image names and node names are more consistent with other targets.
- SUPPORTED_DEVICES can be set automatically for all but two cases.
- Image names and node names are in line with DEVICE_TITLEs.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler c642a97aa6 ath79: add support for TP-Link TL-WDR4300 v1 (IL)
The TL-WDR4300 v1 sold in Israel has a different TPLINK_HWID.

Thanks to Josh4300 for testing on device.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 8e91b18ab7 ath79: redistribute UBNT variables in Ubiquiti image Makefile
The variables UBNT_BOARD and UBNT_VERSION are defined in the parent
Device/ubnt definition and then overwritten for most of the derived
platform definitions (e.g. Device/ubnt-wa).

Since this mixed use of inheritance and overwriting can be misleading,
this moves the variables to the platform-based definitions.

While at it, reorder the definitions to have order consistent, too.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 68ef534989 ramips: add label MAC address for Mikrotik RBM33G
The device label contains:
E01: B8:69:F4:xx:xx:07
E02: B8:69:F4:xx:xx:09

The first value corresponds to the address set in hard_config 0x10.

That one is taken for the label MAC address.

Thanks to Martin Schiller for retrieving the information.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 772af7f98d ramips: rt305x: use flash location for wan_mac in 02_network
This uses the flash locations instead of eth0 MAC address to
calculate MAC address increments for WAN.

The change will make the MAC address setup of a particular device
more obvious and removes the dependency of 02_network on the eth0
initialization.

This removes the wan_mac setup for the following devices as they
do not set up a MAC address for ethernet in the first place:
- asiarf,awapn2403
- belkin,f7c027
- dlink,dir-615-d
- mofinetwork,mofi3500-3gn
- prolink,pwh2004
- ralink,v22rw-2x2
- unbranded,wr512-3gn-4m
- unbranded,wr512-3gn-8m

While at it, make some DT node labels consistent with the label
property.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler a858d6d0e2 ramips: rt288x: use flash location for wan_mac in 02_network
This uses the flash locations instead of eth0 MAC address to
calculate MAC address increments for WAN.

The change will make the MAC address setup of a particular device
more obvious and removes the dependency of 02_network on the eth0
initialization.

This removes the wan_mac setup for ralink,v11st-fe as this device
does not set up a MAC address for ethernet in the first place.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler fef1810897 ramips: mt76x8: use flash location for wan_mac in 02_network
This uses the flash locations instead of eth0 MAC address to
calculate MAC address increments for WAN.

The change will make the MAC address setup of a particular device
more obvious and removes the dependency of 02_network on the eth0
initialization.

While at it, change the partition label for zyxel,keenetic-extra-ii
to factory to be consistent with node label and all the other devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler ed975a58e4 ramips: mt7621: use flash location for wan_mac in 02_network
This uses the flash locations instead of eth0 MAC address to
calculate MAC address increments for WAN.

The change will make the MAC address setup of a particular device
more obvious and removes the dependency of 02_network on the eth0
initialization.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 98d9158d2f ramips: mt7620: use flash location for wan_mac in 02_network
This uses the flash locations instead of eth0 MAC address to
calculate MAC address increments for WAN.

The change will make the MAC address setup of a particular device
more obvious and removes the dependency of 02_network on the eth0
initialization.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 38866f275d ramips: remove wan_mac setup for evaluation boards
The evaluation boards do not set up a MAC address for eth0
in the first place, so it does not make sense to calculate a WAN
address from the random MAC used there.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 757658f2ab ramips: create common DTSI for TP-Link Archer C20i/C20 v1/C50 v1
The TP-Link Archer C20i/C20 v1/C50 v1 seem to be almost the same,
so creating a common DTSI will reduce duplicate code.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler c4f6850efc ramips: remove unused DTS variable from DEVICE_VARS
The DTS variable has been removed in 402138d12d ("ramips: Derive
DTS name from device name in Makefile"), but the DEVICE_VARS entry
has been overlooked.

Remove it now since we are not using this variable.

This must _not_ be backported to 19.07, where the variable is still
in use.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Gabor Varga a283b1788a ramips: fix switch port numbering for RT-AC65P/RT-AC85P
The switch LAN port numbers are in reversed order with original config.
With this patch they are fixed.

Port order checked on both devices.

Signed-off-by: Gabor Varga <vargagab@gmail.com>
[merged definitions into appropriate block, extended commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler e00396d584 ramips: add label MAC address for TP-Link Archer C20i
Current OpenWrt MAC setup:
eth0             &rom 0xf100    :48
eth0.2           eth0+1         :49
wlan0 (5 GHz)    &radio 0x8004  different OUI
wlan1 (2.4 GHz)  &radio 0x4     same OUI as wlan0

Label MAC address corresponds to eth0 (&ethernet).

No additional addresses found in hexdump of rom/radio.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
DENG Qingfang 46c74944df ath79: fix typos in DTS
Replace "usb_ochi" with "usb_ohci", and "usb_echi" with "usb_ehci".

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
Koen Vandeputte 88ca372b5a kernel: bump 4.19 to 4.19.88
Refreshed all patches.

Remove upstreamed:
- 0004-boot-sq201-from-sda1.patch
- 500-v4.20-ubifs-Fix-default-compression-selection-in-ubifs.patch
- 0003-usb-dwc2-use-a-longer-core-rest-timeout-in-dwc2_core.patch

Altered patches:
- 0011-ARM-dts-Fix-up-SQ201-flash-access.patch
- 400-mtd-add-rootfs-split-support.patch
- 0101-pci-mediatek-backport-fix-pcie.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte d395583d69 kernel: bump 4.14 to 4.14.158
Refreshed all patches.

Altered patches:
- 400-mtd-add-rootfs-split-support.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte a9b9592196 kernel: bump 4.9 to 4.9.206
Refreshed all patches.

Altered patches:
- 400-mtd-add-rootfs-split-support.patch

Compile-tested on: none
Runtime-tested on: none

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Daniel Golle e964338110 malta: remove CONFIG_LEGACY_PTY from kernel config
Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Daniel Golle 2105354968 sunxi: remove CONFIG_LEGACY_PTY from kernel config
Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Daniel Golle 414d027ae8 layerscape: remove CONFIG_LEGACY_PTY from kernel config
Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Daniel Golle 411e824ec3 kirkwood: remove CONFIG_LEGACY_PTY from kernel config
Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Daniel Golle c1db4d9c56 at91: disable legacy PTYs and virtual terminals
Enabling legacy PTYs causes problems with procd-hotplug.
And as this is a headless target, no need to have virtual terminals.
Remove corresponding kernel config options, they are disabled in
generic kernel config.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Daniel Golle d0d7f5d9e4 mpc85xx: remove CONFIG_LEGACY_PTY from kernel config
Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Daniel Golle 8069e9734b ixp4xx: remove CONFIG_LEGACY_PTY from kernel config
Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Daniel Golle dcf48fda05 uml: remove CONFIG_LEGACY_PTY from kernel config
Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Daniel Golle c881769a55 oxnas: disable legacy PTYs and virtual terminals
Enabling legacy PTYs causes problems with procd-hotplug.
And as this is a headless target, no need to have virtual terminals.
Remove corresponding kernel config options, they are disabled in
generic kernel config.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Adrian Schmutzler 231dc26867 treewide: remove dts-v1 identifier from DTSI files
The "/dts-v1/;" identifier is supposed to be put once at the beginning
of a device tree file. Thus, it makes no sense to provide it a second
time in to-be-included DTSI files.

This removes the identifier from all DTSI files in /target/linux.

Most of the DTS files in OpenWrt do contain the "/dts-v1/;". It is
missing for most of the following targets, though:
mvebu, ipq806x, mpc85xx, ipq40xx

This does not touch ipq806x for now, as the bump to 4.19 is close.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Olli Asikainen deb835849a brcm47xx: add switch configuration for WNR3500L
Netgear WNR3500L is an already supported device, but out of the
box, the device has no switch configuration and there is no wan.
The correct configuration for this specific model is similar to
some other models. This simple commit adds the correct switch
and the out-of-the-box experience is improved.

Experimentally determined:

Port 0 => WAN
Port 1..4 => LAN
Port 5..7 => unused
Port 8 => CPU

Signed-off-by: Olli Asikainen <olli.asikainen@gmail.com>
Tested-by: Fabian Zaremba <fabian@youremail.eu>
[added port mapping to commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 34abfb6e91 ramips: convert mediatek,mtd-eeprom from decimal to hex notation
A small subset of devices uses decimal notation for mediatek,mtd-eeprom
in DTS files. Convert to hexadecimal notation to be consistent with
all the rest.

Also change "0" to "0x0" in the same files for consistency.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Martin Schiller 3a55c7935d ramips: fix number of LAN Ports for Mikrotik RBM33G
The Mikrotik RBM33G has only 2 LAN ports.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
[moved node in 02_network to maintain alphabetic sorting]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Walter Sonius a065cd29bf ramips: fix switch port order for TP-Link Archer C20i
Physical port order watched from the backside of the C20i
(from left to right) is: Internet / 1 / 2 / 3 / 4

Physical Port	Switch port
WAN             0
LAN 3           1
LAN 4           2
LAN 1           3
LAN 2           4
(not used)      5
CPU             6

Signed-off-by: Walter Sonius <walterav1984@gmail.com>
[commit message/title improvements]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Christian Lamparter a428606646 ath79: fix WNDR3700/WNDR3800 wifi reg size
"[...] the size component shall be zero."
(See "PCI Bus Binding to: IEEE Std 1275-1994 Rev 2.1"
section "4.1.1 Open Firmware-defined Properties for Child Nodes")

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
John Crispin a512123a4b mediatek: fix pcie bringup issue
Signed-off-by: John Crispin <john@phrozen.org>
5 years ago
Stijn Tintel 157e17e985 ath79: add support for Ubiquiti LiteBeam AC Gen2
Hardware:
* SoC: Atheros AR9342-BL1A
* RAM: 64MB DDR2 (Winbond W9751G6KB-25)
* Flash: 16MB SPI NOR (Macronix MX25L12835FZ2I-10G)
* Ethernet: 1x 10/100/1000 Mbps (Atheros AR8035-A) with 24V PoE support
* Wifi 2.4GHz: Atheros AR9340 v2
* WiFi 5GHz: Ubiquiti U-AME-G1-BR4A (rebranded QCA988X v2)
* LEDs: 1x Power, 1x Ethernet
* Buttons: 1x Reset
* UART: 1x TTL 115200n8, 3.3V RX TX GND, 3.3V pin closest to RJ45 port

The LEDs do not seem to be connected to any GPIO, so there is currently
no way to control them.

Installation via U-Boot, TFTP and serial console:
* Configure your TFTP server with IP 192.168.1.254
* Connect serial console and power up the device
* Hit any key to stop autoboot
* tftpboot 0x81000000 openwrt-ath79-generic-ubnt_litebeam-ac-gen2-initramfs-kernel.bin
* bootm 0x81000000
* copy openwrt-ath79-generic-ubnt_litebeam-ac-gen2-squashfs-sysupgrade.bin
  to /tmp
* sysupgrade /tmp/openwrt-ath79-generic-ubnt_litebeam-ac-gen2-squashfs-sysupgrade.bin

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Petr Štetiar <ynezz@true.cz>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Stijn Tintel db26f53bb3 ath79: drop IMAGE/factory.bin from ubnt-wa devices
The sysupgrade image contains OpenWrt specific metadata. Having this
metadata in the factory images makes no sense. Drop IMAGE/factory.bin
from Device/ubnt-wa and use the default from Device/ubnt instead.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Petr Štetiar <ynezz@true.cz>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Kevin Darbyshire-Bryant 89b8dd62ce kernel: act_ctinfo: fix updated backport on 4.14
It turns out my 4.14 testing had a rather large flaw in it and the
'extack' mechanism isn't quite ready.  Remove the extack stuff from this
backport.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
5 years ago
Kevin Darbyshire-Bryant 1d608a10a0 kernel: act_ctinfo: update backport
Since the original backports from kernel 5.3 a few things have been
tweaked by kernel bumps & other upstream changes.  Update the backport
to reflect upstream as closely as possible and remove the bitrot.

Functions remain the same, error reporting improved.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
5 years ago
Adrian Schmutzler f6385f30bd ath79: fix source of label MAC address for Ubiquiti XM devices
In d421a8b944 ("ath79: read label MAC address from flash instead
of using phy0/phy1") the source of the label MAC address was changed
for devices just reading it from phy0. To get rid of the dependency
from phy startup, addresses were read directly from the flash
locations that are used to initialize the phy MAC addresses.

Unfortunately, it turned out that Ubiquiti XM devices seem to have
different flash locations than expected, and also seem to have
specific locations for different devices (all in art/EEPROM):

0xe012 AR9280 Nanostation M2 - 0x120c
0xe035 AR9280 Nanostation M3 - 0x120c
0xe1b2 AR9280 Rocket M2 - 0x120c
0xe1c3 AR9280 Rocket M3 - 0x120c
0xe1b5 AR9280 Rocket M5 - 0x120c
0xe2d5 AR9280 Bullet M2 Titanium - 0x120c
0xe2b5 AR9280 Nanobridge M5 - 0x120c
0xe202 AR9280 Bullet M2 - 0x120c
0xe232 AR9287 Nanobridge M2 - 0x110c
0xe4a2 AR9285 AirRouter - 0xa0bf
Picostation M2 - 0x120c and 0xa0bf
Nanostation Loco M2 - not in 0x120c, other locations not checked

An additional problem of the Ubiquiti device support in OpenWrt is
that we provide images that match several subvariants of the devices,
which might have different MAC address locations.

Given that reading the address from phy0 in 02_network _is_ working
for the ath79 target in general, it does not seem reasonable to
rebuild a complex MAC address retrieval mechanism which is already
present in the ath9k driver.

So, this patch reverts the label MAC address source for Ubiquiti XM
devices (and the Unifi AP) to /sys/class/ieee80211/phy0/macaddress.

This doesn't affect XW and Unifi AC devices, where the label MAC
address source is defined via device tree.

For alfa-network,ap121f the location 0x1002 is kept, as this has
been verified during device support preparation in PR #2199.

Fixes: d421a8b944 ("ath79: read label MAC address from flash
instead of using phy0/phy1")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Stijn Tintel 291d79935e octeon: fix sysupgrade
Sysupgrade was failing due to incorrect replacement of backticks:
/sbin/sysupgrade: /lib/upgrade/platform.sh: line 101: syntax error: missing '))'

Fixes: 0bbfc3dff7 ("octeon: replace backticks by $(...)")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
5 years ago
David Bauer 3f79aaa297 generic ar8xxx: increase VLAN table for AR83x7
The Atheros AR8327 and AR8337 have (according to their datasheet) a
VLAN table with a maximum of 4096 entries.

Currently, there's a hard limit of 128 VLANs, which is the same as
for most other Atheros switches. Increase this limit only for the
AR83x7 series and modify some shared functions to allow them to work
with a variable max VLAN count.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Christian Lamparter 82a741c774 mac80211: switch to upstream owl-loader driver
The Owl Loader (named after the codename that Atheros gave
these devices back in the day) has been accepted upstream.

This patch removes the "misc" driver OpenWrt had and adds
the remaining differences against the version that ships
with 5.4-rc1 into a separate "120-owl-loader-compat.patch"
file that can be cut down once AR71XX is being dealt with.

Note: I decided to keep the existing (kmod-)owl-loader
package name around for now. The kernel module file in
the kmod package will be called ath9k_pci_owl_loader.ko
though.

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Robert Marko 146eb4925c ipq40xx: add support for Crisis Innovation Lab MeshPoint.One
MeshPoint.One is Wi-Fi hotspot and smart IoT gateway (based upon
Jalapeno module from 8Devices).

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

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

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

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

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

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

Signed-off-by: Robert Marko <robert@meshpoint.me>
[commit description long line wrap]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Koen Vandeputte 7c76565d4c kernel: bump 4.9 to 4.9.205
Refreshed all patches.

Fixes:
- CVE-2019-18660

Compile-tested on: none
Runtime-tested on: none

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte f19e471f32 kernel: bump 4.19 to 4.19.86
Refreshed all patches.

Altered patches:
- 950-0064-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch
- 0005-mtd-physmap_of-Move-custom-initialization.patch

Remove upstreamed:
- 0001-pinctrl-gemini-Mask-and-set-properly.patch
- 0002-pinctrl-gemini-Fix-up-TVC-clock-group.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 414b7c107a kernel: bump 4.14 to 4.14.156
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Adrian Schmutzler 118749271b mpc85xx: add vendor to Makefile node name, derive SUPPORTED_DEVICES
By adding the vendor to the Makefile device definition node name,
one can derive the standard compatible used in SUPPORTED_DEVICES
instead of having to specify it manually.

Despite, this moves the naming scheme closer to what is used for
other targets (ath79, ramips).

Build-tested on all subtargets.
Run-tested on TP-Link TL-WDR4900 v1.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Anderson Vulczak 9b90dc05f5 ath79: add support for TP-Link Archer C6 v2 (US) and A6 (US/TW)
This patch is based on #1689 and adds support for TP-Link Archer
C6 v2 (US) and A6 (US/TW).

The hardware is the same as EU and RU variant, except for GPIOs
(LEDS/Buttons), flash(chip/partitions) and UART being available
on the board.

- SOC: Qualcomm QCA9563 @ 775MHz
- Flash: GigaDevice GD25Q127CS1G (16MiB)
- RAM: Zentel A3R1GE40JBF (128 MiB DDR2)
- Ethernet: Qualcomm QCA8337N: 4x 1Gbps LAN + 1x 1Gbps WAN
- Wireless:
  - 2.4GHz (bgn) QCA9563 integrated (3x3)
  - 5GHz (ac) Qualcomm QCA9886 (2x2)
- Button: 1x power, 1x reset, 1x wps
- LED: 6x LEDs: power, wlan2g, wlan5g, lan, wan, wps
- UART: 115200, 8n1 (header available on board)

Known issues:
 - Wireless: 5GHz is known to have lower RSSI signal, it affects speed and range.

Flash instructions:

Upload openwrt-ath79-generic-tplink_archer-c6-v2-us-squashfs-factory.bin
via the router Web interface.

Flash instruction using tftp recovery:

1. Connect the computer to one of the LAN ports of the router
2. Set the computer IP to 192.168.0.66
3. Start a tftp server with the OpenWrt factory image in the
   tftp root directory renamed to ArcherA6v2_tp_recovery.bin.
4. Connect power cable to router, press and hold the
   reset button and turn the router on
5. Keep the reset button pressed until the WPS LED lights up
6. Wait ~150 seconds to complete flashing

Flash partitioning: I've followed #1689 for defining the partition layout
for this patch. The partition named as "tplink" @ 0xfd0000 is marked
as read only as it is where some config for stock firmware are stored.
On stock firmware those stock partitions starts at 0xfd9400 however
I had not been able to make it functional starting on the same address as
on stock fw, so it has been partitioned following #1689 and not the stock
partition layout for this specific partition. Due to that firmware/rootfs
partition lenght is 0xf80000 and not 0xf89400 as stock.

According to the GPL code, the EU/RU/JP variant does have different GPIO pins
assignment to LEDs and buttons, also the flash memory layout is different.

GPL Source Code: https://static.tp-link.com/resources/gpl/gpl-A6v2_us.tar.gz

Signed-off-by: Anderson Vulczak <andi@andi.com.br>
[wrap commit message, remove soft_ver change for C6 v2 EU, move LED aliases
to DTS files, remove dts-v1 in DTSI, node/property reorder in DTSI]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler c08ddfce3f ath79: rename EEPROM to art
This renames all remaining occurrences of "EEPROM" to "art" to
further harmonize the partition labelling in ath79. This will
help to reduce the amount of user-space code and might be
beneficial when code is copy/pasted in the future.

Affected are only devices from Ubiquiti, where the XM board is
already using "art" in ath79.

Acked-by: Piotr Dymacz <pepe2k@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Piotr Dymacz e5d4c09667 ath79: add support for YunCore XD4200 and A782
YunCore XD4200 ('XD4200_W6.0' marking on PCB) is Qualcomm/Atheros based
(QCA9563, QCA9886, QCA8334) dual-band, Wave-2 AC1200 ceiling AP with PoE
(802.3at) support. A782 model ('T750_V5.1' marking on PCB) is a smaller
version of the XD4200, with similar specification but lower TX power.

Specification:

- QCA9563 (775 MHz)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 2x 10/100/1000 Mbps Ethernet (QCA8334), with 802.3at PoE support (WAN)
- Wi-Fi 2.4 GHz:
  - XD4200: 2T2R (QCA9563), with ext. PA (SKY65174-21) and LNA
  - A782: 2T2R (QCA9563), with ext. FEM (SKY85329-11)
- Wi-Fi 5 GHz:
  - XD4200: 2T2R (QCA9886), with ext. FEM (SKY85728-11)
  - A782: 2T2R (QCA9886), with ext. FEM (SKY85735-11)
- LEDs:
  - XD4200: 5x (2x driven by SOC, 1x driven by AC radio, 2x Ethernet)
  - A782: 3x (1x RGB, driven by SOC and radio, 2x Ethernet)
- 1x button (reset)
- 1x UART (4-pin, 2.54 mm pitch) header on PCB
- 1x DC jack (12 V)

Flash instructions:

If your device comes with generic QSDK based firmware, you can login
over telnet (login: root, empty password, default IP: 192.168.188.253),
issue first (important!) 'fw_setenv' command and then perform regular
upgrade, using 'sysupgrade -n -F ...' (you can use 'wget' to download
image to the device, SSH server is not available):

  fw_setenv bootcmd "bootm 0x9f050000 || bootm 0x9fe80000"
  sysupgrade -n -F openwrt-...-yuncore_...-squashfs-sysupgrade.bin

In case your device runs firmware with YunCore custom GUI, you can use
U-Boot recovery mode:

1. Set a static IP 192.168.0.141/24 on PC and start TFTP server with
   'tftp' image renamed to 'upgrade.bin'
2. Power the device with reset button pressed and release it after 5-7
   seconds, recovery mode should start downloading image from server
   (unfortunately, there is no visible indication that recovery got
   enabled - in case of problems check TFTP server logs)

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Vincent Wiemann 8016f64864 ath79: add support for YunCore TFTP image generation
YunCore QCA9k based devices released in 2019 require a custom TFTP image
for U-Boot built-in recovery mode (triggered with reset button). Image
has to be prepended with 'YUNCORE' keyword followed by U-Boot CLI
commands which will be executed later. Images without the custom header
will be ignored by U-Boot.

To be able to support both the vendor firmware (QSDK) and OpenWrt flash
layouts, used here commands change the 'bootcmd' before flashing image.

This commit adds generic helper script for YunCore devices with 16 MB of
flash and enables TFTP image generation for A770 model.

Signed-off-by: Vincent Wiemann <vincent.wiemann@ironai.com>
[pepe2k@gmail.com: commit description reworded, recipe renamed]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Piotr Dymacz c543dfe431 ath79: generic: base-files: fix indentation in 02_network
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
David Bauer 6a76ea359b ramips: reorganize NETGEAR sercomm boards
This re-organizes the device-tree files for the Sercomm-manufactured
NETGEAR routers. They are now split into two different base-boards,
from which the respective model is extended.

This partially reverts commit c7842ceaaa ("ramips: reorganize DTSI
files for Netgear R devices"), which introduced inheritance between two
completely unrelated base-boards.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Stijn Segers bfabd8d613 ath79: remove ath10k drivers from Archer C7 v1 profile
Ath10k packages were removed from ar71xx in master in commit
34113999ef ("ar71xx: Remove ath10k packages from archer-c7-v1 (fixes
FS#1743)") but ath79 in master and the 19.07 branch still suffer from
the issue.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
[commit description facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Petr Štetiar 3bbcffa0b6 treewide: kernel config: remove runtime options
Remove CC_HAS_ASM_GOTO, CC_IS_GCC and GCC_VERSION kernel config options
which are set at runtime and which should be ignored now.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Yousong Zhou b3779e920e kernel: nf_conntrack_rtcache: fix WARNING on rmmod
Fixes b7c58a1ee ("kernel: nf_conntrack_rtcache: fix cleanup on netns
delete and rmmod")

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years ago
Yousong Zhou 1c5df850a0 kernel: nf_conntrack_rtcache: fix WARNING on forward path
Fixes b7c58a1ee ("kernel: nf_conntrack_rtcache: fix cleanup on netns
delete and rmmod")

Resolves FS#2624

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years ago
Adrian Schmutzler 226bc91109 ath79: improve TP-Link CPE DTSI names for ar9344 SOC
The initial DTSI names for the TP-Link CPE devices have become
quite confusing, as several non-V1 devices now use the *-v1.dtsi,
the *cpe510-v1.dts does not use the cpe510.dtsi, etc.

This introduces a new naming scheme based on whether devices have
one or two ports, which should be easier to grasp.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 640a36aafc ath79: DTS style improvement for Ubiquiti XM and BZ devices
This applies minor style improvements and removes commented pll
clock adjustments from ubnt_xm DTSI. The latter were introduced
(already commented out) when adding ath79 target and have never
been touched since then. For Unifi (BZ board), similar clock
adjustments are employed and used.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Yousong Zhou b7c58a1eeb kernel: nf_conntrack_rtcache: fix cleanup on netns delete and rmmod
Fixes FS#1472, FS#2353, FS#2426

Fixes: b3f95490 ("kernel: generic: Add kernel 4.14 support")
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hauke Mehrtens 103e49f62e kernel: Add missing configuration option
This was found by the build bot.

Fixes: e29500eb84 ("kernel: bump 4.19 to 4.19.85")
Fixes: db9e9e8382 ("kernel: bump 4.14 to 4.14.155")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Koen Vandeputte ada7322055 cns3xxx: use proper macros for defining partition regions
While at it, also reorder the items for
improved readability.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte e29500eb84 kernel: bump 4.19 to 4.19.85
Refreshed all patches.

Altered patches:
- 080-sata_support.patch

Remove upstreamed:
- 034-v4.20-MIPS-BCM47XX-Enable-USB-power-on-Netgear-WNDR3400v3.patch
- 001-4.21-01-BCM63XX-fix-switch-core-reset-on-BCM6368.patch
- 073-qcom-ipq4019-fix-cpu0-s-qcom-saw2-reg-value.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte db9e9e8382 kernel: bump 4.14 to 4.14.155
Refreshed all patches.

Altered patches:
- 707-dpaa-ethernet-support-layerscape.patch

Remove upstreamed:
- 034-v4.20-MIPS-BCM47XX-Enable-USB-power-on-Netgear-WNDR3400v3.patch
- 001-4.21-01-BCM63XX-fix-switch-core-reset-on-BCM6368.patch
- 073-qcom-ipq4019-fix-cpu0-s-qcom-saw2-reg-value.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Andrew Cameron 20fdfe37d2 ath79: add support for the TP-LINK WBS510 V1
This adds support for a popular low-cost 5GHz N based AP

Specifications:
- SoC: Atheros AR9344
- RAM: 64MB
- Storage: 8 MB SPI NOR
- Wireless: 5GHz 300 Mbps, 2x RP-SMA connector, 27 dBm TX power
- Ethernet: 1x 10/100 Mbps with 24V POE IN, 1x 10/100 Mbps

Installation:
Flash factory image through stock firmware WEB UI
or through TFTP
To get to TFTP recovery just hold reset button while powering on for
around 4-5 seconds and release.
Rename factory image to recovery.bin
Stock TFTP server IP:192.168.0.100
Stock device TFTP adress:192.168.0.254

Signed-off-by: Andrew Cameron <apcameron@softhome.net>
5 years ago
Andrew Cameron 5b8709d9f2 ath79: add support for the TP-LINK WBS510 V2
This adds support for a popular low-cost 5GHz N based AP

Specifications:
 - SoC: Atheros AR9344
 - RAM: 64MB
 - Storage: 8 MB SPI NOR
 - Wireless: 5GHz 300 Mbps, 2x RP-SMA connector, 27 dBm TX power
 - Ethernet: 1x 10/100 Mbps with 24V POE IN, 1x 10/100 Mbps

Installation:
Flash factory image through stock firmware WEB UI
or through TFTP
To get to TFTP recovery just hold reset button while powering on for
around 4-5 seconds and release.
Rename factory image to recovery.bin
Stock TFTP server IP:192.168.0.100
Stock device TFTP adress:192.168.0.254

Signed-off-by: Andrew Cameron <apcameron@softhome.net>
5 years ago
Lech Perczak 08d9c95417 ar71xx: ubnt-(xm,xw): add rssileds package
In order to make RSSI indicator on the device work out of box,
include "rssileds" package in per-device rootfs image by default
for Ubiquiti XM and XW devices, namely:
- Bullet M (XM/XW)
- Rocket M (XM/XW)
- Nanostation M (XM/XW)
- Nanostation Loco-M (XW)

This moves the package addition to the individual devices in order
to prevent accidental inclusions of the package when not looking
at the parent node carefully enough.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
[add bullet-m-xw, remove rocket-m-ti, extend commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 317e98a5a2 ath79: add PoE passthrough switch for Ubiquiti Nanostation (XM/XW)
This adds the gpio switch to enable PoE passthrough on Ubiquiti
Nanostation (XM/XW).

Values are copied from the implementation in ar71xx.

GPIO values checked on:
- NanoStation M5 XW
- NanoStation M2 XM

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Andre Heider 1f37b2226e omap: switch from uEnv.txt to generic distro booting
Which makes supporting different boot devices easy.

Signed-off-by: Andre Heider <a.heider@gmail.com>
5 years ago
Andre Heider 65cfe8164a omap: switch to kernel 4.19
Signed-off-by: Andre Heider <a.heider@gmail.com>
5 years ago
Andre Heider e26b7e3c53 omap: enable new sound kernel options
This gets rid of a boot time warning about the missing edma module.
Enable SND_OMAP_SOC_HDMI_AUDIO while here.
All enabled options default to y.

Signed-off-by: Andre Heider <a.heider@gmail.com>
5 years ago
Andre Heider 124b2d32b5 omap: disable excess kernel debug options
Signed-off-by: Andre Heider <a.heider@gmail.com>
5 years ago
Andre Heider 65e6b7a4d8 omap: run `make oldconfig` for kernel 4.19
The only manually enabled config is the new OMAP4_DSS_HDMI_CEC, which
defaults to y.

Signed-off-by: Andre Heider <a.heider@gmail.com>
5 years ago
Andre Heider 26d05a3942 omap: copy the kernel 4.14 config for 4.19
Signed-off-by: Andre Heider <a.heider@gmail.com>
5 years ago
Koen Vandeputte 50ff887f41 ipq40xx: fix build error
Add missing brace which was accidentally omitted

Fixes: d6aea46a50 ("kernel: bump 4.14 to 4.14.154")
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 723f4a4119 brcm2708: remove useless patches
The first adds some stuff while the second one
just reverts it.

Remove both patches.

This is done is a separate commit on purpose to make it clear.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 7533087565 kernel: bump 4.19 to 4.19.84
Refreshed all patches.

Altered patches:
- 950-0748-net-bcmgenet-Workaround-for-Pi-4B-network-issue.patch
- 950-0754-Revert-net-bcmgenet-Workaround-for-Pi-4B-network-iss.patch
- 902-debloat_proc.patch

Remove upstreamed:
- 150-MIPS-bmips-mark-exception-vectors-as-char-arrays.patch

New symbols:
X86_INTEL_MPX
X86_INTEL_MEMORY_PROTECTION_KEYS
X86_INTEL_TSX_MODE_OFF
X86_INTEL_TSX_MODE_ON
X86_INTEL_TSX_MODE_AUTO

Compile-tested on: cns3xxx, x86_64
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte d6aea46a50 kernel: bump 4.14 to 4.14.154
Refreshed all patches.

Altered patches:
- 902-debloat_proc.patch
- 040-dmaengine-qcom-bam-Process-multiple-pending-descript.patch
- 807-usb-support-layerscape.patch
- 809-flexcan-support-layerscape.patch
- 816-pcie-support-layerscape.patch

Remove upstreamed:
- 150-MIPS-bmips-mark-exception-vectors-as-char-arrays.patch
- 303-spi-nor-enable-4B-opcodes-for-mx66l51235l.patch

New symbols:
X86_INTEL_MPX
X86_INTEL_MEMORY_PROTECTION_KEYS
X86_INTEL_TSX_MODE_OFF
X86_INTEL_TSX_MODE_ON
X86_INTEL_TSX_MODE_AUTO
SGL_ALLOC

Compile-tested on: cns3xxx, x86_64
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte d2ee922051 kernel: bump 4.9 to 4.9.202
Refreshed all patches.

Altered patches:
- 902-debloat_proc.patch

Compile-tested on: none
Runtime-tested on: none

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Adrian Schmutzler 25127f58b4 ar71xx: fix buttons for TP-Link TL-WDR4900 v2
TP-Link TL-WDR4900 v2 only has one combined WPS/Reset button, so
don't set up an RFKILL for this device.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 93f2bcc35e ar71xx: fix LED setup for TL-WDR4900 v2
In ar71xx there is only one combined mach file for Archer C5/C7 and
TL-WDR4900 v2. This one uses the same LED struct for all devices,
defining "green" LEDs for them. However, WDR4900 uses blue front
LEDs, while only C5/C7 uses green ones. Despite, in base-files
WDR4900 is actually set up with "blue" for the mentioned LEDs.

Thus, this patch creates a separate LED struct for WDR4900, so the
LEDs can be set up correctly. Despite, the wlan5g LED is removed as
it is controlled by ath9k chip for WDR4900 (in contrast to C5/C7).

Note: While front LEDs are blue, USB LEDs (on the back) are green,
so colors are mixed intentionally for the WDR4900 v2.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 1a0d6e1eba ath79: fix DTS node names for Ubiquiti XM partitions
Some node names were inconsistent with the reg property. Fix it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
John Crispin 567d08104e mediatek: pass console inside bootargs on mt7629
Signed-off-by: John Crispin <john@phrozen.org>
5 years ago
John Crispin d4f1937a21 mediatek: drop leading + from config
Signed-off-by: John Crispin <john@phrozen.org>
5 years ago
Sungbo Eo 19800ac095 ramips: set uImage name of WeVO 11AC NAS and W2914NS v2
The stock firmware and bootloader only accept uImage with names that
match certain patterns. This patch enables OpenWrt installation from
stock firmware without having to reflash the bootloader or access the
UART console.

Installation via web interface:
1.  Flash **initramfs** image through the stock web interface.
2.  Boot into OpenWrt and perform sysupgrade with sysupgrade image.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
5 years ago
Adrian Schmutzler a9d3084b83 ar71xx: fix MAC address setup for TL-WDR4900 v2
The MAC address setup of the TL-WDR4900 v2 is different from the
C5/C7. This aligns ar71xx with the setup in ath79:

wlan0 (5GHz) : -2
wlan1 (2.4GHz) : -1
eth1 (LAN) : 0
eth0 (WAN) : 1

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Christian Lamparter 7a7610c21b ath79: remap D-Link DIR-859 A1 WPS button to WPS
The WPS button was mapped to the restart/reset. This patch
changes it to emit the KEY_WPS_BUTTON keycode so pressing
the WPS button does initiate WPS.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Christian Lamparter ad65d9d7b2 ramips: assign correct key-code to wps buttons
The ASUS WL-330N(3G) and the Edimax RG21S had the
reset keycode assigned to the WPS button. This patch
changes all three devices to use KEY_WPS_BUTTON in
the hopes that this fixes unwanted restarts/
unexpected behavior from the users point of view.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Jeff Kletsky f84d6d2f3a ath79: fix firmware partition attributes for GL-AR300M16 and -Lite
During the introduction of the ath79/nand images for the GL-AR300M
series the firmware partition label and compatible were altered,
but the necessary adjustments have not been made for the
GL-AR300M16 and the GL-AR300M-Lite. This will result in a
non-bootable partition setup for these devices.

This patch adds the necessary definitions to those two devices.

Fixes: 55e6c903ae ("ath79: GL-AR300M: provide NAND support;
       increase to 4 MB kernel")
Fixes: b591cabd39 ("ath79: add GL.iNet GL-AR300M16 as NOR-only
       board")

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
[extend commit message, alter commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
John Crispin 1ea22e4de6 mediatek: drop accidentially commited file
Signed-off-by: John Crispin <john@phrozen.org>
5 years ago
John Crispin 50735df7b2 mediatek: fix bootup problem on mt7629 EVB
Signed-off-by: John Crispin <john@phrozen.org>
5 years ago
Adrian Schmutzler fc44a8481c ath79: fix sysupgrade from ar71xx for WNDR3700 V2 and WNDR3800(CH)
ar71xx has just one board name "wndr3700" for WNDR3700 V1/V2,
WNDR3800 and WNDR3800CH, whereas ath79 provides separate images for
the boards. So, update SUPPORTED_DEVICES to store the correct
ar71xx board names.

Fixes: FS#2510

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Paul Blazejowski 7e623c3128 ath79: add support for Netgear WNDR3700v4
This patch adds ath79 support for Netgear WNDR3700v4.
Router was previously supported by ar71xx target only.
Note: device requires 'ar934x-nand' driver in kernel.

Specification
=============
  * Description: Netgear WNDR3700v4
  * Loader: U-boot
  * SOC: Atheros AR9344 (560 MHz)
  * RAM: 128 MiB
  * Flash: 128 MiB (NAND)
    - U-boot binary: 256 KiB
    - U-boot environment: 256 KiB
    - ART: 256 KiB
    - POT: 512 KiB
    - Language: 2 MiB
    - Config: 512 KiB
    - Traffic Meter: 3 MiB
    - Firmware: 25 MiB
    - ART Backup: 256 KiB
    - Reserved: 96 MiB
  * Ethernet: 5 x 10/100/1000 (4 x LAN, 1 x WAN) (AR8327)
  * Wireless:
    - 2.4 GHz b/g/n (internal)
    - 5 GHz a/n (AR9580)
  * USB: yes, 1 x USB 2.0
  * Buttons:
    - Reset
    - WiFi (rfkill)
    - WPS
  * LEDs:
    - Power (amber/green)
    - WAN (amber/green)
    - WLAN 2G (green)
    - WLAN 5G (blue)
    - 4 x LAN (amber/green)
    - USB (green)
    - WPS (amber/green)
  * UART: 4-pin connector JP1, 3.3V (Vcc, TX, RX, GND), 115200 8N1
  * Power supply: DC 12V 2.5A
  * MAC addresses: LAN=WLAN2G on case label, WAN +1, WLAN5G +2

Installation
============
  * TFTP recovery
  * TFTP via U-boot prompt
  * sysupgrade
  * Web interface

Note about partitioning: firmware partition offset (0x6c0000) is
hardcoded into vendor's u-boot, so this partition cannot be moved
and resized to include Netgear-specific flash areas (pot, language,
config, traffic_meter) not used by OpenWrt.

Test build configuration
========================
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_nand=y
CONFIG_TARGET_ath79_nand_DEVICE_netgear_wndr3700-v4=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_IMAGEOPT=y

Signed-off-by: Paul Blazejowski <paulb@blazebox.homeip.net>
5 years ago
Michal Cieslakiewicz 119e0d57ae ath79: split dts file for Netgear WNDR4300
Move board configuration to dtsi file in preparation for WNDR3700v4
router support.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Adrian Schmutzler 71fbec0eff ath79: fix indent in TP-Link TL-WDR4900 v2 DTS
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler bcee364944 ath79: improve common DTSI name for TP-Link Archer C5, C7 v1/v2
As the former qca9558_tplink_archer-c7.dtsi is also used for
Archer C5 v1 this patch removes the number from the DTSI name
to indicate that.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Petr Štetiar fa83455392 ath79: remove obsolete OF PCI related config symbols
Those symbols were removed in kernel 4.16:

 commit 4670d610d59233b017a6ea1fa25bbf06dabbff42
 Author:     Rob Herring <robh@kernel.org>

    PCI: Move OF-related PCI functions into PCI core

Fixes: FS#2588
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Roger Pueyo Centelles 1c6066a867 ath79: include rssileds package for ubnt devices with LEDs
Some Ubiquiti devices had the RSSI LEDs configured in 01_leds but
were missing the rssileds package, while others that don't have
RSSI LEDS had the package included.

This commit includes the rssileds package only for those devices
that need it.

Tested on a NanoStation M XW.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
5 years ago
Jeff Kletsky b496a2294c ath79: GL-AR750S: provide NAND support; increase kernel to 4 MB
The GL.iNet GL-AR750S has been supported by the ar71xx and ath79
platforms with access to its 16 MB NOR flash, but not its 128 MB
SPI NAND flash.

This commit provides support for the NAND through the upstream
SPI-NAND framework.

At this time, the OEM U-Boot appears to only support loading the
kernel from NOR. This configuration is preserved as this time,
with the glinet,gl-ar750s-nand name reserved for a potential,
future, NAND-only boot.

The family of GL-AR750S devices on the ath79 platform now includes:

  * glinet,gl-ar750m-nor-nand   "nand" target
  * glinet,gl-ar750m-nor        "nand" target (NAND-aware)

NB: This commit increases the kernel size from 2 MB to 4 MB

"Force-less" sysupgrade is presently supported from the current
versions of following NOR-based firmwre images to the version of
glinet,gl-ar750s-nor firmware produced by this commit:

  * glinet,gl-ar750s     -- OpenWrt 19.07 ar71xx
  * glinet,gl-ar750s     -- OpenWrt 19.07 ath79

Users who have sucessfully upgraded to glinet,gl-ar750m-nor may then
flash glinet,gl-ar750m-nor-nand with sysupgrade to transtion to the
NAND-based variant.

Other upgrades to these images, including directly to the NAND-based
glinet,gl-ar750s-nor-nand firmware, can be accomplished through U-Boot.

NB: See "ath79: restrict GL-AR750S kernel build-size to 2 MB" which
enables flashing of NAND factory.img with the current GL-iNet U-Boot,
"U-Boot 1.1.4-gcf378d80-dirty (Aug 16 2018 - 07:51:15)"

The GL-AR750S OEM U-Boot allows upload and flashing of either NOR
firmware (sysupgrade.bin) or NAND firmware (factory.img) through its
HTTP-based GUI. Serial connectivity is not required.

The glinet,gl-ar750s-nor and glinet,gl-ar750s-nor-nand images
generated after this commit flash each other directly.

This commit changes the control of the USB VBUS to gpio-hog from
regulator-fixed introduced by commit 0f6b944c92. This reduces the
compressed kernel size by ~14 kB, with no apparent loss of
functionality. No other ath79-nand boards are using regulator-fixed
at this time.

Note: mtd_get_mac_binary art 0x5006 does not return the proper MAC
and the GL.iNet source indicates that only the 0x0 offset is valid

The ar71xx targets are unmodified.

Cc: Alexander Wördekemper <alexwoerde@web.de>

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years ago
Jeff Kletsky b591cabd39 ath79: add GL.iNet GL-AR300M16 as NOR-only board
The GL.iNet GL-AR300M series of devices includes variants without NAND
and only the 16 MB NOR flash. These include the GL-AR300M16 and the
GL-AR300M-Lite (already with its own board name).

This board-name addition provides disambiguation from the NAND-bearing
GL-AR300M devices, both for OpenWrt code and for end users.

Kernel and firmware support for NAND and UBI will add ~320 kB to the
overall firmware size at this time. This NOR-only option continues to
provide more compact firmware for both the GL-AR300M16 as well as
those who wish to use it as an alternate or primary, NOR-resident
firmware on the GL-AR300M.

The ar71xx targets are unmodified.

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

Install through OEM U-Boot (HTTP-based) or `sysupgrade --force` when
booted from NOR and running OEM or OpenWrt, NOR-based firmware.

As one of the intentions is disambiguation from NAND-bearing units,
users who have flashed this firmware onto a device with NAND would
need to use U-Boot or `sysupgrade --force` to flash firmware that
again supports NAND.

There are no additional SUPPORTED_DEVICES as it is not possible to
determine if a device does or does not have NAND based on
either the OEM's or OpenWrt's board names prior to this patch.

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years ago
Jeff Kletsky 55e6c903ae ath79: GL-AR300M: provide NAND support; increase to 4 MB kernel
The GL.iNet GL-AR300M has been supported by the ar71xx and ath79
platforms with access to its 16 MB NOR flash, but not its 128 MB
SPI NAND flash.

This commit provides support for the NAND through the upstream
SPI-NAND framework. Devices with both NOR and NAND flash can support
independent firmware on each, with U-Boot able to boot from either.
The OEM U-Boot will fall back to the NOR firmware after three
"unsuccessful" boots.

The family of GL-AR300M devices on the ath79 platform now includes:

  * glinet,gl-ar300m-lite       "generic" target, NOR-only board
  * glinet,gl-ar300m-nand       "nand" target
  * glinet,gl-ar300m-nor        "nand" target (NAND-aware)

NB: This commit increases the kernel size from 2 MB to 4 MB

"Force-less" sysupgrade is presently supported from the current
versions of following NOR-based firmwre images to the version of
glinet,gl-ar300m-nor firmware produced by this commit:

  * gl-ar300m            -- OEM v3 NOR    ar71xx (openwrt-ar300m16-*.bin)
  * gl-ar300m            -- OpenWrt 18.06 ar71xx
  * gl-ar300m            -- OpenWrt 19.07 ar71xx

Other upgrades to these images should be performed through U-Boot.

The GL-AR300M OEM U-Boot allows upload and flashing of either NOR
firmware (sysupgrade.bin) or NAND firmware (factory.img) through its
HTTP-based GUI. Serial connectivity is not required.

The glinet,gl-ar300m-nand and glinet,gl-ar300m-nor images generated
after this commit should safely flash each other using sysupgrade.

The boot counter is implemented by the OEM using u-boot-env. At this
time, it does not appear that the switch on the side of the unit can
be used to select NOR vs. NAND boot and the fail-over is only from
NAND to NOR. To save flash wear, it is only reset when running the
glinet,gl-ar300m-nand firmware.

NAND-specific base-files are used to remove impact on existing
generic and tiny targets.

As there is now no "generic" build appropriate for the GL-AR300M16,
(or for users of the GL-AR300M that do not need access to NAND)
it will be introduced in a subsequent commit.

Note: `mtd_get_mac_binary art 0x6` does not return the proper MAC
and the GL.iNet source indicates that only the 0x0 offset is valid

The ar71xx targets are unmodified.

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years ago
Jeff Kletsky 20b3e77ba3 ath79: prepare NAND subtarget for upstream support of SPI NAND
Linux 4.19 supplies the upstream spi-nand framework,
permitting porting and support of boards with SPI NAND.

  * Adjusted nand/target.mk to provide FEATURES += squashfs nand

  * Updated config-default to provide current MTD and UBI support

Defaults selected for:

  CONFIG_MTD_UBI_WL_THRESHOLD=4096
  CONFIG_MTD_UBI_BEB_LIMIT=20
  # CONFIG_MTD_UBI_FASTMAP is not set
  # CONFIG_MTD_UBI_GLUEBI is not set

The bad-block reservation limit technically should be 21 for Paragon
SPI NAND but most other devices in the class are 20 blocks per Gbit.
In Linux 5.2 this is specified on a per-chip basis through NAND_MEMORG

Contents adjusted to remove declarations provided at the target level
by commit 08a134820f (Oct 23, 2019) ath79: enable PCI for whole target

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
Tested-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Piotr Dymacz e68539aca4 ramips: add support for ALFA Network Quad-E4G
ALFA Network Quad-E4G is a universal Wi-Fi/4G platform, which offers
three miniPCIe (PCIe, USB 2.0, SIM) and a single M.2 B-key (dual-SIM,
USB 3.0) slots, RTC and five Gigabit Ethernet ports with PoE support.

Specification:

- MT7621A (880 MHz)
- 256/512 MB of RAM (DDR3)
- 16/32+ MB of FLASH (SPI NOR)
- optional second SPI flash (8-pin WSON/SOIC)
- 1x microSD (SDXC) flash card reader
- 5x 10/100/100 Mbps Ethernet, with passive PoE support (24 V) in LAN1
- optional 802.3at/af PoE module for WAN
- 3x miniPCIe slot (with PCIe and USB 2.0 buses, micro SIM and 5 V)
- 1x M.2/NGFF B-key 3042 (USB 3.0/2.0, mini + micro SIM)
- RTC (TI BQ32002, I2C bus) with backup battery (CR2032)
- external hardware watchdog (EM Microelectronic EM6324)
- 1x USB 2.0 Type-A
- 1x micro USB Type-B for system serial console (Holtek HT42B534)
- 11x LED (5 for Ethernet, 5 driven by GPIO, 1x power indicator)
- 3x button (reset, user1, user2)
- 1x I2C (4-pin, 2.54 mm pitch) header on PCB
- 4x SIM (6-pin, 2.00 mm pitch) headers on PCB
- 2x UART2/3 (4-pin, 2.54 mm pitch) headers on PCB
- 1x mechanical power switch
- 1x DC jack with lock (24 V)

Other:

- U-Boot selects default SIM slot, based on value of 'default_sim' env
  variable: '1' or unset -> SIM1 (mini), '2' -> SIM2 (micro). This board
  has additional logic circuit for M.2 SIM switching. The 'sim-select'
  will work only if both SIM slots are occupied. Otherwise, always slot
  with SIM inside is selected, no matter 'sim-select' value.
- U-Boot enables power in all three miniPCIe and M.2 slots before
  loading the kernel
- this board supports 'dual image' feature (controlled by 'dual_image'
  U-Boot environment variable)
- all three miniPCIe slots have additional 5 V supply on pins 47 and 49
- the board allows to install up to two oversized miniPCIe cards (vendor
  has dedicated MediaTek MT7615N/D cards for this board)
- this board has additional logic circuit controlling PERSTn pins inside
  miniPCIe slots. By default, PERSTn (GPIO19) is routed to all miniPCIe
  slots but setting GPIO22 to high allows PERSTn control per slot, using
  GPIO23-25 (value is inverted)

You can use the 'sysupgrade' image directly in vendor firmware which is
based on OpenWrt (make sure to not preserve settings - use 'sysupgrade
-n -F ...' command). Alternatively, use web recovery mode in U-Boot:

1. Power the device with reset button pressed, the modem LED will start
   blinking slowly and after ~3 seconds, when it starts blinking faster,
   you can release the button.
2. Setup static IP 192.168.1.2/24 on your PC.
3. Go to 192.168.1.1 in browser and upload 'sysupgrade' image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Piotr Dymacz 44d7a14a83 ramips: mt7621: refresh kernel config
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Piotr Dymacz fc0d0f5dfd ramips: provide label MAC for ALFA Network Tube-E4G
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Piotr Dymacz dfecf94c20 ramips: add support for ALFA Network R36M-E4G
ALFA Network R36M-E4G is a dual-SIM, N300 Wi-Fi, compact size platform
based on MediaTek MT7620A WiSoC. This product is designed for operation
with 4G modem (can be bought in bundle with Quectel EC25, EG25 or EP06)
but supports also Wi-Fi modules (miniPCIe slot has USB and PCIe buses).

Specification:

- MT7620A (580 MHz)
- 64/128/256 MB of RAM (DDR2)
- 16/32+ MB of FLASH (SPI NOR)
- 2x 10/100 Mbps Ethernet, with passive PoE support (24 V)
- 2T2R 2.4 GHz (MT7620A), with ext. LNA (RFFM4227)
- 1x miniPCIe slot (with PCIe and USB 2.0 buses and optional 5 V)
- 2x SIM slot (mini, micro) with detect and switch driven by GPIO
- 2x u.fl antenna connectors (for Wi-Fi)
- 8x LED (7 driven by GPIO)
- 2x button (reset, wifi)
- 2x UART (4-pin/2.54 mm pitch, 10-pin/1.27 mm pitch) headers on PCB
- 1x I2C (4-pin, 1.27 mm pitch) header on PCB
- 1x LED (8-pin, 1.27 mm pitch) header on PCB
- 1x DC jack with lock (12 V)

Other:

- there is a dedicated, 4-pin connector for optional RTC module (Holtek
  HT138x) with 'enable' input, not available at the time of preparing
  support for this board
- miniPCIe slot supports additional 5 V supply on pins 47 and 49 but a
  jumper resistor (R174) is not installed by default
- U-Boot selects default SIM slot, based on value of 'default_sim' env
  variable: '1' or unset -> SIM1 (mini), '2' -> SIM2 (micro). This will
  work only if both slots are occupied, otherwise U-Boot will always
  select slot with SIM card inside (user can override it later, in
  user-space)
- U-Boot resets the modem, using PERSTn signal, before starting kernel
- this board supports 'dual image' feature (controlled by 'dual_image'
  U-Boot environment variable)

Flash instruction:

You can use the 'sysupgrade' image directly in vendor firmware which is
based on OpenWrt (make sure to not preserve settings - use 'sysupgrade
-n -F ...' command). Alternatively, use web recovery mode in U-Boot:

1. Power the device with reset button pressed, the modem LED will start
   blinking slowly and after ~3 seconds, when it starts blinking faster,
   you can release the button.
2. Setup static IP 192.168.1.2/24 on your PC.
3. Go to 192.168.1.1 in browser and upload 'sysupgrade' image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Piotr Dymacz bc173ddd83 ramips: support dual image feature on ALFA Network boards
New U-Boot version for MediaTek MT76x8/MT762x based ALFA Network boards
includes support for a 'dual image' feature. Users can enable it using
U-Boot environment variable 'dual_image' ('1' -> enabled).

When 'dual image' feature is enabled, U-Boot will modify DTB and divide
the original 'firmware' flash area into two, equal in size and aligned
to 64 KB partitions: 'firmware' and 'backup'. U-Boot will also adjust
size of 'firmware' area to match installed flash chip size.

U-Boot will load kernel from active partition which is marked with env
variable 'bootactive' ('1' -> first partition, '2' -> second partition)
and rename both partitions accordingly ('firmware' <-> 'backup').

There are 3 additional env variables used to control 'dual image' mode:
- bootlimit   - maximum number of unsuccessful boot tries (default: '3')
- bootcount   - current number of boot tries
- bootchanged - flag which informs that active partition was changed; if
                it is set and 'bootcount' reaches 'bootlimit' value,
                U-Boot will start web-based recovery which then updates
                both partitions with provided image

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Sungbo Eo 261c746631 ramips: add usb-ledtrig-usbport to DEVICE_PACKAGES of CY-SWR1100
CY-SWR1100 has a USB LED but kmod-usb-ledtrig-usbport is missing
in default images. This commit adds it.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[changed commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Sungbo Eo fe6a04a8fe ramips: change status LED of Samsung CY-SWR1100
Use power LED for status indication and free WPS LED for other uses.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
5 years ago
Sungbo Eo aabdf6991c ramips: improve Samsung CY-SWR1100 support
This patch does the following:

- rename "devdata" flash partition and make it read-only
- switch from gpio-keys-polled to gpio-keys
- add missing power LED
- set correct PCI ID to compatible string in wifi node
- remove ralink,5ghz property in wifi node
- provide label MAC address

Rename devdata partition to devconf as indicated in the stock firmware
partition table:
00030000-00040000: "devdata"
00040000-00050000: "devconf"

Power LED can be controlled by SoC GPIO. Add it in the dts leds node.

RT3092L supports only bgn mode, so it is unnecessary to disable 5GHz band.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
5 years ago
Sungbo Eo 7231c1edd9 ramips: fix MAC address setup for Samsung CY-SWR1100
Ethernet MAC address setup has been broken since c3e420f28c. Restore
original setting.

Fixes: c3e420f28c ("ramips: Add support for D-Link DCH-M225")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
5 years ago
Adrian Schmutzler a021268032 ar71xx: fix MAC addresses for Archer C5 v1, C7 v1/v2, WDR4900 v2
As discussed in 1d18a14a90 ("ath79: really fix TP-Link Archer C7
v2 MAC address"), stock firmware MAC address assignment is
actually as follows:

wlan0 (5GHz) : -1
wlan1 (2.4GHz) : 0
eth1 (LAN) : 0
eth0 (WAN) : 1

This has never been fixed for ar71xx, so let's do it now.
Note that with WDR4900 v2 even both wlan0 and wlan1 where assigned
to basemac-1 before ...

Fixes: FS#408

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler d421a8b944 ath79: read label MAC address from flash instead of using phy0/phy1
This replaces all uses of $(cat /sys/class/ieee80211/phyX/macaddress)
by retrieval from the proper flash locations. This will make
02_network independent of WiFi setup again.

For future reference:

The MAC addresses of the FRITZ!WLAN Repeater 300E can be extracted
from the urlader key value store:

maca        *:6B
macb        *:6C
macwlan     *:6D
macdsl      *:6E

and be set by e.g.
addr=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler f4c3cfc620 ramips: read label MAC address from flash instead of using phy0/phy1
This replaces all uses of $(cat /sys/class/ieee80211/phyX/macaddress)
by retrieval from the proper flash locations. This will make
02_network independent of WiFi setup again.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Koen Vandeputte 6589de9af7 kernel: bump 4.19 to 4.19.82
Refreshed all patches.

Remove upstreamed:
- 950-0295-sc16is7xx-Fix-for-Unexpected-interrupt-8.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte ecfe552f99 kernel: bump 4.14 to 4.14.152
Refreshed all patches.

Altered patches:
- 301-arch-support-layerscape.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 015fefa8e7 kernel: bump 4.9 to 4.9.199
Refreshed all patches.

Compile-tested on: none
Runtime-tested on: none

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Adrian Schmutzler b5791118cc ath79: fix SUPPORTED_DEVICES for TP-Link TL-WR1043ND v3
In ar71xx, the board name for the TL-WR1043ND v3 is equal to v2:
tl-wr1043nd-v2

Fix SUPPORTED_DEVICES for v3 in ath79 accordingly.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Manuel Kock 509894cffb lantiq: remove redundant WiFi LED on FRITZ!Box 7320
The led wireless trigger is already set correctly to phy0tpt through the
alias in the device tree.

Signed-off-by: Manuel Kock <github.web@manu.li>
[rephrased commit title]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Paul Spooren e97113d5e1 x86,tegra,mvebu: image: use common reproducible IMG_PART_SIGNATURE
These targets are currently using more or less same SIGNATURE variable
which provides unique partition ID/signature, so it makes sense to
refactor it out into common IMG_PART_SIGNATURE variable which could be
reused by all targets.

This is another step in the direction of reproducible OpenWrt images.

Signed-off-by: Paul Spooren <mail@aparcar.org>
[split into separate commit, renamed to IMG_PART_SIGNATURE]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Adrian Schmutzler 1c321237c2 ramips: split further base-files across subtargets
As started in 19724e28c8 ("ramips: split base-files into
subtargets"), this moves some smaller left-over files to the
appropriate base-files folder of their subtarget:

- /etc/init.d/bootcount
- /etc/uci-defaults/04_led_migration

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 5dc535419f ath79: fix identifier for Nanostation M in ath9k caldata extraction
When Nanostation M was renamed from ubnt,nano-m to ubnt,nanostation-m
in commit f1396ac753 ("ath79: align naming of Ubiquiti Nanostation M"),
the caldata extraction in 10-ath9k-eeprom was overlooked.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
David Bauer b16d76bf40 ramips: correct Netgear WNDR3700v5 button flag
This adjusts the GPIO state flag to ACTIVE_LOW as FCC pictures indicate
the base board is identical to the one of the R6220.

Fixes commit 3459013257 ("ramips: correct R6220 button flag")

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 3459013257 ramips: correct R6220 button flag
All buttons on the Netgear R6220 are active-low while they are flagged
as active-high.

The GPIO status reads the following for no buttons pressed:

root@64367-r6220:~# cat /sys/kernel/debug/gpio
gpio-7   (                    |wps                 ) in  hi
gpio-8   (                    |wifi                ) in  hi
gpio-14  (                    |reset               ) in  hi

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Álvaro Fernández Rojas f586dd67ac brcm63xx: add linux 4.19 support
Boot tested on Comtrend AR-5387un:
https://gist.github.com/Noltari/57e5030455da8dc38e61f8c3a5922254

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
[jonas.gorski: make 4.19 an optional testing version; add gcc 8.3 fix]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
5 years ago
Michael Heimpold 9673d5c7ab mxs: start a console on USB gadget serial ports
The I2SE Duckbill devices are pen-drive like and thus the usage
of the USB gadget subsystem is highly indicated.

Spawning a console if a serial gadget is configured saves
us from connecting a physical debug uart.

On Olimex OLinuXino Maxi/Mini boards, this does not hurt.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
5 years ago
Michael Heimpold 9a5fd2fa85 mxs: switch to askconsole
Remove the dedicated tty name and use askconsole to spawn the console
on serial debug uart.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
5 years ago
Michael Heimpold 002e312538 mxs: add support and switch to kernel 4.19
Also remove kernel 4.14 support and the meanwhile obsolete patch.

This was run-tested on I2SE Duckbill device and
Olimex OLinuXino Maxi board.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Tested-by: Zoltan HERPAI <wigyori@uid0.hu>
5 years ago
Adrian Schmutzler f098c612b6 ramips: create shared DTSI for Netgear EX2700 and WN3000RP v3
This moves shared code of the named devices into a common DTSI.

Remove setting status="okay" for &gpio0 as it's not disabled in
mt7620a.dtsi.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Frederik Noe-Sdun 4a904b8b76 ramips: increase max SPI frequency to 50 MHz for EX3700/EX6130
Based on Macronix MX25L3205DM2I datasheet this is maximum
supported speed.

Signed-off-by: Frederik Noe-Sdun <Frederik.Sdun@googlemail.com>
[rebased, improved commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Frederik Noe-Sdun 0cbd2c74d0 ramips: add support for Netgear EX6130
Specifications:
* SoC: MT7620A
* RAM: 64 MB DDR
* Flash: 8MB NOR SPI flash
* WiFi: MT7612E (5Ghz) and builtin MT7620A (2.4GHz)
* LAN: 1x100M

The -factory images can be flashed from the
device's web interface or via nmrpflash.

The device seems to use base PCB as EX3700/EX3800,
but supporting AC1200 using MT7612E.

MAC adresses:
5.0 GHz  0x8004  *:9a
2.4 GHz  0x4     *:9b
lan      0x28    *:9b
wan      0x2e    *:9c

Since this is a one-port device, although wan MAC address is
set in flash, it is not used in OpenWrt setup.

Signed-off-by: Frederik Noe-Sdun <Frederik.Sdun@googlemail.com>
[rebased, extended commit message, tiny DTS style fixes]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
南浦月 0ff2385a92 ar71xx: fix tl-wdr3320-v2 upgrade
Fix the error that tl-wdr3320-v2 can't upgrade firmware via web
interface by using magic_ver="0200" for this device.

Signed-off-by: 南浦月 <nanpuyue@gmail.com>
[commit message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Kristian Evensen 6ab84579c6 ipq40xx: u4019: use reset-gpios instead of phy-reset-gpio
Use reset-gpio instead of the custom phy-reset-gpio property to do phy
reset on the U4019. phy-reset-gpio was incorrectly introduced when we
added support for the U4019, and will be deprecated.

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

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
5 years ago
DENG Qingfang 6abce4d5e4 ipq40xx: mdio: remove support for phy-reset-gpio
Commit 6f6c00cfc9 ("ipq40xx: Add support for Unielec U4019") has
introduced support for `phy-reset-gpio` DT property, which isn't needed
as the MDIO already supports `reset-gpios`[1] which could be used instead.

1. https://elixir.bootlin.com/linux/v4.19.81/source/Documentation/devicetree/bindings/net/mdio.txt

Ref: PR#2511
Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
[commit title and description facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Adrian Schmutzler a921945773 ramips: rename keys node formerly named button
For some devices, the keys node is named "button". Change name to
match the rest of the target.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 4176100b06 ath79: replace generic button node names
In several DTS files, button nodes are just named buttonX or
xxx_button. This replaces the names with more specific names matching
the majority of key definitions.

While at it, fix name of keys node in one case.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Martin Schiller edbadec843 kernel: fix LED netdev trigger on interface rename
This fixes the netdev LED trigger for interfaces, which are renamed
during initialization (e.g. ppp interfaces).

Fixes: FS#2193
Fixes: FS#2239
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
5 years ago
Paul Spooren 9fa061a7d3 ramips, mt7620: reproducible elecom-header uid/gid
The elecom-header renames the firmware image to v_0.0.0.bin, stores its
MD5 sum as v_0.0.0.md5 and tars both files again.

Both v_0.0.0 files are created as the build user making it harder to
reproduce.

This commit sets the owner/group of both files to root by adding extra
options to the final tar command.

Before:
0 buildbot   (101) buildbot   (102)  3932164 2019-11-05 14:43:22.000000 v_0.0.0.bin
0 buildbot   (101) buildbot   (102)       33 2019-11-05 14:43:22.000000 v_0.0.0.md5

After:
0 root         (0) root         (0)  3932164 2019-11-05 23:43:08.000000 v_0.0.0.bin
0 root         (0) root         (0)       33 2019-11-05 23:43:08.000000 v_0.0.0.md5

Signed-off-by: Paul Spooren <mail@aparcar.org>
5 years ago
Adrian Schmutzler c8c4f7216e ath79: specify N and ND subversions of TL-WR941 with ALT0_MODEL
TP-Link's TL-WR941 is sold with detachable antennas
internationally (ND version), but with fixed antennas in China
(N version). While hardware and images are similar for both
variants of v2 and v4, they are different for v6.

Having both explicitly will make it easier for user to identify
the correct image, and most importantly will raise awareness
that N and ND are not necessarily always the same as for
TL-WR841 series.

With an image selection webpage, using ALT0_MODEL as in this
patch will provide the option to list versions for N and ND
separately.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler c7842ceaaa ramips: reorganize DTSI files for Netgear R devices
This reorganizes DTSI files for the Netgear R devices in mt7621
(and the WNDR3700 v5). It creates a common DTSI for all R (sercomm)
devices and distributes the remaining code in r6220.dtsi to R6220
and WNDR3700 v5.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Sungbo Eo 62b1559b56 ramips: improve support for WeVO 11AC NAS and W2914NS v2
- remove WAN port index
- load WAN MAC address directly from the flash
- provide label MAC address
- increase flash's SPI frequency to 80MHz
- add mt76 led nodes to make WiFi LEDs work
- drop unnecessary pinmux groups

The factory partition scheme for MAC addresses (verified on both devices):
0x4   : WiFi 2.4GHz (label_mac-9)
0x28  : unused
0x2e  : WAN (label_mac)
0x8004: WiFi 5GHz (label_mac-5)
0xe000: LAN (label_mac-1)
0xe006: unused

By improving flash speed,
`time dd if=/dev/mtdblock3 of=/dev/null bs=64k`
has been reduced from 14.51s to 3.11s.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[rebased]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 15dc60e727 ath79: move eth0 to parent DTSI for ar9344 TP-Link CPE devices
The &eth0 node is the same for all TP-Link CPE devices in ar9344,
so move it to parent DTSI. While at it, do some minor DTS
harmonizations.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Andrew Cameron bae0d47f2e ath79: add support for the TP-LINK CPE220 V3
This adds support for a popular low-cost 2.4GHz N based AP

Specifications:
SoC: Qualcomm Atheros QCA9533 (650MHz)
RAM: 64MB
Storage: 8 MB SPI NOR
Wireless: 2.4GHz N based built into SoC 2x2
Ethernet: 2x 100/10 Mbps, integrated into SoC

Installation:
Flash factory image through stock firmware WEB UI
or through TFTP
To get to TFTP recovery just hold reset button while powering on for
around 4-5 seconds and release.
Rename factory image to recovery.bin
Stock TFTP server IP:192.168.0.100
Stock device TFTP adress:192.168.0.254

This also applies some minor changes to the common DTSI:
- use &wmac for label-mac-device, as this one is actually set up in
  common DTSI
- move &eth0 to parent DTSI
- fix several leading spaces, added/removed newlines

Signed-off-by: Andrew Cameron <apcameron@softhome.net>
[DTS style fixes/improvements, updated commit message/title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler d2b9333ea9 ramips: remove default case for MAC address assignment
So far, MAC address assignment in ramips has contained a default
case, which defined wan_mac = eth0 + 1 for _every_ device not
having an explicit case there.

This is not desirable, as many device supporters will just not
care or know about this definition, so another MAC address will be
introduced by accident. In some cases the wan_mac is assigned
although it is not needed, in other cases even addresses not
dedicated to the device will be used (e.g. wan_mac actually is
eth0 - 1, but during support nobody cared, so eth0 + 1 is used now,
which might actually belong to another device ...).

Thus, in this PR the former default case is converted to an
explicit case. This one comprises all devices not being accounted
for by other cases, reduced by those not having wan at all.
The big number of entries for this node might be another indication
that many of them wouldn't actually be there if there hadn't been
default wan_mac setup.

In exchange, the current "do nothing" case can be removed, as it
will be the new default case.

The devices being put in the newly created explicit case were
determined as follows:

1. Create a list of all devices based on the DTS files.

2. Remove all devices already having an explicit entry setting
   their address.

3. Remove all devices that only have lan set up in the first part
   of 02_network:

mt7620:
   - alfa-network,tube-e4g
   - asus,rp-n53
   - buffalo,wmr-300
   - comfast,cf-wr800n
   - edimax,ew-7476rpc
   - edimax,ew-7478ac
   - elecom,wrh-300cr
   - hnet,c108
   - kimax,u25awf-h1
   - kimax,u35wf
   - kingston,mlw221
   - kingston,mlwg2
   - microduino,microwrt
   - netgear,ex2700
   - netgear,ex3700
   - netgear,wn3000rp-v3
   - planex,cs-qr10
   - planex,mzk-ex300np
   - planex,mzk-ex750np
   - ravpower,wd03
   - sercomm,na930
   - yukai,bocco
   - zbtlink,zbt-cpe102
   - zte,q7

mt7621:
   - gnubee,gb-pc1
   - gnubee,gb-pc2
   - linksys,re6500
   - mikrotik,rbm11g
   - netgear,ex6150
   - thunder,timecloud
   - tplink,re350-v1
   - tplink,re650-v1

mt76x8:
   - alfa-network,awusfree1
   - d-team,pbr-d1
   - glinet,vixmini
   - vocore,vocore2-lite
   - tama,w06
   - tplink,tl-mr3020-v3
   - tplink,tl-wa801nd-v5
   - tplink,tl-wr802n-v4
   - tplink,tl-wr902ac-v3
   - vocore,vocore2
   - widora,neo-16m
   - widora,neo-32m

rt288x:
   - buffalo,wli-tx4-ag300n
   - dlink,dap-1522-a1

rt305x:
   - allnet,all0256n-4m
   - allnet,all0256n-8m
   - allnet,all5002
   - allnet,all5003
   - alphanetworks,asl26555-16m
   - alphanetworks,asl26555-8m
   - asus,wl-330n
   - aximcom,mr-102n
   - dlink,dcs-930
   - easyacc,wizard-8800
   - hame,mpr-a2
   - hootoo,ht-tm02
   - huawei,d105
   - intenso,memory2move
   - planex,mzk-dp150n
   - rt305x dlink,dcs-930l-b1
   - sparklan,wcr-150gn
   - tenda,3g150b
   - tenda,3g300m
   - tenda,w150m
   - trendnet,tew-638apb-v2
   - unbranded,a5-v11
   - vocore,vocore-16m
   - vocore,vocore-8m
   - wansview,ncs601w
   - zorlik,zl5900v2

rt3883:
   - loewe,wmdr-143n
   - omnima,hpm

4. Put the remaining devices in the new case.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler f4026ad24d ath79: DTS file style update and harmonization
This applies several style adjustments that have been requested in
recent reviews to older DTS files. Despite making the code base more
consistent, this will also help to reduce review time when DTSes
are copy/pasted.

Applied changes:
- Rename gpio-keys/gpio-leds to keys/leds
- Remove node labels that are not used
- Use label property for partitions
- Prefix led node labels with "led_"
- Remove redundant includes
- Harmonize new lines after status property
- Several smaller style fixes

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Sungbo Eo 763914ef1b ramips: improve netis WF-2881 support
This patch does the following:

1. remove u-boot-env partition
   Stock bootloader saves env variables at 0x80000 in flash,
   and there is nothing stored at 0x30000.
   By merging the partition "u-boot-env" with "u-boot",
   the partition table becomes the same as used in stock firmware:
   00000000-00080000: "Bootloader"
   00080000-00100000: "Config"
   00100000-00140000: "Factory"
   00140000-07f80000: "Kernel"

2. fix LAN/WAN MAC addresses and provide label MAC address
   Ethernet MAC addresses are stored in factory partition at:
   0xe000: LAN (label_mac)
   0xe006: WAN (label_mac+1)

3. fix LAN port order
   WF-2881 LAN ports are in reverse order of switch ports.

4. fix WiFi LEDs
   mt76 led nodes are added to make WiFi LEDs work.
   On top of this, mt76 node names are changed to more generic ones,
   and compatible strings are also added.

5. fix pinmux groups
   uart3 and uart2 pins are used as button and led, but jtag pins are not.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
5 years ago
Petr Štetiar 04d6753d03 Revert "ipq806x: fix EA8500 switch control"
There is a problem with the EA8500, the switch will not work after soft
reboot, the only way to get it working again is to power cycle it
manually.

There are probably several issues in the play, it's quite hard to fix it
without having access to the actual device, so I don't see any other
option now, then revert the offending commit.

Ref: PR#2047
Fixes: FS#2168 ("Switch no longer work after restart on Linksys EA8500")
Reported-by: Adam <424778940z@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Adrian Schmutzler 443ba75c4e ath79: fix sorting and harmonize indent in tiny board.d files
This seems to have been overlooked when splitting base files.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
David Bauer 70d5989c9c ipq806x: use switch trigger for WAN LED on NETGEAR boards
With this commit, the WAN LED is triggered by the switch port state
instead of the eth0 netdev.
Otherwise, the LED is always illuminated, regardless of the WAN port
link state.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Sungbo Eo 6ea5f7d44c ramips: fix MTK_SOC for RT3662 devices
rt3883.mk contains both RT3662 and RT3883 device profiles, but commit
6a104ac772 set MTK_SOC to rt3883 for all devices. This patch fixes it,
and renames dts files accordingly. And SoC compatible strings are also
appended in the dts.

Fixes: 6a104ac772 ("ramips/rt288x,rt3883: Name DTS files based on scheme")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
5 years ago
Chuanhong Guo 09fe0c847d mediatek: add mt7629 subtarget with rfb image
base-files are added into subtarget directory like what's done
recently in ath79. For this subtarget, metadata checks are enforced
and a SUPPORTED_DEVICE is added to generate proper metadata.
Since we only have mt7629 support in 4.19, override KERNEL_PATCHVER
in target.mk for now.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Chuanhong Guo 58b0d3ecd6 mediatek: cosmetic fixes for mt7629-lynx-rfb
This patch did the following things:
1. rename device compatible string
2. add earlycon into cmdline
3. add mac address location according to mt7629 eeprom layout
4. rename mtd partitions
5. replace spaces for indentation with tabs

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Chuanhong Guo 109e614d90 mediatek: backport upstream patches related to mt7629 support
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Chuanhong Guo 46a97fe316 mediatek: fix Unielec U7623 dts in 4.19
remove duplicated pinctrl nodes.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Adrian Schmutzler a5428d8c9b x86: delete empty Makefile introduced by accident
When changing profile titles for this target, an empty Makefile
has been added by accident.

Fixes: 14d17306bc ("x86: make profile titles more verbose")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Kristian Evensen 5f108bbc58 ramips: add support for ZBT WE1026-H
This commit adds support for the ZBT WE1026-H, an outdoor AP with
support for adding an internal LTE modem. The detailed specs are:

* CPU: MT7620A
* 2x 10/100Mbps Ethernet (LAN port has passive PoE support).
* 16/32 MB Flash.
* 128/256 MB RAM.
* 1x USB 2.0 port.
* 1x mini-PCIe slot (only USB2.0 bus).
* 1x SIM slot (standard size).
* 1x 2.4Ghz WIFI (rt2800).
* 1x button.
* 6x LEDS (4 GPIO-controlled).
* 1x micro-SD reader.

The following have been tested and working:
- Ethernet switch
- Wifi
- Mini-PCIe slot + SIM slot
- USB port
- microSD slot
- sysupgrade
- reset button

Installation and recovery:

In order to install OpenWRT the first time or ito recover the router,
you can use the web-based recovery system. Keep the reset button pressed
during boot and access 192.168.1.1 in your browser when your machine
obtains an IP address. Upload the firmware to start the recovery
process.

Notes:

* When binding the USB LED to a usbport, the LED is switched on all the
time due to the presence of an internal hub. Thus, it does not really
signal any USB-information.

* I only have the 32MB version and have only added support for this
device. However, the files are structured so that adding support for the
16MB version should be easy.

* Only the LAN port is accessible from the outside of the casing and LEDs
are not visible.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
[rebased onto base-files split, minor style fixes, removed use of
USB led as power LED]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Kristian Evensen a033f14fe9 ramips: update ZBT WE1026 DTS-files
This commit makes the following changes to the WE1026 DTS-files:

* The parts that are unique to the -5G-version (LED and 5GHz wifi)
are moved to a separate file, so that WE1026.dtsi can be referenced also
by the DTS for the -H version.
* Use the generic "flash"-name for the spi-nor node.
* Add label MAC.

All changes have been tested on the WE1026-5G-16M and work fine. I.e.,
the device works as before the DTS-changes.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
Acked-by: Mathias Kresin <dev@kresin.me>
Acked-by: Alex Maclean <monkeh@monkeh.net>
Acked-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Acked-by: Petr Štetiar <ynezz@true.cz>
[minor style fixes, rebased onto base-files split, remove obsolete
gpio-keys comment]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 65d76175a5 ramips: improve common definition for Netgear R6xxx in mt7621.mk
This patch renames and reassembles the common definition for
Netgear R6xxx devices in mt7621.mk. The following goals should be
achieved:
- Give the node a more generic name instead of adding devices to it
- Use the common definition in the (less) similar R6220 node
- Include/exclude settings into the common definition so the common
  node contains the common definitions
- Prepare for support of R6700 v2

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Bernhard Geier 3930aab2cb ath79: add support for TP-Link WBS210 v2
TP-Link WBS210 v2 is an outdoor wireless CPE for 2.4 GHz with
two Ethernet ports based on Atheros AR9344

The device is the same as TP-Link CPE220 v2, but with higher TX power (27 dBm
instead of 12 dBm) and two antenna connectors instead of built-in antennas.

Specifications:
 - SoC: Atheros AR9344
 - RAM: 64MB
 - Storage: 8 MB SPI NOR
 - Wireless: 2.4GHz 300 Mbps, 2x RP-SMA connector, 27 dBm TX power
 - Ethernet: 1x 10/100 Mbps with 24V POE IN, 1x 10/100 Mbps

Installation:
Flash factory image through stock firmware WEB UI
or through TFTP
To get to TFTP recovery just hold reset button while powering on for
around 4-5 seconds and release.
Rename factory image to recovery.bin
Stock TFTP server IP: 192.168.0.100
Stock device TFTP adress: 192.168.0.254

The TP-Link WBS devices use the same GPIOs as the CPE devices,
except for the link4 LED. For this one, WBS devices use "2", while
CPE devices use "16". (Tested on WBS210 v2)

Signed-off-by: Bernhard Geier <freifunk@geierb.de>
[added comment about GPIO]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Yousong Zhou 66ebca7103 build: label kernel and rootfs ext4 volumes
UUID of ext4 volumes generated by make_ext4fs are determined by volume
label and it will all be 57f8f4bc-abf4-655f-bf67-946fc0f9f25b when label
is empty

Labeling them does not make them unique but tools like block command
from fstools have a better chance differentiating them

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years ago
Adrian Schmutzler fe534392a5 ath79: revert erroneous second addition of files for WNDR4300
There are two recent commits stating to add support for Netgear
WNDR4300, where the second one seems to be just leftover from
an earlier patch having been rebased.

Since the first patch already provides support in the most recent
state, just revert the second one.

This reverts commit cd87272eb2.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Chih-Wei Chen 3e88ab79b0 ramips: fix Xiaomi MiWiFi Mini switch definition
Based on OpenWRT Table of Hardware > Xiaomi > Xiaomi Mi WiFi Mini

Switch Ports Defaults:
0, 1: LAN
4: WAN
6: CPU

Port in Web GUI (word printed on bottom of case)
WAN(Internet) map to switch port 4
LAN1(.) map to switch port 1
LAN2(..) map to switch port 0
CPU map to switch port 6

current setting is 1 WAN/ 4 LAN port, fix it.

Signed-off-by: Chih-Wei Chen <changeway@gmail.com>
[rebased after base-files split, fixed commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Paul Spooren 14d17306bc x86: make profile titles more verbose
So far (nearly) all x86 profiles are called "Generic" which makes
it hard to distinguish them in special cases, like searching for a
specific profile (without pre-selecting target/subtarget).

To make this change locally working, remove the tmp/ folder to
force reload of menuconfig.

As these files are infrequently touched, the Copyright was updated
as well.

Signed-off-by: Paul Spooren <mail@aparcar.org>
[changed commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Rasim Kalimullin 81f7af4881 ath79: add support for TP-Link TL-WR1045ND v2
Specifications:
 - QCA9558 Soc
 - 720/800 (CPU/DDR)
 - 1x 10/100/1000 Mbps WAN Ethernet
 - 4x 10/100/1000 Mbps LAN Ethernet
 - 64 MB RAM (DDR2)
 - 8 MB FLASH
 - QCA9558 2.4 GHz 802.11bgn
 - 1x USB 2.0

Flash instruction
WebUI:
Download *-factory.bin image, rename to tp_firmware.bin and upload
it via the firmwary upgrade function of the stock firmware WebUI.

Tftp:
Rename OpenWRT or original firmware to wr1045v2_tp_recovery.bin and
Change your computer ip in 192.168.0.66 and subnet mask in 255.255.255.0.
Router will obtain IP 192.168.0.86 for a few seconds while loading,
when reset button pressed at power On.

Signed-off-by: Rasim Kalimullin <neutrino.vm@gmail.com>
[rebased onto base-files split]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Roger Pueyo Centelles 20ace70db6 ath79: remove wmac mtd-mac-address for UniFi AC family
The MAC address for the wmac 2.4 GHz radio of the Ubiquiti UniFi AC
family of devices is actually embedded in the mtd-cal-data, so there
is no need for mtd-mac-address (which was incorrectly forcing wmac
to have the same MAC as eth0). This makes it coherent with the stock
firmware and the ar71xx target:

 · XX:XX:XX:X0:XX:XX eth0
 · XX:XX:XX:X1:XX:XX ath0/wlan1 (2.4 GHz)
 · XX:XX:XX:X2:XX:XX ath1/wlan0 (5 GHz)

Checked on a UniFi AC Mesh, a UniFi AC LR and a UniFi Lite.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
5 years ago
Adrian Schmutzler 194612997b ath79: use nand_do_upgrade by default for nand subtarget
On nand subtarget, the default upgrade mechanism should be
nand_do_upgrade. This patch changes platform_do_upgrade()
accordingly.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 19724e28c8 ramips: split base-files into subtargets
While most of the target's contents are split into subtargets, the
base-files are maintained for the target as a whole.

However, OpenWrt already implements a mechanism that will use (and
even prefer) files in the subtargets' directories. This can be
exploited to make several scripts subtarget-specific and thus save
some space.

In certain cases, keeping files in parent (=target) base-files was
more convenient, and thus no splitting was performed for those.

Note that this will increase overall code lines, but reduce code
per subtarget.

base-files ipk size reduction:
master (mt7621)   60958 B
split (mt7620)    46358 B (- 14.3 kiB)
split (mt7621)    48759 B (- 11.9 kiB)
split (mt76x8)    44948 B (- 15.6 kiB)
split (rt288x)    43508 B (- 17.0 kiB)
split (rt305x)    45616 B (- 15.0 kiB)
split (rt3883)    44176 B (- 16.4 kiB)

Run-tested on:
GL.iNet GL-MT300N-V2 (mt76x8)
D-Link DWR-116 (mt7620)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 0975c35b83 ramips: add newline for ASUS RT-ACx5P DTSes
Those files are missing the newline at the end.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 999504ff65 ath79: remove further redundant mtd-mac-address for wmac
For several devices, wmac MAC address is set from art 0x1002
explicitly by using mtd-mac-address although mtd-cal-data is
pulled from art 0x1000.

With the MAC address in 0x1002, the driver should automatically
use it when reading caldata from 0x1000. Thus, remove the
redundant mtd-mac-address for those devices.

This patch addresses the cases where the calibration data partition
is not labelled art, having been overlooked in the first patch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler dc90caf45a ipq40xx: convert IMAGE_SIZE/KERNEL_SIZE/BLOCKSIZE to kiB
This cosmetical patch converts IMAGE_SIZE, KERNEL_SIZE and
BLOCKSIZE definitions to kilobytes, as this is consistent and
easier to read/type.

An exception was made for asus_rt-ac58u, where the IMAGE_SIZE of
20439364 cannot be divided by 1024 (and also does not seem to
match anything in DTS).

Build-tested for all devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 6d00e6fc7b ath79: fix several issues for ZyXEL NBG6716
This fixes several issues introduced with ZyXEL NBG6716 support:
- Inhomogeneous indent
- Wrong ath10k MAC patching function
- Wrong brackets for pad-to in nand.mk
- Add missing DEVICE_MODEL
- Remove k2t.sh include (copy/paste leftover)

Fixes: 99835e0999 ("ath79: add support for ZyXEL NBG6716")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Michal Cieslakiewicz cd87272eb2 ath79: add support for Netgear WNDR4300
This patch adds ath79 support for Netgear WNDR4300.
Router was previously supported by ar71xx target only.
Note: device requires 'ar934x-nand' driver in kernel.

Specification
=============
  * Description: Netgear WNDR4300
  * Loader: U-boot
  * SOC: Atheros AR9344 (560 MHz)
  * RAM: 128 MiB
  * Flash: 128 MiB (NAND)
	- U-boot binary: 256 KiB
	- U-boot environment: 256 KiB
	- ART: 256 KiB
	- POT: 512 KiB
	- Language: 2 MiB
	- Config: 512 KiB
	- Traffic Meter: 3 MiB
	- Firmware: 25 MiB
	- ART Backup: 256 KiB
	- Reserved: 96 MiB
  * Ethernet: 5 x 10/100/1000 (4 x LAN, 1 x WAN) (AR8327)
  * Wireless:
	- 2.4 GHz b/g/n (internal)
	- 5 GHz a/n (AR9580)
  * USB: yes, 1 x USB 2.0
  * Buttons:
	- Reset
	- WiFi (rfkill)
	- WPS
  * LEDs:
	- Power (amber/green)
	- WAN (amber/green)
	- WLAN 2G (green)
	- WLAN 5G (blue)
	- 4 x LAN (amber/green)
	- USB (green)
	- WPS (amber/green)
  * UART: 4-pin connector JP1, 3.3V (Vcc, TX, RX, GND), 115200 8N1
  * Power supply: DC 12V 2.5A
  * MAC addresses: LAN=WLAN2G on case label, WAN +1, WLAN5G +2

Installation
============
  * TFTP recovery
  * TFTP via U-boot prompt
  * sysupgrade
  * Web interface

Note about partitioning: firmware partition offset (0x6c0000) is
hardcoded into vendor's u-boot, so this partition cannot be moved
and resized to include Netgear-specific flash areas (pot, language,
config, traffic_meter) not used by OpenWrt.

Test build configuration
========================
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_nand=y
CONFIG_TARGET_ath79_nand_DEVICE_netgear_wndr4300=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_IMAGEOPT=y

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Michal Cieslakiewicz 9b6f89c37f ath79: add support for Netgear WNDR4300
This patch adds ath79 support for Netgear WNDR4300.
Router was previously supported by ar71xx target only.
Note: device requires 'ar934x-nand' driver in kernel.

Specification
=============
  * Description: Netgear WNDR4300
  * Loader: U-boot
  * SOC: Atheros AR9344 (560 MHz)
  * RAM: 128 MiB
  * Flash: 128 MiB (NAND)
	- U-boot binary: 256 KiB
	- U-boot environment: 256 KiB
	- ART: 256 KiB
	- POT: 512 KiB
	- Language: 2 MiB
	- Config: 512 KiB
	- Traffic Meter: 3 MiB
	- Firmware: 25 MiB
	- ART Backup: 256 KiB
	- Reserved: 96 MiB
  * Ethernet: 5 x 10/100/1000 (4 x LAN, 1 x WAN) (AR8327)
  * Wireless:
	- 2.4 GHz b/g/n (internal)
	- 5 GHz a/n (AR9580)
  * USB: yes, 1 x USB 2.0
  * Buttons:
	- Reset
	- WiFi (rfkill)
	- WPS
  * LEDs:
	- Power (amber/green)
	- WAN (amber/green)
	- WLAN 2G (green)
	- WLAN 5G (blue)
	- 4 x LAN (amber/green)
	- USB (green)
	- WPS (amber/green)
  * UART: 4-pin connector JP1, 3.3V (Vcc, TX, RX, GND), 115200 8N1
  * Power supply: DC 12V 2.5A
  * MAC addresses: LAN=WLAN2G on case label, WAN +1, WLAN5G +2

Installation
============
  * TFTP recovery
  * TFTP via U-boot prompt
  * sysupgrade
  * Web interface

Note about partitioning: firmware partition offset (0x6c0000) is
hardcoded into vendor's u-boot, so this partition cannot be moved
and resized to include Netgear-specific flash areas (pot, language,
config, traffic_meter) not used by OpenWrt.

Test build configuration
========================
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_nand=y
CONFIG_TARGET_ath79_nand_DEVICE_netgear_wndr4300=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_IMAGEOPT=y

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

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

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

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

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
5 years ago
Michal Cieslakiewicz f85d56bb03 ath79: add support for Netgear WNR2200
This patch adds ath79 support for Netgear WNR2200.
Router was previously supported by ar71xx target only (8 MiB variant).
Netgear WNR2200 has two flash versions - 8MiB sold in EU, US etc. and
16 MiB for Russia and China markets. Apart from flash size both variants
share the same hardware specification.

Specification
=============
  * Description: Netgear WNR2200
  * Loader: U-boot
  * SOC: Atheros AR7241 (360 MHz)
  * RAM: 64 MiB
  * Flash: 8 MiB or 16 MiB (SPI NOR)
	- U-boot binary: 256 KiB
	- U-boot environment: 64 KiB
	- Firmware: 7808 KiB or 16000 KiB
	- ART: 64 KiB
  * Ethernet: 4 x 10/100 LAN + 1 x 10/100 WAN
  * Wireless: 2.4 GHz b/g/n (Atheros AR9287)
  * USB: yes, 1 x USB 2.0
  * Buttons:
	- Reset
	- WiFi (rfkill)
	- WPS
  * LEDs:
	- Power (amber/green)
	- WAN (amber/green)
	- WLAN (blue)
	- 4 x LAN (amber/green)
	- WPS (green)
  * UART: 4-pin connector JP1, 3.3V (Vcc, TX, RX, GND), 115200 8N1
  * Power supply: DC 12V 1.5A
  * MAC addresses: LAN on case label, WAN +1, WLAN +2

Installation
============
  * TFTP recovery
  * TFTP via U-boot prompt
  * sysupgrade
  * Web interface

Test build configuration
========================
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_generic=y
CONFIG_TARGET_ath79_generic_DEVICE_netgear_wnr2200-8m=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_IMAGEOPT=y
CONFIG_KERNEL_DEBUG_INFO=y
CONFIG_KERNEL_DEBUG_KERNEL=y

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Koen Vandeputte df60a0852c kernel: bump 4.19 to 4.19.81
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 0e212220e9 kernel: bump 4.14 to 4.14.151
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 4b2ab533d4 kernel: bump 4.19 to 4.19.80
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 0787b7247f kernel: bump 4.14 to 4.14.150
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Rafał Miłecki b49f2113cc kernel: fix swconfig compilation with kernels 5.2+
This is related to the upstream kernel change 3b0f31f2b8c9 ("genetlink:
make policy common to family").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
David Bauer a8a9340609 ath79: fix incorrect identation in qca9557.dtsi
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler b288c56e1e ath79: move base-files for ZyXEL NBG6716
Due to rebase of the base-files split patch after adding support
for the ZyXEL NBG6716, its base-files were added to the generic
subtarget, although the device belongs to the nand subtarget.

This moves the definitions to their proper locations.

Fixes: 0130022bae ("ath79: split base-files into subtargets")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[improve commit message, rebase]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 62db255543 ath79: add support for Aerohive HiveAP 121
This commit adds support for the Aerohive HiveAP-121. It was previously
already supported in the ar71xx subtarget.

The following is copied from the commit which added ar71xx support:

Specification:
- SoC: Atheros AR9344-BC2A at 560MHz
- WiFi 1: 2.4GHz Atheros AR9340? - SoC
- WiFi 2: 5.0GHz Atheros AR9382-AL1A
- Memory: 128MB from 2x Nanya NT5TU32M16DG-AC
- SPI: 1MB Macronix MX25L8006E
- NAND: 128MB Hynix H27U1G8F2BTR-BC
- Ethernet: Atheros AR8035-A
- USB: 1x 2.0
- TPM: Atmel SC3204

Flashing:
1. Hook into UART (9600 baud) and enter U-Boot. You may need to enter
a password of administrator or AhNf?d@ta06 if prompted.
2. Once in U-Boot, download and flash LEDE factory image over tftp:

dhcp;
setenv serverip tftp-server-ip;
tftpboot 0x81000000 lede-ar71xx-nand-hiveap-121-squashfs-factory.bin;
nand erase 0x800000 0x800000;
nand write 0x81000000 0x800000 0x800000;
reset;

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 08a134820f ath79: enable PCI for whole target
This commit adds PCI support for the whole ath79 target. Previously,
this was only done in the generic and tiny subtargets.

With the introduction of the HiveAP-121, PCI will be a requirement for
all subtargets, thus moving PCI support to the target configuration.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler 2b1baf9b16 ath79: remove redundant mtd-mac-address for wmac
For several devices, wmac MAC address is set from art 0x1002
explicitly by using mtd-mac-address although mtd-cal-data is
pulled from art 0x1000.

With the MAC address in 0x1002, the driver should automatically
use it when reading caldata from 0x1000. Thus, remove the
redundant mtd-mac-address for those devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Jeff Kletsky <git-commits@allycomm.com>
Tested-by: Karl Palsson <karlp@etactica.com>
5 years ago
David Bauer 6f2e1b7485 ath79: disable delays on AT803X config init
Until upstream commit 6d4cd041f0af("net: phy: at803x: disable delay
only for RGMII mode"), delays were not disabled on driver probe
for the Atheros AR803x PHYs, although the RX delay is enabled on
soft and hard reset.

In addition, the TX delay setting is retained on soft-reset.

This patch disables both delays on config init to align the behavior
with kernel 5.1 and higher. It can be safely dropped with kernel 5.1.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler 0130022bae ath79: split base-files into subtargets
While most of the target's contents are split into subtargets, the
base-files are maintained for the target as a whole.

However, OpenWrt already implements a mechanism that will use (and
even prefer) files in the subtargets' directories. This can be
exploited to make several scripts subtarget-specific and thus save
some space (especially helpful for the tiny devices).

The only script remaining in parent base-files is
/etc/hotplug.d/ieee80211/00-wifi-migration, everything else is
moved/split.

Note that this will increase overall code lines, but reduce code
per subtarget.

base-files ipk size reduction:
master (generic)   49135 B
split (generic)    48533 B (- 0.6 kiB)
split (tiny)       43337 B (- 5.7 kiB)
split (nand)       44423 B (- 4.6 kiB)

Tested on TL-WR1043ND v4 (generic) and TL-WR841N v12 (tiny).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Rosen Penev c36ef5970b ramips: ethernet: Replace random_ether_addr with eth_hw_addr_random
eth_hw_addr_random additionally sets addr_assign_type to NET_ADDR_RANDOM.

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

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

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

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler dc7872d8f8 ipq40xx: use DEVICE_VARIANT for Unielec U4019 flash size
If flash size is used as part of a device's title, it should be
specified as DEVICE_VARIANT like for the other devices so far.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 2d2fa2fd2d ath79: fix remaining IMAGE_SIZE issues
This fixes the remaining IMAGE_SIZE issues in ath79 target.
All devices in target have been checked, so together with
previous patches this target should be "clean" afterwards.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 4b4856bc53 ath79: fix IMAGE_SIZE for common TP-Link definitions
So far, IMAGE_SIZE is set as follows:
tplink-4m*   3904k  0x3d0000
tplink-8m*   7936k  0x7c0000
tplink-16m* 15872k  0xf80000

However, based on the size of firmware partitions in DTS it should
be:
tplink-4m*   3904k  0x3d0000
tplink-8m*   8000k  0x7d0000
tplink-16m* 16192k  0xfd0000

All (!) 8m*/16m* devices actually follow the latter scheme, which
is also consistent in terms of left free space for other
partitions. Thus, fix it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 3202ee0fc6 ath79: tidy up and fix IMAGE_SIZE for Ubiquiti devices
This addresses IMAGE_SIZE inconsistencies in generic_ubnt.mk by:

1. (cosmetical) Move IMAGE_SIZE out of top definition ("ubnt"),
   since despite two all subdefinition have different values.
2. (change) Fix IMAGE_SIZE for ubnt-xm and ubnt-bz (7552k->7488k).
3. (cosmetical) Move IMAGE_SIZE of ubnt-wa devices to parent node
   since all have same size (it is defined in parent DTSI ...).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Michal Cieslakiewicz 3f275f2ac8 ath79: wnr1000v2: fix image header information
Factory image generated for Netgear WNR1000 v2 has incorrect device
and hardware ID information in header due to missing makefile
variables. This fix adds them to device section.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
André Valentin 99835e0999 ath79: add support for ZyXEL NBG6716
Attention: Kernel partition size has been enlarged to 4MB.
To switch, you must update to latest ar71xx-nand snapshort and flash the
sysupgrade-4M-Kernel.bin:

zcat openwrt-ath79-nand-zyxel_nbg6716-squashfs-sysupgrade-4M-Kernel.bin | mtd -r -e ubi write - firmware; reboot -f
You will end up with a fresh config if you do not inject config into the image.

The NBG6716 may come with 128MB or 256MB NAND. ar71xx was able to use all, but
ath79 can only use the first 128MB. Therefore the complete NAND needs to be
overwritten. If not, the old UBI may make problems and lead to reboot loop.

Access the real u-boot shell:
ZyXEL uses a proprietary loader/shell on top of u-boot: "ZyXEL zloader v2.02"
When the device is starting up, the user can enter the the loader shell
by simply pressing a key within the 3 seconds once the following string
appears on the serial console:

|   Hit any key to stop autoboot:  3

The user is then dropped to a locked shell.

|NBG6716> HELP
|ATEN    x[,y]     set BootExtension Debug Flag (y=password)
|ATSE    x         show the seed of password generator
|ATSH              dump manufacturer related data in ROM
|ATRT    [x,y,z,u] RAM read/write test (x=level, y=start addr, z=end addr, u=iterations)
|ATGO              boot up whole system
|ATUR    x         upgrade RAS image (filename)
|NBG6716>

In order to escape/unlock a password challenge has to be passed.
Note: the value is dynamic! you have to calculate your own!

First use ATSE $MODELNAME (MODELNAME is the hostname in u-boot env)
to get the challange value/seed.

|NBG6716> ATSE NBG6716
|012345678901

This seed/value can be converted to the password with the help of this
bash script (Thanks to http://www.adslayuda.com/Zyxel650-9.html authors):

- tool.sh -
ror32() {
  echo $(( ($1 >> $2) | (($1 << (32 - $2) & (2**32-1)) ) ))
}
v="0x$1"
a="0x${v:2:6}"
b=$(( $a + 0x10F0A563))
c=$(( 0x${v:12:14} & 7 ))
p=$(( $(ror32 $b $c) ^ $a ))
printf "ATEN 1,%X\n" $p
- end of tool.sh -

|# bash ./tool.sh 012345678901
|
|ATEN 1,879C711

copy and paste the result into the shell to unlock zloader.

|NBG6716> ATEN 1,0046B0017430

If the entered code was correct the shell will change to
use the ATGU command to enter the real u-boot shell.

|NBG6716> ATGU
|NBG6716#

Signed-off-by: André Valentin <avalentin@marcant.net>
5 years ago
André Valentin 353ecbbf64 ar71xx: fix bug in NBG6716 kernelpacking, add firmware partition
-Fix the kernel image generation (more robust)
-Add a firmware partition table allowing easy upgrade to ath79

Signed-off-by: André Valentin <avalentin@marcant.net>
5 years ago
Paul Fertser 522d5ff428 ramips: add support for Xiaomi Mi Wi-Fi Router 3G v2
- CMIIT ID: 2019AP2581
- SoC:      MediaTek MT7621
- Flash:    16MiB NOR SPI (GigaDevice GD25Q128B)
- RAM:      128MiB DDR3 (ESMT M15T1G1664A)
- Serial:   As marked on PCB, 3V3 logic, baudrate is 115200, 8n1
- Ethernet: 3x 10/100/1000 Mbps (switched, 2xLAN + WAN)
- WIFI0:    MT7603E 2.4GHz 802.11b/g/n
- WIFI1:    MT7612E 5GHz 802.11ac
- Antennas: 4x external (2 per radio), non-detachable
- LEDs:     Programmable "power" LED (two-coloured, yellow/blue)
            Non-programmable "internet" LED (shows WAN activity)
- Buttons:  Reset

INSTALLATION:

Bootloader won't accept any serial input unless "boot_wait" u-boot
environment variable is changed to "on". Vendor firmware (looks like
an illegal OpenWrt fork) won't accept any serial input unless
"uart_en" is set to "1". Tricks to force u-boot to use default
environment do not help as it's restricted in the same way.

With bootloader unlocked the easiest way would be to TFTP the
sysupgrade image or to sysupgrade after loading an initramfs one.

For porting the flash contents were changed externally with an SPI
programmer (after lifting Vcc flash IC pin away from the PCB).

Forum thread [0] indicates that this device is identical to "Xiaomi Mi
Router 4A Gigabit Edition".

[0] https://forum.openwrt.org/t/xiaomi-mi-router-4a-gigabit-edition-r4ag-r4a-gigabit-fully-supported-but-requires-overwriting-spi-flash-with-programmer/36685

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
5 years ago
Tim Harvey d3d06f1500 octeontx: fix thunderx BGX underflow irq name
request_irq requires irq names to be static/allocated and not on the stack

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
5 years ago
Adrian Schmutzler 1abb473cea ramips: remove phy0tpt trigger from RT-AC65P/RT-AC85P power LED
This patch removes a phy0tpt trigger from the power LED, which
seems to have been added by mistake.

WiFi LEDs using phy0radio and phy1radio triggers are present and
used correctly.

Cc: Birger Koblitz <mail@birger-koblitz.de>

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler b6d53f1d02 ramips: remove redundant mtd-eeprom in mt76x8 DTS files
In mt7628an.dtsi, calibration data for wmac is already defined:
mediatek,mtd-eeprom = <&factory 0x0>;

Thus, this patch removes redundant entries of this property in
derived DTS files.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 547720fb48 ramips: remove redundant mtd-mac-address for WiFi
When caldata locations are defined with mediatek,mtd-eeprom the
MAC address is automatically read from offset +4. Thus, specifying
that location explicitly is redundant.

This patch removes those redundant definitions.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Jeff Kletsky b9d58f7e06 kernel: mtd: spinand: Backport chip definitions
generic: Add/rename patches for upstream consistency

ipq40xx: generic-level patch replaces same-source patches-4.19/
         082-v4.20-mtd-spinand-winbond-Add-support-for-W25N01GV.patch

The SPI-NAND framework from Linux uses common driver code that is then
"tuned" by a tiny struct of chip-specific data that describes
available commands, timing, and layout (data and OOB data). Several
manufacturers and chips have been added since 4.19, several of which
are used in devices already supported by OpenWrt (typically with no or
"legacy" access to their NAND memory). This commit catches up the
supported-chip definitions through Linux 5.2-rc6 and linux/next.

The driver is only compiled for platforms with CONFIG_MTD_SPI_NAND=y.
This presently includes ipq40xx and pistachio, with the addition of
ath79-nand in these commits (and not ath79-generic or ath79-tiny).

Upstream patches refreshed against 4.19.75

Build-tested-on: ipq40xx
Run-tested-on: ath79-nand

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years ago
Jeff Kletsky 18848312c5 ath79: Refactor GL.iNet GL-AR300M-series generic.mk
Rework DEVICE_VENDOR, DEVICE_MODEL, and DEVICE_VARIANT
for the GL-AR300M series on the ath79-generic target.

Changes GL-AR300M-Lite to the current form with
DEVICE_VARIANT := Lite (board name is unchanged)

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years ago
Jeff Kletsky 1f748df085 ath79: GL-AR750S: Add I2C Support
The GL-AR750S has an internal header for I2C.

Provide DTS definitions for the i2c-gpio driver.

The I2C drivers; kmod-i2c-core, kmod-i2c-gpio
consume ~20 kB of flash and can be loaded as modules,

Default clock measured ~11.2 ms period, ~89 kHz

The board has well-labeled (unpopulated) headers for serial and I2C
along the front edge of the board (the edge with the LEDs). Looking
from the top, rear of the unit (behind Ethernet jacks)

  -------------------------------------------
       5G_LED        2G_LED      PWR_LED

                 O O O O O O O

                 3 S S G T R G
                 V C D N X X N
                 3 L A D     D

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years ago
Jeff Kletsky 736d16baad ath79: GL-AR300M series: Add I2C Support
The GL-AR300M series have an internal header for I2C.

Provide DTS definitions for the i2c-gpio driver.

The I2C drivers; kmod-i2c-core, kmod-i2c-gpio
consume ~20 kB of flash and can be loaded as modules,

Default clock measured ~11.4 ms period, ~88 kHz

The board has two sets of (unpopulated) headers.  While facing the
back of the board (looking into the Ethernet jacks), and looking from
the top, the one on the left edge of the baord with four holes is the
I2C header. It appears to be labeled J8 on "GL-AR300M-V1.4.0" boards.

    | (Patch antenna)
    |
    |
    |  O   GND
    |  O   SDA / GPIO 17
    |  O   SCL / GPIO 16
    |  ⊡   3V3 (square land)
    |
    | (Ethernet jacks)

https://docs.gl-inet.com/en/3/hardware/ar300m/#pcb-pinout states
"Note: I2C is not working in some early version of the router."

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years ago
Gabor Varga 7c5f712e4f ramips: add support for Asus RT-AC65P
The Asus RT-AC65P router is identical with the RT-AC85P, but better to make separate images for it.

On both routers the installation can be done also via SSH:

Note: The user/password for SSH is identical with the one used in the
Web-interface.

1. Complete the initial setup wizard.
2. Activate SSH under "Administration" -> "System".
3. Transfer the OpenWrt factory image via scp:
 > scp openwrt-ramips-mt7621-asus_rt-ac65p-squashfs-factory.bin admin@192.168.50.1:/tmp
4. Connect via SSH to the router.
 > ssh admin@192.168.50.1
5. Write the OpenWrt image to flash.
 > mtd-write -i
/tmp/openwrt-ramips-mt7621-asus_rt-ac65p-squashfs-factory.bin -d linux
6. Reboot the router
 > reboot

Changelog:

v3: removed [] from filename, rebased to latest master
v2: Rebased to latest master
v1: Initial release

Signed-off-by: Gabor Varga <vargagab@gmail.com>
5 years ago
Andreas Ziegler 2bc7c519dc ar71xx: add model detection for UniFi AC-LR
This commit adds correct model detection for UniFi
AC-LR. Previously, said device was incorrectly detected
as UniFi-AC-LITE/MESH.

The Information about the device is stored at 0xC in the EEPROM
partition. It corresponds to the sysid in /etc/board.info of the
Ubiquiti stock firmware.

Signed-off-by: Andreas Ziegler <dev@andreas-ziegler.de>
[adjust naming style of target to existing ones]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 7f187229a8 ipq40xx: add support for AVM FRITZ!Repeater 1200
Hardware
--------
SoC:   Qualcomm IPQ4019
RAM:   256M DDR3
FLASH: 128M NAND
WiFi:  2T2R IPQ4019 bgn
       2T2R IPQ4019 a/n/ac
ETH:   Atheros AR8033 RGMII PHY
BTN:   1x Connect (WPS)
LED:   Power (green/red/yellow)

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

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

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

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

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

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

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

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

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

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

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

8. Flash OpenWRT peristently using sysupgrade.

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

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 6fd9eeeeb2 ipq40xx: add missing backslash in 11-ath10k-caldata
This adds a missing backslash in the caldata-extraction script. Without
this fix, caldata extraction fails for every device.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 7be79a3ab2 ipq40xx: fix ethernet probe abort on missing phy-reset
This commit completely fixes the abortion of the ipq40xx ethernet driver
probe in case no phy-reset is defined.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Moritz Warning d263883796 brcm63xx: split up DEVICE_TITLE
DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT
Uses DEVICE_ALT* variables for alternative vendor/retailer names.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years ago
Jonas Gorski 4f86397022 brcm63xx: fix build with GCC 8.3
Fixes the following build error when building when using GCC 8.3:

In file included from ./include/linux/string.h:19,
                 from ./include/linux/bitmap.h:9,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/mips/include/asm/processor.h:15,
                 from ./arch/mips/include/asm/thread_info.h:16,
                 from ./include/linux/thread_info.h:38,
                 from ./include/asm-generic/preempt.h:5,
                 from ./arch/mips/include/generated/asm/preempt.h:1,
                 from ./include/linux/preempt.h:81,
                 from ./include/linux/spinlock.h:51,
                 from ./include/linux/mmzone.h:8,
                 from ./include/linux/bootmem.h:8,
                 from arch/mips/bcm63xx/prom.c:10:
arch/mips/bcm63xx/prom.c: In function 'prom_init':
./arch/mips/include/asm/string.h:162:11: error: '__builtin_memcpy' forming offset [2, 32] is out of the bounds [0, 1] of object 'bmips_smp_movevec' with type 'char' [-Werror=array-bounds]
   __ret = __builtin_memcpy((dst), (src), __len); \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/bcm63xx/prom.c:97:3: note: in expansion of macro 'memcpy'
   memcpy((void *)0xa0000200, &bmips_smp_movevec, 0x20);
   ^~~~~~
In file included from arch/mips/bcm63xx/prom.c:14:
./arch/mips/include/asm/bmips.h:80:13: note: 'bmips_smp_movevec' declared here
 extern char bmips_smp_movevec;

Reported-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
5 years ago
Adrian Schmutzler fd1d03f853 ramips: fix LAN/WAN MAC addresses of Xiaomi MiWiFi Mini board
Based on stock firmware tests, both LAN and WAN ports use the
MAC address from 0x28 on factory partition.

In OpenWrt, this one is already set in DTS. This patch removes the
local bit set in 02_network previously, and adjusts LAN/WAN
addresses as on stock firmware.

Note that in tests we found a MAC address in 0x2e that is the one
in 0x28 plus 1. Since stock firmware does not use it though, we
do not use it either.

Thanks to Chih-Wei Chen for testing this on his device.

ref: https://github.com/openwrt/openwrt/pull/2497

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
John Crispin 8285af1928 ipq40xx: fix optional gpio-reset
If a gpio reset pin was not defined we should not bog out.

Signed-off-by: John Crispin <john@phrozen.org>
5 years ago
Adrian Schmutzler c79b796280 ar71xx: improve support for TP-Link CPE510 v2
This fixes commit bae927c551 ("ar71xx: add support for TP-LINK CPE510
V2.0") where the support for this device wasn't optimal.

Device support for the CPE510v2 so far has been a hack to enable
flashing with CPE510v1 images. Those even have different hardware (e.g.
additional ethernet port).

With this patch, we provide proper support for this device in ar71xx.

Installation:
- Flash factory image through stock firmware WEB UI or through TFTP
- To get to TFTP recovery just hold reset button while powering on
  for around 4-5 seconds and release.
- Rename factory image to recovery.bin
- Stock TFTP server IP: 192.168.0.100
- Stock device TFTP address: 192.168.0.254

Fixes: bae927c551 ("ar71xx: add support for TP-LINK CPE510 V2.0")
Signed-off-by: Andrew Cameron <apcameron@softhome.net>
[Rebased onto revert commit, changed comments in mach-cpe510.c,
changed commit title and description, fixed eth0 MAC address,
removed eth1 initialization]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[squashed revert, added fixes tag]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Adrian Schmutzler e4155bcc45 ramips: fix TARGET_DEVICES after UniElec rename
Device node names were updated, but updating TARGET_DEVICES
was overlooked.

Fixes: 4408723d42 ("ramips: remove RAM size from device name
for UniElec devices")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 4408723d42 ramips: remove RAM size from device name for UniElec devices
UniElec devices are the last ones in ramips target still having
the RAM size in device name although RAM size is auto-detected.

Remove this from device name, compatible, etc., as it's not
required and might be misleading to users and developers adding
device support copying those devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Tomasz Maciej Nowak cc5256a8bf ath79: base-files: disable sysupgrade for routerstations and ja76pf2
Previous commit 0cc87b3 "ath79: image: disable sysupgrade images for
routerstations and ja76pf2" doesn't remedy completely the posibility of
bricking the device, since user could try to downgrade with an older
image. Therefore disable sysupgrade code for these boards with a small
note.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Adrian Schmutzler 8c36fd3105 ath79: apply alphabetical sorting to entries in 10_fix_wifi_mac
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 244745d7fc ath79: remove empty default case in 10_fix_wifi_mac
This removes a useless empty default case.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 44da2e0344 ath79: fix whitespaces in 10_fix_wifi_mac
This converts leading whitespaces to tabs and removes a double
newline at the end of the file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 556ff09875 ramips/mt762x: convert devices to interrupt-driven gpio-keys
This converts all remaining devices to use interrupt-driven
gpio-keys compatible instead of gpio-keys-polled.
The poll-interval is removed.

While at it, add/remove newlines in keys and leds node where
necessary.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 53e6cc7a81 ath79: add LED migration for several Archer Cxx devices
Several Archer Cxx devices were using board-specific LED names in
ar71xx, which were changed to "tp-link:*" in ath79.

This patch adds migration for them.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 6b0eb84336 ath79: use board name in LED migrations
Several devices added to LED migration script will just have their
(old) board name converted to tp-link.

By using a variable for this, the amount of code in the migration
script can be reduced and the chance for typos is reduced.

This patch also introduces the marker for beginning of a pattern
"^" to the regex, so the match is more specific.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler e816c50993 ramips: fix whitespace issues in DTS files
This is the result of grepping/searching for several common
whitespace issues like double empty lines, leading spaces, etc.

This patch fixes them for the ramips target.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler f473ce6f23 ath79: fix SUPPORTED_DEVICES for ubnt_nanostation-m
The ar71xx images for the Ubiquiti NanoStation M (XM) devices use
"nanostation-m" as board name, but the ath79 images are only
compatible with the "nano-m" board name, so sysupgrade complains.

By changing this additional supported device, sysupgrade smoothly
upgrades from ar71xx to ath79.

Ref: openwrt#2418

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 86a1f52617 lantiq: modify ath9k caldata extraction to reuse caldata.sh
In lantiq, ath9k caldata extraction is implemented to work in two
alternate "modes", the standard one and another one with swapped
byte pairs.

This rearranges the functions so "standard" use is based on the
caldata.sh library, while only a single local function is required
for the special case.

Note that while the parameter for switching between normal and swab
is removed, the size of the caldata is added to the function calls
to stay consistent.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Michal Cieslakiewicz 380cf82f99 ar71xx: WNDR4300: fix WAN LED behaviour
Change WAN LED behaviour to be consistent with other Netgear
routers running OpenWrt. Instead of link speed, use amber colour
to indicate link status. Green LED should be used when Internet
connection is up and running.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Michal Cieslakiewicz 77e14181d9 ar71xx: WNDR4300: use standard labels for buttons
GPIO key labels have been changed to standard ones (rfkill, reset, wps).
It does not affect button functionality.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Adrian Schmutzler 6b53033783 ath79: fix patching ath9k MAC address for MyNet WiFi Range Extender
The code line patching ath9k MAC address for this device contains
a wrong number of arguments including an unset "$mac", which
looks like a typo or copy/paste mistake.

This has been introduced already in the device support commit
745dee11ac ("ath79: add support for WD My Net Wi-Fi Range
Extender").

This patch just removes the "$mac" argument, leaving a formally
valid line. (No on-device test has been performed.)

Cc: Christian Lamparter <chunkeey@gmail.com>

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Michal Cieslakiewicz 09f46c6b54 ath79: add support for Netgear WNR1000 v2
This patch adds ath79 support for Netgear WNR1000v2.
Router was previously supported by ar71xx target only.
Note: this is a 4_32 device with limited upgrade capabilities.

Specification
=============
  * Description: Netgear WNR1000 v2
  * Loader: U-boot
  * SOC: Atheros AR7240 (340 MHz)
  * RAM: 32 MiB
  * Flash: 4 MiB (SPI NOR)
	- U-boot binary: 256 KiB
	- U-boot environment: 64 KiB
	- Firmware: 3712 KiB
	- ART: 64 KiB
  * Ethernet: 4 x 10/100 LAN + 1 x 10/100 WAN
  * Wireless: 2.4 GHz b/g/n (Atheros AR9285)
  * USB: no
  * Buttons:
	- Reset
	- WiFi (rfkill)
	- WPS
  * LEDs:
	- Power (amber/green)
	- WAN (amber/green)
	- WLAN (blue)
	- 4 x LAN (amber/green)
	- WPS (green)
  * UART: 4-pin connector JP2, 3.3V (Vcc, TX, RX, GND), 115200 8N1
  * Power supply: DC 12V 1A
  * MAC addresses: LAN on case label, WAN +1, WLAN +2

Installation
============
  * TFTP recovery
  * TFTP via U-boot prompt
  * sysupgrade
  * Web interface

Test build configuration
========================
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_tiny=y
CONFIG_TARGET_ath79_tiny_DEVICE_netgear_wnr1000-v2=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_IMAGEOPT=y
CONFIG_KERNEL_DEBUG_INFO=y
CONFIG_KERNEL_DEBUG_KERNEL=y

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Michal Cieslakiewicz 12719ce37a ath79: add support for Netgear WNR2000 v3
This patch adds ath79 support for Netgear WNR2000v3.
Router was previously supported by ar71xx target only.
Note: this is a 4_32 device with limited upgrade capabilities.

Specification
=============
  * Description: Netgear WNR2000 v3
  * Loader: U-boot
  * SOC: Atheros AR7241 (360 MHz)
  * RAM: 32 MiB
  * Flash: 4 MiB (SPI NOR)
	- U-boot binary: 256 KiB
	- U-boot environment: 64 KiB
	- Firmware: 3712 KiB
	- ART: 64 KiB
  * Ethernet: 4 x 10/100 LAN + 1 x 10/100 WAN
  * Wireless: 2.4 GHz b/g/n (Atheros AR9287)
  * USB: no
  * Buttons:
	- Reset
	- WiFi (rfkill)
	- WPS
  * LEDs:
	- Power (amber/green)
	- WAN (amber/green)
	- WLAN (blue)
	- 4 x LAN (amber/green)
	- WPS (green)
  * UART: 4-pin connector JP1, 3.3V (Vcc, TX, RX, GND), 115200 8N1
  * Power supply: DC 12V 1A
  * MAC addresses: LAN on case label, WAN +1, WLAN +2

Installation
============
  * TFTP recovery
  * TFTP via U-boot prompt
  * sysupgrade
  * Web interface

Test build configuration
========================
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_tiny=y
CONFIG_TARGET_ath79_tiny_DEVICE_netgear_wnr2000-v3=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_IMAGEOPT=y
CONFIG_KERNEL_DEBUG_INFO=y
CONFIG_KERNEL_DEBUG_KERNEL=y

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Michal Cieslakiewicz d74324e407 ath79: WNR612v2: improve device support
This patch improves ath79 support for Netgear WNR612v2.
Router functionality becomes identical to ar71xx version.

Changes include:
* software control over LAN LEDs via sysfs
* correct MAC addresses for network interfaces
* correct image size in device definition
* dts: 'keys' renamed to 'ath9k-keys'
* dts: 'label-mac-device' set to eth1 (LAN)
* dts: formatting adjustments

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago