1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-17 12:43:56 +02:00
Commit Graph

23820 Commits

Author SHA1 Message Date
Sven Eckelmann
223eec7e81 kernel: mtd: parser: cmdline: Fix parsing of part-names with colons
Some devices (especially QCA ones) are already using hardcoded partition
names with colons in it. The OpenMesh A62 for example provides following
mtd relevant information via cmdline:

  root=31:11 mtdparts=spi0.0:256k(0:SBL1),128k(0:MIBIB),384k(0:QSEE),64k(0:CDT),64k(0:DDRPARAMS),64k(0:APPSBLENV),512k(0:APPSBL),64k(0:ART),64k(custom),64k(0:KEYS),0x002b0000(kernel),0x00c80000(rootfs),15552k(inactive) rootfsname=rootfs rootwait

The change to split only on the last colon between mtd-id and partitions
will cause newpart to see following string for the first partition:

  KEYS),0x002b0000(kernel),0x00c80000(rootfs),15552k(inactive)

Such a partition list cannot be parsed and thus the device fails to boot.

Avoid this behavior by making sure that the start of the first part-name
("(") will also be the last byte the mtd-id split algorithm is using for
its colon search.

Fixes: d6a9a92e32 ("kernel: bump 5.4 to 5.4.69")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-11-23 22:53:15 +01:00
Sven Eckelmann
8231994d3f ipq40xx: DTS style updates for OpenMesh devices
The OpenMesh related files were not updated since a while and the new
coding style requirements weren't integrated. This can cause problems
for new devices when an author uses these files as starting point.

* use SPDX-License-Identifiers instead of full license texts
* drop linux,default-trigger with value default-off for LEDs
* led nodes with label "abc:xyz" should have name "xyz_abc"
* led DT labels for "xyz_abc" should be "led_xyz_abc"
* "m25p80@0" flash node should be renamed to "flash@0"
* drop unnecessary empty lines

Signed-off-by: Sven Eckelmann <sven@narfation.org>
[minor commit title and message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-23 13:44:47 +01:00
Rui Salvaterra
eb087ae4f4 ath79: move the squashfs feature to the parent target
All subtargets define it. Move it to the parent target and remove
it from all subtargets.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2020-11-23 13:20:53 +01:00
Paulo Machado
b19a684f46 imagebuilder: fix main entry makefile
Remove a syntax error from ImageBuider Makefile

Acked-by: Paul Spooren <mail@aparcar.org>
Signed-off-by: Paulo Machado <pffmachado@yahoo.com>
2020-11-23 03:13:46 +00:00
Filip Moc
0d65177658 ramips: add support for TP-Link MR6400 v4
You can flash via tftp recovery:
 - serve tftp-recovery image as /tp_recovery.bin on 192.168.0.225/24
 - connect to any ethernet port
 - power on the device while holding the reset button
 - wait at least 8 seconds before releasing reset button

Flashing via OEM web interface does not work.

LTE module does not support DHCP so it must be configured via QMI.

Hardware Specification (v4.0 EU):
 - SoC: MT7628NN
 - Flash: Winbond W25Q64JVS (8MiB)
 - RAM: ESMT M14D5121632A (64MiB)
 - Wireless: SoC platform only (2.4GHz b/g/n, 2x internal antenna)
 - Ethernet: 1NIC (4x100M)
 - WWAN: TP-LINK LTE MODULE (2x external detachable antenna)
 - Power: DC 9V 0.85A

Signed-off-by: Filip Moc <lede@moc6.cz>
2020-11-23 00:46:40 +00:00
Filip Moc
1e69106e34 generic: add DTR quirk patch for MR400 LTE
This is required for LTE module MR400 in TL-MR6400 v4.

Signed-off-by: Filip Moc <lede@moc6.cz>
2020-11-23 00:45:44 +00:00
Paul Spooren
418362b1cc imagebuilder: add package signature verification
The ImageBuilder downloads pre-built packages and adds them to images.
This process uses `opkg` which has the capability to verify package list
signatures via `usign`, as enabled per default on running OpenWrt
devices.

Until now this was disabled for ImageBuilders because neither the `opkg`
keys nor the `opkg-add` script was present during first packagelist
update.

To harden the ImageBuilder against *drive-by-download-attacks* both keys
and verification script are added to the ImageBuilder allowing `opkg` to
verify downloaded package indices.

This commit adds `opkg-add` to the ImageBuilder scripts folder. The keys
folder is added to ImageBuilder $TOPDIR to have an obvious place for users to
store their own keys. The `option check_signature` is appended to the
repositories.conf file. All of the above only happens if the Buildbot
runs with the SIGNATURE_CHECK option.

The keys stored in the ImageBuilder keys/ are the same as included in
the openwrt-keyring package. To avoid the chicken-egg problem of
downloading and verifying a package, containing signing keys, the keys
are added during the ImageBuilder generation. They are same as in
shipped images (stored at `/etc/opkg/keys/`).

To allow a local package feed in which the user can add additional
packages, a local set of `usign` and `ucert` keys is generated, same as
building OpenWrt from source. The private key signs the local repository
inside the packages/ folder. The local public key is added to the keys/
folder to be considered by `opkg` when updating repositories. This way a
local package feed can be modified while requiring `opkg` to check
signatures for remote feed, making HTTPS optional.

The new option `ADD_LOCAL_KEY` allows to add the local key inside the
created images, adding the advantage that sysupgrades can validate the
ImageBuilders local key.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-11-19 22:15:00 +00:00
Marc Egerton
f276395cda ramips: add support for the Hak5 WiFi Pineapple Mark 7
This patch adds support for the WiFi Pineapple Mark 7, a wireless
penetration testing tool.

Specifications:
    * SoC: MediaTek MT7628 (580MHz)
    * RAM: 256MiB (DDR2)
    * Storage 1: 32MiB NOR (SPI)
    * Storage 2: 2GB eMMC
    * Wireless 1: 802.11b/g/n 2.4GHz (Built In)
    * Wireless 2: 802.11b/g/n 2.4GHz (MT7601)
    * Wireless 3: 802.11b/g/n 2.4GHz (MT7601)
    * USB: 1x USB Type-A 2.0 Host Port
    * Ethernet: 1x USB Type-C AX88772C Ethernet
    * UART: 57600 8N1 on PCB
    * Inputs: 1x Reset Button
    * Outputs: 1x RGB LED
    * FCCID: 2AA52MK7

Flash Instructions:
    Original firmware is based on OpenWRT.
    Use sysupgrade via SSH to flash.

Signed-off-by: Marc Egerton <foxtrot@realloc.me>
[pepe2k@gmail.com: set only required/used gpio groups to gpio function]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-11-18 23:49:34 +01:00
Piotr Dymacz
a92d55efcf ath79: fix reset button support on 8devices Lima
This fixes 'linux,code' property name and value for the 'reset' key node
in 8devices Lima DTS file.

Problem and solution were reported on the forum, see:
https://forum.openwrt.org/t/resetbutton-not-working-ath79-8devices-lima/78810

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-11-18 23:49:34 +01:00
Piotr Dymacz
6d65e3af9b ath79: calculate Eth MACs from WLAN on ALFA Network R36A
New batches of the R36A board series might no longer keep separated
Ethernet MAC addresses stored in flash. Use same approach as on the
N2Q and calculate Ethernet MACs from WLAN one which is kept in ART.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-11-18 23:49:34 +01:00
Piotr Dymacz
64a6f4a9c1 ath79: add support for ALFA Network Pi-WiFi4
ALFA Network Pi-WiFi4 is a Qualcomm QCA9531 v2 based, high-power 802.11n
WiFi board in Raspberry Pi 3B shape, equipped with 1x FE and 4x USB 2.0.

Specifications:

- Qualcomm/Atheros QCA9531 v2
- 650/400/200 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16+ MB of flash (SPI NOR)
- 1x 10/100 Mbps Ethernet
- 2T2R 2.4 GHz Wi-Fi with Qorvo RFFM8228P FEM
- 2x IPEX/U.FL connectors on PCB
- 4x USB 2.0 Type-A
- Genesys Logic GL850G 4-port USB HUB
- USB power is controlled by GPIO
- 5x LED (3x on PCB, 2x in RJ45, 4x driven by GPIO)
- 1x button (reset)
- external h/w watchdog (EM6324QYSP5B, enabled by default)
- 1x micro USB Type-B for power and system console (Holtek HT42B534)
- UART and GPIO (8-pin, 1.27 mm pitch) header on PCB

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on LEDE/OpenWrt. Alternatively, you can use web recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24.
2. Connect PC with one of RJ45 ports, press the reset button, power up
   device, wait for first blink of all LEDs (indicates network setup),
   then keep button for 3 following blinks and release it.
3. Open 192.168.1.1 address in your browser and upload sysupgrade image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-11-18 23:49:34 +01:00
Piotr Dymacz
d44463b087 ath79: add label MAC address for ALFA Network N5Q
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-11-18 23:49:34 +01:00
e0cc68daad ramips: use m25p,fast-read on Xiaomi Mi Router 4A Gb/3G v2
The Xiaomi Mi Router 4A Gigabit model has a race condition on bootup
causing the SQUASHFS data errors to appear and create a bootloop
scenario.

Adding the m25p,fast-read property resolves this issue.

Suggested-by: David Bentham <db260179@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-18 21:13:46 +01:00
John Audia
667f6c7f49 kernel: bump 5.4 to 5.4.77
Manually rebased patches:
 bcm27xx/patches-5.4/950-0135-spi-spi-bcm2835-Disable-forced-software-CS.patch
 generic-backport/744-v5.5-net-sfp-soft-status-and-control-support.patch
 layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch
 mvebu/patches-5.4/521-arm64-dts-marvell-espressobin-Add-ethernet-switch-al.patch

Removed:
 layerscape/patches-5.4/819-uart-0012-tty-serial-lpuart-add-LS1028A-support.patch

All modifications made by update_kernel.sh

Build system: x86_64
Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711,
              lantiq/Easybox 904 xDSL, x86_64
Run-tested: ipq806x/R7800, lantiq/Easybox 904 xDSL, x86_64

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
Co-developed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-18 21:13:46 +01:00
Nick Hainke
79f3f1358b ath79: Add support for Ubiquiti NanoBeam AC Gen2
CPU:         Atheros AR9342 rev 3 SoC
RAM:         64 MB DDR2
Flash:       16 MB NOR SPI
WLAN 2.4GHz: Atheros AR9342 v3 (ath9k)
WLAN 5.0GHz: QCA988X
Ports:       2x GbE

Flashing procedure is identical to other ubnt devices.
https://openwrt.org/toh/ubiquiti/common

Flashing through factory firmware
1. Ensure firmware version v8.7.0 is installed.
   Up/downgrade to this exact version.
2. Patch fwupdate.real binary using
   `hexdump -Cv /bin/ubntbox | sed 's/14 40 fe 27/00 00 00 00/g' | \
    hexdump -R > /tmp/fwupdate.real`
3. Make the patched fwupdate.real binary executable using
   `chmod +x /tmp/fwupdate.real`
4. Copy the squashfs factory image to /tmp on the device
5. Flash OpenWrt using `/tmp/fwupdate.real -m <squashfs-factory image>`
6. Wait for the device to reboot
(copied from Ubiquiti NanoBeam AC and modified)

To keep it consistent, we will add the gen1 variant to
the nanobeam ac gen1.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2020-11-18 21:13:46 +01:00
aafbfc6ac3 ath79: fix missing ";;" in 11-ath10k-caldata
This adds a missing ";;" in the switch-case in 11-ath10k-caldata.

Fixes: 4d36569b9c ("ath79: fix ath10k caldata extraction on some
D-Link DIR-842 C3 devices")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-16 19:26:25 +01:00
Paul Fertser
4d36569b9c ath79: fix ath10k caldata extraction on some D-Link DIR-842 C3 devices
According to forum threads [0][1] and a report on IRC by Doc-Saintly
some of those boards have calibration data in a different place. Only
one alternative location is known.

Without proper board calibration data (board.bin having all 0xff bytes)
ath10k firmware still tries to load but crashes on startup with a
confusing error message.

If you're applying this patch manually on your device do not forget to
remove /lib/firmware/ath10k/pre-cal-pci-0000:00:00.0.bin and reboot to
force caldata re-extraction.

[0] https://forum.openwrt.org/t/support-for-d-link-dir842-rev-c3/41654
[1] https://forum.openwrt.org/t/d-link-dir-842-cant-access-firmware-upload-form/65454

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2020-11-16 14:05:24 +01:00
DENG Qingfang
03d178727a kernel: remove mvsw61xx swconfig driver
All targets that used mvsw61xx have switched to upstream mv88e6xxx DSA
driver, so it can be removed.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
2020-11-16 13:55:05 +01:00
7661b83768 mediatek: fix mixed indent in DTS files
mediatek frequently had mixed indent (tabs vs. spaces) in DTS files
and DTS file kernel patches (probably due to careless copy/paste).

The harmonizes these cases to tabs-only, as usual for DTS(I).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-16 13:43:39 +01:00
2658008a2a treewide: remove default-state off for LEDs
default-state = "off" is default for LEDs, no need to specify it
explicitly.

https://www.kernel.org/doc/Documentation/devicetree/bindings/leds/common.yaml

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-16 13:43:39 +01:00
Daniel González Cabanelas
4e885dd90a mvebu: LS421DE: improve the HDD leds
Improve the HDD LEDs used for disk activity:
 - Use the trigger activity per ata channel

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2020-11-16 13:43:39 +01:00
DENG Qingfang
fe1f11ce32 ramips: mt7621: fix Telco X1 GPIO switches
The GPIO base of MT7621 GPIO 0~31 is 480 on kernel 5.4
Fix the GPIO numbering.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
2020-11-16 13:43:39 +01:00
Paul Spooren
47e089e30e bcm27xx: add bit variant to redundant RaspberryPi
Both bcm2709 and bcm2710 firmware can run on the same RaspberryPi
models, varying however in 32 and 64 Bit architectures. The model name
alone does not include the architecture information, which becomes
problematic if looking at a overview that only contains the names. By
adding a variant it is possible to tell the architecture.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-11-15 00:24:12 +00:00
95b0751d0f ipq40xx: do not remove pci@40000000 for ap.dk04.1
This pci@40000000 node from upstream was dropped when the device
was converted from local DTS(I) files to kernel patches in [1] to
ensure that change was purely cosmetic.

However, the DK04.1 has a PCI-E slot by default, so let's keep
(i.e. not remove) the kernel definition now.

[1] c4beac9ea2 ("ipq40xx: use upstream DTS files for IPQ4019/AP-DK04.1")

Suggested-by: Robert Marko <robert.marko@sartura.hr>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-13 18:34:41 +01:00
Robert Marko
4f277b4da5 ipq40xx: 5.4: update and reorder patches
A lot of patches are outdated versions of upstreamed patches and
drivers.

So lets pull in the upstreamed patches and reorder remaining ones.

This drops the unnecessary 721-dts-ipq4019-add-ethernet-essedma-node.patch
which adds nodes for not yet in OpenWrt IPQESS driver.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
[do not touch 902-dts-ipq4019-ap-dk04.1.patch here]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-13 16:08:58 +01:00
Felix Fietkau
a8fb12a7d6 build: filter out more autogenerated kernel config options
Define wildcard patterns for filtering in target/linux/generic/config-filter
Preparation for supporting newer kernels

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-13 13:18:20 +01:00
Felix Fietkau
f307684ab2 kernel: rename mtdpart_get_master to mtd_get_master
Preparation for supporting newer kernels

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-13 13:16:51 +01:00
Felix Fietkau
92b707f61b kernel: ip17xx: use pr_warn instead of pr_warning
Fixes build with newer kernels

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-13 13:16:31 +01:00
Thibaut VARÈNE
41b867165d generic: platform/mikrotik: implement multi caldata
MikroTik recently changed again the way they store wlan calibration data
on devices. Prior to this change, ERD calibration data for all available
radios was stored within a single identifier node ("tag" in RouterBoot
parlance).

Recent devices have been seen with calibration (and BDF) data stored in
separate identifiers within LZOR packing for each radio: this patch
addresses this by:
1) ensuring that both variants are properly supported,
2) preserving backward compatibility with existing data consumers,
3) allowing for more than 2 calibration blobs to be exposed via sysfs.

Specifically, before this patch, the driver would provide a single sysfs
file named /sys/firmware/mikrotik/hard_config/wlan_data that contained
whatever calibration data found on the device's flash. After this patch,
when executed on a device that uses the old style storage, this behavior
is unchanged, but when executed on a device that uses new style storage
(for either traditional "ERD" packing or "LZOR" packing), the driver
replaces that single file with a folder containing one or more files
each containing the data encoded within individual identifiers.

As far as OpenWRT is concerned, this means that for devices which are
known to exist with both styles of data storage, a suitable hotplug stub
could look like this for e.g. the second radio:

wdata="/sys/firmware/mikrotik/hard_config/wlan_data"
( [ -f "$wdata" ] && caldata_sysfsload_from_file "$wdata" 0x8000 0x2f20 ) || \
( [ -d "$wdata" ] && caldata_sysfsload_from_file "$wdata/data_2" 0x0 0x2f20 )

This patch has been tested with LZOR old and new style packing on ipq4019,
and with old style on ath79.

Tested-by: John Thomson <git@johnthomson.fastmail.com.au>
Tested-by: Шебанов Алексей <admin@ublaze.ru>
Tested-by: Alen Opačić <subixonfire@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Tested-by: Robert Marko <robimarko@gmail.com>
2020-11-12 18:21:55 +01:00
Alberto Bursi
ccddc3470c x86: generic: disable CONFIG_EFI_VARS
CONFIG_EFI_VARS has been disabled in 
64bit x86 target in 2018 by the following commit
b0a51dab8c
the same reasons apply to Generic target, so
now it's disabled here too.
Leaving it enabled is also blocking compile as 
a new symbol was added
EFI_CUSTOM_SSDT_OVERLAYS 
that depends from CONFIG_EFI_VARS
and the build system stops and waits for
user input on what to do about it.

The Legacy and Geode targets never
had any EFI_xxx configs enabled so they 
don't have this issue

Signed-off-by: Alberto Bursi <bobafetthotmail@gmail.com>
2020-11-12 18:21:55 +01:00
Birger Koblitz
fba69a5a30 rtl838x: Add switch and ethernet driver support for RTL839x SoCs
This adds support for RTL839x SoCs in the ethernet and switch
drivers of the rtl838x architecture.

Reviewed-by: Andreas Oberritter <obi@saftware.de>
Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2020-11-12 18:21:55 +01:00
Roman Kuzmitskii
02e8182d87 sunxi: add support for Libre Computer ALL-H3-CC H5
Specification:

- CPU: Allwinner H5, Quad-core Cortex-A53 Up to 1GHz
- DDR3 RAM: 2GB
- Network:
    10/100M Ethernet x 1
- IR: x1 (Receive)
- USB (Host) Type-A x3
- USB (OTG) Type-A x1
- MicroSD Slot x 1
- eMMC Slot x1
- MicroUSB power input
- GPIO 40pin header
- UART 3pin header
- Leds:
    - librecomputer:blue:status
    - librecomputer:green:pwr
- Buttons:
    - uboot button (used to enter fel mode)
    - power button (can trigger power on)
- Power Supply via MicroUSB or GPIO 5V/2A

Installation:

- Write the image to SD Card with dd
- Boot from the SD Card

Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
[Fixed Signed-off-by]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-12 18:21:17 +01:00
a51e46e543 ramips: add Xiaomi Mi Router 4A Gigabit explicitly
This device has previously been supported by the image
for Xiaomi Mi Router 3G v2. Since this is not obvious, the
4A is marketed as a new major revision and it also seems to
have a different bootloader, this will be both more tidy and
more helpful for the users.

Apart from that, note that there also is a 100M version of
the device that uses mt7628 platform, so a specifically named
image will also prevent confusion in this area.

Specifications:

- SoC:      MediaTek MT7621
- Flash:    16 MiB NOR SPI
- RAM:      128 MiB DDR3
- Ethernet: 3x 10/100/1000 Mbps (switched, 2xLAN + WAN)
- WIFI0:    MT7603E 2.4GHz 802.11b/g/n
- WIFI1:    MT7612E 5GHz 802.11ac
- Antennas: 4x external (2 per radio), non-detachable
- LEDs:     Programmable "power" LED (two-coloured, yellow/blue)
            Non-programmable "internet" LED (shows WAN activity)
- Buttons:  Reset

Installation:

Bootloader won't accept any serial input unless "boot_wait" u-boot
environment variable is changed to "on".

Vendor firmware won't accept any serial input until "uart_en" is
set to "1".

Using the https://github.com/acecilia/OpenWRTInvasion exploit you
can gain access to shell to enable these options:

To enable uart keyboard actions - 'nvram set uart_en=1'
To make uboot delay boot work - 'nvram set boot_wait=on'
Set boot delay to 5 - 'nvram set bootdelay=5'

Then run 'nvram commit' to make the changes permanent.

Once in the shell (following the OpenWRTInvasion instructions) you
can then run the following to flash OpenWrt and then reboot:

'cd /tmp; curl https://downloads.openwrt.org/...-sysupgrade.bin
  --output firmware.bin; mtd -e OS1 -r write firmware.bin OS1'

Suggested-by: David Bentham <db260179@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-12 17:18:26 +01:00
张鹏
448de2e2e5 ath79: add support for Qxwlan E600G v2 / E600GAC v2
E600G v2 based on Qualcomm/Atheros QCA9531

Specification:

 - 650/600/200 MHz (CPU/DDR/AHB)
 - 128/64 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 2.4 GHz
 - 2 x 10/100 Mbps Ethernet(RJ45)
 - 1 x MiniPCI-e
 - 1 x SIM (3G/4G)
 - 5 x LED , 1 x Button(SW2-Reset Buttun), 1 x power input
 - UART(J100) header on PCB(115200 8N1)

E600GAC v2 based on Qualcomm/Atheros QCA9531 + QCA9887

Specification:

 - 650/600/200 MHz (CPU/DDR/AHB)
 - 128/64 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 2.4 GHz
 - 1T1R 5 GHz
 - 2 x 10/100 Mbps Ethernet(RJ45)
 - 6 x LED (one three-color led), 2 x Button(SW2-Reset Buttun),1 x power input
 - UART (J100)header on PCB(115200 8N1)

Flash instruction:

1.Using tftp mode with UART connection and original OpenWrt image
 - Configure PC with static IP 192.168.1.10 and tftp server.
 - Rename "openwrt-ath79-generic-xxx-squashfs-sysupgrade.bin"
   to "firmware.bin" and place it in tftp server directory.
 - Connect PC with one of LAN ports, power up the router and press
   key "Enter" to access U-Boot CLI.
 - Use the following commands to update the device to OpenWrt:
   run lfw
 - After that the device will reboot and boot to OpenWrt.
 - Wait until all LEDs stops flashing and use the router.

2.Using httpd mode with Web UI connection and original OpenWrt image
 - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
 - Connect PC with one of LAN ports,press the reset button, power up
   the router and keep button pressed for around 6-7 seconds, until
   leds flashing.
 - Open your browser and enter 192.168.1.1,You will see the upgrade
   interface, select "openwrt-ath79-generic-xxx-squashfs-
   sysupgrade.bin" and click the upgrade button.
 - After that the device will reboot and boot to OpenWrt.
 - Wait until all LEDs stops flashing and use the router.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
[rearrange in generic.mk, fix one case in 04_led_migration, update
commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-12 17:18:26 +01:00
Piotr Jurkiewicz
75401550c3 sunxi: fix board.d/01_leds permissions and drop include
The file lacks executable permissions, which makes it not being applied
during the first boot.

While at it, drop unneeded include.

Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
[do not touch board name handling, update commit message/title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-12 17:18:26 +01:00
James McGuire
de768829a5 ramips: add support for D-Link DIR-2640 A1
This patch adds support for D-Link DIR-2640 A1.

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

Notes:
* WiFi 2.4G and WiFi 5G LEDs are wired directly to the wireless chips

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

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

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

MAC addresses:

lan   factory 0xe000     *:a7 (label)
wan   factory 0xe006     *:aa
2.4   factory 0xe000 +1  *:a8
5.0   factory 0xe000 +2  *:a9

Seems like vendor didn't replace the dummy entries in the calibration data.

Signed-off-by: James McGuire <jamesm51@gmail.com>
[fix device definition title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-11 17:35:10 +01:00
Yousong Zhou
c02096361c x86: upgrade: make code comment appear as log lines
The comment content can be useful for readers of both the log and code

Previously when dd command "records in/out" messages are not filtered
like now with get_image_dd, it's not clear that these messages are for
extracting boot sectors.  E.g.

Before

  == upgrade: Reading partition table from bootdisk...
  37+26 records in
  37+26 records out
  == upgrade: Reading partition table from image...

After

  == upgrade: Reading partition table from bootdisk...
  == upgrade: Extract boot sector from the image
  37+26 records in
  37+26 records out
  == upgrade: Reading partition table from image...

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-11-11 21:29:55 +08:00
Yousong Zhou
2e34cfbca7 x86: upgrade: use get_image_dd
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=3140
Reported-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Reviewed-By: Philip Prindeville <philipp@redfish-solutions.com>
2020-11-11 21:29:55 +08:00
Yousong Zhou
31a34076ed x86: upgrade: use v function for writting logs
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-11-11 21:29:55 +08:00
John Audia
a47279154e kernel: bump 5.4 to 5.4.75
Manually rebased patches:
  bcm27xx:
    patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch
  bcm53xx:
    patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch
  layerscape:
    patches-5.4/802-can-0025-can-flexcan-add-LPSR-mode-support-for-i.MX7D.patch
    patches-5.4/808-i2c-0002-MLK-10893-i2c-imx-add-irqf_no_suspend.patch
    patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch

Removed since could be reverse-applied by quilt:
  mediatek:
    patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch

All modifications made by update_kernel.sh

Build system: x86_64
Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711, x86_64
Run-tested: ipq806x/R7800, x86_64

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
Tested-by: Curtis Deptuck <curtdept@me.com> [x86_64]

Rebase of 802-can-0025-can-flexcan-add-LPSR-mode-support-for-i.MX7D.patch
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
2020-11-10 13:11:32 +01:00
Petr Štetiar
fe302d472a rtl838x: fine tune default package set
Althought most of the switches aren't routers, they can be used as such,
so let's add some of the packages from the router's DEVICE_TYPE. While
at it, remove swconfig package which is not needed on DSA targets.

Acked-by: John Crispin <john@phrozen.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-09 21:50:06 +01:00
Paul Spooren
2e282537d0 imagebuilder: fix sstrip
Without an absolute path to staging_dir/host/bin/sstrip the Makefile
tries to run a host installed version of sstrip, which is likely not
available.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-11-09 10:54:30 +00:00
Petr Štetiar
e267445510 rtl838x: dts: use macros for phy and switch definitions
It's quite more readable, saves some tedious copy&pasting, not so
error prone etc.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-09 09:14:02 +01:00
Petr Štetiar
0516aa398c rtl838x: rtl838x.dtsi: fix missing interrupt-parent for uart0
Fixes following dtc warning:

 Warning (interrupts_property): /uart@b8002000: Missing interrupt-parent

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-09 09:14:02 +01:00
Petr Štetiar
2ab6add9b9 rtl838x: rtl838x.dtsi: remove reg property from root node
Fixes following dtc warning:

 ../dts/rtl838x.dtsi:38.3-145.3: Warning (reg_format): /: Root node has a "reg" property

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-09 09:14:02 +01:00
Petr Štetiar
b5bd945733 rtl838x: add support for D-Link DGS-1210-28
Hardware specification
 ----------------------

 * RTL8382M SoC, 1 MIPS 4KEc core @ 500MHz
 * 128MB DRAM
 * 32MB NOR Flash (MX25L25635E)
 * 24 x 10/100/1000BASE-T ports
    - Internal PHY with 8 ports (RTL8218B)
    - Two external PHYs with 8 ports each (RTL8218B)
 * 4 x Gigabit RJ45/SFP Combo ports
    - External PHY with 4 SFP ports (RTL8214FC)
 * Power LED
 * Reset button on front panel
 * UART (115200 8N1) via unpopulated standard 0.1" pin header marked J6

 UART pinout
 -----------

  [oooo]J3 [o]ooo|J6
    |       ^ ||`------ GND
    |       | |`------- RX
    |       | `-------- TX
    |       `---------- Vcc (3V3)
    |
    `------------------ J3 is power input connector nearby J6 UART

 Boot initramfs image from U-Boot
 --------------------------------

  1. Press Escape key during `Hit Esc key to stop autoboot` prompt
  2. Press CTRL+C keys to get into real U-Boot prompt
  3. Init network with `rtk network on` command
  4. Load image with `tftpboot 0x8f000000 openwrt-rtl838x-generic-d-link_dgs-1210-28-initramfs-kernel.bin` command
  5. Boot the image with `bootm` command

To install, upload the sysupgrade image to the OEM webpage or sysupgrade
from the system running from initramfs image.

It has been developed and tested on device with F1 revision.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-09 09:14:02 +01:00
Petr Štetiar
aeb26f8434 rtl838x: d-link_dgs-1210: refactor common family bits
So the common bits can be easily shared with other boards in the family
and while at it add missing SPDX license identifiers into the DTS files
and fixed alphabetic sorting of the devices in the images.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-09 09:14:02 +01:00
Petr Štetiar
b1b8abaf58 rtl838x: clean whitespace issues in rtl8382_d-link_dgs-1210-16.dts
So it's tidy.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-09 09:14:02 +01:00
Roman Kuzmitskii
dd651e54cc octeon: add support for Ubiquiti EdgeRouter 4
Ubiquiti EdgeRouter 4 is 4 port Octeon Cavium 7130 powered router.
It has internal power supply and needs c13 power cord.
There are three 10/100/1000 Mbps RJ45/Copper ports and
one 1000 Mbps SFP port connected directly to a SoC.

SoC:
  Octeon Cavium 7130 (Cavium 3)
  Clocked at 1000Mhz

Memory:
  1 GiB (SK hynix H5TQ4G63CFR-RDC × 2)
  DDR3, clocked at 533 Mhz (1066Mhz effective)
Flash:
  - mtd:
    8 MiB (Macronix MX25L6408EMI-12G)
    used for uboot/eeprom
  - emmc:
    4 GiB (SanDisk SDIN7DP2-4G)
    used for kernel+rootfs
Leds: 1x for power status (white/blue, controllable)
  and 4x for ethernet and sfp ports (no control over them)
Buttons: 1x Reset (from SOC)
Serial: 1x RJ45 port on front panel. 115200 baud, 8N1 (from SoC)
USB: 1x USB3.0 on front panel (from SoC)
MII: 1x QSGMII from SoC is used
PHY: 1x Vitesse VSC8504 of which 4x ports is used

All physical port numbers are properly mapped inside OS and
named by lanX instead of ethX.

There is also special purpose four(4) loopX ports available.
That loopX ports are currently hardcoded by linux kernel
and exact use case of them is currently unknown. We leave them
to the linux kernel and octeon board defaults.

All four (4) physical ports are connected to the same QSGMII.
vsc8504 is used for phys and only 4, 5, 6 and 7 phys are used.

Phy mapping:
 - Phy5 is connected to physical eth0 port
 - Phy6 is connected to physical eth1 port
 - Phy7 is connected to physical eth2 port
 - Phy4 is connected to physical eth3 port

Why this device needs external dts:
 - faster boot time since need to initialize less device tree nodes.
 - to add actual indication with LED about boot/failure/upgrade.
   i.e. user could know when to enter failsafe mode or if upgrade is done
 - reset button support so user can reset their device in case off failure
 - sfp port indication in dmesg with information about sfp module
   it also indicates when module inserted or removed

Octeon quirks:
 - There is no port status available before it interface brought up
 - SFP port can not be tied to actual phy due to octeon-ethernet state
   and currently we can only get reports a about SFP state in dmesg

How to flash the firmware:
  - copy openwrt-octeon-ubnt_edgerouter-4-initramfs-kernel.bin and
    openwrt-octeon-ubnt_edgerouter-4-squashfs-sysupgrade.tar to
    USB flash drive that is formatted to vfat/fat32
  - connect USB flash drive to edgerouter 4 front USB port
  - connect serial cable using front RJ45 port (115200 baud, 8N1)
  - connect power to cable to edgerouter 4
  - connect terminal to the console to see uboot boot process
  - interrupt boot by pressing button(s) on your keyboard to log in to the uboot
  - detect usb connected flash drives by typing to the console:
    usb start
  - after drive is detected load initramfs+kernel to the memory by typing:
    fatload usb 0:1 0x20000000 openwrt-octeon-ubnt_edgerouter-4-initramfs-kernel.bin
  - after initramfs+kernel is loaded to the memory load it by typing:
    bootoctlinux 0 numcores=4 endbootargs mem=0
  - boot process should finish and you will be greeted with console after pressing enter
  - create directory to mount usb flash drive to by typing:
    mkdir /tmp/sda
  - mount flash drive to that directory by typing:
    mount /dev/sda1 /tmp/sda
  - flash firmware to router internal storage by typing:
    sysupgrade /tmp/sda/openwrt-octeon-ubnt_edgerouter-4-squashfs-sysupgrade.tar
  - device will reboot and after it gets up you will have edgerouter 4 running openwrt

Reviewed-by: Johannes Kimmel <fff@bareminimum.eu>
Tested-by: Johannes Kimmel <fff@bareminimum.eu>
Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
2020-11-05 19:29:48 +00:00
Roman Kuzmitskii
577ac8ce84 octeon: honor disabled sgmii device tree nodes
adds patch to octeon ethernet driver that lets sgmii interface
device tree node to be disabled and that disabled interface
won't be unnecessarily initialized.

It solves the problem with octeon boards that have 8 sgmii or more ports
initialized but have nothing connected to them.

Tested-by: Johannes Kimmel <fff@bareminimum.eu>
Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
2020-11-05 19:29:48 +00:00