2019-11-08 12:18:35 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 SEAL AG
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <init.h>
|
|
|
|
#include <soc.h>
|
2020-11-20 16:41:20 +01:00
|
|
|
#include <stm32_ll_bus.h>
|
|
|
|
#include <stm32_ll_system.h>
|
2019-11-08 12:18:35 +01:00
|
|
|
|
2020-04-30 20:33:38 +02:00
|
|
|
static int pinmux_stm32_init(const struct device *port)
|
2019-11-08 12:18:35 +01:00
|
|
|
{
|
|
|
|
ARG_UNUSED(port);
|
|
|
|
|
2020-05-13 08:29:40 +02:00
|
|
|
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usart1), okay) && CONFIG_SERIAL
|
2019-11-08 12:18:35 +01:00
|
|
|
/* Remap PA11 to PA9 */
|
|
|
|
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SYSCFG);
|
|
|
|
LL_SYSCFG_EnablePinRemap(LL_SYSCFG_PIN_RMP_PA11);
|
2020-04-16 14:15:44 +02:00
|
|
|
#endif
|
2019-11-08 12:18:35 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1,
|
|
|
|
CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
|