diff options
author | Josua Mayer <josua@solid-run.com> | 2022-06-16 11:40:15 +0300 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2022-07-25 15:08:23 +0200 |
commit | 6cf1cc987f359649645ad7e8272acf5621c70427 (patch) | |
tree | c57b5a2ad77615c74f74c6c8067b10a6c6a38571 /board/solidrun | |
parent | 408349acbf95a507860fb57f2a3e05d934781899 (diff) | |
download | u-boot-6cf1cc987f359649645ad7e8272acf5621c70427.tar.gz |
mx6cuboxi: fix board detection while patching device-tree phy nodes
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>
Diffstat (limited to 'board/solidrun')
-rw-r--r-- | board/solidrun/mx6cuboxi/mx6cuboxi.c | 13 |
1 files changed, 12 insertions, 1 deletions
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) { |