Re: Bacport of ARM cache, RTL and TMS570 to RTEMS 4.11 Was: Simple question about RTL

2016-10-03 Thread Pavel Pisa
Hello Alan,

thanks much for test.

On Monday 03 of October 2016 03:40:46 Alan Cudmore wrote:
> Hi Pavel,
> I have built the Raspberry Pi 1 and 2 BSPs with the latest 4.11 branch. I
> plan on testing them soon.
>
> I also tried to build the 4.11 sparc/sis BSP, but it failed to compile:
> ../../../../../../../rtems-src/rtems-4.11/c/src/../../cpukit/libdl/rtl-obj.
>c:585:47: error: 'CPU_CACHE_LINE_BYTES' undeclared (first use in this
> function) old_end = (uintptr_t)sync_ctx->end_va & ~(CPU_CACHE_LINE_BYTES -
> 1);
>
> It looks like rtl-obj.c uses CPU_CACHE_LINE_BYTES, but a grep only shows
> that is defined for ARM.

This bug falls on my head. I have not noticed that it is not defined
on 4.11 same as on the master.

I have introduced that for ARM to change hardcodded aligned
to 4.12 style. The right think id probably to return this to hardcoded
value

#if defined(ARM_MULTILIB_CACHE_LINE_MAX_64)
  #define CPU_CACHE_LINE_BYTES 32
#else
  #define CPU_CACHE_LINE_BYTES 64
#endif

#define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned (CPU_CACHE_LINE_BYTES 
)))


> Do we need to back port these defines for the other CPU architectures as
> well?

As for RTL, the line size is used only for optimization, merging
directly following sections to the single region so it is not critical
if value is instruction/data cache line max/min

old_end = (uintptr_t)sync_ctx->end_va & ~(CPU_CACHE_LINE_BYTES - 1);
new_start = (uintptr_t)sect->base & ~(CPU_CACHE_LINE_BYTES - 1);
if ( (sect->base <  sync_ctx->start_va) ||

So any value returned from the cache manager can be used there

  rtems_cache_get_maximal_line_size()

  rtems_cache_get_instruction_line_size()

  rtems_cache_get_data_line_size()

I would would prefer rtems_cache_get_maximal_line_size()
and to use this for both master and 4.11 to keep consistency.

What is preferred change for CPU_CACHE_LINE_BYTES removal from 4.11 ARM?
I am inclined it to remove it to ensure same behavior over all architectures.
Introduction would help with compatibility but it I think that other 
architectures
should not be touched by this ARM bring up.

Best wishes,

Pavel


___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: Bacport of ARM cache, RTL and TMS570 to RTEMS 4.11 Was: Simple question about RTL

2016-10-02 Thread Alan Cudmore
Hi Pavel,
I have built the Raspberry Pi 1 and 2 BSPs with the latest 4.11 branch. I plan 
on testing them soon. 

I also tried to build the 4.11 sparc/sis BSP, but it failed to compile:
../../../../../../../rtems-src/rtems-4.11/c/src/../../cpukit/libdl/rtl-obj.c:585:47:
 error: 'CPU_CACHE_LINE_BYTES' undeclared (first use in this function)
 old_end = (uintptr_t)sync_ctx->end_va & ~(CPU_CACHE_LINE_BYTES - 1);

It looks like rtl-obj.c uses CPU_CACHE_LINE_BYTES, but a grep only shows that 
is defined for ARM.

Do we need to back port these defines for the other CPU architectures as well?

Thanks,
Alan


> On Oct 2, 2016, at 6:06 AM, Pavel Pisa  wrote:
> 
> Hello all,
> 
> I have pushed massive update to RTEMS-4.11 ARM BSPs
> support. The cache manager and RTL update has been
> prepared in response to RTL failures reported by Tim Tian
> on Zynq BSP more than month ago. I have proposed
> 4.11 update series at September 9.
> 
>  https://github.com/ppisa/rtems/tree/4.11-arm-update
> 
> Code has been tested by Alan Cudmore and more RPi
> versions and correction of Zynq problem has been reported
> as well. Because there has not been reported any
> problem on master nor on my 4.11-arm-update branch
> I have pushed changes to official 4.11 tree.
> 
> Please, check on more BSPs and applications
> if all works correctly.
> 
> I have pushed TMS570 backport from master to 4.11 as well,
> there has been critical problem corrected on master
> 
> 
> #2794 ARM TMS570 BSP: Serial port hangs when baudrate change
>  initiates before all characters are sent
> 
> and the rest of updates is required to boot RTEMS
> on TMS570LS3137 without separate loader or mixing
> code with other sources.
> 
> I expect to do some more testing of 4.11 on TMS570 HW
> next week.
> 
> From my side, I think that RTEMS 4.11 branch is in the
> state where release can report Raspberry Pi 1, 2
> and TMS570 as supported now.
> 
> Best wishes,
> 
> Pavel
> 
> On Tuesday 06 of September 2016 09:28:42 Pavel Pisa wrote:
>> Hello Chris,
>> 
>> On Tuesday 06 of September 2016 07:12:53 Chris Johns wrote:
>>> Hi Tim and Pavel,
>>> 
>>> Thank you for the patches and testing. I will have a chat to Joel
>>> tomorrow about the patches and what we will do. If Joel agrees I may
>>> test and push the patches.
>>> 
>>> FYI I am currently looking at #2767 which is reported against 4.11 and a
>>> zynq so there is real interest on these patches ending up on 4.11.
>>> 
>>> Chris
>> 
>> I have made 4.11 to boot on Raspberry Pi.
>> 
>> The final patch
>> 
>>  arm/raspberrypi: minimized mainline patch move MMU in front of
>> application image and correct RPi2 boot on 4.11 branch.
>> https://github.com/ppisa/rtems/commit/984047e8295bb82b12700edb3aac911bd8427
>> 8af
>> 
>> of branch
>> 
>>  https://github.com/ppisa/rtems/tree/4.11-arm-update
>> 
>> series.
>> 
>> Tickets
>> 
>>  https://devel.rtems.org/ticket/2783
>> 
>>  https://devel.rtems.org/ticket/2782
>> 
>> At least one of these tickets can be assigned to all patches
>> in this backports branch.
>> 
>> I have to move to other tasks today to have students exams prepared
>> and to have resources to pay our company bills.
>> 
>> I understand that modifications are huge for 4.11 
>> 
>> If there is interrest I can resend series to mainlinglist
>> when I return from our potential customers meeting.
>> 
>> Best wishes,
>> 
>>  Pavel
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Bacport of ARM cache, RTL and TMS570 to RTEMS 4.11 Was: Simple question about RTL

2016-10-02 Thread Pavel Pisa
Hello all,

I have pushed massive update to RTEMS-4.11 ARM BSPs
support. The cache manager and RTL update has been
prepared in response to RTL failures reported by Tim Tian
on Zynq BSP more than month ago. I have proposed
4.11 update series at September 9.

  https://github.com/ppisa/rtems/tree/4.11-arm-update

Code has been tested by Alan Cudmore and more RPi
versions and correction of Zynq problem has been reported
as well. Because there has not been reported any
problem on master nor on my 4.11-arm-update branch
I have pushed changes to official 4.11 tree.

Please, check on more BSPs and applications
if all works correctly.

I have pushed TMS570 backport from master to 4.11 as well,
there has been critical problem corrected on master


#2794 ARM TMS570 BSP: Serial port hangs when baudrate change
  initiates before all characters are sent

and the rest of updates is required to boot RTEMS
on TMS570LS3137 without separate loader or mixing
code with other sources.

I expect to do some more testing of 4.11 on TMS570 HW
next week.

>From my side, I think that RTEMS 4.11 branch is in the
state where release can report Raspberry Pi 1, 2
and TMS570 as supported now.

Best wishes,

 Pavel

On Tuesday 06 of September 2016 09:28:42 Pavel Pisa wrote:
> Hello Chris,
>
> On Tuesday 06 of September 2016 07:12:53 Chris Johns wrote:
> > Hi Tim and Pavel,
> >
> > Thank you for the patches and testing. I will have a chat to Joel
> > tomorrow about the patches and what we will do. If Joel agrees I may
> > test and push the patches.
> >
> > FYI I am currently looking at #2767 which is reported against 4.11 and a
> > zynq so there is real interest on these patches ending up on 4.11.
> >
> > Chris
>
> I have made 4.11 to boot on Raspberry Pi.
>
> The final patch
>
>   arm/raspberrypi: minimized mainline patch move MMU in front of
> application image and correct RPi2 boot on 4.11 branch.
> https://github.com/ppisa/rtems/commit/984047e8295bb82b12700edb3aac911bd8427
>8af
>
> of branch
>
>   https://github.com/ppisa/rtems/tree/4.11-arm-update
>
> series.
>
> Tickets
>
>   https://devel.rtems.org/ticket/2783
>
>   https://devel.rtems.org/ticket/2782
>
> At least one of these tickets can be assigned to all patches
> in this backports branch.
>
> I have to move to other tasks today to have students exams prepared
> and to have resources to pay our company bills.
>
> I understand that modifications are huge for 4.11 
>
> If there is interrest I can resend series to mainlinglist
> when I return from our potential customers meeting.
>
> Best wishes,
>
>   Pavel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel