Jack <jackrubby2...@gmail.com> wrote:
>Anders Darander <anders@...> writes:
>
>Thanks Anders,
>
>But I have this problem not only for GPIOs, but also for other
>registers.

Well, my comment about dereferencing physical addresses using *-only, wasn't 
restricted to GPIO's only. It was regarding physical addresses in general... 

Once again, I've not used this platform, this I'm not able to be too specific. 

>For example, I tried to change DTW bits of PROCTL register in eSDH but
>I get
>"Kernel access of bad area" again. My simple code is here :

>int init_module(void)
>{
>       
>       // e500 Core View To Power Architecture CCSR: 0x0_FF70_0000
>       
>       volatile uint32_t * eSDH_PROCTL = (volatile uint32_t *)(0xFF72E028);
>
>       *(eSDH_PROCTL) = 0x00000002;

I think that you should try to look at some code from the kernel that accesses 
registers on your platform. For instance 
http://lxr.free-electrons.com/source/sound/soc/fsl/p1022_ds.c?v=3.4 (this is 
just a randomly chosen file that relates to P1022. 

Have a look at how guts_phys is declared, as well as how guts later on is both 
declared and initialized from guts_phys. 
When the registers are actually read / written, this driver uses the 
clrsetbits_XX. These functions then implements the actual reading and writing 
of the registers. 

(Note again, I've just looked at this file and p1022 for a couple of minutes). 

Cheers, 
Anders 

-- 
ChargeStorm AB / eStorm 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to