aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/base-files/lib
Commit message (Collapse)AuthorAgeFilesLines
* lantiq: xrx200: switch the subtarget to the mainline DSA driverMartin Blumenstingl2021-06-261-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable the XRX200 PMAC, GSWIP DSA tag and GSIP DSA drivers in the 5.4 kernel config. Update the existing vr9_*.dts{,i} to use the new Ethernet and switch drivers. Drop the swconfig package from the xrx200 target because swconfig doesn't manage DSA based switches. The new /etc/config/network format for the DSA driver is not compatible with the old (swconfig) based one. Show a message during sysupgrade notifying users about this change and asking them to start with a fresh config (or forcefully update and then migrate the config manually). Failsafe mode can now automatically bring up the first lan interface based on board.json including DSA based setups. Drop 05_set_preinit_iface_lantiq from the xRX200 sub-target as this is not needed anymore. For now we are keeping it for the ase, xway and xway_legacy until there's some confirmation that it can be dropped from there as well. While here, some boards also receive minor fixups: - Use LAN1 as LAN1 (according to a photo this port can also be configured as WAN) on the Buffalo WBMR-300HPD. This makes it easier to read the port mapping because otherwise we would have LAN{2,3,4} and WAN (which was the case for the non-DSA version previously). - vr9_avm_fritz3390.dts: move the "gpio" comment from port 0 and 1 to their corresponding PHYs - vr9_tplink_vr200.dtsi: move the "gpio" comment from port 0 to PHY 0 - vr9_tplink_tdw89x0.dtsi: move the "gpio" comment from port 0 to PHY 0 Acked-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl> Tested-by: Notupus <notpp46@googlemail.com> # TD-W9980/DM200/FRITZ 7430 Tested-by: Martin Schiller <ms@dev.tdt.de> # tested on TDT VR2020 Tested-by: Martin Schiller <ms@dev.tdt.de> # tested on TP-Link TD-W8980B Tested-by: Martin Schiller <ms@dev.tdt.de> # tested on ZyXEL P-2812HNU-F1 Tested-by: Daniel Kestrel <kestrel1974@t-online.de> # tested on Fritzbox 7490 Tested-by: Daniel Kestrel <kestrel1974@t-online.de> # tested on Fritzbox 3490 Tested-by: @jospezial <jospezial@gmx.de> # tested on VGV7510KW22 (o2 Box 6431) Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
* treewide: drop shebang from non-executable lib filesAdrian Schmutzler2021-01-291-3/+0
| | | | | | | | | | | | This drops the shebang from another bunch of files in various /lib folders, as these are sourced and the shebang is useless. Fix execute bit in one case, too. This should cover almost all trivial cases now, i.e. where /lib is actually used for library files. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* lantiq: move dsl related base-files into own packageMartin Schiller2020-07-171-749/+0
| | | | | | | | | | It does not make sense to install this components on lantiq systems where the dsl subsystem is not needed/used. This also makes it possible to use the files also on other targets. (hopefully ipq401x / FritzBox 7530 in the near future) Signed-off-by: Martin Schiller <ms.3headeddevs@gmail.com>
* lantiq: move common DSL setup into lantiq.shAdrian Schmutzler2020-01-141-2/+15
| | | | | | | | | DSL setup consists of the same commands for all subtargets, so move it into a helper function. While at it, remove shebang from library file. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* lantiq: split base-files into subtargetsAdrian Schmutzler2020-01-141-27/+0
| | | | | | | | | | | | | | | | | | This splits the device-dependent base-files into subtarget directories, like done recently for ath79 and ramips. While this increases the overall lines of codes, it will make the code per subtarget smaller and easier to keep track of features and devices. While at it, several variables at the top of 02_network are removed, as they were never changed. The values are put directly into the function calls where they are used. Remove unneeded LED setup from 01_leds, and remove 01_leds entirely for falcon subtarget (as it is not used there). Applies alphabetic reordering to device cases in base-files. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* lantiq: remove includes of non-existent /lib/functions/lantiq.shAdrian Schmutzler2020-01-031-2/+0
| | | | | | | lantiq.sh is still included in files which do not use it anymore. Remove the includes. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* lantiq: fix dsl_control status handling.Martin Schiller2019-10-151-2/+2
| | | | | | | | | | Commit 7519a36774ca ("base-files,procd: add generic service status") introduced the generic 'status' command which broke the previous dsl_control status output. To fix this, let's rename the "old" command to "dslstat". Fixes: 7519a36774ca ("base-files,procd: add generic service status") Signed-off-by: Martin Schiller <ms@dev.tdt.de>
* lantiq: replace backticks by $(...) and remove useless echoAdrian Schmutzler2019-09-291-4/+4
| | | | | | | | This replaces deprecated backticks by more versatile $(...) syntax. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> [decapitalized patch subject at submitter's request] Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* lantiq-dsl: fix value of FECS counterMartin Schiller2019-09-191-13/+7
| | | | | | | Instead of the nFECS value, the nFEC value (the number of corrected code words) was mistakenly used. Signed-off-by: Martin Schiller <ms@dev.tdt.de>
* treewide: sysupgrade: don't use $ARGV in platform_do_upgrade()Rafał Miłecki2019-07-171-1/+1
| | | | | | | stage2 passes image path to platform_do_upgrade() as an argument so it can be simply accessed using $1 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* lantiq: add support for AVM FRITZ!Box 7362 SLDanijel Tudek2019-03-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware: - SoC: Lantiq VRX288 - RAM: Winbond W971GG6JB 1 Gb (128 MiB) - Flash: - SPI: 8 Mb (1 MiB) for bootloader and tffs - NAND: 1 Gb (128 MiB) for OS - xDSL: Lantiq VRX208 - WLAN: Atheros AR9381 - DECT: Dialog Semiconductors SC14441 Everything except FXS/DECT works (no drivers for AVM's FXS implementation with SC14441). Installation via FTP: 1. Use scripts/flashing/eva_ramboot.py to send initramfs-kernel.bin to the device when powering on. Standard AVM procedures with finding the correct IP address and the right moment to open FTP apply here (approx. 4 seconds on 7362SL). IMPORTANT: set lzma compression in ramdisk options, bootloader stalls when receiving uncompressed images. 2. Transfer sysupgrade.bin image with scp to /tmp directory and run sysupgrade 3. First boot might take a bit longer if linux_fs_start was set to 1, in that case the device will reboot twice, first time it will fail to load second kernel (overwritten by ubifs), set linux_fs_start to 0 and reboot. OpenWrt uses the entire NAND flash. Kernel uses 4 MiB and rootfs uses the rest of 124 MiB, overwriting everything related to FRITZ!OS - both OS images, config and answering machine/media server data. To return to FRITZ!OS, use AVM's recovery image. Signed-off-by: Danijel Tudek <danijel.tudek@gmail.com>
* lantiq: add support for AVM FRITZ!Box 7412Andy Binder2019-03-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware: SoC: Lantiq VRX 220 CPU Cores: 2x MIPS 34Kc at 500 MHz RAM: 128 MiB 250 MHz Storage: 128 MiB NAND flash Ethernet: built-in Fast Ethernet switch, only port 2 is used Wireless: Atheros AR9287-BL1A b/g/n with 2 pcb antennas Modem: built-in A/VDSL2 modem DECT: Dialog SC14441 LEDs: 1 two-color, 4 one-color Buttons: 2 FXS: 1 port via TAE or RJ12 connector Everything except FXS/DECT works (no drivers for AVM's FXS implementation with SC14441). Installation: Use the eva_ramboot.py script to load an initramfs image on the device. Run it a few seconds after turning the device on. $ scripts/flashing eva_ramboot 192.168.178.1 bin/targets/lantiq/xrx200/openwrt-lantiq-xrx200-avm_fritz7412-initramfs-kernel.bin If it fails to find the device try the ip address 169.254.120.1. (Firmware updates or the recovery tool apparently change it.) IMPORTANT: set lzma compression in ramdisk options, bootloader stalls when receiving uncompressed images. The device will load it in ram and boot it. You can reach it under the openwrt default ip address 192.168.1.1. Check if the key linux_fs_start is not set to 1 in tffs: $ fritz_tffs_nand -d /dev/mtd1 -n linux_fs_start If it is set to 1, the bootloader will select the wrong set of partitions. Restart the box and install an FritzOS upgrade or do a recovery. Afterwards start again at step 1. Run sysupgrade to persistently install OpenWRT. Signed-off-by: Valentin Spreckels <Valentin.Spreckels@Informatik.Uni-Oldenburg.de> Signed-off-by: Andy Binder <AndyBinder@gmx.de>
* lantiq: add integer latency stat for lantiq-dslAndre Heider2018-12-161-0/+8
| | | | | | | The current stats always have a 'ms' suffix, and they're used by luci. Introduce dsl.latency_[down|up] values, exported in µs without suffix. Signed-off-by: Andre Heider <a.heider@gmail.com>
* lantiq: complete AVM FRITZ!Box 3370 supportMathias Kresin2018-05-171-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename the image and use a compatible string which indicates that only hardware revision 2 and higher is supported. It allows to use the wireless LED, as HWRev 1 uses GPIO#39 for the wireless LED and starting with HWRev 2 GPIO#35 is used for the wireless LED and GPIO#39 for IFX_GPIO_MODULE_EXTPHY_MDIO. The HWREV can be checked by connecting to the fritzbox right after power on via ftp: ftp> quote GETENV HWSubRevision Within the same HW revision 5 of the Fritz!Box 3370 different NAND flash chips are used. Usually it isn't a big deal but depending on the used NAND flash chip, the ECC calculation is done different (and incompatible of course). Boards with a Micron MT29F1G08ABADA NAND flash chip are using the NAND chip to calculate the ECC (on-die). Boards with a Hynix HY27UF081G2M NAND flash chip are doing the ECC calculation in software. Supporting both with a single DTS isn't possible. It might be possible to add a patch selecting the ECC mode dynamicaly based on the found NAND flash chip. But such a patch has no chance to get accepted upstream and most likely need to be touched with every kernel update. Instead two images are created. One for Micron NAND flash chip and one for Hynix NAND flash chip. So far no pattern is known to identify the used flash chip without opening the box. Add the power off GPIO. At least EVA version 2186 sets/keeps the GPIO as input, which will cause a reboot 30sec after power on. For boards with EVA version 2186 the installation is tricky as it has to be finished within the 30sec time frame. The EVA version can be checked by connecting to the fritzbox right after power on via ftp: ftp> quote GETENV urlader-version The ath9k eeprom/caldata is at a different and offset and stored in reverse order (from the last byte to the beginning) on the flash. Reverse the bits to bring the data into the format expected by the ath9k driver. Since the ath9k eeprom is stored in reverse order on flash, we can not use the mac address from the on flash eeprom. Get the MAC address from the tffs instead. Within the same HW revision 5 of the Fritz!Box 3370 both version of the vr9 SoC are used. During preparation of kernel 4.14 support, all devicetree source files were changed to load the vr9 v1.1 and vr9 v1.2 gphy firmware, which fixed the embedded phys for boards using the version 1.2 of the vr9 SoC. While at it, add a trigger to make use of the LAN LED. Setup the build-in switch and add a hint for LuCI two show the ports in order matching the labels on the case Add support for the second USB port and provide the volatage GPIOs. Use GPIO#21 as PCIe reset pin. The lan led is connected to GPIO#38. Name the rootfs partition ubi and remove the mtd/rootfs related kernel bootargs to use the OpenWrt autoprobing based on the partition name. Enable sysupgrade support to allow an upgrade from a running system. Since sysupgrade wasn't supported till now, drop image build code which was added to allow a sysupgrade from earlier OpenWrt versions. Build images that allow an (initial) installation via EVA bootloader. To install OpenWrt via Eva bootloader, within the first seconds after power on a ftp connection need to be established to the FRITZ!Box at 192.168.178.1 and the the following ftp commands need to be run: ftp> quote USER adam2 ftp> quote PASS adam2 ftp> binary ftp> debug ftp> passive ftp> quote SETENV linux_fs_start 0 ftp> quote MEDIA FLSH ftp> put /path/to/openwrt-lantiq-xrx200-FRITZ3370-eva-kernel.bin mtd1 ftp> put /path/to/openwrt-lantiq-xrx200-FRITZ3370-eva-filesystem.bin mtd0 Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: Mathias Kresin <dev@kresin.me>
* treewide: move nand_do_upgrade call to platform_do_upgradeMathias Kresin2018-02-161-3/+4
| | | | | | | | | | Calling nand_do_upgrade() from platform_pre_upgrade() was deprecated with 30f61a34b4cf ("base-files: always use staged sysupgrade"). Update the platform upgrade code to use platform_do_upgrade() for NAND images as well. Signed-off-by: Mathias Kresin <dev@kresin.me>
* treewide: remove obsolete sysupgrade watchdog killMathias Kresin2018-02-161-9/+0
| | | | | | | | | The watchdog kill command was meant for busybox watchdog. Busybox watchdog was replaced by the procd watchdog mid 2013 with commit df7ce9301a25 ("busybox: disable the watchdog utility by default"), which makes the kill command obsolete since quite some time. Signed-off-by: Mathias Kresin <dev@kresin.me>
* lantiq: remove DSL_ChipSetHWVersion from status informationMartin Schiller2017-12-231-4/+2
| | | | | | | | | | | | The value DSL_ChipSetHWVersion is fetched from the dsl frontend via the dsl_control service, but not really provided by the dsl frontend firmware and for now always "UNKNOWN". The lantiq support told us that this information wouldn't be provided in the foreseeable future, so let's remove this useless "UNKNOWN" information. Signed-off-by: Martin Schiller <ms@dev.tdt.de>
* lantiq: use the generic board detectMathias Kresin2017-12-161-19/+0
| | | | | | | Drop the target specific detection function in favour of the generic one provided by base-files. Signed-off-by: Mathias Kresin <dev@kresin.me>
* lantiq: remove the former board name from device tree modelMathias Kresin2017-12-161-1/+1
| | | | | | | Remove the former used board name from the device model property and use the model name as it is. Signed-off-by: Mathias Kresin <dev@kresin.me>
* lantiq: use the compatible string as board nameMathias Kresin2017-12-162-2/+2
| | | | | | | | | | | Use the first compatible string as board name in userspace. Add the new board name as well as the former used board name to the image metadata to keep compatibilty with already deployed installations. Don't add the former used boardname for boards which exists only in master or evaluation boards. Signed-off-by: Mathias Kresin <dev@kresin.me>
* base-files: unify get_dt_led helper functionChristian Lamparter2017-12-141-12/+0
| | | | | | | | | | | | | | Lantiq and IPQ806X (which includes IPQ40XX) both define the same custom function {ipq806x|lantiq}_get_dt_led. This patch moves the function into the base-file package at lib/functions/leds.sh to make it more accessible for other targets as well. Cc: Mathias Kresin <dev@kresin.me> Cc: John Crispin <john@phrozen.org> Cc: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* treewide: populate boardname and model earlierMathias Kresin2017-07-151-0/+0
| | | | | | | | | | | | | For targets using the generic board detection and board specific settings in diag.sh, the board name is still unset at the time the set_state() provided by diag.sh is called by 10_indicate_preinit. Change the execution order to ensure the boardname is populated before required the first time. Do the target specific board detection as early as possible, directly followed by the generic one to allow a seamless switch to the generic function for populating /tmp/sysinfo/. Signed-off-by: Mathias Kresin <dev@kresin.me>
* lantiq: modified lantiq_dsl.sh status output of latencyHelge Mader2017-06-021-1/+1
| | | | Signed-off-by: Helge Mader <ma@dev.tdt.de>
* lantiq: fix lantiq_dsl.sh status and lucistat outputHelge Mader2017-06-021-12/+12
| | | | Signed-off-by: Helge Mader <ma@dev.tdt.de>
* treewide: fix device tree path in scriptsMathias Kresin2017-05-261-1/+1
| | | | | | | | The device tree is at /proc/device-tree/ without a base subdir. Fixes: da472e5b30f6 ("treewide: access device tree from userspace via /proc/") Signed-off-by: Mathias Kresin <dev@kresin.me>
* treewide: access device tree from userspace via /proc/Mathias Kresin2017-05-261-1/+1
| | | | | | | Access the device tree via /proc/device-tree/ is the documented way to access the properties. Everything else might not work in future. Signed-off-by: Mathias Kresin <dev@kresin.me>
* lantiq: remove lantiq_board_model, it is unusedFelix Fietkau2017-03-221-9/+0
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* lantiq: remove lantiq_board_name, use the generic function insteadFelix Fietkau2017-03-222-12/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* lantiq: move lantiq_board_detect() to 03_preinit_board.shFelix Fietkau2017-03-222-10/+10
| | | | | | It is only used there Signed-off-by: Felix Fietkau <nbd@nbd.name>
* lantiq: introduce lantiq_is_vdsl_systemMathias Kresin2017-02-181-0/+4
| | | | | | | Move the code to check if the current system is a system with vdsl support to a dedicate function to make it reusable. Signed-off-by: Mathias Kresin <dev@kresin.me>
* lantiq: remove device specific sysupgrade image checksFelix Fietkau2016-11-201-22/+1
| | | | | | Replaced by image metadata Signed-off-by: Felix Fietkau <nbd@nbd.name>
* lantiq: append metadata to imagesFelix Fietkau2016-11-191-0/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* lantiq: fix lantiq-dsl output spamMathias Kresin2016-10-111-1/+1
| | | | | | | | | | | | | | | | | In case the adsl/vdsl service is disabled intentional, the output is cluttered with the following message multiple times if the status of the dsl line is queried: killall: vdsl_cpe_control: no process killed If the dsl line status is queried by LuCI, the logfile is spammed with the message. Fix the issue by using killall in quite mode. In quite mode killall still returns a non-zero value if the to be killed process can not be found so that existing logic based on the return value still works. Signed-off-by: Mathias Kresin <dev@kresin.me>
* lantiq: use aliases device tree node for ledsMathias Kresin2016-10-051-1/+1
| | | | | | The chosen node is clearly the wrong place for aliases. Signed-off-by: Mathias Kresin <dev@kresin.me>
* lantiq: cleanup led handling functionsMathias Kresin2016-10-051-9/+5
| | | | | | | | | Use a more generic name for the lantiq_get_dt_led_chosen function. Drop the lantiq_is_dt_led_chosen function. The lantiq_get_dt_led function can be used to achieve the same. Signed-off-by: Mathias Kresin <dev@kresin.me>
* lantiq: fix network in failsafeMathias Kresin2016-06-221-9/+1
| | | | | | | | | | So far the network in failsafe is setup only for one board. Use the eth0 interface as lan interface for all boards for now. If a board has its lan interface(s) on another eth, a special handling based on the board name can be added. Signed-off-by: Mathias Kresin <dev@kresin.me>
* lantiq: add AVM image mageic to sysupgrade scriptJohn Crispin2016-06-131-0/+2
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* lantiq-dsl: add missing blank in dsl outputJohn Crispin2016-04-091-1/+1
| | | | | | | | blank inserted before ACTATP Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com> SVN-Revision: 49137
* lantiq-dsl: bugfix latency values swapped for lucistatJohn Crispin2016-04-091-2/+2
| | | | | | | | swapped wrong latency output Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com> SVN-Revision: 49136
* lantiq-dsl: bugfix db negative sign after commaJohn Crispin2016-04-091-1/+1
| | | | | | | | If db is negative minus sign was shown after comma Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com> SVN-Revision: 49135
* lantiq: print profile name in dsl lucistatFelix Fietkau2016-03-071-0/+1
| | | | | | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 48949
* use "-gt" instead of ">" with [ in /lib/functions/lantiq_dsl.shJohn Crispin2016-02-121-2/+2
| | | | | | | | | Avoids inadvertent file creation when executing `/etc/init.d/dsl_control status`. Signed-off-by: Jonathan A. Kollasch <jakllsch@kollasch.net> SVN-Revision: 48700
* lantiq: convert vendorid into human readable formJohn Crispin2016-01-011-0/+67
| | | | | | Signed-off-by: Mathias Kresin <openwrt@kresin.me> SVN-Revision: 48046
* lantiq: add the current profile to the stats outputJohn Crispin2016-01-011-0/+30
| | | | | | Signed-off-by: Mathias Kresin <openwrt@kresin.me> SVN-Revision: 48045
* lantiq: use default leds defined in DTSJohn Crispin2016-01-011-0/+16
| | | | | | | | | | | | | Remove all now double defined leds from the led board file. Use pppoe as default for all broadband connections, since it's the default in OpenWrt now. Rename the the wifi leds to make sure, the not applicable default values get overwritten. Signed-off-by: Mathias Kresin <openwrt@kresin.me> SVN-Revision: 48038
* lantiq: add VDSL2 vectoring status informationFelix Fietkau2015-12-051-1/+12
| | | | | | Signed-off-by: Mathias Kresin <openwrt@kresin.me> SVN-Revision: 47785
* lantiq: Synchronize access to the DSL command pipeJohn Crispin2015-10-191-0/+2
| | | | | | | | | | Whenever two processes were executing different commands at the same time then one of the commands sometimes got the response of the other command. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> SVN-Revision: 47213
* lantiq: bugfix wrong non pre-emptive crc errors outputJohn Crispin2015-10-111-1/+1
| | | | | | | | | This patch fixes a wrong non pre-emptive crc errors output of dsl_control.sh status. Signed-off-by: Luca Debernardi <luca.debernardi@gmail.com> SVN-Revision: 47172
* lantiq: bugfix luci lantiq_dsl statusJohn Crispin2015-10-071-25/+25
| | | | | | | | Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com> Signed-off-by: Helge Mader <hmader@tdt.de> Reported-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47152
* lantiq: bugfix uninitialized variablesJohn Crispin2015-10-051-0/+2
| | | | | | | Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com> Reported-by: Sylwester Petela <sscapi@gmail.com> SVN-Revision: 47127