[PATCH 24/47] bsp/tms570: Remove double pin configuration

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jan 8 12:49:24 UTC 2024


Hello Pavel,

On 21.12.23 16:13, Pavel Pisa wrote:
> On Thursday 21 of December 2023 15:37:57 Sebastian Huber wrote:
>> From: Tyler Miller<tyler.miller at airbusus.com>
>>
>> ---
>>   bsps/arm/tms570/start/pinmux.c | 10 ----------
>>   1 file changed, 10 deletions(-)
>>
>> diff --git a/bsps/arm/tms570/start/pinmux.c
>> b/bsps/arm/tms570/start/pinmux.c index d9c52cd00d..9277a36431 100644
>> --- a/bsps/arm/tms570/start/pinmux.c
>> +++ b/bsps/arm/tms570/start/pinmux.c
>> @@ -182,16 +182,6 @@ tms570_bsp_pinmmr_config(const uint32_t
>> *pinmmr_values, int reg_start, int reg_c pval = pinmmr_values;
>>     cnt = reg_count;
>>
>> -  do {
>> -    *pinmmrx = *pinmmrx & *pval;
>> -    pinmmrx++;
>> -    pval++;
>> -  } while( --cnt );
>> -
>> -  pinmmrx = (&TMS570_IOMM.PINMUX.PINMMR0) + reg_start;
>> -  pval = pinmmr_values;
>> -  cnt = reg_count;
>> -
>>     do {
>>       *pinmmrx = *pval;
>>       pinmmrx++;
> there has been reason for this sequence.
> 
> If you use bootloader or if you want to start
> RTEMS in SDRAM loaded by another RTEMS or system
> in Flash then direct switching from one config
> to another can lead to pin configuration collision.
> 
> So the logic has been meant such way, that
> all configurations which should not be valid
> after pin reconfiguration are disabled the first,
> (i.e.) pins and internal signals are tristated
> and in the second round the final values
> are set.
> 
> It can have reason even if some peripheral is activated
> at runtime according to application config.
> 
> May be, that double run is really abundant but I would
> suggest to do the analysis again. I need to find some
> time to refresh TMS570 knowledge because it is eight
> years already when we build base TMS570L3137 support
> with Premek...
> 
> But I am sure that this was the idea behind update
> in two phases.

I had a look at the TMS570LC31x and TMS570LS43x manuals. It seems if you 
don't set a bit in the 8-bit fields of the PINMMR control registers, 
then the default pin function is selected (the documentation is not 
really clear, they just mention this in one example). The default 
function is not always GIO. This makes this clearing operation a bit 
unpredictable. I suggest to apply the proposed patch. If you really need 
to switch the pin function to a certain configuration before doing the 
actual change, then this should be done by two 
tms570_bsp_pinmmr_config() calls.

-- 
embedded brains GmbH & Co. KG
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list