Easier to just use devm_platform_ioremap_resource.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16701
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Set the physical switch to KEY_RFKILL, since its previous value
(KEY_SETUP) is unsupported. This should also make the KEY_RESET button
functional, by allowing the gpio-button-hotplug kmod to load.
Signed-off-by: Chris Jones <cmsj@tenshu.net>
Link: https://github.com/openwrt/openwrt/pull/16564
Signed-off-by: Robert Marko <robimarko@gmail.com>
The qpic DMA controller is used by the parallel NAND Flash
interface. We don't need to enable it when nand-controller node
is marked as disabled.
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16654
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The bootloader can support zImage linux kernel which can decrease
the firmware image size.
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16662
Signed-off-by: Robert Marko <robimarko@gmail.com>
Specification
-------------
- SoC : Qualcomm IPQ4019
- RAM : 256 MiB DDR3 (NT5CC128M16JR-EK)
- Flash : 64 MiB SPI NOR (Winbond W25Q512JVFQ)
- WLAN : IPQ4019 built-in
- 2.4 GHz : 2x2 MIMO WiFi4
- 5 GHz : 2x2 MIMO WiFi5
- Ethernet : QCA8075 10/100/1000 Mbps 1x WAN (ETH1, PoE); 1x LAN (ETH2)
- USB : 1x 2.0 Type-A
- UART : 3.3V, 115200n8
- Buttons : 1x Reset
- LEDs : 1x RUN (lime & red)
1x WiFi 2.4 GHz (lime)
1x WiFi 5 GHz (lime)
2x ETH (lime), controlled by the QCA8075 phy
- Power : DC 12V & 802.3at PoE
- FCC ID : 2AHKT-WIA3300-20
- TFTP IP :
- client : 192.168.18.254
- router : 192.168.18.1
Installation
------------
1. Open uart console and start TFTP server. Copy initramfs image to
the TFTP root directory and rename it to 'ipqinitramfs.bin'.
2. Power on and press 'Enter' to exit to the u-boot console according
to the TTL log prompt.
3. Execute commands to load the initramfs image:
tftpboot && bootm
4. Enter into OpenWrt to backup the partitions if you want to restore
the stock firmware one day.
5. Override default 'bootcmd' environment variable in u-boot console:
env set bootcmd 'sf probe && sf read $loadaddr 0x980000 0x800000 && bootm $loadaddr'
env save
6. Repeat step 3 and flash 'sysupgrade' image in OpenWrt.
Recovery and return to stock
----------------------------
1. Restore the backup firmware partitions in the installation step 4.
2. Restore `bootcmd` environment variable via commands:
env set bootcmd bootipq && env save
MAC addresses
-------------
+---------+-------------------+
| | MAC example |
+---------+-------------------+
| LABEL | xx:xx:xx:xx:xx:25 |
| LAN | xx:xx:xx:xx:xx:26 |
| WAN | xx:xx:xx:xx:xx:25 |
| WLAN 2g | xx:xx:xx:xx:xx:28 |
| WLAN 5g | xx:xx:xx:xx:xx:29 |
+---------+-------------------+
Notice
-----------
1. Some CH340 USB-TTL module doesn't work on this device.
2. The 'firmware' partition consists of four parts in the vendor
layout:
* Name Start Size
* rootfs 0x980000 0x1680000
* 0:HLOS1 0x2000000 0x800000
* rootfs_1 0x2800000 0x1400000
* rootfs_data 0x3c00000 0x350000
3. User can control the USB power supply via commands:
echo enabled > /sys/devices/platform/output-usb-power/state
echo disabled > /sys/devices/platform/output-usb-power/state
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16476
Signed-off-by: Robert Marko <robimarko@gmail.com>
It can be used to control the power on/off status for the fixed
voltage regulator via sysfs.
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16476
Signed-off-by: Robert Marko <robimarko@gmail.com>
...conversion.
Commit 20736013e9 ("kernel: backport nvmem v6.6 fixes and v6.7 changes")
has causedt he device to no longer correctly read MAC address from its
onboard 24c64 EEPROM, because "at24" driver doesn't support legacy
nvmem-cell bindings [1] - and there was an explicit config option added
to mandate that behaviour in the following patch:
820-v6.7-0002-nvmem-add-explicit-config-option-to-read-old-syntax-.patch
But some of the devices, MR33 and MR74 included, weren't converted with
that as well.
Convert the definition to use proper fixed-layout binding to fix it.
The offending change was introduced between v23.05.0 and v23.05.1, and
found by bisection:
git bisect start
# status: waiting for both good and bad commits
# good: [bd4f415efa] OpenWrt v23.05.0: adjust config defaults
git bisect good bd4f415efa
# status: waiting for bad commit, 1 good commit known
# bad: [a58a86693f] OpenWrt v23.05.1: adjust config defaults
git bisect bad a58a86693f
# good: [3d0a78add2] qualcommax: only build initramfs if CONFIG_TARGET_ROOTFS_INITRAMFS is set
git bisect good 3d0a78add2
# bad: [21e5db97c4] build: add CycloneDX SBOM JSON support
git bisect bad 21e5db97c4
# good: [89184b15cf] mediatek: add build for MT7981 RFB
git bisect good 89184b15cf
# bad: [41f27bbb6d] bcm53xx: add the latest fix version of brcm_nvram
git bisect bad 41f27bbb6d
# good: [b649b0bf71] kernel: nvmem: fix "fixed-layout" & support "mac-base"
git bisect good b649b0bf71
# bad: [20736013e9] kernel: backport nvmem v6.6 fixes and v6.7 changes
git bisect bad 20736013e9
# good: [066971615f] kernel: backport v6.6 nvmem changes
git bisect good 066971615f
# first bad commit: [20736013e9] kernel: backport nvmem v6.6 fixes and v6.7 changes
Link: [1] https://github.com/openwrt/openwrt/issues/15393#issuecomment-2212300849
Fixes: 20736013e9 ("kernel: backport nvmem v6.6 fixes and v6.7 changes")
Fixes: https://github.com/openwrt/openwrt/issues/15393
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16623
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add the GPIO pin of the PoE passthrough switch on the Aruba AP-303H.
Power is activated when the pin is low. It enables a PSE chip, so power
is only supplied to downstream devices when they are 802.3af/at
compliant devices.
Ensure you use a sufficient power supply when chaining a consuming
device after the AP.
Signed-off-by: David Bauer <mail@david-bauer.net>
Aruba boards now ship with multiple DTS and image-configurations per
image. Newer apboot revs expect a configuration for their hardware to be
present.
Signed-off-by: David Bauer <mail@david-bauer.net>
The company Zyxel rebranded some years ago.
Currently the casing is according to the old branding even
for newer devices which already use the new branding.
This commit aligns the casing of Zyxel everywhere.
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15652
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This target doesn't actually use NAND.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16001
Signed-off-by: Robert Marko <robimarko@gmail.com>
BDFs come from latest firmware, version 1.1.19.209880 (2022-06-20):
- /lib/firmware/IPQ4019/v1/FCC/boardData_1_0_IPQ4019_DK04_2G.bin
- /lib/firmware/IPQ4019/v1/FCC/boardData_1_0_IPQ4019_DK04_5G.bin
- /lib/firmware/QCA9888/v1/FCC/boardData_2_0_QCA9888_5G_Y9690_SBS_HB.bin
Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15844
Signed-off-by: Robert Marko <robimarko@gmail.com>
Currently, only the WAN MAC is being populated on Habanero DVK, and that is
happening via the ethernet1 alias so U-Boot does it, previously ethernet0
was implicitly added in the SoC DTSI so it would populate the LAN MAC-s but
it was dropped(rightly so) so now LAN MAC-s and the GMAC one are random.
So, lets simply switch to using NVMEM to assign the proper MAC adresses.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Notify via dev_info when a random MAC address is set.
of_get_ethdev_address can return -EPROBE_DEFER for NVMEM devices,
return this up, so that ipqess can defer as well.
Also move this MAC assignment from _init into _probe, so that this defer
can happen earlier.
Before change, with MAC address allocated from a built-in NVMEM layout
driver (mikrotik,routerboot-nvmem) with extra of_get_ethdev_address
result and random MAC printfs:
[ 1.197571] ipqess-edma c080000.ethernet: ipqess_init of_get_ethdev_address ret:-517, of_node: /soc/ethernet@c080000
[ 1.197690] ipqess-edma c080000.ethernet: generated random MAC address 22:e7:36:e0:e4:a3
[ 1.614444] ipqess-edma c080000.ethernet eth0: entered promiscuous mode
[ 5.055929] ipqess-edma c080000.ethernet eth0: configuring for fixed/internal link mode
after change:
[ 1.173776] ipqess-edma c080000.ethernet: of_get_ethdev_address: -517
[ 1.614607] ipqess-edma c080000.ethernet eth0: entered promiscuous mode
[ 5.246105] ipqess-edma c080000.ethernet eth0: configuring for fixed/internal link mode
[ 5.260754] ipqess-edma c080000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
with extra __func__ printf to show _probe and _init:
[ 1.173685] ipqess-edma c080000.ethernet: ipqess_axi_probe
[ 1.173784] ipqess-edma c080000.ethernet: of_get_ethdev_address: -517
[ 1.280347] ipqess-edma c080000.ethernet: ipqess_axi_probe
[ 1.304844] ipqess-edma c080000.ethernet: ipqess_init
[ 1.614664] ipqess-edma c080000.ethernet eth0: entered promiscuous mode
Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
Link: https://github.com/openwrt/openwrt/pull/15831
Signed-off-by: Robert Marko <robimarko@gmail.com>
Currently, information from MikroTik hard_config is only available via
sysfs, meaning that we have to rely on userspace to for example setup MACs.
So, lets provide a basic NVMEM layout based driver to expose the same cells
as sysfs driver exposes.
Do note that the we dont extract the WLAN caldata and BDF-s at this point.
Reviewed-by: Thibaut VARÈNE <hacks@slashdirt.org>
Link: https://github.com/openwrt/openwrt/pull/15665
Signed-off-by: Robert Marko <robimarko@gmail.com>
Since the introduction of out-of-band tagging, writing the outbound tag
had been completely broken: First, in place of a port mask containing
the port number, just the port number itself was set in the register
value. Just after that, the full port mask 0x3e (all 5 external ports)
was set unconditionally.
This remained unnoticed because the switch would then use the FDB to
decide where to send unicast packets; broadcast and multicast packets
were however sent to every port.
Fix the port tag computation and only use the full port mask as a
fallback for non-DSA mode, as it was done in the older driver patches
used on Linux 5.15.
Fixes: cd9c721124 ("ipq40xx: 6.1: use latest DSA and ethernet patches")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: Robert Marko <robimarko@gmail.com>
gpio is deprecated. Found with dtc's -Wdeprecated_gpio_property
Used git grep -E $'\tgpio = <' to make the changes.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15681
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
The bump to kernel 6.6 increased the GPIO base from
412 to 512 on this target.
We need to compensate for that in the GPIO numbers being passed
to uci to fix following kernel report:
[ 24.176183] export_store: invalid GPIO 423
Tested on a Wallys DR40x9 board.
Please note that:
Boards "rtl30vw" and "wpj428" are not being altered here.
They define GPIO numbers which are even below the previous
base of 412 which looks wrong.
Actual testing on these boards should be conducted to validate
and optionally fix GPIO numbering.
Suggested-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
All NETGEAR EX6150v2 validate the rootfs for which OpenWrt places a
fakeheader at the position, where the bootloader expects it.
Some EX6150v2 bootloaders do however make a broken assumption about
where the rootfs starts. This is due to them calculating the rootfs
start not based upon the kernel-length but the string-offset of the
FIT-image.
We have to be compatible with both this broken as well as the valid
calculation. So we do relocate the FDT string section to a
block-boundary and enlarge the FIT image to end at this boundary +
BLOCKSIZE / 2. This way, both the broken as well as correct calculations
do expect the rootfs-header at the same position.
It is worth noting, that this is a rare edge-case in which only happens
if the image-length as well as the start of the string-section are not
placed in the same erase-block. This is an edge-case which happens very
rarely (thus it was not spotted prior).
Affected:
- U-Boot 2012.07 (Jun 16 2016 - 11:59:37)
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 8f9546f7b0a14f3afa813e39ed45c968ece24464)
The Yafut tool now has limited capabilities for working on filesystem
images stored in regular files. This enables preparing Yaffs2 images
for devices with NOR flash using upstream Yaffs2 filesystem code instead
of the custom kernel2minor tool.
Since minimizing the size of the resulting filesystem image size is
important and upstream Yaffs2 code requires two allocator reserve blocks
to be available when writing a file to the filesystem, a trick is
employed while preparing an OpenWRT image: the blank filesystem image
that Yafut operates on initially contains two extra erase blocks that
are chopped off after the kernel file is written. This is safe to do
because Yaffs2 has a true log structure and therefore only ever writes
sequentially (and the size of the kernel file is known beforehand).
While the two extra erase blocks are necessary for writes, Yaffs2 code
seems to be perfectly capable of reading back files from a "truncated"
filesystem that does not contain these extra erase blocks.
In terms of image size, this new approach is only marginally worse than
the current kernel2minor-based one: specifically, upstream Yaffs2 code
needs to write three object headers (each of which takes up an entire
data chunk) when the kernel file is written to the filesystem:
- an object header for the kernel file when it is created,
- an object header for the root directory when the kernel file is
created,
- an updated object header for the kernel file when the latter is
fully written (so that its new size can be recorded).
kernel2minor only writes two of these headers, which is the absolute
minimum required for reading the file back. This means that the
Yafut-based approach causes firmware images to be at most one erase
block (64 kB) larger than those created using kernel2minor, but only in
the very unfortunate scenario where the size of the kernel file is
really close to a multiple of the erase block size.
The rest of the calculations performed when the empty filesystem image
is first prepared stems from the Yaffs2 layout used by MikroTik NOR
devices: each 65,536-byte erase block contains 63 chunks, each of which
consists of 1024 bytes of data followed by 16-byte Yaffs tags without
ECC data; each such group of 63 chunks is then followed by 16 bytes of
padding, which translates to "-C 1040 -B 64k -E" in the Yafut
invocation. Yaffs2 checkpoints and summaries are disabled (using
Yafut's -P and -S switches, respectively) as they are merely performance
optimizations that require extra storage space. The -L and -M switches
are used to force little-endian or big-endian byte order (respectively)
in the resulting filesystem image, no matter what byte order the build
host uses. The tr invocation is used to ensure that the filesystem
image is initialized with 0xFF bytes (which are an indicator of unused
space for Yaffs2 code).
Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
Link: https://github.com/openwrt/openwrt/pull/13453
Signed-off-by: Robert Marko <robimarko@gmail.com>
Instead of extracting WiFi precal as well as MAC addresses in userspace
use recently introduced NVMEM-on-UBI instead.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Tested-by: Christian Lamparter <chunkeey@gmail.com>
The EnGenius EAP1300 and EAP1300EXT use identical boards and firmware
(as flashed) from the vendor.
As with the EAP1300, the EAP1300EXT requires a specific firmware version
to flash OpenWRT. Unfortunately, the required firmware is truncated on
the vendor's website.
A working file can be created as follows:
```
curl \
https://www.engeniustech.com/wp_firmware/eap1300-all-v3.5.3.5_c1.9.04.bin \
| perl -pe 's/\x09EAP1300_A/\x0cEAP1300EXT_A/' \
> eap1300ext-all-v3.5.3.5_c1.9.04.bin
```
The file should have sha256:
`58a1197a426139a12b03fd432334e677124cbe3384349bd7337f2ee71f1dcfd4`.
Please see commit 2b4ac79 for further
details.
The vendor firmware must be decrypted before it can be flashed from
OpenWRT. A tool able to do that is available from:
https://github.com/ryancdotorg/enfringement/blob/main/decrypt.py
Signed-off-by: Ryan Castellucci <code@ryanc.org>
Currently, in case that PSGMII calibration fails it will panic the kernel
which is not ideal and is preventing any debugging to be done.
So, since PGMII calibration failing only means that wired networking wont
work lets convet the panic() call to dev_error.
Link: https://github.com/openwrt/openwrt/pull/15542
Signed-off-by: Robert Marko <robimarko@gmail.com>
Like AVM 1200 these devices also do not use QCA807x PHY at all and thus
they disables all of the individual PHY nodes, however this is not enough
anymore since the conversion to PHY package.
Now its now enough to disable the PHY-s in the package alone, but the PHY
package node itself must also be disabled.
Fixes: 1b931c33a2 ("ipq40xx: adapt to new Upstream QCA807x PHY driver")
Link: https://github.com/openwrt/openwrt/pull/15444
Signed-off-by: Robert Marko <robimarko@gmail.com>
WPJ419 is still manually defining SPI node, so lets
convert it to use the existing upstream labels for SPI node.
Link: https://github.com/openwrt/openwrt/pull/15415
Signed-off-by: Robert Marko <robimarko@gmail.com>
WPJ419 is still manually defining pinctrl node, so lets
convert it to use the existing upstream labels for pinctrl node.
Link: https://github.com/openwrt/openwrt/pull/15415
Signed-off-by: Robert Marko <robimarko@gmail.com>
WPJ419 is still manually defining PCIe node, so lets
convert it to use the existing upstream labels for PCIe node and while we
are here use the -gpios suffix instead.
Link: https://github.com/openwrt/openwrt/pull/15415
Signed-off-by: Robert Marko <robimarko@gmail.com>
Some boards are still defining MDIO nodes under soc instead of using the
existing upstream labels to reference them so convert them.
Link: https://github.com/openwrt/openwrt/pull/15415
Signed-off-by: Robert Marko <robimarko@gmail.com>
Some boards are still defininig I2C nodes under soc instead of using the
existing upstream labels to reference them so convert them.
Link: https://github.com/openwrt/openwrt/pull/15415
Signed-off-by: Robert Marko <robimarko@gmail.com>
Some boards are still defininig UART nodes under soc instead of using the
existing upstream labels to reference them so convert them.
Link: https://github.com/openwrt/openwrt/pull/15415
Signed-off-by: Robert Marko <robimarko@gmail.com>
This device does not have NAND enabled at all and NAND is the only consumer
of QPIC BAM DMA, so drop the node.
Link: https://github.com/openwrt/openwrt/pull/15415
Signed-off-by: Robert Marko <robimarko@gmail.com>
WPJ419 is still manually defining dma nodes(And even some labels), so lets
convert it to use the existing upstream labels for DMA nodes.
Link: https://github.com/openwrt/openwrt/pull/15415
Signed-off-by: Robert Marko <robimarko@gmail.com>
Currently, a lot of boards are still not using the existing label to
reference the crypto node, so lets rectify this.
Link: https://github.com/openwrt/openwrt/pull/15415
Signed-off-by: Robert Marko <robimarko@gmail.com>
Currently, a lot of boards are still not using the existing label to
reference the prng node, so lets rectify this.
Link: https://github.com/openwrt/openwrt/pull/15415
Signed-off-by: Robert Marko <robimarko@gmail.com>
Currently, a lot of boards are still not using the existing label to
reference the watchdog node, so lets rectify this.
Link: https://github.com/openwrt/openwrt/pull/15415
Signed-off-by: Robert Marko <robimarko@gmail.com>
Now that DSA is enabled and the MAC addresses are set properly, we can
use it.
Signed-off-by: Corey Minyard <minyard@acm.org>
Link: https://github.com/openwrt/openwrt/pull/15358
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
The code that was there was just taking whatever was left in the
registers, which was just wrong. Set the addresses using the value from
the u-boot environment, the same way the OEM firmware does.
Signed-off-by: Corey Minyard <minyard@acm.org>
Link: https://github.com/openwrt/openwrt/pull/15358
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit converts the EAP1300 to DSA setup.
Signed-off-by: Corey Minyard <minyard@acm.org>
Link: https://github.com/openwrt/openwrt/pull/15358
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
It's needed to get the MAC addresses for the Engenius EAP1300.
Signed-off-by: Corey Minyard <minyard@acm.org>
Link: https://github.com/openwrt/openwrt/pull/15358
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Commit 6136ebabc5 ("ipq40xx: 6.6: fix DTS to use reference for usb
node") fixed only some of the reference to USB node but many others were
still using the old broken usb3/usb2. Fix every reference to those node
and move them on using the tag name.
Fixes: 6136ebabc5 ("ipq40xx: 6.6: fix DTS to use reference for usb node")
Link: https://github.com/openwrt/openwrt/pull/15392
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
No changes other than the merging itself are intended in this commit.
Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15345
Signed-off-by: Robert Marko <robimarko@gmail.com>
Apply stylistic changes to facilitate DTS merging with WHW03 V1.
Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15345
Signed-off-by: Robert Marko <robimarko@gmail.com>