Reading and writing to and from flash storage is slow and currently,
the ath10kcal_extract() scripts are even more at an disadvantage
because they use a block size of 1 to be able skip.
This patch reworks the extraction scripts to be much faster and
efficient by reading and writing the calibration data in possibly
one big block.
before: (Tested on a RT-AC58U, which has SPI-NAND).
# time dd if=/dev/ubi0_1 of=/lib/firmware/... bs=1 skip=4096 count=12064
12064+0 records in
12064+0 records out
real 0m 0.28s
user 0m 0.02s
sys 0m 0.24s
after:
# time dd if=/dev/ubi0_1 of=/lib/firmware/... bs=12064 skip=4096 count=1 iflag=skip_bytes
1+0 records in
1+0 records out
real 0m 0.01s
user 0m 0.00s
sys 0m 0.00s
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
This commit fixes the script that sets the MAC address of the LAN
switch. The LAN MAC address should be the WAN MAC address plus one.
Without this patch the WAN and the LAN interface will use the same
MAC address and an error will be generated.
With this patch all interfaces will have a different MAC address,
consecutive in the following order: WAN, LAN, radio0 and radio1.
Signed-off-by: Oever González <notengobattery@gmail.com>
SoC: Qualcomm IPQ4019 (Dakota) 717 MHz, 4 cores
RAM: 256 MiB (Nanya NT5CC128M16IP-DI)
FLASH: 128 MiB (Macronix NAND)
WiFi0: Qualcomm IPQ4019 b/g/n 2x2
WiFi1: Qualcomm IPQ4019 a/n/ac 2x2
WiFi2: Qualcomm Atheros QCA9886 a/n/ac
BT: Atheros AR3012
IN: WPS Button, Reset Button
OUT: RGB-LED via TI LP5523 9-channel Controller
UART: Front of Device - 115200 N-8
Pinout 3.3v - RX - TX - GND (Square is VCC)
Installation:
1. Transfer OpenWRT-initramfs image to the device via SSH to /tmp.
Login credentials are identical to the Web UI.
2. Login to the device via SSH.
3. Flash the initramfs image using
> mtd-write -d linux -i openwrt-image-file
4. Power-cycle the device and wait for OpenWRT to boot.
5. From there flash the OpenWRT-sysupgrade image.
Ethernet-Ports: Although labeled identically, the port next to
the power socket is the LAN port and the other one is WAN. This
is the same behavior as in the stock firmware.
Signed-off-by: Marius Genheimer <mail@f0wl.cc>
[Dropped setup_mac 02_network in favour of 05_set_iface_mac_ipq40xx.sh,
reorderd 02_network entries, added board.bin WA for the QCA9886 from ath79,
minor dts touchup, added rng to 4.19 dts]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Robert Marko made a big effort to enable the rng on all
ipq40xx for 4.19, so let's continue the quest.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
This patch fixes the ASUS' RT-AC58U port order by
unifying the configuration with the NBG6617.
Reported-by: Roberto Socrates (rtac58u-user on the forum)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
This patch splits the big board case switch in 02_network in
two functions ipq40xx_setup_interfaces() and ipq40xx_setup_macs()
just like ath79 and ramips do.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Specifications:
SOC: Qualcomm IPQ4018
RAM: 256 MiB Samsung K4B2G1646F-BYK0
FLASH1: MX25L1605D 2 MB
FLASH2: Winbond W25N01GV 128Mb
ETH: Qualcomm QCA8075
WLAN0: Qualcomm Atheros QCA4018 2.4GHz 802.11b/g/n 2x2
WLAN1: Qualcomm Atheros QCA4018 5GHz 802.11n/ac W2 2x2
INPUT: WPS, Reset
LED: Status - Green
SERIAL: Header at J19, Beneath DC Power Jack
1-VCC ; 2-TX ; 3-RX; 4-GND;
Serial 115200-8-N-1.
Tested and working:
- USB (requires extra packages)
- LAN Ethernet (Correct MAC-address)
- WAN Ethernet (Correct MAC-address)
- 2.4 GHz WiFi (Correct MAC-address)
- 5 GHz WiFi (Correct MAC-address)
- Factory installation from Web UI
- OpenWRT sysupgrade
- LED
- Reset Button
Need Testing:
- WPS button
Install via Web UI:
- Attach to a LAN port on the router.
- Connect to the Linksys Smart WiFi Page (default 192.168.1.1) and login
- Select the connectivity tab on the left
- In the manual update box on the right
- Select browse, and browse to
openwrt-ipq40xx-linksys_ea6350v3-squashfs-factory.bin
- Click update.
- Read and accept the warning
- The router LED will start blinking. When the router LED goes solid, you
can now navigate to 192.168.1.1 to your new OpenWrt installation.
Sysupgrade:
- Flash the sysupgrade image as usual. Please: try to do a reset everytime
you can (doing it with LuCI is easy and can be done in the same step).
Recovery (Automatic):
- If the device fails to boot after install or upgrade, whilst the unit is
turned on:
1 - Wait 15 seconds
2 - Switch Off and Wait 10 seconds
3 - Switch on
4 - Repeat steps 1 to 3, 3 times then go to 5.
5 - U-boot will have now erased the failed update and switched back to the
last working firmware - you should be able to access your router on
LAN.
Recovery (Manual):
- The steps for manual recovery are the same as the generic u-boot tftp
client method.
Back To Stock:
- Use the generic recovery using the tftp client method to flash the
"civic.img". Also you can strip-and-pad the original image and use
the generic "mtd" method by flashing over the "kernel" partition.
* Just be careful to flash in the partition that the device is currently
booted.
Signed-off-by: Ryan Pannell <ryan@osukl.com>
Signed-off-by: Oever González <notengobattery@gmail.com>
[minor edits, removed second compatible of nand, added dtb entry to 4.19]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
The unit address should be wifi@1,0 since the device is located
at 0000:01:00.0.
Reported-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
This removes the misplaced UCI-network configuration for the MR33. The
LAN port is set in 01_leds while it is already correctly defined in
02_network.
This was most likely an oversight as no network configuration belongs
into 01_leds.
Signed-off-by: David Bauer <mail@david-bauer.net>
Copy U-Boot to STAGING_DIR_IMAGE (and append it to the EVA-image from
there) to fix image generation using the image-builder.
Also remove the bootloader from DEVICE_PACKAGES and instead use the
BUILD_DEVICES directive from within the U-Boot makefile.
This fixes eva-image generation using the OpenWRT image-builder.
Signed-off-by: David Bauer <mail@david-bauer.net>
This patch syncs the 4.14 kernel config to the
current generic configuration.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [reworded commit]
This patch syncs the 4.19 kernel config since the
KERNEL_STACKPROTECTOR and compiler options are
now part of the 4.19 generic config.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [reworded commit]
Robert Marko reported an issue with the current imagebuilder images:
"Imagebuilder includes the new kmod-usb-dwc3-qcom USB driver
package by default even on 4.14. [...] the current state imagebuilder
can't build images under 4.14 at all as the kmod-usb-dwc3-qcom does
not exist in it so it throws and error and exits."
This patch reverts the Makefile to just kmod-usb-dwc3-of-simple and
once the switch to 4.19 is done. It also removes the
kmod-usb-phy-qcom-dwc3 as they only contain the usb-phy drivers for
the ipq806x generation.
Dynamic switching based on the KERNEL_PATCHVER is possible by using:
$(if $(filter 4.14,$(KERNEL_PATCHVER)),kmod-usb-dwc3-of-simple,kmod-usb-dwc3-qcom)
though it
Fixes: 13321fa142 ("ipq40xx: Use kmod-usb-dwc3-qcom by default")
Fixes: 6e58fb2c33 ("ipq40xx: kmod-usb-dwc3-of-simple vs kmod-usb-dwc3-qcom")
Reported-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Thanks to the ledtrig-usb.c the USB LED trigger can be
setup in the device-tree definition for the Asus RT-AC58U
and ZyXEL NBG6617.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
This patch fixes a kernel warning that got triggered by 4.19
because of a bad/missing interrupt level definition in the DTS.
| WARNING: CPU: 2 PID: 1996 at drivers/irqchip/irq-gic.c:1016
| CPU: 2 PID: 1996 Comm: kmodloader Not tainted 4.19.9 #0
| Hardware name: Generic DT based system
| [<c0317884>] (warn_slowpath_null) from [<c04f9cd0>]
| [<c04f9cd0>] (gic_irq_domain_translate) from [<c035af30>]
| [<c035af30>] (irq_create_fwspec_mapping) from [<c035b1e0>]
| [<c035b1e0>] (irq_create_of_mapping) from [<c0614eec>]
| [<c0614eec>] (of_irq_get) from [<c0614f3c>]
| [<c0614f3c>] (of_irq_to_resource) from [<c0614ff0>]
| [<c0614ff0>] (of_irq_to_resource_table) from [<c0610e08>]
| [<c0610e08>] (of_device_alloc) from [<c0610ea0>]
| [<c0610ea0>] (of_platform_device_create_pdata)
| [<c061120c>] (of_platform_bus_create)
| [<c06113c4>] (of_platform_populate)
| [<bf4c06b4>] (dwc3_qcom_probe [dwc3_qcom])
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Robert Marko <robimarko@gmail.com> noted in
"ipq40xx: Use kmod-usb-dwc3-qcom by default":
| Since 4.18 we cant use DWC3 OF Simple anymore so we
| have to use kmod-usb-dwc3-qcom.
This patch adds a TODO right next to the KERNEL_PATCHVER so
it will be picked up when moving to 4.19.
I would also like to point out:
All users/devs that are compiling their own images from source
and have a existing 4.14 config and want to switch to 4.19:
Please drop kmod-usb-dwc3-of-simple and add kmod-usb-dwc3-qcom
module package. Otherwise, the USB port on your router will no
longer work.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
- 4.19 no longer refuses to initialize the mdio bus if
a phy is not connected.
- fix partition unit-address
- restrict partition offset and size to 32-bit integers.
- add note to warn people not to mess with the ubi
partition size.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Upstream commit:
80483c3abf8 ("ARM: qcom: Cleanup/Remove unnecessary board file")
removed all the platform device compatibles stating that:
"This patch removes the unnecessary board file. The generic machine
definition is sufficient for the Qualcomm platforms."
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
- make the device userspace integration (WIFI,MAC,sysupgrade)
work again by renaming the ubi to UBI_DEV as a temporary measure.
In the future, once 4.14 support is dropped, this can all be
refactored again. *sigh*
- use the wifi0 and wifi1 labels
- follow Device-Tree Release v0.2 2.2.2 Generic Names Recommendation
- fix duplicated partition node-names
- remove qcom,ipq4019 platform compatible. it's no longer needed
(and wrong because the chip is a qcom,ipq4018).
Fixes: 4c67f3ad78d ("ipq40xx: Adapt 4.19 DTS for upstream SPI-NAND driver")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
IPQ40xx series has a HW pseudo random number generator built in.
It already has a node in the upstream ipq4019.dtsi so we just need to enable it.
Its driver has been rewritten to use crypto API so we dont have char interface like under 4.14 kernel.
Signed-off-by: Robert Marko <robimarko@gmail.com>
DTC was throwing warnings like this:
image-qcom-ipq4018-jalapeno.dtb: Warning (avoid_unnecessary_addr_size): /soc/spi@78b5000/m25p80@0: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property
image-qcom-ipq4018-jalapeno.dtb: Warning (avoid_unnecessary_addr_size): /soc/spi@78b5000/spi-nand@1: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property
So lets fix this for our downstream boards.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Since 4.19 upstream kernel provides generic SPI-NAND
framework and vendor specific drivers.
Since only users of MT29F are 2 boards with Winbond
W25N01GV SPI-NAND for which support has been backported
from 4.20 we can drop the ever stuck in staging MT29F
driver and instead use the upstream driver.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [squashed]
This adds the necessary patches for 4.19 kernel.
Upstreamed patches were dropped, backported upstreamed patches
from 4.20.
Drop Winbond ID patch since that NAND IC was upstreamed to use
SPI-NAND framework and support for it was backported from 4.20.
Rework ESSEDMA patches to compile under 4.19 due to timer changes,
Clément Péron did the hard work and his changes were taken from the
initial 4.19 PR.
MR33 changes had to be manually refreshed to apply.
Refresh other patches to apply.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Remove
The ZyXEL NBG6617 USB LED was not working with the default images.
It turned out that kmod-usb-ledtrig-usbport was missing from the
default installation.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
This commit removes the fixed kernel size-padding for the Netgear
DNI image creation as it is not necessary for a working image.
The fake rootfs still needs to be padded to the blocksize.
Tested-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: David Bauer <mail@david-bauer.net>
Alberto Bursi reported:
>The patch "ipq40xx: specify "firmware" partition format for GL.iNet GL-B1300"
>prevents boot on my B1300. I compiled from latest sources.
The GL-B1300 was using the discouraged direct subnodes method to declare
the partitions on the flash.
|The partition table should be a subnode of the flash node and should be named
|'partitions'. This node should have the following property:
|- compatible : (required) must be "fixed-partitions"
|Partitions are then defined in subnodes of the partitions node.
|
|For backwards compatibility partitions as direct subnodes of the flash device are
|supported. This use is discouraged.
|NOTE: also for backwards compatibility, direct subnodes that have a compatible
|string are not considered partitions, as they may be used for other bindings.
<https://www.kernel.org/doc/Documentation/devicetree/bindings/mtd/partition.txt>
Hence, this patch converts the device to the "partitions" layout.
Fixes: 1cbe457cf9 ("ipq40xx: specify "firmware" partition format for GL.iNet GL-B1300")
Reported-by: Alberto Bursi <bobafetthotmail@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
>From the Documentation/devicetree/bindings/leds/common.txt:
- default-state : The initial state of the LED. Valid values are "on", "off",
and "keep". If the LED is already on or off and the default-state property is
set the to same value, then no glitch should be produced where the LED
momentarily turns off (or on). The "keep" setting will keep the LED at
whatever its current state is, without producing a glitch. The default is
off if this property is not present.
So setting the default-state of the LEDs to `off` is redundant as `off`
is default LED state anyway. We should remove it as almost every new
PR/patch submission contains this property by default which seems to be
just copy&paste from some DTS file already present in the tree.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
- replace licence texts with SPDX-License-Identifier where
applicable.
- make node-names more generic to fit with Device-Tree Release v0.2
Section 2.2.2 Generic Names Recommendation.
- utilize wifi0/1, blsp1_uart1 labels
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
In the thread: "ipq806x: add ath10k calibration data MAC addresses patching"
Chuanhong Guo <gch981213@gmail.com> noted that:
"All ath10k calibration data have a checksum at 0x2.
ath10kcal_patch_mac works for QCA9880/QCA9882 only because
the ath10k firmware for these two chips doesn't check the
checksum value. (QCA proprietary driver checks this and
refuses to use caldata with incorrect checksum.)"
This patch updates 11-ath10k-caldata of the ipq40xx target accordingly.
Reported-by: Chuanhong Guo <gch981213@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
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)
The tar extraction depends on the order in which the files
are added to the tar file. Since the order is not guaranteed
and depends on the host system, the combined mtd write fails
with sysupgrade images built on some systems.
Fix by changing to tar file order independent mtd write.
Fixes: 86e18f6706 ("ipq806x: add support for OpenMesh A42")
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
SOC: IPQ4018 / QCA Dakota
CPU: Quad-Core ARMv7 Processor rev 5 (v7l) Cortex-A7
DRAM: 256 MiB
NOR: 32 MiB
ETH: Qualcomm Atheros QCA8072
WLAN1: Qualcomm Atheros QCA4018 2.4GHz 802.11bgn 2:2x2
WLAN2: Qualcomm Atheros QCA4018 5GHz 802.11a/n/ac 2:2x2
INPUT: RESET Button
LEDS: Power, LAN, MESH, WLAN 2.4GHz, WLAN 5GHz
1. Load Ramdisk via U-Boot
To set up the flash memory environment, do the following:
a. As a preliminary step, ensure that the board console port is connected to the PC using these RS232 parameters:
* 115200bps
* 8N1
b. Confirm that the PC is connected to the board using one of the Ethernet ports. Set a static ip 192.168.99.8 for Ethernet that connects to board. The PC must have a TFTP server launched and listening on the interface to which the board is connected. At this stage power up the board and, after a few seconds, press 4 and then any key during the countdown.
U-BOOT> set serverip 192.168.99.8 && set ipaddr 192.168.99.9 && tftpboot 0x84000000 openwrt.itb && bootm
2. Load image via GUI
a. Upgrade EAP1300 to FW v3.5.3.2
In the GUI, System Manager > Firmware > Firmware Upgrade, to do upgrade.
b. Transfer to OpenWrt from EnGenius.
In Firmware Upgrade page, to upgrade yours openwrt-ipq40xx-engenius_eap1300-squashfs-sysupgrade.bin.
3. Revert to EnGenius EAP1300
To flash openwrt-ipq40xx-engenius_eap1300-squashfs-factory.bin by using sysupgrade command and "DO NOT" keep configuration.
$ sysupgrade –n openwrt-ipq40xx-engenius_eap1300-squashfs-factory.bin
Signed-off-by: Steven Lin <steven.lin@senao.com>
The NBG6617's LEDs are wrongly identified in the 01_leds boardinit
script (board instead of boardname), resulting in referencing
non-existent LEDs in UCI.
Signed-off-by: David Bauer <mail@david-bauer.net>
The BDFs for all boards were upstreamed to the ath10k-firmware
repository and linux-firmware.git.
We switched to the upstream board-2.bin, hence the files can be removed
here.
Keep the ipq-wifi package in case new boards are added. It might take
some time till board-2.bins send upstream are merged.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>