From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/3] ARM: at91: clock: add PMC_PLLICPR init function
Date: Thu, 10 Dec 2015 10:35:14 +0100 [thread overview]
Message-ID: <56694752.3080209@denx.de> (raw)
In-Reply-To: <1449646720-30057-2-git-send-email-wenyou.yang@atmel.com>
Hello Wenyou,
Am 09.12.2015 um 08:38 schrieb Wenyou Yang:
> To avoid the duplicated code, add the PMC_PLLICPR init function.
>
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> ---
>
> Changes in v2:
> - move at91_pllicpr_init() definition to the common file, clock.c.
> - fix checkpatch errors.
>
> arch/arm/mach-at91/clock.c | 7 +++++++
> arch/arm/mach-at91/include/mach/at91_pmc.h | 7 +++++++
> arch/arm/mach-at91/include/mach/clk.h | 1 +
> 3 files changed, 15 insertions(+)
Tested on the smartweb board, see log:
http://xeidos.ddns.net/buildbot/builders/smartweb_dfu/builds/29/steps/shell/logs/tbotlog
Tested-by: Heiko Schocher <hs@denx.de>
bye,
Heiko
>
> diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
> index b8f8d48..885d6fe 100644
> --- a/arch/arm/mach-at91/clock.c
> +++ b/arch/arm/mach-at91/clock.c
> @@ -118,3 +118,10 @@ void at91_usb_clk_init(u32 value)
>
> writel(value, &pmc->usb);
> }
> +
> +void at91_pllicpr_init(u32 icpr)
> +{
> + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
> +
> + writel(icpr, &pmc->pllicpr);
> +}
> diff --git a/arch/arm/mach-at91/include/mach/at91_pmc.h b/arch/arm/mach-at91/include/mach/at91_pmc.h
> index eb40194..7684f09 100644
> --- a/arch/arm/mach-at91/include/mach/at91_pmc.h
> +++ b/arch/arm/mach-at91/include/mach/at91_pmc.h
> @@ -246,4 +246,11 @@ typedef struct at91_pmc {
> #define AT91_PMC_GCKRDY (1 << 24)
>
> #define AT91_PMC_PROTKEY 0x504d4301 /* Activation Code */
> +
> +/* PLL Charge Pump Current Register (PMC_PLLICPR) */
> +#define AT91_PMC_ICP_PLLA(x) (((x) & 0x3) << 0)
> +#define AT91_PMC_IPLL_PLLA(x) (((x) & 0x7) << 8)
> +#define AT91_PMC_ICP_PLLU(x) (((x) & 0x3) << 16)
> +#define AT91_PMC_IVCO_PLLU(x) (((x) & 0x3) << 24)
> +
> #endif
> diff --git a/arch/arm/mach-at91/include/mach/clk.h b/arch/arm/mach-at91/include/mach/clk.h
> index 64dec52..8577c74 100644
> --- a/arch/arm/mach-at91/include/mach/clk.h
> +++ b/arch/arm/mach-at91/include/mach/clk.h
> @@ -135,5 +135,6 @@ int at91_upll_clk_disable(void);
> void at91_usb_clk_init(u32 value);
> int at91_pllb_clk_enable(u32 pllbr);
> int at91_pllb_clk_disable(void);
> +void at91_pllicpr_init(u32 icpr);
>
> #endif /* __ASM_ARM_ARCH_CLK_H__ */
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2015-12-10 9:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-09 7:38 [U-Boot] [PATCH v2 0/3] ARM: at91: add PMC_PLLICPR init function Wenyou Yang
2015-12-09 7:38 ` [U-Boot] [PATCH v2 1/3] ARM: at91: clock: " Wenyou Yang
2015-12-10 9:35 ` Heiko Schocher [this message]
2015-12-09 7:38 ` [U-Boot] [PATCH v2 2/3] ARM: at91: clean up the PMC_PLLICPR init code Wenyou Yang
2015-12-10 9:35 ` Heiko Schocher
2015-12-09 7:38 ` [U-Boot] [PATCH v2 3/3] board: atmel: " Wenyou Yang
2015-12-10 9:35 ` Heiko Schocher
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=56694752.3080209@denx.de \
--to=hs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox