Commit b1e8512e9dbe1771da9c3ad3ddfaf7681318fe0e
Committed by
Stefano Babic
1 parent
30df9f770b
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
detect and setup solidrun hummingboard2
The hummingboard2 is slightly different to the cubox i and to the hummingboard. The GPIO pin info to probe came from solidruns for of u-boot on github. https://github.com/SolidRun/u-boot-imx6/blob/imx6/board/solidrun/mx6_cubox-i/mx6_cubox-i.c#L569-L589 I have tested on a hummingboard-edge witha imx6 solo and 512mb of ram. Signed-off-by: Dennis Gilmore <dgilmore@redhat.com>
Showing 2 changed files with 37 additions and 2 deletions Side-by-side Diff
board/solidrun/mx6cuboxi/mx6cuboxi.c
... | ... | @@ -349,6 +349,7 @@ |
349 | 349 | * Machine selection - |
350 | 350 | * Machine val1, val2 |
351 | 351 | * ------------------------- |
352 | + * HB2 x x | |
352 | 353 | * HB rev 3.x x 0 |
353 | 354 | * CBi 0 1 |
354 | 355 | * HB 1 1 |
355 | 356 | |
... | ... | @@ -362,9 +363,37 @@ |
362 | 363 | return true; |
363 | 364 | } |
364 | 365 | |
366 | +static bool is_hummingboard2(void) | |
367 | +{ | |
368 | + int val1; | |
369 | + | |
370 | + SETUP_IOMUX_PADS(hb_cbi_sense); | |
371 | + | |
372 | + gpio_direction_input(IMX_GPIO_NR(2, 8)); | |
373 | + | |
374 | + val1 = gpio_get_value(IMX_GPIO_NR(2, 8)); | |
375 | + | |
376 | + /* | |
377 | + * Machine selection - | |
378 | + * Machine val1 | |
379 | + * ------------------- | |
380 | + * HB2 0 | |
381 | + * HB rev 3.x x | |
382 | + * CBi x | |
383 | + * HB x | |
384 | + */ | |
385 | + | |
386 | + if (val1 == 0) | |
387 | + return true; | |
388 | + else | |
389 | + return false; | |
390 | +} | |
391 | + | |
365 | 392 | int checkboard(void) |
366 | 393 | { |
367 | - if (is_hummingboard()) | |
394 | + if (is_hummingboard2()) | |
395 | + puts("Board: MX6 Hummingboard2\n"); | |
396 | + else if (is_hummingboard()) | |
368 | 397 | puts("Board: MX6 Hummingboard\n"); |
369 | 398 | else |
370 | 399 | puts("Board: MX6 Cubox-i\n"); |
... | ... | @@ -375,7 +404,9 @@ |
375 | 404 | int board_late_init(void) |
376 | 405 | { |
377 | 406 | #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG |
378 | - if (is_hummingboard()) | |
407 | + if (is_hummingboard2()) | |
408 | + env_set("board_name", "HUMMINGBOARD2"); | |
409 | + else if (is_hummingboard()) | |
379 | 410 | env_set("board_name", "HUMMINGBOARD"); |
380 | 411 | else |
381 | 412 | env_set("board_name", "CUBOXI"); |
include/configs/mx6cuboxi.h
... | ... | @@ -106,6 +106,10 @@ |
106 | 106 | "fi; " \ |
107 | 107 | "fi\0" \ |
108 | 108 | "findfdt="\ |
109 | + "if test $board_name = HUMMINGBOARD2 && test $board_rev = MX6Q ; then " \ | |
110 | + "setenv fdtfile imx6q-hummingboard2.dtb; fi; " \ | |
111 | + "if test $board_name = HUMMINGBOARD2 && test $board_rev = MX6DL ; then " \ | |
112 | + "setenv fdtfile imx6dl-hummingboard2.dtb; fi; " \ | |
109 | 113 | "if test $board_name = HUMMINGBOARD && test $board_rev = MX6Q ; then " \ |
110 | 114 | "setenv fdtfile imx6q-hummingboard.dtb; fi; " \ |
111 | 115 | "if test $board_name = HUMMINGBOARD && test $board_rev = MX6DL ; then " \ |