mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] ARM: rdu-common: restart machine after fixing i210 device ID
Date: Tue, 17 Dec 2019 12:22:38 +0100	[thread overview]
Message-ID: <20191217112238.32333-1-l.stach@pengutronix.de> (raw)

For the iNVM change to take effect we need to reset the i210 adapter.
As this is not really possible in isolation in Barebox, we just go
through a full machine reset cycle. As this should only happen once
during the lifetime of each device there is no need for a more
elaborate solution.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boards/zii-common/board.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boards/zii-common/board.c b/arch/arm/boards/zii-common/board.c
index c13b04c2221e..3e44b85a4d70 100644
--- a/arch/arm/boards/zii-common/board.c
+++ b/arch/arm/boards/zii-common/board.c
@@ -13,11 +13,12 @@
  */
 
 #include <common.h>
+#include <fs.h>
 #include <globalvar.h>
 #include <init.h>
-#include <fs.h>
-#include <net.h>
 #include <linux/nvmem-consumer.h>
+#include <net.h>
+#include <restart.h>
 
 static int rdu_eth_register_ethaddr(struct device_node *np)
 {
@@ -129,6 +130,9 @@ static int rdu_i210_invm(void)
 	val = I210_CFGWORD_PCIID_157B;
 	pwrite(fd, &val, sizeof(val), 0);
 
+	shutdown_barebox();
+	restart_machine();
+
 	return 0;
 }
 late_initcall(rdu_i210_invm);
-- 
2.20.1


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

             reply	other threads:[~2019-12-17 11:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17 11:22 Lucas Stach [this message]
2019-12-18  7:30 ` Sascha Hauer

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=20191217112238.32333-1-l.stach@pengutronix.de \
    --to=l.stach@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