All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [1/5]devkit8000 nand_spl: armv7 support nand_spl boot
Date: Wed, 29 Jun 2011 10:27:46 +0200	[thread overview]
Message-ID: <4E0AE202.6060708@gmail.com> (raw)
In-Reply-To: <1309270480-31918-2-git-send-email-schwarz@corscience.de>

Dear Simon Schwarz,

(this is a review of RFC for omap3 nand spl Simon does for his bachelor
thesis, there is one question in regarding the current 'SPL framework
redesign' discussion -> entry point for spl code).

Am 28.06.2011 16:14, schrieb simonschwarzcor at googlemail.com:

<snip long line>

> --
> 
> diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
> index d91ae12..ebbfce4 100644
> --- a/arch/arm/cpu/armv7/start.S
> +++ b/arch/arm/cpu/armv7/start.S
> @@ -33,6 +33,11 @@
>  #include <config.h>
>  #include <version.h>
>  
> +/* prevent lowlevel init if this is not the preloader*/
> +#if defined(CONFIG_SPL) && !defined(CONFIG_PRELOADER)
> +#define CONFIG_SKIP_LOWLEVEL_INIT
> +#endif
> +

not here, use your board configuration header for this.

>  .globl _start
>  _start: b	reset
>  	ldr	pc, _undefined_instruction
> @@ -43,6 +48,17 @@ _start: b	reset
>  	ldr	pc, _irq
>  	ldr	pc, _fiq
>  
> +#ifdef CONFIG_PRELOADER
> +/* If in Preloader don't use interrupts...*/
> +_undefined_instruction: .word undefined_instruction
> +_software_interrupt:    .word _software_interrupt
> +_prefetch_abort:    .word _prefetch_abort
> +_data_abort:        .word data_abort
> +_not_used:      .word _not_used
> +_irq:           .word _irq
> +_fiq:           .word _fiq
> +_pad:           .word 0x12345678 /* now 16*4=64 */
> +#else
>  _undefined_instruction: .word undefined_instruction
>  _software_interrupt:	.word software_interrupt
>  _prefetch_abort:	.word prefetch_abort
> @@ -51,6 +67,7 @@ _not_used:		.word not_used
>  _irq:			.word irq
>  _fiq:			.word fiq
>  _pad:			.word 0x12345678 /* now 16*4=64 */
> +#endif /* CONFIG_PRELOADER */

why resetting the vector table? just do not enable irq at all should
also do the job, isn't it?

>  .global _end_vect
>  _end_vect:
>  
> @@ -85,6 +102,7 @@ _armboot_start:
>  /*
>   * These are defined in the board-specific linker script.
>   */
> +#ifndef CONFIG_PRELOADER

isn't that SPL specific?

>  .globl _bss_start_ofs
>  _bss_start_ofs:
>  	.word __bss_start - _start
> @@ -96,6 +114,16 @@ _bss_end_ofs:
>  .globl _end_ofs
>  _end_ofs:
>  	.word _end - _start
> +#else
> +/* preserved the _ofs because although there is no offset */
> +.globl _bss_start_ofs
> +_bss_start_ofs:
> +	.word __bss_start
> +
> +.globl _bss_end_ofs
> +_bss_end_ofs:
> +	.word __bss_end__
> +#endif
>  
>  #ifdef CONFIG_USE_IRQ
>  /* IRQ stack memory (calculated at run-time) */
> @@ -153,8 +181,15 @@ next:
>  	/* the mask ROM code should have PLL and others stable */
>  #ifndef CONFIG_SKIP_LOWLEVEL_INIT
>  	bl	cpu_init_crit
> -#endif
> -
> +#endif /* #ifdef CONFIG_PRELOADER */

ok to mark this #endif, but do not use  '/* #ifdef', it looks like
commented out ifdef.

> +
> +#ifdef CONFIG_PRELOADER
> +call_board_init_spl:
> +    ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
> +    bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
> +    ldr r0,=0x00000000
> +    bl  board_init_spl

why a new interface for entry point? You could just use
call_board_init_f() even for spl (just do not compile lib/board.c and
provide another one for spl). -> this should be discussed in 'SPL
framework redesign'.

> +#else
>  /* Set stackpointer in internal RAM to call board_init_f */
>  call_board_init_f:
>  	ldr	sp, =(CONFIG_SYS_INIT_SP_ADDR)
> @@ -182,10 +217,8 @@ stack_setup:
>  	mov	sp, r4
>  
>  	adr	r0, _start
> -#ifndef CONFIG_PRELOADER

hmm ... that ifndef was intentionally there

>  	cmp	r0, r6
>  	beq	clear_bss		/* skip relocation */
> -#endif
>  	mov	r1, r6			/* r1 <- scratch for copy_loop */
>  	ldr	r3, _bss_start_ofs
>  	add	r2, r0, r3		/* r2 <- source end address	    */
> @@ -196,7 +229,6 @@ copy_loop:
>  	cmp	r0, r2			/* until source end address [r2]    */
>  	blo	copy_loop
>  
> -#ifndef CONFIG_PRELOADER
>  	/*
>  	 * fix .rel.dyn relocations
>  	 */
> @@ -248,7 +280,6 @@ clbss_l:str	r2, [r0]		/* clear loop...		    */
>  	add	r0, r0, #4
>  	cmp	r0, r1
>  	bne	clbss_l
> -#endif	/* #ifndef CONFIG_PRELOADER */
>  
>  /*
>   * We are done. Do not return, instead branch to second part of board
> @@ -265,16 +296,18 @@ jump_2_ram:
>  	/* jump to it ... */
>  	mov	pc, lr
>  
> -_board_init_r_ofs:
> -	.word board_init_r - _start
> -
>  _rel_dyn_start_ofs:
> -	.word __rel_dyn_start - _start
> +    .word __rel_dyn_start - _start
>  _rel_dyn_end_ofs:
> -	.word __rel_dyn_end - _start
> +    .word __rel_dyn_end - _start
>  _dynsym_start_ofs:
> -	.word __dynsym_start - _start
> +    .word __dynsym_start - _start
>  
> +_board_init_r_ofs:
> +	.word board_init_r - _start

these changes are not necessary!

> +#endif /* #ifndef CONFIG_PRELOADER */
> +
> +#ifndef CONFIG_SKIP_LOWLEVEL_INIT

this shouldn't be required here. If there is an error in start.S please
provide another patch fixing the error.

>  /*************************************************************************
>   *
>   * CPU_init_critical registers
> @@ -311,6 +344,8 @@ cpu_init_crit:
>  	bl	lowlevel_init		@ go setup pll,mux,memory
>  	mov	lr, ip			@ restore link
>  	mov	pc, lr			@ back to my caller
> +#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
> +
>  /*
>   *************************************************************************
>   *
> @@ -437,6 +472,7 @@ cpu_init_crit:
>  /*
>   * exception handlers
>   */
> +#ifndef CONFIG_PRELOADER
>  	.align	5
>  undefined_instruction:
>  	get_bad_stack
> @@ -499,3 +535,14 @@ fiq:
>  	bl	do_fiq
>  
>  #endif
> +#endif /* CONFIG_PRELOADER */

#endif /* CONFIG_PRELOADER */ followed by #ifdef CONFIG_PRELOADER? ...
how about #else?

> +

no empty line then

> +#ifdef CONFIG_PRELOADER
> +	.align 	5
> +undefined_instruction:
> +	b undefined_instruction
> +
> +	.align	5
> +data_abort:
> +	b data_abort
> +#endif

I guess you want to save space by reducing the irq vector overhead. But
shouldn't this be some #ifdef CONFIG_USE_IRQ instead of CONFIG_PRELOADER?

> diff --git a/arch/arm/lib/reset.c b/arch/arm/lib/reset.c
> index 08e6acb..ad444cb 100644
> --- a/arch/arm/lib/reset.c
> +++ b/arch/arm/lib/reset.c
> @@ -44,8 +44,9 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  	puts ("resetting ...\n");
>  
>  	udelay (50000);				/* wait 50 ms */
> -
> +#ifndef CONFIG_PRELOADER
>  	disable_interrupts();
> +#endif

again, use CONFIG_USE_IRQ here would be better. But providing an empty
disable_interrupts() in either case you can drop these #ifndef here too.

>  	reset_cpu(0);
>  
>  	/*NOTREACHED*/

regards

Andreas Bie?mann

  reply	other threads:[~2011-06-29  8:27 UTC|newest]

Thread overview: 134+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-28 14:14 [U-Boot] [0/5]devkit8000 nand_spl support simonschwarzcor at googlemail.com
2011-06-28 14:14 ` [U-Boot] [1/5]devkit8000 nand_spl: armv7 support nand_spl boot simonschwarzcor at googlemail.com
2011-06-29  8:27   ` Andreas Bießmann [this message]
2011-06-30 11:10     ` Aneesh V
2011-06-28 14:14 ` [U-Boot] [2/5]devkit8000 nand_spl: omap3 " simonschwarzcor at googlemail.com
2011-06-29  8:43   ` Andreas Bießmann
2011-06-30  9:06     ` Simon Schwarz
2011-06-30 10:38   ` Aneesh V
2011-06-28 14:14 ` [U-Boot] [3/5]devkit8000 nand_spl: Add RAM configuration independent of x-loader or CH simonschwarzcor at googlemail.com
2011-06-28 14:14 ` [U-Boot] [4/5]devkit8000 nand_spl: Add SPL NAND support to omap_gpmc driver simonschwarzcor at googlemail.com
2011-06-29  8:58   ` Andreas Bießmann
2011-06-30 11:01     ` Simon Schwarz
2011-06-28 14:14 ` [U-Boot] [5/5]devkit8000 nand_spl: add nand_spl support simonschwarzcor at googlemail.com
2011-06-28 15:01   ` Andreas Bießmann
2011-07-25 18:05 ` [U-Boot] [PATCH V2 0/5] OMAP3 and devkit8000 SPL support Simon Schwarz
2011-07-25 18:05   ` [U-Boot] [PATCH V2 1/5] omap3: Configure RAM bank 0 if in SPL Simon Schwarz
2011-07-25 18:05   ` [U-Boot] [PATCH V2 2/5] omap-common: add nand spl support Simon Schwarz
2011-07-26  6:07     ` Andreas Bießmann
2011-07-26  8:42       ` Simon Schwarz
2011-07-28  6:20         ` Aneesh V
2011-07-25 18:05   ` [U-Boot] [PATCH V2 3/5] nand spl: add NAND Library to new SPL Simon Schwarz
2011-07-26  5:59     ` Andreas Bießmann
2011-07-26  8:47       ` Simon Schwarz
2011-07-25 18:05   ` [U-Boot] [PATCH V2 4/5] omap3: new SPL structure support Simon Schwarz
2011-07-26  6:11     ` Andreas Bießmann
2011-07-25 18:05   ` [U-Boot] [PATCH V2 5/5] devkit8000: Add nand-spl support for new SPL Simon Schwarz
2011-07-26  6:17     ` Andreas Bießmann
2011-07-26  9:09       ` Simon Schwarz
2011-07-26 10:22   ` [U-Boot] [PATCH V3 0/5] OMAP3 and devkit8000 SPL support Simon Schwarz
2011-07-26 10:22     ` [U-Boot] [PATCH V3 1/5] omap3: Configure RAM bank 0 if in SPL Simon Schwarz
2011-07-26 10:22     ` [U-Boot] [PATCH V3 2/5] omap-common: add nand spl support Simon Schwarz
2011-07-26 10:22     ` [U-Boot] [PATCH V3 3/5] nand spl: add NAND Library to new SPL Simon Schwarz
2011-07-26 10:22     ` [U-Boot] [PATCH V3 4/5] omap3: new SPL structure support Simon Schwarz
2011-07-26 10:22     ` [U-Boot] [PATCH V3 5/5] devkit8000: Add nand-spl support for new SPL Simon Schwarz
2011-07-26 10:42       ` Andreas Bießmann
2011-07-26 12:34         ` Simon Schwarz
2011-07-26 11:04       ` Wolfgang Denk
2011-07-26 11:06     ` [U-Boot] [PATCH V3 0/5] OMAP3 and devkit8000 SPL support Wolfgang Denk
2011-07-26 12:31       ` Simon Schwarz
2011-07-26 12:09     ` [U-Boot] [PATCH V4 " Simon Schwarz
2011-07-26 12:09       ` [U-Boot] [PATCH V4 1/5] omap3: Configure RAM bank 0 if in SPL Simon Schwarz
2011-07-26 12:09       ` [U-Boot] [PATCH V4 2/5] omap-common: add nand spl support Simon Schwarz
2011-07-26 18:06         ` Scott Wood
     [not found]           ` <4E2FCF6E.10701@gmail.com>
     [not found]             ` <20110727163839.736d5bed@schlenkerla.am.freescale.net>
2011-07-28  7:51               ` Simon Schwarz
2011-07-28 18:56                 ` Scott Wood
2011-07-29  8:48                   ` Simon Schwarz
2011-07-26 12:09       ` [U-Boot] [PATCH V4 3/5] nand spl: add NAND Library to new SPL Simon Schwarz
2011-07-26 18:04         ` Scott Wood
2011-07-26 18:12           ` Scott Wood
2011-07-27  9:22           ` Simon Schwarz
2011-07-27 14:55             ` V, Aneesh
2011-07-27 22:01               ` Scott Wood
2011-07-28  7:27                 ` Aneesh V
2011-07-26 12:09       ` [U-Boot] [PATCH V4 4/5] omap3: new SPL structure support Simon Schwarz
2011-07-26 12:09       ` [U-Boot] [PATCH V4 5/5] devkit8000: Add nand-spl support for new SPL Simon Schwarz
2011-07-27 12:50       ` [U-Boot] [PATCH V5 0/5] OMAP3 and devkit8000 SPL support Simon Schwarz
2011-07-27 12:50         ` [U-Boot] [PATCH V5 1/5] omap3: Configure RAM bank 0 if in SPL Simon Schwarz
2011-07-27 12:50         ` [U-Boot] [PATCH V5 2/5] omap-common: add nand spl support Simon Schwarz
2011-07-27 12:50         ` [U-Boot] [PATCH V5 3/5] nand spl: add NAND Library to new SPL Simon Schwarz
2011-07-27 12:50         ` [U-Boot] [PATCH V5 4/5] omap3: new SPL structure support Simon Schwarz
2011-07-27 12:50         ` [U-Boot] [PATCH V5 5/5] devkit8000: Add nand-spl support for new SPL Simon Schwarz
2011-07-28  8:38         ` [U-Boot] [PATCH V6 0/5] OMAP3 and devkit8000 SPL support Simon Schwarz
2011-07-28  8:38           ` [U-Boot] [PATCH V6 1/5] omap3: Configure RAM bank 0 if in SPL Simon Schwarz
2011-07-28  8:50             ` Aneesh V
2011-07-28  9:42               ` Simon Schwarz
2011-07-29 16:53                 ` Simon Schwarz
2011-07-28  8:38           ` [U-Boot] [PATCH V6 2/5] omap-common: add nand spl support Simon Schwarz
2011-07-28  9:42             ` Aneesh V
2011-07-28 12:44               ` Simon Schwarz
2011-07-28 14:24                 ` Aneesh V
2011-07-28 14:34                   ` Simon Schwarz
2011-08-02 12:03               ` Simon Schwarz
2011-08-02 12:18                 ` Aneesh V
2011-08-02 12:30                   ` Simon Schwarz
2011-07-28  9:58             ` Aneesh V
2011-07-28 12:54               ` Simon Schwarz
2011-07-28 14:16             ` Aneesh V
2011-07-28 18:50               ` Scott Wood
2011-07-28 19:07                 ` Wolfgang Denk
2011-07-29  7:34                 ` Aneesh V
2011-07-29  8:19                   ` Simon Schwarz
2011-07-28  8:38           ` [U-Boot] [PATCH V6 3/5] nand spl: add NAND Library to new SPL Simon Schwarz
2011-07-28 11:54             ` Aneesh V
2011-07-28 14:04               ` Simon Schwarz
2011-07-28 16:18                 ` Aneesh V
2011-07-29 12:17                   ` Simon Schwarz
2011-07-28 19:16             ` Scott Wood
2011-07-29  9:12               ` Simon Schwarz
2011-07-29  9:27                 ` Wolfgang Denk
2011-07-29 12:27                   ` Simon Schwarz
2011-07-28  8:38           ` [U-Boot] [PATCH V6 4/5] omap3: new SPL structure support Simon Schwarz
2011-07-28  8:38           ` [U-Boot] [PATCH V6 5/5] devkit8000: Add nand-spl support for new SPL Simon Schwarz
2011-07-28 10:51             ` Aneesh V
2011-07-28 11:54               ` Simon Schwarz
2011-07-29 16:53           ` [U-Boot] [PATCH V7 0/7] OMAP3 and devkit8000 SPL support Simon Schwarz
2011-07-29 16:53             ` [U-Boot] [PATCH V7 1/7] omap-common/omap4: relocate early UART clock setup Simon Schwarz
2011-07-29 16:53             ` [U-Boot] [PATCH V7 2/7] omap3: Configure RAM bank 0 if in SPL Simon Schwarz
2011-07-29 16:53             ` [U-Boot] [PATCH V7 3/7] omap-common: add nand spl support Simon Schwarz
2011-07-29 16:53             ` [U-Boot] [PATCH V7 4/7] spl: add NAND Library to new SPL Simon Schwarz
2011-08-01 17:58               ` Scott Wood
2011-08-02  8:15                 ` Simon Schwarz
2011-07-29 16:53             ` [U-Boot] [PATCH V7 5/7] spl: Add POWER library to new spl Simon Schwarz
2011-07-29 16:53             ` [U-Boot] [PATCH V7 6/7] omap3: new SPL structure support Simon Schwarz
2011-07-29 16:53             ` [U-Boot] [PATCH V7 7/7] devkit8000: Add nand-spl support for new SPL Simon Schwarz
2011-08-01 16:23             ` [U-Boot] [PATCH V7 0/7] OMAP3 and devkit8000 SPL support Simon Schwarz
2011-08-02 15:59             ` [U-Boot] [PATCH V8 0/9] " Simon Schwarz
2011-08-02 15:59               ` [U-Boot] [PATCH V8 1/9] omap-common/omap4: relocate early UART clock setup Simon Schwarz
2011-08-02 15:59               ` [U-Boot] [PATCH V8 2/9] omap3: Configure RAM bank 0 if in SPL Simon Schwarz
2011-08-02 15:59               ` [U-Boot] [PATCH V8 3/9] omap-common: add nand spl support Simon Schwarz
2011-08-05  7:30                 ` Aneesh V
2011-08-08  7:50                   ` Simon Schwarz
2011-08-08  9:04                     ` Aneesh V
2011-08-02 15:59               ` [U-Boot] [PATCH V8 4/9] spl: add NAND Library to new SPL Simon Schwarz
2011-08-02 16:12                 ` Scott Wood
2011-08-02 15:59               ` [U-Boot] [PATCH V8 5/9] spl: Add POWER library to new spl Simon Schwarz
2011-08-02 15:59               ` [U-Boot] [PATCH V8 6/9] omap3: new SPL structure support Simon Schwarz
2011-08-02 15:59               ` [U-Boot] [PATCH V8 7/9] devkit8000: Add nand-spl support for new SPL Simon Schwarz
2011-08-02 15:59               ` [U-Boot] [PATCH V8 8/9] omap3: implement boot parameter saving Simon Schwarz
2011-08-05  7:41                 ` Aneesh V
2011-08-08  8:03                   ` Simon Schwarz
2011-08-08  8:44                     ` Aneesh V
2011-08-08 10:59                       ` Simon Schwarz
2011-08-02 15:59               ` [U-Boot] [PATCH V8 9/9] omap-common: reorganize spl.c Simon Schwarz
2011-08-08 13:11               ` [U-Boot] [PATCH V9 0/9] OMAP3 and devkit8000 SPL support Simon Schwarz
2011-08-08 13:11                 ` [U-Boot] [PATCH V9 1/9] omap-common/omap4: relocate early UART clock setup Simon Schwarz
2011-08-08 13:11                 ` [U-Boot] [PATCH V9 2/9] omap3: Configure RAM bank 0 if in SPL Simon Schwarz
2011-08-08 13:11                 ` [U-Boot] [PATCH V9 3/9] omap-common: add nand spl support Simon Schwarz
2011-08-08 13:11                 ` [U-Boot] [PATCH V9 4/9] spl: add NAND Library to new SPL Simon Schwarz
2011-08-08 23:34                   ` Scott Wood
2011-08-08 13:11                 ` [U-Boot] [PATCH V9 5/9] spl: Add POWER library to new spl Simon Schwarz
2011-08-08 13:11                 ` [U-Boot] [PATCH V9 6/9] omap3: new SPL structure support Simon Schwarz
2011-08-08 13:11                 ` [U-Boot] [PATCH V9 7/9] devkit8000: Add nand-spl support for new SPL Simon Schwarz
2011-08-08 13:11                 ` [U-Boot] [PATCH V9 8/9] omap3: implement boot parameter saving Simon Schwarz
2011-08-08 13:11                 ` [U-Boot] [PATCH V9 9/9] omap-common: reorganize spl.c Simon Schwarz

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=4E0AE202.6060708@gmail.com \
    --to=andreas.devel@googlemail.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.