[PATCH 08/23] ARM: zii-imx6q-rdu2: Differentiate between RDU2 and RDU2+

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add code to configure hostname so we could differentiate between the
two in scripts.

Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
---
 arch/arm/boards/zii-imx6q-rdu2/board.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boards/zii-imx6q-rdu2/board.c b/arch/arm/boards/zii-imx6q-rdu2/board.c
index d41609bfa..0bb4700b6 100644
--- a/arch/arm/boards/zii-imx6q-rdu2/board.c
+++ b/arch/arm/boards/zii-imx6q-rdu2/board.c
@@ -128,8 +128,11 @@ static int rdu2_devices_init(void)
 {
 	struct i2c_client client;
 
-	if (!of_machine_is_compatible("zii,imx6q-zii-rdu2") &&
-	    !of_machine_is_compatible("zii,imx6qp-zii-rdu2"))
+	if (of_machine_is_compatible("zii,imx6q-zii-rdu2"))
+		barebox_set_hostname("rdu2");
+	else if (of_machine_is_compatible("zii,imx6qp-zii-rdu2"))
+		barebox_set_hostname("rdu2p");
+	else
 		return 0;
 
 	client.adapter = i2c_get_adapter(1);
@@ -147,8 +150,6 @@ static int rdu2_devices_init(void)
 		i2c_write_reg(&client, 0x2e, &reg, 1);
 	}
 
-	barebox_set_hostname("rdu2");
-
 	imx6_bbu_internal_spi_i2c_register_handler("SPI", "/dev/m25p0.barebox",
 						   BBU_HANDLER_FLAG_DEFAULT);
 
-- 
2.21.0


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



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux