All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 3/4] arm: socfpga: Convert system manager from struct to defines
Date: Thu, 7 Nov 2019 03:47:12 +0100	[thread overview]
Message-ID: <00d11c2f-7448-78e2-168a-12371c0b0bca@denx.de> (raw)
In-Reply-To: <1573092659-24385-4-git-send-email-ley.foon.tan@intel.com>

On 11/7/19 3:10 AM, Ley Foon Tan wrote:
[...]
> diff --git a/arch/arm/mach-socfpga/misc_arria10.c b/arch/arm/mach-socfpga/misc_arria10.c
> index 2e2a40b65d..ff6ab83441 100644
> --- a/arch/arm/mach-socfpga/misc_arria10.c
> +++ b/arch/arm/mach-socfpga/misc_arria10.c
> @@ -28,9 +28,6 @@
>  #define PINMUX_UART1_TX_SHARED_IO_OFFSET_Q3_7	0x78
>  #define PINMUX_UART1_TX_SHARED_IO_OFFSET_Q4_3	0x98
>  
> -static struct socfpga_system_manager *sysmgr_regs =
> -	(struct socfpga_system_manager *)SOCFPGA_SYSMGR_ADDRESS;
> -
>  /*
>   * FPGA programming support for SoC FPGA Arria 10
>   */
> @@ -81,7 +78,7 @@ void socfpga_init_security_policies(void)
>  	writel(~0, SOCFPGA_NOC_FW_H2F_SCR_OFST);
>  	writel(~0, SOCFPGA_NOC_FW_H2F_SCR_OFST + 4);
>  
> -	writel(0x0007FFFF, &sysmgr_regs->ecc_intmask_set);
> +	writel(0x0007FFFF, socfpga_sysmgr_base + SYSMGR_A10_ECC_INTMASK_SET);
>  }
>  
>  void socfpga_sdram_remap_zero(void)
> @@ -105,8 +102,8 @@ int arch_early_init_r(void)
>  #if defined(CONFIG_DISPLAY_CPUINFO)
>  int print_cpuinfo(void)
>  {
> -	const u32 bsel =
> -		SYSMGR_GET_BOOTINFO_BSEL(readl(&sysmgr_regs->bootinfo));
> +	u32 bootinfo = readl(socfpga_sysmgr_base + SYSMGR_A10_BOOTINFO);

const u32

> +	const u32 bsel = SYSMGR_GET_BOOTINFO_BSEL(bootinfo);
>  
>  	puts("CPU:   Altera SoCFPGA Arria 10\n");
>  
> diff --git a/arch/arm/mach-socfpga/misc_gen5.c b/arch/arm/mach-socfpga/misc_gen5.c
> index b39a66562d..7735958e9c 100644
> --- a/arch/arm/mach-socfpga/misc_gen5.c
> +++ b/arch/arm/mach-socfpga/misc_gen5.c
> @@ -28,8 +28,6 @@ DECLARE_GLOBAL_DATA_PTR;
>  
>  static struct pl310_regs *const pl310 =
>  	(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
> -static struct socfpga_system_manager *sysmgr_regs =
> -	(struct socfpga_system_manager *)SOCFPGA_SYSMGR_ADDRESS;
>  static struct nic301_registers *nic301_regs =
>  	(struct nic301_registers *)SOCFPGA_L3REGS_ADDRESS;
>  static struct scu_registers *scu_regs =
> @@ -118,8 +116,8 @@ static int socfpga_fpga_id(const bool print_id)
>  #if defined(CONFIG_DISPLAY_CPUINFO)
>  int print_cpuinfo(void)
>  {
> -	const u32 bsel =
> -		SYSMGR_GET_BOOTINFO_BSEL(readl(&sysmgr_regs->bootinfo));
> +	u32 bootinfo = readl(socfpga_sysmgr_base + SYSMGR_GEN5_BOOTINFO);
> +	const u32 bsel = SYSMGR_GET_BOOTINFO_BSEL(bootinfo);

Same here , const u32 .

>  	puts("CPU:   Altera SoCFPGA Platform\n");
>  	socfpga_fpga_id(1);

[...]

> diff --git a/arch/arm/mach-socfpga/misc_s10.c b/arch/arm/mach-socfpga/misc_s10.c
> index 0a5fab11c0..16fbf71599 100644
> --- a/arch/arm/mach-socfpga/misc_s10.c
> +++ b/arch/arm/mach-socfpga/misc_s10.c
> @@ -23,9 +23,6 @@
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> -static struct socfpga_system_manager *sysmgr_regs =
> -	(struct socfpga_system_manager *)SOCFPGA_SYSMGR_ADDRESS;
> -
>  /*
>   * FPGA programming support for SoC FPGA Stratix 10
>   */
> @@ -68,9 +65,9 @@ static u32 socfpga_phymode_setup(u32 gmac_index, const char *phymode)
>  	else
>  		return -EINVAL;
>  
> -	clrsetbits_le32(&sysmgr_regs->emac0 + gmac_index,
> -			SYSMGR_EMACGRP_CTRL_PHYSEL_MASK,
> -			modereg);
> +	clrsetbits_le32((unsigned long)(socfpga_sysmgr_base + SYSMGR_S10_EMAC0 +

Is the typecast needed at all ?
Also, the typecast should probably apply only on socfpga_sysmgr_base,
not the entire expression.

> +			gmac_index),
> +			SYSMGR_EMACGRP_CTRL_PHYSEL_MASK, modereg);
>  
>  	return 0;
>  }

[...]

  reply	other threads:[~2019-11-07  2:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-07  2:10 [U-Boot] [PATCH v5 0/4] arm: socfpga: Convert drivers from struct to defines Ley Foon Tan
2019-11-07  2:10 ` [U-Boot] [PATCH v5 1/4] arm: dts: socfpga: Add u-boot, dm-pre-reloc for sysmgr and clkmgr nodes Ley Foon Tan
2019-11-07  2:27   ` Marek Vasut
2019-11-07  3:31     ` Ley Foon Tan
2019-11-07  8:10       ` Marek Vasut
2019-11-07  8:36         ` Simon Goldschmidt
2019-11-07  8:39           ` Marek Vasut
2019-11-07  9:14             ` Simon Goldschmidt
2019-11-07  9:22               ` Marek Vasut
2019-11-07  2:10 ` [U-Boot] [PATCH v5 2/4] arm: socfpga: Convert reset manager from struct to defines Ley Foon Tan
2019-11-07  2:41   ` Marek Vasut
2019-11-07  8:06     ` Ley Foon Tan
2019-11-07  8:33       ` Marek Vasut
2019-11-07  8:41         ` Ley Foon Tan
2019-11-07  8:43           ` Marek Vasut
2019-11-07  8:47             ` Ley Foon Tan
2019-11-07  2:10 ` [U-Boot] [PATCH v5 3/4] arm: socfpga: Convert system " Ley Foon Tan
2019-11-07  2:47   ` Marek Vasut [this message]
2019-11-07  8:11     ` Ley Foon Tan
2019-11-07  2:10 ` [U-Boot] [PATCH v5 4/4] arm: socfpga: Convert clock " Ley Foon Tan

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=00d11c2f-7448-78e2-168a-12371c0b0bca@denx.de \
    --to=marex@denx.de \
    --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.