This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 047a40917c Cmake: Implement CMake build of Tiva arch
047a40917c is described below

commit 047a40917ce42ba64f4d6606f5c3d5111c6d847e
Author: simbit18 <simbi...@gmail.com>
AuthorDate: Fri Apr 18 15:04:03 2025 +0200

    Cmake: Implement CMake build of Tiva arch
    
    added TI/Stellaris Tiva
    
    CMake added tm4c1294-launchpad and tm4c123g-launchpad board
    
    Signed-off-by: simbit18 <simbi...@gmail.com>
---
 arch/arm/src/tiva/CMakeLists.txt                   | 123 ++-------------------
 .../arm/src/tiva/cc13xx}/CMakeLists.txt            |  74 ++++++-------
 arch/arm/src/tiva/{ => common}/CMakeLists.txt      |  76 +++----------
 .../src => arch/arm/src/tiva/lm}/CMakeLists.txt    |  48 ++------
 .../src => arch/arm/src/tiva/tm4c}/CMakeLists.txt  |  46 ++------
 .../arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt |  36 +++---
 .../src => tm4c1294-launchpad}/CMakeLists.txt      |  45 +-------
 .../src/CMakeLists.txt                             |  31 +++---
 8 files changed, 115 insertions(+), 364 deletions(-)

diff --git a/arch/arm/src/tiva/CMakeLists.txt b/arch/arm/src/tiva/CMakeLists.txt
index d50b85c005..b62c85fe3b 100644
--- a/arch/arm/src/tiva/CMakeLists.txt
+++ b/arch/arm/src/tiva/CMakeLists.txt
@@ -20,123 +20,14 @@
 #
 # 
##############################################################################
 
-if(CONFIG_ARCH_CHIP_LM)
-  set(ARCH_CHIP lm)
-elseif(CONFIG_ARCH_CHIP_TM4C)
-  set(ARCH_CHIP tm4c)
-elseif(CONFIG_ARCH_CHIP_CC13X0)
-  set(ARCH_CHIP cc13xx)
-elseif(CONFIG_ARCH_CHIP_CC13X2)
-  set(ARCH_CHIP cc13xx)
-endif()
-
-set(SRCS)
-
-if(NOT CONFIG_ARCH_IDLE_CUSTOM)
-  list(APPEND SRCS tiva_idle.c)
-endif()
+# Paths to source files
 
-list(APPEND SRCS tiva_allocateheap.c tiva_irq.c tiva_lowputc.c tiva_serial.c)
-list(APPEND SRCS tiva_ssi.c)
+add_subdirectory(common)
 
-if(CONFIG_ARCH_CHIP_LM3S)
-  list(APPEND SRCS lmxx_tm4c_start.c lm3s_gpio.c lmxx_tm4c_gpioirq.c)
-  list(APPEND SRCS lm4xx_tm3c_sysctrl.c)
-elseif(CONFIG_ARCH_CHIP_LM4F)
-  list(APPEND SRCS lmxx_tm4c_start.c lm4f_gpio.c lmxx_tm4c_gpioirq.c)
-  list(APPEND SRCS lm4xx_tm3c_sysctrl.c)
+if(CONFIG_ARCH_CHIP_LM)
+  add_subdirectory(lm)
 elseif(CONFIG_ARCH_CHIP_TM4C)
-  list(APPEND SRCS lmxx_tm4c_start.c tm4c_gpio.c lmxx_tm4c_gpioirq.c)
-  if(CONFIG_ARCH_CHIP_TM4C129)
-    list(APPEND SRCS tm4c129_sysctrl.c)
-  else()
-    list(APPEND SRCS lm4xx_tm3c_sysctrl.c)
-  endif()
-
-elseif(CONFIG_ARCH_CHIP_CC13X0)
-  list(APPEND SRCS cc13xx_start.c cc13xx_prcm.c cc13xx_chipinfo.c 
cc13xx_gpio.c)
-  list(APPEND SRCS cc13xx_gpioirq.c cc13xx_enableclks.c cc13xx_enablepwr.c)
-  list(APPEND SRCS cc13x0_trim.c cc13x0_rom.c)
-elseif(CONFIG_ARCH_CHIP_CC13X2)
-  list(APPEND SRCS cc13xx_start.c cc13xx_prcm.c cc13xx_chipinfo.c 
cc13xx_gpio.c)
-  list(APPEND SRCS cc13xx_gpioirq.c cc13xx_enableclks.c cc13xx_enablepwr.c)
-  list(APPEND SRCS cc13x2_aux_sysif.c)
-  if(CONFIG_ARCH_CHIP_CC13XX_V1)
-    list(APPEND SRCS cc13x2_v1_trim.c cc13x2_cc26x2_v1_rom.c)
-  else()
-    list(APPEND SRCS cc13x2_v2_trim.c)
-  endif()
-endif()
-
-if(CONFIG_DEBUG_GPIO_INFO)
-  list(APPEND SRCS tiva_dumpgpio.c)
+  add_subdirectory(tm4c)
+elseif((CONFIG_ARCH_CHIP_CC13X0) OR (CONFIG_ARCH_CHIP_CC13X2))
+  add_subdirectory(cc13xx)
 endif()
-
-if(NOT CONFIG_SCHED_TICKLESS)
-  list(APPEND SRCS tiva_timerisr.c)
-endif()
-
-if(CONFIG_BUILD_PROTECTED)
-  list(APPEND SRCS tiva_userspace.c tiva_mpuinit.c)
-endif()
-
-if(CONFIG_TIVA_I2C)
-  list(APPEND SRCS tiva_i2c.c)
-endif()
-
-if(CONFIG_TIVA_PWM)
-  list(APPEND SRCS tiva_pwm.c)
-endif()
-
-if(CONFIG_TIVA_QEI)
-  list(APPEND SRCS tiva_qencoder.c)
-endif()
-
-if(CONFIG_TIVA_TIMER)
-  list(APPEND SRCS tiva_timerlib.c)
-  if(CONFIG_TIVA_TIMER32_PERIODIC)
-    list(APPEND SRCS tiva_timerlow32.c)
-  endif()
-endif()
-
-if(CONFIG_TIVA_ADC)
-  list(APPEND SRCS tiva_adclow.c)
-  list(APPEND SRCS tiva_adclib.c)
-endif()
-
-if(CONFIG_TIVA_CAN)
-  list(APPEND SRCS tiva_can.c)
-endif()
-
-if(CONFIG_TIVA_ETHERNET)
-  if(CONFIG_ARCH_CHIP_LM3S)
-    list(APPEND SRCS lm3s_ethernet.c)
-  endif()
-  if(CONFIG_ARCH_CHIP_TM4C)
-    list(APPEND SRCS tm4c_ethernet.c)
-  endif()
-endif()
-
-if(CONFIG_TIVA_FLASH)
-  list(APPEND SRCS tiva_flash.c)
-endif()
-
-if(CONFIG_TIVA_EEPROM)
-  list(APPEND SRCS tiva_eeprom.c)
-endif()
-
-if(CONFIG_TIVA_HCIUART)
-  list(APPEND SRCS tiva_hciuart.c)
-endif()
-
-set(COMMON_SRCS)
-
-foreach(src ${SRCS})
-  if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/common/${src})
-    list(APPEND COMMON_SRCS common/${src})
-  else()
-    list(APPEND COMMON_SRCS ${ARCH_CHIP}/${src})
-  endif()
-endforeach()
-
-target_sources(arch PRIVATE ${COMMON_SRCS})
diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt 
b/arch/arm/src/tiva/cc13xx/CMakeLists.txt
similarity index 54%
copy from boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
copy to arch/arm/src/tiva/cc13xx/CMakeLists.txt
index c2ec0e12ba..bd11879318 100644
--- a/boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
+++ b/arch/arm/src/tiva/cc13xx/CMakeLists.txt
@@ -1,5 +1,5 @@
 # 
##############################################################################
-# boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
+# arch/arm/src/tiva/cc13xx/CMakeLists.txt
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -20,45 +20,41 @@
 #
 # 
##############################################################################
 
-set(SRCS tm4c_boot.c tm4c_bringup.c)
-
-if(CONFIG_ARCH_LEDS)
-  list(APPEND SRCS tm4c_autoleds.c)
-else()
-  list(APPEND SRCS tm4c_userleds.c)
-endif()
-
-if(CONFIG_ARCH_BUTTONS)
-  list(APPEND SRCS tm4c_buttons.c)
-endif()
-
-if(CONFIG_BOARDCTL)
-  list(APPEND SRCS tm4c_appinit.c)
-endif()
-
-if(CONFIG_TIVA_ADC)
-  list(APPEND SRCS tm4c_adc.c)
-endif()
-
-if(CONFIG_TIVA_AT24)
-  list(APPEND SRCS tm4c_at24.c)
-endif()
-
-if(CONFIG_TIVA_CAN)
-  list(APPEND SRCS tm4c_can.c)
-  if(CONFIG_TIVA_MCP2515)
-    list(APPEND SRCS tm4c_mcp2515.c)
+if((CONFIG_ARCH_CHIP_CC13X0) OR (CONFIG_ARCH_CHIP_CC13X2))
+  set(SRCS)
+
+  if(CONFIG_ARCH_CHIP_CC13X0)
+    list(
+      APPEND
+      SRCS
+      cc13xx_start.c
+      cc13xx_prcm.c
+      cc13xx_chipinfo.c
+      cc13xx_gpio.c
+      cc13xx_gpioirq.c
+      cc13xx_enableclks.c
+      cc13xx_enablepwr.c
+      cc13x0_trim.c
+      cc13x0_rom.c)
+  elseif(CONFIG_ARCH_CHIP_CC13X2)
+    list(
+      APPEND
+      SRCS
+      cc13xx_start.c
+      cc13xx_prcm.c
+      cc13xx_chipinfo.c
+      cc13xx_gpio.c
+      cc13xx_gpioirq.c
+      cc13xx_enableclks.c
+      cc13xx_enablepwr.c
+      cc13x2_aux_sysif.c)
+    if(CONFIG_ARCH_CHIP_CC13XX_V1)
+      list(APPEND SRCS cc13x2_v1_trim.c cc13x2_cc26x2_v1_rom.c)
+    else()
+      list(APPEND SRCS cc13x2_v2_trim.c)
+    endif()
   endif()
-endif()
 
-if(CONFIG_TIVA_SSI)
-  list(APPEND SRCS tm4c_ssi.c)
-endif()
+  target_sources(arch PRIVATE ${SRCS})
 
-if(CONFIG_TIVA_TIMER)
-  list(APPEND SRCS tm4c_timer.c)
 endif()
-
-target_sources(board PRIVATE ${SRCS})
-
-set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
diff --git a/arch/arm/src/tiva/CMakeLists.txt 
b/arch/arm/src/tiva/common/CMakeLists.txt
similarity index 52%
copy from arch/arm/src/tiva/CMakeLists.txt
copy to arch/arm/src/tiva/common/CMakeLists.txt
index d50b85c005..47c5790f82 100644
--- a/arch/arm/src/tiva/CMakeLists.txt
+++ b/arch/arm/src/tiva/common/CMakeLists.txt
@@ -1,5 +1,5 @@
 # 
##############################################################################
-# arch/arm/src/tiva/CMakeLists.txt
+# arch/arm/src/tiva/common/CMakeLists.txt
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -20,52 +20,28 @@
 #
 # 
##############################################################################
 
-if(CONFIG_ARCH_CHIP_LM)
-  set(ARCH_CHIP lm)
-elseif(CONFIG_ARCH_CHIP_TM4C)
-  set(ARCH_CHIP tm4c)
-elseif(CONFIG_ARCH_CHIP_CC13X0)
-  set(ARCH_CHIP cc13xx)
-elseif(CONFIG_ARCH_CHIP_CC13X2)
-  set(ARCH_CHIP cc13xx)
-endif()
-
-set(SRCS)
-
 if(NOT CONFIG_ARCH_IDLE_CUSTOM)
   list(APPEND SRCS tiva_idle.c)
 endif()
 
-list(APPEND SRCS tiva_allocateheap.c tiva_irq.c tiva_lowputc.c tiva_serial.c)
-list(APPEND SRCS tiva_ssi.c)
+list(
+  APPEND
+  SRCS
+  tiva_allocateheap.c
+  tiva_irq.c
+  tiva_lowputc.c
+  tiva_serial.c
+  tiva_ssi.c)
 
 if(CONFIG_ARCH_CHIP_LM3S)
-  list(APPEND SRCS lmxx_tm4c_start.c lm3s_gpio.c lmxx_tm4c_gpioirq.c)
-  list(APPEND SRCS lm4xx_tm3c_sysctrl.c)
+  list(APPEND SRCS lmxx_tm4c_start.c lmxx_tm4c_gpioirq.c lm4xx_tm3c_sysctrl.c)
 elseif(CONFIG_ARCH_CHIP_LM4F)
-  list(APPEND SRCS lmxx_tm4c_start.c lm4f_gpio.c lmxx_tm4c_gpioirq.c)
-  list(APPEND SRCS lm4xx_tm3c_sysctrl.c)
+  list(APPEND SRCS lmxx_tm4c_start.c lmxx_tm4c_gpioirq.c lm4xx_tm3c_sysctrl.c)
 elseif(CONFIG_ARCH_CHIP_TM4C)
-  list(APPEND SRCS lmxx_tm4c_start.c tm4c_gpio.c lmxx_tm4c_gpioirq.c)
-  if(CONFIG_ARCH_CHIP_TM4C129)
-    list(APPEND SRCS tm4c129_sysctrl.c)
-  else()
+  list(APPEND SRCS lmxx_tm4c_start.c lmxx_tm4c_gpioirq.c)
+  if(NOT CONFIG_ARCH_CHIP_TM4C129)
     list(APPEND SRCS lm4xx_tm3c_sysctrl.c)
   endif()
-
-elseif(CONFIG_ARCH_CHIP_CC13X0)
-  list(APPEND SRCS cc13xx_start.c cc13xx_prcm.c cc13xx_chipinfo.c 
cc13xx_gpio.c)
-  list(APPEND SRCS cc13xx_gpioirq.c cc13xx_enableclks.c cc13xx_enablepwr.c)
-  list(APPEND SRCS cc13x0_trim.c cc13x0_rom.c)
-elseif(CONFIG_ARCH_CHIP_CC13X2)
-  list(APPEND SRCS cc13xx_start.c cc13xx_prcm.c cc13xx_chipinfo.c 
cc13xx_gpio.c)
-  list(APPEND SRCS cc13xx_gpioirq.c cc13xx_enableclks.c cc13xx_enablepwr.c)
-  list(APPEND SRCS cc13x2_aux_sysif.c)
-  if(CONFIG_ARCH_CHIP_CC13XX_V1)
-    list(APPEND SRCS cc13x2_v1_trim.c cc13x2_cc26x2_v1_rom.c)
-  else()
-    list(APPEND SRCS cc13x2_v2_trim.c)
-  endif()
 endif()
 
 if(CONFIG_DEBUG_GPIO_INFO)
@@ -100,21 +76,15 @@ if(CONFIG_TIVA_TIMER)
 endif()
 
 if(CONFIG_TIVA_ADC)
-  list(APPEND SRCS tiva_adclow.c)
-  list(APPEND SRCS tiva_adclib.c)
+  list(APPEND SRCS tiva_adclow.c tiva_adclib.c)
 endif()
 
-if(CONFIG_TIVA_CAN)
+if(CONFIG_TIVA_CHAR_DEV_CAN)
   list(APPEND SRCS tiva_can.c)
 endif()
 
-if(CONFIG_TIVA_ETHERNET)
-  if(CONFIG_ARCH_CHIP_LM3S)
-    list(APPEND SRCS lm3s_ethernet.c)
-  endif()
-  if(CONFIG_ARCH_CHIP_TM4C)
-    list(APPEND SRCS tm4c_ethernet.c)
-  endif()
+if(CONFIG_TIVA_SOCKET_CAN)
+  list(APPEND SRCS tiva_sock_can.c)
 endif()
 
 if(CONFIG_TIVA_FLASH)
@@ -129,14 +99,4 @@ if(CONFIG_TIVA_HCIUART)
   list(APPEND SRCS tiva_hciuart.c)
 endif()
 
-set(COMMON_SRCS)
-
-foreach(src ${SRCS})
-  if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/common/${src})
-    list(APPEND COMMON_SRCS common/${src})
-  else()
-    list(APPEND COMMON_SRCS ${ARCH_CHIP}/${src})
-  endif()
-endforeach()
-
-target_sources(arch PRIVATE ${COMMON_SRCS})
+target_sources(arch PRIVATE ${SRCS})
diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt 
b/arch/arm/src/tiva/lm/CMakeLists.txt
similarity index 55%
copy from boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
copy to arch/arm/src/tiva/lm/CMakeLists.txt
index c2ec0e12ba..d30f801aa2 100644
--- a/boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
+++ b/arch/arm/src/tiva/lm/CMakeLists.txt
@@ -1,5 +1,5 @@
 # 
##############################################################################
-# boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
+# arch/arm/src/tiva/lm/CMakeLists.txt
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -20,45 +20,19 @@
 #
 # 
##############################################################################
 
-set(SRCS tm4c_boot.c tm4c_bringup.c)
+if(CONFIG_ARCH_CHIP_LM)
+  set(SRCS)
 
-if(CONFIG_ARCH_LEDS)
-  list(APPEND SRCS tm4c_autoleds.c)
-else()
-  list(APPEND SRCS tm4c_userleds.c)
-endif()
-
-if(CONFIG_ARCH_BUTTONS)
-  list(APPEND SRCS tm4c_buttons.c)
-endif()
-
-if(CONFIG_BOARDCTL)
-  list(APPEND SRCS tm4c_appinit.c)
-endif()
-
-if(CONFIG_TIVA_ADC)
-  list(APPEND SRCS tm4c_adc.c)
-endif()
-
-if(CONFIG_TIVA_AT24)
-  list(APPEND SRCS tm4c_at24.c)
-endif()
+  if(CONFIG_ARCH_CHIP_LM3S)
+    list(APPEND SRCS lm3s_gpio.c)
+  elseif(CONFIG_ARCH_CHIP_LM4F)
+    list(APPEND SRCS lm4f_gpio.c)
+  endif()
 
-if(CONFIG_TIVA_CAN)
-  list(APPEND SRCS tm4c_can.c)
-  if(CONFIG_TIVA_MCP2515)
-    list(APPEND SRCS tm4c_mcp2515.c)
+  if((CONFIG_TIVA_ETHERNET) AND (CONFIG_ARCH_CHIP_LM3S))
+    list(APPEND SRCS lm3s_ethernet.c)
   endif()
-endif()
 
-if(CONFIG_TIVA_SSI)
-  list(APPEND SRCS tm4c_ssi.c)
-endif()
+  target_sources(arch PRIVATE ${SRCS})
 
-if(CONFIG_TIVA_TIMER)
-  list(APPEND SRCS tm4c_timer.c)
 endif()
-
-target_sources(board PRIVATE ${SRCS})
-
-set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt 
b/arch/arm/src/tiva/tm4c/CMakeLists.txt
similarity index 55%
copy from boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
copy to arch/arm/src/tiva/tm4c/CMakeLists.txt
index c2ec0e12ba..e504f2b12e 100644
--- a/boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
+++ b/arch/arm/src/tiva/tm4c/CMakeLists.txt
@@ -1,5 +1,5 @@
 # 
##############################################################################
-# boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
+# arch/arm/src/tiva/tm4c/CMakeLists.txt
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -20,45 +20,19 @@
 #
 # 
##############################################################################
 
-set(SRCS tm4c_boot.c tm4c_bringup.c)
+if(CONFIG_ARCH_CHIP_TM4C)
+  set(SRCS)
 
-if(CONFIG_ARCH_LEDS)
-  list(APPEND SRCS tm4c_autoleds.c)
-else()
-  list(APPEND SRCS tm4c_userleds.c)
-endif()
-
-if(CONFIG_ARCH_BUTTONS)
-  list(APPEND SRCS tm4c_buttons.c)
-endif()
-
-if(CONFIG_BOARDCTL)
-  list(APPEND SRCS tm4c_appinit.c)
-endif()
-
-if(CONFIG_TIVA_ADC)
-  list(APPEND SRCS tm4c_adc.c)
-endif()
+  list(APPEND SRCS tm4c_gpio.c)
 
-if(CONFIG_TIVA_AT24)
-  list(APPEND SRCS tm4c_at24.c)
-endif()
+  if(CONFIG_ARCH_CHIP_TM4C129)
+    list(APPEND SRCS tm4c129_sysctrl.c)
+  endif()
 
-if(CONFIG_TIVA_CAN)
-  list(APPEND SRCS tm4c_can.c)
-  if(CONFIG_TIVA_MCP2515)
-    list(APPEND SRCS tm4c_mcp2515.c)
+  if(CONFIG_TIVA_ETHERNET)
+    list(APPEND SRCS tm4c_ethernet.c)
   endif()
-endif()
 
-if(CONFIG_TIVA_SSI)
-  list(APPEND SRCS tm4c_ssi.c)
-endif()
+  target_sources(arch PRIVATE ${SRCS})
 
-if(CONFIG_TIVA_TIMER)
-  list(APPEND SRCS tm4c_timer.c)
 endif()
-
-target_sources(board PRIVATE ${SRCS})
-
-set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt 
b/boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
index c2ec0e12ba..72391990e0 100644
--- a/boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
+++ b/boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
@@ -20,45 +20,43 @@
 #
 # 
##############################################################################
 
-set(SRCS tm4c_boot.c tm4c_bringup.c)
+set(SRCS tm4c_boot.c tm4c_bringup.c tm4c_ssi.c)
 
 if(CONFIG_ARCH_LEDS)
   list(APPEND SRCS tm4c_autoleds.c)
-else()
-  list(APPEND SRCS tm4c_userleds.c)
-endif()
-
-if(CONFIG_ARCH_BUTTONS)
-  list(APPEND SRCS tm4c_buttons.c)
 endif()
 
 if(CONFIG_BOARDCTL)
   list(APPEND SRCS tm4c_appinit.c)
 endif()
 
-if(CONFIG_TIVA_ADC)
-  list(APPEND SRCS tm4c_adc.c)
+if(CONFIG_TIVA_TIMER)
+  list(APPEND SRCS tm4c_timer.c)
 endif()
 
-if(CONFIG_TIVA_AT24)
-  list(APPEND SRCS tm4c_at24.c)
+if(CONFIG_TIVA_ADC)
+  list(APPEND SRCS tm4c_adc.c)
 endif()
 
 if(CONFIG_TIVA_CAN)
   list(APPEND SRCS tm4c_can.c)
-  if(CONFIG_TIVA_MCP2515)
-    list(APPEND SRCS tm4c_mcp2515.c)
-  endif()
 endif()
 
-if(CONFIG_TIVA_SSI)
-  list(APPEND SRCS tm4c_ssi.c)
+if(CONFIG_CAN_MCP2515)
+  list(APPEND SRCS tm4c_mcp2515.c)
 endif()
 
-if(CONFIG_TIVA_TIMER)
-  list(APPEND SRCS tm4c_timer.c)
+if(CONFIG_MTD_AT24XX)
+  if(CONFIG_TIVA_I2C0)
+    list(APPEND SRCS tm4c_at24.c)
+  endif()
+endif()
+
+if(CONFIG_ARCH_BUTTONS)
+  list(APPEND SRCS tm4c_buttons.c)
 endif()
 
 target_sources(board PRIVATE ${SRCS})
 
-set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
+set_property(GLOBAL PROPERTY LD_SCRIPT
+                             
"${NUTTX_BOARD_DIR}/scripts/tm4c123g-launchpad.ld")
diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt 
b/boards/arm/tiva/tm4c1294-launchpad/CMakeLists.txt
similarity index 54%
copy from boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
copy to boards/arm/tiva/tm4c1294-launchpad/CMakeLists.txt
index c2ec0e12ba..a955f4fb6e 100644
--- a/boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
+++ b/boards/arm/tiva/tm4c1294-launchpad/CMakeLists.txt
@@ -1,5 +1,5 @@
 # 
##############################################################################
-# boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
+# boards/arm/tiva/tm4c1294-launchpad/CMakeLists.txt
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -20,45 +20,4 @@
 #
 # 
##############################################################################
 
-set(SRCS tm4c_boot.c tm4c_bringup.c)
-
-if(CONFIG_ARCH_LEDS)
-  list(APPEND SRCS tm4c_autoleds.c)
-else()
-  list(APPEND SRCS tm4c_userleds.c)
-endif()
-
-if(CONFIG_ARCH_BUTTONS)
-  list(APPEND SRCS tm4c_buttons.c)
-endif()
-
-if(CONFIG_BOARDCTL)
-  list(APPEND SRCS tm4c_appinit.c)
-endif()
-
-if(CONFIG_TIVA_ADC)
-  list(APPEND SRCS tm4c_adc.c)
-endif()
-
-if(CONFIG_TIVA_AT24)
-  list(APPEND SRCS tm4c_at24.c)
-endif()
-
-if(CONFIG_TIVA_CAN)
-  list(APPEND SRCS tm4c_can.c)
-  if(CONFIG_TIVA_MCP2515)
-    list(APPEND SRCS tm4c_mcp2515.c)
-  endif()
-endif()
-
-if(CONFIG_TIVA_SSI)
-  list(APPEND SRCS tm4c_ssi.c)
-endif()
-
-if(CONFIG_TIVA_TIMER)
-  list(APPEND SRCS tm4c_timer.c)
-endif()
-
-target_sources(board PRIVATE ${SRCS})
-
-set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
+add_subdirectory(src)
diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt 
b/boards/arm/tiva/tm4c1294-launchpad/src/CMakeLists.txt
similarity index 83%
copy from boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
copy to boards/arm/tiva/tm4c1294-launchpad/src/CMakeLists.txt
index c2ec0e12ba..6ad85a2497 100644
--- a/boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
+++ b/boards/arm/tiva/tm4c1294-launchpad/src/CMakeLists.txt
@@ -1,5 +1,5 @@
 # 
##############################################################################
-# boards/arm/tiva/tm4c123g-launchpad/src/CMakeLists.txt
+# boards/arm/tiva/tm4c1294-launchpad/src/CMakeLists.txt
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -32,31 +32,30 @@ if(CONFIG_ARCH_BUTTONS)
   list(APPEND SRCS tm4c_buttons.c)
 endif()
 
-if(CONFIG_BOARDCTL)
-  list(APPEND SRCS tm4c_appinit.c)
+if(CONFIG_TIVA_ETHERNET)
+  list(APPEND SRCS tm4c_ethernet.c)
 endif()
 
-if(CONFIG_TIVA_ADC)
-  list(APPEND SRCS tm4c_adc.c)
+if(CONFIG_TIVA_CAN)
+  list(APPEND SRCS tm4c_can.c)
 endif()
 
-if(CONFIG_TIVA_AT24)
-  list(APPEND SRCS tm4c_at24.c)
+if(CONFIG_DK_TM4C129X_TIMER)
+  list(APPEND SRCS tm4c_timer.c)
 endif()
 
-if(CONFIG_TIVA_CAN)
-  list(APPEND SRCS tm4c_can.c)
-  if(CONFIG_TIVA_MCP2515)
-    list(APPEND SRCS tm4c_mcp2515.c)
-  endif()
+if(CONFIG_BOARDCTL)
+  list(APPEND SRCS tm4c_appinit.c)
 endif()
 
-if(CONFIG_TIVA_SSI)
-  list(APPEND SRCS tm4c_ssi.c)
+if(CONFIG_TIVA_HCIUART)
+  if(CONFIG_BLUETOOTH_UART)
+    list(APPEND SRCS tm4c_hciuart.c)
+  endif()
 endif()
 
-if(CONFIG_TIVA_TIMER)
-  list(APPEND SRCS tm4c_timer.c)
+if(CONFIG_BOARDCTL_RESET)
+  list(APPEND SRCS tm4c_reset.c)
 endif()
 
 target_sources(board PRIVATE ${SRCS})

Reply via email to