Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-08-27 Thread Maxime Ripard
On Tue, Aug 27, 2013 at 04:13:04PM +0200, oliver+l...@schinagl.nl wrote: > From: Oliver Schinagl > > Allwinner has electric fuses (efuse) on their line of chips. This driver > reads those fuses, seeds the kernel entropy and exports them as a sysfs > node. > > These fuses are most likly to be pro

[PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-08-27 Thread oliver+list
From: Oliver Schinagl Allwinner has electric fuses (efuse) on their line of chips. This driver reads those fuses, seeds the kernel entropy and exports them as a sysfs node. These fuses are most likly to be programmed at the factory, encoding things like Chip ID, some sort of serial number etc an

Re: [linux-sunxi] Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-07-30 Thread Oliver Schinagl
On 30-07-13 16:20, Greg KH wrote: On Tue, Jul 30, 2013 at 03:22:55PM +0200, Oliver Schinagl wrote: Let me go look at how I can make this work "easier", give me a few days. Not wanting to be rude, but it has been a little more then a few days, any progress? Just want to know what I have to modif

Re: [linux-sunxi] Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-07-30 Thread Greg KH
On Tue, Jul 30, 2013 at 03:22:55PM +0200, Oliver Schinagl wrote: > >Let me go look at how I can make this work "easier", give me a few days. > Not wanting to be rude, but it has been a little more then a few > days, any progress? Just want to know what I have to modify my > driver to so it can go i

Re: [linux-sunxi] Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-07-30 Thread Oliver Schinagl
Hey Greg! On 20-07-13 01:49, Greg KH wrote: On Fri, Jul 19, 2013 at 11:42:11AM +0200, Maxime Ripard wrote: On Wed, Jul 17, 2013 at 09:17:58AM -0700, Greg KH wrote: On Wed, Jul 17, 2013 at 01:46:50PM +0200, Maxime Ripard wrote: On Mon, Jul 15, 2013 at 11:41:07PM -0700, Greg KH wrote: On Mon,

Re: [linux-sunxi] Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-07-19 Thread Greg KH
On Fri, Jul 19, 2013 at 11:42:11AM +0200, Maxime Ripard wrote: > On Wed, Jul 17, 2013 at 09:17:58AM -0700, Greg KH wrote: > > On Wed, Jul 17, 2013 at 01:46:50PM +0200, Maxime Ripard wrote: > > > On Mon, Jul 15, 2013 at 11:41:07PM -0700, Greg KH wrote: > > > > On Mon, Jul 15, 2013 at 11:16:19PM +020

Re: [linux-sunxi] Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-07-19 Thread Maxime Ripard
On Wed, Jul 17, 2013 at 09:17:58AM -0700, Greg KH wrote: > On Wed, Jul 17, 2013 at 01:46:50PM +0200, Maxime Ripard wrote: > > On Mon, Jul 15, 2013 at 11:41:07PM -0700, Greg KH wrote: > > > On Mon, Jul 15, 2013 at 11:16:19PM +0200, Oliver Schinagl wrote: > > > > So using these new patches for binary

Re: [linux-sunxi] Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-07-17 Thread Greg KH
On Wed, Jul 17, 2013 at 01:46:50PM +0200, Maxime Ripard wrote: > On Mon, Jul 15, 2013 at 11:41:07PM -0700, Greg KH wrote: > > On Mon, Jul 15, 2013 at 11:16:19PM +0200, Oliver Schinagl wrote: > > > So using these new patches for binary attributes, how can I pass data > > > between my driver and the

Re: [linux-sunxi] Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-07-17 Thread Maxime Ripard
On Mon, Jul 15, 2013 at 11:41:07PM -0700, Greg KH wrote: > On Mon, Jul 15, 2013 at 11:16:19PM +0200, Oliver Schinagl wrote: > > So using these new patches for binary attributes, how can I pass data > > between my driver and the sysfs files using a platform_driver? Or are > > other 'hacks' needed

Re: [linux-sunxi] Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-07-16 Thread Greg KH
On Tue, Jul 16, 2013 at 11:02:22PM +0200, Oliver Schinagl wrote: > On 07/16/13 08:41, Greg KH wrote: > > On Mon, Jul 15, 2013 at 11:16:19PM +0200, Oliver Schinagl wrote: > >> With your latest patches for binary attributes and your blog post, I > >> thought that you want to create your binary attrib

Re: [linux-sunxi] Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-07-16 Thread Oliver Schinagl
On 07/16/13 08:41, Greg KH wrote: On Mon, Jul 15, 2013 at 11:16:19PM +0200, Oliver Schinagl wrote: With your latest patches for binary attributes and your blog post, I thought that you want to create your binary attributes before the probe function, to avoid the userspace race. To do that, we ha

Re: [linux-sunxi] Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-07-16 Thread Greg KH
On Mon, Jul 15, 2013 at 11:16:19PM +0200, Oliver Schinagl wrote: > > With your latest patches for binary attributes and your blog post, I > thought that you want to create your binary attributes before the probe > function, to avoid the userspace race. To do that, we have two options, > create

Re: [linux-sunxi] Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-07-15 Thread Oliver Schinagl
On 07/06/13 21:36, Greg KH wrote: On Fri, Jul 05, 2013 at 09:24:47AM +0200, Oliver Schinagl wrote: The other 'broken' drivers that where linked earlier, also use the BINARY attributes. So Greg, if you could be so kind and give me an example how to implement this properly, I am at loss and don't

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-07-06 Thread Greg KH
On Sat, Jul 06, 2013 at 12:36:46PM -0700, Greg KH wrote: > On Fri, Jul 05, 2013 at 09:24:47AM +0200, Oliver Schinagl wrote: > > The other 'broken' drivers that where linked earlier, also use the > > BINARY attributes. > > > > So Greg, if you could be so kind and give me an example how to > > imple

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-07-06 Thread Greg KH
On Fri, Jul 05, 2013 at 09:24:47AM +0200, Oliver Schinagl wrote: > The other 'broken' drivers that where linked earlier, also use the > BINARY attributes. > > So Greg, if you could be so kind and give me an example how to > implement this properly, I am at loss and don't know :( Ah crap, devices

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-07-05 Thread Oliver Schinagl
Hey Greg, Thanks for the blog post :) it was very helpful and at least something good came from the less-nice bit of the discussion, but: On 26-06-13 19:51, Greg KH wrote: On Wed, Jun 26, 2013 at 10:32:09AM +0200, Oliver Schinagl wrote: On 24-06-13 23:46, Greg KH wrote: On Mon, Jun 24, 2013

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-26 Thread Greg KH
On Wed, Jun 26, 2013 at 10:32:09AM +0200, Oliver Schinagl wrote: > On 24-06-13 23:46, Greg KH wrote: > >On Mon, Jun 24, 2013 at 11:21:16PM +0200, Oliver Schinagl wrote: > >>On 06/24/13 20:15, Greg KH wrote: > >>>On Mon, Jun 24, 2013 at 07:11:35PM +0200, Oliver Schinagl wrote: > Hey Greg, >

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-26 Thread Greg KH
On Wed, Jun 26, 2013 at 10:10:33AM +0100, Russell King - ARM Linux wrote: > On Mon, Jun 24, 2013 at 02:46:15PM -0700, Greg KH wrote: > > Stick with a binary attribute, and attach that to the proper class > > structure and all should be fine. > > > > Ah crap, you're using a platform device. > > >

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-26 Thread Greg KH
On Wed, Jun 26, 2013 at 11:22:30AM +0200, Geert Uytterhoeven wrote: > On Mon, Jun 24, 2013 at 6:04 PM, Greg KH wrote: > > On Mon, Jun 24, 2013 at 11:29:42AM +0200, Maxime Ripard wrote: > >> On Mon, Jun 17, 2013 at 03:58:47PM -0700, Greg KH wrote: > >> > On Mon, Jun 17, 2013 at 10:59:37PM +0200, Ol

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-26 Thread Geert Uytterhoeven
On Mon, Jun 24, 2013 at 6:04 PM, Greg KH wrote: > On Mon, Jun 24, 2013 at 11:29:42AM +0200, Maxime Ripard wrote: >> On Mon, Jun 17, 2013 at 03:58:47PM -0700, Greg KH wrote: >> > On Mon, Jun 17, 2013 at 10:59:37PM +0200, Oliver Schinagl wrote: >> > > +static int __init sunxi_sid_probe(struct platfo

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-26 Thread Russell King - ARM Linux
On Mon, Jun 24, 2013 at 02:46:15PM -0700, Greg KH wrote: > Stick with a binary attribute, and attach that to the proper class > structure and all should be fine. > > Ah crap, you're using a platform device. > > {sigh} > > Why? Why not use a "real" device which has a "real" class, and then use >

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-26 Thread Oliver Schinagl
On 24-06-13 23:46, Greg KH wrote: On Mon, Jun 24, 2013 at 11:21:16PM +0200, Oliver Schinagl wrote: On 06/24/13 20:15, Greg KH wrote: On Mon, Jun 24, 2013 at 07:11:35PM +0200, Oliver Schinagl wrote: Hey Greg, On 06/24/13 18:04, Greg KH wrote: On Mon, Jun 24, 2013 at 11:29:42AM +0200, Maxime Ri

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-24 Thread Greg KH
On Mon, Jun 24, 2013 at 11:21:16PM +0200, Oliver Schinagl wrote: > On 06/24/13 20:15, Greg KH wrote: > >On Mon, Jun 24, 2013 at 07:11:35PM +0200, Oliver Schinagl wrote: > >>Hey Greg, > >>On 06/24/13 18:04, Greg KH wrote: > >>>On Mon, Jun 24, 2013 at 11:29:42AM +0200, Maxime Ripard wrote: > Hi G

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-24 Thread Oliver Schinagl
On 06/24/13 20:15, Greg KH wrote: On Mon, Jun 24, 2013 at 07:11:35PM +0200, Oliver Schinagl wrote: Hey Greg, On 06/24/13 18:04, Greg KH wrote: On Mon, Jun 24, 2013 at 11:29:42AM +0200, Maxime Ripard wrote: Hi Greg, On Mon, Jun 17, 2013 at 03:58:47PM -0700, Greg KH wrote: On Mon, Jun 17, 2013

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-24 Thread Maxime Ripard
On Mon, Jun 24, 2013 at 09:04:40AM -0700, Greg KH wrote: > On Mon, Jun 24, 2013 at 11:29:42AM +0200, Maxime Ripard wrote: > > Hi Greg, > > > > On Mon, Jun 17, 2013 at 03:58:47PM -0700, Greg KH wrote: > > > On Mon, Jun 17, 2013 at 10:59:37PM +0200, Oliver Schinagl wrote: > > > > [..] > > > > > >

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-24 Thread Greg KH
On Mon, Jun 24, 2013 at 07:11:35PM +0200, Oliver Schinagl wrote: > Hey Greg, > On 06/24/13 18:04, Greg KH wrote: > >On Mon, Jun 24, 2013 at 11:29:42AM +0200, Maxime Ripard wrote: > >>Hi Greg, > >> > >>On Mon, Jun 17, 2013 at 03:58:47PM -0700, Greg KH wrote: > >>>On Mon, Jun 17, 2013 at 10:59:37PM +

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-24 Thread Oliver Schinagl
Hey Greg, On 06/24/13 18:04, Greg KH wrote: On Mon, Jun 24, 2013 at 11:29:42AM +0200, Maxime Ripard wrote: Hi Greg, On Mon, Jun 17, 2013 at 03:58:47PM -0700, Greg KH wrote: On Mon, Jun 17, 2013 at 10:59:37PM +0200, Oliver Schinagl wrote: [..] +static int __init sunxi_sid_probe(struct platf

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-24 Thread Greg KH
On Mon, Jun 24, 2013 at 11:29:42AM +0200, Maxime Ripard wrote: > Hi Greg, > > On Mon, Jun 17, 2013 at 03:58:47PM -0700, Greg KH wrote: > > On Mon, Jun 17, 2013 at 10:59:37PM +0200, Oliver Schinagl wrote: > > [..] > > > > +static int __init sunxi_sid_probe(struct platform_device *pdev) > > > +{ >

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-24 Thread Maxime Ripard
Hi Greg, On Mon, Jun 17, 2013 at 03:58:47PM -0700, Greg KH wrote: > On Mon, Jun 17, 2013 at 10:59:37PM +0200, Oliver Schinagl wrote: [..] > > +static int __init sunxi_sid_probe(struct platform_device *pdev) > > +{ > > + u8 entropy[SID_SIZE]; > > + unsigned int i; > > + struct resource *res

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-17 Thread Andy Shevchenko
On Mon, Jun 17, 2013 at 11:59 PM, Oliver Schinagl wrote: > From: Oliver Schinagl > > Allwinner has electric fuses (efuse) on their line of chips. This driver > reads those fuses, seeds the kernel entropy and exports them as a sysfs node. > > These fuses are most likly to be programmed at the fact

Re: [linux-sunxi] Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-17 Thread Henrik Nordström
mån 2013-06-17 klockan 15:58 -0700 skrev Greg KH: > Really? I don't mind it but is this something that is ok to add to the > pool? Will it be different on different machines with this device? Or > will it always be the same on all systems with this device? The data is unique per CPU, so it's d

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-17 Thread Greg KH
On Mon, Jun 17, 2013 at 10:59:37PM +0200, Oliver Schinagl wrote: > From: Oliver Schinagl > > Allwinner has electric fuses (efuse) on their line of chips. This driver > reads those fuses, seeds the kernel entropy and exports them as a sysfs node. > > These fuses are most likly to be programmed at

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-17 Thread Tomasz Figa
Hi Oliver, On Monday 17 of June 2013 22:59:37 Oliver Schinagl wrote: > From: Oliver Schinagl > > Allwinner has electric fuses (efuse) on their line of chips. This driver > reads those fuses, seeds the kernel entropy and exports them as a sysfs > node. > > These fuses are most likly to be progra

[PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-17 Thread Oliver Schinagl
From: Oliver Schinagl Allwinner has electric fuses (efuse) on their line of chips. This driver reads those fuses, seeds the kernel entropy and exports them as a sysfs node. These fuses are most likly to be programmed at the factory, encoding things like Chip ID, some sort of serial number etc an

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-17 Thread Oliver Schinagl
On 17-06-13 15:23, Tomasz Figa wrote: On Monday 17 of June 2013 15:10:47 Oliver Schinagl wrote: On 17-06-13 14:51, Tomasz Figa wrote: On Monday 17 of June 2013 12:36:47 Oliver Schinagl wrote: On 15-06-13 12:28, Tomasz Figa wrote: Now we pass this array to add_randomness(array, 16). So add_r

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-17 Thread Tomasz Figa
On Monday 17 of June 2013 15:10:47 Oliver Schinagl wrote: > On 17-06-13 14:51, Tomasz Figa wrote: > > On Monday 17 of June 2013 12:36:47 Oliver Schinagl wrote: > >> On 15-06-13 12:28, Tomasz Figa wrote: > >>> Hi, > >>> > >>> Some comments inline. > >> > >> Thank you > > > > You're welcome. :) >

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-17 Thread Oliver Schinagl
On 17-06-13 14:51, Tomasz Figa wrote: On Monday 17 of June 2013 12:36:47 Oliver Schinagl wrote: On 15-06-13 12:28, Tomasz Figa wrote: Hi, Some comments inline. Thank you You're welcome. :) On Saturday 15 of June 2013 01:16:20 Oliver Schinagl wrote: From: Oliver Schinagl Allwinner has

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-17 Thread Tomasz Figa
On Monday 17 of June 2013 12:36:47 Oliver Schinagl wrote: > On 15-06-13 12:28, Tomasz Figa wrote: > > Hi, > > > > Some comments inline. > > Thank you You're welcome. :) > > On Saturday 15 of June 2013 01:16:20 Oliver Schinagl wrote: > >> From: Oliver Schinagl > >> > >> Allwinner has electric

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-17 Thread Oliver Schinagl
On 17-06-13 13:51, Maxime Ripard wrote: On Mon, Jun 17, 2013 at 12:36:47PM +0200, Oliver Schinagl wrote: On 15-06-13 12:28, Tomasz Figa wrote: +#define DRV_VERSION "1.0" What is this version thingy? Is there a versioning scheme defined for this driver? Do you expect it to be changed every mo

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-17 Thread Maxime Ripard
On Mon, Jun 17, 2013 at 12:36:47PM +0200, Oliver Schinagl wrote: > On 15-06-13 12:28, Tomasz Figa wrote: > >>+#define DRV_VERSION "1.0" > > > >What is this version thingy? > > > >Is there a versioning scheme defined for this driver? Do you expect it to > >be changed every modification of this drive

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-17 Thread Oliver Schinagl
On 17-06-13 13:25, Russell King - ARM Linux wrote: On Mon, Jun 17, 2013 at 12:36:47PM +0200, Oliver Schinagl wrote: On 15-06-13 12:28, Tomasz Figa wrote: What is this version thingy? Is there a versioning scheme defined for this driver? Do you expect it to be changed every modification of this

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-17 Thread Russell King - ARM Linux
On Mon, Jun 17, 2013 at 12:36:47PM +0200, Oliver Schinagl wrote: > On 15-06-13 12:28, Tomasz Figa wrote: >> What is this version thingy? >> >> Is there a versioning scheme defined for this driver? Do you expect it to >> be changed every modification of this driver? >> >> I don't see any point of ha

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-17 Thread Oliver Schinagl
On 15-06-13 12:28, Tomasz Figa wrote: Hi, Some comments inline. Thank you On Saturday 15 of June 2013 01:16:20 Oliver Schinagl wrote: From: Oliver Schinagl Allwinner has electric fuses (efuse) on their line of chips. This driver reads those fuses, seeds the kernel entropy and exports them

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-15 Thread Tomasz Figa
Hi, Some comments inline. On Saturday 15 of June 2013 01:16:20 Oliver Schinagl wrote: > From: Oliver Schinagl > > Allwinner has electric fuses (efuse) on their line of chips. This driver > reads those fuses, seeds the kernel entropy and exports them as a sysfs > node. > > These fuses are most

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-15 Thread Oliver Schinagl
On 06/15/13 04:14, Andy Shevchenko wrote: On Sat, Jun 15, 2013 at 2:16 AM, Oliver Schinagl wrote: From: Oliver Schinagl Allwinner has electric fuses (efuse) on their line of chips. This driver reads those fuses, seeds the kernel entropy and exports them as a sysfs node. These fuses are most

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-14 Thread Andy Shevchenko
On Sat, Jun 15, 2013 at 2:16 AM, Oliver Schinagl wrote: > From: Oliver Schinagl > > Allwinner has electric fuses (efuse) on their line of chips. This driver > reads those fuses, seeds the kernel entropy and exports them as a sysfs node. > > These fuses are most likly to be programmed at the facto

[PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-14 Thread Oliver Schinagl
From: Oliver Schinagl Allwinner has electric fuses (efuse) on their line of chips. This driver reads those fuses, seeds the kernel entropy and exports them as a sysfs node. These fuses are most likly to be programmed at the factory, encoding things like Chip ID, some sort of serial number etc an

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses; Unanswered comments

2013-06-11 Thread Oliver Schinagl
Hello all, While waiting/working in comments I realized/was reminded that there where a few things I hadn't addressed. I'll try to go over all the missing bits to be sure to answer all questions before submitting the hopefully final version. This because I wouldn't want anybody to think I'm u

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-11 Thread Andy Shevchenko
On Tue, Jun 11, 2013 at 12:43 AM, Oliver Schinagl wrote: > On 06/06/13 21:16, Andy Shevchenko wrote: >> On Sun, Jun 2, 2013 at 5:58 PM, Oliver Schinagl >> wrote: >>> From: Oliver Schinagl >>> + if (likely((SID_SIZE))) { >> >> Extra braces. >> Use antipattern here. > > While I accidentally

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-10 Thread Oliver Schinagl
On 06/06/13 21:16, Andy Shevchenko wrote: Thank you andy for your review, I do have a few questions/comments if you don't mind. On Sun, Jun 2, 2013 at 5:58 PM, Oliver Schinagl wrote: From: Oliver Schinagl + if (likely((SID_SIZE))) { Extra braces. Use antipattern here. While I ac

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-06 Thread Andy Shevchenko
On Sun, Jun 2, 2013 at 5:58 PM, Oliver Schinagl wrote: > From: Oliver Schinagl > > Allwinner has electric fuses (efuse) on their line of chips. This driver > reads those fuses, seeds the kernel entropy and exports them as a sysfs node. > > These fuses are most likly to be programmed at the factor

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-02 Thread Oliver Schinagl
On 06/02/13 17:09, Russell King - ARM Linux wrote: On Sun, Jun 02, 2013 at 04:58:49PM +0200, Oliver Schinagl wrote: +#include We have an include file called linux/io.h. Please use linux/*.h files which include asm/*.h files in preference to directly using asm/*.h. In fact, no driver should

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-02 Thread Russell King - ARM Linux
On Sun, Jun 02, 2013 at 04:58:49PM +0200, Oliver Schinagl wrote: > +#include We have an include file called linux/io.h. Please use linux/*.h files which include asm/*.h files in preference to directly using asm/*.h. In fact, no driver should include an asm/*.h header. > +#include > +#include

[PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-06-02 Thread Oliver Schinagl
From: Oliver Schinagl Allwinner has electric fuses (efuse) on their line of chips. This driver reads those fuses, seeds the kernel entropy and exports them as a sysfs node. These fuses are most likly to be programmed at the factory, encoding things like Chip ID, some sort of serial number etc an

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-26 Thread Maxime Ripard
On Sat, May 25, 2013 at 09:25:51PM +0200, Oliver Schinagl wrote: > On 05/25/13 14:22, Maxime Ripard wrote: > >What about: > > > >val = ioread32be(base + (key / 4)); > >val >>= (key % 4) * 8; > >return val & 0xff; > > > >No lookup table, no weird swich statement, and you get the endianness > >conver

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-25 Thread Oliver Schinagl
On 05/25/13 14:22, Maxime Ripard wrote: Hi Oliver, On Fri, May 24, 2013 at 11:50:38PM +0200, Oliver Schinagl wrote: On 05/18/13 19:19, Oliver Schinagl wrote: + + +/* We read the entire key, using a look up table. Returned is only the + * requested byte. This is of course slower then it could

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-25 Thread Maxime Ripard
Hi Oliver, On Fri, May 24, 2013 at 11:50:38PM +0200, Oliver Schinagl wrote: > On 05/18/13 19:19, Oliver Schinagl wrote: > > >>>+ > >>>+ > >>>+/* We read the entire key, using a look up table. Returned is only the > >>>+ * requested byte. This is of course slower then it could be and uses 4 > >>>

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-24 Thread Oliver Schinagl
On 05/18/13 19:19, Oliver Schinagl wrote: + + +/* We read the entire key, using a look up table. Returned is only the + * requested byte. This is of course slower then it could be and uses 4 times + * more reads as needed but keeps code a little simpler. + */ +u8 sunxi_sid_read_byte(const int ke

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-23 Thread Maxime Ripard
On Thu, May 23, 2013 at 05:05:21PM +0200, Oliver Schinagl wrote: > On 05/23/13 16:58, Maxime Ripard wrote: > >On Thu, May 23, 2013 at 10:10:17AM +0200, Oliver Schinagl wrote: > >>Then, i'm not sure if the driver is the best for this to be loaded? > >>Maxime, what do you think? Personally I would fe

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-23 Thread Oliver Schinagl
On 05/23/13 16:58, Maxime Ripard wrote: On Thu, May 23, 2013 at 10:10:17AM +0200, Oliver Schinagl wrote: Then, i'm not sure if the driver is the best for this to be loaded? Maxime, what do you think? Personally I would feel more in having this in the mach-sunxi/core.c bit, but then again, this i

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-23 Thread Maxime Ripard
On Thu, May 23, 2013 at 10:10:17AM +0200, Oliver Schinagl wrote: > Then, i'm not sure if the driver is the best for this to be loaded? > Maxime, what do you think? Personally I would feel more in having > this in the mach-sunxi/core.c bit, but then again, this is currently > a module and wouldn't b

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-23 Thread Linus Walleij
On Thu, May 23, 2013 at 10:10 AM, Oliver Schinagl wrote: > On 05/23/13 09:56, Linus Walleij wrote: >> >> On Fri, May 17, 2013 at 3:35 PM, Oliver Schinagl >> wrote: >> >> (...) >>> >>> While initially these fuses are used to somewhat determin the chipID, >>> these >>> appear to be writeable by the

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-23 Thread Oliver Schinagl
On 05/23/13 09:56, Linus Walleij wrote: On Fri, May 17, 2013 at 3:35 PM, Oliver Schinagl wrote: (...) While initially these fuses are used to somewhat determin the chipID, these appear to be writeable by the user and thus can be used for other purpouses. For example storing a 128 bit root key,

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-23 Thread Linus Walleij
On Fri, May 17, 2013 at 3:35 PM, Oliver Schinagl wrote: (...) > While initially these fuses are used to somewhat determin the chipID, these > appear to be writeable by the user and thus can be used for other purpouses. > For example storing a 128 bit root key, a unique serial number, which could

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-19 Thread Maxime Ripard
On Sat, May 18, 2013 at 07:19:43PM +0200, Oliver Schinagl wrote: > On 05/17/13 23:18, Maxime Ripard wrote: > >Hi Oliver, > > > >Le 17/05/2013 15:35, Oliver Schinagl a écrit : > >>From: Oliver Schinagl > >> > >>Allwinner has electric fuses (efuse) on their line of chips. This driver > >>reads those

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-18 Thread Oliver Schinagl
On 05/17/13 23:18, Maxime Ripard wrote: Hi Oliver, Le 17/05/2013 15:35, Oliver Schinagl a écrit : From: Oliver Schinagl Allwinner has electric fuses (efuse) on their line of chips. This driver reads those fuses and exports them as a sysfs node. Also a symbol is exported for in-kernel useage.

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-17 Thread Maxime Ripard
Hi Oliver, Le 17/05/2013 15:35, Oliver Schinagl a écrit : > From: Oliver Schinagl > > Allwinner has electric fuses (efuse) on their line of chips. This driver > reads those fuses and exports them as a sysfs node. Also a symbol is exported > for in-kernel useage. > > While initially these fuses

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-17 Thread Oliver Schinagl
On 05/17/13 15:45, Arnd Bergmann wrote: On Friday 17 May 2013 15:35:43 Oliver Schinagl wrote: +static struct bin_attribute sid_bin_attr = { + .attr = { + .name = "key", + .mode = S_IRUGO, + }, + .size = SUNXI_SID_SIZE, + .read = sid_read, +};

Re: [PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-17 Thread Arnd Bergmann
On Friday 17 May 2013 15:35:43 Oliver Schinagl wrote: > +static struct bin_attribute sid_bin_attr = { > + .attr = { > + .name = "key", > + .mode = S_IRUGO, > + }, > + .size = SUNXI_SID_SIZE, > + .read = sid_read, > +}; I believe all the other dri

[PATCH 1/2] Initial support for Allwinner's Security ID fuses

2013-05-17 Thread Oliver Schinagl
From: Oliver Schinagl Allwinner has electric fuses (efuse) on their line of chips. This driver reads those fuses and exports them as a sysfs node. Also a symbol is exported for in-kernel useage. While initially these fuses are used to somewhat determin the chipID, these appear to be writeable by