From 77dcab735247d8657bbd20f92b3856fa0916d6d5 Mon Sep 17 00:00:00 2001 From: Neil Chen Date: Wed, 8 Jan 2025 14:18:36 +0800 Subject: [PATCH] boards: nxp: frdm_mcxa156: Support flexio for NXP frdm_mcxa156 board Support flexio for NXP frdm_mcxa156 board. Signed-off-by: Neil Chen --- boards/nxp/frdm_mcxa156/board.c | 5 +++ boards/nxp/frdm_mcxa156/doc/index.rst | 5 +++ .../frdm_mcxa156/frdm_mcxa156-pinctrl.dtsi | 40 +++++++++++++++++++ boards/nxp/frdm_mcxa156/frdm_mcxa156.dts | 37 +++++++++++++++++ 4 files changed, 87 insertions(+) diff --git a/boards/nxp/frdm_mcxa156/board.c b/boards/nxp/frdm_mcxa156/board.c index 12d2128149a..a51f3f15de4 100644 --- a/boards/nxp/frdm_mcxa156/board.c +++ b/boards/nxp/frdm_mcxa156/board.c @@ -155,6 +155,11 @@ static int frdm_mcxa156_init(void) CLOCK_AttachClk(kFRO_HF_DIV_to_FLEXCAN0); #endif +#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(flexio0)) + CLOCK_SetClockDiv(kCLOCK_DivFLEXIO0, 1u); + CLOCK_AttachClk(kFRO_HF_to_FLEXIO0); +#endif + #if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpadc0)) CLOCK_SetClockDiv(kCLOCK_DivADC0, 1u); CLOCK_AttachClk(kFRO12M_to_ADC0); diff --git a/boards/nxp/frdm_mcxa156/doc/index.rst b/boards/nxp/frdm_mcxa156/doc/index.rst index fe74df87847..0bcc9d6e9ee 100644 --- a/boards/nxp/frdm_mcxa156/doc/index.rst +++ b/boards/nxp/frdm_mcxa156/doc/index.rst @@ -64,6 +64,11 @@ The FRDM-MCXA156 board configuration supports the following hardware features: +-----------+------------+-------------------------------------+ | FLEXCAN | on-chip | CAN | +-----------+------------+-------------------------------------+ +| FLEXIO | on-chip | flexio | ++-----------+------------+-------------------------------------+ +| DISPLAY | on-chip | flexio; MIPI-DBI. Tested with | +| | | :ref:`lcd_par_s035` | ++-----------+------------+-------------------------------------+ | I2C | on-chip | i2c | +-----------+------------+-------------------------------------+ | LPCMP | on-chip | sensor(comparator) | diff --git a/boards/nxp/frdm_mcxa156/frdm_mcxa156-pinctrl.dtsi b/boards/nxp/frdm_mcxa156/frdm_mcxa156-pinctrl.dtsi index 69105bad8ca..151b43d0edf 100644 --- a/boards/nxp/frdm_mcxa156/frdm_mcxa156-pinctrl.dtsi +++ b/boards/nxp/frdm_mcxa156/frdm_mcxa156-pinctrl.dtsi @@ -32,6 +32,46 @@ input-enable; }; }; + pinmux_flexio_lcd: pinmux_flexio_lcd { + group0 { + pinmux = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + slew-rate = "fast"; + drive-strength = "low"; + input-enable; + }; + group1 { + pinmux = ; + slew-rate = "fast"; + drive-strength = "low"; + input-enable; + bias-pull-up; + }; + group2 { + pinmux = ; + slew-rate = "slow"; + drive-strength = "low"; + input-enable; + bias-pull-up; + }; + }; pinmux_flexpwm0_pwm0: pinmux_flexpwm0_pwm0 { group0 { pinmux = , diff --git a/boards/nxp/frdm_mcxa156/frdm_mcxa156.dts b/boards/nxp/frdm_mcxa156/frdm_mcxa156.dts index 788d91eb455..2ff177a8d0e 100644 --- a/boards/nxp/frdm_mcxa156/frdm_mcxa156.dts +++ b/boards/nxp/frdm_mcxa156/frdm_mcxa156.dts @@ -66,6 +66,18 @@ }; }; + /* + * This node describes the GPIO pins of the LCD-PAR-S035 panel 8080 interface. + */ + nxp_lcd_8080_connector: lcd-8080-connector { + compatible = "nxp,lcd-8080"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <9 0 &gpio2 15 0>, /* Pin 9, LCD touch INT */ + <10 0 &gpio3 22 0>, /* Pin 10, LCD backlight control */ + <11 0 &gpio3 0 0>; /* Pin 11, LCD and touch reset */ + }; }; &gpio0 { @@ -115,6 +127,31 @@ pinctrl-names = "default"; }; +&flexio0 { + status = "okay"; +}; + +nxp_8080_touch_panel_i2c: &lpi2c2 { + pinctrl-0 = <&pinmux_lpi2c2>; + pinctrl-names = "default"; +}; + +zephyr_mipi_dbi_parallel: &flexio0_lcd { + /* DMA channels 0, muxed to FlexIO TX */ + dmas = <&edma0 0 71>; + dma-names = "tx"; + shifters-count = <4>; + timers-count = <1>; + enwr-pin = <31>; + rd-pin = <28>; + data-pin-start = <0>; + reset-gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio2 19 GPIO_ACTIVE_HIGH>; + rs-gpios = <&gpio2 17 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&pinmux_flexio_lcd>; + pinctrl-names = "default"; +}; + &flexpwm0_pwm0 { status = "okay"; pinctrl-0 = <&pinmux_flexpwm0_pwm0>;