1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-13 10:49:13 +02:00
Commit Graph

84 Commits

Author SHA1 Message Date
Rafał Miłecki
30b168b9b8 bcm4908: sysupgrade: refactor handling different firmware formats
This results in setting format specific data (format info, extract
commands) in a single function. It should help maintaining sysupgrade
code.

This change has been tested on Asus GT-AC5300 and Netgear R8000P.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-12-02 09:17:43 +01:00
Hauke Mehrtens
101300b842 bcm4908: Deactivate pci feature
This target does not activate CONFIG_PCI kernel configuration option, do
not activate the PCI feature. This will deactivate some PCI drivers
which are not building without PCI support in the kernel.

If PCI_SUPPORT or PCIE_SUPPORT are activated in the kernel configuration
the feature flag will be automatically set by the build system again.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-11-29 22:40:44 +01:00
Hauke Mehrtens
be3fcd72e9 kernel: Deactivate B53 symbols in generic configuration
Deactivate all the symbols of the B53 DSA driver in the generic kernel
configuration. Multiple targets are now using this drivers and they
only need some of the options.
This fixes the bcm4908 build which didn't deactivate all of the options.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-11-29 22:37:58 +01:00
Rafał Miłecki
0e8a5acf6e bcm4908: build chk image for Netgear RAXE500
Fixes: 63ba3eaccd ("bcm4908: start working on Netgear RAXE500 image")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-11-19 14:49:18 +01:00
Rafał Miłecki
63ba3eaccd bcm4908: start working on Netgear RAXE500 image
bootfs still needs more work before it's ready.

For some unknown reason model RAXE500 uses board id RAX220.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-11-19 14:45:47 +01:00
Rafał Miłecki
21d28adbc1 bcm4908: enable MTD_CMDLINE_PARTS
It's needed to support devices with U-Boot. That bootloader passes MTD
layout using cmdline.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-11-19 14:32:58 +01:00
Rafał Miłecki
494c033f9c bcm4908: continue work on images for U-Boot based devices
It still isn't ready though - more data needs to be added to the bootfs.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-11-19 14:32:58 +01:00
Rafał Miłecki
d745835ae1 bcm4908: backport upstream DT commits
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-11-18 17:51:24 +01:00
Rafał Miłecki
f1a074d0ce bcm4908: switch to kernel 5.10
Tested on:
1. Asus GT-AC5300
2. Netgear R8000P

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-11-09 12:44:26 +01:00
Rafał Miłecki
9565bd9bd6 bcm4908: add watchdog support
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-11-09 12:44:23 +01:00
Rafał Miłecki
9a18bbec1f bcm4908: refresh kernel configs
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-11-09 12:27:49 +01:00
Rafał Miłecki
c4ff53b971 bcm4908: fix b53 regression regarding RGMII reg(s)
This fixes:
[   35.308550] WARNING: CPU: 0 PID: 230 at bcm_sf2_reg_rgmii_cntrl.isra.0+0x84/0x90

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-11-08 17:52:29 +01:00
Rafał Miłecki
a02c971dff bcm4908: start work on images for devices using U-Boot
New BCM4908 family based routers will use U-Boot bootloader. That will
require using a totally different firmware format. Kernel has to be put
in a FIT image.

OpenWrt has some helpers for generating .its files but they don't fit
BCM4908 requirements and there is no simple way of extending any of
them. The best solution seems to be storing an .its template.

BCM4908 bootfs may:
1. contain extra binaries (other than kernel & DTB)
2. include multiple DTB files
3. store device specific U-Boot configurations with custom properties

Such setups are too complex to generate using shell script. Raw .its
file on the other hand seems quire clean & reasonable.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-11-08 15:57:55 +01:00
John Audia
83f1d72dea kernel: bump 5.10 to 5.10.78
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-11-07 19:59:10 +01:00
Sungbo Eo
f432353850 bcm4908: fix calculation of new cferam index
The arithmetic expansion fails when idx becomes a two digit number.
Fix this by relying on expr command.

root@OpenWrt:/# echo $(((028 + 0) % 1000))
/bin/ash: arithmetic syntax error
root@OpenWrt:/# echo $(($(expr 028 + 0) % 1000))
28

Fixes: a6a0b252ba ("bcm4908: add sysupgrade support")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2021-11-04 15:52:03 +01:00
Rafał Miłecki
20d3e236b2 bcm4908: add testing support for kernel 5.10
CONFIG_COMPAT_32BIT_TIME is a new symbol and has to be set to avoid:
Provide system calls for 32-bit time_t (COMPAT_32BIT_TIME) [N/y/?] (NEW)

CONFIG_RELOCATABLE needs to be enabled to make kernel start booting.
That raises a question: do we really need CONFIG_EXPERT=y ?

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-11-03 12:16:06 +01:00
Rafał Miłecki
e3a1e78cd8 bcm4908: prepare kernel 5.10 support
It compiles but *doesn't* boot so it isn't enabled yet.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-11-03 12:08:40 +01:00
John Audia
3d0499bcdb kernel: bump 5.4 to 5.4.154
All patches automatically rebased.

Signed-off-by: John Audia <graysky@archlinux.us>
2021-10-21 00:17:36 +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
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
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
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
David Bauer
0f3f5d47d3 bcm4908: add missing config symbol
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-13 00:52:35 +02:00
Ansuel Smith
91a52f22a1 treewide: backport support for nvmem on non platform devices
In the current state, nvmem cells are only detected on platform device.
To quickly fix the problem, we register the affected problematic driver
with the of_platform but that is more an hack than a real solution.
Backport from net-next the required patch so that nvmem can work also
with non-platform devices and rework our current patch.
Drop the mediatek and dsa workaround and rework the ath10k patches.
Rework every driver that use the of_get_mac_address api.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-08-05 01:46:26 +02:00
Rafał Miłecki
f8d5bd20b3 bcm4908: fix Ethernet broken state after interface restart
This fixes traffic stalls after ifdown & ifup.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-06-22 08:06:13 +02:00
Rafał Miłecki
fcfa60408c bcm4908: add kmod-gpio-button-hotplug
All bcm4908 devices are expected to have GPIO buttons to make relevant
package selected by default.
This "fixes" triggering failsafe mode.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-06-21 09:12:59 +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
Rafał Miłecki
d92a9c97bf bcm4908: enable Netgear R8000P bootloader image
This enables building BCM4908 "raw" image that can be flashed using
bootloader web UI. It requires serial console access & stopping booting
by the "Press any key to stop auto run".

It's easy to build vendor like CHK image but it can't be safely flashed
using vendor UI at this point. Netgear implements method called "NAND
incremental flashing" that doesn't seem to flash bootfs partition as
provided.

Above method seems to update vmlinux.lz without updating 94908.dtb. It
prevents OpenWrt kernel from booting due to incomplete DTB file. Full
Netgear R8000P support can be enabled after finding a way to make vendor
firmware flash OpenWrt firmware including the 94908.dtb update.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-08 10:50:59 +02:00
Rafał Miłecki
5e78cb9b85 bcm4908: enable target & Asus GT-AC5300 image
OpenWrt was succesfully tested on the GT-AC5300 model. It's possible to:
1. Install OpenWrt using vendor UI
2. Perform UBI aware sysupgrade
3. Install vendor firmware using OpenWrt sysupgrade

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-08 10:50:59 +02:00
Rafał Miłecki
9b4fc4cae9 firmware-utils: bcm4908img: convert into a package
bcm4908img is a tool managing BCM4908 platform images. It's used for
creating them as well as checking, modifying and extracting data from.

It's required by both: host (for building firmware images) and target
(for sysupgrade purposes). Make it a host/target package.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-08 10:50:59 +02:00
Rafał Miłecki
f2c8c62d98 bcm4908: fix Netgear R8000P image
Use vendor format to allow flashing using Negear UI.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-07 14:46:46 +02:00
Rafał Miłecki
a6a0b252ba bcm4908: add sysupgrade support
It supports flashing OpenWrt images (bootfs & UBI upgrade) as well as
vendor images (whole MTD partition write).

Upgrading cferom is unsupported. It requires copying device specific
data (like MAC) to target image before flashing.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-07 14:44:20 +02:00
Rafał Miłecki
ca9b1f15c4 bcm4908: pad firmware image bootfs JFFS2 partition to 8 MiB
This way MTD "bootfs" partition will be always 8+ MiB. This should be
enough for any custom / future firmware to fit its bootfs (e.g. big
kernel) without having to repertition whole flash. That way we can
preserve UBI and its erase counters during sysupgrade.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-07 09:36:47 +02:00
Rafał Miłecki
880c8b4422 bcm4908: rename bootfs dummy file to the 1-openwrt
The purpose of that dummy file is to make CFE work properly with OpenWrt
bootfs. CFE for some reason ignores JFFS2 files with ino 0.

Rename it to 1-openwrt so:
1. It's consistent with bcm63xx
2. It's OpenWrt specific so sysupgrade can distinguish it from vendor
   images

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-06 00:07:12 +02:00
Rafał Miłecki
180c463526 bcm4908: enable JFFS2 support
It's needed for accessing JFFS2 bootfs partition.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-05 10:44:46 +02:00
John Audia
ec6293febc kernel: bump 5.4 to 5.4.109
Ran update_kernel.sh in a fresh clone without any existing toolchains.

Manually rebased:
  pending-5.4/611-netfilter_match_bypass_default_table.patch

The upstream change affecting this patch is the revert of an earlier
kernel commit. Therefore, we just revert our corresponding changes
in [1].

Build system: x86_64
Build-tested: ipq806x/R7800

[1] 9b1b89229f ("kernel: bump 5.4 to 5.4.86")

Signed-off-by: John Audia <graysky@archlinux.us>
[adjust manually rebased patch, add explanation]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-04-02 16:45:28 +02:00
Rafał Miłecki
1cc5eb45d5 bcm4908: backport DT patch adding Ethernet MAC address
This tells OS (Linux) where from MAC should be read (bootloader MTD
partition).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-03-31 23:15:49 +02: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
John Audia
55be1c3734 kernel: bump 5.4 to 5.4.108
All modifications made by by update_kernel.sh.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800 [only 5.4.107]
No dmesg regressions, everything functional

Run-tested by @timocapa:
 - ramips/mt7621/{Xiaomi R3G, Redmi 2100}
 - Lantiq/XWAY/Fritz!Box 7320/7330

Signed-off-by: John Audia <graysky@archlinux.us>
[squash, edit commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-03-27 16:39:31 +01:00
Rafał Miłecki
a49fd9db0a bcm4908: backport the latest bcm_sf2 commits
1. CFP support for BCM4908
2. Upstream RGMII regs fix

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-03-22 08:19:36 +01:00
Rafał Miłecki
13d9904acd bcm4908: backport DTS patch with Ethernet TX IRQ
It allows bcm4908_enet Linux driver to work more efficiently.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-03-22 07:45:34 +01:00
Rafał Miłecki
2b4986b942 bcm4908: add MTD support for repartitioning
It's required for sysupgrade which requires:
1. Flashing new firmware
2. Finding updated bootfs partition
3. Updating bootfs content

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-03-22 07:44:10 +01:00
Rafał Miłecki
e1b4fd52a8 bcm4908: backport recent bcm_sf2 changes
One 5.12 link fix and 5.13 crossbar support.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-03-17 08:10:54 +01:00
Rafał Miłecki
7091e31230 bcm4908: backport recent bcm4908_enet changes
This includes 5.12 fix and 5.13 improvements.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-03-16 23:57:52 +01:00
Rafał Miłecki
d7c8ca4d0b bcm4908: backport first PHY 5.13 patches
1. Upstream accepted version of Kconfig change
2. Documentation binding fix

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-03-15 20:30:21 +01:00
Rafał Miłecki
05dbfe616d bcm4908: use accepted 5.13 DTS patches
Some patches were slightly cleaned up. One things worth mentioning is
that adding:
phy-mode = "rgmii"
broke SF2 driver. It made it access random register breaking switch
setup.

That's why this commit also adds a quick sf2 fix.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-03-14 22:54:45 +01:00
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
Rafał Miłecki
8d24da1470 bcm4908: prepare to support TP-Link Archer C2300 V1
It's a BCM4906 based device (2 CPU cores). It has 512 MiB of RAM, 4 LAN
ports, 1 WAN port, 2 USB ports, NAND flash. WiFi unknown at this point.

Flashing is possible using CFE only, proper image will be worked on
later.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-03-05 14:56:50 +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