Skip to content

Commit 3042cb8

Browse files
jbylickihenrikbrixandersen
authored andcommitted
boards: arm: mercury_xu: Define the pinctrl instance
Define the pinctrl-based pin controller instance for the Mercury XU board and remove the old implementation Signed-off-by: Jan Bylicki <[email protected]>
1 parent 6400e3f commit 3042cb8

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

boards/arm/mercury_xu/board.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,9 @@
66

77
#include <zephyr/arch/cpu.h>
88
#include <zephyr/init.h>
9-
#define MIO_PIN_18 0xff180048
10-
#define MIO_PIN_19 0xff18004c
11-
#define MIO_PIN_38 0xff180098
12-
#define MIO_PIN_39 0xff18009c
13-
14-
#define MIO_DEFAULT 0x0
15-
#define MIO_UART0 0xc0
169

1710
static int mercury_xu_init(void)
1811
{
19-
/* pinmux settings for uart */
20-
sys_write32(MIO_UART0, MIO_PIN_38);
21-
sys_write32(MIO_UART0, MIO_PIN_39);
22-
23-
/* disable misleading pinmux */
24-
sys_write32(MIO_DEFAULT, MIO_PIN_18);
25-
sys_write32(MIO_DEFAULT, MIO_PIN_19);
26-
2712
return 0;
2813
}
2914

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2024 Antmicro <www.antmicro.com>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <dt-bindings/pinctrl/pinctrl-zynqmp.h>
8+
9+
&pinctrl {
10+
uart0_default: uart0_default {
11+
group1 {
12+
pinmux = <UART0_RX_38>;
13+
};
14+
group2 {
15+
pinmux = <UART0_TX_39>;
16+
};
17+
};
18+
};

boards/arm/mercury_xu/mercury_xu.dts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
/dts-v1/;
88
#include <arm/xilinx/zynqmp_rpu.dtsi>
9+
#include "mercury_xu-pinctrl.dtsi"
910

1011
/ {
1112
model = "Mercury XU";
@@ -28,6 +29,8 @@
2829
status = "okay";
2930
current-speed = <115200>;
3031
clock-frequency = <99999901>;
32+
pinctrl-0 = <&uart0_default>;
33+
pinctrl-names = "default";
3134
};
3235

3336
&ttc0 {

boards/arm/mercury_xu/mercury_xu_defconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ CONFIG_UART_CONSOLE=y
1111

1212
# enable timer
1313
CONFIG_SYS_CLOCK_TICKS_PER_SEC=100
14+
15+
CONFIG_PINCTRL=y

0 commit comments

Comments
 (0)