Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: mxs: remove obsolete startup code for TX28

The power and reset handling of the FEC ethernet driver is sufficient
to get the ethernet PHY on the TX28 into a usable state.
Remove the code that does the PHY initialization on startup.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>

authored by

Lothar Waßmann and committed by
Shawn Guo
7705b5ed d7b5ccc9

-77
-77
arch/arm/mach-mxs/mach-mxs.c
··· 268 268 apx4devkit_phy_fixup); 269 269 } 270 270 271 - #define ENET0_MDC__GPIO_4_0 MXS_GPIO_NR(4, 0) 272 - #define ENET0_MDIO__GPIO_4_1 MXS_GPIO_NR(4, 1) 273 - #define ENET0_RX_EN__GPIO_4_2 MXS_GPIO_NR(4, 2) 274 - #define ENET0_RXD0__GPIO_4_3 MXS_GPIO_NR(4, 3) 275 - #define ENET0_RXD1__GPIO_4_4 MXS_GPIO_NR(4, 4) 276 - #define ENET0_TX_EN__GPIO_4_6 MXS_GPIO_NR(4, 6) 277 - #define ENET0_TXD0__GPIO_4_7 MXS_GPIO_NR(4, 7) 278 - #define ENET0_TXD1__GPIO_4_8 MXS_GPIO_NR(4, 8) 279 - #define ENET_CLK__GPIO_4_16 MXS_GPIO_NR(4, 16) 280 - 281 - #define TX28_FEC_PHY_POWER MXS_GPIO_NR(3, 29) 282 - #define TX28_FEC_PHY_RESET MXS_GPIO_NR(4, 13) 283 - #define TX28_FEC_nINT MXS_GPIO_NR(4, 5) 284 - 285 - static const struct gpio const tx28_gpios[] __initconst = { 286 - { ENET0_MDC__GPIO_4_0, GPIOF_OUT_INIT_LOW, "GPIO_4_0" }, 287 - { ENET0_MDIO__GPIO_4_1, GPIOF_OUT_INIT_LOW, "GPIO_4_1" }, 288 - { ENET0_RX_EN__GPIO_4_2, GPIOF_OUT_INIT_LOW, "GPIO_4_2" }, 289 - { ENET0_RXD0__GPIO_4_3, GPIOF_OUT_INIT_LOW, "GPIO_4_3" }, 290 - { ENET0_RXD1__GPIO_4_4, GPIOF_OUT_INIT_LOW, "GPIO_4_4" }, 291 - { ENET0_TX_EN__GPIO_4_6, GPIOF_OUT_INIT_LOW, "GPIO_4_6" }, 292 - { ENET0_TXD0__GPIO_4_7, GPIOF_OUT_INIT_LOW, "GPIO_4_7" }, 293 - { ENET0_TXD1__GPIO_4_8, GPIOF_OUT_INIT_LOW, "GPIO_4_8" }, 294 - { ENET_CLK__GPIO_4_16, GPIOF_OUT_INIT_LOW, "GPIO_4_16" }, 295 - { TX28_FEC_PHY_POWER, GPIOF_OUT_INIT_LOW, "fec-phy-power" }, 296 - { TX28_FEC_PHY_RESET, GPIOF_OUT_INIT_LOW, "fec-phy-reset" }, 297 - { TX28_FEC_nINT, GPIOF_DIR_IN, "fec-int" }, 298 - }; 299 - 300 - static void __init tx28_post_init(void) 301 - { 302 - struct device_node *np; 303 - struct platform_device *pdev; 304 - struct pinctrl *pctl; 305 - int ret; 306 - 307 - enable_clk_enet_out(); 308 - 309 - np = of_find_compatible_node(NULL, NULL, "fsl,imx28-fec"); 310 - pdev = of_find_device_by_node(np); 311 - if (!pdev) { 312 - pr_err("%s: failed to find fec device\n", __func__); 313 - return; 314 - } 315 - 316 - pctl = pinctrl_get_select(&pdev->dev, "gpio_mode"); 317 - if (IS_ERR(pctl)) { 318 - pr_err("%s: failed to get pinctrl state\n", __func__); 319 - return; 320 - } 321 - 322 - ret = gpio_request_array(tx28_gpios, ARRAY_SIZE(tx28_gpios)); 323 - if (ret) { 324 - pr_err("%s: failed to request gpios: %d\n", __func__, ret); 325 - return; 326 - } 327 - 328 - /* Power up fec phy */ 329 - gpio_set_value(TX28_FEC_PHY_POWER, 1); 330 - msleep(26); /* 25ms according to data sheet */ 331 - 332 - /* Mode strap pins */ 333 - gpio_set_value(ENET0_RX_EN__GPIO_4_2, 1); 334 - gpio_set_value(ENET0_RXD0__GPIO_4_3, 1); 335 - gpio_set_value(ENET0_RXD1__GPIO_4_4, 1); 336 - 337 - udelay(100); /* minimum assertion time for nRST */ 338 - 339 - /* Deasserting FEC PHY RESET */ 340 - gpio_set_value(TX28_FEC_PHY_RESET, 1); 341 - 342 - pinctrl_put(pctl); 343 - } 344 - 345 271 static void __init crystalfontz_init(void) 346 272 { 347 273 update_fec_mac_prop(OUI_CRYSTALFONTZ); ··· 427 501 of_platform_default_populate(NULL, NULL, parent); 428 502 429 503 mxs_restart_init(); 430 - 431 - if (of_machine_is_compatible("karo,tx28")) 432 - tx28_post_init(); 433 504 } 434 505 435 506 #define MXS_CLKCTRL_RESET_CHIP (1 << 1)