diff --git a/arch/arm/mach-fh/board-fh8856.c b/arch/arm/mach-fh/board-fh8856.c index fabbf37871..93a46ccc32 100644 --- a/arch/arm/mach-fh/board-fh8856.c +++ b/arch/arm/mach-fh/board-fh8856.c @@ -410,6 +410,19 @@ static void fh_set_rmii_speed(int speed) static void fh_phy_reset(void) { +#ifdef CONFIG_GPIO_EMACPHY_RESET_UNWIRED + /* + * The board config declares CONFIG_GPIO_EMACPHY_RESET as not routed to + * the PHY. On FH8856 boards such as the Asecam PB1 (IF5653-V2) that + * GPIO is pad 46, which is PWM7 there; pulsing it while the RXDV strap + * floats leaves the JL1101 unresponsive on MDIO. The vendor firmware + * does not reset the PHY either, and U-Boot has already brought it up. + * + * Boards that do wire the line - FH8852 among them - keep the reset + * sequence below. + */ + return; +#else /* * RXDV must be low during phy reset */ @@ -428,7 +441,7 @@ static void fh_phy_reset(void) gpio_free(CONFIG_GPIO_EMACPHY_RXDV); fh_pmu_set_reg(0xe8, 0x00101030); - +#endif } static struct fh_gmac_platform_data fh_gmac_data = { diff --git a/arch/arm/mach-fh/include/mach/board_config.fh8856.appboard b/arch/arm/mach-fh/include/mach/board_config.fh8856.appboard index 1cd8c86cb7..b4d726f801 100644 --- a/arch/arm/mach-fh/include/mach/board_config.fh8856.appboard +++ b/arch/arm/mach-fh/include/mach/board_config.fh8856.appboard @@ -27,6 +27,13 @@ * GPIO55 -> SD1 WIFI Interrupt */ +/* + * GPIO11 is pad 46 (PWM7) on this board and is not routed to the PHY reset + * pin; see fh_phy_reset() in board-fh8856.c. Boards that do wire it, such as + * the FH8852 appboard, must not define this. + */ +#define CONFIG_GPIO_EMACPHY_RESET_UNWIRED 1 + #define CONFIG_GPIO_EMACPHY_RESET 11 #define CONFIG_GPIO_EMACPHY_RXDV 41 @@ -39,7 +46,7 @@ #define FH_BOARD_8856 #define CONFIG_PINCTRL_SELECT \ "I2C0", "I2C1", "MIPI", "RMII", "SD0_NO_WP", \ - "SD1_NO_WP", "SSI0_4BIT", "UART0", "GPIO0", "GPIO1", \ + "SSI0_4BIT", "UART0", "GPIO0", "GPIO1", \ "GPIO2", "GPIO3", "GPIO11", "GPIO13", "GPIO14", \ "GPIO19", "GPIO20", "GPIO24", "GPIO25", "GPIO26", \ "GPIO27", "GPIO28", "GPIO53", "GPIO55" diff --git a/arch/arm/mach-fh/include/mach/board_config.fh8856.testboard b/arch/arm/mach-fh/include/mach/board_config.fh8856.testboard index 1cd8c86cb7..b4d726f801 100644 --- a/arch/arm/mach-fh/include/mach/board_config.fh8856.testboard +++ b/arch/arm/mach-fh/include/mach/board_config.fh8856.testboard @@ -27,6 +27,13 @@ * GPIO55 -> SD1 WIFI Interrupt */ +/* + * GPIO11 is pad 46 (PWM7) on this board and is not routed to the PHY reset + * pin; see fh_phy_reset() in board-fh8856.c. Boards that do wire it, such as + * the FH8852 appboard, must not define this. + */ +#define CONFIG_GPIO_EMACPHY_RESET_UNWIRED 1 + #define CONFIG_GPIO_EMACPHY_RESET 11 #define CONFIG_GPIO_EMACPHY_RXDV 41 @@ -39,7 +46,7 @@ #define FH_BOARD_8856 #define CONFIG_PINCTRL_SELECT \ "I2C0", "I2C1", "MIPI", "RMII", "SD0_NO_WP", \ - "SD1_NO_WP", "SSI0_4BIT", "UART0", "GPIO0", "GPIO1", \ + "SSI0_4BIT", "UART0", "GPIO0", "GPIO1", \ "GPIO2", "GPIO3", "GPIO11", "GPIO13", "GPIO14", \ "GPIO19", "GPIO20", "GPIO24", "GPIO25", "GPIO26", \ "GPIO27", "GPIO28", "GPIO53", "GPIO55" diff --git a/arch/arm/mach-fh/include/mach/board_config.h b/arch/arm/mach-fh/include/mach/board_config.h index 1cd8c86cb7..b4d726f801 100644 --- a/arch/arm/mach-fh/include/mach/board_config.h +++ b/arch/arm/mach-fh/include/mach/board_config.h @@ -27,6 +27,13 @@ * GPIO55 -> SD1 WIFI Interrupt */ +/* + * GPIO11 is pad 46 (PWM7) on this board and is not routed to the PHY reset + * pin; see fh_phy_reset() in board-fh8856.c. Boards that do wire it, such as + * the FH8852 appboard, must not define this. + */ +#define CONFIG_GPIO_EMACPHY_RESET_UNWIRED 1 + #define CONFIG_GPIO_EMACPHY_RESET 11 #define CONFIG_GPIO_EMACPHY_RXDV 41 @@ -39,7 +46,7 @@ #define FH_BOARD_8856 #define CONFIG_PINCTRL_SELECT \ "I2C0", "I2C1", "MIPI", "RMII", "SD0_NO_WP", \ - "SD1_NO_WP", "SSI0_4BIT", "UART0", "GPIO0", "GPIO1", \ + "SSI0_4BIT", "UART0", "GPIO0", "GPIO1", \ "GPIO2", "GPIO3", "GPIO11", "GPIO13", "GPIO14", \ "GPIO19", "GPIO20", "GPIO24", "GPIO25", "GPIO26", \ "GPIO27", "GPIO28", "GPIO53", "GPIO55" diff --git a/drivers/net/fh_gmac/fh_gmac_phyt.c b/drivers/net/fh_gmac/fh_gmac_phyt.c index b2ff4eb0b7..c9342dd919 100644 --- a/drivers/net/fh_gmac/fh_gmac_phyt.c +++ b/drivers/net/fh_gmac/fh_gmac_phyt.c @@ -84,6 +84,7 @@ int fh_mdio_set_mii(struct mii_bus *bus) switch (pGmac->phydev->phy_id) { case FH_GMAC_PHY_RTL8201: case FH_GMAC_PHY_JL1101: + case FH_GMAC_PHY_JL1101_B: fh_mdio_write(bus, phyid, gmac_phyt_rtl8201_page_select, 7); fh_mdio_write(bus, phyid, @@ -118,6 +119,7 @@ int fh_mdio_set_mii(struct mii_bus *bus) switch (pGmac->phydev->phy_id) { case FH_GMAC_PHY_RTL8201: case FH_GMAC_PHY_JL1101: + case FH_GMAC_PHY_JL1101_B: fh_mdio_write(bus, phyid, gmac_phyt_rtl8201_page_select, 7); fh_mdio_write(bus, phyid, diff --git a/drivers/net/fh_gmac/fh_gmac_phyt.h b/drivers/net/fh_gmac/fh_gmac_phyt.h index f7256ff31a..c6d7535bae 100755 --- a/drivers/net/fh_gmac/fh_gmac_phyt.h +++ b/drivers/net/fh_gmac/fh_gmac_phyt.h @@ -12,6 +12,9 @@ #define FH_GMAC_PHY_RTL8201 0x001CC816 #define FH_GMAC_PHY_TI83848 0xFFFFFFFF #define FH_GMAC_PHY_JL1101 0x937c4023 +/* JLSemi JL1101, newer stepping (e.g. Asecam PB1 / IF5653-V2 with FH8856). + Same RMII setup as 0x937c4023. */ +#define FH_GMAC_PHY_JL1101_B 0x937c4024 enum {