2009-07-18 17:24:21     SPI for BF-533 Stamp

Document created by Aaronwu Employee on Aug 16, 2013
Version 1Show Document
  • View in full screen mode

2009-07-18 17:24:21     SPI for BF-533 Stamp

Lukasz Jaruszewski (POLAND)

Message: 77617   

 

Hi all,

 

I want to run tempeture sensor Microchip TC77, which is communicating via SPI interface with the board (BF-533 Stamp).

 

I'm currently using SVN branch for 533 Stamp. When I connected all wires nothing was happened. I mean, I was not able to show any /dev/spidev node.

 

Is SVN branch supporting SPI driver? Or I have to compile my own uClinux kernel? Do I have to initialize SPI driver on board to be able to see spidev node in /dev directory?

 

I will be very grateful for any sugestions and pieces of advice.

 

Lukasz

QuoteReplyEditDelete

 

 

2009-07-18 17:32:13     Re: SPI for BF-533 Stamp

Mike Frysinger (UNITED STATES)

Message: 77618   

 

you didnt say which branch you're using

 

did you read the documentation ?  merely connecting the wires wont make any difference -- the SPI bus is not one where devices can be discovered automatically.

 

  docs.blackfin.uclinux.org/doku.php?id=spi

QuoteReplyEditDelete

 

 

2009-07-18 18:37:26     Re: SPI for BF-533 Stamp

Lukasz Jaruszewski (POLAND)

Message: 77619   

 

Mike,

 

I'm using uImage-SVN-r8549-bf533-stamp. Yes, I have seen   docs.blackfin.uclinux.org/doku.php?id=spi but I overlooked Device Resources section. I will try to compile new kernel tommorow with /spidev node enable.

 

Thanks,

 

Lukasz

QuoteReplyEditDelete

 

 

2009-07-19 14:41:53     Re: SPI for BF-533 Stamp

Lukasz Jaruszewski (POLAND)

Message: 77642   

 

I tried to compile kernel with spidev node. Unfortunately it didn't show in /dev after compilation.

 

I configured stamp.c file as it's wrote in   docs.blackfin.uclinux.org/doku.php?id=spi . Below you can find a part of this file responsible for spidev driver.

 

#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)

static struct bfin5xx_spi_chip spidev_chip_info = {               

        .ctl_reg = 0x4,                                           

        .enable_dma = 0,                                          

        .bits_per_word = 16,                                      

        .cs_change_per_word = 0,                                  

        .cs_chg_udelay = 0,                                       

        .cs_gpio = 0,                                             

};                                                                

#endif

 

 

 

#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)

        {                                                         

                .modalias = "spidev",                             

                .max_speed_hz = 12500000,     /* max spi clock (SCK) speed in HZ */

                .bus_num = 1,                                                     

                .chip_select = 0,                                                 

                .platform_data = NULL,                                            

                .controller_data = &spidev_chip_info,                             

                .mode = SPI_MODE_1,                                               

        },                                                                        

#endif                                                                            

};

 

 

 

In attachment you can find stamp.c file and three screen shots shows options which I choosed while compiling the kernel.

 

I'm using uclinux-dist-trunk-svn-8437 SVN branch.

 

Am I doing something wrong? I'll be grateful for any suggestions and pieces of advice.

 

Lukasz

 

1.png

2.png

3.png

stamp2.c

QuoteReplyEditDelete

 

 

2009-07-19 14:53:25     Re: SPI for BF-533 Stamp

Mike Frysinger (UNITED STATES)

Message: 77647   

 

are you sure you booted the right kernel ?  post the full boot output

 

also, your svn snap is out of date

QuoteReplyEditDelete

 

 

2009-07-19 15:42:25     Re: SPI for BF-533 Stamp

Lukasz Jaruszewski (POLAND)

Message: 77654   

 

I don't know why but files were not attached...

 

Below you can find options whose I choosed while compiling the kernel:

 

 

 

   Device Drivers  --->

 

-*- SPI support  --->

 

  │ │          --- SPI support  

  │ │          [ ]   Debug support for SPI drivers

  │ │                *** SPI Master Controller Drivers ***  

  │ │          {*}   SPI controller driver for ADI Blackfin5xx   

  │ │          [*]     SPI bus lock      

  │ │          < >   emulate SPI bus with Blackfin SPORT     

  │ │          -*-   Utilities for Bitbanging SPI masters   

  │ │          <*>   GPIO-based bitbanging SPI Master      

  │ │                *** SPI Protocol Masters ***      

  │ │          <*>   User mode SPI device driver support      

  │ │          < >   Infineon TLE62X0 (for power switching)

 

 

 

 

 

uClinux Distribution Configuration:

 

    Blackfin test programs  --->

 

  │ │          [ ] RTC test program

  │ │          [ ] DPMC test program

  │ │          [ ] PPIFCD test program  

  │ │          [ ] AUDIO test program 

  │ │          [*] VIDEO test program 

  │ │          [ ] PFBUTTONS test program

  │ │          [ ] TWI test program    

  │ │          [*] SPI test program

  │ │          [ ] PPI test program 

  │ │          [*] TWI LCD test program 

  │ │          [ ] TWI KEYPAD test program

 

 

 

Are those options correct?

 

I'll paste my boot log soon..

 

Lukasz

QuoteReplyEditDelete

 

 

2009-07-19 18:01:55     Re: SPI for BF-533 Stamp

Lukasz Jaruszewski (POLAND)

Message: 77660   

 

Mike,

 

Below you can find pasted boot log and list of files and directories in /dev directory.

 

## Booting image at 01000000 ...                                                                                                             

   Image Name:   bf533-2.6.30-ADI-2010R1-pre                                                                                                 

   Created:      2009-07-19  17:25:21 UTC                                                                                                    

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)                                                                               

   Data Size:    3962205 Bytes =  3.8 MB                                                                                                     

   Load Address: 00001000                                                                                                                    

   Entry Point:  0017e054                                                                                                                    

   Verifying Checksum ... OK                                                                                                                 

   Uncompressing Kernel Image ... OK                                                                                                         

Starting Kernel at = 17e054                                                                                                                  

Linux version 2.6.30-ADI-2010R1-pre (root@linux-nhys) (gcc version 4.1.2 (ADI svn)) #6 Sun Jul 19 19:25:08 CEST 2009                         

bootconsole [early_shadow0] enabled                                                                                                          

bootconsole [early_BFuart0] enabled                                                                                                          

early printk enabled on early_BFuart0                                                                                                        

Limiting kernel memory to 56MB due to anomaly 05000263                                                                                       

Board Memory: 128MB                                                                                                                          

Kernel Managed Memory: 128MB                                                                                                                 

Memory map:                                                                                                                                  

  fixedcode = 0x00000400-0x00000490                                                                                                          

  text      = 0x00001000-0x00102940                                                                                                          

  rodata    = 0x00102940-0x00154eb0                                                                                                          

  bss       = 0x00155000-0x001658cc                                                                                                          

  data      = 0x001658cc-0x00176000                                                                                                          

    stack   = 0x00174000-0x00176000                                                                                                          

  init      = 0x00176000-0x0077d000                                                                                                          

  available = 0x0077d000-0x037ff000                                                                                                          

  DMA Zone  = 0x07f00000-0x08000000                                                                                                          

Hardware Trace Active and Enabled                                                                                                            

Boot Mode: 0                                                                                                                                 

Blackfin support (C) 2004-2009 Analog Devices, Inc.                                                                                          

Compiled for ADSP-BF533 Rev 0.3                                                                                                              

Blackfin Linux support by   blackfin.uclinux.org/                                                                                       

Processor Speed: 398 MHz core clock and 79 MHz System Clock                                                                                  

NOMPU: setting up cplb tables                                                                                                                

Instruction Cache Enabled for CPU0                                                                                                           

  External memory: cacheable in instruction cache                                                                                            

Data Cache Enabled for CPU0                                                                                                                  

  External memory: cacheable (write-back) in data cache                                                                                      

Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 14223                                                                  

Kernel command line: root=/dev/mtdblock0 rw earlyprintk=serial,uart0,57600 console=ttyBF0,57600                                              

NR_IRQS:49                                                                                                                                   

Configuring Blackfin Priority Driven Interrupts                                                                                              

PID hash table entries: 256 (order: 8, 1024 bytes)                                                                                           

bfin-rtc: invalid date; resetting                                                                                                            

console handover:boot [early_BFuart0] boot [early_shadow0]  -> real [ttyBF0]                                                                 

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)                                                                                

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)                                                                                 

Memory available: 49104k/131072k RAM, (6172k init code, 1030k kernel code, 462k data, 1024k dma, 73280k reserved)                            

Calibrating delay loop... 792.57 BogoMIPS (lpj=1585152)                                                                                      

Security Framework initialized                                                                                                               

Mount-cache hash table entries: 512                                                                                                          

Blackfin Scratchpad data SRAM: 4 KB                                                                                                          

Blackfin L1 Data A SRAM: 16 KB (16 KB free)                                                                                                  

Blackfin L1 Data B SRAM: 16 KB (16 KB free)                                                                                                  

Blackfin L1 Instruction SRAM: 64 KB (52 KB free)                                                                                             

net_namespace: 296 bytes                                                                                                                     

NET: Registered protocol family 16                                                                                                           

Blackfin DMA Controller                                                                                                                      

stamp_init(): registering device resources                                                                                                   

bio: create slab <bio-0> at 0                                                                                                                

NET: Registered protocol family 2                                                                                                            

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)                                                                               

TCP established hash table entries: 2048 (order: 2, 16384 bytes)                                                                             

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)                                                                                     

TCP: Hash tables configured (established 2048 bind 2048)                                                                                     

TCP reno registered

NET: Registered protocol family 1

msgmni has been set to 95

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler cfq registered

TWI LCD Driver v0.00

Serial: Blackfin serial driver

bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 21) is a BFIN-UART

brd: module loaded

smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@cam.org>

eth0: SMC91C11xFD (rev 1) at 20300300 IRQ 40 [nowait]

eth0: Ethernet addr: 00:e0:22:fe:04:33

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@5

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

i2c /dev entries driver

i2c-gpio i2c-gpio.0: using pins 2 (SDA) and 3 (SCL)

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

TCP cubic registered

NET: Registered protocol family 17

rtc-bfin rtc-bfin: setting system clock to 1970-01-01 00:00:16 UTC (16)

Freeing unused kernel memory: 6172k freed

dma_alloc_init: dma_page @ 0x00177000 - 256 pages at 0x07f00000

                            _____________________________________

        a8888b.           / Welcome to the uClinux distribution \

       d888888b.         /       _     _                         \

       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |

       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |

       8'    .88       \        | |   | |  _ \| | | | \  /        |

       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |

      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |

     dP   .    Y8b.       \   For embedded processors including   |

    d8:'  "  `::88b        \    the Analog Devices Blackfin      /

   d8"         'Y88b        \___________________________________/

  :8P    '      :888

   8a.   :     _a88P         For further information, check out:

._/"Yaa_:   .| 88P|            -   blackfin.uclinux.org/

\    YP"    `| 8P  `.          -   docs.blackfin.uclinux.org/

/     \.___.d|    .'           -   www.uclinux.org/

`--..__)8888P`._.'  jgs/a:f    -   www.analog.com/blackfin

 

Have a lot of fun...

 

 

BusyBox v1.14.2 (2009-07-19 19:21:36 CEST) hush - the humble shell

 

 

root:/> ls -l                                                                                                                               

drwxr-xr-x    2 root     root            0 Jul 19  2009 bin                                                                                 

drwxr-xr-x    3 root     root            0 Jan  1 00:00 dev                                                                                 

drwxr-xr-x    5 root     root            0 Jul 19  2009 etc                                                                                 

drwxr-xr-x    3 root     root            0 Jul 19  2009 home                                                                                

lrwxrwxrwx    1 root     root           10 Jul 19  2009 init -> /sbin/init                                                                  

drwxr-xr-x    3 root     root            0 Jul 19  2009 lib                                                                                 

drwxr-xr-x    2 root     root            0 Jul 19  2009 mnt                                                                                 

dr-xr-xr-x   29 root     root            0 Jan  1  2007 proc                                                                                

drwxr-xr-x    2 root     root            0 Jul 19  2009 root                                                                                

lrwxrwxrwx    1 root     root            3 Jul 19  2009 sbin -> bin                                                                         

drwxr-xr-x   12 root     root            0 Jan  1  2007 sys

drwxr-xr-x    2 root     root            0 Jan  1 00:00 tmp

drwxr-xr-x    4 root     root            0 Jul 19  2009 usr

drwxr-xr-x    7 root     root            0 Jan  1 00:00 var

root:/dev> ls -l

crw-rw----    1 root     root       5,   1 Jan  1 00:02 console

crw-rw----    1 root     root      10,  63 Jan  1 00:00 cpu_dma_latency

lrwxrwxrwx    1 root     root           13 Jan  1 00:00 fd -> /proc/self/fd

crw-rw----    1 root     root       1,   7 Jan  1 00:00 full

crw-rw----    1 root     root      89,   0 Jan  1 00:00 i2c-0

crw-rw----    1 root     root       1,  11 Jan  1 00:00 kmsg

crw-rw----    1 root     root      10, 250 Jan  1 00:00 lcd

srw-rw-rw-    1 root     root            0 Jan  1 00:00 log

crw-rw----    1 root     root       1,   1 Jan  1 00:00 mem

crw-rw----    1 root     root      10,  62 Jan  1 00:00 network_latency

crw-rw----    1 root     root      10,  61 Jan  1 00:00 network_throughput

crw-rw----    1 root     root       1,   3 Jan  1 00:00 null

crw-rw----    1 root     root       5,   2 Jan  1 00:00 ptmx

drwxr-xr-x    2 root     root            0 Jan  1  2007 pts

brw-rw----    1 root     root       1,   0 Jan  1 00:00 ram0

brw-rw----    1 root     root       1,   1 Jan  1 00:00 ram1

brw-rw----    1 root     root       1,  10 Jan  1 00:00 ram10

brw-rw----    1 root     root       1,  11 Jan  1 00:00 ram11

brw-rw----    1 root     root       1,  12 Jan  1 00:00 ram12

brw-rw----    1 root     root       1,  13 Jan  1 00:00 ram13

brw-rw----    1 root     root       1,  14 Jan  1 00:00 ram14

brw-rw----    1 root     root       1,  15 Jan  1 00:00 ram15

brw-rw----    1 root     root       1,   2 Jan  1 00:00 ram2

brw-rw----    1 root     root       1,   3 Jan  1 00:00 ram3

brw-rw----    1 root     root       1,   4 Jan  1 00:00 ram4

brw-rw----    1 root     root       1,   5 Jan  1 00:00 ram5

brw-rw----    1 root     root       1,   6 Jan  1 00:00 ram6

brw-rw----    1 root     root       1,   7 Jan  1 00:00 ram7

brw-rw----    1 root     root       1,   8 Jan  1 00:00 ram8

brw-rw----    1 root     root       1,   9 Jan  1 00:00 ram9

crw-rw----    1 root     root       1,   8 Jan  1 00:00 random

crw-rw----    1 root     root     254,   0 Jan  1 00:00 rtc0

lrwxrwxrwx    1 root     root            4 Jan  1 00:00 stderr -> fd/2

lrwxrwxrwx    1 root     root            4 Jan  1 00:00 stdin -> fd/0

lrwxrwxrwx    1 root     root            4 Jan  1 00:00 stdout -> fd/1

crw-rw----    1 root     root       5,   0 Jan  1 00:00 tty

crw-rw----    1 root     root     204,  64 Jan  1 00:00 ttyBF0

crw-rw----    1 root     root       1,   9 Jan  1 00:00 urandom

crw-rw----    1 root     root      10, 130 Jan  1 00:00 watchdog

crw-rw----    1 root     root       1,   5 Jan  1 00:00 zero

root:/dev>

 

Do you have any ideas why spidev node is not working for me?

 

Lukasz

QuoteReplyEditDelete

 

 

2009-07-19 22:14:40     Re: SPI for BF-533 Stamp

Mike Frysinger (UNITED STATES)

Message: 77667   

 

make sure you have spi listed in /proc/devices, and try doing:

find /sys/ -name '*spidev*'

 

also, disable the GPIO SPI bus master in your kernel configuration

QuoteReplyEditDelete

 

 

2009-07-20 14:27:18     Re: SPI for BF-533 Stamp

Lukasz Jaruszewski (POLAND)

Message: 77757   

 

Mike,

 

Below I posted the kernel configuration with disable GPIO SPI bus master:

 

  │ │          --- SPI support 

  │ │          [ ]   Debug support for SPI drivers

  │ │                *** SPI Master Controller Drivers ***  

  │ │          {*}   SPI controller driver for ADI Blackfin5xx 

  │ │          [ ]     SPI bus lock 

  │ │          < >   emulate SPI bus with Blackfin SPORT

  │ │          < >   Utilities for Bitbanging SPI masters

  │ │          < >   GPIO-based bitbanging SPI Master

  │ │                *** SPI Protocol Masters ***  

  │ │          <*>   User mode SPI device driver support 

  │ │          < >   Infineon TLE62X0 (for power switching)

 

This is what I showed when uImage booted up:

 

bfin> bootm 0x1000000

## Booting image at 01000000 ...

   Image Name:   bf533-2.6.30-ADI-2010R1-pre

   Created:      2009-07-20  16:11:26 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    3958792 Bytes =  3.8 MB

   Load Address: 00001000

   Entry Point:  0017e054

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

Starting Kernel at = 17e054

Linux version 2.6.30-ADI-2010R1-pre (root@linux-nhys) (gcc version 4.1.2 (ADI sv

n)) #10 Mon Jul 20 18:10:53 CEST 2009

bootconsole [early_shadow0] enabled

bootconsole [early_BFuart0] enabled

early printk enabled on early_BFuart0

Limiting kernel memory to 56MB due to anomaly 05000263

Board Memory: 128MB

Kernel Managed Memory: 128MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x00101db0

  rodata    = 0x00101db0-0x001540b4

  bss       = 0x00155000-0x001658cc

  data      = 0x001658cc-0x00176000

    stack   = 0x00174000-0x00176000

  init      = 0x00176000-0x0077d000

  available = 0x0077d000-0x037ff000

  DMA Zone  = 0x07f00000-0x08000000

Hardware Trace Active and Enabled

Boot Mode: 0

Blackfin support (C) 2004-2009 Analog Devices, Inc.

Compiled for ADSP-BF533 Rev 0.3

Blackfin Linux support by   blackfin.uclinux.org/

Processor Speed: 398 MHz core clock and 79 MHz System Clock

NOMPU: setting up cplb tables

Instruction Cache Enabled for CPU0

  External memory: cacheable in instruction cache

Data Cache Enabled for CPU0

  External memory: cacheable (write-back) in data cache

Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 14223

Kernel command line: root=/dev/mtdblock0 rw earlyprintk=serial,uart0,57600 conso

le=ttyBF0,57600

NR_IRQS:49

Configuring Blackfin Priority Driven Interrupts

PID hash table entries: 256 (order: 8, 1024 bytes)

console handover:boot [early_BFuart0] boot [early_shadow0]  -> real [ttyBF0]

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory available: 49104k/131072k RAM, (6172k init code, 1027k kernel code, 465k

data, 1024k dma, 73280k reserved)

Calibrating delay loop... 792.57 BogoMIPS (lpj=1585152)

Security Framework initialized

Mount-cache hash table entries: 512

Blackfin Scratchpad data SRAM: 4 KB

Blackfin L1 Data A SRAM: 16 KB (16 KB free)

Blackfin L1 Data B SRAM: 16 KB (16 KB free)

Blackfin L1 Instruction SRAM: 64 KB (52 KB free)

net_namespace: 296 bytes

NET: Registered protocol family 16

Blackfin DMA Controller

stamp_init(): registering device resources

bio: create slab <bio-0> at 0

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 2048 (order: 2, 16384 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

NET: Registered protocol family 1

msgmni has been set to 95

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler cfq registered

TWI LCD Driver v0.00

Serial: Blackfin serial driver

bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 21) is a BFIN-UART

brd: module loaded

smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@cam.org>

eth0: SMC91C11xFD (rev 1) at 20300300 IRQ 40 [nowait]

eth0: Ethernet addr: 00:e0:22:fe:04:33

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_b

ase@ffc00500, dma channel@5

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

i2c /dev entries driver

i2c-gpio i2c-gpio.0: using pins 2 (SDA) and 3 (SCL)

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

TCP cubic registered

NET: Registered protocol family 17

rtc-bfin rtc-bfin: setting system clock to 1970-01-01 01:48:12 UTC (6492)

Freeing unused kernel memory: 6172k freed

dma_alloc_init: dma_page @ 0x00bc6000 - 256 pages at 0x07f00000

                           _____________________________________

        a8888b.           / Welcome to the uClinux distribution \

       d888888b.         /       _     _                         \

       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |

       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |

       8'    .88       \        | |   | |  _ \| | | | \  /        |

       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |

      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |

     dP   .    Y8b.       \   For embedded processors including   |

    d8:'  "  `::88b        \    the Analog Devices Blackfin      /

   d8"         'Y88b        \___________________________________/

  :8P    '      :888

   8a.   :     _a88P         For further information, check out:

._/"Yaa_:   .| 88P|            -   blackfin.uclinux.org/

\    YP"    `| 8P  `.          -   docs.blackfin.uclinux.org/

/     \.___.d|    .'           -   www.uclinux.org/

`--..__)8888P`._.'  jgs/a:f    -   www.analog.com/blackfin

 

Have a lot of fun...

 

 

BusyBox v1.14.2 (2009-07-20 18:07:01 CEST) hush - the humble shell

 

root:/> ls

bin   etc   init  mnt   root  sys   usr

dev   home  lib   proc  sbin  tmp   var

 

root:/> cd dev

root:/dev> ls -al

drwxr-xr-x    3 root     root            0 Jan  1 01:48 .

drwxr-xr-x   14 root     root            0 Jan  1  2007 ..

crw-rw----    1 root     root       5,   1 Jan  1 02:16 console

crw-rw----    1 root     root      10,  63 Jan  1 01:48 cpu_dma_latency

lrwxrwxrwx    1 root     root           13 Jan  1 01:48 fd -> /proc/self/fd

crw-rw----    1 root     root       1,   7 Jan  1 01:48 full

crw-rw----    1 root     root      89,   0 Jan  1 01:48 i2c-0

crw-rw----    1 root     root       1,  11 Jan  1 01:48 kmsg

crw-rw----    1 root     root      10, 250 Jan  1 01:48 lcd

srw-rw-rw-    1 root     root            0 Jan  1 01:48 log

crw-rw----    1 root     root       1,   1 Jan  1 01:48 mem

crw-rw----    1 root     root      10,  62 Jan  1 01:48 network_latency

crw-rw----    1 root     root      10,  61 Jan  1 01:48 network_throughput

crw-rw----    1 root     root       1,   3 Jan  1 01:48 null

crw-rw----    1 root     root       5,   2 Jan  1 01:48 ptmx

drwxr-xr-x    2 root     root            0 Jan  1  2007 pts

brw-rw----    1 root     root       1,   0 Jan  1 01:48 ram0

brw-rw----    1 root     root       1,   1 Jan  1 01:48 ram1

brw-rw----    1 root     root       1,  10 Jan  1 01:48 ram10

brw-rw----    1 root     root       1,  11 Jan  1 01:48 ram11

brw-rw----    1 root     root       1,  12 Jan  1 01:48 ram12

brw-rw----    1 root     root       1,  13 Jan  1 01:48 ram13

brw-rw----    1 root     root       1,  14 Jan  1 01:48 ram14

brw-rw----    1 root     root       1,  15 Jan  1 01:48 ram15

brw-rw----    1 root     root       1,   2 Jan  1 01:48 ram2

brw-rw----    1 root     root       1,   3 Jan  1 01:48 ram3

brw-rw----    1 root     root       1,   4 Jan  1 01:48 ram4

brw-rw----    1 root     root       1,   5 Jan  1 01:48 ram5

brw-rw----    1 root     root       1,   6 Jan  1 01:48 ram6

brw-rw----    1 root     root       1,   7 Jan  1 01:48 ram7

brw-rw----    1 root     root       1,   8 Jan  1 01:48 ram8

brw-rw----    1 root     root       1,   9 Jan  1 01:48 ram9

crw-rw----    1 root     root       1,   8 Jan  1 01:48 random

crw-rw----    1 root     root     254,   0 Jan  1 01:48 rtc0

lrwxrwxrwx    1 root     root            4 Jan  1 01:48 stderr -> fd/2

lrwxrwxrwx    1 root     root            4 Jan  1 01:48 stdin -> fd/0

lrwxrwxrwx    1 root     root            4 Jan  1 01:48 stdout -> fd/1

crw-rw----    1 root     root       5,   0 Jan  1 01:48 tty

crw-rw----    1 root     root     204,  64 Jan  1 01:48 ttyBF0

crw-rw----    1 root     root       1,   9 Jan  1 01:48 urandom

crw-rw----    1 root     root      10, 130 Jan  1 01:48 watchdog

crw-rw----    1 root     root       1,   5 Jan  1 01:48 zero

 

root:/dev> cd ..

root:/> cd proc

root:/proc> ls -al

dr-xr-xr-x   29 root     root            0 Jan  1  2007 .

drwxr-xr-x   14 root     root            0 Jan  1  2007 ..

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 1

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 111

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 112

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 152

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 153

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 154

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 155

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 156

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 162

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 2

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 3

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 4

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 48

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 5

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 6

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 66

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 67

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 68

dr-xr-xr-x    7 root     root            0 Jan  1 02:18 9

-r--r--r--    1 root     root            0 Jan  1 02:18 buddyinfo

dr-xr-xr-x    3 root     root            0 Jan  1 02:18 bus

-r--r--r--    1 root     root            0 Jan  1 02:18 cmdline

-r--r--r--    1 root     root         8258 Jan  1 02:18 config.gz

dr-xr-xr-x    3 root     root            0 Jan  1 02:18 cplbinfo

-r--r--r--    1 root     root            0 Jan  1 02:18 cpuinfo

-r--r--r--    1 root     root            0 Jan  1 02:18 devices

-r--r--r--    1 root     root            0 Jan  1 02:18 diskstats

-r--r--r--    1 root     root            0 Jan  1 02:18 dma

dr-xr-xr-x    2 root     root            0 Jan  1 02:18 driver

-r--r--r--    1 root     root            0 Jan  1 02:18 execdomains

-r--r--r--    1 root     root            0 Jan  1 02:18 filesystems

dr-xr-xr-x    3 root     root            0 Jan  1 02:18 fs

-r--r--r--    1 root     root            0 Jan  1 02:18 gpio

-r--r--r--    1 root     root            0 Jan  1 02:18 interrupts

-r--r--r--    1 root     root            0 Jan  1 02:18 iomem

-r--r--r--    1 root     root            0 Jan  1 02:18 ioports

dr-xr-xr-x   50 root     root            0 Jan  1 02:18 irq

-r--r--r--    1 root     root            0 Jan  1 02:18 kallsyms

-r--------    1 root     root            0 Jan  1 02:18 kmsg

-r--r--r--    1 root     root            0 Jan  1 02:18 loadavg

-r--r--r--    1 root     root            0 Jan  1 02:18 locks

-r--r--r--    1 root     root            0 Jan  1 02:18 maps

-r--r--r--    1 root     root            0 Jan  1 02:18 meminfo

-r--r--r--    1 root     root            0 Jan  1 02:18 misc

-r--r--r--    1 root     root            0 Jan  1 02:18 modules

lrwxrwxrwx    1 root     root           11 Jan  1 02:18 mounts -> self/mounts

-r--r--r--    1 root     root            0 Jan  1 02:18 mtd

lrwxrwxrwx    1 root     root            8 Jan  1 02:18 net -> self/net

-r--r--r--    1 root     root            0 Jan  1 02:18 pagetypeinfo

-r--r--r--    1 root     root            0 Jan  1 02:18 partitions

-r--r--r--    1 root     root            0 Jan  1 02:18 sched_debug

lrwxrwxrwx    1 root     root           64 Jan  1 02:16 self -> 162

-rw-r--r--    1 root     root            0 Jan  1 02:18 slabinfo

-r--r--r--    1 root     root            0 Jan  1 02:18 sram

-r--r--r--    1 root     root            0 Jan  1 02:18 stat

dr-xr-xr-x    1 root     root            0 Jan  1 01:48 sys

dr-xr-xr-x    2 root     root            0 Jan  1 02:18 sysvipc

-rw-r--r--    1 root     root            0 Jan  1 02:18 timer_list

dr-xr-xr-x    4 root     root            0 Jan  1 02:18 tty

-r--r--r--    1 root     root            0 Jan  1 02:18 uptime

-r--r--r--    1 root     root            0 Jan  1 02:18 version

-r--r--r--    1 root     root            0 Jan  1 02:18 vmstat

-r--r--r--    1 root     root            0 Jan  1 02:18 zoneinfo

 

Below you can find commands whose you suggested to typed:

 

root:/proc> cat devices

Character devices:

  1 mem

  5 /dev/tty

  5 /dev/console

  5 /dev/ptmx

10 misc

13 input

89 i2c

128 ptm

136 pts

153 spi

204 ttyBF

254 rtc

 

Block devices:

  1 ramdisk

259 blkext

31 mtdblock

 

root:/proc> find /sys/ -name '*spidev*'

/sys/bus/spi/drivers/spidev

/sys/class/spidev

/sys/module/spidev

 

 

root:/proc> find /sys/ -name '*spi*'

/sys/devices/platform/bfin-spi.0

/sys/devices/platform/bfin-spi.0/spi_master

/sys/devices/platform/bfin-spi.0/spi_master/spi0

/sys/devices/platform/bfin-spi.0/spi0.4

/sys/bus/platform/devices/bfin-spi.0

/sys/bus/platform/drivers/bfin-spi

/sys/bus/platform/drivers/bfin-spi/bfin-spi.0

/sys/bus/spi

/sys/bus/spi/devices/spi0.4

/sys/bus/spi/drivers/spidev

/sys/class/spi_master

/sys/class/spi_master/spi0

/sys/class/spidev

/sys/module/spidev

 

 

root:/proc> find / -name '*spi*'

/sys/devices/platform/bfin-spi.0

/sys/devices/platform/bfin-spi.0/spi_master

/sys/devices/platform/bfin-spi.0/spi_master/spi0

/sys/devices/platform/bfin-spi.0/spi0.4

/sys/bus/platform/devices/bfin-spi.0

/sys/bus/platform/drivers/bfin-spi

/sys/bus/platform/drivers/bfin-spi/bfin-spi.0

/sys/bus/spi

/sys/bus/spi/devices/spi0.4

/sys/bus/spi/drivers/spidev

/sys/class/spi_master

/sys/class/spi_master/spi0

/sys/class/spidev

/sys/module/spidev

/bin/spidev_test

root:/proc>

QuoteReplyEditDelete

 

 

2009-07-20 14:32:33     Re: SPI for BF-533 Stamp

Mike Frysinger (UNITED STATES)

Message: 77759   

 

so run `mdev -s`

QuoteReplyEditDelete

 

 

2009-07-20 14:35:12     Re: SPI for BF-533 Stamp

Lukasz Jaruszewski (POLAND)

Message: 77760   

 

Mike,

 

As you can see I still haven't spidev in /dev directory. Meybe there is some other way to utilize spidev? As I can see spidev is located in /sys/module and /sys/bus/spi/devices/spidev.

 

I will appreciate any suggestions.

 

Lukasz

QuoteReplyEditDelete

 

 

2009-07-20 14:48:29     Re: SPI for BF-533 Stamp

Lukasz Jaruszewski (POLAND)

Message: 77761   

 

This is output after 'mdev -s'

 

root:/dev> ls

console             network_throughput  ram14               random

cpu_dma_latency     null                ram15               rtc0

fd                  ptmx                ram2                stderr

full                pts                 ram3                stdin

i2c-0               ram0                ram4                stdout

kmsg                ram1                ram5                tty

lcd                 ram10               ram6                ttyBF0

log                 ram11               ram7                urandom

mem                 ram12               ram8                watchdog

network_latency     ram13               ram9                zero

root:/dev> mdev -s

root:/dev> ls

console             network_throughput  ram14               random

cpu_dma_latency     null                ram15               rtc0

fd                  ptmx                ram2                stderr

full                pts                 ram3                stdin

i2c-0               ram0                ram4                stdout

kmsg                ram1                ram5                tty

lcd                 ram10               ram6                ttyBF0

log                 ram11               ram7                urandom

mem                 ram12               ram8                watchdog

network_latency     ram13               ram9                zero

root:/dev>

 

Is it possible that I have something wrong with connections?

 

Lukasz

QuoteReplyEditDelete

 

 

2009-07-20 15:39:59     Re: SPI for BF-533 Stamp

Mike Frysinger (UNITED STATES)

Message: 77762   

 

did you disable hotplug or something ?  you should start with the BF533-STAMP_defconfig and only enable the spidev driver.

 

i tested a BF548-EZKIT and it worked fine:

root:/> find /sys/ -name '*spidev*'

/sys/devices/platform/bfin-spi.0/spi0.1/spidev

/sys/devices/platform/bfin-spi.0/spi0.1/spidev/spidev0.1

/sys/bus/spi/drivers/spidev

/sys/class/spidev

/sys/class/spidev/spidev0.1

/sys/module/spidev

 

root:/> cat /sys/class/spidev/spidev0.1/dev

153:0

 

root:/> strace -eopen,mknod mdev -s 2>&1 | grep spidev

open("/sys/class/spidev", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4

open("/sys/class/spidev/spidev0.1", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 5

open("/sys/class/spidev/spidev0.1/dev", O_RDONLY) = 6

mknod("spidev0.1", S_IFCHR|0660, makedev(153, 0)) = 0

 

root:/> ls -l /dev/spidev0.1

crw-rw----    1 root     root     153,   0 Jun 11 20:19 /dev/spidev0.1

QuoteReplyEditDelete

 

 

2009-07-20 16:42:50     Re: SPI for BF-533 Stamp

Lukasz Jaruszewski (POLAND)

Message: 77767   

 

Mike,

 

Could you clarify where I can find BF533-STAMP_defconfig?

 

Lukas

QuoteReplyEditDelete

 

 

2009-07-21 22:23:38     Re: SPI for BF-533 Stamp

Robin Getz (UNITED STATES)

Message: 77801   

 

Lukas:

 

./arch/blackfin/configs/BF533-STAMP_defconfig

 

-Robin

Attachments

Outcomes