Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cross compile openwrt #6

Open
DittelHome opened this issue Mar 19, 2020 · 4 comments
Open

cross compile openwrt #6

DittelHome opened this issue Mar 19, 2020 · 4 comments

Comments

@DittelHome
Copy link

Hi,
i am a end user.
I tried several hours to do a cross compile for my router (Archer C7), without success.
Is it possible to make the driver available to the openwrt project ?
regards

@ulli-kroll
Copy link
Owner

currently working on this issue #8

but you should read here
https://github.com/ulli-kroll/rtl8821au

If you build openwrt from "source" you should adapt
KSRC and CROSS_COMPILE to your needs

If you use -stable binaries you are out of luck
or install the SDK
also it may be possible this is also true for -development

I know this is hard for a true beginner/end user

@caydenm
Copy link

caydenm commented Oct 8, 2020

I have sucessfully got this to compile on Openwrt. You be able to check out the source for openwrt as defined here, create a folder in package/kernel called rtw88-usb-new and then put the file below in it. After that simply type make menuconfig, select this package from the kernel modules > wireless devices menu.

You will need to manually copy across the firmware and place in /lib/firmware/rtw88/.

include $(TOPDIR)/rules.mk

PKG_NAME:=rtw88-usb-new
PKG_RELEASE:=2

PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=

PKG_SOURCE_URL:=https://github.com/ulli-kroll/rtw88-usb.git
PKG_SOURCE_PROTO:=git
#PKG_SOURCE_DATE:=2020-10-17
#PKG_SOURCE_VERSION:=f9f4ee862b3e1f9e6a543d503a08d8de9b18b8f9
PKG_SOURCE_VERSION:=d6b859eed430c24cb74301cafaa1eab25f103dab
#PKG_MIRROR_HASH:=60359df8b49fa433d38b968b0df7eaddaca10f13cdd57471394bac1f6e5a162e

# PKG_MAINTAINER:=
PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk

define KernelPackage/rtw88-usb-new
  SUBMENU:=Wireless Drivers
  TITLE:=Realtek rtw88-usb new version testing
   DEPENDS:=+kmod-cfg80211 +kmod-mac80211 +kmod-usb-core +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT
  FILES:=\
	$(PKG_BUILD_DIR)/rtw88_pci.ko \
	$(PKG_BUILD_DIR)/rtw88_usb.ko \
	$(PKG_BUILD_DIR)/rtw88_core.ko \
	$(PKG_BUILD_DIR)/rtw88_8822cu.ko \
	$(PKG_BUILD_DIR)/rtw88_8822ce.ko \
	$(PKG_BUILD_DIR)/rtw88_8822c.ko \
	$(PKG_BUILD_DIR)/rtw88_8822b.ko \
	$(PKG_BUILD_DIR)/rtw88_8822be.ko \
	$(PKG_BUILD_DIR)/rtw88_8822bu.ko \
	$(PKG_BUILD_DIR)/rtw88_8723d.ko \
	$(PKG_BUILD_DIR)/rtw88_8723de.ko \
	$(PKG_BUILD_DIR)/rtw88_8821c.ko \
	$(PKG_BUILD_DIR)/rtw88_8821cu.ko
  AUTOLOAD:=$(call AutoProbe, rtw88_8821cu)
endef

define Build/Compile
	+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
		$(KERNEL_MAKE_FLAGS) \
		M="$(PKG_BUILD_DIR)" \
		modules
endef

$(eval $(call KernelPackage,rtw88-usb-new))

@ulli-kroll
Copy link
Owner

You forgot there is (currently) no master branch with all USB-ID's here.

I hope I sort this out after reading some other phy_init/mac_init code
and compare this with 8723d
;-)

@RezApp
Copy link

RezApp commented Jun 27, 2023

I have sucessfully got this to compile on Openwrt. You be able to check out the source for openwrt as defined here, create a folder in package/kernel called rtw88-usb-new and then put the file below in it. After that simply type make menuconfig, select this package from the kernel modules > wireless devices menu.

You will need to manually copy across the firmware and place in /lib/firmware/rtw88/.

include $(TOPDIR)/rules.mk

PKG_NAME:=rtw88-usb-new
PKG_RELEASE:=2

PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=

PKG_SOURCE_URL:=https://github.com/ulli-kroll/rtw88-usb.git
PKG_SOURCE_PROTO:=git
#PKG_SOURCE_DATE:=2020-10-17
#PKG_SOURCE_VERSION:=f9f4ee862b3e1f9e6a543d503a08d8de9b18b8f9
PKG_SOURCE_VERSION:=d6b859eed430c24cb74301cafaa1eab25f103dab
#PKG_MIRROR_HASH:=60359df8b49fa433d38b968b0df7eaddaca10f13cdd57471394bac1f6e5a162e

# PKG_MAINTAINER:=
PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk

define KernelPackage/rtw88-usb-new
  SUBMENU:=Wireless Drivers
  TITLE:=Realtek rtw88-usb new version testing
   DEPENDS:=+kmod-cfg80211 +kmod-mac80211 +kmod-usb-core +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT
  FILES:=\
	$(PKG_BUILD_DIR)/rtw88_pci.ko \
	$(PKG_BUILD_DIR)/rtw88_usb.ko \
	$(PKG_BUILD_DIR)/rtw88_core.ko \
	$(PKG_BUILD_DIR)/rtw88_8822cu.ko \
	$(PKG_BUILD_DIR)/rtw88_8822ce.ko \
	$(PKG_BUILD_DIR)/rtw88_8822c.ko \
	$(PKG_BUILD_DIR)/rtw88_8822b.ko \
	$(PKG_BUILD_DIR)/rtw88_8822be.ko \
	$(PKG_BUILD_DIR)/rtw88_8822bu.ko \
	$(PKG_BUILD_DIR)/rtw88_8723d.ko \
	$(PKG_BUILD_DIR)/rtw88_8723de.ko \
	$(PKG_BUILD_DIR)/rtw88_8821c.ko \
	$(PKG_BUILD_DIR)/rtw88_8821cu.ko
  AUTOLOAD:=$(call AutoProbe, rtw88_8821cu)
endef

define Build/Compile
	+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
		$(KERNEL_MAKE_FLAGS) \
		M="$(PKG_BUILD_DIR)" \
		modules
endef

$(eval $(call KernelPackage,rtw88-usb-new))

Thanks for your instruction, but it doesn't work for me
not even detect my TP-Link Archer T4U V3 (RTL8812BU) on Raspberry Pi 3 Model B Rev 1.2 with OpenWrt 22.03.5
do you have any suggestion for me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants