ARM: orion5x: only call into phylib when available

Board code cannot call mdiobus_register_board_info() when phylib
or mdio_device is a loadable module:

arch/arm/plat-orion/common.o: In function `orion_ge00_switch_init':
:(.init.text+0x474): undefined reference to `mdiobus_register_board_info'

I had a number of ideas for how this could be solved, but after the MDIO
code got split out from PHYLIB it has gotten too hard, so I'm basically
giving up, and only call the mdiobus_register_board_info() function
if the MDIO layer is built-in to avoid the link error. This is similar
to how we handle PHY registration on other ARM platforms.

Fixes: 90eff9096c01 ("net: phy: Allow splitting MDIO bus/device support from PHYs")
Fixes: 648ea0134069 ("net: phy: Allow pre-declaration of MDIO devices")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>

authored by Arnd Bergmann and committed by Gregory CLEMENT d43e85b7 c1ae3cfa

Changed files
+6
arch
arm
mach-orion5x
plat-orion
+1
arch/arm/mach-orion5x/Kconfig
··· 6 6 select GPIOLIB 7 7 select MVEBU_MBUS 8 8 select PCI 9 + select PHYLIB if NETDEVICES 9 10 select PLAT_ORION_LEGACY 10 11 help 11 12 Support for the following Marvell Orion 5x series SoCs:
+5
arch/arm/plat-orion/common.c
··· 468 468 eth_data, &orion_ge11); 469 469 } 470 470 471 + #ifdef CONFIG_ARCH_ORION5X 471 472 /***************************************************************************** 472 473 * Ethernet switch 473 474 ****************************************************************************/ ··· 480 479 { 481 480 struct mdio_board_info *bd; 482 481 unsigned int i; 482 + 483 + if (!IS_BUILTIN(CONFIG_PHYLIB)) 484 + return; 483 485 484 486 for (i = 0; i < ARRAY_SIZE(d->port_names); i++) 485 487 if (!strcmp(d->port_names[i], "cpu")) ··· 497 493 498 494 mdiobus_register_board_info(&orion_ge00_switch_board_info, 1); 499 495 } 496 + #endif 500 497 501 498 /***************************************************************************** 502 499 * I2C