boards: arm: nuvoton_pfm_m487: use gpio and pinctrl apis by default
Now that we have support for the GPIO and pinctrl APIs on this platform, enable them by default and add definitions for the on-board LEDs and switches. Additionally, use the pinctrl API to configure the UART pins. Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
This commit is contained in:
parent
0df2e8c888
commit
239c69ee49
15
boards/arm/nuvoton_pfm_m487/nuvoton_pfm_m487-pinctrl.dtsi
Normal file
15
boards/arm/nuvoton_pfm_m487/nuvoton_pfm_m487-pinctrl.dtsi
Normal file
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* Copyright (c) 2022 SEAL AG
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <nuvoton/numicro/M48x-pinctrl.h>
|
||||
|
||||
&pinctrl {
|
||||
uart0_default: uart0_default {
|
||||
group0 {
|
||||
pinmux = <UART0_RXD_PB12>, <UART0_TXD_PB13>;
|
||||
};
|
||||
};
|
||||
};
|
|
@ -6,17 +6,54 @@
|
|||
|
||||
/dts-v1/;
|
||||
#include <nuvoton/m48x.dtsi>
|
||||
#include "nuvoton_pfm_m487-pinctrl.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Nuvoton PFM M487 board";
|
||||
compatible = "nuvoton,pfm-m487", "nuvoton,m487";
|
||||
|
||||
aliases {
|
||||
led0 = &red_led;
|
||||
led1 = &yellow_led;
|
||||
led2 = &green_led;
|
||||
sw0 = &sw2;
|
||||
sw1 = &sw3;
|
||||
};
|
||||
|
||||
chosen {
|
||||
zephyr,console = &uart0;
|
||||
zephyr,shell-uart = &uart0;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
red_led: led_0 {
|
||||
gpios = <&gpioh 0 GPIO_ACTIVE_LOW>;
|
||||
label = "User LED Red";
|
||||
};
|
||||
yellow_led: led_1 {
|
||||
gpios = <&gpioh 1 GPIO_ACTIVE_LOW>;
|
||||
label = "User LED Yellow";
|
||||
};
|
||||
green_led: led_2 {
|
||||
gpios = <&gpioh 2 GPIO_ACTIVE_LOW>;
|
||||
label = "User LED Green";
|
||||
};
|
||||
};
|
||||
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
sw2: button_0 {
|
||||
gpios = <&gpiog 15 GPIO_ACTIVE_LOW>;
|
||||
label = "User SW2";
|
||||
};
|
||||
sw3: button_1 {
|
||||
gpios = <&gpiof 11 GPIO_ACTIVE_LOW>;
|
||||
label = "User SW3";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
|
@ -27,7 +64,25 @@
|
|||
reg = <0x20000000 DT_SIZE_K(160)>;
|
||||
};
|
||||
|
||||
&gpiob {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpiof {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpiog {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpioh {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
current-speed = <115200>;
|
||||
status = "okay";
|
||||
pinctrl-0 = <&uart0_default>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
|
|
@ -8,6 +8,10 @@ CONFIG_BOARD_NUVOTON_PFM_M487=y
|
|||
CONFIG_ARM_MPU=y
|
||||
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=192000000
|
||||
|
||||
# Enable GPIO and pinctrl drivers
|
||||
CONFIG_GPIO=y
|
||||
CONFIG_PINCTRL=y
|
||||
|
||||
# enable uart driver
|
||||
CONFIG_SERIAL=y
|
||||
|
||||
|
|
Loading…
Reference in a new issue