Commit Graph

25708 Commits

Author SHA1 Message Date
Josef Schlehofer
01520a96e7 mvebu: enable watchdog for Armada 37XX
This option includes support for watchdog timer on Marvell Armada 37xx
SoCs. [1] It is useful e.g. for Turris MOX, Marvell ESPRESSObin

Enable armada-37xx-watchdog driver as built in for mvebu cortex-a53,
so that kernel can start serving as soon as the driver is probed, until userspace takes over it.

[1] https://cateee.net/lkddb/web-lkddb/ARMADA_37XX_WATCHDOG.html

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(improved commit message, 2nd paragraph)
Signed-off-by: Marek Behún <kabel@kernel.org>
2022-01-15 17:41:19 +01:00
Marek Behún
43659a7d74 mvebu: cortexa53: Enable Armada 37xx rWTM driver
Enabling Armada 37xx rWTM driver. This gives the kernel access to random
number generator, if provided by the rWTM firmware.

Note that the driver is called turris-mox-rwtm because it was initially
written for Turris MOX, but will also work on other Armada 37xx
platforms, if they use rWTM firmware from CZ.NIC [1].

It makes sense to have this driver built-in, so that kernel has access
to random number generator without needing to load any drivers.

[1] https://gitlab.nic.cz/turris/mox-boot-builder

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andre Heider <a.heider@gmail.com>
2022-01-15 17:41:18 +01:00
Marek Behún
bf991fa357 kernel: 5.10: Backport pending Armada 3720 comphy patches
Backport 5 pending patches [1] for Armada 3720 comphy driver and one
patch for device tree, applied to mvebu-dt64, but pending to appear in
Linus' tree [2].

These patches makes the driver work correctly even with older, buggy
versions of TF-A firmware.

[1] http://lists.infradead.org/pipermail/linux-phy/2022-January/002598.html
[2] http://lists.infradead.org/pipermail/linux-phy/2021-December/002279.html

Signed-off-by: Marek Behún <kabel@kernel.org>
2022-01-15 17:26:55 +01:00
Marek Behún
cf3a6e62a1 kernel: 5.10: Backport Armada 3720 comphy patches from 5.15
Backport 2 patches for Armada 3720 comphy from 5.15 kernel.

These are needed for clear application of pending patches that fix this
driver.

Signed-off-by: Marek Behún <kabel@kernel.org>
2022-01-15 17:26:55 +01:00
Marek Behún
080691d7b1 kernel: 5.10: Backport pending pci-aardvark changes fixing MSI support
Backport Aardvark PCIe controller driver changes that fix MSI support,
that were recently sent to the linux-pci mailing list [1].

These changes fix MSI and MSI-X support for this PCIe controller, which,
among other things, make it possible to use NVMe drives with this PCIe
controllers.

[1] https://lore.kernel.org/linux-pci/20220110015018.26359-1-kabel@kernel.org/

Signed-off-by: Marek Behún <kabel@kernel.org>
2022-01-15 17:26:55 +01:00
Marek Behún
612e1c6801 kernel: 5.10: Backport pci-aardvark driver changes from 5.17
Backport Aardvark PCIe controller driver changes that will appear in
5.17 kernel. They are currently accessible on LKML [1], in linux-next
repository [2], or in Bjorn Helgaas' repository [3].

These changes mainly enhance driver removal method.

[1] https://lore.kernel.org/linux-pci/20211130172913.9727-1-kabel@kernel.org/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/drivers/pci?h=next-20220107
[3] https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/log/?h=next

Signed-off-by: Marek Behún <kabel@kernel.org>
2022-01-15 17:26:55 +01:00
Josef Schlehofer
9d530ac4bf mvebu: kernel: enable CONFIG_BLK_DEV_NVME
CONFIG_BLK_DEV_NVME [1]:
- This is a kernel driver for SSD connected to PCI or PCIe bus [1].
By default, it is enabled for targets "ipq807x", "rockchip/armv8"
and "x86/64".

With miniPCIe adapter, there is a possibility to connect NVMe disk
to Turris Omnia (cortex-a9), Turris MOX (cortex-a53).

It allows to boot system from NVMe disk, because of that it can not
be kmod package as you can not access the disk to be able to boot from
it.

CONFIG_NVME_CORE [2]:
- This is selected by CONFIG_BLK_DEV_NVME
It does not need to be explicitly enabled, but it is done for "ipq807",
"x64_64" and rockchip/armv8", which has also enabled the previous config
option as well.

Kernel increase: ~28k KiB on mamba kernel

Reference:
[1] https://cateee.net/lkddb/web-lkddb/BLK_DEV_NVME.html
[2] https://cateee.net/lkddb/web-lkddb/NVME_CORE.html

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2022-01-15 17:26:55 +01:00
Christian Lamparter
cfc13c4459 ipq40xx: utilize nvmem-cells for macs & (pre-)calibration data
moves extraction entries out of 11-ath10k-caldata and into
the individual board's device-tree.

Some notes:
 - mmc could work as well (not tested)
 - devices that pass the partitions via mtdparts
   bootargs are kept as is
 - gl-b2200 has a weird pcie wifi device
   (vendor claims 9886 wave 2. But firmware-extraction
   was for a wave 1 device?!)

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-01-15 17:26:55 +01:00
Christian Lamparter
10bc55c496 ipq40xx: add RT-ACRH13 alternative name to RT-AC58U
RT-ACRH13 is another name this device was sold as (US?).

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-01-15 17:26:55 +01:00
Joshua Roys
51b9aef553 ipq40xx: add support for ASUS RT-ACRH17/RT-AC42U
SOC:	IPQ4019
CPU:	Quad-core ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
DRAM:	256 MB
NAND:	128 MiB Macronix MX30LF1G18AC
ETH:	Qualcomm Atheros QCA8075 Gigabit Switch (4x LAN, 1x WAN)
USB:	1x 3.0 (via Synopsys DesignWare DWC3 controller in the SoC)
WLAN1:	Qualcomm Atheros QCA4019 2.4GHz 802.11bgn 2x2:2
WLAN2:	Qualcomm Atheros QCA9984 5GHz 802.11nac 4x4:4
INPUT:	1x WPS, 1x Reset
LEDS:	Status, WIFI1, WIFI2, WAN (red & blue), 4x LAN

This board is very similar to the RT-ACRH13/RT-AC58U. It must be flashed
with an intermediary initramfs image, the jffs2 ubi volume deleted, and
then finally a sysupgrade with the final image performed.

Signed-off-by: Joshua Roys <roysjosh@gmail.com>
(added ALT0)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-01-15 17:21:01 +01:00
Michael Pratt
74516f4357 ramips: fix reboot for remaining 32 MB boards
The following devices have a Winbond W25Q256FV flash chip,
which does not have the RESET pin enabled by default,
and otherwise would require setting a bit in a status register.

Before moving to Linux 5.4, we had the patch:
0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch
which kept specific flash chips with explicit 3-byte and 4-byte address modes
to stay in 3-byte address mode while idle (after an erase or write)
by using a custom flag SPI_NOR_4B_READ_OP that was part of the patch.

this was obsoleted by the patch:
481-mtd-spi-nor-rework-broken-flash-reset-support.patch
which uses the newer upstream flag SNOR_F_BROKEN_RESET
for devices with a flash chip that cannot be hardware reset with RESET pin
and therefore must be left in 3-byte address mode when idle.

The new patch requires that the DTS of affected devices
have the property "broken-flash-reset", which was not yet added for most of them.

This commit adds the property for remaining affected devices in ramips target,
specifically because of the flash chip model.

However, it is possible that there are other devices
where the flash chip uses an explicit 4-byte address mode
and the RESET pin is not connected to the SOC on the board,
and those DTS would also need this property.

Ref: 22d982ea00 ("ramips: add support for switching between 3-byte and 4-byte addressing")
Ref: dfa521f129 ("generic: spi-nor: rework broken-flash-reset")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
2022-01-15 17:12:12 +01:00
Paul Spooren
daae59b729 at91: drop /etc/config/firewall
The file can't be part of base files or the base-files and firewall
packages collide. Two packages must not provide the same config files
without having a defined CONFLICT since it would result in an
undeterministic config state depending on what package is installed
last.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2022-01-15 16:36:28 +01:00
SeongUk Moon
9c8ccdcdc8 ramips: add support for ipTIME A6004NS-M
ipTIME A6004NS-M is a 2.4/5GHz band AC1900 router, based on MediaTek MT7621A.

Specifications:
- SoC: MediaTek MT7621A (880MHz, Duel-Core)
- RAM: DDR3 256MB
- Flash: SPI NOR 16MB (Winbond W25Q128BV)
- WiFi: MediaTek MT7615E (2.4GHz, 5GHz)
- Ethernet: MediaTek MT7530 (WAN x1, LAN x4, SoC built-in Estimated)
- USB: USB 3.0 x1
- UART: [3.3V, TX, RX, GND] (57600 8N1)

Installation via web interface:
1. Flash initramfs image using OEM's Firmware Update page.
2. Connect to OpenWrt with an SSH connection to `192.168.1.1`.
3. Perform sysupgrade with sysupgrade image.

Revert to stock firmware:
1.  Flash stock firmware via OEM's Recovery mode

How to use OEM's Recovery mode:
1. Power on the device and connect the shell through UART.
2. Connect to the shell and press the `t` key on the keyboard.
3. Set fixed IP with  `192.168.0.2`  with subnet mask  `255.255.255.0`
4. Flash image via TFTP to  `192.168.0.1`

Additional Notes:
1. The higher the 5Ghz Frequency, the lower the stability. It is recommended to use less than 5.775Ghz.
2. If the 5Ghz frequency is too high, 5Ghz may not work.
3. A6ns-M use shared dtsi file of A6004NS-M. (reference: /mt7621_iptime_a6004ns-m.dtsi).

Signed-off-by: SeongUk Moon <antegral@antegral.net>
[convert CRLF to LF]
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2022-01-15 20:43:14 +09:00
Kyoungkyu Park
6041c693dd ramips: add support for HUMAX E2
HUMAX E2 (also known as HUMAX QUANTUM E2) is a 2.4/5GHz band AC router,
based on MediaTek MT7620A.

Specifications:
- SoC: MT7620A
- RAM: DDR2 64MB
- Flash: SPI NOR 8MB (MXIC MX25L6405D)
- WiFi:
  - 2.4GHz: SoC internal
  - 5GHz: MT7610E
- Ethernet: 1x 10/100Mbps
  - Switch: SoC internal
- UART: J2 (57600 8N1)
  - pinout: [3V3] (RXD) (GND) (TXD)

Installation and Recovery via TFTP:
1. Connect ethernet cable between Router port and PC Ethernet port.
2. Set your computer to a static IP **192.168.1.1**
3. Turn the device off and wait a few seconds. Hold the WPS button on front
   of device and insert power.
4. Send a firmware image to **192.168.1.6** using TFTP.
   You can use any TFTP client. (tftp, curl, Tftpd64...)
5. Wait until Power LED stop flashing. **DO NOT TURN OFF DEVICE!**
   The device will be automatically rebooted.

Signed-off-by: Kyoungkyu Park <choryu.park@choryu.space>
2022-01-15 20:05:46 +09:00
David Bauer
7f7705923a lantiq: add additional caldata offsets
It was reported the AVM FritzBox 7430 has different offsets for the
caldata depending on the device.

Whether this is due to custom bad-block handling or up to the installed
bootloader-version is unknown.

Try both known caldata offsets like it is already done for the ipq40xx
NAND based models. Use the same approach for the FritzBox 7412. While it
is currently unknown, whether it is affected, applying the same logic
has no downsides.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-01-15 11:27:53 +01:00
David Bauer
3154537864 lantiq: flag FritzBox 7360 family buttons active-low
All buttons of the FritzBox 7360 family are active-low, not active-high.
Corrent the GPIO flag. This fixes release triggers upon push of a button.

Reported-by: Jan-Niklas Burfeind <git@aiyionpri.me>
Signed-off-by: David Bauer <mail@david-bauer.net>
2022-01-14 22:12:53 +01:00
David Woodhouse
557067d9b1 mediatek: mt7623: Enable PCIe bus 0 (and thus SATA) on U7623
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2022-01-14 19:43:45 +00:00
Felix Fietkau
83b14ec026 ramips: enable badblock table support on linksys ea7xxx devices
Use remapping only on the kernel partitions.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-13 18:33:06 +01:00
Felix Fietkau
e2aa04d1e5 kernel: mtk_bmt: add support for the bbt format used on mt7621
This does not have spare blocks for remapping, and it is also not suitable
for random write access. It only skips over bad blocks on linear writes of an
image to a partition. As such, it is really only suitable for the kernel
partition, or other partitions with mostly static data

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-13 18:33:06 +01:00
Felix Fietkau
ff6b4f2cfb kernel: mtk_bmt: add abstraction for supporting other formats
Preparation for supporting remapping on MT7621

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-13 18:33:06 +01:00
Felix Fietkau
3c78fabb0d ramips: mt7621_nand: fix writing upper half of fdm data
Since the loop iterates from 0-3, subtracting 4 from the shift
multiplier does not make any sense

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-13 18:33:06 +01:00
Felix Fietkau
76b27f6bb9 mediatek: rework and fix mt7622-rfb1-ubi support
Limit bmt remapping range to cover everything up to and including the kernel image,
use the rest of the flash area for ubi.
Fix partition table and sysupgrade support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-13 18:33:06 +01:00
Felix Fietkau
7235c8d00c kernel: mtk_bmt: remap blocks after reaching bitflip threshold
This ensures that blocks are remapped before data becomes corrupt

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-13 18:33:06 +01:00
Felix Fietkau
0ddead0897 kernel: mtk_bmt: pass number of bitflips on read to the caller
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-13 18:33:06 +01:00
Felix Fietkau
b86452f841 kernel: mtk_bmt: add support for limiting range of remapping
This can be used to support ubi on top of mtk_bmt without reflashing the
boot loader. The boot loader + factory + kernel area is covered, while the
rest is passed through as-is

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-13 18:33:06 +01:00
Felix Fietkau
31b6cfb288 kernel: mtk_bmt: extend debug interface
Add support for showing remapped blocks and garbage collecting old
remapped blocks triggered by using the mark_good/mark_bad files

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-13 18:33:06 +01:00
Felix Fietkau
fde2421597 kernel: mtk_bmt: fix remapping after read/write failure
Copy from the previous block in order to preserve existing data

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-13 18:33:06 +01:00
Felix Fietkau
bcf91fe884 kernel: move mediatek BMT support patch to generic patches
Preparation for supporting BMT on MT7621. Move source files to the files/
subdirectory in order to simplify maintenance

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-13 18:33:06 +01:00
Denis Kalashnikov
2d19e6c6a4 generic: platform/mikrotik: use MTD notifier
If the SPI probe is sufficiently delayed, the routerboot driver may fail
to init as the routerboot partitions are not yet available.

Register an MTD user notifier instead of doing straight init so that the
init subroutines are only executed when the target MTD partitions are
present.

Because the init/exit routines can now be called outside of the kernel
normal init/exit calls, they cannot be jettisoned and must always be
available: the __init and __exit qualifiers are thus removed.

Reported-by: Denis Kalashnikov <denis281089@gmail.com>
Signed-off-by: Denis Kalashnikov <denis281089@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Reviewed-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
[bump hardconfig/softconfig versions]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2022-01-13 09:33:29 +01:00
Koen Vandeputte
9571d9d4b1 ath79: qca955x: remove double declaration
No need to mention the same value twice

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2022-01-13 09:33:29 +01:00
Koen Vandeputte
f11df68956 ath79: rb912: remove unused property
ar934x does not define property 'rgmii-enabled' in the parsing code
remove it

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2022-01-13 09:33:29 +01:00
Koen Vandeputte
2a00054618 ath79: rb912: fix pll init issues
It was reported that some rb912 boards (ar934x) have issues with some ethernet speeds.
Investigation shows that the board failed to adapt the ethernet pll values as shown here:

[    5.284359] ag71xx 19000000.eth: failed to read pll-handle property

added custom prints in code and triggering a link switch:

[   62.821446] Atheros AG71xx: fast reset
[   62.826442] Atheros AG71xx: update pll 2
[   62.830494] Atheros AG71xx: no pll regmap!

Comparison with another very similar board (rb922 - QCA955x) showed a missing
reference clock frequency in dts, which seems to cause a pll init issue.
Unfortunately, no errors are printed when this occurs.

Adding the frequency property fixes the pll init as it can be parsed now
by the ethernet driver.

[   55.861407] Atheros AG71xx: fast reset
[   55.866403] Atheros AG71xx: update pll 2
[   55.870462] Atheros AG71xx: ath79_set_pllval: regmap: 0x81548000, pll_reg: 0x2c, pll_val: 0x02000000

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2022-01-13 09:33:29 +01:00
Oskari Lemmela
fdda3130f2 mikrotik: make soft_config writable
Parent mtd partition needs to be writable

Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
2022-01-13 09:33:29 +01:00
Oskari Lemmela
8441a622ec mikrotik: enable variable size erase
Add support for variable size erase blocks.
Enable it to all targets which has mikrotik targets.

Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
2022-01-13 09:33:29 +01:00
Oskari Lemmela
6eb196ed0f generic: platform/mikrotik: make soft_config writable without 4K sectors
Make soft_config writable in all cases. Performing soft_config commit
will fail if mtd partition is not writable.

Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
[bump rb_softconfig version number]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2022-01-13 09:33:29 +01:00
Koen Vandeputte
2bb7c1db70 imx: bump SDMA firmware to v3.6
No changelog available

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2022-01-13 09:33:29 +01:00
Daniel Golle
f2c3875dfc
generic: deny write to uImage.FIT sub-image partitions
Set policy bit to force read-only mode on uImage.FIT filesystem
sub-images mapped as block partitions by the FIT partition parser.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-01-11 00:06:16 +00:00
David Woodhouse
8cdc356f8c mediatek: mt7623: Re-enable ARM arch timer
CONFIG_ARM_ARCH_TIMER cannot be enabled in the config directly; it is only
selected by CONFIG_HAVE_ARM_ARCH_TIMER. We need to enable the latter in
our config.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Fixes: 4f1c5b01c1 ("mediatek: mt7623: backport musb, improve HDMI console")
2022-01-10 13:45:41 +00:00
David Woodhouse
4648a60058 mediatek: mt7623: Disable power button reset for U7623-02 board
The Unielec U7623 doesn't have a physical power button; I think it's hard
wired so that it turns on automatically when power is applied (unlike the
Banana Pi R2 which is a pain).

So the 'reset on long press of power button' behaviour that we get when
we enable the PMIC keyboard driver is kind of unhelpful. Disable it.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Fixes: 0d3f3323a2 ("mediatek: mt7623: enable more hardware features")
2022-01-10 13:45:41 +00:00
Sven Eckelmann
97f5617259 ath79: Add support for OpenMesh OM5P-AC v1
Device specifications:
======================

* Qualcomm/Atheros QCA9558 ver 1 rev 0
* 720/600/240 MHz (CPU/DDR/AHB)
* 128 MB of RAM
* 16 MB of SPI NOR flash
  - 2x 7 MB available; but one of the 7 MB regions is the recovery image
* 2T2R 2.4 GHz Wi-Fi (11n)
* 2T2R 5 GHz Wi-Fi (11ac)
* 6x GPIO-LEDs (3x wifi, 2x ethernet, 1x power)
* external h/w watchdog (enabled by default))
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* TI tmp423 (package kmod-hwmon-tmp421) for temperature monitoring
* 2x ethernet
  - eth0
    + AR8035 ethernet PHY (RGMII)
    + 10/100/1000 Mbps Ethernet
    + 802.3af POE
    + used as LAN interface
  - eth1
    + AR8035 ethernet PHY (SGMII)
    + 10/100/1000 Mbps Ethernet
    + 18-24V passive POE (mode B)
    + used as WAN interface
* 12-24V 1A DC
* internal antennas

Flashing instructions:
======================

Various methods can be used to install the actual image on the flash.
Two easy ones are:

ap51-flash
----------

The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the image to the u-boot when the device boots up.

initramfs from TFTP
-------------------

The serial console must be used to access the u-boot shell during bootup.
It can then be used to first boot up the initramfs image from a TFTP server
(here with the IP 192.168.1.21):

   setenv serverip 192.168.1.21
   setenv ipaddr 192.168.1.1
   tftpboot 0c00000 <filename-of-initramfs-kernel>.bin && bootm $fileaddr

The actual sysupgrade image can then be transferred (on the LAN port) to the
device via

  scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/

On the device, the sysupgrade must then be started using

  sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-01-09 21:12:28 +01:00
Sven Eckelmann
72ef594550 ath79: Add support for OpenMesh OM5P-AN
Device specifications:
======================

* Qualcomm/Atheros AR9344 rev 2
* 560/450/225 MHz (CPU/DDR/AHB)
* 64 MB of RAM
* 16 MB of SPI NOR flash
  - 2x 7 MB available; but one of the 7 MB regions is the recovery image
* 1T1R 2.4 GHz Wi-Fi
* 2T2R 5 GHz Wi-Fi
* 6x GPIO-LEDs (3x wifi, 2x ethernet, 1x power)
* 1x GPIO-button (reset)
* external h/w watchdog (enabled by default)
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* TI tmp423 (package kmod-hwmon-tmp421) for temperature monitoring
* 2x ethernet
  - eth0
    + AR8035 ethernet PHY
    + 10/100/1000 Mbps Ethernet
    + 802.3af POE
    + used as LAN interface
  - eth1
    + 10/100 Mbps Ethernet
    + builtin switch port 1
    + 18-24V passive POE (mode B)
    + used as WAN interface
* 12-24V 1A DC
* internal antennas

Flashing instructions:
======================

Various methods can be used to install the actual image on the flash.
Two easy ones are:

ap51-flash
----------

The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the image to the u-boot when the device boots up.

initramfs from TFTP
-------------------

The serial console must be used to access the u-boot shell during bootup.
It can then be used to first boot up the initramfs image from a TFTP server
(here with the IP 192.168.1.21):

   setenv serverip 192.168.1.21
   setenv ipaddr 192.168.1.1
   tftpboot 0c00000 <filename-of-initramfs-kernel>.bin && bootm $fileaddr

The actual sysupgrade image can then be transferred (on the LAN port) to the
device via

  scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/

On the device, the sysupgrade must then be started using

  sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-01-09 21:12:28 +01:00
Tamas Balogh
b29f4cf34c ath79: add support for ASUS RP-AC66
Asus RP-AC66 Repeater

Hardware specifications:
Board: AP152
SoC: QCA9563
DRAM: 64MB DDR2
Flash: 25l128 16MB SPI-NOR
LAN/WAN: 1x1000M QCA8033
WiFi 5GHz: QCA9880
Clocks: CPU:775.000MHz, DDR:650.000MHz, AHB:258.333MHz, Ref:25.000MHz

MAC addresses as verified by OEM firmware:
use            address   source
Lan/Wan   *:24         art 0x1002 (label)
2G             *:24         art 0x1002
5G             *:26         art 0x5006

Installation:

Asus windows recovery tool:
 - install the Asus firmware restoration utility
 - unplug the router, hold the reset button while powering it on
 - release when the power LED flashes slowly
 - specify a static IP on your computer:
     IP address: 192.168.1.75
     Subnet mask 255.255.255.0
 - Start the Asus firmware restoration utility, specify the factory image
    and press upload
 - Do not power off the device after OpenWrt has booted until the LED flashing.

TFTP Recovery method:
 - set computer to a static ip, 192.168.1.75
 - connect computer to the LAN 1 port of the router
 - hold the reset button while powering on the router for a few seconds
 - send firmware image using a tftp client; i.e from linux:
 $ tftp
 tftp> binary
 tftp> connect 192.168.1.1
 tftp> put factory.bin
 tftp> quit

Signed-off-by: Tamas Balogh <tamasbalogh@hotmail.com>
2022-01-09 20:32:41 +01:00
Fritz D. Ansel
693958497a mediatek mt7622: fix 300mhz typo in dts
The lowest frequency should be 300MHz, since that is the label
assigned to the OPP in the mt7622.dtsi device tree, while there is one
missing zero in the actual value.

To be clear, the lowest frequency should be 300MHz instead of 30MHz.

As mentioned @dangowrt on the OpenWrt forum there is no benefit in
leaving 30MHz as the lowest frequency.

Signed-off-by: Jip de Beer <gpk6x3591g0l@opayq.com>
Signed-off-by: Fritz D. Ansel <fdansel@yandex.ru>
2022-01-09 14:48:16 +00:00
Stefan Lippers-Hollmann
abc2821286 x86: improve sysinfo handling of dummy values
Fall back to using board_vendor and board_name, if known dummy values
are used for sys_vendor and product_name.

Examples:
	To be filled by O.E.M.:To be filled by O.E.M.
-->	INTEL Corporation:ChiefRiver

	System manufacturer:System Product Name
-->	ASUSTeK COMPUTER INC.:P8H77-M PRO

	To Be Filled By O.E.M.:To Be Filled By O.E.M.
-->	ASRock:Q1900DC-ITX

	Gigabyte Technology Co., Ltd.:To be filled by O.E.M.
-->	Gigabyte Technology Co., Ltd.:H77M-D3H

	empty:empty
-->	TYAN Computer Corporation:TYAN Toledo i3210W/i3200R S5211

	To Be Filled By O.E.M.:To Be Filled By O.E.M.
-->	ASRock:H77 Pro4-M

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
2022-01-08 23:25:05 +01:00
Alex Lewontin
62a2bfaff8 ipq806x: janitorial work, respect line lengths
This commit breaks up some lines so that they are shorter than
74 charcters.

Signed-off-by: Alex Lewontin <alex.c.lewontin@gmail.com>
2022-01-08 23:25:05 +01:00
Alex Lewontin
479acf03cc ipq806x: modularize generic subtarget
This commit moves the device profiles within the ipq806x/generic
subtarget into their own includable .mk file, to support eventually
having subtargets other than generic.

Signed-off-by: Alex Lewontin <alex.c.lewontin@gmail.com>
2022-01-08 23:25:05 +01:00
Aleksander Jan Bajkowski
46468fc9d5 lantiq: replace patches with version accepted upstream
Replace recently added patches with version accepted upstream.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2022-01-08 19:32:45 +01:00
Nick McKinney
e0a574d4b7 ramips: add support for Linksys EA6350 v4
Specifications:
- SoC: MT7621DAT (880MHz, 2 Cores)
- RAM: 128 MB
- Flash: 128 MB NAND
- Ethernet: 5x 1GiE MT7530
- WiFi: MT7603/MT7613
- USB: 1x USB 3.0

This is another MT7621 device, very similar to other Linksys EA7300
series devices.

Installation:

Upload the generated factory.bin image via the stock web firmware
updater.

Reverting to factory firmware:

Like other EA7300 devices, this device has an A/B router configuration
to prevent bricking.  Hard-resetting this device three (3) times will
put the device in failsafe (default) mode.  At this point, flash the
OEM image to itself and reboot.  This puts the router back into the 'B'
image and allows for a firmware upgrade.

Troubleshooting:

If the firmware will not boot, first restore the factory as described
above.  This will then allow the factory.bin update to be applied
properly.

Signed-off-by: Nick McKinney <nick@ndmckinney.net>
2022-01-08 00:49:59 +01:00
Liangkuan Yang
bc7d36ba3a ramips: add support for RAISECOM MSG1500 X.00
RAISECOM MSG1500 X.00 is a 2.4/5 GHz band 11ac (Wi-Fi 5) router.
Apart from the general model, there are two ISP customized models:
China Mobile and China Telecom.

Specifications:

- SoC: Mediatek MT7621AT
- RAM: 256MiB DDR3
- Flash: 128MiB NAND
- Ethernet: 5 * 10/100/1000Mbps: 4 * LAN + 1 * WAN
  - Switch: MediaTek MT7530 (SoC)
- WLAN: 1 * MT7615DN Dual-Band 2.4GHz 2T2R (400Mbps) 5GHz 2T2R (867Mbps)
- USB: 1 * USB 2.0 port
- Button: 1 * RESET button, 1 * WPS button, 1 * WIFI button
- LED: blue color: POWER, WAN, WPS, 2.4G, 5G, LAN1, LAN2, LAN3, LAN4, USB
- UART: 1 * serial port header (4-pin)
- Power: DC 12V, 1A
  - Switch: 1 * POWER switch

MAC addresses as verified by vendor firmware:

use   address             source
LAN   C8:XX:XX:3A:XX:E7   Config   "protest_lan_mac"  ascii  (label)
WAN   C8:XX:XX:3A:XX:EA   Config   "protest_wan_mac"  ascii
5G    C8:XX:XX:3A:XX:E8   Factory  "0x4"              hex
2.4G  CA:XX:XX:4A:XX:E8   [not on flash]

The increment of the 4th byte for the 2.4g address appears to vary.
Reported cases:

       5g                 2.4g         increment
 C8:XX:XX:90:XX:C3  CA:XX:XX:C0:XX:C3  0x30
 C8:XX:XX:3A:XX:08  CA:XX:XX:4A:XX:08  0x10
 C8:XX:XX:3A:XX:E8  CA:XX:XX:4A:XX:E8  0x10

Since increment is inconsistent and there is no obvious pattern
in swapping bytes, and the 2.4g address has local bit set anyway,
it seems safer to use the LAN address with flipped byte here in
order to prevent collisions between OpenWrt devices and OEM devices
for this interface. This way we at least use an address as base
that is definitely owned by the device at hand.

Notes:

1. The vendor firmware allows you to connect to the router by telnet.
   (known version 1.0.0 can open telnet.)
   There is no official binary firmware available.
   Backup the important partitions data:
   "Bootloader", "Config", "Factory", and "firmware".
   Note that with the vendor firmware the memory is detected only 128MiB
   and the last 512KiB in NAND flash is not used.

2. The POWER LED is default on after press POWER switch.
   The WAN and LAN1 - 4 LEDs are wired to ethernet switch.
   The WPS LED is controlled by MT7615DN's GPIO.
   Currently there is no proper way to configure it.

3. At the time of adding support the wireless config needs to be set up
   by editing the wireless config file:

 * Setting the country code is mandatory, otherwise the router loses
   connectivity at the next reboot. This is mandatory and can be done
   from luci. After setting the country code the router boots correctly.
   A reset with the reset button will fix the issue and the user has to
   reconfigure.

 * This is minor since the 5g interface does not come up online although
   it is not set as disabled. 2 options here:

   1- Either run the "wifi" command. Can be added from LuCI in system -
      startup - local startup and just add wifi above "exit 0".

   2- Or add the serialize option in the wireless config file as shown
      below. This one would work and bring both interfaces automatically
      at every boot:

      config wifi-device 'radio0'
          option serialize '1'

      config wifi-device 'radio1'
          option serialize '1'

Flash instructions using initramfs image:

1. Press POWER switch to power down if the router is running.

2. Connect PC to one of LAN ports, and set
   static IP address to "10.10.10.2", netmask to "255.255.255.0",
   and gateway to "10.10.10.1" manually on the PC.

3. Push and hold the WIFI button, and then power up the router.
   After about 10s (or you can call the recovery page, see "4" below)
   you can release the WIFI button.
   There is no clear indication when the router
   is entering or has entered into "RAISECOM Router Recovery Mode".

4. Call the recovery page for the router at "http://10.10.10.1".
   Keep an eye on the "WARNING!! tip" of the recovery page.
   Click "Choose File" to select initramfs image, then click "Upload".

5. If image is uploaded successfully, you will see the page display
   "Device is upgrading the firmware... %".
   Keep an eye on the "WARNING!! tip" of the recovery page.
   When the page display "Upgrade Successfully",
   you can set IP address as "automatically obtain".

6. After the rebooting (PC should automatically obtain an IP address),
   open the SSH connection, then download the sysupgrade image
   to the router and perform sysupgrade with it.

Flash back to vendor firmware:

 See "Flash instructions 1 - 5" above.
 The only difference is that in step 4
 you should select the vendor firmware which you backup.

Signed-off-by: Liangkuan Yang <ylk951207@gmail.com>
2022-01-08 00:49:59 +01:00
Rodrigo Araujo
766733e172 ramips: add support for Joowin WR758AC V1 and V2
This commit adds support for Joowin (aka Comfast) WR758AC V1 and V2
devices.

Both have the same wall AP/repeater form factor and differ only
in the 5Ghz chipset (V1 has MT7662, V2 has MT7663).

OpenWrt developers forum page:
https://forum.openwrt.org/t/87355

Specifications:

 - CPU: MediaTek MT7628AN (580MHz)
 - Flash: 8MB
 - RAM: 64MB DDR2
 - 2.4 GHz: 802.11b/g/n (MT7603)
 - 5 GHz: 802.11ac (V1 has MT7662, V2 has MT7663)
 - Antennas: 4x external single band antennas
 - LAN: 1x 10/100M
 - LED: Wifi 3x blue. Programmable
 - Button: WPS

MAC addresses as verified by OEM firmware:

use address source
LAN *:83 factory 0xe000
2g *:85 factory 0x4
5g *:86 factory 0x8004

How to install:
1- Setup a TFTP server on a machine with IP address 192.168.1.10/24
2- Name the image as `firmware_auto.bin` and place it on the root of the
TFTP server
3- Connect the device via Ethernet, it should pick and flash the image

Signed-off-by: Rodrigo Araujo <araujo.rm@gmail.com>
2022-01-08 00:49:59 +01:00