Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1 1/1] rtl8821au: new package
@ 2015-07-14 23:01 Christian Stewart
  2015-07-18 21:26 ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Stewart @ 2015-07-14 23:01 UTC (permalink / raw)
  To: buildroot

Adding a kernel module based USB wifi driver. There is no official
version of this driver that works properly on ARM and with newer USB
WiFi cards. This driver version builds module 8821au and is based on a
kernel module release from ASUS with various fixes integrated in.

Signed-off-by: Christian Stewart <christian@paral.in>
---
 package/linux-firmware/Config.in |  5 +++++
 package/rtl8821au/rtl8821au.hash |  1 +
 package/rtl8821au/rtl8821au.mk   | 22 ++++++++++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 package/rtl8821au/rtl8821au.hash
 create mode 100644 package/rtl8821au/rtl8821au.mk

diff --git a/package/linux-firmware/Config.in b/package/linux-firmware/Config.in
index 2e4c205..a99b877 100644
--- a/package/linux-firmware/Config.in
+++ b/package/linux-firmware/Config.in
@@ -189,6 +189,11 @@ config BR2_PACKAGE_LINUX_FIRMWARE_RTL_88XX
 	help
 	  Realtek rtl8821ae
 
+config BR2_PACKAGE_RTL8821AU
+	bool "Realtek 8821AU"
+	help
+	  Realtek rtl8821au kernel module
+
 config BR2_PACKAGE_LINUX_FIRMWARE_TI_WL127X
 	bool "TI wl127x"
 	help
diff --git a/package/rtl8821au/rtl8821au.hash b/package/rtl8821au/rtl8821au.hash
new file mode 100644
index 0000000..21f47a2
--- /dev/null
+++ b/package/rtl8821au/rtl8821au.hash
@@ -0,0 +1 @@
+sha256 7ab9aae237ff562d5c40675115ffb9e36a4774490df0a6a8a4c7746dfd567e14  rtl8821au-4.3.14.tar.gz
diff --git a/package/rtl8821au/rtl8821au.mk b/package/rtl8821au/rtl8821au.mk
new file mode 100644
index 0000000..f5f3da6
--- /dev/null
+++ b/package/rtl8821au/rtl8821au.mk
@@ -0,0 +1,22 @@
+################################################################################
+#
+# rtl8821au
+#
+################################################################################
+
+RTL8821AU_VERSION = 4.3.14
+RTL8821AU_SITE = $(call github,paralin,rtl8821au,v$(RTL8821AU_VERSION))
+
+define RTL8821AU_BUILD_CMDS
+	$(SED) "s/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g" -i $(@D)/Makefile
+	$(MAKE) -C $(@D) ARCH="$(ARCH)" KVER="$(LINUX_VERSION_PROBED)" USER_EXTRA_CFLAGS="-DCONFIG_LITTLE_ENDIAN" CROSS_COMPILE="$(CROSS_COMPILE)" KSRC="$(LINUX_BUILDDIR)" CC="$(TARGET_CC)" LD="$(TARGET_LD)" modules
+endef
+
+define RTL8821AU_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -p -m 644 $(@D)/8821au.ko $(TARGET_DIR)/lib/modules/$(LINUX_VERSION_PROBED)/kernel/drivers/net/wireless/
+	$(HOST_DIR)/sbin/depmod -a --basedir=$(TARGET_DIR) $(LINUX_VERSION_PROBED)
+endef
+
+RTL8821AU_DEPENDENCIES = linux linux-firmware
+
+$(eval $(generic-package))
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v1 1/1] rtl8821au: new package
  2015-07-14 23:01 [Buildroot] [PATCH v1 1/1] rtl8821au: new package Christian Stewart
@ 2015-07-18 21:26 ` Thomas Petazzoni
       [not found]   ` <CA+h8R2rH2Ne_PUe85wMnEc1a817FVun0m61z+FqCfA3ph5NvMQ@mail.gmail.com>
       [not found]   ` <CA+h8R2pR_BU7FRm0R8EHKuA7rqgeeRrzBzy1AkvVEuqo04uAwQ@mail.gmail.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2015-07-18 21:26 UTC (permalink / raw)
  To: buildroot

Dear Christian Stewart,

On Tue, 14 Jul 2015 16:01:01 -0700, Christian Stewart wrote:

> diff --git a/package/linux-firmware/Config.in b/package/linux-firmware/Config.in
> index 2e4c205..a99b877 100644
> --- a/package/linux-firmware/Config.in
> +++ b/package/linux-firmware/Config.in
> @@ -189,6 +189,11 @@ config BR2_PACKAGE_LINUX_FIRMWARE_RTL_88XX
>  	help
>  	  Realtek rtl8821ae
>  
> +config BR2_PACKAGE_RTL8821AU
> +	bool "Realtek 8821AU"
> +	help
> +	  Realtek rtl8821au kernel module

Why are you putting the option in the middle of
package/linux-firmware/Config.in ? It should be in
package/rtl8821au/Config.in, and this file be included from
package/Config.in.

> diff --git a/package/rtl8821au/rtl8821au.hash b/package/rtl8821au/rtl8821au.hash
> new file mode 100644
> index 0000000..21f47a2
> --- /dev/null
> +++ b/package/rtl8821au/rtl8821au.hash
> @@ -0,0 +1 @@
> +sha256 7ab9aae237ff562d5c40675115ffb9e36a4774490df0a6a8a4c7746dfd567e14  rtl8821au-4.3.14.tar.gz
> diff --git a/package/rtl8821au/rtl8821au.mk b/package/rtl8821au/rtl8821au.mk
> new file mode 100644
> index 0000000..f5f3da6
> --- /dev/null
> +++ b/package/rtl8821au/rtl8821au.mk
> @@ -0,0 +1,22 @@
> +################################################################################
> +#
> +# rtl8821au
> +#
> +################################################################################
> +
> +RTL8821AU_VERSION = 4.3.14
> +RTL8821AU_SITE = $(call github,paralin,rtl8821au,v$(RTL8821AU_VERSION))

This is your repo, but it doesn't seem to be the real upstream for the
project. Can you use https://github.com/ulli-kroll/rtl8821au instead,
which seems much more active ? We can accept having a few patches on
top, as long as their are also submitted upstream.

> +define RTL8821AU_BUILD_CMDS
> +	$(SED) "s/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g" -i $(@D)/Makefile
> +	$(MAKE) -C $(@D) ARCH="$(ARCH)" KVER="$(LINUX_VERSION_PROBED)" USER_EXTRA_CFLAGS="-DCONFIG_LITTLE_ENDIAN" CROSS_COMPILE="$(CROSS_COMPILE)" KSRC="$(LINUX_BUILDDIR)" CC="$(TARGET_CC)" LD="$(TARGET_LD)" modules

Hardcoding -DCONFIG_LITTLE_ENDIAN will not work on big endian
architectures. ARCH should probably use KERNEL_ARCH.

> +endef
> +
> +define RTL8821AU_INSTALL_TARGET_CMDS
> +	$(INSTALL) -D -p -m 644 $(@D)/8821au.ko $(TARGET_DIR)/lib/modules/$(LINUX_VERSION_PROBED)/kernel/drivers/net/wireless/
> +	$(HOST_DIR)/sbin/depmod -a --basedir=$(TARGET_DIR) $(LINUX_VERSION_PROBED)
> +endef
> +
> +RTL8821AU_DEPENDENCIES = linux linux-firmware

Why do you depend on the linux-firmware package?

> +$(eval $(generic-package))

Can you look at using the kernel-module infrastructure instead, it
should make things a bit easier. If you have issues, don't hesitate to
ask. I've Cc'ed Yann E. Morin, who is the author of the kernel-module
infrastructure. See also
http://nightly.buildroot.org/manual.html#_infrastructure_for_packages_building_kernel_modules
for the official documentation of this package infrastructure.

In the mean time, I'll mark your patch as Changes Requested in our
patch tracking system, so please resubmit an updated version when you
can!

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v1 1/1] rtl8821au: new package
       [not found]   ` <CA+h8R2rH2Ne_PUe85wMnEc1a817FVun0m61z+FqCfA3ph5NvMQ@mail.gmail.com>
@ 2015-07-20 21:30     ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2015-07-20 21:30 UTC (permalink / raw)
  To: buildroot

Christian,

Please do not reply to me directly, keep the list in Cc. Thanks.

On Mon, 20 Jul 2015 20:55:09 +0000, Christian Stewart wrote:

> I didn't see the kernel module infrastructure before, not really sure how I
> missed it. I remember looking closely at the manual.

The kernel module infra is brand new, it was merged like 10 days ago.

> I put it under linux-firmware because I thought that was where all of the
> wifi related drivers should go. But I think you're right that it should be
> separate.

Yes, it's not a firmware per-se.

> The reason why I'm using my version of the driver is because it's based on
> an entirely different wifi driver release from the other repository you've
> linked. Mine is based on v4.3.14_13455.20150212_BTCOEX20150128-51 while
> theirs is based on a version from a couple years ago. Thus mine is actually
> closer to the vendor version, with some fixups.
> 
> Is it okay to use this version?

I suppose it's not possible to directly download the vendor version?

If not, then using your Github repo is probably OK. The issue is of
course that in 6-12 months, you'll probably stop caring about this
driver, and no-one will be able to upstream fixes anymore. But I guess
that's the normal life-cycle for out of tree kernel drivers,
unfortunately.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v1 1/1] rtl8821au: new package
       [not found]     ` <20150720233051.6ae1947e@free-electrons.com>
@ 2015-07-20 21:35       ` Christian Stewart
  2015-07-20 21:49         ` Yann E. MORIN
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Stewart @ 2015-07-20 21:35 UTC (permalink / raw)
  To: buildroot

All,

I don't think I will forget about maintaining this because we're using the
driver here in the lab extensively. Only thing I can forsee happening is
the vendor releasing another version at some point, but you can always
email me to update the repo and test with the newer version and I'll get on
it pretty quickly.

As per the rtl8821au business...

Is this the best way to specify the defines I need in the makefile:

RTL8821AU_MODULE_MAKE_OPTS = KVER="$(LINUX_VERSION_PROBED)"
ARCH="$(KERNEL_ARCH)"

Also, what's the best way to determine big or little endian? All of the
arch options have different formats for specifying it.

Thanks!
Christian

On Mon, Jul 20, 2015 at 2:30 PM Thomas Petazzoni <
thomas.petazzoni@free-electrons.com> wrote:

> Dear Christian Stewart,
>
> Please keep the list in Cc when replying.
>
> Thanks!
>
> Thomas
>
> On Mon, 20 Jul 2015 21:16:20 +0000, Christian Stewart wrote:
> > Hey,
> >
> > Quick question for Yann.
> >
> > Is this the best way to specify the defines I need in the makefile:
> >
> > RTL8821AU_MODULE_MAKE_OPTS = KVER="$(LINUX_VERSION_PROBED)"
> > ARCH="$(KERNEL_ARCH)"
> >
> > Also, what's the best way to determine big or little endian? All of the
> > arch options have different formats for specifying it...
> >
> > Thanks!
> > Christian
> >
> > On Sat, Jul 18, 2015 at 2:26 PM Thomas Petazzoni <
> > thomas.petazzoni at free-electrons.com> wrote:
> >
> > > Dear Christian Stewart,
> > >
> > > On Tue, 14 Jul 2015 16:01:01 -0700, Christian Stewart wrote:
> > >
> > > > diff --git a/package/linux-firmware/Config.in
> > > b/package/linux-firmware/Config.in
> > > > index 2e4c205..a99b877 100644
> > > > --- a/package/linux-firmware/Config.in
> > > > +++ b/package/linux-firmware/Config.in
> > > > @@ -189,6 +189,11 @@ config BR2_PACKAGE_LINUX_FIRMWARE_RTL_88XX
> > > >       help
> > > >         Realtek rtl8821ae
> > > >
> > > > +config BR2_PACKAGE_RTL8821AU
> > > > +     bool "Realtek 8821AU"
> > > > +     help
> > > > +       Realtek rtl8821au kernel module
> > >
> > > Why are you putting the option in the middle of
> > > package/linux-firmware/Config.in ? It should be in
> > > package/rtl8821au/Config.in, and this file be included from
> > > package/Config.in.
> > >
> > > > diff --git a/package/rtl8821au/rtl8821au.hash
> > > b/package/rtl8821au/rtl8821au.hash
> > > > new file mode 100644
> > > > index 0000000..21f47a2
> > > > --- /dev/null
> > > > +++ b/package/rtl8821au/rtl8821au.hash
> > > > @@ -0,0 +1 @@
> > > > +sha256
> > > 7ab9aae237ff562d5c40675115ffb9e36a4774490df0a6a8a4c7746dfd567e14
> > > rtl8821au-4.3.14.tar.gz
> > > > diff --git a/package/rtl8821au/rtl8821au.mk b/package/rtl8821au/
> > > rtl8821au.mk
> > > > new file mode 100644
> > > > index 0000000..f5f3da6
> > > > --- /dev/null
> > > > +++ b/package/rtl8821au/rtl8821au.mk
> > > > @@ -0,0 +1,22 @@
> > > >
> > >
> +################################################################################
> > > > +#
> > > > +# rtl8821au
> > > > +#
> > > >
> > >
> +################################################################################
> > > > +
> > > > +RTL8821AU_VERSION = 4.3.14
> > > > +RTL8821AU_SITE = $(call
> github,paralin,rtl8821au,v$(RTL8821AU_VERSION))
> > >
> > > This is your repo, but it doesn't seem to be the real upstream for the
> > > project. Can you use https://github.com/ulli-kroll/rtl8821au instead,
> > > which seems much more active ? We can accept having a few patches on
> > > top, as long as their are also submitted upstream.
> > >
> > > > +define RTL8821AU_BUILD_CMDS
> > > > +     $(SED) "s/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC =
> > > n/g" -i $(@D)/Makefile
> > > > +     $(MAKE) -C $(@D) ARCH="$(ARCH)" KVER="$(LINUX_VERSION_PROBED)"
> > > USER_EXTRA_CFLAGS="-DCONFIG_LITTLE_ENDIAN"
> CROSS_COMPILE="$(CROSS_COMPILE)"
> > > KSRC="$(LINUX_BUILDDIR)" CC="$(TARGET_CC)" LD="$(TARGET_LD)" modules
> > >
> > > Hardcoding -DCONFIG_LITTLE_ENDIAN will not work on big endian
> > > architectures. ARCH should probably use KERNEL_ARCH.
> > >
> > > > +endef
> > > > +
> > > > +define RTL8821AU_INSTALL_TARGET_CMDS
> > > > +     $(INSTALL) -D -p -m 644 $(@D)/8821au.ko
> > >
> $(TARGET_DIR)/lib/modules/$(LINUX_VERSION_PROBED)/kernel/drivers/net/wireless/
> > > > +     $(HOST_DIR)/sbin/depmod -a --basedir=$(TARGET_DIR)
> > > $(LINUX_VERSION_PROBED)
> > > > +endef
> > > > +
> > > > +RTL8821AU_DEPENDENCIES = linux linux-firmware
> > >
> > > Why do you depend on the linux-firmware package?
> > >
> > > > +$(eval $(generic-package))
> > >
> > > Can you look at using the kernel-module infrastructure instead, it
> > > should make things a bit easier. If you have issues, don't hesitate to
> > > ask. I've Cc'ed Yann E. Morin, who is the author of the kernel-module
> > > infrastructure. See also
> > >
> > >
> http://nightly.buildroot.org/manual.html#_infrastructure_for_packages_building_kernel_modules
> > > for the official documentation of this package infrastructure.
> > >
> > > In the mean time, I'll mark your patch as Changes Requested in our
> > > patch tracking system, so please resubmit an updated version when you
> > > can!
> > >
> > > Thanks a lot!
> > >
> > > Thomas
> > > --
> > > Thomas Petazzoni, CTO, Free Electrons
> > > Embedded Linux, Kernel and Android engineering
> > > http://free-electrons.com
> > >
>
>
>
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20150720/7925581e/attachment.html>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v1 1/1] rtl8821au: new package
  2015-07-20 21:35       ` Christian Stewart
@ 2015-07-20 21:49         ` Yann E. MORIN
  0 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2015-07-20 21:49 UTC (permalink / raw)
  To: buildroot

Christian, All,

On 2015-07-20 21:35 +0000, Christian Stewart spake thusly:
> I don't think I will forget about maintaining this because we're using the
> driver here in the lab extensively. Only thing I can forsee happening is
> the vendor releasing another version at some point, but you can always
> email me to update the repo and test with the newer version and I'll get on
> it pretty quickly.

Yeah, as Thomas said, we have no choice in this case, and yuour repo is
as good as any other in this respect. Thanks for doing that work! :-)

> As per the rtl8821au business...
> 
> Is this the best way to specify the defines I need in the makefile:
> 
> RTL8821AU_MODULE_MAKE_OPTS = KVER="$(LINUX_VERSION_PROBED)"
> ARCH="$(KERNEL_ARCH)"

Well, you can ditch ARCH, it's already passed by the kernel-module infra.
Also, do not quote the version string, so just:

    RTL8821AU_MODULE_MAKE_OPTS = KVER=$(LINUX_VERSION_PROBED)

> Also, what's the best way to determine big or little endian? All of the
> arch options have different formats for specifying it.

We do have BR2_ENDIAN that is a string for the endianness, either BIG or
LITTLE.

So I'd say:

    ifeq ($(call qstrip,$(BR2_ENDAIN)),BIG)
    RTL8821AU_CFLAGS_ENDIAN = -DCONFIG_BIG_ENDIAN
    else
    RTL8821AU_CFLAGS_ENDIAN = -DCONFIG_LITTLE_ENDIAN
    endif

Then use that as:

    RTL8821AU_MODULE_MAKE_OPTS = \
        KVER=$(LINUX_VERSION_PROBED) \
        USER_EXTRA_CFLAGS=$(RTL8821AU_CFLAGS_ENDIAN)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-20 21:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-14 23:01 [Buildroot] [PATCH v1 1/1] rtl8821au: new package Christian Stewart
2015-07-18 21:26 ` Thomas Petazzoni
     [not found]   ` <CA+h8R2rH2Ne_PUe85wMnEc1a817FVun0m61z+FqCfA3ph5NvMQ@mail.gmail.com>
2015-07-20 21:30     ` Thomas Petazzoni
     [not found]   ` <CA+h8R2pR_BU7FRm0R8EHKuA7rqgeeRrzBzy1AkvVEuqo04uAwQ@mail.gmail.com>
     [not found]     ` <20150720233051.6ae1947e@free-electrons.com>
2015-07-20 21:35       ` Christian Stewart
2015-07-20 21:49         ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox