Hi,
goon863 wrote:
hi,
I want to read the gpio4 voltag of Micrel KS8695.When use
"IO_ADDRESS",it return "Segmentation fault". Any idea will be thanks.
#include <asm/hardware.h>
#include <asm/irq.h>
#include <asm/io.h>
#define KS8695_GPIO_MODE 0xE600
#define KS8695_GPIO_CTRL 0xE604
#define KS8695_GPIO_DATA 0xE608
#define KS8695_VA_IO_BASE IO_ADDRESS(KS8695_IO_BASE)
#define KS8695_WRITE(offset, v) __raw_writel((v), KS8695_VA_IO_BASE
+ (offset))
#define KS8695_READ(offset) __raw_readl(KS8695_VA_IO_BASE +
(offset))
int main(void)
{
u32 uReg;
printf("haha");
uReg = KS8695_READ(KS8695_GPIO_DATA);
return 0;
}
The KS8695 register addresses are not mapped into user space.
You cannot access them (using __raw_readl(), etc) in a user
space program.
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Chief Software Dude EMAIL: [EMAIL PROTECTED]
Secure Computing Corporation PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev