All of lore.kernel.org
 help / color / mirror / Atom feed
From: Holger Brunck <holger.brunck@keymile.com>
To: Stefan Roese <sr@denx.de>
Cc: devicetree-discuss@ozlabs.org, linux-mtd@lists.infradead.org,
	Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: [PATCH] mtd: cfi_cmdset_0002: Support Persistent Protection Bits (PPB) locking
Date: Fri, 07 Dec 2012 11:41:58 +0100	[thread overview]
Message-ID: <50C1C7F6.9010504@keymile.com> (raw)
In-Reply-To: <1354864954-30290-1-git-send-email-sr@denx.de>

Hi Stefan,

On 12/07/2012 08:22 AM, Stefan Roese wrote:
> Currently cfi_cmdset_0002.c does not support PPB locking of sectors. This
> patch adds support for this locking/unlocking mechanism. It is needed on
> some platforms, since newer U-Boot versions do support this PPB locking
> and protect for example their environment sector(s) this way.
> 
> This PPB locking/unlocking will be enabled for all devices supported by
> cfi_cmdset_0002 reporting 8 in the CFI word 0x49 (Sector Protect/Unprotect
> scheme).
> 
> Please note that PPB locking does support sector-by-sector locking. But
> the whole chip can only be unlocked together. So unlocking one sector
> will automatically unlock all sectors of this device. Because of this
> chip limitation, the PPB unlocking function saves the current locking
> status of all sectors before unlocking the whole device. After unlocking
> the saved locking status is re-configured. This way only the addressed
> sectors will be unlocked.
> 
> To selectively enable this advanced sector protection mechanism, the
> device-tree property "use-advanced-sector-protection" has been created.
> To enable support for this locking this property needs to be present in the
> flash DT node. E.g.:
> 
> nor_flash@0,0 {
> 	compatible = "amd,s29gl256n", "cfi-flash";
> 	bank-width = <2>;
> 	use-advanced-sector-protection;
> 	...
> 
> Tested with Spanion S29GL512S10THI and Micron JS28F512M29EWx flash
> devices.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Holger Brunck <holger.brunck@keymile.com>
> Cc: Artem Bityutskiy <dedekind1@gmail.com>
> ---
>  .../devicetree/bindings/mtd/mtd-physmap.txt        |   3 +
>  drivers/mtd/chips/cfi_cmdset_0002.c                | 211 +++++++++++++++++++++
>  drivers/mtd/maps/physmap_of.c                      |   1 +
>  include/linux/mtd/map.h                            |   1 +
>  4 files changed, 216 insertions(+)
> 

Tested-by: Holger Brunck <holger.brunck@keymile.com>

with an Spanion S29GL512S10THI.

Regards
Holger

WARNING: multiple messages have this Message-ID (diff)
From: Holger Brunck <holger.brunck@keymile.com>
To: Stefan Roese <sr@denx.de>
Cc: devicetree-discuss@ozlabs.org, linux-mtd@lists.infradead.org,
	Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: [PATCH] mtd: cfi_cmdset_0002: Support Persistent Protection Bits (PPB) locking
Date: Fri, 07 Dec 2012 11:41:58 +0100	[thread overview]
Message-ID: <50C1C7F6.9010504@keymile.com> (raw)
In-Reply-To: <1354864954-30290-1-git-send-email-sr@denx.de>

Hi Stefan,

On 12/07/2012 08:22 AM, Stefan Roese wrote:
> Currently cfi_cmdset_0002.c does not support PPB locking of sectors. This
> patch adds support for this locking/unlocking mechanism. It is needed on
> some platforms, since newer U-Boot versions do support this PPB locking
> and protect for example their environment sector(s) this way.
> 
> This PPB locking/unlocking will be enabled for all devices supported by
> cfi_cmdset_0002 reporting 8 in the CFI word 0x49 (Sector Protect/Unprotect
> scheme).
> 
> Please note that PPB locking does support sector-by-sector locking. But
> the whole chip can only be unlocked together. So unlocking one sector
> will automatically unlock all sectors of this device. Because of this
> chip limitation, the PPB unlocking function saves the current locking
> status of all sectors before unlocking the whole device. After unlocking
> the saved locking status is re-configured. This way only the addressed
> sectors will be unlocked.
> 
> To selectively enable this advanced sector protection mechanism, the
> device-tree property "use-advanced-sector-protection" has been created.
> To enable support for this locking this property needs to be present in the
> flash DT node. E.g.:
> 
> nor_flash@0,0 {
> 	compatible = "amd,s29gl256n", "cfi-flash";
> 	bank-width = <2>;
> 	use-advanced-sector-protection;
> 	...
> 
> Tested with Spanion S29GL512S10THI and Micron JS28F512M29EWx flash
> devices.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Holger Brunck <holger.brunck@keymile.com>
> Cc: Artem Bityutskiy <dedekind1@gmail.com>
> ---
>  .../devicetree/bindings/mtd/mtd-physmap.txt        |   3 +
>  drivers/mtd/chips/cfi_cmdset_0002.c                | 211 +++++++++++++++++++++
>  drivers/mtd/maps/physmap_of.c                      |   1 +
>  include/linux/mtd/map.h                            |   1 +
>  4 files changed, 216 insertions(+)
> 

Tested-by: Holger Brunck <holger.brunck@keymile.com>

with an Spanion S29GL512S10THI.

Regards
Holger

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2012-12-07 10:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-07  7:22 [PATCH] mtd: cfi_cmdset_0002: Support Persistent Protection Bits (PPB) locking Stefan Roese
2012-12-07  7:22 ` Stefan Roese
2012-12-07 10:41 ` Holger Brunck [this message]
2012-12-07 10:41   ` Holger Brunck
2012-12-10 15:00 ` Artem Bityutskiy
2012-12-10 15:00   ` Artem Bityutskiy
2012-12-10 18:40   ` Stefan Roese
2012-12-10 18:40     ` Stefan Roese
2012-12-12 15:25     ` Artem Bityutskiy
2012-12-12 15:25       ` Artem Bityutskiy
2012-12-12 15:44       ` Stefan Roese
2012-12-12 15:44         ` Stefan Roese

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=50C1C7F6.9010504@keymile.com \
    --to=holger.brunck@keymile.com \
    --cc=dedekind1@gmail.com \
    --cc=devicetree-discuss@ozlabs.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=sr@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 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.