RE: [uClinux-dev] Controlling GPIO on coldfire
> Hi Dan, > > Dan Snyder wrote: > > I am attempting to use the hardware encryption support provided by the 5271 > > and am running into this problem. (Access Error Exception when attempting > > to read/write from userspace). How can I modify the kernel to allow access > > to 0x4000 through 0x401b009f ? > > Section 11.4 of the 5271 RM seems to be what you are looking for. > It describes the access control implemented on this part. > > > > I have been poking through the kernel headers for hours now and I am still > > clueless. > > You probably won't find anything associated with this in the headers, > since the kernel doesn't generally support any of these types of > features. > > > > I believe I need to add the address range to > > /arch/m68knommu/platform/527x/config.c but I am not sure if this is correct > > or exactly how to do so. > > config.c would be an ok place to set this. I suspect you want > to add something like: > > writeb(0x04, 0x4030) > > which sets the GPACR0 register to allows kernel and user > modes to have read/write access. > > > > Any guidance would be much appreciated. Thank you > > Regards > Greg Thank you Greg, this worked perfectly. The reference manual had confused me by its suggestion to use the MOVEC instruction to set these registers. - Dan ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] Controlling GPIO on coldfire
Hi Dan, Dan Snyder wrote: I am attempting to use the hardware encryption support provided by the 5271 and am running into this problem. (Access Error Exception when attempting to read/write from userspace). How can I modify the kernel to allow access to 0x4000 through 0x401b009f ? Section 11.4 of the 5271 RM seems to be what you are looking for. It describes the access control implemented on this part. I have been poking through the kernel headers for hours now and I am still clueless. You probably won't find anything associated with this in the headers, since the kernel doesn't generally support any of these types of features. I believe I need to add the address range to /arch/m68knommu/platform/527x/config.c but I am not sure if this is correct or exactly how to do so. config.c would be an ok place to set this. I suspect you want to add something like: writeb(0x04, 0x4030) which sets the GPACR0 register to allows kernel and user modes to have read/write access. Any guidance would be much appreciated. Thank you Regards Greg Greg Ungerer -- Principal EngineerEMAIL: g...@snapgear.com SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] Controlling GPIO on coldfire
> Hi Valentin, > > Valentin Favreau wrote: > > I'm new on uClinux/coldifre and I have a problem with the GPIO. > > > > I found, on the Internet, that I just need to set up a pointer to the > > I/O address to access to the I/O but when I run my application on > > uClinux the error message "Memory Fault" appears and my application quit. > > > > Here is my simple test code: > > > > #define GPTADR (*(volatile unsigned char *)0x401a001d) > > #define GPTADDR (*(volatile unsigned char *)0x401a001e) > > > > int main(void){ > > GPTADDR = 0xFF; > > > > return 0; > > } > > > > I'm working on the DNP/5280 board, Coldfire 5282. > > I use this command to compile my code: > > m68k-uclinux-gcc -Wall -m5307 -Wl,-elf2flt -Os -o hello hello.c -lc > > > > Does anyone has an idea to solve my problem? > > On some platforms, this can be due to the protection register > settings of some ColdFire CPU's. They will generate a trap on > user mode access to system registers. (You can change this > behavior so that they are allowed ofcourse - but the kernel > will have to do it). > > Regards > Greg > > Greg - I am attempting to use the hardware encryption support provided by the 5271 and am running into this problem. (Access Error Exception when attempting to read/write from userspace). How can I modify the kernel to allow access to 0x4000 through 0x401b009f ? I have been poking through the kernel headers for hours now and I am still clueless. I believe I need to add the address range to /arch/m68knommu/platform/527x/config.c but I am not sure if this is correct or exactly how to do so. Any guidance would be much appreciated. Thank you - Dan ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] Controlling GPIO on coldfire
Thanks for your answers. I tried to include coldfire.h and m5282sim.h but I have the same error. With the ssvhwa module it works so I'm going to use this. Regards Valentin 2008/8/15 Greg Ungerer <[EMAIL PROTECTED]> > Hi Valentin, > > > Valentin Favreau wrote: > >> I'm new on uClinux/coldifre and I have a problem with the GPIO. >> >> I found, on the Internet, that I just need to set up a pointer to the I/O >> address to access to the I/O but when I run my application on uClinux the >> error message "Memory Fault" appears and my application quit. >> >> Here is my simple test code: >> >> #define GPTADR (*(volatile unsigned char *)0x401a001d) >> #define GPTADDR (*(volatile unsigned char *)0x401a001e) >> >> int main(void){ >>GPTADDR = 0xFF; >> >>return 0; >> } >> >> I'm working on the DNP/5280 board, Coldfire 5282. >> I use this command to compile my code: >> m68k-uclinux-gcc –Wall –m5307 –Wl,-elf2flt –Os –o hello hello.c –lc >> >> Does anyone has an idea to solve my problem? >> > > On some platforms, this can be due to the protection register > settings of some ColdFire CPU's. They will generate a trap on > user mode access to system registers. (You can change this > behavior so that they are allowed ofcourse - but the kernel > will have to do it). > > Regards > Greg > > > > Greg Ungerer -- Chief Software Dude EMAIL: [EMAIL PROTECTED] > Secure Computing CorporationPHONE: +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 > uClinux-dev@uclinux.org > http://mailman.uclinux.org/mailman/listinfo/uclinux-dev > This message was resent by uclinux-dev@uclinux.org > To unsubscribe see: > http://mailman.uclinux.org/mailman/options/uclinux-dev > ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] Controlling GPIO on coldfire
Hi Valentin, Valentin Favreau wrote: I'm new on uClinux/coldifre and I have a problem with the GPIO. I found, on the Internet, that I just need to set up a pointer to the I/O address to access to the I/O but when I run my application on uClinux the error message "Memory Fault" appears and my application quit. Here is my simple test code: #define GPTADR (*(volatile unsigned char *)0x401a001d) #define GPTADDR (*(volatile unsigned char *)0x401a001e) int main(void){ GPTADDR = 0xFF; return 0; } I'm working on the DNP/5280 board, Coldfire 5282. I use this command to compile my code: m68k-uclinux-gcc –Wall –m5307 –Wl,-elf2flt –Os –o hello hello.c –lc Does anyone has an idea to solve my problem? On some platforms, this can be due to the protection register settings of some ColdFire CPU's. They will generate a trap on user mode access to system registers. (You can change this behavior so that they are allowed ofcourse - but the kernel will have to do it). Regards Greg Greg Ungerer -- Chief Software Dude EMAIL: [EMAIL PROTECTED] Secure Computing CorporationPHONE: +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 uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] Controlling GPIO on coldfire
Message: 1 Date: Thu, 14 Aug 2008 15:31:06 +0200 From: "Valentin Favreau" <[EMAIL PROTECTED]> Subject: [uClinux-dev] Controlling GPIO on coldfire To: uclinux-dev@uclinux.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="windows-1252" Hey, I'm new on uClinux/coldifre and I have a problem with the GPIO. I found, on the Internet, that I just need to set up a pointer to the I/O address to access to the I/O but when I run my application on uClinux the error message "Memory Fault" appears and my application quit. Here is my simple test code: #define GPTADR (*(volatile unsigned char *)0x401a001d) #define GPTADDR (*(volatile unsigned char *)0x401a001e) int main(void){ GPTADDR = 0xFF; return 0; } I'm working on the DNP/5280 board, Coldfire 5282. I use this command to compile my code: m68k-uclinux-gcc –Wall –m5307 –Wl,-elf2flt –Os –o hello hello.c –lc Does anyone has an idea to solve my problem? Thanks a lot! Valentin. -- next part -- An HTML attachment was scrubbed... URL: http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20080814/dc6c/attachment-0001.html -- Valentin Are you sure your GPIO addresses are correct? It will depend on the value of the MBAR register. I do direct I/O from userspace. I include the following header files then access as shown. In my case I am using a MCF5272 and accessing GPIO port C. There is also a m5282sim.h file. #include #include ... pcdat = *(volatile unsigned short *) (MCF_MBAR + MCFSIM_PCDAT); pcdat &= 0xfeff; *(volatile unsigned short *) (MCF_MBAR + MCFSIM_PCDAT) = pcdat; Hope it helps, Mark ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] Controlling GPIO on coldfire
Am Donnerstag, 14. August 2008 15:31:06 schrieb Valentin Favreau: > I'm working on the DNP/5280 board, Coldfire 5282. Hi, For the dilnet-pc there exist the ssvhwa module. This is a driver module for accessing ports/mem from the userspace. This software is on your CD from SSV. Regards Wolf -- Tradition heißt, das Feuer weiterzutragen und nicht die Asche anzubeten - Gustav Mahler ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev