[PATCH 26/26] leon,tn-0018: work around GRLIB-TN-0018 errata

Daniel Hellstrom daniel at gaisler.com
Mon Jun 29 12:34:20 UTC 2020


On 2020-06-29 13:57, Sebastian Huber wrote:
> On 29/06/2020 13:28, Daniel Hellstrom wrote:
>
>> diff --git a/bsps/sparc/leon3/config/gr712rc.cfg 
>> b/bsps/sparc/leon3/config/gr712rc.cfg
>> index 3852932..e8f0731 100644
>> --- a/bsps/sparc/leon3/config/gr712rc.cfg
>> +++ b/bsps/sparc/leon3/config/gr712rc.cfg
>> @@ -10,10 +10,11 @@ RTEMS_CPU=sparc
>>   #  and (hopefully) optimize for it.
>>   #  GCC and clang use different switches to select target:
>>   ifneq (,$(findstring clang,$(CC)))
>> -  CPU_CFLAGS = -mcpu=gr712rc
>> +  CPU_CFLAGS = -mcpu=gr712rc -D__FIX_LEON3FT_TN0018
>>   else
>> -  CPU_CFLAGS = -mcpu=leon3 -mfix-gr712rc
>> +  CPU_CFLAGS = -mcpu=leon3 -mfix-gr712rc -D__FIX_LEON3FT_TN0018
>>   endif
>> +# -D__FIX_LEON3FT_TN0018 enables kernel work around for 
>> GRLIB-TN-0018 errata
>>     # optimize flag: typically -O2
>>   CFLAGS_OPTIMIZE_V = -O2 -g
>> diff --git a/bsps/sparc/leon3/config/ut699.cfg 
>> b/bsps/sparc/leon3/config/ut699.cfg
>> index a8fff49..ed70cf5 100644
>> --- a/bsps/sparc/leon3/config/ut699.cfg
>> +++ b/bsps/sparc/leon3/config/ut699.cfg
>> @@ -8,7 +8,8 @@ RTEMS_CPU=sparc
>>     #  This contains the compiler options necessary to select the CPU 
>> model
>>   #  and (hopefully) optimize for it.
>> -CPU_CFLAGS = -mcpu=leon -mfix-ut699
>> +# -D__FIX_LEON3FT_TN0018 enables kernel work around for 
>> GRLIB-TN-0018 errata
>> +CPU_CFLAGS = -mcpu=leon -mfix-ut699 -D__FIX_LEON3FT_TN0018
>>     # optimize flag: typically -O2
>>   CFLAGS_OPTIMIZE_V = -O2 -g
>> diff --git a/bsps/sparc/leon3/config/ut700.cfg 
>> b/bsps/sparc/leon3/config/ut700.cfg
>> index bcca901..5c6fff8 100644
>> --- a/bsps/sparc/leon3/config/ut700.cfg
>> +++ b/bsps/sparc/leon3/config/ut700.cfg
>> @@ -8,7 +8,8 @@ RTEMS_CPU=sparc
>>     #  This contains the compiler options necessary to select the CPU 
>> model
>>   #  and (hopefully) optimize for it.
>> -CPU_CFLAGS = -mcpu=leon3 -mfix-ut700
>> +# -D__FIX_LEON3FT_TN0018 enables kernel work around for 
>> GRLIB-TN-0018 errata
>> +CPU_CFLAGS = -mcpu=leon3 -mfix-ut700 -D__FIX_LEON3FT_TN0018
>>     # optimize flag: typically -O2
>>   CFLAGS_OPTIMIZE_V = -O2 -g
> Command line defines are discouraged and in cpukit only multilib 
> defined defines should be used. Can't you the existing 
> __FIX_LEON3FT_B2BST define to enable the errata workarounds?

For UT700, for example, it is true that B2BST also needs to be defined, 
but in general a user may have TN0018 but not the B2BST since it was 
fixed in HW several years ago. There is no fix needed to the compiler or 
newlib affecting the multilibs, the workaround can be implemented purely 
in the run-time time time which simplifies the impact on the user. When 
building multiple BSPs this is very convenient too since the configure 
line can remain the same regardless of the work around. The compiler 
does not emit any information about TN0018 or UT700 for example.






More information about the devel mailing list