mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 03:15:00 +00:00
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>
This commit is contained in:
parent
408349acbf
commit
6cf1cc987f
1 changed files with 12 additions and 1 deletions
|
@ -449,15 +449,26 @@ int ft_board_setup(void *fdt, struct bd_info *bd)
|
||||||
int node_phy0, node_phy1, node_phy4;
|
int node_phy0, node_phy1, node_phy4;
|
||||||
int ret, phy;
|
int ret, phy;
|
||||||
bool enable_phy0 = false, enable_phy1 = false, enable_phy4 = false;
|
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
|
// detect phy
|
||||||
phy = find_ethernet_phy();
|
phy = find_ethernet_phy();
|
||||||
if (phy == 0 || phy == 4) {
|
if (phy == 0 || phy == 4) {
|
||||||
enable_phy0 = true;
|
enable_phy0 = true;
|
||||||
switch (board_type()) {
|
switch (board) {
|
||||||
|
case HUMMINGBOARD:
|
||||||
|
case HUMMINGBOARD2:
|
||||||
|
/* atheros phy may appear only at address 0 */
|
||||||
|
break;
|
||||||
case CUBOXI:
|
case CUBOXI:
|
||||||
case UNKNOWN:
|
case UNKNOWN:
|
||||||
default:
|
default:
|
||||||
|
/* atheros phy may appear at either address 0 or 4 */
|
||||||
enable_phy4 = true;
|
enable_phy4 = true;
|
||||||
}
|
}
|
||||||
} else if (phy == 1) {
|
} else if (phy == 1) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue