Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ioconfig #10

Draft
wants to merge 3 commits into
base: histb
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/hisilicon,hi3798mv200-ioconfig.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: HiSilicon Hi3798MV200 SoC IOCONFIG module

maintainers:
- Yang Xiwen <[email protected]>

description: Hi3798MV200 IOCONFIG pinmux&pinconf controller

properties:
compatible:
const: hisilicon,hi3798mv200-ioconfig

reg:
maxItems: 1

"#pinctrl-cells":
const: 1

patternProperties:
"-state$":
oneOf:
- $ref: "#/$defs/hi3798mv200-iocfg-pin-state"
- patternProperties:
"-pins?$":
$ref: "#/$defs/hi3798mv200-iocfg-pin-state"
unevaluatedProperties: false

$defs:
hi3798mv200-iocfg-pin-state:
$ref: hisilicon,histb-pinctrl-common.yaml#/$defs/histb-pin-state
unevaluatedProperties: false

properties:
pins:
items:
enum: [ Y19, W19, AA20, Y20, V19, Y21, W20, W21, V20, V21, U20, U21,
T18, T19, T20, R20, R21, P20, R19, K18, J17, J18, H17, H18, K20,
K19, J20, J19, H21, H20, H19, G20, G19, F21, F20, F19, E20, E19,
D21, E18, C20, D19, B21, B18, C17, B17, A17, C16, B16, B4, C4, A3,
B3, A2, B2, A6, C6, C5, C3, D4, D3, B1, C2, C1, A5, D5 ]

function:
enum: [ gpio, bootsel, clkout, emmc, fe_led, hdmitx, i2c_scl, i2c_sda,
i2s_clk, i2s_data, i2s_ws, jtag, nand, pmc, rgmii, rmii, sata, sdio,
sim, spdif, spi, spi_flash, tsi0_d0, tsi0_d1, tsi0_data, tsi1_data,
tsi2_data, tsi3_data, tso, tsi_clk, tsi_sync, tsi_valid, uart ]

allOf:
- $ref: hisilicon,histb-pinctrl-common.yaml#

required:
- compatible
- reg

unevaluatedProperties: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/hisilicon,histb-pinctrl-common.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: HiSilicon HiSTB SoCs Pinctrl Controller

maintainers:
- Yang Xiwen <[email protected]>

description: |
Pinctrl for HiSilicon HiSTB SoCs are commonly separated into two parts. Most
pins are controlled via IOCONFIG register space, the rest are controlled
within sysctrl core.

Both support per-pin pinmux and pinconf settings. Though the register fields
and offsets may differ.

allOf:
- $ref: pinctrl.yaml#

addtionalProperties: true

$defs:
histb-pin-state:
properties:
pins:
items:
pattern: "^[A-Z]+[0-9]+$"

drive-strength:
minimum: 1
maximum: 16

slew-rate:
enum: [0, 1]

bias-pull-down: true
bias-pull-up: true
bias-disable: true
input-schmitt-enable: true

function: true

required:
- pins
- function

allOf:
- $ref: pincfg-node.yaml#
- $ref: pinmux-node.yaml#

unevaluatedProperties: false
...
1 change: 1 addition & 0 deletions drivers/pinctrl/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ source "drivers/pinctrl/bcm/Kconfig"
source "drivers/pinctrl/berlin/Kconfig"
source "drivers/pinctrl/cirrus/Kconfig"
source "drivers/pinctrl/freescale/Kconfig"
source "drivers/pinctrl/hisilicon/Kconfig"
source "drivers/pinctrl/intel/Kconfig"
source "drivers/pinctrl/mediatek/Kconfig"
source "drivers/pinctrl/meson/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/pinctrl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ obj-y += bcm/
obj-$(CONFIG_PINCTRL_BERLIN) += berlin/
obj-y += cirrus/
obj-y += freescale/
obj-$(CONFIG_PINCTRL_HISILICON) += hisilicon/
obj-$(CONFIG_X86) += intel/
obj-y += mediatek/
obj-$(CONFIG_PINCTRL_MESON) += meson/
Expand Down
28 changes: 28 additions & 0 deletions drivers/pinctrl/hisilicon/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SPDX-License-Identifier: GPL-2.0-or-later
if (ARCH_HISI || COMPILE_TEST)

config PINCTRL_HISILICON
bool

config PINCTRL_HISTB
tristate "HiSilicon HiSTB SoCs pinctrl framework"
select PINCTRL_HISILICON
select GENERIC_PINCONF
select GENERIC_PINCTRL_GROUPS
select GENERIC_PINMUX_FUNCTIONS

help
Support HiSTB SoCs pinctrl module

menu "HiSTB pinctrl drivers"
depends on PINCTRL_HISTB

config PINCTRL_HI3798MV2X
tristate "HiSilicon Hi3798MV2X pinctrl driver"
depends on PINCTRL_HISTB
help
Support IOCONFIG core on Hi3798MV2X SoCs

endmenu

endif
6 changes: 6 additions & 0 deletions drivers/pinctrl/hisilicon/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright 2024 (r) Yang Xiwen <[email protected]>

obj-$(CONFIG_PINCTRL_HISTB) += pinctrl-histb.o
obj-$(CONFIG_PINCTRL_HI3798MV2X) += pinctrl-hi3798mv2x.o
Loading