All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] net: sun8i_emac: Use consistent clock bitfield definitions
@ 2020-05-07 23:10 Samuel Holland
  2020-05-07 23:10 ` [PATCH 2/3] net: sun8i_emac: Add support for the H6 variant Samuel Holland
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Samuel Holland @ 2020-05-07 23:10 UTC (permalink / raw)
  To: u-boot

While the R40 uses a different register for EMAC clock configuration
than other chips, the register has a very similar layout. Reuse the
existing bitfield definitions in this file, since they match.

This allows the driver to compile on the H6 platform, where the
CCM_GMAC_CTRL definitions are not present.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---
 drivers/net/sun8i_emac.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c
index 1ae776b446..dcd18833a2 100644
--- a/drivers/net/sun8i_emac.c
+++ b/drivers/net/sun8i_emac.c
@@ -296,9 +296,9 @@ static int sun8i_emac_set_syscon(struct sun8i_eth_pdata *pdata,
 	if (priv->variant == R40_GMAC) {
 		/* Select RGMII for R40 */
 		reg = readl(priv->sysctl_reg + 0x164);
-		reg |= CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII |
-		       CCM_GMAC_CTRL_GPIT_RGMII |
-		       CCM_GMAC_CTRL_TX_CLK_DELAY(CONFIG_GMAC_TX_DELAY);
+		reg |= SC_ETCS_INT_GMII |
+		       SC_EPIT |
+		       (CONFIG_GMAC_TX_DELAY << SC_ETXDC_OFFSET);
 
 		writel(reg, priv->sysctl_reg + 0x164);
 		return 0;
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-01 17:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 23:10 [PATCH 1/3] net: sun8i_emac: Use consistent clock bitfield definitions Samuel Holland
2020-05-07 23:10 ` [PATCH 2/3] net: sun8i_emac: Add support for the H6 variant Samuel Holland
2020-05-07 23:10 ` [PATCH 3/3] sunxi: H6: Enable Ethernet on the Pine H64 Samuel Holland
2020-06-01 17:03 ` [PATCH 1/3] net: sun8i_emac: Use consistent clock bitfield definitions Jagan Teki

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.