aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/base-files
Commit message (Collapse)AuthorAgeFilesLines
* ipq806x: fix LAN and WAN port assignments on TP-Link AD7200Alex Henrie2021-06-061-1/+4
| | | | | | | | LAN port 4 was swapped with the WAN port and the remaining three LAN ports were numbered in reverse order from their labels on the case. Fixes: 1a775a4fd033 ("ipq806x: add support for TP-Link Talon AD7200") Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
* treewide: remove "+" sign for increment with macaddr_addAdrian Schmutzler2021-06-051-6/+6
| | | | | | | | | | | | Many people appear to use an unneeded "+" prefix for the increment when calculating a MAC address with macaddr_add. Since this is not required and used inconsistently [*], just remove it. [*] As a funny side-fact, copy-pasting has led to almost all hotplug.d files using the "+", while nearly all of the 02_network files are not using it. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: add support for Askey RT4230W REV6Lauro Moreno2021-06-053-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the Askey RT4230W REV6 (Branded by Spectrum/Charter as RAC2V1K) At this time, there's no way to reinstall the stock firmware so don't install this on a router that's being rented. Specifications: Qualcomm IPQ8065 1 GB of RAM (DDR3) 512 MB Flash (NAND) 2x Wave 2 WiFi cards (QCA9984) 5x 10/100/1000 Mbps Ethernet (Switch: QCA8337) 1x LED (Controlled by a microcontroller that switches it between red and blue with different patterns) 1x USB 3.0 Type-A 12V DC Power Input UART header on PCB - pinout from top to bottom is RX, TX, GND, 5V Port settings are 115200n8 More information: https://forum.openwrt.org/t/askey-rac2v1k-support/15830 https://deviwiki.com/wiki/Askey_RAC2V1K To check what revision your router is, restore one of these config backups through the stock firmware to get ssh access then run "cat /proc/device-tree/model". https://forum.openwrt.org/t/askey-rac2v1k-support/15830/17 The revision number on the board doesn't seem to be very consistent so that's why this is needed. You can also run printenv in the uboot console and if machid is set to 177d, that means your router is rev6. Note: Don't install this if the router is being rented from an ISP. The defined partition layout is different from the OEM one and even if you changed the layout to match, backing up and restoring the OEM firmware breaks /overlay so nothing will save and the router will likely enter a bootloop. How to install: Method 1: Install without opening the case using SSH and tftp You'll need: RAC2V1K-SSH.zip: https://github.com/lmore377/openwrt-rt4230w/blob/master/RAC2V1K-SSH.zip initramfs and sysupgrade images Connect to one of the router's LAN ports Download the RAC2V1K-SSH.zip file and restore the config file that corresponds to your router's firmware (If you're firmware is newer than what's in the zip file, just restore the 1.1.16 file) After a reboot, you should be able to ssh into the router with username: "4230w" and password: "linuxbox" or "admin". Run the following commannds fw_setenv ipaddr 10.42.0.10 #IP of router, can be anything as long as it's in the same subnet as the server fw_setenv serverip 10.42.0.1# #IP of tftp server that's set up in next steps fw_setenv bootdelay 8 fw_setenv bootcmd "tftpboot initramfs.bin; bootm; bootipq" Don't reboot the router yet. Install and set up a tftp server on your computer Set a static ip on the ethernet interface of your computer (use this for serverip in the above commands) Rename the initramfs image to initramfs.bin, and host it with the tftp server Reboot the router. If you set up everything right, the router led should switch over to a slow blue glow which means openwrt is booted. If for some reason the file doesn't get loaded into ram properly, it should still boot to the OEM firmware. After openwrt boots, ssh into it and run these commands: fw_setenv bootcmd "setenv mtdids nand0=nand0 && setenv mtdparts mtdparts=nand0:0x1A000000@0x2400000(firmware) && ubi part firmware && ubi read 0x44000000 kernel 0x6e0000 && bootm" fw_setenv bootdelay 2 After openwrt boots up, figure out a way to get the sysupgrade file onto it (scp, custom build with usb kernel module included, wget, etc.) then flash it with sysupgrade. After it finishes flashing, it should reboot, the light should start flashing blue, then when the light starts "breathing" blue that means openwrt is booted. Method 2: Install with serial access (Do this if something fails and you can't boot after using method 1) You'll need: initramfs and sysupgrade images Serial access: https://openwrt.org/inbox/toh/askey/askey_rt4230w_rev6#opening_the_case Install and set up a tftp server Set a static ip on the ethernet interface of your computer Download the initramfs image, rename it to initramfs.bin, and host it with the tftp server Connect the wan port of the router to your computer Interrupt U-Boot and run these commands: setenv serverip 10.42.0.1 (You can use whatever ip you set for the computer) setenv ipaddr 10.42.0.10 (Can be any ip as long as it's in the same subnet) setenv bootcmd "setenv mtdids nand0=nand0 && set mtdparts mtdparts=nand0:0x1A000000@0x2400000(firmware) && ubi part firmware && ubi read 0x44000000 kernel 0x6e0000 && bootm" saveenv tftpboot initramfs.bin bootm After openwrt boots up, figure out a way to get the sysupgrade file onto it (scp, custom build with usb kernel module included, wget, etc.) then flash it with sysupgrade. After it finishes flashing, it should reboot, the light should start flashing blue, then when the light starts "breathing" blue that means openwrt is booted. Signed-off-by: Lauro Moreno <lmore377@gmail.com> [add entry in 5.10 patch, fix whitespace issues] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: base-files: asrock: fix bootcount includePetr Štetiar2021-05-131-5/+2
| | | | | | | | | | | | | | | | | | | | | Fixes following error while executing the init script on the buildhost: Enabling boot ./etc/init.d/bootcount: line 5: /lib/upgrade/asrock.sh: No such file or directory Enabling bootcount While at it fix following shellcheck issue: base-files/etc/init.d/bootcount line 11: if [ $? -eq 0 ]; then ^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. Cc: Ansuel Smith <ansuelsmth@gmail.com> Cc: Pawel Dembicki <paweldembicki@gmail.com> Cc: Christian Lamparter <chunkeey@gmail.com> Fixes: 98b86296e67d ("ipq806x: add support for ASRock G10") References: https://gitlab.com/ynezz/openwrt/-/jobs/1243290743#L1444 Signed-off-by: Petr Štetiar <ynezz@true.cz>
* ipq806x: ecw5410: case-insensitive qcom-smem partitionsStefan Lippers-Hollmann2021-05-082-4/+20
| | | | | | | | The out-of-tree qcom-smem patches traditionally displayed mtd partition names in upper case, starting with the new mainline qcom-smem support in kernel v5.10, it switches to normalizing the partition names to lower case. Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
* ipq806x: g10: case-insensitive qcom-smem partitionsStefan Lippers-Hollmann2021-05-082-3/+15
| | | | | | | | The out-of-tree qcom-smem patches traditionally displayed mtd partition names in upper case, starting with the new mainline qcom-smem support in kernel v5.10, it switches to normalizing the partition names to lower case. Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
* ipq806x: nbg6817: case-insensitive qcom-smem partitionsStefan Lippers-Hollmann2021-05-083-6/+24
| | | | | | | | The out-of-tree qcom-smem patches traditionally displayed mtd partition names in upper case, starting with the new mainline qcom-smem support in kernel v5.10, it switches to normalizing the partition names to lower case. Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
* 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: ubnt,unifi-ac-hd: reorder eth0 and eth1Mark Mentovai2021-05-071-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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>
* ipq806x: add support for Ubiquiti UniFi AC HDJan Alexander2021-01-142-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: 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: add support for TP-Link Talon AD7200Gary Cooper2021-01-054-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: add support for NEC Platforms Aterm WG2600HP3Yanase Yuki2020-12-253-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NEC Platforms Aterm WG2600HP3 is a dual-band router based on Qualcomm IPQ8062. Specification ------------- - SoC: Qualcomm IPQ8062 - RAM: 512MiB - Flash memory: SPI-NOR 32MiB (Cypress S25FL256S) - Wi-Fi: Qualcomm QCA9984 (2.4GHz, 1ch - 13ch) - Wi-Fi: Qualcomm QCA9984 (5GHz, 36ch - 64ch, 100ch - 140ch) - Ethernet: 4x 100/1000 Mbps (1x WAN, 4x LAN) - LED: 6x green LED, 6x red LED - Input: 2x tactile switch, 1x SP3T slide switch - Serial console: 115200bps, through-hole J3 - [ ] [GND] [ ] [TX] [RX] ----> DC jack - Power: DC 12V 1.5A This device does not support VHT160 and VHT80+80. Custom BDFs are required to limit VHT capabilities. Flash instructions ------------------ 1. Setup TFTP server (IP address: 192.168.1.2) 2. Put initramfs image into TFTP server directory 3. Connect WG2600HP3 lan port and computer that runs TFTP server 4. Connect to the serial console 5. Interrupt booting by Esc key (password: chiron) 6. Execute the following commands # setenv bootcmd "nboot 0x44000000 1 0x860000" # saveenv # setenv ipaddr 192.168.1.1 # setenv serverip 192.168.1.2 # tftpboot 0x44000000 openwrt-ipq806x-generic-nec_wg2600hp3-initramfs-uImage 7. After booting OpenWrt initramfs image, backup SPI-NOR flash memory 8. Erase firmware partition # mtd erase firmware 9. Run sysupgrade Signed-off-by: Yanase Yuki <dev@zpc.sakura.ne.jp>
* ipq806x: remove unneeded empty linesAdrian Schmutzler2020-12-222-2/+0
| | | | | | This removes two unneeded empty lines in base-files. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: add support for ASRock G10Christian Lamparter2020-12-227-4/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ASRock G10 is a 2.4/5 GHz band 11ac "Gaming" router, based on Qualcomm IPQ8064. Specifications: SoC: Qualcomm IPQ8064 CPU: Dual-Core A15 @ (384 - 1,400 MHz, 2C2T) DRAM: 512 MiB (~467 MiB available) NAND: 128 MB (Micron MT29F1G08ABBEAH4) WLAN0: 4T4R 5 GHz Wlan (QCA9980) WLAN1: 4T4R 2.4 GHz Wlan (QCA9980) ETH: 5x 10/100/1000 Mbps Ethernet (QCA8337) INPUT: Reset Button, WPS 2.4G and WPS 5G Button LEDS: 1 multicolor status LED USB: 2x USB 3.0 Type-A POWER: 12VDC/3A AC Adapter + dedicated Power Switch UART: Setting is 115200-8-N-1. 1x4 .1" unpopulated header on the PCB (J6 - very tiny silkscreen next to TX). Pinout: 1. 3v3 (Square - best skipped!), 2. RX, 3. GND, 4. TX WARNING: The serial port needs a TTL/RS-232 3.3v level converter! (Depending on the serial adapter RX and TX might need to be swapped). Note about the IR-Remote: There's a 8-Bit MCU (SONIX SN8F25E21SG) which is controlling the IR-Remote and is fed by the IR-Photodiode. The SoC can talk to the device via I2C. The vendor's GPL archive comes with the source of the interface driver for this as a (character driver), the main control software is however a blob. Installation Instructions: 1. Download factory image to disk 2. Apply factory image via stock web-gui Back to stock: 1. Login to router via ssh 2. run "asrock_g10_back_to_factory" script from /sbin Notes: - If something goes wrong durring sysupgrade, router will go back to factory image. - Asrock G10 uses partition layout from smem. So partition layout can be normal or alternate. - 900-arm-add-cmdline-override.patch was copied from 102-powerpc-add-cmdline-override.patch from powerpc target. Knowledge about BOOTCONFIG partition was based on user "jmomo" post from old OpenWrt forum (Post #50): https://forum.archive.openwrt.org/viewtopic.php?id=65956&p=2 Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [bump to 5.4, add factory image, fix sysupgrade, convert partition layout to smem, remove ipq-wifi-asrock-g10 and use ART, minor fixes] Co-Authored-by: Pawel Dembicki <paweldembicki@gmail.com> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> Tested-by: Lukasz Ostapiuk <palibrzuch@gmail.com>
* ipq806x: remove model name from LED labelsAdrian Schmutzler2020-10-072-24/+30
| | | | | | | | | | Like in the previous patches for ath79 and ramips, this will remove the "devicename" from LED labels in ipq806x. The devicename is removed in DTS files and 01_leds, and a migration script is added. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: fix support of Edgecore ECW5410 supportAdrian Schmutzler2020-09-191-2/+2
| | | | | | | | | | | | | | | | This fixes several stylistic and functional errors of the recently added Edgecore ECW5410: - fix call in 11-ath10k-caldata - use hex notation in 11-ath10k-caldata - remove redundant definitions from DTS that are already in DTSI - use proper sorting in image/Makefile - use DEVICE_VENDOR/DEVICE_MODEL instead of DEVICE_TITLE - use SOC instead of DEVICE_DTS Fixes: 59f0a0fd839e ("ipq806x: add Edgecore ECW5410 support") Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: sort entries in lib/upgrade/platform.shAdrian Schmutzler2020-09-171-3/+3
| | | | | | Apply alphabetic sorting like in the other files. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* treewide: remove empty default casesAdrian Schmutzler2020-09-171-2/+0
| | | | | | There is no apparent reason to have an empty default case. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: sort entries in 02_networkAdrian Schmutzler2020-09-171-5/+5
| | | | | | Apply alphabetic sorting like in the other files. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: add Edgecore ECW5410 supportRobert Marko2020-09-175-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the Edgecore ECW5410 indoor AP. Specification: - SoC: Qualcomm Atheros IPQ8068 ARMv7 2x Cortex A-15 - RAM: 256MB(225 usable) DDR3 - NOR Flash: 16MB SPI NOR - NAND Flash: 128MB S34MS01G2 Parallel NAND - Ethernet: 2 x 1G via 2x AR8033 PHY-s connected directly to GMAC2 and GMAC3 via SGMII (802.3af POE IN on eth0) - USB: 1 x USB 3.0 SuperSpeed - WLAN: 2x QCA9994 AC Wawe 2 (1x 2GHz bgn, 1x 5GHz acn) - CC2540 BLE - UART console on RJ45 next to ethernet ports exposed. Its Cisco pin compatible, 115200 8n1 baud. Installation instructions: Through stock firmware or initramfs. 1.Connect to console 2. Login with root account, if password is unknown then interrupt the boot with f and reset it in failsafe. 3. Transfer factory image 4. Flash the image with ubiformat /dev/mtd1 -y -f <your factory image path> This will replace the rootfs2 with OpenWrt, if you are currently running from rootfs2 then simply change /dev/mtd1 to /dev/mtd0 Note Initramfs: 1. Connect to console 2. Transfer the image from TFTP server with tftpboot, or by using DHCP advertised image with dhcp command. 3. bootm 4. Run ubiformat /dev/mtd1 You need to interrupt the bootloader after rebooting and run: run altbootcmd This will switch your active rootfs partition to one you wrote to and boot from it. So if rootfs1 is active, then it will change it to rootfs2. This will format the rootfs2 partition, if your active partition is 2 then simply change /dev/mtd1 with /dev/mtd0 If you dont format the partition you will be writing too, then sysupgrade will find existing UBI rootfs and kernel volumes and update those. This will result in wrong ordering and OpenWrt will panic on boot. 5. Transfer sysupgrade image 6. Flash with sysupgrade -n. Note that sysupgrade will write the image to rootfs partition that is not currently in use. Signed-off-by: Robert Marko <robert.marko@sartura.hr>
* ipq806x: enable Linksys EA8500 eth1 interfacePawel Dembicki2020-07-111-1/+1
| | | | | | | | | | | | | At this moment Linksys EA8500 uses only eth0. This patch change switch registers, which allow to use eth1 as lan and eth0 as wan. The method work with similar Linksys EA7500V1 and it work with EA8500. Suggested-by: Sungbo Eo <mans0n@gorani.run> Tested-by: Brian Onn <brian.a.onn@gmail.com> Tested-by: Adrian Panella <ianchi74@outlook.com> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
* ipq806x: add support for Linksys EA7500 V1Pawel Dembicki2020-07-084-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the Linksys EA7500 V1 router. Specification: - CPU: Qualcomm IPQ8064 - RAM: 256MB - Flash: NAND 128MB - WiFi: QCA9982 an+ac + QCA9983 bgn - Ethernet: 5 GBE Ports (WAN+ 4xLAN) (QCA8337) - USB: 1x USB 3.0 1x USB2.0 - Serial console: RJ-45 115200 8n1 (1V8 Voltage level) - 2 Buttons - 1 LED Known issues: - Some devices won't flash via web gui Installation: - Newer stock images doesn't allow to install custom firmware. - Please downgrade software to 1.1.2 version. Official firmware: https://downloads.linksys.com/downloads/firmware/FW_EA7500_1.1.2.172843_prod.gpg.img - Do it two times to downgrade all stored images. - Apply factory image via web-gui. Serial + TFTP method: - downgrade to 1.1.2 two times - connect ehternet and serial cable - set ip address of tftp server to 192.168.1.254 - put openwrt factory image to tftp folder and rename it to macan.bin - stop device while booting in u-boot - run command: "run flashimg" - run command: "setenv boot_part 1" - run command "saveenv" - reset Back to stock: - Please use old non-gpg image like this 1.1.2: https://downloads.linksys.com/downloads/firmware/FW_EA7500_1.1.2.172843_prod.img - ssh to router and copy image to tmp - use sysupgrade -n -F Tested by github users: @jack338c and @grzesiczek1 Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> [removed i2c4_pins, mdio0_pins, nand_pins, rgmii2_pins from DTSI] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* treewide: drop shebang from non-executable target filesAdrian Schmutzler2020-06-161-1/+0
| | | | | | | | | | | | | | This drops the shebang from all target files for /lib and /etc/uci-defaults folders, as these are sourced and the shebang is useless. While at it, fix the executable flag on a few of these files. This does not touch ar71xx, as this target is just used for backporting now and applying cosmetic changes would just complicate things. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: EA8500 fix boot partition detectionSamantha Collard2020-05-311-2/+0
| | | | | | | Remove extraneous code that disabled boot partition detection. Fixes: b3770eaca39f ("mtd: base-files: Unify dual-firmware devices (Linksys)") Signed-off-by: Samantha Collard <sammyrc34@gmail.com>
* ipq806x: read both WG2600HP MAC addresses from flashYanase Yuki2020-03-161-1/+1
| | | | | | | | | WG2600HP has its WLAN MAC addresses at PRODUCTDATA 0xc and 0x12, so use them both directly. Signed-off-by: Yanase Yuki <dev@zpc.sakura.ne.jp> [commit title/message clarification] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: remove useless case within default case for upgradeAdrian Schmutzler2020-03-161-1/+0
| | | | | | | The default case will catch anything left, there is no need to explicitly add any device to it. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq806x: use switch trigger for WAN LED on NETGEAR boardsDavid Bauer2019-11-041-1/+1
| | | | | | | | | With this commit, the WAN LED is triggered by the switch port state instead of the eth0 netdev. Otherwise, the LED is always illuminated, regardless of the WAN port link state. Signed-off-by: David Bauer <mail@david-bauer.net>
* treewide: use a single ath10k MAC patching function with checksumAdrian Schmutzler2019-10-151-14/+14
| | | | | | | | | | | | | | | | While all ath10k eeproms have a checksum field, so far two functions for patching ath10k MAC address have been present (and been used). This merges code to provide a single function ath10k_patch_mac in caldata.sh, having its name in accordance with ath9k functions. By doing so, correct MAC patching for current and future ath10k devices should be ensured. This patch adds checksum adjustments for several targets on ath79 and lantiq. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* treewide: move MAC address patch functions to common libraryAdrian Schmutzler2019-10-141-25/+0
| | | | | | | | | This unifies MAC address patch functions and moves them to a common script. While those were implemented differently for different targets, they all seem to do the same. The number of different variants is significantly reduced by this patch. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* treewide: move calibration data extraction function to libraryAdrian Schmutzler2019-10-131-46/+16
| | | | | | | | | | | | | | | | | This moves the almost identical calibration data extraction functions present multiple times in several targets to a single library file /lib/functions/caldata.sh. Functions are renamed with more generic names to merge different variants that only differ in their names. Most of the targets used find_mtd_chardev, while some used find_mtd_part inside the extraction code. To merge them, the more abundant version with find_mtd_chardev is used in the common code. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> [rebase on latest master; add mpc85xx] Signed-off-by: David Bauer <mail@david-bauer.net>
* base-files: move xor() from caldata extraction to functions.shAdrian Schmutzler2019-10-131-16/+1
| | | | | | | | The xor() function is defined in each of the caldata extraction scripts for several targets. Move it to functions.sh to reduce duplicate code. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* treewide: use new procd sysupgrade $UPGRADE_BACKUP variableRafał Miłecki2019-09-051-1/+1
| | | | | | | | | | It's a variable set by procd that should replace hardcoded /tmp/sysupgrade.tgz. This change requires the most recent procd with the commit 0f3c136 ("sysupgrade: set UPGRADE_BACKUP env variable"). Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* treewide: when copying a backup file always specify dest nameRafał Miłecki2019-09-051-1/+1
| | | | | | | $CONF_TAR shouldn't be assumed to always point to the sysupgrade.tgz. This change makes code more generic and allows refactoring $CONF_TAR. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* treewide: don't hardcode "sysupgrade.tgz" file nameRafał Miłecki2019-09-051-1/+1
| | | | | | | | 1) Add BACKUP_FILE and use it when copying an archive to be restored after sysupgrade (on the next preinit). 2) Use CONF_TAR for copying backup prepared by the /sbin/sysupgrade Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* ipq806x: Replace backticks by $(...)Adrian Schmutzler2019-08-312-4/+4
| | | | | | This replaces deprecated backticks by more versatile $(...) syntax. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* treewide: sync bootcount scripts across targetsChuanhong Guo2019-08-171-3/+1
| | | | | | | | | | | | | | | This commit made the following changes to sync all bootcount scripts: 1. use boot() instead of start() This script only needs to be executed once when boot is complete. use boot() to make this explicit. 2. drop sourcing of /lib/functions.sh This is aready done in /etc/rc.common. 3. ramips: replace board name checking with a case Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* treewide: convert WiFi caldata size and offset to hexadecimalAdrian Schmutzler2019-08-141-18/+18
| | | | | | | | | | | | | | This changes size and offset set for WiFi caldata extraction and MAC address adjustment to hexadecimal notation. This will be much clearer for the reader when numbers are big, and will also match the style used for mtd-cal-data in DTS files. Since dd cannot deal with hexadecimal notation, one has to convert back to decimal by simple $(($hexnum)). Acked-by: Alexander Couzens <lynxis@fe80.eu> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* treewide: convert MAC address location offsets to hexadecimalAdrian Schmutzler2019-08-141-10/+10
| | | | | | | | | | | | | This changes the offsets for the MAC address location in mtd_get_mac_binary* and mtd_get_mac_text to hexadecimal notation. This will be much clearer for the reader when numbers are big, and will also match the style used for mtd-mac-address in DTS files. (e.g. 0x1006 and 0x5006 are much more useful than 4102 and 20486) Acked-by: Alexander Couzens <lynxis@fe80.eu> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* treewide: sysupgrade: get rid of platform_nand_pre_upgrade()Rafał Miłecki2019-07-222-10/+6
| | | | | | | | | | | 1) nand_do_upgrade() is always called by a target code 2) nand_do_upgrade() starts with calling platform_nand_pre_upgrade() It means there is no need for the platform_nand_pre_upgrade() callback at all. All code that was present there could bo moved & simplly called by a target right before the nand_do_upgrade(). Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* treewide: sysupgrade: don't use $ARGV in platform_do_upgrade()Rafał Miłecki2019-07-171-6/+6
| | | | | | | 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>
* mtd: base-files: Unify dual-firmware devices (Linksys)Jeff Kletsky2019-05-183-38/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consistently handle boot-count reset and upgrade across ipq40xx, ipq806x, kirkwood, mvebu Dual-firmware devices often utilize a specific MTD partition to record the number of times the boot loader has initiated boot. Most of these devices are NAND, typically with a 2k erase size. When this code was ported to the ipq40xx platform, the device in hand used NOR for this partition, with a 16-byte "record" size. As the implementation of `mtd resetbc` is by-platform, the hard-coded nature of this change prevented proper operation of a NAND-based device. * Unified the "NOR" variant with the rest of the Linksys variants * Added logging to indicate success and failure * Provided a meaningful return value for scripting * "Protected" the use of `mtd resetbc` in start-up scripts so that failure does not end the boot sequence * Moved Linksys-specific actions into common `/etc/init.d/bootcount` For upgrade, these devices need to determine which partition to flash, as well as set certain U-Boot envirnment variables to change the next boot to the newly flashed version. * Moved upgrade-related environment changes out of bootcount * Combined multiple flashes of environment into single one * Current-partition detection now handles absence of `boot_part` Runtime-tested: Linksys EA8300 Signed-off-by: Jeff Kletsky <git-commits@allycomm.com> Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [checkpatch.pl fixes, traded split strings for 80+ chars per line]
* ipq806x: fix LED configuration for NEC Aterm WG2600HPINAGAKI Hiroshi2019-02-281-1/+1
| | | | | | | NEC WG2600HP uses port1 on QCA8337 as a WAN port, so "0x2" should be used as a portmask instead of "0x1e" for "WAN" LED configuration. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* ipq806x: add support for Buffalo WXR-2533DHPINAGAKI Hiroshi2019-01-015-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Buffalo WXR-2533DHP is a 2.4/5 GHz band 11ac router, based on Qualcomm IPQ8064. The U-Boot on WXR-2533DHP employs a complicated dual firmware protection scheme against corruptions of the kernel and rootfs images. See the notes in buffalo.sh for details. specifications: - Qualcomm IPQ8064 (384 - 1,400 MHz, 2C2T) - 512 MB of RAM (DDR3) - 256 MB of Flash (NAND) - 4T4R 2.4/5 GHz Wlan (QCA9980) - 5x 10/100/1000 Mbps Ethernet - 10x LEDs, 8x keys (6x buttons, 2x slide-switches) - 2x USB 3.0 Type-A - 12VDC/4A AC Adapter - UART through-hole on PCB - J3: Vcc, GND, TX, RX from USB port side - 115200n8 Boot instructions for the initramfs image: 1. Prepare the TFTP server with the initramfs image renamed to "wxr2300dhp-initramfs.uImage" and IP address "192.168.11.10". 2. Press the "AOSS" button while powering on the WXR-2533DHP. 3. Wait until the "Wireless" LED flashes before releasing the AOSS button. The WXR-2533DHP will grab the image from TFTP server and will boot it. Flashing instructions: To persistently write the firmware, flash an openwrt sysupgrade image from inside the initramfs, for example transfer via `scp <sysupgrade> root@192.168.1.1:/tmp` and flash on the device with `sysupgrade -n /tmp/<sysupgrade>`. Then wait ~120 seconds to let it finish the flashing process. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com> Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [reworded message]
* ipq806x: add ath10k calibration data MAC addresses patchingChristian Lamparter2018-12-152-35/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ben Greear reported in his patch: |Subject: netgear r7800: Fix mac address of radios. | |Reloading the driver causes the phyX to change, and that |caused the MAC address to change. This is because all ODM/OEMs except QCA bothered to write the correct MAC address for the ath10k wifi into the calibration data. This patch copies over the MAC patching helper functions from ipq40xx's target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata file and converts all the devices to patch the correct MACs into the extracted calibration data before it gets sent to the driver, which sets up the device with the correct MAC address. It also removes the entries in the 10_fix_wifi_mac file as they have served their purpose for good. Please note the C2600: There is conflicting information on what the offset for the second wifi is supposed to be. This patch uses what was specified in 10_fix_wifi_mac. According to Ben Greear this method is save to use with the stock firmware too. As he explained that the stock firmware messes up rx-bssid mask calculation when the MAC is changed after the first vif is created. Reported-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* apm821xx, ath79, ipq40xx, ipq806x, lantiq, ramips: base-files: Use generic ↵Petr Štetiar2018-12-061-46/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | diag.sh I wanted to add status LEDs support to my imx6 based board and have found out, that I could use diag.sh script found in ramips platform, which seems to be also shared in a few other platforms: 4801276bc2078c5bcf03003c831e3b0a target/linux/ramips/base-files/etc/diag.sh 4801276bc2078c5bcf03003c831e3b0a target/linux/ipq40xx/base-files/etc/diag.sh 4801276bc2078c5bcf03003c831e3b0a target/linux/ath79/base-files/etc/diag.sh And @chunkeey suggested to me, that I can also add lantiq, ipq806x and apm821xx to the list of platforms which could share this generic diag.sh. I've extended the base diag.sh in a way, that if it detects any of the DTS LED aliases, then it would use the generic DTS set_led_state code. The code in platform's diag.sh has moved to base-files package in this commit: base-files: diag.sh: Make it more generic towards DTS so it could be reused Signed-off-by: Petr Štetiar <ynezz@true.cz> Tested-by: Christian Lamparter <chunkeey@gmail.com> (apm821xx and ipq40xx)
* ipq806x: Add support for IPQ8064 AP161 boardRam Chandra Jangir2018-11-262-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specification: - SoC: Qualcomm Atheros IPQ8064 ARM-v7 Dual Core SMP CPU - RAM: 512MB DDR3 System Memory - NOR Flash: 32MB SPI NOR - NAND Flash: 256MB NAND - Ethernet: 5 x 1G via QCA8337N - USB: 2 x USB 3.0 SuperSpeed - PCIe: 3x Mini PCIe 2.0 Slots Three PCIE2.0 connectors can connect two or three radio cards such as the CUS260 for 2.4 GHz WLAN and the CUS239 for 802.11ac WLAN How to flash via u-boot console: tftpboot 0x44000000 openwrt-ipq806x-qcom_ipq8064-ap161-squashfs-nand-factory.bin nand erase 0x1340000 0x4000000 nand write 0x44000000 0x1340000 $filesize setenv bootargs ‘console=ttyMSM0,115200 ubi.mtd=ubi root=/dev/ubiblock0_1’ saveenv bootm Further upgrades via sysupgrade. Tested on IPQ8064 AP161 Board: 1) NAND boot 2) Tested USB and PCIe interfaces 3) WDOG test 4) cpu frequency scaling 5) ethernet, 2G and 5G WiFi 6) ubi sysupgrade Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
* hotplug: Allow configuring radio name.Ben Greear2018-11-261-0/+21
| | | | | | | | | | | | | This way the radio (phy) name can be the same through module reloads. To set the desired name: uci set wireless.@wifi-device[0].phyname=wiphy0 I guess this only works on ipq6086 boards as I could not find a more generic place to put this. Maybe someone can improve it. Signed-off-by: Ben Greear <greearb@candelatech.com>
* treewide: fix upgrade led handlingMathias Kresin2018-08-161-2/+4
| | | | | | | | | | | | The upgrade led is only used if a running led is defined. If no running led is defined, the upgrade led is ignored and upgrade isn't indicated at all. Instead, turn off the running led prior to turning the upgrade led on. In most cases there isn't any visual change, but it allows to use an independent led for upgrade indication. Signed-off-by: Mathias Kresin <dev@kresin.me>