2025年10月29日 星期三

WE310K6 on NV Orin

The main chip is RTL8852be.
Found another driver below, not tested yet


The drive comes from Telit, not downloaded from above.
  • WiFi
source/kernel/kernel-jammy-src/drivers/net/wireless/Makefile
...
...
obj-$(CONFIG_RTL8852BE) += we310k6/

source/kernel/kernel-jammy-src/drivers/net/wireless/Kconfig
...
...
source "drivers/net/wireless/we310k6/Kconfig"

source/kernel/kernel-jammy-src/drivers/net/wireless/we310k6/Makefile
...
...
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_RADIO_WORK -DCONFIG_PLATFORM_OPS
...
...
EXTRA_CFLAGS += -I$(src)/platform
...
...
CONFIG_PLATFORM_I386_PC = n
...
...
########### PLATFORM OPS  ##########################
# Import platform specific compile options
EXTRA_CFLAGS += -I$(src)/platform

# Explicitly select platform-specific PCI operations file
# Based on your system (Orin is AArch64 Linux), we'll assume platform_linux_pc_pci.c is correct.
# You might need to adjust this logic if you have a more specific platform configuration macro.
# Check the ARCH variable that the kernel build system passes.

# Clear _PLATFORM_FILES to prevent unintended inclusions from .mk files if they re-assign it.
_PLATFORM_FILES =

ifeq ($(ARCH),arm64) # For NVIDIA Orin
    # This assumes platform_linux_pc_pci.c is the correct file for ARM64 Linux
    _PLATFORM_FILES += platform/platform_linux_pc_pci.o platform/platform_ops.o
    EXTRA_CFLAGS += -DCONFIG_PLATFORM_LINUX_PC # If this define is used in your code
    # Comment out other platform-specific configs if they are set to 'y' earlier
    # For example, ensure CONFIG_PLATFORM_I386_PC is 'n'
endif
ifeq ($(ARCH),x86) # For generic Linux PC (i386/x86_64)
    _PLATFORM_FILES += platform/platform_linux_pc_pci.o
    EXTRA_CFLAGS += -DCONFIG_PLATFORM_I386_PC # If this define is used in your code
endif
ifeq ($(ARCH),mips) # For MIPS platforms
    _PLATFORM_FILES += platform/platform_mips_98d_pci.o
    EXTRA_CFLAGS += -DCONFIG_PLATFORM_RTL8198D # If this define is used in your code
endif
# Add more conditions for other platforms if needed, following the same pattern.
# Make sure only one of these blocks evaluates to true for your target system.

# Add the selected platform files to the build objects
OBJS += $(_PLATFORM_FILES)
...
...

  • BT
Note: BT is working on UART
Since the default setting is PCIE+USB via M.2 on NV Orin, WE310K6 BT didn't work on it.
source/kernel/kernel-jammy-src/drivers/bluetooth/Kconfig
config BT_WE310K6
        tristate "WE310K6 Bluetooth driver support"
        depends on BT
        help
          This is a driver for the WE310K6 Bluetooth controller.
          If you have this hardware, say Y or M here.
          Say N otherwise.

source "drivers/bluetooth/we310k6/Kconfig"


source/kernel/kernel-jammy-src/drivers/bluetooth/Makefile
obj-$(CONFIG_BT_WE310K6) += we310k6/


source/kernel/kernel-jammy-src/drivers/bluetooth/we310k6/Makefile
obj-$(config_bt_we310k6) += bt_we310k6.o

bt_we310k6-y := hci_h4.o hci_ldisc.o hci_rtk_h5.o rtk_coex.o


Telit's document.
Bluetooth® controller. For WE310K6 Bluetooth UART, please use rtk_hciattach.
Do not use the hciattach compiled by BlueZ.
Initialization is performed by rtk_hciattach -n -s 115200 ttyUSB0 rtk_h5 
or 
rtk_hciattach -n -s 115200 ttyUSB0 rtk_h4 commands, where the serial device name will be different on each platform. 
We are using 3 wire protocol So please use the below command to Initialization.

沒有留言:

張貼留言