mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Subject: [PATCH v3 7/7] ARM: boards: skov-imx6: add defaultenv with eth1-discover script
Date: Mon, 20 Sep 2021 13:15:28 +0200
Message-ID: <20210920111528.14575-8-o.rempel@pengutronix.de> (raw)
In-Reply-To: <20210920111528.14575-1-o.rempel@pengutronix.de>

Add eth1-discover script to run USB detection if eth0 is disabled. The
eth0 will be automatically disabled if the no on-board switch is
detected.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/boards/skov-imx6/Makefile                        | 1 +
 arch/arm/boards/skov-imx6/board.c                         | 3 +++
 .../skov-imx6/defaultenv-skov-imx6/network/eth1-discover  | 8 ++++++++
 3 files changed, 12 insertions(+)
 create mode 100644 arch/arm/boards/skov-imx6/defaultenv-skov-imx6/network/eth1-discover

diff --git a/arch/arm/boards/skov-imx6/Makefile b/arch/arm/boards/skov-imx6/Makefile
index a5e85bc1e1..07b87ff11d 100644
--- a/arch/arm/boards/skov-imx6/Makefile
+++ b/arch/arm/boards/skov-imx6/Makefile
@@ -1,3 +1,4 @@
 obj-y += board.o
 lwl-y += lowlevel.o
 obj-pbl-y += version.o
+bbenv-y += defaultenv-skov-imx6
diff --git a/arch/arm/boards/skov-imx6/board.c b/arch/arm/boards/skov-imx6/board.c
index 6a9055757c..8881c10ab2 100644
--- a/arch/arm/boards/skov-imx6/board.c
+++ b/arch/arm/boards/skov-imx6/board.c
@@ -5,6 +5,7 @@
 #include <bootsource.h>
 #include <common.h>
 #include <deep-probe.h>
+#include <envfs.h>
 #include <environment.h>
 #include <globalvar.h>
 #include <gpio.h>
@@ -662,6 +663,8 @@ static int skov_imx6_probe(struct device_d *dev)
 
 	skov_init_board(variant);
 
+	defaultenv_append_directory(defaultenv_skov_imx6);
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/skov-imx6/defaultenv-skov-imx6/network/eth1-discover b/arch/arm/boards/skov-imx6/defaultenv-skov-imx6/network/eth1-discover
new file mode 100644
index 0000000000..e11a3f9006
--- /dev/null
+++ b/arch/arm/boards/skov-imx6/defaultenv-skov-imx6/network/eth1-discover
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Some boards doesn't have a ETH port, but may have USB network attached
+if [ "$eth0.mode" != "disabled" ]; then
+	exit 0;
+fi
+
+usb
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      parent reply	other threads:[~2021-09-20 11:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20 11:15 [PATCH v3 0/7] add noswitch support for skov boards Oleksij Rempel
2021-09-20 11:15 ` [PATCH v3 1/7] ARM: dts: skov-imx6: add USB nodes Oleksij Rempel
2021-09-20 11:15 ` [PATCH v3 2/7] ARM: boards: skov-imx6: fixup_machine_compatible() add optional root node Oleksij Rempel
2021-09-20 11:15 ` [PATCH v3 3/7] ARM: boards: skov-imx6: add switch detection Oleksij Rempel
2021-10-01 14:29   ` Sascha Hauer
2021-09-20 11:15 ` [PATCH v3 4/7] ARM: boards: skov-imx6: disable eth0 for barebox if no switch is detected Oleksij Rempel
2021-09-20 11:15 ` [PATCH v3 5/7] ARM: boards: skov-imx6: fixup different DTS variants Oleksij Rempel
2021-09-20 11:15 ` [PATCH v3 6/7] ARM: boards: skov-imx6: start using deep-probe Oleksij Rempel
2021-09-20 11:15 ` Oleksij Rempel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210920111528.14575-8-o.rempel@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

mail archive of the barebox mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://lore.barebox.org/barebox/0 barebox/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 barebox barebox/ https://lore.barebox.org/barebox \
		barebox@lists.infradead.org
	public-inbox-index barebox

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git