Skip to content

Commit

Permalink
Merge pull request #11940 from basilfx/feature/efm32_riotboot
Browse files Browse the repository at this point in the history
efm32: add support for riotboot
  • Loading branch information
benpicco authored Oct 1, 2019
2 parents 29de470 + 08bc67c commit c4fa084
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions boards/common/silabs/Makefile.features
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Various other features (if any)
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += riotboot
3 changes: 3 additions & 0 deletions boards/ikea-tradfri/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart periph_uart_modecfg

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += riotboot
2 changes: 2 additions & 0 deletions boards/ikea-tradfri/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ void board_init(void)
/* initialize the CPU */
cpu_init();

#ifndef RIOTBOOT
/* initialize the LEDs */
gpio_init(LED0_PIN, GPIO_OUT);
gpio_init(LED1_PIN, GPIO_OUT);
#endif
}
2 changes: 2 additions & 0 deletions boards/slstk3401a/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ void board_init(void)
/* initialize the CPU */
cpu_init();

#ifndef RIOTBOOT
/* perform common board initialization */
board_common_init();

Expand All @@ -36,4 +37,5 @@ void board_init(void)
gpio_init(SI7021_EN_PIN, GPIO_OUT);
gpio_set(SI7021_EN_PIN);
#endif
#endif
}
2 changes: 2 additions & 0 deletions boards/slstk3402a/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ void board_init(void)
/* initialize the CPU */
cpu_init();

#ifndef RIOTBOOT
/* perform common board initialization */
board_common_init();

Expand All @@ -36,4 +37,5 @@ void board_init(void)
gpio_init(SI7021_EN_PIN, GPIO_OUT);
gpio_set(SI7021_EN_PIN);
#endif
#endif
}
2 changes: 2 additions & 0 deletions boards/sltb001a/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void board_init(void)
/* initialize the CPU */
cpu_init();

#ifndef RIOTBOOT
/* perform common board initialization */
board_common_init();

Expand Down Expand Up @@ -61,4 +62,5 @@ void board_init(void)
(RGB_LED4_ENABLED << RGB_LED4_EN_BIT));
#endif
#endif
#endif
}
2 changes: 2 additions & 0 deletions boards/slwstk6000b/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ void board_init(void)
/* initialize the CPU */
cpu_init();

#ifndef RIOTBOOT
/* perform common board initialization */
board_common_init();

Expand All @@ -36,4 +37,5 @@ void board_init(void)
gpio_init(SI7021_EN_PIN, GPIO_OUT);
gpio_set(SI7021_EN_PIN);
#endif
#endif
}
2 changes: 2 additions & 0 deletions boards/stk3600/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ void board_init(void)
/* initialize the CPU */
cpu_init();

#ifndef RIOTBOOT
/* perform common board initialization */
board_common_init();
#endif
}
2 changes: 2 additions & 0 deletions boards/stk3700/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ void board_init(void)
/* initialize the CPU */
cpu_init();

#ifndef RIOTBOOT
/* perform common board initialization */
board_common_init();
#endif
}
3 changes: 3 additions & 0 deletions cpu/efm32/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ include $(RIOTCPU)/efm32/efm32-info.mk
export CPU_ARCH = $(EFM32_ARCHITECTURE)
export CPU_FAM = $(EFM32_FAMILY)

# the size of riotboot on the EFM32 exceeds the default value
RIOTBOOT_LEN ?= 0x2000

# the em_device.h header requires a global define with the cpu model
CFLAGS += -D$(call uppercase_and_underscore,$(CPU_MODEL))

Expand Down
9 changes: 9 additions & 0 deletions cpu/efm32/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
#define EMU_EM4INIT EMU_EM4INIT_DEFAULT
#endif

#ifndef RIOTBOOT

#ifdef _SILICON_LABS_32B_SERIES_1
/**
* @brief Initialize integrated DC-DC regulator
Expand Down Expand Up @@ -154,14 +156,20 @@ static void pm_init(void)
#endif
}

#endif

void cpu_init(void)
{
#ifndef RIOTBOOT
/* apply errata that may be applicable (see em_chip.h) */
CHIP_Init();
#endif

/* initialize the Cortex-M core */
cortexm_init();

#ifndef RIOTBOOT

#ifdef _SILICON_LABS_32B_SERIES_1
/* initialize dc-dc */
dcdc_init();
Expand All @@ -178,4 +186,5 @@ void cpu_init(void)

/* trigger static peripheral initialization */
periph_init();
#endif
}

0 comments on commit c4fa084

Please sign in to comment.