Patchwork [U-Boot,1/2] microblaze: avoid compile error on systems without cfi flash

login
register
mail settings
Submitter Stephan Linz
Date June 21, 2012, 7:42 p.m.
Message ID <1340307771-15204-1-git-send-email-linz@li-pro.net>
Download mbox | patch
Permalink /patch/166376/
State Changes Requested
Delegated to: Michal Simek
Headers show

Comments

Stephan Linz - June 21, 2012, 7:42 p.m.
Use XILINX_FLASH_START to set/unset FLASH and RAMENV.

Error was:
board.c: In function 'board_init':
board.c:134: error: 'XILINX_FLASH_START' undeclared (first use in this function)
board.c:134: error: (Each undeclared identifier is reported only once
board.c:134: error: for each function it appears in.)

Signed-off-by: Stephan Linz <linz@li-pro.net>
---
 include/configs/microblaze-generic.h |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
Michal Simek - June 25, 2012, 4:55 a.m.
On 06/21/2012 09:42 PM, Stephan Linz wrote:
> Use XILINX_FLASH_START to set/unset FLASH and RAMENV.
>
> Error was:
> board.c: In function 'board_init':
> board.c:134: error: 'XILINX_FLASH_START' undeclared (first use in this function)
> board.c:134: error: (Each undeclared identifier is reported only once
> board.c:134: error: for each function it appears in.)
>
> Signed-off-by: Stephan Linz<linz@li-pro.net>
> ---
>   include/configs/microblaze-generic.h |   14 +++++++++-----
>   1 files changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h
> index 295d123..2ef7d62 100644
> --- a/include/configs/microblaze-generic.h
> +++ b/include/configs/microblaze-generic.h
> @@ -31,6 +31,15 @@
>   #define	CONFIG_MICROBLAZE	1
>   #define	MICROBLAZE_V5		1
>
> +/* linear flash memory */
> +#ifdef XILINX_FLASH_START
> +#define	FLASH
> +#undef	RAMENV	/* hold environment in flash */
> +#else
> +#undef	FLASH
> +#define	RAMENV	/* hold environment in RAM */
> +#endif
> +
>   /* uart */
>   #ifdef XILINX_UARTLITE_BASEADDR
>   # define CONFIG_XILINX_UARTLITE
> @@ -164,9 +173,6 @@
>   /* stack */
>   #define	CONFIG_SYS_INIT_SP_OFFSET	CONFIG_SYS_MALLOC_BASE
>
> -/*#define	RAMENV */
> -#define	FLASH
> -
>   #ifdef FLASH
>   # define CONFIG_SYS_FLASH_BASE		XILINX_FLASH_START
>   # define CONFIG_SYS_FLASH_SIZE		XILINX_FLASH_SIZE
> @@ -200,8 +206,6 @@
>   # define CONFIG_ENV_IS_NOWHERE	1
>   # define CONFIG_ENV_SIZE	0x1000
>   # define CONFIG_ENV_ADDR	(CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE)
> -/* hardware flash protection */
> -# define CONFIG_SYS_FLASH_PROTECTION

What's wrong with hardware flash protection?

Thanks,
Michal
Stephan Linz - June 25, 2012, 5:08 p.m.
Am Montag, den 25.06.2012, 06:55 +0200 schrieb Michal Simek: 
> On 06/21/2012 09:42 PM, Stephan Linz wrote:
> > Use XILINX_FLASH_START to set/unset FLASH and RAMENV.
> >
> > Error was:
> > board.c: In function 'board_init':
> > board.c:134: error: 'XILINX_FLASH_START' undeclared (first use in this function)
> > board.c:134: error: (Each undeclared identifier is reported only once
> > board.c:134: error: for each function it appears in.)
> >
> > Signed-off-by: Stephan Linz<linz@li-pro.net>
> > ---
> >   include/configs/microblaze-generic.h |   14 +++++++++-----
> >   1 files changed, 9 insertions(+), 5 deletions(-)
> >
> > diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h
> > index 295d123..2ef7d62 100644
> > --- a/include/configs/microblaze-generic.h
> > +++ b/include/configs/microblaze-generic.h
> > @@ -31,6 +31,15 @@
> >   #define	CONFIG_MICROBLAZE	1
> >   #define	MICROBLAZE_V5		1
> >
> > +/* linear flash memory */
> > +#ifdef XILINX_FLASH_START
> > +#define	FLASH
> > +#undef	RAMENV	/* hold environment in flash */
> > +#else
> > +#undef	FLASH
> > +#define	RAMENV	/* hold environment in RAM */
> > +#endif
> > +
> >   /* uart */
> >   #ifdef XILINX_UARTLITE_BASEADDR
> >   # define CONFIG_XILINX_UARTLITE
> > @@ -164,9 +173,6 @@
> >   /* stack */
> >   #define	CONFIG_SYS_INIT_SP_OFFSET	CONFIG_SYS_MALLOC_BASE
> >
> > -/*#define	RAMENV */
> > -#define	FLASH
> > -
> >   #ifdef FLASH
> >   # define CONFIG_SYS_FLASH_BASE		XILINX_FLASH_START
> >   # define CONFIG_SYS_FLASH_SIZE		XILINX_FLASH_SIZE
> > @@ -200,8 +206,6 @@
> >   # define CONFIG_ENV_IS_NOWHERE	1
> >   # define CONFIG_ENV_SIZE	0x1000
> >   # define CONFIG_ENV_ADDR	(CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE)
> > -/* hardware flash protection */
> > -# define CONFIG_SYS_FLASH_PROTECTION
> 
> What's wrong with hardware flash protection?

Nothing, but it will defined twice. One time in line 182 and one time in
that line 204. I think the last one is wrong, because that define is
outside the Flash configuration context, or not?

Sorry, I should split the patch. Should I do this?


br,
Stephan
Michal Simek - June 26, 2012, 8:56 a.m.
2012/6/25 Stephan Linz <linz@li-pro.net>:
> Am Montag, den 25.06.2012, 06:55 +0200 schrieb Michal Simek:
>> On 06/21/2012 09:42 PM, Stephan Linz wrote:
>> > Use XILINX_FLASH_START to set/unset FLASH and RAMENV.
>> >
>> > Error was:
>> > board.c: In function 'board_init':
>> > board.c:134: error: 'XILINX_FLASH_START' undeclared (first use in this function)
>> > board.c:134: error: (Each undeclared identifier is reported only once
>> > board.c:134: error: for each function it appears in.)
>> >
>> > Signed-off-by: Stephan Linz<linz@li-pro.net>
>> > ---
>> >   include/configs/microblaze-generic.h |   14 +++++++++-----
>> >   1 files changed, 9 insertions(+), 5 deletions(-)
>> >
>> > diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h
>> > index 295d123..2ef7d62 100644
>> > --- a/include/configs/microblaze-generic.h
>> > +++ b/include/configs/microblaze-generic.h
>> > @@ -31,6 +31,15 @@
>> >   #define   CONFIG_MICROBLAZE       1
>> >   #define   MICROBLAZE_V5           1
>> >
>> > +/* linear flash memory */
>> > +#ifdef XILINX_FLASH_START
>> > +#define    FLASH
>> > +#undef     RAMENV  /* hold environment in flash */
>> > +#else
>> > +#undef     FLASH
>> > +#define    RAMENV  /* hold environment in RAM */
>> > +#endif
>> > +
>> >   /* uart */
>> >   #ifdef XILINX_UARTLITE_BASEADDR
>> >   # define CONFIG_XILINX_UARTLITE
>> > @@ -164,9 +173,6 @@
>> >   /* stack */
>> >   #define   CONFIG_SYS_INIT_SP_OFFSET       CONFIG_SYS_MALLOC_BASE
>> >
>> > -/*#define  RAMENV */
>> > -#define    FLASH
>> > -
>> >   #ifdef FLASH
>> >   # define CONFIG_SYS_FLASH_BASE            XILINX_FLASH_START
>> >   # define CONFIG_SYS_FLASH_SIZE            XILINX_FLASH_SIZE
>> > @@ -200,8 +206,6 @@
>> >   # define CONFIG_ENV_IS_NOWHERE    1
>> >   # define CONFIG_ENV_SIZE  0x1000
>> >   # define CONFIG_ENV_ADDR  (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE)
>> > -/* hardware flash protection */
>> > -# define CONFIG_SYS_FLASH_PROTECTION
>>
>> What's wrong with hardware flash protection?
>
> Nothing, but it will defined twice. One time in line 182 and one time in
> that line 204. I think the last one is wrong, because that define is
> outside the Flash configuration context, or not?
>
> Sorry, I should split the patch. Should I do this?

Two ways.
1. write it to description
2. create separate patch

Option 2 is IMHO better.

Thanks,
Michal
Stephan Linz - June 26, 2012, 4:56 p.m.
Am Dienstag, den 26.06.2012, 10:56 +0200 schrieb Michal Simek: 
> 2012/6/25 Stephan Linz <linz@li-pro.net>:
> > Am Montag, den 25.06.2012, 06:55 +0200 schrieb Michal Simek:
> >> On 06/21/2012 09:42 PM, Stephan Linz wrote:
> >> > Use XILINX_FLASH_START to set/unset FLASH and RAMENV.
> >> >
> >> > Error was:
> >> > board.c: In function 'board_init':
> >> > board.c:134: error: 'XILINX_FLASH_START' undeclared (first use in this function)
> >> > board.c:134: error: (Each undeclared identifier is reported only once
> >> > board.c:134: error: for each function it appears in.)
> >> >
> >> > Signed-off-by: Stephan Linz<linz@li-pro.net>
> >> > ---
> >> >   include/configs/microblaze-generic.h |   14 +++++++++-----
> >> >   1 files changed, 9 insertions(+), 5 deletions(-)
> >> >
> >> > --snip--
> >>
> >> What's wrong with hardware flash protection?
> >
> > Nothing, but it will defined twice. One time in line 182 and one time in
> > that line 204. I think the last one is wrong, because that define is
> > outside the Flash configuration context, or not?
> >
> > Sorry, I should split the patch. Should I do this?
> 
> Two ways.
> 1. write it to description
> 2. create separate patch
> 
> Option 2 is IMHO better.

Yes I do so. I'll split the patch and resubmit together with the UBI
support patch.

br,
Stephan

Patch

diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h
index 295d123..2ef7d62 100644
--- a/include/configs/microblaze-generic.h
+++ b/include/configs/microblaze-generic.h
@@ -31,6 +31,15 @@ 
 #define	CONFIG_MICROBLAZE	1
 #define	MICROBLAZE_V5		1
 
+/* linear flash memory */
+#ifdef XILINX_FLASH_START
+#define	FLASH
+#undef	RAMENV	/* hold environment in flash */
+#else
+#undef	FLASH
+#define	RAMENV	/* hold environment in RAM */
+#endif
+
 /* uart */
 #ifdef XILINX_UARTLITE_BASEADDR
 # define CONFIG_XILINX_UARTLITE
@@ -164,9 +173,6 @@ 
 /* stack */
 #define	CONFIG_SYS_INIT_SP_OFFSET	CONFIG_SYS_MALLOC_BASE
 
-/*#define	RAMENV */
-#define	FLASH
-
 #ifdef FLASH
 # define CONFIG_SYS_FLASH_BASE		XILINX_FLASH_START
 # define CONFIG_SYS_FLASH_SIZE		XILINX_FLASH_SIZE
@@ -200,8 +206,6 @@ 
 # define CONFIG_ENV_IS_NOWHERE	1
 # define CONFIG_ENV_SIZE	0x1000
 # define CONFIG_ENV_ADDR	(CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE)
-/* hardware flash protection */
-# define CONFIG_SYS_FLASH_PROTECTION
 #endif /* !FLASH */
 
 /* system ace */