public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] cfi-flash: Add CFG_FLASH_AUTOPROTECT_LIST
Date: Sun, 20 Apr 2008 23:52:31 +0200	[thread overview]
Message-ID: <20080420215231.9B0F824657@gemini.denx.de> (raw)
In-Reply-To: Your message of "Sun, 20 Apr 2008 15:22:40 +0200." <200804201522.40808.matthias.fuchs@esd-electronics.com>

Dear Matthias,

in message <200804201522.40808.matthias.fuchs@esd-electronics.com> you wrote:
> 
> even though I like the weak stuff, I agree with you. I also like Stefan's
> idea about removing the #ifdef from the code.
> 
> So I will update my patch in this direction.

Thanks.

> The main idea behind my patch is to fix the bootloader autoprotection
> for 4xx. Do you (sr, J., others) think i is also a good idea to add this:
> 
>         /* Monitor protection ON by default */
> #if (CFG_MONITOR_BASE >= CFG_FLASH_BASE)
>         flash_protect (FLAG_PROTECT_SET,
>                        CFG_MONITOR_BASE,
> +#if defined(CONFIG_4xx)
> 			0xffffffff,
> +#else
>                        CFG_MONITOR_BASE + monitor_flash_len  - 1,
> +#endif
>                        flash_get_info(CFG_MONITOR_BASE));
> #endif

No, I don't think this is a good idea.

First, I don't see what is so special about 4xx here. There are other
processors which have the reset vector at  the  end  of  the  address
space as well, so why do it for 4xx and not - for example - for 85xx?

Also, what makes you think it is  reasonable  to  protect  everything
from  CFG_MONITOR_BASE  to  the  end  of  memory? Yes, we usually pot
U-Boot close to the  end  of  the  flash  memory,  but  there  is  no
guarantee that every board configuration works that way. We could put
U-Boot  at  the  beginning  of  the  flash instead and just reserve a
single sector at the end of the flash for the reset vector. OK,  that
would need adaption of the linker script as well, but ...

I don't think this hardwired, absolute constant makes sense to me. If
0xffffffff is really the value to use, then it should be identical to
the "CFG_MONITOR_BASE + monitor_flash_len - 1" expression,  and  then
we should have no need for the #ifdef at all.

> To be honest, I hope to get my autoprotection patch into 1.3.3 (as a bug fix).

I see.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Microsoft Compatibility:
     your old Windows 3.11 application crash exactly as the new ones.

      reply	other threads:[~2008-04-20 21:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-18 14:29 [U-Boot-Users] [PATCH] cfi-flash: Add CFG_FLASH_AUTOPROTECT_LIST Matthias Fuchs
2008-04-18 16:01 ` Jean-Christophe PLAGNIOL-VILLARD
2008-04-19 11:30   ` Matthias Fuchs
2008-04-19 12:02     ` Stefan Roese
2008-04-19 14:50       ` Matthias Fuchs
2008-04-19 15:33         ` [U-Boot-Users] [PATCH] cfi-flash: Add?CFG_FLASH_AUTOPROTECT_LIST Jean-Christophe PLAGNIOL-VILLARD
2008-04-19 17:22           ` Matthias Fuchs
2008-04-20  3:54             ` [U-Boot-Users] [PATCH] cfi-flash:?Add?CFG_FLASH_AUTOPROTECT_LIST Jean-Christophe PLAGNIOL-VILLARD
2008-04-20 23:44               ` Wolfgang Denk
2008-04-20  1:14   ` [U-Boot-Users] [PATCH] cfi-flash: Add CFG_FLASH_AUTOPROTECT_LIST Wolfgang Denk
2008-04-20 13:22     ` Matthias Fuchs
2008-04-20 21:52       ` Wolfgang Denk [this message]

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=20080420215231.9B0F824657@gemini.denx.de \
    --to=wd@denx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox