* [PATCH] net fec_imx: add support for i.MX6 1000Mbps mode
@ 2013-02-07 10:06 Hubert Feurstein
2013-02-08 16:47 ` Hubert Feurstein
2013-02-11 8:51 ` Sascha Hauer
0 siblings, 2 replies; 4+ messages in thread
From: Hubert Feurstein @ 2013-02-07 10:06 UTC (permalink / raw)
To: Sascha Hauer, barebox
Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
---
drivers/net/fec_imx.c | 14 ++++++++++----
drivers/net/fec_imx.h | 1 +
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 2378a19..7320f07 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -361,12 +361,18 @@ static int fec_init(struct eth_device *dev)
static void fec_update_linkspeed(struct eth_device *edev)
{
struct fec_priv *fec = (struct fec_priv *)edev->priv;
+ int speed = edev->phydev->speed;
+ u32 rcntl = readl(fec->regs + FEC_R_CNTRL) & ~FEC_R_CNTRL_RMII_10T;
+ u32 ecntl = readl(fec->regs + FEC_ECNTRL) & ~FEC_ECNTRL_SPEED;
- if (edev->phydev->speed == SPEED_10) {
- u32 rcntl = readl(fec->regs + FEC_R_CNTRL);
+ if (speed == SPEED_10)
rcntl |= FEC_R_CNTRL_RMII_10T;
- writel(rcntl, fec->regs + FEC_R_CNTRL);
- }
+
+ if (speed == SPEED_1000)
+ ecntl |= FEC_ECNTRL_SPEED;
+
+ writel(rcntl, fec->regs + FEC_R_CNTRL);
+ writel(ecntl, fec->regs + FEC_ECNTRL);
}
/**
diff --git a/drivers/net/fec_imx.h b/drivers/net/fec_imx.h
index 1eb1eba..29aea85 100644
--- a/drivers/net/fec_imx.h
+++ b/drivers/net/fec_imx.h
@@ -92,6 +92,7 @@
#define FEC_ECNTRL_RESET 0x00000001 /**< reset the FEC */
#define FEC_ECNTRL_ETHER_EN 0x00000002 /**< enable the FEC */
+#define FEC_ECNTRL_SPEED 0x00000020 /**< i.MX6: enable 1000Mbps mode */
/**
* @brief Descriptor buffer alignment
--
1.8.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net fec_imx: add support for i.MX6 1000Mbps mode
2013-02-07 10:06 [PATCH] net fec_imx: add support for i.MX6 1000Mbps mode Hubert Feurstein
@ 2013-02-08 16:47 ` Hubert Feurstein
2013-02-09 11:46 ` Daniel Mierswa
2013-02-11 8:51 ` Sascha Hauer
1 sibling, 1 reply; 4+ messages in thread
From: Hubert Feurstein @ 2013-02-08 16:47 UTC (permalink / raw)
To: Sascha Hauer, barebox
Any comments on this?
2013/2/7 Hubert Feurstein <h.feurstein@gmail.com>:
> Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
> ---
> drivers/net/fec_imx.c | 14 ++++++++++----
> drivers/net/fec_imx.h | 1 +
> 2 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
> index 2378a19..7320f07 100644
> --- a/drivers/net/fec_imx.c
> +++ b/drivers/net/fec_imx.c
> @@ -361,12 +361,18 @@ static int fec_init(struct eth_device *dev)
> static void fec_update_linkspeed(struct eth_device *edev)
> {
> struct fec_priv *fec = (struct fec_priv *)edev->priv;
> + int speed = edev->phydev->speed;
> + u32 rcntl = readl(fec->regs + FEC_R_CNTRL) & ~FEC_R_CNTRL_RMII_10T;
> + u32 ecntl = readl(fec->regs + FEC_ECNTRL) & ~FEC_ECNTRL_SPEED;
>
> - if (edev->phydev->speed == SPEED_10) {
> - u32 rcntl = readl(fec->regs + FEC_R_CNTRL);
> + if (speed == SPEED_10)
> rcntl |= FEC_R_CNTRL_RMII_10T;
> - writel(rcntl, fec->regs + FEC_R_CNTRL);
> - }
> +
> + if (speed == SPEED_1000)
> + ecntl |= FEC_ECNTRL_SPEED;
> +
> + writel(rcntl, fec->regs + FEC_R_CNTRL);
> + writel(ecntl, fec->regs + FEC_ECNTRL);
> }
>
> /**
> diff --git a/drivers/net/fec_imx.h b/drivers/net/fec_imx.h
> index 1eb1eba..29aea85 100644
> --- a/drivers/net/fec_imx.h
> +++ b/drivers/net/fec_imx.h
> @@ -92,6 +92,7 @@
>
> #define FEC_ECNTRL_RESET 0x00000001 /**< reset the FEC */
> #define FEC_ECNTRL_ETHER_EN 0x00000002 /**< enable the FEC */
> +#define FEC_ECNTRL_SPEED 0x00000020 /**< i.MX6: enable 1000Mbps mode */
>
> /**
> * @brief Descriptor buffer alignment
> --
> 1.8.1
>
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net fec_imx: add support for i.MX6 1000Mbps mode
2013-02-07 10:06 [PATCH] net fec_imx: add support for i.MX6 1000Mbps mode Hubert Feurstein
2013-02-08 16:47 ` Hubert Feurstein
@ 2013-02-11 8:51 ` Sascha Hauer
1 sibling, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2013-02-11 8:51 UTC (permalink / raw)
To: Hubert Feurstein; +Cc: barebox
On Thu, Feb 07, 2013 at 11:06:06AM +0100, Hubert Feurstein wrote:
> Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
> ---
> drivers/net/fec_imx.c | 14 ++++++++++----
> drivers/net/fec_imx.h | 1 +
> 2 files changed, 11 insertions(+), 4 deletions(-)
Applied, thanks
Sascha
>
> diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
> index 2378a19..7320f07 100644
> --- a/drivers/net/fec_imx.c
> +++ b/drivers/net/fec_imx.c
> @@ -361,12 +361,18 @@ static int fec_init(struct eth_device *dev)
> static void fec_update_linkspeed(struct eth_device *edev)
> {
> struct fec_priv *fec = (struct fec_priv *)edev->priv;
> + int speed = edev->phydev->speed;
> + u32 rcntl = readl(fec->regs + FEC_R_CNTRL) & ~FEC_R_CNTRL_RMII_10T;
> + u32 ecntl = readl(fec->regs + FEC_ECNTRL) & ~FEC_ECNTRL_SPEED;
>
> - if (edev->phydev->speed == SPEED_10) {
> - u32 rcntl = readl(fec->regs + FEC_R_CNTRL);
> + if (speed == SPEED_10)
> rcntl |= FEC_R_CNTRL_RMII_10T;
> - writel(rcntl, fec->regs + FEC_R_CNTRL);
> - }
> +
> + if (speed == SPEED_1000)
> + ecntl |= FEC_ECNTRL_SPEED;
> +
> + writel(rcntl, fec->regs + FEC_R_CNTRL);
> + writel(ecntl, fec->regs + FEC_ECNTRL);
> }
>
> /**
> diff --git a/drivers/net/fec_imx.h b/drivers/net/fec_imx.h
> index 1eb1eba..29aea85 100644
> --- a/drivers/net/fec_imx.h
> +++ b/drivers/net/fec_imx.h
> @@ -92,6 +92,7 @@
>
> #define FEC_ECNTRL_RESET 0x00000001 /**< reset the FEC */
> #define FEC_ECNTRL_ETHER_EN 0x00000002 /**< enable the FEC */
> +#define FEC_ECNTRL_SPEED 0x00000020 /**< i.MX6: enable 1000Mbps mode */
>
> /**
> * @brief Descriptor buffer alignment
> --
> 1.8.1
>
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-02-11 8:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-07 10:06 [PATCH] net fec_imx: add support for i.MX6 1000Mbps mode Hubert Feurstein
2013-02-08 16:47 ` Hubert Feurstein
2013-02-09 11:46 ` Daniel Mierswa
2013-02-11 8:51 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox