mt76x8: Switch to DSA architecture?

2021-06-13 Thread Reto Schneider

Hi all,

I am wondering if anyone is working on porting the mt76x8 targets over 
to DSA. If no such work has yet started - are there any roadblocks 
foreseeable?


I am interested in this happening, and willing to put in effort and/or 
money.


Kind regards,
Reto

ps: My ultimate goal is to get DSA running on a Yocto and MediaTek 
MT7688 based IoT gateway, but I feel like this ML is a good place to get 
started.


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] mt76x8: Strange GPIO numbering on Onion Omega2+

2021-06-12 Thread Reto Schneider

Hi Gerd,

Very late to the party, but I had a similar problem on my MT7688 based 
device and came up with the attached (not yet upstreamed) patch.


While I also was also able to verify the problem for OpenWRT (yesterdays 
OpenWrt SNAPSHOT r16925-b721579842) using a LinkIt Smart 7688, I have 
not actually integrated the patch in and therefore not tested on 
OpenWRT. Not sure if and when I'll find the time to do so. Hope this is 
still helpful to someone.


Kind regards,
Reto

[1] 
https://github.com/husqvarnagroup/smart-garden-gateway-yocto-meta-mediatek/blob/38b41e0a68a9b1ca4cd7af33ad37177ef63ba62d/recipes-kernel/linux/linux-yocto-tiny-5.10.42/0013-gpio-mt7621-Assign-base-field-in-gpio_chip.patch
From f0891893dd8d65e59f5ae4ef19c2a509f35d060f Mon Sep 17 00:00:00 2001
From: Reto Schneider 
Date: Sat, 5 Jun 2021 14:21:17 +0200
Subject: [PATCH] gpio: mt7621: Assign base field in gpio_chip

This is needed for gpiochip_sysfs_register() to properly export
/sys/class/gpio/gpiochip{0,32,64}.

Without this fix, the field base in gpio_device remains at its
initialization value, which is -1. This causes
gpiochip_add_data_with_key() to call gpiochip_find_base(), which in turn
dynamically determines the base to be at ARCH_NR_GPIOS - 32/64/96,
resulting in gpiochip{480,448,416}.

Detected/fixed/tested on a MediaTek MT7688 based GARDENA smart gateway.

Signed-off-by: Reto Schneider 
---
 drivers/gpio/gpio-mt7621.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c
index 82fb20dca53a..403d64cd65a6 100644
--- a/drivers/gpio/gpio-mt7621.c
+++ b/drivers/gpio/gpio-mt7621.c
@@ -234,6 +234,7 @@ mediatek_gpio_bank_probe(struct device *dev,
 		return ret;
 	}
 
+	rg->chip.base = rg->bank * MTK_BANK_WIDTH;
 	rg->chip.of_gpio_n_cells = 2;
 	rg->chip.of_xlate = mediatek_gpio_xlate;
 	rg->chip.label = devm_kasprintf(dev, GFP_KERNEL, "%s-bank%d",
-- 
2.30.2

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel