blob: 11d5ea1c3d7b860b8fa389424e6c1331da741b82 [file] [log] [blame]
Kyösti Mälkki78093562014-11-11 17:22:23 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2014 Sage Electronic Engineering, LLC
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifndef GPIO_FTNS_H
21#define GPIO_FTNS_H
22
23u32 find_gpio_base(void);
24void configure_gpio(u32 base_addr, u32 gpio, u8 iomux_ftn, u8 setting);
25u8 read_gpio(u32 base_addr, u32 gpio);
26int get_spd_offset(void);
27
28#define IOMUX_OFFSET 0xD00
29#define GPIO_OFFSET 0x100
30#define GPIO_10 10 // PE3 Reset
31#define GPIO_11 11 // PE4 Reset
32#define GPIO_15 15 // board rev strap ms bit
33#define GPIO_16 16 // board rev strap ls bit
34#define GPIO_17 17 // TP13
35#define GPIO_18 18 // TP10
36#define GPIO_187 187 // MODESW
37#define GPIO_189 189 // LED1#
38#define GPIO_190 190 // LED2#
39#define GPIO_191 191 // LED3#
40#define GPIO_FTN_1 0x01
41#define GPIO_OUTPUT 0x08
42#define GPIO_INPUT 0x28
43#define GPIO_DATA_IN 0x80
44#define GPIO_DATA_LOW 0x00
45#define GPIO_DATA_HIGH 0x40
46
47#endif /* GPIO_FTNS_H */