I2C_GPIO defined in device tree?

2009-08-21 Thread ST
Hi 

Beeing new to the ppc platform (on xilinx xup fpga) i have a hard time finding 
out the syntax
of the dts file. First i was tring to use the xilinx iic driver but the system 
was always locking 
up when using it. So i thought i am just simply switching to the i2c_gpio 
driver. So i defined 
another 2 port gpio and then got stuck in defining the pins to be used. So i 
would be really glad 
if someone could help me, telling me the proper format to define the GPIO pins 
used by the i2c_gpio 
driver.

Thanks
ST

PS: This is my current xilinx.dts file. "xps_gpio_iic" should provide the sda 
sdl lines for the i2c_gpio driver:


/dts-v1/;
/ {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,virtex405", "xlnx,virtex";
model = "testing";
DDR_SDRAM: mem...@0 {
device_type = "memory";
reg = < 0x0 0x1000 >;
} ;
alias {
ethernet0 = &Ethernet_MAC;
serial0 = &RS232_Uart_1;
} ;
chosen {
bootargs = "console=ttyUL0 root=/dev/xsa2";
linux,stdout-path = "/p...@0/ser...@8400";
} ;
cpus {
#address-cells = <1>;
#cpus = <0x1>;
#size-cells = <0>;
ppc405_0: c...@0 {
clock-frequency = <2>;
compatible = "PowerPC,405", "ibm,ppc405";
d-cache-line-size = <0x20>;
d-cache-size = <0x4000>;
dcr-access-method = "native";
dcr-controller ;
device_type = "cpu";
i-cache-line-size = <0x20>;
i-cache-size = <0x4000>;
model = "PowerPC,405";
reg = <0>;
timebase-frequency = <2>;
xlnx,dcr-resync = <0x0>;
xlnx,deterministic-mult = <0x0>;
xlnx,disable-operand-forwarding = <0x1>;
xlnx,fastest-plb-clock = "DPLB0";
xlnx,generate-plb-timespecs = <0x1>;
xlnx,mmu-enable = <0x1>;
} ;
} ;
plb0: p...@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,plb-v46-1.03.a", "simple-bus";
ranges ;
DDR_SDRAM: m...@8480 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,mpmc-4.03.a";
reg = < 0x8480 0x1 >;
} ;
DIPSWs_4Bit: g...@8148 {
compatible = "xlnx,xps-gpio-1.00.a";
reg = < 0x8148 0x1 >;
xlnx,all-inputs = <0x1>;
xlnx,all-inputs-2 = <0x0>;
xlnx,dout-default = <0x0>;
xlnx,dout-default-2 = <0x0>;
xlnx,family = "virtex2p";
xlnx,gpio-width = <0x4>;
xlnx,interrupt-present = <0x0>;
xlnx,is-bidir = <0x1>;
xlnx,is-bidir-2 = <0x1>;
xlnx,is-dual = <0x0>;
xlnx,tri-default = <0x>;
xlnx,tri-default-2 = <0x>;
} ;
Ethernet_MAC: ether...@8100 {
compatible 
= "xlnx,xps-ethernetlite-2.00.b", "xlnx,xps-ethernetlite-1.00.a";
device_type = "network";
interrupt-parent = <&xps_intc_0>;
interrupts = < 1 0 >;
local-mac-address = [ 02 00 00 00 00 00 ];
reg = < 0x8100 0x1 >;
xlnx,duplex = <0x1>;
xlnx,family = "virtex2p";
xlnx,rx-ping-pong = <0x1>;
xlnx,tx-ping-pong = <0x1>;
} ;
LEDs_4Bit: g...@8146 {
compatible = "xlnx,xps-gpio-1.00.a";
reg = < 0x8146 0x1 >;
xlnx,all-inputs = <0x0>;
xlnx,all-inputs-2 = <0x0>;

dts,i2c,pcf8574 on Xilinx XUP

2010-04-01 Thread ST
Hi

I am currently trying to get the i2c driver from there:
http://www.mail-archive.com/linux-...@vger.kernel.org/msg02403.html
working on a full custom toolchain from me based on ptxdist as a
hobby.

Unfortunatly the i2c driver hangs the git://git.xilinx.com/linux-2.6-xlnx
tree hard if i run i2cdetect. Also my pcf device is not listed as a device.

Obviously my device tree is not correct as the dtc compiler complains:
Warning (avoid_default_addr_size): Relying on default #address-cells value for 
/p...@0/i...@8160/i...@20
Warning (avoid_default_addr_size): Relying on default #size-cells value for 
/p...@0/i...@8160/i...@20
Warning (avoid_default_addr_size): Relying on default #address-cells value for 
/p...@0/xps-...@81818000/spi...@0
Warning (avoid_default_addr_size): Relying on default #size-cells value for 
/p...@0/xps-...@81818000/spi...@0

The dts file comes straight from the xilinx tools with these small additions 
made by me:
210a211,216
> pcf1: i...@20 {
> #gpio-cells = <2>;
> compatible = "ti,pcf8574";
> reg = <0x20>;
> gpio-controller;
> };
228a235,240
>   spi...@0 {
>   compatible = "spidev";
>   spi-max-frequency = <100>;
>   reg = <0>;
>   } ;
>
I am new to this device tree stuff and it would be really great to get some 
hints as i am currently stuck.

Also if someone knows if these i2c patches which had been partially in 2.6.34 
are bigendian/little endian
clean, as i suspect that they are focused on support for the µblazes?

Thanks for your attention
ST
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: dts,i2c,pcf8574 on Xilinx XUP

2010-04-01 Thread ST
Hi Wolfram

Thanks for your reply.
> Is there any output before the crash? Also, the complete device tree and
> bootlog may be useful.
Ups, forgot to attach.

The bootlog is below. There is no output or error msg of the kernel.
Its just gone: no network no nothing. There is a jtag interface but 
i haven't figured out how to use that.

There is only one pcf8574 connected to the i2c bus and nothing else, so
i think that dumping the i2c bus should do no harm?

Best regards
ST
 
zImage starting: loaded at 0x0040 (sp: 0x004f9fb0)  
   
Allocating 0x220e61 bytes for kernel ...
   
gunzipping (0x <- 0x0040d000:0x004f8ac0)...done 0x20399c bytes  
   

Linux/PowerPC load: console=ttyUL0 root=/dev/xsa2 init=/usr/sbin/init
Finalizing device tree... flat tree at 0x506300  
[0.00] Using Xilinx Virtex machine description   
[0.00] Linux version 2.6.32 (tst...@ligeia) (gcc version 4.3.2 
(OSELAS.Toolchain-trunk) ) #2 Thu Apr 1 23:19:08 CEST 2010  
   
[0.00] Zone PFN ranges: 
   
[0.00]   DMA  0x -> 0x0001  
   
[0.00]   Normal   0x0001 -> 0x0001  
   
[0.00] Movable zone start PFN for each node 
   
[0.00] early_node_map[1] active PFN ranges  
   
[0.00] 0: 0x -> 0x0001  
   
[0.00] MMU: Allocated 1088 bytes of context maps for 255 contexts   
   
[0.00] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 65024  
[0.00] Kernel command line: console=ttyUL0 root=/dev/xsa2 
init=/usr/sbin/init  
[0.00] PID hash table entries: 1024 (order: 0, 4096 bytes)  
   
[0.00] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)  
   
[0.00] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
   
[0.00] Memory: 257408k/262144k available (1928k kernel code, 4452k 
reserved, 136k data, 115k bss, 104k init)   
   
[0.00] Kernel virtual memory layout:
   
[0.00]   * 0xe000..0xf000  : fixmap 
   
[0.00]   * 0xfde0..0xfe00  : consistent mem 
   
[0.00]   * 0xfde0..0xfde0  : early ioremap  
   
[0.00]   * 0xd100..0xfde0  : vmalloc & ioremap  
   
[0.00] Hierarchical RCU implementation. 
   
[0.00] NR_IRQS:512  
   
[0.00] clocksource: timebase mult[140] shift[22] registered 
   
[0.00] Console: colour dummy device 80x25   
   
[2797861247.029784] Mount-cache hash table entries: 512 
   
[2797861247.038137] NET: Registered protocol family 16  
   
[2797861247.097587] bio: create slab  at 0   
   
[2797861247.103850] XGpio: /p...@0/g...@8146: registered

[2797861247.105898] XGpio: /p...@0/g...@8144: registered

[2797861247.107782] XGpio: /p...@0/g...@8142: registered

[2797861247.109683] XGpio: /p...@0/g...@8140: registered

[2797861247.121074] Switching to clocksource timebase   
   
[2797861247.123476] Switched to NOHz mode on CPU #0 
   
[2797861

Re: dts,i2c,pcf8574 on Xilinx XUP

2010-04-04 Thread ST
Hi
> (BTW your full name in the mail header would be appreciated)
If the internet would be forgetting more...
 
> > [2797861247.810511] i2c /dev entries driver
> > [2797861247.817952] Device Tree Probing 'i2c'
> > [2797861247.830658]  #0 at 0x8160 mapped to 0xD10C, irq=20
> > [2797861247.838743] pcf857x: probe of 0-0020 failed with error -22
> 
> Doesn't look good here. Do you have the latest version of the driver?
> (CCing i2c)
Mh, i just saw that the i2c-xii.h file is now in 2.6.34. I copied them to my 
2.6.32-xlnx tree. So i think this is the most recent driver (albeit not the most
recent kernel 2.6.32 due to the fact that vanilla doesn't boot on my machine).

> > xps_iic_0: i...@8160 {
> > compatible = "xlnx,xps-iic-2.00.a";
> > interrupt-parent = <&xps_intc_0>;
> > interrupts = < 1 2 >;
> > reg = < 0x8160 0x1 >;
> > xlnx,clk-freq = <0x17d7840>;
> > xlnx,family = "virtex2p";
> > xlnx,gpo-width = <0x1>;
> > xlnx,iic-freq = <0x186a0>;
> > xlnx,scl-inertial-delay = <0x0>;
> > xlnx,sda-inertial-delay = <0x0>;
> > xlnx,ten-bit-adr = <0x0>;
> 
> Have you checked the values? There is surely
> 
> #address-cells = <1>;
> #size-cells = <0>;
> 
> missing here, but that shouldn't cause your problems IMHO. I probably can't
> help any further, never used Xilinx so far (you have the newest version of
>  the dts-generator?).
The messages come from dts-v1.1.0 included in ptxdist-2010.03.0. The warnings 
are gone
after inserting your suggested lines into the dts file. Thanks for that hint! 
However the error 
that no PCF devices are found on the bus still persists. However there is 
absolutly no i2c traffic 
on the i2c pins while it probes for the pcf device, so there clearly is s.t. 
amiss.
Reconfiguring the pins to gpio pins works as expected, so the raw hardware (not 
the "soft" hw)
is working. 

Possible causes i see:
* i did an error when backporting these changes. But since there was only a 
kconfig entry besides 
  adding the c and header file, this would be still possible.
* I did some error in building the hardware.
* The i2c-xii driver is not working on powerpc hardware (only µblaze).
If anybody has some suggestions or knows that the i2c-xii driver
works on powerpc would be really happy to know.

Concerning the xilinx xup board, i am kind of frustrated: There is no support 
for newer 
design tools than 10.1 [1]. Then there had been a regression in the systhesis 
tools which 
couldn't handle 512 Mb memory sticks anymore (works with 256Mb). Then
the git tree is only sometimes online? There is no i2c (compiling) driver for 
their stuff 
which is then added by Intel? So Wolfram you can probably consider yourself 
lucky ;-).

Thanks
ST

[1] http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,400,794&Prod=XUPV2P
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev