beagleboard unique identifier

53 views
Skip to first unread message

Marc

unread,
Nov 19, 2009, 1:54:39 PM11/19/09
to beagl...@googlegroups.com
Hello, I need to get a unique identifier for each Beagleboard in order to automate installations, I've seen in u-boot there is a "Die ID", but with /proc/cpuinfo I get the Serial number empty.
Is the "Die ID" really a unique identifier or it only differentiates from one revision to another?
Is there anyway to retrieve a unique identifier from userspace?

Thank's

--
Marc.

Steve

unread,
Nov 19, 2009, 2:02:25 PM11/19/09
to beagl...@googlegroups.com

What about the MAC address?

Pawel Potera

unread,
Nov 19, 2009, 2:17:00 PM11/19/09
to beagl...@googlegroups.com
You're assuming that there is an ethernet adapter attached. :)

What if this is some sort of installation via MMC card?

I don't think the kernel even reads the Die ID on OMAP3 (yes, it's
unique). This might help:

http://lxr.linux.no/#linux+v2.6.31/arch/arm/mach-omap2/id.c
> --
>
> You received this message because you are subscribed to the Google
> Groups "Beagle Board" group.
> To post to this group, send email to beagl...@googlegroups.com.
> To unsubscribe from this group, send email to
> beagleboard...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/beagleboard?hl=.

Pawel Potera

unread,
Nov 19, 2009, 2:25:11 PM11/19/09
to beagl...@googlegroups.com
There is a patch for it, though.

http://patchwork.kernel.org/patch/53143/

Marc

unread,
Nov 19, 2009, 2:49:33 PM11/19/09
to beagl...@googlegroups.com
Thank's Pawel, you are right, I don't wan't to assume I have an ethernet connected.
Sorry but I'm not very familiar with kernel and sysfs, I'm currently using angstrom-distribution with kernel 2.6.29-r48, I've located id.c under the kernel sources but I don't know if its defined in the defconfig file, I can't find the option from reading the id.c file. I also don't know if I need the patch or not.
And if I have already built into the kernel I can't find it under /sys

Could you tell me what to look for?

Thank's

--

You received this message because you are subscribed to the Google Groups "Beagle Board" group.
To post to this group, send email to beagl...@googlegroups.com.
To unsubscribe from this group, send email to beagleboard...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/beagleboard?hl=.





--
Marc.

Pawel Potera

unread,
Nov 19, 2009, 3:02:55 PM11/19/09
to beagl...@googlegroups.com
Can you try the following and see what happens?

mount -t sysfs sysfs /sys

Then look in /sys.

id.c is definitely compiled into your kernel.
> <mailto:beagl...@googlegroups.com>.
> To unsubscribe from this group, send email to
> beagleboard...@googlegroups.com
> <mailto:beagleboard%2Bunsu...@googlegroups.com>.

Pawel Potera

unread,
Nov 19, 2009, 3:11:31 PM11/19/09
to beagl...@googlegroups.com
I think I misread your email. I though you somehow didn't have /sys.
If you do have the patch applied and you recompile the kernel, you
should be able to look in /sys/power for the die ID.

Brad Badke

unread,
Nov 19, 2009, 3:39:40 PM11/19/09
to beagl...@googlegroups.com

Each OMAP has a unique 128 bit ID. The following code will print it out.

 

#define CONTROL_ID_CODE_ADDR 0x4830A204  //VERSION Bits [31:28], HAWKEYE Bits [27:12] (Silicon Type)

#define CONTROL_DIE_ID_0 0x4830A218

#define CONTROL_DIE_ID_1 0x4830A21C

#define CONTROL_DIE_ID_2 0x4830A220

#define CONTROL_DIE_ID_3 0x4830A224

 

            unsigned int regVal0, regVal1, regVal2, regVal3;

             regVal0 = *(unsigned int*)CONTROL_ID_CODE_ADDR;

             serial_printf("VERSION %x\r\n",0xf&(regVal0>>28));

            serial_printf("HAWKEYE %x\r\n",0xffff&(regVal0>>12));

//Print out the unique 128 bit ID for this CPU

            regVal3 = *(unsigned int*)CONTROL_DIE_ID_3;

            regVal2 = *(unsigned int*)CONTROL_DIE_ID_2;

            regVal1 = *(unsigned int*)CONTROL_DIE_ID_1;

            regVal0 = *(unsigned int*)CONTROL_DIE_ID_0;

            serial_printf("Serial # %08x%08x%08x%08x\r\n",regVal3,regVal2,regVal1,regVal0);

 

Regards,

 

Brad Badke

 

Hemisphere GPS

8444 N 90th St #130

Scottsdale, AZ  85258

Direct: 480-348-6323

Fax: 480-348-6370

bba...@hemispheregps.com

www.hemispheregps.com


--

Marc

unread,
Nov 19, 2009, 6:17:27 PM11/19/09
to beagl...@googlegroups.com
Sorry Brad, isn't this code for u-boot?
Can I make a simple C program and run it to get the ID from userspace?
isn't serial_printf a function to print out serial port?
 
As you see I have way to many questions :-)

And following the thread I also have another question for Pawel, I didn't apply the patch but It looks like the code is already in id.c under the kernel tree, what I don't know is which option I have to select when I compile it.
Under /sys/power I only have:
clocks_off_while_idle
pm_test
sleep_while_idle
state



Thank you both.
--
Marc.

Cameron Stone

unread,
Nov 19, 2009, 6:41:31 PM11/19/09
to beagl...@googlegroups.com
On Fri, 20 Nov 2009 06:25:11 am Pawel Potera wrote:
> There is a patch for it, though.
>
> http://patchwork.kernel.org/patch/53143/

This patch works for me on the 2.6.31 kernel with power management enabled
(from https://code.launchpad.net/~beagleboard-kernel/+junk/2.6-dev).

$ cat /sys/power/idcode # numbers changed to protect the guilty
IDCODE: deadbeef
Production ID: 00000000 00000003 000000f0 deadbeef
Die ID: cafefeed cafebeef 00000000 deadbeef

Thanks

Cameron Stone

unread,
Nov 19, 2009, 6:44:25 PM11/19/09
to beagl...@googlegroups.com
On Fri, 20 Nov 2009 10:17:27 am Marc wrote:
> And following the thread I also have another question for Pawel, I didn't
> apply the patch but It looks like the code is already in id.c under the
> kernel tree, what I don't know is which option I have to select when I
> compile it.

There is similar code, but not the magic sysfs_create_file part. Try applying
the patch and rebuild. It worked for me. I now have a /sys/power/idcode file,
filled with id information.

Cameron.

Marc

unread,
Dec 21, 2009, 7:02:03 AM12/21/09
to beagl...@googlegroups.com
Hello again, It's been a while but I finally had time to try this.
The patch works fine and now I get the file /sys/power/idcode

This file has

IDCODE: 3b7ae02f
Production ID: 00000000 00000003 000000f0 cafeb7ae
Die ID: 0e01801f 04032309 00000000 0eca0003

which is simmilar to the Die ID that outputs before it enters uboot (its actually the same whith some bytes in different order)

Is there any relation between any of this numbers and the serial ID printed on the board? I've tryied many combinations with mine but they seem unrelated.


--

You received this message because you are subscribed to the Google Groups "Beagle Board" group.
To post to this group, send email to beagl...@googlegroups.com.
To unsubscribe from this group, send email to beagleboard...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/beagleboard?hl=.





--
Marc.

Gerald Coley

unread,
Dec 21, 2009, 7:16:27 AM12/21/09
to beagl...@googlegroups.com
There is no relation whatsoever.
 
Gerald

For more options, visit this group at http://groups.google.com/group/beagleboard?hl=en.

Reply all
Reply to author
Forward
0 new messages