[PATCH] Modify raspberrypi mm_config_table to map GPIO and registers.

Hesham Moustafa heshamelmatary at gmail.com
Tue Oct 15 20:11:27 UTC 2013


On Tue, Oct 15, 2013 at 8:59 AM, Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> On 2013-10-14 18:16, Hesham Moustafa wrote:
>
>>
>> On Mon, Oct 14, 2013 at 6:03 PM, Gedare Bloom <gedare at rtems.org
>> <mailto:gedare at rtems.org>> wrote:
>>
>>     On Mon, Oct 14, 2013 at 11:54 AM, Hesham Moustafa
>>     <heshamelmatary at gmail.com <mailto:heshamelmatary at gmail.**com<heshamelmatary at gmail.com>>>
>> wrote:
>>      >
>>      >
>>      >
>>      > On Mon, Oct 14, 2013 at 4:02 PM, Sebastian Huber
>>      > <sebastian.huber at embedded-**brains.de<sebastian.huber at embedded-brains.de>
>>     <mailto:sebastian.huber@**embedded-brains.de<sebastian.huber at embedded-brains.de>>>
>> wrote:
>>      >>
>>      >> On 2013-10-14 15:34, Hesham AL-Matary wrote:
>>      >>>
>>      >>> diff --git a/c/src/lib/libbsp/arm/**
>> raspberrypi/startup/mm_config_**table.c
>>      >>> b/c/src/lib/libbsp/arm/**raspberrypi/startup/mm_config_**table.c
>>      >>> index 5436a76..2b748b2 100644
>>      >>> --- a/c/src/lib/libbsp/arm/**raspberrypi/startup/mm_config_**
>> table.c
>>      >>> +++ b/c/src/lib/libbsp/arm/**raspberrypi/startup/mm_config_**
>> table.c
>>      >>> @@ -42,7 +42,7 @@ bsp_mm_config_table[] = {
>>      >>>     }, {
>>      >>>       .begin = (uint32_t) bsp_section_text_begin,
>>      >>>       .end = (uint32_t) bsp_section_text_end,
>>      >>> -    .flags = ARMV7_MMU_CODE_CACHED
>>      >>> +    .flags = ARMV7_MMU_READ_WRITE
>>      >>
>>      >>
>>      >> What is the problem with the cache?  Did the cache previously
>> work?
>>      >
>>      > There is a problem with applying a Read-Only permissions in
>> general to this
>>      > area for RaspberryPi BSP.
>>     Any idea why? Letting the text region be read-write is overly
>>     permissive, as RTEMS does not generally use self-modifying code.
>>
>> Not sure about the reason, I had to test (i.e., change attributes) every
>> entry in
>>   the table and finally found that this section causes the problem. I
>> could not use
>> other debugging methods because the BSP is new and lacks a driver to
>> remotely
>> debug, and I could not also use printf as it's a startup code. Maybe this
>> section
>> overlaps other section (as its minimum size is 1 MB and it's aligned)
>> which is written later (e.g., vector table area). ticker.exe only works
>> with this
>> modification.
>>
>
> You can add a gap between the read-only and read-write sections with the
>
> bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ?
> bsp_section_rwbarrier_align : 1M;
>
> I tried out this solution but unfortunately there is no effect.


> symbol which may be provided by the BSP specific linker command file.
>
> You can also use Qemu to debug this problem.
>
> Qemu did not work for me for RaspberryPi BSP. I checked out the repo here
[1] and built
it successfully. I ran ticker.exe with the following command line but the
GUI window shows
blank black screen.

"qemu-system-arm -kernel kernel.img -cpu arm1176 -m 128 -M raspi -serial
stdio -append "rw dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1024
bcm2708_fb.fbheight=768 bcm2708.boardrev=0xf bcm2708.serial=0xcad0eedf
smsc95xx.macaddr=B8:27:EB:D0:EE:DF sdhci-bcm2708.emmc_clock_freq=100000000
vc_mem.mem_base=0x1c000000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0
console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline
rootwait" -snapshot -sd /home/hesham/ISOs/2013-07-26-wheezy-raspbian.img -d
guest_errors"

[1] https://github.com/Torlus/qemu-rpi

>
>
>>      >>
>>      >>
>>      >>
>>      >>>     }, {
>>      >>>       .begin = (uint32_t) bsp_section_rodata_begin,
>>      >>>       .end = (uint32_t) bsp_section_rodata_end,
>>      >>> @@ -63,8 +63,12 @@ bsp_mm_config_table[] = {
>>      >>>       .begin = (uint32_t) bsp_section_stack_begin,
>>      >>>       .end = (uint32_t) bsp_section_stack_end,
>>      >>>       .flags = MMU_DATA_READ_WRITE
>>      >>> +  }, {
>>      >>> +    .begin = 0x20000000,
>>      >>> +    .end = 0x20FFFFFF,
>>      >>> +    .flags = ARMV7_MMU_DATA_READ_WRITE
>>      >>
>>      >>
>>      >> What is this for an area?
>>      >
>>      > It's for Raspberry GPIO pins and other registers (defined at
>>      > raspbberrypi.h).
>>
>
> Is this the correct setting for devices?
>
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> E-Mail  : sebastian.huber at embedded-**brains.de<sebastian.huber at embedded-brains.de>
> PGP     : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> ______________________________**_________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/**listinfo/rtems-devel<http://www.rtems.org/mailman/listinfo/rtems-devel>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20131015/dd93a082/attachment-0001.html>


More information about the devel mailing list