[coreboot-gerrit] New patch to review for coreboot: 1d57a3f baytrail: gpio: add configs for PU/PD functional pins
Aaron Durbin (adurbin@google.com)
gerrit at coreboot.org
Wed Feb 12 22:21:32 CET 2014
Aaron Durbin (adurbin at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5208
-gerrit
commit 1d57a3ff020e0645f2d4b9be51641232f741c8b8
Author: Aaron Durbin <adurbin at chromium.org>
Date: Wed Feb 12 15:19:23 2014 -0600
baytrail: gpio: add configs for PU/PD functional pins
Pull-ups and pull-downs can be active on functional pins. Add configs
for these options so they can be specified on board GPIO maps.
Change-Id: Ia0ee18fee324053caa7eecaf974e9a8e3150eb22
Signed-off-by: Aaron Durbin <adurbin at chromium.org>
---
src/soc/intel/baytrail/baytrail/gpio.h | 62 ++++++++++++++--------------------
1 file changed, 25 insertions(+), 37 deletions(-)
diff --git a/src/soc/intel/baytrail/baytrail/gpio.h b/src/soc/intel/baytrail/baytrail/gpio.h
index f62f5c8..a180ba7 100644
--- a/src/soc/intel/baytrail/baytrail/gpio.h
+++ b/src/soc/intel/baytrail/baytrail/gpio.h
@@ -187,47 +187,35 @@
.io_sel = GPIO_DIR_OUTPUT, \
.gp_lvl = GPIO_LEVEL_HIGH }
-#define GPIO_FUNC0 \
+/* Define no-pull / PU / PD configs for each functional config option */
+#define _GPIO_FUNC(_func, _pu, _str) \
{ .use_sel = GPIO_USE_PAD, \
- .pad_conf0 = PAD_FUNC0 | PAD_CONFIG0_DEFAULT, \
+ .pad_conf0 = PAD_FUNC##_func | PAD_PU_##_pu | PAD_PU_##_str | \
+ PAD_CONFIG0_DEFAULT, \
.pad_conf1 = PAD_CONFIG1_DEFAULT, \
.pad_val = PAD_VAL_DEFAULT }
-#define GPIO_FUNC1 \
- { .use_sel = GPIO_USE_PAD, \
- .pad_conf0 = PAD_FUNC1 | PAD_CONFIG0_DEFAULT, \
- .pad_conf1 = PAD_CONFIG1_DEFAULT, \
- .pad_val = PAD_VAL_DEFAULT }
-
-#define GPIO_FUNC2 \
- { .use_sel = GPIO_USE_PAD, \
- .pad_conf0 = PAD_FUNC2 | PAD_CONFIG0_DEFAULT, \
- .pad_conf1 = PAD_CONFIG1_DEFAULT, \
- .pad_val = PAD_VAL_DEFAULT }
-
-#define GPIO_FUNC3 \
- { .use_sel = GPIO_USE_PAD, \
- .pad_conf0 = PAD_FUNC3 | PAD_CONFIG0_DEFAULT, \
- .pad_conf1 = PAD_CONFIG1_DEFAULT, \
- .pad_val = PAD_VAL_DEFAULT }
-
-#define GPIO_FUNC4 \
- { .use_sel = GPIO_USE_PAD, \
- .pad_conf0 = PAD_FUNC4 | PAD_CONFIG0_DEFAULT, \
- .pad_conf1 = PAD_CONFIG1_DEFAULT, \
- .pad_val = PAD_VAL_DEFAULT }
-
-#define GPIO_FUNC5 \
- { .use_sel = GPIO_USE_PAD, \
- .pad_conf0 = PAD_FUNC5 | PAD_CONFIG0_DEFAULT, \
- .pad_conf1 = PAD_CONFIG1_DEFAULT, \
- .pad_val = PAD_VAL_DEFAULT }
-
-#define GPIO_FUNC6 \
- { .use_sel = GPIO_USE_PAD, \
- .pad_conf0 = PAD_FUNC6 | PAD_CONFIG0_DEFAULT, \
- .pad_conf1 = PAD_CONFIG1_DEFAULT, \
- .pad_val = PAD_VAL_DEFAULT }
+#define GPIO_FUNC0 _GPIO_FUNC(0, DISABLE, 10K)
+#define GPIO_FUNC0_PU_10K _GPIO_FUNC(0, UP, 10K)
+#define GPIO_FUNC0_PD_10K _GPIO_FUNC(0, DOWN, 10K)
+#define GPIO_FUNC1 _GPIO_FUNC(1, DISABLE, 10K)
+#define GPIO_FUNC1_PU_10K _GPIO_FUNC(1, UP, 10K)
+#define GPIO_FUNC1_PD_10K _GPIO_FUNC(1, DOWN, 10K)
+#define GPIO_FUNC2 _GPIO_FUNC(2, DISABLE, 10K)
+#define GPIO_FUNC2_PU_10K _GPIO_FUNC(2, UP, 10K)
+#define GPIO_FUNC2_PD_10K _GPIO_FUNC(2, DOWN, 10K)
+#define GPIO_FUNC3 _GPIO_FUNC(3, DISABLE, 10K)
+#define GPIO_FUNC3_PU_10K _GPIO_FUNC(3, UP, 10K)
+#define GPIO_FUNC3_PD_10K _GPIO_FUNC(3, DOWN, 10K)
+#define GPIO_FUNC4 _GPIO_FUNC(4, DISABLE, 10K)
+#define GPIO_FUNC4_PU_10K _GPIO_FUNC(4, UP, 10K)
+#define GPIO_FUNC4_PD_10K _GPIO_FUNC(4, DOWN, 10K)
+#define GPIO_FUNC5 _GPIO_FUNC(5, DISABLE, 10K)
+#define GPIO_FUNC5_PU_10K _GPIO_FUNC(5, UP, 10K)
+#define GPIO_FUNC5_PD_10K _GPIO_FUNC(5, DOWN, 10K)
+#define GPIO_FUNC6 _GPIO_FUNC(6, DISABLE, 10K)
+#define GPIO_FUNC6_PU_10K _GPIO_FUNC(6, UP, 10K)
+#define GPIO_FUNC6_PD_10K _GPIO_FUNC(6, DOWN, 10K)
/* End marker */
#define GPIO_LIST_END 0xffffffff
More information about the coreboot-gerrit
mailing list