2 * i.MX processors GPIO registers definition.
4 * Copyright (C) 2015 Jean-Christophe Dubois <jcd@tribudubois.net>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 or
9 * (at your option) version 3 of the License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, see <http://www.gnu.org/licenses/>.
23 #include <hw/sysbus.h>
25 #define TYPE_IMX_GPIO "imx.gpio"
26 #define IMX_GPIO(obj) OBJECT_CHECK(IMXGPIOState, (obj), TYPE_IMX_GPIO)
28 #define IMX_GPIO_MEM_SIZE 0x20
30 /* i.MX GPIO memory map */
31 #define DR_ADDR 0x00 /* DATA REGISTER */
32 #define GDIR_ADDR 0x04 /* DIRECTION REGISTER */
33 #define PSR_ADDR 0x08 /* PAD STATUS REGISTER */
34 #define ICR1_ADDR 0x0c /* INTERRUPT CONFIGURATION REGISTER 1 */
35 #define ICR2_ADDR 0x10 /* INTERRUPT CONFIGURATION REGISTER 2 */
36 #define IMR_ADDR 0x14 /* INTERRUPT MASK REGISTER */
37 #define ISR_ADDR 0x18 /* INTERRUPT STATUS REGISTER */
38 #define EDGE_SEL_ADDR 0x1c /* EDGE SEL REGISTER */
40 #define IMX_GPIO_PIN_COUNT 32
42 typedef struct IMXGPIOState
{
44 SysBusDevice parent_obj
;
57 bool has_upper_pin_irq
;
60 qemu_irq output
[IMX_GPIO_PIN_COUNT
];
63 #endif /* __IMX_GPIO_H_ */