Skip to content

Commit 047a409

Browse files
simbit18acassis
authored andcommitted
Cmake: Implement CMake build of Tiva arch
added TI/Stellaris Tiva CMake added tm4c1294-launchpad and tm4c123g-launchpad board Signed-off-by: simbit18 <[email protected]>
1 parent d3bb1ea commit 047a409

File tree

8 files changed

+348
-135
lines changed

8 files changed

+348
-135
lines changed

arch/arm/src/tiva/CMakeLists.txt

+7-116
Original file line numberDiff line numberDiff line change
@@ -20,123 +20,14 @@
2020
#
2121
# ##############################################################################
2222

23-
if(CONFIG_ARCH_CHIP_LM)
24-
set(ARCH_CHIP lm)
25-
elseif(CONFIG_ARCH_CHIP_TM4C)
26-
set(ARCH_CHIP tm4c)
27-
elseif(CONFIG_ARCH_CHIP_CC13X0)
28-
set(ARCH_CHIP cc13xx)
29-
elseif(CONFIG_ARCH_CHIP_CC13X2)
30-
set(ARCH_CHIP cc13xx)
31-
endif()
32-
33-
set(SRCS)
34-
35-
if(NOT CONFIG_ARCH_IDLE_CUSTOM)
36-
list(APPEND SRCS tiva_idle.c)
37-
endif()
23+
# Paths to source files
3824

39-
list(APPEND SRCS tiva_allocateheap.c tiva_irq.c tiva_lowputc.c tiva_serial.c)
40-
list(APPEND SRCS tiva_ssi.c)
25+
add_subdirectory(common)
4126

42-
if(CONFIG_ARCH_CHIP_LM3S)
43-
list(APPEND SRCS lmxx_tm4c_start.c lm3s_gpio.c lmxx_tm4c_gpioirq.c)
44-
list(APPEND SRCS lm4xx_tm3c_sysctrl.c)
45-
elseif(CONFIG_ARCH_CHIP_LM4F)
46-
list(APPEND SRCS lmxx_tm4c_start.c lm4f_gpio.c lmxx_tm4c_gpioirq.c)
47-
list(APPEND SRCS lm4xx_tm3c_sysctrl.c)
27+
if(CONFIG_ARCH_CHIP_LM)
28+
add_subdirectory(lm)
4829
elseif(CONFIG_ARCH_CHIP_TM4C)
49-
list(APPEND SRCS lmxx_tm4c_start.c tm4c_gpio.c lmxx_tm4c_gpioirq.c)
50-
if(CONFIG_ARCH_CHIP_TM4C129)
51-
list(APPEND SRCS tm4c129_sysctrl.c)
52-
else()
53-
list(APPEND SRCS lm4xx_tm3c_sysctrl.c)
54-
endif()
55-
56-
elseif(CONFIG_ARCH_CHIP_CC13X0)
57-
list(APPEND SRCS cc13xx_start.c cc13xx_prcm.c cc13xx_chipinfo.c cc13xx_gpio.c)
58-
list(APPEND SRCS cc13xx_gpioirq.c cc13xx_enableclks.c cc13xx_enablepwr.c)
59-
list(APPEND SRCS cc13x0_trim.c cc13x0_rom.c)
60-
elseif(CONFIG_ARCH_CHIP_CC13X2)
61-
list(APPEND SRCS cc13xx_start.c cc13xx_prcm.c cc13xx_chipinfo.c cc13xx_gpio.c)
62-
list(APPEND SRCS cc13xx_gpioirq.c cc13xx_enableclks.c cc13xx_enablepwr.c)
63-
list(APPEND SRCS cc13x2_aux_sysif.c)
64-
if(CONFIG_ARCH_CHIP_CC13XX_V1)
65-
list(APPEND SRCS cc13x2_v1_trim.c cc13x2_cc26x2_v1_rom.c)
66-
else()
67-
list(APPEND SRCS cc13x2_v2_trim.c)
68-
endif()
69-
endif()
70-
71-
if(CONFIG_DEBUG_GPIO_INFO)
72-
list(APPEND SRCS tiva_dumpgpio.c)
30+
add_subdirectory(tm4c)
31+
elseif((CONFIG_ARCH_CHIP_CC13X0) OR (CONFIG_ARCH_CHIP_CC13X2))
32+
add_subdirectory(cc13xx)
7333
endif()
74-
75-
if(NOT CONFIG_SCHED_TICKLESS)
76-
list(APPEND SRCS tiva_timerisr.c)
77-
endif()
78-
79-
if(CONFIG_BUILD_PROTECTED)
80-
list(APPEND SRCS tiva_userspace.c tiva_mpuinit.c)
81-
endif()
82-
83-
if(CONFIG_TIVA_I2C)
84-
list(APPEND SRCS tiva_i2c.c)
85-
endif()
86-
87-
if(CONFIG_TIVA_PWM)
88-
list(APPEND SRCS tiva_pwm.c)
89-
endif()
90-
91-
if(CONFIG_TIVA_QEI)
92-
list(APPEND SRCS tiva_qencoder.c)
93-
endif()
94-
95-
if(CONFIG_TIVA_TIMER)
96-
list(APPEND SRCS tiva_timerlib.c)
97-
if(CONFIG_TIVA_TIMER32_PERIODIC)
98-
list(APPEND SRCS tiva_timerlow32.c)
99-
endif()
100-
endif()
101-
102-
if(CONFIG_TIVA_ADC)
103-
list(APPEND SRCS tiva_adclow.c)
104-
list(APPEND SRCS tiva_adclib.c)
105-
endif()
106-
107-
if(CONFIG_TIVA_CAN)
108-
list(APPEND SRCS tiva_can.c)
109-
endif()
110-
111-
if(CONFIG_TIVA_ETHERNET)
112-
if(CONFIG_ARCH_CHIP_LM3S)
113-
list(APPEND SRCS lm3s_ethernet.c)
114-
endif()
115-
if(CONFIG_ARCH_CHIP_TM4C)
116-
list(APPEND SRCS tm4c_ethernet.c)
117-
endif()
118-
endif()
119-
120-
if(CONFIG_TIVA_FLASH)
121-
list(APPEND SRCS tiva_flash.c)
122-
endif()
123-
124-
if(CONFIG_TIVA_EEPROM)
125-
list(APPEND SRCS tiva_eeprom.c)
126-
endif()
127-
128-
if(CONFIG_TIVA_HCIUART)
129-
list(APPEND SRCS tiva_hciuart.c)
130-
endif()
131-
132-
set(COMMON_SRCS)
133-
134-
foreach(src ${SRCS})
135-
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/common/${src})
136-
list(APPEND COMMON_SRCS common/${src})
137-
else()
138-
list(APPEND COMMON_SRCS ${ARCH_CHIP}/${src})
139-
endif()
140-
endforeach()
141-
142-
target_sources(arch PRIVATE ${COMMON_SRCS})
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# ##############################################################################
2+
# arch/arm/src/tiva/cc13xx/CMakeLists.txt
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
7+
# license agreements. See the NOTICE file distributed with this work for
8+
# additional information regarding copyright ownership. The ASF licenses this
9+
# file to you under the Apache License, Version 2.0 (the "License"); you may not
10+
# use this file except in compliance with the License. You may obtain a copy of
11+
# the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
# License for the specific language governing permissions and limitations under
19+
# the License.
20+
#
21+
# ##############################################################################
22+
23+
if((CONFIG_ARCH_CHIP_CC13X0) OR (CONFIG_ARCH_CHIP_CC13X2))
24+
set(SRCS)
25+
26+
if(CONFIG_ARCH_CHIP_CC13X0)
27+
list(
28+
APPEND
29+
SRCS
30+
cc13xx_start.c
31+
cc13xx_prcm.c
32+
cc13xx_chipinfo.c
33+
cc13xx_gpio.c
34+
cc13xx_gpioirq.c
35+
cc13xx_enableclks.c
36+
cc13xx_enablepwr.c
37+
cc13x0_trim.c
38+
cc13x0_rom.c)
39+
elseif(CONFIG_ARCH_CHIP_CC13X2)
40+
list(
41+
APPEND
42+
SRCS
43+
cc13xx_start.c
44+
cc13xx_prcm.c
45+
cc13xx_chipinfo.c
46+
cc13xx_gpio.c
47+
cc13xx_gpioirq.c
48+
cc13xx_enableclks.c
49+
cc13xx_enablepwr.c
50+
cc13x2_aux_sysif.c)
51+
if(CONFIG_ARCH_CHIP_CC13XX_V1)
52+
list(APPEND SRCS cc13x2_v1_trim.c cc13x2_cc26x2_v1_rom.c)
53+
else()
54+
list(APPEND SRCS cc13x2_v2_trim.c)
55+
endif()
56+
endif()
57+
58+
target_sources(arch PRIVATE ${SRCS})
59+
60+
endif()
+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# ##############################################################################
2+
# arch/arm/src/tiva/common/CMakeLists.txt
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
7+
# license agreements. See the NOTICE file distributed with this work for
8+
# additional information regarding copyright ownership. The ASF licenses this
9+
# file to you under the Apache License, Version 2.0 (the "License"); you may not
10+
# use this file except in compliance with the License. You may obtain a copy of
11+
# the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
# License for the specific language governing permissions and limitations under
19+
# the License.
20+
#
21+
# ##############################################################################
22+
23+
if(NOT CONFIG_ARCH_IDLE_CUSTOM)
24+
list(APPEND SRCS tiva_idle.c)
25+
endif()
26+
27+
list(
28+
APPEND
29+
SRCS
30+
tiva_allocateheap.c
31+
tiva_irq.c
32+
tiva_lowputc.c
33+
tiva_serial.c
34+
tiva_ssi.c)
35+
36+
if(CONFIG_ARCH_CHIP_LM3S)
37+
list(APPEND SRCS lmxx_tm4c_start.c lmxx_tm4c_gpioirq.c lm4xx_tm3c_sysctrl.c)
38+
elseif(CONFIG_ARCH_CHIP_LM4F)
39+
list(APPEND SRCS lmxx_tm4c_start.c lmxx_tm4c_gpioirq.c lm4xx_tm3c_sysctrl.c)
40+
elseif(CONFIG_ARCH_CHIP_TM4C)
41+
list(APPEND SRCS lmxx_tm4c_start.c lmxx_tm4c_gpioirq.c)
42+
if(NOT CONFIG_ARCH_CHIP_TM4C129)
43+
list(APPEND SRCS lm4xx_tm3c_sysctrl.c)
44+
endif()
45+
endif()
46+
47+
if(CONFIG_DEBUG_GPIO_INFO)
48+
list(APPEND SRCS tiva_dumpgpio.c)
49+
endif()
50+
51+
if(NOT CONFIG_SCHED_TICKLESS)
52+
list(APPEND SRCS tiva_timerisr.c)
53+
endif()
54+
55+
if(CONFIG_BUILD_PROTECTED)
56+
list(APPEND SRCS tiva_userspace.c tiva_mpuinit.c)
57+
endif()
58+
59+
if(CONFIG_TIVA_I2C)
60+
list(APPEND SRCS tiva_i2c.c)
61+
endif()
62+
63+
if(CONFIG_TIVA_PWM)
64+
list(APPEND SRCS tiva_pwm.c)
65+
endif()
66+
67+
if(CONFIG_TIVA_QEI)
68+
list(APPEND SRCS tiva_qencoder.c)
69+
endif()
70+
71+
if(CONFIG_TIVA_TIMER)
72+
list(APPEND SRCS tiva_timerlib.c)
73+
if(CONFIG_TIVA_TIMER32_PERIODIC)
74+
list(APPEND SRCS tiva_timerlow32.c)
75+
endif()
76+
endif()
77+
78+
if(CONFIG_TIVA_ADC)
79+
list(APPEND SRCS tiva_adclow.c tiva_adclib.c)
80+
endif()
81+
82+
if(CONFIG_TIVA_CHAR_DEV_CAN)
83+
list(APPEND SRCS tiva_can.c)
84+
endif()
85+
86+
if(CONFIG_TIVA_SOCKET_CAN)
87+
list(APPEND SRCS tiva_sock_can.c)
88+
endif()
89+
90+
if(CONFIG_TIVA_FLASH)
91+
list(APPEND SRCS tiva_flash.c)
92+
endif()
93+
94+
if(CONFIG_TIVA_EEPROM)
95+
list(APPEND SRCS tiva_eeprom.c)
96+
endif()
97+
98+
if(CONFIG_TIVA_HCIUART)
99+
list(APPEND SRCS tiva_hciuart.c)
100+
endif()
101+
102+
target_sources(arch PRIVATE ${SRCS})

arch/arm/src/tiva/lm/CMakeLists.txt

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# ##############################################################################
2+
# arch/arm/src/tiva/lm/CMakeLists.txt
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
7+
# license agreements. See the NOTICE file distributed with this work for
8+
# additional information regarding copyright ownership. The ASF licenses this
9+
# file to you under the Apache License, Version 2.0 (the "License"); you may not
10+
# use this file except in compliance with the License. You may obtain a copy of
11+
# the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
# License for the specific language governing permissions and limitations under
19+
# the License.
20+
#
21+
# ##############################################################################
22+
23+
if(CONFIG_ARCH_CHIP_LM)
24+
set(SRCS)
25+
26+
if(CONFIG_ARCH_CHIP_LM3S)
27+
list(APPEND SRCS lm3s_gpio.c)
28+
elseif(CONFIG_ARCH_CHIP_LM4F)
29+
list(APPEND SRCS lm4f_gpio.c)
30+
endif()
31+
32+
if((CONFIG_TIVA_ETHERNET) AND (CONFIG_ARCH_CHIP_LM3S))
33+
list(APPEND SRCS lm3s_ethernet.c)
34+
endif()
35+
36+
target_sources(arch PRIVATE ${SRCS})
37+
38+
endif()

arch/arm/src/tiva/tm4c/CMakeLists.txt

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# ##############################################################################
2+
# arch/arm/src/tiva/tm4c/CMakeLists.txt
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
7+
# license agreements. See the NOTICE file distributed with this work for
8+
# additional information regarding copyright ownership. The ASF licenses this
9+
# file to you under the Apache License, Version 2.0 (the "License"); you may not
10+
# use this file except in compliance with the License. You may obtain a copy of
11+
# the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
# License for the specific language governing permissions and limitations under
19+
# the License.
20+
#
21+
# ##############################################################################
22+
23+
if(CONFIG_ARCH_CHIP_TM4C)
24+
set(SRCS)
25+
26+
list(APPEND SRCS tm4c_gpio.c)
27+
28+
if(CONFIG_ARCH_CHIP_TM4C129)
29+
list(APPEND SRCS tm4c129_sysctrl.c)
30+
endif()
31+
32+
if(CONFIG_TIVA_ETHERNET)
33+
list(APPEND SRCS tm4c_ethernet.c)
34+
endif()
35+
36+
target_sources(arch PRIVATE ${SRCS})
37+
38+
endif()

0 commit comments

Comments
 (0)