From 452b3813f99538ebd54407e911733c4b26efd1a4 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Thu, 26 May 2016 09:48:24 +0100 Subject: clearfog: add HUSH parser In the big move of CONFIG_HUSH_PARSER to config files the clearfog somehow missed out. Signed-off-by: Peter Robinson Signed-off-by: Stefan Roese diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig index 0fde640..75ea200 100644 --- a/configs/clearfog_defconfig +++ b/configs/clearfog_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_MVEBU=y CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_CLEARFOG=y CONFIG_DEFAULT_DEVICE_TREE="armada-388-clearfog" +CONFIG_HUSH_PARSER=y CONFIG_SPL=y CONFIG_CMD_BOOTZ=y # CONFIG_CMD_IMLS is not set -- cgit v0.10.2 From f7c32e8ece7fefd950382a7522aff9939a218b91 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Wed, 27 Apr 2016 09:10:42 +0200 Subject: arm: spear: x600: Add support for Micrel KSZ9031 PHY As the old ethernet PHY is not available any more, the x600 board has been redesigned with the Micrel KSZ9031 PHY. This patch adds support to autodetect the PHY and configure the Micrel PHY correctly. Signed-off-by: Stefan Roese diff --git a/board/spear/x600/x600.c b/board/spear/x600/x600.c index b8edfcd..f8e9fdd 100644 --- a/board/spear/x600/x600.c +++ b/board/spear/x600/x600.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include @@ -69,27 +70,64 @@ void board_nand_init(void) int board_phy_config(struct phy_device *phydev) { - /* Extended PHY control 1, select GMII */ - phy_write(phydev, MDIO_DEVAD_NONE, 23, 0x0020); - - /* Software reset necessary after GMII mode selction */ - phy_reset(phydev); - - /* Enable extended page register access */ - phy_write(phydev, MDIO_DEVAD_NONE, 31, 0x0001); - - /* 17e: Enhanced LED behavior, needs to be written twice */ - phy_write(phydev, MDIO_DEVAD_NONE, 17, 0x09ff); - phy_write(phydev, MDIO_DEVAD_NONE, 17, 0x09ff); - - /* 16e: Enhanced LED method select */ - phy_write(phydev, MDIO_DEVAD_NONE, 16, 0xe0ea); - - /* Disable extended page register access */ - phy_write(phydev, MDIO_DEVAD_NONE, 31, 0x0000); - - /* Enable clock output pin */ - phy_write(phydev, MDIO_DEVAD_NONE, 18, 0x0049); + unsigned short id1, id2; + + /* check whether KSZ9031 or AR8035 has to be configured */ + id1 = phy_read(phydev, MDIO_DEVAD_NONE, 2); + id2 = phy_read(phydev, MDIO_DEVAD_NONE, 3); + + if ((id1 == 0x22) && ((id2 & 0xFFF0) == 0x1620)) { + /* PHY configuration for Micrel KSZ9031 */ + printf("PHY KSZ9031 detected - "); + + phy_write(phydev, MDIO_DEVAD_NONE, MII_CTRL1000, 0x1c00); + + /* control data pad skew - devaddr = 0x02, register = 0x04 */ + ksz9031_phy_extended_write(phydev, 0x02, + MII_KSZ9031_EXT_RGMII_CTRL_SIG_SKEW, + MII_KSZ9031_MOD_DATA_NO_POST_INC, + 0x0000); + /* rx data pad skew - devaddr = 0x02, register = 0x05 */ + ksz9031_phy_extended_write(phydev, 0x02, + MII_KSZ9031_EXT_RGMII_RX_DATA_SKEW, + MII_KSZ9031_MOD_DATA_NO_POST_INC, + 0x0000); + /* tx data pad skew - devaddr = 0x02, register = 0x05 */ + ksz9031_phy_extended_write(phydev, 0x02, + MII_KSZ9031_EXT_RGMII_TX_DATA_SKEW, + MII_KSZ9031_MOD_DATA_NO_POST_INC, + 0x0000); + /* gtx and rx clock pad skew - devaddr = 0x02, reg = 0x08 */ + ksz9031_phy_extended_write(phydev, 0x02, + MII_KSZ9031_EXT_RGMII_CLOCK_SKEW, + MII_KSZ9031_MOD_DATA_NO_POST_INC, + 0x03FF); + } else { + /* PHY configuration for Vitesse VSC8641 */ + printf("PHY VSC8641 detected - "); + + /* Extended PHY control 1, select GMII */ + phy_write(phydev, MDIO_DEVAD_NONE, 23, 0x0020); + + /* Software reset necessary after GMII mode selction */ + phy_reset(phydev); + + /* Enable extended page register access */ + phy_write(phydev, MDIO_DEVAD_NONE, 31, 0x0001); + + /* 17e: Enhanced LED behavior, needs to be written twice */ + phy_write(phydev, MDIO_DEVAD_NONE, 17, 0x09ff); + phy_write(phydev, MDIO_DEVAD_NONE, 17, 0x09ff); + + /* 16e: Enhanced LED method select */ + phy_write(phydev, MDIO_DEVAD_NONE, 16, 0xe0ea); + + /* Disable extended page register access */ + phy_write(phydev, MDIO_DEVAD_NONE, 31, 0x0000); + + /* Enable clock output pin */ + phy_write(phydev, MDIO_DEVAD_NONE, 18, 0x0049); + } if (phydev->drv->config) phydev->drv->config(phydev); diff --git a/include/configs/x600.h b/include/configs/x600.h index 5fdd2be..07c8abe 100644 --- a/include/configs/x600.h +++ b/include/configs/x600.h @@ -80,6 +80,8 @@ #define CONFIG_PHY_RESET_DELAY 10000 /* in usec */ #define CONFIG_PHY_ADDR 0 /* PHY address */ #define CONFIG_PHY_GIGE /* Include GbE speed/duplex detection */ +#define CONFIG_PHY_MICREL +#define CONFIG_PHY_MICREL_KSZ9031 #define CONFIG_SPEAR_GPIO -- cgit v0.10.2 From e084fd922f7483d591c623823452fff7879c9d71 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Wed, 27 Apr 2016 09:10:43 +0200 Subject: arm: spear: x600: Remove EFI support to reduce image size EFI is not needed on x600. So lets remove the EFI support to make it fit into the 0x60000 image size limit again. Signed-off-by: Stefan Roese diff --git a/configs/x600_defconfig b/configs/x600_defconfig index ace620b..14977dc 100644 --- a/configs/x600_defconfig +++ b/configs/x600_defconfig @@ -22,3 +22,4 @@ CONFIG_NETDEVICES=y CONFIG_ETH_DESIGNWARE=y CONFIG_USE_TINY_PRINTF=y CONFIG_OF_LIBFDT=y +# CONFIG_EFI_LOADER is not set -- cgit v0.10.2