Re: Adding a new platform: renesas rz

2023-11-03 Thread Michele Bisogno
> Renesas offers different architectures in their portfolio[1], I haven't
> dug into the OpenWRT build system for this issue yet to tell whether it
> is able to handle that at this folder level. Much of the above is
> "legacy" and does not run OpenWRT(?), but they also seem to aim for
> Risc-V. There is a platform called "ramips" and the broadcoms each have
> their own subdirectory. None of them have punctuation yet. Maybe call it
> "renesasrz"? They're also offering other ARM-based SoCs, and building
> common kernels might become difficult.
> Torsten
> [1] 
> https://www.renesas.com/eu/en/products/microcontrollers-microprocessors/other-mcus-mpus

Hi Torsten,

what is listed there is old stuff. Renesas MPUs are now all under the
RZ umbrella.
Well, actually there are also the rcar devices, but these are automotive SoCs.
Yes, there is an RZ device that is not Arm: RZ/Five. For now it is a
single device based on a Andes core.

Kind regards,
Michele

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


Re: Adding a new platform: renesas rz

2023-11-03 Thread Torsten Duwe
Hi Michele,

On Fri, 3 Nov 2023 09:04:08 +0100
Michele Bisogno  wrote:

> > is able to handle that at this folder level. Much of the above is
> > "legacy" and does not run OpenWRT(?), but they also seem to aim for
> > Risc-V. There is a platform called "ramips" and the broadcoms each
> > have their own subdirectory.
[...]
> 
> what is listed there is old stuff.

I thought so, thanks for the confirmation.

> Renesas MPUs are now all under the RZ umbrella.

The question then is: are they similar enough to build from one kernel
source, or will they require different sets of patches?

> Well, actually there are also the rcar devices, but these are
> automotive SoCs. Yes, there is an RZ device that is not Arm: RZ/Five.
> For now it is a single device based on a Andes core.

Have you looked at the peripherials on the SoCs? Is RZ/Five identical
to RZ/Arm in that respect? I've seen this at WinChipHead, for
microcontrollers. The reasoning again would be whether it could be
built from the same source code base.

If not, how about "rzarm", leaving room for future "rzfive"? I know this
sounds like bike shedding, but it might actually save some renaming
work in the future. Naming it just "renesas" does not feel right, IMHO.

Torsten



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


Re: Adding a new platform: renesas rz

2023-11-03 Thread Michele Bisogno
Torsten,

> The question then is: are they similar enough to build from one kernel
> source, or will they require different sets of patches?

RZ includes different subseries, as of today: RZ/G, RZ/V and some new
RZ/T run Linux.
Renesas official SW package is based on the CIP Linux, even though the
support of the devices is regularly upstreamed in the Linux kernel.
I kind of know that the maintainers are trying to keep things
consistent and usually the same kernel image works for all the
supported devices, requiring just a different device tree.
My idea at the moment is to add the devices that are supported in Linux 6.1.


> Have you looked at the peripherials on the SoCs? Is RZ/Five identical
> to RZ/Arm in that respect? I've seen this at WinChipHead, for
> microcontrollers. The reasoning again would be whether it could be
> built from the same source code base.

RZ/Five is basically a RZ/G2UL with a RISC-V CPU instead of Arm.
Of course for RZ/Five the same kernel binary cannot work.
On top of that, it's a pity that the RZ/Five started to be supported
from 6.2, I'm not sure what to do with it.

> If not, how about "rzarm", leaving room for future "rzfive"? I know this
> sounds like bike shedding, but it might actually save some renaming
> work in the future. Naming it just "renesas" does not feel right, IMHO.

Honestly I am fine with any naming, that's why I am here asking and
discussing it.

Kind regards,
Michele

On Fri, 3 Nov 2023 at 09:04, Michele Bisogno  wrote:
>
> > Renesas offers different architectures in their portfolio[1], I haven't
> > dug into the OpenWRT build system for this issue yet to tell whether it
> > is able to handle that at this folder level. Much of the above is
> > "legacy" and does not run OpenWRT(?), but they also seem to aim for
> > Risc-V. There is a platform called "ramips" and the broadcoms each have
> > their own subdirectory. None of them have punctuation yet. Maybe call it
> > "renesasrz"? They're also offering other ARM-based SoCs, and building
> > common kernels might become difficult.
> > Torsten
> > [1] 
> > https://www.renesas.com/eu/en/products/microcontrollers-microprocessors/other-mcus-mpus
>
> Hi Torsten,
>
> what is listed there is old stuff. Renesas MPUs are now all under the
> RZ umbrella.
> Well, actually there are also the rcar devices, but these are automotive SoCs.
> Yes, there is an RZ device that is not Arm: RZ/Five. For now it is a
> single device based on a Andes core.
>
> Kind regards,
> Michele

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


Re: Adding a new platform: renesas rz

2023-11-03 Thread Michele Bisogno
Hi Matt,

> Does the Renesas/RZ U-boot have EFI support enabled ('bootefi' command)?
> Could you try an armsr/armv8 image and see if it boots?

I've just tried:

=> fatload mmc 1:1 0x4800 openwrt-armsr-armv8-generic-initramfs-kernel.bin
32223744 bytes read in 2669 ms (11.5 MiB/s)
=> bootefi 0x4800
Scanning disk s...@11c0.blk...
Scanning disk s...@11c1.blk...
Found 13 disks
No EFI system partition
Booting /openwrt-armsr-armv8-generic-initramfs-kernel.bin
EFI stub: Booting Linux Kernel...
EFI stub: EFI_RNG_PROTOCOL unavailable
EFI stub: ERROR: FIRMWARE BUG: kernel image not aligned on 64k boundary
EFI stub: Using DTB from configuration table
EFI stub: Exiting boot services...

And it hangs here.
I suppose there are still some missing bits in u-boot to make it
happen. I'm investigating.

Kind regards,
Michele

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


[PATCH v2 0/2] Add support for rtw8822bu

2023-11-03 Thread Alexis Lothoré via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
Hello,
This series aims to enable support for RTW8822BU dongles. This chip is a
802.11ac wireless usb chip. Corresponding support has been added in Linux
6.1.
This version follows Hauke's suggestion to resplit RTW88 into PCI and USB
options. I finally went further and added options per-chip instead of
per-bus, because the first options would still have "forced" some options
which do not look relevant for all chips in the same family (eg 802.11 AC
enforced for all PCI chips)

Changes in v2:
- re-split exisiting rtw88 package to properly define bus dependency
- Link to V1: 
http://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041652.html

Alexis Lothoré (2):
  mac80211: split rtw88 configuration for each supported chip
  mac80211: add support for rtw88_8822bu

 package/kernel/mac80211/realtek.mk | 109 +
 1 file changed, 94 insertions(+), 15 deletions(-)

-- 
2.42.0


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


[PATCH v2 1/2] mac80211: split rtw88 configuration for each supported chip

2023-11-03 Thread Alexis Lothoré via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
From: Alexis Lothoré 

Current rtw88 build configuration builds modules for all chips supported by
rtw88 driver family. This brings the following issues:
- adding a chip with a different bus is not convenient (all chips currently
  depends on PCI)
- some features requirements are not relevant for all chips in family (eg
  802.11AC is enforced but RTW88-8723DE is only a 802.11b/g/n chip)

Remove those constraints/issues by adding one module build option per
supported chip, and add intermediate options to properly cascade
dependencies.

Signed-off-by: Alexis Lothoré 
---
 package/kernel/mac80211/realtek.mk | 90 +-
 1 file changed, 75 insertions(+), 15 deletions(-)

diff --git a/package/kernel/mac80211/realtek.mk 
b/package/kernel/mac80211/realtek.mk
index 9c143583265e..3cd6740e6c6e 100644
--- a/package/kernel/mac80211/realtek.mk
+++ b/package/kernel/mac80211/realtek.mk
@@ -1,7 +1,8 @@
 PKG_DRIVERS += \
rtlwifi rtlwifi-pci rtlwifi-btcoexist rtlwifi-usb rtl8192c-common \
rtl8192ce rtl8192se rtl8192de rtl8192cu rtl8723bs rtl8821ae \
-   rtl8xxxu rtw88
+   rtl8xxxu rtw88 rtw88-pci rtw88-8822b rtw88-8822c rtw88-8723d \
+   rtw88-8822be rtw88-8822ce rtw88-8723de
 
 config-$(call config_package,rtlwifi) += RTL_CARDS RTLWIFI
 config-$(call config_package,rtlwifi-pci) += RTLWIFI_PCI
@@ -21,8 +22,14 @@ config-y += RTL8XXXU_UNTESTED
 config-$(call config_package,rtl8723bs) += RTL8723BS
 config-y += STAGING
 
-config-$(call config_package,rtw88) += RTW88 RTW88_CORE RTW88_PCI
-config-y += RTW88_8822BE RTW88_8822CE RTW88_8723DE
+config-$(call config_package,rtw88) += RTW88 RTW88_CORE
+config-$(call config_package,rtw88-pci) += RTW88_PCI
+config-$(call config_package,rtw88-8822b) += RTW88_8822B
+config-$(call config_package,rtw88-8822be) += RTW88_8822BE
+config-$(call config_package,rtw88-8822c) += RTW88_8822C
+config-$(call config_package,rtw88-8822ce) += RTW88_8822CE
+config-$(call config_package,rtw88-8723d) += RTW88_8723D
+config-$(call config_package,rtw88-8723de) += RTW88_8723DE
 config-$(CONFIG_PACKAGE_RTW88_DEBUG) += RTW88_DEBUG
 config-$(CONFIG_PACKAGE_RTW88_DEBUGFS) += RTW88_DEBUGFS
 
@@ -168,18 +175,71 @@ endef
 
 define KernelPackage/rtw88
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek RTL8822BE/RTL8822CE/RTL8723DE
-  DEPENDS+= @(PCI_SUPPORT) +kmod-mac80211 +@DRIVER_11AC_SUPPORT
-  FILES:=\
-   $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822be.ko \
-   $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko \
-   $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822ce.ko \
-   $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822c.ko \
-   $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723de.ko \
-   $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723d.ko \
-   $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_core.ko \
-   $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_pci.ko
-  AUTOLOAD:=$(call AutoProbe,rtw88_8822be rtw88_8822ce rtw88_8723de)
+  TITLE:=Realtek RTW88 common part
+  DEPENDS+= @PCI_SUPPORT +kmod-mac80211
+  FILES:=  
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_core.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_core)
+  HIDDEN:=1
+endef
+
+define KernelPackage/rtw88-pci
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTW88 PCI chips support
+  DEPENDS+= @PCI_SUPPORT +kmod-rtw88
+  FILES:=  $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_pci.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_pci)
+  HIDDEN:=1
+endef
+
+define KernelPackage/rtw88-8822b
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8822B family support
+  DEPENDS+= +kmod-rtw88 +@DRIVER_11AC_SUPPORT
+  FILES:=  
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_8822b)
+  HIDDEN:=1
+endef
+
+define KernelPackage/rtw88-8822c
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8822C family support
+  DEPENDS+= +kmod-rtw88 +@DRIVER_11AC_SUPPORT
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822c.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_8822c)
+  HIDDEN:=1
+endef
+
+define KernelPackage/rtw88-8723d
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8723D family support
+  DEPENDS+= +kmod-rtw88
+  FILES:=  
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723d.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_8723d)
+  HIDDEN:=1
+endef
+
+define KernelPackage/rtw88-8822be
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8822BE support
+  DEPENDS+= +kmod-rtw88-pci +kmod-rtw88-8822b
+  FILES:=  
$(PKG_BUILD_DIR)/drivers/net/wireless/rea

[PATCH v2 2/2] mac80211: add support for rtw88_8822bu

2023-11-03 Thread Alexis Lothoré via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
From: Alexis Lothoré 

Kernel 6.1 has introduced support for RTW8822BU network adapter, which
is an USB variant of the rtw8822b 802.11ac chipset family.

Build and install the corresponding module in the rtw88 package

Signed-off-by: Alexis Lothoré 
---
 package/kernel/mac80211/realtek.mk | 25 ++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/package/kernel/mac80211/realtek.mk 
b/package/kernel/mac80211/realtek.mk
index 3cd6740e6c6e..db2c4e395c16 100644
--- a/package/kernel/mac80211/realtek.mk
+++ b/package/kernel/mac80211/realtek.mk
@@ -1,8 +1,8 @@
 PKG_DRIVERS += \
rtlwifi rtlwifi-pci rtlwifi-btcoexist rtlwifi-usb rtl8192c-common \
rtl8192ce rtl8192se rtl8192de rtl8192cu rtl8723bs rtl8821ae \
-   rtl8xxxu rtw88 rtw88-pci rtw88-8822b rtw88-8822c rtw88-8723d \
-   rtw88-8822be rtw88-8822ce rtw88-8723de
+   rtl8xxxu rtw88 rtw88-pci rtw88-usb rtw88-8822b rtw88-8822c rtw88-8723d \
+   rtw88-8822be rtw88-8822bu rtw88-8822ce rtw88-8723de
 
 config-$(call config_package,rtlwifi) += RTL_CARDS RTLWIFI
 config-$(call config_package,rtlwifi-pci) += RTLWIFI_PCI
@@ -24,8 +24,10 @@ config-y += STAGING
 
 config-$(call config_package,rtw88) += RTW88 RTW88_CORE
 config-$(call config_package,rtw88-pci) += RTW88_PCI
+config-$(call config_package,rtw88-usb) += RTW88_USB
 config-$(call config_package,rtw88-8822b) += RTW88_8822B
 config-$(call config_package,rtw88-8822be) += RTW88_8822BE
+config-$(call config_package,rtw88-8822bu) += RTW88_8822BU
 config-$(call config_package,rtw88-8822c) += RTW88_8822C
 config-$(call config_package,rtw88-8822ce) += RTW88_8822CE
 config-$(call config_package,rtw88-8723d) += RTW88_8723D
@@ -176,7 +178,7 @@ endef
 define KernelPackage/rtw88
   $(call KernelPackage/mac80211/Default)
   TITLE:=Realtek RTW88 common part
-  DEPENDS+= @PCI_SUPPORT +kmod-mac80211
+  DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211
   FILES:=  
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_core.ko
   AUTOLOAD:=$(call AutoProbe,rtw88_core)
   HIDDEN:=1
@@ -191,6 +193,15 @@ define KernelPackage/rtw88-pci
   HIDDEN:=1
 endef
 
+define KernelPackage/rtw88-usb
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTW88 USB chips support
+  DEPENDS+= @USB_SUPPORT +kmod-rtw88
+  FILES:=  $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_usb.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_usb)
+  HIDDEN:=1
+endef
+
 define KernelPackage/rtw88-8822b
   $(call KernelPackage/mac80211/Default)
   TITLE:=Realtek RTL8822B family support
@@ -226,6 +237,14 @@ define KernelPackage/rtw88-8822be
   AUTOLOAD:=$(call AutoProbe,rtw88_8822be)
 endef
 
+define KernelPackage/rtw88-8822bu
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8822BU support
+  DEPENDS+= +kmod-rtw88-usb +rtl8822be-firmware +kmod-rtw88-8822b
+  FILES:=  
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822bu.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_8822bu)
+endef
+
 define KernelPackage/rtw88-8822ce
   $(call KernelPackage/mac80211/Default)
   TITLE:=Realtek RTL8822CE support
-- 
2.42.0


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