Commit 41855186afd35669228e103a43e4eaf42fcc6496
Committed by
Stefano Babic
1 parent
53af877fd2
Exists in
v2017.01-smarct4x
and in
33 other branches
arm: mx6: cm-fx6: modify device tree for old revisions of utilite
Old revisions of Utilite (a miniature PC based on cm-fx6) do not have a card detect for mmc, and thus the kernel needs to be told that there's a persistent storage on usdhc3 to force it to probe the mmc card. Check the baseboard revision and modify the device tree accordingly if needed. Cc: Stefano Babic <sbabic@denx.de> Cc: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Showing 1 changed file with 20 additions and 0 deletions Side-by-side Diff
board/compulab/cm_fx6/cm_fx6.c
| ... | ... | @@ -561,9 +561,14 @@ |
| 561 | 561 | #endif |
| 562 | 562 | |
| 563 | 563 | #ifdef CONFIG_OF_BOARD_SETUP |
| 564 | +#define USDHC3_PATH "/soc/aips-bus@02100000/usdhc@02198000/" | |
| 564 | 565 | int ft_board_setup(void *blob, bd_t *bd) |
| 565 | 566 | { |
| 567 | + u32 baseboard_rev; | |
| 568 | + int nodeoffset; | |
| 566 | 569 | uint8_t enetaddr[6]; |
| 570 | + char baseboard_name[16]; | |
| 571 | + int err; | |
| 567 | 572 | |
| 568 | 573 | /* MAC addr */ |
| 569 | 574 | if (eth_getenv_enetaddr("ethaddr", enetaddr)) { |
| ... | ... | @@ -575,6 +580,21 @@ |
| 575 | 580 | if (eth_getenv_enetaddr("eth1addr", enetaddr)) { |
| 576 | 581 | fdt_find_and_setprop(blob, "/eth@pcie", "local-mac-address", |
| 577 | 582 | enetaddr, 6, 1); |
| 583 | + } | |
| 584 | + | |
| 585 | + baseboard_rev = cl_eeprom_get_board_rev(0); | |
| 586 | + err = cl_eeprom_get_product_name((uchar *)baseboard_name, 0); | |
| 587 | + if (err || baseboard_rev == 0) | |
| 588 | + return 0; /* Assume not an early revision SB-FX6m baseboard */ | |
| 589 | + | |
| 590 | + if (!strncmp("SB-FX6m", baseboard_name, 7) && baseboard_rev <= 120) { | |
| 591 | + fdt_shrink_to_minimum(blob); /* Make room for new properties */ | |
| 592 | + nodeoffset = fdt_path_offset(blob, USDHC3_PATH); | |
| 593 | + fdt_delprop(blob, nodeoffset, "cd-gpios"); | |
| 594 | + fdt_find_and_setprop(blob, USDHC3_PATH, "non-removable", | |
| 595 | + NULL, 0, 1); | |
| 596 | + fdt_find_and_setprop(blob, USDHC3_PATH, "keep-power-in-suspend", | |
| 597 | + NULL, 0, 1); | |
| 578 | 598 | } |
| 579 | 599 | |
| 580 | 600 | return 0; |