* [PATCH] mx6cuboxi: fix board detection while patching device-tree phy nodes
@ 2022-06-16 8:40 Josua Mayer
2022-07-25 16:41 ` sbabic
0 siblings, 1 reply; 2+ messages in thread
From: Josua Mayer @ 2022-06-16 8:40 UTC (permalink / raw)
To: u-boot; +Cc: alvaro.karsz, Josua Mayer, Baruch Siach, Fabio Estevam
ft_board_setup relies on the board_type() function to optimize which phy
nodes need to be enabled for Linux.
Add calls to setup and release the board-detect GPIOs.
Also fix the switch-case statement to only enable phy address 4 for
Cubox and unknown devices.
Fixes: 741ce308 ("mx6cuboxi: fixup dtb ethernet phy nodes before booting an OS")
Signed-off-by: Josua Mayer <josua@solid-run.com>
---
board/solidrun/mx6cuboxi/mx6cuboxi.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
index 42aa5cb63c..debf4f6a3b 100644
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
@@ -449,15 +449,26 @@ int ft_board_setup(void *fdt, struct bd_info *bd)
int node_phy0, node_phy1, node_phy4;
int ret, phy;
bool enable_phy0 = false, enable_phy1 = false, enable_phy4 = false;
+ enum board_type board;
+
+ // detect device
+ request_detect_gpios();
+ board = board_type();
+ free_detect_gpios();
// detect phy
phy = find_ethernet_phy();
if (phy == 0 || phy == 4) {
enable_phy0 = true;
- switch (board_type()) {
+ switch (board) {
+ case HUMMINGBOARD:
+ case HUMMINGBOARD2:
+ /* atheros phy may appear only at address 0 */
+ break;
case CUBOXI:
case UNKNOWN:
default:
+ /* atheros phy may appear at either address 0 or 4 */
enable_phy4 = true;
}
} else if (phy == 1) {
--
2.35.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] mx6cuboxi: fix board detection while patching device-tree phy nodes
2022-06-16 8:40 [PATCH] mx6cuboxi: fix board detection while patching device-tree phy nodes Josua Mayer
@ 2022-07-25 16:41 ` sbabic
0 siblings, 0 replies; 2+ messages in thread
From: sbabic @ 2022-07-25 16:41 UTC (permalink / raw)
To: Josua Mayer, u-boot
> ft_board_setup relies on the board_type() function to optimize which phy
> nodes need to be enabled for Linux.
> Add calls to setup and release the board-detect GPIOs.
> Also fix the switch-case statement to only enable phy address 4 for
> Cubox and unknown devices.
> Fixes: 741ce308 ("mx6cuboxi: fixup dtb ethernet phy nodes before booting an OS")
> Signed-off-by: Josua Mayer <josua@solid-run.com>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-25 16:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-16 8:40 [PATCH] mx6cuboxi: fix board detection while patching device-tree phy nodes Josua Mayer
2022-07-25 16:41 ` sbabic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox