diff mbox series

[1/5] xr819-firmware: new package

Message ID 20171104194049.24550-2-geomatsi@gmail.com
State Changes Requested
Headers show
Series orangepi-zero: misc updates | expand

Commit Message

Sergey Matyukevich Nov. 4, 2017, 7:40 p.m. UTC
Add firmware for XR819 SDIO WiFi chip.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
---
 DEVELOPERS                                 |  1 +
 package/Config.in                          |  1 +
 package/xr819-firmware/Config.in           |  4 ++++
 package/xr819-firmware/xr819-firmware.hash |  5 +++++
 package/xr819-firmware/xr819-firmware.mk   | 25 +++++++++++++++++++++++++
 5 files changed, 36 insertions(+)
 create mode 100644 package/xr819-firmware/Config.in
 create mode 100644 package/xr819-firmware/xr819-firmware.hash
 create mode 100644 package/xr819-firmware/xr819-firmware.mk

Comments

Peter Korsgaard Nov. 5, 2017, 11:53 a.m. UTC | #1
>>>>> "Sergey" == Sergey Matyukevich <geomatsi@gmail.com> writes:

 > Add firmware for XR819 SDIO WiFi chip.

Thanks. I had a quick look at doing so myself some time ago, but never
got around to finishing it.

> +++ b/package/xr819-firmware/xr819-firmware.mk
 > @@ -0,0 +1,25 @@
 > +################################################################################
 > +#
 > +# xr819-firmware
 > +#
 > +################################################################################
 > +
 > +XR819_FIRMWARE_VERSION = v2017.07
 > +XR819_FIRMWARE_SITE =  https://github.com/armbian/build/raw/$(XR819_FIRMWARE_VERSION)/packages/extras/firmware/xr819
 > +XR819_FIRMWARE_SOURCE = fw_xr819.bin
 > +XR819_FIRMWARE_EXTRA_DOWNLOADS = boot_xr819.bin sdd_xr819.bin
 > +XR819_FIRMWARE_LICENSE = PROPRIETARY

These firmware blobs are quite icky. If I understand correctly, the
firmware comes from some kind of (android?) disk image. Given that, I'm
not sure we are really allowed to redistribute them so we should set
XR819_FIRMWARE_REDISTRIBUTE = NO

The fact that the filenames are not versioned is also a pain, as we
cannot really handle any future version bumps without breaking older
releases.

I agree that cloning the huge armbian build repo for these small files
isn't really nice, but I had a look at the armbian github and I see they
have recently moved the firmware blobs to a separate repo:

https://github.com/armbian/firmware

Which is only around ~9MB, so I suggest we download that with git
similar to linux-firmware, then at least we have a git revision.

Care to rework the package to be such an "armbian-firmware" package
instead? For now it is fine to just have a single sub option to install
the xr819 files.
Sergey Matyukevich Nov. 5, 2017, 3:39 p.m. UTC | #2
Hello Peter,

>  > Add firmware for XR819 SDIO WiFi chip.
> 
> Thanks. I had a quick look at doing so myself some time ago, but never
> got around to finishing it.
> 
> > +++ b/package/xr819-firmware/xr819-firmware.mk
>  > @@ -0,0 +1,25 @@
>  > +################################################################################
>  > +#
>  > +# xr819-firmware
>  > +#
>  > +################################################################################
>  > +
>  > +XR819_FIRMWARE_VERSION = v2017.07
>  > +XR819_FIRMWARE_SITE =  https://github.com/armbian/build/raw/$(XR819_FIRMWARE_VERSION)/packages/extras/firmware/xr819
>  > +XR819_FIRMWARE_SOURCE = fw_xr819.bin
>  > +XR819_FIRMWARE_EXTRA_DOWNLOADS = boot_xr819.bin sdd_xr819.bin
>  > +XR819_FIRMWARE_LICENSE = PROPRIETARY
> 
> These firmware blobs are quite icky. If I understand correctly, the
> firmware comes from some kind of (android?) disk image. Given that, I'm
> not sure we are really allowed to redistribute them so we should set
> XR819_FIRMWARE_REDISTRIBUTE = NO
> 
> The fact that the filenames are not versioned is also a pain, as we
> cannot really handle any future version bumps without breaking older
> releases.
> 
> I agree that cloning the huge armbian build repo for these small files
> isn't really nice, but I had a look at the armbian github and I see they
> have recently moved the firmware blobs to a separate repo:
> 
> https://github.com/armbian/firmware
> 
> Which is only around ~9MB, so I suggest we download that with git
> similar to linux-firmware, then at least we have a git revision.
> 
> Care to rework the package to be such an "armbian-firmware" package
> instead? For now it is fine to just have a single sub option to install
> the xr819 files.

Thanks for review ! I didn't notice they moved all the blobs into a
separate git repository. I assume you mean the same approach as in
the package linux-firmware.mk: adding separate Kconfig options
for each group of firmware files.

I will rework xr819 firmware packaging approach and then resubmit
the whole patchset. For the time being I plan to add xr819 and ap6212
sub-options to handle orange-pi-zero and upcoming orange-pi-zero-plus2 boards.

Regards,
Sergey
Yann E. MORIN Nov. 5, 2017, 4:33 p.m. UTC | #3
Sergey, All,

On 2017-11-05 18:39 +0300, Sergey Matyukevich spake thusly:
> >  > Add firmware for XR819 SDIO WiFi chip.
> > Thanks. I had a quick look at doing so myself some time ago, but never
> > got around to finishing it.
> > 
> > > +++ b/package/xr819-firmware/xr819-firmware.mk
> >  > @@ -0,0 +1,25 @@
> >  > +################################################################################
> >  > +#
> >  > +# xr819-firmware
> >  > +#
> >  > +################################################################################
> >  > +
> >  > +XR819_FIRMWARE_VERSION = v2017.07
> >  > +XR819_FIRMWARE_SITE =  https://github.com/armbian/build/raw/$(XR819_FIRMWARE_VERSION)/packages/extras/firmware/xr819
> >  > +XR819_FIRMWARE_SOURCE = fw_xr819.bin
> >  > +XR819_FIRMWARE_EXTRA_DOWNLOADS = boot_xr819.bin sdd_xr819.bin
> >  > +XR819_FIRMWARE_LICENSE = PROPRIETARY
> > 
> > These firmware blobs are quite icky. If I understand correctly, the
> > firmware comes from some kind of (android?) disk image. Given that, I'm
> > not sure we are really allowed to redistribute them so we should set
> > XR819_FIRMWARE_REDISTRIBUTE = NO
> > 
> > The fact that the filenames are not versioned is also a pain, as we
> > cannot really handle any future version bumps without breaking older
> > releases.
> > 
> > I agree that cloning the huge armbian build repo for these small files
> > isn't really nice, but I had a look at the armbian github and I see they
> > have recently moved the firmware blobs to a separate repo:
> > 
> > https://github.com/armbian/firmware
> > 
> > Which is only around ~9MB, so I suggest we download that with git
> > similar to linux-firmware, then at least we have a git revision.
> > 
> > Care to rework the package to be such an "armbian-firmware" package
> > instead? For now it is fine to just have a single sub option to install
> > the xr819 files.
> 
> Thanks for review ! I didn't notice they moved all the blobs into a
> separate git repository. I assume you mean the same approach as in
> the package linux-firmware.mk: adding separate Kconfig options
> for each group of firmware files.

Basically, yes.

> I will rework xr819 firmware packaging approach and then resubmit
> the whole patchset. For the time being I plan to add xr819 and ap6212
> sub-options to handle orange-pi-zero and upcoming orange-pi-zero-plus2 boards.

Yes, just start with just the options you require. If anyone is later
interested to add more, they can send further patches to add those.

Regards,
Yann E. MORIN.
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index c651bf26fa..ab2d0a36b9 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1432,6 +1432,7 @@  F:	package/mpir/
 
 N:	Sergey Matyukevich <geomatsi@gmail.com>
 F:	package/xr819-xradio/
+F:	package/xr819-firmware/
 
 N:	Sergio Prado <sergio.prado@e-labworks.com>
 F:	package/libgdiplus/
diff --git a/package/Config.in b/package/Config.in
index fe5ccc434e..7b7a85a574 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -369,6 +369,7 @@  menu "Firmware"
 	source "package/wilc1000-firmware/Config.in"
 	source "package/wilink-bt-firmware/Config.in"
 	source "package/zd1211-firmware/Config.in"
+	source "package/xr819-firmware/Config.in"
 endmenu
 	source "package/a10disp/Config.in"
 	source "package/acpica/Config.in"
diff --git a/package/xr819-firmware/Config.in b/package/xr819-firmware/Config.in
new file mode 100644
index 0000000000..d1be7f8554
--- /dev/null
+++ b/package/xr819-firmware/Config.in
@@ -0,0 +1,4 @@ 
+config BR2_PACKAGE_XR819_FIRMWARE
+	bool "xr819-firmware"
+	help
+	  Firmware for XR819 SDIO WiFi chip
diff --git a/package/xr819-firmware/xr819-firmware.hash b/package/xr819-firmware/xr819-firmware.hash
new file mode 100644
index 0000000000..91a2a80a91
--- /dev/null
+++ b/package/xr819-firmware/xr819-firmware.hash
@@ -0,0 +1,5 @@ 
+# Locally computed
+sha256 6583350b3eb12f70fc6d6081426717bd0019b55c6558ffe820c1548f0702bb8c boot_xr819.bin
+sha256 4954ceb85807959c42e82c432109455bd9eabe95971402299a16d77ddd7d79f5 fw_xr819.bin
+sha256 84d3fb3ca8e5d25a0c113a5063bccbeb5b53da230a0afa236b5b625f37db5161 sdd_xr819.bin
+
diff --git a/package/xr819-firmware/xr819-firmware.mk b/package/xr819-firmware/xr819-firmware.mk
new file mode 100644
index 0000000000..a14719f6fa
--- /dev/null
+++ b/package/xr819-firmware/xr819-firmware.mk
@@ -0,0 +1,25 @@ 
+################################################################################
+#
+# xr819-firmware
+#
+################################################################################
+
+XR819_FIRMWARE_VERSION = v2017.07
+XR819_FIRMWARE_SITE =  https://github.com/armbian/build/raw/$(XR819_FIRMWARE_VERSION)/packages/extras/firmware/xr819
+XR819_FIRMWARE_SOURCE = fw_xr819.bin
+XR819_FIRMWARE_EXTRA_DOWNLOADS = boot_xr819.bin sdd_xr819.bin
+XR819_FIRMWARE_LICENSE = PROPRIETARY
+
+define XR819_FIRMWARE_EXTRACT_CMDS
+	mkdir -p $(@D)/xr819
+	cp $(DL_DIR)/fw_xr819.bin $(@D)/xr819/
+	cp $(DL_DIR)/sdd_xr819.bin $(@D)/xr819/
+	cp $(DL_DIR)/boot_xr819.bin $(@D)/xr819/
+endef
+
+define XR819_FIRMWARE_INSTALL_TARGET_CMDS
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/lib/firmware/xr819
+	cp $(@D)/xr819/* $(TARGET_DIR)/lib/firmware/xr819/
+endef
+
+$(eval $(generic-package))