Commit Graph

22082 Commits (d3c0a944059bb0d45c3b56278249100258378b0c)

Author SHA1 Message Date
Yong-hyu Ban 99dd2709b8 ramips: add support for ipTIME A8004T
ipTIME A8004T is a 2.4/5GHz band AC2600 router, based on Mediatek
MT7621A.

Specifications:
- SoC: MT7621A
- RAM: DDR3 256M
- Flash: SPI NOR 16MB
- WiFi:
  - 2.4GHz: MT7615E
  - 5GHz: MT7615E
- Ethernet: 5x 10/100/1000Mbps
  - Switch: SoC internal
- USB: 1 * USB3.0 port
- UART:
  - J4: 3.3V, TX, RX, GND (3.3V is the square pad) / 57600 8N1
- Other info:
  - J9: Unknown unpopulated header.

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: Yong-hyu Ban <perillamint@quendi.moe>
[do not enable xhci node in DTS which is already enabled in DTSI]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 8fc25d8664 ramips: add label MAC address for Netgear EX6130
The MAC address on the label of this device corresponds to the
2.4 GHz and ethernet MAC address.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Jack Chen 4be271a486 ramips: remove duplicate dts nodes of MediaTek LinkIt Smart 7688
There are two identical wmac nodes in the dts file of MediaTek
LinkIt Smart 7688, so delete one of them.

Signed-off-by: Jack Chen <redchenjs@live.com>
4 years ago
Mason Clarke 6fba88de19 ramips: reduce lzma dictionary size for D-Link DIR-645
Currently this device fails to boot with the OpenWrt snapshot images
(release images are unaffected). The error message is:
"LZMA ERROR 1 - must RESET board to recover".

This happens because the kernel image is too big for the bootloader
to boot. This commit works around this by decreasing the lzma dictionary
size option from the default 23 to 10.

Before this change the current OpenWrt snapshot image (uncompressed
kernel size 4875139 bytes) failed to boot, while now an even bigger
image (kernel 4.19 with snapshot default config; uncompressed kernel
size 5162833 bytes) boots just fine.

The highest lzma dictionary size option this image booted with was 11.
10 was chosen to have a bit more room for growth.

An unavoidable side-effect of this change is that the compressed kernel
image will take up more space.

Total image size with different dictionary size options:
D23 - 3973903 bytes (base)
D16 - 4113167 bytes (+3.5%  - +139264 bytes)
D12 - 4317967 bytes (+8.7%  - +344064‬ bytes)
D11 - 4383503 bytes (+10.3% - +409600 bytes)
D10 - 4461327 bytes (+12.3% - +487424 bytes)

Fixes: FS#1484
Signed-off-by: Mason Clarke <mclarke2355@gmail.com>
4 years ago
Christoph Krapp 7bef62de79 ath79: use ath10k-ct-smallbuffers for TP-Link RE355/RE450 v1
Both devices are available in 64M and 128M RAM configurations but there
is no visial indication which configuration one might get.
So just to be sure we properly support both configurations switch to
kmod-atk10k-ct-smallbuffers.

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
4 years ago
Bjørn Mork 0bd322861c ath79: drop obsolete ehci hacks
There's nothing enabling these hacks in ath79, so drop the redundant
patches.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
4 years ago
Tokunori Ikegami 946eba9a92 ath79: Remove mtd cfi_cmdset_0002 status check patches
Currently the patch only changes break to use goto statement instead.
But not necessary acutually since the ret value checked after the for loop.
So it is okay for the break case before changed by the patch also.

This patch only reverts the following commit partially.
  https://github.com/openwrt/openwrt/commit/ddc11c3932c7b7b7df7d5fbd48f207e7
    Note: The changes are mainly applied into the linux kernel upstream.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Cc: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Tokunori Ikegami dd15ffbf6b ar71xx: Remove mtd cfi_cmdset_0002 status check patch
Currently the patch only changes break to use goto statement instead.
But not necessary acutually since the ret value checked after the for loop.
So it is okay for the break case before changed by the patch also.

This patch only reverts the following commit partially.
  ddc11c3932
    Note: The changes are mainly applied into the linux kernel upstream.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Cc: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Christian Lamparter 80c8a9aeed ipq806x: remove CONFIG_MDIO_IPQ8064 symbol
This driver is not available on upstream.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Andreas Böhler 411a666df2 ramips: fix sysupgrade image for TP-Link RE200v1
Images generated for the TP-Link RE200v1 cannot be updated using
sysupgrade, because a necessary call to append-metadata was missing.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
4 years ago
Hauke Mehrtens fba8083540 kernel: bump 4.9 to 4.9.208
Refreshed all patches.

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

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens b6cdc042af kernel: bump 4.19 to 4.19.93
Refreshed all patches.

The patch hack-4.19/550-loop-better-discard-for-block-devices.patch was
replaced with an new version of the patch from:
https://lore.kernel.org/patchwork/patch/1153625/
https://lore.kernel.org/patchwork/patch/1153626/

Compile-tested on: ipq40xx, lantiq
Runtime-tested on: ipq40xx, lantiq

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens 1bb90a28e4 kernel: bump 4.14 to 4.14.162
Refreshed all patches.

Compile-tested on: ramips
Runtime-tested on: ramips

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Maksym Medvedev 663b1a14e5 ramips: add support for Edimax RA21S
Edimax RA21S is a dual band 11ac router,
based on MediaTek MT7621A and MT7615N chips.

Specification:
- SoC: MediaTek MT7621A dual-core @ 880MHz
- RAM: 256M (Nanya NT5CC128M16IP)
- FLASH: 16MB (Macronix MX25L12835F)
- WiFi: 2.4/5 GHz 4T4R
  - 2.4GHz MediaTek MT7615N bgn
  - 5GHz MediaTek MT7615N nac
- Switch: SoC integrated Gigabit Switch (4 x LAN, 1 x WAN)
- USB: No
- BTN: Reset, WPS
- LED: 4 red LEDs, indistinguishable when case closed
- UART:  through-hole on PCB.
   J1: 3.3V - RX - GND - TX / 57600-8N1.  3.3V is the square pad

Installation:
Update the factory image via the OEM web-interface
(by default: http://192.168.2.1/)
User: admin
Password: 1234

The sysupgrade image can be installed via TFTP
from the U-Boot bootloader. Connect via ethernet port 2.

Tested on device by @UAb5eSMn

Signed-off-by: Maksym Medvedev <redrathnure@gmail.com>
[split DTS and take over improvements from RG21S, extend commit
message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Daniel Golle f64c64a91c generic: fix compiler error in OpenWrt's kexec patch
330-MIPS-kexec-Accept-command-line-parameters-from-users.patch causes
problems when building with -Werror=unused-result.

arch/mips/kernel/machine_kexec.c: In function 'machine_kexec_init_argv':
arch/mips/kernel/machine_kexec.c:76:2: error: ignoring return value of 'copy_from_user', declared with attribute warn_unused_result [-Werror=unused-result]
  copy_from_user(kexec_argv_buf, buf, size);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Fix this by handling the return value in an appropriate way.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Hauke Mehrtens 9a417fbd0d kernel: bump 4.14 to 4.14.161
Refreshed all patches.

Compile-tested on: ipq40xx, ramips
Runtime-tested on: ipq40xx

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Florian Fainelli 32e4eaef1b sunxi: Turn on CONFIG_PINCTRL_SUN4I_A10 for A20
CONFIG_PINCTRL_SUN4I_A10 controls both the A10 and the A20 enablong of
the pinctrl driver, this is necessary since upstream commit
5d8d349618a9464714c07414c5888bfd9416638f ("pinctrl: sunxi: add A20
support to A10 driver") which has been included in v4.13 and onwards.

Fixes: ad2b3bf310 ("sunxi: Add support for kernel 4.14")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
4 years ago
Moritz Warning 3e1325b219 ramips: fix inverted reset button for Ravpower WD03
The button events "pressed" and "released" were switched. Tested with v18.06.4.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
4 years ago
DENG Qingfang 113e51f79a ramips: move set-irq-affinity script to mt7621 subtarget
Move the set-irq-affinity script to mt7621 because it is the only
SMP subtarget.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
Adrian Schmutzler f943d84615 lantiq: use shared code for LED migration
Shared base-files package contains functions for LED migration that
are already used by several targets. Apply those also to lantiq and
drop the (redundant) local code.

While at it, reorder board names in file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler ed3e1bd2cc lantiq: remove includes of non-existent /lib/functions/lantiq.sh
lantiq.sh is still included in files which do not use it anymore.
Remove the includes.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 1b44ecc2d7 samsung: add subtarget condition for device
The only device in samsung target is meant to be built with s5pv210
subtarget. Thus, though this won't make a difference for a
one-subtarget target, already add the condition to the Makefile to
make the assignment obvious.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 6e70e4a071 samsung: use soc_vendor_model scheme for DTS file name
This patch changes the samsung target to calculate the DTS file name
from vendor and device name and the SOC (i.e. subtarget) following
the common scheme:

soc_vendor_model.dts

This also updates the device definition name to make compatible,
image name, menuconfig name and DTS name consistent.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 3b013dcdf8 ramips: fix Archer C20i wireless MAC address
The TP-Link Archer C20i previously had a generic Ralink MAC address set
for both radios, as the caldata does only contain a generic MAC address.

Set the MAC address from the vendor firmware for both radios to assign
unique MAC addresses to every device.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer dcc923a4c4 ramips: fix Archer C2 v1 5GHz MAC address
The TP-Link Archer C2 v1 previously had a generic Ralink MAC address set
for the 5GHz radio (MT7610), as the caldata does only contain a generic
MAC address.

Set the MAC address from the vendor firmware for the 5GHz radio to
assign unique MAC addresses to every device.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer a272fafc9c ramips: add system LED indicators for TP-Link C20i
Use the WPS LED to indicate system status like it is done for the
TP-Link Archer C2 v1 and many other boards.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer 1e7c6381f0 ramips: convert TP-Link MT7620 boards to tpt trigger
This converts all MediaTek MT7620 boards from TP-Link to use the now
supported WiFi throughput LED trigger. This way, the LED state now
covers all VAPs regardless of their name.

Also align all single-WiFi LEDs to represent the state of the 2.4GHz
radio. This was not always the case previously, as later-added support
for the MT7610 altered the phy probing order.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
DENG Qingfang a176f8d3ec ramips: mt7620: use throughput trigger on HiWiFi HC5x61
Throughput trigger support for MT7620 has been added, so switch to it

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang 415cc83da6 ramips: remove HiWiFi HC5661 non-existent 5GHz LED
HC5661 does not have 5GHz WiFi or LED.

Fixes: e6e373d348 ("ramips: Add DTS files for HiWiFi HC5x61 models")

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
Andreas Böhler a3010a7f8d ramips: add support for TP-Link RE200 v1
TP-Link RE200 v1 is a wireless range extender with Ethernet and 2.4G and 5G
WiFi with internal antennas. It's based on MediaTek MT7620A+MT7610EN.

Specifications
--------------

- MediaTek MT7620A (580 Mhz)
- 64 MB of RAM
- 8 MB of FLASH
- 2T2R 2.4 GHz and 1T1R 5 GHz
- 1x 10/100 Mbps Ethernet
- UART header on PCB (57600 8n1)
- 8x LED (GPIO-controlled; only 6 supported), 2x button

There are 2.4G and 5G LEDs in red and green which are controlled
separately. The 5G LED is currently not supported, since the GPIOs couldn't
be determined.

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

Web Interface
-------------

It is possible to upgrade to OpenWrt via the web interface. However, the
OEM firmware upgrade file is required and a tool to fix the MD5 sum of
the header. This procedure overwrites U-Boot and there is not failsafe /
recovery mode present! To prepare an image, you need to take the header
and U-Boot (i.e. 0x200 + 0x20000 bytes) from an OEM firmware file and
attach the factory image to it. Then fix the header MD5Sum1.

Serial console
--------------

Opening the case is quite hard, since it is welded together. Rename the
OpenWrt factory image to "test.bin", then plug in the device and quickly
press "2" to enter flash mode (no line feed). Follow the prompts until
OpenWrt is installed.

Unfortunately, this devices does not offer a recovery mode or a tftp
installation method. If the web interface upgrade fails, you have to open
your device and attach serial console. Since the web upgrade overwrites
the boot loader, you might also brick your device.

Additional notes
----------------

MAC address assignment is based on stock-firmware. For me, the device
assigns the MAC on the label to Ethernet and the 2.4G WiFi, while the 5G
WiFi has a separate MAC with +2.

*:88    Ethernet/2.4G    label, uboot 0x1fc00, userconfig 0x0158
*:89    unused           userconfig 0x0160
*:8A    5G               not present in flash

This seems to be the first ramips device with a TP-Link v1 header. The
original firmware has the string "EU" embedded, there might be some region-
checking going on during the firmware upgrade process. The original
firmware also contains U-Boot and thus overwrites the boot loader during
upgrade.
In order to flash back to stock, the first header and U-Boot need to be
stripped from the original firmware.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
4 years ago
Sungbo Eo 7a3c9e557a ramips: fix switch setup for Xiaomi MiWiFi Nano
MiWiFi Nano has two LAN ports, which are in reverse order. Add port numbers
to them, and disable unused ports.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Josua Mayer 12795ec9f1 mvebu: split interface configuration for clearfog pro and base
Handle both variants separately. This removes the need for calling
swconfig to detect the switch, and simplifies future changes.

Signed-off-by: Josua Mayer <josua.mayer@jm0.eu>
4 years ago
Christian Mauderer 5e5e92b7c3 ath79: generate firmware image for aircube-isp
This adds a "factory" image for the aircube-isp devices. Note that the
firmware can't be uploaded without prior special preparation. For the
most recent instructions on how to do that, visit the OpenWRT wiki page
of the Ubiquiti airCube ISP for details:

https://openwrt.org/toh/ubiquiti/ubiquiti_aircube_isp

Current procedure:

With the original firmware 2.5.0 it is possible to upload and execute a
script via the configuration. To do that download and unpack the
original configuration, adapt uhttpd config to execute another lua
handler (placed in the config directory) and pack and upload it again.

The lua handler can call a script that mounts an overlayfs and modifies
the "fwupdate.real" binary so that an unsigned image is accepted. The
overlayfs is necessary because a security system (called tomoyo) doesn't
allow binaries in other locations than /sbin/fwupdate.real (and maybe
some more) to access the flash when executed via network.

A big thanks to Torvald Menningen (Snap) from the OpenWRT forum for
finding out how to patch the binary so that it accepts an unsigned
image.

The current step-by-step procedure is:

- Use a version 2.5.0 of the original firmware. This is important
  because a binary file will be modified.
- Download a configuration.
- Unpack it (it's just a tar gz file without an ending).
- Add the following to uhttpd:

``````
config 'uhttpd' 'other'
	list listen_http    0.0.0.0:8080
	list listen_http    [::]:8080
	option 'home'       '/tmp/persistent/config/patch/www'
	option lua_prefix   '/lua'
	option lua_handler  '/tmp/persistent/config/patch/handler.lua'
``````

- Create a `patch` subfolder.
- Create a `patch/www` subfolder.
- Create a `patch/handler.lua` with the following content:

``````
function handle_request(env)
    uhttpd.send("Status: 200 OK\r\n")
    uhttpd.send("Content-Type: text/plain\r\n\r\n")

    local command = "/bin/sh /tmp/persistent/config/patch/patch.sh 2>&1"

    local proc = assert(io.popen(command))
    for line in proc:lines() do
        uhttpd.send(line.."\r\n")
    end
    proc:close()
end
``````

- Create a `patch/patch.sh` with the following content:

``````
#!/bin/sh -x

set -e
set -u
set -x

UBNTBOX_PATCHED="/tmp/fwupdate.real"
MD5FILE="/tmp/patchmd5"

cat <<EOF > ${MD5FILE}
c33235322da5baca5a7b237c09bc8df1  /sbin/fwupdate.real
EOF

# check md5 of files that will be patched
if ! md5sum -c ${MD5FILE}
then
        echo "******** Error when checking files. Refuse to do anything. ********"
        exit 0
fi

# prepare some overlay functionality
LOWERDIR="/tmp/lower_root"
mkdir -p ${LOWERDIR}
mount -t squashfs -oro /dev/mtdblock3 ${LOWERDIR}
overlay_some_path()
{
        PATH_TO_OVERLAY=$1
        ALIAS=$2
        UPPERDIR="/tmp/over_${ALIAS}"
        WORKDIR="/tmp/over_${ALIAS}_work"

        mkdir -p ${UPPERDIR}
        mkdir -p ${WORKDIR}

        mount -t overlay -o lowerdir=${LOWERDIR}${PATH_TO_OVERLAY},upperdir=${UPPERDIR},workdir=${WORKDIR} overlay ${PATH_TO_OVERLAY}
}

# patch the ubntbox binary.
overlay_some_path "/sbin" "sbin"
echo -en '\x10' | dd of=/sbin/fwupdate.real conv=notrunc bs=1 count=1 seek=24598

echo "******** Done ********"
``````

- Repack the configuration.
- Upload it via the normal web interface.
- Wait about a minute. The webserver should restart.
- Now there is a second web server at port 8080 which can call the lua
  script. Visit the page with a web browser. Link is for example
  http://192.168.1.1:8080/lua
- You should see the output of the script with a "*** Done ***" at the
  end. Note that the patches are not permanent. If you restart the
  router you have to re-visit the link (but not re-upload the config).
- Now you can upload an unsigned binary via the normal web interface.

Signed-off-by: Christian Mauderer <oss@c-mauderer.de>
4 years ago
Adrian Schmutzler 836d5395a5 toolchain: wrapper.sh: harmonize leading whitespaces
Convert leading spaces to tabs and generally harmonize leading
whitespace indent in the file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev ac42b916bc toolchain: wrapper.sh: use /bin/sh instead of bash
No bash features are actually used here.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[slightly adjust commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev 3c42293937 apm821xx: mbl_gen_hdd_img.sh: switch to /bin/sh
Nothing here needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev 5422db7e27 arc770: gen_axs10x_sdcard_img.sh: switch to /bin/sh
Nothing here needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev e95c4d2f50 archs38: gen_axs10x_sdcard_img.sh: switch to /bin/sh
Nothing here needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev 55383a9a7a at91: gen_at91_sdcard_img.sh: switch to /bin/sh
Nothing here needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev de8e51c06f brcm2708: gen_rpi_sdcard_img.sh: use /bin/sh
Nothing here needs bash.

While at it, remove trailing whitespace.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title, add whitespace comment]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev 454339b533 gemini: dns313_gen_hdd_img.sh: switch to /bin/sh
Nothing here needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev 2b2985fe6b layerscape: gen_sdcard_head_img.sh: switch to /bin/sh
Nothing here needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev c0ca9f90a8 mediatek: gen_mt7623_emmc_img.sh: use /bin/sh
Nothing here needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev c7382cccd8 mxs: gen_sdcard_ext4_ext4.sh: use /bin/sh
Nothing here needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[adjust prefix of commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev 5ce2f3dc15 mxs: gen_sdcard_vfat_ext4.sh: use /bin/sh
Nothing here needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[change prefix of commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev 646e811b07 omap: gen_omap_sdcard_img.sh: use /bin/sh
Nothing here needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev 4fb4cc537a rb532: gen_image.sh: use /bin/sh
Nothing here needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[slightly adjust commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev 0713afd298 sunxi: gen_sunxi_sdcard_img.sh: switch to /bin/sh
This has nothing that needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev 3c8d95209f zynq: gen_zynq_sdcard_img.sh: switch to /bin/sh
This has nothing that needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev b2e12de339 mvebu: gen_mvebu_sdcard_img.sh: use /bin/sh
There is nothing that needs bash anymore.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev 19be55aa37 toolchain/wrapper: replace legacy backticks with $()
This replaces deprecated backticks by more versatile $(...) syntax.

Found with shellcheck.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[alter commit title, extend commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev 9edf808e35 mvebu: gen_mvebu_sdcard_img.sh: don't use format directly in printf
Enables proper checking. Matches printf behavior in C.

Found with shellcheck.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rosen Penev 927210a828 mvebu: gen_mvebu_sdcard_img.sh: replace let with $(())
let is a bashism.

Found with shellcheck.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer c48b571ad7 ramips: add LED trigger for TL-WR902AC v3 WAN LED
This adds an LED trigger for the WAN LED on top of the TP-Link
TL-WR902AC v3. Currently, only the LED on the port itself shows the link
state, while the LED on top of the device stays dark.

The WAN port of the device is a hybrid LAN/WAN one, hence why the LED at
the port was labled LAN.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Álvaro Fernández Rojas 9941edc724 brcm2708: image: stop using mkknlimg script
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 5c06657e42 brcm2708: switch to upstream cpufreq driver
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Felix Fietkau b2d10977a8 Revert "kernel: fix kmemleak warnings introduced in 305-mips_module_reloc.patch"
This reverts commit a03afef7f2e8ae363a97357ec75ffbfef372a9ea.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years ago
Adrian Schmutzler e0382e88a9 ipq806x: build DEVICE_DTS based on SOC and device name
This patch uses the SOC variable to calculate DTS names automatically
based on the SOC and the device definition node name.

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

Since the kernel uses a "soc-device.dts" scheme for this target, we
use this for the derivation of DEVICE_DTS, too, leaving the DTS names
unchanged for this target.

Note that for some devices the kernel itself uses inconsistent names
(DTS naming scheme vs. compatible), leaving us with a manual overwrite
of DEVICE_DTS for those cases.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 9c7025b779 ipq40xx: build DEVICE_DTS based on SOC and device name
This patch uses the SOC variable to calculate DTS names automatically
based on the SOC and the device definition node name.

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

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

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 09d38a3bc3 ramips: remove bogus ralink,mtd-eeprom with offset 0x4
Several devices in mt76x8 subtarget use the following line to set
up wmac in their DTS(I) files:

ralink,mtd-eeprom = <&factory 0x4>

This is strange for several reasons:
- They should use mediatek,mtd-eeprom on this SOC
- The caldata is supposed to start at 0x0
- The parent DTSI mt7628an.dtsi specifies mediatek,mtd-eeprom anyway,
  starting from 0x0
- The offset coincides with the default location of the MAC address
  in caldata

Based on the comment in b28e94d4bf ("ramips: MiWiFi Nano fixes"),
it looks like the author for this device wanted to actually use
mtd-mac-address instead of ralink,mtd-eeprom. A check on the same
device revealed that actually the MAC address start at offset 4 there,
so the correct caldata offset is 0x0.

Based on these findings, and the fact that the expected location on
this SOC is 0x0, we remove the "ralink,mtd-eeprom = <&factory 0x4>"
statement from all devices in ramips (being only mt7628an anyway).

Thanks to Sungbo Eo for finding and researching this.

Reported-by: Sungbo Eo <mans0n@gorani.run>
Fixes: b28e94d4bf ("ramips: MiWiFi Nano fixes")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Felix Fietkau 441052f44a kernel: fix kmemleak warnings introduced in 305-mips_module_reloc.patch
Physically allocated memory for modules needs to be registered with kmemleak,
so it can track it as object.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years ago
Paul Fertser 0b7d779dcf ipq40xx: use ath10k-ct-smallbuffers for 128 MiB devices
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
4 years ago
Ansuel Smith b04ccdb1e8 ipq806x: fix wrong definition for tsense calib
We have only 11 sensors on ipq806x. Fix the reg property
to load the right amount of data instead of the entire
space.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 77f4d5c6bb ipq806x: rework ipq806x specific tsense temp driver
Tsense driver for ipq806x have various problem.
- Emit wrong error. On probing of this driver, nvmem driver can be
  not ready and this cause a EDEFER error. Actually this is not an
  error as the kernel will retry to probe the driver after the
  nvmem driver is loaded.
- Use uninitialized value on trigger of critical temp
- Doesn't free allocated memory

Because of this, rework the driver and improve it by removing extra
load of data.

Change the logic of loading data. Use the backup calib data only
when the calib data is not present. As the calibration is only
needed to set the temp offset, we don't really need to read
both calib data and set the offset based only on the backup one.
Also change how the notifier function work. At times when we
output the trigger message, we already have read the temp so
remove the extra read and the wrong uninitialized data that
probably caused a kernel panic for null pointer exception.
(Think we never experience this bug because the router
never reached that temp ever... So just lucky)

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith a666f817a2 ipq806x: update kernel config with new driver
The config name for cpufreq driver has changed.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith c8086c7d2d ipq806x: refresh new and changed patches
Refresh patches to remove fuzz

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 62a4e4b319 ipq8065: update dtsi with new opp table
The new driver use opp table to register frequency.
Drop psv bindings as they are not used anymore.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith adc0bebd87 ipq8064: update dtsi with new opp table
The new driver use opp table to register frequency.
Drop psv bindings as they are not used anymore.
Adds speedbin definition for nvmem driver

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith e18f8e417f ipq806x: add patch to support krait cpu scaling driver
This patch has been proposed but never actually merged to
mainline. It was accepted but never re proposed by the
creator.
Rework it, fix kernel panic cause by double kfree.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith a37f787162 ipq806x: backport qcom-cpufreq-kryo patch
Backport patch applied to qcom-cpufreq-kryo
driver as krait cpu will base on this driver.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 4165f2340e ipq806x: drop old cpufreq patch
Drop old cpufreq as now we have new driver that
can use normal kernel opp definition

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith e9a982e1d9 ipq806x: opp/core: update patch updating voltage tolerance on voltage adjust
Rework 0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t
to reflect changes upstream.

- Skip unnecessary allocation of buffer to set u_volt
- Change opp u_volt directly

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 456ab9a912 ipq806x: opp/core: update patch allowing adjusting of OPP voltages at runtime
Update 0049-PM-OPP-Support-adjusting-OPP-voltages-at-runtime with
upstream version.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 5ab9c0b388 ipq806x: fix bug in L2 cache scaling
It has been notice a buf in L2 cache scaling where the scaling is not
done proprely if the frequency is set to the initial state before
the new frequency.

From: https://patchwork.kernel.org/patch/10565443/

* The clocks are set to aux clock rate first to make sure the
* secondary mux is not sourcing off of QSB. The rate is then set to
* two different rates to force a HFPLL reinit under all
* circumstances.

In the initial stage of boot to force a new frequency to apply, is
needed to first set the frequency back to the lowest one (aux_rate)
and then to the target one. This force and make sure the controller
actually switch the frequency to the right one. Apply the same
mechanism to L2 frequency scaling. Before scaling to the target
frequency, first set the frequency to the aux_rate to force the
transition, then scale it to the target frequency. Doing the wrong way
can produce unexpected results and could lock the scaling mechanism
until a full reboot is done (Causing a full reset by the krait-cc driver)

From: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=77612720a2362230af726baa4149c40ec7a7fb05

When the Hfplls are reprogrammed during the rate change,
the primary muxes which are sourced from the same hfpll
for higher frequencies, needs to be switched to the 'safe
secondary mux' as the parent for that small window. This
is done by registering a clk notifier for the muxes and
switching to the safe parent in the PRE_RATE_CHANGE notifier
and back to the original parent in the POST_RATE_CHANGE notifier.

This should apply also to L2 scaling... as we can't relly use
the notifier, we manually do this on L2 scaling.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Paul Fertser 3e51cb7820 ath79: tp-link: use ath10k-ct-smallbuffers for 64 MiB devices
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
4 years ago
Álvaro Fernández Rojas 1579599079 brcm2708: fix malformed patch
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas c2308a7e4a brcm2708: update to latest patches from RPi Foundation
Also removes reverted patches.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 67dcc43f3a brcm2708: organize kernel patches
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Hauke Mehrtens 47a93a810f kernel: bump 4.9 to 4.9.207
Refreshed all patches.

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

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens 25b422a041 kernel: bump 4.14 to 4.14.160
Refreshed all patches.

Compile-tested on: ipq40xx, apm821xx
Runtime-tested on: ipq40xx

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens f0df0d6a14 kernel: bump 4.19 to 4.19.91
Refreshed all patches.

Compile-tested on: ipq40xx, apm821xx
Runtime-tested on: ipq40xx

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Koen Vandeputte e115fa478f kernel: bump 4.19 to 4.19.90
Refreshed all patches.

Remove upstreamed:
- 010-dmaengine-dw-dmac-implement-dma-prot.patch
- 950-0148-Increase-firmware-call-buffer-size-to-48-bytes.patch
- 950-0206-Mailbox-firmware-calls-now-use-kmalloc-2749.patch
- 402-leds-trigger-netdev-fix-handling-on-interface-rename.patch

Fixes:
- CVE-2019-19332

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
[Add 010-dt-bindings-dmaengine-dw-dmac-add-protection-control.patch]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Koen Vandeputte 7604e53d5f kernel: bump 4.14 to 4.14.159
Refreshed all patches.

Remove upstreamed:
- 302-0002-dmaengine-dw-implement-per-channel-protection-contro.patch

Fixes:
- CVE-2019-19332

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Paul Fertser db992e7b53 ath79: use ath10k-ct-smallbuffers for 64 MiB devices
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
4 years ago
Florian Fainelli c715f71bce treewide: Remove self from MAINTAINER entries
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
4 years ago
Hauke Mehrtens 729d7bc751 kernel: Deactivate CONFIG_SFP in generic config
Deactivate CONFIG_SFP for kernel 4.19 in the generic configuration.
The CONFIG_SFP configuration option was not set to anything in the
ath79 build for me, set it to deactivated by default.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens b0b1d4aaf0 ath79: Do not build dlink_dir-615-e4 by default
The factory image for the dlink_dir-615-e4 is getting too big which makes
the full ath79 tiny build fail, deactivate it by default.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Álvaro Fernández Rojas 2d899a69e7 brcm2708: remove unneeded patches
- wireless patches
- defconfig patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Sven Roederer eca05bc4cc ramips: add label MAC address for Mikrotik RB750Gr3
The device label contains:
E01: 74:4D:28:xx:xx:30
E05: 74:4D:28:xx:xx:34

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

That one is taken for the label MAC address.

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
4 years ago
Adrian Schmutzler e4ce3109f2 ramips: simplify state_default/pinctrl0 in device DTS files
The node pinctrl0 is already set up in the SOC DTSI files, but
defined again as member of pinctrl in most of the device DTS(I)
files. This patch removes this redundancy for the entire ramips
target.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
John Sommerville 6041eb9547 build: build proper VMDK formats for ESXI 6.5
VMWare ESXI 6.5 and above is not compatible with
subformat=monolithicSparse (The default qemu-img convert -O VMDK option).
Monolithic Sparse vmdk can be imported, but issues occur when running
sysupgrade with new images and other tasks that modify the file system
(issues like Kernel panics, reboot loops, sometimes crashing the Host ESXI
box).

This change creates an additional VMDK output file for ESXI that sets the
subformat to monlithicFlat, and the adapter_type to the SCSI lsilogic
controller.

This change existed back on:
25e36d379e

But it looks like the change was removed when refactoring occurred with:
5f6a2732f892b6229473576d89cc963ae9c97d5d

Signed-off-by: John Sommerville <jsommerville@untangle.com>
4 years ago
Kevin Schmidt 77e27e0f53 lantiq: enable 5ghz wifi on VR200/VR200v
Enable mt76 driver on VR200/VR200v.

Signed-off-by: Kevin Schmidt <kevin.patrick.schmidt@googlemail.com>
4 years ago
Aleksander Jan Bajkowski 692390225d lantiq: fix phys led
led2l and led2h value is incorrectly set by led3l and led3h.
Bug was introduced in commit: 863e79f8d5

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
Fixes: 863e79f8d5 ("lantiq: add support for kernel 4.9")
4 years ago
Sungbo Eo ea5cf7c0dd ramips: fix MAC address setup for Xiaomi MiWiFi Nano
MAC addresses are stored in factory partition at:
0x0004: WiFi 2.4GHz (label_mac +1)
0x0028: LAN, WAN (label_mac)

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo 74e9f95c79 ramips: further improve support for Xiaomi MiWiFi Nano
This patch does the following:

- prepend vendor name to model
- set status LEDs to follow the behavior in stock FW
- simplify state_default node definition
- use generic name for flash node

Stock FW status indicators:
https://files.xiaomi-mi.com/files/Mi_Router_Wi-Fi_Nano/Mi_router-NANO_EN.pdf
> Yellow: power on / off
> Blue: during normal operation
> Red: in case of problems with the operation of the device

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Adrian Schmutzler e2eb6d5829 lantiq: move include to parent falcon_lantiq_easy98000.dtsi
This moves the include of lantiq.dtsi from the DTS files to the
parent falcon_lantiq_easy98000.dtsi.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 397aa5d37d lantiq: remove ar9_lantiq_easy50810.dts
This file seems to be orphaned, no device setup existing for it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler c640370939 lantiq: use soc_vendor_device scheme on DTS file
This renames lantiq DTS(I) files to follow soc_vendor_device scheme.
This will make DTS files easier to maintain.

As a side effect, DTS file name can be derived from device node
names now, only having to specify a SOC variable in Makefiles.

While at it, move files to arch/mips/boot/dts/lantiq subfolder.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler de6dd7a8db lantiq: split device definitions into files
This splits device definitions into several *.mk files to increase
overview.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Martin Blumenstingl 4c88b3b5dc lantiq: dts: assign the ASC pins to the serial controller node
Assign the ASC pins to the serial controller node instead of using pin
hogging (where pins are assigned to the pin controller).
This is the preferred way of assigning pins upstream.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 years ago