From: Wolfgang Denk Date: Sat, 19 Dec 2009 22:37:51 +0100 Subject: [U-Boot] [PATCH 2/9] smi driver support for SPEAr SoCs In-Reply-To: <83d1d72b0912182356u6b140b24g8ee1e97becc6285b@mail.gmail.com> References: <1260955110-5656-1-git-send-email-vipin.kumar@st.com> <1260955110-5656-2-git-send-email-vipin.kumar@st.com> <1260955110-5656-3-git-send-email-vipin.kumar@st.com> <20091216224441.64E914C026@gemini.denx.de> <83d1d72b0912182244yb303c6ai3b61d7b896020c00@mail.gmail.com> <20091219072038.4FEC9E85072@gemini.denx.de> <83d1d72b0912182356u6b140b24g8ee1e97becc6285b@mail.gmail.com> Message-ID: <20091219213751.9AD69E85072@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Vipin Kumar, In message <83d1d72b0912182356u6b140b24g8ee1e97becc6285b@mail.gmail.com> you wrote: > > >> >> + /* Assume that all sectors are unprotected by default */ > >> >> + for (i = 0; i < CONFIG_SYS_MAX_FLASH_SECT; i++) > >> >> + info->protect[i] = 0; > >> > > >> > Um... is this assumption correct? > >> > >> It is intentional > > > > Why don;t you protect sectors where the U-Bootimage and environment > > are stored? > > Since the code is being developed for a development board, erasing and > flashing the uboot is frequent. This is done only to save unprotect every > time before erasing/flashing uboot That's what I expected. Please do add proper protection, so that everybody who copies the code for a real production board has a sane implementation. If you are worried about having to type too many commands for update, please consider pre-defining useful macros like we do in so many other boards; for example: "include/configs/aria.h": "u-boot=aria/u-boot.bin\0" ... "load=tftp ${u-boot_addr_r} ${u-boot}\0" ... "update=protect off ${u-boot_addr} +${filesize};" \ "era ${u-boot_addr} +${filesize};" \ "cp.b ${u-boot_addr_r} ${u-boot_addr} ${filesize}\0" so you only have to type "run load update". 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 "Unix is simple, but it takes a genius to understand the simplicity." - Dennis Ritchie