All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [lm-sensors] How to use SC18IS602 driver ?
@ 2012-09-28  1:35 Guenter Roeck
  2012-10-01 14:03 ` Bruce Parker
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Guenter Roeck @ 2012-09-28  1:35 UTC (permalink / raw)
  To: lm-sensors

On Thu, Sep 27, 2012 at 07:40:14PM -0500, Bruce Parker wrote:
> ok...see below

Adding mailing list back in. Please don't drop it, and please don't top-post.

> # ls /sys/class/i2c-adapter/i2c-0
> 0-0020         0-0025         0-004c         0-0054         i2c-dev
> 0-0021         0-0026         0-0050         0-0055         name
> 0-0022         0-0027         0-0051         0-0056         new_device
> 0-0023         0-0028         0-0052         delete_device  subsystem
> 0-0024         0-0037         0-0053         device         uevent
> # ls /sys/class/i2c-adapter/i2c-0/0-0028
> driver      modalias    name        spi_master  subsystem   uevent
> # ls /sys/class/i2c-adapter/i2c-0/0-0028/spi_master/
> spi0
> # ls /sys/class/i2c-adapter/i2c-0/0-0028/spi_master/spi0
> device     spi0.0     subsystem  uevent
> # ls /sys/class/i2c-adapter/i2c-0/0-0028/spi_master/spi0/spi0.0
> modalias   subsystem  uevent
> #
> 
> I guess I don't understand when the /dev/mtd* device is supposed to be created?
> 
Given the above, you must have either a device tree based configuration or a
platform initialization file. In there you would specify the parameters of the
SPI EEPROM. Assuming it is a Jedec compliant eeprom, that would in turn
instantiate the mtd devices. If you use device tree, I think you would specify
partition sizes in it as well.

Guenter

> -----Original Message-----
> From: Guenter Roeck [mailto:linux@roeck-us.net]
> Sent: Thu 9/27/2012 7:10 PM
> To: Bruce Parker
> Subject: Re: How to use SC18IS602 driver ?
>  
> On Thu, Sep 27, 2012 at 05:56:02PM -0500, Bruce Parker wrote:
> > I'm logged in as root, but doesn't look like "sudo" or "i2cdetect" are
> > on my filesystem. Guess I need to get it added to ramdisk?
> > 
> Try "ls /sys/class/i2c-adapter/i2c-0"
> 
> Guenter
> 
> > Bruce...
> > 
> > -----Original Message-----
> > From: Guenter Roeck [mailto:linux@roeck-us.net] 
> > Sent: Thursday, September 27, 2012 5:48 PM
> > To: Bruce Parker
> > Subject: Re: How to use SC18IS602 driver ?
> > 
> > On Thu, Sep 27, 2012 at 04:50:53PM -0500, Bruce Parker wrote:
> > > Message at bottom of email...
> > >  
> > > > -----Original Message-----
> > > > From: Guenter Roeck [mailto:linux@roeck-us.net] 
> > > > Sent: Tuesday, August 28, 2012 6:38 PM
> > > > To: Bruce Parker
> > > > Subject: Re: How to use SC18IS602 driver ?
> > > > 
> > > > On Tue, Aug 28, 2012 at 06:34:03PM -0500, Bruce Parker wrote:
> > > > >  [snip]
> > > > > >
> > > > > > With these entries, I can successfully boot Linux and see that
> > an
> > > > > entry
> > > > > > has been created at:
> > > > > > /sys/class/i2c-adapter/i2c-0/0-0028/spi_master/spi0/spi0.0
> > > > > >
> > > > > Do you also see it at /sys/class/spi_master/spi0/spi0.0 ?
> > > > > 
> > > > > Yes
> > > > > 
> > > > > > In the past I have accessed eeproms by just having them in the
> > > > device
> > > > > > tree, then doing open(/sys/bus/i2c/devices/0-005x/eeprom) to get
> > > > file
> > > > > > descriptor. Then using file descriptor to do
> > > read()/write()...pretty
> > > > > > straight forward. Of course those eeproms were hanging directly
> > on
> > > > the
> > > > > > I2C bus.
> > > > > 
> > > > > Yes, this is how it works with I2C EEPROMs, or with AT25
> > conpatible
> > > > SPI
> > > > > EEPROMs.
> > > > > m25p80 works differently; it creates an mfd device.
> > > > > 
> > > > > Do you see any output with dmesg ? You should either see something
> > > > like
> > > > >         m25p80 spi0.0: s25sl064a (xxx Kbytes)
> > > > > or
> > > > >         m25p80 spi0.0: unrecognized JEDEC id ffffff
> > > > > 
> > > > > In the latter case, try again with mode 3 instead of mode 0.
> > > > > 
> > > > > No, but I don't have the hardware with the bridge and m25p80 on it
> > > > yet.
> > > > > Does that matter?
> > > > 
> > > > Ok, then I guess you'll have to wait for the hardware. The /dev/mtd
> > > > entries will
> > > > only be created if the hardware is actually there.
> > > > 
> > > > Guenter
> > > Hi again Guenter,
> > > I have my hardware now, but it does not appear to be discovered by the
> > > kernel at boot time. Using an I2C bus monitor, I do not see any
> > accesses
> > > to the I2C bridge during boot. The device is definitely in the device
> > > tree because the /sys/class/spi_master/spi0/spi0.0 file is being
> > > created. Should I see the kernel probing for the Bridge during boot
> > > time? Is there some specific kernel configuration I need to ask my
> > > kernel guy to enable?
> > > 
> > The driver is not an auto-detect driver, so you would not see any i2c
> > activity
> > unless you try to access a SPI device.
> > 
> > What do you see if you run "sudo i2cdetect 0" ?
> > 
> > Guenter
> > 
> > 
> 

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [lm-sensors] How to use SC18IS602 driver ?
  2012-09-28  1:35 [lm-sensors] How to use SC18IS602 driver ? Guenter Roeck
@ 2012-10-01 14:03 ` Bruce Parker
  2012-10-01 17:19 ` Guenter Roeck
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Bruce Parker @ 2012-10-01 14:03 UTC (permalink / raw)
  To: lm-sensors

 
> Adding mailing list back in. Please don't drop it, and please 
> don't top-post.
> 
> > # ls /sys/class/i2c-adapter/i2c-0
> > 0-0020         0-0025         0-004c         0-0054         i2c-dev
> > 0-0021         0-0026         0-0050         0-0055         name
> > 0-0022         0-0027         0-0051         0-0056         
> new_device
> > 0-0023         0-0028         0-0052         delete_device  
> subsystem
> > 0-0024         0-0037         0-0053         device         uevent
> > # ls /sys/class/i2c-adapter/i2c-0/0-0028
> > driver      modalias    name        spi_master  subsystem   uevent
> > # ls /sys/class/i2c-adapter/i2c-0/0-0028/spi_master/
> > spi0
> > # ls /sys/class/i2c-adapter/i2c-0/0-0028/spi_master/spi0
> > device     spi0.0     subsystem  uevent
> > # ls /sys/class/i2c-adapter/i2c-0/0-0028/spi_master/spi0/spi0.0
> > modalias   subsystem  uevent
> > #
> > 
> > I guess I don't understand when the /dev/mtd* device is 
> supposed to be created?
> > 
> Given the above, you must have either a device tree based 
> configuration or a
> platform initialization file. In there you would specify the 
> parameters of the
> SPI EEPROM. Assuming it is a Jedec compliant eeprom, that 
> would in turn
> instantiate the mtd devices. If you use device tree, I think 
> you would specify
> partition sizes in it as well.
> 
> Guenter
> 
> > -----Original Message-----
> > From: Guenter Roeck [mailto:linux@roeck-us.net]
> > Sent: Thu 9/27/2012 7:10 PM
> > To: Bruce Parker
> > Subject: Re: How to use SC18IS602 driver ?
> >  
> > On Thu, Sep 27, 2012 at 05:56:02PM -0500, Bruce Parker wrote:
> > > I'm logged in as root, but doesn't look like "sudo" or 
> "i2cdetect" are
> > > on my filesystem. Guess I need to get it added to ramdisk?
> > > 
> > Try "ls /sys/class/i2c-adapter/i2c-0"
> > 
> > Guenter
> > 
> > > Bruce...
> > > 
> > > -----Original Message-----
> > > From: Guenter Roeck [mailto:linux@roeck-us.net] 
> > > Sent: Thursday, September 27, 2012 5:48 PM
> > > To: Bruce Parker
> > > Subject: Re: How to use SC18IS602 driver ?
> > > 
> > > On Thu, Sep 27, 2012 at 04:50:53PM -0500, Bruce Parker wrote:
> > > > Message at bottom of email...
> > > >  
> > > > > -----Original Message-----
> > > > > From: Guenter Roeck [mailto:linux@roeck-us.net] 
> > > > > Sent: Tuesday, August 28, 2012 6:38 PM
> > > > > To: Bruce Parker
> > > > > Subject: Re: How to use SC18IS602 driver ?
> > > > > 
> > > > > On Tue, Aug 28, 2012 at 06:34:03PM -0500, Bruce Parker wrote:
> > > > > >  [snip]
> > > > > > >
> > > > > > > With these entries, I can successfully boot Linux 
> and see that
> > > an
> > > > > > entry
> > > > > > > has been created at:
> > > > > > > /sys/class/i2c-adapter/i2c-0/0-0028/spi_master/spi0/spi0.0
> > > > > > >
> > > > > > Do you also see it at /sys/class/spi_master/spi0/spi0.0 ?
> > > > > > 
> > > > > > Yes
> > > > > > 
> > > > > > > In the past I have accessed eeproms by just 
> having them in the
> > > > > device
> > > > > > > tree, then doing 
> open(/sys/bus/i2c/devices/0-005x/eeprom) to get
> > > > > file
> > > > > > > descriptor. Then using file descriptor to do
> > > > read()/write()...pretty
> > > > > > > straight forward. Of course those eeproms were 
> hanging directly
> > > on
> > > > > the
> > > > > > > I2C bus.
> > > > > > 
> > > > > > Yes, this is how it works with I2C EEPROMs, or with AT25
> > > conpatible
> > > > > SPI
> > > > > > EEPROMs.
> > > > > > m25p80 works differently; it creates an mfd device.
> > > > > > 
> > > > > > Do you see any output with dmesg ? You should 
> either see something
> > > > > like
> > > > > >         m25p80 spi0.0: s25sl064a (xxx Kbytes)
> > > > > > or
> > > > > >         m25p80 spi0.0: unrecognized JEDEC id ffffff
> > > > > > 
> > > > > > In the latter case, try again with mode 3 instead of mode 0.
> > > > > > 
> > > > > > No, but I don't have the hardware with the bridge 
> and m25p80 on it
> > > > > yet.
> > > > > > Does that matter?
> > > > > 
> > > > > Ok, then I guess you'll have to wait for the 
> hardware. The /dev/mtd
> > > > > entries will
> > > > > only be created if the hardware is actually there.
> > > > > 
> > > > > Guenter
> > > > Hi again Guenter,
> > > > I have my hardware now, but it does not appear to be 
> discovered by the
> > > > kernel at boot time. Using an I2C bus monitor, I do not see any
> > > accesses
> > > > to the I2C bridge during boot. The device is definitely 
> in the device
> > > > tree because the /sys/class/spi_master/spi0/spi0.0 file is being
> > > > created. Should I see the kernel probing for the Bridge 
> during boot
> > > > time? Is there some specific kernel configuration I 
> need to ask my
> > > > kernel guy to enable?
> > > > 
> > > The driver is not an auto-detect driver, so you would not 
> see any i2c
> > > activity
> > > unless you try to access a SPI device.
> > > 
> > > What do you see if you run "sudo i2cdetect 0" ?
> > > 
> > > Guenter
> > > 
> > > 
> > 
> 

Ok...got i2cdetect installed and below is result:
# i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and
worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: UU UU UU UU UU UU UU UU UU -- -- -- -- -- -- --
30: -- 31 -- -- -- -- -- UU -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
50: UU UU UU UU UU UU UU -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
I2C-SPI bridge is at addr 28, so it appears to be detected. 

Below is my entry in device tree, but I do not see anything special in
/dev/mtd*
                                spi: spi@28 {
                                        compatible = "nxp,sc18is602";
                                        #address-cells = <1>;
                                        #size-cells = <0>;
                                        reg = <0x28>;
                                        m25p80@0 {
                                                #address-cells = <1>;
                                                #size-cells = <1>;
                                                compatible "fsl,espi-flash";
                                                linux,modalias "m25p80";
                                                spi-max-frequency <25000000>;
                                                modal = "s25sl064a";
                                                reg = <0>;
                                                mode = <0>;

                                                partition@0 {
                                                    reg = <0x0
0x00080000>;
                                                    label = "Test
Image";
                                                    read-only;
                                                };
                                        };
                                };


# ls /dev/mtd*
/dev/mtd0        /dev/mtd6        /dev/mtdblock2   /dev/mtdr12
/dev/mtd1        /dev/mtd7        /dev/mtdblock3   /dev/mtdr13
/dev/mtd10       /dev/mtd8        /dev/mtdblock4   /dev/mtdr14
/dev/mtd11       /dev/mtd9        /dev/mtdblock5   /dev/mtdr15
/dev/mtd12       /dev/mtdblock0   /dev/mtdblock6   /dev/mtdr2
/dev/mtd13       /dev/mtdblock1   /dev/mtdblock7   /dev/mtdr3
/dev/mtd14       /dev/mtdblock10  /dev/mtdblock8   /dev/mtdr4
/dev/mtd15       /dev/mtdblock11  /dev/mtdblock9   /dev/mtdr5
/dev/mtd2        /dev/mtdblock12  /dev/mtdr0       /dev/mtdr6
/dev/mtd3        /dev/mtdblock13  /dev/mtdr1       /dev/mtdr7
/dev/mtd4        /dev/mtdblock14  /dev/mtdr10      /dev/mtdr8
/dev/mtd5        /dev/mtdblock15  /dev/mtdr11      /dev/mtdr9


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [lm-sensors] How to use SC18IS602 driver ?
  2012-09-28  1:35 [lm-sensors] How to use SC18IS602 driver ? Guenter Roeck
  2012-10-01 14:03 ` Bruce Parker
@ 2012-10-01 17:19 ` Guenter Roeck
  2012-10-01 18:41 ` Bruce Parker
  2012-10-01 19:35 ` Guenter Roeck
  3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2012-10-01 17:19 UTC (permalink / raw)
  To: lm-sensors

On Mon, Oct 01, 2012 at 09:03:15AM -0500, Bruce Parker wrote:

[ ... ]

> 
> Ok...got i2cdetect installed and below is result:
> # i2cdetect 0
> WARNING! This program can confuse your I2C bus, cause data loss and
> worse!
> I will probe file /dev/i2c-0.
> I will probe address range 0x03-0x77.
> Continue? [Y/n] y
>      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
> 00:          -- -- -- -- -- -- -- -- -- -- -- -- --
> 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 20: UU UU UU UU UU UU UU UU UU -- -- -- -- -- -- --
> 30: -- 31 -- -- -- -- -- UU -- -- -- -- -- -- -- --
> 40: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
> 50: UU UU UU UU UU UU UU -- -- -- -- -- -- -- -- --
> 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 70: -- -- -- -- -- -- -- --
> I2C-SPI bridge is at addr 28, so it appears to be detected. 
> 
> Below is my entry in device tree, but I do not see anything special in
> /dev/mtd*
>                                 spi: spi@28 {
>                                         compatible = "nxp,sc18is602";
>                                         #address-cells = <1>;
>                                         #size-cells = <0>;
>                                         reg = <0x28>;
>                                         m25p80@0 {
>                                                 #address-cells = <1>;
>                                                 #size-cells = <1>;
>                                                 compatible > "fsl,espi-flash";
>                                                 linux,modalias > "m25p80";
>                                                 spi-max-frequency > <25000000>;
>                                                 modal = "s25sl064a";
>                                                 reg = <0>;
>                                                 mode = <0>;
> 
>                                                 partition@0 {
>                                                     reg = <0x0
> 0x00080000>;
>                                                     label = "Test
> Image";
>                                                     read-only;
>                                                 };
>                                         };
>                                 };

I don't know much about devicetree instantiation, but the one example I found
for  m25p80 looks a bit different and much simpler.

	flash: m25p80@0 {
        	compatible = "sst,sst25vf016b";
		spi-max-frequency = <20000000>;
		reg = <0>;
	};

> 
> 
> # ls /dev/mtd*
> /dev/mtd0        /dev/mtd6        /dev/mtdblock2   /dev/mtdr12
> /dev/mtd1        /dev/mtd7        /dev/mtdblock3   /dev/mtdr13
> /dev/mtd10       /dev/mtd8        /dev/mtdblock4   /dev/mtdr14
> /dev/mtd11       /dev/mtd9        /dev/mtdblock5   /dev/mtdr15
> /dev/mtd12       /dev/mtdblock0   /dev/mtdblock6   /dev/mtdr2
> /dev/mtd13       /dev/mtdblock1   /dev/mtdblock7   /dev/mtdr3
> /dev/mtd14       /dev/mtdblock10  /dev/mtdblock8   /dev/mtdr4
> /dev/mtd15       /dev/mtdblock11  /dev/mtdblock9   /dev/mtdr5
> /dev/mtd2        /dev/mtdblock12  /dev/mtdr0       /dev/mtdr6
> /dev/mtd3        /dev/mtdblock13  /dev/mtdr1       /dev/mtdr7
> /dev/mtd4        /dev/mtdblock14  /dev/mtdr10      /dev/mtdr8
> /dev/mtd5        /dev/mtdblock15  /dev/mtdr11      /dev/mtdr9
> 
Since you do see a whole lot of mtd devices, did you try to access any of those ?

Also, what is the output of /proc/mtd ? That should give you a mapping from
the partition label to the actual mtd device if the partition was created.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [lm-sensors] How to use SC18IS602 driver ?
  2012-09-28  1:35 [lm-sensors] How to use SC18IS602 driver ? Guenter Roeck
  2012-10-01 14:03 ` Bruce Parker
  2012-10-01 17:19 ` Guenter Roeck
@ 2012-10-01 18:41 ` Bruce Parker
  2012-10-01 19:35 ` Guenter Roeck
  3 siblings, 0 replies; 5+ messages in thread
From: Bruce Parker @ 2012-10-01 18:41 UTC (permalink / raw)
  To: lm-sensors

 

> -----Original Message-----
> From: Guenter Roeck [mailto:linux@roeck-us.net] 
> Sent: Monday, October 01, 2012 12:19 PM
> To: Bruce Parker
> Cc: lm-sensors@lm-sensors.org
> Subject: Re: How to use SC18IS602 driver ?
> 
> On Mon, Oct 01, 2012 at 09:03:15AM -0500, Bruce Parker wrote:
> 
> [ ... ]
> 
> > 
> > Ok...got i2cdetect installed and below is result:
> > # i2cdetect 0
> > WARNING! This program can confuse your I2C bus, cause data loss and
> > worse!
> > I will probe file /dev/i2c-0.
> > I will probe address range 0x03-0x77.
> > Continue? [Y/n] y
> >      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
> > 00:          -- -- -- -- -- -- -- -- -- -- -- -- --
> > 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > 20: UU UU UU UU UU UU UU UU UU -- -- -- -- -- -- --
> > 30: -- 31 -- -- -- -- -- UU -- -- -- -- -- -- -- --
> > 40: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
> > 50: UU UU UU UU UU UU UU -- -- -- -- -- -- -- -- --
> > 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > 70: -- -- -- -- -- -- -- --
> > I2C-SPI bridge is at addr 28, so it appears to be detected. 
> > 
> > Below is my entry in device tree, but I do not see anything 
> special in
> > /dev/mtd*
> >                                 spi: spi@28 {
> >                                         compatible = 
> "nxp,sc18is602";
> >                                         #address-cells = <1>;
> >                                         #size-cells = <0>;
> >                                         reg = <0x28>;
> >                                         m25p80@0 {
> >                                                 
> #address-cells = <1>;
> >                                                 #size-cells = <1>;
> >                                                 compatible > > "fsl,espi-flash";
> >                                                 linux,modalias > > "m25p80";
> >                                                 spi-max-frequency > > <25000000>;
> >                                                 modal = "s25sl064a";
> >                                                 reg = <0>;
> >                                                 mode = <0>;
> > 
> >                                                 partition@0 {
> >                                                     reg = <0x0
> > 0x00080000>;
> >                                                     label = "Test
> > Image";
> >                                                     read-only;
> >                                                 };
> >                                         };
> >                                 };
> 
> I don't know much about devicetree instantiation, but the one 
> example I found
> for  m25p80 looks a bit different and much simpler.
> 
> 	flash: m25p80@0 {
>         	compatible = "sst,sst25vf016b";
> 		spi-max-frequency = <20000000>;
> 		reg = <0>;
> 	};
> 
Ok, tried your example in my device tree and it definitely changed
something. Unfortunately, the kernel crashed during booting as shown
below. But I guess it does imply it was trying to instantiate the
device, where previous device tree didn't seem to be doing anything for
the SPI. Do you know how I could try to instantiate the device outside
of a device tree?

Unable to handle kernel paging request for instruction fetch
Faulting instruction address: 0x00000000
Oops: Kernel access of bad area, sig: 11 [#1]
PowerPC 44x Platform
Modules linked in:
NIP: 00000000 LR: 8022dcb4 CTR: 00000000
REGS: 9f8a5ec0 TRAP: 0400   Not tainted  (3.4.0-tanisys-sx2-25227)
MSR: 00029000 <CE,EE,ME>  CR: 22000022  XER: 20000000
TASK = ef8fd5e0[1039] 'spi0' THREAD: 9f8a4000
GPR00: 00000000 9f8a5f70 ef8fd5e0 ef8cf400 ef8fd5e0 ffff5762 ffffffff
ffd23940
GPR08: 00000001 00000000 ef8cf524 ef8cf524 22002022 10220170 7fff2500
7ffe122c
GPR16: 7ffe1250 00000000 7ffed388 034f2c0f 03000040 7ff31f70 80000010
0000000e
GPR24: 00000000 7ff31e90 00000e80 80047c38 ef8cf504 00029000 ef8cf504
ef8cf400
NIP [00000000]   (null)
LR [8022dcb4] spi_pump_messages+0x108/0x160
Call Trace:
[9f8a5f70] [7ff31e90] 0x7ff31e90 (unreliable)
[9f8a5f90] [80047ba0] kthread_worker_fn+0x98/0x130
[9f8a5fb0] [80047cbc] kthread+0x84/0x88
[9f8a5ff0] [8000b390] kernel_thread+0x4c/0x68
Instruction dump:
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
---[ end trace f360c06729bfcc7f ]---
> > 
> > 
> > # ls /dev/mtd*
> > /dev/mtd0        /dev/mtd6        /dev/mtdblock2   /dev/mtdr12
> > /dev/mtd1        /dev/mtd7        /dev/mtdblock3   /dev/mtdr13
> > /dev/mtd10       /dev/mtd8        /dev/mtdblock4   /dev/mtdr14
> > /dev/mtd11       /dev/mtd9        /dev/mtdblock5   /dev/mtdr15
> > /dev/mtd12       /dev/mtdblock0   /dev/mtdblock6   /dev/mtdr2
> > /dev/mtd13       /dev/mtdblock1   /dev/mtdblock7   /dev/mtdr3
> > /dev/mtd14       /dev/mtdblock10  /dev/mtdblock8   /dev/mtdr4
> > /dev/mtd15       /dev/mtdblock11  /dev/mtdblock9   /dev/mtdr5
> > /dev/mtd2        /dev/mtdblock12  /dev/mtdr0       /dev/mtdr6
> > /dev/mtd3        /dev/mtdblock13  /dev/mtdr1       /dev/mtdr7
> > /dev/mtd4        /dev/mtdblock14  /dev/mtdr10      /dev/mtdr8
> > /dev/mtd5        /dev/mtdblock15  /dev/mtdr11      /dev/mtdr9
> > 
> Since you do see a whole lot of mtd devices, did you try to 
> access any of those ?
> 
> Also, what is the output of /proc/mtd ? That should give you 
> a mapping from
> the partition label to the actual mtd device if the partition 
> was created.
> 
> Thanks,
> Guenter
> 
Forgot to include this before but /proc/mtd shows nothing even though
all those files are there.
# cat /proc/mtd
dev:    size   erasesize  name
#

Bruce...

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [lm-sensors] How to use SC18IS602 driver ?
  2012-09-28  1:35 [lm-sensors] How to use SC18IS602 driver ? Guenter Roeck
                   ` (2 preceding siblings ...)
  2012-10-01 18:41 ` Bruce Parker
@ 2012-10-01 19:35 ` Guenter Roeck
  3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2012-10-01 19:35 UTC (permalink / raw)
  To: lm-sensors

On Mon, Oct 01, 2012 at 01:41:00PM -0500, Bruce Parker wrote:
>  
> 
> > -----Original Message-----
> > From: Guenter Roeck [mailto:linux@roeck-us.net] 
> > Sent: Monday, October 01, 2012 12:19 PM
> > To: Bruce Parker
> > Cc: lm-sensors@lm-sensors.org
> > Subject: Re: How to use SC18IS602 driver ?
> > 
> > On Mon, Oct 01, 2012 at 09:03:15AM -0500, Bruce Parker wrote:
> > 
> > [ ... ]
> > 
> > > 
> > > Ok...got i2cdetect installed and below is result:
> > > # i2cdetect 0
> > > WARNING! This program can confuse your I2C bus, cause data loss and
> > > worse!
> > > I will probe file /dev/i2c-0.
> > > I will probe address range 0x03-0x77.
> > > Continue? [Y/n] y
> > >      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
> > > 00:          -- -- -- -- -- -- -- -- -- -- -- -- --
> > > 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > > 20: UU UU UU UU UU UU UU UU UU -- -- -- -- -- -- --
> > > 30: -- 31 -- -- -- -- -- UU -- -- -- -- -- -- -- --
> > > 40: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
> > > 50: UU UU UU UU UU UU UU -- -- -- -- -- -- -- -- --
> > > 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > > 70: -- -- -- -- -- -- -- --
> > > I2C-SPI bridge is at addr 28, so it appears to be detected. 
> > > 
> > > Below is my entry in device tree, but I do not see anything 
> > special in
> > > /dev/mtd*
> > >                                 spi: spi@28 {
> > >                                         compatible = 
> > "nxp,sc18is602";
> > >                                         #address-cells = <1>;
> > >                                         #size-cells = <0>;
> > >                                         reg = <0x28>;
> > >                                         m25p80@0 {
> > >                                                 
> > #address-cells = <1>;
> > >                                                 #size-cells = <1>;
> > >                                                 compatible > > > "fsl,espi-flash";
> > >                                                 linux,modalias > > > "m25p80";
> > >                                                 spi-max-frequency > > > <25000000>;
> > >                                                 modal = "s25sl064a";
> > >                                                 reg = <0>;
> > >                                                 mode = <0>;
> > > 
> > >                                                 partition@0 {
> > >                                                     reg = <0x0
> > > 0x00080000>;
> > >                                                     label = "Test
> > > Image";
> > >                                                     read-only;
> > >                                                 };
> > >                                         };
> > >                                 };
> > 
> > I don't know much about devicetree instantiation, but the one 
> > example I found
> > for  m25p80 looks a bit different and much simpler.
> > 
> > 	flash: m25p80@0 {
> >         	compatible = "sst,sst25vf016b";
> > 		spi-max-frequency = <20000000>;
> > 		reg = <0>;
> > 	};
> > 
> Ok, tried your example in my device tree and it definitely changed
> something. Unfortunately, the kernel crashed during booting as shown
> below. But I guess it does imply it was trying to instantiate the
> device, where previous device tree didn't seem to be doing anything for
> the SPI. Do you know how I could try to instantiate the device outside
> of a device tree?
> 

I typically use the new_device ABI I introduced for that purpose:
	https://patchwork.kernel.org/patch/1426841/
Unfortunately, it was not accepted upstream, to some degree because no one
besides me supported it. It does not support creating partitions, but you
should be able to create a simple device with a single partition.

> Unable to handle kernel paging request for instruction fetch
> Faulting instruction address: 0x00000000
> Oops: Kernel access of bad area, sig: 11 [#1]
> PowerPC 44x Platform
> Modules linked in:
> NIP: 00000000 LR: 8022dcb4 CTR: 00000000
> REGS: 9f8a5ec0 TRAP: 0400   Not tainted  (3.4.0-tanisys-sx2-25227)
> MSR: 00029000 <CE,EE,ME>  CR: 22000022  XER: 20000000
> TASK = ef8fd5e0[1039] 'spi0' THREAD: 9f8a4000
> GPR00: 00000000 9f8a5f70 ef8fd5e0 ef8cf400 ef8fd5e0 ffff5762 ffffffff
> ffd23940
> GPR08: 00000001 00000000 ef8cf524 ef8cf524 22002022 10220170 7fff2500
> 7ffe122c
> GPR16: 7ffe1250 00000000 7ffed388 034f2c0f 03000040 7ff31f70 80000010
> 0000000e
> GPR24: 00000000 7ff31e90 00000e80 80047c38 ef8cf504 00029000 ef8cf504
> ef8cf400
> NIP [00000000]   (null)
> LR [8022dcb4] spi_pump_messages+0x108/0x160
> Call Trace:
> [9f8a5f70] [7ff31e90] 0x7ff31e90 (unreliable)
> [9f8a5f90] [80047ba0] kthread_worker_fn+0x98/0x130
> [9f8a5fb0] [80047cbc] kthread+0x84/0x88
> [9f8a5ff0] [8000b390] kernel_thread+0x4c/0x68
> Instruction dump:
> XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
> XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
> ---[ end trace f360c06729bfcc7f ]---

Odd, that suggests that something was not initialized properly. No idea what is
going on, though.

Guenter

> > > 
> > > 
> > > # ls /dev/mtd*
> > > /dev/mtd0        /dev/mtd6        /dev/mtdblock2   /dev/mtdr12
> > > /dev/mtd1        /dev/mtd7        /dev/mtdblock3   /dev/mtdr13
> > > /dev/mtd10       /dev/mtd8        /dev/mtdblock4   /dev/mtdr14
> > > /dev/mtd11       /dev/mtd9        /dev/mtdblock5   /dev/mtdr15
> > > /dev/mtd12       /dev/mtdblock0   /dev/mtdblock6   /dev/mtdr2
> > > /dev/mtd13       /dev/mtdblock1   /dev/mtdblock7   /dev/mtdr3
> > > /dev/mtd14       /dev/mtdblock10  /dev/mtdblock8   /dev/mtdr4
> > > /dev/mtd15       /dev/mtdblock11  /dev/mtdblock9   /dev/mtdr5
> > > /dev/mtd2        /dev/mtdblock12  /dev/mtdr0       /dev/mtdr6
> > > /dev/mtd3        /dev/mtdblock13  /dev/mtdr1       /dev/mtdr7
> > > /dev/mtd4        /dev/mtdblock14  /dev/mtdr10      /dev/mtdr8
> > > /dev/mtd5        /dev/mtdblock15  /dev/mtdr11      /dev/mtdr9
> > > 
> > Since you do see a whole lot of mtd devices, did you try to 
> > access any of those ?
> > 
> > Also, what is the output of /proc/mtd ? That should give you 
> > a mapping from
> > the partition label to the actual mtd device if the partition 
> > was created.
> > 
> > Thanks,
> > Guenter
> > 
> Forgot to include this before but /proc/mtd shows nothing even though
> all those files are there.
> # cat /proc/mtd
> dev:    size   erasesize  name
> #
> 
> Bruce...
> 

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-10-01 19:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-28  1:35 [lm-sensors] How to use SC18IS602 driver ? Guenter Roeck
2012-10-01 14:03 ` Bruce Parker
2012-10-01 17:19 ` Guenter Roeck
2012-10-01 18:41 ` Bruce Parker
2012-10-01 19:35 ` Guenter Roeck

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.