Commit Graph

747 Commits

Author SHA1 Message Date
Daniel Golle
3684b494dd
mvebu: puzzle-m901: add LEDs, fan and reset button
Wire up MCU driver for LEDs, fan and temperature sensor, and add
GPIO reset button just like on the M902 also on the Puzzle M901.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-12-21 21:54:54 +00:00
Daniel Golle
ddad936fc6
mvebu: puzzle-m902: add GPIO reset button
Add reset button to device tree so it has the function expected from
usual OpenWrt devices.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-12-21 21:54:49 +00:00
Daniel Golle
7e4c1cca8a
mvebu: puzzle-mcu: improve led driver
Set blinking mode using scheduled work instead of blocking which may
result in deadlocks.
Add dynamic kprintf debugging hexdumps of all MCU rx and tx.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-12-21 21:54:42 +00:00
Daniel Golle
f0c0b18234
mvebu: puzzle-m902: add driver for MCU driving LEDs, fan and buzzer
Backport MFD driver for communicating with the on-board MCU found on
IEI World Puzzle appliances.
Improve the driver to support multiple LEDs, apply a default state and
let MCU take care of blinking if timing is within supported range.
Wire up LEDs and fan for Puzzle M902 in device tree.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-12-21 16:41:10 +00:00
Sergey Ryazanov
fa3690f8f1 kernel: 5.10: consolidate mac80211 crypto options
Each of
- CRYPTO_AEAD2
- CRYPTO_AEAD
- CRYPTO_GF128MUL
- CRYPTO_GHASH
- CRYPTO_HASH2
- CRYPTO_HASH
- CRYPTO_MANAGER2
- CRYPTO_MANAGER
- CRYPTO_NULL2

either directly required for mac80211 crypto support, or directly
selected by such options. Support for the mac80211 crypto was enabled in
the generic config since c7182123b9 ("kernel: make cryptoapi support
needed by mac80211 built-in"). So move the above options from the target
configs to the generic config to make it clear why do we need them.

CC: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
2021-12-17 16:16:34 +01:00
Sergey Ryazanov
b61ab8f57e kernel: filter out both Clang and LLD versions
Both CLANG_VERSION and LLD_VERISON are autogenerated runtime
configuration options, so add them to the kernel configuration filter
and remove from generic and per-target configs to keep configs clean.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
2021-12-17 16:16:34 +01:00
John Audia
187c8f9153 kernel: bump 5.10 to 5.10.84
All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B
Run-tested: bcm2711/RPi4B

Signed-off-by: John Audia <graysky@archlinux.us>
2021-12-17 15:10:22 +01:00
Kabuli Chana
7fd1ca96a1 mvebu: next backport mvnet MQPrio offload
linux-next MQPrio patches adding TC traffic shaping offload

Signed-off-by: Kabuli Chana <newtownBuild@gmail.com>
2021-12-03 12:35:23 +01:00
Bjørn Mork
0efb169aad mvebu: sysupgrade: drop unnecessary UBI to UBI logic
The recent changes to the maximum kernel size for Mamba and Venom
highlighted the fact that the old Mamba kernel size has been
hardcoded in linksys_get_root_magic() even for devices with
a different kernel/rootfs split.

The purpose of this code seems to be to avoid issues caused
by partially overwriting an existing UBI partition, where some
of the erase counters would be reset but not the unmodified
ones.  This problem has been solved in a more generic way by
the UBI EOF marker. This ensures that any old PEBs after the
marker are properly initialized.  It is therefore unnecessary
to erase the whole partition before flashing a new OpenWrt
factory image.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-12-03 12:23:02 +01:00
John Audia
be077f4812 kernel: bump 5.10 to 5.10.81
Manually rebased:
    octeontx/patches-5.10/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, ipq806x/R7800
Run-tested: bcm2711/RPi4B, ipq806x/R7800

Signed-off-by: John Audia <graysky@archlinux.us>
2021-11-27 19:19:11 +01:00
Kabuli Chana
4580516bfb mvebu: backport mvneta basic MQPrio patch
Implement a basic MQPrio support, inserting rules in RX that translate
the TC to prio mapping into vlan prio to queues.

Signed-off-by: Kabuli Chana <newtownBuild@gmail.com>
2021-11-20 20:54:26 +01:00
Rui Salvaterra
02026d0a6f kernel: bump 5.10 to 5.10.76
Deleted (upstreamed):
bcm27xx/patches-5.10/950-0145-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch [1]

Manually rebased:
bcm27xx/patches-5.10/950-0355-xhci-quirks-add-link-TRB-quirk-for-VL805.patch
bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch

Note: although automatically rebaseable, the last patch has been edited to avoid
conflicting bit definitions.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=b6f32897af190d4716412e156ee0abcc16e4f1e5

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-10-30 21:17:20 +02:00
Robert Marko
46646efc38 mvebu: mochabin: correct LED labels in DTS
LED labels got reversed by accident, so fix it to the usual color:led_name format.

Fixes: 78cf3e53b1 ("mvebu: add Globalscale MOCHAbin")

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
[add Fixes:]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-10-09 19:27:11 +02:00
Hauke Mehrtens
57b323ce38 kernel: Deactivate some ARM64 errata workarounds
This deactivates the following workarounds for erratas in ARM64 CPUS:
CONFIG_ARM64_ERRATUM_1165522: Cortex-A76 cores (r0p0, r1p0, r2p0)
CONFIG_ARM64_ERRATUM_1286807: Cortex-A76 cores (r0p0 to r3p0)
CONFIG_ARM64_ERRATUM_1418040: Cortex-A76/Neoverse-N1 cores (r0p0 to r3p1)
CONFIG_CAVIUM_TX2_ERRATUM_219: Cavium ThunderX2
CONFIG_FUJITSU_ERRATUM_010001: Fujitsu-A64FX

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-10-03 01:13:18 +02:00
Paul Spooren
8ff8323335 mvebu: remove obsolete Kernel 5.4
With the upgrade to Kernel 5.10 per default the old version is no longer
required to be in tree.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-10-02 18:16:33 +02:00
Hauke Mehrtens
50f456b46c kernel: bump 5.4 to 5.4.150
Manually rebased:
  generic/pending-5.4/800-bcma-get-SoC-device-struct-copy-its-DMA-params-to-th.patch
  mvebu/patches-5.4/021-arm64-dts-marvell-armada-37xx-Move-PCIe-comphy-handl.patch

Removed upstreamed:
  layerscape/patches-5.4/819-uart-0004-MLK-18137-fsl_lpuart-Fix-loopback-mode.patch

All others updated automatically.

Compile-tested on: lantiq/xrx200, armvirt/64
Runtime-tested on: lantiq/xrx200, armvirt/64

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-10-02 16:45:56 +02:00
Robert Marko
78cf3e53b1 mvebu: add Globalscale MOCHAbin
Globalscale MOCHAbin is a Armada 7040 based development board.

Specifications:
* Armada 7040 Quad core ARMv8 Cortex A-72 @ 1.4GHz
* 2 / 4 / 8 GB of DDR4 DRAM
* 16 GB eMMC
* 4MB SPI-NOR (Bootloader)
* 1x M.2-2280 B-key socket (for SSD expansion, SATA3 only)
* 1x M.2-2250 B-key socket (for modems, USB2.0 and I2C only)
* 1x Mini-PCIe 3.0 (x1, USB2.0 and I2C)
* 1x SATA 7+15 socket (SATA3)
* 1x 16-pin (2×8) MikroBus Connector
* 1x SIM card slot (Connected to the mini-PCIe and both M.2 slots)
* 2x USB3.0 Type-A ports via SMSC USB5434B hub
* Cortex 2x5 JTAG
* microUSB port for UART (PL2303GL/PL2303SA onboard)
* 1x 10G SFP+
* 1x 1G SFP (Connected to 88E1512 PHY)
* 1x 1G RJ45 with PoE PD (Connected to 88E1512 PHY)
* 4x 1G RJ45 ports via Topaz 88E6141 switch
* RTC with battery holder (SoC provided, requires CR2032 battery)
* 1x 12V DC IN
* 1x Power switch
* 1x 12V fan header (3-pin, power only)
* 1x mini-PCIe LED header (2x0.1" pins)
* 1x M.2-2280 LED header (2x0.1" pins)
* 6x Bootstrap jumpers
* 1x Power LED (Green)
* 3x Tri-color RGB LEDs (Controllable)
* 1x Microchip ATECC608B secure element

Note that 1G SFP and 1G WAN cannot be used at the same time as they are in
parallel connected to the same PHY.

Installation:

Copy dtb from build_dir to bin/ and run tftpserver there:
$ cp ./build_dir/target-aarch64_cortex-a72_musl/linux-mvebu_cortexa72/image-armada-7040-mochabin.dtb bin/targets/mvebu/cortexa72/
$ in.tftpd -L -s bin/targets/mvebu/cortexa72/

Connect to the device UART via microUSB port and power on the device.

Power on the device and hit any key to stop the autoboot.

Set serverip (host IP) and ipaddr (any free IP address on the same subnet), e.g:
$ setenv serverip 192.168.1.10 # Host
$ setenv ipaddr 192.168.1.15 # Device

Set the ethernet device (Example for the 1G WAN):
$ setenv ethact mvpp2-2

Ping server to confirm network is working:
$ ping $serverip
Using mvpp2-2 device
host 192.168.1.15 is alive

Tftpboot the firmware:
$ tftpboot $kernel_addr_r openwrt-mvebu-cortexa72-globalscale_mochabin-initramfs-kernel.bin
$ tftpboot $fdt_addr_r image-armada-7040-mochabin.dtb

Boot the image:
$ booti $kernel_addr_r - $fdt_addr_r

Once the initramfs is booted, transfer openwrt-mvebu-cortexa72-globalscale_mochabin-squashfs-sdcard.img.gz
to /tmp dir on the device.

Gunzip and dd the image:
$ gunzip /tmp/openwrt-mvebu-cortexa72-globalscale_mochabin-squashfs-sdcard.img.gz
$ dd if=/tmp/openwrt-mvebu-cortexa72-globalscale_mochabin-squashfs-sdcard.img of=/dev/mmcblk0 && sync

Reboot the device.

Hit any key to stop the autoboot.

Reset U-boot env and set the bootcmd:
$ env default -a
$ setenv bootcmd 'load mmc 0 ${loadaddr} boot.scr && source ${loadaddr}'

Optionally I would advise to edit the console env variable to remove earlycon as that
causes the kernel to never use the driver for the serial console.
Earlycon should be used only for debugging before the kernel can configure the console
and will otherwise cause various issues with the console.

$ setenv console 'console=ttyS0,115200'

Save and reset
$ saveenv
$ reset

OpenWrt should boot from eMMC now.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2021-10-02 16:45:35 +02:00
Ian Chang
70c75965a9 mvebu: add support for iEi Puzzle-M901/Puzzle-M902
Hardware specification
 ----------------------
 * CN9130 SoC, Quad-core ARMv8 Cortex-72 @ 2200 MHz
 * 4 GB DDR
 * 4 GB eMMC
 * mmcblk0
 - mmcblk0p1    64M  kernel_1
 - mmcblk0p2    64M  kernel_2
 - mmcblk0p3   512M  rootfs_1
 - mmcblk0p4   512M  rootfs_2
 - mmcblk0p5   512M  Reserved
 - mmcblk0p6    64M  Reserved
 - mmcblk0p7   1.8G  rootfs_data

 * 4 MB (SPI Flash)
 * 6 x 2.5 Gigabit  ports (Puzzle-M901)
 - External PHY with 6 ports (AQR112R)

 * 6 x 2.5 Gigabit ports (Puzzle-M902)
 - External PHY with 6 ports (AQR112R)
   3 x 10 Gigabit ports (Puzzle-M902)
 - External PHY with 3 ports (AQR113R)

 * 4 x Front panel LED
 * 1 x USB 3.0
 * Reset button on Rear panel
 * UART (115200 8N1,header on PCB)

 Flash instructions:
    The original firmware is based on OpenWrt.
    Flash firmware using LuCI and CLI

Signed-off-by: Ian Chang <ianchang@ieiworld.com>
2021-09-09 23:36:13 +02:00
Ian Chang
c98ddf0f01 mvebu: backport CN9130 dts necessary files changes to 5.4
1. Add support for Marvell CN9130 SoC
 2. Add support for CP115,and create an armada-cp11x.dtsi file which will be used to instantiate both CP110 and CP115
 3. Add support for AP807/AP807-quad,AP807 is a major component of CN9130 SoC series
 4. Drop PCIe I/O ranges from CP11x file and externalize PCIe macros from CP11x file

Signed-off-by: Ian Chang <ianchang@ieiworld.com>
2021-09-09 23:36:13 +02:00
Rui Salvaterra
c9042202ad mvebu: switch to kernel 5.10
It's been brewing on my cortexa9 subtarget (Turris Omnia) for months.
Perfectly stable.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
[modify subject to match previous updates]
Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-09-08 13:28:22 -10:00
Rui Salvaterra
505b7a2d08 kernel: move two symbols to the generic kconfigs
CONFIG_RCU_{NEED_SEGCBLIST,STALL_COMMON} are set basically everywhere. Move them
to the generic kconfigs. And resort the generic kconfigs while at it.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-29 17:07:19 +02:00
John Audia
be7e0091fe kernel: bump 5.4 to 5.4.143
Manually rebased:
  bcm27xx/patches-5.4/950-1031-net-lan78xx-Ack-pending-PHY-ints-when-resetting.patch

Removed upstreamed:
  mvebu/patches-5.4/100-cpufreq-armada-37xx-forbid-cpufreq-for-1.2-GHz-variant.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-08-29 16:31:02 +02:00
John Audia
6b1cd3e345 kernel: bump 5.10 to 5.10.61
Manually rebased:
  bcm27xx/patches-5.10/950-1031-net-lan78xx-Ack-pending-PHY-ints-when-resetting.patch

Removed upstreamed:
  mvebu/patches-5.10/101-cpufreq-armada-37xx-forbid-cpufreq-for-1.2-GHz-variant.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B
Run-tested: bcm2711/RPi4B

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-08-29 16:30:20 +02:00
Daniel Golle
98bccdafd7
base-files: rename 'sdcard' to 'legacy-sdcard'
While an image layout based on MBR and 'bootfs' partition may be easy
to understand for users who are very used to the IBM PC and always have
the option to access the SD card outside of the device (and hence don't
really depend on other recovery methods or dual-boot), in my opinion
it's a dead end for many desirable features on embedded systems,
especially when managed remotely (and hence without an easy option to
access the SD card using another device in case things go wrong, for
example).

Let me explain:

* using a MSDOS/VFAT filesystem to store kernel(s) is problematic, as a
  single corruption of the bootfs can render the system into a state
  that it no longer boots at all. This makes dual-boot useless, or at
  least very tedious to setup with then 2 independent boot partitions
  to avoid the single point of failure on a "hot" block (the FAT index
  of the boot partition, written every time a file is changed in
  bootfs). And well: most targets even store the bootloader environment
  in a file in that very same FAT filesystem, hence it cannot be used
  to script a reliable dual-boot method (as loading the environment
  itself will already fail if the filesystem is corrupted).

* loading the kernel uImage from bootfs and using rootfs inside an
  additional partition means the bootloader can only validate the
  kernel -- if rootfs is broken or corrupted, this can lead to a reboot
  loop, which is often a quite costly thing to happen in terms of
  hardware lifetime.

* imitating MBR-boot behavior with a FAT-formatted bootfs partition
  (like IBM PC in the 80s and 90s) is just one of many choices on
  embedded targets. There are much better options with modern U-Boot
  (which is what we use and build from source for all targets booting
  off SD cards), see examples in mediatek/mt7622 and mediatek/mt7623.

Hence rename the 'sdcard' feature to 'legacy-sdcard', and prefix
functions with 'legacy_sdcard_' instead of 'sdcard_'.

Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-16 12:22:17 +01:00
John Audia
ed9341dd78 kernel: bump 5.4 to 5.4.140
Removed upstreamed bcm27xx/patches-5.4:
    950-0977-USB-gadget-f_hid-avoid-crashes-and-log-spam.patch
    950-0980-SQUASH-USB-gadget-f_hid-remove-more-spam.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-08-14 20:25:25 +02:00
John Audia
02e2723ef3 kernel: bump 5.4 to 5.4.139
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-08-14 20:25:19 +02:00
Josef Schlehofer
4b2dc4dbbf mvebu: armada-37xx: add patch to forbid cpufreq for 1.2 GHz
This patch is backported from linux-arm-kernel [1] to improve situation, when
it was reported that 1.2 GHz variant is unstable with DFS.
It waits to be accepted upstream, however, it waits for Marvell people to respond.

[1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20210630225601.6372-1-kabel@kernel.org/

Fixes: 7b868fe04a ("Revert "mvebu: 5.4 fix DVFS caused random boot crashes"")
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2021-08-08 20:42:01 +02:00
Josef Schlehofer
0dcb03dc63 Revert "mvebu: 5.10 fix DVFS caused random boot crashes"
Based on the discussion on the mailing list [1], the patch which was
reverted, it reverts only one patch without the subsequent ones.

This leads to the SoC scaling issue not using a CPU parent clock, but
it uses DDR clock. This is done for all variants, and it's wrong because
commits (hacks) that were using the DDR clock are no longer in the mainline kernel.

If someone has stability issues on 1.2 GHz, it should not affect all
routers (1 GHz, 800 MHz) and it should be rather consulted with guys, who are trying to
improve the situation in the kernel and not making the situation worse.

There are two solutions in cases of instability:
a) disable cpufreq
b) underclock it up to 1 GHz

This reverts commit 080a0b74e3.

[1] https://lists.openwrt.org/pipermail/openwrt-devel/2021-June/035702.html

Fixes: d379476817 ("mvebu: armada-37xx: add patch to forbid cpufreq for 1.2 GHz")
CC: Pali Rohár <pali@kernel.org>
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2021-08-08 20:42:01 +02:00
Josef Schlehofer
d379476817 mvebu: armada-37xx: add patch to forbid cpufreq for 1.2 GHz
This patch is backported from linux-arm-kernel [1] to improve situation, when
it was reported that 1.2 GHz variant is unstable with DFS.
It waits to be accepted upstream, however, it waits for Marvell people to respond.

[1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20210630225601.6372-1-kabel@kernel.org/

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2021-08-08 19:50:45 +02:00
Josef Schlehofer
7b868fe04a Revert "mvebu: 5.4 fix DVFS caused random boot crashes"
Based on the discussion on the mailing list [1], the patch which was
reverted, it reverts only one patch without the subsequent ones.

This leads to the SoC scaling issue not using a CPU parent clock, but
it uses DDR clock. This is done for all variants, and it's wrong because
commits (hacks) that were using the DDR clock are no longer in the mainline kernel.

If someone has stability issues on 1.2 GHz, it should not affect all
routers (1 GHz, 800 MHz) and it should be rather consulted with guys, who are trying to
improve the situation in the kernel and not making the situation worse.

There are two solutions in cases of instability:
a) disable cpufreq
b) underclock it up to 1 GHz

This reverts commit 080a0b74e3.

[1] https://lists.openwrt.org/pipermail/openwrt-devel/2021-June/035702.html

CC: Pali Rohár <pali@kernel.org>
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2021-08-08 19:50:45 +02:00
Klaus Kudielka
82620cd610 mvebu: Turris Omnia: use SFP module, if present
Follow the recommendations stated in the Turris Omnia DTS for eth2:

"In case SFP module is present, U-Boot has to enable the sfp node above,
remove phy-handle property, and add managed = "in-band-status" property."

The boot script is written in a way, that it works for all U-Boot
versions deployed by the vendor so far (2015.10-rc2, 2019.07).

Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
2021-08-08 19:50:45 +02:00
Klaus Kudielka
f2c57a294f mvebu: backport Turris Omnia DTS changes to 5.4
Kernel 5.4 receives a reduced set, just to make the SFP cage work.
While we are at it, move the patches accepted upstream to the 0xx series.

Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
2021-08-08 19:50:45 +02:00
Klaus Kudielka
b3b855191b mvebu: backport Turris Omnia DTS changes to 5.10
Kernel 5.10 receives the complete set of improvements from 5.11/5.12.
While we are at it, move the patches accepted upstream to the 0xx series.

Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
2021-08-08 19:50:45 +02:00
John Audia
3c0a26b43a kernel: bump 5.4 to 5.4.138
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-08-08 17:57:34 +02:00
Stijn Tintel
b1bff5cb57 mvebu: switch to generic sdcard upgrade method
Now that we have a generic sdcard upgrade method, which was copied from
the mvebu platform method, we can switch mvebu to the generic method.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-08-07 01:43:39 +03:00
John Audia
28ef764026 kernel: bump 5.4 to 5.4.135
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-07-31 19:13:00 +02:00
Tomasz Maciej Nowak
cbdd2b62e4 mvebu: limit mvneta tx queue workaround to 32 bit SoC
This patch has been carried since introduction throughout every kernel
major bump and no one has tested if the later kernels improved the
situation. The Armada 3720 SoC can only process GbE interrupts on Core 0
and this is already limited in all stable kernels, so ditch this
workaround for 64 bit SoCs.

Ref: https://git.kernel.org/torvalds/c/cf9bf871280d

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2021-07-25 13:52:38 +02:00
John Audia
5408e811b2 kernel: bump 5.4 to 5.4.133
Manually rebased:
  pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-07-25 13:52:38 +02:00
Ansuel Smith
2ca8e424b9 mvebu: convert mtd-mac-address to nvmem implementation
Define nvmem-cells and convert mtd-mac-address to nvmem implementation.
The conversion is done with an automated script.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-07-19 14:51:22 +02:00
John Audia
e6bb0b6ad9 kernel: bump 5.4 to 5.4.128
Removed upstreamed:
  mvebu/patches-5.4/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-06-26 12:49:15 +02:00
Tomasz Maciej Nowak
db014428b1 mvebu: armada-37xx: remove ethernet alias patch
This patch has been added with initial support for ESPRESSObin board and
mistakenly it affects all boards with this SoC. Drop this patch since
the aliases are now in upstream dts for ESPRESSObin. If any boards are
relying on this, please add the respective alias to that board dts.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2021-06-06 00:26:13 +02:00
Adrian Schmutzler
6f648ed7e6 treewide: remove "+" sign for increment with macaddr_add
Many people appear to use an unneeded "+" prefix for the increment
when calculating a MAC address with macaddr_add. Since this is not
required and used inconsistently [*], just remove it.

[*] As a funny side-fact, copy-pasting has led to almost all
    hotplug.d files using the "+", while nearly all of the
    02_network files are not using it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-06-05 23:54:37 +02:00
Robert Marko
080a0b74e3 mvebu: 5.10 fix DVFS caused random boot crashes
5.10.37 and 5.4.119 introduced a lot of DVFS changes for Armada 37xx from 5.13 kernel.

Unfortunately commit:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/cpufreq/armada-37xx-cpufreq.c?h=v5.10.37&id=a13b110e7c9e0dc2edcc7a19d4255fc88abd83cc

This patch actually corrects the things so that 1 or 1.2GHz models would actually get scaled to their native frequency.

However, due to a AVS setting voltages too low this will cause random crashes on 1.2GHz models.

So, until a new safe for everybody voltage is agreed on
lets revert the patch.

Fixes: d337731 ("kernel: bump 5.10 to 5.10.37")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2021-05-23 15:11:38 +02:00
John Audia
3e1c92f9e1 kernel: bump 5.4 to 5.4.118
Manually rebased:
  ath79/patches-5.4/0033-spi-ath79-drop-pdata-support.patch

Removed uneeded patch:
  ath79/patches-5.4/0050-spi-ath79-remove-spi-master-setup-and-cleanup-assign.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-05-23 15:09:06 +02:00
Rafał Miłecki
ed4641e9f1 kernel: fix parsing fixed subpartitions
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-05-06 14:53:25 +02:00
Daniel González Cabanelas
26a5aea9bc mvebu: LS421DE: improve pin configuration
The CLK125 output pin at the ethernet PHY is connected via capacitor to
GND and nowhere else. Disable it. Also tune the LED masks.

The MPP56 and MPP60 pins at the SoC are conected to the μPD720202 USB3.0
chip:
  - MPP56: wired to PCIe CLKREQ# (out)
  - MPP60: wired to PCIe RESET# (in)
Configure the pcie pinmux for these pins.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2021-05-01 00:37:15 +02:00
Rui Salvaterra
3326b5e75c treewide: switch the timer frequency to 100 Hz
Some targets select HZ=100, others HZ=250. There's no reason to select a higher
timer frequency (and 100 Hz are available in every architecture), so change all
targets to 100 Hz.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-04-21 10:31:10 +01:00
Rui Salvaterra
27b5bae2ec treewide: remove redundant ubifs kconfig symbols
For the targets which enable ubifs, these symbols are already part of the
generic kconfigs. Drop them from the target kconfigs.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-04-21 10:31:07 +01:00
Sven Eckelmann
07e5e03711 mvebu: Fix sysupgrade for GL.iNet GL-MV1000
The GL.iNet GL-MV1000 is booting from eMMC and the images for it are in
theory sysupgrade compatible. But the platform upgrade scripts were not
adjusted to select the mmcblock device as upgrade target. This resulted in
a failed sysupgrade because the mtd device (NOR flash) was instead tried to
be modified by the sysupgrade script.

Fixes: 050c24f05c ("mvebu: add support for GL.iNet GL-MV1000")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-04-17 21:56:05 +02:00
Daniel González Cabanelas
2e1ebe96c6 mvebu: armada 370: dts: fix the crypto engine
The crypto engine in Armada 370 SoCs is currently broken. It can be
checked installing the required packages for testing openssl with hw
acceleration:

  opkg install openssl-util
  opkg install kmod-cryptodev
  opkg install libopenssl-devcrypto

After configuring /etc/ssl/openssl.cnf to let openssl use the crypto
engine for digest operations, and performing some checksums..

  md5sum 10M-file.bin
  openssl md5 10M-file.bin

...we can see they don't match.

There might be an alignment or size constraint issue caused by the
idle-sram area.

Use the whole crypto sram and disable the idle-sram area to fix it. Also
disable the idle support by adding the broken-idle property to prevent
accessing the disabled idle-sram.

We don't care about disabling the idle support since it is already broken
in Armada 370 causing a huge performance loss because it disables
permanently the L2 cache. This was reported in the Openwrt forum and
elsewhere by Debian users with different board models.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2021-04-17 21:56:05 +02:00
John Audia
79fdd68103 kernel: bump 5.4 to 5.4.112
Ran update_kernel.sh in a fresh clone without any existing toolchains.

Removed upstreamed:
  mvebu/patches-5.4/319-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch

Build system : x86_64
Build-tested : ipq806x/R7800
Run-tested   : ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-04-17 21:50:08 +02:00
Rui Salvaterra
a3d431ccf7 kernel: bump 5.10 to 5.10.30
Deleted (reverse-applicable):
mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch

Automatically refreshed:
bcm63xx/patches-5.10/143-gpio-fix-device-tree-gpio-hogs-on-dual-role-gpio-pin.patch
generic/backport-5.10/610-v5.13-02-netfilter-Fix-fall-through-warnings-for-Clang.patch
generic/backport-5.10/610-v5.13-10-netfilter-nftables-update-table-flags-from-the-commi.patch
generic/hack-5.10/204-module_strip.patch
generic/hack-5.10/902-debloat_proc.patch
generic/pending-5.10/203-kallsyms_uncompressed.patch
generic/pending-5.10/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
generic/pending-5.10/920-mangle_bootargs.patch
mediatek/patches-5.10/115-dts-bpi64-add-snand-support.patch
mediatek/patches-5.10/602-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch
mediatek/patches-5.10/900-dts-mt7622-bpi-r64-aliases-for-dtoverlay.patch
ramips/patches-5.10/323-mt7621-memory-detect.patch

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-04-16 12:58:53 +01:00
Rafał Miłecki
3fd0a4222b kernel: backport 5.13 mtd partitioning changes
1. Use upstream accepted NVMEM patches
2. Minor fix for BCM4908 partitioning
3. Support for Linksys firmware partitions on Northstar

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-03-29 08:46:17 +02:00
Sven Eckelmann
c20ac84803 mvebu: Fix mac addresses for GL.iNet GL-MV1000
The original GL.iNet firmware has two different mac addresses in the
factory/art partition. The first one is for the WAN interface only and the
second one is for both lan0 and lan1.

But the original submission for OpenWrt didn't initialize the mac
addresses of the LAN ports for the DSA device at all. The ethernet mac
address was then used for all DSA ports.

Fixes: 050c24f05c ("mvebu: add support for GL.iNet GL-MV1000")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-03-27 16:56:50 +01:00
Sven Eckelmann
01b911a938 mvebu: Add button support for GL.iNet GL-MV1000
The original patch to support this device advertised support for the reset
button and the "switch" in the commit message. But neither were actually
integrated in the device tree or documented anywere.

The button itself is now used to trigger a reset (as described in the
official GL.iNet documentation). The switch itself is registered as BTN_0
like other devices from GL.iNet in ath79.

Fixes: 050c24f05c ("mvebu: add support for GL.iNet GL-MV1000")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-03-27 16:22:11 +01:00
Tad Davanzo
b4f76d9f0d mvebu: enable WRT1900AC v1 and WRT32X for buildbots
Kernel size limits have been dealt with.
Effective revert of a1eb2c46 and ac9730c4.

Signed-off-by: Tad Davanzo <tad@spotco.us>
2021-03-19 15:30:01 +01:00
Tad Davanzo
15309f5133 mvebu: venom resize kernel to 6MB
venom has a 3MB kernel partition as specified by the DTS.
3MB is not sufficient for building with many kernel modules or newer
kernel versions.

venom uboot however as set from factory will load up to 6MB.
This can be observed by looking a uboot log:
	NAND read: device 0 offset 0x900000, size 0x600000
	6291456 bytes read: OK
and from uboot environment variables:
	$ fw_printenv | grep "priKernSize";
	priKernSize=0x0600000

Resize the root partitions from 120MB to 117MB to let kernel expand
into it another 3MB.
And set kernel target size to 6MB.

Lastly set the kernel-size-migration compatibility version on venom to
prevent sysupgrading without first reinstalling from a factory image.

Signed-off-by: Tad Davanzo <tad@spotco.us>
2021-03-19 15:30:01 +01:00
Tad Davanzo
10415d5e70 mvebu: mamba resize kernel to 4MB
mamba has a 3MB kernel partition as specified by the DTS.
3MB is not sufficient for building with many kernel modules or newer
kernel versions.

mamba uboot however as set from factory will load up to 4MB.
This can be observed by looking a uboot log:
	NAND read: device 0 offset 0xa00000, size 0x400000
	4194304 bytes read: OK
and from uboot environment variables:
	$ fw_printenv | grep "pri_kern_size";
	pri_kern_size=0x400000

Resize the root partitions from 37MB to 36MB to let kernel expand
into it another 1MB.
And set kernel target size to 4MB.

Lastly add a compatibility version message: kernel-size-migration.
And set it on mamba to prevent sysupgrading without first reinstalling from
a factory image.

Signed-off-by: Tad Davanzo <tad@spotco.us>
2021-03-19 15:30:01 +01:00
Aleksander Jan Bajkowski
12e942b1fd kernel: move some disabled symbols to generic
Move some disabled symbols found in armvirt target to generic.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
2021-03-19 00:59:22 +01:00
Daniel González Cabanelas
b0235c0d8d mvebu: LS421DE: make cosmetics changes in dts file
Make some cosmetic changes in the Buffalo LinkStation LS421DE NAS:
  - Delete pointless #xxx-cells
  - bootargs: replace earlyprintk with earlycon and remove unneeded args.
  - Separate pinmux nodes with empty lines.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2021-03-13 20:15:29 +00:00
Rafał Miłecki
e90e75b12c kernel: add pending mtd patches adding NVMEM support
It's meant to provide upstream support for mtd & NVMEM. It's required
e.g. for reading MAC address from mtd partition content. It seems to be
in a final shape so it's worth testing.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-03-12 18:49:46 +01:00
Adrian Schmutzler
85b1f4d8ca treewide: remove execute bit and shebang from board.d files
So far, board.d files were having execute bit set and contained a
shebang. However, they are just sourced in board_detect, with an
apparantly unnecessary check for execute permission beforehand.

Replace this check by one for existance and make the board.d files
"normal" files, as would be expected in /etc anyway.

Note:

This removes an apparantly unused '#!/bin/sh /etc/rc.common' in
target/linux/bcm47xx/base-files/etc/board.d/01_network

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-03-06 11:30:06 +01:00
Rui Salvaterra
3a187fa718 kernel: bump 5.10 to 5.10.20
Also add a new kconfig symbol (CONFIG_KCMP) to the generic config,
disabling the SYS_kcmp syscall (it was split from
CONFIG_CHECKPOINT_RESTORE, which is disabled by default, so the
previous behaviour is kept).

Removed (upstreamed) patches:
  070-net-icmp-pass-zeroed-opts-from-icmp-v6-_ndo_send-bef.patch
  081-wireguard-device-do-not-generate-ICMP-for-non-IP-pac.patch
  082-wireguard-queueing-get-rid-of-per-peer-ring-buffers.patch
  083-wireguard-kconfig-use-arm-chacha-even-with-no-neon.patch
  830-v5.12-0002-usb-serial-option-update-interface-mapping-for-ZTE-P685M.patch

Manually rebased patches:
  313-helios4-dts-status-led-alias.patch
  104-powerpc-mpc85xx-change-P2020RDB-dts-file-for-OpenWRT.patch

Run tested:
  ath79 (TL-WDR3600)
  mvebu (Turris Omnia)

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-03-05 20:35:01 +01:00
Jason A. Donenfeld
196f3d586f kernel-5.4: bump to 5.4.102 and refresh patches
5.4.102 backported a lot of stuff that our WireGuard backport already
did, in addition to other patches we had, so those patches were
removed from that part of the series. In the process other patches were
refreshed or reworked to account for upstream changes.

This commit involved `update_kernel.sh -v -u 5.4`.

Cc: John Audia <graysky@archlinux.us>
Cc: David Bauer <mail@david-bauer.net>
Cc: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-03-04 22:06:53 +01:00
Rafał Miłecki
7a7b2fd809 kernel: add the latest mtd patch extending ofpart parser
This adds the latest version of ofpart commit. It hopefully
1. Doesn't break compilation
2. Doesn't break partitioning
(this time).

It's required to implement fixed partitioning with some quirks. It's
required by bcm53xx, bcm4908, kirkwood, lantiq and mvebu.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-03-01 18:18:38 +01:00
Rui Salvaterra
6fe6b631ef mvebu/omnia: fix the device tree
Backport [1] and fix [2] hardware buffer management. Also fix the IRQ storm
caused by a misconfiguration of the PCA9538 interrupt pin [3].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/armada-385-turris-omnia.dts?id=018b88eee1a2efda26ed2f09aab33ccdc40ef18f
[2] https://lore.kernel.org/linux-arm-kernel/20210217153038.1068170-1-rsalvaterra@gmail.com/
[3] https://lore.kernel.org/linux-arm-kernel/20210220231144.32325-1-kabel@kernel.org/

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-03-01 00:34:22 +01:00
Jeff Collins
6e0c780eb3 mvebu: add LED support for GL.iNet GL-MV1000
This patch enables LED support for the GL.iNet GL-MV1000

Signed-off-by: Jeff Collins <jeffcollins9292@gmail.com>
[add SPDX identifier on new file, add aliases, minor cosmetic issues]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-26 13:57:50 +01:00
Adrian Schmutzler
ef2cb8572b treewide: rename IMAGE_PREFIX/IMAGE_NAME to DEVICE_IMG_*
We so far had two variables IMG_PREFIX and IMAGE_PREFIX with
different content. Since these names are obviously quite
confusing, this patch renames the latter to DEVICE_IMG_PREFIX,
as it's a device-dependent variable, while IMG_PREFIX is only
(sub)target-dependent.

For consistency, also rename IMAGE_NAME to DEVICE_IMG_NAME, as
that's a device-dependent variable as well.

Cc: Paul Spooren <mail@aparcar.org>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-25 18:11:06 +01:00
Kabuli Chana
dc8cc44612 kernel: bump version 5.10 to 5.10.18
update kernel version, refresh current patchset

Signed-off-by: Kabuli Chana <newtownBuild@gmail.com>
[rebase/refresh]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-24 18:45:59 +01:00
Adrian Schmutzler
8d766aa669 kernel: add further missing symbols
CONFIG_NET_DSA_MV88E6XXX_PTP was simply missing in generic config.

CONFIG_I2C_PXA_SLAVE was previously enabled via i2c-pxa package,
but got removed there without moving the symbol to generic config.

Fixes: dd13add3ce ("kernel: i2c-pxa: remove slave")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-24 02:53:53 +01:00
Adrian Schmutzler
5e9b07ff36 kernel: add symbol CONFIG_POWER_RESET_LINKSTATION
Add symbol to generic config (this was added between 5.4 and 5.10),
and remove it from the targets where it was added by kernel_oldconfig
in the meantime.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-23 21:08:21 +01:00
Rui Salvaterra
fde9703a48 mvebu: add 5.10 as a testing kernel
Keep 5.4 as stable until further validation.

Tested on Turris Omnia (Rui Salvaterra) and ESPRESSObin v5 (Tomasz
Maciej Nowak). Cortex-A{53,72} subtargets are only build-tested.

Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
[added comment about tests]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-23 18:31:35 +01:00
Rui Salvaterra
b0cdc5ae46 mvebu: fix the Turris Omnia device tree
Enable and fix hardware buffer management. Also fix the IRQ storm caused by a
misconfiguration of the PCA9538 interrupt pin.

Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-02-23 18:31:35 +01:00
Rui Salvaterra
23ebb2e9c3 mvebu: fix the patch numbering
Make each logical patch group numbering contiguous.

Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
[add kernel version to backport]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-23 18:31:35 +01:00
Rui Salvaterra
b43f5a9359 mvebu: refresh 5.10 kconfigs/patches
Also delete already upstreamed patches/changes.

Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-02-23 18:31:35 +01:00
Adrian Schmutzler
7be8ab4f7b mvebu: remove upstreamed DTS files in 5.10
Some armada-3720-espressobin-* files have been upstreamed, move
these to files-5.4.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-23 18:31:35 +01:00
Rui Salvaterra
202515b901 mvebu: copy 5.4 patches/kconfigs to 5.10
Just a simple copy, no refresh yet.

Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
[do not duplicate files]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-23 18:31:35 +01:00
Rui Salvaterra
4d9ae8ca07 mvebu: refresh the 5.4 kernel configs
Remove the implicit/inherited symbols. While not strictly necessary, this will
make reviewing the diff between 5.4 and 5.10 easier.

Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-02-23 18:31:35 +01:00
Tomasz Maciej Nowak
1caa81e505 mvebu: espressobin: drop COMPHY removement patch
There are proper workarounds merged to 5.4 stable tree for ESPRESSObin
boards with older bootloader:
4e1a23779bde ("ata: ahci: mvebu: Make SATA PHY optional for Armada 3720")
40af962eb1d4 ("usb: host: xhci: mvebu: make USB 3.0 PHY optional for
Armada 3720")

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2021-02-14 09:34:57 +01:00
Adrian Schmutzler
7157c77c6d target: use SPDX license identifiers on scripts
Use SPDX license tags to allow machines to check licenses.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-10 15:47:23 +01:00
Adrian Schmutzler
598b29585e target: use SPDX license identifiers on Makefiles
Use SPDX license tags to allow machines to check licenses.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-10 15:47:18 +01:00
John Audia
d33cd383ed kernel: bump 5.4 to 5.4.94
All modification made by update_kernel.sh in a fresh clone without
existing toolchains.

Build-tested: bcm27xx/bcm2711, ipq806x/R7800,
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-02-01 19:10:43 +01:00
Petr Štetiar
337ff74894 mvebu: omnia: make initramfs image usable out of the box
Currently it's not possible to boot the device with just initramfs image
without additional effort as the initramfs image doesn't contain device
tree.  Fix it by producing FIT based image which could be booted with
following commands:

 setenv bootargs earlyprintk console=ttyS0,115200
 tftpboot ${kernel_addr_r} openwrt-mvebu-cortexa9-cznic_turris-omnia-initramfs-kernel.bin
 bootm ${kernel_addr_r}

Acked-by: Klaus Kudielka <klaus.kudielka@gmail.com>
Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2021-01-31 11:39:19 +01:00
Daniel González Cabanelas
24b910dca2 mvebu: LS421DE: fix the thermal zones
The thermal zones kernel documentation is misleading, we cannot use more
than one sensor in a thermal zone node.

Furthermore the drivetemp driver for some reason it only catches one
sensor from the hard drives array (the first available).

In the Buffalo Linkstation LS421DE board there is also a sensor at the
ethernet phy chip that can also be monitored. Very useful to stop the fan
when there are no hard drives in the bays.

(It might be also possible to add the CPU sensor, but it requires kernel
patching for registering the sensor via device tree, using the function:
devm_thermal_zone_of_sensor_register)

Fix the thermal zones to use only one sensor per node and add the ethernet
phy sensor. Also adjust the hdd temperatures to be more conservative for
a mechanical hard drive.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2021-01-30 01:03:00 +01:00
Adrian Schmutzler
f52081bcf9 treewide: provide global default for SUPPORTED_DEVICES
The majority of our targets provide a default value for the variable
SUPPORTED_DEVICES, which is used in images to check against the
compatible on a running device:

  SUPPORTED_DEVICES := $(subst _,$(comma),$(1))

At the moment, this is implemented in the Device/Default block of
the individual targets or even subtargets. However, since we
standardized device names and compatible in the recent past, almost
all targets are following the same scheme now:

  device/image name:  vendor_model
  compatible:         vendor,model

The equal redundant definitions are a symptom of this process.

Consequently, this patch moves the definition to image.mk making it
a global default. For the few targets not using the scheme above,
SUPPORTED_DEVICES will be defined to a different value in
Device/Default anyway, overwriting the default. In other words:
This change is supposed to be cosmetic.

This can be used as a global measure to get the current compatible
with: $(firstword $(SUPPORTED_DEVICES))
(Though this is not precisely an achievement of this commit.)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-23 12:45:21 +01:00
Sungbo Eo
583e39e3d5 kernel: drop empty kmod-ledtrig-* packages
The following four led triggers are enabled in generic config.

* kmod-ledtrig-default-on
* kmod-ledtrig-heartbeat
* kmod-ledtrig-netdev
* kmod-ledtrig-timer

Drop the packages and remove them from DEVICE_PACKAGES.
There's no other package depending on them in this repo.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2021-01-15 18:24:31 +01:00
Adrian Schmutzler
9b1b89229f kernel: bump 5.4 to 5.4.86
Removed upstreamed patches:
  pending-5.4/499-mtd-parser-cmdline-Fix-parsing-of-part-names-with-co.patch

Manually merged:
  pending-5.4/611-netfilter_match_bypass_default_table.patch
  layerscape/302-dts-0112-arm64-dts-fsl-ls1028a-prepare-dts-for-overlay.patch

Build-tested: ipq806x/R7800, bcm27xx/bcm2711, ath79/{generic,tiny},
              ipq40xx, octeon, ramips/mt7621, realtek, x86/64
Run-tested: ipq806x/R7800, realtek

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: John Audia <graysky@archlinux.us>
Tested-by: Stijn Segers <foss@volatilesystems.org>
2021-01-01 17:07:28 +01:00
Aleksander Jan Bajkowski
77575d4c02 kernel: move some disabled symbols to generic
Move some disabled config options found in lantiq target to generic.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
2020-12-22 19:11:50 +01:00
Petr Štetiar
3aeaef6e56 Revert "mvebu: fix initramfs/kernel image for CZNIC Turris Omnia"
This reverts commit e401a2a42e as at least
two users had reported breakage on their devices.

References: https://lists.infradead.org/pipermail/openwrt-devel/2020-December/032837.html
References: e401a2a42e (commitcomment-45189788)
Cc: Karel Kočí <karel.koci@nic.cz>
Reported-by: Magnus Kroken <mkroken@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-12-22 19:11:37 +01:00
Daniel González Cabanelas
a9deace10c mvebu: gpio-mvebu IRQ index error kernel backport
Backport the upstream kernel fix 525b0858ff to get rid of the kernel
messages:

mvebu-gpio xxxxxx.gpio: IRQ index 3 not found

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2020-12-22 18:59:10 +01:00
Daniel González Cabanelas
b8362c20e7 mvebu: LS421DE: use the RTC as a wakeup source
The Buffalo Linkstation LS421DE comes with a Ricoh RS5C372A real time
clock. This RTC has the INTRA pin connected to the power management
circuit, allowing to wake up the device from the power off state when an
alarm is scheduled.

Add the "wakeup-source" property in the RTC dts node to allow the use
of the alarm.

Example of use, the device is powered off and it comes to life after 5
minutes:
echo $(expr $(date '+%s') + 60 * 5) > /sys/class/rtc/rtc0/wakealarm
poweroff

This feature isn't available in the stock firmware.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2020-12-22 18:59:10 +01:00
Daniel González Cabanelas
3064651bf7 mvebu: LS421DE: fix low performance issue
The Buffalo Linkstation LS421DE isn't able to enable the Level 2 cache
(AKA Aurora cache). As of result of this, the throughput is about half of
the expected, e.g when doing network data transfers.

Fix it by adding the broken-idle property in the coherency fabric node.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2020-12-22 18:59:10 +01:00
Tomasz Maciej Nowak
85caf21ade mvebu: macchiatobin-singleshot: enable heartbeat LED
With board revision 1.3, SolidRun moved the power LED to the middle of
the board. In old place of power LED a GPIO controllable heartbeat LED
was added. This commit touches only Single Shot variant, because all
have revision 1.3. Some boards could be placed in an enclosure, therefore
the LED18 is enabled by default, since that'll be the only visible
indicator that the board is operating.

Ref: http://wiki.macchiatobin.net/tiki-index.php?page=Schematics#Revision1.3_Electrical_Design_Changes
Ref: http://macchiatobin.net/wp-content/uploads/2017/11/MACCHIATOBin-rev-1_3.pdf

Reported-by: Alexandra Alth <alexandra@alth.de>
Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2020-12-20 00:00:33 +01:00
Karel Kočí
e401a2a42e mvebu: fix initramfs/kernel image for CZNIC Turris Omnia
This adds DTB to kernel and that way makes it possible to easily boot
initramfs image and also kernel.

The sequence to boot initramfs on Omnia is then just:
  env set bootargs earlyprintk console=ttyS0,115200
  dhcp 0x1000000 192.168.1.1:openwrt-mvebu-cortexa9-cznic_turris-omnia-initramfs-kernel.bin
  bootz 0x1000000

Without this change kernel boot won't proceed and is stuck on "Starting
kernel".

Signed-off-by: Karel Kočí <karel.koci@nic.cz>
[fixed From: to match with SoB:]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-12-11 13:56:29 +01:00
Tomasz Maciej Nowak
1ac3b53278 mvebu: sysupgrade: write additional information to log output
This will explain what is actually occuring on dd invocations.
Additionally remove comments for steps which are described by printed
statements anyway.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2020-12-01 19:39:08 +01:00
Tomasz Maciej Nowak
b5036569aa mvebu: sysupgrade: use v function for writing logs
Sync with x86 target changes.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2020-12-01 19:38:43 +01:00
Klaus Kudielka
485ce5bbe5 mvebu: fixup Turris Omnia U-Boot environment
Fixup dfa357a3de "mvebu: base-files: Update Turris Omnia U-Boot
environment" which should have included this file as well.

By rebasing the initial patch this file somehow disappeared.

Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
Reviewed-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
Tested-by: W. Michael Petullo <mike@flyn.org> (Turris Omnia "2020")
Tested-by: Klaus Kudielka <klaus.kudielka@gmail.com> (Turris Omnia)
[explain fixup in commit message]
Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-11-27 17:36:10 -10:00
Klaus Kudielka
dfa357a3de mvebu: base-files: Update Turris Omnia U-Boot environment
Move the update procedure from sysupgrade to first boot, which is much
more convenient in the sysupgrade case (otherwise the environment is
always one generation behind).

Check whether we have an old U-Boot release installed, and update the
environment only if necessary.

Some notes on the U-Boot environment:

The first 9 lines are a copy of the default environment of the old U-Boot
release - only modified, to run "distro_bootcmd", in case "mmcboot" fails
to boot the factory OS.

The remaining 16 lines are a backport of the default environment of the
new U-Boot release (shipped with CZ11NIC23). The main entry point is
"distro_bootcmd", which eventually sources boot.scr. This way, we have
a unified boot protocol for all Turris Omnia revisions so far.

This commit also fixes a shortcoming of previous Turris Omnia support:

Users may install OpenWrt with the Turris Omnia in factory state
(i.e. invalid environment store). In that case, neither fw_setenv, nor
U-Boot itself, would import the default environment from the image -
screwing up the rescue system, at least!

Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
Reviewed-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
Tested-by: W. Michael Petullo <mike@flyn.org> (Turris Omnia "2020")
Tested-by: Klaus Kudielka <klaus.kudielka@gmail.com> (Turris Omnia)
2020-11-26 21:55:59 -10:00
Klaus Kudielka
afd4375a33 mvebu: Add turris-omnia.bootscript
In contrast to the U-Boot version shipped with older versions of Turris
Omnia (CZ11NIC13, CZ11NIC20), the version shipped with Turris Omnia 2019
(CZ11NIC23) relies on the existence of /boot.scr.

Consequently, add a suitable boot script to the sysupgrade image.

Flash instructions for Turris Omnia 2019:
- Download openwrt-...-sysupgrade.img.gz, gunzip it, and copy the resulting
  .img file to the root of a USB flash drive (FAT32 or ext2/3/4).
- Enter a rescue shell: Either via 5-LED reset and ssh root@192.168.1.1
  on LAN port 4, or via 7-LED reset and the serial console.
- Insert the USB drive and mount it:
  mkdir /mnt; mount /dev/sda1 /mnt
- Flash the OpenWrt image to eMMC:
  dd if=/mnt/openwrt-...-sysupgrade.img of=/dev/mmcblk0 bs=4096 conv=fsync
- Reboot.

Flash instructions using a temporary "medkit" installation were written for
the older versions of Turris Omnia, and will *not* work on the Turris Omnia
2019.

Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
Reviewed-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
Tested-by: W. Michael Petullo <mike@flyn.org> (Turris Omnia "2020")
2020-11-26 21:52:04 -10:00
Tomasz Maciej Nowak
456f5680db mvebu: sysupgrade: use get_image_dd wrapper
This function eliminates false-positive errors emitted by dd.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2020-11-25 18:18:54 +01:00