All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] cfi_flash: use CFI driver without a monitor program
@ 2013-05-17  6:35 Masahiro Yamada
  2013-05-17  7:38 ` Stefan Roese
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2013-05-17  6:35 UTC (permalink / raw)
  To: u-boot

When CONFIG_SYS_MONITOR_BASE is not defined
and CONFIG_SYS_FLASH_BASE is defined as zero,
compile failed with an error.

We can work around this problem by defining
CONFIG_SYS_MONITOR_BASE as any value
even though a monitor program is not used.
But this is not a correct way.

Using CFI driver should not depend on the use of
a monitor program.

So, this commit corrects the build error by adding
"if defined(CONFIG_SYS_MONITOR_BASE)" condition.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---
 drivers/mtd/cfi_flash.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 22d8440..e418c22 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -2308,7 +2308,8 @@ void flash_protect_default(void)
 #endif
 
 	/* Monitor protection ON by default */
-#if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
+#if defined(CONFIG_SYS_MONITOR_BASE) && \
+	(CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) &&	\
 	(!defined(CONFIG_MONITOR_IS_IN_RAM))
 	flash_protect(FLAG_PROTECT_SET,
 		       CONFIG_SYS_MONITOR_BASE,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] cfi_flash: use CFI driver without a monitor program
  2013-05-17  6:35 [U-Boot] [PATCH] cfi_flash: use CFI driver without a monitor program Masahiro Yamada
@ 2013-05-17  7:38 ` Stefan Roese
  2013-05-17  9:01   ` Masahiro Yamada
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Roese @ 2013-05-17  7:38 UTC (permalink / raw)
  To: u-boot

On 05/17/2013 08:35 AM, Masahiro Yamada wrote:
> When CONFIG_SYS_MONITOR_BASE is not defined
> and CONFIG_SYS_FLASH_BASE is defined as zero,
> compile failed with an error.
> 
> We can work around this problem by defining
> CONFIG_SYS_MONITOR_BASE as any value
> even though a monitor program is not used.
> But this is not a correct way.

CONFIG_SYS_MONITOR_BASE should be defined to the value, where the U-Boot
image (monitor) is located.

> Using CFI driver should not depend on the use of
> a monitor program.

Could you please explain, what a "monitor program" is?

Is it correct to assume, that you are using the CFI NOR flash driver,
but have U-Boot located in some other location (NAND, MMC...)?

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] cfi_flash: use CFI driver without a monitor program
  2013-05-17  7:38 ` Stefan Roese
@ 2013-05-17  9:01   ` Masahiro Yamada
  0 siblings, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2013-05-17  9:01 UTC (permalink / raw)
  To: u-boot

Hello, Stefan,

Thank you for your reply.

> Could you please explain, what a "monitor program" is?

I don't actually know what a "monitor program" is.
But, I just thought it is like a stab program used
by GDB or something.
(I am not using GDB either, but somehow I just imagined so.)

You mentioned "monitor" is U-Boot image, and I read README file.
Now I realized I had completely misunderstood
the meaning of "monitor".

> Is it correct to assume, that you are using the CFI NOR flash driver,
> but have U-Boot located in some other location (NAND, MMC...)?

Yes.
U-Boot is located sometimes in SRAM, or sometimes in NOR flash
or other cases in NAND.
(My SoC board is a little special.
Memory devices such as SRAM, NOR flash, NAND flash can be attached
to kind of expantion slots of SoC board,
which allows to easily change boot devices.)


Please let me retract this patch.
I'm sorry for wasting your time.


Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-17  9:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-17  6:35 [U-Boot] [PATCH] cfi_flash: use CFI driver without a monitor program Masahiro Yamada
2013-05-17  7:38 ` Stefan Roese
2013-05-17  9:01   ` Masahiro Yamada

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.