summaryrefslogtreecommitdiffstats
path: root/src/mainboard/google/guybrush/variants/dewatt/gpio.c
blob: 1d796c51e8bd4c979a541c392e9a42a775fb3b1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* SPDX-License-Identifier: GPL-2.0-or-later */

#include <baseboard/gpio.h>
#include <baseboard/variants.h>
#include <gpio.h>
#include <soc/gpio.h>
#include <baseboard/variants.h>

/* This table is used by guybrush variant */
static const struct soc_amd_gpio override_ramstage_gpio_table[] = {
	/* Unused TP247*/
	PAD_NC(GPIO_3),
	/* Unused TP218*/
	PAD_NC(GPIO_4),
	/* Unused TP245*/
	PAD_NC(GPIO_8),
	/* Unused TP244*/
	PAD_NC(GPIO_11),
	/* Unused TP194*/
	PAD_NC(GPIO_17),
	/* Unused TP195*/
	PAD_NC(GPIO_18),
	/* Unused TP243*/
	PAD_NC(GPIO_21),
	/* Unused TP196*/
	PAD_NC(GPIO_24),
	/* Unused TP219*/
	PAD_NC(GPIO_42),
	/* Unused TP217*/
	PAD_NC(GPIO_69),
	/* Unused TP235*/
	PAD_NC(GPIO_115),
	/* Unused TP205*/
	PAD_NC(GPIO_116),
	/* Unused TP226*/
	PAD_NC(GPIO_140),
	/* Unused TP225*/
	PAD_NC(GPIO_142),
	/* Unused TP227*/
	PAD_NC(GPIO_144),
	/* SOC_TCHPAD_INT_ODL */
	PAD_SCI(GPIO_9, PULL_NONE, LEVEL_LOW),
};

static const struct soc_amd_gpio override_early_gpio_table[] = {
	/* Unused TP245*/
	PAD_NC(GPIO_8),
	/* Unused TP195*/
	PAD_NC(GPIO_18),
	/* Unused TP196*/
	PAD_NC(GPIO_24),
	/* Unused TP217*/
	PAD_NC(GPIO_69),
};

/* This table is used by guybrush variant */
static const struct soc_amd_gpio override_pcie_gpio_table[] = {
	/* Unused TP195*/
	PAD_NC(GPIO_18),
	/* Unused TP217*/
	PAD_NC(GPIO_69),
};


static const struct soc_amd_gpio override_bootblock_gpio_table[] = {
	/* Unused TP196*/
	PAD_NC(GPIO_24),
};

const struct soc_amd_gpio *variant_override_gpio_table(size_t *size)
{
	*size = ARRAY_SIZE(override_ramstage_gpio_table);
	return override_ramstage_gpio_table;
}

const struct soc_amd_gpio *variant_early_override_gpio_table(size_t *size)
{
	*size = ARRAY_SIZE(override_early_gpio_table);
	return override_early_gpio_table;
}

const struct soc_amd_gpio *variant_pcie_override_gpio_table(size_t *size)
{
	*size = ARRAY_SIZE(override_pcie_gpio_table);
	return override_pcie_gpio_table;
}

const struct soc_amd_gpio *variant_bootblock_override_gpio_table(size_t *size)
{
	*size = ARRAY_SIZE(override_bootblock_gpio_table);
	return override_bootblock_gpio_table;
}