Re: [PATCH 1/2] bsp/sparc: Flush icache before first time enabling interrupts

2014-07-03 Thread Sebastian Huber
On 2014-07-03 11:39, Daniel Cederman wrote: A secondary processor might miss changes done to the trap table if the instruction cache is not flushed. Once interrupts are enabled any other required cache flushes can be ordered via the cache manager. I think it is a general bug if you change the t

Re: [PATCH 3/3] score: Add SMP support to the cache manager

2014-07-03 Thread Sebastian Huber
On 2014-07-03 11:37, Daniel Cederman wrote: Adds functions that allows the user to specify which cores that should perform the cache operation. SMP messages are sent to all the specified cores and the caller waits until all cores have acknowledged that they have flushed their cache. Implementatio

Re: [PATCH 1/3] score: Use consistent type for SMP messages

2014-07-03 Thread Sebastian Huber
On 2014-07-03 11:37, Daniel Cederman wrote: --- a/cpukit/score/include/rtems/score/smpimpl.h +++ b/cpukit/score/include/rtems/score/smpimpl.h @@ -159,7 +159,7 @@ static inline void _SMP_Inter_processor_interrupt_handler( void ) * @param[in] cpu_index The target processor of the message. *

Re: [PATCH 5/5] LEON3: use CPU_Fatal_halt for halt

2014-07-03 Thread Sebastian Huber
On 2014-07-03 09:29, Daniel Hellstrom wrote: By removing the bsp_reset() mechanism and instead relying on the CPU_Fatal_halt() routine SMP and single-core can halt by updating the _Internal_errors_What_happened structure and set the state to SYSTEM_STATE_TERMINATED (the generic way). This will be

Re: [PATCH 4/5 v2] SPARC: Fatal_halt use source and exit codes

2014-07-03 Thread Sebastian Huber
On 2014-07-03 16:55, Joel Sherrill wrote: As an aside, should the _Internal_errors_What_happened structure be filled in earlier in _Terminate? How about just after disabling interrupts? I think we should remove _Internal_errors_What_happened. It makes no sense on SMP and the application can g

Re: [PATCH 1/2] bsp/sparc: Ensure that data cache snooping is enabled

2014-07-03 Thread Sebastian Huber
On 2014-07-03 11:39, Daniel Cederman wrote: @@ -39,7 +40,9 @@ void bsp_start_on_secondary_processor() { uint32_t cpu_index_self = _CPU_SMP_Get_current_processor(); - leon3_set_cache_control_register(0x8F); + if( ! leon3_data_cache_snooping_enabled() ) +BSP_fatal_exit( LEON3_FATAL

Re: [PATCH 1/2] LEON3: add dedicated SMP BSP config

2014-07-03 Thread Chris Johns
On 4/07/2014 3:24 am, Joel Sherrill wrote: On 7/3/2014 2:59 AM, Daniel Hellstrom wrote: In order to support older toolchains and LEON3 v7 systems the -mcpu=leon3 flag can not be used in the LEON3 BSP. The SMP kernel however requires -mcpu=leon3 for the CAS support only present in GCC-4.8 and GC

Re: [PATCH 1/2] bsp/sparc: Flush icache before first time enabling interrupts

2014-07-03 Thread Joel Sherrill
On 7/3/2014 4:39 AM, Daniel Cederman wrote: > A secondary processor might miss changes done to the trap table > if the instruction cache is not flushed. Once interrupts are enabled > any other required cache flushes can be ordered via the cache > manager. > --- > c/src/lib/libbsp/sparc/leon3/star

Re: [PATCH 2/2] bsp/sparc: Flush only instruction cache

2014-07-03 Thread Joel Sherrill
OK except one style comment. On 7/3/2014 4:39 AM, Daniel Cederman wrote: > The flush instruction on LEON flushes both the data and the instruction > cache. Flushing of just the instruction cache can be done by setting > the "flush instruction cache" bit in the cache control register. > --- > c/src

Re: [PATCH 1/2] bsp/sparc: Ensure that data cache snooping is enabled

2014-07-03 Thread Joel Sherrill
OK besides style comments. On 7/3/2014 4:39 AM, Daniel Cederman wrote: > Check that data cache snooping exists and is enabled on all cores. > --- > c/src/lib/libbsp/shared/include/fatal.h |1 + > c/src/lib/libbsp/sparc/leon3/include/leon.h | 10 ++ > c/src/lib/libbsp/sparc/le

Re: [PATCH 2/2] score/sparc: Flush all cores icache after trap table update

2014-07-03 Thread Joel Sherrill
Seems reasonable. My only concern is creeping sysstate.h into cpu.c but I think that's OK. --joel On 7/3/2014 4:39 AM, Daniel Cederman wrote: > Changes to the trap table might be missed by other cores. > If the system state is up, the other cores can be notified > using SMP messages that they need

Re: [PATCH 0/2] Use of SMP cache manager on Sparc

2014-07-03 Thread Joel Sherrill
I don't know why but I don't see any code on this. On 7/3/2014 4:39 AM, Daniel Cederman wrote: > When entering up state, but before enabling interrupts, > the icaches are flushed to make sure that changes to the trap > table are visible. After up state the SMP cache manager is > used to order cach

Re: [PATCH 3/3] score: Add SMP support to the cache manager

2014-07-03 Thread Joel Sherrill
Comments inline. But mostly the same style comments. Check that they aren't needed in other places. I didn't note them everywhere. On 7/3/2014 4:37 AM, Daniel Cederman wrote: > Adds functions that allows the user to specify which cores that should > perform the cache operation. SMP messages are se

Re: [PATCH 1/3] score: Use consistent type for SMP messages

2014-07-03 Thread Joel Sherrill
I assume this is just fixing the types to match the assumed prototype. This needs a comment but if that's the intent, it is OK. On 7/3/2014 4:37 AM, Daniel Cederman wrote: > --- > cpukit/score/include/rtems/score/smpimpl.h |2 +- > cpukit/score/src/smp.c |2 +- > 2 fi

Re: [PATCH 2/3] score: Add function to send a SMP message to a set of CPUs

2014-07-03 Thread Joel Sherrill
This is OK. I assume there are other use cases to justify adding it. On 7/3/2014 4:37 AM, Daniel Cederman wrote: > Make _SMP_Broadcast_message() use the function to send a message to all CPUs > except itself. > --- > cpukit/score/include/rtems/score/smpimpl.h | 10 ++ > cpukit/score/s

Re: [PATCH 0/3] SMP cache manager

2014-07-03 Thread Joel Sherrill
I don't know why but I don't see any file changes on this. On 7/3/2014 4:37 AM, Daniel Cederman wrote: > Adds functions to request cache operations on a set of cores. > > Daniel Cederman (3): > score: Use consistent type for SMP messages > score: Add function to send a SMP message to a set of

Re: [PATCH 1/2] LEON3: add dedicated SMP BSP config

2014-07-03 Thread Joel Sherrill
On 7/3/2014 2:59 AM, Daniel Hellstrom wrote: > In order to support older toolchains and LEON3 v7 systems the > -mcpu=leon3 flag can not be used in the LEON3 BSP. The SMP > kernel however requires -mcpu=leon3 for the CAS support only > present in GCC-4.8 and GCC-4.9. I don't know if older tools is

Re: [PATCH 5/5] LEON3: use CPU_Fatal_halt for halt

2014-07-03 Thread Joel Sherrill
On 7/3/2014 2:29 AM, Daniel Hellstrom wrote: > By removing the bsp_reset() mechanism and instead relying on the > CPU_Fatal_halt() routine SMP and single-core can halt by updating > the _Internal_errors_What_happened structure and set the state to > SYSTEM_STATE_TERMINATED (the generic way). This

Re: [PATCH 4/5 v2] SPARC: Fatal_halt use source and exit codes

2014-07-03 Thread Joel Sherrill
I am wondering if I don't have a vision for what this series of patches is trying to accomplish in whole. And I am hung up on not wanting BSP references in score. So I would like an elegant solution. How does tweaking the bsp_reset() method not address all of this? It is invoked along the _Termin

Re: [PATCH 3/5 v2] SPARC: add BSP specific error handler

2014-07-03 Thread Joel Sherrill
I don't have a problem with this in principle but reviewing the earlier patches and seeing similar names in other BSPs makes me wonder if we can't get a better name. Isn't this really just bsp_reset? I don't see needing the symbol BSP_fatal_exit(). On 7/3/2014 2:29 AM, Daniel Hellstrom wrote: >

Re: [PATCH 2/5 v2] SPARC BSPs: remove BSP_fatal_return unreached code

2014-07-03 Thread Joel Sherrill
This looks good to me. Also looks like you found one of those odd dead routines I mentioned against the first patch in this series. On 7/3/2014 2:29 AM, Daniel Hellstrom wrote: > PATCHv2: unreachable code after SMP secondary CPU init or boot_card > calls, is now removed instead of cleane

Re: [PATCH 1/5] Let CPU/BSP Fatal handler have access to source

2014-07-03 Thread Joel Sherrill
This looks mostly mechanical and the biggest issue is what to do with the source in the generic shutdown case. The first thing is that I think this is already handled and the information is stored in _Internal_errors_What_happened in score/src/interr.c before _CPU_Fatal_halt() is invoked. I would

Re: Remaining arch issue in Newlib optimized ARM ASM memchr for Cortex-R

2014-07-03 Thread Joel Sherrill
On 7/3/2014 7:49 AM, Richard Earnshaw wrote: > On 03/07/14 13:17, Nicholas Clifton wrote: >> Hi Jeff, >> >> > Pavel Pisa wrote: >>> Index: newlib-2.1/newlib/libc/machine/arm/memchr.S >>> === >>> --- newlib-2.1.orig/newlib/libc/machi

[PATCH 1/2] bsp/sparc: Ensure that data cache snooping is enabled

2014-07-03 Thread Daniel Cederman
Check that data cache snooping exists and is enabled on all cores. --- c/src/lib/libbsp/shared/include/fatal.h |1 + c/src/lib/libbsp/sparc/leon3/include/leon.h | 10 ++ c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c |8 ++-- 3 files changed, 17 insertions(+), 2 deleti

[PATCH 2/2] bsp/sparc: Flush only instruction cache

2014-07-03 Thread Daniel Cederman
The flush instruction on LEON flushes both the data and the instruction cache. Flushing of just the instruction cache can be done by setting the "flush instruction cache" bit in the cache control register. --- c/src/lib/libbsp/sparc/leon3/include/cache_.h |4 +++- c/src/lib/libbsp/sparc/leon3/

[PATCH 0/2] Use of SMP cache manager on Sparc

2014-07-03 Thread Daniel Cederman
When entering up state, but before enabling interrupts, the icaches are flushed to make sure that changes to the trap table are visible. After up state the SMP cache manager is used to order cache flushes whenever the trap table is altered. Daniel Cederman (2): bsp/sparc: Flush icache before fir

[PATCH 2/2] score/sparc: Flush all cores icache after trap table update

2014-07-03 Thread Daniel Cederman
Changes to the trap table might be missed by other cores. If the system state is up, the other cores can be notified using SMP messages that they need to flush their icache. If the up state has not been reached there is no need to notify other cores. They will do an automatic flush of the icache ju

[PATCH 1/2] bsp/sparc: Flush icache before first time enabling interrupts

2014-07-03 Thread Daniel Cederman
A secondary processor might miss changes done to the trap table if the instruction cache is not flushed. Once interrupts are enabled any other required cache flushes can be ordered via the cache manager. --- c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c |9 + cpukit/score/cpu/sparc/rte

[PATCH 2/3] score: Add function to send a SMP message to a set of CPUs

2014-07-03 Thread Daniel Cederman
Make _SMP_Broadcast_message() use the function to send a message to all CPUs except itself. --- cpukit/score/include/rtems/score/smpimpl.h | 10 ++ cpukit/score/src/smp.c | 15 --- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/cpukit/s

[PATCH 0/3] SMP cache manager

2014-07-03 Thread Daniel Cederman
Adds functions to request cache operations on a set of cores. Daniel Cederman (3): score: Use consistent type for SMP messages score: Add function to send a SMP message to a set of CPUs score: Add SMP support to the cache manager c/src/lib/libcpu/shared/src/cache_manager.c | 166 +

[PATCH 3/3] score: Add SMP support to the cache manager

2014-07-03 Thread Daniel Cederman
Adds functions that allows the user to specify which cores that should perform the cache operation. SMP messages are sent to all the specified cores and the caller waits until all cores have acknowledged that they have flushed their cache. Implementation is shown using both function pointers and fu

[PATCH 1/3] score: Use consistent type for SMP messages

2014-07-03 Thread Daniel Cederman
--- cpukit/score/include/rtems/score/smpimpl.h |2 +- cpukit/score/src/smp.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpukit/score/include/rtems/score/smpimpl.h b/cpukit/score/include/rtems/score/smpimpl.h index e2fee39..ba16c8f 100644 ---

[PATCH 2/2] LEON4: NGMP BSP is based on LEON3 SPARC v8 SMP

2014-07-03 Thread Daniel Hellstrom
NGMP is a new BSP and is SMP capable which requires the mcpu=leon3 flag. The LEON4 CPU is backwards compatible with the LEON3. --- c/src/lib/libbsp/sparc/leon3/make/custom/ngmp.cfg |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/c/src/lib/libbsp/sparc/leon3/make/custom/ng

[PATCH 1/2] LEON3: add dedicated SMP BSP config

2014-07-03 Thread Daniel Hellstrom
In order to support older toolchains and LEON3 v7 systems the -mcpu=leon3 flag can not be used in the LEON3 BSP. The SMP kernel however requires -mcpu=leon3 for the CAS support only present in GCC-4.8 and GCC-4.9. --- .../libbsp/sparc/leon3/make/custom/leon3smp.cfg|8 1 files chan

[PATCH 5/5] LEON3: use CPU_Fatal_halt for halt

2014-07-03 Thread Daniel Hellstrom
By removing the bsp_reset() mechanism and instead relying on the CPU_Fatal_halt() routine SMP and single-core can halt by updating the _Internal_errors_What_happened structure and set the state to SYSTEM_STATE_TERMINATED (the generic way). This will be better for test scripts and debugger that can

[PATCH 2/5 v2] SPARC BSPs: remove BSP_fatal_return unreached code

2014-07-03 Thread Daniel Hellstrom
PATCHv2: unreachable code after SMP secondary CPU init or boot_card calls, is now removed instead of cleaned-up. --- c/src/lib/libbsp/sparc/erc32/include/bsp.h |2 -- c/src/lib/libbsp/sparc/leon2/include/bsp.h |2 -- c/src/lib/libbsp/sparc/leon3/include/bsp.h |2 -- c/src/l

[PATCH 1/5] Let CPU/BSP Fatal handler have access to source

2014-07-03 Thread Daniel Hellstrom
Without the source the error code does not say that much. Let it be up to the CPU/BSP to determine the error code reported on fatal shutdown. This patch does not change the current behaviour, just adds the option to handle the source of the fatal halt. --- cpukit/score/cpu/arm/rtems/score/cpu.h

[PATCH 4/5 v2] SPARC: Fatal_halt use source and exit codes

2014-07-03 Thread Daniel Hellstrom
PATCHv2: BSP_fatal_halt renamed to _BSP_Fatal_halt The Fatal_halt handler now have two options, either halt as before or enter system error state to return to debugger or simulator. The exit-code is now also propagated to the debugger which is very useful for testing. The CPU_Fatal_halt handler w

[PATCH 3/5 v2] SPARC: add BSP specific error handler

2014-07-03 Thread Daniel Hellstrom
PATCHv2: BSP_fatal_exit defined in header Instead of calling the system call TA instruction directly it is better paractise to isolate the trap implementation to the system call functions. BSP_fatal_exit() is added. --- c/src/lib/libbsp/sparc/erc32/Makefile.am |1 + c/src/lib/libbs