soc: silabs_exx32: Add SWO logger support to EFM32PG12B

By default, after reset SWO signal is not connected to GPIO pin.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This commit is contained in:
Christian Taedcke 2019-01-06 00:30:41 +01:00 committed by Carles Cufí
commit e6d5c4e3da
7 changed files with 30 additions and 3 deletions

View file

@ -69,3 +69,8 @@
location = <15>;
status = "ok";
};
&gpio {
location-swo = <0>;
status = "ok";
};

View file

@ -117,7 +117,7 @@
status = "disabled";
};
gpio@4000a400 {
gpio: gpio@4000a400 {
compatible = "silabs,efm32-gpio";
reg = <0x4000a400 0xf00>;
interrupts = <1 2 11 2>;

View file

@ -31,4 +31,9 @@ properties:
description: Human readable string describing the device (used by Zephyr for API name)
generation: define
location-swo:
type: int
category: optional
description: Serial Wire Output (SWO) PIN location
generation: define
...

View file

@ -8,12 +8,12 @@
if SOC_SERIES_EFM32PG12B
if GPIO
if GPIO || LOG_BACKEND_SWO
config GPIO_GECKO
default y
endif # GPIO
endif # GPIO || LOG_BACKEND_SWO
if SERIAL

View file

@ -8,6 +8,7 @@
config SOC_SERIES_EFM32PG12B
bool "EFM32PG12B Series MCU"
select HAS_SILABS_GECKO
select HAS_SWO
select CPU_CORTEX_M4
select CPU_HAS_FPU
select SOC_FAMILY_EXX32

View file

@ -16,6 +16,7 @@
#define DT_GPIO_GECKO_COMMON_EVEN_PRI DT_SILABS_EFM32_GPIO_4000A400_IRQ_GPIO_EVEN_PRIORITY
#define DT_GPIO_GECKO_COMMON_ODD_IRQ DT_SILABS_EFM32_GPIO_4000A400_IRQ_GPIO_ODD
#define DT_GPIO_GECKO_COMMON_ODD_PRI DT_SILABS_EFM32_GPIO_4000A400_IRQ_GPIO_ODD_PRIORITY
#define DT_GPIO_GECKO_SWO_LOCATION DT_SILABS_EFM32_GPIO_4000A400_LOCATION_SWO
#define DT_GPIO_GECKO_PORTA_NAME DT_SILABS_EFM32_GPIO_PORT_4000A000_LABEL
#define DT_GPIO_GECKO_PORTB_NAME DT_SILABS_EFM32_GPIO_PORT_4000A030_LABEL

View file

@ -16,6 +16,21 @@
#include <soc.h>
#include <em_gpio.h>
#ifdef CONFIG_GPIO_GECKO
/* Serial Wire Output (SWO) */
#if (DT_GPIO_GECKO_SWO_LOCATION == 0)
#define PIN_SWO {gpioPortF, 2, gpioModePushPull, 1}
#elif (DT_GPIO_GECKO_SWO_LOCATION == 1)
#define PIN_SWO {gpioPortB, 13, gpioModePushPull, 1}
#elif (DT_GPIO_GECKO_SWO_LOCATION == 2)
#define PIN_SWO {gpioPortD, 15, gpioModePushPull, 1}
#elif (DT_GPIO_GECKO_SWO_LOCATION == 3)
#define PIN_SWO {gpioPortC, 11, gpioModePushPull, 1}
#elif (DT_GPIO_GECKO_SWO_LOCATION >= 4)
#error ("Invalid SWO pin location")
#endif
#endif /* CONFIG_GPIO_GECKO */
#ifdef CONFIG_USART_GECKO_0
#if (DT_SILABS_GECKO_USART_USART_0_GPIO_LOC == 0)
#define PIN_USART0_TXD {gpioPortA, 0, gpioModePushPull, 1}