From: Bastian Krause <bst@pengutronix.de>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH v3 3/4] nvmem: ocotp: set unique id as machine-id hashable
Date: Wed, 25 Sep 2019 10:54:41 +0200 [thread overview]
Message-ID: <08e62315-25d1-71e3-b804-24be46c84d55@pengutronix.de> (raw)
In-Reply-To: <CAHQ1cqGrgqbTMGwRbNBVZZmPh+5gL3+qusKwNC6Q9iP9zoRweQ@mail.gmail.com>
Hey Andrey,
On 9/24/19 7:18 PM, Andrey Smirnov wrote:
> On Tue, Sep 24, 2019 at 6:29 AM Bastian Krause <bst@pengutronix.de> wrote:
>>
>> Pass the OCOTP unique id as hashable information to machine id
>> generation.
>>
>> Signed-off-by: Bastian Krause <bst@pengutronix.de>
>> ---
>> drivers/nvmem/ocotp.c | 24 ++++++++++++++++++++++++
>> 1 file changed, 24 insertions(+)
>>
>> diff --git a/drivers/nvmem/ocotp.c b/drivers/nvmem/ocotp.c
>> index 3f9f162860..d5e9d72a52 100644
>> --- a/drivers/nvmem/ocotp.c
>> +++ b/drivers/nvmem/ocotp.c
>> @@ -29,6 +29,7 @@
>> #include <regmap.h>
>> #include <linux/clk.h>
>> #include <mach/ocotp.h>
>> +#include <machine_id.h>
>> #include <linux/nvmem-provider.h>
>>
>> /*
>> @@ -77,6 +78,9 @@
>> #define MAC_OFFSET_1 (0x24 * 4)
>> #define MAX_MAC_OFFSETS 2
>> #define MAC_BYTES 8
>> +#define UNIQUE_ID_NUM 2
>> +/* 0 <= n < UNIQUE_ID_NUM */
>> +#define UNIQUE_ID(n) (OCOTP_WORD(0x410 + 0x10 * (n)) | OCOTP_BIT(0) | OCOTP_WIDTH(32))
>
> There already OCOTP_UNIQUE_ID() in
> arch/arm/mach-imx/include/mach/ocotp-fusemap.h might make sense to
> re-use it.
Yes.
>
>>
>> enum imx_ocotp_format_mac_direction {
>> OCOTP_HW_TO_MAC,
>> @@ -548,6 +552,23 @@ static int imx_ocotp_read(struct device_d *dev, const int offset, void *val,
>> return regmap_bulk_read(priv->map, offset, val, bytes);
>> }
>>
>> +static int imx_ocotp_set_unique_machine_id(void)
>
> The return value of this function is not used anywhere in this patch.
> Maybe it would make sense to convert it to void and simplify the rest
> of the code?
You're right, will include it in v4.
Thanks!
Regards,
Bastian
--
Pengutronix e.K.
Industrial Linux Solutions
http://www.pengutronix.de/
Peiner Str. 6-8, 31137 Hildesheim, Germany
Amtsgericht Hildesheim, HRA 2686
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2019-09-25 8:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-24 13:29 [PATCH v3 0/4] Machine ID Support Bastian Krause
2019-09-24 13:29 ` [PATCH v3 1/4] digest.h: needs errno definitions Bastian Krause
2019-09-24 13:29 ` [PATCH v3 2/4] common: machine_id: introduce machine id generation Bastian Krause
2019-09-24 13:29 ` [PATCH v3 3/4] nvmem: ocotp: set unique id as machine-id hashable Bastian Krause
2019-09-24 17:18 ` Andrey Smirnov
2019-09-25 8:54 ` Bastian Krause [this message]
2019-09-24 13:29 ` [PATCH v3 4/4] bootm: allow providing machine id to Kernel Bastian Krause
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=08e62315-25d1-71e3-b804-24be46c84d55@pengutronix.de \
--to=bst@pengutronix.de \
--cc=andrew.smirnov@gmail.com \
--cc=barebox@lists.infradead.org \
/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