[PATCH 45/47] bsp/tms570: Board-specific tms570_pinmux_init()

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Dec 21 14:38:18 UTC 2023


From: Tyler Miller <tyler.miller at airbusus.com>

---
 bsps/arm/tms570/include/bsp/tms570_hwinit.h   |   7 +-
 .../tms570/include/bsp/tms570lc4357-pins.h    |  76 +++--
 bsps/arm/tms570/start/hwinit-lc4357-hdk.c     |  60 ++++
 bsps/arm/tms570/start/hwinit-ls3137-hdk.c     | 184 ++++++++++++
 bsps/arm/tms570/start/init_pinmux.c           | 283 ------------------
 spec/build/bsps/arm/tms570/objhwinit.yml      |   1 -
 6 files changed, 300 insertions(+), 311 deletions(-)
 delete mode 100644 bsps/arm/tms570/start/init_pinmux.c

diff --git a/bsps/arm/tms570/include/bsp/tms570_hwinit.h b/bsps/arm/tms570/include/bsp/tms570_hwinit.h
index eca4a5e7cc..f88463bb43 100644
--- a/bsps/arm/tms570/include/bsp/tms570_hwinit.h
+++ b/bsps/arm/tms570/include/bsp/tms570_hwinit.h
@@ -71,7 +71,6 @@ void _mpuInit_( void );
 
 void tms570_emif_sdram_init( void );
 void tms570_memory_init( uint32_t ram );
-void tms570_pinmux_init( void );
 void tms570_trim_lpo_init( void );
 void tms570_flash_init( void );
 void tms570_periph_init( void );
@@ -96,4 +95,10 @@ void tms570_pll_init(void);
  */
 void tms570_map_clock_init(void);
 
+/**
+ * @brief Initialize the tms570 PINMUX peripheral. This maps signals to pin
+ *   terminals.
+ */
+void tms570_pinmux_init(void);
+
 #endif /* LIBBSP_ARM_TMS570_HWINIT_H */
diff --git a/bsps/arm/tms570/include/bsp/tms570lc4357-pins.h b/bsps/arm/tms570/include/bsp/tms570lc4357-pins.h
index 8807f41e82..a78c9222f2 100644
--- a/bsps/arm/tms570/include/bsp/tms570lc4357-pins.h
+++ b/bsps/arm/tms570/include/bsp/tms570lc4357-pins.h
@@ -928,6 +928,11 @@
                 TMS570_PIN_AND_FNC(TMS570_BALL_B11, 5), \
                 TMS570_PIN_AND_FNC(TMS570_PIN_MMR_ALT_eQEP2S, 1))
 
+/// (TM) TODO: is this correct? LS3137ZWT uses TMS570_PIN_AND_FNC(TMS570_BALL_WITH_MMR(29, 3), 0)
+///   Per the schematic, this pin (called MII_RX_DV / RX_DV) attaches to pad B11 and can select
+///   between MII and RMII mode for the PHY. A pin like this is required for the lwip tms570 rtems port
+#define TMS570_MMR_SELECT_GMII_SEL TMS570_BALL_B11_MII_RX_DV
+
 #define TMS570_BALL_D8 TMS570_BALL_WITH_MMR(34, 3)
 #define TMS570_BALL_D8_HET2_01 TMS570_PIN_WITH_IN_ALT( \
                 TMS570_PIN_AND_FNC(TMS570_BALL_D8, 0), \
@@ -998,8 +1003,7 @@
 
 /* Default pinmux select */
 
-#define TMS570_PINMMR_DEFAULT_INIT_LIST(per_pin_action, common_arg) \
-  per_pin_action(common_arg, TMS570_BALL_N19_AD1EVT) \
+#define TMS570LC4357_PINMMR_DEFAULT_INIT_LIST(per_pin_action, common_arg) \
   per_pin_action(common_arg, TMS570_BALL_D4_EMIF_ADDR_00) \
   per_pin_action(common_arg, TMS570_BALL_D5_EMIF_ADDR_01) \
   per_pin_action(common_arg, TMS570_BALL_C4_EMIF_ADDR_06) \
@@ -1027,30 +1031,30 @@
   per_pin_action(common_arg, TMS570_BALL_R3_EMIF_nRAS) \
   per_pin_action(common_arg, TMS570_BALL_P3_EMIF_nWAIT) \
   per_pin_action(common_arg, TMS570_BALL_D17_EMIF_nWE) \
-  per_pin_action(common_arg, TMS570_BALL_E9_ETMDATA_08) \
-  per_pin_action(common_arg, TMS570_BALL_E8_ETMDATA_09) \
-  per_pin_action(common_arg, TMS570_BALL_E7_ETMDATA_10) \
-  per_pin_action(common_arg, TMS570_BALL_E6_ETMDATA_11) \
-  per_pin_action(common_arg, TMS570_BALL_E13_ETMDATA_12) \
-  per_pin_action(common_arg, TMS570_BALL_E12_ETMDATA_13) \
-  per_pin_action(common_arg, TMS570_BALL_E11_ETMDATA_14) \
-  per_pin_action(common_arg, TMS570_BALL_E10_ETMDATA_15) \
-  per_pin_action(common_arg, TMS570_BALL_K15_ETMDATA_16) \
-  per_pin_action(common_arg, TMS570_BALL_L15_ETMDATA_17) \
-  per_pin_action(common_arg, TMS570_BALL_M15_ETMDATA_18) \
-  per_pin_action(common_arg, TMS570_BALL_N15_ETMDATA_19) \
-  per_pin_action(common_arg, TMS570_BALL_E5_ETMDATA_20) \
-  per_pin_action(common_arg, TMS570_BALL_F5_ETMDATA_21) \
-  per_pin_action(common_arg, TMS570_BALL_G5_ETMDATA_22) \
-  per_pin_action(common_arg, TMS570_BALL_K5_ETMDATA_23) \
-  per_pin_action(common_arg, TMS570_BALL_L5_ETMDATA_24) \
-  per_pin_action(common_arg, TMS570_BALL_M5_ETMDATA_25) \
-  per_pin_action(common_arg, TMS570_BALL_N5_ETMDATA_26) \
-  per_pin_action(common_arg, TMS570_BALL_P5_ETMDATA_27) \
-  per_pin_action(common_arg, TMS570_BALL_R5_ETMDATA_28) \
-  per_pin_action(common_arg, TMS570_BALL_R6_ETMDATA_29) \
-  per_pin_action(common_arg, TMS570_BALL_R7_ETMDATA_30) \
-  per_pin_action(common_arg, TMS570_BALL_R8_ETMDATA_31) \
+  per_pin_action(common_arg, TMS570_BALL_E9_EMIF_ADDR_05) \
+  per_pin_action(common_arg, TMS570_BALL_E8_EMIF_ADDR_04) \
+  per_pin_action(common_arg, TMS570_BALL_E7_EMIF_ADDR_03) \
+  per_pin_action(common_arg, TMS570_BALL_E6_EMIF_ADDR_02) \
+  per_pin_action(common_arg, TMS570_BALL_E13_EMIF_BA_0) \
+  per_pin_action(common_arg, TMS570_BALL_E12_EMIF_nOE) \
+  per_pin_action(common_arg, TMS570_BALL_E11_EMIF_nDQM_1) \
+  per_pin_action(common_arg, TMS570_BALL_E10_EMIF_nDQM_0) \
+  per_pin_action(common_arg, TMS570_BALL_K15_EMIF_DATA_00) \
+  per_pin_action(common_arg, TMS570_BALL_L15_EMIF_DATA_01) \
+  per_pin_action(common_arg, TMS570_BALL_M15_EMIF_DATA_02) \
+  per_pin_action(common_arg, TMS570_BALL_N15_EMIF_DATA_03) \
+  per_pin_action(common_arg, TMS570_BALL_E5_EMIF_DATA_04) \
+  per_pin_action(common_arg, TMS570_BALL_F5_EMIF_DATA_05) \
+  per_pin_action(common_arg, TMS570_BALL_G5_EMIF_DATA_06) \
+  per_pin_action(common_arg, TMS570_BALL_K5_EMIF_DATA_07) \
+  per_pin_action(common_arg, TMS570_BALL_L5_EMIF_DATA_08) \
+  per_pin_action(common_arg, TMS570_BALL_M5_EMIF_DATA_09) \
+  per_pin_action(common_arg, TMS570_BALL_N5_EMIF_DATA_10) \
+  per_pin_action(common_arg, TMS570_BALL_P5_EMIF_DATA_11) \
+  per_pin_action(common_arg, TMS570_BALL_R5_EMIF_DATA_12) \
+  per_pin_action(common_arg, TMS570_BALL_R6_EMIF_DATA_13) \
+  per_pin_action(common_arg, TMS570_BALL_R7_EMIF_DATA_14) \
+  per_pin_action(common_arg, TMS570_BALL_R8_EMIF_DATA_15) \
   per_pin_action(common_arg, TMS570_BALL_R9_ETMTRACECLKIN) \
   per_pin_action(common_arg, TMS570_BALL_R10_ETMTRACECLKOUT) \
   per_pin_action(common_arg, TMS570_BALL_R11_ETMTRACECTL) \
@@ -1132,7 +1136,27 @@
   per_pin_action(common_arg, TMS570_BALL_U7_MII_TX_CLK) \
   per_pin_action(common_arg, TMS570_BALL_E2_HET2_03) \
   per_pin_action(common_arg, TMS570_BALL_N3_HET2_07) \
+  per_pin_action(common_arg, TMS570_BALL_K3_EMIF_CLK) \
+  per_pin_action(common_arg, TMS570_BALL_N19_MII_RX_ER) \
+  per_pin_action(common_arg, TMS570_BALL_F3_MII_COL) \
+  per_pin_action(common_arg, TMS570_BALL_E18_MII_TXD_3) \
+  per_pin_action(common_arg, TMS570_BALL_R2_MII_TXD_2) \
+  per_pin_action(common_arg, TMS570_BALL_J19_MII_TXD_1) \
+  per_pin_action(common_arg, TMS570_BALL_J18_MII_TXD_0) \
+  per_pin_action(common_arg, TMS570_BALL_H19_MII_TXEN) \
+  per_pin_action(common_arg, TMS570_BALL_D19_MII_TX_CLK) \
+  per_pin_action(common_arg, TMS570_BALL_B4_MII_CRS) \
+  per_pin_action(common_arg, TMS570_BALL_K19_MII_RXCLK) \
+  per_pin_action(common_arg, TMS570_BALL_H18_MII_RXD_3) \
+  per_pin_action(common_arg, TMS570_BALL_G19_MII_RXD_2) \
+  per_pin_action(common_arg, TMS570_BALL_A14_MII_RXD_1) \
+  per_pin_action(common_arg, TMS570_BALL_P1_MII_RXD_0) \
+  per_pin_action(common_arg, TMS570_BALL_B11_MII_RX_DV) \
+  per_pin_action(common_arg, TMS570_BALL_G3_MDIO) \
+  per_pin_action(common_arg, TMS570_BALL_V5_MDCLK)
 
 /* End of default PINMMR list */
 
+// Note EMIF Clock enable (EMIF_CKE) on Ball L3 has no alternate functions and is enabled by default
+
 #endif /*LIBBSP_ARM_TMS570_TMS570LC4357_PINS_H*/
diff --git a/bsps/arm/tms570/start/hwinit-lc4357-hdk.c b/bsps/arm/tms570/start/hwinit-lc4357-hdk.c
index a57536be30..0c5a471748 100644
--- a/bsps/arm/tms570/start/hwinit-lc4357-hdk.c
+++ b/bsps/arm/tms570/start/hwinit-lc4357-hdk.c
@@ -10,6 +10,7 @@
 
 /*
  * Copyright (C) 2022 Airbus U.S. Space & Defense, Inc
+ * Copyright (C) 2016 Pavel Pisa <pisa at cmp.felk.cvut.cz>
  * Copyright (C) 2009-2015 Texas Instruments Incorporated - www.ti.com
  *
  *
@@ -45,6 +46,7 @@
 
 #include <bsp/tms570.h>
 #include <bsp/tms570_hwinit.h>
+#include <bsp/tms570-pinmux.h>
 
 typedef enum Tms570ClockDisableSources {
     TMS570_CLKDIS_SRC_OSC  = 0x01, ///< External high-speed oscillator as clock source
@@ -69,6 +71,64 @@ typedef enum Tms570GhvClockSources {
   TMS570_SYS_CLK_SRC_VCLK = 9U          /**< Alias for synchronous VCLK1 clock Source         */
 } Tms570GhvClockSources;
 
+/*
+ * The next construct allows to compute values for individual
+ * PINMMR registers based on the multiple processing
+ * complete pin functions list at compile time.
+ * Each line computes 32-bit value which selects function
+ * of consecutive four pins. Each pin function is defined
+ * by single byte.
+ */
+static const uint32_t tms570_pinmmr_init_data[] = {
+  TMS570_PINMMR_REG_VAL( 0, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 1, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 2, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 3, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 4, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 5, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 6, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 7, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 8, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 9, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 10, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 11, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 12, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 13, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 14, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 15, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 16, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 17, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 18, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 19, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 20, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 21, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 22, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 23, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 24, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 25, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 26, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 27, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 28, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 29, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 30, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 31, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 32, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 33, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 34, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 35, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 36, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 37, TMS570LC4357_PINMMR_DEFAULT_INIT_LIST ),
+};
+
+void tms570_pinmux_init( void )
+{
+    tms570_bsp_pinmmr_config(tms570_pinmmr_init_data, 0, RTEMS_ARRAY_SIZE(tms570_pinmmr_init_data));
+
+    tms570_pin_config_prepare();
+    TMS570_PINMUX[174] &= (TMS570_PINMUX[174] & ~(0x3 << 8)) | (0x1 << 9); // emif output-enable bit8= 0, bit9= 1
+    tms570_pin_config_complete();
+}
+
 /**
  * @brief Setup all system PLLs (HCG:setupPLL)
  *
diff --git a/bsps/arm/tms570/start/hwinit-ls3137-hdk.c b/bsps/arm/tms570/start/hwinit-ls3137-hdk.c
index e4b7cef336..610d20ecc3 100644
--- a/bsps/arm/tms570/start/hwinit-ls3137-hdk.c
+++ b/bsps/arm/tms570/start/hwinit-ls3137-hdk.c
@@ -9,6 +9,7 @@
  */
 
 /*
+ * Copyright (C) 2016 Pavel Pisa <pisa at cmp.felk.cvut.cz>
  * Copyright (C) 2009-2015 Texas Instruments Incorporated - www.ti.com
  *
  *
@@ -44,6 +45,7 @@
 
 #include <bsp/tms570.h>
 #include <bsp/tms570_hwinit.h>
+#include <bsp/tms570-pinmux.h>
 
 enum tms570_system_clock_source {
   TMS570_SYS_CLK_SRC_OSC = 0U,          /**< Alias for oscillator clock Source                */
@@ -56,6 +58,188 @@ enum tms570_system_clock_source {
   TMS570_SYS_CLK_SRC_VCLK = 9U          /**< Alias for synchronous VCLK1 clock Source         */
 };
 
+/*
+ * Definition of fuctions for all pins of TMS570LS3137.
+ * This setup correctponds to TMS570LS31x HDK Kit
+ */
+
+#define TMS570_PINMMR_INIT_LIST( per_pin_action, common_arg ) \
+  per_pin_action( common_arg, TMS570_BALL_W10_GIOB_3 ) \
+  per_pin_action( common_arg, TMS570_BALL_A5_GIOA_0 ) \
+  per_pin_action( common_arg, TMS570_BALL_C3_MIBSPI3NCS_3 ) \
+  per_pin_action( common_arg, TMS570_BALL_B2_MIBSPI3NCS_2 ) \
+  per_pin_action( common_arg, TMS570_BALL_C2_GIOA_1 ) \
+  per_pin_action( common_arg, TMS570_BALL_E3_HET1_11 ) \
+  per_pin_action( common_arg, TMS570_BALL_E5_EMIF_DATA_4 ) \
+  per_pin_action( common_arg, TMS570_BALL_F5_EMIF_DATA_5 ) \
+  per_pin_action( common_arg, TMS570_BALL_C1_GIOA_2 ) \
+  per_pin_action( common_arg, TMS570_BALL_G5_EMIF_DATA_6 ) \
+  per_pin_action( common_arg, TMS570_BALL_E1_GIOA_3 ) \
+  per_pin_action( common_arg, TMS570_BALL_B5_GIOA_5 ) \
+  per_pin_action( common_arg, TMS570_BALL_K5_EMIF_DATA_7 ) \
+  per_pin_action( common_arg, TMS570_BALL_B3_HET1_22 ) \
+  per_pin_action( common_arg, TMS570_BALL_H3_GIOA_6 ) \
+  per_pin_action( common_arg, TMS570_BALL_L5_EMIF_DATA_8 ) \
+  per_pin_action( common_arg, TMS570_BALL_M1_GIOA_7 ) \
+  per_pin_action( common_arg, TMS570_BALL_M5_EMIF_DATA_9 ) \
+  per_pin_action( common_arg, TMS570_BALL_V2_HET1_01 ) \
+  per_pin_action( common_arg, TMS570_BALL_U1_HET1_03 ) \
+  per_pin_action( common_arg, TMS570_BALL_K18_HET1_00 ) \
+  per_pin_action( common_arg, TMS570_BALL_W5_HET1_02 ) \
+  per_pin_action( common_arg, TMS570_BALL_V6_HET1_05 ) \
+  per_pin_action( common_arg, TMS570_BALL_N5_EMIF_DATA_10 ) \
+  per_pin_action( common_arg, TMS570_BALL_T1_HET1_07 ) \
+  per_pin_action( common_arg, TMS570_BALL_P5_EMIF_DATA_11 ) \
+  per_pin_action( common_arg, TMS570_BALL_V7_HET1_09 ) \
+  per_pin_action( common_arg, TMS570_BALL_R5_EMIF_DATA_12 ) \
+  per_pin_action( common_arg, TMS570_BALL_R6_EMIF_DATA_13 ) \
+  per_pin_action( common_arg, TMS570_BALL_V5_MIBSPI3NCS_1 ) \
+  per_pin_action( common_arg, TMS570_BALL_W3_SCIRX ) \
+  per_pin_action( common_arg, TMS570_BALL_R7_EMIF_DATA_14 ) \
+  per_pin_action( common_arg, TMS570_BALL_N2_SCITX ) \
+  per_pin_action( common_arg, TMS570_BALL_G3_MIBSPI1NCS_2 ) \
+  per_pin_action( common_arg, TMS570_BALL_N1_HET1_15 ) \
+  per_pin_action( common_arg, TMS570_BALL_R8_EMIF_DATA_15 ) \
+  per_pin_action( common_arg, TMS570_BALL_R9_ETMTRACECLKIN ) \
+  per_pin_action( common_arg, TMS570_BALL_W9_MIBSPI3NENA ) \
+  per_pin_action( common_arg, TMS570_BALL_V10_MIBSPI3NCS_0 ) \
+  per_pin_action( common_arg, TMS570_BALL_J3_MIBSPI1NCS_3 ) \
+  per_pin_action( common_arg, TMS570_BALL_N19_AD1EVT ) \
+  per_pin_action( common_arg, TMS570_BALL_N15_EMIF_DATA_3 ) \
+  per_pin_action( common_arg, TMS570_BALL_N17_EMIF_nCS_0 ) \
+  per_pin_action( common_arg, TMS570_BALL_M15_EMIF_DATA_2 ) \
+  per_pin_action( common_arg, TMS570_BALL_K17_EMIF_nCS_3 ) \
+  per_pin_action( common_arg, TMS570_BALL_M17_EMIF_nCS_4 ) \
+  per_pin_action( common_arg, TMS570_BALL_L15_EMIF_DATA_1 ) \
+  per_pin_action( common_arg, TMS570_BALL_P1_HET1_24 ) \
+  per_pin_action( common_arg, TMS570_BALL_A14_HET1_26 ) \
+  per_pin_action( common_arg, TMS570_BALL_K15_EMIF_DATA_0 ) \
+  per_pin_action( common_arg, TMS570_BALL_G19_MIBSPI1NENA ) \
+  per_pin_action( common_arg, TMS570_BALL_H18_MIBSPI5NENA ) \
+  per_pin_action( common_arg, TMS570_BALL_J18_MIBSPI5SOMI_0 ) \
+  per_pin_action( common_arg, TMS570_BALL_J19_MIBSPI5SIMO_0 ) \
+  per_pin_action( common_arg, TMS570_BALL_H19_MIBSPI5CLK ) \
+  per_pin_action( common_arg, TMS570_BALL_R2_MIBSPI1NCS_0 ) \
+  per_pin_action( common_arg, TMS570_BALL_E18_HET1_08 ) \
+  per_pin_action( common_arg, TMS570_BALL_K19_HET1_28 ) \
+  per_pin_action( common_arg, TMS570_BALL_D17_EMIF_nWE ) \
+  per_pin_action( common_arg, TMS570_BALL_D16_EMIF_BA_1 ) \
+  per_pin_action( common_arg, TMS570_BALL_C17_EMIF_ADDR_21 ) \
+  per_pin_action( common_arg, TMS570_BALL_C16_EMIF_ADDR_20 ) \
+  per_pin_action( common_arg, TMS570_BALL_C15_EMIF_ADDR_19 ) \
+  per_pin_action( common_arg, TMS570_BALL_D15_EMIF_ADDR_18 ) \
+  per_pin_action( common_arg, TMS570_BALL_E13_EMIF_BA_0 ) \
+  per_pin_action( common_arg, TMS570_BALL_C14_EMIF_ADDR_17 ) \
+  per_pin_action( common_arg, TMS570_BALL_D14_EMIF_ADDR_16 ) \
+  per_pin_action( common_arg, TMS570_BALL_E12_EMIF_nOE ) \
+  per_pin_action( common_arg, TMS570_BALL_D19_HET1_10 ) \
+  per_pin_action( common_arg, TMS570_BALL_E11_EMIF_nDQM_1 ) \
+  per_pin_action( common_arg, TMS570_BALL_B4_HET1_12 ) \
+  per_pin_action( common_arg, TMS570_BALL_E9_EMIF_ADDR_5 ) \
+  per_pin_action( common_arg, TMS570_BALL_C13_EMIF_ADDR_15 ) \
+  per_pin_action( common_arg, TMS570_BALL_A11_HET1_14 ) \
+  per_pin_action( common_arg, TMS570_BALL_C12_EMIF_ADDR_14 ) \
+  per_pin_action( common_arg, TMS570_BALL_M2_GIOB_0 ) \
+  per_pin_action( common_arg, TMS570_BALL_E8_EMIF_ADDR_4 ) \
+  per_pin_action( common_arg, TMS570_BALL_B11_HET1_30 ) \
+  per_pin_action( common_arg, TMS570_BALL_E10_EMIF_nDQM_0 ) \
+  per_pin_action( common_arg, TMS570_BALL_E7_EMIF_ADDR_3 ) \
+  per_pin_action( common_arg, TMS570_BALL_C11_EMIF_ADDR_13 ) \
+  per_pin_action( common_arg, TMS570_BALL_C10_EMIF_ADDR_12 ) \
+  per_pin_action( common_arg, TMS570_BALL_F3_MIBSPI1NCS_1 ) \
+  per_pin_action( common_arg, TMS570_BALL_C9_EMIF_ADDR_11 ) \
+  per_pin_action( common_arg, TMS570_BALL_D5_EMIF_ADDR_1 ) \
+  per_pin_action( common_arg, TMS570_BALL_K2_GIOB_1 ) \
+  per_pin_action( common_arg, TMS570_BALL_C8_EMIF_ADDR_10 ) \
+  per_pin_action( common_arg, TMS570_BALL_C7_EMIF_ADDR_9 ) \
+  per_pin_action( common_arg, TMS570_BALL_D4_EMIF_ADDR_0 ) \
+  per_pin_action( common_arg, TMS570_BALL_C5_EMIF_ADDR_7 ) \
+  per_pin_action( common_arg, TMS570_BALL_C4_EMIF_ADDR_6 ) \
+  per_pin_action( common_arg, TMS570_BALL_E6_EMIF_ADDR_2 ) \
+  per_pin_action( common_arg, TMS570_BALL_C6_EMIF_ADDR_8 ) \
+  per_pin_action( common_arg, TMS570_MMR_SELECT_SPI4CLK ) \
+  per_pin_action( common_arg, TMS570_MMR_SELECT_SPI4SIMO ) \
+  per_pin_action( common_arg, TMS570_MMR_SELECT_SPI4SOMI ) \
+  per_pin_action( common_arg, TMS570_MMR_SELECT_SPI4NENA ) \
+  per_pin_action( common_arg, TMS570_MMR_SELECT_SPI4NCS_0 ) \
+  per_pin_action( common_arg, TMS570_BALL_A13_HET1_17 ) \
+  per_pin_action( common_arg, TMS570_BALL_B13_HET1_19 ) \
+  per_pin_action( common_arg, TMS570_BALL_H4_HET1_21 ) \
+  per_pin_action( common_arg, TMS570_BALL_J4_HET1_23 ) \
+  per_pin_action( common_arg, TMS570_BALL_M3_HET1_25 ) \
+  per_pin_action( common_arg, TMS570_BALL_A9_HET1_27 ) \
+  per_pin_action( common_arg, TMS570_BALL_A3_HET1_29 ) \
+  per_pin_action( common_arg, TMS570_BALL_J17_HET1_31 ) \
+  per_pin_action( common_arg, TMS570_BALL_W6_MIBSPI5NCS_2 ) \
+  per_pin_action( common_arg, TMS570_BALL_T12_MIBSPI5NCS_3 ) \
+  per_pin_action( common_arg, TMS570_BALL_E19_MIBSPI5NCS_0 ) \
+  per_pin_action( common_arg, TMS570_BALL_B6_MIBSPI5NCS_1 ) \
+  per_pin_action( common_arg, TMS570_BALL_E16_MIBSPI5SIMO_1 ) \
+  per_pin_action( common_arg, TMS570_BALL_H17_MIBSPI5SIMO_2 ) \
+  per_pin_action( common_arg, TMS570_BALL_G17_MIBSPI5SIMO_3 ) \
+  per_pin_action( common_arg, TMS570_BALL_E17_MIBSPI5SOMI_1 ) \
+  per_pin_action( common_arg, TMS570_BALL_H16_MIBSPI5SOMI_2 ) \
+  per_pin_action( common_arg, TMS570_BALL_G16_MIBSPI5SOMI_3 ) \
+  per_pin_action( common_arg, TMS570_BALL_D3_SPI2NENA ) \
+  per_pin_action( common_arg, \
+  TMS570_MMR_SELECT_EMIF_CLK_SEL | TMS570_PIN_CLEAR_RQ_MASK ) \
+  per_pin_action( common_arg, \
+  TMS570_BALL_F2_GIOB_2 | TMS570_PIN_CLEAR_RQ_MASK ) \
+  per_pin_action( common_arg, \
+  TMS570_MMR_SELECT_MII_MODE | TMS570_PIN_CLEAR_RQ_MASK ) \
+  per_pin_action( common_arg, TMS570_MMR_SELECT_ADC_TRG1 )
+
+/*
+ * The next construct allows to compute values for individual
+ * PINMMR registers based on the multiple processing
+ * complete pin functions list at compile time.
+ * Each line computes 32-bit value which selects function
+ * of consecutive four pins. Each pin function is defined
+ * by single byte.
+ */
+static const uint32_t tms570_pinmmr_init_data[] = {
+  TMS570_PINMMR_REG_VAL( 0, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 1, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 2, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 3, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 4, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 5, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 6, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 7, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 8, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 9, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 10, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 11, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 12, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 13, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 14, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 15, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 16, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 17, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 18, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 19, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 20, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 21, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 22, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 23, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 24, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 25, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 26, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 27, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 28, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 29, TMS570_PINMMR_INIT_LIST ),
+  TMS570_PINMMR_REG_VAL( 30, TMS570_PINMMR_INIT_LIST ),
+};
+
+/**
+ * @brief setups pin multiplexer according to precomputed registers values (HCG:muxInit)
+ */
+void tms570_pinmux_init( void )
+{
+  tms570_bsp_pinmmr_config( tms570_pinmmr_init_data, 0,
+    RTEMS_ARRAY_SIZE( tms570_pinmmr_init_data ) );
+}
+
 /**
  * @brief Setup all system PLLs (HCG:setupPLL)
  *
diff --git a/bsps/arm/tms570/start/init_pinmux.c b/bsps/arm/tms570/start/init_pinmux.c
deleted file mode 100644
index 5f6192bab7..0000000000
--- a/bsps/arm/tms570/start/init_pinmux.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSBSPsARMTMS570
- *
- * @brief This source file contains the pin multiplexer initialization.
- */
-
-/*
- * Copyright (C) 2016 Pavel Pisa <pisa at cmp.felk.cvut.cz>
- *
- * Czech Technical University in Prague
- * Zikova 1903/4
- * 166 36 Praha 6
- * Czech Republic
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <bsp/tms570.h>
-#include <bsp/tms570-pinmux.h>
-#include <rtems.h>
-#include <bsp/tms570_hwinit.h>
-
-/*
- * To check that content is right generated use
- *
- * objdump --section=.rodata -s init_pinmux.o
- */
-#if 0
-
-/*
- * Test of use of the default pins configuration with one line added.
- * This can be used to concatenate partial lists but care has to
- * be taken to not attempt to override already defined pin.
- * This would not work and result in two PINMMR bits set
- * for given pine.
- */
-
-#ifndef TMS570_PINMMR_INIT_LIST
-  #define TMS570_PINMMR_INIT_LIST(per_pin_action, common_arg) \
-     TMS570_PINMMR_DEFAULT_INIT_LIST(per_pin_action, common_arg) \
-     per_pin_action(common_arg, TMS570_BALL_E3_HET2_18)
-#endif
-
-#elif TMS570_VARIANT == 4357
-
-#define TMS570_PINMMR_INIT_LIST( per_pin_action, common_arg )
-
-#else
-
-/*
- * Definition of fuctions for all pins of TMS570LS3137.
- * This setup correctponds to TMS570LS31x HDK Kit
- */
-
-#define TMS570_PINMMR_INIT_LIST( per_pin_action, common_arg ) \
-  per_pin_action( common_arg, TMS570_BALL_W10_GIOB_3 ) \
-  per_pin_action( common_arg, TMS570_BALL_A5_GIOA_0 ) \
-  per_pin_action( common_arg, TMS570_BALL_C3_MIBSPI3NCS_3 ) \
-  per_pin_action( common_arg, TMS570_BALL_B2_MIBSPI3NCS_2 ) \
-  per_pin_action( common_arg, TMS570_BALL_C2_GIOA_1 ) \
-  per_pin_action( common_arg, TMS570_BALL_E3_HET1_11 ) \
-  per_pin_action( common_arg, TMS570_BALL_E5_EMIF_DATA_4 ) \
-  per_pin_action( common_arg, TMS570_BALL_F5_EMIF_DATA_5 ) \
-  per_pin_action( common_arg, TMS570_BALL_C1_GIOA_2 ) \
-  per_pin_action( common_arg, TMS570_BALL_G5_EMIF_DATA_6 ) \
-  per_pin_action( common_arg, TMS570_BALL_E1_GIOA_3 ) \
-  per_pin_action( common_arg, TMS570_BALL_B5_GIOA_5 ) \
-  per_pin_action( common_arg, TMS570_BALL_K5_EMIF_DATA_7 ) \
-  per_pin_action( common_arg, TMS570_BALL_B3_HET1_22 ) \
-  per_pin_action( common_arg, TMS570_BALL_H3_GIOA_6 ) \
-  per_pin_action( common_arg, TMS570_BALL_L5_EMIF_DATA_8 ) \
-  per_pin_action( common_arg, TMS570_BALL_M1_GIOA_7 ) \
-  per_pin_action( common_arg, TMS570_BALL_M5_EMIF_DATA_9 ) \
-  per_pin_action( common_arg, TMS570_BALL_V2_HET1_01 ) \
-  per_pin_action( common_arg, TMS570_BALL_U1_HET1_03 ) \
-  per_pin_action( common_arg, TMS570_BALL_K18_HET1_00 ) \
-  per_pin_action( common_arg, TMS570_BALL_W5_HET1_02 ) \
-  per_pin_action( common_arg, TMS570_BALL_V6_HET1_05 ) \
-  per_pin_action( common_arg, TMS570_BALL_N5_EMIF_DATA_10 ) \
-  per_pin_action( common_arg, TMS570_BALL_T1_HET1_07 ) \
-  per_pin_action( common_arg, TMS570_BALL_P5_EMIF_DATA_11 ) \
-  per_pin_action( common_arg, TMS570_BALL_V7_HET1_09 ) \
-  per_pin_action( common_arg, TMS570_BALL_R5_EMIF_DATA_12 ) \
-  per_pin_action( common_arg, TMS570_BALL_R6_EMIF_DATA_13 ) \
-  per_pin_action( common_arg, TMS570_BALL_V5_MIBSPI3NCS_1 ) \
-  per_pin_action( common_arg, TMS570_BALL_W3_SCIRX ) \
-  per_pin_action( common_arg, TMS570_BALL_R7_EMIF_DATA_14 ) \
-  per_pin_action( common_arg, TMS570_BALL_N2_SCITX ) \
-  per_pin_action( common_arg, TMS570_BALL_G3_MIBSPI1NCS_2 ) \
-  per_pin_action( common_arg, TMS570_BALL_N1_HET1_15 ) \
-  per_pin_action( common_arg, TMS570_BALL_R8_EMIF_DATA_15 ) \
-  per_pin_action( common_arg, TMS570_BALL_R9_ETMTRACECLKIN ) \
-  per_pin_action( common_arg, TMS570_BALL_W9_MIBSPI3NENA ) \
-  per_pin_action( common_arg, TMS570_BALL_V10_MIBSPI3NCS_0 ) \
-  per_pin_action( common_arg, TMS570_BALL_J3_MIBSPI1NCS_3 ) \
-  per_pin_action( common_arg, TMS570_BALL_N19_AD1EVT ) \
-  per_pin_action( common_arg, TMS570_BALL_N15_EMIF_DATA_3 ) \
-  per_pin_action( common_arg, TMS570_BALL_N17_EMIF_nCS_0 ) \
-  per_pin_action( common_arg, TMS570_BALL_M15_EMIF_DATA_2 ) \
-  per_pin_action( common_arg, TMS570_BALL_K17_EMIF_nCS_3 ) \
-  per_pin_action( common_arg, TMS570_BALL_M17_EMIF_nCS_4 ) \
-  per_pin_action( common_arg, TMS570_BALL_L15_EMIF_DATA_1 ) \
-  per_pin_action( common_arg, TMS570_BALL_P1_HET1_24 ) \
-  per_pin_action( common_arg, TMS570_BALL_A14_HET1_26 ) \
-  per_pin_action( common_arg, TMS570_BALL_K15_EMIF_DATA_0 ) \
-  per_pin_action( common_arg, TMS570_BALL_G19_MIBSPI1NENA ) \
-  per_pin_action( common_arg, TMS570_BALL_H18_MIBSPI5NENA ) \
-  per_pin_action( common_arg, TMS570_BALL_J18_MIBSPI5SOMI_0 ) \
-  per_pin_action( common_arg, TMS570_BALL_J19_MIBSPI5SIMO_0 ) \
-  per_pin_action( common_arg, TMS570_BALL_H19_MIBSPI5CLK ) \
-  per_pin_action( common_arg, TMS570_BALL_R2_MIBSPI1NCS_0 ) \
-  per_pin_action( common_arg, TMS570_BALL_E18_HET1_08 ) \
-  per_pin_action( common_arg, TMS570_BALL_K19_HET1_28 ) \
-  per_pin_action( common_arg, TMS570_BALL_D17_EMIF_nWE ) \
-  per_pin_action( common_arg, TMS570_BALL_D16_EMIF_BA_1 ) \
-  per_pin_action( common_arg, TMS570_BALL_C17_EMIF_ADDR_21 ) \
-  per_pin_action( common_arg, TMS570_BALL_C16_EMIF_ADDR_20 ) \
-  per_pin_action( common_arg, TMS570_BALL_C15_EMIF_ADDR_19 ) \
-  per_pin_action( common_arg, TMS570_BALL_D15_EMIF_ADDR_18 ) \
-  per_pin_action( common_arg, TMS570_BALL_E13_EMIF_BA_0 ) \
-  per_pin_action( common_arg, TMS570_BALL_C14_EMIF_ADDR_17 ) \
-  per_pin_action( common_arg, TMS570_BALL_D14_EMIF_ADDR_16 ) \
-  per_pin_action( common_arg, TMS570_BALL_E12_EMIF_nOE ) \
-  per_pin_action( common_arg, TMS570_BALL_D19_HET1_10 ) \
-  per_pin_action( common_arg, TMS570_BALL_E11_EMIF_nDQM_1 ) \
-  per_pin_action( common_arg, TMS570_BALL_B4_HET1_12 ) \
-  per_pin_action( common_arg, TMS570_BALL_E9_EMIF_ADDR_5 ) \
-  per_pin_action( common_arg, TMS570_BALL_C13_EMIF_ADDR_15 ) \
-  per_pin_action( common_arg, TMS570_BALL_A11_HET1_14 ) \
-  per_pin_action( common_arg, TMS570_BALL_C12_EMIF_ADDR_14 ) \
-  per_pin_action( common_arg, TMS570_BALL_M2_GIOB_0 ) \
-  per_pin_action( common_arg, TMS570_BALL_E8_EMIF_ADDR_4 ) \
-  per_pin_action( common_arg, TMS570_BALL_B11_HET1_30 ) \
-  per_pin_action( common_arg, TMS570_BALL_E10_EMIF_nDQM_0 ) \
-  per_pin_action( common_arg, TMS570_BALL_E7_EMIF_ADDR_3 ) \
-  per_pin_action( common_arg, TMS570_BALL_C11_EMIF_ADDR_13 ) \
-  per_pin_action( common_arg, TMS570_BALL_C10_EMIF_ADDR_12 ) \
-  per_pin_action( common_arg, TMS570_BALL_F3_MIBSPI1NCS_1 ) \
-  per_pin_action( common_arg, TMS570_BALL_C9_EMIF_ADDR_11 ) \
-  per_pin_action( common_arg, TMS570_BALL_D5_EMIF_ADDR_1 ) \
-  per_pin_action( common_arg, TMS570_BALL_K2_GIOB_1 ) \
-  per_pin_action( common_arg, TMS570_BALL_C8_EMIF_ADDR_10 ) \
-  per_pin_action( common_arg, TMS570_BALL_C7_EMIF_ADDR_9 ) \
-  per_pin_action( common_arg, TMS570_BALL_D4_EMIF_ADDR_0 ) \
-  per_pin_action( common_arg, TMS570_BALL_C5_EMIF_ADDR_7 ) \
-  per_pin_action( common_arg, TMS570_BALL_C4_EMIF_ADDR_6 ) \
-  per_pin_action( common_arg, TMS570_BALL_E6_EMIF_ADDR_2 ) \
-  per_pin_action( common_arg, TMS570_BALL_C6_EMIF_ADDR_8 ) \
-  per_pin_action( common_arg, TMS570_MMR_SELECT_SPI4CLK ) \
-  per_pin_action( common_arg, TMS570_MMR_SELECT_SPI4SIMO ) \
-  per_pin_action( common_arg, TMS570_MMR_SELECT_SPI4SOMI ) \
-  per_pin_action( common_arg, TMS570_MMR_SELECT_SPI4NENA ) \
-  per_pin_action( common_arg, TMS570_MMR_SELECT_SPI4NCS_0 ) \
-  per_pin_action( common_arg, TMS570_BALL_A13_HET1_17 ) \
-  per_pin_action( common_arg, TMS570_BALL_B13_HET1_19 ) \
-  per_pin_action( common_arg, TMS570_BALL_H4_HET1_21 ) \
-  per_pin_action( common_arg, TMS570_BALL_J4_HET1_23 ) \
-  per_pin_action( common_arg, TMS570_BALL_M3_HET1_25 ) \
-  per_pin_action( common_arg, TMS570_BALL_A9_HET1_27 ) \
-  per_pin_action( common_arg, TMS570_BALL_A3_HET1_29 ) \
-  per_pin_action( common_arg, TMS570_BALL_J17_HET1_31 ) \
-  per_pin_action( common_arg, TMS570_BALL_W6_MIBSPI5NCS_2 ) \
-  per_pin_action( common_arg, TMS570_BALL_T12_MIBSPI5NCS_3 ) \
-  per_pin_action( common_arg, TMS570_BALL_E19_MIBSPI5NCS_0 ) \
-  per_pin_action( common_arg, TMS570_BALL_B6_MIBSPI5NCS_1 ) \
-  per_pin_action( common_arg, TMS570_BALL_E16_MIBSPI5SIMO_1 ) \
-  per_pin_action( common_arg, TMS570_BALL_H17_MIBSPI5SIMO_2 ) \
-  per_pin_action( common_arg, TMS570_BALL_G17_MIBSPI5SIMO_3 ) \
-  per_pin_action( common_arg, TMS570_BALL_E17_MIBSPI5SOMI_1 ) \
-  per_pin_action( common_arg, TMS570_BALL_H16_MIBSPI5SOMI_2 ) \
-  per_pin_action( common_arg, TMS570_BALL_G16_MIBSPI5SOMI_3 ) \
-  per_pin_action( common_arg, TMS570_BALL_D3_SPI2NENA ) \
-  per_pin_action( common_arg, \
-  TMS570_MMR_SELECT_EMIF_CLK_SEL | TMS570_PIN_CLEAR_RQ_MASK ) \
-  per_pin_action( common_arg, \
-  TMS570_BALL_F2_GIOB_2 | TMS570_PIN_CLEAR_RQ_MASK ) \
-  per_pin_action( common_arg, \
-  TMS570_MMR_SELECT_MII_MODE | TMS570_PIN_CLEAR_RQ_MASK ) \
-  per_pin_action( common_arg, TMS570_MMR_SELECT_ADC_TRG1 ) \
-
-
-#endif
-
-/*
- * The next construct allows to compute values for individual
- * PINMMR registers based on the multiple processing
- * complete pin functions list at compile time.
- * Each line computes 32-bit value which selects function
- * of consecutive four pins. Each pin function is defined
- * by single byte.
- */
-const uint32_t tms570_pinmmr_init_data[] = {
-  TMS570_PINMMR_REG_VAL( 0, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 1, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 2, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 3, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 4, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 5, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 6, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 7, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 8, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 9, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 10, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 11, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 12, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 13, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 14, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 15, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 16, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 17, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 18, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 19, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 20, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 21, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 22, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 23, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 24, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 25, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 26, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 27, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 28, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 29, TMS570_PINMMR_INIT_LIST ),
-  TMS570_PINMMR_REG_VAL( 30, TMS570_PINMMR_INIT_LIST ),
-};
-
-/**
- * @brief setups pin multiplexer according to precomputed registers values (HCG:muxInit)
- */
-void tms570_pinmux_init( void )
-{
-  tms570_bsp_pinmmr_config( tms570_pinmmr_init_data, 0,
-    RTEMS_ARRAY_SIZE( tms570_pinmmr_init_data ) );
-}
-
-#if 0
-
-/*
- * Alternative option how to set function of individual pins
- * or use list for one by one setting. This is much slower
- * and consumes more memory to hold complete list.
- *
- * On the other hand this solution can be used for configuration
- * or reconfiguration of some shorter groups of pins at runtime.
- *
- */
-
-const uint32_t tms570_pinmmr_init_list[] = {
-  TMS570_PINMMR_COMA_LIST( TMS570_PINMMR_INIT_LIST )
-};
-
-void tms570_pinmux_init_by_list( void )
-{
-  int pincnt = RTEMS_ARRAY_SIZE( tms570_pinmmr_init_list );
-  const uint32_t *pinfnc = tms570_pinmmr_init_list;
-
-  while ( pincnt-- )
-    tms570_bsp_pin_config_one( *(pinfnc++) );
-}
-#endif
diff --git a/spec/build/bsps/arm/tms570/objhwinit.yml b/spec/build/bsps/arm/tms570/objhwinit.yml
index f6c02ec1d9..db4b8fdedd 100644
--- a/spec/build/bsps/arm/tms570/objhwinit.yml
+++ b/spec/build/bsps/arm/tms570/objhwinit.yml
@@ -23,7 +23,6 @@ source:
 - bsps/arm/tms570/start/fail_notification.c
 - bsps/arm/tms570/start/init_emif_sdram.c
 - bsps/arm/tms570/start/init_esm.c
-- bsps/arm/tms570/start/init_pinmux.c
 - bsps/arm/tms570/start/init_system.c
 - bsps/arm/tms570/start/tms570_selftest.c
 - bsps/arm/tms570/start/tms570_selftest_par_can.c
-- 
2.35.3



More information about the devel mailing list