Re: Register Access
Jose Mª Ferreiro <[email protected]>
| Newsgroups | gmane.linux.uclinux.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello
I found a similar problem to Christian's, but using the PWM module from
the 5329.
I have solved it creating a driver to access the PWM registers from the
kernel.
But I am yet intrigued by it. I was not able to found why these user
registers were not accesible from userspace. I am using an old 2.16.17
uclinux. I revised SCM PACRx registers and they are all filled with 0
(giving user access, I think). Someone suggested me a cache entry
restriction, but I only can see SDRAM caching at the start code.
What other thing can limit that access?
Thank you,
Jose
El 24/10/2012 3:38, Greg Ungerer escribió:
> Hi Christian,
>
> On 24/10/12 01:06, Christian Gieseler wrote:
>> We have to activate dithering in our Coldfire 5329 device. But it
>> seams,
>> that I cant even read the register values of PLL Control Register
>> (PCR) and
>> PLL Modulation Divider Register (PMDR). The registers should be user
>> readable and writable.
>
> Why do you think they should be user space read/write?
>
>
>> But it seems that I get a bus error because the
>> values do not match the written ones or the reset values if I don┤t
>> write
>> something.
>
> That would seem to indicate that those registers are not user space
> read/write.
>
> Check your settings of the PACRx registers (Peripheral Access Control
> Registers). They power up with the supervisor only access bit set,
> so unless you have changed them you won't get user access.
>
> Regards
> Greg
>
>
>> #define GT_REG_READ_SHORT(Reg, pData)
>> \
>> *pData = ((volatile unsigned short)*((unsigned short *) (Reg)));
>>
>> #define GT_REG_WRITE(Reg,
>> data) \
>> (*(volatile unsigned long *)(Reg)) =data
>>
>> #define PLL_PODR 0xFC0C0000
>> #define PLL_PLLCR 0xFC0C0004
>> #define PLL_PMDR 0xFC0C0008
>> int main(int argc, char *argv[])
>> {
>> unsigned int RegVal=0;
>>
>> //GT_REG_WRITE(MCF_PLL_PLLCR,0x0);
>> GT_REG_WRITE (PLL_PLLCR ,0);
>> GT_REG_WRITE (PLL_PMDR ,0x5);
>> //Setze PLL Control Register
>> GT_REG_WRITE (PLL_PLLCR ,0x87);
>>
>>
>> GT_REG_READ_SHORT (PLL_PLLCR,(unsigned int*)&RegVal);
>> printf ("PLLCR has Value=%x\n",RegVal);
>>
>>
>> return 0;
>> }
>>
>> Does someone have a hint how to write and read these registers? Is
>> something
>> wrong in my code?
>>
>> Best regards
>> Christian
>>
>> _______________________________________________
>> 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
>>
>>
>>
>
>
_______________________________________________
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