Commit Graph

25647 Commits

Author SHA1 Message Date
Paul Spooren
493b60d044 bcm63xx: switch to Kernel 5.10
Bump the last missing target to Kernel 5.10. While this requires a work
around to boot it will allow more people to test the new Kernel before
the upcomming release.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2022-02-27 14:41:28 +01:00
Paul Spooren
c3ccc4529d bcm63xx: fix booting with Kernel 5.10
This is a workaround to make the target overall bootable. With this more
people should be able to test the Kernel 5.10 and report further issues.

Suggested-by: Daniel González Cabanelas <dgcbueu@gmail.com>
Signed-off-by: Paul Spooren <mail@aparcar.org>
2022-02-27 14:41:28 +01:00
Stijn Tintel
a1b8a4d7b3 ramips: support TP-Link EAP615-Wall
Add support for the TP-Link EAP615-Wall, an AX1800 Wall Plate WiFi 6 AP.
The device is very similar to the TP-Link EAP235-Wall.

Hardware:
* SoC: MediaTek MT7621AT
* RAM: 128MiB
* Flash: 16MiB SPI-NOR
* Ethernet: 4x GbE
  * Back: ETH0 (PoE-PD)
  * Bottom: ETH1, ETH2, ETH3 (PoE passthrough)
* WiFi: MT7905DAN/MT7975DN 2.4/5 GHz 2T2R
* LEDS: 1x white
* Buttons: 1x LED, 1x reset

Stock firmware uses a random MAC address for ethernet. OpenWrt uses the
MAC address that is on the device label for ethernet and the wireless
interfaces. MAC address must not be incremented, as this will cause MAC
address conflicts in case you have two devices with consecutive MAC
addresses. Instead, different locally administered addresses will be
generated automatically, based on the MAC on the label.

Installation via stock firmware:
* Enable SSH in the TP-Link web interface
* SSH to the device
* Run `cliclientd stopcs`
* Upload the OpenWrt factory image via the TP-Link web interface

Installation via bootloader:
* Solder TTL header. Pinout: 1: TX, 2: RX, 3: GND, 4: VCC, with pin 1
  closest to ETH1. Baud rate 115200
* Interrupt boot process by holding a key during boot
* Boot the OpenWrt initramfs:
  # tftpboot 0x84000000 openwrt-ramips-mt7621-tplink_eap615-wall-v1-initramfs-kernel.bin
  # bootm
* Copy openwrt-ramips-mt7621-tplink_eap615-wall-v1-squashfs-sysupgrade.bin
  to /tmp and use sysupgrade to install it

Thanks to Sander Vanheule for his work on the EAP235-Wall, which made
adding support for the EAP615-Wall very easy.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Reviewed-by: Sander Vanheule <sander@svanheule.net>
Acked-by: Arınç ÜNAL <arinc.unal@arinc9.com>
2022-02-27 12:01:22 +02:00
Claudiu Beznea
d52bf5a424 at91: remove pm debug features from sama5 kernel config
Remove PM debug features from sama5 kernel config. It is not
necessary to have it on production code. This also fixes the
build for sama5 target after commit 97158fe10e ("kernel:
package ramoops pstore-ram crash log storage)

Fixes: 97158fe10e ("kernel: package ramoops pstore-ram crash log storage")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2022-02-26 19:52:41 +01:00
Hannu Nyman
ec32c4ef01 ipq806x: Increase kernel size to 4 MB for EA8500/EA7500v1
Increase the kernel size from 3 MB to 4 MB for EA8500 and EA7500v1.
* modify the common .dtsi
* modify the kernel size in the image recipes

Define compat-version 2.0 to force factory image usage for sysupgrade.
Add explanation message. Reenable both devices.

As for 4MiB (and not more): Hannu Nyman noted that:
"We have lots of ipq806x devices with 4 MB kernel, so will
need action at that point in future in any case.
(Assuming that the bootloader did not have a 4 MB limit that
has been tested...)"

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(squashed, added 4MiB notice of support in ipq806x)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-02-26 19:52:06 +01:00
Lech Perczak
7ac8da0060 ath79: support ZTE MF286A/R
ZTE MF286A and MF286R are indoor LTE category 6/7 CPE router with simultaneous
dual-band 802.11ac plus 802.11n Wi-Fi radios and quad-port gigabit
Ethernet switch, FXS and external USB 2.0 port.

Hardware highlights:
- CPU: QCA9563 SoC at 775MHz,
- RAM: 128MB DDR2,
- NOR Flash: MX25L1606E 2MB SPI Flash, for U-boot only,
- NAND Flash: W25N01GV 128MB SPI NAND-Flash, for all other data,
- Wi-Fi 5GHz: QCA9886 2x2 MIMO 802.11ac Wave2 radio,
- WI-Fi 2.4GHz: QCA9563 3x3 MIMO 802.11n radio,
- Switch: QCA8337v2 4-port gigabit Ethernet, with single SGMII CPU port,
- WWAN:
  [MF286A] MDM9230-based category 6 internal LTE modem
  [MF286R] PXA1826-based category 7 internal LTE modem
  in extended  mini-PCIE form factor, with 3 internal antennas and
  2 external antenna connections, single mini-SIM slot.
- FXS: one external ATA port (handled entirely by modem part) with two
  physical connections in parallel,
- USB: Single external USB 2.0 port,
- Switches: power switch, WPS, Wi-Fi and reset buttons,
- LEDs: Wi-Fi, Test (internal). Rest of LEDs (Phone, WWAN, Battery,
  Signal state) handled entirely by modem. 4 link status LEDs handled by
  the switch on the backside.
- Battery: 3Ah 1-cell Li-Ion replaceable battery, with charging and
  monitoring handled by modem.
- Label MAC device: eth0

The device shares many components with previous model, MF286, differing
mostly by a Wave2 5GHz radio, flash layout and internal LED color.
In case of MF286A, the modem is the same as in MF286. MF286R uses a
different modem based on Marvell PXA1826 chip.

Internal modem of MF286A is supported via uqmi, MF286R modem isn't fully
supported, but it is expected to use comgt-ncm for connection, as it
uses standard 3GPP AT commands for connection establishment.

Console connection: connector X2 is the console port, with the following
pinout, starting from pin 1, which is the topmost pin when the board is
upright:
- VCC (3.3V). Do not use unless you need to source power for the
  converer from it.
- TX
- RX
- GND
Default port configuration in U-boot as well as in stock firmware is
115200-8-N-1.

Installation:
Due to different flash layout from stock firmware, sysupgrade from
within stock firmware is impossible, despite it's based on QSDK which
itself is based on OpenWrt.

STEP 0: Stock firmware update:
As installing OpenWrt cuts you off from official firmware updates for
the modem part, it is recommended to update the stock firmware to latest
version before installation, to have built-in modem at the latest firmware
version.

STEP 1: gaining root shell:

Method 1:
This works if busybox has telnetd compiled in the binary.
If this does not work, try method 2.

Using well-known exploit to start telnetd on your router - works
only if Busybox on stock firmware has telnetd included:
- Open stock firmware web interface
- Navigate to "URL filtering" section by going to "Advanced settings",
  then "Firewall" and finally "URL filter".
- Add an entry ending with "&&telnetd&&", for example
  "http://hostname/&&telnetd&&".
- telnetd will immediately listen on port 4719.
- After connecting to telnetd use "admin/admin" as credentials.

Method 2:
This works if busybox does not have telnetd compiled in. Notably, this
is the case in DNA.fi firmware.
If this does not work, try method 3.

- Set IP of your computer to 192.168.0.22. (or appropriate subnet if
  changed)
- Have a TFTP server running at that address
- Download MIPS build of busybox including telnetd, for example from:
  https://busybox.net/downloads/binaries/1.21.1/busybox-mips
  and put it in it's root directory. Rename it as "telnetd".
- As previously, login to router's web UI and navigate to "URL
  filtering"
- Using "Inspect" feature, extend "maxlength" property of the input
  field named "addURLFilter", so it looks like this:
  <input type="text" name="addURLFilter" id="addURLFilter" maxlength="332"
    class="required form-control">
- Stay on the page - do not navigate anywhere
- Enter "http://aa&zte_debug.sh 192.168.0.22 telnetd" as a filter.
- Save the settings. This will download the telnetd binary over tftp and
  execute it. You should be able to log in at port 23, using
  "admin/admin" as credentials.

Method 3:
If the above doesn't work, use the serial console - it exposes root shell
directly without need for login. Some stock firmwares, notably one from
finnish DNA operator lack telnetd in their builds.

STEP 2: Backing up original software:
As the stock firmware may be customized by the carrier and is not
officially available in the Internet, IT IS IMPERATIVE to back up the
stock firmware, if you ever plan to returning to stock firmware.
It is highly recommended to perform backup using both methods, to avoid
hassle of reassembling firmware images in future, if a restore is
needed.

Method 1: after booting OpenWrt initramfs image via TFTP:
PLEASE NOTE: YOU CANNOT DO THIS IF USING INTERMEDIATE FIRMWARE FOR INSTALLATION.
- Dump stock firmware located on stock kernel and ubi partitions:

  ssh root@192.168.1.1: cat /dev/mtd4 > mtd4_kernel.bin
  ssh root@192.168.1.1: cat /dev/mtd9 > mtd9_ubi.bin

And keep them in a safe place, should a restore be needed in future.

Method 2: using stock firmware:
- Connect an external USB drive formatted with FAT or ext4 to the USB
  port.
- The drive will be auto-mounted to /var/usb_disk
- Check the flash layout of the device:

  cat /proc/mtd

  It should show the following:
  mtd0: 000a0000 00010000 "u-boot"
  mtd1: 00020000 00010000 "u-boot-env"
  mtd2: 00140000 00010000 "reserved1"
  mtd3: 000a0000 00020000 "fota-flag"
  mtd4: 00080000 00020000 "art"
  mtd5: 00080000 00020000 "mac"
  mtd6: 000c0000 00020000 "reserved2"
  mtd7: 00400000 00020000 "cfg-param"
  mtd8: 00400000 00020000 "log"
  mtd9: 000a0000 00020000 "oops"
  mtd10: 00500000 00020000 "reserved3"
  mtd11: 00800000 00020000 "web"
  mtd12: 00300000 00020000 "kernel"
  mtd13: 01a00000 00020000 "rootfs"
  mtd14: 01900000 00020000 "data"
  mtd15: 03200000 00020000 "fota"
  mtd16: 01d00000 00020000 "firmware"

  Differences might indicate that this is NOT a MF286A device but
  one of other variants.
- Copy over all MTD partitions, for example by executing the following:

  for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do cat /dev/mtd$i > \
  /var/usb_disk/mtd$i; done

  "Firmware" partition can be skipped, it is a concatenation
  of "kernel" and "rootfs".

- If the count of MTD partitions is different, this might indicate that
  this is not a MF286A device, but one of its other variants.
- (optionally) rename the files according to MTD partition names from
  /proc/mtd
- Unmount the filesystem:

  umount /var/usb_disk; sync

  and then remove the drive.
- Store the files in safe place if you ever plan to return to stock
  firmware. This is especially important, because stock firmware for
  this device is not available officially, and is usually customized by
  the mobile providers.

STEP 3: Booting initramfs image:

Method 1: using serial console (RECOMMENDED):
- Have TFTP server running, exposing the OpenWrt initramfs image, and
  set your computer's IP address as 192.168.0.22. This is the default
  expected by U-boot. You may wish to change that, and alter later
  commands accordingly.
- Connect the serial console if you haven't done so already,
- Interrupt boot sequence by pressing any key in U-boot when prompted
- Use the following commands to boot OpenWrt initramfs through TFTP:

  setenv serverip 192.168.0.22
  setenv ipaddr 192.168.0.1
  tftpboot 0x81000000 openwrt-ath79-nand-zte_mf286a-initramfs-kernel.bin
  bootm 0x81000000

  (Replace server IP and router IP as needed). There is no  emergency
  TFTP boot sequence triggered by buttons, contrary to MF283+.
- When OpenWrt initramfs finishes booting, proceed to actual
  installation.

Method 2: using initramfs image as temporary boot kernel
This exploits the fact, that kernel and rootfs MTD devices are
consecutive on NAND flash, so from within stock image, an initramfs can
be written to this area and booted by U-boot on next reboot, because it
uses "nboot" command which isn't limited by kernel partition size.
- Download the initramfs-kernel.bin image
- After backing up the previous MTD contents, write the images to the
  "firmware" MTD device, which conveniently concatenates "kernel" and
  "rootfs" partitions that can fit the initramfs image:

  nandwrite -p /dev/<firmware-mtd> \
  /var/usb_disk/openwrt-ath79-zte_mf286a-initramfs-kernel.bin

- If write is OK, reboot the device, it will reboot to OpenWrt
  initramfs:

  reboot -f

- After rebooting, SSH into the device and use sysupgrade to perform
  proper installation.

Method 3: using built-in TFTP recovery (LAST RESORT):
- With that method, ensure you have complete backup of system's NAND
  flash first. It involves deliberately erasing the kernel.
- Download "-initramfs-kernel.bin" image for the device.
- Prepare the recovery image by prepending 8MB of zeroes to the image,
  and name it root_uImage:

  dd if=/dev/zero of=padding.bin bs=8M count=1

  cat padding.bin openwrt-ath79-nand-zte_mf286a-initramfs-kernel.bin >
  root_uImage

- Set up a TFTP server at 192.0.0.1/8. Router will use random address
  from that range.
- Put the previously generated "root_uImage" into TFTP server root
  directory.
- Deliberately erase "kernel" partition" using stock firmware after
  taking backup. THIS IS POINT OF NO RETURN.
- Restart the device. U-boot will attempt flashing the recovery
  initramfs image, which will let you perform actual installation using
  sysupgrade. This might take a considerable time, sometimes the router
  doesn't establish Ethernet link properly right after booting. Be
  patient.
- After U-boot finishes flashing, the LEDs of switch ports will all
  light up. At this moment, perform power-on reset, and wait for OpenWrt
  initramfs to finish booting. Then proceed to actual installation.

STEP 4: Actual installation:
- Set your computer IP to 192.168.1.22/24
- scp the sysupgrade image to the device:

  scp openwrt-ath79-nand-zte_mf286a-squashfs-sysupgrade.bin \
  root@192.168.1.1:/tmp/

- ssh into the device and execute sysupgrade:

  sysupgrade -n /tmp/openwrt-ath79-nand-zte_mf286a-squashfs-sysupgrade.bin

- Wait for router to reboot to full OpenWrt.

STEP 5: WAN connection establishment
Since the router is equipped with LTE modem as its main WAN interface, it
might be useful to connect to the Internet right away after
installation. To do so, please put the following entries in
/etc/config/network, replacing the specific configuration entries with
one needed for your ISP:

config interface 'wan'
        option proto 'qmi'
        option device '/dev/cdc-wdm0'
        option auth '<auth>' # As required, usually 'none'
        option pincode '<pin>' # If required by SIM
        option apn '<apn>' # As required by ISP
        option pdptype '<pdp>' # Typically 'ipv4', or 'ipv4v6' or 'ipv6'

For example, the following works for most polish ISPs
config interface 'wan'
        option proto 'qmi'
        option device '/dev/cdc-wdm0'
        option auth 'none'
        option apn 'internet'
        option pdptype 'ipv4'

The required minimum is:
config interface 'wan'
        option proto 'qmi'
        option device '/dev/cdc-wdm0'
In this case, the modem will use last configured APN from stock
firmware - this should work out of the box, unless your SIM requires
PIN which can't be switched off.

If you have build with LuCI, installing luci-proto-qmi helps with this
task.

Restoring the stock firmware:

Preparation:
If you took your backup using stock firmware, you will need to
reassemble the partitions into images to be restored onto the flash. The
layout might differ from ISP to ISP, this example is based on generic stock
firmware
The only partitions you really care about are "web", "kernel", and
"rootfs". These are required to restore the stock firmware through
factory TFTP recovery.

Because kernel partition was enlarged, compared to stock
firmware, the kernel and rootfs MTDs don't align anymore, and you need
to carve out required data if you only have backup from stock FW:
- Prepare kernel image
  cat mtd12_kernel.bin mtd13_rootfs.bin > owrt_kernel.bin
  truncate -s 4M owrt_kernel_restore.bin
- Cut off first 1MB from rootfs
  dd if=mtd13_rootfs.bin of=owrt_rootfs.bin bs=1M skip=1
- Prepare image to write to "ubi" meta-partition:
  cat mtd6_reserved2.bi mtd7_cfg-param.bin mtd8_log.bin mtd9_oops.bin \
  mtd10_reserved3.bin mtd11_web.bin owrt_rootfs.bin > \
  owrt_ubi_ubi_restore.bin

You can skip the "fota" partition altogether,
it is used only for stock firmware update purposes and can be overwritten
safely anyway. The same is true for "data" partition which on my device
was found to be unused at all. Restoring mtd5_cfg-param.bin will restore
the stock firmware configuration you had before.

Method 1: Using initramfs:
This method is recmmended if you took your backup from within OpenWrt
initramfs, as the reassembly is not needed.
- Boot to initramfs as in step 3:
- Completely detach ubi0 partition using ubidetach /dev/ubi0_0
- Look up the kernel and ubi partitions in /proc/mtd
- Copy over the stock kernel image using scp to /tmp
- Erase kernel and restore stock kernel:
  (scp mtd4_kernel.bin root@192.168.1.1:/tmp/)
  mtd write <kernel_mtd> mtd4_kernel.bin
  rm mtd4_kernel.bin
- Copy over the stock partition backups one-by-one using scp to /tmp, and
  restore them individually. Otherwise you might run out of space in
  tmpfs:

  (scp mtd3_ubiconcat0.bin root@192.168.1.1:/tmp/)

  mtd write <ubiconcat0_mtd> mtd3_ubiconcat0.bin
  rm mtd3_ubiconcat0.bin

  (scp mtd5_ubiconcat1.bin root@192.168.1.1:/tmp/)

  mtd write <ubiconcat1_mtd> mtd5_ubiconcat1.bin
  rm mtd5_ubiconcat1.bin

- If the write was correct, force a device reboot with

  reboot -f

Method 2: Using live OpenWrt system (NOT RECOMMENDED):
- Prepare a USB flash drive contatining MTD backup files
- Ensure you have kmod-usb-storage and filesystem driver installed for
  your drive
- Mount your flash drive

  mkdir /tmp/usb

  mount /dev/sda1 /tmp/usb

- Remount your UBI volume at /overlay to R/O

  mount -o remount,ro /overlay

- Write back the kernel and ubi partitions from USB drive

  cd /tmp/usb
  mtd write mtd4_kernel.bin /dev/<kernel_mtd>

  mtd write mtd9_ubi.bin /dev/<kernel_ubi>

- If everything went well, force a device reboot with
  reboot -f

Last image may be truncated a bit due to lack of space in RAM, but this will happen over "fota"
MTD partition which may be safely erased after reboot anyway.

Method 3: using built-in TFTP recovery:
This method is recommended if you took backups using stock firmware.
- Assemble a recovery rootfs image from backup of stock partitions by
  concatenating "web", "kernel", "rootfs" images dumped from the device,
  as "root_uImage"
- Use it in place of "root_uImage" recovery initramfs image as in the
  TFTP pre-installation method.

Quirks and known issuesa
- It was observed, that CH340-based USB-UART converters output garbage
  during U-boot phase of system boot. At least CP2102 is known to work
  properly.
- Kernel partition size is increased to 4MB compared to stock 3MB, to
  accomodate future kernel updates - at this moment OpenWrt 5.10 kernel
  image is at 2.5MB which is dangerously close to the limit. This has no
  effect on booting the system - but keep that in mind when reassembling
  an image to restore stock firmware.
- uqmi seems to be unable to change APN manually, so please use the one
  you used before in stock firmware first. If you need to change it,
  please use protocok '3g' to establish connection once, or use the
  following command to change APN (and optionally IP type) manually:
  echo -ne 'AT+CGDCONT=1,"IP","<apn>' > /dev/ttyUSB0
- The only usable LED as a "system LED" is the blue debug LED hidden
  inside the case. All other LEDs are controlled by modem, on which the
  router part has some influence only on Wi-Fi LED.
- Wi-Fi LED currently doesn't work while under OpenWrt, despite having
  correct GPIO mapping. All other LEDs are controlled by modem,
  including this one in stock firmware. GPIO19, mapped there only acts
  as a gate, while the actual signal source seems to be 5GHz Wi-Fi
  radio, however it seems it is not the LED exposed by ath10k as
  ath10k-phy0.
- GPIO5 used for modem reset is a suicide switch, causing a hardware
  reset of whole board, not only the modem. It is attached to
  gpio-restart driver, to restart the modem on reboot as well, to ensure
  QMI connectivity after reboot, which tends to fail otherwise.
- Modem, as in MF283+, exposes root shell over ADB - while not needed
  for OpenWrt operation at all - have fun lurking around.
  The same modem module is used as in older MF286.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2022-02-26 17:46:10 +01:00
Arınç ÜNAL
7774b86019 ramips: mt7621-dts: add pinctrl properties for ethernet
Add the missing pinctrl properties on the ethernet node.
GMAC1 will start working with this change.

Link: https://lore.kernel.org/netdev/83a35aa3-6cb8-2bc4-2ff4-64278bbcd8c8@arinc9.com/

Overwrite pinctrl-0 property without rgmii2_pins on devicetrees which use
the rgmii2 pins as GPIO (22 - 33).

Give gpio function to rgmii2 pin group on mt7621_tplink_archer-x6-v3.dtsi
which uses GPIO 28.

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
2022-02-26 13:36:30 +01:00
Arınç ÜNAL
704c8426fb ramips: mt7621-dts: enable flow control on port@6
Flow control needs to be enabled on both sides to work.
It is already enabled on gmac0, enable it on port@6 too.

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Tested-by: Sungbo Eo <mans0n@gorani.run>
2022-02-26 13:36:30 +01:00
Arınç ÜNAL
2b202185d2 ramips: mt7621-dts: fix switch@1f warnings
Remove reg property from ports node to fix this warning:

Warning (unit_address_vs_reg): /ethernet@1e100000/mdio-bus/switch@1f/ports: node has a reg or ranges property, but no unit name

Another warning surfaces afterwards. Remove #address-cells and #size-cells
from switch@1f node to fix this warning:

Warning (avoid_unnecessary_addr_size): /ethernet@1e100000/mdio-bus/switch@1f: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
2022-02-26 13:36:30 +01:00
Alex Henrie
fe1ecf1fcb ath79: add Zyxel EMG2926-Q10A
The Zyxel EMG2926-Q10A is 99% the Zyxel NBG6716, but the bootloader
expects a different product name when flashing over TFTP. Also, the
EMG2926-Q10A always has 128 MiB of NAND flash whereas the NBG6716
reportedly can have either 128 MiB or 256 MiB.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
2022-02-26 13:36:30 +01:00
Florian Eckert
4e28494144 x86: geode: fix package nameing kmod-crypto-ebc does not exist
This commit fixes the package naming that was added by commit:
e1e4cbde5c

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-02-26 13:36:30 +01:00
Daniel González Cabanelas
33a7cd1833 bcm63xx: Fast 2704n: configure the WAN port
The Sagem/Plusnet F@ST2704N has a red label in ethernet port 4. Its purpose is
to be used as Fibre/WAN with the stock firmware.

Configure the Eth4 as WAN.

Fixes: fbbb977772 (brcm63xx: Tune the network configuration for several
routers)

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2022-02-26 13:36:30 +01:00
Christian Lamparter
8144f9c665 mpc85xx: HiveAP-330: add tmp125 temperature sensor
the Aerohive HiveAP-330 and HiveAP-350 come equipped
with an TI TMP125 temperature chip. This patch wires
up the necessary support for this sensor and exposes
it through hwmon / thermal sensor framework. Upstream
support is coming, but it has to go through hwmon-next
first.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-02-25 17:54:56 +01:00
Christian Lamparter
71d86a2db9 kernel: add disabled PSTORE+REED_SOLOMON symbols for 5.4
The last remaining 5.4 target currently chokes because the
symbols haven't been disabled like for 5.10.

Fixes: 97158fe10e ("kernel: package ramoops pstore-ram crash log storage")
Reported-by: Hannu Nyman <hannu.nyman@iki.fi>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-02-25 17:27:28 +01:00
Rafał Miłecki
0dbcefdd52 bcm4908: fix USB PHY support
This fixes problem with USB PHY not handling some USB 3.0 devices.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-02-25 10:48:32 +01:00
Rui Salvaterra
3c561cff0b kernel: generic: add missing 5.10 symbols
Add the following kconfig symbols (disabled):

CONFIG_DEFAULT_FQ
CONFIG_DEFAULT_CODEL
CONFIG_DEFAULT_SFQ

Also resort the config with the kconfig.pl script.

Fixes: f39872d966 ("kernel: generic: select the fq_codel qdisc by default")

Tested-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2022-02-25 08:30:14 +00:00
Hannu Nyman
cf346dfadf ipq806x: kernel crash log ramoops storage for R7800 and XR500
Define the kernel crash log storage ramoops/pstore feature
for R7800 and its sister XR500.

Reference to the ramoops admin guide in upstream Linux:
https://www.kernel.org/doc/html/v5.10/admin-guide/ramoops.html

Tested with R7800.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-02-24 20:45:12 +01:00
Hannu Nyman
97158fe10e kernel: package ramoops pstore-ram crash log storage
Package the ability to log kernel crashes to 'ramoops' pstore
files into RAM in /sys/fs/pstore

Reference to the ramoops admin guide in upstream Linux:
https://www.kernel.org/doc/html/v5.10/admin-guide/ramoops.html

The files in RAM survive a warm reboot, but not a cold reboot.

Note: kmod-ramoops selects kmod-pstore and kmod-reed-solomon.

The feature can be used by selecting the kmod-ramoops and
adding a ramoops reserved-memory definition to the device DTS.
Example from R7800:

       reserved-memory {
                rsvd@5fe00000 {
                        reg = <0x5fe00000 0x200000>;
                        reusable;
                };

                ramoops@42100000 {
                        compatible = "ramoops";
                        reg = <0x42100000 0x40000>;
                        record-size = <0x4000>;
                        console-size = <0x4000>;
                        ftrace-size = <0x4000>;
                        pmsg-size = <0x4000>;
                };
        };

If no definition has been made in DTS, no crash log is stored
for the device.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(added CONFIG_EFI_VARS_PSTORE disable)
2022-02-24 20:45:12 +01:00
Jax Jiang
1050e66c8f x86: grub2: search for the "kernel" filesystem on all disks
Previously, grub2 was hardcoded to always look on "hd0" for the
kernel.

This works well when the system only had a single disk.
But if there was a second disk/stick present, it may have look
on the wrong drive because of enumeration races.

This patch utilizes grub2 search function to look for a filesystem
with the label "kernel". This works thanks to existing setup in
scripts/gen_image_generic.sh. Which sets the "kernel" label on
both the fat and ext4 filesystem variants.

Signed-off-by: Jax Jiang <jax.jiang.007@gmail.com>
Suggested-by: Alberto Bursi <bobafetthotmail@gmail.com> (MX100 WA)
(word wrapped, slightly rewritten commit message, removed MX100 WA)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-02-24 20:45:12 +01:00
Christian Lamparter
83f2f1ad58 Revert "bcm27xx: bcm27xx: update defconfig"
This reverts all four commits
dbb45421ba "bcm27xx: bcm2708: update defconfig"
332f69583a "bcm27xx: bcm2709: update defconfig"
a478202d74 "bcm27xx: bcm2710: update defconfig"
82da1dfd69 "bcm27xx: bcm2711: update defconfig"

this also highlighted an unrelated kconfig failure
that warrants investigation. But for now it is important
for the bcm27xx target to come back again.

|*
|* Restart config...
|*
|*
|* Allow override default queue discipline
|*
|Allow override default queue discipline (NET_SCH_DEFAULT) [Y/n/?] y
|  Default queuing discipline
|    1. Fair Queue (DEFAULT_FQ) (NEW)
|    2. Controlled Delay (DEFAULT_CODEL) (NEW)
|  > 3. Fair Queue Controlled Delay (DEFAULT_FQ_CODEL)
|    4. Stochastic Fair Queue (DEFAULT_SFQ) (NEW)
|    5. Priority FIFO Fast (DEFAULT_PFIFO_FAST)
|  choice[1-5?]:
|Error in reading or end of file.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-02-24 20:45:12 +01:00
Claudiu Beznea
3e53eec589 at91: add support for sama7g5-ek board
Add support for SAMA7G5-EK board.
Hardware:
- SoC: SAMA7G5
- RAM: Aliance Memory AS4C256M16D3LC (4 Gbit DDR3L)
- SD/MMC: 1 standard 4bit SD Card interface
- USB: 1 Micro-AB host/device, 1 Type-A host, 1 Type-C host
- CAN: 2 interfaces
- Ethernet: 10/100 port, 1Gbps port
- Wi-Fi/BT: 1 optional interface
- Audio: 1 SPDIF RX port, 1 SPDIF TX port, 4 digital microphones
- Camera: 1 RPi CSI camera interface
- Debug: 1 J-Link-OB + CDC, 1 JTAG
- LEDs: 1 RGB
- Buttons: 4 push buttons
- Expansions: 1 RPi Expansion connector, 2 mikroBUS connectors
- Power management: 1 power management IC, 1 power consumption
  measurement device

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2022-02-24 19:05:29 +01:00
Claudiu Beznea
e58cd453d5 at91: add kernel support for sama7g5 soc
Add kernel support for SAMA7G5 by back-porting mainline kernel patches.
Among SAMA7G5 features could be remembered:
- ARM Cortex-A7
- double data rate multi-port dynamic RAM controller supporting DDR2,
  DDR3, DDR3L, LPDDR2, LPDDR3 up to 533MHz
- peripherals for audio, video processing
- 1 gigabit + 1 megabit Ethernet controllers
- 6 CAN controllers
- trust zone support
- DVFS for CPU
- criptography IPs

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2022-02-24 19:05:28 +01:00
Paul Spooren
5777c6fc95 mvebu: add targz feature flag
Adding the feature flag automatically creates a a rootfs.tar.gz files
which can be used for Docker rootfs containers.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2022-02-24 15:32:57 +01:00
Daniel Golle
9e6a71e86d
mediatek: mt7623: drop RAMFS_COPY_BIN
fwtool is now always part of the sysupgrade stage2 ramdisk, so drop
the no longer needed RAMFS_COPY_BIN variable.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-02-22 19:19:46 +00:00
Daniel Golle
bb9043031a
mediatek: mt7622: drop RAMFS_COPY_BIN and RAMFS_COPY_DATA
Now that both, fw_printenv/fw_setenv and fwtool are always present
during stage2 sysupgrade, we no longer need to list them in
RAMFS_COPY_BIN and RAMFS_COPY_DATA in platform.sh.
Drop both variables as they are now unneeded.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-02-22 19:16:08 +00:00
Piotr Dymacz
aae7af4219 ath79: image: use 'kmod-usb-chipidea2' for AR933x devices
AR933x based devices should include 'kmod-usb-chipidea2' for USB
support. Fixes: #9243.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-02-21 22:22:30 +01:00
Piotr Dymacz
034531db73 ath79: image: drop 'BOARDNAME' from devices recipes
The 'BOARDNAME' variable is part of target configuration and shouldn't
be part of a device's image recipe.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-02-21 19:16:30 +01:00
Sander Vanheule
66d8db01cc realtek: remove debugging code from timer
Remove some (dead) debugging code from the Realtek timer to clean up the
sources of this driver.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-02-20 16:23:58 +00:00
Sander Vanheule
9db651f4a2 realtek: use DT provided address for timers
The I/O base address for the timers was hardcoded into the driver,
or derived from the HW IRQ number as an even more horrible hack. All
supported SoC families have these timers, but with hardcoded addresses
the code cannot be reused right now.

Request the timer's base address from the DT specification, and store it
in a private struct for future reference.

Matching the second interrupt specifier, the address range for the
second timer is added to the DT specification.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-02-20 16:23:58 +00:00
Sander Vanheule
71810eb068 realtek: clean up RTL930x timer DT node
The Realtek timer node for RTL930x doesn't have any child nodes, making
the use of '#address-cells' quite pointless. It is also not an interrupt
controller, meaning it makes no sense to define '#interrupt-cells'.

The I/O address for this node is also wrong, but this is hidden by the
fact that the driver associated with this node bypasses the usual DT
machinery and does it's own thing. Correct the address to have a sane
value, even though it isn't actually used.

Fixes: a75b9e3ecb ("realtek: Adding RTL930X sub-target")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-02-20 16:23:58 +00:00
Sander Vanheule
fa20f2bfc7 realtek: ZyXEL GS1900-48: fix system LED polarity
When driven by a GPIO pin, the system LED needs to be configured as
active high. Otherwise the LED switches off after booting and
initialisation.

Fixes: 47f5a0a3ee ("realtek: Add support for ZyXEL GS1900-48 Switch")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-02-20 16:23:55 +00:00
Sander Vanheule
66140820e1 realtek: ZyXEL GS1900-48: drop status from gpio1
The default value for a DT node's status property is already "okay", so
there's no need to specify it again. Drop the status property to clean
up the DTS.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-02-20 16:23:55 +00:00
Sander Vanheule
a39fbaf23a realtek: use higher priority for timer interrupts
The assigned output index for the event timers was quite low, lower even
than the ethernet interrupt. This means that high network load could
preempt timer interrupts, possibly leading to all sorts of strange
behaviour.

Increase the interrupt output index of the event timers to 5, which is
the highest priority output and corresponds to the (otherwise unused)
MIPS CPU timer interrupt.

Fixes: a75b9e3ecb ("realtek: Adding RTL930X sub-target")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-02-20 16:23:55 +00:00
Sander Vanheule
4b31717fb0 realtek: move RTL8231 definitions to board files
The RTL8231 is an external chip, and not part of the SoC. That means
it is more appropriate to define it in the board specific (base) files,
instead of the DT include for the SoC itself.

Moving the RTL8231 definition also ensures that boards with no GPIO
expander, or an alternative one, don't have a useless gpio1 node label
defined.

Tested on a Netgear GS110TPPv1.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-02-20 16:23:55 +00:00
Sander Vanheule
004d4d66c8 realtek: fix node addresses for RTL839x
The address in some node names doesn't match the actual offset specified
in the DT node. Update the names to fix this.

While fixing the node names, also drop the unused node labels.

Fixes: 0a7565e536 ("realtek: Update rtl839x.dtsi for realtek,rtl-intc, new gpio controller remove RTL8231 node")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-02-20 16:23:55 +00:00
Sander Vanheule
1ca081000a realtek: consolidate bootargs again
Bootargs for devices in the realtek target were previously consolidated
in commit af2cfbda2b ("realtek: Consolidate bootargs"), since all
devices currently use the same arguments.

Commit a75b9e3ecb ("realtek: Adding RTL930X sub-target") reverted this
without any argumentation, so let's undo that.

Commit 0b8dfe0851 ("realtek: Add RTL931X sub-target") introduced the
old bootargs also for RTL931x, without providing any actual device
support. Until that is done, let's assume vendors will have done what
they did before, and use a baud rate of 115200.

Fixes: a75b9e3ecb ("realtek: Adding RTL930X sub-target")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-02-20 16:23:55 +00:00
Matthew Hagan
6f88526fa4 mvebu: cortexa72: enable ARM_ARMADA_8K_CPUFREQ
Enable the AP806's cpufreq driver. This driver is compatible with the
Armada 7K and 8K platforms.

Tested-by: Stijn Segers <foss@volatilesystems.org> (RB5009UG+S+IN)
Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
2022-02-20 14:26:43 +01:00
John Audia
82da1dfd69 bcm27xx: bcm2711: update defconfig
Enabled CONFIG_ALL_KMODS and ran make kernel_menuconfig against
bcm2711 to update defconfig.  Some of the removed symbols are
present in target/linux/generic/config-5.10 while others were
removed by the make target.

Signed-off-by: John Audia <graysky@archlinux.us>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> (wrapped)
2022-02-20 14:26:42 +01:00
John Audia
a478202d74 bcm27xx: bcm2710: update defconfig
Enabled CONFIG_ALL_KMODS and ran make kernel_menuconfig against
bcm2710 to update defconfig.  Some of the removed symbols are
present in target/linux/generic/config-5.10 while others were
removed by the make target.

Signed-off-by: John Audia <graysky@archlinux.us>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> (wrapped)
2022-02-20 14:26:42 +01:00
John Audia
332f69583a bcm27xx: bcm2709: update defconfig
Enabled CONFIG_ALL_KMODS and ran make kernel_menuconfig against
bcm2709 to update defconfig.  Some of the removed symbols are
present in target/linux/generic/config-5.10 while others were
removed by the make target.

Signed-off-by: John Audia <graysky@archlinux.us>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> (wrapped)
2022-02-20 14:26:41 +01:00
John Audia
dbb45421ba bcm27xx: bcm2708: update defconfig
Enabled CONFIG_ALL_KMODS and ran make kernel_menuconfig against
bcm2708 to update defconfig.  Some of the removed symbols are
present in target/linux/generic/config-5.10 while others were
removed by the make target.

Signed-off-by: John Audia <graysky@archlinux.us>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> (wrapped)
2022-02-20 14:26:41 +01:00
Robert Marko
c1e06a0cbb ipq40xx: mikrotik: fix LED script
Fix the missing ;; after the cAP ac case in /e/b/01_leds.

Fixes: 93d9119 ("ipq40xx: add MikroTik cAP ac support")
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> (minor touch-up)
2022-02-20 14:24:43 +01:00
Christian Lamparter
5696244ae2 ipq806x: disable Linksys EA7500v1 and EA8500
The kernel of both images will no longer fit into
the 3072KiB / 3MiB kernel partition:
|Image Name:   ARM OpenWrt Linux-5.10.100
|Created:      Sat Feb 19 00:11:55 2022
|Image Type:   ARM Linux Kernel Image (uncompressed)
|Data Size:    3147140 Bytes = 3073.38 KiB = 3.00 MiB

Disable both targets for now, until a solution is available.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-02-20 14:04:38 +01:00
Christian Lamparter
c062087a6c mpc85xx: fix KEY_RFKILL vs KEY_RFKill
This fixes a buildbot builder error:
Error: arch/powerpc/boot/dts/tl-wdr4900-v1.dts:245.18-19 syntax error

Fixes: 256e1dbc7d ("mpc85xx: utilize dt-binding definitions for keys + gpios")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-02-20 14:04:38 +01:00
Nick McKinney
61d97bf377 ramips: clean up Makefile formatting
Use correct indent in target/linux/ramips/image/mt7621.mk
to be consistent with the rest of the file.

Signed-off-by: Nick McKinney <nick@ndmckinney.net>
[rephrase commit message as Adrian suggested, fix a6004ns-m indent]
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2022-02-20 16:16:43 +09:00
Sven Roederer
65df862b50 ramips: mt7621: print size of factory initramfs-image if it's too big
It's helpful to know the current and maximal size of the imagefiles if the
creation fails.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
2022-02-20 15:55:36 +09:00
Graham Cole
e282e50d44 ath79: fix wndr4500v3 lan port order to match case
The LED and LAN port numbering on the case of wndr4500v3 devices are
reversed relative to the wndr4300v2. I created this patch to so that the
ordering in OpenWRT will be consistent with that.

Signed-off-by: Graham Cole <diakka@gmail.com>
2022-02-20 13:54:12 +09:00
Yoonji Park
125b9aec29 ramips: add support for ipTIME A3002MESH
Add support for ipTIME A3002MESH.

Hardware:
- SoC: MediaTek MT7621AT (880MHz, Duel-Core)
- RAM: DDR3 128MB
- Flash: XMC XM25QH128AHIG (SPI-NOR 16MB)
- WiFi: MediaTek MT7615D (2.4GHz, 5GHz, DBDC)
- Ethernet: MediaTek MT7530 (WAN x1, LAN x2, SoC built-in)
- UART: [GND, RX, TX, 3.3V] (57600 8N1, J4)

MAC addresses:
| interface |        MAC        |     source     | comment
|-----------|-------------------|----------------|----------
|       LAN | 70:XX:XX:5X:XX:X3 |                |
|       WAN | 70:XX:XX:5X:XX:X1 | u-boot 0x1fc40 |
|   WLAN 2G | 72:XX:XX:4X:XX:X0 |                |
|   WLAN 5G | 70:XX:XX:5X:XX:X0 | factory 0x4    |
|           | 70:XX:XX:5X:XX:X0 | u-boot 0x1fc20 | unknown
|           | 70:XX:XX:5X:XX:X2 | factory 0x8004 | unknown

- WLAN 2G MAC address is not the same as stock firmware since OpenWrt
  uses LAN MAC address with local bit sets.

Installation:
1. Flash initramfs image. This can be done using stock web ui or TFTP
2. Connect to OpenWrt with an SSH connection to 192.168.1.1
3. Perform sysupgrade with sysupgrade image

Revert to stock firmware:
- Flash stock firmware via OEM TFTP Recovery mode
- Perform sysupgrade with stock image

TFTP Recovery method:
1. Unplug the router
2. Hold the reset button and plug in
3. Release when the power LED stops flashing and go off
4. Set your computer IP address manually to 192.168.0.x / 255.255.255.0
5. Flash image with TFTP client to 192.168.0.1

Signed-off-by: Yoonji Park <koreapyj@dcmys.kr>
[wrap/rephrase commit message]
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2022-02-20 13:53:15 +09:00
Sungbo Eo
9968a909c2 Revert "ramips: increase spi-max-frequency for ipTIME mt7620 devices"
This reverts commit 13a185bf8a.

There was a report that one A1004ns device fails to detect its flash
chip correctly:

[    1.470297] spi-nor spi0.0: unrecognized JEDEC id bytes: e0 10 0c 40 10 08
[    1.484110] spi-nor: probe of spi0.0 failed with error -2

It also uses a different flash chip model:
* in my hand: Winbond W25Q128FVSIG (SOIC-8)
* reported: Macronix MX25L12845EMI-10G (SOP-16)

Reducing spi-max-frequency solved the detection failure. Hence revert.

Reported-by: Koasing <koasing@gmail.com>
Tested-by: Koasing <koasing@gmail.com>
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2022-02-20 13:47:57 +09:00
Sungbo Eo
3e3e78de11 ath79: utilize nvmem on Netgear EX7300 v2
mtd-mac-address should no longer be used after commit 5ae2e78639
("kernel: drop support for mtd-mac-address"). Convert it to nvmem-cells.

While at it, also convert OpenWrt's custom mtd-cal-data property and
userspace pre-calibration data extraction to the nvmem implementation.

Note: nvmem-cells in QCN5502 wmac has not been tested.

Fixes: c32008a37b ("ath79: add partial support for Netgear EX7300v2")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2022-02-20 13:45:06 +09:00