From: Oleksij Rempel <o.rempel@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Subject: [PATCH v3 4/7] ARM: boards: skov-imx6: disable eth0 for barebox if no switch is detected
Date: Mon, 20 Sep 2021 13:15:25 +0200 [thread overview]
Message-ID: <20210920111528.14575-5-o.rempel@pengutronix.de> (raw)
In-Reply-To: <20210920111528.14575-1-o.rempel@pengutronix.de>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
arch/arm/boards/skov-imx6/board.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm/boards/skov-imx6/board.c b/arch/arm/boards/skov-imx6/board.c
index a94c2cd25c..4044bacb28 100644
--- a/arch/arm/boards/skov-imx6/board.c
+++ b/arch/arm/boards/skov-imx6/board.c
@@ -540,6 +540,7 @@ static void skov_init_board(const struct board_description *variant)
static int skov_switch_test(void)
{
struct phy_device *phydev;
+ struct device_d *eth0;
struct mii_bus *mii;
int ret;
@@ -567,6 +568,15 @@ no_switch:
pr_notice("No-switch variant is detected\n");
+ eth0 = get_device_by_name("eth0");
+ if (eth0) {
+ ret = dev_set_param(eth0, "mode", "disabled");
+ if (ret)
+ pr_warn("Can't set eth0 mode\n");
+ } else {
+ pr_warn("Can't disable eth0\n");
+ }
+
return 0;
}
late_initcall(skov_switch_test);
--
2.30.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev 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 ` Oleksij Rempel [this message]
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 ` [PATCH v3 7/7] ARM: boards: skov-imx6: add defaultenv with eth1-discover script Oleksij Rempel
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-5-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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox