Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/4] board/raspberrypi/post-image.sh: add multi arg support
@ 2017-07-14  6:48 Erik Stromdahl
  2017-07-14  6:48 ` [Buildroot] [PATCH 2/4] board/raspberrypi/post-image.sh: add VC4 DTB overlay support Erik Stromdahl
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Erik Stromdahl @ 2017-07-14  6:48 UTC (permalink / raw)
  To: buildroot

Add possibility to supply multiple arguments to
post-image.sh

Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
---
 board/raspberrypi/post-image.sh | 40 ++++++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 18 deletions(-)

diff --git a/board/raspberrypi/post-image.sh b/board/raspberrypi/post-image.sh
index de97299..4f136f6 100755
--- a/board/raspberrypi/post-image.sh
+++ b/board/raspberrypi/post-image.sh
@@ -5,39 +5,43 @@ BOARD_NAME="$(basename ${BOARD_DIR})"
 GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
 GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
 
-case "${2}" in
-	--add-pi3-miniuart-bt-overlay)
-	if ! grep -qE '^dtoverlay=' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
-		echo "Adding 'dtoverlay=pi3-miniuart-bt' to config.txt (fixes ttyAMA0 serial console)."
-		cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
+for arg in "$@"
+do
+	case "${arg}" in
+		--add-pi3-miniuart-bt-overlay)
+		if ! grep -qE '^dtoverlay=' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
+			echo "Adding 'dtoverlay=pi3-miniuart-bt' to config.txt (fixes ttyAMA0 serial console)."
+			cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
 
 # fixes rpi3 ttyAMA0 serial console
 dtoverlay=pi3-miniuart-bt
 __EOF__
-	fi
-	;;
-	--aarch64)
-	# Run a 64bits kernel (armv8)
-	sed -e '/^kernel=/s,=.*,=Image,' -i "${BINARIES_DIR}/rpi-firmware/config.txt"
-	if ! grep -qE '^arm_control=0x200' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
-		cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
+		fi
+		;;
+		--aarch64)
+		# Run a 64bits kernel (armv8)
+		sed -e '/^kernel=/s,=.*,=Image,' -i "${BINARIES_DIR}/rpi-firmware/config.txt"
+		if ! grep -qE '^arm_control=0x200' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
+			cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
 
 # enable 64bits support
 arm_control=0x200
 __EOF__
-	fi
+		fi
 
-	# Enable uart console
-	if ! grep -qE '^enable_uart=1' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
-		cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
+		# Enable uart console
+		if ! grep -qE '^enable_uart=1' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
+			cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
 
 # enable rpi3 ttyS0 serial console
 enable_uart=1
 __EOF__
-	fi
-	;;
+		fi
+		;;
 esac
 
+done
+
 rm -rf "${GENIMAGE_TMP}"
 
 genimage                           \
-- 
2.7.4

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

* [Buildroot] [PATCH 2/4] board/raspberrypi/post-image.sh: add VC4 DTB overlay support
  2017-07-14  6:48 [Buildroot] [PATCH 1/4] board/raspberrypi/post-image.sh: add multi arg support Erik Stromdahl
@ 2017-07-14  6:48 ` Erik Stromdahl
  2017-07-14  6:48 ` [Buildroot] [PATCH 3/4] board/raspberrypi/post-image.sh: add option for uart enable Erik Stromdahl
  2017-07-14  6:48 ` [Buildroot] [PATCH 4/4] configs: raspberrypi3_64_defconfig: enable uart Erik Stromdahl
  2 siblings, 0 replies; 6+ messages in thread
From: Erik Stromdahl @ 2017-07-14  6:48 UTC (permalink / raw)
  To: buildroot

Add option for adding the vc4-fkms-v3d dtoverlay in config.txt.
This will enable the VC4 GPU.

Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
---
 board/raspberrypi/post-image.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/board/raspberrypi/post-image.sh b/board/raspberrypi/post-image.sh
index 4f136f6..be5ed9c 100755
--- a/board/raspberrypi/post-image.sh
+++ b/board/raspberrypi/post-image.sh
@@ -38,6 +38,17 @@ enable_uart=1
 __EOF__
 		fi
 		;;
+		--add-vc4-fkms-v3d-overlay)
+		# Enable VC4 overlay
+		if ! grep -qE '^dtoverlay=' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
+			echo "Adding 'dtoverlay=vc4-fkms-v3d' to config.txt (fixes ttyAMA0 serial console)."
+			cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
+
+# Add VC4 GPU support
+dtoverlay=vc4-fkms-v3d
+__EOF__
+		fi
+		;;
 esac
 
 done
-- 
2.7.4

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

* [Buildroot] [PATCH 3/4] board/raspberrypi/post-image.sh: add option for uart enable
  2017-07-14  6:48 [Buildroot] [PATCH 1/4] board/raspberrypi/post-image.sh: add multi arg support Erik Stromdahl
  2017-07-14  6:48 ` [Buildroot] [PATCH 2/4] board/raspberrypi/post-image.sh: add VC4 DTB overlay support Erik Stromdahl
@ 2017-07-14  6:48 ` Erik Stromdahl
  2017-07-14  6:48 ` [Buildroot] [PATCH 4/4] configs: raspberrypi3_64_defconfig: enable uart Erik Stromdahl
  2 siblings, 0 replies; 6+ messages in thread
From: Erik Stromdahl @ 2017-07-14  6:48 UTC (permalink / raw)
  To: buildroot

Currently, the uart is enabled only when the --aarch64 option
is passed to post-image.sh.

Since enabling of the uart is unrelated to the ARM architecture
(the same config key is applicable to rpi2 as well),
a new option was introduced.

Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
---
 board/raspberrypi/post-image.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/board/raspberrypi/post-image.sh b/board/raspberrypi/post-image.sh
index be5ed9c..d7824a5 100755
--- a/board/raspberrypi/post-image.sh
+++ b/board/raspberrypi/post-image.sh
@@ -28,7 +28,8 @@ __EOF__
 arm_control=0x200
 __EOF__
 		fi
-
+		;;
+		--enable-uart)
 		# Enable uart console
 		if ! grep -qE '^enable_uart=1' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
 			cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
-- 
2.7.4

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

* [Buildroot] [PATCH 4/4] configs: raspberrypi3_64_defconfig: enable uart
  2017-07-14  6:48 [Buildroot] [PATCH 1/4] board/raspberrypi/post-image.sh: add multi arg support Erik Stromdahl
  2017-07-14  6:48 ` [Buildroot] [PATCH 2/4] board/raspberrypi/post-image.sh: add VC4 DTB overlay support Erik Stromdahl
  2017-07-14  6:48 ` [Buildroot] [PATCH 3/4] board/raspberrypi/post-image.sh: add option for uart enable Erik Stromdahl
@ 2017-07-14  6:48 ` Erik Stromdahl
  2017-07-15  5:15   ` Ricardo Martincoski
  2 siblings, 1 reply; 6+ messages in thread
From: Erik Stromdahl @ 2017-07-14  6:48 UTC (permalink / raw)
  To: buildroot

This patch is necessary to preserve the same behaviour as
before the --uart-enable option in post-image.sh was
introduced.

Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
---
 configs/raspberrypi3_64_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/raspberrypi3_64_defconfig b/configs/raspberrypi3_64_defconfig
index 13a505b..af50930 100644
--- a/configs/raspberrypi3_64_defconfig
+++ b/configs/raspberrypi3_64_defconfig
@@ -34,4 +34,4 @@ BR2_TARGET_ROOTFS_EXT2_BLOCKS=120000
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3-64/post-build.sh"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3-64/post-image.sh"
-BR2_ROOTFS_POST_SCRIPT_ARGS="--aarch64"
+BR2_ROOTFS_POST_SCRIPT_ARGS="--aarch64 --enable-uart)"
-- 
2.7.4

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

* [Buildroot] [PATCH 4/4] configs: raspberrypi3_64_defconfig: enable uart
  2017-07-14  6:48 ` [Buildroot] [PATCH 4/4] configs: raspberrypi3_64_defconfig: enable uart Erik Stromdahl
@ 2017-07-15  5:15   ` Ricardo Martincoski
  2017-07-15 10:31     ` Erik Stromdahl
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Martincoski @ 2017-07-15  5:15 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, Jul 14, 2017 at 03:48 AM, Erik Stromdahl wrote:

> This patch is necessary to preserve the same behaviour as
> before the --uart-enable option in post-image.sh was

s/--uart-enable/--enable-uart/

> introduced.

Also, to me it looks like patch 3 and 4 should be merged.
Let's see what others think.

[snip]
> -BR2_ROOTFS_POST_SCRIPT_ARGS="--aarch64"
> +BR2_ROOTFS_POST_SCRIPT_ARGS="--aarch64 --enable-uart)"
                                                       ^
I guess you meant
BR2_ROOTFS_POST_SCRIPT_ARGS="--aarch64 --enable-uart"

Regards,
Ricardo

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

* [Buildroot] [PATCH 4/4] configs: raspberrypi3_64_defconfig: enable uart
  2017-07-15  5:15   ` Ricardo Martincoski
@ 2017-07-15 10:31     ` Erik Stromdahl
  0 siblings, 0 replies; 6+ messages in thread
From: Erik Stromdahl @ 2017-07-15 10:31 UTC (permalink / raw)
  To: buildroot



On 2017-07-15 07:15, Ricardo Martincoski wrote:
> Hello,
> 
> On Fri, Jul 14, 2017 at 03:48 AM, Erik Stromdahl wrote:
> 
>> This patch is necessary to preserve the same behaviour as
>> before the --uart-enable option in post-image.sh was
> 
> s/--uart-enable/--enable-uart/
Right, bad commit comment indeed.
I'll change the comment.

> 
>> introduced.
> 
> Also, to me it looks like patch 3 and 4 should be merged.
> Let's see what others think.
> 
I was actually thinking about this, but then I couldn't figure out a nice
header for the combined commit.

> [snip]
>> -BR2_ROOTFS_POST_SCRIPT_ARGS="--aarch64"
>> +BR2_ROOTFS_POST_SCRIPT_ARGS="--aarch64 --enable-uart)"
>                                                         ^
> I guess you meant
> BR2_ROOTFS_POST_SCRIPT_ARGS="--aarch64 --enable-uart"
Oops, the parenthesis in the end was not intended!

> 
> Regards,
> Ricardo
> 

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

end of thread, other threads:[~2017-07-15 10:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-14  6:48 [Buildroot] [PATCH 1/4] board/raspberrypi/post-image.sh: add multi arg support Erik Stromdahl
2017-07-14  6:48 ` [Buildroot] [PATCH 2/4] board/raspberrypi/post-image.sh: add VC4 DTB overlay support Erik Stromdahl
2017-07-14  6:48 ` [Buildroot] [PATCH 3/4] board/raspberrypi/post-image.sh: add option for uart enable Erik Stromdahl
2017-07-14  6:48 ` [Buildroot] [PATCH 4/4] configs: raspberrypi3_64_defconfig: enable uart Erik Stromdahl
2017-07-15  5:15   ` Ricardo Martincoski
2017-07-15 10:31     ` Erik Stromdahl

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