Re: [PATCH 00/10] Raspberry Pi 2 (BCM2836) SMP support
Hello Chris and others, On Sunday 11 of September 2016 08:53:09 Chris Johns wrote: > On 09/09/2016 17:47, Sebastian Huber wrote: > > On 09/09/16 09:43, Pavel Pisa wrote: > >> Hello Chris and others, > >> > >> On Friday 09 of September 2016 02:06:19 Chris Johns wrote: > >>> >On 09/09/2016 07:46, Pavel Pisa wrote: > > >I have provided simple bsp_reset() for Raspberry Pi and pushed it > > into > > > >master. > >>> > > >>> >Thank you. Is the reset on exit on by default? I rebuilt without a BSP > >>> >opt and the Rpi2 did not reset. I see a reference to > >>> >BSP_RESET_BOARD_AT_EXIT but I do not know what the default is. > >>> > > >>> >I think*all* RTEMS BSPs should reset on exit and shut-down by > >>> > default. It is the normal production setting for most systems. > >> > >> Mainly for others, the BSP default cleanup operations > >> selection mechanism is defined in > >> > >>rtems/c/src/aclocal/bsp-bspcleanup-options.m4 > >> > >> RTEMS_BSP_CLEANUP_OPTIONS > >> dnl USAGE: > >> dnlRTEMS_BSP_CLEANUP_OPTIONS([0|1], [0|1], [0|1]) > >> dnl WHERE: > >> dnlargument 1 indicates the default value for > >> BSP_PRESS_KEY_FOR_RESET dnlargument 2 indicates the default value > >> for BSP_RESET_BOARD_AT_EXIT dnlargument 3 indicates the default > >> value for > >> BSP_PRINT_EXCEPTION_CONTEXT > > > > Maybe it makes sense to remove the ability to change the default, so > > what all BSPs have the same defaults. You can change the behaviour via > > the configure command line if needed. > > Yes I think this is the way we should head. Any BSP which does not reset > and start again by default needs to be changed making the default state > for a BSP production ready. This statement covers this configure option > plus it covers things like pressing a key which the PC BSP has on by > default and should be defaulted to off. May it be that RTEMS_BSP_CLEANUP_OPTIONS should not define default but provide information which options are supported for given BSP. Best wishes, Pavel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 00/10] Raspberry Pi 2 (BCM2836) SMP support
On 09/09/2016 17:47, Sebastian Huber wrote: On 09/09/16 09:43, Pavel Pisa wrote: Hello Chris and others, On Friday 09 of September 2016 02:06:19 Chris Johns wrote: >On 09/09/2016 07:46, Pavel Pisa wrote: > >I have provided simple bsp_reset() for Raspberry Pi and pushed it into > >master. > >Thank you. Is the reset on exit on by default? I rebuilt without a BSP >opt and the Rpi2 did not reset. I see a reference to >BSP_RESET_BOARD_AT_EXIT but I do not know what the default is. > >I think*all* RTEMS BSPs should reset on exit and shut-down by default. >It is the normal production setting for most systems. Mainly for others, the BSP default cleanup operations selection mechanism is defined in rtems/c/src/aclocal/bsp-bspcleanup-options.m4 RTEMS_BSP_CLEANUP_OPTIONS dnl USAGE: dnlRTEMS_BSP_CLEANUP_OPTIONS([0|1], [0|1], [0|1]) dnl WHERE: dnlargument 1 indicates the default value for BSP_PRESS_KEY_FOR_RESET dnlargument 2 indicates the default value for BSP_RESET_BOARD_AT_EXIT dnlargument 3 indicates the default value for BSP_PRINT_EXCEPTION_CONTEXT Maybe it makes sense to remove the ability to change the default, so what all BSPs have the same defaults. You can change the behaviour via the configure command line if needed. Yes I think this is the way we should head. Any BSP which does not reset and start again by default needs to be changed making the default state for a BSP production ready. This statement covers this configure option plus it covers things like pressing a key which the PC BSP has on by default and should be defaulted to off. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 00/10] Raspberry Pi 2 (BCM2836) SMP support
On 09/09/16 09:43, Pavel Pisa wrote: Hello Chris and others, On Friday 09 of September 2016 02:06:19 Chris Johns wrote: >On 09/09/2016 07:46, Pavel Pisa wrote: > >I have provided simple bsp_reset() for Raspberry Pi and pushed it into > >master. > >Thank you. Is the reset on exit on by default? I rebuilt without a BSP >opt and the Rpi2 did not reset. I see a reference to >BSP_RESET_BOARD_AT_EXIT but I do not know what the default is. > >I think*all* RTEMS BSPs should reset on exit and shut-down by default. >It is the normal production setting for most systems. Mainly for others, the BSP default cleanup operations selection mechanism is defined in rtems/c/src/aclocal/bsp-bspcleanup-options.m4 RTEMS_BSP_CLEANUP_OPTIONS dnl USAGE: dnlRTEMS_BSP_CLEANUP_OPTIONS([0|1], [0|1], [0|1]) dnl WHERE: dnlargument 1 indicates the default value for BSP_PRESS_KEY_FOR_RESET dnlargument 2 indicates the default value for BSP_RESET_BOARD_AT_EXIT dnlargument 3 indicates the default value for BSP_PRINT_EXCEPTION_CONTEXT Maybe it makes sense to remove the ability to change the default, so what all BSPs have the same defaults. You can change the behaviour via the configure command line if needed. -- 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.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 00/10] Raspberry Pi 2 (BCM2836) SMP support
Hello Chris, On Thursday 08 of September 2016 09:14:00 Chris Johns wrote: > On 05/09/2016 00:38, Alan Cudmore wrote: > > I applied your patches, and verified that my apps still work on the > > Raspberry Pi 1 ( Pi Zero ). Now I am moving to the Pi 2 for some tests. > > I have verified a few tests running on RPi2 no-smp using HEAD on master. > Well done to all who have made this happen, the support is looking > really nice. > > My only issue is the BSP does not reset when it exits. I think all RPi > variants should reset once finished because it will be a big help to > automating test runs with the rtems-test command. I have provided simple bsp_reset() for Raspberry Pi and pushed it into master. I have not defined BSP specific bspclean.c. May it be that there could be some problem with SMP shutdown without #ifdef RTEMS_SMP if (src == RTEMS_FATAL_SOURCE_SMP && code == SMP_FATAL_SHUTDOWN_RESPONSE) { while (true) { _ARM_Wait_for_event(); } } #endif But for simple testing it seems to work. Best wishes, Pavel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 00/10] Raspberry Pi 2 (BCM2836) SMP support
On 05/09/2016 00:38, Alan Cudmore wrote: I applied your patches, and verified that my apps still work on the Raspberry Pi 1 ( Pi Zero ). Now I am moving to the Pi 2 for some tests. I have verified a few tests running on RPi2 no-smp using HEAD on master. Well done to all who have made this happen, the support is looking really nice. My only issue is the BSP does not reset when it exits. I think all RPi variants should reset once finished because it will be a big help to automating test runs with the rtems-test command. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 00/10] Raspberry Pi 2 (BCM2836) SMP support
Hi Pavel, Thanks for the information. I will try to enable SMP in my application too and see how that works. I do have a raspberry Pi 3, but I think the UART is different. The original UART from the processor is used for the Bluetooth module, and the UART pins are now connected to the mini-uart port on the Pi. So there will have to be some changes. I tried booting with HDMI as well, but that did not work. But it is exciting to see SMP code running on the Pi 2. Thanks, Alan > On Sep 4, 2016, at 12:14 PM, Pavel Pisawrote: > > Hello Alan, > > On Sunday 04 of September 2016 16:38:36 Alan Cudmore wrote: >> Hi Pavel, >> I applied your patches, and verified that my apps still work on the >> Raspberry Pi 1 ( Pi Zero ). Now I am moving to the Pi 2 for some tests. >> >> When building for the Pi 2, I need to use the —enable-smp configure switch, >> correct? > > Yes. There is even added configure option RASPBERRYPI_CPUS which controls > number of CPUs reported trough linker script to the application. > The default is all four (4) when --enable-smp is set. If it is not set > then it is set to 1. I have not solved misconfiguration which can > be caused by selection --enable-smp for RPi1. It fails horribly > because some peripherals referenced by SMP code are not available. > >> When I build the raspberrypi2 BSP with —enable-smp and —enable-tests, the >> smpfatal08 test does not compile. It has multiple definition errors like >> the following: >> ../../../../../raspberrypi2/lib/librtemsbsp.a(libbsp_a-bspsmp.o): In >> function `_CPU_SMP_Get_current_processor': >> /Users/alan/rtems/build/build-pavel-tmp/arm-rtems4.12/c/raspberrypi2/lib/li >> bbsp/arm/raspberrypi/../../../../../.././raspberrypi2/lib/include/rtems/scor >> e/cpu.h:522: multiple definition of `_CPU_SMP_Start_processor' >> init.o:/Users/alan/rtems/build/build-pavel-tmp/arm-rtems4.12/c/raspberrypi2 >> /testsuites/smptests/smpfatal08/../../../../../../../../rtems-src/rtems-pave >> l/c/src/../../testsuites/smptests/smpfatal08/init.c:60: first defined here > > I have tried complete tests build and this one fails for me as well. > I have removed references to smpfatal08 from lists in the file > > arm-rtems4.12/c/raspberrypi2/testsuites/smptests/Makefile > > The test seems to check cpukit core by replacing BSP provided > CPU management functions by some dummy/test ones and for given > setup the original ones are pull in together with some another > symbol and result is clash. > > Then all other tests build OK. I have tried many of them. I have > noticed only one failure (testsuites/smptests/smpmutex01) > > *** BEGIN OF TEST SMPMUTEX 1 *** > ../../../../../../../../../git/rtems/c/src/../../testsuites/smptests/smpmutex01/init.c: > 184 expected == actual > > Has that problem been spotted on Zynq or Altera too? > >> But I tried several of the SMP tests that did compile before this one and >> they are working on my Raspberry Pi 2! >> >> When I build with just the samples, rather than the full test suite, the >> build completes, and I can link and run my application just like the Pi. > > If you build own application then you need to to include something > like > > #define CONFIGURE_SMP_MAXIMUM_PROCESSORS 2 > #define CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP > > before > > #include > > to configure application to actually use more CPUs. Example is to use > only two. If you select limit above 4 then it is corrected by BSP. > > I have prepared simple OMK example which runs two tasks on two CPUs > > > https://rtime.felk.cvut.cz/gitweb/rtems-devel.git/tree/refs/heads/master:/rtems-omk-template/appsmptest > > I used it during SMP mailboxes and timer debugging. > > By the way, have you Raspberry Pi 3? > I have not tested that but there is some chance that RPi2 > build could run on RPi3 unmodified for 32-bit mode. > According to scattered information it seems that > there are no differences in base addresses of critical > peripherals. But may it be that there would be some problem > in core code support or elsewhere. > > Best wishes, > > Pavel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 00/10] Raspberry Pi 2 (BCM2836) SMP support
Hello Alan, On Sunday 04 of September 2016 16:38:36 Alan Cudmore wrote: > Hi Pavel, > I applied your patches, and verified that my apps still work on the > Raspberry Pi 1 ( Pi Zero ). Now I am moving to the Pi 2 for some tests. > > When building for the Pi 2, I need to use the —enable-smp configure switch, > correct? Yes. There is even added configure option RASPBERRYPI_CPUS which controls number of CPUs reported trough linker script to the application. The default is all four (4) when --enable-smp is set. If it is not set then it is set to 1. I have not solved misconfiguration which can be caused by selection --enable-smp for RPi1. It fails horribly because some peripherals referenced by SMP code are not available. > When I build the raspberrypi2 BSP with —enable-smp and —enable-tests, the > smpfatal08 test does not compile. It has multiple definition errors like > the following: > ../../../../../raspberrypi2/lib/librtemsbsp.a(libbsp_a-bspsmp.o): In > function `_CPU_SMP_Get_current_processor': > /Users/alan/rtems/build/build-pavel-tmp/arm-rtems4.12/c/raspberrypi2/lib/li >bbsp/arm/raspberrypi/../../../../../.././raspberrypi2/lib/include/rtems/scor >e/cpu.h:522: multiple definition of `_CPU_SMP_Start_processor' > init.o:/Users/alan/rtems/build/build-pavel-tmp/arm-rtems4.12/c/raspberrypi2 >/testsuites/smptests/smpfatal08/../../../../../../../../rtems-src/rtems-pave >l/c/src/../../testsuites/smptests/smpfatal08/init.c:60: first defined here I have tried complete tests build and this one fails for me as well. I have removed references to smpfatal08 from lists in the file arm-rtems4.12/c/raspberrypi2/testsuites/smptests/Makefile The test seems to check cpukit core by replacing BSP provided CPU management functions by some dummy/test ones and for given setup the original ones are pull in together with some another symbol and result is clash. Then all other tests build OK. I have tried many of them. I have noticed only one failure (testsuites/smptests/smpmutex01) *** BEGIN OF TEST SMPMUTEX 1 *** ../../../../../../../../../git/rtems/c/src/../../testsuites/smptests/smpmutex01/init.c: 184 expected == actual Has that problem been spotted on Zynq or Altera too? > But I tried several of the SMP tests that did compile before this one and > they are working on my Raspberry Pi 2! > > When I build with just the samples, rather than the full test suite, the > build completes, and I can link and run my application just like the Pi. If you build own application then you need to to include something like #define CONFIGURE_SMP_MAXIMUM_PROCESSORS 2 #define CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP before #include to configure application to actually use more CPUs. Example is to use only two. If you select limit above 4 then it is corrected by BSP. I have prepared simple OMK example which runs two tasks on two CPUs https://rtime.felk.cvut.cz/gitweb/rtems-devel.git/tree/refs/heads/master:/rtems-omk-template/appsmptest I used it during SMP mailboxes and timer debugging. By the way, have you Raspberry Pi 3? I have not tested that but there is some chance that RPi2 build could run on RPi3 unmodified for 32-bit mode. According to scattered information it seems that there are no differences in base addresses of critical peripherals. But may it be that there would be some problem in core code support or elsewhere. Best wishes, Pavel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 00/10] Raspberry Pi 2 (BCM2836) SMP support
Hi Pavel, I applied your patches, and verified that my apps still work on the Raspberry Pi 1 ( Pi Zero ). Now I am moving to the Pi 2 for some tests. When building for the Pi 2, I need to use the —enable-smp configure switch, correct? When I build the raspberrypi2 BSP with —enable-smp and —enable-tests, the smpfatal08 test does not compile. It has multiple definition errors like the following: ../../../../../raspberrypi2/lib/librtemsbsp.a(libbsp_a-bspsmp.o): In function `_CPU_SMP_Get_current_processor': /Users/alan/rtems/build/build-pavel-tmp/arm-rtems4.12/c/raspberrypi2/lib/libbsp/arm/raspberrypi/../../../../../.././raspberrypi2/lib/include/rtems/score/cpu.h:522: multiple definition of `_CPU_SMP_Start_processor' init.o:/Users/alan/rtems/build/build-pavel-tmp/arm-rtems4.12/c/raspberrypi2/testsuites/smptests/smpfatal08/../../../../../../../../rtems-src/rtems-pavel/c/src/../../testsuites/smptests/smpfatal08/init.c:60: first defined here But I tried several of the SMP tests that did compile before this one and they are working on my Raspberry Pi 2! When I build with just the samples, rather than the full test suite, the build completes, and I can link and run my application just like the Pi. This is great, thanks for advancing the Raspberry pi BSPs! Alan > On Sep 3, 2016, at 8:31 AM, p...@cmp.felk.cvut.cz wrote: > > From: Pavel Pisa> > The series implements Raspberry Pi 2 (BCM2836) SMP support. > > The first two patches modify ARM Cortex-A common CP15 support > to expose clean by level cache operations to the BSP code. > Clean and invalidation of L1 cache is required when the secondary > CPU is booted. But the secondary CPU must not trash content > of shared cache levels because primary CPU is already running > from it. > > Next patches provides basic SMP implementation. > BCM2836 core mailboxes are used to implement inter-processor > interrupts. > > The last two patches change reimplement clock driver to > use GPU/system timer instead of ARM timer because original > approach has been incompatible with SMP support. > SMP support requires timecounter source and it implemented > easier from GPU/system timer which is based on free-running > counter. > > Pavel Pisa (9): > bsps/arm: use defines for cache type register format field. > bsps/arm: remove lock in arm_cp15_set_translation_table_entries(). > bsps/arm: reorganize CP15 code to allow clean and invalidate ARMv7 >cache by level. > arm/raspberrypi: more definitions of BCM2836 core local peripherals. > arm/raspberrypi: rename linkcmds to linkcmds.in to allow their >configure processing. > arm/raspberrypi: propagate number of configured CPUs into linker >script. > bsps/arm: basic BCM2836 SMP implementation. > arm/raspberrypi: correct and extend definitions for GPU timer. > arm/raspberrypi: use GPU/system timer as clock source. > > Rohini Kulkarni (1): > arm/raspberrypi: include definitions of BCM2836 SMP mailboxes. > > c/src/lib/libbsp/arm/raspberrypi/Makefile.am | 5 +- > c/src/lib/libbsp/arm/raspberrypi/clock/clockdrv.c | 98 +++ > c/src/lib/libbsp/arm/raspberrypi/configure.ac | 19 ++- > c/src/lib/libbsp/arm/raspberrypi/include/bsp.h | 3 + > c/src/lib/libbsp/arm/raspberrypi/include/irq.h | 5 + > .../libbsp/arm/raspberrypi/include/raspberrypi.h | 182 - > c/src/lib/libbsp/arm/raspberrypi/irq/irq.c | 18 ++ > c/src/lib/libbsp/arm/raspberrypi/startup/bspsmp.c | 122 ++ > .../libbsp/arm/raspberrypi/startup/bspstarthooks.c | 35 +++- > .../raspberrypi/startup/{linkcmds => linkcmds.in} | 4 +- > .../arm/raspberrypi/startup/mm_config_table.c | 8 + > .../libbsp/arm/shared/arm-cp15-set-ttb-entries.c | 10 +- > c/src/lib/libcpu/arm/shared/include/arm-cp15.h | 147 ++--- > 13 files changed, 539 insertions(+), 117 deletions(-) > create mode 100644 c/src/lib/libbsp/arm/raspberrypi/startup/bspsmp.c > rename c/src/lib/libbsp/arm/raspberrypi/startup/{linkcmds => linkcmds.in} > (95%) > > -- > 1.9.1 > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 00/10] Raspberry Pi 2 (BCM2836) SMP support
From: Pavel PisaThe series implements Raspberry Pi 2 (BCM2836) SMP support. The first two patches modify ARM Cortex-A common CP15 support to expose clean by level cache operations to the BSP code. Clean and invalidation of L1 cache is required when the secondary CPU is booted. But the secondary CPU must not trash content of shared cache levels because primary CPU is already running from it. Next patches provides basic SMP implementation. BCM2836 core mailboxes are used to implement inter-processor interrupts. The last two patches change reimplement clock driver to use GPU/system timer instead of ARM timer because original approach has been incompatible with SMP support. SMP support requires timecounter source and it implemented easier from GPU/system timer which is based on free-running counter. Pavel Pisa (9): bsps/arm: use defines for cache type register format field. bsps/arm: remove lock in arm_cp15_set_translation_table_entries(). bsps/arm: reorganize CP15 code to allow clean and invalidate ARMv7 cache by level. arm/raspberrypi: more definitions of BCM2836 core local peripherals. arm/raspberrypi: rename linkcmds to linkcmds.in to allow their configure processing. arm/raspberrypi: propagate number of configured CPUs into linker script. bsps/arm: basic BCM2836 SMP implementation. arm/raspberrypi: correct and extend definitions for GPU timer. arm/raspberrypi: use GPU/system timer as clock source. Rohini Kulkarni (1): arm/raspberrypi: include definitions of BCM2836 SMP mailboxes. c/src/lib/libbsp/arm/raspberrypi/Makefile.am | 5 +- c/src/lib/libbsp/arm/raspberrypi/clock/clockdrv.c | 98 +++ c/src/lib/libbsp/arm/raspberrypi/configure.ac | 19 ++- c/src/lib/libbsp/arm/raspberrypi/include/bsp.h | 3 + c/src/lib/libbsp/arm/raspberrypi/include/irq.h | 5 + .../libbsp/arm/raspberrypi/include/raspberrypi.h | 182 - c/src/lib/libbsp/arm/raspberrypi/irq/irq.c | 18 ++ c/src/lib/libbsp/arm/raspberrypi/startup/bspsmp.c | 122 ++ .../libbsp/arm/raspberrypi/startup/bspstarthooks.c | 35 +++- .../raspberrypi/startup/{linkcmds => linkcmds.in} | 4 +- .../arm/raspberrypi/startup/mm_config_table.c | 8 + .../libbsp/arm/shared/arm-cp15-set-ttb-entries.c | 10 +- c/src/lib/libcpu/arm/shared/include/arm-cp15.h | 147 ++--- 13 files changed, 539 insertions(+), 117 deletions(-) create mode 100644 c/src/lib/libbsp/arm/raspberrypi/startup/bspsmp.c rename c/src/lib/libbsp/arm/raspberrypi/startup/{linkcmds => linkcmds.in} (95%) -- 1.9.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel