2 * Raspberry Pi (BCM2838) GPIO Controller
3 * This implementation is based on bcm2835_gpio (hw/gpio/bcm2835_gpio.c)
5 * Copyright (c) 2022 Auriga LLC
8 * Lotosh, Aleksey <aleksey.lotosh@auriga.com>
10 * This work is licensed under the terms of the GNU GPL, version 2 or later.
11 * See the COPYING file in the top-level directory.
14 #ifndef BCM2838_GPIO_H
15 #define BCM2838_GPIO_H
18 #include "hw/sysbus.h"
19 #include "qom/object.h"
21 #define TYPE_BCM2838_GPIO "bcm2838-gpio"
22 OBJECT_DECLARE_SIMPLE_TYPE(BCM2838GpioState
, BCM2838_GPIO
)
24 #define BCM2838_GPIO_REGS_SIZE 0x1000
25 #define BCM2838_GPIO_NUM 58
26 #define GPIO_PUP_PDN_CNTRL_NUM 4
28 struct BCM2838GpioState
{
29 SysBusDevice parent_obj
;
38 uint8_t fsel
[BCM2838_GPIO_NUM
];
41 qemu_irq out
[BCM2838_GPIO_NUM
];
42 uint32_t pup_cntrl_reg
[GPIO_PUP_PDN_CNTRL_NUM
];