1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-13 18:53:52 +02:00
Commit Graph

21 Commits

Author SHA1 Message Date
Paul Spooren
b3c1c57a35 treewide: update PKG_MIRROR_HASH to zst
When using zst instead of xz, the hash changes. This commit fixes the
hash for packages and tools in core.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-04-06 11:24:18 +02:00
Sean Khan
00f8c86624 qca-ssdk: rework make to allow parallel building
The current build procedure always wipes away build files, this is
costly as ssdk is a parent dependency on a whole host of packages and
will always end up rebuilding (and in serial) the whole package.

This patch includes:

1. Module Building Optimization: Instead of creating a temporary
directory (temp) and copying files into it for module building,
the directly invoke the module build command with the
necessary paths. This simplifies the build process
and avoids unnecessary file operations, speeding up
the build process and reducing disk usage.

2. Parallel Build Support: By removing the explicit creation of
the temporary directory and associated file copying operations,
and passing in $(MAKE) $(PKG_JOBS) allows building in parallel.

3. Fix `EXTRA_CFLAGS`: This variable is referenced and set within MAKE_FLAGS,
so doesn't preserve spaces. Should have its defined value quoted.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-04-01 11:08:57 +02:00
Robert Marko
1d33ee019f kernel: qca-ssdk: fix C45 MDIO support on kernel 6.6
Kernel 6.3 has introduced separate C45 read/write operations, and thus
split them out of the C22 operations completely so the old way of marking
C45 reads and writes via the register value does not work anymore.

This is causing SSDK to fail and find C45 only PHY-s such as Aquantia ones:
[   22.187877] ssdk_phy_driver_init[371]:INFO:dev_id = 0, phy_adress = 8, phy_id = 0x0 phytype doesn't match
[   22.209924] ssdk_phy_driver_init[371]:INFO:dev_id = 0, phy_adress = 0, phy_id = 0x0 phytype doesn't match

This in turn causes USXGMII MAC autoneg bit to not get set and then UNIPHY
autoneg will time out, causing the 10G ports not to work:
[   37.292784] uniphy autoneg time out!

So, lets detect C45 reads and writes by the magic BIT(30) in the register
argument and if so call separate C45 mdiobus read/write functions.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-03-26 18:10:50 +01:00
Paul Spooren
c02a2db05e treewide: update PKG_MIRROR_HASH after APK version schema
With the change in version schema the downloaded files changed, too,
mostly the hash is now prefixed with a tilde `~` instead of a dash `-`.

Since each downloaded archive contains folder with the same name as the
archive, the checksum changed.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-03-25 09:32:48 +01:00
Christian Marangi
8d7f747757
qca-ssdk: disable Malibu PHY in favor of upstream version
Disable Malibu PHY driver in Qca SSDK in favor of the upstream version.
The same workaround are applied and the version upstream is just a drop
in replacement and is well tested from the ipq40xx target.

Also using the upstream version permits further support for LEDs.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-02-11 21:09:34 +01:00
Robert Marko
a79efe4cdf
qca-ssdk: add support for ipq60xx
IPQ60xx uses a different codename for SSDK, so lets pass the correct one
as otherwise SSDK asumes we are building for the old MIPS SoC-s.

Signed-off-by: Robert Marko <robimarko@gmail.com>
[ drop outdated commit description info ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-02-09 14:01:51 +01:00
Christian Marangi
7f0f838767
qca-ssdk: disable compiling qca8081 PHY driver in favor of upstream
Disable compiling qca8081 PHY driver in favor of upstream to better
support it and add better control of attached LEDs.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-01-27 19:04:11 +01:00
Robert Marko
17feb04ad4
qca-ssdk: disable building ISISC
ISISC is the QCA codename for their Atheros switch family including
AR237, QCA8337 etc.

Since we have qca8k support in OpenWrt, there is no need to have SSDK
support for these switches, and boards that also have external switches
can just use qca8k.

Disable QCA803x PHY support as well, since all of those are supportable
via at803x driver.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-15 11:01:56 +01:00
Robert Marko
14aeb471f2
qca-ssdk: disable PTP and swconfig by default
PTP and swconfig support in SSDK require kernel modifications we dont need
nor we want to support for now, so move the PTP and swconfig disablement
into general build options as they are not ipq807x specific.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-14 05:21:55 +01:00
Robert Marko
853db7be95
qca-ssdk: pass SoC to build
Recent SSDK versions started also parsing the "SoC" variable to identify
the SoC along with the "CHIP_TYPE".

We are not passing "SoC" currently and this leads to components we dont
need like MHT (New 2.5G quad port switch) being compiled and then unused,
so lets just pass the "SoC" as well.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-14 05:21:55 +01:00
Christian Marangi
e927456ec3
qca-ssdk: fix unsupported scenario with PORT1 not declared in switch bmp
Commit 947b44d ("ipq807x: fix wrong define for LAN and WAN ess mask")
started fixing wrong switch_lan_bmp that defined lan there weren't
actually present. This displayed a fragility in the malibu phy init code
in qca-ssdk.

Add patch to fix this. Also update each DTS with the new required
property if needed.

The new binding malibu_phy_start_addr is required with devices that
place the malibu first PHY referring port1 on a different PHY addres
than 0. The most common configuration is 0 but some device (for example
Qnap 301W) place the malibu PHY at an offset to address 16.

Refer to ipq8074-ess dtsi for extensive description on how to derive
this value.

Quoting the patch detailed description:

The usage of first_phy_addr is EXTREMELY FRAGILE and results
in dangerous results if the OEM (or anyone that by chance try to
implement things in a logical manner) deviates from the default values
from the "magical template".

To be in more details. With QSDK 12.4, some tweaks were done to improve
autoneg and now on every call of port status, the phydev is tried to
add. This resulted in the call and log spam of an error with ports that
are actually not present on the system with qsdk reporting phydev is
NULL. This itself is not an error and printing the error is correct.

What is actually an error from ages is setting generic bitmap reporting
presence of port that are actually not present. This is very common on
OEM where the switch_lan_bmp is always a variant of 0x1e (that on bitmap
results in PORT1 PORT2 PORT3 PORT4 present) or 0x3e (PORT1 PORT2 PORT3
PORT4 PORT5). Reality is that many device are used as AP with one LAN
port or one WAN port. (or even exotic configuration with PORT1 not
present and PORT2 PORT3 PORT4 present (Xiaomi 3600)

With this finding one can say... ok nice, then lets update the DT and
set the correct bitmap...

Again world is a bad place and reality is that this cause wonderful
regression in some case of by extreme luck the first ever connected
port working and the rest of the switch dead.

The problem has been bisected to all the device that doesn't have the
PORT1 declared in any of the bitmap.

With this prefaction in mind, on to the REAL problem.

malibu_phy_hw_init FOR SOME REASON, set a global variable first_phy_addr
to the first detected PHY addr that coincidentally is always PORT1.
PORT1 addr is 0x0. The entire code in malibu_phy use this variable to
derive the phy addrs in some function.

Declaring a bitmap where the PORT1 is missing (or worse PORT4 the only
one connected) result in first_phy_addr set to 1 or whatever phy addr is
detected first setting wrong value all over the init stage.

To fix this, introduce a new binding malibu_first_phy_addr to manually
declare the first phy that the malibu PHY driver should use and permit
to detach it from port bmp detection. The legacy detection is kept for
compatibility reason.

Fixes: #13945
Fixes: 947b44d9ae ("ipq807x: fix wrong define for LAN and WAN ess mask")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tested-by: Robert Marko <robimarko@gmail.com> # Qnap 301W
Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-11-13 14:27:16 +01:00
Christian Marangi
9b4628eaee
Revert "qca-ssdk: fix unsupported scenario with PORT1 not declared in switch bmp"
This reverts commit 8cce00bc9d.

The confusion was real and this change cause regression on other
advanced devices that makes actual use of the first_phy_addr value.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-11-13 14:27:16 +01:00
Christian Marangi
8cce00bc9d
qca-ssdk: fix unsupported scenario with PORT1 not declared in switch bmp
Commit 947b44d9ae ("ipq807x: fix wrong define for LAN and WAN ess mask")
started fixing wrong switch_lan_bmp that defined lan there weren't
actually present. This displayed a fragility in the malibu phy init code
in qca-ssdk.

Add patch to fix this.

Quoting the patch detailed description:

I'm very confused by this and to me it's not clear the real usage of
this logic.

From what I can see the usage of this is EXTREMELY FRAGILE and results
in dangerous results if the OEM (or anyone that by chance try to
implement things in a logical manner) deviates from the default values
from the "magical template".

To be in more details. With QSDK 12.4, some tweaks were done to improve
autoneg and now on every call of port status, the phydev is tried to
add. This resulted in the call and log spam of an error with ports that
are actually not present on the system with qsdk reporting phydev is
NULL. This itself is not an error and printing the error is correct.

What is actually an error from ages is setting generic bitmap reporting
presence of port that are actually not present. This is very common on
OEM where the switch_lan_bmp is always a variant of 0x1e (that on bitmap
results in PORT1 PORT2 PORT3 PORT4 present) or 0x3e (PORT1 PORT2 PORT3
PORT4 PORT5). Reality is that many device are used as AP with one LAN
port or one WAN port. (or even exotic configuration with PORT1 not
present and PORT2 PORT3 PORT4 present (Xiaomi 3600)

With this finding one can say... ok nice, then lets update the DT and
set the correct bitmap...

Again world is a bad place and reality is that this cause wonderful
regression in some case of by extreme luck the first ever connected
port working and the rest of the switch dead.

The problem has been bisected to all the device that doesn't have the
PORT1 declared in any of the bitmap.

With this perfection in mind, on to the REAL problem.

malibu_phy_hw_init FOR SOME REASON, set a global variable first_phy_addr
to the first detected PHY addr that coincidentally is always PORT1.
PORT1 addr is 0x0. The entire code in malibu_phy use this variable to
derive the phy addrs in some function.

Declaring a bitmap where the PORT1 is missing (or worse PORT4 the only
one connected) result in first_phy_addr set to 1 or whatever phy addr is
detected first setting wrong value all over the init stage.

To fix this, just drop this variable and hardcode everything to assume
the first phy adrr is ALWAYS 0 and remove calculation and use define for
special case.

With the following change normal switch traffic is restored and ports
function is recovered.

Fixes: #13945
Fixes: 947b44d9ae ("ipq807x: fix wrong define for LAN and WAN ess mask")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-11-11 23:39:32 +01:00
Robert Marko
eea264fead
kernel: qca-ssdk: update to 12.4
Update SSDK version to 12.4, this fixes weird SFP port link up/downs
while there is no SFP module plugged in.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-09 13:21:55 +01:00
Christian Marangi
d82c5884c6
treewide: make use of new toolchain define
Make use of new toolchain define. TOOLCHAIN_DIR should be used only for
toolchain related packages and for everything else TOOLCHAIN_ROOT_DIR
and other define should be used instead.

Switch to new entry where possible.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-10-20 16:13:56 +02:00
Robert Marko
b45562a69c
kernel: qca-ssdk: update to 12.4.5.r1
Qualcomm has finally started the preparatory work in order to support
kernel 6.1, so lets make use of that and update SSDK 12.4.5.r1 which
allows us to drop almost all of the patches.

Lets also install the forgotten SSDK netlink header.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-06-26 16:17:37 +02:00
Robert Marko
83314c13d0
qualcommax: move ipq807x support to subtarget
Now that qualcommax exists as a target and dependencies have been updated
let move ipq807x support to subtarget of qualcommax.

This is mostly copy/paste with the exception of having to update SSDK and
NSS-DP to use CONFIG_TARGET_SUBTARGET.

This is a preparation for later addition of IPQ60xx and IPQ50xx support.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-06-16 11:11:09 +02:00
Robert Marko
f02f6aaa8d
ipq807x: rename target to qualcommax
Currently, ipq807x only covers Qualcomm IPQ807x SoC-s.
However, Qualcomm also has IPQ60xx and IPQ50xx SoC-s under the AX WiSoC-s
and they share a lot of stuff with IPQ807x, especially IPQ60xx so to avoid
duplicating kernel patches and everything lets make a common target with
per SoC subtargets.

Start doing that by renaming ipq807x to qualcommax so that dependencies
on ipq807x target can be updated.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-06-16 11:11:08 +02:00
Robert Marko
957f1ee85e
kernel: qca-ssdk: backport support for building as kernel module
Currently, SSDK is rather special in the sense that its not being built as
a proper out of tree module at all but rather like a userspace application
and that involves a lot of make magic which unfortunately broke with make
version 4.4 and newer.

Luckily QCA finally added a way to build SSDK as an out of tree module
and it uses the kernel buildsystem which makes it compile with make 4.4
as well.
So lets backport the support for it and switch to using it.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-05-23 23:51:39 +02:00
Robert Marko
1342afcd27
kernel: qca-ssdk: opt-out of LTO
SSDK is doing everything custom, so trying to use mold and/or LTO
fails, so lets opt-out of using both of them.

Signed-off-by: Robert Marko <robimarko@gmail.com>
[a.heider: split and switch to PKG_BUILD_FLAGS]
Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-03-21 18:28:23 +01:00
Robert Marko
c608f70325 kernel: add Qualcomm SSDK driver
Qualcomm SSDK is driver for Qualcomm Atheros switches and PHY-s.

It is quite complicated and used by rest of the Qualcomm SDK stack for
anything switch or PHY related.

It is required for IPQ807x support as currently, there is no better driver
for the built-in switch or UNIPHY.

So, lets add the fixed-up version that supports kernel 5.15 for use on
ipq807x target until a better driver is available.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-01-16 12:42:23 +01:00