[PATCH 1/3] i.MX6: phytec: Separate SoM specific code

Andrey Smirnov andrew.smirnov at gmail.com
Thu Jan 15 18:32:33 PST 2015


Separate SoM(designator PFLA02) specific and base board(designator
PBAB0x) code into two distinct functions. PHYTEC default environment
for PHYFLEX references peripherals that may or may not be used on
custom baseboards used with SoMs. Move the code appending it into a
separate function that would have effect only for boards explicitly
claiming compatibility with PHYTEC baseboards.

Signed-off-by: Andrey Smirnov <andrew.smirnov at gmail.com>
---
 arch/arm/boards/phytec-phyflex-imx6/board.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/phytec-phyflex-imx6/board.c b/arch/arm/boards/phytec-phyflex-imx6/board.c
index 1551460..7ac7928 100644
--- a/arch/arm/boards/phytec-phyflex-imx6/board.c
+++ b/arch/arm/boards/phytec-phyflex-imx6/board.c
@@ -87,8 +87,19 @@ static int phytec_pfla02_init(void)
 		break;
 	}
 
+	return 0;
+}
+device_initcall(phytec_pfla02_init);
+
+static int phytec_pbab0x_init(void)
+{
+	if (!of_machine_is_compatible("phytec,imx6x-pbab01") &&
+		!of_machine_is_compatible("phytec,imx6dl-pbab05") &&
+		!of_machine_is_compatible("phytec,imx6q-pbab02"))
+		return 0;
+
 	defaultenv_append_directory(defaultenv_phyflex_imx6);
 
 	return 0;
 }
-device_initcall(phytec_pfla02_init);
+device_initcall(phytec_pbab0x_init);
-- 
2.1.0




More information about the barebox mailing list