drivers: pinctrl: add SiFive pinctrl driver
Add a pinctrl driver used in FE310-based boards. Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
This commit is contained in:
parent
b76d74cd64
commit
a5cc185b9b
6 changed files with 140 additions and 0 deletions
29
soc/riscv/riscv-privilege/sifive-freedom/pinctrl_soc.h
Normal file
29
soc/riscv/riscv-privilege/sifive-freedom/pinctrl_soc.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2022 Antmicro <www.antmicro.com>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef ZEPHYR_SOC_RISCV_RISCV_PRIVILEGE_SIFIVE_FREEDOM_PINCTRL_H_
|
||||
#define ZEPHYR_SOC_RISCV_RISCV_PRIVILEGE_SIFIVE_FREEDOM_PINCTRL_H_
|
||||
|
||||
#include <zephyr/types.h>
|
||||
|
||||
typedef struct pinctrl_soc_pin_t {
|
||||
uint8_t pin;
|
||||
uint8_t iof;
|
||||
} pinctrl_soc_pin_t;
|
||||
|
||||
#define SIFIVE_DT_PIN(node_id) \
|
||||
{ \
|
||||
.pin = DT_PROP_BY_IDX(node_id, pinmux, 0), \
|
||||
.iof = DT_PROP_BY_IDX(node_id, pinmux, 1) \
|
||||
},
|
||||
|
||||
#define Z_PINCTRL_STATE_PIN_INIT(node_id, prop, idx) \
|
||||
SIFIVE_DT_PIN(DT_PROP_BY_IDX(node_id, prop, idx))
|
||||
|
||||
#define Z_PINCTRL_STATE_PINS_INIT(node_id, prop) \
|
||||
{ DT_FOREACH_PROP_ELEM(node_id, prop, Z_PINCTRL_STATE_PIN_INIT) }
|
||||
|
||||
#endif /* ZEPHYR_SOC_RISCV_RISCV_PRIVILEGE_SIFIVE_FREEDOM_PINCTRL_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue