1 /* 2 * Copyright (c) 2021 Linaro Limited 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <zephyr/drivers/gpio/gpio_mmio32.h> 8 #include <soc.h> 9 #include <zephyr/linker/linker-defs.h> 10 11 12 /* Setup GPIO drivers for accessing FPGAIO registers */ 13 #define FPGAIO_NODE(n) DT_INST(n, arm_mps3_fpgaio_gpio) 14 #define FPGAIO_INIT(n) \ 15 GPIO_MMIO32_INIT(FPGAIO_NODE(n), \ 16 DT_REG_ADDR(FPGAIO_NODE(n)), \ 17 BIT_MASK(DT_PROP(FPGAIO_NODE(n), ngpios))) 18 19 /* We expect there to be 3 arm,mps3-fpgaio-gpio devices: 20 * led0, button, and misc 21 */ 22 FPGAIO_INIT(0); 23 FPGAIO_INIT(1); 24 FPGAIO_INIT(2); 25