blob: af05d1eb8878a91a5a665a2036d7d3dc65a4fb67 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
tremcf233ed2012-08-25 05:30:33 +00002/*
3 * Copyright (C) 2012
4 * Philippe Reynes <tremyfr@yahoo.fr>
tremcf233ed2012-08-25 05:30:33 +00005 */
6
tremcf233ed2012-08-25 05:30:33 +00007#ifndef __ASM_ARCH_MX27_GPIO_H
8#define __ASM_ARCH_MX27_GPIO_H
9
10/* GPIO registers */
11struct gpio_regs {
12 u32 gpio_dir; /* DDIR */
13 u32 ocr1;
14 u32 ocr2;
15 u32 iconfa1;
16 u32 iconfa2;
17 u32 iconfb1;
18 u32 iconfb2;
19 u32 gpio_dr; /* DR */
20 u32 gius;
21 u32 gpio_psr; /* SSR */
22 u32 icr1;
23 u32 icr2;
24 u32 imr;
25 u32 isr;
26 u32 gpr;
27 u32 swr;
28 u32 puen;
29 u32 res[0x2f];
30};
31
32/* This structure is used by the function imx_gpio_mode */
33struct gpio_port_regs {
34 struct gpio_regs port[6];
35};
36
Peng Fancf99d022015-05-15 07:29:13 +080037/*
38 * GPIO Module and I/O Multiplexer
39 */
40#define PORTA 0
41#define PORTB 1
42#define PORTC 2
43#define PORTD 3
44#define PORTE 4
45#define PORTF 5
46
47#define GPIO_PIN_MASK 0x1f
48#define GPIO_PORT_SHIFT 5
49#define GPIO_PORT_MASK (0x7 << GPIO_PORT_SHIFT)
50#define GPIO_PORTA (PORTA << GPIO_PORT_SHIFT)
51#define GPIO_PORTB (PORTB << GPIO_PORT_SHIFT)
52#define GPIO_PORTC (PORTC << GPIO_PORT_SHIFT)
53#define GPIO_PORTD (PORTD << GPIO_PORT_SHIFT)
54#define GPIO_PORTE (PORTE << GPIO_PORT_SHIFT)
55#define GPIO_PORTF (PORTF << GPIO_PORT_SHIFT)
56
tremcf233ed2012-08-25 05:30:33 +000057#endif