xref: /rk3399_rockchip-uboot/arch/arm/include/asm/arch-spear/gpio.h (revision 326ea986ac150acdc7656d57fca647db80b50158)
12cb06a4fSStefan Roese /*
22cb06a4fSStefan Roese  * Copyright (C) 2012 Stefan Roese <sr@denx.de>
32cb06a4fSStefan Roese  *
4*1a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
52cb06a4fSStefan Roese  */
62cb06a4fSStefan Roese 
72cb06a4fSStefan Roese 
82cb06a4fSStefan Roese #ifndef __ASM_ARCH_SPEAR_GPIO_H
92cb06a4fSStefan Roese #define __ASM_ARCH_SPEAR_GPIO_H
102cb06a4fSStefan Roese 
112cb06a4fSStefan Roese enum gpio_direction {
122cb06a4fSStefan Roese 	GPIO_DIRECTION_IN,
132cb06a4fSStefan Roese 	GPIO_DIRECTION_OUT,
142cb06a4fSStefan Roese };
152cb06a4fSStefan Roese 
162cb06a4fSStefan Roese struct gpio_regs {
172cb06a4fSStefan Roese 	u32 gpiodata[0x100];	/* 0x000 ... 0x3fc */
182cb06a4fSStefan Roese 	u32 gpiodir;		/* 0x400 */
192cb06a4fSStefan Roese };
202cb06a4fSStefan Roese 
212cb06a4fSStefan Roese #define SPEAR_GPIO_COUNT		8
222cb06a4fSStefan Roese #define DATA_REG_ADDR(gpio)		(1 << (gpio + 2))
232cb06a4fSStefan Roese 
242cb06a4fSStefan Roese #endif	/* __ASM_ARCH_SPEAR_GPIO_H */
25