[v3 08/16] net: designware: socfpga: Add ATF support for MAC driver

Tan, Ley Foon ley.foon.tan at intel.com
Thu Nov 12 11:51:37 CET 2020



> -----Original Message-----
> From: Lim, Elly Siew Chin <elly.siew.chin.lim at intel.com>
> Sent: Thursday, October 15, 2020 8:30 PM
> To: u-boot at lists.denx.de
> Cc: Marek Vasut <marex at denx.de>; Tan, Ley Foon
> <ley.foon.tan at intel.com>; See, Chin Liang <chin.liang.see at intel.com>;
> Simon Goldschmidt <simon.k.r.goldschmidt at gmail.com>; Chee, Tien Fong
> <tien.fong.chee at intel.com>; Westergreen, Dalon
> <dalon.westergreen at intel.com>; Simon Glass <sjg at chromium.org>; Ang,
> Chee Hong <chee.hong.ang at intel.com>; Lim, Elly Siew Chin
> <elly.siew.chin.lim at intel.com>
> Subject: [v3 08/16] net: designware: socfpga: Add ATF support for MAC
> driver
> 
> From: Chee Hong Ang <chee.hong.ang at intel.com>
> 
> In non-secure mode (EL2), MAC driver calls the SMC/PSCI services provided
> by ATF to setup the PHY interface.
> 
> Signed-off-by: Chee Hong Ang <chee.hong.ang at intel.com>
> Signed-off-by: Siew Chin Lim <elly.siew.chin.lim at intel.com>
> ---
>  drivers/net/dwmac_socfpga.c | 30 ++++++++++++++++++++++++++----
>  1 file changed, 26 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/dwmac_socfpga.c b/drivers/net/dwmac_socfpga.c
> index e93561dffa..a2d09d5c4a 100644
> --- a/drivers/net/dwmac_socfpga.c
> +++ b/drivers/net/dwmac_socfpga.c
> @@ -17,7 +17,9 @@
>  #include <dm/device_compat.h>
>  #include <linux/err.h>
> 
> +#include <asm/arch/smc_api.h>
>  #include <asm/arch/system_manager.h>
> +#include <linux/intel-smc.h>
Move this to after <linux/err.h>. 
> 
>  struct dwmac_socfpga_platdata {
>  	struct dw_eth_pdata	dw_eth_pdata;
> @@ -64,6 +66,27 @@ static int dwmac_socfpga_ofdata_to_platdata(struct
> udevice *dev)
>  	return designware_eth_ofdata_to_platdata(dev);
>  }
> 
> +static int dwmac_socfpga_do_setphy(struct udevice *dev, u32 modereg) {
> +	struct dwmac_socfpga_platdata *pdata = dev_get_platdata(dev);
> +
> +#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_ATF)
> +	u64 args[2];
> +
> +	args[0] = ((u64)pdata->phy_intf - socfpga_get_sysmgr_addr() -
> +		   SYSMGR_SOC64_EMAC0) >> 2;
> +	args[1] = modereg;
> +
> +	if (invoke_smc(INTEL_SIP_SMC_HPS_SET_PHYINTF, args, 2, NULL, 0))
> +		return -EIO;
Can you if check ATF support this SMC call already? I didn't see it.


Regards
Ley Foon


More information about the U-Boot mailing list