All of lore.kernel.org
 help / color / mirror / Atom feed
From: Icenowy Zheng <icenowy@aosc.io>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/4] sun8i_emac: disable build of EPHY clock code on non-H3/H5 platforms
Date: Sun,  2 Jul 2017 15:02:41 +0800	[thread overview]
Message-ID: <20170702070244.10539-2-icenowy@aosc.io> (raw)
In-Reply-To: <20170702070244.10539-1-icenowy@aosc.io>

Sometimes the EPHY clock macros are not defined for non-H3/H5 platforms
(e.g. A83T), which makes the driver to fail to be built.

Only build the EPHY clock code when the SoC is H3/H5 by wrap them into
an #ifdef.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
 drivers/net/sun8i_emac.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c
index 09bbb2cdb5..c071f5d3c3 100644
--- a/drivers/net/sun8i_emac.c
+++ b/drivers/net/sun8i_emac.c
@@ -604,6 +604,7 @@ static void sun8i_emac_board_setup(struct emac_eth_dev *priv)
 {
 	struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
 
+#if defined(CONFIG_MACH_SUNXI_H3_H5)
 	if (priv->use_internal_phy) {
 		/* Set clock gating for ephy */
 		setbits_le32(&ccm->bus_gate4, BIT(AHB_GATE_OFFSET_EPHY));
@@ -611,6 +612,7 @@ static void sun8i_emac_board_setup(struct emac_eth_dev *priv)
 		/* Deassert EPHY */
 		setbits_le32(&ccm->ahb_reset2_cfg, BIT(AHB_RESET_OFFSET_EPHY));
 	}
+#endif
 
 	/* Set clock gating for emac */
 	setbits_le32(&ccm->ahb_gate0, BIT(AHB_GATE_OFFSET_GMAC));
-- 
2.13.0

  reply	other threads:[~2017-07-02  7:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-02  7:02 [U-Boot] [PATCH 0/4] Allwinner A83T and Banana Pi M3 EMAC support Icenowy Zheng
2017-07-02  7:02 ` Icenowy Zheng [this message]
2017-07-02  7:02 ` [U-Boot] [PATCH 2/4] sun8i_emac: add support for setting EMAC TX/RX delay Icenowy Zheng
2017-07-02  7:02 ` [U-Boot] [PATCH 3/4] sunxi: add stub EMAC device node in A83T device tree Icenowy Zheng
2017-07-03  6:52   ` Maxime Ripard
2017-07-03  6:54     ` Icenowy Zheng
2017-07-03 20:46       ` Maxime Ripard
2017-07-04  0:07         ` [U-Boot] [linux-sunxi] " Icenowy Zheng
2017-07-04 21:21           ` Maxime Ripard
2017-07-06 10:09   ` [U-Boot] [linux-sunxi] " Andre Przywara
2017-07-02  7:02 ` [U-Boot] [PATCH 4/4] sunxi: enable EMAC for Banana Pi M3 board Icenowy Zheng
2017-07-06 10:13   ` [U-Boot] [linux-sunxi] " Andre Przywara

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=20170702070244.10539-2-icenowy@aosc.io \
    --to=icenowy@aosc.io \
    --cc=u-boot@lists.denx.de \
    /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: link
Be 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.