All of lore.kernel.org
 help / color / mirror / Atom feed
From: Prabhakar Kushwaha <prabhakar@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/2] powerpc/c29xpcie: 8k page size NAND boot support base on TPL/SPL
Date: Mon, 9 Dec 2013 11:10:54 +0530	[thread overview]
Message-ID: <52A557E6.8030303@freescale.com> (raw)
In-Reply-To: <1386379293.7375.226.camel@snotra.buserror.net>


On 12/7/2013 6:51 AM, Scott Wood wrote:
> On Thu, 2013-12-05 at 14:19 +0800, Po Liu wrote:
>> diff --git a/board/freescale/c29xpcie/spl.c b/board/freescale/c29xpcie/spl.c
>> new file mode 100644
>> index 0000000..7bc8ce1
>> --- /dev/null
>> +++ b/board/freescale/c29xpcie/spl.c
>> @@ -0,0 +1,73 @@
>> +/* Copyright 2013 Freescale Semiconductor, Inc.
>> + *
>> + * SPDX-License-Identifier:    GPL-2.0+
>> + */
>> +
>> +#include <common.h>
>> +#include <ns16550.h>
>> +#include <malloc.h>
>> +#include <mmc.h>
>> +#include <nand.h>
>> +#include <i2c.h>
>> +
>> +DECLARE_GLOBAL_DATA_PTR;
>> +
>> +ulong get_effective_memsize(void)
>> +{
>> +	return CONFIG_SYS_L2_SIZE;
>> +}
>> +
>> +void board_init_f(ulong bootflag)
>> +{
>> +	u32 plat_ratio;
>> +	ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
>> +
>> +	console_init_f();
>> +
>> +	/* initialize selected port with appropriate baud rate */
>> +	plat_ratio = in_be32(&gur->porpllsr) & MPC85xx_PORPLLSR_PLAT_RATIO;
>> +	plat_ratio >>= 1;
>> +	gd->bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
>> +
>> +	NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
>> +		     gd->bus_clk / 16 / CONFIG_BAUDRATE);
>> +
>> +	/* copy code to RAM and jump to it - this should not return */
>> +	/* NOTE - code has to be copied out of NAND buffer before
>> +	 * other blocks can be read.
>> +	 */
>> +	relocate_code(CONFIG_SPL_RELOC_STACK, 0, CONFIG_SPL_RELOC_TEXT_BASE);
>> +}
>> +
>> +void board_init_r(gd_t *gd, ulong dest_addr)
>> +{
>> +	/* Pointer is writable since we allocated a register for it */
>> +	gd = (gd_t *)CONFIG_SPL_GD_ADDR;
>> +	bd_t *bd;
>> +
>> +	memset(gd, 0, sizeof(gd_t));
>> +	bd = (bd_t *)(CONFIG_SPL_GD_ADDR + sizeof(gd_t));
>> +	memset(bd, 0, sizeof(bd_t));
>> +	gd->bd = bd;
>> +	bd->bi_memstart = CONFIG_SYS_INIT_L2_ADDR;
>> +	bd->bi_memsize = CONFIG_SYS_L2_SIZE;
>> +
>> +	probecpu();
>> +	get_clocks();
>> +	mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR,
>> +			CONFIG_SPL_RELOC_MALLOC_SIZE);
>> +
>> +	/* relocate environment function pointers etc. */
>> +	nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
>> +			  (uchar *)CONFIG_ENV_ADDR);
>> +			  gd->env_addr  = (ulong)(CONFIG_ENV_ADDR);
>> +	gd->env_valid = 1;
>> +
>> +	i2c_init_all();
>> +
>> +	gd->ram_size = initdram(0);
>> +
>> +	puts("\nTertiary program loader running in sram...");
> Why do you assume tertiary?  Couldn't this be SPL for SD/SPI?  Or was it
> a copy/paste error that you added things to the board config file for
> SD/SPI (after all, the subject line says it's a NAND patch)?
>
>> +void board_init_r(gd_t *gd, ulong dest_addr)
>> +{
>> +	puts("\nSecond program loader running in sram...");
> I see that this isn't new to this patch, but we ought to be consistent
> and either change this to "secondary", or change "tertiary" to "third".
>
> It's also probably too verbose...  Simply saying "SPL\n" or "TPL\n"
> would suffice to indicate progress and verify that console output is
> working (if nothing is printed, then that path doesn't get tested in the
> absence of a load error).
>
>> diff --git a/board/freescale/c29xpcie/tlb.c b/board/freescale/c29xpcie/tlb.c
>> index 84844ee..11f8a37 100644
>> --- a/board/freescale/c29xpcie/tlb.c
>> +++ b/board/freescale/c29xpcie/tlb.c
>> @@ -26,10 +26,20 @@ struct fsl_e_tlb_entry tlb_table[] = {
>>   			0, 0, BOOKE_PAGESZ_4K, 0),
>>   
>>   	/* TLB 1 */
>> +#ifdef CONFIG_SPL_NAND_MINIMAL
>> +	SET_TLB_ENTRY(1, 0xfffff000, 0xfffff000,
>> +			MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
>> +			0, 10, BOOKE_PAGESZ_4K, 1),
>> +	SET_TLB_ENTRY(1, 0xffffe000, 0xffffe000,
>> +			MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
>> +			0, 11, BOOKE_PAGESZ_4K, 1),
>> +#endif
> CONFIG_SPL_NAND_MINIMAL should not exist.  It was introduced by accident
> after a different approach was chosen in patch review (and even then,
> this wasn't what it meant).
I was not aware of this. My mistake :(

> Prabhakar, why did you extend that to other uses?  Why are both entries
> ifdeffed here, but only the 0xffffe000 entry on existing boards?

both entry should not be in ifdef. p1010rdb/bsc9131rdb/bsc9132qds does 
not have this.
i dont think NOR boot tested after this patch. NOR boot will not work 
after applying this patch.

> If this needs to be ifdeffed (and it probably does, if only to avoid
> possible speculative instruction fetches), use (and document)
> CONFIG_SPL_NAND_BOOT.
Yes, I will suggest to have CONFIG_SPL_NAND_BOOT instead of 
CONFIG_SPL_NAND_MINIMAL.
I will fix for p1010rdb, bsc9131rdb, bsc9132qds.

Regards,
Prabhakar

  reply	other threads:[~2013-12-09  5:40 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-02  4:12 [U-Boot] [PATCH] powerpc/c29xpcie: 8k page size NAND boot support base on TPL/SPL Po Liu
2013-12-05  6:18 ` [U-Boot] [PATCH v2 1/2] powerpc:mpc85xx: Add ifc nand boot support for TPL/SPL Po Liu
2013-12-05  6:19   ` [U-Boot] [PATCH v2 2/2] powerpc/c29xpcie: 8k page size NAND boot support base on TPL/SPL Po Liu
2013-12-07  1:21     ` Scott Wood
2013-12-09  5:40       ` Prabhakar Kushwaha [this message]
2013-12-09 17:51         ` Scott Wood
2013-12-10  6:07           ` Prabhakar Kushwaha
2013-12-10 18:20             ` Scott Wood
2013-12-11  6:40               ` Prabhakar Kushwaha
2013-12-11 16:42                 ` Scott Wood
     [not found]               ` <5d27987f1d694ae9977cba2e8a78d843@DM2PR03MB317.namprd03.prod.outlook.com>
2013-12-11  3:00                 ` Po.Liu at freescale.com
2013-12-11  7:00                 ` Prabhakar Kushwaha
     [not found]       ` <c957f7e802e245488c0c0e0fc0f425ed@DM2PR03MB317.namprd03.prod.outlook.com>
2013-12-11  2:46         ` Po.Liu at freescale.com
2013-12-13 21:22           ` Scott Wood
     [not found]       ` <ce05f24a72e0474f82d7f99c215353e6@DM2PR03MB317.namprd03.prod.outlook.com>
2013-12-11  6:20         ` Po.Liu at freescale.com
2013-12-13 20:25         ` Scott Wood
     [not found]           ` <8cbfa2585cd04b348c5883a628e3a33c@DM2PR03MB317.namprd03.prod.outlook.com>
2013-12-14  3:21             ` Scott Wood
2013-12-14  3:08     ` [U-Boot] [PATCH v3 1/2] powerpc:mpc85xx: Add ifc nand boot support for TPL/SPL Po Liu
2013-12-14  3:08       ` [U-Boot] [PATCH v3 2/2] powerpc/c29xpcie: 8k page size NAND boot support base on TPL/SPL Po Liu
2014-01-02 22:01       ` [U-Boot] [PATCH v3 1/2] powerpc:mpc85xx: Add ifc nand boot support for TPL/SPL Scott Wood
2014-01-06  6:15       ` [U-Boot] [PATCH v4 " Po Liu
2014-01-06  6:15         ` [U-Boot] [PATCH v4 2/2] powerpc/c29xpcie: 8k page size NAND boot support base on TPL/SPL Po Liu
2014-01-07  3:37           ` [U-Boot] [PATCH v5 1/2] powerpc:mpc85xx: Add ifc nand boot support for TPL/SPL Po Liu
2014-01-07  3:37             ` [U-Boot] [PATCH v5 2/2] powerpc/c29xpcie: 8k page size NAND boot support base on TPL/SPL Po Liu
2014-01-08  0:03             ` [U-Boot] [PATCH v5 1/2] powerpc:mpc85xx: Add ifc nand boot support for TPL/SPL Scott Wood
2014-01-10  2:10             ` [U-Boot] [PATCH v6 " Po Liu
2014-01-10  2:10               ` [U-Boot] [PATCH v6 2/2] powerpc/c29xpcie: 8k page size NAND boot support base on TPL/SPL Po Liu
2014-01-21 22:54                 ` York Sun
2014-01-10 19:03               ` [U-Boot] [PATCH v6 1/2] powerpc:mpc85xx: Add ifc nand boot support for TPL/SPL Scott Wood
2014-01-21 22:54                 ` York Sun
2014-01-13  6:28               ` Prabhakar Kushwaha
2014-01-14  1:09                 ` Scott Wood
2014-01-14  3:44                   ` Prabhakar Kushwaha
2013-12-07  1:33   ` [U-Boot] [PATCH v2 " Scott Wood

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=52A557E6.8030303@freescale.com \
    --to=prabhakar@freescale.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 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.