Kyösti Mälkki | 7809356 | 2014-11-11 17:22:23 +0200 | [diff] [blame] | 1 | /* |
| 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. |
Kyösti Mälkki | 7809356 | 2014-11-11 17:22:23 +0200 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #ifndef GPIO_FTNS_H |
| 17 | #define GPIO_FTNS_H |
| 18 | |
Stefan Reinauer | e6946c6 | 2015-06-19 15:54:00 -0700 | [diff] [blame] | 19 | uintptr_t find_gpio_base(void); |
| 20 | void configure_gpio(uintptr_t base_addr, u32 gpio, u8 iomux_ftn, u8 setting); |
| 21 | u8 read_gpio(uintptr_t base_addr, u32 gpio); |
Kyösti Mälkki | 7809356 | 2014-11-11 17:22:23 +0200 | [diff] [blame] | 22 | int get_spd_offset(void); |
| 23 | |
| 24 | #define IOMUX_OFFSET 0xD00 |
| 25 | #define GPIO_OFFSET 0x100 |
| 26 | #define GPIO_10 10 // PE3 Reset |
| 27 | #define GPIO_11 11 // PE4 Reset |
| 28 | #define GPIO_15 15 // board rev strap ms bit |
| 29 | #define GPIO_16 16 // board rev strap ls bit |
| 30 | #define GPIO_17 17 // TP13 |
| 31 | #define GPIO_18 18 // TP10 |
| 32 | #define GPIO_187 187 // MODESW |
| 33 | #define GPIO_189 189 // LED1# |
| 34 | #define GPIO_190 190 // LED2# |
| 35 | #define GPIO_191 191 // LED3# |
| 36 | #define GPIO_FTN_1 0x01 |
| 37 | #define GPIO_OUTPUT 0x08 |
| 38 | #define GPIO_INPUT 0x28 |
| 39 | #define GPIO_DATA_IN 0x80 |
| 40 | #define GPIO_DATA_LOW 0x00 |
| 41 | #define GPIO_DATA_HIGH 0x40 |
| 42 | |
| 43 | #endif /* GPIO_FTNS_H */ |