[U-Boot] fw_setenv on protected flash

Some of your recent cfi flash driver enhancements have made flash protect/unprotect work on our NOR based platforms (S29GL512). Good news so far, but as a consequence fw_setenv is woking no more: MTD erase error on /dev/mtd5: Input/output error Error: can't write fw_env to flash
Also flash_unlock from mtd_utils is not doing the trick: Could not unlock MTD device: /dev/mtd5
Unprotecting flash in u-boot before booting linux makes this work, but this is probably no good idea.
So what is the recommended workflow for fw_setenv on protected flash?
Cheers Dirk ------------------------------------------------------------------------------------------------ Messe-Highlights 2013. Wir freuen uns auf Ihren Besuch.
Broadcast Video Expo 2013 London - 26.02. bis 28.02.2013 - Stand B22
CeBIT 2013 In Hannover - 05.03. bis 09.03.2012 - Halle 11, Stand D31
ATC Global 2013 Amsterdam - 12.03. bis 14.03.2012 - Halle 10, Stand D202 ------------------------------------------------------------------------------------------------ Besuchen Sie unseren Blog auf http://blog.gdsys.de
oder folgen Sie uns auf: twitter: http://twitter.com/#!/gdsys facebook: http://www.facebook.com/pages/Guntermann-Drunck-GmbH/318396891518396 Google+ : https://plus.google.com/100228872787564309232/ YouTube: http://www.youtube.com/user/GuntermannDrunck ------------------------------------------------------------------------------------------------ Guntermann & Drunck GmbH Systementwicklung Dortmunder Str. 4a D-57234 Wilnsdorf - Germany Tel: +49 (0) 27 39 / 89 01 - 100 Fax: +49 (0) 27 39 / 89 01 - 120 E-Mail: sales@gdsys.de - Web: www.gdsys.de ------------------------------------------------------------------------------------------------ Geschaftsfuhrer: Udo Guntermann - Martin Drunck - Reiner Ruelmann HRB 2884, Amtsgericht Siegen - WEEE-Reg.-Nr. DE30763240 USt.-Id.-Nr. DE 126575222 - Steuer-Nr. 342 / 5835 / 1041 ------------------------------------------------------------------------------------------------ DQS-zertifiziert nach ISO 9001:2008 ------------------------------------------------------------------------------------------------

Hi Dirk,
On 22.02.2013 09:18, Eibach, Dirk wrote:
Some of your recent cfi flash driver enhancements have made flash protect/unprotect work on our NOR based platforms (S29GL512). Good news so far, but as a consequence fw_setenv is woking no more: MTD erase error on /dev/mtd5: Input/output error Error: can't write fw_env to flash
Also flash_unlock from mtd_utils is not doing the trick: Could not unlock MTD device: /dev/mtd5
Unprotecting flash in u-boot before booting linux makes this work, but this is probably no good idea.
So what is the recommended workflow for fw_setenv on protected flash?
Linux support for this enhanced sector protection (PPB) has just been accepted into mainline Linux. You need include this patch if you are working with an older kernel version:
http://patchwork.ozlabs.org/patch/213602/
And you also need to enable this feature in your dts file as described in the patch description.
Thanks, Stefan

Hi Stefan,
Some of your recent cfi flash driver enhancements have made flash protect/unprotect work on our NOR based platforms (S29GL512). Good news so far, but as a consequence fw_setenv is woking no more: MTD erase error on /dev/mtd5: Input/output error Error: can't write fw_env to flash
Also flash_unlock from mtd_utils is not doing the trick: Could not unlock MTD device: /dev/mtd5
Unprotecting flash in u-boot before booting linux makes
this work, but
this is probably no good idea.
So what is the recommended workflow for fw_setenv on
protected flash?
Linux support for this enhanced sector protection (PPB) has just been accepted into mainline Linux. You need include this patch if you are working with an older kernel version:
http://patchwork.ozlabs.org/patch/213602/
And you also need to enable this feature in your dts file as described in the patch description.
Ah, thanks a lot.
So the recommended workflow (with patch and dts changes applied) would be: flash_unlock fw_setenv flash_lock ?
Cheers Dirk

On 22.02.2013 10:15, Eibach, Dirk wrote:
Linux support for this enhanced sector protection (PPB) has just been accepted into mainline Linux. You need include this patch if you are working with an older kernel version:
http://patchwork.ozlabs.org/patch/213602/
And you also need to enable this feature in your dts file as described in the patch description.
Ah, thanks a lot.
So the recommended workflow (with patch and dts changes applied) would be: flash_unlock fw_setenv flash_lock ?
No. Unlocking and re-locking is already integrated into the fw_xxx tool. So just apply the patch and everything should work as usually.
Thanks, Stefan
participants (2)
-
Eibach, Dirk
-
Stefan Roese