public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ian Campbell <ijc@hellion.org.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 7/9] ARM: sunxi: Allow specifying module in prcm apb0 init function
Date: Sat, 11 Oct 2014 17:11:28 +0100	[thread overview]
Message-ID: <1413043888.11505.45.camel@hellion.org.uk> (raw)
In-Reply-To: <1412665917-29731-8-git-send-email-wens@csie.org>

On Tue, 2014-10-07 at 15:11 +0800, Chen-Yu Tsai wrote:
> The prcm apb0 controls multiple modules. Allow specifying which
> modules to enable clocks and de-assert resets so the function
> can be reused.

How come this isn't actually called on sun6i?

(naughty of me not to notice this when it was submitted!)

Is it going to be called by anything in this series? I have a feeling
this is a precursor for SPL which should have been left out of the sun6i
series, but oh well what's done is done.

Without a caller it's hard to make a judgement call on parameters vs
#ifdef in the function, although my inclination would generally be
towards parameters, if there's just going to be an ifdef at the call
site instead it's not really buying us much.

> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  arch/arm/cpu/armv7/sunxi/prcm.c        | 12 +++++++-----
>  arch/arm/include/asm/arch-sunxi/prcm.h |  2 +-
>  2 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/sunxi/prcm.c b/arch/arm/cpu/armv7/sunxi/prcm.c
> index 7b3ee89..19b4938 100644
> --- a/arch/arm/cpu/armv7/sunxi/prcm.c
> +++ b/arch/arm/cpu/armv7/sunxi/prcm.c
> @@ -21,13 +21,15 @@
>  #include <asm/arch/prcm.h>
>  #include <asm/arch/sys_proto.h>
>  
> -void prcm_init_apb0(void)
> +/* APB0 clock gate and reset bit offsets are the same. */

Is this absolutely guaranteed?

> +void prcm_apb0_enable(u32 flags)
>  {
>  	struct sunxi_prcm_reg *prcm =
>  		(struct sunxi_prcm_reg *)SUNXI_PRCM_BASE;
>  
> -	setbits_le32(&prcm->apb0_gate, PRCM_APB0_GATE_P2WI |
> -				       PRCM_APB0_GATE_PIO);
> -	setbits_le32(&prcm->apb0_reset, PRCM_APB0_RESET_P2WI |
> -					PRCM_APB0_RESET_PIO);
> +	/* open the clock for module */
> +	setbits_le32(&prcm->apb0_gate, flags);
> +
> +	/* deassert reset for module */
> +	setbits_le32(&prcm->apb0_reset, flags);
>  }
> diff --git a/arch/arm/include/asm/arch-sunxi/prcm.h b/arch/arm/include/asm/arch-sunxi/prcm.h
> index 1b40f09..3d3bfa6 100644
> --- a/arch/arm/include/asm/arch-sunxi/prcm.h
> +++ b/arch/arm/include/asm/arch-sunxi/prcm.h
> @@ -233,6 +233,6 @@ struct sunxi_prcm_reg {
>  	u32 dram_tst;		/* 0x190 */
>  };
>  
> -void prcm_init_apb0(void);
> +void prcm_apb0_enable(u32 flags);
>  #endif /* __ASSEMBLY__ */
>  #endif /* _PRCM_H */

  reply	other threads:[~2014-10-11 16:11 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-07  7:11 [U-Boot] [PATCH 0/9] ARM: sunxi: Add Allwinner A23 (sun8i) support Chen-Yu Tsai
2014-10-07  7:11 ` [U-Boot] [PATCH 1/9] ARM: sunxi: Fix build break when CONFIG_MMC is not defined Chen-Yu Tsai
2014-10-11 15:50   ` Ian Campbell
2014-10-12  8:58     ` Hans de Goede
2014-10-07  7:11 ` [U-Boot] [PATCH 2/9] ARM: sunxi: Add sun8i (A23) UART0 pin mux support Chen-Yu Tsai
2014-10-11 15:51   ` Ian Campbell
2014-10-07  7:11 ` [U-Boot] [PATCH 3/9] ARM: sunxi: Add support for uart0 on port F (mmc0) Chen-Yu Tsai
2014-10-11 15:53   ` Ian Campbell
2014-10-07  7:11 ` [U-Boot] [PATCH 4/9] mmc: sunxi: Add support for sun8i (A23) Chen-Yu Tsai
2014-10-11 15:54   ` Ian Campbell
2014-10-07  7:11 ` [U-Boot] [PATCH 5/9] ARM: sunxi: Add basic A23 support Chen-Yu Tsai
2014-10-11 15:58   ` Ian Campbell
2014-10-12  2:43     ` Chen-Yu Tsai
2014-10-12  9:33       ` Ian Campbell
2014-10-07  7:11 ` [U-Boot] [PATCH 6/9] ARM: sunxi: Add support for R_PIO gpio banks Chen-Yu Tsai
2014-10-11 16:05   ` Ian Campbell
2014-10-12  8:23     ` Chen-Yu Tsai
2014-10-12  9:34       ` Ian Campbell
2014-10-13 12:57       ` Maxime Ripard
2014-10-17 14:48         ` [U-Boot] [linux-sunxi] " Chen-Yu Tsai
2014-10-21 18:55           ` Ian Campbell
2014-10-07  7:11 ` [U-Boot] [PATCH 7/9] ARM: sunxi: Allow specifying module in prcm apb0 init function Chen-Yu Tsai
2014-10-11 16:11   ` Ian Campbell [this message]
2014-10-11 16:13     ` Ian Campbell
2014-10-12  8:15       ` Chen-Yu Tsai
2014-10-07  7:11 ` [U-Boot] [PATCH 8/9] ARM: sunxi: Add support for using R_UART as console Chen-Yu Tsai
2014-10-11 16:15   ` Ian Campbell
2014-10-07  7:11 ` [U-Boot] [PATCH 9/9] ARM: sunxi: Add Ippo-q8h-v5 A23 tablet board defconfig Chen-Yu Tsai
2014-10-11 16:17   ` Ian Campbell
2014-10-12  8:13     ` Chen-Yu Tsai

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=1413043888.11505.45.camel@hellion.org.uk \
    --to=ijc@hellion.org.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox