-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu/efm32: cleanup #13174
cpu/efm32: cleanup #13174
Changes from all commits
d6b478f
95f8de8
085665f
7cc65c9
67ec9a2
5715f13
a046248
8cf186c
ae1c54b
9a7ddde
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# HACK this should be deduced from the daughter board in 'common/slwstk6000b' | ||
CPU_FAM = efr32mg1p | ||
CPU_MODEL = efr32mg1p233f256gm48 | ||
include $(RIOTBOARD)/common/slwstk6000b/Makefile.features |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# HACK this should be deduced from the daughter board in 'common/slwstk6000b' | ||
CPU_FAM = efr32mg12p | ||
CPU_MODEL = efr32mg12p332f1024gl125 | ||
include $(RIOTBOARD)/common/slwstk6000b/Makefile.features |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,26 @@ | ||
MODULE = cpu | ||
|
||
# add a list of subdirectories, that should also be build | ||
DIRS = periph families/$(EFM32_FAMILY) $(RIOTCPU)/cortexm_common | ||
DIRS += periph | ||
DIRS += $(RIOTCPU)/cortexm_common | ||
|
||
ifneq (,$(filter cpu_efm32gg,$(USEMODULE))) | ||
DIRS += families/efm32gg | ||
endif | ||
ifneq (,$(filter cpu_efm32lg,$(USEMODULE))) | ||
DIRS += families/efm32lg | ||
endif | ||
ifneq (,$(filter cpu_efm32pg1b,$(USEMODULE))) | ||
DIRS += families/efm32pg1b | ||
endif | ||
ifneq (,$(filter cpu_efm32pg12b,$(USEMODULE))) | ||
DIRS += families/efm32pg12b | ||
endif | ||
ifneq (,$(filter cpu_efr32mg1p,$(USEMODULE))) | ||
DIRS += families/efr32mg1p | ||
endif | ||
ifneq (,$(filter cpu_efr32mg12p,$(USEMODULE))) | ||
DIRS += families/efr32mg12p | ||
endif | ||
|
||
include $(RIOTBASE)/Makefile.base |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This file provides defaults for additional EFM32-specific features. You | ||
# should override them from the command line, or in your Makefile. Note that | ||
# some features may not be applicable to all EFM32 boards or CPUs. | ||
export EFM32_LEUART_ENABLED ?= 1 | ||
EFM32_LEUART_ENABLED ?= 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
# Find the header file that should exist if the CPU is supported. | ||
EFM32_HEADER = $(wildcard $(RIOTCPU)/efm32/families/*/include/vendor/$(CPU_MODEL).h) | ||
# Include family-specific CPU information. This file contains one line per | ||
# CPU_MODEL that includes additional information, such as flash and memory | ||
# sized and supported features. This does not respect the current | ||
# NOTE: here we use $(CPU_FAM) to parse the directory since it is used only | ||
# to load a 'database' or set a of `FEATURES`, where the file location cant | ||
# be obtained from the CPU and CPU_MODEL | ||
include $(RIOTCPU)/efm32/families/$(CPU_FAM)/efm32-info.mk | ||
|
||
ifeq (,$(EFM32_HEADER)) | ||
$(error Header file for $(CPU_MODEL) is missing) | ||
endif | ||
|
||
# Lookup up CPU information using grep. | ||
EFM32_INFO = $(shell grep $(CPU_MODEL) $(shell dirname $(EFM32_HEADER))/../../cpus.txt) | ||
EFM32_INFO = $(EFM32_INFO_$(CPU_MODEL)) | ||
|
||
ifeq (,$(EFM32_INFO)) | ||
$(error Unable to read CPU information for $(CPU_MODEL)) | ||
$(error Family-specific information for $(CPU_MODEL) is missing) | ||
endif | ||
|
||
# Export variables to use in this build. | ||
export EFM32_FAMILY = $(word 2, $(EFM32_INFO)) | ||
export EFM32_SERIES = $(word 3, $(EFM32_INFO)) | ||
export EFM32_ARCHITECTURE = $(word 4, $(EFM32_INFO)) | ||
# Parse the information into EFM32 specific variables. They are specific to the | ||
# EFM32 CPU only, and should not be used outside this module. | ||
EFM32_SERIES = $(word 1, $(EFM32_INFO)) | ||
EFM32_ARCHITECTURE = $(word 2, $(EFM32_INFO)) | ||
|
||
export EFM32_FLASH_START = $(word 5, $(EFM32_INFO)) | ||
export EFM32_FLASH_SIZE = $(word 6, $(EFM32_INFO)) | ||
export EFM32_SRAM_START = $(word 7, $(EFM32_INFO)) | ||
export EFM32_SRAM_SIZE = $(word 8, $(EFM32_INFO)) | ||
EFM32_FLASH_START = $(word 3, $(EFM32_INFO)) | ||
EFM32_FLASH_SIZE = $(word 4, $(EFM32_INFO)) | ||
EFM32_SRAM_START = $(word 5, $(EFM32_INFO)) | ||
EFM32_SRAM_SIZE = $(word 6, $(EFM32_INFO)) | ||
|
||
export EFM32_CRYPTO = $(word 9, $(EFM32_INFO)) | ||
export EFM32_TRNG = $(word 10, $(EFM32_INFO)) | ||
export EFM32_RADIO = $(word 11, $(EFM32_INFO)) | ||
EFM32_CRYPTO = $(word 7, $(EFM32_INFO)) | ||
EFM32_TRNG = $(word 8, $(EFM32_INFO)) | ||
EFM32_RADIO = $(word 9, $(EFM32_INFO)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Find the header file that should exist if the CPU is supported. Only headers | ||
# for supported boards are included, but to support another CPU, it should be | ||
# as easy as adding the header file only. | ||
EFM32_HEADER = $(wildcard $(RIOTCPU)/efm32/families/efm32gg/include/vendor/$(CPU_MODEL).h) | ||
|
||
# vectors.o is provided by 'cpu_$(CPU_FAM)' module and not by 'cpu' | ||
VECTORS_O = $(BINDIR)/cpu_efm32gg/vectors.o | ||
|
||
# include vendor device headers | ||
INCLUDES += -I$(RIOTCPU)/efm32/families/efm32gg/include/vendor |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# This file is automatically generated, and should not be changed. There is | ||
# probably little reason to edit this file anyway, since it should already | ||
# contain all information for the EFM32GG family of CPUs. | ||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm trying to add support to another member of the efm32 family and now I wonder what tool was used to generate that kind of file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You might want to look here: https://github.com/basilfx/EFM2RIOT/tree/develop/dist It should be reasonably up to date and contain all supported chips already. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uh that's nice. I take we can't do that on the fly as Gecko SDK is required. But I don't like copying around folders either. But we could just import that wholesale. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it is necessary to do it on-the-fly. These families are quite stable (only new ones are added). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So how about we import https://github.com/basilfx/EFM2RIOT/tree/develop/dist/cpu/efm32/families into RIOT as a whole? |
||
|
||
# Series - Architecture - Flash base - Flash size - SRAM base - SRAM size - Crypto? - TRNG? - Radio? | ||
EFM32_INFO_efm32gg330f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg295f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg940f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg840f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg332f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg990f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg890f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg232f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg942f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg842f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg395f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg295f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg995f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg895f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg395f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg230f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg895f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg390f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg290f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg995f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg980f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg940f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg942f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg330f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg230f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg842f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg332f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg232f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg880f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg840f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg380f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg890f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg990f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg290f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg390f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg900f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg900f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg380f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg280f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg280f512 = 0 cortex-m3 0x00000000 0x00080000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg980f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 | ||
EFM32_INFO_efm32gg880f1024 = 0 cortex-m3 0x00000000 0x00100000 0x20000000 0x00020000 0 0 0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Find the header file that should exist if the CPU is supported. Only headers | ||
# for supported boards are included, but to support another CPU, it should be | ||
# as easy as adding the header file only. | ||
EFM32_HEADER = $(wildcard $(RIOTCPU)/efm32/families/efm32lg/include/vendor/$(CPU_MODEL).h) | ||
|
||
# vectors.o is provided by 'cpu_$(CPU_FAM)' module and not by 'cpu' | ||
VECTORS_O = $(BINDIR)/cpu_efm32lg/vectors.o | ||
|
||
# include vendor device headers | ||
INCLUDES += -I$(RIOTCPU)/efm32/families/efm32lg/include/vendor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@basilfx I have a THUNDERBOARD EFM32GG12 here, for whose MCU there is no entry in this file. Is this file really created automatically and if so, how. Or does the entry have to be added manually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is generated using https://github.com/basilfx/EFM2Riot. That script parses the Gecko SDK and generates the necessary files. I'll admit that it's a bit outdated now.