Skip to content

Commit 3579b35

Browse files
committed
riscv: dts: spacemit: add pinctrl property to uart0 in BPI-F3
Before pinctrl driver implemented, the uart0 controller reply on bootloader for setting correct pin mux and configurations. Now, let's add pinctrl property to uart0 of Bananapi-F3 board. Signed-off-by: Yixun Lan <[email protected]>
1 parent 21bef40 commit 3579b35

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#include "k1.dtsi"
7+
#include "k1-pinctrl.dtsi"
78

89
/ {
910
model = "Banana Pi BPI-F3";
@@ -15,5 +16,7 @@
1516
};
1617

1718
&uart0 {
19+
pinctrl-names = "default";
20+
pinctrl-0 = <&uart0_2_cfg>;
1821
status = "okay";
1922
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// SPDX-License-Identifier: GPL-2.0 OR MIT
2+
/*
3+
* Copyright (c) 2024 Yixun Lan <[email protected]>
4+
*/
5+
6+
#include <dt-bindings/gpio/gpio.h>
7+
8+
#define K1_PADCONF(pin, func) (((pin) << 16) | (func))
9+
10+
&pinctrl {
11+
uart0_2_cfg: uart0-2-cfg {
12+
uart0-2-pins {
13+
pinmux = <K1_PADCONF(68, 2)>,
14+
<K1_PADCONF(69, 2)>;
15+
16+
bias-pull-up = <0>;
17+
drive-strength = <32>;
18+
};
19+
};
20+
};

arch/riscv/boot/dts/spacemit/k1.dtsi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,11 @@
416416
status = "disabled";
417417
};
418418

419+
pinctrl: pinctrl@d401e000 {
420+
compatible = "spacemit,k1-pinctrl";
421+
reg = <0x0 0xd401e000 0x0 0x400>;
422+
};
423+
419424
plic: interrupt-controller@e0000000 {
420425
compatible = "spacemit,k1-plic", "sifive,plic-1.0.0";
421426
reg = <0x0 0xe0000000 0x0 0x4000000>;

0 commit comments

Comments
 (0)