summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s5l8702/gpio-s5l8702.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/s5l8702/gpio-s5l8702.c')
-rw-r--r--firmware/target/arm/s5l8702/gpio-s5l8702.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8702/gpio-s5l8702.c b/firmware/target/arm/s5l8702/gpio-s5l8702.c
index bd87005ad8..85033de78c 100644
--- a/firmware/target/arm/s5l8702/gpio-s5l8702.c
+++ b/firmware/target/arm/s5l8702/gpio-s5l8702.c
@@ -214,3 +214,22 @@ void ICODE_ATTR INT_EXT6(void)
gpio_handler(0);
}
#endif
+
+#ifdef BOOTLOADER
+static uint32_t gpio_data[16] =
+{
+ 0x5322222F, 0xEEEEEE00, 0x2332EEEE, 0x3333E222,
+ 0x33333333, 0x33333333, 0x3F000E33, 0xEEEEEEEE,
+ 0xEEEEEEEE, 0xEEEEEEEE, 0xE0EEEEEE, 0xEE00EE0E,
+ 0xEEEE0EEE, 0xEEEEEEEE, 0xEE2222EE, 0xEEEE0EEE
+};
+
+void gpio_preinit(void)
+{
+ for (int i = 0; i < 16; i++) {
+ PCON(i) = gpio_data[i];
+ PUNB(i) = 0;
+ PUNC(i) = 0;
+ }
+}
+#endif