aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x
Commit message (Collapse)AuthorAgeFilesLines
* ipq806x: add missing wakeup-source for gpio keysAnsuel Smith2021-05-0716-0/+105
| | | | | | | wakeup-source is required for gpio keys to fix error genirq: irq_chip msmgpio did not update eff. affinity mask Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: apply correct voltage toleranceAnsuel Smith2021-05-073-77/+77
| | | | | | Voltage tolerance was 5%, not 5000. Update min and max voltage of the target opp. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: fix missing tx/rx fifo depth gmac configurationAnsuel Smith2021-05-071-0/+101
| | | | | | tx/rx-fifo-depth is required to set mtu to the gmac. Backport upstream patch. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: refresh 5.10 patchesAnsuel Smith2021-05-0724-181/+93
| | | | | | make target/linux/kernel refresh Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: simplify ecw5410 dtsAnsuel Smith2021-05-071-25/+25
| | | | | | Simplify ecw5410 dts instead of redefine nodes. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: set boot layout for nandc compatibleAnsuel Smith2021-05-076-0/+18
| | | | | | Set boot layout size to fix io error on block scan. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: add kernel 5.10 as testing kernelAnsuel Smith2021-05-071-0/+1
| | | | | | Add kernel 5.10 as testing kernel Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: refresh config 5.10Ansuel Smith2021-05-071-76/+58
| | | | | | | | Refresh config for kernel 5.10. - Added new symbol. - Refreshed with make kernel_oldconfig Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: refresh dtsi patchesAnsuel Smith2021-05-076-448/+399
| | | | | | | | | | - Add new tsens node - Add new cpufreq required nodes - Drop arm cpuidle compatible - Fix duplicate node set upstream - Add voltage tolerance value for cpu opp Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: introduce nandc boot layout modeAnsuel Smith2021-05-072-0/+292
| | | | | | ipq806x have different ecc configuration for boot partition and rootfs partition. Add support for this to fix IO error on mtd block scan. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: fix broken pci2 and pci3Ansuel Smith2021-05-071-0/+30
| | | | | | pci2 and pci3 has a too big io address space. Enlarge the IO_SPACE_LIMIT define for the arm arch. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: backport cpufreq changes to 5.4Ansuel Smith2021-05-0711-609/+985
| | | | | | | The new cpufreq driver requires different dts bindings. Backport the new driver to kernel 5.4 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: introduce dedicated krait cpufreqAnsuel Smith2021-05-0710-609/+995
| | | | | | | - Drop cpufreq patchs that tweak the cpufreq-dt driver - Add dedicated krait cpufreq driver Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: drop upstream patchAnsuel Smith2021-05-0716-2131/+0
| | | | | | Drop upstream patch already included in the kernel 5.10 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: drop cpuidle generic support from QCOMAnsuel Smith2021-05-071-29/+0
| | | | | | The spm driver now has dedicated support for krait cpu idle state. We don't need to add generic arm cpuidle support for qcom. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: backport mtd adm and smem driverAnsuel Smith2021-05-0716-896/+806
| | | | | | | | | - Backport mtd adm driver from kernel 5.12 - Backport mtd parser smem from kernel 5.11 - Fix mtd rootfs patch - Update qcom,smem compatible to qcom,smem-parts Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: fix missing clk and resetAnsuel Smith2021-05-075-40/+629
| | | | | | | Patch 0030 wrongly disables gsbi1 instead of gsbi4. Fix the wrong patch and also include other fix from the original qsdk source. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: use newer tsens patchAnsuel Smith2021-05-0714-1228/+973
| | | | | | Use improved tsens patch proposed upstream. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: copy kernel 5.4 patches to 5.10Ansuel Smith2021-05-0748-0/+7939
| | | | | | Copy kernel 5.4 patches and config to 5.10 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: improve system latencyAnsuel Smith2021-05-071-0/+17
| | | | | | | | | | | | | | Various report and data show that the freq 384000 is too low and cause some extra latency to the entire system. OEM qsdk code also set the min frequency for this target to 800 mhz. Also some user notice some instability with this idle frequency, solved by setting the min frequency to 600mhz. Fix all these kind of problem by introducing a boot init.d script that set the min frequency to 600mhz and set the ondemand governor to be more aggressive. The script set these value only if the ondemand governor is detected. 384 mhz freq is still available and user can decide to restore the old behavior by disabling this script. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: Add "snps,dwmac" to all gmac compatible=Mark Mentovai2021-05-071-2/+2
| | | | | | | | | | | | | | | This was introduced to gmac2 and gmac3 in 57ea767a53c1 without fanfare. There's no indication of why it was added to those devices, but not to gmac0 or gmac1. It was probably an unintentional omission. It should be present on all four gmac devices. This property is considered by drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt. Signed-off-by: Mark Mentovai <mark@moxienet.com> Build-tested: ipq806x/ubnt,unifi-ac-hd Run-tested: ipq806x/ubnt,unifi-ac-hd
* ipq806x: ubnt,unifi-ac-hd: reorder eth0 and eth1Mark Mentovai2021-05-072-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | The Ubiquiti UniFi AC HD (UAP-AC-HD, UAP301) has two Ethernet ports, labeled MAIN and SECONDARY, connected to gmac2 and gmac1, respectively. The standard probe order results in gmac1/SECONDARY being eth0 and gmac2/MAIN being eth1. This does not match the stock firmware, is contrary to user expectation, causes the wrong (high) MAC address to be used in a bridged configuration (the default for this device), and makes the gmac2/MAIN port unusable in the preinit environment (such as for failsafe). Until a recent patch, gmac1/SECONDARY (eth0) was not even usable. This reorders the ports so that gmac2/MAIN is eth0, and the now-working gmac1/SECONDARY is eth1. eth0 has the low MAC address and eth1 has the high; when bridged, the bridge takes on the correct low MAC address. This matches the stock firmware. The MAIN port is usable for failsafe during preinit. This device does not have a switch on board, so there's no possibility to remap ports via switch configuration. "ip link set $interface name" is used instead, during preinit before networking is configured. Signed-off-by: Mark Mentovai <mark@moxienet.com> Build-tested: ipq806x/ubnt,unifi-ac-hd Run-tested: ipq806x/ubnt,unifi-ac-hd
* ipq806x: ubnt,unifi-ac-hd: use on-board PHYsMark Mentovai2021-05-071-19/+19
| | | | | | | | | | | | Unlike many ipq806x devices, Ubiquiti UniFi AC HD (UAP-AC-HD, UAP301) has no switch on board. Its two Ethernet ports are connected to Atheros AR8033 PHYs. It is not appropriate to use fixed-link in this configuration. Instead, configure the correct PHYs in the device tree configuration to allow the at803x driver to load. Signed-off-by: Mark Mentovai <mark@moxienet.com> Build-tested: ipq806x/ubnt,unifi-ac-hd Run-tested: ipq806x/ubnt,unifi-ac-hd
* ipq806x: dwmac: clear forced speed during probeMark Mentovai2021-05-071-0/+33
| | | | | | | | | | | | | | | | | | | | | | On a Ubiquiti UniFi AC HD (ubnt,unifi-ac-hd, UAP-AC-HD, UAP301), a forced speed on gmac1 is set in the QSGMII PCS_ALL_CH_CTL register, presumably by the bootloader (4.3.28), preventing the interface from being usable. The QSDK NSS GMAC driver takes care to clear the forced speed in nss_gmac_qsgmii_dev_init (https://source.codeaurora.org/quic/qsdk/oss/lklm/nss-gmac/tree/ipq806x/nss_gmac_init.c?h=nss at d5bb14925861). gmac1 is connected to the port on the device labeled SECONDARY, and is currently eth0 but will be switched to eth1 by a subsequent patch. By clearing the QSGMII PCS forced speed during dwmac initialization when SGMII is in use, this port becomes usable. This patch is upstreamable, and will be sent upstream after successful testing in OpenWrt. Signed-off-by: Mark Mentovai <mark@moxienet.com> Build-tested: ipq806x/ubnt,unifi-ac-hd Run-tested: ipq806x/ubnt,unifi-ac-hd
* treewide: switch the timer frequency to 100 HzRui Salvaterra2021-04-211-2/+0
| | | | | | | | 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>
* treewide: remove redundant ubifs kconfig symbolsRui Salvaterra2021-04-211-4/+0
| | | | | | | 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>
* kernel: bump 5.4 to 5.4.109John Audia2021-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | 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] 9b1b89229f0e ("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>
* kernel: backport 5.13 mtd partitioning changesRafał Miłecki2021-03-291-2/+2
| | | | | | | | 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>
* ipq806x: work-around vendor 'rootfs_data' GPT partitionDaniel Golle2021-03-191-1/+1
| | | | | | | | | | ZyXEL NBG6817 comes with an eMMC which contains a GPT partition named 'rootfs_data'. This currently confuses fstools and makes it pick that (not suitable) partition. Use the newly introduced fstools_ignore_partname=1 kernel cmdline parameter to have fstools ignore that partition. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: move some disabled symbols to genericAleksander Jan Bajkowski2021-03-191-1/+0
| | | | | | Move some disabled symbols found in armvirt target to generic. Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
* ipq806x: work-around borked QCA SDK bootloaderDaniel Golle2021-03-061-0/+1
| | | | | | | | | | | | | | | | | The bootloader of many ipq806x boards seems to require the config node of the FIT image to be 'config@1' (or a secific different value). This requirement used to be implicitely satisfied because OpenWrt used to also call the configuration node inside a FIT image 'config@1'. However, as recent U-Boot now prohibits the use of the '@' symbol as part of node names, this was changed by commit 5ec60cbe9d ("scripts: mkits.sh: replace @ with - in nodes") Explicitely restore the default name of the configuration node to 'config@1' on ipq806x. (ipq807x is unaffected as DEVICE_DTS_CONFIG default is set "config@hk01" in target/linux/ipq807x/image/Makefile) Reported-by: Chen Minqiang <ptpt52@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* treewide: remove execute bit and shebang from board.d filesAdrian Schmutzler2021-03-062-2/+0
| | | | | | | | | | | | | | | | 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>
* kernel-5.4: bump to 5.4.102 and refresh patchesJason A. Donenfeld2021-03-044-10/+10
| | | | | | | | | | | | | | 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>
* kernel: add the latest mtd patch extending ofpart parserRafał Miłecki2021-03-011-2/+2
| | | | | | | | | | | | 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>
* treewide: remove redundant KERNEL_PREFIX definitionsPaul Spooren2021-02-231-2/+0
| | | | | | | | | | The variables KERNEL_INITRAMFS_PREFIX and KERNEL_PREFIX are already defined in include/image.mk and don't have to be redefined in the target Makefiles. Signed-off-by: Paul Spooren <mail@aparcar.org> [also cover imx6] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: replace full-text BSC license by SPDX identifierAdrian Schmutzler2021-02-051-27/+1
| | | | | | | | | | This replaces a full-text BSD clause by the corresponding SPDX identifier. This should make it easier to identify the license both by humans and machines. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: remove generic profileAdrian Schmutzler2021-01-271-10/+0
| | | | | | | | | | | On a platform with many very different devices, like found on ipq806x, the generic profile seems like a remnant of the past that does not have a real use anymore. Remove it to have one thing less to maintain. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Acked-by: Paul Spooren <mail@aparcar.org>
* treewide: provide global default for SUPPORTED_DEVICESAdrian Schmutzler2021-01-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ipq806x: fix Ubiquiti UniFi AC HD partition mapJan Alexander2021-01-151-1/+1
| | | | | | | | | | This fixes a typo in the previously committed partition map that led to the extension of the read-only mtd partition "SSD" into the following partitions. Fixes: 4e46beb31342 ("ipq806x: add support for Ubiquiti UniFi AC HD") Signed-off-by: Jan Alexander <jan@nalx.net>
* ipq806x: add support for Ubiquiti UniFi AC HDJan Alexander2021-01-145-1/+325
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware -------- SoC: Qualcomm IPQ8064 RAM: 512MB DDR3 Flash: 256MB NAND (Micron MT29F2G08ABBEAH4) 32MB SPI-NOR (Macronix MX25U25635F) WLAN: Qualcomm Atheros QCA9994 4T4R b/g/n Qualcomm Atheros QCA9994 4T4R a/n/ac ETH: eth0 - SECONDARY (Atheros AR8033) eth1 - MAIN (Atheros AR8033) USB: USB-C LED: Dome (white / blue) BTN: Reset Installation ------------ Copy the OpenWrt sysupgrade image to the /tmp directory of the device using scp. Default IP address is 192.168.1.20 and default username and password are "ubnt". SSH to the device and write the bootselect flag to ensure it is booting from the mtd partition the OpenWrt image will be written to. Verify the output device below matches mtd partition "bootselect" using /proc/mtd. > dd if=/dev/zero bs=1 count=1 seek=7 conv=notrunc of=/dev/mtd11 Write the OpenWrt sysupgrade image to the mtd partition labeled "kernel0". Also verify the used partition device using /proc/mtd. > dd if=/tmp/sysupgrade.bin of=/dev/mtdblock12 Reboot the device. Back to stock ------------- Use the TFTP recovery procedure with the Ubiquiti firmware image to restore the vendor firmware. Signed-off-by: Jan Alexander <jan@nalx.net>
* ipq806x: add space before SPDX identifier (again)Adrian Schmutzler2021-01-062-2/+2
| | | | | | | | | | | | | | Strictly, an SPDX identifier requires a space between the comment marker and the identifier itself. This has been addressed in b69c21738e29 ("treewide: add space before SPDX identifier"), but some new malformatted identifiers were merged recently. This could have been prevented by using checkpatch.pl earlier. Fixes: 1a775a4fd033 ("ipq806x: add support for TP-Link Talon AD7200") Fixes: 8ddaeaf6424e ("ipq806x: create DTSI for TP-Link AD7200 and C2600") Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: improve model name and revision for TP-Link AD7200Adrian Schmutzler2021-01-061-3/+5
| | | | | | | | | | | | | | | | | The TP-Link AD7200 appears with and without the "Talon" model name prefix. Let's use both variants for 'make menuconfig' so everybody can locate the device. Concerning the revision, the TP-Link page lists v1 and v2 with the device currently marked as "End of Life". However, the v2 and latest v1 firmware are byte-identical. Thus, we only need one image for this device and do not need to include the revision in the image name. While at it, remove the useless BOARD_NAME variable which only makes sense in combination with upgrade from legacy stable versions or when custom upgrade scripts are involved. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: create DTSI for TP-Link AD7200 and C2600Adrian Schmutzler2021-01-063-619/+317
| | | | | | | | | | | Both devices share most of their setup except buttons and LEDs, so having a common DTSI removes a lot of duplicate code. In order to have a shared partitioning scheme, device-id and product-info from AD7200 have been merged into a single product-info partition like for C2600. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: clean up DTS file for TP-Link AD7200Adrian Schmutzler2021-01-061-8/+8
| | | | | | | | | | This does several cosmetic adjustments for AD7200's DTS: - Make node name, DT label and label property consistent - Drop wrong and unused spi4 label - Use generic flash@0 node name Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: fix LED names of TP-Link Talon AD2700Daniel Golle2021-01-051-2/+2
| | | | | | | | While the underscore in the name of the USB LEDs was removed from DTS, /etc/board.d/01_leds also has to reflect that change. Fixes: 28fd279e5d ("ipq806x: some corrections for TP-Link Talon AD7200") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* ipq806x: some corrections for TP-Link Talon AD7200Daniel Golle2021-01-052-48/+45
| | | | | | | | | | Address most comments made by Adrian Schmutzler on the mailing list. The device name is kept as 'TP-Link Talon AD7200' as that seems to be the marketing name TP-Link chose for that device, it also matches the naming scheme for other TP-Link devices (e.g. 'TP-Link Archer C7'). Fixes: 1a775a4fd0 ("ipq806x: add support for TP-Link Talon AD7200") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* ipq806x: add support for TP-Link Talon AD7200Gary Cooper2021-01-056-0/+468
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device hardware: https://deviwiki.com/wiki/TP-LINK_AD7200_(Talon) The Talon AD7200 is basically an Archer C2600 with a third PCIe lane and an 802.11ad radio. It looks like the Archers C2600/5400 but the housing is slightly larger. Specifications -------------- - IPQ8064 dual-core 1400MHz - QCA9988 2.4GHz WiFi - QCA9990 5GHz WiFi - QCA9500 60GHz WiFi - 32MB SPI Flash - 512MiB RAM - 5 GBit Ports (QCA8337) Installation ------------ Installation is possible from the OEM web interface. Sysupgrade is possible. TFTP recovery is possible. - Image: AD7200_1.0_tp_recovery.bin Notes - This will be the first 802.11ad device supported by mainline. Signed-off-by: Gary Cooper <gaco@bitmessage.de>
* ipq806x: consolidate DTS files directorySungbo Eo2021-01-031-0/+0
| | | | | | | | | Commit 29ca10e537ee ("ipq806x: remove support for kernel 4.19") moved DTS files to "files" directory, but after that a new DTS file was added to the former "files-5.4" directory. Move it to the new directory. Fixes: 98b86296e67d ("ipq806x: add support for ASRock G10") Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ipq806x: reenable CONFIG_CMDLINE_OVERRIDE and ASRock G10Pawel Dembicki2021-01-012-2/+1
| | | | | | | | | | This reverts commit 57e4cc8261ca6f0b32e4da6922a8f52ef82c4dc6. Cmdline override patch was fixed. It's time for reenable Asrock G10 support. Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> Tested-by: Hannu Nyman <hannu.nyman@iki.fi> (run-tested for R7800)
* ipq806x: fix 900-arm-add-cmdline-override.patchPawel Dembicki2021-01-011-11/+11
| | | | | | | | | | | | 900-arm-add-cmdline-override.patch have missplaced entry in arch/arm/Kconfig file. It causes problem with other cmdline patches. This patch put Kconfig entry in correct place. Fixes: 98b86296e67d ("ipq806x: add support for ASRock G10") Suggested-by: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> Tested-by: Hannu Nyman <hannu.nyman@iki.fi> (run-tested for R7800)