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.smir...@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


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

Reply via email to