* [PATCH] net: stmmac: Add SMC support for EMAC System Manager register
@ 2018-08-13 6:41 Ooi, Joyce
2018-08-13 16:48 ` David Miller
2018-08-13 21:41 ` kbuild test robot
0 siblings, 2 replies; 7+ messages in thread
From: Ooi, Joyce @ 2018-08-13 6:41 UTC (permalink / raw)
To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu
Cc: David S. Miller, netdev, linux-kernel, Ong Hean Loong,
Yves Vandervennet, Joyce Ooi
As there is restriction to access to EMAC System Manager registers in
the kernel for Intel Stratix10, the use of SMC calls are required and
added in dwmac-socfpga driver.
Signed-off-by: Ooi, Joyce <joyce.ooi@intel.com>
---
This patch is dependent on https://lkml.org/lkml/2018/7/26/624
---
.../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 74 +++++++++++++++++++-
1 files changed, 73 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
index c3a78c1..2cea97d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
@@ -23,6 +23,9 @@
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/stmmac.h>
+#ifdef CONFIG_HAVE_ARM_SMCCC
+#include <linux/stratix10-smc.h>
+#endif
#include "stmmac.h"
#include "stmmac_platform.h"
@@ -52,6 +55,7 @@ struct socfpga_dwmac {
int interface;
u32 reg_offset;
u32 reg_shift;
+ u32 sysmgr_reg;
struct device *dev;
struct regmap *sys_mgr_base_addr;
struct reset_control *stmmac_rst;
@@ -61,6 +65,48 @@ struct socfpga_dwmac {
struct tse_pcs pcs;
};
+#ifdef CONFIG_HAVE_ARM_SMCCC
+/**************** Stratix 10 EMAC Memory Controller Functions ************/
+
+/* s10_protected_reg_write
+ * Write to a protected SMC register.
+ * @reg: Address of register
+ * @value: Value to write
+ * Return: INTEL_SIP_SMC_STATUS_OK (0) on success
+ * INTEL_SIP_SMC_REG_ERROR on error
+ * INTEL_SIP_SMC_RETURN_UNKNOWN_FUNCTION if not supported
+ */
+static int s10_protected_reg_write(unsigned int reg, unsigned int val)
+{
+ struct arm_smccc_res result;
+
+ arm_smccc_smc(INTEL_SIP_SMC_REG_WRITE, reg, val, 0, 0,
+ 0, 0, 0, &result);
+
+ return (int)result.a0;
+}
+
+/* s10_protected_reg_read
+ * Read the status of a protected SMC register
+ * @reg: Address of register
+ * @value: Value read.
+ * Return: INTEL_SIP_SMC_STATUS_OK (0) on success
+ * INTEL_SIP_SMC_REG_ERROR on error
+ * INTEL_SIP_SMC_RETURN_UNKNOWN_FUNCTION if not supported
+ */
+static int s10_protected_reg_read(unsigned int reg, unsigned int *val)
+{
+ struct arm_smccc_res result;
+
+ arm_smccc_smc(INTEL_SIP_SMC_REG_READ, reg, 0, 0, 0,
+ 0, 0, 0, &result);
+
+ *val = (unsigned int)result.a1;
+
+ return (int)result.a0;
+}
+#endif
+
static void socfpga_dwmac_fix_mac_speed(void *priv, unsigned int speed)
{
struct socfpga_dwmac *dwmac = (struct socfpga_dwmac *)priv;
@@ -104,10 +150,11 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
{
struct device_node *np = dev->of_node;
struct regmap *sys_mgr_base_addr;
- u32 reg_offset, reg_shift;
+ u32 reg_offset, reg_shift, sysmgr_reg;
int ret, index;
struct device_node *np_splitter = NULL;
struct device_node *np_sgmii_adapter = NULL;
+ struct device_node *np_sysmgr = NULL;
struct resource res_splitter;
struct resource res_tse_pcs;
struct resource res_sgmii_adapter;
@@ -132,6 +179,16 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
return -EINVAL;
}
+ np_sysmgr = of_parse_phandle(np, "altr,sysmgr-syscon", 0);
+ if (np_sysmgr) {
+ ret = of_property_read_u32_index(np_sysmgr, "reg", 0,
+ &sysmgr_reg);
+ if (ret) {
+ dev_info(dev, "Could not read sysmgr register address\n");
+ return -EINVAL;
+ }
+ }
+
dwmac->f2h_ptp_ref_clk = of_property_read_bool(np, "altr,f2h_ptp_ref_clk");
np_splitter = of_parse_phandle(np, "altr,emac-splitter", 0);
@@ -221,6 +278,7 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
}
dwmac->reg_offset = reg_offset;
dwmac->reg_shift = reg_shift;
+ dwmac->sysmgr_reg = sysmgr_reg;
dwmac->sys_mgr_base_addr = sys_mgr_base_addr;
dwmac->dev = dev;
of_node_put(np_sgmii_adapter);
@@ -238,7 +296,9 @@ static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac)
int phymode = dwmac->interface;
u32 reg_offset = dwmac->reg_offset;
u32 reg_shift = dwmac->reg_shift;
+ u32 sysmgr_reg = dwmac->sysmgr_reg;
u32 ctrl, val, module;
+ int ret = 0;
switch (phymode) {
case PHY_INTERFACE_MODE_RGMII:
@@ -266,7 +326,13 @@ static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac)
reset_control_assert(dwmac->stmmac_ocp_rst);
reset_control_assert(dwmac->stmmac_rst);
+#ifdef CONFIG_HAVE_ARM_SMCCC
+ ret = s10_protected_reg_read(sysmgr_reg + reg_offset, &ctrl);
+ if (ret)
+ dev_err(dwmac->dev, "error reading Sys Mgr %d\n", ret);
+#else
regmap_read(sys_mgr_base_addr, reg_offset, &ctrl);
+#endif
ctrl &= ~(SYSMGR_EMACGRP_CTRL_PHYSEL_MASK << reg_shift);
ctrl |= val << reg_shift;
@@ -281,7 +347,13 @@ static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac)
ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2));
}
+#ifdef CONFIG_HAVE_ARM_SMCCC
+ ret = s10_protected_reg_write(sysmgr_reg + reg_offset, ctrl);
+ if (ret)
+ dev_err(dwmac->dev, "error writing Sys Mgr %d\n", ret);
+#else
regmap_write(sys_mgr_base_addr, reg_offset, ctrl);
+#endif
/* Deassert reset for the phy configuration to be sampled by
* the enet controller, and operation to start in requested mode
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] net: stmmac: Add SMC support for EMAC System Manager register
2018-08-13 6:41 [PATCH] net: stmmac: Add SMC support for EMAC System Manager register Ooi, Joyce
@ 2018-08-13 16:48 ` David Miller
2018-08-16 3:39 ` Ooi, Joyce
2018-08-13 21:41 ` kbuild test robot
1 sibling, 1 reply; 7+ messages in thread
From: David Miller @ 2018-08-13 16:48 UTC (permalink / raw)
To: joyce.ooi
Cc: peppe.cavallaro, alexandre.torgue, joabreu, netdev, linux-kernel,
hean.loong.ong, yves.vandervennet
From: "Ooi, Joyce" <joyce.ooi@intel.com>
Date: Sun, 12 Aug 2018 23:41:34 -0700
> As there is restriction to access to EMAC System Manager registers in
> the kernel for Intel Stratix10, the use of SMC calls are required and
> added in dwmac-socfpga driver.
>
> Signed-off-by: Ooi, Joyce <joyce.ooi@intel.com>
> ---
> This patch is dependent on https://lkml.org/lkml/2018/7/26/624
I guess I cannot apply this to my networking tree then.
I would suggest that you make a helper in a header file which dos the
special SMC EMAC accesses, or alternatively the regular regmap access,
based upon the CPP ifdef.
That way you won't have to put all of those CPP tests in the foo.c
code.
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] net: stmmac: Add SMC support for EMAC System Manager register
2018-08-13 6:41 [PATCH] net: stmmac: Add SMC support for EMAC System Manager register Ooi, Joyce
2018-08-13 16:48 ` David Miller
@ 2018-08-13 21:41 ` kbuild test robot
1 sibling, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2018-08-13 21:41 UTC (permalink / raw)
To: Ooi, Joyce
Cc: kbuild-all, Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
David S. Miller, netdev, linux-kernel, Ong Hean Loong,
Yves Vandervennet, Joyce Ooi
[-- Attachment #1: Type: text/plain, Size: 1301 bytes --]
Hi Joyce,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
[also build test ERROR on v4.18 next-20180813]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Ooi-Joyce/net-stmmac-Add-SMC-support-for-EMAC-System-Manager-register/20180814-031821
config: arm-multi_v7_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=arm
All errors (new ones prefixed by >>):
>> drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:27:10: fatal error: linux/stratix10-smc.h: No such file or directory
#include <linux/stratix10-smc.h>
^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
vim +27 drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> 27 #include <linux/stratix10-smc.h>
28 #endif
29
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 43971 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] net: stmmac: Add SMC support for EMAC System Manager register
2018-08-13 16:48 ` David Miller
@ 2018-08-16 3:39 ` Ooi, Joyce
0 siblings, 0 replies; 7+ messages in thread
From: Ooi, Joyce @ 2018-08-16 3:39 UTC (permalink / raw)
To: David Miller
Cc: peppe.cavallaro, alexandre.torgue, joabreu, netdev, linux-kernel,
Ong, Hean Loong, Vandervennet, Yves
> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Tuesday, August 14, 2018 12:48 AM
> To: Ooi, Joyce <joyce.ooi@intel.com>
> Cc: peppe.cavallaro@st.com; alexandre.torgue@st.com;
> joabreu@synopsys.com; netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
> Ong, Hean Loong <hean.loong.ong@intel.com>; Vandervennet, Yves
> <yves.vandervennet@intel.com>
> Subject: Re: [PATCH] net: stmmac: Add SMC support for EMAC System Manager
> register
>
> From: "Ooi, Joyce" <joyce.ooi@intel.com>
> Date: Sun, 12 Aug 2018 23:41:34 -0700
>
> > As there is restriction to access to EMAC System Manager registers in
> > the kernel for Intel Stratix10, the use of SMC calls are required and
> > added in dwmac-socfpga driver.
> >
> > Signed-off-by: Ooi, Joyce <joyce.ooi@intel.com>
> > ---
> > This patch is dependent on https://lkml.org/lkml/2018/7/26/624
>
> I guess I cannot apply this to my networking tree then.
>
> I would suggest that you make a helper in a header file which dos the special
> SMC EMAC accesses, or alternatively the regular regmap access, based upon the
> CPP ifdef.
Could you please explain what you mean by 'a helper in a header file'?
Thanks.
>
> That way you won't have to put all of those CPP tests in the foo.c code.
>
> Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] net: stmmac: Add SMC support for EMAC System Manager register
2019-02-12 20:52 ` Thor Thayer
@ 2019-02-13 3:22 ` Ooi, Joyce
0 siblings, 0 replies; 7+ messages in thread
From: Ooi, Joyce @ 2019-02-13 3:22 UTC (permalink / raw)
To: thor.thayer, Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
David S. Miller, Maxime Coquelin
Cc: netdev, linux-stm32, linux-arm-kernel, linux-kernel, See, Chin Liang
> -----Original Message-----
> From: Thor Thayer [mailto:thor.thayer@linux.intel.com]
> Sent: Wednesday, February 13, 2019 4:53 AM
> To: Ooi, Joyce <joyce.ooi@intel.com>; Giuseppe Cavallaro
> <peppe.cavallaro@st.com>; Alexandre Torgue <alexandre.torgue@st.com>;
> Jose Abreu <joabreu@synopsys.com>; David S. Miller <davem@davemloft.net>;
> Maxime Coquelin <mcoquelin.stm32@gmail.com>
> Cc: netdev@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; See, Chin
> Liang <chin.liang.see@intel.com>
> Subject: Re: [PATCH] net: stmmac: Add SMC support for EMAC System Manager
> register
>
> Hi Joyce,
>
> On 2/12/19 10:24 AM, Ooi, Joyce wrote:
> > As there is restriction to access to EMAC System Manager registers in
> > the kernel for Intel Stratix10, the use of SMC calls are required and
> > added in dwmac-socfpga driver.
> >
> > Signed-off-by: Ooi, Joyce <joyce.ooi@intel.com>
>
> <snip>
>
> I have a pending patchset[1] that addresses this but can be used by other drivers
> as well.
>
> [1] https://patchwork.kernel.org/cover/10612891/[]
Oh, didn't realize your patchset. I guess my patch can be ignored then. Thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] net: stmmac: Add SMC support for EMAC System Manager register
2019-02-12 16:24 Ooi, Joyce
@ 2019-02-12 20:52 ` Thor Thayer
2019-02-13 3:22 ` Ooi, Joyce
0 siblings, 1 reply; 7+ messages in thread
From: Thor Thayer @ 2019-02-12 20:52 UTC (permalink / raw)
To: Ooi, Joyce, Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
David S. Miller, Maxime Coquelin
Cc: netdev, linux-stm32, linux-arm-kernel, linux-kernel, See Chin Liang
Hi Joyce,
On 2/12/19 10:24 AM, Ooi, Joyce wrote:
> As there is restriction to access to EMAC System Manager registers in
> the kernel for Intel Stratix10, the use of SMC calls are required and
> added in dwmac-socfpga driver.
>
> Signed-off-by: Ooi, Joyce <joyce.ooi@intel.com>
<snip>
I have a pending patchset[1] that addresses this but can be used by
other drivers as well.
[1] https://patchwork.kernel.org/cover/10612891/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] net: stmmac: Add SMC support for EMAC System Manager register
@ 2019-02-12 16:24 Ooi, Joyce
2019-02-12 20:52 ` Thor Thayer
0 siblings, 1 reply; 7+ messages in thread
From: Ooi, Joyce @ 2019-02-12 16:24 UTC (permalink / raw)
To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
David S. Miller, Maxime Coquelin
Cc: netdev, linux-stm32, linux-arm-kernel, linux-kernel,
See Chin Liang, Joyce Ooi
As there is restriction to access to EMAC System Manager registers in
the kernel for Intel Stratix10, the use of SMC calls are required and
added in dwmac-socfpga driver.
Signed-off-by: Ooi, Joyce <joyce.ooi@intel.com>
---
.../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 101 ++++++++++++++++++++
1 files changed, 101 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
index 5b3b06a..55cce97 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
@@ -15,6 +15,10 @@
* Adopted from dwmac-sti.c
*/
+#if defined CONFIG_HAVE_ARM_SMCCC && defined CONFIG_ARCH_STRATIX10
+#include <linux/arm-smccc.h>
+#include <linux/firmware/intel/stratix10-smc.h>
+#endif
#include <linux/mfd/syscon.h>
#include <linux/of.h>
#include <linux/of_address.h>
@@ -52,6 +56,9 @@ struct socfpga_dwmac {
int interface;
u32 reg_offset;
u32 reg_shift;
+#if defined CONFIG_HAVE_ARM_SMCCC && defined CONFIG_ARCH_STRATIX10
+ u32 sysmgr_reg;
+#endif
struct device *dev;
struct regmap *sys_mgr_base_addr;
struct reset_control *stmmac_rst;
@@ -61,6 +68,63 @@ struct socfpga_dwmac {
struct tse_pcs pcs;
};
+#if defined CONFIG_HAVE_ARM_SMCCC && defined CONFIG_ARCH_STRATIX10
+/**************** Stratix 10 EMAC Memory Controller Functions ************/
+
+/* s10_protected_reg_write
+ * Write to a protected SMC register.
+ * @context: Not used
+ * @reg: Address of register
+ * @value: Value to write
+ * Return: INTEL_SIP_SMC_STATUS_OK (0) on success
+ * INTEL_SIP_SMC_REG_ERROR on error
+ * INTEL_SIP_SMC_RETURN_UNKNOWN_FUNCTION if not supported
+ */
+static int s10_protected_reg_write(void *context, unsigned int reg,
+ unsigned int val)
+{
+ struct arm_smccc_res result;
+
+ arm_smccc_smc(INTEL_SIP_SMC_REG_WRITE, reg, val, 0, 0,
+ 0, 0, 0, &result);
+
+ return (int)result.a0;
+}
+
+/* s10_protected_reg_read
+ * Read the status of a protected SMC register
+ * @context: Not used
+ * @reg: Address of register
+ * @value: Value read.
+ * Return: INTEL_SIP_SMC_STATUS_OK (0) on success
+ * INTEL_SIP_SMC_REG_ERROR on error
+ * INTEL_SIP_SMC_RETURN_UNKNOWN_FUNCTION if not supported
+ */
+static int s10_protected_reg_read(void *context, unsigned int reg,
+ unsigned int *val)
+{
+ struct arm_smccc_res result;
+
+ arm_smccc_smc(INTEL_SIP_SMC_REG_READ, reg, 0, 0, 0,
+ 0, 0, 0, &result);
+
+ *val = (unsigned int)result.a1;
+
+ return (int)result.a0;
+}
+
+static const struct regmap_config s10_emac_regmap_cfg = {
+ .name = "s10_emac",
+ .reg_bits = 32,
+ .val_bits = 32,
+ .max_register = 0xffffffff,
+ .reg_read = s10_protected_reg_read,
+ .reg_write = s10_protected_reg_write,
+ .use_single_read = true,
+ .use_single_write = true,
+};
+#endif
+
static void socfpga_dwmac_fix_mac_speed(void *priv, unsigned int speed)
{
struct socfpga_dwmac *dwmac = (struct socfpga_dwmac *)priv;
@@ -105,20 +169,43 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
struct device_node *np = dev->of_node;
struct regmap *sys_mgr_base_addr;
u32 reg_offset, reg_shift;
+#if defined CONFIG_HAVE_ARM_SMCCC && defined CONFIG_ARCH_STRATIX10
+ u32 sysmgr_reg = 0;
+#endif
int ret, index;
struct device_node *np_splitter = NULL;
struct device_node *np_sgmii_adapter = NULL;
+#if defined CONFIG_HAVE_ARM_SMCCC && defined CONFIG_ARCH_STRATIX10
+ struct device_node *np_sysmgr = NULL;
+#endif
struct resource res_splitter;
struct resource res_tse_pcs;
struct resource res_sgmii_adapter;
dwmac->interface = of_get_phy_mode(np);
+#if defined CONFIG_HAVE_ARM_SMCCC && defined CONFIG_ARCH_STRATIX10
+ sys_mgr_base_addr = devm_regmap_init(dev, NULL, (void *)dwmac,
+ &s10_emac_regmap_cfg);
+ if (IS_ERR(sys_mgr_base_addr))
+ return PTR_ERR(sys_mgr_base_addr);
+
+ np_sysmgr = of_parse_phandle(np, "altr,sysmgr-syscon", 0);
+ if (np_sysmgr) {
+ ret = of_property_read_u32_index(np_sysmgr, "reg", 0,
+ &sysmgr_reg);
+ if (ret) {
+ dev_info(dev, "Could not read sysmgr register address\n");
+ return -EINVAL;
+ }
+ }
+#else
sys_mgr_base_addr = syscon_regmap_lookup_by_phandle(np, "altr,sysmgr-syscon");
if (IS_ERR(sys_mgr_base_addr)) {
dev_info(dev, "No sysmgr-syscon node found\n");
return PTR_ERR(sys_mgr_base_addr);
}
+#endif
ret = of_property_read_u32_index(np, "altr,sysmgr-syscon", 1, ®_offset);
if (ret) {
@@ -222,6 +309,9 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
dwmac->reg_offset = reg_offset;
dwmac->reg_shift = reg_shift;
dwmac->sys_mgr_base_addr = sys_mgr_base_addr;
+#if defined CONFIG_HAVE_ARM_SMCCC && defined CONFIG_ARCH_STRATIX10
+ dwmac->sysmgr_reg = sysmgr_reg;
+#endif
dwmac->dev = dev;
of_node_put(np_sgmii_adapter);
@@ -238,6 +328,9 @@ static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac)
int phymode = dwmac->interface;
u32 reg_offset = dwmac->reg_offset;
u32 reg_shift = dwmac->reg_shift;
+#if defined CONFIG_HAVE_ARM_SMCCC && defined CONFIG_ARCH_STRATIX10
+ u32 sysmgr_reg = dwmac->sysmgr_reg;
+#endif
u32 ctrl, val, module;
switch (phymode) {
@@ -266,7 +359,11 @@ static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac)
reset_control_assert(dwmac->stmmac_ocp_rst);
reset_control_assert(dwmac->stmmac_rst);
+#if defined CONFIG_HAVE_ARM_SMCCC && defined CONFIG_ARCH_STRATIX10
+ regmap_read(sys_mgr_base_addr, sysmgr_reg + reg_offset, &ctrl);
+#else
regmap_read(sys_mgr_base_addr, reg_offset, &ctrl);
+#endif
ctrl &= ~(SYSMGR_EMACGRP_CTRL_PHYSEL_MASK << reg_shift);
ctrl |= val << reg_shift;
@@ -284,7 +381,11 @@ static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac)
ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2));
}
+#if defined CONFIG_HAVE_ARM_SMCCC && defined CONFIG_ARCH_STRATIX10
+ regmap_write(sys_mgr_base_addr, sysmgr_reg + reg_offset, ctrl);
+#else
regmap_write(sys_mgr_base_addr, reg_offset, ctrl);
+#endif
/* Deassert reset for the phy configuration to be sampled by
* the enet controller, and operation to start in requested mode
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-02-13 3:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-13 6:41 [PATCH] net: stmmac: Add SMC support for EMAC System Manager register Ooi, Joyce
2018-08-13 16:48 ` David Miller
2018-08-16 3:39 ` Ooi, Joyce
2018-08-13 21:41 ` kbuild test robot
2019-02-12 16:24 Ooi, Joyce
2019-02-12 20:52 ` Thor Thayer
2019-02-13 3:22 ` Ooi, Joyce
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).