diff --git a/cpu/arm7_common/Makefile.dep b/cpu/arm7_common/Makefile.dep new file mode 100644 index 0000000000..e1f9aaf2e2 --- /dev/null +++ b/cpu/arm7_common/Makefile.dep @@ -0,0 +1,4 @@ +# use common ARM7 periph code +USEMODULE += arm7_common_periph +# use the nano-specs of Newlib when available +USEMODULE += newlib_nano diff --git a/cpu/arm7_common/Makefile.include b/cpu/arm7_common/Makefile.include index c0c0113c4c..b31c843b6e 100644 --- a/cpu/arm7_common/Makefile.include +++ b/cpu/arm7_common/Makefile.include @@ -3,11 +3,6 @@ export TARGET_ARCH ?= arm-none-eabi INCLUDES += -I$(RIOTBASE)/cpu/arm7_common/include/ -# use common ARM7 periph code -USEMODULE += arm7_common_periph -# use the nano-specs of Newlib when available -USEMODULE += newlib_nano - # currently only arm7tdmi-s is supported by RIOT, but allow overriding MCPU # if someone wants to add support for other ARM7 CPUs MCPU ?= arm7tdmi-s diff --git a/cpu/atmega_common/Makefile.dep b/cpu/atmega_common/Makefile.dep index d418eb3b8f..33fa82c5cf 100644 --- a/cpu/atmega_common/Makefile.dep +++ b/cpu/atmega_common/Makefile.dep @@ -1,6 +1,15 @@ +# avr libc needs some RIOT-specific support code +USEMODULE += avr_libc_extra + # tell the build system to build the atmega common files USEMODULE += atmega_common +# peripheral drivers are linked into the final binary +USEMODULE += atmega_common_periph + +# the atmel port uses stdio_uart +USEMODULE += stdio_uart + # expand atmega_pcint module ifneq (,$(filter atmega_pcint,$(USEMODULE))) USEMODULE += atmega_pcint0 diff --git a/cpu/atmega_common/Makefile.include b/cpu/atmega_common/Makefile.include index 188dc1466a..b51f67520c 100644 --- a/cpu/atmega_common/Makefile.include +++ b/cpu/atmega_common/Makefile.include @@ -3,9 +3,6 @@ INCLUDES += -I$(RIOTCPU)/atmega_common/include \ -isystem$(RIOTCPU)/atmega_common/avr_libc_extra/include \ -isystem$(RIOTCPU)/atmega_common/avr_libc_extra/include/vendor -# avr libc needs some RIOT-specific support code -USEMODULE += avr_libc_extra - PSEUDOMODULES += atmega_pcint PSEUDOMODULES += atmega_pcint% diff --git a/cpu/cc13x2/Makefile.dep b/cpu/cc13x2/Makefile.dep new file mode 100644 index 0000000000..a0a73e54fe --- /dev/null +++ b/cpu/cc13x2/Makefile.dep @@ -0,0 +1 @@ +include ${RIOTCPU}/cc26xx_cc13xx/Makefile.dep diff --git a/cpu/cc26x0/Makefile.dep b/cpu/cc26x0/Makefile.dep new file mode 100644 index 0000000000..a0a73e54fe --- /dev/null +++ b/cpu/cc26x0/Makefile.dep @@ -0,0 +1 @@ +include ${RIOTCPU}/cc26xx_cc13xx/Makefile.dep diff --git a/cpu/cc26xx_cc13xx/Makefile.dep b/cpu/cc26xx_cc13xx/Makefile.dep new file mode 100644 index 0000000000..c9dafe0dfb --- /dev/null +++ b/cpu/cc26xx_cc13xx/Makefile.dep @@ -0,0 +1 @@ +USEMODULE += periph_common cc26xx_cc13xx_periph diff --git a/cpu/cc26xx_cc13xx/Makefile.include b/cpu/cc26xx_cc13xx/Makefile.include index 23bd1a83ad..3f6a29f17f 100644 --- a/cpu/cc26xx_cc13xx/Makefile.include +++ b/cpu/cc26xx_cc13xx/Makefile.include @@ -1,5 +1,4 @@ VARIANT = $(shell echo $(CPU_VARIANT) | tr 'a-z-' 'A-Z_') CFLAGS += -DCPU_VARIANT_$(VARIANT) -USEMODULE += periph_common cc26xx_cc13xx_periph INCLUDES += -I${RIOTCPU}/cc26xx_cc13xx/include diff --git a/cpu/cc430/Makefile.dep b/cpu/cc430/Makefile.dep new file mode 100644 index 0000000000..cf926d66c2 --- /dev/null +++ b/cpu/cc430/Makefile.dep @@ -0,0 +1,3 @@ +USEMODULE += periph + +include $(RIOTCPU)/msp430_common/Makefile.dep diff --git a/cpu/cc430/Makefile.include b/cpu/cc430/Makefile.include index 49f1ae492c..d84a5ee820 100644 --- a/cpu/cc430/Makefile.include +++ b/cpu/cc430/Makefile.include @@ -1,3 +1 @@ include $(RIOTCPU)/msp430_common/Makefile.include - -export USEMODULE += periph diff --git a/cpu/efm32/Makefile.dep b/cpu/efm32/Makefile.dep index 9d63028a74..abd57505df 100644 --- a/cpu/efm32/Makefile.dep +++ b/cpu/efm32/Makefile.dep @@ -5,3 +5,9 @@ endif ifneq (,$(filter periph_rtt,$(USEMODULE))) USEMODULE += periph_rtt_series$(EFM32_SERIES) endif + +# include Gecko SDK package +USEPKG += gecko_sdk + +# include layered power management +USEMODULE += pm_layered diff --git a/cpu/efm32/Makefile.include b/cpu/efm32/Makefile.include index 94cdda7a40..64d69cb696 100644 --- a/cpu/efm32/Makefile.include +++ b/cpu/efm32/Makefile.include @@ -9,9 +9,6 @@ RIOTBOOT_LEN ?= 0x2000 # the em_device.h header requires a global define with the cpu model CFLAGS += -D$(call uppercase_and_underscore,$(CPU_MODEL)) -# include Gecko SDK package -USEPKG += gecko_sdk - # CMSIS-DSP is needed for arm_math.h on Cortex-M0+ architectures ifeq ($(CPU_ARCH),cortex-m0plus) USEPKG += cmsis-dsp @@ -23,9 +20,6 @@ USEMODULE += cpu_$(EFM32_FAMILY) # vectors.o is provided by 'cpu_$(EFM32_FAMILY)' and not by 'cpu' VECTORS_O := $(BINDIR)/cpu_$(EFM32_FAMILY)/vectors.o -# include layered power management -USEMODULE += pm_layered - # include vendor device headers INCLUDES += -I$(RIOTCPU)/efm32/families/$(EFM32_FAMILY)/include/vendor diff --git a/cpu/fe310/Makefile.dep b/cpu/fe310/Makefile.dep index 725d8c9daf..3a32bc7fd8 100644 --- a/cpu/fe310/Makefile.dep +++ b/cpu/fe310/Makefile.dep @@ -1,3 +1,11 @@ +USEMODULE += newlib_nano + +USEMODULE += newlib_syscalls_fe310 +USEMODULE += sifive_drivers_fe310 + +USEMODULE += periph +USEMODULE += periph_pm + ifneq (,$(filter periph_rtc,$(USEMODULE))) FEATURES_REQUIRED += periph_rtt endif diff --git a/cpu/fe310/Makefile.include b/cpu/fe310/Makefile.include index 564abaa5b3..0b93159caa 100644 --- a/cpu/fe310/Makefile.include +++ b/cpu/fe310/Makefile.include @@ -1,12 +1,3 @@ - -USEMODULE += newlib_nano - -USEMODULE += newlib_syscalls_fe310 -USEMODULE += sifive_drivers_fe310 - -USEMODULE += periph -USEMODULE += periph_pm - CFLAGS += -Wno-pedantic include $(RIOTMAKE)/arch/riscv.inc.mk diff --git a/cpu/lpc1768/Makefile.dep b/cpu/lpc1768/Makefile.dep new file mode 100644 index 0000000000..d626e716f1 --- /dev/null +++ b/cpu/lpc1768/Makefile.dep @@ -0,0 +1 @@ +USEMODULE += pm_layered diff --git a/cpu/lpc1768/Makefile.include b/cpu/lpc1768/Makefile.include index 7897d949a4..1fe925bc54 100644 --- a/cpu/lpc1768/Makefile.include +++ b/cpu/lpc1768/Makefile.include @@ -1,5 +1,3 @@ CPU_ARCH = cortex-m3 -USEMODULE += pm_layered - include $(RIOTMAKE)/arch/cortexm.inc.mk diff --git a/cpu/lpc2387/Makefile.dep b/cpu/lpc2387/Makefile.dep new file mode 100644 index 0000000000..0ed40cc62e --- /dev/null +++ b/cpu/lpc2387/Makefile.dep @@ -0,0 +1,7 @@ +USEMODULE += arm7_common +USEMODULE += bitfield +USEMODULE += newlib +USEMODULE += periph +USEMODULE += pm_layered + +include $(RIOTCPU)/arm7_common/Makefile.dep diff --git a/cpu/lpc2387/Makefile.include b/cpu/lpc2387/Makefile.include index 19cfdb7946..a9e29b702b 100644 --- a/cpu/lpc2387/Makefile.include +++ b/cpu/lpc2387/Makefile.include @@ -1,4 +1 @@ include $(RIOTCPU)/arm7_common/Makefile.include - -USEMODULE += arm7_common periph bitfield newlib -USEMODULE += pm_layered diff --git a/cpu/mips32r2_common/Makefile.dep b/cpu/mips32r2_common/Makefile.dep new file mode 100644 index 0000000000..af49a8d526 --- /dev/null +++ b/cpu/mips32r2_common/Makefile.dep @@ -0,0 +1,14 @@ +USEMODULE += mips32r2_common +USEMODULE += mips32r2_common_periph +USEMODULE += newlib + +# mips32 needs periph_timer for its gettimeofday() implementation +FEATURES_REQUIRED += periph_timer + +ifeq ($(USE_UHI_SYSCALLS),1) + #Use UHI to handle syscalls + USEMODULE += newlib_syscalls_mips_uhi +else + #Use RIOT to handle syscalls (default) + USEMODULE += newlib_syscalls_default +endif diff --git a/cpu/mips32r2_common/Makefile.include b/cpu/mips32r2_common/Makefile.include index b65543819c..5ad9e95238 100644 --- a/cpu/mips32r2_common/Makefile.include +++ b/cpu/mips32r2_common/Makefile.include @@ -1,18 +1,7 @@ INCLUDES += -I$(RIOTCPU)/mips32r2_common/include -export USEMODULE += mips32r2_common -export USEMODULE += mips32r2_common_periph -export USEMODULE += newlib - -# mips32 needs periph_timer for its gettimeofday() implementation -export USEMODULE += periph_timer - ifeq ($(USE_UHI_SYSCALLS),1) #Use UHI to handle syscalls LINKFLAGS += -luhi - export USEMODULE += newlib_syscalls_mips_uhi CFLAGS += -DHAVE_HEAP_STATS -else - #Use RIOT to handle syscalls (default) - export USEMODULE += newlib_syscalls_default endif diff --git a/cpu/mips_pic32_common/Makefile.dep b/cpu/mips_pic32_common/Makefile.dep new file mode 100644 index 0000000000..f3fd6729ba --- /dev/null +++ b/cpu/mips_pic32_common/Makefile.dep @@ -0,0 +1,4 @@ +USEMODULE += mips_pic32_common +USEMODULE += mips_pic32_common_periph + +include $(RIOTCPU)/mips32r2_common/Makefile.dep diff --git a/cpu/mips_pic32_common/Makefile.include b/cpu/mips_pic32_common/Makefile.include index c7873eb984..cc5b75126a 100644 --- a/cpu/mips_pic32_common/Makefile.include +++ b/cpu/mips_pic32_common/Makefile.include @@ -1,6 +1,3 @@ include $(RIOTCPU)/mips32r2_common/Makefile.include INCLUDES += -I$(RIOTCPU)/mips_pic32_common/include - -USEMODULE += mips_pic32_common -USEMODULE += mips_pic32_common_periph diff --git a/cpu/mips_pic32mx/Makefile.dep b/cpu/mips_pic32mx/Makefile.dep new file mode 100644 index 0000000000..5d3f2106be --- /dev/null +++ b/cpu/mips_pic32mx/Makefile.dep @@ -0,0 +1 @@ +include $(RIOTCPU)/mips_pic32_common/Makefile.dep diff --git a/cpu/mips_pic32mz/Makefile.dep b/cpu/mips_pic32mz/Makefile.dep new file mode 100644 index 0000000000..5d3f2106be --- /dev/null +++ b/cpu/mips_pic32mz/Makefile.dep @@ -0,0 +1 @@ +include $(RIOTCPU)/mips_pic32_common/Makefile.dep diff --git a/cpu/msp430_common/Makefile.dep b/cpu/msp430_common/Makefile.dep new file mode 100644 index 0000000000..353918cd48 --- /dev/null +++ b/cpu/msp430_common/Makefile.dep @@ -0,0 +1,3 @@ +USEMODULE += msp430_common msp430_common_periph msp430_malloc + +DEFAULT_MODULE += oneway_malloc diff --git a/cpu/msp430_common/Makefile.include b/cpu/msp430_common/Makefile.include index afcc202c1e..84999be22e 100644 --- a/cpu/msp430_common/Makefile.include +++ b/cpu/msp430_common/Makefile.include @@ -5,9 +5,6 @@ INCLUDES += -I$(RIOTCPU)/msp430_common/include/ CFLAGS += -DCPU_MODEL_$(call uppercase_and_underscore,$(CPU_MODEL)) export UNDEF += $(BINDIR)/msp430_common/startup.o -export USEMODULE += msp430_common msp430_common_periph msp430_malloc - -DEFAULT_MODULE += oneway_malloc # include the msp430 common Makefile include $(RIOTMAKE)/arch/msp430.inc.mk diff --git a/cpu/msp430fxyz/Makefile.dep b/cpu/msp430fxyz/Makefile.dep new file mode 100644 index 0000000000..dd6c951eba --- /dev/null +++ b/cpu/msp430fxyz/Makefile.dep @@ -0,0 +1,3 @@ +USEMODULE += periph stdio_uart + +include $(RIOTCPU)/msp430_common/Makefile.dep diff --git a/cpu/msp430fxyz/Makefile.include b/cpu/msp430fxyz/Makefile.include index f3ceaf30b0..d84a5ee820 100644 --- a/cpu/msp430fxyz/Makefile.include +++ b/cpu/msp430fxyz/Makefile.include @@ -1,3 +1 @@ include $(RIOTCPU)/msp430_common/Makefile.include - -export USEMODULE += periph stdio_uart diff --git a/cpu/nrf51/Makefile.dep b/cpu/nrf51/Makefile.dep new file mode 100644 index 0000000000..56c2263f7e --- /dev/null +++ b/cpu/nrf51/Makefile.dep @@ -0,0 +1 @@ +include $(RIOTCPU)/nrf5x_common/Makefile.dep diff --git a/cpu/nrf52/Makefile.dep b/cpu/nrf52/Makefile.dep index d5e4d42993..cbf9f0708b 100644 --- a/cpu/nrf52/Makefile.dep +++ b/cpu/nrf52/Makefile.dep @@ -4,3 +4,5 @@ ifneq (,$(filter nrf802154,$(USEMODULE))) USEMODULE += luid USEMODULE += netdev_ieee802154 endif + +include $(RIOTCPU)/nrf5x_common/Makefile.dep diff --git a/cpu/nrf5x_common/Makefile.dep b/cpu/nrf5x_common/Makefile.dep new file mode 100644 index 0000000000..ae1319e836 --- /dev/null +++ b/cpu/nrf5x_common/Makefile.dep @@ -0,0 +1,5 @@ +# include nrf5x common periph drivers +USEMODULE += nrf5x_common_periph + +# link common cpu code +USEMODULE += cpu_common diff --git a/cpu/nrf5x_common/Makefile.include b/cpu/nrf5x_common/Makefile.include index 9dc47f49b0..c4b3dec388 100644 --- a/cpu/nrf5x_common/Makefile.include +++ b/cpu/nrf5x_common/Makefile.include @@ -1,9 +1,3 @@ CFLAGS += -DCPU_FAM_$(call uppercase_and_underscore,$(CPU_FAM)) -# include nrf5x common periph drivers -USEMODULE += nrf5x_common_periph - -# link common cpu code -USEMODULE += cpu_common - INCLUDES += -I$(RIOTCPU)/nrf5x_common/include diff --git a/cpu/sam0_common/Makefile.dep b/cpu/sam0_common/Makefile.dep index d14f2bdb7b..a87db0f10c 100644 --- a/cpu/sam0_common/Makefile.dep +++ b/cpu/sam0_common/Makefile.dep @@ -1,3 +1,9 @@ ifneq (,$(filter periph_uart_nonblocking,$(USEMODULE))) USEMODULE += tsrb endif + +# All SAM0 based CPUs provide PM +USEMODULE += pm_layered + +# include sam0 common periph drivers +USEMODULE += sam0_common_periph diff --git a/cpu/sam0_common/Makefile.include b/cpu/sam0_common/Makefile.include index 1ccbb98c16..d08c446d65 100644 --- a/cpu/sam0_common/Makefile.include +++ b/cpu/sam0_common/Makefile.include @@ -31,7 +31,4 @@ LINKER_SCRIPT ?= cortexm.ld # define sam0 specific pseudomodules PSEUDOMODULES += sam0_periph_uart_hw_fc -# include sam0 common periph drivers -USEMODULE += sam0_common_periph - INCLUDES += -I$(RIOTCPU)/sam0_common/include diff --git a/cpu/samd21/Makefile.include b/cpu/samd21/Makefile.include index 2576ff4ed2..30f4ae9d0c 100644 --- a/cpu/samd21/Makefile.include +++ b/cpu/samd21/Makefile.include @@ -1,7 +1,5 @@ CPU_ARCH = cortex-m0plus CPU_FAM = samd21 -USEMODULE += pm_layered - include $(RIOTCPU)/sam0_common/Makefile.include include $(RIOTMAKE)/arch/cortexm.inc.mk diff --git a/cpu/samd5x/Makefile.include b/cpu/samd5x/Makefile.include index 4484c2497e..6e33db8efc 100644 --- a/cpu/samd5x/Makefile.include +++ b/cpu/samd5x/Makefile.include @@ -6,8 +6,6 @@ CPU_FAM = samd5x # flash cannot be divided by two slots while staying FLASHPAGE_SIZE aligned. RIOTBOOT_LEN ?= 0x4000 -USEMODULE += pm_layered - BACKUP_RAM_ADDR = 0x47000000 BACKUP_RAM_LEN = 0x2000 diff --git a/cpu/saml1x/Makefile.include b/cpu/saml1x/Makefile.include index c552017b2d..5f85fa02ea 100644 --- a/cpu/saml1x/Makefile.include +++ b/cpu/saml1x/Makefile.include @@ -1,6 +1,4 @@ CPU_ARCH = cortex-m23 -USEMODULE += pm_layered - include $(RIOTCPU)/sam0_common/Makefile.include include $(RIOTMAKE)/arch/cortexm.inc.mk diff --git a/cpu/saml21/Makefile.include b/cpu/saml21/Makefile.include index f42f494a78..233886256a 100644 --- a/cpu/saml21/Makefile.include +++ b/cpu/saml21/Makefile.include @@ -1,8 +1,6 @@ CPU_ARCH = cortex-m0plus CPU_FAM = saml21 -USEMODULE += pm_layered - ifneq (,$(filter saml21j18b saml21j18a samr30g18a samr34j18b,$(CPU_MODEL))) BACKUP_RAM_ADDR = 0x30000000 BACKUP_RAM_LEN = 0x2000 diff --git a/cpu/stm32_common/Makefile.dep b/cpu/stm32_common/Makefile.dep new file mode 100644 index 0000000000..378eb8ebc7 --- /dev/null +++ b/cpu/stm32_common/Makefile.dep @@ -0,0 +1,5 @@ +# All stm32 families provide pm support +USEMODULE += pm_layered + +# include stm32 common functions and stm32 common periph drivers +USEMODULE += stm32_common stm32_common_periph diff --git a/cpu/stm32_common/Makefile.include b/cpu/stm32_common/Makefile.include index 47db930eca..01ef56c348 100644 --- a/cpu/stm32_common/Makefile.include +++ b/cpu/stm32_common/Makefile.include @@ -1,11 +1,5 @@ CFLAGS += -DCPU_FAM_$(call uppercase_and_underscore,$(CPU_FAM)) -# All stm32 families provide pm support -USEMODULE += pm_layered - -# include stm32 common functions and stm32 common periph drivers -USEMODULE += stm32_common stm32_common_periph - # For stm32 cpu's we use the stm32_common.ld linker script LINKFLAGS += -L$(RIOTCPU)/stm32_common/ldscripts LINKER_SCRIPT ?= stm32_common.ld diff --git a/cpu/stm32f0/Makefile.dep b/cpu/stm32f0/Makefile.dep new file mode 100644 index 0000000000..f806a28929 --- /dev/null +++ b/cpu/stm32f0/Makefile.dep @@ -0,0 +1 @@ +include $(RIOTCPU)/stm32_common/Makefile.dep diff --git a/cpu/stm32f1/Makefile.dep b/cpu/stm32f1/Makefile.dep new file mode 100644 index 0000000000..f806a28929 --- /dev/null +++ b/cpu/stm32f1/Makefile.dep @@ -0,0 +1 @@ +include $(RIOTCPU)/stm32_common/Makefile.dep diff --git a/cpu/stm32f2/Makefile.dep b/cpu/stm32f2/Makefile.dep new file mode 100644 index 0000000000..f806a28929 --- /dev/null +++ b/cpu/stm32f2/Makefile.dep @@ -0,0 +1 @@ +include $(RIOTCPU)/stm32_common/Makefile.dep diff --git a/cpu/stm32f3/Makefile.dep b/cpu/stm32f3/Makefile.dep new file mode 100644 index 0000000000..f806a28929 --- /dev/null +++ b/cpu/stm32f3/Makefile.dep @@ -0,0 +1 @@ +include $(RIOTCPU)/stm32_common/Makefile.dep diff --git a/cpu/stm32f4/Makefile.dep b/cpu/stm32f4/Makefile.dep new file mode 100644 index 0000000000..f806a28929 --- /dev/null +++ b/cpu/stm32f4/Makefile.dep @@ -0,0 +1 @@ +include $(RIOTCPU)/stm32_common/Makefile.dep diff --git a/cpu/stm32f7/Makefile.dep b/cpu/stm32f7/Makefile.dep new file mode 100644 index 0000000000..f806a28929 --- /dev/null +++ b/cpu/stm32f7/Makefile.dep @@ -0,0 +1 @@ +include $(RIOTCPU)/stm32_common/Makefile.dep diff --git a/cpu/stm32l0/Makefile.dep b/cpu/stm32l0/Makefile.dep new file mode 100644 index 0000000000..f806a28929 --- /dev/null +++ b/cpu/stm32l0/Makefile.dep @@ -0,0 +1 @@ +include $(RIOTCPU)/stm32_common/Makefile.dep diff --git a/cpu/stm32l1/Makefile.dep b/cpu/stm32l1/Makefile.dep new file mode 100644 index 0000000000..f806a28929 --- /dev/null +++ b/cpu/stm32l1/Makefile.dep @@ -0,0 +1 @@ +include $(RIOTCPU)/stm32_common/Makefile.dep diff --git a/cpu/stm32l4/Makefile.dep b/cpu/stm32l4/Makefile.dep new file mode 100644 index 0000000000..f806a28929 --- /dev/null +++ b/cpu/stm32l4/Makefile.dep @@ -0,0 +1 @@ +include $(RIOTCPU)/stm32_common/Makefile.dep diff --git a/makefiles/arch/atmega.inc.mk b/makefiles/arch/atmega.inc.mk index db2610b611..24e7cb08dd 100644 --- a/makefiles/arch/atmega.inc.mk +++ b/makefiles/arch/atmega.inc.mk @@ -11,15 +11,6 @@ ASFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT) -static -lgcc -e reset_handler -Wl,--gc-sections OFLAGS += -j .text -j .data -# Tell the build system that the CPU depends on the atmega common files: -USEMODULE += atmega_common - -# export the peripheral drivers to be linked into the final binary -USEMODULE += atmega_common_periph - -# the atmel port uses stdio_uart -USEMODULE += stdio_uart - # explicitly tell the linker to link the syscalls and startup code. # without this the interrupt vectors will not be linked correctly! UNDEF += $(BINDIR)/atmega_common/startup.o