aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek
Commit message (Collapse)AuthorAgeFilesLines
* mediatek: filogic: consolidate adc '32k' clockDaniel Golle2022-10-204-180/+14
| | | | | | | | | | Add dependency to '32k' ADC clock so it is always enabled for thermal and raw access to ADC values. This allows to remove the patch for the ADC driver and reduce the patch adding thermal support for MT7986 to only add the new efuse layout and temperature decoding for V3. Suggested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mt7622: switch default CPU governor to ondemandJohn Audia2022-10-201-1/+1
| | | | | | | | | | | | | | | | | | The most common CPU governor in the OpenWRT project is currently ondemand (see below). Switch mt7622 over to it as well. Audit the code by running the following and then analyzing the results: find -name 'config-5.*' -print0 | xargs -0 grep 'CONFIG_CPU_FREQ_DEFAULT_GOV.*=y' ondemand: 16 performance: 5 schedutil: 5 userspace: 2 Build system: x86_64 Build-tested: ramips/mt7621 Signed-off-by: John Audia <graysky@archlinux.us>
* mediatek: clean up platform kernel modulesDaniel Golle2022-10-193-15/+8
| | | | | | | | | | | | | | Remove kmod-sdhci-mtk as the mtk-sd driver is built-in anyway for the relevant subtargets in order to support mounting rootfs from eMMC or SD card. Add kmod-iio-mt6577-auxadc to support reading the raw values from the auxadc unit used as in-SoC thermal sensor. This driver was previously built-in, but as thermal itself works well without it there is no use for it in every day use of a device. Build the module to still allow access to the raw values for those who need it. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: don't rely on existing image for sysupgradeDaniel Golle2022-10-191-2/+2
| | | | | | | | Don't reply on mapped rootfs partition but rather just take what ever has been set to the kernel cmdline root= parameter as a hint to decide which media to install sysupgrade to on the BananaPi BPi-R64. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: kernel config fixesDaniel Golle2022-10-191-1/+1
| | | | | | | | | | | * remove orphaned Kconfig symbol now that CONFIG_IIO is no longer selected after commit ef8b935c95 ("mediatek: clean up mt7622 kernel config") * select UBI fast-map feature to decrease boot time and keep the number of spare blocks required in sync with U-Boot's expectations (we got fast-map enabled in U-Boot) Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: update pending and rename merged patchDaniel Golle2022-10-192-21/+57
| | | | | | | Add patch headers and description for pending patch. Add version tag to patch already merged upstream. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: filogic: don't rely on image preset in flash or sysupgradeDaniel Golle2022-10-181-11/+6
| | | | | | | | Instead of trying to figure out the actual root device, just use the kernel 'root' cmdline parameter as a hint to decide which device to flash to. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: filogic: use UBI fast map to speed up bootDaniel Golle2022-10-181-0/+1
| | | | | | | Use UBI fast map feature to avoid scanning the whole flash on each boot which takes several seconds. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: don't break auxadc without 32k clkDaniel Golle2022-10-181-5/+7
| | | | | | | Make the newly added 32k clock optional for the auxadc driver also used on pre-filogic platforms. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7623: fix thermal zoneBruno Umuarama2022-10-141-0/+48
| | | | | | | | | | | | | | | | | | | | | Raising the temperatures for passive and active trips. @VA1DER proposed at issue 9396 to remove passive trip. This commit relates to his suggestion. Without this patch. the CPU will be throttled all the way down to 98MHz if the temperature rises even a degree above the trip point, and it was further discovered that if the internal temperature of the device is above the first trip point temperature when it boots then it will start in a throttled state and even $ echo disabled > /sys/class/thermal/thermal_zone0/mode will have no effect. The patch increases the passive trip point and active cooling map. The throttling temperature will then be at 77°C and 82°C, which is still a low enough temperature for ARM devices to not be in the real danger zone, and gives some operational headroom. Signed-off-by: Bruno Umuarama <anonimou_eu@hotmail.com>
* mediatek: clean up mt7622 kernel configFelix Fietkau2022-10-141-5/+2
| | | | | | Remove a few unused options to reduce kernel size Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel: remove target specific CONFIG_IKCONFIG linesFelix Fietkau2022-10-142-4/+0
| | | | | | Use generic configuration for this feature Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mediatek: fill wlan device entries in board.json on mt7622Felix Fietkau2022-10-141-0/+12
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mediatek: filogic: set correct PWM clock and clean thermal zoneDaniel Golle2022-10-093-18/+18
| | | | | | | | | | | | * set correct clocks for PWM to work. * MT7986 PWM does have the 26MHz-clock-select, set that in patch * drop useless 'passive' trip point in thermal zone * extend pwm-fan to have 3 active operating points * set reasonable trip points in thermal zone * invert pwm-fan operating points and set shorter period to allow less noisy operation of the PWM fan of the BPi-R3. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: filogic: enable thermal, I2C and PWM of the BPi-R3Daniel Golle2022-10-072-1/+32
| | | | | | | Setup thermal zone, select pins and enabled drivers for I2C (on 26-pin GPIO bank) and PWM (1x fan and 1x GPIO bank). Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: filogic: add support for hw i2c, pwm and thermalDaniel Golle2022-10-078-1/+524
| | | | | | | Add support for hardware I2C and PWM units found in the Filogic SoCs as well as the CPU thermal support. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add support t-phy settings from efuse on MT7986Daniel Golle2022-09-303-1/+405
| | | | | | | Import patches from mtk-openwrt-feeds (MTK SDK) to support reading t-phy settings affecting PCIe as well as USB2 and USB3 from efuse. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: filogic: add efuse layout to mt7986a.dtsiDaniel Golle2022-09-301-0/+93
| | | | | | | | efuse is used to store board-specific settings of some of the in-SoC peripherals. Add it to device tree, so it gets probed on boot and can be accessed by other drivers. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add patch allowing 1-byte wide access to efuseDaniel Golle2022-09-301-0/+46
| | | | | | | Allow byte-wise access to mtk-efuse as some drivers require that. Patch imported from mtk-openwrt-feeds (MTK SDK). Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: move ubnt ledbar driver to a separate packageFelix Fietkau2022-09-302-15/+0
| | | | | | | Simplifies the tree by removing a non-upstream kernel patch and related kconfig symbols Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel: Move some IOMMU options to genericHauke Mehrtens2022-09-241-2/+0
| | | | | | | | | | | | This adds some missing IOMMU related options for x86/64 and moves some of them to generic for all targets. On x86 IOMMU_DEFAULT_DMA_LAZY is used by default, on all other platforms IOMMU_DEFAULT_DMA_STRICT is the default. we just follow the default kernel configuration here. Fixes: 8fea4a102ccd ("x86/64: enable IOMMU support") Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: pick patches for MediaTek Ethernet from linux-nextDaniel Golle2022-09-223-5/+29
| | | | | | | | | | | | | | | | | | | Pick patches with several fixes and improvements, preparation for upcoming WED (TX) [1] as well as basic XDP support [2] with MediaTek's Filogic SoCs to the mtk_eth_soc driver. Also pick follow-up patch fixing Ethernet on MT7621 [3]. Tested on Bananapi BPi-R3 (MT7986), Bananapi BPi-R64 (MT7622), Bananapi BPi-R2 (MT7623), MikroTik RouterBoard M11G (MT7621). [1]: https://patchwork.kernel.org/project/netdevbpf/list/?series=662108&state=* [2]: https://patchwork.kernel.org/project/netdevbpf/list/?series=675368&state=* (the first part of the series adding wed nodes to mt7986a.dtsi was applied to the copy of mt7986a.dtsi in our tree) [3]: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=5e69163d3b9931098922b3fc2f8e786af8c1f37e Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: fix Unifi 6LR network configStijn Tintel2022-09-201-2/+1
| | | | | | | | | | | | | | | | When the v1 and v2 variants of the U6LR were introduced, the board network config was not adapted to the new device names. Due to this, the wrong network config is applied during initial boot. The resulting config has lan, wan and a switch, while this device only has a single ethernet interface without a switch. Fix this by using a wildcard that matches all the variants. Fixes: 15a02471bb85 ("mediatek: new target mt7622-ubnt-unifi-6-lr-v1") Fixes: 5c8d3893a78f ("mediatek: new target ubnt_unifi-6-lr-v1-ubootmod") Fixes: 31d86a1a1192 ("mediatek: add Ubiquiti UniFi 6 LR v2 targets") Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> Acked-by: Daniel Golle <daniel@makrotopia.org>
* kernel: bump 5.15 to 5.15.68John Audia2022-09-171-2/+2
| | | | | | | | | | All patches automatically rebased Build system: x86_64 Build-tested: bcm2711/RPi4B, mt7622/RT3200 Run-tested: bcm2711/RPi4B, mt7622/RT3200 Signed-off-by: John Audia <therealgraysky@proton.me>
* mediatek: build USB XHCI support as moduleDaniel Golle2022-09-143-13/+0
| | | | | | | | Instead of always including the XHCI driver in the kernel on all MediaTek boards, selectively include the kernel module only on boards which actually make use of USB functionality. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: unset CONFIG_CMDLINE_OVERRIDE for all targets but mt7629Daniel Golle2022-09-123-0/+3
| | | | | | | | | | The newly introduced config symbol CONFIG_CMDLINE_OVERRIDE is only set for mt7629 for now which breaks automated build on all other mediatek subtargets. Make sure the symbol is configured as 'is not set' for all remaining subtargets. Fixes: c27279dc26 ("mediatek: add support for ipTIME A6004MX Add basic support for ipTIME A6004MX.") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add support for ipTIME A6004MX Add basic support for ipTIME A6004MX.Yoonji Park2022-09-128-0/+393
| | | | | | | | | | | | | | | | | | | | | | | | | Hardware: SoC: MediaTek MT7629 Cortex-A7 (ARMv7 1.25GHz, Dual-Core) RAM: DDR3 128MB Flash: Macronix MX35LF1GE4AB (SPI-NAND 128MB) WiFi: MediaTek MT7761N (2.4GHz) / MediaTek MT7762N (5GHz) - no driver Ethernet: SoC (WAN) / MediaTek MT7531 (LAN x4) UART: [GND, RX, TX, 3.3V] (115200) Installation: - Flash recovery image with TFTP recovery Revert to stock firmware: - Flash stock firmware with TFTP recovery 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>
* mediatek: disable unsupported background radar detectionShiji Yang2022-09-123-2/+7
| | | | | | | | | | | MT7915 requires an additional antenna for background radar scanning. Disable this feature in the following devices that do not have a separate DFS antenna: linksys,e8450 ruijie,rg-ew3200gx-pro xiaomi,redmi-router-ax6s Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* mediatek: fix ledbar of UniFi 6 LR when running custom U-BootDaniel Golle2022-09-111-1/+2
| | | | | | | | | | The RGB LED of the UniFi 6 LR v1 doesn't work when using the Openwrt- built U-Boot. This is because the vendor loader resets the ledbar controller while our U-Boot doesn't care. Add reset-gpio so the ledbar driver in Linux will always reset the ledbar controller. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* generic: move ledbar driver from mediatek targetSven Wegener2022-09-112-284/+0
| | | | | | This moves the ledbar driver to generic, to be also used by the ramips target. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: add led countSven Wegener2022-09-111-1/+7
| | | | | | | | | The LEDs connected to the MCU are so-called smart LEDs and their signal is daisy-chained. Because of this, the MCU needs to be told how many LEDs are connected. It also means the LEDs could be individually controlled, if the MCU has a command for this. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: add initialization after resetSven Wegener2022-09-111-0/+14
| | | | | | | | During GPIO initialization the pin state flips and triggers a reset of the ledbar MCU. It needs to be moved through an initialization sequence before working correctly. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: add support for reset gpioSven Wegener2022-09-111-0/+26
| | | | | | | Some versions of the ledbar MCU have a reset pin. It needs to be correctly initialized or we might keep the MCU in reset state. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: support reading more than one byte of responseSven Wegener2022-09-111-7/+8
| | | | | | There are commands that return more than one byte of response. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: cast literal value to charSven Wegener2022-09-111-1/+1
| | | | | | | | | | Or the comparison against a signed char is always true, because the literal 0xaa is treated as an unsigned int, to which the signed char is casted during comparison. 0xaa is above the positive values of a signed char and negative signed char values result in values larger than 0xaa when casted to unsigned int. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: correctly log i2c responseSven Wegener2022-09-111-2/+2
| | | | | | | The read response is in the i2c_response variable. Also use %hhx format, because we're dealing with a single char. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: remove gpiod_direction_output()Sven Wegener2022-09-111-2/+0
| | | | | | It's already set to output with GPIOD_OUT_LOW. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: do not use gpiod_set_raw_value()Sven Wegener2022-09-111-2/+2
| | | | | | The polarity of the signal is set in the device dts. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: filogic: use WPS button instead of RST on BPi-R3Daniel Golle2022-09-101-0/+12
| | | | | | | | | The GPIO used for the RST button is also used for PCIe-CLKREQ signal. Hence it cannot be used as button signal if PCIe is also used. Wire up WPS button to serve as KEY_RESTART in Linux and "reset" button in U-Boot. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: bananapi-r3: remove kmod-btmtkuart from default packagesDaniel Golle2022-09-101-1/+1
| | | | | | | The package kmod-btmtkuart is specific for MT7622 and isn't available for MT7986 (which doesn't have this built-in Bluetooth like MT7622). Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: rename some patchesDaniel Golle2022-09-094-0/+0
| | | | | | | To ease maintainance rename patches to contain the kernel version they have first been part of. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: 5.15: add missing patch suffixChukun Pan2022-09-091-0/+0
| | | | | | | The 213 patch is missing filename suffix. Fix it. Fixes: dabcaac ("mediatek: add mt7986 soc support to the target") Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
* mediatek: mt7986a/b-rfb: fix 02_network setupChukun Pan2022-09-091-1/+1
| | | | | | | | According to the device tree, the lan ports are lan0 to lan3, and the wan port is eth1. Fixes: cffc77a ("mediatek: add filogic subtarget") Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
* mediatek: fix typo in bpi-r64 image recipeDaniel Golle2022-09-081-1/+1
| | | | | | | Janusz Dziedzic reported a typo introduced by a recent commit. Fix it. Fixes: 50c892d67b ("mediatek: bpi-r64: make initramfs/recovery optional") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: bpi-r64: make initramfs/recovery optionalDaniel Golle2022-09-081-2/+7
| | | | | | | | | Only include recovery image in SD card image generated for the BananaPi BPi-R64 if building with CONFIG_TARGET_ROOTFS_INITRAMFS This allows to build images larger than 32 MB (the limit for initramfs/recovery image) by deselecting initramfs. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: bpi-r3: make initramfs/recovery optionalDaniel Golle2022-09-081-2/+7
| | | | | | | | | Only include recovery image in SD card image generated for the BananaPi BPi-R3 if building with CONFIG_TARGET_ROOTFS_INITRAMFS. This allows to build images larger than 32 MB (the limit for initramfs/recovery image) by deselecting initramfs. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: remove redundant patchDaniel Golle2022-09-071-47/+0
| | | | | | | | | | | | | | | The patch 921-mt7986-add-mmc-support.patch introduced by commit dabcaac443 ("mediatek: add mt7986 soc support to the target") has never been applied in a way that it would have any effect as it actually created a file target/linux/generic/patches-5.15/... in the kernel tree and was probably a patch intended to be applied to openwrt.git instead of being put into kernel patches folder as a file. As an upstream commit from vanilla Linux also adding support for MT7986 to the mtk-sd driver has already been included we can remove that old patch. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: mtk_eth_soc: fix hw hash reporting for MT7986Daniel Golle2022-09-072-2/+2
| | | | | | Import patch from Linux 6.0. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: refresh patchesDaniel Golle2022-09-073-6/+6
| | | | | | | The introduction of the new Airoha target has left the tree in an unfresh state. Refresh patches to improve that situation. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: fix sysupgrade on MTK7986 rfba APDaniel Golle2022-09-061-0/+1
| | | | | | | | | A line in platform.sh was accidentally removed when adding support for the Bananapi BPi-R3. Re-add it to fix sysupgrade on the MTK7986 rfba AP. Fixes: a96382c1bb ("mediatek: add support for Bananapi BPi-R3") Signed-off-by: Daniel Golle <daniel@makrotopia.org>