From: Nicolas Ferre <nicolas.ferre@atmel.com> To: <netdev@vger.kernel.org>, <davem@davemloft.net>, <havard@skinnemoen.net> Cc: <bhutchings@solarflare.com>, <linux-arm-kernel@lists.infradead.org>, <plagnioj@jcrosoft.com>, <patrice.vilchez@atmel.com>, <linux-kernel@vger.kernel.org>, <manabian@gmail.com>, <David.Laight@ACULAB.COM>, Nicolas Ferre <nicolas.ferre@atmel.com> Subject: [PATCH v4 01/10] net/macb: Add support for Gigabit Ethernet mode Date: Wed, 31 Oct 2012 17:04:50 +0100 [thread overview] Message-ID: <5a323a4b8e5ee6fac22442d9ea8fda017e6c12d6.1351690694.git.nicolas.ferre@atmel.com> (raw) In-Reply-To: <cover.1351690694.git.nicolas.ferre@atmel.com> From: Patrice Vilchez <patrice.vilchez@atmel.com> Add Gigabit Ethernet mode to GEM cadence IP and enable RGMII connection. Signed-off-by: Patrice Vilchez <patrice.vilchez@atmel.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Joachim Eastwood <manabian@gmail.com> --- drivers/net/ethernet/cadence/macb.c | 15 ++++++++++++--- drivers/net/ethernet/cadence/macb.h | 4 ++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 6a4f499..0931cb7 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -152,13 +152,17 @@ static void macb_handle_link_change(struct net_device *dev) reg = macb_readl(bp, NCFGR); reg &= ~(MACB_BIT(SPD) | MACB_BIT(FD)); + if (macb_is_gem(bp)) + reg &= ~GEM_BIT(GBE); if (phydev->duplex) reg |= MACB_BIT(FD); if (phydev->speed == SPEED_100) reg |= MACB_BIT(SPD); + if (phydev->speed == SPEED_1000) + reg |= GEM_BIT(GBE); - macb_writel(bp, NCFGR, reg); + macb_or_gem_writel(bp, NCFGR, reg); bp->speed = phydev->speed; bp->duplex = phydev->duplex; @@ -216,7 +220,10 @@ static int macb_mii_probe(struct net_device *dev) } /* mask with MAC supported features */ - phydev->supported &= PHY_BASIC_FEATURES; + if (macb_is_gem(bp)) + phydev->supported &= PHY_GBIT_FEATURES; + else + phydev->supported &= PHY_BASIC_FEATURES; phydev->advertising = phydev->supported; @@ -1388,7 +1395,9 @@ static int __init macb_probe(struct platform_device *pdev) bp->phy_interface = err; } - if (bp->phy_interface == PHY_INTERFACE_MODE_RMII) + if (bp->phy_interface == PHY_INTERFACE_MODE_RGMII) + macb_or_gem_writel(bp, USRIO, GEM_BIT(RGMII)); + else if (bp->phy_interface == PHY_INTERFACE_MODE_RMII) #if defined(CONFIG_ARCH_AT91) macb_or_gem_writel(bp, USRIO, (MACB_BIT(RMII) | MACB_BIT(CLKEN))); diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index a362751..33a050f 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -149,6 +149,8 @@ #define MACB_IRXFCS_SIZE 1 /* GEM specific NCFGR bitfields. */ +#define GEM_GBE_OFFSET 10 +#define GEM_GBE_SIZE 1 #define GEM_CLK_OFFSET 18 #define GEM_CLK_SIZE 3 #define GEM_DBW_OFFSET 21 @@ -252,6 +254,8 @@ /* Bitfields in USRIO (AT91) */ #define MACB_RMII_OFFSET 0 #define MACB_RMII_SIZE 1 +#define GEM_RGMII_OFFSET 0 /* GEM gigabit mode */ +#define GEM_RGMII_SIZE 1 #define MACB_CLKEN_OFFSET 1 #define MACB_CLKEN_SIZE 1 -- 1.8.0
WARNING: multiple messages have this Message-ID (diff)
From: nicolas.ferre@atmel.com (Nicolas Ferre) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 01/10] net/macb: Add support for Gigabit Ethernet mode Date: Wed, 31 Oct 2012 17:04:50 +0100 [thread overview] Message-ID: <5a323a4b8e5ee6fac22442d9ea8fda017e6c12d6.1351690694.git.nicolas.ferre@atmel.com> (raw) In-Reply-To: <cover.1351690694.git.nicolas.ferre@atmel.com> From: Patrice Vilchez <patrice.vilchez@atmel.com> Add Gigabit Ethernet mode to GEM cadence IP and enable RGMII connection. Signed-off-by: Patrice Vilchez <patrice.vilchez@atmel.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Joachim Eastwood <manabian@gmail.com> --- drivers/net/ethernet/cadence/macb.c | 15 ++++++++++++--- drivers/net/ethernet/cadence/macb.h | 4 ++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 6a4f499..0931cb7 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -152,13 +152,17 @@ static void macb_handle_link_change(struct net_device *dev) reg = macb_readl(bp, NCFGR); reg &= ~(MACB_BIT(SPD) | MACB_BIT(FD)); + if (macb_is_gem(bp)) + reg &= ~GEM_BIT(GBE); if (phydev->duplex) reg |= MACB_BIT(FD); if (phydev->speed == SPEED_100) reg |= MACB_BIT(SPD); + if (phydev->speed == SPEED_1000) + reg |= GEM_BIT(GBE); - macb_writel(bp, NCFGR, reg); + macb_or_gem_writel(bp, NCFGR, reg); bp->speed = phydev->speed; bp->duplex = phydev->duplex; @@ -216,7 +220,10 @@ static int macb_mii_probe(struct net_device *dev) } /* mask with MAC supported features */ - phydev->supported &= PHY_BASIC_FEATURES; + if (macb_is_gem(bp)) + phydev->supported &= PHY_GBIT_FEATURES; + else + phydev->supported &= PHY_BASIC_FEATURES; phydev->advertising = phydev->supported; @@ -1388,7 +1395,9 @@ static int __init macb_probe(struct platform_device *pdev) bp->phy_interface = err; } - if (bp->phy_interface == PHY_INTERFACE_MODE_RMII) + if (bp->phy_interface == PHY_INTERFACE_MODE_RGMII) + macb_or_gem_writel(bp, USRIO, GEM_BIT(RGMII)); + else if (bp->phy_interface == PHY_INTERFACE_MODE_RMII) #if defined(CONFIG_ARCH_AT91) macb_or_gem_writel(bp, USRIO, (MACB_BIT(RMII) | MACB_BIT(CLKEN))); diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index a362751..33a050f 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -149,6 +149,8 @@ #define MACB_IRXFCS_SIZE 1 /* GEM specific NCFGR bitfields. */ +#define GEM_GBE_OFFSET 10 +#define GEM_GBE_SIZE 1 #define GEM_CLK_OFFSET 18 #define GEM_CLK_SIZE 3 #define GEM_DBW_OFFSET 21 @@ -252,6 +254,8 @@ /* Bitfields in USRIO (AT91) */ #define MACB_RMII_OFFSET 0 #define MACB_RMII_SIZE 1 +#define GEM_RGMII_OFFSET 0 /* GEM gigabit mode */ +#define GEM_RGMII_SIZE 1 #define MACB_CLKEN_OFFSET 1 #define MACB_CLKEN_SIZE 1 -- 1.8.0
next prev parent reply other threads:[~2012-10-31 16:05 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-10-31 16:04 [PATCH v4 00/10] net/macb: driver enhancement concerning GEM support, ring logic and cleanup Nicolas Ferre 2012-10-31 16:04 ` Nicolas Ferre 2012-10-31 16:04 ` Nicolas Ferre [this message] 2012-10-31 16:04 ` [PATCH v4 01/10] net/macb: Add support for Gigabit Ethernet mode Nicolas Ferre 2012-10-31 16:04 ` [PATCH v4 02/10] net/macb: memory barriers cleanup Nicolas Ferre 2012-10-31 16:04 ` Nicolas Ferre 2012-10-31 16:04 ` [PATCH v4 03/10] net/macb: change debugging messages Nicolas Ferre 2012-10-31 16:04 ` Nicolas Ferre 2012-10-31 16:04 ` [PATCH v4 04/10] net/macb: remove macb_get_drvinfo() Nicolas Ferre 2012-10-31 16:04 ` Nicolas Ferre 2012-10-31 16:04 ` [PATCH v4 05/10] net/macb: tx status is more than 8 bits now Nicolas Ferre 2012-10-31 16:04 ` Nicolas Ferre 2012-10-31 16:04 ` Nicolas Ferre 2012-10-31 16:04 ` [PATCH v4 06/10] net/macb: clean up ring buffer logic Nicolas Ferre 2012-10-31 16:04 ` Nicolas Ferre 2012-10-31 16:04 ` Nicolas Ferre 2012-10-31 16:04 ` [PATCH v4 07/10] net/macb: ethtool interface: add register dump feature Nicolas Ferre 2012-10-31 16:04 ` Nicolas Ferre 2012-10-31 16:04 ` [PATCH v4 08/10] net/macb: better manage tx errors Nicolas Ferre 2012-10-31 16:04 ` Nicolas Ferre 2012-10-31 16:04 ` [PATCH v4 09/10] net/macb: Offset first RX buffer by two bytes Nicolas Ferre 2012-10-31 16:04 ` Nicolas Ferre 2012-10-31 16:04 ` [PATCH v4 10/10] net/macb: add pinctrl consumer support Nicolas Ferre 2012-10-31 16:04 ` Nicolas Ferre 2012-11-01 14:47 ` [PATCH v4 00/10] net/macb: driver enhancement concerning GEM support, ring logic and cleanup Jean-Christophe PLAGNIOL-VILLARD 2012-11-01 14:47 ` Jean-Christophe PLAGNIOL-VILLARD 2012-11-01 15:46 ` David Miller 2012-11-01 15:46 ` David Miller
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=5a323a4b8e5ee6fac22442d9ea8fda017e6c12d6.1351690694.git.nicolas.ferre@atmel.com \ --to=nicolas.ferre@atmel.com \ --cc=David.Laight@ACULAB.COM \ --cc=bhutchings@solarflare.com \ --cc=davem@davemloft.net \ --cc=havard@skinnemoen.net \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=manabian@gmail.com \ --cc=netdev@vger.kernel.org \ --cc=patrice.vilchez@atmel.com \ --cc=plagnioj@jcrosoft.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.