CubieBoard中文论坛

 找回密码
 立即注册
搜索
热搜: unable
12
返回列表 发新帖
楼主: @allen

A20 SPI 可用测试

[复制链接]
 楼主| 发表于 2013-11-29 11:18:31 | 显示全部楼层
gsoft 发表于 2013-11-29 10:47
我也对照了以下这个表, 只是不知道默认该怎么配置了, 我也就接一个SPI的TFT.

8.5   [spi_devices]

将 bus_num = 2 可以生成了 现在测试 读写
回复 支持 反对

使用道具 举报

发表于 2013-11-29 12:45:27 | 显示全部楼层
@allen 发表于 2013-11-29 11:18
将 bus_num = 2 可以生成了 现在测试 读写

嗯. 晚上回去再试试修改下这些参数. 不知道CT的有哪里可以查到这些参数定义不.

另外能加你QQ沟通吗?
回复 支持 反对

使用道具 举报

发表于 2013-12-5 18:22:21 | 显示全部楼层
LZ,,求帮助,我这个搞不出来了...

http://forum.cubietech.com/forum.php?mod=viewthread&tid=1668#lastpost
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-12-6 09:55:27 | 显示全部楼层
醉月 发表于 2013-12-5 18:22
LZ,,求帮助,我这个搞不出来了...

http://forum.cubietech.com/forum.php?mod=viewthread&tid=1668#lastpo ...

如果是旧的内核,看modalias,这个名字要跟spidev.c中的相同.name =  "spidev"是否一样,还有更新了新的SPI-SUNXI
这是我的配置
[spi_board0]
modalias = "spidev"
max_speed_hz = 12000000
bus_num = 0         设为0
chip_select = 0
mode = 3
full_duplex = 0
manual_cs = 0

spi-sun7i.c.tar.gz

13.55 KB, 下载次数: 11, 下载积分: 金钱 -1

回复 支持 反对

使用道具 举报

发表于 2013-12-6 12:35:53 | 显示全部楼层
@allen 发表于 2013-12-6 09:55
如果是旧的内核,看modalias,这个名字要跟spidev.c中的相同.name =  "spidev"是否一样,还有更新了新的S ...

这个补丁文件中,有一个头文件找不到:
  1. #include <plat/sys_config.h>
复制代码

当我把这个头文件换成:
  1. #include <mach/sys_config.h>
复制代码
它编译的时候又报这个错误:
  1. drivers/spi/spi-sun7i.c: In function ‘sun7i_spi_config_dma’:
  2. drivers/spi/spi-sun7i.c:552:14: error: ‘CHAN_NORMAL’ undeclared (first use in this function)
  3. drivers/spi/spi-sun7i.c:552:14: note: each undeclared identifier is reported only once for each function it appears in
  4. drivers/spi/spi-sun7i.c:551:5: warning: enumeration value ‘CHAN_NORAML’ not handled in switch [-Wswitch]
  5. drivers/spi/spi-sun7i.c: In function ‘sun7i_spi_set_gpio’:
  6. drivers/spi/spi-sun7i.c:1241:13: error: implicit declaration of function ‘gpio_request_ex’ [-Werror=implicit-function-declaration]
  7. drivers/spi/spi-sun7i.c:1295:13: error: implicit declaration of function ‘gpio_release’ [-Werror=implicit-function-declaration]
  8. drivers/spi/spi-sun7i.c: In function ‘sun7i_spi_probe’:
  9. drivers/spi/spi-sun7i.c:1504:28: error: ‘CHAN_NORMAL’ undeclared (first use in this function)
  10. drivers/spi/spi-sun7i.c: At top level:
  11. drivers/spi/spi-sun7i.c:1748:18: error: ‘SW_INT_IRQNO_SPI00’ undeclared here (not in a function)
  12. drivers/spi/spi-sun7i.c:1800:18: error: ‘SW_INT_IRQNO_SPI01’ undeclared here (not in a function)
  13. drivers/spi/spi-sun7i.c:1800:9: error: initializer element is not constant
  14. drivers/spi/spi-sun7i.c:1800:9: error: (near initialization for ‘sun7i_spi1_resources[3].start’)
  15. drivers/spi/spi-sun7i.c:1801:9: error: initializer element is not constant
  16. drivers/spi/spi-sun7i.c:1801:9: error: (near initialization for ‘sun7i_spi1_resources[3].end’)
  17. drivers/spi/spi-sun7i.c:1846:18: error: ‘SW_INT_IRQNO_SPI02’ undeclared here (not in a function)
  18. drivers/spi/spi-sun7i.c:1846:9: error: initializer element is not constant
  19. drivers/spi/spi-sun7i.c:1846:9: error: (near initialization for ‘sun7i_spi2_resources[3].start’)
  20. drivers/spi/spi-sun7i.c:1847:9: error: initializer element is not constant
  21. drivers/spi/spi-sun7i.c:1847:9: error: (near initialization for ‘sun7i_spi2_resources[3].end’)
  22. drivers/spi/spi-sun7i.c:1898:18: error: ‘SW_INT_IRQNO_SPI3’ undeclared here (not in a function)
  23. drivers/spi/spi-sun7i.c:1898:9: error: initializer element is not constant
  24. drivers/spi/spi-sun7i.c:1898:9: error: (near initialization for ‘sun7i_spi3_resources[3].start’)
  25. drivers/spi/spi-sun7i.c:1899:9: error: initializer element is not constant
  26. drivers/spi/spi-sun7i.c:1899:9: error: (near initialization for ‘sun7i_spi3_resources[3].end’)
  27. drivers/spi/spi-sun7i.c: In function ‘sun7i_spi_register_spidev’:
  28. drivers/spi/spi-sun7i.c:1930:5: error: implicit declaration of function ‘script_parser_fetch’ [-Werror=implicit-function-declaration]
  29. drivers/spi/spi-sun7i.c:1931:15: error: ‘SCRIPT_PARSER_OK’ undeclared (first use in this function)
  30. drivers/spi/spi-sun7i.c:1931:12: warning: comparison between pointer and integer [enabled by default]
  31. drivers/spi/spi-sun7i.c:1951:16: warning: comparison between pointer and integer [enabled by default]
  32. drivers/spi/spi-sun7i.c:1956:16: warning: comparison between pointer and integer [enabled by default]
  33. drivers/spi/spi-sun7i.c:1961:16: warning: comparison between pointer and integer [enabled by default]
  34. drivers/spi/spi-sun7i.c:1966:16: warning: comparison between pointer and integer [enabled by default]
  35. drivers/spi/spi-sun7i.c:1971:16: warning: comparison between pointer and integer [enabled by default]
  36. drivers/spi/spi-sun7i.c:1976:10: warning: comparison between pointer and integer [enabled by default]
  37. drivers/spi/spi-sun7i.c: In function ‘sun7i_spi_get_cfg_csbitmap’:
  38. drivers/spi/spi-sun7i.c:2021:15: error: ‘SCRIPT_PARSER_OK’ undeclared (first use in this function)
  39. drivers/spi/spi-sun7i.c:2021:12: warning: comparison between pointer and integer [enabled by default]
  40. drivers/spi/spi-sun7i.c: At top level:
复制代码
回复 支持 反对

使用道具 举报

发表于 2013-12-6 12:40:52 | 显示全部楼层
哦,我忘记说了,我现在这个版本的kernel是 linux -3.3的了,下面是我这个mach/sys_config.h的内容,希望LZ能帮我看一下,谢谢!
  1. /*
  2. * arch/arch/mach-sunxi/include/mach/sys_config.h
  3. * (C) Copyright 2010-2015
  4. * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
  5. * Kevin <Kevin@allwinnertech.com>
  6. *
  7. * sys_config utils (porting from 2.6.36)
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. */

  15. #ifndef __SW_SYS_CONFIG_H
  16. #define __SW_SYS_CONFIG_H

  17. #include "gpio.h"

  18. /*
  19. * define types of script item
  20. * @SCIRPT_ITEM_VALUE_TYPE_INVALID:  invalid item type
  21. * @SCIRPT_ITEM_VALUE_TYPE_INT: integer item type
  22. * @SCIRPT_ITEM_VALUE_TYPE_STR: strint item type
  23. * @SCIRPT_ITEM_VALUE_TYPE_PIO: gpio item type
  24. */
  25. typedef enum {
  26.     SCIRPT_ITEM_VALUE_TYPE_INVALID = 0,
  27.     SCIRPT_ITEM_VALUE_TYPE_INT,
  28.     SCIRPT_ITEM_VALUE_TYPE_STR,
  29.     SCIRPT_ITEM_VALUE_TYPE_PIO,
  30. } script_item_value_type_e;


  31. /*
  32. * define data structure script item
  33. * @val: integer value for integer type item
  34. * @str: string pointer for sting type item
  35. * @gpio: gpio config for gpio type item
  36. */
  37. typedef union {
  38.     int                 val;
  39.     char                *str;
  40.     struct gpio_config  gpio;
  41. } script_item_u;

  42. /*
  43. * script_get_item
  44. *      get an item from script based on main_key & sub_key
  45. * @main_key    main key value in script which is marked by '[]'
  46. * @sub_key     sub key value in script which is left of '='
  47. * @item        item pointer for return value
  48. * @return      type of the item
  49. */
  50. script_item_value_type_e script_get_item(char *main_key, char *sub_key, script_item_u *item);


  51. /*
  52. * script_get_pio_list
  53. *      get gpio list from script baseed on main_key
  54. * @main_key    main key value in script which is marked by '[]'
  55. * @list        list pointer for return gpio list
  56. * @return      count of the gpios
  57. */
  58. int script_get_pio_list(char *main_key, script_item_u **list);

  59. /*
  60. * script_dump_mainkey
  61. *      dump main_key info
  62. * @main_key    main key value in script which is marked by '[]',
  63. *              if NULL, dump all main key info in script
  64. * @return      0
  65. */
  66. int script_dump_mainkey(char *main_key);

  67. #endif
复制代码

回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-12-6 13:15:43 | 显示全部楼层
醉月 发表于 2013-12-6 12:40
哦,我忘记说了,我现在这个版本的kernel是 linux -3.3的了,下面是我这个mach/sys_config.h的内容,希望LZ ...

换3.4内核或添加plat/sys_config.h ,这个是解析script.bin的库非常重要
回复 支持 反对

使用道具 举报

发表于 2013-12-6 14:04:33 | 显示全部楼层
@allen 发表于 2013-12-6 13:15
换3.4内核或添加plat/sys_config.h ,这个是解析script.bin的库非常重要

是这个吗?
https://github.com/cubieboard2/linux-sunxi/tree/sunxi-3.4-cb2

另外,我把android  linux-3.3 替换成linux-3.4 会不会需要修改什么脚本文件呢..
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-12-6 14:53:08 | 显示全部楼层
醉月 发表于 2013-12-6 14:04
是这个吗?
https://github.com/cubieboard2/linux-sunxi/tree/sunxi-3.4-cb2

android 3.3 和  linux-3.4 还是有区别的,肯定不能简单替换,加个库文件吧, 我也没编译过android的驱动
回复 支持 反对

使用道具 举报

发表于 2014-6-5 16:07:51 | 显示全部楼层
这个驱动 能否支持全双工
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|粤ICP备13051116号|cubie.cc---深刻的嵌入式技术讨论社区

GMT+8, 2024-11-23 22:53 , Processed in 0.026520 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2012 Comsenz Inc. | Style by Coxxs

返回顶部