Not all targets support power management, some older or more simple
targets don't have CONFIG_PM set. Allow kernel module packages to
depend on USES_PM to only be available on targets which got
CONFIG_PM=y in their kernel config.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Partially revert commit 332645a610 ("uboot-mediatek: sync with
mtk-openwrt/u-boot 20250711") by dropping unused PHY drivers which come
with large embedded firmware (and are hence inacceptable for upstream)
and restoring our previous version of the Airoha EN8811H driver which is
known to work and load firmware from the eMMC boot1 hardware partition
instead of embedding it in the driver.
In future we may switch to the upstream Airoha EN8811H driver which
allows loading the firmware either from a filesystem or overloading the
en8811h_read_fw() for board which may eg. store that firmware directly
inside a eMMC hardware partition or UBI volume, like the BPi-R3 mini
does.
See also:
https://patchwork.ozlabs.org/project/uboot/patch/20250615131243.30770-1-lucienzx159@gmail.com/
Fixes: 332645a610 ("uboot-mediatek: sync with mtk-openwrt/u-boot 20250711")
Reported-by: Adrian Bente
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The ix4-200d is a 4 bay NAS supported since OpenWrt 23.05. Drive trays
controller. Due to a kernel-related issue with the SATA controller,
trays #1 and #2 were not recognized. This issue has been fixed in
kernel 6.10, so with the adoption of kernel 6.12 in the Kirkwood
target trays #1 and #2 can now be made accessible. This requires the
kmod-ata-ahci package, which this commit adds as default to the
makefile.
Signed-off-by: Sander van Deijck <sander@vandeijck.com>
Link: https://github.com/openwrt/openwrt/pull/19435
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Not all targets have CONFIG_PINCTRL=y set in their kernel config.
Let's introduce a feature for that so kernel module packages which
select or depend on CONFIG_PINCTRL=y may depend on that, so we can
try to prevent leaking CONFIG_PINCTRL=y also into targets which do
not require it.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Update mediatek arm-trusted-firmware to the latest version.
Remove upstream patch:
0004-mediatek-snfi-fix-return-code-when-reading.patch
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
The build error has been fixed by the upstream commit:
03e598263e38 ("tools: fix build without LIBCRYPTO support")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Most ramips target devices use the legacy uImage format. This
patch extends the imsz/imszb commands to support detecting the
image size of legacy uImage.
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
These u-boot images are no longer automatically copied to the
bindir since commit:
ed50004319 ("uboot-mediatek: add support for Linksys E8450")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Add back the default LK image header to generate u-boot-mtk.bin. This
is the default behavior before u-boot v2022.01. If "u-boot-mtk.bin"
doesn't boot, please try "u-boot.bin" and report it.
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Update to the latest version.
Suppressed patch:
100-04-env-add-support-for-generic-MTD-device.patch[1]
[1] 03fb08d4ae
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Package kernel modules for PS/2 mouse support, mostly to allow
using touchpads and trackpoints built-into laptops (many of those
are connected using classic i8052-compatible PS/2 I/O).
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Buildbot revealed that on the x86/geode target, on which CONFIG_DRM=y isn't set,
kmod-i2c-hid misses the dependency on kmod-drm. Fix that to fix the build for
x86/geode.
Fixes: c83e275c9b ("kernel: package modules for I2C HID devices")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
RTL83xx devices have two types of receive interrupts for each of its
8 rings. One for packet received and another for ring overflow. When
the switch is flooded with incoming packets the receive handler will
disable the packet receive notification but still keeps the overflow
notification enabled. While the receive path "slowly" processes the
received packets each new packet triggers the overflow IRQ again. The
device becomes unresponsive and eventually produces messages like:
[18441.709764] rcu: Stack dump where RCU GP kthread last ran:
[18441.727892] Sending NMI from CPU 1 to CPUs 0:
[18441.742300] NMI backtrace for cpu 0 skipped: idling at 0x8080e994
[18415.251700] rcu: INFO: rcu_sched detected stalls on CPUs/tasks:
[18415.271350] rcu: 0-...!: (0 ticks this GP) idle=d740/0/0x0 ...
[18415.303046] rcu: (detected by 1, t=6004 jiffies, g=230925, ...
[18415.326095] Sending NMI from CPU 1 to CPUs 0:
[18415.340540] NMI backtrace for cpu 0
Fix this issue by always disabling receive and overflow interrupts at
the same time.
Test with hping3 --udp -p 5021 -d 1400 --flood 192.168.2.72
Before (3sec run):
[183260.324846] rtl838x-eth 1b00a300.ethernet eth0: RX buffer overrun: status 0x101, mask: 0x7ffeff
[183260.340524] rtl838x-eth 1b00a300.ethernet eth0: RX buffer overrun: status 0x1, mask: 0x7ffeff
[183260.345799] net_ratelimit: 489997 callbacks suppressed
After (3 sec run):
[ 373.981479] rtl838x-eth 1b00a300.ethernet eth0: rx ring overrun: status 0x101, mask: 0x7fffff
[ 374.031118] rtl838x-eth 1b00a300.ethernet eth0: rx ring overrun: status 0x101, mask: 0x7fffff
[ 377.919996] net_ratelimit: 34 callbacks suppressed
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19365
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The current implementation has several issues:
- it uses the hacky phy_port* macros
- it uses SoC dependent raw pages
- it disables/enables SoC dependent polling
Get rid of these dependencies and access the mdio bus the normal way.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19372
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Add an OpenWrt-based U-Boot build for this device, allowing for more
flexibility and customization.
Expected behaviour
------------------
When plugging the device, keeping the reset button pressed will enter
TFTP recovery mode: the board will send requests for the initramfs file
(openwrt-mediatek-filogic-glinet_gl-mt2500-initramfs-kernel.bin) from
IP 192.168.1.1 to 192.168.1.10 TFTP server.
The bootloader will populate the environment with the unit serial number
as reported by the "sn" value in eMMC, the "sn_bak" value, the country
code and ddns. WAN and LAN MAC addresses are reported in the environment
as well.
Limitations
-----------
No web interface is available, and only the LAN port can be used for
system recovery.
Notes
-----
This port has been tested with the Maxlinear version only, and with a
board that does not exhibit eMMC communication problems. Even though eMMC
frequency has been lowered, some testing is probably needed and always
very welcome.
A -factory image has been introduced, and is only needed when using the
"Load Firmware via TFTP then write to eMMC." boot menu function.
The device has not been converted to use uImage.FIT including the rootfs
to keep compatibility with stock bootloader and firmware.
Installation
------------
From a Linux root shell:
0. Transfer the needed files to the board, placing them in /tmp.
1. Make sure your U-Boot environment is erased: all of my units came with
unpopulated environment, but I am not sure this is always the case.
Issue the command
cat /dev/zero >/dev/mmcblk0p2
(you will get a "no space left" error, which is reasonable and expected).
2. Unlock the eMMC boot area where BL2 is located:
echo 0 >/sys/block/mmcblk0boot0/force_ro
3. Write the new BL2 code:
cat openwrt-mediatek-filogic-glinet_gl-mt2500-emmc-preloader.bin >/dev/mmcblk0boot0
4. Write new BL31+U-Boot image:
cat openwrt-mediatek-filogic-glinet_gl-mt2500-emmc-bl31-uboot.fip >/dev/mmcblk0p4
5. Reboot.
Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
This commit updates the OpenWrt-based U-Boot for this device, allowing
to boot a FIT firmware image stored in an SD card.
The environment has been updated accordingly to allow for managing images
on the two different supported firmware boot media configurations
(NOR or SDMMC).
Erasing the U-Boot environment when upgrading is recommended, so that
the correct DTS overlay is applied.
New behaviour
-------------
The default environment "bootconf" variable is set to
config-1#mt7981b-gatonetworks-gdsp-gps
rendering the GPS module accessible.
You may set it to something like
config-1#mt7981b-gatonetworks-gdsp-sd
to be able to use the MMC controller.
To boot from a firmware image stored in an SD card, you may set the
bootmedia environment variable:
# fw_setenv bootmedia sd
and reboot.
Should the bootmedia variable be absent or it's content not recognized
as valid (e.g., does not contain "nor" or "sd"), NOR boot will be
attempted.
Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
The device is equipped with a GPS module, reporting data via /dev/ttyS1.
A TF card reader is also present. Only one of those components can be
used at once, since they share some PINs.
This commit adds two devicetree overlays to allow for the user to select
the desired configuration. Another overlay configuration to allow booting
from SD card is provided.
Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
All kernel symbols are automatically refreshed by
`make kernel_oldconfig CONFIG_TARGET=target` and
`make kernel_oldconfig CONFIG_TARGET=subtarget`.
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
* Drop obsolete flag I2C_CLASS_SPD. [1]
* Change .remove callback return type to NULL.
* Use strscpy instead of strlcpy.
This patch fixes the following build errors:
drivers/i2c/busses/i2c-lantiq.c:599:41: error: 'I2C_CLASS_SPD' undeclared (first use in this function); did you mean 'I2C_CLASS_HWMON'?
599 | adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
| ^~~~~~~~~~~~~
| I2C_CLASS_HWMON
drivers/i2c/busses/i2c-lantiq.c:600:9: error: implicit declaration of function 'strlcpy'; did you mean 'strncpy'? [-Wimplicit-function-declaration]
600 | strlcpy(adap->name, DRV_NAME "-adapter", sizeof(adap->name));
| ^~~~~~~
| strncpy
drivers/i2c/busses/i2c-lantiq.c:729:19: error: initialization of 'void (*)(struct platform_device *)' from incompatible pointer type 'int (*)(struct platform_device *)' [-Wincompatible-pointer-types]
729 | .remove = ltq_i2c_remove,
|
[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.12.y&id=e61bcf42d290e73025bab38e0e55a5586c2d8ad5
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>