Discussion:
[PATCH ipq 0/2] ipq40xx: OpenMesh A42 adjustments
(too old to reply)
Sven Eckelmann
2018-03-13 14:50:15 UTC
Permalink
Hi,

I was informed by Christian Lamparter that the ipq806x will be modified
and a new target ipq40xx will be created [1]. During this process, the
files were cleaned up (good thing) and some things were swapped (not so
good).

I have created these two patches to inform the authors of the
ipq40xx-split. They were also uploaded to github.

Kind regards,
Sven

[1] https://git.openwrt.org/?p=openwrt/staging/mkresin.git;a=shortlog;h=refs/heads/ipq
[2] https://github.com/ecsv/openwrt/tree/ipq-rebuttal

Sven Eckelmann (2):
ipq40xx: Use exact SoC name in A42 DTS name
ipq40xx: Fix A42 eth port aliases/mac addresses

target/linux/ipq40xx/base-files/etc/board.d/02_network | 2 +-
.../arm/boot/dts/{qcom-ipq4019-a42.dts => qcom-ipq4018-a42.dts} | 8 ++++++++
target/linux/ipq40xx/image/Makefile | 2 +-
.../linux/ipq40xx/patches-4.14/069-arm-boot-add-dts-files.patch | 2 +-
4 files changed, 11 insertions(+), 3 deletions(-)
rename target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/{qcom-ipq4019-a42.dts => qcom-ipq4018-a42.dts} (96%)
--
2.11.0
Sven Eckelmann
2018-03-13 14:50:16 UTC
Permalink
The naming scheme of ipq40xx DTS files was adjusted with the switch to the
new IPQ40xx target. This was not done correctly for the OpenMesh A42 which
is actually an IPQ4018 and not an IPQ4019.

Signed-off-by: Sven Eckelmann <***@openmesh.com>
---
.../arch/arm/boot/dts/{qcom-ipq4019-a42.dts => qcom-ipq4018-a42.dts} | 0
target/linux/ipq40xx/image/Makefile | 2 +-
target/linux/ipq40xx/patches-4.14/069-arm-boot-add-dts-files.patch | 2 +-
3 files changed, 2 insertions(+), 2 deletions(-)
rename target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/{qcom-ipq4019-a42.dts => qcom-ipq4018-a42.dts} (100%)

diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4019-a42.dts b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts
similarity index 100%
rename from target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4019-a42.dts
rename to target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts
diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile
index 0c4b971eeb..1abbb404d7 100644
--- a/target/linux/ipq40xx/image/Makefile
+++ b/target/linux/ipq40xx/image/Makefile
@@ -90,7 +90,7 @@ TARGET_DEVICES += meraki_mr33

define Device/openmesh_a42
$(call Device/FitImageLzma)
- DEVICE_DTS := qcom-ipq4019-a42
+ DEVICE_DTS := qcom-ipq4018-a42
BLOCKSIZE := 64k
SUPPORTED_DEVICES := openmesh,a42
DEVICE_TITLE := OpenMesh A42
diff --git a/target/linux/ipq40xx/patches-4.14/069-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-4.14/069-arm-boot-add-dts-files.patch
index 8f0f473e30..b472c122d0 100644
--- a/target/linux/ipq40xx/patches-4.14/069-arm-boot-add-dts-files.patch
+++ b/target/linux/ipq40xx/patches-4.14/069-arm-boot-add-dts-files.patch
@@ -14,8 +14,8 @@ Signed-off-by: John Crispin <***@phrozen.org>
qcom-apq8074-dragonboard.dtb \
qcom-apq8084-ifc6540.dtb \
qcom-apq8084-mtp.dtb \
++ qcom-ipq4018-a42.dtb \
+ qcom-ipq4018-rt-ac58u.dtb \
-+ qcom-ipq4019-a42.dtb \
qcom-ipq4019-ap.dk01.1-c1.dtb \
+ qcom-ipq4019-ap.dk04.1-c1.dtb \
+ qcom-ipq4019-fritz4040.dtb \
--
2.11.0
Sven Eckelmann
2018-03-13 14:50:17 UTC
Permalink
The OpenMesh A42 uses labels next to the ethernet ports to identify the
first and second ethernet port. The first ethernet port's MAC address is
also printed prominently on the label in the center of the housing.

The board can also be powered up only using POE. It is therefore likely
that the ethernet cable to the internet is attached to the first ethernet
port which is also the active POE port. For a firmware without automatic
internet detection (like OpenWrt), it is therefore logical to use this port
as the default WAN port.

The configuration for each port are:

first ethernet port:

* phy_mdio_addr: 4
* QCA8072 port bit: BIT(5)
* u-boot mac address entry: ethaddr
* active POE

second ethernet port:

* phy_mdio_addr: 3
* QCA8072 port bit: BIT(4)
* u-boot mac address entry: eth1addr

As Mark Rutland pointed out [1], user-accessible ports with well defined
labels should be mapped accordingly with the aliases. This is mostly done
already by qcom-ipq4019.dtsi which maps ethernet0 to &gmac0 and &gmac1.
Only the gmac0 and gmac1 entries have to be adjusted accordingly to use the
correct configurations for the ports.

Not configuring the gmac entries as shown above, doesn't only affect the
names of the virtual interface names but also swaps the mac addresses of
the ports. The first ethernet port will then no longer use the mac address
which is printed on the device.

[1] https://patchwork.kernel.org/patch/9133903/

Signed-off-by: Sven Eckelmann <***@openmesh.com>
---
I was informed that the patch
<https://git.openwrt.org/?p=openwrt/staging/mkresin.git;a=commit;h=9a6d5bd049568e175d45415f51b3cf569ebd7479>
was not actually from Christian Lamparter. His original patch
<https://github.com/chunkeey/LEDE-IPQ40XX/commit/847c09d2b53684180297bdb056bda08f1c3333f8>
didn't contain the gmac0 <-> gmac1 swap. So I have to apologize to him for
wasting his time while trying to discuss changes which he actually didn't
do.

Btw. I don't have a good picture at the moment but you can check some photo
from heise to see some of the labels
<Loading Image...>
---
target/linux/ipq40xx/base-files/etc/board.d/02_network | 2 +-
.../ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index 8e9a1889d1..d25a039f2d 100755
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -33,7 +33,7 @@ glinet,gl-b1300)
"***@eth0" "3:lan" "4:lan"
;;
openmesh,a42)
- ucidef_set_interfaces_lan_wan "eth0" "eth1"
+ ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;

meraki,mr33)
diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts
index 3d56a6ef52..fcc22276ba 100644
--- a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts
+++ b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-a42.dts
@@ -210,6 +210,14 @@
};

&gmac0 {
+ qcom,phy_mdio_addr = <4>;
+ qcom,poll_required = <1>;
+ qcom,forced_speed = <1000>;
+ qcom,forced_duplex = <1>;
+ vlan_tag = <2 0x20>;
+};
+
+&gmac1 {
qcom,phy_mdio_addr = <3>;
qcom,poll_required = <1>;
qcom,forced_speed = <1000>;
--
2.11.0
Loading...