2021-02-14 04:42:46 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021 Linaro Limited
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2022-05-06 17:11:04 +08:00
|
|
|
#include <zephyr/drivers/gpio/gpio_mmio32.h>
|
2021-02-14 04:42:46 +08:00
|
|
|
#include <soc.h>
|
2022-05-06 17:11:04 +08:00
|
|
|
#include <zephyr/linker/linker-defs.h>
|
2021-02-14 04:42:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* Setup GPIO drivers for accessing FPGAIO registers */
|
|
|
|
#define FPGAIO_NODE(n) DT_INST(n, arm_mps3_fpgaio_gpio)
|
|
|
|
#define FPGAIO_INIT(n) \
|
2021-04-09 20:45:54 +08:00
|
|
|
GPIO_MMIO32_INIT(FPGAIO_NODE(n), \
|
2021-02-14 04:42:46 +08:00
|
|
|
DT_REG_ADDR(FPGAIO_NODE(n)), \
|
|
|
|
BIT_MASK(DT_PROP(FPGAIO_NODE(n), ngpios)))
|
|
|
|
|
|
|
|
/* We expect there to be 3 arm,mps3-fpgaio-gpio devices:
|
|
|
|
* led0, button, and misc
|
|
|
|
*/
|
|
|
|
FPGAIO_INIT(0);
|
|
|
|
FPGAIO_INIT(1);
|
|
|
|
FPGAIO_INIT(2);
|