All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/5] Add fuse API and commands
Date: Wed, 22 Aug 2012 18:25:57 +0200	[thread overview]
Message-ID: <50350815.1040406@gmail.com> (raw)
In-Reply-To: <122060610.2688957.1345633901706.JavaMail.root@advansee.com>

On 22.08.2012 13:11, Beno?t Th?baudeau wrote:
> Hi Dirk,
>
> On Wednesday, August 22, 2012 12:43:05 PM, Dirk Behme wrote:
>> On 14.08.2012 14:52, Beno?t Th?baudeau wrote:
>>> This can be useful for fuse-like hardware, OTP SoC options, etc.
>>
>> For i.MX6, I have a port of the OTP support from Freescale's U-Boot
>> to
>> our mainline U-Boot in the queue [1].
>>
>> As I don't have the overview over the various i.MXxx SoCs and don't
>> understand much of this patch below: Should this implement the same
>> functionality like my patch [1] for i.MX6?
>>
>> Or shall I send my patch [1] to this mailing list for official review
>> because the functionality here and there is orthogonal?
>>
>> Thanks
>>
>> Dirk
>>
>> [1]
>> https://github.com/dirkbehme/u-boot-imx6/commit/da718b338a79af160f7b7e542fe97b24edbfc36a
>
> This OTP IP is different from the IIM IP of other i.MXs, so having a different
> driver for it is fine.
>
> What you can do is implement in your driver the fuse API

You mean

http://lists.denx.de/pipermail/u-boot/2012-August/130904.html

here, correct?

>that I've defined in
> this series. In that way, you could drop your common/cmd_imxotp.c and use the
> commands from this series.

Let's see how this fits to i.MX6:

My understanding is that the i.MX6 has 128 fuse 'registers' (#define 
IMX_OTP_ADDR_MAX 0x7F), each containing 32 fuses/bits. These 
fuses/bits can be written from 0 -> 1 once.

Looking at your API [2] we could set 'bank' to 0 and interpret 'row' 
as the 'register' number. That might fit. Doing this, 
fuse_read_bit/row() and fuse_prog_bit/row() could be used for i.MX6.

 From i.MX6 point of view, as I don't know your use case, I'm not sure 
what fuse_sense_bit/row() and fuse_override_bit/row() might be good for?

Anybody else: Does this make sense? Or should we keep the i.MX6 
specific common/cmd_imxotp.c (see [1] above)?.

Best regards

Dirk

[2]

+ * Read/Sense/Program/Override interface:
+ *   bank:    Fuse bank
+ *   row:     Fuse row within the bank
+ *   bit:     Fuse bit within the row
+ *   val:     Value to read/write
+ *
+ *   Returns: 0 on success, not 0 on failure
+ */
+int fuse_read_bit(u32 bank, u32 row, u32 bit, u32 *val);
+int fuse_read_row(u32 bank, u32 row, u32 *val);
+int fuse_sense_bit(u32 bank, u32 row, u32 bit, u32 *val);
+int fuse_sense_row(u32 bank, u32 row, u32 *val);
+int fuse_prog_bit(u32 bank, u32 row, u32 bit);
+int fuse_prog_row(u32 bank, u32 row, u32 val);
+int fuse_override_bit(u32 bank, u32 row, u32 bit, u32 val);
+int fuse_override_row(u32 bank, u32 row, u32 val);

  reply	other threads:[~2012-08-22 16:25 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14 12:51 [U-Boot] [PATCH 0/5] Make iim support common to mpc and imx Benoît Thébaudeau
2012-08-14 12:52 ` [U-Boot] [PATCH 1/5] imx iim: Homogenize and fix register definitions Benoît Thébaudeau
2012-11-27 13:30   ` [U-Boot] [PATCH v2 " Benoît Thébaudeau
2012-11-27 13:30     ` [U-Boot] [PATCH v2 2/5] imx iim: Add useful fuse definitions Benoît Thébaudeau
2012-11-27 13:31     ` [U-Boot] [PATCH v2 3/5] Add fuse API and commands Benoît Thébaudeau
2012-11-27 13:31     ` [U-Boot] [PATCH v2 4/5] Add fsl_iim driver Benoît Thébaudeau
2012-11-27 13:32     ` [U-Boot] [PATCH v2 5/5] mpc iim: Switch to common fsl_iim Benoît Thébaudeau
2013-03-18 12:07     ` [U-Boot] [PATCH v2 1/5] imx iim: Homogenize and fix register definitions Stefano Babic
2013-03-18 12:08       ` Benoît Thébaudeau
2013-03-18 12:13         ` Benoît Thébaudeau
2012-08-14 12:52 ` [U-Boot] [PATCH 2/5] imx iim: Add useful fuse definitions Benoît Thébaudeau
2012-08-14 12:52 ` [U-Boot] [PATCH 3/5] Add fuse API and commands Benoît Thébaudeau
2012-08-21  8:11   ` Stefano Babic
2012-08-21 10:14     ` Benoît Thébaudeau
2012-08-22 10:43   ` Dirk Behme
2012-08-22 11:11     ` Benoît Thébaudeau
2012-08-22 16:25       ` Dirk Behme [this message]
2012-08-22 16:53         ` Benoît Thébaudeau
2012-08-23 10:31     ` Stefano Babic
2012-08-23 13:23       ` Eric Nelson
2012-11-26 16:03         ` Benoît Thébaudeau
2012-11-27  7:19           ` Dirk Behme
2012-11-27 16:58             ` Eric Nelson
2012-11-27 18:27               ` Benoît Thébaudeau
2012-11-27 18:36                 ` Eric Nelson
2012-11-27 19:23                   ` Benoît Thébaudeau
2012-11-27 19:54                     ` Eric Nelson
2012-12-03  9:03   ` Stefano Babic
2012-12-03 11:25     ` Benoît Thébaudeau
2012-12-03 11:41       ` Stefano Babic
2012-08-14 12:52 ` [U-Boot] [PATCH 4/5] Add fsl_iim driver Benoît Thébaudeau
2012-08-21  8:13   ` Stefano Babic
2012-08-21 12:56     ` Benoît Thébaudeau
2012-08-21 13:41       ` Stefano Babic
2012-08-14 12:53 ` [U-Boot] [PATCH 5/5] mpc iim: Switch to common fsl_iim Benoît Thébaudeau
2012-08-15 14:30   ` Benoît Thébaudeau
2012-08-21  8:15   ` Stefano Babic
2012-11-05 20:05     ` Benoît Thébaudeau

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=50350815.1040406@gmail.com \
    --to=dirk.behme@gmail.com \
    --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 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.