From: Steven Kipisz <s-kipisz2@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/5] ARM: OMAP4/5: Centralize early clock initialization
Date: Wed, 4 Nov 2015 08:54:11 -0600 [thread overview]
Message-ID: <563A1C13.5040105@ti.com> (raw)
In-Reply-To: <5639C2B0.1010905@ti.com>
On 11/04/2015 02:32 AM, Lokesh Vutla wrote:
>
>
> On Tuesday 03 November 2015 05:52 PM, Steve Kipisz wrote:
>> Early clock initialization is currently done in two stages for OMAP4/5
>> SoCs. The first stage is the initialization of console clocks and
>> then we initialize basic clocks for functionality necessary for SoC
>> initialization and basic board functionality.
>>
>> By splitting up prcm_init and centralizing this clock initialization,
>> we setup the code for follow on patches that can do board specific
>> initialization such as board detection which will depend on these
>> basic clocks.
>>
>> As part of this change, since the early clock initialization
>> is centralized, we no longer need to expose the console clock
>> initialization and build it just for SPL.
>>
>> NOTE: we change the sequence slightly by initializing console clocks
>> timer after the io settings are complete, but this is not expected
>> to have any functioanlity impact since we setup the basic IO drive
>> strength initialization as part of do_io_settings
>>
>> Signed-off-by: Steve Kipisz <s-kipisz2@ti.com>
>> ---
>> v2 Based on:
>> master a6104737 ARM: at91: sama5: change the environment address to 0x6000
>>
>> Changes in v2:
>> - New patch
>>
>> arch/arm/cpu/armv7/omap-common/clocks-common.c | 26 ++++++++++++++++++++++++--
>> arch/arm/cpu/armv7/omap-common/hwinit-common.c | 3 +--
>> arch/arm/include/asm/arch-omap4/sys_proto.h | 2 +-
>> arch/arm/include/asm/arch-omap5/sys_proto.h | 2 +-
>> 4 files changed, 27 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c
>> index e28b79568d1d..2ede0818e444 100644
>> --- a/arch/arm/cpu/armv7/omap-common/clocks-common.c
>> +++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c
>> @@ -769,7 +769,8 @@ void lock_dpll(u32 const base)
>> wait_for_lock(base);
>> }
>>
>> -void setup_clocks_for_console(void)
>> +#ifdef CONFIG_SPL_BUILD
>> +static void setup_clocks_for_console(void)
>> {
>> /* Do not add any spl_debug prints in this function */
>> clrsetbits_le32((*prcm)->cm_l4per_clkstctrl, CD_CLKCTRL_CLKTRCTRL_MASK,
>> @@ -801,6 +802,9 @@ void setup_clocks_for_console(void)
>> CD_CLKCTRL_CLKTRCTRL_HW_AUTO <<
>> CD_CLKCTRL_CLKTRCTRL_SHIFT);
>> }
>> +#else
>> +static inline void setup_clocks_for_console(void) { }
>> +#endif
>
> Please drop this if condition as clocks will be needed in u-boot for xip
> boot.
>
How about changing it to
#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
>>
>> void do_enable_clocks(u32 const *clk_domains,
>> u32 const *clk_modules_hw_auto,
>> @@ -853,14 +857,32 @@ void do_disable_clocks(u32 const *clk_domains,
>> disable_clock_domain(clk_domains[i]);
>> }
>>
>> -void prcm_init(void)
>> +/**
>> + * setup_early_clocks() - Setup early clocks needed for SoC
>> + *
>> + * Setup clocks for console, SPL basic initialization clocks and initialize
>> + * the timer. This is invoked prior prcm_init.
>> + */
>> +void setup_early_clocks(void)
>> {
>> + setup_clocks_for_console();
>> +
>> switch (omap_hw_init_context()) {
>> case OMAP_INIT_CONTEXT_SPL:
>> case OMAP_INIT_CONTEXT_UBOOT_FROM_NOR:
>> case OMAP_INIT_CONTEXT_UBOOT_AFTER_CH:
>
> Add setup_clocks_for_console() here instead of adding in the beginning
> of function.
>
> Thanks and regards,
> Lokesh
>
next prev parent reply other threads:[~2015-11-04 14:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 12:22 [U-Boot] [PATCH v2 0/5] ARM: omap-common: Add board detection support for TI EVMs Steve Kipisz
2015-11-03 12:22 ` [U-Boot] [PATCH v2 1/5] ARM: OMAP4/5: Centralize early clock initialization Steve Kipisz
2015-11-03 16:07 ` Tom Rini
2015-11-04 8:32 ` Lokesh Vutla
2015-11-04 14:54 ` Steven Kipisz [this message]
2015-11-03 12:22 ` [U-Boot] [PATCH v2 2/5] ARM: OMAP4/5: Centralize gpi2c_init Steve Kipisz
2015-11-03 16:07 ` Tom Rini
2015-11-03 12:22 ` [U-Boot] [PATCH v2 3/5] ARM: omap-common: Add standard access for board description EEPROM Steve Kipisz
2015-11-03 13:16 ` Igor Grinberg
2015-11-03 15:13 ` Steven Kipisz
2015-11-03 15:26 ` Nishanth Menon
2015-11-03 16:07 ` Tom Rini
2015-11-03 16:11 ` Nishanth Menon
2015-11-03 17:02 ` Igor Grinberg
2015-11-03 17:45 ` Nishanth Menon
2015-11-03 21:07 ` Igor Grinberg
2015-11-03 21:13 ` Nishanth Menon
2015-11-03 12:22 ` [U-Boot] [PATCH v2 4/5] ARM: OMAP4/5: Add generic board detection hook Steve Kipisz
2015-11-03 16:07 ` Tom Rini
2015-11-03 12:22 ` [U-Boot] [PATCH v2 5/5] board: ti: AM57xx: Add detection logic for AM57xx-evm Steve Kipisz
2015-11-03 13:29 ` Igor Grinberg
2015-11-03 15:09 ` Steven Kipisz
2015-11-03 17:04 ` Igor Grinberg
2015-11-03 15:31 ` Nishanth Menon
2015-11-03 15:36 ` Steven Kipisz
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=563A1C13.5040105@ti.com \
--to=s-kipisz2@ti.com \
--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