免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1034 | 回复: 0
打印 上一主题 下一主题

gpio [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-03-05 23:32 |只看该作者 |倒序浏览
Gpio 2410
1. in  \include\asm-arm\arch-s3c2410\hardware.h , I see
*   s3c2410_gpio_pullup(S3C2410_GPB0, 0);
*   s3c2410_gpio_pullup(S3C2410_GPE8, 0);
*/
extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);

things above make me think in write_gpio_bit(x,v), x shall be S3C2410_GPB0, but where is the hearder which includes this faction?
Not in  /io.h
Not in the whole /arm-arch
Not in any folder
I try many times, but no result.
2.then I know from net that write_gpio_bit is defined in mizi_linux kernel, and they tell me there is no relationship between the function and 2410 user mannul, it is just a linux function.so I get a 2.4 kernel from D:\useful softwares\FriendlyARM\ ,and find out there is a file named S3C2410.h with write_gpio_bit and anything in it, which I don’t have in yctek 2.6 kernel. That mean I can not mean to use write_gpio_bit, too bad!
3.below is  what I find out in friendly-arm2.6 kernel/include/../regs-gpio.h
#define GPIO_H6    MAKE_GPIO_NUM(PORTH_OFS, 6)
#define GPIO_H7    MAKE_GPIO_NUM(PORTH_OFS, 7)
#define GPIO_H8    MAKE_GPIO_NUM(PORTH_OFS, 8)
#define write_gpio_bit_clear(x) \
            ({ GPDAT(GRAB_PORT((x))) &= ~(0x1
4. the first 19 pages of both yc-reg and fa-reg arm almost the same(only small differences), but fa-reg has 25 pages.
5.
http://www.gelato.unsw.edu.au/lxr/source/arch/alpha/kernel/io.c#L77
this website is heaven of kernel hackers, with its help I trace s3c2410_set_pin to the deepest heart of kernel, and finally found some assembly language. One thing I know is not all the defination of the function you used is in include header files.e.g. one functong that is used to define s3c2410_set_pin, is defined in arch/../..,
now what I believe all finctions, if you trace it to the buttom shall be define as assembly lanage, and if you can not find it in the kernel source, then it must be in gcc-as tool.

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/56913/showart_490190.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP