mx6cuboxi: consolidate board detection and add som revision checking

In order to properly detect the board the checks need to be done
in a specific order.  Move these tests back into a single enum
function that will always return the proper the board it is checking.

This also adds the best test we have for detecting the rev 1.5 som,
and it simplifies the device-tree filename building.

Signed-off-by: Jon Nettleton <jon@solid-run.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
This commit is contained in:
Jon Nettleton
2018-06-07 16:17:36 +03:00
committed by Stefano Babic
parent 8fd05fccc8
commit 73708200f0
2 changed files with 102 additions and 66 deletions

View File

@@ -101,18 +101,18 @@
"fi; " \
"fi\0" \
"findfdt="\
"if test $board_name = HUMMINGBOARD2 && test $board_rev = MX6Q ; then " \
"setenv fdtfile imx6q-hummingboard2.dtb; fi; " \
"if test $board_name = HUMMINGBOARD2 && test $board_rev = MX6DL ; then " \
"setenv fdtfile imx6dl-hummingboard2.dtb; fi; " \
"if test $board_name = HUMMINGBOARD && test $board_rev = MX6Q ; then " \
"setenv fdtfile imx6q-hummingboard.dtb; fi; " \
"if test $board_name = HUMMINGBOARD && test $board_rev = MX6DL ; then " \
"setenv fdtfile imx6dl-hummingboard.dtb; fi; " \
"if test $board_name = CUBOXI && test $board_rev = MX6Q ; then " \
"setenv fdtfile imx6q-cubox-i.dtb; fi; " \
"if test $board_name = CUBOXI && test $board_rev = MX6DL ; then " \
"setenv fdtfile imx6dl-cubox-i.dtb; fi; " \
"if test $board_rev = MX6Q ; then " \
"setenv fdtprefix imx6q; fi; " \
"if test $board_rev = MX6DL ; then " \
"setenv fdtprefix imx6dl; fi; " \
"if test $som_rev = V15 ; then " \
"setenv fdtsuffix -som-v15; fi; " \
"if test $board_name = HUMMINGBOARD2 ; then " \
"setenv fdtfile ${fdtprefix}-hummingboard2${fdtsuffix}.dtb; fi; " \
"if test $board_name = HUMMINGBOARD ; then " \
"setenv fdtfile ${fdtprefix}-hummingboard${fdtsuffix}.dtb; fi; " \
"if test $board_name = CUBOXI ; then " \
"setenv fdtfile ${fdtprefix}-cubox-i${fdtsuffix}.dtb; fi; " \
"if test $fdtfile = undefined; then " \
"echo WARNING: Could not determine dtb to use; fi; \0" \
BOOTENV