public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/9] arm: Move CP15 init out of cpu_init_crit()
Date: Sat, 05 Nov 2011 09:17:46 +0100	[thread overview]
Message-ID: <4EB4F12A.10802@aribaud.net> (raw)
In-Reply-To: <1318539963-3329-4-git-send-email-sjg@chromium.org>

Hi Simon,

Going back to this version of the patch as indicated, I notice something 
weird:

Le 13/10/2011 23:05, Simon Glass a ?crit :
> Some SOCs have do not start up with their 'main' CPU. The first U-Boot
> code may then be executed with a CPU which does not have a CP15, or not a
> useful one.
>
> Here we split the initialization of CP15 into a separate call, which can
> be performed later if required.
>
> Once the main CPU is running, you should call cpu_init_cp15() to perform
> this init as early as possible.
>
> Existing ARMv7 boards which define CONFIG_SKIP_LOWLEVEL_INIT should not
> need to change, this CP15 init is still skipped in that case. The only
> impact for these boards is that the cpu_init_cp15() will be available
> even if it is never used on these boards.
>
> Signed-off-by: Simon Glass<sjg@chromium.org>
> ---
>   arch/arm/cpu/armv7/start.S        |   24 ++++++++++++++++++------
>   arch/arm/include/asm/u-boot-arm.h |    3 +++
>   2 files changed, 21 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
> index db8e9d2..7fdd422 100644
> --- a/arch/arm/cpu/armv7/start.S
> +++ b/arch/arm/cpu/armv7/start.S
> @@ -168,6 +168,7 @@ next:
>   #endif
>   	/* the mask ROM code should have PLL and others stable */
>   #ifndef CONFIG_SKIP_LOWLEVEL_INIT
> +	bl	cpu_reset_cp15
>   	bl	cpu_init_crit
>   #endif
>
> @@ -305,17 +306,16 @@ jump_2_ram:
>   _board_init_r_ofs:
>   	.word board_init_r - _start
>
> -
> -#ifndef CONFIG_SKIP_LOWLEVEL_INIT
>   /*************************************************************************
>    *
> - * CPU_init_critical registers
> + * cpu_reset_cp15
>    *
> - * setup important registers
> - * setup memory timing
> + * Setup CP15 registers (cache, MMU, TLBs). The I-cache is turned on unless
> + * CONFIG_SYS_ICACHE_OFF is defined.
>    *
>    *************************************************************************/
> -cpu_init_crit:
> +.globl cpu_init_cp15
> +cpu_init_cp15:

Seems like half this patch says 'cpu_reset_cp15' and then the second 
half says 'cpu_init_cp15' (I prefer 'cpu_init_cp15').

>   	/*
>   	 * Invalidate L1 I/D
>   	 */
> @@ -340,7 +340,19 @@ cpu_init_crit:
>   	orr	r0, r0, #0x00001000	@ set bit 12 (I) I-cache
>   #endif
>   	mcr	p15, 0, r0, c1, c0, 0
> +	mov	pc, lr			@ back to my caller
>
> +
> +#ifndef CONFIG_SKIP_LOWLEVEL_INIT
> +/*************************************************************************
> + *
> + * CPU_init_critical registers
> + *
> + * setup important registers
> + * setup memory timing
> + *
> + *************************************************************************/
> +cpu_init_crit:
>   	/*
>   	 * Jump to board specific initialization...
>   	 * The Mask ROM will have already initialized
> diff --git a/arch/arm/include/asm/u-boot-arm.h b/arch/arm/include/asm/u-boot-arm.h
> index d3308f7..4ca75f9 100644
> --- a/arch/arm/include/asm/u-boot-arm.h
> +++ b/arch/arm/include/asm/u-boot-arm.h
> @@ -46,6 +46,9 @@ extern ulong IRQ_STACK_START_IN;	/* 8 bytes in IRQ stack */
>   int	cpu_init(void);
>   int	cleanup_before_linux(void);
>
> +/* Set up ARMv7 MMU, caches and TLBs */
> +void	cpu_init_cp15(void);
> +
>   /* cpu/.../arch/cpu.c */
>   int	arch_cpu_init(void);
>   int	arch_misc_init(void);

Amicalement,
-- 
Albert.

  parent reply	other threads:[~2011-11-05  8:17 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-13 21:05 [U-Boot] [PATCH 0/9] tegra2: Tidy up boot path Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 1/9] tegra2: Add arch_cpu_init() to fire up Cortex-A9 Simon Glass
2011-10-13 22:52   ` Mike Frysinger
2011-10-13 23:18     ` Simon Glass
2011-10-13 23:34       ` Mike Frysinger
2011-10-14  0:47         ` Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 2/9] tegra2: Simplify tegra_start() boot path Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 3/9] arm: Move CP15 init out of cpu_init_crit() Simon Glass
2011-10-21 20:58   ` Albert ARIBAUD
2011-10-21 21:18     ` Simon Glass
2011-10-21 21:43       ` Albert ARIBAUD
2011-10-21 21:54         ` Simon Glass
2011-10-21 22:24           ` Albert ARIBAUD
2011-10-22  5:05             ` Simon Glass
2011-10-22  7:56               ` Albert ARIBAUD
2011-10-22 16:13                 ` Simon Glass
2011-10-24 19:34                   ` Simon Glass
2011-10-24 20:04                   ` Albert ARIBAUD
2011-10-24 20:14                     ` Simon Glass
2011-10-24 21:21                       ` Albert ARIBAUD
2011-10-25  5:02                         ` Simon Glass
2011-10-25  6:41                           ` Albert ARIBAUD
2011-10-25 13:44                             ` Simon Glass
2011-10-25 21:16                               ` Simon Glass
2011-10-27 20:05                                 ` Albert ARIBAUD
2011-10-27 20:17                                   ` Simon Glass
2011-10-27 22:39                                     ` Albert ARIBAUD
2011-10-27 22:46                                       ` Simon Glass
2011-10-28  1:43                                         ` Simon Glass
2011-10-28  5:09                                           ` Albert ARIBAUD
2011-10-29  0:36                                             ` Simon Glass
2011-10-30 10:16                                               ` Albert ARIBAUD
2011-10-31 21:44                                                 ` Simon Glass
2011-10-31 22:54                                                   ` Tom Warren
2011-11-05  5:17                                                     ` Simon Glass
2011-11-05  8:09                                                       ` Albert ARIBAUD
2011-11-05 13:36                                                         ` Simon Glass
2011-10-28  5:07                                         ` Albert ARIBAUD
2011-11-05  8:17   ` Albert ARIBAUD [this message]
2011-11-05 14:00     ` Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 4/9] tegra2: Enable instruction cache Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 5/9] tegra2: Remove unneeded boot code Simon Glass
2011-10-13 21:06 ` [U-Boot] [PATCH 6/9] tegra2: Remove unneeded config option Simon Glass
2011-10-13 21:06 ` [U-Boot] [PATCH 7/9] tegra2: Remove unused low-level Tegra2 UART code Simon Glass
2011-10-13 21:06 ` [U-Boot] [PATCH 8/9] tegra2: Remove unneeded 'dynamic ram size' message Simon Glass
2011-10-13 21:06 ` [U-Boot] [PATCH 9/9] tegra2: Don't use board pointer before it is set up Simon Glass

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=4EB4F12A.10802@aribaud.net \
    --to=albert.u.boot@aribaud.net \
    --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