From: Marek Vasut Date: Fri, 18 May 2018 10:10:24 +0200 Subject: [U-Boot] [PATCH v2 07/16] arm: socfpga: stratix10: Add misc support for Stratix10 SoC In-Reply-To: <1526652336-34764-8-git-send-email-ley.foon.tan@intel.com> References: <1526652336-34764-1-git-send-email-ley.foon.tan@intel.com> <1526652336-34764-8-git-send-email-ley.foon.tan@intel.com> Message-ID: <9abcbfb5-61dd-ed06-4f88-c4fa24d9de76@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 05/18/2018 04:05 PM, Ley Foon Tan wrote: > Add misc support such as EMAC and cpu info printout for Stratix SoC > > Signed-off-by: Chin Liang See > Signed-off-by: Ley Foon Tan > --- > arch/arm/mach-socfpga/Makefile | 1 + > arch/arm/mach-socfpga/misc_s10.c | 133 ++++++++++++++++++++++++++++++++++++++ > 2 files changed, 134 insertions(+), 0 deletions(-) > create mode 100644 arch/arm/mach-socfpga/misc_s10.c > > diff --git a/arch/arm/mach-socfpga/Makefile b/arch/arm/mach-socfpga/Makefile > index 61f5778..c74fec2 100644 > --- a/arch/arm/mach-socfpga/Makefile > +++ b/arch/arm/mach-socfpga/Makefile > @@ -30,6 +30,7 @@ endif > > ifdef CONFIG_TARGET_SOCFPGA_STRATIX10 > obj-y += clock_manager_s10.o > +obj-y += misc_s10.o > obj-y += reset_manager_s10.o > obj-y += system_manager_s10.o > obj-y += wrap_pinmux_config_s10.o > diff --git a/arch/arm/mach-socfpga/misc_s10.c b/arch/arm/mach-socfpga/misc_s10.c > new file mode 100644 > index 0000000..918baac > --- /dev/null > +++ b/arch/arm/mach-socfpga/misc_s10.c > @@ -0,0 +1,133 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (C) 2016-2018 Intel Corporation > + * > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +DECLARE_GLOBAL_DATA_PTR; > + > +static struct socfpga_system_manager *sysmgr_regs = > + (struct socfpga_system_manager *)SOCFPGA_SYSMGR_ADDRESS; > + > +/* > + * DesignWare Ethernet initialization > + */ > +#ifdef CONFIG_ETH_DESIGNWARE > + > +static u32 socfpga_phymode_setup(u32 gmac_index, const char *phymode) > +{ > + u32 modereg; > + > + if (!phymode) > + return -EINVAL; > + > + if (!strcmp(phymode, "mii") || !strcmp(phymode, "gmii")) > + modereg = SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII; > + else if (!strcmp(phymode, "rgmii")) > + modereg = SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII; > + else if (!strcmp(phymode, "rmii")) > + modereg = SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RMII; > + else > + return -EINVAL; > + > + clrsetbits_le32(&sysmgr_regs->emac0 + gmac_index, > + SYSMGR_EMACGRP_CTRL_PHYSEL_MASK, > + modereg); > + > + return 0; > +} This looks quite similar to what A10 does. Can you rebase this one on top of u-boot-socfpga/master ? -- Best regards, Marek Vasut