Commit Graph

21705 Commits (5625a02e77bd293e999562141aab01746521f30b)

Author SHA1 Message Date
Dan Haab bc5db7364d bcm53xx: sysupgrade: support Luxul firmware format
Allow flashing Luxul devices using vendor firmware format. The next step
will be building proper images once they are conirmed to work.

Signed-off-by: Dan Haab <dan.haab@legrand.com>
5 years ago
Rafał Miłecki 63d611390c ar71xx: fix typo in platform_do_upgrade_compex()
Fixes: 641f6b6c26 ("treewide: use new procd sysupgrade $UPGRADE_BACKUP variable")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Lorenzo Bianconi 14054e2982 mediatek: enable mtk_efuse by default
Enable by default mtk_efuse driver since it needed by mtk_thermal driver
to read sensor calibration data

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
5 years ago
Karl Palsson dadcd3dd98 ath79: eg200: enable status led usage
This enables using the "eTactica" LED during boot, to indicate failsafe,
and during upgrade, while still leaving the LED alone for normal
operation.  This brings the device more in line with how other devices
work, and makes the failsafe functionality easier to use and understand.

Signed-off-by: Karl Palsson <karlp@etactica.com>
5 years ago
Ivan Hörler c03a328b10 ramips: add SD-Card support for Linkit Smart 7688
The Linkit Smart 7688 has a SD-Card reader that does not work with the official build of openwrt. Adding kmod-sdhci-mt7620 makes it working.

Signed-off-by: Ivan Hörler <i.hoerler@me.com>
5 years ago
Daniel Golle 6364e03736 ramips: only add spidev node in for WrtNode2R (and not for 2P)
Only the 2R version got the STM32 uC connected as 2nd SPI device.
Hence move the spidev node from mt7628an_wrtnode_wrtnode2.dtsi to
mt7628an_wrtnode_wrtnode2r.dts.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years ago
Yousong Zhou a089d55170 apm821xx: image: remove unused kernel.dtb from IMAGES
It's a leftover from 2271967f ("apm821xx: utilize build ARTIFACTs")

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Acked-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Yousong Zhou c163604b7f imx6: install-dtb as separate IMAGE
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years ago
Koen Vandeputte 1cf2495d48 ar71xx: make IRQ fixes target specific
Move the IRQ fix from generic to ar71xx specific.
Other targets like ath79 have specific pathes to delete this code.
This resulted in a build failure on ath79

While at it, wipe the 4.19 version, as ar71xx will never reach this.

Fixes: 530f76708cef ("ar71xx: Fix potentially missed IRQ handling during
dispatch")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Adrian Schmutzler 84c263ebfe brcm63xx: remove redundant variable definition in Makefile
For devices inheriting from bcm63xx_netgear, the IMAGES variable
is overwritten with the same values as defined in the parent
definition. So, remove the unnecessary overwrite.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Koen Vandeputte 713561a10b ar71xx: fix potential IRQ misses during dispatch for qca953x
If both interrupts are set in the current implementation
only the 1st will be handled and the 2nd will be skipped
due to the "if else" condition.

Fix this by using the same approach as done for QCA955x
just below it.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 00d48bcac0 ar71xx: Fix potentially missed IRQ handling during dispatch
If both interrupts are set in the current implementation
only the 1st will be handled and the 2nd will be skipped
due to the "if else" condition.

Fix this by using the same approach as done for QCA955x
just below it.

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

Remove upstreamed:
- 390-v5.3-net-sched-fix-action-ipt-crash.patch

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

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

Remove upstreamed:
- 390-v5.3-net-sched-fix-action-ipt-crash.patch

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

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

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
David Bauer 18fa749df8 ath79: fix UniFi AC LED mapping
The UniFi AC LED mapping is currently off. The blue/white LED are used
as WiFi indicators, while the vendor firmware does not feature WiFI
LEDs.

Instead, the LEDs are used to indicate the devices status. Align the LED
mapping to match the vendor firmware as good as possible.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Koen Vandeputte 7489ea85a2 Revert "ar71xx: use platform code for qca955x usb0 init"
This reverts commit 5b98061bb1.

As Piotr Dymacz pointed out:

In QCA MIPS based WiSOCs, for first USB interface,
device/host mode can be selected _only_ in hardware
see description of 57c641ba6e

QCA955x and QCA9563, second USB can be switched to device
mode in software (tested and confirmed on real hardware).

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Moritz Warning c546855188
imx6: split up DEVICE_TITLE
DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years ago
Moritz Warning bdf0ca7fec samsung: split up DEVICE_TITLE
DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years ago
Tomislav Požega 191c3e49b9 ar71xx: qca955x pci init/reset fixes
Current ar724x code does the reset only on single pci bus, and
in case of qca9558 writes the wrong register (0x10 vs 0x0c).
This change allows the reset of second pci bus, commonly used in
Archer C7 devices, in case host controller is stuck in reset.
If the resetting controller on boot can solve any other issue it
can be enabled unconditionally by removing reset check before
ar724x_pci_hw_init is called.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
[refreshed to apply cleanly]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Tomislav Požega e8350c998b ar71xx: enable ddr wb flush on qca955x
Enable flushing of write buffers on qca955x. GPL code has 0x88 reg
defined for PCI flush which is likely an error since the device
freezes on boot. So use DS default value 0xA8 for PCI flush.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
5 years ago
Tomislav Požega 5b98061bb1 ar71xx: use platform code for qca955x usb0 init
Switch from ci_usb_setup to generic platform initialization of
usb0 port.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
5 years ago
Koen Vandeputte 1d51160f85 kernel: bump 4.19 to 4.19.71
Refreshed all patches.

Remove upstreamed:
- 950-0774-watchdog-bcm2835_wdt-Fix-module-autoload.patch
- 0017-usb-host-fotg2-restart-hcd-after-port-reset.patch

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

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

Remove upstreamed:
- 0032-usb-host-fotg2-restart-hcd-after-port-reset.patch

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

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

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Rafał Miłecki a858db3136 treewide: sysupgrade: use $UPGRADE_BACKUP to check for backup
Now that $UPGRADE_BACKUP is set conditionally there is no need to check
the $UPGRADE_OPT_SAVE_CONFIG anymore. All conditions can be simplified.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Yousong Zhou 6d819fae53 gemini: image: fix race condition when building copy-kernel.bin
Make treat copy-kernel.o as intermediate and delete it when it's no
longer needed.  This can fail when the same submake was triggered
multiple times for different devices.

	arm-openwrt-linux-muslgnueabi-as  -k -o copy-kernel.o copy-kernel.S
	export MAKEFLAGS= ;make -w -C copy-kernel CROSS_COMPILE=arm-openwrt-linux-muslgnueabi-
	arm-openwrt-linux-muslgnueabi-objcopy -O binary -S copy-kernel.o copy-kernel.bin
	make[5]: Entering directory '/builder/shared-workdir/build/target/linux/gemini/image/copy-kernel'
	arm-openwrt-linux-muslgnueabi-objcopy -O binary -S copy-kernel.o copy-kernel.bin
	rm copy-kernel.o
	make[5]: Leaving directory '/builder/shared-workdir/build/target/linux/gemini/image/copy-kernel'
	# "App" partition is the rootfs
	arm-openwrt-linux-muslgnueabi-objcopy: 'copy-kernel.o': No such file
	Makefile:27: recipe for target 'copy-kernel.bin' failed
	make[5]: Leaving directory '/builder/shared-workdir/build/target/linux/gemini/image/copy-kernel'
	make[5]: *** [copy-kernel.bin] Error 1
	Makefile:244: recipe for target '/builder/shared-workdir/build/build_dir/target-arm_fa526_musl_eabi/linux-gemini/tmp/openwrt-gemini-storlink_sl93512r-ext4-factory.bin' failed
	make[4]: *** [/builder/shared-workdir/build/build_dir/target-arm_fa526_musl_eabi/linux-gemini/tmp/openwrt-gemini-storlink_sl93512r-ext4-factory.bin] Error 2

With this change, output files are directed to $(KDIR)

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
5 years ago
Roger Pueyo Centelles e667d6f46b ramips: enable external amplifier for D-Link DIR-810L
The 2.4 GHz radio had very poor signal reception (-89 dBm for an AP
sitting 5 m away). By enabling the external amplifier, received signal
has improved to -50 dBm for the same AP.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
5 years ago
Adrian Schmutzler 869a0183b9 ramips: fix MAC address setup for Newifi Y1 and Y1S
So far, MAC address setup for those devices has been using local
addresses although additional MAC addresses are available on flash.

On device, we found the following situation:
position   Y1     Y1S
0x4        *:d4   *:e4
0x8004     *:d6   *:e8
0x28       *:d4   *:e4
0x2e       *:d7   *:eb

Since 0x4 and 0x28 yield the same address, the former was set for
&ethernet in DTS. However, the typical location on this
architecture is 0x28, so this patch changes that.

For further setup in 02_network, the local bit for lan_mac is
removed, so the address from &ethernet is used at all. For wan_mac,
instead of calculating an address with local bit set, this patch
exploits the previously unused address in 0x2e.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler aaf90d8808 ramips: initialize MAC addresses from flash where possible
This patch changes wan MAC address setup from retrieving it by
calculation to reading it from flash.

Changes are limited to cases where on-device check was possible.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[fix mac for newifi-d1; drop adslr,g7 because it's unlikely for
vendor to specifically use 2.4g mac as wan_mac]
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Adrian Schmutzler e35e4a996e ramips: fix duplicate network setup for dlink,dir-615-h1
In 555ca422d1 ("ramips: fix D-Link DIR-615 H1 switch port
mapping"), port setup for dir-615-h1 was changed without removing
the old one. This was working as the new one was triggered earlier
than the old one.

(In the meantine, changed sorting during ramips rename patches
actually inversed that order.)

Anyway, just remove the wrong case now.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler ad4eb2241b ramips: remove duplicate case for MAC setup of freestation5
ARC FreeStation5 is present twice in MAC address setup.

From older commits/changes, it is not possible to reconstruct
the correct choice only by reading the annotations.

Thus, remove the second case and keep the first one, so behavior
stays the same (as nobody seems to have complained about it).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 6640e1c368 ramips: clean and improve MAC address setup in 02_network
This patch removes unnecessary MAC address setup statements in
ramips' 02_network by doing several optimizations:

1. For the following devices, lan_mac was set up with
   mtd_get_mac_binary although the same address was set in DTS.
   The lan_mac statement is removed in 02_network, but
   wan_mac is kept:
   - mercury,mac1200r-v2
   - phicomm,k2g
   - skylab,skw92a
   - wiznet,wizfi630a

2. For the following devices, wan_mac was set up with
   mtd_get_mac_binary although the same address was set in DTS.
   The wan_mac statement is removed in 02_network, no
   lan_mac is present:
   - buffalo,whr-g300n
   - glinet,gl-mt300n-v2
   - zyxel,keenetic-start

3. For the following device, lan_mac and wan_mac were set up
   with mtd_get_mac_binary to the same address as set in DTS.
   Both statements are removed in 02_network:
   - buffalo,whr-600d

4. For some devices, it was possible to move setup from 02_network
   to DTS by introducing previously missing mtd_mac_address:
   - buffalo,whr-1166d
   - buffalo,whr-300hp2
   - buffalo,wsr-600dhp
   - ohyeah,oy-0001
   - planex,vr500

5. For one device, mtd_mac_address was just wrong and overwritten
   by 02_network. Put the correct value in DTS and remove redundant
   statement in 02_network:
   - asus,rt-ac57u

6. For one device, MAC address defined in DTS is exchanged together
   with lan_mac/wan_mac setup in 02_network, so that cases in
   02_network can be merged:
   - phicomm,k2p

For some devices, an empty case has to be used to prevent them
from falling into the default case and have
WAN address = eth0 address + 1 set to them.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Rafał Miłecki c19b9f9a26 bcm53xx: extend firmware validation
This provides TRX validation result to the validation JSON. It also
prevents users from installing broken firmware files.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki 641f6b6c26 treewide: use new procd sysupgrade $UPGRADE_BACKUP variable
It's a variable set by procd that should replace hardcoded
/tmp/sysupgrade.tgz.

This change requires the most recent procd with the commit 0f3c136
("sysupgrade: set UPGRADE_BACKUP env variable").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki 62dbe361a1 treewide: when copying a backup file always specify dest name
$CONF_TAR shouldn't be assumed to always point to the sysupgrade.tgz.
This change makes code more generic and allows refactoring $CONF_TAR.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki bf39047872 treewide: don't hardcode "sysupgrade.tgz" file name
1) Add BACKUP_FILE and use it when copying an archive to be restored
   after sysupgrade (on the next preinit).
2) Use CONF_TAR for copying backup prepared by the /sbin/sysupgrade

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki 1078de96e3 treewide: fix invalid UPGRADE_OPT_SAVE_CONFIG spellings
That was a result of accidentally running "sed" twice on some files.

Fixes: 5797fe84a3 ("treewide: replace remaining (not working now) $SAVE_CONFIG uses")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki 5797fe84a3 treewide: replace remaining (not working now) $SAVE_CONFIG uses
This var has been replaced by the $UPGRADE_OPT_UPGRADE_OPT_SAVE_CONFIG

Fixes: b534ba9611 ("base-files: pass "save_config" option to the "sysupgrade" method")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Álvaro Fernández Rojas 662394fb30 brcm2708: update to latest patches from RPi foundation
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 years ago
Álvaro Fernández Rojas 99a5e28588 brcm2708: bcm2711: remove custom config file
Forcing arm_64bit is no longer required with latest firmware.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 years ago
Chuanhong Guo 7a21c85f70 ramips: improve support for Xiaomi Miwifi Nano
This patch does the following things:
1. mark u-boot-env writable
2. add bootcount support
   Currently, u-boot has a flag_boot_success env variable to reset.
   Also reset it in our firmware to follow the behavior in vendor's
   firmware.
3. disable usb support
   This router doesn't have usb port at all.
4. increase spi clock to 40MHz
5. fix pinmux groups

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Rafał Miłecki e68c1cebd1 brcm47xx: extend firmware validation
This provides TRX validation result, so final JSON may look like:
{
	"tests": {
		"fwtool_signature": true,
		"fwtool_device_match": true,
		"trx_valid": true
	},
	"valid": true,
	"forceable": true
}

It also prevents users from installing broken firmware files, e.g.:

root@OpenWrt:/# sysupgrade -F -n /tmp/TZ
Image metadata not found
Invalid image type. Please use firmware specific for this device.
Image check failed but --force given - will update anyway!
Commencing upgrade. Closing all shell sessions.
Firmware image is broken and cannot be installed

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Álvaro Fernández Rojas 5287ac2dfb brcm2708: restore UART on RPi 0W, 3B, 3B+ and 4B
Disable Bluetooth and restore UART to GPIOs 14 & 15.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 years ago
Adrian Schmutzler fbbb4eb8b4 ath79: add support for TP-Link WDR3500 v1
Hardware:
SoC:      AR9344
CPU:      560 MHz
Flash:    8 MiB
RAM:      128 MiB
WiFi:     Atheros AR9340 2.4GHz 802.11bgn
          Atheros AR9300 5GHz 802.11an
Ethernet: AR934X built-in switch, WAN on separate physical interface
USB:      1x 2.0

Flash instruction (WebUI):
Download *-factory.bin image and upload it via the firmwary upgrade
function of the stock firmware WebUI.

Flash instruction (TFTP):
1. Set PC to fixed ip address 192.168.0.66
2. Download *-factory.bin image and rename it to
   wdr3500v1_tp_recovery.bin
3. Start a tftp server with the image file in its root directory
4. Turn off the router
5. Press and hold Reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time
the firmware should be transferred from the tftp server
8. Wait ~30 second to complete recovery.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[removed stray newline]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Jo-Philipp Wich efaaadb49e sdk: use bundle-libraries.sh to ship kernel objtool tools
Ensure that the kernel objtool utilities are processed by the library
bundler in order to ensure that they're usable on foreign systems with
different libc versions.

Fixes: a9f6fceb42 ("sdk: fix building external modules when CONFIG_STACK_VALIDATION=y")
Acked-by: Yousong Zhou <yszhou4tech@gmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Paul Spooren ac418ddecc bcm53xx: add generic subtarget
Same game as for 853e4dd306. Add generic
to the filenames.

CC: Hauke Mehrtens <hauke@hauke-m.de>

Signed-off-by: Paul Spooren <mail@aparcar.org>
Acked-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
DENG Qingfang 26851f9db2 mvebu: fix Linksys WRT LAN/WAN MAC addresses
According to 02_network, eth0.1 is LAN and eth1.2 is WAN,
but $mac_wan was assigned incorrectly to eth0 in preinit.

Swap eth0 and eth1 to fix this.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
5 years ago
Cong Wang 7735cce0c5 kernel: net_sched: fix a NULL pointer deref in ipt action
The net pointer in struct xt_tgdtor_param is not explicitly
initialized therefore is still NULL when dereferencing it.
So we have to find a way to pass the correct net pointer to
ipt_destroy_target().

The best way I find is just saving the net pointer inside the per
netns struct tcf_idrinfo, which could make this patch smaller.

Fixes: 0c66dc1ea3f0 ("netfilter: conntrack: register hooks in netns when needed by ruleset")
Reported-and-tested-by: Tony Ambardar <itugrok@xxxxxxxxx>
Cc: Jamal Hadi Salim <jhs@xxxxxxxxxxxx>
Cc: Jiri Pirko <jiri@xxxxxxxxxxx>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

[Backport for kernel v4.19 and v4.14]
[Bug Link: https://bugzilla.kernel.org/show_bug.cgi?id=204681]
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
5 years ago
Tomasz Maciej Nowak 0cc87b3bac ath79: image: disable sysupgrade images for routerstations and ja76pf2
Because a bug in handling partial erase blocks in 4.19 kernel, using
sysupgrade images will hard brick devices that use RedBoot bootloader
and have "FIS directory" with "RedBoot config" on the same erase block.
Since flashing the devices from bootloader is safe, and to not cause a
situation where external chip programmer or JTAG is needed, disable
sysupgrade images for affected boards while creating kernel.bin and
rootfs.bin for jjPlus JA76PF2 board, which doesn't have factory image.

To set up the JA76PF2 board follow "Installation" instructions in b3a0c97
("ath79: add support for jjPlus JA76PF2") except the part of loading
initramfs image and using sysupgrade image for flashing (point 6 and 7).
Enter following commands to flash the board from bootloader:
  fis init
  load -r -b 0x80060000 <openwrt_kernel_image_name>
  fis create linux
  load -r -b %{FREEMEMLO} <openwrt_rootfs_image_name>
  fis create rootfs
  fis load -l linux
  exec -c ""

For RouterStations use TFTP recovery procedure.

Ref: FS#2428
Cc: Matt Merhar <mattmerhar@protonmail.com>
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Tomasz Maciej Nowak 0bf6a531c2 ath79: fix FIS partition detection for 4.19 kernel
When bumping to 4.19 the patch responsible for scaning flash for FIS
partition got left out. Without it devices with RedBoot bootloader using
automatic partitions detection in dts won't boot with the new kernel.

Fixes: 3771176 ("ath79: add support for linux 4.19")
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Tomasz Maciej Nowak a45cf75eca ath79: image: add supported string for routerstations and ja76pf2
Now that the md5 check is fixed and metadata present, sysupgrade on
ar71xx will complain about device not being supported by the image.
Since the cause is not matching strings for supported devices add them
accordingly.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Tomasz Maciej Nowak 077d06a1a5 ath79: image: append metadata to routerstations and ja76pf2 images
This target enforces metadata check so add the necessary information. It
was previously removed because md5 sum check. When using these sysupgrade
images on ar71xx target the check would complain about them not matching.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Tomasz Maciej Nowak 8b4109c2b4 ar71xx: sysupgrade: accept ath79 combined-image
There is md5 sum of whole image embedded in combined-image header which
is checked on sysupgrade. The check will fail for ath79 images which
may have embedded metadata. This is because metadata are appended after
the combined image is created. To allow smooth transition from ar71xx to
ath79, strip metadata before calculating md5 sum for whole image.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Tomasz Maciej Nowak 900330ff2f ath79: image: retire combined-image for Adtran/Bluesocket devices
During review it slipped by that these devices use combined-image which
should never be used for newly added ones. Therefore switch to
sysupgrade-tar generated images introduced in 8f6f260 ("ath79:
routerstation: prepare to use sysupgrade-tar format image"). The
sysupgrade accepts both images for now so no reression should occur.

Cc: Brian Gonyer <bgonyer@gmail.com>
Cc: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Tomasz Maciej Nowak c1db564cbc ath79: dts: fix ja76pf2 spi frequency
The frequency was filled acording the information from datasheet for
particular chip (Winbond 25Q128BVFG). Unfortunately this led to
coruption and introduced bad blocks on the chip. Reducing the frequency
to commonly used in ath79, made the board more stable and no new bad
blocks were spoted.

Fixes: b3a0c97 ("ath79: add support for jjPlus JA76PF2")
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
David Bauer 7b137e9df9 ath79: correct OCEDO Ursus phy-mode property
This fixes the previously incorrect phy-mode for the OCEDO Ursus GMAC0.

See 62abbd587d ("ath79: correct various phy-mode properties")
for more details.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler d94a3f328f ipq806x: Replace backticks by $(...)
This replaces deprecated backticks by more versatile $(...) syntax.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Michal Cieslakiewicz dddb43775f ar71xx: WNR2200: remove redundant GPIO for WLAN LED
Without this patch, an extra entry appears for AR9287 GPIO
that duplicates WLAN LED but in fact drives nothing:

gpiochip1: GPIOs 502-511, ath9k-phy0:
 gpio-502 (                    |netgear:blue:wlan   ) out hi
 gpio-503 (                    |netgear:amber:test  ) out hi
 gpio-504 (                    |netgear:green:power ) out lo
 gpio-505 (                    |rfkill              ) in  hi
 gpio-507 (                    |wps                 ) in  hi
 gpio-508 (                    |reset               ) in  hi
 gpio-510 (                    |ath9k-phy0          ) out hi <===!

The pin pointed above is default LED GPIO (8) for AR9287.
For WNR2200 it is not connected anywhere - pin 0 drives blue WLAN
LED instead - but initialization code is missing that information.

This fix calls ap9x_pci_setup_wmac_led_pin() function at device
setup, forcing WLAN LED pin to be 0 and removing redundant entry.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Karl Pálsson 075c570cde ath79: etactica-eg200: fix restore button
The button is labelled reboot/restore in documentation, and has always
been used for that.  Naming it WPS has always been wrong.

Signed-off-by: Karl Pálsson <karlp@etactica.com>
[matched author to SoB]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Christoph Krapp 6cea9688af ramips: add support for Netgear R6260 and R6850
As Netgear uses the same image for R6260, R6350 & R6850
we can merge device tree files and generate separate
images for each device.

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
[add missing WiFi compatible string, fix network
configuration]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Christoph Krapp 3c8df280a9 ramips: add factory image for Netgear R6350
This adds factory image generation for all three
devices. These images can be flashed via WebUI
for easy installation.

Thanks to David Bauer for the inspiration.

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
[altered commit to only include the R6350]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Christoph Krapp 9861fa7aba ramips: add mt7615e support to Netgear R6350
Signed-off-by: Christoph Krapp <achterin@googlemail.com>
5 years ago
David Bauer 13937a16d4 ramips: fix network setup for various NETGEAR boards
There are currently the following issues present for the Netgear R6220,
R6350 and WNDR3700 v5:

 - LAN and WAN MAC-addresses are inverted
 - WAN MAC-address is off. It are +2 compared to the LAN MAC-address
   (R6350 only)
 - Switchport order is inverted in LuCi

This commit fixes both these issues by assigning correct MAC-addresses
to LAN and WAN interfaces and defining the switchports with the correct
labels.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer fa46c9b208 ramips: use phy trigger for various Netgear boards
This commit switches the default trigger for the WiFi LED from a netdev
trigger on "wlan0" to a wireless-phy based trigger. THis allows the LED
to work, even when the wireless interface is not named "wlan0" without
modifiying the LED settings.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 607dfdf211 ramips: add factory image for NETGEAR R6220
This adds an easy-installation factory image for the NETGEAR R6220
router. The factory image can either be flashed via the vendor Web-UI or
the bootloader using nmrpflash.

Tested with NETGEAR V1.1.0.86 firmware.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 527832e54b ramips: disable badblock shifting for MT7621 NAND
The MediaTek MT7621 NAND driver currently intransparently shifts NAND
pages when a block is marked as bad. Because of this, offsets for e.g.
caldata and MAC-addresses seem to be off.

This is, howeer, not a task for the mtd NAND driver, as the flash
translation layer is tasked with this.

This patch disables this badblock shifting. This fix was originally
proposed by Jo-Philipp Wich at
https://bugs.openwrt.org/index.php?do=details&task_id=1926

Fixes FS#1926 ("MTD partition offset not correctly mapped when bad
eraseblocks present")
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Koen Vandeputte db97cb814c kernel: bump 4.19 to 4.19.69
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 071209ed22 kernel: bump 4.14 to 4.14.141
Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
John Crispin 7f9edadf85 mediatek: backport a pcie fix
PCI/e probe was failing under certain situations.

Signed-off-by: John Crispin <john@phrozen.org>
5 years ago
Vladimir Vid bec2df9a66 mvebu: sysupgrade: fix uDPU eMMC check regression
Add udpu_ prefix in all other function names

Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
5 years ago
Álvaro Fernández Rojas 055abe902b brcm2708: remove duplicated patch
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 years ago
Etienne Champetier 7d542dc804 kernel: add disable_eap_hack sysfs attribute
We are not sure if 640-bridge-only-accept-EAP-locally.patch is still needed
as a first step, add disable_eap_hack sysfs config to allow to disable it

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
5 years ago
John Crispin 4685fc0cf1 mediatek: update v4.19 switch support to latest vendor version
Signed-off-by: John Crispin <john@phrozen.org>
5 years ago
Koen Vandeputte 1bc31e0339 kernel: bump 4.19 to 4.19.68
Refreshed all patches.

Remove upstreamed:
- 950-0307-Revert-pwm-Set-class-for-exported-channels-in-sysfs.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte b5407887bc kernel: bump 4.14 to 4.14.140
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 b32c77004c kernel: bump 4.9 to 4.9.190
Refreshed all patches.

Fixes:
- CVE-2019-3900

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Álvaro Fernández Rojas 2876709fb7 brcm2708: fix DMA leaks in bcm2835-mmc
Add patches from https://github.com/raspberrypi/linux/pull/3164

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 years ago
Álvaro Fernández Rojas 2340c646e6 brcm2708: update to latest patches from RPi foundation
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 years ago
Koen Vandeputte 81d0da1186 ar71xx/ath79: ag71xx: dont fetch the same var again
tx_size was just declared above and set to BIT(tx->order)
Use the declaration instead, which could avoid a pointer deref

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte e773838813 ar71xx: ag71xx: use base address value directly from the source
This brings the code more inline with the ath79 flavour

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 19ed799bdc ar71xx: ag71xx: make use of managed dev API simplifying code
Backport of a4eef43a12 ("ath79: ag71xx: replace alloc_etherdev with devm_alloc_etherdev")
combined with the initial changes from John Crispin.

Simplifies the code a lot by using the Managed dev API.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 4d40c0edd4 ar71xx: ag71xx: replace ag71xx_get_phy_if_mode_name with phy_modes()
Backport of f73b2d64ed ("ath79: ag71xx: replace ag71xx_get_phy_if_mode_name() with phy_modes()")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte e18724b907 ar71xx: ag71xx: pass correct device pointer to dma
Backport of 4eaa3626a8 ("ath79: ag71xx: pass correct device pointer to dma functions")

While 4.14 does not contain the warnings,
it still makes sense to use the proper pointers here.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 662922068d ar71xx/ath79: ag71xx: get ring_mask consistent
All other instances of this identical declaration fetch the
value directly from the ring_order.

Also do it here.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte e10b163247 ar71xx: ag71xx: add missing register writes
These are added in ath79, but were not backported here

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

Also add a missing symbol for x86 which got used now in this bump.
- ISCSI_IBFT

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

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

Also add a missing symbol for x86 which got used now in this bump.
- ISCSI_IBFT

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Felix Fietkau c3a78955f3 kernel: move crypto-arc4 into a module
It is no longer required by wireless drivers, so we can save some space here

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Christian Lamparter 94bf2e4813 ipq40xx: drop unreachable ipq-wifi package for the AP120C-AC
Harri Hursti reported that ALFA Network AP120C-AC does not
work anymore due to: "Unknown package 'ipq-wifi-alfa-network_ap120c-ac'."

This patch fixes the issue by removing the stale package from
the device's dependencies as the calibration data is now
provided by the upstream board-2.bin.

Reported-by: Harri Hursti <harri@nordicinnovationlabs.com>
Fixes: 8f757d427c ("ipq-wifi: drop upstreamed custom board-2.bin")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Christian Lamparter 3dc5716b07 ramips: add NAS goodies on U25AWF-H1 + U35[N|W]F
These devices are sold as a "NAS HDD Enclousure"
and have a "NAS Media Streaming & File Server & AP" on
the box. That's why I think they should have some support
for the HDD right out-of-the-box.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Luka Perkov f4500fde1e kernel: refresh patches
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
5 years ago
Vladimir Vid 7dff6a8c89 mvebu: uDPU: add sysupgrade support
This patch adds sysupgrade, uboot-env and networking support
for Methode uDPU device.

Device features 4 partitions:

-----------------------------------------
|  boot   | recovery  | rootfs |  misc  |
| (ext4)  |  (ext4)   | (fsf2) | (f2fs) |
_________________________________________

Idea was to use f2fs only but the u-boot currently lacks support
so first 2 partition are ext4 to be u-boot readable, and this was
a reason why custom build and sysupgrade sections were required.

On the sysupgrade, boot and rootfs partitions are updated, firmare
image and user configuration is saved on the misc partition and if
the upgrade was successfull, recovery partition will be updated on
after the reboot from preinit script. If the sysupgrade fails for any
reason, device will fallback to recovery initramfs image.

Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
5 years ago
Vladimir Vid b8474dc42b kernel: 4.19: backport mx25u12835f support from linux 5.0
Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
5 years ago
Luochongjun 921675a2d1 ath79: add support for gl-ar750
This patch supports gl-ar750, which was previously supported by ar71xx.

Specification:
- SOC: QCA9531 (650MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 10/100: 2xLAN + 10/100: 1xWAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Switch: 1x switch
- Button: 1x reset button
- LED: 3x LEDS (white)

Flash instruction:
Support for sysupgrade directive upgrades, as well as luci upgrades.

Signed-off-by: Luochongjun <luochongjun@gl-inet.com>
5 years ago
Zhenjian Zhang fb3574f123 ramips: add support for ADSLR G7
SoC: MT7621AT
RAM: 256MB
Flash: 16M SPI
Ethernet: 5x GE ports
WiFi: 2.4G: MT7615N
5G: MT7615N

Flash instruction:
1.Modify the file to linux.bin
2.Set up FTP service
3.Computer settings fixed IP: 192.168.179.50 255.255.255.0
4.Turn on the power and press and hold the reset button until the indicator light is on for about 5 seconds.

Signed-off-by: Zhenjian Zhang <itdesk.zhang@gmail.com>
[fix mac location]
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Paul Spooren 853e4dd306 ipqx0xx: add Generic subtarget
Both targets miss a subtarget causing an image naming style which is
different from other all othe targets, even tho it already uses
`x/generic/` as subfolder as if the subtarget would exist.

This commit adds the Generic subtarget resulting in consistent naming.

    ~/src/openwrt/openwrt/bin/targets/ipq806x/generic$ ls
    openwrt-ipq806x-generic-netgear_d7800-initramfs-uImage
    openwrt-ipq806x-generic-netgear-d7800.manifest
    openwrt-ipq806x-generic-netgear_d7800-squashfs-factory.img
    openwrt-ipq806x-generic-netgear_d7800-squashfs-sysupgrade.bin

CC: John Crispin <john@phrozen.org>

Signed-off-by: Paul Spooren <mail@aparcar.org>
5 years ago
Daniel Golle ccf3bac6f3 lantiq: add device alias for Alpha ASL56026
BT Openreach ECI VDSL Modem V-2FUb/I is an alias of Alpha ASL56026 as
also stated in the original commit message adding the device
(commit 6254a2028c "lantiq: add support for the Alpha ASL56026").

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years ago
Adrian Schmutzler 0fcab46f97 lantiq: sort device definitions in image/Makefile
This sorts the device definitions in image/Makefile alphabetically
for each subtarget/block.

The order of blocks has not been touched.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Rafał Miłecki b6f4cd57e1 treewide: sysupgrade: pass "save_partitions" option to the "sysupgrade" method
This explicitly lets stage2 know if partitions should be preserved. No
more "touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap" hack.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Daniel Golle 41f580b596 ramips: add device alias for Allnet ALL0239-3G
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years ago
Paul Spooren 149d1e7a61 ramips/mt76x8: add DEVICE_VENDOR for tl-wr840n-v5
DEVICE_VENDOR is missing for this device.

Signed-off-by: Paul Spooren <mail@aparcar.org>
5 years ago
Moritz Warning fd66687058 lantiq: 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
Christian Lamparter 8f757d427c ipq-wifi: drop upstreamed custom board-2.bin
The BDFs for the:
	ALFA Network AP120C-AC
	ASUS Lyra
	AVM FRITZ!Box 7530
	AVM FRITZ!Repeater 3000
	EnGenius EAP1300
	EnGenius ENS620EXT
	Netgear Orbi Pro SRK60

boards were upstreamed to the ath10k-firmware repository
and linux-firmware.git.

Furthermore the BDFs for the:
	OpenMesh A42 specific BDFs
	OpenMesh A62 specific BDFs
	Linksys EA6350v3
have been updated.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Deng Qingfang fd4804ce33 ramips: add MT7530 switch port-mirroring support
Compile & run tested on MT7620, MT7621

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
[Tested on Phicomm PSG1218 rev.A, MediaTek MT7620A ver:2 eco:6]
Tested-by: MingHao Chen <cmheia@email.com>
5 years ago
Sandeep Sheriker M 552c48ea43 at91/image/sama5.mk: check for sama5d4_xplained device
check for sama5d4_xplained device while copying at91bootstrap binary
to sdcard image.

Signed-off-by: Sandeep Sheriker M <sandeep.sheriker@microchip.com>
5 years ago
Sandeep Sheriker M 05a81abb5f at91: remove Build/at91-sdcard command
remove at91-sdcard build command from Makefile as this is moved to
respective subtarget Makefile.

Signed-off-by: Sandeep Sheriker M <sandeep.sheriker@microchip.com>
5 years ago
Sandeep Sheriker M 575950e376 at91: add uboot environments
add uboot environments to sdcard image

Signed-off-by: Sandeep Sheriker M <sandeep.sheriker@microchip.com>
5 years ago
Sandeep Sheriker M 32d4e4226d at91: move at91-sdcard command to sama5.mk
Signed-off-by: Sandeep Sheriker M <sandeep.sheriker@microchip.com>
5 years ago
Sandeep Sheriker M 0b7c66c93b at91bootstrap: add sama5d27_som1_eksd1_uboot as default defconfig
Signed-off-by: Sandeep Sheriker M <sandeep.sheriker@microchip.com>
5 years ago
Chen Minqiang 51dcde7c9c ramips: fix switch ports settings
This change the switch settings for:
HC5661: 4 lan ports + 1 wan port
Y1S: 2 lan ports(G port) + 2 lan ports(E port) + 1 wan port

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
5 years ago
Chen Minqiang a293db2103 ramips: hc5xxx: use switch trigger for leds
netdev on eth0.2 can't show link status of wan port because eth0 is
connected to builtin switch and is always link up. Use swconfig
trigger instead.

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
[redo commit message]
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Adrian Schmutzler 95dfeabf26 ath79: create DTSI for ar9341 TP-Link devices
This patch creates a shared DTSI for the TP-Link devices based
on ar9341 as those share a lot of definitions.

While at it, change from gpio-keys-polled to gpio-keys, remove
unused pll-data and remove some inherited stuff, too.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Lim Guo Wei e7ab1b5173 ath79: migrate TP-Link TL-MR3420v2 to ath79
Specifications:
- SoC: ar9341
- RAM: 32M
- Flash: 4M
- Ethernet: 5x FE ports
- WiFi: ar9341-wmac

Flash instruction:
Upload generated factory firmware on vendor's web interface.

This changes the key assignment compared to ar71xx support of this
device, since of the two keys on the device one is used as combined
Reset/WPS and the second one as WiFi on/off button.
Despite, the reset button required GPIO_ACTIVE_HIGH to work correctly.

Signed-off-by: Lim Guo Wei <limguowei@gmail.com>
[redo commit message]
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
xixiao zheng 2ada2a5e5b ath79: add support for PISEN TS-D084
PISEN TS-D084 is an wireless router with a battery and integrated power
supply based on Atheros AR9331.

Specification:

- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 1x 10/100 Mbps Ethernet
- 1T1R 2.4 GHz (AR9331)
- 1x USB 2.0

Flash instruction:
 Upload generated factory image through web interface.

Signed-off-by: xixiao zheng <xixiaozheng64@gmail.com>
[wrap commit message, add flash instruction]
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Sungbo Eo 2678ba9093 ramips: add support for ipTIME A604M
ipTIME A604M is a 2.4/5GHz band AC1200 router, based on MediaTek
MT7628AN.

Specifications:
- SoC: MT7628AN
- RAM: DDR2 64MB
- Flash: SPI NOR 8MB
- WiFi:
  - 2.4GHz: SoC internal
  - 5GHz: MT7612EN
- Ethernet: 5x 10/100Mbps
  - Switch: SoC internal
- UART:
  - J1: 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>
5 years ago
Chuanhong Guo 68588e1518 ath79: adtran,bsap1840/bsap1800-v2: move bootcount out of 02_network
These device supports were introduced before /etc/init.d/bootcount and they
had a bootcount reset done in /etc/board.d/02_network.
Move it into /etc/init.d/bootcount instead.

Suggested-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Chuanhong Guo 92e60260d5 treewide: sync bootcount scripts across targets
This commit made the following changes to sync all bootcount scripts:

1. use boot() instead of start()
    This script only needs to be executed once when boot is complete.
    use boot() to make this explicit.

2. drop sourcing of /lib/functions.sh
    This is aready done in /etc/rc.common.

3. ramips: replace board name checking with a case

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Florian Eckert 33411ee919 target/x86/image: use qemu-img from STAGING_DIR_HOST
The host tool package qemu is build for the target x86. The installed tool
qemu-img is needed to build vdi or vmdk images. In the image Makefile we
use however the host installed qemu-img command and not the tool from the
buildsystem. This commit force to use the already build qemu-img command
from the openwrt toolchain.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
5 years ago
Linus Walleij dc451a4b24 gemini: Enable flash boot on reference design type
The flash layout on the Storlink reference design for Gemini
is using 2 MB flash for the kernel, and it also insists on
overwriting the partition table with default values on every
boot. The same is true for the SQ201. This poses a problem
on recent OpenWrt firmware as the base zImage is bigger
than 2 MB.

At the same time there is a ramdisk partition of 6 MB that we
don't really need. The partition table looks like this:

Creating 7 MTD partitions on "30000000.flash":
0x000000000000-0x000000016000 : "BOOT"
0x000000120000-0x000000320000 : "Kern"
0x000000320000-0x000000920000 : "Ramdisk"
0x000000920000-0x000000f20000 : "Application"
0x000000f20000-0x000000f40000 : "VCTL"
0x000000f40000-0x000000fe0000 : "CurConf"
0x000000fe0000-0x000001000000 : "FIS directory"

On boot the "Kern" partition is copied to RAM @0x01600000
and the "Ramdisk" partition is copied to RAM @0x00800000.
Then the kernel is executed.

The idea with this patch is to extend the "Kern" partition
with the "Ramdisk" partition to get a full 8 MB to use
for the kernel. Then we put the OpenWrt JFFS2 rootfs
inside the "Application" partition.

We create a small assembly loop that we prepend to the
"Kern" image that will copy the "Kern" from 0x0160000
and the "Ramdisk" from 0x00800000 and put them in
consecutive space at 0x00400000 and execute it from
there, using "Application" as rootfs.

We generate 3 main files:
- zImage - contains the assembly bootstrap loop and
  the first part of the generated kernel image
- rd.gz - contains the second part of the generated
  kernel image
- hddapp.tgz - contains the root filesystem

On the SQ201 I flash these manually using the native boot
loader PLATO, "Y" alternative for the zImage, "R" for
the rd.gz image and "A" for hddapp.tgz.

This works fine and I can now boot to prompt on the SQ201
with nothing but flash.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years ago
Linus Walleij a608380e42 gemini: Add copy-kernel utility package
This package just contains a small Gemini-only assembler
bootstrap loop to copy the kernel from the two fragments
(previously zImage at 0x01600000 and initramdisk at 0x00800000)
into one big zImage of up to 8 MB at 0x00400000.

It will be built on demand from the Gemini image Makefile.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years ago
Linus Walleij 860d6ce0ce gemini: Fix up flash accesses
The SL93512r and the NAS4220B have Redboot partition
tables (rely on these) and need to boot from mtdblock3.
Add two patches from upstream to fix this.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years ago
Linus Walleij 1eb851143a gemini: Fix up some confused pin config on SL93512r
Upstream patch fixing the errors in the device tree.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years ago
Luis Araneda 87b3203664 zynq: remove kernel 4.14 support
Signed-off-by: Luis Araneda <luaraneda@gmail.com>
5 years ago
Luis Araneda 078848ac01 zynq: switch to kernel 4.19
Use kernel 4.19 by default

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
5 years ago
Luis Araneda d71cac96f3 zynq: k4.19: fix kernel panic on smp bring-up
This fixes a kernel panic when validating the
arguments of memcpy at runtime, which is enabled
by generic's CONFIG_FORTIFY_SOURCE for k4.19

This wasn't triggered on 4.14, as ARCH_HAS_FORTIFY_SOURCE
was added on k4.17 for the ARM architecture

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
5 years ago
Luis Araneda b82edc70ad zynq: kernel: use some configs provided by generic
- Select CONFIG_PREEMPT_NONE (server) instead
  of CONFIG_PREEMPT (low-latency desktop)
- Remove CONFIG_USELIB
- Remove CONFIG_SYSCTL_SYSCALL

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
5 years ago
Luis Araneda 594606592b zynq: add k4.19 config
Copied from kernel 4.14 and refreshed
with make kernel_oldconfig

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
5 years ago
Klaus Kudielka 4b5df88f1c mvebu: sysupgrade: sdcard: fix platform_do_upgrade_sdcard
Unconditionally execute the final case statement, even if the disk layout
changed. This is necessary, to keep the original Turris Omnia flash
instructions working: The disk layout WILL change, when switching from
TurrisOS to OpenWRT. Without updating the uboot environment at the same
time, the user would end up with an unbootable system.

Fixes commit 2e5a0b81ec ("mvebu: sysupgrade: sdcard: keep user added ...")

Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
5 years ago
Jonas Gorski 812bad9b13 brcm63xx: do not build images for 16 MiB RAM devices by default
OpenWrt will run out of RAM while booting with the default package set,
so let's not provide images that will likely fail. They can still be
built manually through source or IB if needed.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
5 years ago
David Bauer 3032bf7f89 lantiq: unify Fritz!Box LED mappings
This commit unifies the LED mapping of the AVM Fritz!Box routers, which
have a combined Power/DSL LED.

With the stock firmware, the Power LED has the following
characteristics:

 - Blink when DSL sync is being established
 - Solid when DSL sync is present

We can't completely resemble this behavior in OpenWrt. Currently, the
Power LED is completely off, when DSL sync is missing. This is not
really helpful, as a user might have the impression, that he bricked his
device.

Instead, map the Info-LED to the state of the DSL connection.
There is no consistent behavior for the Info-LED in the stock
firmware, as the user can set it's function by himself. The DSL
connection state is one possible option for the Info LED there.

Also use the red Power LED to indicate a running upgrade, in case the
board has a two-color Power LED.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler 894bdee756 ath79: remove SUPPORTED_DEVICES for TP-Link Archer D50 v1
This device has not been supported in ar71xx, so there is no need
for an explicit SUPPORTED_DEVICES entry.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
David Bauer 84c103509a ath79: use Power LED as System LED for TL-WR842Nv3
The TP-Link TL-WR842N v3 has a software-controllable Power LED. The WPS
LED is normally only used as a System LED, when the Power LED can't be
controlled by software.

Additionally, the Power LED is also the System LED for this board in
ar71xx.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer a6f85b81b7 ipq40xx: fix AVM NAND caldata extraction
The AVM Fritz!Box 7530 (and probably other AVM IPQ4019 NAND devices)
has it's caldata not stored consistently, but instead at currently
3 known possible offsets.

As we get a non-zero exit code from fritz_cal_extract, simply try all
three possible offsets on both bootloader partitions, until a matching
caldata for each radio is found.

Reported-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Koen Vandeputte c9dc0e1bdf kernel: bump 4.19 to 4.19.66
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 873a8c5078 kernel: bump 4.14 to 4.14.138
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 c141508525 kernel: bump 4.9 to 4.9.189
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 b133e466b0
treewide: convert WiFi caldata size and offset to hexadecimal
This changes size and offset set for WiFi caldata extraction and
MAC address adjustment to hexadecimal notation.

This will be much clearer for the reader when numbers are big, and
will also match the style used for mtd-cal-data in DTS files.

Since dd cannot deal with hexadecimal notation, one has to convert
back to decimal by simple $(($hexnum)).

Acked-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 75bfc393ba treewide: convert MAC address location offsets to hexadecimal
This changes the offsets for the MAC address location in
mtd_get_mac_binary* and mtd_get_mac_text to hexadecimal notation.

This will be much clearer for the reader when numbers are big, and
will also match the style used for mtd-mac-address in DTS files.

(e.g. 0x1006 and 0x5006 are much more useful than 4102 and 20486)

Acked-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Paul Spooren 07926d7def imagebuilder: fix `make info` for empty SUPPORTED_DEVICES
For x86/64 (maybe more) target the SUPPORTED_DEVICES variable is empty
which causes the `&&` junction to fail, producing a non zero exit code.

Tested-by: Paul Spooren <mail@aparcar.org>
Fixed-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Paul Spooren <mail@aparcar.org>
5 years ago
Adrian Schmutzler 32144ba275 ath79: update DTS for TP-Link WDR3600/WDR4300 v1
This replaces gpio-export by gpio-hogs and switches buttons
to interrupt-driven gpio-keys.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Felix Fietkau 7ec092e641 Revert faulty tree push
Revert "mac80211: add new minstrel_ht patches to improve probing on mt76x2" (9861050b85)
Revert "kernel: use bulk free in kfree_skb_list to improve performance" (98b654de2e)
Revert "ramips: add preliminary support for WIO ONE" (085141dc5b)
Revert "ramips: add preliminary support for SGE AP-MTKH7-0006 developer board" (b1db6d0539)
Revert "build: use config.site generated by autoconf-lean, drop hardcoded sitefiles" (363ce4329d)
Revert "toolchain: add autoconf-lean" (fdb30eed03)
Revert "build: allow overriding the filename on the remote server when downloading" (6fa0e07758)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Felix Fietkau 98b654de2e kernel: use bulk free in kfree_skb_list to improve performance
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Felix Fietkau 085141dc5b ramips: add preliminary support for WIO ONE
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Felix Fietkau b1db6d0539 ramips: add preliminary support for SGE AP-MTKH7-0006 developer board
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Petr Štetiar 200f2666fb sdk: fix GCC and Python dangling symlinks
Force prereq again in SDK in order to fix GCC and Python dangling
symlinks:

 staging_dir/host/bin/g++ -> /builder/ath79_generic/ccache_cxx.sh
 staging_dir/host/bin/gcc -> /builder/ath79_generic/ccache_cc.sh
 staging_dir/host/bin/python -> /usr/bin/python3.5
 staging_dir/host/bin/python3 -> /usr/bin/python3.5

Ref: FS#2424
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Davide Fioravanti 0891358e4b ramips: fix lan and wan mac addresses for Cudy WR1000
Lan and Wan addresses are swapped compared to the original firmware.
This patch fixes this problem

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
5 years ago
David Bauer 920abb9b58 lantiq: add led-upgrade alias for Fritz!Box 7412
This adds the led-upgrade alias for the AVM Fritz!Box 7412 to indicate a
running firmware upgrade.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 891a700759 lantiq: enable second VPE on Fritz!Box 7412
The AVM Fritz!Box 7412 does not use the VMMC part of the Lantiq chip but
rather a proprietary solution based on the DECT chip for the FXS ports.

Therefore, the second VPE can be enabled for use with OpenWrt.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer c12947b39e lantiq: correct Fritz!Box 7412 button logic level
The AVM FRITZ!Box 7412 buttons are both active low, which is currently
incorrectly defined in the device-tree.

This leads to the device booting directly into failsafe.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler da0de5e007 ramips: fix LED labels not updated during device name changes
In commit d93969a13a ("ramips: Improve compatible for TP-Link
Archer devices") and subsequent ones, names of several devices
in ramips have been changed.
Since LED names are frequently invoked by $boardname, this has
broken LED setup in 01_leds, as $boardname and prefix in DTS
do not match anymore.

This patch updates device name prefixes for LEDs in DTS files,
and provides a migration script.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Ozgur Can Leonard d7c082ba4f ramips: add kmod-mt7615e to Xiaomi Mi Router 3 Pro images
Now that the mt76/mt7615e driver is in Openwrt, might as well use it.

Signed-off-by: Ozgur Can Leonard <ozgurcan@gmail.com>
5 years ago
Adrian Schmutzler 296affa359 ath79: add missing IMAGE_SIZE for Comfast WR650AC v1/v2
When adding support in 9ed272fe95 ("ath79: add support for
Comfast WR650AC v1/v2"), IMAGE_SIZE has not been added to device
definition.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Koen Vandeputte 2a08bf3656 ar71xx: ag71xx: init rings with GFP_KERNEL
ar71xx got lost during final rebase ..

Fixes: b417a0c48d ("ar71xx/ath79: ag71xx: init rings with GFP_KERNEL")
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte b417a0c48d ar71xx/ath79: ag71xx: init rings with GFP_KERNEL
Upstream commit	246902bdf562d45ea3475fac64c93048a7a39f01

Which contains following explanation:

--
There is no need to use GFP_ATOMIC here, GFP_KERNEL should be enough.
The 'kcalloc()' just a few lines above, already uses GFP_KERNEL.
--

Looking at the code, all other descriptors also use plain GFP_KERNEL

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 6ced31c320 ar71xx/ath79: ag71xx: fix sleep in atomic
When enabling atomic-sleep-debugging options in the kernel,
following splat is seen when disabling the interface (which happens on boot):

[   10.892878] eth0: link down
[   10.896788] BUG: sleeping function called from invalid context at net/core/dev.c:5563
[   10.904730] in_atomic(): 1, irqs_disabled(): 1, pid: 425, name: ip
[   10.911004] 2 locks held by ip/425:
[   10.914539]  #0:  (rtnl_mutex){....}, at: [<80377474>] rtnetlink_rcv_msg+0x2d8/0x380
[   10.922441]  #1:  (&(&ag->lock)->rlock){....}, at: [<80330158>] ag71xx_hw_disable+0x24/0x94
[   10.930976] CPU: 0 PID: 425 Comm: ip Not tainted 4.14.136 #0
[   10.936716] Stack : 805e0000 80589228 80557404 876998ec 80610000 80610000 87cdcafc 805b5327
[   10.945233]         80551534 000001a9 8061386c 87699ccc 87cfb180 00000001 876998a0 84f70903
[   10.953751]         00000000 00000000 80b00000 8769979c 6a7407fa 00000000 00000007 00000000
[   10.962270]         000000b7 16d0954a 000000b6 00000000 80000000 87cb658c 87cb65b0 00000001
[   10.970787]         8046f97c 87699ccc 87cfb180 87ff2810 00000003 802ce724 0806e098 80610000
[   10.979306]         ...
[   10.981797] Call Trace:
[   10.984287] [<8006cb0c>] show_stack+0x58/0x100
[   10.988814] [<800aab34>] ___might_sleep+0x100/0x120
[   10.993774] [<8035c434>] napi_disable+0x30/0xd8
[   10.998377] [<80330198>] ag71xx_hw_disable+0x64/0x94
[   11.003418] [<8033069c>] ag71xx_stop+0x24/0x38
[   11.007959] [<80359e30>] __dev_close_many+0xcc/0x104
[   11.013009] [<80362eac>] __dev_change_flags+0xc8/0x1ac
[   11.018227] [<80362fb8>] dev_change_flags+0x28/0x70
[   11.023182] [<80376890>] do_setlink+0x31c/0x91c
[   11.027786] [<80379360>] rtnl_newlink+0x3ec/0x7f8
[   11.032563] [<80377498>] rtnetlink_rcv_msg+0x2fc/0x380
[   11.037799] [<8039a734>] netlink_rcv_skb+0xd4/0x178
[   11.042754] [<80399d10>] netlink_unicast+0x168/0x250
[   11.047796] [<8039a2d4>] netlink_sendmsg+0x3d8/0x434
[   11.052841] [<8033f0e4>] ___sys_sendmsg+0x1dc/0x290
[   11.057794] [<80340140>] __sys_sendmsg+0x54/0x84
[   11.062495] [<8007212c>] syscall_common+0x34/0x58

This is caused by calling napi_disable() while holding the spinlock.

Fix it by omitting the spinlock, which is not required here
Extensively tested on GL-MiFi, RB-912 and RB-922 hardware

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 697658e220 kernel: bump 4.19 to 4.19.65
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 f5acf56483 kernel: bump 4.14 to 4.14.137
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 6e4d590990 kernel: bump 4.9 to 4.9.188
Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
David Bauer cad1b474d9 ath79: fix identation errors in 01_leds
Fix the identation of 01_leds to keep the style of the file consistent.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler c2716758c5 ath79: add missing IMAGE_SIZE for Comfast E314N-v2
When adding support in abbbecaa73 ("ath79: add support for
Comfast E314N-v2"), IMAGE_SIZE has not been added to device
definition.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 2758dd332c ath79: fix whitespace errors from adding D-Link DIR-842 C3
We completely overlooked whitespace errors when reviewing
796ad2f7ef ("ath79: add support for D-Link DIR-842 C3").

Fix them and and also fix Makefile indent for C1/C2.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Joan Moreau 9ed272fe95 ath79: add support for Comfast WR650AC v1/v2
This is a dual band 11a/11n router with 1x wan and 4x gig lan ports.

There are two versions of this router which can be identified through
the factory web interface, v1 has 128mb ram and a uboot size of 128k,
v2 has 256mb ram and a uboot size of 256k, the remaining hardware and
PCB markings are the same.

Short specification:

    SoC: Qualcomm Atheros QCA9558 - 720 MHz
    Switch: Atheros AR8327
    Second radio : Qualcomm Atheros QCA9880 802.11ac
    4 LAN/1 WAN 1000Mps Ethernet
    256 MB of RAM (DDR2)
    16 MB of FLASH
    3x2.4 GHz, 3x5GHz antennas

Steps to install :

Option A : Use vendor UI

Option B (if A is not working) :
(a) Download 'backup' from vendor UI and rename it backup.tar.gz
(b) Open the archive, and update the root password in /etc/shadow by
    '$1$9wX3HGfB$X5Sb3kqzzBLdKRUR2kfFd0'
(c) 'Restore' from the archive using the vendor UI. Root password is now
    'aaa'
(d) Scp the firwmware to the device:
    $ scp <openwrt-sysupgrade>.bin root@192.168.1.1:/
(d) ssh to the device and flash the firmware:
    $ cd /
    $ mtd -e firmware -r write <openwrt-sysupgrade>.bin firmware

Signed-off-by: Gareth Parker <gareth41@orcon.net.nz>
Signed-off-by: Ding Tengfei <dtf@comfast.cn>
Signed-off-by: Joan Moreau <jom@grosjo.net>
[reformatted commit message]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Álvaro Fernández Rojas d8c62c4029 brcm2708: bcm2711: remove unneeded boot file
bootcode.bin isn't needed for RPi 4B since it's stored on a SPI-attached EEPROM.
More info: https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 years ago
Joan Moreau abbbecaa73 ath79: add support for Comfast E314N-v2
Taken code from https://patchwork.ozlabs.org/patch/884850/ that was never
pushed by the author, and adapted to ath79.

The Comfast E314N-V2 is a 2.4 GHz 2x2 radio with a built-in directional
antenna and a second Ethernet port - very similar to the Ubiquiti
NanoStation M2. The Ethernet port features a pass-through PoE capability,
enabled or disabled with a slide switch.

Specifications :
- System-On-Chip: Qualcomm/Atheros QCA9531
- CPU/Speed: 650 MHz
- Flash size: 8 MiB
- RAM: 64 MiB
- 2 Ethernet 1Gbp
- 1 reset button
- 1 switch to choose PoE from LAN or Wan. 48Vdc
- Wifi 2.4 Ghz (b/g/n)
- UART inside the box (3.3V, pins marked on the PCB)

Firmware can be flashed on these units by the following method:
1.) Apply power to the unit
2.) Immediately AFTER applying power, hold down the reset button
3.) The WAN, LAN, and wireless lights will flash - wait three seconds
    (three flashes) and then release the button.
4.) After a second, the lights will flutter quickly and the unit will be
    visible at 192.168.1.1. A web page will be available to enable quick
    and simple uploading and flashing of firmware.

During the boot process, these units also look for a tftp server at
192.168.1.10. If one is present, the firmware can be uploaded as a file
called firmware-auto.bin

Signed-off-by: Joan Moreau <jom@grosjo.net>
[wrapped commit message - fix commit title capitalization]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
DENG Qingfang d3e832d6fd ramips: add support for HiWiFi HC5761A
HiWiFi HC5761A is an "MT7628AN variant" of HC5761

Specifications:
- MediaTek MT7628AN 580MHz
- 128 MB DDR2 RAM
- 16 MB SPI Flash
- 2.4G MT7628AN 802.11bgn 2T2R 300Mbps
- 5G MT7610EN 802.11ac 433Mbps
- 3x 10/100 Mbps Ethernet

Flash instruction:
1. Get SSH access to the router
2. SSH to router with `ssh -p 1022 root@192.168.199.1`, The SSH password is the same as the webconfig one
3. Upload OpenWrt sysupgrade firmware into the router's `/tmp` folder with SCP
4. Run `mtd write /tmp/<filename> firmware`
5. reboot

Known bug:
- SD slot does not work (See PR 1500)

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
5 years ago
DENG Qingfang 9852859e77 ramips: improve support for HiWiFi HC5661A and HC5861B
HC5661A:
- Fix pinctrl
- Fix image size (15808k)
- Use switch trigger for WAN LED

Both:
- Use tpt LED trigger for wireless
- Explicitly disable USB nodes

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
5 years ago
DENG Qingfang 521fcd0e8b ramips: add HC5X61A.dtsi for HiWiFi MT7628AN boards
HiWiFi has several MT7628AN routers which have similar specs
Add HC5X61A.dtsi to include them, like HC5X61.dtsi (for MT7620A)

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
5 years ago
Chuanhong Guo 4d5dae2741 ath79: add support for PISEN WMB001N
Specifications:
- SoC: AR9341
- RAM: 64M
- Flash: 16M
- Ethernet: 1 * FE port
- WiFi: ar934x-wmac
- Sound: WM8918 DAC
         1 * 3.5mm headphone jack
         2 * RCA connectors for speakers
         1 * SPDIF out
- USB: 1 * USB2.0 port

Flash instruction:
 Upload generated factory image via vendor's web interface.

Notes:
A. Audio stuff:
 1. Since AR934x, all pins for peripheral blocks can be mapped to
    any available GPIOs. We currently don't have a PCM/I2S driver
    for AR934x so pinmux for i2s and SPDIF are bound to i2c gpio
    node. This should be moved into I2S node when a PCM/I2S driver
    is available.
 2. The i2c-gpio node is for WM8918. DT binding for it can't be added
    currently due to a missing clock from I2S PLL.

B. Factory image:
 Image contains a image header and a tar.gz archive.
 1. Header: A 288 byte header that has nothing to do with appended
    tarball. Format:
     0x0-0x7 and 0x18-0x1F: magic values
     0x20: Model number string
     0xFC: Action string. It's either "update" or "backup"
     0x11C: A 1 byte checksum. It's XOR result of 0x8-0x11B
    Firmware doesn't care about the rest of the header as long as
    checksum result is correct.
    The same header is used for backup and update routines so the
    magic values and model number can be obtained by generating a
    backup bin and grab values from it.
 2. Tarball: It contains two files named uImage and rootfs, which
    will be flashed into corresponding mtd partition.
 Writing a special utility that can only output a fixed binary
 blob is overkill so factory image header is placed under
 image/bin instead.

C. LED
 The wifi led has "Wi-Fi" marked on the case but vendor's firmware
 used it as system status indicator. I did the same in this device
 support patch.

D. Firmware
 Factory u-boot is built without 'savenv' support so it's impossible
 to change kernel offset. A 2MB kernel partition won't be enough in
 the future. OKLI loader is used here to migrate this problem:
  1. add OKLI image magic support into uImage parser.
  2. build an OKLI loader, compress it with lzma and add a normal
     uImage header.
  3. flash the loader to where the original kernel supposed to be.
  4. create a uImage firmware using OKLI loader.
  5. flash the created firmware to where rootfs supposed to be.
 By doing so, u-boot will start OKLI loader, which will then load
 the actual kernel at 0x20000.

 The kernel partition is 2MB, which is too much for our loader.
 To save this space, "mtd-concat" is used here:
  1. create a 64K (1 erase block) partition for OKLI loader and
     create another partition with the left space.
  2. concatenate rootfs and this partition into a virtual flash.
  3. use the virtual flash for firmware partition.

 Currently OKLI loader is flashed with factory image only.
 sysupgrade won't replace it. Since it only has one function
 and it works for several years, its unlikely to have some bugs
 that requires a replacement.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Chuanhong Guo 1d6368ee73 kernel: mtdsplit_uimage: add support for okli image
This adds support for uImage used by OpenWrt kernel loader.
The parser searches for uImage header at flash eraseblock boundary
and it might attempt to split any firmware with loader, therefore
this entry doesn't have MTD_PARSER_TYPE_FIRMWARE so that this parser
is only used when explicitly defined in dts.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Perry Melange 796ad2f7ef ath79: add support for D-Link DIR-842 C3
Hardware spec of DIR-842 C3:
SoC: QCA9563
DRAM: 128MB DDR2
Flash: 16MB SPI-NOR
Switch: QCA8337N
WiFi 5.8GHz: QCA9888
WiFi 2.4Ghz: QCA9563
USB: circuit onboard, but components are not soldered

Flash instructions:

1. Upgrade the factory.bin through the factory web interface or
   the u-boot failsafe interface.
   The firmware will boot up correctly for the first time.
   Do not power off the device after OpenWrt has booted.
   Otherwise the u-boot will enter failsafe mode as the checksum
   of the firmware has been changed.
2. Upgrade the sysupgrade.bin in OpenWrt.
   After upgrading completes the u-boot won't complain about the
   firmware checksum and it's OK to use now.
3. If you powered off the device before upgrading the sysupgrade.bin,
   just upgrade the factory.bin through the u-boot failsafe interface
   and then goto step 2.

Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
5 years ago
Adrian Schmutzler d7b4b5ec24 ath79: fix vendor capitalization of TP-Link
According to detective grep, with this patch all devices should
be labelled "TP-Link" consistently.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 854ab1b045 ath79: add support for TP-Link CPE220 v2
This seems to be identical to CPE210 v1 despite having removable
antennas.

Specifications:

    * SoC: Qualcomm Atheros AR9344 (560 MHz)
    * RAM: 64MB
    * Storage: 8 MB
    * Wireless: 2.4GHz N based built into SoC 2x2
    * Ethernet: 2x 100/10 Mbps, integrated into SoC, 24V POE IN

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 0104eed1e5 ath79: add support for TP-Link CPE510 v1
TP-Link CPE510-v1 is an outdoor wireless CPE for 5 GHz with
two Ethernet ports based on Atheros AR9334

Specifications:
 - 560/450/225 MHz (CPU/DDR/AHB)
 - 2x 10/100 Mbps Ethernet, 1x PoE-in, 1x PoE-out
 - 64 MB of DDR2 RAM
 - 8 MB of SPI-NOR Flash
 - 2T2R 5 GHz
 - 13 dBi built-in antenna
 - Power, LAN0, LAN1 green LEDs
 - 4x green RSSI LEDs

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

Based on the work of Paul Wassi <p.wassi@gmx.at>

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 08857e69be ath79: add support for TP-Link CPE210 v1
Specifications:

    * SoC: Qualcomm Atheros AR9344 (560 MHz)
    * RAM: 64MB
    * Storage: 8 MB
    * Wireless: 2.4GHz N based built into SoC 2x2
    * Ethernet: 2x 100/10 Mbps, integrated into SoC, 24V POE IN

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 198eae2862 ath79: create common definition tplink-loader-okli
The loader-okli is shared by several TP-Link CPExxx devices, so
give it its own definition to prevent too much code duplication.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 9ba83c450c ath79: provide common DTSI for CPE510 v2/v3 and CPE610
This puts some common code into a new shared DTSI. Common nodes
are chosen so that the new DTSI can be used for CPE210 v1, too.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 8d83a4f545 tplink-safeloader: increase kernel partition for CPE/WBSx10v1
This is a preparation for ath79 support of the CPE210/CPE510 v1.
Kernel size is chosen equal to the latest update for CPE610 v1.

This also updates the partition size in ar71xx target, so code
remains consistent if someone looks up the device. Since CPE210,
CPE510, WBS210 and WBS510 (all v1) share the same partition
layout definition, and are on deprecated target anyway, this
changes them all at once.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Rafał Miłecki c4492dd70e kernel: drop Fon(Foxconn) parser matching for the "firmware" partition
This parser's matching function appears to be too generic as it matches
e.g. Buffalo WZR-HP-G300NH. That results in incorrect parts parsing.

Luckily this parser is needed by Fon FON2601 only which uses DT-based
ramips target. It means we can depend on mtd subsystem matching of
"fonfxc,uimage" string.

That said triggering this parser based on the "firmware" (or whatever
MTD_SPLIT_FIRMWARE_NAME is) partiiton name is not needed. It can be
dropped which will automatically fix the Buffalo WZR-HP-G300NH case.

Fixes: a1c6a316d2 ("ramips: add support for Fon FON2601")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Koen Vandeputte 42d9bccadb kernel: bump 4.19 to 4.19.64
Refreshed all patches.

Remove upstreamed:
- 100-powerpc-4xx-uic-clear-pending-interrupt-after-irq-ty.patch
- 950-0309-usb-dwc2-Disable-all-EP-s-on-disconnect.patch
- 950-0310-usb-dwc2-Fix-disable-all-EP-s-on-disconnect.patch

Fixes:
- CVE-2019-13648
- CVE-2019-3900
- CVE-2019-10207

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

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

Altered patches:
- 306-v4.16-netfilter-remove-saveroute-indirection-in-struct-nf_.patch

Remove upstreamed:
- 100-powerpc-4xx-uic-clear-pending-interrupt-after-irq-ty.patch
- 088-0002-i2c-qup-fixed-releasing-dma-without-flush-operation.patch
- 500-arm64-dts-marvell-Fix-A37xx-UART0-register-size.patch

Fixes:
- CVE-2019-13648
- CVE-2019-10207

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

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

Altered patches:
- 021-bridge-multicast-to-unicast.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
John Crispin 274895a8d7 mediatek: add new dts files for mt7622 to v4.14
Signed-off-by: John Crispin <john@phrozen.org>
5 years ago
Rafał Miłecki 4b755ce06a Revert "kernel: generic: fix fonfxc uimage parser"
This reverts commit e92a14709d.

mtdsplit_uimage_parse_fonfxc() gets called in two situations:
1) It was /requested/ from DT using "fonfxc,uimage" compatible string
2) It was called by parsing code after finding "firmware"
   (MTD_SPLIT_FIRMWARE_NAME) due to the parser's type

Code added in the /fix/ commit basically just disabled the second case.
If that's the real goal it could be achieved by simply dropping type
MTD_PARSER_TYPE_FIRMWARE. It may however require another solution as
it's possible that some non-DT target actually needs fonfxc uImage
parsing.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
John Crispin 19cfbb1b34 mediatek: update the mt7531 switch driver
Signed-off-by: John Crispin <john@phrozen.org>
5 years ago
Tomasz Maciej Nowak 427ff0cd26 mvebu: remove support for deprecated DSA bindings
These legacy bindings were removed long time ago from dts, so there's no
need to keep support for them.

Spotted-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Tomasz Maciej Nowak 2dca43b871 mvebu: enable xHCI USB controller connected to PCIe
This commit fixes regression on Linksys WRT1900 (Mamba) where this device
doesn't have USB 3.0 controller integrated in SoC, instead it has Etron
EJ168 connected to PCIe lane. Previously enabled in kernel 4.4 and 4.9,
was lost in transition to 4.14.

Fixes: 4ccad92 ("mvebu: Add support for kernel 4.14")
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Tomasz Maciej Nowak d6b585eb4e kernel: drop mvebu support in kmod-usb3
This is already enabled as kernel built-in feature in mvebu target and
none other target will use it.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
David Bauer a3a2b4857e mpc85xx: correct OCEDO Panda LED definition
WLAN0 and the unused LED are currently swapped. Fix this, so the LED
behavior matches the other OCEDo devices.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler c02b9818a5 ath79: add support for TP9343-based TP-Link TL-WR94x devices
This adds support for several TP-Link devices based on TP9343
("a QCA9561 without PCIe and USB"):
- TL-WR940N v3
- TL-WR940N v4
- TL-WR941ND v6

The devices are only different concerning LEDs and MAC address
assignment.

All TL-WR940 are with non-detachable antennas (N), all
TL-WR941 devices are with detachable antennas (ND).

Specification:
- 750 MHz CPU
- 32 MB of RAM
- 4 MB of FLASH
- 2.4 GHz WiFi
- 4x 10/100 Mbps Ethernet

Flash instruction (WebUI):
Download *-factory.bin image and upload it via the firmwary upgrade
function of the stock firmware WebUI.

Flash instruction (TFTP):
1. Set PC to fixed ip address 192.168.0.66
2. Download *-factory.bin image and rename it to * (see below)
3. Start a tftp server with the image file in its root directory
4. Turn off the router
5. Press and hold Reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time
the firmware should be transferred from the tftp server
8. Wait ~30 second to complete recovery.

* TFTP image names:
940 v3: wr941ndv6_tp_recovery.bin
940 v4: wr940nv4_tp_recovery.bin
941 v6: wr941ndv6_tp_recovery.bin

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Jackson Lim 030fc6ab6c ath79: add support for D-Link DIR-842 C1
Hardware spec of DIR-842 C1:
SoC: QCA9563
DRAM: 128MB DDR2
Flash: 16MB SPI-NOR
Switch: QCA8337N
WiFi 5.8GHz: QCA9888
WiFi 2.4Ghz: QCA9563
USB: circuit onboard, but components are not soldered

Flash instructions:

1. Upgrade the factory.bin through the factory web interface or
   the u-boot failsafe interface.
   The firmware will boot up correctly for the first time.
   Do not power off the device after OpenWrt has booted.
   Otherwise the u-boot will enter failsafe mode as the checksum
   of the firmware has been changed.
2. Upgrade the sysupgrade.bin in OpenWrt.
   After upgrading completes the u-boot won't complain about the
   firmware checksum and it's OK to use now.
3. If you powered off the device before upgrading the sysupgrade.bin,
   just upgrade the factory.bin through the u-boot failsafe interface
   and then goto step 2.

Signed-off-by: Jackson Lim <jackcolentern@gmail.com>
[fix whitespace issues]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler 7ed643d205 ath79: add SUPPORTED_DEVICES for TP-Link TL-WR841N/ND v9 to v12
In ar71xx, v10 and v12 did not have separate board_name.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 8b76c6695b ath79: add support for TP-Link TL-WR841N/ND v12
This router has the same hardware as TP-LINK TL-WR841N/ND v11 (same
FCC ID, same TFTP image name...).

Flash instruction (WebUI):
Download *-factory.bin image and upload it via the firmwary upgrade
function of the stock firmware WebUI.

Flash instruction (TFTP):
1. Set PC to fixed ip address 192.168.0.66
2. Download *-factory.bin image and rename it to wr841nv11_tp_recovery.bin
   (it's really v11, not v12)
3. Start a tftp server with the image file in its root directory
4. Turn off the router
5. Press and hold Reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time
the firmware should be transferred from the tftp server
8. Wait ~30 second to complete recovery.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 4254193c1d ath79: add support for TP-Link TL-WR841N/ND v10
The TL-WR841N/ND v10 is mostly identical to the v9. Apart from some minor
changes, it contains a newer revision of the QCA9533 SoC and the CPU clock
is significantly higher.

Flash instruction (WebUI):
Download *-factory.bin image and upload it via the firmwary upgrade
function of the stock firmware WebUI.

Flash instruction (TFTP):
1. Set PC to fixed ip address 192.168.0.66
2. Download *-factory.bin image and rename it to wr841nv10_tp_recovery.bin
3. Start a tftp server with the image file in its root directory
4. Turn off the router
5. Press and hold Reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time
the firmware should be transferred from the tftp server
8. Wait ~30 second to complete recovery.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Leon M. George c070662980 ar71xx: wpj531: fix SIG1/RSS1 LED GPIO
In commit 6c937df749 ("ar71xx: wpj531: fix GPIOs for LED") wrong GPIO
13 for SIG1/RSS1 LED was commited, the correct GPIO number for this LED
is 12.

It's listed in "Hardware Guide - wpj531 7A06 (02/07/2019)" as GPIO12/RSS1
on the LED header and same GPIO 12 is used in the vendor's SDK as well.

Fixes: 6c937df749 ("ar71xx: wpj531: fix GPIOs for LED")
Signed-off-by: Leon M. George <leon@georgemail.eu>
[commit subject/message facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
NOGUCHI Hiroshi e92a14709d kernel: generic: fix fonfxc uimage parser
We cannot distinguish between fonfxc uImage and generic uImage because
fonfxc uImage header is almost same as generic uImage, except padding
length after image name.

The fonfxc uImage parser is available when specifying directly with DT
compatible property.  So this patch adds check if the partition DT node
is compatible with the parser.

Ref: https://bugs.openwrt.org/index.php?do=details&task_id=2413
Fixes: a1c6a316d2 ("ramips: add support for Fon FON2601")
Signed-off-by: NOGUCHI Hiroshi <drvlabo@gmail.com>
[commit light touches and removed C code comment]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Jeffery To 6e300f6a0c sdk: Fix cryptodev-linux build when CONFIG_ARM64_MODULE_PLTS=y
When CONFIG_ARM64_MODULE_PLTS=y, arch/arm64/kernel/module.lds is
required to build cryptodev-linux. This updates the sdk to include this
file.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
5 years ago
Moritz Warning a8098607af brcm2708: split up DEVICE_TITLE
Splits up DEVICE_TITLE into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT.

Fixes https://github.com/openwrt/openwrt/pull/2245

Signed-off-by: Moritz Warning <moritzwarning@web.de>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 years ago
Álvaro Fernández Rojas abdd9539d1 brcm2708: fix warnings due to non-breaking space
Reported by ZWx4 on Github:
19226502bf (r34555799)

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 years ago
Adrian Schmutzler efe09ef67f mediatek: fix typo in Banana Pi R64 device title
The DEVICE_TITLE introduced in 66458c49aa ("mediatek: add
v4.19 support") is mistyped. Fix it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Álvaro Fernández Rojas 32788e685f brcm2708: arm8stub is no longer needed
It's already embedded on latest RPi firmware.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 years ago
Álvaro Fernández Rojas d34d461dbf brcm2708: clean up target configs
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 years ago
Christian Lamparter 6825b4ca95 ipq40xx: remove redundant PHY_POLL set code
The [devm_]mdiobus_alloc[_size()] functions are creating
the array of interrupt numbers as well as initializing
them to POLLING.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Christian Lamparter fd58035a8e ipq40xx: decouple mdio-ipq40xx and ar40xx
This makes it possible to delete the ar40xx driver in the
future by just removing the file.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Christian Lamparter ef4bea0b51 ipq40xx: extend DT mdio node to be more accessible
The MDIO node will become more important in the future.
Hence, this patch adds DT labels to make the properties
inside the various subnodes more accessible.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Moritz Warning 6933f2bc1d
at91: split up DEVICE_TITLE
DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years ago
Moritz Warning 62db9ce1c4 apm821xx: split up DEVICE_TITLE
Splits up DEVICE_TITLE into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years ago
Moritz Warning 2afb3a56f1 ipq806x: split up DEVICE_TITLE
DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years ago
Moritz Warning 3bef16bb30 bcm53xx: split up DEVICE_TITLE
DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years ago
Moritz Warning c1bf5d5432 gemini: split up DEVICE_TITLE
DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years ago
Moritz Warning d07a263ae6 octeon: split up DEVICE_TITLE
Splits up DEVICE_TITLE into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years ago
Álvaro Fernández Rojas 5e928acf22 brcm2708: add bcm2711 subtarget (RPi 4B aarch64)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 years ago
Álvaro Fernández Rojas 00813d4dd9 brcm2708: remove linux 4.14 support
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 years ago
Álvaro Fernández Rojas 19226502bf brcm2708: update to latest patches from the RPi foundation
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 years ago
John Crispin 66458c49aa mediatek: add v4.19 support
Bump the target to v4.19. Add a patch with additional eth driver
fixes/features that MTK provided aswell as the driver for the new mt7530
switch.

Signed-off-by: John Crispin <john@phrozen.org>
5 years ago
David Bauer cb49e46a8a ar71xx: fix HiveAP 121 PLL for 1000M
The Aerohive HiveAP 121 has the wrong PLL value set for Gigabit speeds,
leading to packet-loss. 10M and 100M work fine.

This commit sets the Gigabit Ethernet PLL value to the correct value,
fixing packet loss.

Confirmed with iperf and floodping.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Koen Vandeputte 845b2a1cfe ar71xx: really fix Mikrotik board detection
commit e09da0169a ("ar71xx: fix Mikrotik board detection")
was generated based on testing a rb-912 board, on which detection failed.

Testing on more hardware shows something fun:

machine	: MikroTik RouterBOARD 922UAGS-5HPacD
machine	: Mikrotik RouterBOARD 912UAG-5HPnD

Both lowercase and uppercase are used.
So ensure we support both now ..

Fixes: e09da0169a ("ar71xx: fix Mikrotik board detection")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte a56cbe379b kernel: fix typo in replaced symbol
Looks like a copy/paste error ..

Fixes: a89b49bca4ec ("kernel: bump 4.19 to 4.19.62")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 1d2b2e744e ar71xx: fix nand init issues on some rb2011 devices
While flashing lots of RB2011 devices, I noticed that
some of them refused to boot properly, failing over the NAND parameters.

Checking in detail shows that some device seem to use another NAND flash
which only support standard 2048-byte pages, without 512-byte subpage support.

This commit disables usage of these small subpage completely.

Advantages:
- Both NAND's with(out) subpage support are working now
- The nand speed increases a bit (measured roughly 1%) in typical usecases

Disadvantages:
- The maximum storage capacity decreases by ~0.2%
as small changes can consume a full page (2048 bytes) now.

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

Remove upstreamed:
- 023-0013-crypto-crypto4xx-fix-AES-CTR-blocksize-value.patch
- 023-0014-crypto-crypto4xx-fix-blocksize-for-cfb-and-ofb.patch
- 023-0015-crypto-crypto4xx-block-ciphers-should-only-accept-co.patch
- 950-0252-staging-bcm2835_camera-Ensure-all-buffers-are-return.patch
- 950-0253-staging-bcm2835-camera-Remove-check-of-the-number-of.patch
- 950-0254-staging-bcm2835-camera-Handle-empty-EOS-buffers-whil.patch
- 950-0489-staging-mmal-vchiq-Replace-spinlock-protecting-conte.patch
- 0021-ARM-dts-gemini-Fix-up-DNS-313-compatible-string.patch
- 049-v4.20-mips-remove-superfluous-check-for-linux.patch
- 100-MIPS-fix-build-on-non-linux-hosts.patch
- 303-MIPS-Fix-bounds-check-virt_addr_valid.patch
- 0002-usb-dwc2-use-a-longer-AHB-idle-timeout-in-dwc2_core_.patch

Altered patches:
- 950-0267-staging-vc04_services-Split-vchiq-mmal-into-a-module.patch
- 700-net-add-qualcomm-mdio-and-phy.patch

Fixes:
- CVE-2019-3846

New symbol:
- AX88796B_PHY

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

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

Remove upstreamed:
- 049-v4.20-mips-remove-superfluous-check-for-linux.patch
- 303-MIPS-Fix-bounds-check-virt_addr_valid.patch

Fixes:
- CVE-2019-3846
- CVE-2019-3900

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

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

Fixes:
- CVE-2019-3846

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 27df621505 imx6: bump SDMA firmware to 3.5
- add uart rom script address in header of sdma firmware to support
  the uart driver of latest kernel working well while old firmware
  assume ram script used for uart driver as NXP internal legacy
  kernel.
- add multi-fifo SAI/PDM scripts.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Piotr Dymacz 5e9086b7b1 ath79: fix SOC version in compat string for A770
YunCore A770 is based on QCA9531, not QCA9533.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Roger Pueyo Centelles 334bbc5198 ath79: add support for ALFA Network AP121F
This commit ports support for the ALFA Network AP121F, a pocket-size
router with 1 Ethernet and 2.4 GHz WiFi based on the AR9331 SoC, to the
ath79 target (it was already supported in ar71xx; see commit 0c6165d2
for more details).

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
[pepe2k@gmail.com: fixed GPIO polarity, included USB support, changed
DTS nodes order, moved WLAN LED trigger define to DTS, made U-Boot env
partition writable]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Johann Neuhauser c3c3cd5e4a lantiq: use wpad-basic for boards with enough storage
This commit selects wpad-basic for the FRITZ!Box 7312 and 7412 as
wpad-mini is only selected on boards with small flash.

Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
[add short description]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler a421f33316 ath79: fix indent in TP-Link TL-WR842N v3 DTS file
Convert leading spaces to tab to match rest of the file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Kevin Darbyshire-Bryant 4dcef8263e Revert "kmod-sched-cake: drop out of tree package, use kernel version"
This reverts commit 5c094ff660.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
5 years ago
Koen Vandeputte e09da0169a ar71xx: fix Mikrotik board detection
Fix a typo in the machine type being extracted from /proc/cpuinfo
which causes all Mikrotik board to be undetected properly.

This lead to sysupgrade issues and probably some others too.

Fixes: acf2b6c888 ("ar71xx: base-files: fix board detect on new MikroTik devices")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
NOGUCHI Hiroshi a1c6a316d2 ramips: add support for Fon FON2601
FON2601 is a wireless router.

Specification:
- SoC: Mediatek MT7620A (580MHz)
- RAM: 128 MiB
- ROM: 16 MiB SPI Flash
- Wireless:
   for 11b/g/n (upto 300 Mbps):  MT7620A built-in WMAC
   for 11a/n/ac (upto 867 Mbps): MT7662E
- Ethernet LAN: 1 port, upto 100 Mbps
- Ethernet WAN: 1 port, upto 1000 Mbps
- USB: 1 port (USB 2.0 host)
- LEDs: 4 (all can be controlled by SoC's GPIO)
- buttons: 1 (Displayed as "WPS" on enclosure)
- serial port: 57600n8
 pins: Vcc(3.3V), Rx, Tx, GND
(left to right, viewed from outside of board)

Installation (only available via UART):
  1. download sysupgrade binary image by wget command
  2. write sysupgrade binary image to Flash
     command is:
       mtd write sysupgrade.bin firmware
  3. reboot

Important Notice:
  Only one button is displayed as "WPS" on enclosure.
  However, it is configured as "reset" (factory resetting feature).

Signed-off-by: NOGUCHI Hiroshi <drvlabo@gmail.com>
[removed unrelated openwrt-keyring revert, missing -Wall for uimage_padhdr]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
David Bauer 5897b2be21 ath79: remove lines-initial-states property
The lines-initial-states property was an early attempt to set the latch
bit of the shift register on driver probe. It is not implemented in the
driver and was rejected upstream. The latch bit was always set by a GPIO
hog, so this property is safe to drop.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Chuanhong Guo 679a01f34e ramips: drop an empty case in 02_network
There's an empty case in 02_network introduced by last commit. Drop it.

Fixes: ee650ba46c ("ramips: remove needless setting of lan_mac to eth0 in 02_network")
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Adrian Schmutzler ee650ba46c ramips: remove needless setting of lan_mac to eth0 in 02_network
This removes superfluous lines like
lan_mac=$(cat /sys/class/net/eth0/address)

Since lan_mac only sets the MAC address for eth0.1, these lines
can be safely removed as the address will be inherited from eth0
anyway.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler f72d2ba60a ramips: consistently use lower-case factory partition label
The vast majority of devices labels "factory" partition with lower
case. Convert the small fraction with capital letter to that and
merge another case in 02_network.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler ee5fce887a ramips: consolidate MAC address cases in 02_network
This just merges some duplicate definitions and consolidates lines.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com> [merge duplicated
cases for phicomm k2p]
5 years ago
Adrian Schmutzler f14a5c3f2f ramips: use kiB instead of B for IMAGE_SIZE
This cosmetical patch is just meant to make comparing/checking
IMAGE_SIZE values easier.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 9d87a58d34 ramips: remove ralink_default_fw_size_xxx variables
There are frequent examples of the ralink_default_fw_size_xxx
variables being used to "roughly" set flash size without caring
about the actual size of the firmware partition.

To discourage this behavior, this patch removes the variables and
just sets IMAGE_SIZE by its numeric value for each target.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 363197311b ramips: remove default IMAGE_SIZE for ramips target
Currently, ramips target defines 0x7b0000 as default IMAGE_SIZE
for all devices in ramips target, i.e. this will be set if a
device does not specify IMAGE_SIZE itself.

From 92 devices using that default due to a "missing" IMAGE_SIZE,
14 were incorrect by a small amount (i.e. still "8M" flash) and
12 were completely off ("16M", "4M", ...).

This patch thus removes the _default_ IMAGE_SIZE and defines
IMAGE_SIZE for each device individually. This should indicate to
people supporting new devices that this parameter has to be cared
about.

For the present code, this patch is cosmetical.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 24ded1810b ramips/rt305x: fix IMAGE_SIZE for all devices
This fixes IMAGE_SIZE for all devices based on the partition size
given in DTS:

DEVICE                       *.MK    *.DTS     VERDICT
7links_px-4885-4m            (4M)    0x3b0000
7links_px-4885-8m            -       0x7b0000  default
8devices_carambola           -       0x7b0000  default
accton_wr6202                -       0x7b0000  default
airlive_air3gii              (4M)    0x3b0000
alfa-network_w502u           -       0x7b0000  default
allnet_all0256n-4m           (4M)    0x3b0000
allnet_all0256n-8m           -       0x7b0000  default
allnet_all5002               32448k  0x1fb0000
allnet_all5003               32448k  0x1fb0000
alphanetworks_asl26555-16m   15872k  0xf80000
alphanetworks_asl26555-8m    7744k   0x790000
arcwireless_freestation5     -       0x7b0000  default
argus_atp-52b                7808k   0x7a0000
asiarf_awapn2403             (4M)    0x3b0000
asiarf_awm002-evb-4m         (4M)    0x3b0000
asiarf_awm002-evb-8m         -       0x7b0000  default
asus_rt-g32-b1               (4M)    0x3b0000
asus_rt-n10-plus             (4M)    0x3b0000
asus_rt-n13u                 -       0x7b0000  default
asus_wl-330n                 (4M)    0x3b0000
asus_wl-330n3g               (4M)    0x3b0000
aximcom_mr-102n              -       0x790000  wrong
aztech_hw550-3g              -       0x7b0000  default
belkin_f5d8235-v2            7744k   0x790000
belkin_f7c027                7616k   0x770000
buffalo_whr-g300n            3801088 0x3a0000
dlink_dap-1350               7488k   0x750000
dlink_dcs-930                (4M)    0x3b0000
dlink_dcs-930l-b1            (4M)    0x3b0000
dlink_dir-300-b1             (4M)    0x3b0000
dlink_dir-300-b7             (4M)    0x7b0000  wrong
dlink_dir-320-b1             -       0x7b0000  default
dlink_dir-600-b1             (4M)    0x3b0000
dlink_dir-610-a1             (4M)    0x3b0000
dlink_dir-615-d              (4M)    0x3b0000
dlink_dir-615-h1             (4M)    0x3b0000
dlink_dir-620-a1             -       0x7b0000  default
dlink_dir-620-d1             -       0x7b0000  default
dlink_dwr-512-b              7800k   0x7e0000  wrong
easyacc_wizard-8800          -       0x7b0000  default
edimax_3g-6200n              3648k   0x390000
edimax_3g-6200nl             3648k   0x390000
engenius_esr-9753            (4M)    0x3b0000
fon_fonera-20n               -       0x7b0000  default
hame_mpr-a1                  (4M)    0x3b0000
hame_mpr-a2                  -       0x7b0000  default
hauppauge_broadway           7744k   0x790000
hilink_hlk-rm04              -       0x3b0000  wrong
hootoo_ht-tm02               -       0x7b0000  default
huawei_d105                  (4M)    0x3b0000
huawei_hg255d                15744k  0xf60000
intenso_memory2move          -       0x7b0000  default
jcg_jhr-n805r                (4M)    0x3b0000
jcg_jhr-n825r                (4M)    0x3b0000
jcg_jhr-n926r                (4M)    0x3b0000
mofinetwork_mofi3500-3gn     -       0x7b0000  default
netcore_nw718                3712k   0x3a0000
netgear_wnce2001             (4M)    0x350000  wrong
nexaira_bc2                  -       0x7b0000  default
nexx_wt1520-4m               (4M)    0x3b0000
nexx_wt1520-8m               -       0x7b0000  default
nixcore_x1-16m               16064k  0xfb0000
nixcore_x1-8m                7872k   0x7b0000
olimex_rt5350f-olinuxino     -       0x7b0000  default
olimex_rt5350f-olinuxino-evb -       0x7b0000  default
omnima_miniembplug           -       0x7b0000  default
omnima_miniembwifi           -       0x7b0000  default
petatel_psr-680w             (4M)    0x3b0000
planex_mzk-dp150n            (4M)    0x3b0000
planex_mzk-w300nh2           3648k   0x390000
planex_mzk-wdpr              -       0x680000  wrong
poray_ip2202                 -       0x7b0000  default
poray_m3                     (4M)    0x3b0000
poray_m4-4m                  (4M)    0x3b0000
poray_m4-8m                  -       0x7b0000  default
poray_x5                     -       0x7b0000  default
poray_x8                     -       0x7b0000  default
prolink_pwh2004              -       0x7b0000  default
ralink_v22rw-2x2             (4M)    0x3b0000
sitecom_wl-351               (4M)    0x3b0000
skyline_sl-r7205             (4M)    0x3b0000
sparklan_wcr-150gn           (4M)    0x3b0000
teltonika_rut5xx             -       0xfb0000  wrong
tenda_3g150b                 (4M)    0x3b0000
tenda_3g300m                 (4M)    0x3b0000
tenda_w150m                  (4M)    0x3b0000
tenda_w306r-v2               (4M)    0x3b0000
trendnet_tew-638apb-v2       (4M)    0x3b0000
trendnet_tew-714tru          -       0x7b0000  default
unbranded_a5-v11             (4M)    0x3b0000
unbranded_wr512-3gn-4m       (4M)    0x3b0000
unbranded_wr512-3gn-8m       -       0x7b0000  default
unbranded_xdx-rn502j         (4M)    0x3b0000
upvel_ur-326n4g              (4M)    0x3b0000
upvel_ur-336un               -       0x7b0000  default
vocore_vocore-16m            16064k  0xfb0000
vocore_vocore-8m             7872k   0x7b0000
wansview_ncs601w             -       0x7b0000  default
wiznet_wizfi630a             (16M)   0xfb0000
zorlik_zl5900v2              -       0x7b0000  default
zyxel_keenetic               (4M)    0x3b0000
zyxel_keenetic-start         (4M)    0x3b0000
zyxel_nbg-419n               (4M)    0x3b0000
zyxel_nbg-419n-v2            (8M)    0x7b0000

No verdict means that the device is correctly set.

Legend:
( ): Value is set via ralink_default_fw_size_xxM
[ ]: Value is derived from parent definition
 - : Value is not set and derived from default definition

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 1c611f1617 ramips/rt288x,rt3883: fix IMAGE_SIZE for all devices
This fixes IMAGE_SIZE for all devices based on the partition size
given in DTS:

DEVICE                 *.MK    *.DTS      VERDICT
airlink101_ar670w      (4M)    0x3c0000   wrong
airlink101_ar725w      -       0x3B0000   wrong
asus_rt-n15            (4M)    0x3b0000
belkin_f5d8235-v1      7744k   0x7b0000   wrong
buffalo_wli-tx4-ag300n (4M)    0x3b0000
buffalo_wzr-agl300nh   (4M)    0x3b0000
dlink_dap-1522-a1      3801088 0x3a0000
ralink_v11st-fe        (4M)    0x003b0000

asus_rt-n56u           -       0x007b0000 default
belkin_f9k1109v1       7224k   0x7a0000   wrong
dlink_dir-645          -       0x7b0000   default
edimax_br-6475nd       7744k   0x00790000
loewe_wmdr-143n        -       0x7b0000   default
omnima_hpm             16064k  0x00fb0000
samsung_cy-swr1100     -       0x7b0000   default
sitecom_wlr-6000       7244k   0x713000
trendnet_tew-691gr     -       0x007b0000 default
trendnet_tew-692gr     -       0x007b0000 default

No verdict means that the device is correctly set.

Legend:
( ): Value is set via ralink_default_fw_size_xxM
[ ]: Value is derived from parent definition
 - : Value is not set and derived from default definition

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 439435f59b ramips/mt76x8: fix IMAGE_SIZE for all devices
This fixes IMAGE_SIZE for all devices based on the partition size
given in DTS:

DEVICE                       *.MK   *.DTS     VERDICT
alfa-network_awusfree1       (8M)   0x7b0000
buffalo_wcr-1166ds           -      0x7c0000  wrong
cudy_wr1000                  (8M)   0x7b0000
d-team_pbr-d1                (16M)  0x0fb0000
duzun_dm06                   -      0x7b0000  default
glinet_gl-mt300n-v2          16064k 0xfb0000
glinet_vixmini               7872k  0x7b0000
hilink_hlk-7628n             (32M)  0x1fb0000
hiwifi_hc5661a               (16M)  0xf70000  wrong
hiwifi_hc5861b               15808k 0xf70000
mediatek_linkit-smart-7688   (32M)  0x1fb0000
mediatek_mt7628an-eval-board (4M)   0x7b0000  wrong
mercury_mac1200r-v2          -      0x7c0000  wrong
netgear_r6120                15744k 0xf60000
onion_omega2                 (16M)  0xfb0000
onion_omega2p                (32M)  0x1fb0000
rakwireless_rak633           -      0x7b0000  default
skylab_skw92a                16064k 0xfb0000
tama_w06                     15040k 0xeb0000
totolink_lr1200              7872k  0x7b0000
tplink_archer-c20-v4         7808k  0x7a0000
tplink_archer-c50-v3         7808k  0x7a0000
tplink_archer-c50-v4         7616k  0x770000
tplink_tl-mr3020-v3          7808k  0x7a0000
tplink_tl-mr3420-v5          7808k  0x7a0000
tplink_tl-wa801nd-v5         7808k  0x7a0000
tplink_tl-wr802n-v4          7808k  0x7a0000
tplink_tl-wr840n-v4          7808k  0x7a0000
tplink_tl-wr840n-v5          3904k  0x3d0000
tplink_tl-wr841n-v13         7808k  0x7a0000
tplink_tl-wr841n-v14         3968k  0x3e0000
tplink_tl-wr842n-v5          7808k  0x7a0000
tplink_tl-wr902ac-v3         7808k  0x7a0000
unielec_u7628-01-128m-16m    16064k 0xfb0000
vocore_vocore2               (16M)  0xfb0000
vocore_vocore2-lite          (16M)  0x7b0000  wrong
wavlink_wl-wn570ha1          (8M)   0x7b0000
wavlink_wl-wn575a3           (8M)   0x7b0000
widora_neo-16m               (16M)  0x0fb0000
widora_neo-32m               (32M)  0x1fb0000
wiznet_wizfi630s             (32M)  0x1fb0000
wrtnode_wrtnode2p            (16M)  0x1fb0000 wrong
wrtnode_wrtnode2r            (16M)  0x1fb0000 wrong
xiaomi_mir4a-100m            14976k 0xea0000
xiaomi_miwifi-nano           (16M)  0xfb0000
zbtlink_zbt-we1226           (8M)   0x7b0000
zyxel_keenetic-extra-ii      14912k 0xe90000

No verdict means that the device is correctly set.

Legend:
( ): Value is set via ralink_default_fw_size_xxM
[ ]: Value is derived from parent definition
 - : Value is not set and derived from default definition

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 7263838e69 ramips/mt7621: fix IMAGE_SIZE for all devices
This fixes IMAGE_SIZE for all devices based on the partition size
given in DTS:

DEVICE                     *.MK     *.DTS     VERDICT
afoundry_ew1200            (16M)    0xfb0000
asiarf_ap7621-001          (16M)    0xfa0000  wrong
buffalo_wsr-1166dhp        (16M)    0xf90000  wrong
buffalo_wsr-600dhp         (16M)    0xfb0000
dlink_dir-860l-b1          (16M)    0xfb0000
d-team_newifi-d2           (32M)    0x1fb0000
d-team_pbr-m1              (16M)    0xfb0000
elecom_wrc-1167ghbk2-s     15488k   0xf20000
elecom_wrc-1900gst         11264k   0xb00000
elecom_wrc-2533gst         11264k   0xb00000
firefly_firewrt            (16M)    0xfb0000
gehua_ghl-r-001            (32M)    0x1fb0000
gnubee_gb-pc1              (32M)    0x1fb0000
gnubee_gb-pc2              (32M)    0x1fb0000
hiwifi_hc5962              (32M)    0x2000000 wrong (kernel + ubi)
iodata_wn-ax1167gr         15552k   0xf30000
iodata_wn-gx300gr          7798784  0x770000
lenovo_newifi-d1           (32M)    0x1fb0000
linksys_re6500             -        0x7b0000  default
mediatek_ap-mt7621a-v60    (8M)     0x7b0000
mediatek_mt7621-eval-board (4M)     0xec0000  wrong (rootfs)
mikrotik_rb750gr3          [16128k] 0xfc0000
mikrotik_rbm11g            [16128k] 0xFC0000
mikrotik_rbm33g            [16128k] 0xFC0000
mqmaker_witi-256m          (16M)    0xfb0000
mqmaker_witi-512m          (16M)    0xfb0000
mtc_wr1201                 16000k   0xfa0000
netgear_ex6150             14848k   0xe80000
netgear_r6220              28672k   0x1c00000
netgear_r6350              40960k   0x2800000
netgear_wndr3700-v5        15232k   0xee0000
netis_wf-2881              129280k  0x7E40000
phicomm_k2p                15744k   0xf60000
planex_vr500               66453504 0x3fb0000 wrong
samknows_whitebox-v8       (16M)    0xfb0000
storylink_sap-g3200u3      -        0x7b0000  default
telco-electronics_x1       16064k   0xfb0000
thunder_timecloud          -        0xfb0000  wrong
totolink_a7000r            16064k   0xfb0000
tplink_re350-v1            6016k    0x5e0000
ubiquiti_edgerouterx       -        0xfa00000 wrong (kernel1 + ubi)
ubiquiti_edgerouterx-sfp   -        0xfa00000 wrong (kernel1 + ubi)
unielec_u7621-06-256m-16m  16064k   0xfb0000
unielec_u7621-06-512m-64m  65216k   0x3fb0000
wevo_11acnas               (16M)    0xfb0000
wevo_w2914ns-v2            (16M)    0xfb0000
xiaomi_mir3g               32768k   0x7980000 wrong (kernel + ubi)
xiaomi_mir3p               (32M)    0xf980000 wrong (kernel + ubi)
xzwifi_creativebox-v1      (32M)    0x1fb0000
youhua_wr1200js            16064k   0xfb0000
youku_yk-l2                (16M)    0xfb0000
zbtlink_zbt-we1326         (16M)    0xfb0000
zbtlink_zbt-we3526         (16M)    0xfb0000
zbtlink_zbt-wg2626         (16M)    0xfb0000
zbtlink_zbt-wg3526-16m     (16M)    0xfb0000
zbtlink_zbt-wg3526-32m     (32M)    0x1fb0000

No verdict means that the device is correctly set.

Legend:
( ): Value is set via ralink_default_fw_size_xxM
[ ]: Value is derived from parent definition
 - : Value is not set and derived from default definition

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 7009f407f1 ramips/mt7620: fix IMAGE_SIZE for all devices
This fixes IMAGE_SIZE for all devices based on the partition size
given in DTS:

DEVICE                     *.MK     *.DTS      VERDICT
aigale_ai-br100            7936k    0x7c0000
alfa-network_ac1200rm      16064k   0xfb0000
alfa-network_tube-e4g      16064k   0xfb0000
asus_rp-n53                -        0x7b0000   default
asus_rt-ac51u              (16M)    0xfb0000
asus_rt-n12p               -        0xfb0000   wrong
asus_rt-n14u               -        0xfb0000   wrong
bdcom_wap2100-sk           15808k   0xf70000
buffalo_whr-1166d          15040k   0xfb0000   wrong
buffalo_whr-300hp2         6848k    0x7b0000   wrong
buffalo_whr-600d           6848k    0x7b0000   wrong
buffalo_wmr-300            -        0x7b0000   default
comfast_cf-wr800n          -        0x7b0000   default
dlink_dch-m225             6848k    0x6b0000
dlink_dir-510l             -        0xde0000   wrong
dlink_dir-810l             6720k    0x690000
dlink_dwr-116-a1           -        0x7e0000   wrong
dlink_dwr-118-a1           -        0xfe0000   wrong
dlink_dwr-118-a2           -        0xfe0000   wrong
dlink_dwr-921-c1           (16M)    0xfe0000   wrong
dlink_dwr-921-c3           [(16M)]  0xfe0000   wrong
dlink_dwr-922-e2           (16M)    0xfe0000   wrong
dovado_tiny-ac             -        0x7b0000   default
edimax_br-6478ac-v2        7616k    0x00790000 wrong
edimax_ew-7476rpc          7744k    0x00790000
edimax_ew-7478ac           7744k    0x00790000
edimax_ew-7478apc          7744k    0x00790000
elecom_wrh-300cr           (16M)    0xdf0000   wrong
glinet_gl-mt300a           (16M)    0xf80000   wrong
glinet_gl-mt300n           (16M)    0xf80000   wrong
glinet_gl-mt750            (16M)    0xf80000   wrong
head-weblink_hdrm200       16064k   0xfb0000
hiwifi_hc5661              15872k   0xf80000
hiwifi_hc5761              15872k   0xf80000
hiwifi_hc5861              15872k   0xf80000
hnet_c108                  16777216 0xfb0000   wrong
iodata_wn-ac1167gr         6864k    0x6b4000
iodata_wn-ac733gr3         6992k    0x6d4000
kimax_u25awf-h1            16064k   0xfb0000
kimax_u35wf                16064k   0xfb0000
kingston_mlw221            15744k   0xf60000
kingston_mlwg2             15744k   0xf60000
lava_lr-25g001             -        0xfe0000   wrong
lenovo_newifi-y1           (16M)    0xfb0000
lenovo_newifi-y1s          (16M)    0xfb0000
linksys_e1700              -        0x7b0000   default
microduino_microwrt        16128k   0xfc0000
netgear_ex2700             (4M)     0x3b0000
netgear_ex3700             7744k    0x790000
netgear_wn3000rp-v3        -        0x7b0000   default
nexx_wt3020-4m             (4M)     0x3b0000
nexx_wt3020-8m             -        0x7b0000   default
ohyeah_oy-0001             (16M)    0xfb0000
phicomm_k2g                7552k    0x760000
phicomm_psg1208            -        0x7b0000   default
phicomm_psg1218a           -        0x7b0000   default
phicomm_psg1218b           -        0x7b0000   default
planex_cs-qr10             -        0x7b0000   default
planex_db-wrt01            -        0x7b0000   default
planex_mzk-750dhp          -        0x7b0000   default
planex_mzk-ex300np         -        0x730000   wrong
planex_mzk-ex750np         -        0x730000   wrong
ralink_mt7620a-evb         -        0x7b0000   default
ralink_mt7620a-mt7530-evb  -        0x7b0000   default
ralink_mt7620a-mt7610e-evb -        0x7b0000   default
ralink_mt7620a-v22sg-evb   -        0x7f80000  wrong
ravpower_wd03              (8M)     0x7b0000
sanlinking_d240            (16M)    0xfb0000
sercomm_na930              20m      0x1400000
tplink_archer-c20i         -        0x7a0000   wrong
tplink_archer-c20-v1       -        0x7a0000   wrong
tplink_archer-c2-v1        -        0x7a0000   wrong
tplink_archer-c50-v1       -        0x7a0000   wrong
tplink_archer-mr200        -        0x7b0000   default
vonets_var11n-300          (4M)     0x3b0000
wrtnode_wrtnode            (16M)    0xfb0000
xiaomi_miwifi-mini         (16M)    0xf80000   wrong
youku_yk1                  (32M)    0x1fb0000
yukai_bocco                -        0x7b0000   default
zbtlink_we1026-5g-16m      16777216 0xfb0000   wrong
zbtlink_zbt-ape522ii       -        0xf80000   wrong
zbtlink_zbt-cpe102         -        0x760000   wrong
zbtlink_zbt-wa05           -        0x760000   wrong
zbtlink_zbt-we2026         -        0x760000   wrong
zbtlink_zbt-we826-16m      (16M)    0xfb0000
zbtlink_zbt-we826-32m      (32M)    0x1fb0000
zbtlink_zbt-we826-e        32448k   0x1fb0000
zbtlink_zbt-wr8305rt       -        0x7b0000   default
zte_q7                     -        0x7b0000   default
zyxel_keenetic-omni        -        0x7b0000   default
zyxel_keenetic-omni-ii     -        0x7b0000   default
zyxel_keenetic-viva        16064k   0xfb0000

No verdict means that the device is correctly set.

Legend:
( ): Value is set via ralink_default_fw_size_xxM
[ ]: Value is derived from parent definition
 - : Value is not set and derived from default definition

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler a6cd311b0b ramips: support IMAGE_SIZE in kiB for Build/trx
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 7392af7520 ramips: fix ralink_default_fw_size_16M
In ramips, there are the following predefined values for IMAGE_SIZE
ralink_default_fw_size_4M    3866624   3776k   0x3B0000
ralink_default_fw_size_8M    8060928   7872k   0x7B0000
ralink_default_fw_size_16M  16121856  15744k   0xF60000
ralink_default_fw_size_32M  33226752  32448k  0x1FB0000

Out of those, the "16M" value is obviously odd, as it provides more
room for the remaining partitions than the tree others.
Of the devices in all subtargets, there are actually > 50 that have
a firmware partition with 0xFB0000 size, while only 5 (!) have
0xF60000. From the former, many are set to
ralink_default_fw_size_16M anyway, although it is wrong at the
present point.

Consequently, it makes sense to change ralink_default_fw_size_16M
to 0xFB0000, and to update IMAGE_SIZE for the 5 devices with
0xF60000.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler b9cf1f6081 ramips/rt305x: fix firmware partition size for some 4MB devices
allnet_all0256n-4m, tenda_w150m and unbranded_wr512-3gn-4m have
their firmware partition set to reg = <0x50000 0x3c8000>.

However, based on the 4MB flash, the size should be 0x3b0000.

After some research in the target's history, it looks like the
changed size has been a mistake when transferring device
partitions from Makefile to DTS in 770b28f146.

This patch changes the named three devices back to 0x3b0000.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Chuanhong Guo f30d588460 ramips: fix mac addresses used by Phicomm K2P
Like most mt7621 boards, Phicomm K2P stores LAN/WAN mac addresses
at 0xe000/0xe006 of factory partition.
Phicomm uses lan_mac-1 as wan_mac, while our default case in 02_network
uses lan_mac+1.

Add a special case reading lan/wan mac address for Phicomm K2P.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Roger Pueyo Centelles 7d684b7673 ramips: add kmod-mt7615e to Phicomm K2P images
Now that the mt76 driver supports the MT7615D chip found on these
devices, use it.

Also add the wpad-basic package.

Note: the driver supports operation on both the 2.4 GHz and the
      5 GHz bands, but not yet concurrently.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
5 years ago
Kevin Darbyshire-Bryant dba5a01358 kernel: netfilter add connmark savedscp support
savedscp is a method of storing the DSCP of an ip packet into conntrack
mark.  In combination with a suitable tc filter action (conndscp but may
end up being integrated into connmark) DSCP values are able to be stored
on egress and restored on ingress across links that otherwise alter or
bleach DSCP.

This is useful for qdiscs such as CAKE which are able to shape according
to policies based on DSCP.

Ingress classification is traditionally a challenging task since
iptables rules haven't yet run and tc filter/eBPF programs are pre-NAT
lookups, hence are unable to see internal IPv4 addresses as used on the
typical home masquerading gateway.

The ingress problem is solved by the tc filter, but the tc people didn't
like the idea of tc setting conntrack mark values, though they are ok
with reading conntrack values and hence restoring DSCP from conntrack
marks.

x_tables CONNMARK with the new savedscp action solves the problem of
storing the DSCP to the conntrack mark.

It accepts 2 parameters.  The mark is a 32bit value with usually one 1
bit set.  This bit is set when savedscp saves the DSCP to the mark.
This is useful to implement a 'one shot'
iptables based classification where the 'complicated' iptables rules are
only run once to classify the connection on initial (egress) packet and
subsequent packets are all marked/restored with the same DSCP.  A mark
of zero disables the setting of a status bit/s.

The mask is a 32bit value of at least 6 contiguous bits and represents
the area where the DSCP will be stored.

e.g.

iptables -A QOS_MARK_eth0 -t mangle -j CONNMARK --savedscp-mark 0xfc000000/0x01000000

Would store the DSCP in the top 6 bits of the 32bit mark field, and use
the LSB of the top byte as the 'DSCP has been stored' marker.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
5 years ago
Tomislav Požega 65762cdd22 ar71xx: fix WLAN LED names for Archer C7
Update WLAN LED colour identifier for both interfaces on Archer C7

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
5 years ago