All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Shiyan <shc_work@mail.ru>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 6/6] PCM038: Read UID from fuses and pass this value to kernel as serial number
Date: Thu, 19 Jul 2012 20:12:52 +0200	[thread overview]
Message-ID: <20120719181252.GF30009@pengutronix.de> (raw)
In-Reply-To: <1342711817-866-6-git-send-email-shc_work@mail.ru>

On Thu, Jul 19, 2012 at 07:30:17PM +0400, Alexander Shiyan wrote:
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  arch/arm/boards/pcm038/pcm038.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
> index 5b0afc3..1bdb93c 100644
> --- a/arch/arm/boards/pcm038/pcm038.c
> +++ b/arch/arm/boards/pcm038/pcm038.c
> @@ -40,6 +40,7 @@
>  #include <mach/spi.h>
>  #include <mach/iomux-mx27.h>
>  #include <mach/devices-imx27.h>
> +#include <mach/iim.h>
>  #include <mfd/mc13xxx.h>
>  
>  #include "pll.h"
> @@ -193,6 +194,7 @@ mem_initcall(pcm038_mem_init);
>  static int pcm038_devices_init(void)
>  {
>  	int i;
> +	u64 uid;

The upper two bytes of uid are used unitialized.

>  	char *envdev;
>  
>  	unsigned int mode[] = {
> @@ -316,6 +318,8 @@ static int pcm038_devices_init(void)
>  
>  	printf("Using environment in %s Flash\n", envdev);
>  
> +	if (imx_iim_read(1, 1, &uid, 6) == 6)
> +		armlinux_set_serial(uid);

With this patch I just realized that my serial becomes:

-6345008925011607552

Having negative numbers here is a bit odd. Looking at it export_env_ull
does:

        char *valstr = asprintf("%lld", val);

Which clearly is a signed number. Maybe this should be changed to "0x%016llx"
(which of course is not your fault)

Sascha


-- 
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:[~2012-07-19 18:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-19 15:30 [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver Alexander Shiyan
2012-07-19 15:30 ` [PATCH 2/6] i.MX: Removed unused declaration for imx_iim_get_mac Alexander Shiyan
2012-07-19 15:30 ` [PATCH 3/6] mc13xxx: Added dummy definition for mc13xxx_get() if CONFIG_MFD_MC13XXX is not set Alexander Shiyan
2012-07-19 17:56   ` Sascha Hauer
2012-07-20  8:08     ` Re[2]: " Alexander Shiyan
2012-07-19 15:30 ` [PATCH 4/6] tx51: Unused mc13xxx.h include removed Alexander Shiyan
2012-07-19 15:30 ` [PATCH 5/6] PCM970: Add MMC support Alexander Shiyan
2012-07-19 15:30 ` [PATCH 6/6] PCM038: Read UID from fuses and pass this value to kernel as serial number Alexander Shiyan
2012-07-19 18:12   ` Sascha Hauer [this message]
2012-07-19 18:48     ` Re[2]: " Alexander Shiyan
2012-07-19 18:49     ` Alexander Shiyan
2012-07-19 17:55 ` [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver Sascha Hauer
2012-07-20  8:05   ` Re[2]: " Alexander Shiyan
2012-07-20  8:11     ` Sascha Hauer
2012-07-20  8:17       ` Re[2]: " Alexander Shiyan
2012-07-20  7:46 ` Sascha Hauer

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=20120719181252.GF30009@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=shc_work@mail.ru \
    /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.