All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4 1/3] uccp420wlan: new package
@ 2017-03-16 11:43 Abhimanyu V
  2017-03-16 11:43 ` [Buildroot] [PATCH v4 2/3] Add LINUX_DIR to EXTRA_ENV for use in post-build scripts Abhimanyu V
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Abhimanyu V @ 2017-03-16 11:43 UTC (permalink / raw)
  To: buildroot

From: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>

Wifi kernel module and firmware for Imagination explorer RPU

Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
Reviewed-by: Rahul Bedarkar <Rahul.Bedarkar@imgtec.com>
---
 Changes v1->v2
  - add hash file
 Changes v2->v3 (Suggested by Arnout)
  - remove patch and bump version
  - add proprietary license file to LICENSE_FILES
  - Fix help text indentation to below 72 columns
 Changes v3->v4 (Suggested by Arnout)
  - use UCCP420WLAN_INSTALL_TARGET_CMDS instead of HOOKS

 package/Config.in                    |  1 +
 package/uccp420wlan/Config.in        | 14 ++++++++++++++
 package/uccp420wlan/uccp420wlan.hash |  2 ++
 package/uccp420wlan/uccp420wlan.mk   | 18 ++++++++++++++++++
 4 files changed, 35 insertions(+)
 create mode 100644 package/uccp420wlan/Config.in
 create mode 100644 package/uccp420wlan/uccp420wlan.hash
 create mode 100644 package/uccp420wlan/uccp420wlan.mk

diff --git a/package/Config.in b/package/Config.in
index 85e4dee..18d00b0 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -479,6 +479,7 @@ endmenu
 	source "package/triggerhappy/Config.in"
 	source "package/uboot-tools/Config.in"
 	source "package/ubus/Config.in"
+	source "package/uccp420wlan/Config.in"
 	source "package/udev/Config.in"
 	source "package/udisks/Config.in"
 	source "package/upower/Config.in"
diff --git a/package/uccp420wlan/Config.in b/package/uccp420wlan/Config.in
new file mode 100644
index 0000000..40abc8e
--- /dev/null
+++ b/package/uccp420wlan/Config.in
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_UCCP420WLAN
+	bool "uccp420wlan"
+	depends on BR2_LINUX_KERNEL
+	help
+	  SoftMAC (mac80211) based WiFi driver for Imagination's
+	  Explorer RPU uccp420. This supports Dual Band WiFi with
+	  2.4GHz - 2x2 b/g/n 40MHz, 5GHz - 2x2 a/n/11ac 80MHz modes
+
+	  Used in creator ci40 board.
+
+	  https://github.com/CreatorDev/uccp420wlan
+
+comment "uccp420wlan needs a Linux kernel to be built"
+	depends on !BR2_LINUX_KERNEL
diff --git a/package/uccp420wlan/uccp420wlan.hash b/package/uccp420wlan/uccp420wlan.hash
new file mode 100644
index 0000000..41f60a4
--- /dev/null
+++ b/package/uccp420wlan/uccp420wlan.hash
@@ -0,0 +1,2 @@
+# locally computed hash
+sha256 1d4de62fc842dbab739708cf0d9ebce270fcdf63c1c13ac676cbc253acdaa3bb uccp420wlan-v6.9.1.tar.gz
diff --git a/package/uccp420wlan/uccp420wlan.mk b/package/uccp420wlan/uccp420wlan.mk
new file mode 100644
index 0000000..1496a92
--- /dev/null
+++ b/package/uccp420wlan/uccp420wlan.mk
@@ -0,0 +1,18 @@
+################################################################################
+#
+# uccp420wlan
+#
+################################################################################
+
+UCCP420WLAN_VERSION = v6.9.1
+UCCP420WLAN_SITE = $(call github,CreatorDev,uccp420wlan,$(UCCP420WLAN_VERSION))
+UCCP420WLAN_LICENSE = GPLv2 (kernel module), proprietary (firmware blob)
+UCCP420WLAN_LICENSE_FILES = COPYING firmware/LICENSE.imagination
+
+define UCCP420WLAN_INSTALL_TARGET_CMDS
+	mkdir -p $(TARGET_DIR)/lib/firmware/img/uccp420wlan
+	cp $(@D)/firmware/*.ldr $(TARGET_DIR)/lib/firmware/img/uccp420wlan
+endef
+
+$(eval $(kernel-module))
+$(eval $(generic-package))
-- 
2.7.4

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

* [Buildroot] [PATCH v4 2/3] Add LINUX_DIR to EXTRA_ENV for use in post-build scripts
  2017-03-16 11:43 [Buildroot] [PATCH v4 1/3] uccp420wlan: new package Abhimanyu V
@ 2017-03-16 11:43 ` Abhimanyu V
  2017-03-17 22:39   ` Arnout Vandecappelle
  2017-03-16 11:43 ` [Buildroot] [PATCH v4 3/3] Add defconfig for MIPS Creator ci40 Abhimanyu V
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Abhimanyu V @ 2017-03-16 11:43 UTC (permalink / raw)
  To: buildroot

From: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>

To build fitImage in post-build scripts, we need compressed
kernel binary which is intermediate target, hence doesnt get
copied to output/images folder.

Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
Reviewed-by: Rahul Bedarkar <Rahul.Bedarkar@imgtec.com>
---
 Changes v3->v4 (Suggested by Arnout)
   - Drop exporting LINUX_DIR instead add to EXTRA_ENV var

 package/Makefile.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index 4a3eb26..b1962ed 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -310,7 +310,8 @@ HOST_CONFIGURE_OPTS = \
 EXTRA_ENV = \
 	PATH=$(BR_PATH) \
 	BR2_DL_DIR=$(BR2_DL_DIR) \
-	BUILD_DIR=$(BUILD_DIR)
+	BUILD_DIR=$(BUILD_DIR) \
+	LINUX_DIR=$(LINUX_DIR)
 
 ################################################################################
 # settings we need to pass to configure
-- 
2.7.4

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

* [Buildroot] [PATCH v4 3/3] Add defconfig for MIPS Creator ci40
  2017-03-16 11:43 [Buildroot] [PATCH v4 1/3] uccp420wlan: new package Abhimanyu V
  2017-03-16 11:43 ` [Buildroot] [PATCH v4 2/3] Add LINUX_DIR to EXTRA_ENV for use in post-build scripts Abhimanyu V
@ 2017-03-16 11:43 ` Abhimanyu V
  2017-03-17 22:36 ` [Buildroot] [PATCH v4 1/3] uccp420wlan: new package Arnout Vandecappelle
  2017-03-18 14:34 ` Thomas Petazzoni
  3 siblings, 0 replies; 11+ messages in thread
From: Abhimanyu V @ 2017-03-16 11:43 UTC (permalink / raw)
  To: buildroot

From: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>

Also add post-build script to create fitImage which is used
by u-boot to boot the device. It also add post-image script
to generate sdcard.img for preparing sdcard/usb device

Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
Reviewed-by: Rahul Bedarkar <Rahul.Bedarkar@imgtec.com>
---
 Changes v1->v2
  - No change
 Changes v2->v3 (Suggested by Arnout)
  - Remove uImage and add fitImage generation
  - Tidy readme.txt
  - Tidy ci40_defconfig, remove custom toolchain and add wifi helper packages
  Some changes are not done:
  - Using git-helper:
    - Custom kernel doesnt provide tar file, so it didnt work for me
 Changes v3->v4 (Suggested by Arnout)
  - Use github helper for getting kernel/u-boot
  - rename fitImage.its -> fitImage.its.in to reflect as template file,
    remove hardcoded dtb filename
  - Find dtb file in output/images directory and use first dtb in fitImage
  - Remove image size from genimage.cfg
  - Tidy readme.txt and add section to explain how to stop u-boot autoboot,
    how to make it persistent, and other grammar

 board/ci40/create_fitImage.sh | 35 ++++++++++++++++++++++
 board/ci40/fitImage.its.in    | 52 ++++++++++++++++++++++++++++++++
 board/ci40/genimage.cfg       | 12 ++++++++
 board/ci40/post-image.sh      | 15 ++++++++++
 board/ci40/readme.txt         | 70 +++++++++++++++++++++++++++++++++++++++++++
 configs/ci40_defconfig        | 46 ++++++++++++++++++++++++++++
 6 files changed, 230 insertions(+)
 create mode 100755 board/ci40/create_fitImage.sh
 create mode 100644 board/ci40/fitImage.its.in
 create mode 100644 board/ci40/genimage.cfg
 create mode 100755 board/ci40/post-image.sh
 create mode 100644 board/ci40/readme.txt
 create mode 100644 configs/ci40_defconfig

diff --git a/board/ci40/create_fitImage.sh b/board/ci40/create_fitImage.sh
new file mode 100755
index 0000000..23e084d
--- /dev/null
+++ b/board/ci40/create_fitImage.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# Inputs
+BOARD_DIR="$(dirname $0)"
+FIT_ITS_FILE=$BOARD_DIR/fitImage.its.in
+MKIMAGE=$HOST_DIR/usr/bin/mkimage
+UIMAGE=$BINARIES_DIR/uImage
+
+# Output
+MODIFIED_FIT_ITS=$BINARIES_DIR/fitImage.its
+FITIMAGE=$BINARIES_DIR/fitImage
+
+# Extract kernel load address and entry address from uImage
+load=0x$($MKIMAGE -l $UIMAGE | grep "Load Address: " | sed 's/Load Address: //g')
+entry=0x$($MKIMAGE -l $UIMAGE | grep "Entry Point:  " | sed 's/Entry Point:  //g')
+
+# For now use first dtb found, once we start supporting more than 1 dtb, we can
+# then generate multiple fitImage for different dtb found.
+dtbs=(`find $BINARIES_DIR -name "*.dtb" -printf "%f "`)
+dtb=${dtbs[0]}
+
+# Create a copy of fitImage.its file and replace these address in that file
+sed -e "s/@load@/$load/g"   \
+    -e "s/@entry@/$entry/g" \
+    -e "s/@dtb@/$dtb/g"     \
+    $FIT_ITS_FILE > $MODIFIED_FIT_ITS
+
+# Copy vmlinux.bin.gz to output/images, it is used in .its file
+cp -a $LINUX_DIR/arch/mips/boot/vmlinux.bin.gz $BINARIES_DIR
+
+# Create fitImage
+$MKIMAGE -f $MODIFIED_FIT_ITS $FITIMAGE
+
+# Copy to target
+cp -a $FITIMAGE $TARGET_DIR/fitImage
diff --git a/board/ci40/fitImage.its.in b/board/ci40/fitImage.its.in
new file mode 100644
index 0000000..376f3bc
--- /dev/null
+++ b/board/ci40/fitImage.its.in
@@ -0,0 +1,52 @@
+/*
+ * Description file for fitImage
+ */
+
+/dts-v1/;
+
+/ {
+	description = "Buildroot CI40 FTD Image";
+	#address-cells = <1>;
+
+	images {
+		kernel at 1 {
+			description = "Linux kernel";
+			data = /incbin/("./vmlinux.bin.gz");
+			type = "kernel";
+			arch = "mips";
+			os = "linux";
+			compression = "gzip";
+			load = <@load@>;
+			entry = <@entry@>;
+			hash at 1 {
+				algo = "crc32";
+			};
+			hash at 2 {
+				algo = "sha1";
+			};
+		};
+		marduk-fdt at 1 {
+			description = "CI40 Flattened Device Tree blob";
+			data = /incbin/("@dtb@");
+			type = "flat_dt";
+			arch = "mips";
+			compression = "none";
+			hash at 1 {
+				algo = "crc32";
+			};
+			hash at 2 {
+				algo = "sha1";
+			};
+		};
+	};
+
+	configurations {
+		default = "config at 1";
+		config at 1 {
+			description = "CI40 dtb";
+			kernel = "kernel at 1";
+			fdt = "marduk-fdt at 1";
+		};
+	};
+};
+
diff --git a/board/ci40/genimage.cfg b/board/ci40/genimage.cfg
new file mode 100644
index 0000000..0ffc91c
--- /dev/null
+++ b/board/ci40/genimage.cfg
@@ -0,0 +1,12 @@
+# Minimal SD card image
+#
+
+image sdcard.img {
+  hdimage {
+  }
+
+  partition rootfs {
+    partition-type = 0x83
+    image = "rootfs.ext4"
+  }
+}
diff --git a/board/ci40/post-image.sh b/board/ci40/post-image.sh
new file mode 100755
index 0000000..18e76aa
--- /dev/null
+++ b/board/ci40/post-image.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+BOARD_DIR="$(dirname $0)"
+GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage \
+  --rootpath "${TARGET_DIR}" \
+  --tmppath "${GENIMAGE_TMP}" \
+  --inputpath "${BINARIES_DIR}" \
+  --outputpath "${BINARIES_DIR}" \
+  --config "${GENIMAGE_CFG}"
+
diff --git a/board/ci40/readme.txt b/board/ci40/readme.txt
new file mode 100644
index 0000000..2fde2b8
--- /dev/null
+++ b/board/ci40/readme.txt
@@ -0,0 +1,70 @@
+*********************
+* MIPS Creator CI40 *
+*********************
+
+The 'ci40_defconfig' will create a root filesystem and a fitImage
+under the 'output/images/' directory. This document explains how
+to use them in order to run Buildroot in the MIPS Creator CI40 board.
+
+Prepare USB/MMC for boot
+------------------------
+It can be done 2 ways:
+
+1. Using "sdcard.img" file created in output/images folder
+
+Use following command to write image to bootable device
+
+# dd if=./output/images/sdcard.img of=/dev/<your-microsd-or-usb-device>
+
+2. Manually preparing USB/MMC device
+
+Extract the generated root filesystem "rootfs.tar" into a ext4 formatted
+USB drive or SD-Card.
+
+Booting from USB/MMC
+--------------------
+The boot loader is already present in NOR flash. To boot your newly generated
+Linux and root filesystem, you need to interrupt U-Boot autoboot. Current U-Boot
+is configured with 2 seconds of boot-delay, after expiry of this boot-delay
+timeout U-Boot start booting default image. To interrupt autoboot, press any
+key before the boot-delay time expires, U-Boot will stops the autoboot process
+and gives a U-Boot prompt. You can now boot to your preferred boot method as
+describe below:
+
+From USB
+  pistachio # run usbboot
+
+From SD-Card
+  pistachio # run mmcboot
+
+Booting from network (nfsboot)
+------------------------------
+Prepare nfs root (See Buildroot manual) and extract rootfs.tar file into it.
+
+  pistachio # setenv serverip <server-ip-address>
+  pistachio # setenv rootpath <nfs root path>
+  pistachio # run netboot
+
+Persistent boot command
+-----------------------
+To boot automatically to your preferred boot method, use following command to
+make it persistent, for example to automatically boot to usb:
+
+  pistachio # setenv bootcmd run usbboot
+  pistachio # saveenv
+
+Flash new bootloader
+--------------------
+After booting with above method. Copy file u-boot-pistachio_marduk-2015.10-v1.0.4.img
+to /tmp. Use following command to flash new bootloader:
+
+# flashcp -v /tmp/u-boot-pistachio_marduk-2015.10-v1.0.4.img /dev/mtd0
+
+Online docs
+-----------
+Mostly for OpenWRT but it is applicable to Buildroot
+https://docs.creatordev.io/ci40/guides/openwrt-platform/#overview
+
+Prebuilt uboot
+--------------
+http://downloads.creatordev.io/?q=u-boot/
diff --git a/configs/ci40_defconfig b/configs/ci40_defconfig
new file mode 100644
index 0000000..32be792
--- /dev/null
+++ b/configs/ci40_defconfig
@@ -0,0 +1,46 @@
+# architecture
+BR2_mipsel=y
+BR2_mips_32r2=y
+
+# linux header same as custom kernel ie 4.4.x
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
+
+# kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,CreatorDev,linux,openwrt-4.4.14/linux-openwrt-4.4.14.tar.gz)"
+BR2_LINUX_KERNEL_DEFCONFIG="pistachio"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="img/pistachio_marduk"
+
+# bootloader flash support
+BR2_PACKAGE_MTD=y
+
+# wireless firmware
+BR2_PACKAGE_UCCP420WLAN=y
+
+# wireless package
+BR2_PACKAGE_WIRELESS_TOOLS=y
+BR2_PACKAGE_WPA_SUPPLICANT=y
+BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
+
+# bootloader
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARDNAME="pistachio_marduk"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,CreatorDev,u-boot,v1.0.4/u-boot-CreatorDev-v1.0.4.tar.gz)"
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-pistachio_marduk-2015.10-v1.0.4.img"
+
+# fitimage / image generation
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/ci40/create_fitImage.sh"
+
+# image generation
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ci40/post-image.sh"
+
-- 
2.7.4

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

* [Buildroot] [PATCH v4 1/3] uccp420wlan: new package
  2017-03-16 11:43 [Buildroot] [PATCH v4 1/3] uccp420wlan: new package Abhimanyu V
  2017-03-16 11:43 ` [Buildroot] [PATCH v4 2/3] Add LINUX_DIR to EXTRA_ENV for use in post-build scripts Abhimanyu V
  2017-03-16 11:43 ` [Buildroot] [PATCH v4 3/3] Add defconfig for MIPS Creator ci40 Abhimanyu V
@ 2017-03-17 22:36 ` Arnout Vandecappelle
  2017-03-18 14:34 ` Thomas Petazzoni
  3 siblings, 0 replies; 11+ messages in thread
From: Arnout Vandecappelle @ 2017-03-17 22:36 UTC (permalink / raw)
  To: buildroot



On 16-03-17 12:43, Abhimanyu V wrote:
> From: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
> 
> Wifi kernel module and firmware for Imagination explorer RPU
> 
> Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
> Reviewed-by: Rahul Bedarkar <Rahul.Bedarkar@imgtec.com>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 There is one worry: it needs a kernel >= 4.2. However, I expect most of our
modules packages have some kind of kernel dependency, and none of them encode
it. It's also hard to do since we don't have a way to know the kernel version.
It could be worthwhile, however, to mention this minimum kernel version in the
help text.

[snip]
> diff --git a/package/uccp420wlan/Config.in b/package/uccp420wlan/Config.in
> new file mode 100644
> index 0000000..40abc8e
> --- /dev/null
> +++ b/package/uccp420wlan/Config.in
> @@ -0,0 +1,14 @@
> +config BR2_PACKAGE_UCCP420WLAN
> +	bool "uccp420wlan"
> +	depends on BR2_LINUX_KERNEL
> +	help
> +	  SoftMAC (mac80211) based WiFi driver for Imagination's
> +	  Explorer RPU uccp420. This supports Dual Band WiFi with
> +	  2.4GHz - 2x2 b/g/n 40MHz, 5GHz - 2x2 a/n/11ac 80MHz modes
> +
> +	  Used in creator ci40 board.

 So

	  This module needs a Linux kernel >= v4.2.

> +
> +	  https://github.com/CreatorDev/uccp420wlan
> +
> +comment "uccp420wlan needs a Linux kernel to be built"

 and

comment "uccp420wlan needs a Linux kernel >= v4.2 to be built"


 Regards,
 Arnout

> +	depends on !BR2_LINUX_KERNEL
> diff --git a/package/uccp420wlan/uccp420wlan.hash b/package/uccp420wlan/uccp420wlan.hash
> new file mode 100644
> index 0000000..41f60a4
> --- /dev/null
> +++ b/package/uccp420wlan/uccp420wlan.hash
> @@ -0,0 +1,2 @@
> +# locally computed hash
> +sha256 1d4de62fc842dbab739708cf0d9ebce270fcdf63c1c13ac676cbc253acdaa3bb uccp420wlan-v6.9.1.tar.gz
> diff --git a/package/uccp420wlan/uccp420wlan.mk b/package/uccp420wlan/uccp420wlan.mk
> new file mode 100644
> index 0000000..1496a92
> --- /dev/null
> +++ b/package/uccp420wlan/uccp420wlan.mk
> @@ -0,0 +1,18 @@
> +################################################################################
> +#
> +# uccp420wlan
> +#
> +################################################################################
> +
> +UCCP420WLAN_VERSION = v6.9.1
> +UCCP420WLAN_SITE = $(call github,CreatorDev,uccp420wlan,$(UCCP420WLAN_VERSION))
> +UCCP420WLAN_LICENSE = GPLv2 (kernel module), proprietary (firmware blob)
> +UCCP420WLAN_LICENSE_FILES = COPYING firmware/LICENSE.imagination
> +
> +define UCCP420WLAN_INSTALL_TARGET_CMDS
> +	mkdir -p $(TARGET_DIR)/lib/firmware/img/uccp420wlan
> +	cp $(@D)/firmware/*.ldr $(TARGET_DIR)/lib/firmware/img/uccp420wlan
> +endef
> +
> +$(eval $(kernel-module))
> +$(eval $(generic-package))
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v4 2/3] Add LINUX_DIR to EXTRA_ENV for use in post-build scripts
  2017-03-16 11:43 ` [Buildroot] [PATCH v4 2/3] Add LINUX_DIR to EXTRA_ENV for use in post-build scripts Abhimanyu V
@ 2017-03-17 22:39   ` Arnout Vandecappelle
  2017-03-18 13:23     ` Thomas Petazzoni
  0 siblings, 1 reply; 11+ messages in thread
From: Arnout Vandecappelle @ 2017-03-17 22:39 UTC (permalink / raw)
  To: buildroot



On 16-03-17 12:43, Abhimanyu V wrote:
> From: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
> 
> To build fitImage in post-build scripts, we need compressed
> kernel binary which is intermediate target, hence doesnt get
> copied to output/images folder.
> 
> Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
> Reviewed-by: Rahul Bedarkar <Rahul.Bedarkar@imgtec.com>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 Regards,
 Arnout

> ---
>  Changes v3->v4 (Suggested by Arnout)
>    - Drop exporting LINUX_DIR instead add to EXTRA_ENV var
> 
>  package/Makefile.in | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 4a3eb26..b1962ed 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -310,7 +310,8 @@ HOST_CONFIGURE_OPTS = \
>  EXTRA_ENV = \
>  	PATH=$(BR_PATH) \
>  	BR2_DL_DIR=$(BR2_DL_DIR) \
> -	BUILD_DIR=$(BUILD_DIR)
> +	BUILD_DIR=$(BUILD_DIR) \
> +	LINUX_DIR=$(LINUX_DIR)
>  
>  ################################################################################
>  # settings we need to pass to configure
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v4 2/3] Add LINUX_DIR to EXTRA_ENV for use in post-build scripts
  2017-03-17 22:39   ` Arnout Vandecappelle
@ 2017-03-18 13:23     ` Thomas Petazzoni
  2017-03-18 13:59       ` Arnout Vandecappelle
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Petazzoni @ 2017-03-18 13:23 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 17 Mar 2017 23:39:46 +0100, Arnout Vandecappelle wrote:
> On 16-03-17 12:43, Abhimanyu V wrote:
> > From: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
> > 
> > To build fitImage in post-build scripts, we need compressed
> > kernel binary which is intermediate target, hence doesnt get
> > copied to output/images folder.
> > 
> > Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
> > Reviewed-by: Rahul Bedarkar <Rahul.Bedarkar@imgtec.com>  
> 
> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

I am not sure about this one. Why would we pass in the environment
specifically LINUX_DIR, and not the <pkg>_DIR of the other ~2000
packages we have in Buildroot ?

What about instead using BR2_LINUX_KERNEL_VMLINUX_BIN, to get
vmlinux.bin copied to output/images, and then compress it in the
post-build script ?

Or alternatively, if there is a vmlinux.bin.gz target, add support for
it in our linux package?

Best regards,

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

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

* [Buildroot] [PATCH v4 2/3] Add LINUX_DIR to EXTRA_ENV for use in post-build scripts
  2017-03-18 13:23     ` Thomas Petazzoni
@ 2017-03-18 13:59       ` Arnout Vandecappelle
  2017-03-18 14:31         ` Thomas Petazzoni
  2017-03-20  7:08         ` Abhimanyu V
  0 siblings, 2 replies; 11+ messages in thread
From: Arnout Vandecappelle @ 2017-03-18 13:59 UTC (permalink / raw)
  To: buildroot



On 18-03-17 14:23, Thomas Petazzoni wrote:
> Hello,
> 
> On Fri, 17 Mar 2017 23:39:46 +0100, Arnout Vandecappelle wrote:
>> On 16-03-17 12:43, Abhimanyu V wrote:
>>> From: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
>>>
>>> To build fitImage in post-build scripts, we need compressed
>>> kernel binary which is intermediate target, hence doesnt get
>>> copied to output/images folder.
>>>
>>> Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
>>> Reviewed-by: Rahul Bedarkar <Rahul.Bedarkar@imgtec.com>  
>>
>> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> 
> I am not sure about this one. Why would we pass in the environment
> specifically LINUX_DIR, and not the <pkg>_DIR of the other ~2000
> packages we have in Buildroot ?

 Because LINUX_DIR is *much* more likely to be used in a post-build/image
script. E.g. if the initramfs wouldn't be supported directly by Buildroot, you'd
need it. Same for mxs-bootlets.

 I agree though that it's not great, but could find no better way. Although,
actually, it could use a recursive 'make printvars VARS=LINUX_DIR' (which will
be even better when [1] gets committed).

> What about instead using BR2_LINUX_KERNEL_VMLINUX_BIN, to get
> vmlinux.bin copied to output/images, and then compress it in the
> post-build script ?

 I considered that in one of my reviews, but vmlinux.bin doesn't contain the
load and start address. The post-build script would have to retrieve those in
some other way.

 However, Abhimanyu reported that there is upstream support for generating a
fitImage in the kernel build itself. That's of course preferable...


 Abhimanyu, could you rework using either 'make printvars' in the post-build
script (optionally incorporating [1] in your series so 'make printvars' actually
does the right thing), or using the in-kernel fitImage support?

 Regards,
 Arnout

[1] http://patchwork.ozlabs.org/patch/721102/

> 
> Or alternatively, if there is a vmlinux.bin.gz target, add support for
> it in our linux package?
> 
> Best regards,
> 
> Thomas
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v4 2/3] Add LINUX_DIR to EXTRA_ENV for use in post-build scripts
  2017-03-18 13:59       ` Arnout Vandecappelle
@ 2017-03-18 14:31         ` Thomas Petazzoni
  2017-03-20  7:13           ` Abhimanyu V
  2017-03-20  7:08         ` Abhimanyu V
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas Petazzoni @ 2017-03-18 14:31 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 18 Mar 2017 14:59:35 +0100, Arnout Vandecappelle wrote:
> > What about instead using BR2_LINUX_KERNEL_VMLINUX_BIN, to get
> > vmlinux.bin copied to output/images, and then compress it in the
> > post-build script ?  
> 
>  I considered that in one of my reviews, but vmlinux.bin doesn't contain the
> load and start address. The post-build script would have to retrieve those in
> some other way.

vmlinux.bin.gz also does not contain the load/start address. Only
uImage does, and they get them from uImage.

So one possibility would be to make the Linux package behave like the
U-Boot package: instead of having a choice...endchoice for the image
format to install, you simply have a list of options so that you can
select several of them.

>  However, Abhimanyu reported that there is upstream support for generating a
> fitImage in the kernel build itself. That's of course preferable...

Yes, it would be much better obviously.

Otherwise, hardcoding the load/start address in the .its.in file is
also good enough, this file is anyway board-specific.

Best regards,

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

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

* [Buildroot] [PATCH v4 1/3] uccp420wlan: new package
  2017-03-16 11:43 [Buildroot] [PATCH v4 1/3] uccp420wlan: new package Abhimanyu V
                   ` (2 preceding siblings ...)
  2017-03-17 22:36 ` [Buildroot] [PATCH v4 1/3] uccp420wlan: new package Arnout Vandecappelle
@ 2017-03-18 14:34 ` Thomas Petazzoni
  3 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2017-03-18 14:34 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 16 Mar 2017 17:13:20 +0530, Abhimanyu V wrote:
> From: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
> 
> Wifi kernel module and firmware for Imagination explorer RPU
> 
> Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
> Reviewed-by: Rahul Bedarkar <Rahul.Bedarkar@imgtec.com>
> ---
>  Changes v1->v2
>   - add hash file
>  Changes v2->v3 (Suggested by Arnout)
>   - remove patch and bump version
>   - add proprietary license file to LICENSE_FILES
>   - Fix help text indentation to below 72 columns
>  Changes v3->v4 (Suggested by Arnout)
>   - use UCCP420WLAN_INSTALL_TARGET_CMDS instead of HOOKS

Applied to master, after taking into account the comments made by
Arnout.

Thanks!

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

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

* [Buildroot] [PATCH v4 2/3] Add LINUX_DIR to EXTRA_ENV for use in post-build scripts
  2017-03-18 13:59       ` Arnout Vandecappelle
  2017-03-18 14:31         ` Thomas Petazzoni
@ 2017-03-20  7:08         ` Abhimanyu V
  1 sibling, 0 replies; 11+ messages in thread
From: Abhimanyu V @ 2017-03-20  7:08 UTC (permalink / raw)
  To: buildroot

Hi Arnout, Thomas,


On Saturday 18 March 2017 07:29 PM, Arnout Vandecappelle wrote:
>
> On 18-03-17 14:23, Thomas Petazzoni wrote:
>> Hello,
>>
>> On Fri, 17 Mar 2017 23:39:46 +0100, Arnout Vandecappelle wrote:
>>> On 16-03-17 12:43, Abhimanyu V wrote:
>>>> From: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
>>>>
>>>> To build fitImage in post-build scripts, we need compressed
>>>> kernel binary which is intermediate target, hence doesnt get
>>>> copied to output/images folder.
>>>>
>>>> Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
>>>> Reviewed-by: Rahul Bedarkar <Rahul.Bedarkar@imgtec.com>
>>> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
>> I am not sure about this one. Why would we pass in the environment
>> specifically LINUX_DIR, and not the <pkg>_DIR of the other ~2000
>> packages we have in Buildroot ?
>   Because LINUX_DIR is *much* more likely to be used in a post-build/image
> script. E.g. if the initramfs wouldn't be supported directly by Buildroot, you'd
> need it. Same for mxs-bootlets.
>
>   I agree though that it's not great, but could find no better way. Although,
> actually, it could use a recursive 'make printvars VARS=LINUX_DIR' (which will
> be even better when [1] gets committed).
>
>> What about instead using BR2_LINUX_KERNEL_VMLINUX_BIN, to get
>> vmlinux.bin copied to output/images, and then compress it in the
>> post-build script ?
>   I considered that in one of my reviews, but vmlinux.bin doesn't contain the
> load and start address. The post-build script would have to retrieve those in
> some other way.
When working I also had 2 other way to get it working:

1. Using vmlinux.bin and use gzip in build script to generate 
vmlinux.bin.gz and use fixed ENTRY_ADDR which is
how openwrt version also does.

2. Extracting vmlinux.bin.gz from uImage directly.

Out of 3 i thought using what is already generated is best way to use it 
and it also reduces extra processing. If out of above 2 look good let me 
know i can propose the patch with
solution.
>
>   However, Abhimanyu reported that there is upstream support for generating a
> fitImage in the kernel build itself. That's of course preferable...
fitImage support would need some more time, i would prefer if we get it 
pushed before fitImage support is ready.

>
>
>   Abhimanyu, could you rework using either 'make printvars' in the post-build
> script (optionally incorporating [1] in your series so 'make printvars' actually
> does the right thing), or using the in-kernel fitImage support?
>
>   Regards,
>   Arnout
>
> [1] http://patchwork.ozlabs.org/patch/721102/
>
Thanks, i will work on patch.


>> Or alternatively, if there is a vmlinux.bin.gz target, add support for
>> it in our linux package?
>>
>> Best regards,
>>
>> Thomas
>>
Regards
Abhimanyu

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

* [Buildroot] [PATCH v4 2/3] Add LINUX_DIR to EXTRA_ENV for use in post-build scripts
  2017-03-18 14:31         ` Thomas Petazzoni
@ 2017-03-20  7:13           ` Abhimanyu V
  0 siblings, 0 replies; 11+ messages in thread
From: Abhimanyu V @ 2017-03-20  7:13 UTC (permalink / raw)
  To: buildroot


On Saturday 18 March 2017 08:01 PM, Thomas Petazzoni wrote:
> Hello,
>
> On Sat, 18 Mar 2017 14:59:35 +0100, Arnout Vandecappelle wrote:
>>> What about instead using BR2_LINUX_KERNEL_VMLINUX_BIN, to get
>>> vmlinux.bin copied to output/images, and then compress it in the
>>> post-build script ?
>>   I considered that in one of my reviews, but vmlinux.bin doesn't contain the
>> load and start address. The post-build script would have to retrieve those in
>> some other way.
> vmlinux.bin.gz also does not contain the load/start address. Only
> uImage does, and they get them from uImage.
>
> So one possibility would be to make the Linux package behave like the
> U-Boot package: instead of having a choice...endchoice for the image
> format to install, you simply have a list of options so that you can
> select several of them.
>
>>   However, Abhimanyu reported that there is upstream support for generating a
>> fitImage in the kernel build itself. That's of course preferable...
> Yes, it would be much better obviously.
>
> Otherwise, hardcoding the load/start address in the .its.in file is
> also good enough, this file is anyway board-specific.
Damn, i didnt see this mail before replying to previous version, I will 
prepare the patch with this.
> Best regards,
>
> Thomas
Regards
Abhimanyu

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

end of thread, other threads:[~2017-03-20  7:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-16 11:43 [Buildroot] [PATCH v4 1/3] uccp420wlan: new package Abhimanyu V
2017-03-16 11:43 ` [Buildroot] [PATCH v4 2/3] Add LINUX_DIR to EXTRA_ENV for use in post-build scripts Abhimanyu V
2017-03-17 22:39   ` Arnout Vandecappelle
2017-03-18 13:23     ` Thomas Petazzoni
2017-03-18 13:59       ` Arnout Vandecappelle
2017-03-18 14:31         ` Thomas Petazzoni
2017-03-20  7:13           ` Abhimanyu V
2017-03-20  7:08         ` Abhimanyu V
2017-03-16 11:43 ` [Buildroot] [PATCH v4 3/3] Add defconfig for MIPS Creator ci40 Abhimanyu V
2017-03-17 22:36 ` [Buildroot] [PATCH v4 1/3] uccp420wlan: new package Arnout Vandecappelle
2017-03-18 14:34 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.