mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Stefan Riedmueller <s.riedmueller@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] nvmem: ocotp: Fix writing of second mac address fuses on imx6ul
Date: Thu, 3 Jan 2019 12:01:04 +0100	[thread overview]
Message-ID: <20190103110104.7dvssb3qnqh5y2sj@pengutronix.de> (raw)
In-Reply-To: <1545228423-7461-1-git-send-email-s.riedmueller@phytec.de>

On Wed, Dec 19, 2018 at 03:07:03PM +0100, Stefan Riedmueller wrote:
> Commit 19a32c0f6bf0 ("nvmem: ocotp: Add support for second mac address
> fuses on imx6ul") added support for correctly reading the second MAC
> address from fuses of the i.MX 6UL/ULL but not for writing. So also fit
> writing of the second MAC address fuses to the correct method.
> 
> Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
> ---
>  drivers/nvmem/ocotp.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/nvmem/ocotp.c b/drivers/nvmem/ocotp.c
> index e0cf35f0b73c..d904bd08f0c5 100644
> --- a/drivers/nvmem/ocotp.c
> +++ b/drivers/nvmem/ocotp.c
> @@ -446,9 +446,18 @@ static int imx_ocotp_set_mac(struct param_d *param, void *priv)
>  {
>  	char buf[MAC_BYTES];
>  	struct ocotp_priv_ethaddr *ethaddr = priv;
> +	int ret;
>  
> -	ethaddr->data->format_mac(buf, ethaddr->value,
> -				  OCOTP_MAC_TO_HW);
> +	ret = regmap_bulk_read(ethaddr->map, ethaddr->offset, buf, MAC_BYTES);
> +	if (ret < 0)
> +		return ret;
> +
> +	if (ethaddr->offset != IMX6UL_MAC_OFFSET_1)
> +		ethaddr->data->format_mac(buf, ethaddr->value,
> +					  OCOTP_MAC_TO_HW);
> +	else
> +		ethaddr->data->format_mac(buf + 2, ethaddr->value,
> +					  OCOTP_MAC_TO_HW);
>  
>  	return regmap_bulk_write(ethaddr->map, ethaddr->offset,
>  				 buf, MAC_BYTES);
> -- 
> 2.7.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2019-01-03 11:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-19 14:07 Stefan Riedmueller
2019-01-03 11:01 ` Sascha Hauer [this message]

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=20190103110104.7dvssb3qnqh5y2sj@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.riedmueller@phytec.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox