Commit Graph

551 Commits

Author SHA1 Message Date
Lech Perczak
1a49b499f1 ipq40xx: dts: remove leftover nodes after DSA conversion
Remove ess-psgmii@98000, edma@c080000 and ess-switch@c000000 nodes.
These nodes are not used after the DSA conversion, but were left over
in a few devices added recently.

ZTE MF289F is omitted on purpose, as for it, these nodes will be removed
together with DSA conversion.

Build tested only, as I only have MF286D from those devices.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2022-11-13 15:31:54 +01:00
Sven Eckelmann
fc69532eb9 ipq40xx: Convert plasmacloud,pa2200 to DSA
* ethernet1:

  - physical port label "Ethernet 1"
  - its mac address is printed on the device label

* ethernet2:

  - physical port label "Ethernet 2"
  - can be used to power the device

Both ports are not marked by there role (because the vendor firmware
automatically detects roles) but the "Ethernet 2" port was used in the past
for "WAN" functionality in OpenWrt.

Tested-by: Michaël BILCOT <michael.bilcot@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-11-13 15:26:34 +01:00
Sven Eckelmann
ce6c9e0328 ipq40xx: utilize nvmem-cells for plasmacloud,pa2200
The calibration data and mac addresses on this device are stored in the
0:ART partition. It is therefore possible to move the code to handle them
directly to the devicetree instead of the various scripts.

But the actual relevant information about the partition layout is provided
by the bootloader via bootargs (mtdparts) and not via the devicetree
itself. Instead of using a fixed-partition template, the mtd dynamic
partitions support from the upstream kernel is used.

Reported-by: Robert Marko <robert.marko@sartura.hr>
Tested-by: Michaël BILCOT <michael.bilcot@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-11-13 15:26:34 +01:00
Sven Eckelmann
539a5fd624 ipq40xx: Convert plasmacloud,pa1200 to DSA
* ethernet1:

  - physical port label "Ethernet 1"
  - its mac address is printed on the device label

* ethernet2:

  - physical port label "Ethernet 2"
  - can be used to power the device

Both ports are not marked by there role (because the vendor firmware
automatically detects roles) but the "Ethernet 2" port was used in the past
for "WAN" functionality in OpenWrt.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-11-13 15:26:34 +01:00
Sven Eckelmann
b8bda645fc ipq40xx: utilize nvmem-cells for plasmacloud,pa1200
The calibration data and mac addresses on this device are stored in the
0:ART partition. It is therefore possible to move the code to handle them
directly to the devicetree instead of the various scripts.

But the actual relevant information about the partition layout is provided
by the bootloader via bootargs (mtdparts) and not via the devicetree
itself. Instead of using a fixed-partition template, the mtd dynamic
partitions support from the upstream kernel is used.

Reported-by: Robert Marko <robert.marko@sartura.hr>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-11-13 15:26:34 +01:00
Sven Eckelmann
087a8e39be ipq40xx: utilize nvmem-cells for openmesh,a62
The calibration data and mac addresses on this device are stored in the
0:ART partition. It is therefore possible to move the code to handle them
directly to the devicetree instead of the various scripts.

But the actual relevant information about the partition layout is provided
by the bootloader via bootargs (mtdparts) and not via the devicetree
itself. Instead of using a fixed-partition template, the mtd dynamic
partitions support from the upstream kernel is used.

Reported-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Robert Marko <robimarko@gmail.com>
Tested-by: Michaël BILCOT <michael.bilcot@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-11-12 18:15:55 +01:00
Sven Eckelmann
2b2f14c959 ipq40xx: utilize nvmem-cells for openmesh,a42
The calibration data and mac addresses on this device are stored in the
0:ART partition. It is therefore possible to move the code to handle them
directly to the devicetree instead of the various scripts.

But the actual relevant information about the partition layout is provided
by the bootloader via bootargs (mtdparts) and not via the devicetree
itself. Instead of using a fixed-partition template, the mtd dynamic
partitions support from the upstream kernel is used.

Reported-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-11-12 18:15:55 +01:00
Sven Eckelmann
c6bef1b83a ipq40xx: Convert openmesh,a62 to DSA
* ethernet1:

  - physical port label "Ethernet 1"
  - can be used to power the device
  - its mac address is printed on the device label

* ethernet2:

  - physical port label "Ethernet 2"

Both ports are not marked by there role (because the vendor firmware
automatically detects roles) but the "Ethernet 1" port was used in the past
for "WAN" functionality in OpenWrt.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Tested-by: Michaël BILCOT <michael.bilcot@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-11-12 18:15:55 +01:00
Sven Eckelmann
66a3c32b47 ipq40xx: Convert openmesh,a42 to DSA
* ethernet1:

  - physical port label "Ethernet 1"
  - can be used to power the device
  - its mac address is printed on the device label

* ethernet2:

  - physical port label "Ethernet 2"

Both ports are not marked by there role (because the vendor firmware
automatically detects roles) but the "Ethernet 1" port was used in the past
for "WAN" functionality in OpenWrt.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-11-12 18:15:55 +01:00
Guillaume Lefebvre
65d9a715fc ipq40xx: D-Link DAP-2610: convert to DSA
Reenable D-Link DAP-2610, convert it to DSA and label port to 'lan', as shown on the case

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Guillaume Lefebvre <guillaume@zelig.ch>
2022-11-12 18:15:55 +01:00
Weiping Yang
9945d05171 ipq40xx: add support for GL.iNet GL-A1300
Specifications:
SOC:		Qualcomm IPQ4018 (DAKOTA) ARM Quad-Core
RAM:		256 MiB
FLASH1:		4 MiB NOR
FLASH2:		128 MiB NAND
ETH:		Qualcomm QCA8075
WLAN1:		Qualcomm Atheros QCA4018 2.4GHz 802.11b/g/n 2x2
WLAN2:		Qualcomm Atheros QCA4018 5G 802.11n/ac W2 2x2
USB:		1 x USB 3.0 port
Button:		1 x Reset button
Switch:		1 x Mode switch
LED:		1 x Blue LED + 1 x White LED

Install via uboot tftp or uboot web failsafe.

By uboot tftp:
(IPQ40xx) # tftpboot 0x84000000 openwrt-ipq40xx-generic-glinet_gl-a1300-squashfs-nand-factory.ubi
(IPQ40xx) # nand erase 0 0x8000000
(IPQ40xx) # nand write 0x84000000 0 $filesize

By uboot web failsafe:
Push the reset button for 10 seconds util the power led flash faster,
then use broswer to access http://192.168.1.1

Afterwards upgrade can use sysupgrade image.

Signed-off-by: Weiping Yang <weiping.yang@gl-inet.com>
2022-11-09 23:34:37 +01:00
Csaba Sipos
cc8b8f1b41 ipq40xx: add support for MikroTik hAP ac3 LTE6 kit
This adds support for the MikroTik RouterBOARD RBD53GR-5HacD2HnD
(hAP ac³ LTE6 kit), an  indoor dual band, dual-radio 802.11ac
wireless AP with built-in Mini PCI-E LTE modem, one USB port, five
10/100/1000 Mbps Ethernet ports.

See https://mikrotik.com/product/hap_ac3_lte6_kit for more info.

Specifications:
 - SoC: Qualcomm Atheros IPQ4019
 - RAM: 256 MB
 - Storage: 16 MB NOR
 - Wireless:
   · Built-in IPQ4019 (SoC) 802.11b/g/n 2x2:2, 3 dBi internal antennae
   · Built-in IPQ4019 (SoC) 802.11a/n/ac 2x2:2, 5.5 dBi internal antennae
 - Ethernet: Built-in IPQ4019 (SoC, QCA8075) , 5x 1000/100/10 port
 - 1x USB Type A port
 - 1x Mini PCI-E port (supporting USB)
 - 1x Mini PCI-E LTE modem (MikroTik R11e-LTE6, Cat.6)

Installation:

Make sure your unit is runnning RouterOS v6 and RouterBOOT v6 (tested on 6.49.6).

0. Export your MikroTik license key (in case you want to use the device with RouterOS later)
1. Boot the initramfs image via TFTP
2. Upload the "openwrt-ipq40xx-mikrotik-mikrotik_hap-ac3-lte6-kit-squashfs-sysupgrade.bin" via SCP to the /tmp folder
3. Use sysupgrade to flash the image: sysupgrade -n /tmp/openwrt-ipq40xx-mikrotik-mikrotik_hap-ac3-lte6-kit-squashfs-sysupgrade.bin
4. Recovery to factory software is possible via Netinstall:
   https://help.mikrotik.com/docs/display/ROS/Netinstall

Signed-off-by: Csaba Sipos <metro4@freemail.hu>
2022-10-30 23:14:45 +01:00
John Audia
a34255b795 kernel: bump 5.15 to 5.15.75
Removed upstreamed:
   bcm27xx/patches-5.15/950-0446-drm-vc4-Fix-timings-for-VEC-modes.patch[1]

Manually rebased:
   patches-5.15/950-0600-xhci-quirks-add-link-TRB-quirk-for-VL805.patch
   bcm27xx/patches-5.15/950-0606-usb-xhci-add-VLI_TRB_CACHE_BUG-quirk.patch
   bcm27xx/patches-5.15/950-0717-usb-xhci-add-a-quirk-for-Superspeed-bulk-OUT-transfe.patch
   bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch

All other patches automatically rebased

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.75&id=2810061452f9b748b096ad023d318690ca519aa3

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-10-30 17:54:59 +01:00
John Audia
aa2fa2eb76 kernel: bump 5.10 to 5.10.150
Manually rebased:
  bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch

All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
[Move gro_skip in 680-NET-skip-GRO-for-foreign-MAC-addresses.patch to old position]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-10-30 17:52:42 +01:00
Davide Fioravanti
8d921167e9
ipq40xx: convert to DSA and enable Netgear Orbi devices
Convert to DSA and enable again Netgear Orbi devices:
 - RBR50
 - RBS50
 - SRR60
 - SRS60

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
2022-10-25 02:34:46 +02:00
Brian Norris
a3da858ab0 ipq40xx: Convert Google Wifi to DSA, reenable
Undo parts of these:

116feb4a1c ipq40xx: remove non-converted network configs
db19efee95 ipq40xx: disable boards not converted to DSA

Reintroduce the DT paths /soc/edma@c080000/gmac{0,1}, because the stock
bootloader has memorized them (instead of following aliases); then plug
the MAC address back in via 05_set_iface_mac_ipq40xx.sh, since the
'local-mac-address' property is no longer in the correct node.

Cc: David Bauer <mail@david-bauer.net>
Cc: Robert Marko <robert.marko@sartura.hr>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2022-10-23 08:27:40 +02:00
Jack Chen
57577bb8cc ipq40xx: convert to DSA and enable mobipromo,cm520-79f
Convert to DSA and enable the MobiPromo CM520-79F device again.

Signed-off-by: Jack Chen <redchenjs@live.com>
Reviewed-by: Robert Marko <robimarko@gmail.com>
2022-10-23 01:45:52 +02:00
Chen Minqiang
3505933073 ipq40xx: convert to DSA and enable asus,rt-ac42u
This convert board asus,rt-ac42u to DSA and re-enable it

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2022-10-22 20:09:58 +08:00
Mark Mentovai
9a8e008188 ipq40xx: Convert mikrotik,wap-ac to DSA
As done previously, this preserves the MAC addresses of they physical
Ethernet ports. The interfaces are renamed as eth0 is in use for the
native GMAC; the new interface naming matches the physical port labels.
 - sw-eth1 corresponds to the physical port labeled ETH1 and has the
   base MAC address. This port can be used to power the device.
 - sw-eth2 corresponds to the physical port labeled ETH2 and has a MAC
   address one greater than the base.

As this device has 2 physical ports, they are each connected to their
respective PHYs, allowing the link status to be visible to software.
Since they are not marked on the case with any role (such as LAN or
WAN), both are bridged to the lan network by default, although this can
easily be changed if needed.

Signed-off-by: Mark Mentovai <mark@mentovai.com>
2022-10-19 22:58:12 +02:00
Giammarco Marzano
cd93980abb
ipq40xx: Fix wrong GPIO for internal status LED on ZTE MF289F
Change GPIO from 10 to 35 to make it works as expected

Fixes: 0de6a3339f ("ipq40xx: Add ZTE MF289F")
Signed-off-by: Giammarco Marzano <stich86@gmail.com>
Reviewed-by: Robert Marko <robimarko@gmail.com>
2022-10-12 00:59:39 +02:00
INAGAKI Hiroshi
32e41ba18a ipq40xx: convert to DSA and enable Sony NCP-HG100/Cellular
This patch converts networking on Sony NCP-HG100/Cellular to DSA and
re-enables support for the device.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-10-09 22:45:06 +02:00
Dirk Buchwalder
579ea6b970 ipq40xx: ZTE MF289F: convert to DSA
Convert ZTE MF289F device to DSA, re-order network ports to match the
labels on the case and re-enable the device.

Signed-off-by: Dirk Buchwalder <buchwalder@posteo.de>
Reviewed-by: Robert Marko <robimarko@gmail.com>
Reviewed-by: Lech Perczak <lech.perczak@gmail.com>
2022-10-09 22:39:48 +02:00
John Audia
9110126620 kernel: bump 5.15 to 5.15.72
Removed upstreamed:
  generic/pending-5.15/722-net-mt7531-only-do-PLL-once-after-the-reset.patch[1]
  bcm53xx/patches-5.15/082-v6.0-clk-iproc-Do-not-rely-on-node-name-for-correct-PLL-s.patch[2]

All other patches automatically rebased

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200, mvebu/cortexa72
Run-tested: bcm2711/RPi4B, mt7622/RT3200, mvebu/cortexa72 (RB5009UG+S+IN)

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.72&id=5de02ab84aeca765da0e4d8e999af35325ac67c2
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.72&id=ab5c5787ab5ecdc4a7ea20b4ef542579e1beb49d

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-10-09 22:26:16 +02:00
Tomasz Maciej Nowak
ee38573093
ipq40xx: pakedge_wr-1: convert to DSA
Convert pakedge_wr-1 device to DSA and enable it.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Reviewed-by: Robert Marko <robimarko@gmail.com>i
[ improve commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-10-05 19:16:52 +02:00
Tomasz Maciej Nowak
70d9193b51
ipq40xx: luma_wrtq-329acn: convert to DSA
Convert luma_wrtq-329acn device to DSA and enable it.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Reviewed-by: Robert Marko <robimarko@gmail.com>
[ improve commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-10-05 19:10:28 +02:00
Petr Štetiar
606eb43b72 ipq40xx: glinet-b1300: fix LAN and WAN MAC address assigments
When testing the DSA changes with 5.15.60 kernel, I've noticed, that the
MAC addresses are not properly configured, there is single MAC being
used for LAN and WAN interfaces:

 eth0: 94:83:c4:XX:YY:4a (MAC on sticker)
 lan1@eth0: 94:83:c4:XX:YY:4a
 lan2@eth0: 94:83:c4:XX:YY:4a
 wan@eth0: 94:83:c4:XX:YY:4a
 wlan0: 94:83:c4:XX:YY:4a
 wlan1: 94:83:c4:XX:YY:4b

The same config, prior to the DSA conversion:

 lan/eth0: 94:83:c4:XX:YY:4a (MAC on sticker)
 wan/eth1: 94:83:c4:XX:YY:4b
 wlan0: 94:83:c4:XX:YY:4a
 wlan1: 94:83:c4:XX:YY:4b

Settings in ART partition:

 root@OpenWrt:/# hexdump -C /dev/mtd7 | grep '94 83'
 00000000  94 83 c4 XX YY 4a 94 83  c4 0e YY 4b ff ff ff ff  |.....J.....K....|
 00001000  20 2f 8d 8c 01 01 94 83  c4 XX YY 4a 00 00 20 00  | /.........J.. .|
 00005000  20 2f 5a 3a 01 01 94 83  c4 XX YY 4b 00 00 20 00  | /Z:.......K.. .|

So let's fix it by keeping same MAC address assigment as was done before
DSA conversion and while at it, define `label-mac-device` as well.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-10-03 08:06:43 +02:00
David Bauer
db19efee95 ipq40xx: disable boards not converted to DSA
Signed-off-by: David Bauer <mail@david-bauer.net>
2022-10-02 23:04:39 +02:00
Robert Marko
116feb4a1c ipq40xx: remove non-converted network configs
Remove networking configs for non DSA converted boards in ipq40xx.
Currently, they are just causing clutter.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:39 +02:00
Robert Marko
132545785b ipq40xx: ipqess: enable threaded NAPI
Enable threaded NAPI by default in IPQESS driver as it significantly
improves network perfromance, in my testing about 100+ Mbps in WAN-LAN
routing.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:39 +02:00
Lech Perczak
b9b4c51b2b ipq40xx: Meraki MR33: convert MAC addresses to nvmem
This fixes assigning random MAC to br-lan interface upon boot.
While at that, rename at24@50 node to eeprom@50, to align with upstream
device tree style.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2022-10-02 23:04:39 +02:00
Robert Marko
550253bdf9 ipq40xx: convert some boards to DSA
Convert IPQ40xx boards to DSA setup.

Signed-off-by: Leon M. George <leon@georgemail.eu>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Signed-off-by: Nick Hainke <vincent@systemli.org>
Signed-off-by: ChunAm See <z1250747241@gmail.com>
Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
Signed-off-by: Andrew Sim <andrewsimz@gmail.com>
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:39 +02:00
Serhii Serhieiev
ad9ecd33cc ipq40xx: qca8k: introduce proper PSGMII calibration
Serhii and others have experienced PSGMII link degradation up to point
that it actually does not pass packets at all or packets arrive as zeros.
This usually happened after a couple of hot reboots.

Serhii has managed to track it down to PSGMII calibration not being done
properly and has fixed it, so all of the code is Serhii-s work.

Signed-off-by: Serhii Serhieiev <adron@mstnt.com>
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:39 +02:00
Robert Marko
f5c62c6e91 ipq40xx: qca807x: drop kernel version checks
Since kernel 5.4 has been droppped from IPQ40xx, there is no need to keep
the version checks for kernels older than 5.10.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:39 +02:00
Serhii Serhieiev
12eebe8871 ipq40xx: qca807x: add suspend and resume ops
Currently, suspend and resume ops are not present, this means that if user
disables a DSA interface that the PHY-s remain alive and the link is up.

Fix it by using generic PHY suspend and resume ops.

Signed-off-by: Serhii Serhieiev <adron@mstnt.com>
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:39 +02:00
Robert Marko
5293c08290 ipq40xx: sxtsq-5-ac: correct TCSR ESS type
SXTsq 5 ac uses RGMII on the port 5 and not PSGMII, so correct the TCSR
interface type property.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:38 +02:00
Robert Marko
a4470685ac ipq40xx: enable ethernet and DSA driver combo
Select the Ethernet driver, DSA tag driver and the DSA driver itself to
be built in the kernel config.
They automatically pull in switchdev and phylink.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:38 +02:00
Robert Marko
b1f21329d4 ipq40xx: add DSA switch driver
Qualcomm IPQ40xx SoC-s have a variant of QCA8337N switch built-in.

It shares most of the stuff with its external counterpart, however it is
modified for the SoC.
Namely, it doesn't have second CPU port (Port 6), so it has 6 ports
instead of 7.
It also has no built-in PHY-s but rather requires external PSGMII based
companion PHY-s (QCA8072 and QCA8075) for which it first needs to carry
out calibration before using them.
PSGMII has a SoC built-in PHY that is used to connect to the PHY-s which
unfortunately requires some magic values as the datasheet doesnt document
the bits that are being set or the register at all.

Since its built-in it is MMIO like other peripherals and doesn't have its
own MDIO bus but depends on the SoC provided one.

CPU connection is at Port 0 and it uses some kind of a internal connection
and no traditional RGMII/SGMII.
It also doesn't use in-band tagging like other qca8k switches so a shinfo
based tagger is used.

This is based on the current OpenWrt qca8k version that has been imported
from generic target.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:38 +02:00
Robert Marko
28b13bb157 ipq40xx: import qca8k from generic
This is just importing the qca8k driver from the generic target.
It will be used as the based for IPQ40xx version, this is just
to be able to see the diff.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:38 +02:00
Robert Marko
17a55f9c9d ipq40xx: add PSGMII PHY mode define
PSGMII is a Qualcomm specific mode similar to QSGMII but it has 5 SGMII
lines instead of 4 in QSGMII.

This just adds the support for the PHY layer to be able to identify the
mode for further use.
It is required for the DSA driver.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:38 +02:00
Robert Marko
a15ccc2fe0 ipq40xx: add IPQESS ethernet driver
IPQESS is the EDMA replacement driver for the IPQ40xx SoC built-in
ethernet controller.

Unlike EDMA it is Phylink based and doesnt touch PHY-s directly.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:38 +02:00
Robert Marko
45ad5beb80 ipq40xx: qca807x: always set PSGMII AZ WAR
There is no point in using a DT property to trigger setting the PSGMII
PHY AZ transmitting ability.
Especially since EEE can be disabled using ethtool anyway.

Fixup the mask for setting the workaround as only BIT(0) is actually being
changed and use the phy_clear_bits_mmd helper instead of reading, then
clearing the bit and writing back as it does everything for us.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:38 +02:00
Robert Marko
acc4add9a7 ipq40xx: add shinfo based DSA tag driver
IPQ40xx requires a special DSA tag driver despite using the QCA8337N
switch.
However they have changed the header format and the existing QCA tag
driver cannot be reused.

For details on how it actually works and else read the patch commit
description.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:38 +02:00
Robert Marko
ccd08ef912 ipq40xx: disable nodes instead of deleting them
There is no reason to delete the DT PHY nodes
as you can just disable them.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:38 +02:00
Robert Marko
378d1a6569 ipq40xx: qca807x: add SFP improvements
Currently, QCA807x doesnt do any kind of validation to see whether it
actually supports the inserted module.

So lets add checks to allow only 1000BaseX and 100BaseFX based modules.

While adding validation, move fiber configuration to insert/remove events
instead of always doing it at config time.
This allows getting rid of the DT property for fiber enable and now only
the upstream sfp phandle is required.

Since we are refactoring fiber related code, lets heavily simplify the
status polling as the current logic is overcomplicated due to previous
wish to support non standard SFP cages that dont have pins properly
connected, that is removed now and only proper SFP cages will work.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:38 +02:00
Robert Marko
27b441cbaf ipq40xx: drop ESSEDMA + AR40xx DTS nodes
In order to start working on IPQESS + DSA drop
the old ESSEDMA + AR40xx DTS nodes.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:38 +02:00
Robert Marko
6d24d10f3d ipq40xx: drop ESSEDMA + AR40xx
In order to start working on IPQESS + DSA drop the old ESSEDMA + AR40xx
driver combo.

Remove the kernel symbols, disable swconfig and drop swconfig package
as they are not needed anymore.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-10-02 23:04:38 +02:00
Giammarco Marzano
0de6a3339f ipq40xx: Add ZTE MF289F
It's a 4G Cat.20 router used by Vodafone Italy (called Vodafone FWA)
and Vodafone DE\T-Mobile PL (called GigaCube).

Modem is a MiniPCIe-to-USB based on Snapdragon X24,
it supports 4CA aggregation.

There are currently two hardware revisions, which
differ on the 5Ghz radio:

AT1 = QCA9984 5Ghz Radio on PCI-E bus
AT2 = IPQ4019 5Ghz Radio inside IPQ4019 like 2.4Ghz

Device specification
--------------------
SoC Type: Qualcomm IPQ4019
RAM: 256 MiB
Flash: 128 MiB SPI NAND (Winbond W25N01GV)
ROM: 2MiB SPI Flash (GD25Q16)
Wireless 2.4 GHz (IP4019): b/g/n, 2x2
Wireless 5 GHz:
	(QCA9984): a/n/ac, 4x4 HW REV AT1
	(IPA4019): a/n/ac, 2x2 HW REV AT2
Ethernet: 2xGbE (WAN/LAN1, LAN2)
USB ports: No
Button: 2 (Reset/WPS)
LEDs: 3 external leds: Network (white or red), Wifi, Power and 1 internal (blue)
Power: 12 VDC, 1 A
Connector type: Barrel
Bootloader: U-Boot

Installation
------------
1. Place OpenWrt initramfs image for the device on a TFTP
   in the server's root. This example uses Server IP: 192.168.0.2
2. Connect serial console (115200,8n1) to serial connector
   GND (which is right next to the thing with MF289F MIMO-V1.0), RX, TX
   (refer to this image: https://ibb.co/31Gngpr).
3. Connect TFTP server to RJ-45 port (WAN/LAN1).
4. Stop in u-Boot (using ESC button) and run u-Boot commands:

setenv serverip 192.168.0.2
setenv ipaddr 192.168.0.1
set fdt_high 0x85000000
tftp openwrt-ipq40xx-generic-zte_mf289f-initramfs-fit-zImage.itb
bootm $loadaddr

5. Please make backup of original partitions, if you think about revert to
   stock, specially mtd16 (Web UI) and mtd17 (rootFS).
Use /tmp as temporary storage and do:

WEB PARITION
--------------------------------------
cat /dev/mtd16 > /tmp/mtd16.bin
scp /tmp/mtd16.bin root@YOURSERVERIP:/
rm /tmp/mtd16.bin

ROOT PARITION
--------------------------------------
cat /dev/mtd17 > /tmp/mtd17.bin
scp /tmp/mtd17.bin root@YOURSERVERIP:/
rm /tmp/mtd17.bin

6. Login via ssh or serial and remove stock partitions
   (default IP 192.168.0.1):

 # this can return an error, if ubi was attached before
 # or rootfs part was erased before.
ubiattach -m 17

 # it could return error if rootfs part was erased before
ubirmvol /dev/ubi0 -N ubi_rootfs
 # some devices doesn't have it
ubirmvol /dev/ubi0 -N ubi_rootfs_data

7. download and install image via sysupgrade -n
 (either use wget/scp to copy the mf289f's squashfs-sysupgrade.bin
 to the device's /tmp directory)

 sysupgrade -n /tmp/openwrt-...-zte_mf289f-squashfs-sysupgrade.bin

Sometimes it could print ubi attach error, but please ignore it
if process goes forward.

Flash Layout

NAND:
mtd8: 000a0000 00020000 "fota-flag"
mtd9: 00080000 00020000 "0:ART"
mtd10: 00080000 00020000 "mac"
mtd11: 000c0000 00020000 "reserved2"
mtd12: 00400000 00020000 "cfg-param"
mtd13: 00400000 00020000 "log"
mtd14: 000a0000 00020000 "oops"
mtd15: 00500000 00020000 "reserved3"
mtd16: 00800000 00020000 "web"
mtd17: 01d00000 00020000 "rootfs"
mtd18: 01900000 00020000 "data"
mtd19: 03200000 00020000 "fota"
mtd20: 0041e000 0001f000 "kernel"
mtd21: 0101b000 0001f000 "ubi_rootfs"

SPI:
mtd0: 00040000 00010000 "0:SBL1"
mtd1: 00020000 00010000 "0:MIBIB"
mtd2: 00060000 00010000 "0:QSEE"
mtd3: 00010000 00010000 "0:CDT"
mtd4: 00010000 00010000 "0:DDRPARAMS"
mtd5: 00010000 00010000 "0:APPSBLENV"
mtd6: 000c0000 00010000 "0:APPSBL"
mtd7: 00050000 00010000 "0:reserved1"

Back to Stock (!!! need original dump taken from initramfs !!!)
-------------
1. Place mtd16.bin and mtd17.bin initramfs image
   for the device on a TFTP in the server's root.
   This example uses Server IP: 192.168.0.2
2. Connect serial console (115200,8n1) to serial console
   connector (refer to the pin-out from above).
3. Connect TFTP server to RJ-45 port (WAN/LAN1).
4. rename mtd16.bin to web.img and mtd17.bin to root_uImage_s
5. Stop in u-Boot (using ESC button) and run u-Boot commands:

This will erase RootFS+Web:
nand erase 0x1000000 0x800000
nand erase 0x1800000 0x1D00000

This will restore RootFS:
tftpboot 0x84000000 ${dir}root_uImage_s
nand erase 0x1800000 0x1D00000
nand write $fileaddr 0x1800000 $filesize

This will restore Web Interface:
tftpboot 0x84000000 ${dir}web.img
nand erase 0x1000000 0x800000
nand write $fileaddr 0x1000000 $filesize

After first boot on stock firwmare, do a factory reset.
Push reset button for 5 seconds so all parameters will
be reverted to the one printed on label on bottom of the router

Signed-off-by: Giammarco Marzano <stich86@gmail.com>
Reviewed-by: Lech Perczak <lech.perczak@gmail.com>
(Warning: commit message did not conform to UTF-8 - hopefully fixed?,
added description of the pin-out if image goes down, reformatted
commit message to be hopefully somewhat readable on git-web,
redid some of the gpio-buttons & leds DT nodes, etc.)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-09-24 23:53:53 +02:00
INAGAKI Hiroshi
c34f071972 ipq40xx: add support for Sony NCP-HG100/Cellular
Sony NCP-HG100/Cellular is a IoT Gateway with 2.4/5 GHz band 11ac
(WiFi-5) wireless function, based on IPQ4019.

Specification:

- SoC                   : Qualcomm IPQ4019
- RAM                   : DDR3 512 MiB (H5TC4G63EFR)
- Flash                 : eMMC 4 GiB (THGBMNG5D1LBAIT)
- WLAN                  : 2.4/5 GHz 2T2R (IPQ4019)
- Ethernet              : 10/100/1000 Mbps x2
  - Transceiver         : Qualcomm QCA8072
- WWAN                  : Telit LN940A9
- Z-Wave                : Silicon Labs ZM5101
- Bluetooth             : Qualcomm CSR8811
- Audio DAC             : Realtek ALC5629
- Audio Amp.            : Realtek ALC1304
- Voice Input Processor : Conexant CX20924
- Micro Controller Unit : Nuvoton MINI54FDE
  - RGB LED, Fan, Temp. sensors
- Touch Sensor          : Cypress CY8C4014LQI
- RGB LED driver        : TI LP55231 (2x)
- LEDs/Keys             : 11x, 6x
- UART                  : through-hole on PCB
  - J1: 3.3V, TX, RX, GND from tri-angle marking
  - 115200n8
- Power                 : 12 VDC, 2.5 A

Flash instruction using initramfs image:

1. Prepare TFTP server with the IP address 192.168.132.100 and place the
   initramfs image to TFTP directory with the name "C0A88401.img"

2. Boot NCP-HG100/Cellular and interrupt after the message
   "Hit any key to stop autoboot:  2"

3. Perform the following commands and set bootcmd to allow booting from
   eMMC

   setenv bootcmd "mmc read 0x84000000 0x2e22 0x4000 && bootm 0x84000000"
   saveenv

4. Perform the following command to load/boot the OpenWrt initramfs image

   tftpboot && bootm

5. On the initramfs image, perform sysupgrade with the sysupgrade image
   (if needed, backup eMMC partitions by dd command and download to
   other place before performing sysupgrade)

6. Wait for ~120 seconds to complete flashing

Known issues:

- There are no drivers for audio-related chips/functions in Linux Kernel
  and OpenWrt, they cannot be used.

- There is no driver for MINI54FDE Micro-Controller Unit, customized for
  this device by the firmware in the MCU. This chip controls the
  following functions, but they cannot be controlled in OpenWrt.

  - RGB LED
  - Fan
    this fan is controlled automatically by MCU by default, without
    driver
  - Thermal Sensors (2x)

- Currently, there is no driver or tool for CY8C4014LQI and cannot be
  controlled. It cannot be exited from "booting mode" and moved to "normal
  op mode" after booting. And also, the 4x buttons (mic mute, vol down,
  vol up, alexa trigger) connected to the IC cannot be controlled.

  - it can be exited from "booting mode" by installing and executing
    i2cset command:

    opkg update
    opkg install i2c-tools
    i2cset -y 1 0x14 0xf 1

- There is a connection issue on the control by uqmi for the WWAN module.
  But modemmanager can be used without any issues and the use of it is
  recommended.

- With the F2FS format, too many errors are reported on erasing eMMC
  partition "rootfs_data" while booting:

  [    1.360270] sdhci: Secure Digital Host Controller Interface driver
  [    1.363636] sdhci: Copyright(c) Pierre Ossman
  [    1.369730] sdhci-pltfm: SDHCI platform and OF driver helper
  [    1.374729] sdhci_msm 7824900.sdhci: Got CD GPIO
  ...
  [    1.413552] mmc0: SDHCI controller on 7824900.sdhci [7824900.sdhci] using ADMA 64-bit
  [    1.528325] mmc0: new HS200 MMC card at address 0001
  [    1.530627] mmcblk0: mmc0:0001 004GA0 3.69 GiB
  [    1.533530] mmcblk0boot0: mmc0:0001 004GA0 partition 1 2.00 MiB
  [    1.537831] mmcblk0boot1: mmc0:0001 004GA0 partition 2 2.00 MiB
  [    1.542918] mmcblk0rpmb: mmc0:0001 004GA0 partition 3 512 KiB, chardev (247:0)
  [    1.550323] Alternate GPT is invalid, using primary GPT.
  [    1.561669]  mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17
  ...
  [    8.841400] mount_root: loading kmods from internal overlay
  [    8.860241] kmodloader: loading kernel modules from //etc/modules-boot.d/*
  [    8.863746] kmodloader: done loading kernel modules from //etc/modules-boot.d/*
  [    9.240465] block: attempting to load /etc/config/fstab
  [    9.246722] block: unable to load configuration (fstab: Entry not found)
  [    9.246863] block: no usable configuration
  [    9.254883] mount_root: overlay filesystem in /dev/mmcblk0p17 has not been formatted yet
  [    9.438915] urandom_read: 5 callbacks suppressed
  [    9.438924] random: mkfs.f2fs: uninitialized urandom read (16 bytes read)
  [   12.243332] mmc_erase: erase error -110, status 0x800
  [   12.246638] mmc0: cache flush error -110
  [   15.134585] mmc_erase: erase error -110, status 0x800
  [   15.135891] mmc_erase: group start error -110, status 0x0
  [   15.139850] mmc_erase: group start error -110, status 0x0
  ...(too many the same errors)...
  [   17.350811] mmc_erase: group start error -110, status 0x0
  [   17.356197] mmc_erase: group start error -110, status 0x0
  [   17.439498] sdhci_msm 7824900.sdhci: Card stuck in wrong state! card_busy_detect status: 0xe00
  [   17.446910] mmc0: tuning execution failed: -5
  [   17.447111] mmc0: cache flush error -110
  [   18.012440] F2FS-fs (mmcblk0p17): Found nat_bits in checkpoint
  [   18.062652] F2FS-fs (mmcblk0p17): Mounted with checkpoint version = 428fa16b
  [   18.198691] block: attempting to load /etc/config/fstab
  [   18.198972] block: unable to load configuration (fstab: Entry not found)
  [   18.203029] block: no usable configuration
  [   18.211371] mount_root: overlay filesystem has not been fully initialized yet
  [   18.214487] mount_root: switching to f2fs overlay

  So, this support uses ext4 format instead which has no errors.

Note:

- The primary uart is shared for debug console and Z-Wave chip. The
  function is switched by GPIO15 (Linux: 427).

  value:

    1: debug console
    0: Z-Wave

- NCP-HG100/Cellular has 2x os-image pairs in eMMC.

  - 0:HLOS, rootfs
  - 0:HLOS_1, rootfs_1

  In OpenWrt, the first image pair is used.

- "bootipq" command in U-Boot requires authentication with signed-image
  by default. To boot unsigned image of OpenWrt, use "mmc read" and
  "bootm" command instead.

- This support is for "Cellular" variant of NCP-HG100 and not tested on
  "WLAN" (non-cellular) variant.

- The board files of ipq-wifi may also be used in "WLAN" variant of
  NCP-HG100, but unconfirmed and add files as for "Cellular" variant.

- "NET" LED is used to indicate WWAN status in stock firmware.

- There is no MAC address information in the label on the case, use the
  address included in UUID in the label as "label-MAC" instead.

- The "CLOUD" LEDs are partially used for indication of system status in
  stock firmware, use they as status LEDs in OpenWrt instead of RGB LED
  connected to the MCU.

MAC addresses:

LAN    : 5C:FF:35:**:**:ED (ART, 0x6    (hex))
WAN    : 5C:FF:35:**:**:EF (ART, 0x0    (hex))
2.4 GHz: 5C:FF:35:**:**:ED (ART, 0x1006 (hex))
5 GHz  : 5C:FF:35:**:**:EE (ART, 0x5006 (hex))

partition layout in eMMC (by fdisk, GPT):

Disk /dev/mmcblk0: 7733248 sectors, 3776M
Logical sector size: 512
Disk identifier (GUID): ****
Partition table holds up to 20 entries
First usable sector is 34, last usable sector is 7634910

Number  Start (sector)    End (sector)  Size Name
     1              34            1057  512K 0:SBL1
     2            1058            2081  512K 0:BOOTCONFIG
     3            2082            3105  512K 0:QSEE
     4            3106            4129  512K 0:QSEE_1
     5            4130            4641  256K 0:CDT
     6            4642            5153  256K 0:CDT_1
     7            5154            6177  512K 0:BOOTCONFIG1
     8            6178            6689  256K 0:APPSBLENV
     9            6690            8737 1024K 0:APPSBL
    10            8738           10785 1024K 0:APPSBL_1
    11           10786           11297  256K 0:ART
    12           11298           11809  256K 0:HSEE
    13           11810           28193 8192K 0:HLOS
    14           28194           44577 8192K 0:HLOS_1
    15           44578          306721  128M rootfs
    16          306722          568865  128M rootfs_1
    17          568866         3958065 1654M rootfs_data

[initial work]
Signed-off-by: Iwao Yuki <dev.clef@gmail.com>
Co-developed-by: Iwao Yuki <dev.clef@gmail.com>
[adjustments, cleanups, commit message, sending patch]
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
(dropped clk_unused_ignore, dropped 901-* patches, renamed
key nodes, changed LEDs chan/labels to match func-en, made
:net -> (w)wan leds)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-09-24 23:53:53 +02:00
Tomasz Maciej Nowak
0410c95f0b ipq40xx: base-files: properly close case
Fix this occurrence during boot:
/bin/board_detect: line 10: Unsupported: not found

Fixes: 80baffd2aa (" ipq40xx: add support for Pakedge WR-1")
Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2022-09-24 23:53:53 +02:00
Tomasz Maciej Nowak
04eb080290 ipq40xx: luma_wrtq-329acn: differentiate ethernet mac addresses
On OEM firmware both addresses for In and Out ports are different. Set
them as such also in OpenWrt.

Fixes: e24635710c (" ipq40xx: add support for Luma Home WRTQ-329ACN")
Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2022-09-24 23:53:53 +02:00