Chinaunix首页 | 论坛 | 博客
  • 博客访问: 276616
  • 博文数量: 91
  • 博客积分: 2105
  • 博客等级: 大尉
  • 技术积分: 1050
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-14 19:30
文章分类
文章存档

2011年(11)

2010年(64)

2009年(16)

我的朋友

分类: LINUX

2010-04-16 09:36:28

SEP4020 spi总线驱动的实现(linux-2.6.27内核),今天终于好了,O(∩_∩)O~发帖纪念下,关于具体的步骤我会今天整理成具体的文档,里面还有待完善的。。。实现方式参考了一些开源的源码,这里就把我spidev_test.c生成的的a.out运行的结果贴出来,里面很多的dbg_msg吧,调试时用的。。。
/ # ./a.out 
<7>SPI: sep4020_spi_setupxfer: we get the clk rate  is 96

<7>spidev spi0.0: setting pre-scaler to 96 (hz 500000)
<7>SPI: sep4020_spi_setupxfer: the value of div is 96

<7>SPI: sep4020_spi_setupxfer: the value of BITBANG_CS_INACTIVE is 0

<7>SPI: sep4020_spi_chipsel: we have enter the sep4020_spi_chipsel

<7>spidev spi0.0: sep4020_spi_setup: mode 0, 8 bpw, 500000 hz
<7>spidev spi0.0: spi mode 00
<7>SPI: sep4020_spi_setupxfer: we get the clk rate  is 96

<7>spidev spi0.0: setting pre-scaler to 96 (hz 500000)
<7>SPI: sep4020_spi_setupxfer: the value of div is 96

<7>SPI: sep4020_spi_setupxfer: the value of BITBANG_CS_INACTIVE is 0

<7>SPI: sep4020_spi_chipsel: we have enter the sep4020_spi_chipsel

<7>spidev spi0.0: sep4020_spi_setup: mode 0, 8 bpw, 500000 hz
<7>spidev spi0.0: 8 bits per word
<7>SPI: sep4020_spi_setupxfer: we get the clk rate  is 96

<7>spidev spi0.0: setting pre-scaler to 96 (hz 500000)
<7>SPI: sep4020_spi_setupxfer: the value of div is 96

<7>SPI: sep4020_spi_setupxfer: the value of BITBANG_CS_INACTIVE is 0

<7>SPI: sep4020_spi_chipsel: we have enter the sep4020_spi_chipsel

<7>spidev spi0.0: sep4020_spi_setup: mode 0, 8 bpw, 500000 hz
<7>spidev spi0.0: 500000 Hz (max)
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)
<7>SPI: sep4020_spi_setupxfer: we get the clk rate  is 96

<7>spidev spi0.0: setting pre-scaler to 96 (hz 500000)
<7>SPI: sep4020_spi_setupxfer: the value of div is 96

<7>SPI: sep4020_spi_chipsel: we have enter the sep4020_spi_chipsel

<7>SPI: sep4020_spi_chipsel: we have enble spi in the sep4020_spi_chipsel

<7>spidev spi0.0: txrx: tx c1c0c000, rx c1c0c000, len 38
<7>SPI: sep4020_spi_txrx: the value of SSIENR is :0x1 

<7>SPI: sep4020_spi_txrx: in sep4020_spi_irq before enable spi in txrx 

<7>SPI: sep4020_spi_txrx: have enble spi in txrx 

<7>SPI: sep4020_spi_txrx: we begin to sent the first byte:0xff

<7>SPI: sep4020_spi_txrx: SSI_IMR:0x1e ,SSI_ISR:0x0 ,SSI_RISR:0x1 ,SSI_SR:0x2

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x2 ,SSI_ISR:0x4  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x2 ,SSI_ISR:0x4  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x2 ,SSI_ISR:0x4  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x2 ,SSI_ISR:0x4  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x2 ,SSI_ISR:0x4  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x2 ,SSI_ISR:0x4  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0x40 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x2 ,SSI_ISR:0x4  

<7>SPI: sep4020_spi_irq: the recieve data is:0x40 

<7>SPI: sep4020_spi_irq: the send data is:0x0 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x4  

<7>SPI: sep4020_spi_irq: the recieve data is:0x0 

<7>SPI: sep4020_spi_irq: the send data is:0x0 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0x0 

<7>SPI: sep4020_spi_irq: the send data is:0x0 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0x0 

<7>SPI: sep4020_spi_irq: the send data is:0x0 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0x0 

<7>SPI: sep4020_spi_irq: the send data is:0x95 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0x95 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xff 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xff 

<7>SPI: sep4020_spi_irq: the send data is:0xde 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xde 

<7>SPI: sep4020_spi_irq: the send data is:0xad 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xad 

<7>SPI: sep4020_spi_irq: the send data is:0xbe 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xbe 

<7>SPI: sep4020_spi_irq: the send data is:0xef 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xef 

<7>SPI: sep4020_spi_irq: the send data is:0xba 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xba 

<7>SPI: sep4020_spi_irq: the send data is:0xad 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xad 

<7>SPI: sep4020_spi_irq: the send data is:0xbc 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xbc 

<7>SPI: sep4020_spi_irq: the send data is:0xac 

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_SR:0x0 ,SSI_ISR:0x6  

<7>SPI: sep4020_spi_irq: the recieve data is:0xac 

<7>SPI: sep4020_spi_irq: I am done

<7>SPI: sep4020_spi_irq: SSI_IMR:0x1e ,SSI_ISR:0x0 ,SSI_RISR:0x0 ,SSI_SR:0x6

<7>SPI: sep4020_spi_irq: come to irq_done

<7>SPI: sep4020_spi_txrx: the read data is :0

<7>SPI: sep4020_spi_setupxfer: we get the clk rate  is 96

<7>spidev spi0.0: setting pre-scaler to 96 (hz 500000)
<7>SPI: sep4020_spi_setupxfer: the value of div is 96

<7>SPI: sep4020_spi_chipsel: we have enter the sep4020_spi_chipsel


FF FF FF FF FF FF 
40 00 00 00 00 95 
FF FF FF FF FF FF 
FF FF FF FF FF FF 
FF FF FF FF FF FF 
DE AD BE EF BA AD 
BC AC 
/ # 
阅读(729) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~