- 论坛徽章:
- 0
|
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 |
|