mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: rdu-common: restart machine after fixing i210 device ID
@ 2019-12-17 11:22 Lucas Stach
  2019-12-18  7:30 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas Stach @ 2019-12-17 11:22 UTC (permalink / raw)
  To: barebox

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

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

end of thread, other threads:[~2019-12-18  7:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17 11:22 [PATCH] ARM: rdu-common: restart machine after fixing i210 device ID Lucas Stach
2019-12-18  7:30 ` Sascha Hauer

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