Arthur Heymans | 62902ca | 2016-11-29 14:13:43 +0100 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2016 Arthur Heymans <arthur@aheymans.xyz> |
| 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 | |
| 16 | #include <southbridge/intel/common/gpio.h> |
| 17 | |
| 18 | static const struct pch_gpio_set1 pch_gpio_set1_mode = { |
| 19 | .gpio0 = GPIO_MODE_GPIO, |
| 20 | .gpio6 = GPIO_MODE_GPIO, |
| 21 | .gpio7 = GPIO_MODE_GPIO, |
| 22 | .gpio8 = GPIO_MODE_GPIO, |
| 23 | .gpio9 = GPIO_MODE_GPIO, |
| 24 | .gpio10 = GPIO_MODE_GPIO, |
| 25 | .gpio12 = GPIO_MODE_GPIO, |
| 26 | .gpio13 = GPIO_MODE_GPIO, |
| 27 | .gpio14 = GPIO_MODE_GPIO, |
| 28 | .gpio15 = GPIO_MODE_GPIO, |
| 29 | .gpio16 = GPIO_MODE_GPIO, |
| 30 | .gpio19 = GPIO_MODE_GPIO, |
| 31 | .gpio20 = GPIO_MODE_GPIO, |
| 32 | .gpio21 = GPIO_MODE_GPIO, |
| 33 | .gpio22 = GPIO_MODE_GPIO, |
| 34 | .gpio23 = GPIO_MODE_GPIO, |
| 35 | .gpio24 = GPIO_MODE_GPIO, |
| 36 | .gpio25 = GPIO_MODE_GPIO, |
| 37 | .gpio26 = GPIO_MODE_GPIO, |
| 38 | .gpio27 = GPIO_MODE_GPIO, |
| 39 | .gpio28 = GPIO_MODE_GPIO, |
| 40 | }; |
| 41 | |
| 42 | static const struct pch_gpio_set1 pch_gpio_set1_direction = { |
| 43 | .gpio0 = GPIO_DIR_INPUT, |
| 44 | .gpio6 = GPIO_DIR_OUTPUT, |
| 45 | .gpio7 = GPIO_DIR_OUTPUT, |
| 46 | .gpio8 = GPIO_DIR_OUTPUT, |
| 47 | .gpio9 = GPIO_DIR_OUTPUT, |
| 48 | .gpio10 = GPIO_DIR_OUTPUT, |
| 49 | .gpio12 = GPIO_DIR_OUTPUT, |
| 50 | .gpio13 = GPIO_DIR_INPUT, |
| 51 | .gpio14 = GPIO_DIR_INPUT, |
| 52 | .gpio15 = GPIO_DIR_INPUT, |
| 53 | .gpio16 = GPIO_DIR_INPUT, |
| 54 | .gpio19 = GPIO_DIR_INPUT, |
| 55 | .gpio20 = GPIO_DIR_OUTPUT, |
| 56 | .gpio21 = GPIO_DIR_INPUT, |
| 57 | .gpio22 = GPIO_DIR_INPUT, |
| 58 | .gpio23 = GPIO_DIR_INPUT, |
| 59 | .gpio24 = GPIO_DIR_OUTPUT, |
| 60 | .gpio25 = GPIO_DIR_OUTPUT, |
| 61 | .gpio26 = GPIO_DIR_OUTPUT, |
| 62 | .gpio27 = GPIO_DIR_OUTPUT, |
| 63 | .gpio28 = GPIO_DIR_OUTPUT, |
| 64 | }; |
| 65 | |
| 66 | static const struct pch_gpio_set1 pch_gpio_set1_level = { |
| 67 | .gpio6 = GPIO_LEVEL_HIGH, |
| 68 | .gpio7 = GPIO_LEVEL_LOW, |
| 69 | .gpio8 = GPIO_LEVEL_LOW, |
| 70 | .gpio9 = GPIO_LEVEL_LOW, |
| 71 | .gpio10 = GPIO_LEVEL_LOW, |
| 72 | .gpio12 = GPIO_LEVEL_LOW, |
| 73 | .gpio20 = GPIO_LEVEL_LOW, |
| 74 | .gpio24 = GPIO_LEVEL_LOW, |
| 75 | .gpio25 = GPIO_LEVEL_LOW, |
| 76 | .gpio26 = GPIO_LEVEL_HIGH, |
| 77 | .gpio27 = GPIO_LEVEL_HIGH, |
| 78 | .gpio28 = GPIO_LEVEL_LOW, |
| 79 | }; |
| 80 | |
| 81 | static const struct pch_gpio_set1 pch_gpio_set1_invert = { |
| 82 | .gpio13 = GPIO_INVERT, |
| 83 | }; |
| 84 | |
| 85 | static const struct pch_gpio_set1 pch_gpio_set1_blink = { |
| 86 | }; |
| 87 | |
| 88 | static const struct pch_gpio_set2 pch_gpio_set2_mode = { |
| 89 | .gpio33 = GPIO_MODE_GPIO, |
| 90 | .gpio34 = GPIO_MODE_GPIO, |
| 91 | .gpio35 = GPIO_MODE_GPIO, |
| 92 | .gpio36 = GPIO_MODE_GPIO, |
| 93 | .gpio37 = GPIO_MODE_GPIO, |
| 94 | .gpio38 = GPIO_MODE_GPIO, |
| 95 | .gpio39 = GPIO_MODE_GPIO, |
| 96 | }; |
| 97 | |
| 98 | static const struct pch_gpio_set2 pch_gpio_set2_direction = { |
| 99 | .gpio33 = GPIO_DIR_INPUT, |
| 100 | .gpio34 = GPIO_DIR_INPUT, |
| 101 | .gpio35 = GPIO_DIR_INPUT, |
| 102 | .gpio36 = GPIO_DIR_INPUT, |
| 103 | .gpio37 = GPIO_DIR_INPUT, |
| 104 | .gpio38 = GPIO_DIR_INPUT, |
| 105 | .gpio39 = GPIO_DIR_OUTPUT, |
| 106 | }; |
| 107 | |
| 108 | static const struct pch_gpio_set2 pch_gpio_set2_level = { |
| 109 | .gpio39 = GPIO_LEVEL_HIGH, |
| 110 | }; |
| 111 | |
| 112 | const struct pch_gpio_map mainboard_gpio_map = { |
| 113 | .set1 = { |
| 114 | .mode = &pch_gpio_set1_mode, |
| 115 | .direction = &pch_gpio_set1_direction, |
| 116 | .level = &pch_gpio_set1_level, |
| 117 | .blink = &pch_gpio_set1_blink, |
| 118 | .invert = &pch_gpio_set1_invert, |
| 119 | }, |
| 120 | .set2 = { |
| 121 | .mode = &pch_gpio_set2_mode, |
| 122 | .direction = &pch_gpio_set2_direction, |
| 123 | .level = &pch_gpio_set2_level, |
| 124 | }, |
| 125 | }; |