Which branch for a new device?

I developed locally a snapshot for a Sitecom WLR-4100 starting from a local copy of 19.07.03 branch.
The firwmare is stable even if just 3 out of 5 Ethernet ports are working (like other MT7620A + AR8x27 devices: Lava, Engenius). I identify the solution for fix. I can test it just on my switch, but I think will woks for others.
I still have some issue with USB which works at 1.1 (full speed) instead of 2.0. I am working on it.
I am using this guide: https://openwrt.org/docs/guide-developer/working-with-github-pr
for adding the device to the project.
I started from the Master branch but I realized that is not mature: I get some warning during compilation and the final firmware does not recognize GPIO and AR8337.

Finally it is not clear to me how to choose the right project branch (19.07, 21.02 or Master) for adding a new device and to keep it in the future OpenWRT branches.

1 Like

master... but yes... master is in a fairly transient state right now... so it's likely to be more challenging...

post such warnings here... you may get some insight into whether it's related to your stuff or something else...

1 Like

Here the warnings:

WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a build dependency on 'libpam', which does not exist

and here the error I get from the master branch (which I did not get in 19.07.03):

...
[    5.216657] rt2880-pinmux pinctrl: pin 38 is not set to gpio mux
[    5.222519] rt2880-pinmux pinctrl: request() failed for pin 38
[    5.228129] rt2880-pinmux pinctrl: pin-38 (pio:38) status -22
...
[    5.460441] mtk_soc_eth: probe of 10100000.ethernet failed with error -22
...
[    6.117488] phy phy-usbphy.0: remote usb device wakeup disabled
[    6.123548] phy phy-usbphy.0: UTMI 16bit 30MHz
...
[    6.480520] random: jshn: uninitialized urandom read (4 bytes read)
[    6.574941] random: jshn: uninitialized urandom read (4 bytes read)
[    6.581474] usb 1-1: new full-speed USB device number 2 using ohci-platform
[    6.768235] random: jshn: uninitialized urandom read (4 bytes read)
...
[    8.964584] urandom_read: 5 callbacks suppressed
...
Failed to connect to the switch. Use the "list" command to see which switches are available.
Failed to connect to the switch. Use the "list" command to see which switches are available.
...
[   10.134109] urngd: jent-rng init failed, err: 2

The GPIO error is for pin 38 (usb power), 45 (ar8337 reset), 2 (wps key), 9 (led)
ln local 19.07.03 version I get the following info which are not reported in the Master branch (The AR8337 is not detected):

[    0.460294] libphy: Fixed MDIO Bus: probed
[    0.473705] libphy: mdio: probed
[    0.477789] Probe mdio address:0
[    0.482539] Phy probe: switch0: Atheros AR8337 rev. 2 switch registered on mdio-bus
[    0.736278] mtk_soc_eth 10100000.ethernet: using fixed link parameters
[    0.743113] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    0.749830] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5

This is the first time I try to contribute. Dealing with "Instable" Master it may be too much for me.
The 21.02 is supposed to be more stable and it has the same *.dts filename and the same 02_network and 01_leds location as the Master branch.
I should add WLR-4100 to the 21.02 and test it on real hardware.
Then I will try to keep it to the master.
I did not find how to navigate among the branches and inject a new hardware in major revisions.

without looking into it... often these types of things are related to dtsi includes and restructuring of labels and alike...

so the best thing to do is compare a similar dts from 19 and master and check for dts general structure and labelling...

makefile warnings are generally unrelated and non-fatal and can generally be disregarded...

instable is probably the wrong word... 'possibly subject to frequent change or missing functionality ( in the case of catching a target just after a major kernel change for instance )...' is probably a better phrasing... by keeping an eye on the mailing list... you can usually fairly quickly determine if your target is currently effected by a recent change or bump ( or git diff target/linux/YOURARCH )...

if it's just been moved from swconfig to dsa... then yes... that's going to compound issues... but sooner or later... it's pretty much the same changes that are going to need to be made... as, other than personal use... new support on old code is not mergable...

1 Like

All new stuff goes first into master.

It might later get backported to the stable branches like 21.02, but not into the two-year old 19.07, which will be soon deprecated (when 21.02 gets released)

You have dirty buildboot. Some package data is not updated. Do "make dirclean" (or at least delete tmp/), and then run feeds update and feeds install.

2 Likes

let me try:

pippo@wd:~/GHubWRT/openwrt$ git fetch upstream
pippo@wd:~/GHubWRT/openwrt$ make dirclean
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'proper-umask'... ok.
Checking 'gcc'... ok.
Checking 'working-gcc'... ok.
Checking 'g++'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'perl-data-dumper'... ok.
Checking 'perl-thread-queue'... ok.
Checking 'tar'... ok.
Checking 'find'... ok.
Checking 'bash'... ok.
Checking 'xargs'... ok.
Checking 'patch'... ok.
Checking 'diff'... ok.
Checking 'cp'... ok.
Checking 'seq'... ok.
Checking 'awk'... ok.
Checking 'grep'... ok.
Checking 'egrep'... ok.
Checking 'getopt'... ok.
Checking 'stat'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'wget'... ok.
Checking 'perl'... ok.
Checking 'python2-cleanup'... ok.
Checking 'python'... ok.
Checking 'python3'... ok.
Checking 'git'... ok.
Checking 'file'... ok.
Checking 'rsync'... ok.
Checking 'which'... ok.
Checking 'ldconfig-stub'... ok.
Collecting package info: done
Collecting target info: done
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a build dependency on 'libpam', which does not exist
 make[1] dirclean
pippo@wd:~/GHubWRT/openwrt$ git checkout wlr4100v1002 
A	target/linux/ramips/dts/mt7620a_sitecom_wlr-4100v1002.dts
M	target/linux/ramips/image/mt7620.mk
M	target/linux/ramips/mt7620/base-files/etc/board.d/01_leds
M	target/linux/ramips/mt7620/base-files/etc/board.d/02_network
Already on 'wlr4100v1002'
pippo@wd:~/GHubWRT/openwrt$ ./scripts/feeds update
Updating feed 'packages' from 'https://git.openwrt.org/feed/packages.git' ...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 13 (delta 4), reused 0 (delta 0)
Unpacking objects: 100% (13/13), done.
From https://git.openwrt.org/feed/packages
   1677e5f..ccfe1bf  master     -> origin/master
Updating 1677e5f..ccfe1bf
Fast-forward
 libs/msgpack-c/Makefile                            | 48 ++++++++++++++++++++
 net/tmate/Makefile                                 | 51 ++++++++++++++++++++++
 .../010-Avoid-initializing-stdout-twice.patch      | 22 ++++++++++
 net/tmate/test.sh                                  |  3 ++
 4 files changed, 124 insertions(+)
 create mode 100644 libs/msgpack-c/Makefile
 create mode 100644 net/tmate/Makefile
 create mode 100644 net/tmate/patches/010-Avoid-initializing-stdout-twice.patch
 create mode 100644 net/tmate/test.sh
Create index file './feeds/packages.index' 
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'proper-umask'... ok.
Checking 'gcc'... ok.
Checking 'working-gcc'... ok.
Checking 'g++'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'perl-data-dumper'... ok.
Checking 'perl-thread-queue'... ok.
Checking 'tar'... ok.
Checking 'find'... ok.
Checking 'bash'... ok.
Checking 'xargs'... ok.
Checking 'patch'... ok.
Checking 'diff'... ok.
Checking 'cp'... ok.
Checking 'seq'... ok.
Checking 'awk'... ok.
Checking 'grep'... ok.
Checking 'egrep'... ok.
Checking 'getopt'... ok.
Checking 'stat'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'wget'... ok.
Checking 'perl'... ok.
Checking 'python2-cleanup'... ok.
Checking 'python'... ok.
Checking 'python3'... ok.
Checking 'git'... ok.
Checking 'file'... ok.
Checking 'rsync'... ok.
Checking 'which'... ok.
Checking 'ldconfig-stub'... ok.
Collecting package info: done
Updating feed 'luci' from 'https://git.openwrt.org/project/luci.git' ...
remote: Enumerating objects: 305, done.
remote: Counting objects: 100% (305/305), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 156 (delta 86), reused 156 (delta 86)
Receiving objects: 100% (156/156), 46.65 KiB | 5.18 MiB/s, done.
Resolving deltas: 100% (86/86), completed with 81 local objects.
From https://git.openwrt.org/project/luci
   d31fa2f..3d6713d  master     -> origin/master
Updating d31fa2f..3d6713d
Fast-forward
 applications/luci-app-acl/po/ko/acl.po             |  18 +-
 applications/luci-app-acme/po/ko/acme.po           |  28 +-
 applications/luci-app-adblock/po/sv/adblock.po     |   8 +-
 .../po/pt_BR/advanced-reboot.po                    |   8 +-
 .../po/es/attendedsysupgrade.po                    |   6 +-
 .../po/sv/attendedsysupgrade.po                    |  63 ++--
 applications/luci-app-banip/po/es/banip.po         |  14 +-
 applications/luci-app-banip/po/sv/banip.po         |   8 +-
 applications/luci-app-ddns/po/ko/ddns.po           |   8 +-
 applications/luci-app-ddns/po/pt_BR/ddns.po        |   6 +-
 applications/luci-app-ddns/po/zh_Hans/ddns.po      |   4 +-
 .../po/sv/dnscrypt-proxy.po                        |   8 +-
 applications/luci-app-dockerman/po/es/dockerman.po |   7 +-
 applications/luci-app-dockerman/po/ko/dockerman.po |   8 +-
 .../luci-app-dockerman/po/pt_BR/dockerman.po       |   8 +-
 applications/luci-app-dockerman/po/ru/dockerman.po |  14 +-
 applications/luci-app-dockerman/po/sv/dockerman.po |  10 +-
 .../luci-app-dockerman/po/zh_Hans/dockerman.po     |   6 +-
 applications/luci-app-firewall/po/ko/firewall.po   |   8 +-
 .../luci-app-firewall/po/zh_Hans/firewall.po       |   8 +-
 applications/luci-app-fwknopd/po/sv/fwknopd.po     |   8 +-
 .../po/sv/https-dns-proxy.po                       |   8 +-
 applications/luci-app-minidlna/po/ko/minidlna.po   |   8 +-
 applications/luci-app-nextdns/po/sv/nextdns.po     |  10 +-
 applications/luci-app-olsr/po/es/olsr.po           |   7 +-
 applications/luci-app-olsr/po/pt_BR/olsr.po        |   6 +-
 applications/luci-app-olsr/po/sv/olsr.po           |   8 +-
 applications/luci-app-openvpn/po/sv/openvpn.po     |   8 +-
 applications/luci-app-pagekitec/po/sv/pagekitec.po |   8 +-
 .../po/ko/shadowsocks-libev.po                     |   8 +-
 .../po/sv/shadowsocks-libev.po                     |   8 +-
 applications/luci-app-splash/po/it/splash.po       |  10 +-
 .../luci-app-statistics/po/ko/statistics.po        |   8 +-
 .../luci-app-statistics/po/sv/statistics.po        |   8 +-
 .../luci-app-statistics/po/zh_Hans/statistics.po   |   6 +-
 .../luci-app-travelmate/po/pt_BR/travelmate.po     |  10 +-
 .../luci-app-travelmate/po/sv/travelmate.po        |   8 +-
 applications/luci-app-upnp/po/ko/upnp.po           |   8 +-
 applications/luci-app-vnstat2/po/sv/vnstat2.po     |   8 +-
 .../po/sv/vpn-policy-routing.po                    |   8 +-
 applications/luci-app-watchcat/po/es/watchcat.po   |  34 +-
 .../luci-app-wireguard/po/pt_BR/wireguard.po       |   6 +-
 .../luci-app-wireguard/po/zh_Hans/wireguard.po     |   6 +-
 modules/luci-base/po/es/base.po                    | 276 ++++++++++------
 modules/luci-base/po/ko/base.po                    |   8 +-
 modules/luci-base/po/pt_BR/base.po                 | 361 ++++++++++++---------
 modules/luci-base/po/ru/base.po                    | 252 ++++++++------
 modules/luci-base/po/sv/base.po                    |  10 +-
 modules/luci-base/po/zh_Hans/base.po               | 243 +++++++-------
 49 files changed, 891 insertions(+), 714 deletions(-)
Create index file './feeds/luci.index' 
Updating feed 'routing' from 'https://git.openwrt.org/feed/routing.git' ...
Already up to date.
Create index file './feeds/routing.index' 
Updating feed 'telephony' from 'https://git.openwrt.org/feed/telephony.git' ...
Already up to date.
Create index file './feeds/telephony.index' 
pippo@wd:~/GHubWRT/openwrt$ ./scripts/feeds install
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a build dependency on 'libpam', which does not exist

Finally I get the same WARNINGS from both:
make dirclean
and
./scripts/feeds install

I think that you need to specify all feeds to the install step:
./scripts/feeds install -a

Hmmm.
But that shouldn't actually have impact, as busybox purely depends on stuff in the main repo.

Are you actually updating source from the main OpenWrt repo?
What does git log show?
Up-to-date master should have these commits:

$ git log --oneline -n 8
a50441b6e9 (HEAD -> master, upstream/master, origin/master, origin/HEAD) kernel: add exfat again
5c469e089e package/exfat: remove
b4f76d9f0d mvebu: enable WRT1900AC v1 and WRT32X for buildbots
15309f5133 mvebu: venom resize kernel to 6MB
10415d5e70 mvebu: mamba resize kernel to 4MB
72885e9608 iproute2: separate tc into tiny and full variants
863ce4f15f kernel/modules: relocate teql hotplug from iproute2 to kmod-sched
10ffefe602 iproute2: add missing limits.h includes

git fetch just fetches the definitions, but does not pull new commits.

You should do "git pull" (or "git merge upstream") after that fetch.

I still think that your repo is somehow stale.

Sorry, I am lost.

pippo@wd:~/GHubWRT/openwrt$ make dirclean
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a build dependency on 'libpam', which does not exist
 make[1] dirclean
pippo@wd:~/GHubWRT/openwrt$ git log --oneline -n 8
b3f4197139 (HEAD -> wlr4100v1002, origin/master, origin/HEAD, master) mtd: fix imagetag compilation
e1b4fd52a8 bcm4908: backport recent bcm_sf2 changes
7091e31230 bcm4908: backport recent bcm4908_enet changes
0f7cd97f81 build,ib: add STRIP_ABI option for manifest
dbde2bcf60 mbedtls: update to 2.16.10
34f898ec29 bmips: backport bcm6368-mdio-mux support
7ec9d95567 bmips: enable CONFIG_B53_MDIO_DRIVER
b434c524b1 bmips: backport b53 spi device tree patch
pippo@wd:~/GHubWRT/openwrt$ git fetch upstream
remote: Enumerating objects: 232, done.
remote: Counting objects: 100% (232/232), done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 336 (delta 212), reused 225 (delta 209), pack-reused 104
Receiving objects: 100% (336/336), 133.87 KiB | 3.19 MiB/s, done.
Resolving deltas: 100% (236/236), completed with 129 local objects.
From https://github.com/openwrt/openwrt
   a50441b6e9..bc356de285  master        -> upstream/master
   afdd5dcd0d..dce6b118eb  openwrt-19.07 -> upstream/openwrt-19.07
   192486ac74..cd48473bb8  openwrt-21.02 -> upstream/openwrt-21.02
pippo@wd:~/GHubWRT/openwrt$ git merge upstream
merge: upstream - not something we can merge
pippo@wd:~/GHubWRT/openwrt$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=<remote>/<branch> wlr4100v1002

pippo@wd:~/GHubWRT/openwrt$ git branch
  master
* wlr4100v1002
pippo@wd:~/GHubWRT/openwrt$ git remote -v
origin	https://github.com/polex/openwrt.git (fetch)
origin	https://github.com/polex/openwrt.git (push)
upstream	https://github.com/openwrt/openwrt.git (fetch)
upstream	https://github.com/openwrt/openwrt.git (push)
pippo@wd:~/GHubWRT/openwrt$ git pull openwrt wlr4100v1002
fatal: 'openwrt' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
pippo@wd:~/GHubWRT/openwrt$ git log --oneline -n 8
b3f4197139 (HEAD -> wlr4100v1002, origin/master, origin/HEAD, master) mtd: fix imagetag compilation
e1b4fd52a8 bcm4908: backport recent bcm_sf2 changes
7091e31230 bcm4908: backport recent bcm4908_enet changes
0f7cd97f81 build,ib: add STRIP_ABI option for manifest
dbde2bcf60 mbedtls: update to 2.16.10
34f898ec29 bmips: backport bcm6368-mdio-mux support
7ec9d95567 bmips: enable CONFIG_B53_MDIO_DRIVER
b434c524b1 bmips: backport b53 spi device tree patch
pippo@wd:~/GHubWRT/openwrt$ 

I agree, Could you suggest me the sequence of commands to issue?

I issued the following sequence of commands:

./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
make

and I did not receive any warning anymore, but the code is still not working like before:

  • GPIO errors for pin 38 (usb power), 45 (ar8337 reset), 2 (wps key), 9 (led).
  • no MT7620 switch1 detection
  • no qca8337 switch0 detection
    Therefore I tried to change to 21.02 branch:
pippo@wd:~/GHubWRT/openwrt$ git reset
Unstaged changes after reset:
M	README.md
M	feeds.conf.default
M	include/kernel-version.mk
M	include/prereq-build.mk
M	include/version.mk
M	package/base-files/image-config.in
M	package/boot/arm-trusted-firmware-mediatek/Makefile
M	package/libs/elfutils/Makefile
M	scripts/getver.sh
M	target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts
M	target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts
M	target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts
M	target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts
M	target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts
M	target/linux/ath79/dts/ar9344_engenius_exx600.dtsi
M	target/linux/ath79/dts/qca9557_engenius_eap1200h.dts
M	target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts
M	target/linux/bcm27xx/patches-5.4/950-0993-xhci-quirks-add-link-TRB-quirk-for-VL805.patch
M	target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcm4908-limit-amount-of-GPIOs.patch
M	target/linux/bcm4908/patches-5.4/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch
M	target/linux/bcm4908/patches-5.4/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch
M	target/linux/bcm53xx/patches-5.4/034-v5.11-0011-ARM-dts-BCM5301X-Add-a-default-compatible-for-switch.patch
M	target/linux/bcm53xx/patches-5.4/034-v5.11-0012-ARM-dts-BCM5301X-Provide-defaults-ports-container-no.patch
D	target/linux/ipq807x/Makefile
D	target/linux/ipq807x/image/Makefile
D	target/linux/ipq807x/profiles/default.mk
M	target/linux/layerscape/patches-5.4/701-net-0229-enetc-Initialize-SerDes-for-SGMII-and-SXGMII-protoco.patch
M	target/linux/layerscape/patches-5.4/701-net-0231-enetc-Use-DT-protocol-information-to-set-up-the-port.patch
M	target/linux/layerscape/patches-5.4/701-net-0232-enetc-Handle-USXGMII-protocol.patch
M	target/linux/layerscape/patches-5.4/701-net-0234-enetc-WA-for-MDIO-register-access-issue.patch
M	target/linux/layerscape/patches-5.4/701-net-0236-enetc-Replace-enetc_gregs-with-a-readers-writer-lock.patch
M	target/linux/layerscape/patches-5.4/701-net-0237-enetc-Remove-mdio-bus-on-PF-probe-error-path.patch
M	target/linux/layerscape/patches-5.4/701-net-0337-enetc-add-support-tsn-capabilities-qbv-qci-qbu-cbs.patch
M	target/linux/layerscape/patches-5.4/701-net-0382-enetc-Make-MDIO-accessors-more-generic-and-export-to.patch
M	target/linux/mediatek/image/mt7622.mk
M	target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
M	target/linux/mediatek/mt7622/config-5.10
M	target/linux/mvebu/cortexa53/base-files/etc/board.d/01_leds
M	target/linux/mvebu/patches-5.4/312-helios4-dts-status-led-alias.patch
pippo@wd:~/GHubWRT/openwrt$ git pull upstream openwrt-21.02
From https://github.com/openwrt/openwrt
 * branch                  openwrt-21.02 -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
	README.md
	feeds.conf.default
	include/kernel-version.mk
	include/prereq-build.mk
	include/version.mk
	package/base-files/image-config.in
	package/boot/arm-trusted-firmware-mediatek/Makefile
	package/libs/elfutils/Makefile
	scripts/getver.sh
	target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts
	target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts
	target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts
	target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts
	target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts
	target/linux/ath79/dts/ar9344_engenius_exx600.dtsi
	target/linux/ath79/dts/qca9557_engenius_eap1200h.dts
	target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts
	target/linux/bcm27xx/patches-5.4/950-0993-xhci-quirks-add-link-TRB-quirk-for-VL805.patch
	target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcm4908-limit-amount-of-GPIOs.patch
	target/linux/bcm4908/patches-5.4/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch
	target/linux/bcm4908/patches-5.4/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch
	target/linux/bcm53xx/patches-5.4/034-v5.11-0011-ARM-dts-BCM5301X-Add-a-default-compatible-for-switch.patch
	target/linux/bcm53xx/patches-5.4/034-v5.11-0012-ARM-dts-BCM5301X-Provide-defaults-ports-container-no.patch
	target/linux/layerscape/patches-5.4/701-net-0229-enetc-Initialize-SerDes-for-SGMII-and-SXGMII-protoco.patch
	target/linux/layerscape/patches-5.4/701-net-0231-enetc-Use-DT-protocol-information-to-set-up-the-port.patch
	target/linux/layerscape/patches-5.4/701-net-0232-enetc-Handle-USXGMII-protocol.patch
	target/linux/layerscape/patches-5.4/701-net-0234-enetc-WA-for-MDIO-register-access-issue.patch
	target/linux/layerscape/patches-5.4/701-net-0236-enetc-Replace-enetc_gregs-with-a-readers-writer-lock.patch
	target/linux/layerscape/patches-5.4/701-net-0237-enetc-Remove-mdio-bus-on-PF-probe-error-path.patch
	target/linux/layerscape/patches-5.4/701-net-0337-enetc-add-support-tsn-capabilities-qbv-qci-qbu-cbs.patch
	target/linux/layerscape/patches-5.4/701-net-0382-enetc-Make-MDIO-accessors-more-generic-and-export-to.patch
	target/linux/mediatek/image/mt7622.mk
	target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
	target/linux/mvebu/cortexa53/base-files/etc/board.d/01_leds
	target/linux/mvebu/patches-5.4/312-helios4-dts-status-led-alias.patch
Please commit your changes or stash them before you merge.
error: The following untracked working tree files would be overwritten by merge:
	target/linux/bcm4908/patches-5.4/702-net-dsa-bcm_sf2-quick-fix-for-RGMII-reg-access-on-BC.patch
	target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-ubnt-unifi-6-lr.dts
Please move or remove them before you merge.
Aborting

I made a local copy of the file to be modify.
What is the sequence of commands for cleaning the context and start from 21.02?

Finally I created 3 folders from scratch for Master, 21.02 and 19.07.7
All branches compiles with no warning.
I retested both Master and 21.02 which have the same behavior: no GPIO and switches detection.

I added the device in to 02_network 01_lead and mt7620.mk.
Here it is the mt7620a_sitecom_wlr-4100v1002.dts for Master and 21.02 branches:

Master and 21.02
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "mt7620a.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	compatible = "sitecom,wlr-4100v1002", "ralink,mt7620a-soc";
	model = "Sitecom sw53 WLR-4100 v1 002";

	chosen {
		bootargs = "console=ttyS0,115200";
	};

	aliases {
		led-boot = &led_power;
		led-failsafe = &led_power;
		led-running = &led_power;
		led-upgrade = &led_power;
	};

	keys {
		compatible = "gpio-keys";

		wps {
			label = "wps";
			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_WPS_BUTTON>;
		};
	};

	leds {
		compatible = "gpio-leds";
		
		led_power: power {	
			label = "amber:power";
			gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
		};

		wifi_led: wifi {
			label = "blue:wifi";
			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
		};

		led_wps: wps {
			label = "white:wps";
			gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
		};
	};
	
	gpio_export {
		compatible = "gpio-export";
		#size-cells = <0>;
		usb-power {
			gpio-export,name = "usb-power";
			gpio-export,output = <1>;
			gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
		};
	};
};

&gpio0 {
	status = "okay";
};

&gpio1 {
	status = "okay";
};

&gpio2 {
	status = "okay";
};

&gpio3 {
	status = "okay";
};

&spi0 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <10000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "uboot";
				reg = <0x0 0x30000>;
				read-only;
			};

			config: partition@30000 {
				label = "config";
				reg = <0x30000 0x10000>;
				read-only;
			};

			factory: partition@40000 {
				label = "factory";
				reg = <0x40000 0x10000>;
				read-only;
			};

			partition@50000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x50000 0x790000>;
			};

			partition@7e0000 {
				label = "backup";
				reg = <0x7e0000 0x10000>;
				read-only;
			};

			partition@7f0000 {
				label = "storage";
				reg = <0x7f0000 0x10000>;
				read-only;
			};
		};
	};
};


&gsw {
	mediatek,port4 = "gmac";
};

&ethernet {
	mtd-mac-address = <&factory 0x4>;
	mediatek,portmap = "wllll";
	pinctrl-names = "default";
	pinctrl-0 = <&rgmii1_pins &mdio_pins>;

	port@5 {
		status = "okay";
		phy-mode = "rgmii";
		mediatek,fixed-link = <1000 1 1 1>;
		phy-handle = <&phy0>;
	};

	mdio-bus {
		status = "okay";
		mediatek,mdio-mode = <1>;
		phy0: ethernet-phy@0 {
				reg = <0>;
				device_type = "ethernet-phy";
				reset-gpios =  <&gpio2 5 GPIO_ACTIVE_LOW>;
				reset-assert-us = <11000>;
				reset-deassert-us = <12000>;
				phy-mode = "rgmii";
				qca,ar8327-initvals = <
					0x04 0x06200000  // PORT0 PAD MODE CTRL
					0x08 0x01000000  //  PORT5 PAD MODE CTRL  RX delay EN all ports 0, 5, 6 
					0x7C 0x0000004e  // 	PORT0_STATUS 
					>;
		};
	};
};

&ohci {
	status = "okay";
};

&wmac {
	status = "okay";
	ralink,mtd-eeprom = <&factory 0>;
};

&state_default {
	gpio {
			group = "uartf", "i2c", "rgmii2", "wled", "spi refclk", "ephy",  "nd_sd";
			function = "gpio";
	};
};

Compared to 19.07:

I modfied the key section compatible = "gpio-keys";
I removed the device name in led
I removed status = "okay"; in ethernet
I reshaped the GPIO pins:

&state_default {
	gpio {
			group = "uartf", "i2c", "rgmii2", "wled", "spi refclk", "ephy",  "nd_sd";
			function = "gpio";

whole 19.07.7 dts file
/dts-v1/;

#include "mt7620a.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	compatible = "sitecom,wlr-4100v1002", "ralink,mt7620a-soc";
	model = "Sitecom sw54 WLR-4100 v1 002";

	aliases {
		led-boot = &led_power;
		led-failsafe = &led_power;
		led-running = &led_power;
		led-upgrade = &led_power;
	};

	chosen {
		bootargs = "console=ttyS0,115200";
	};

	keys {
		compatible = "gpio-keys-polled";
		poll-interval = <20>;

		wps {
			label = "wps";
			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_WPS_BUTTON>;
		};
	};

	leds {	
		compatible = "gpio-leds";
		
		led_power: power {				
			label = "wlr-4100v1002:amber:power";
			gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
		};
		
		wifi2g {
			label = "wlr-4100v1002:blue:wifi2g";					
			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
		};
		
		led_wps: wps {
			label = "wlr-4100v1002:white:wps";
			gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
		};		
	};

	gpio_export {			
		compatible = "gpio-export";
		#size-cells = <0>;
		usb-power {
			gpio-export,name = "usb-power";
			gpio-export,output = <1>;
			gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
		};
	};
};

&gpio0 {
	status = "okay";
};

&gpio1 {
	status = "okay";
};

&gpio2 {
	status = "okay";
};

&gpio3 {
	status = "okay";
};

&spi0 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <10000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "uboot";
				reg = <0x0 0x30000>;
				read-only;
			};

			config: partition@30000 {
				label = "config";
				reg = <0x30000 0x10000>;
				read-only;
			};

			factory: partition@40000 {
				label = "factory";
				reg = <0x40000 0x10000>;
				read-only;
			};

			partition@50000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x50000 0x790000>;
			};

			partition@7e0000 {
				label = "backup";
				reg = <0x7e0000 0x10000>;
				read-only;
			};

			partition@7f0000 {
				label = "storage";
				reg = <0x7f0000 0x10000>;
				read-only;
			};
		};
	};
};


&gsw {
	mediatek,port4 = "gmac";
};

&ethernet {
	status = "okay";
	mtd-mac-address = <&factory 0x4>;
	pinctrl-names = "default";
	pinctrl-0 = <&rgmii1_pins &mdio_pins>;

	port@5 {
		status = "okay";
		phy-mode = "rgmii";
		mediatek,fixed-link = <1000 1 1 1>;
		phy-handle = <&phy0>;
	};

	mdio-bus {
		status = "okay";
		mediatek,mdio-mode = <1>;
		phy0: ethernet-phy@0 {
				reg = <0>;
				phy-mode = "rgmii";
				qca,ar8327-initvals = <
					0x04 0x06200000  // PORT0 PAD MODE CTRL 
					0x08 0x01000000  //  PORT5 PAD MODE CTRL  RX delay EN all ports 0, 5, 6 
					0x7C 0x0000004e  // 	PORT0_STATUS 
					>;
		};
	};
};

&ohci {
	status = "okay";
};

&wmac {
	status = "okay";
	ralink,mtd-eeprom = <&factory 0>;
};

&pinctrl {
	state_default: pinctrl0 {
		gpio {
			ralink,group = "uartf", "i2c", "rgmii2", "wled", "spi refclk", "ephy",  "nd_sd";
			ralink,function = "gpio";
		};
	};
};