Re: Register Access
Greg Ungerer <[email protected]>
| Newsgroups | gmane.linux.uclinux.devel |
|---|---|
| Message-ID | <[email protected]> |
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
>
>
>
--
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: [email protected]
SnapGear Group, McAfee PHONE: +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
Milton, QLD, 4064, 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