bsp/tms570: Add clock BSP options

Update #4982.
This commit is contained in:
Sebastian Huber
2024-04-23 21:06:52 +02:00
committed by Amar Takhar
parent 28e4a46d67
commit cc6f1d86cc
11 changed files with 142 additions and 10 deletions

View File

@@ -83,10 +83,10 @@ static void tms570_clock_driver_support_initialize_hardware( void )
microsec_per_tick = rtems_configuration_get_microseconds_per_tick();
tc_frequency = TMS570_PREFERRED_TC_FREQUENCY;
tc_prescaler = (BSP_PLL_OUT_CLOCK + tc_frequency) / (tc_frequency * 2);
tc_prescaler = (TMS570_RTICLK_HZ + tc_frequency) / (tc_frequency * 2);
/* Recompute actual most close frequency which can be realized */
tc_frequency = (BSP_PLL_OUT_CLOCK + tc_prescaler) / (tc_prescaler * 2);
tc_frequency = (TMS570_RTICLK_HZ + tc_prescaler) / (tc_prescaler * 2);
/*
* Recompute tick period to adjust for configurable or exact

View File

@@ -297,7 +297,7 @@ bool tms570_sci_set_attributes(
/* Apply baudrate to the hardware */
baudrate *= 2 * 16;
bauddiv = (BSP_PLL_OUT_CLOCK + baudrate / 2) / baudrate;
bauddiv = (TMS570_VCLK_HZ + baudrate / 2) / baudrate;
ctx->regs->BRS = bauddiv? bauddiv - 1: 0;
ctx->regs->GCR1 |= TMS570_SCI_GCR1_SWnRST | TMS570_SCI_GCR1_TXENA |

View File

@@ -68,7 +68,7 @@ static void tms570_cpu_counter_initialize(void)
uint32_t _CPU_Counter_frequency(void)
{
return 2 * BSP_PLL_OUT_CLOCK;
return TMS570_GCLK_HZ;
}
CPU_Counter_ticks _CPU_Counter_read(void)

View File

@@ -61,12 +61,6 @@
#include <rtems.h>
#include <bsp/default-initial-extension.h>
#if TMS570_VARIANT == 4357
#define BSP_PLL_OUT_CLOCK 150000000
#else
#define BSP_PLL_OUT_CLOCK 160000000
#endif
RTEMS_NO_RETURN void bsp_restart(const void *addr);
#endif /* ASM */

View File

@@ -32,6 +32,18 @@ links:
uid: optmintskstksz
- role: build-dependency
uid: optoscmain
- role: build-dependency
uid: optgclk
- role: build-dependency
uid: opthclk
- role: build-dependency
uid: optvclk
- role: build-dependency
uid: optvclk2
- role: build-dependency
uid: optvclk3
- role: build-dependency
uid: optrticlk
- role: build-dependency
uid: optreginit
- role: build-dependency

View File

@@ -0,0 +1,21 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
actions:
- get-integer: null
- define: null
build-type: option
copyrights:
- Copyright (C) 2024 embedded brains GmbH & Co. KG
default:
- enabled-by:
- arm/tms570lc4357_hdk
- arm/tms570lc4357_hdk_sdram
value: 300000000
- enabled-by: true
value: 160000000
description: |
The option value shall be the GCLK frequency in Hz.
enabled-by: true
format: '{}'
links: []
name: TMS570_GCLK_HZ
type: build

View File

@@ -0,0 +1,21 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
actions:
- get-integer: null
- define: null
build-type: option
copyrights:
- Copyright (C) 2024 embedded brains GmbH & Co. KG
default:
- enabled-by:
- arm/tms570lc4357_hdk
- arm/tms570lc4357_hdk_sdram
value: 150000000
- enabled-by: true
value: 160000000
description: |
The option value shall be the HCLK frequency in Hz.
enabled-by: true
format: '{}'
links: []
name: TMS570_HCLK_HZ
type: build

View File

@@ -0,0 +1,21 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
actions:
- get-integer: null
- define: null
build-type: option
copyrights:
- Copyright (C) 2024 embedded brains GmbH & Co. KG
default:
- enabled-by:
- arm/tms570lc4357_hdk
- arm/tms570lc4357_hdk_sdram
value: 75000000
- enabled-by: true
value: 80000000
description: |
The option value shall be the RTICLK frequency in Hz.
enabled-by: true
format: '{}'
links: []
name: TMS570_RTICLK_HZ
type: build

View File

@@ -0,0 +1,21 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
actions:
- get-integer: null
- define: null
build-type: option
copyrights:
- Copyright (C) 2024 embedded brains GmbH & Co. KG
default:
- enabled-by:
- arm/tms570lc4357_hdk
- arm/tms570lc4357_hdk_sdram
value: 75000000
- enabled-by: true
value: 80000000
description: |
The option value shall be the VCLK frequency in Hz.
enabled-by: true
format: '{}'
links: []
name: TMS570_VCLK_HZ
type: build

View File

@@ -0,0 +1,21 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
actions:
- get-integer: null
- define: null
build-type: option
copyrights:
- Copyright (C) 2024 embedded brains GmbH & Co. KG
default:
- enabled-by:
- arm/tms570lc4357_hdk
- arm/tms570lc4357_hdk_sdram
value: 75000000
- enabled-by: true
value: 80000000
description: |
The option value shall be the VCLK2 frequency in Hz.
enabled-by: true
format: '{}'
links: []
name: TMS570_VCLK2_HZ
type: build

View File

@@ -0,0 +1,21 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
actions:
- get-integer: null
- define: null
build-type: option
copyrights:
- Copyright (C) 2024 embedded brains GmbH & Co. KG
default:
- enabled-by:
- arm/tms570lc4357_hdk
- arm/tms570lc4357_hdk_sdram
value: 75000000
- enabled-by: true
value: 80000000
description: |
The option value shall be the VCLK3 frequency in Hz.
enabled-by: true
format: '{}'
links: []
name: TMS570_VCLK3_HZ
type: build