All of lore.kernel.org
 help / color / mirror / Atom feed
From: Becky Bruce <beckyb@kernel.crashing.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] 85xx: Introduce determine_mp_bootpg() helper.
Date: Wed, 1 Apr 2009 13:35:35 -0500	[thread overview]
Message-ID: <D6FBE496-2B25-4495-9B62-92BCA127D0F9@kernel.crashing.org> (raw)
In-Reply-To: <1238601989-6251-2-git-send-email-galak@kernel.crashing.org>


On Apr 1, 2009, at 11:06 AM, Kumar Gala wrote:

> Match determine_mp_bootpg() that was added for 86xx.  We need this to
> address a bug introduced in v2009.03 with 86xx MP booting.  We have to
> make sure to reserve the region of memory used for the MP bootpg() so
> other u-boot code doesn't use it.
>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

Acked-by: Becky Bruce <beckyb@kernel.crashing.org>

>
> ---
> * fix up based on tweak to patch 1/3
>
> cpu/mpc85xx/fdt.c |    9 ++-------
> cpu/mpc85xx/mp.c  |   25 +++++++++++--------------
> cpu/mpc85xx/mp.h  |    1 +
> 3 files changed, 14 insertions(+), 21 deletions(-)
>
> diff --git a/cpu/mpc85xx/fdt.c b/cpu/mpc85xx/fdt.c
> index 2d36c24..26a8f48 100644
> --- a/cpu/mpc85xx/fdt.c
> +++ b/cpu/mpc85xx/fdt.c
> @@ -39,13 +39,8 @@ void ft_fixup_cpu(void *blob, u64 memory_limit)
> {
> 	int off;
> 	ulong spin_tbl_addr = get_spin_addr();
> -	u32 bootpg, id = get_my_id();
> -
> -	/* if we have 4G or more of memory, put the boot page at 4Gb-4k */
> -	if ((u64)gd->ram_size > 0xfffff000)
> -		bootpg = 0xfffff000;
> -	else
> -		bootpg = gd->ram_size - 4096;
> +	u32 bootpg = determine_mp_bootpg();
> +	u32 id = get_my_id();
>
> 	off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu",  
> 4);
> 	while (off != -FDT_ERR_NOTFOUND) {
> diff --git a/cpu/mpc85xx/mp.c b/cpu/mpc85xx/mp.c
> index 3338c1a..8ddd81d 100644
> --- a/cpu/mpc85xx/mp.c
> +++ b/cpu/mpc85xx/mp.c
> @@ -112,6 +112,15 @@ int cpu_release(int nr, int argc, char *argv[])
> 	return 0;
> }
>
> +u32 determine_mp_bootpg(void)
> +{
> +	/* if we have 4G or more of memory, put the boot page at 4Gb-4k */
> +	if ((u64)gd->ram_size > 0xfffff000)
> +		return (0xfffff000);
> +
> +	return (gd->ram_size - 4096);
> +}
> +
> ulong get_spin_addr(void)
> {
> 	extern ulong __secondary_start_page;
> @@ -188,13 +197,7 @@ static void pq3_mp_up(unsigned long bootpg)
>
> void cpu_mp_lmb_reserve(struct lmb *lmb)
> {
> -	u32 bootpg;
> -
> -	/* if we have 4G or more of memory, put the boot page at 4Gb-4k */
> -	if ((u64)gd->ram_size > 0xfffff000)
> -		bootpg = 0xfffff000;
> -	else
> -		bootpg = gd->ram_size - 4096;
> +	u32 bootpg = determine_mp_bootpg();
>
> 	lmb_reserve(lmb, bootpg, 4096);
> }
> @@ -203,13 +206,7 @@ void setup_mp(void)
> {
> 	extern ulong __secondary_start_page;
> 	ulong fixup = (ulong)&__secondary_start_page;
> -	u32 bootpg;
> -
> -	/* if we have 4G or more of memory, put the boot page at 4Gb-4k */
> -	if ((u64)gd->ram_size > 0xfffff000)
> -		bootpg = 0xfffff000;
> -	else
> -		bootpg = gd->ram_size - 4096;
> +	u32 bootpg = determine_mp_bootpg();
>
> 	memcpy((void *)bootpg, (void *)fixup, 4096);
> 	flush_cache(bootpg, 4096);
> diff --git a/cpu/mpc85xx/mp.h b/cpu/mpc85xx/mp.h
> index 4329286..71423ef 100644
> --- a/cpu/mpc85xx/mp.h
> +++ b/cpu/mpc85xx/mp.h
> @@ -5,6 +5,7 @@ ulong get_spin_addr(void);
> void setup_mp(void);
> u32 get_my_id(void);
> void cpu_mp_lmb_reserve(struct lmb *lmb);
> +u32 determine_mp_bootpg(void);
>
> #define BOOT_ENTRY_ADDR_UPPER	0
> #define BOOT_ENTRY_ADDR_LOWER	1
> -- 
> 1.5.6.6
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

  parent reply	other threads:[~2009-04-01 18:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-01 16:06 [U-Boot] [PATCH v2 1/3] 86xx: Cleanup MP support Kumar Gala
2009-04-01 16:06 ` [U-Boot] [PATCH 2/3] 85xx: Introduce determine_mp_bootpg() helper Kumar Gala
2009-04-01 16:06   ` [U-Boot] [PATCH 3/3] 85xx/86xx: Ensure MP boot page is not used Kumar Gala
2009-04-01 19:00     ` Wolfgang Denk
2009-04-01 18:35   ` Becky Bruce [this message]
2009-04-01 18:34 ` [U-Boot] [PATCH v2 1/3] 86xx: Cleanup MP support Becky Bruce
2009-04-01 19:00 ` Wolfgang Denk
2009-04-01 20:11 ` Kim Phillips
2009-04-01 20:15   ` Kumar Gala

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=D6FBE496-2B25-4495-9B62-92BCA127D0F9@kernel.crashing.org \
    --to=beckyb@kernel.crashing.org \
    --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.