summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-29 13:24:58 -0700
committerGerrit <chrome-bot@google.com>2012-10-30 12:42:46 -0700
commite82b68bcb9ae585041f7c9316ed46f58e55c3cfb (patch)
tree3337f72912eb4a792f6d8b410c533c3be2dd6856
parentf76cb374f856b71e7db4fd6a123a0add49e7d512 (diff)
downloadchrome-ec-e82b68bcb9ae585041f7c9316ed46f58e55c3cfb.tar.gz
Clean up jtag module
No functional changes BUG=chrome-os-partner:15579 BRANCH=none TEST=boot system; use gdb to connect to EC Change-Id: I2817d04e4de102e4201506cfe51cdf0bd939fcdb Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36802 Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--chip/lm4/jtag.c13
-rw-r--r--chip/stm32/jtag-stm32f100.c4
-rw-r--r--chip/stm32/jtag-stm32l15x.c4
-rw-r--r--include/jtag.h6
4 files changed, 12 insertions, 15 deletions
diff --git a/chip/lm4/jtag.c b/chip/lm4/jtag.c
index 22c9080917..bfa9b1e7de 100644
--- a/chip/lm4/jtag.c
+++ b/chip/lm4/jtag.c
@@ -6,20 +6,21 @@
#include "jtag.h"
#include "registers.h"
-
-int jtag_pre_init(void)
+void jtag_pre_init(void)
{
/* Enable clocks to GPIO block C */
LM4_SYSTEM_RCGCGPIO |= 0x0004;
- /* Ensure PC0:3 are set to JTAG function. They should be set this way
+ /*
+ * Ensure PC0:3 are set to JTAG function. They should be set this way
* on a cold boot, but on a warm reboot a previous misbehaving image
- * could have set them differently. */
+ * could have set them differently.
+ */
if (((LM4_GPIO_PCTL(LM4_GPIO_C) & 0x0000ffff) == 0x00001111) &&
((LM4_GPIO_AFSEL(LM4_GPIO_C) & 0x0f) == 0x0f) &&
((LM4_GPIO_DEN(LM4_GPIO_C) & 0x0f) == 0x0f) &&
((LM4_GPIO_PUR(LM4_GPIO_C) & 0x0f) == 0x0f))
- return EC_SUCCESS; /* Already properly configured */
+ return; /* Already properly configured */
/* Unlock commit register for JTAG pins */
LM4_GPIO_LOCK(LM4_GPIO_C) = LM4_GPIO_LOCK_UNLOCK;
@@ -35,6 +36,4 @@ int jtag_pre_init(void)
/* Re-lock commit register */
LM4_GPIO_CR(LM4_GPIO_C) &= ~0x0f;
LM4_GPIO_LOCK(LM4_GPIO_C) = 0;
-
- return EC_SUCCESS;
}
diff --git a/chip/stm32/jtag-stm32f100.c b/chip/stm32/jtag-stm32f100.c
index 17b4e08ff1..9d55fdb906 100644
--- a/chip/stm32/jtag-stm32f100.c
+++ b/chip/stm32/jtag-stm32f100.c
@@ -7,10 +7,8 @@
#include "jtag.h"
#include "registers.h"
-int jtag_pre_init(void)
+void jtag_pre_init(void)
{
/* stop TIM1-4 and watchdogs when the JTAG stops the CPU */
STM32_DBGMCU_CR |= 0x00003f00;
-
- return EC_SUCCESS;
}
diff --git a/chip/stm32/jtag-stm32l15x.c b/chip/stm32/jtag-stm32l15x.c
index 7b65400b1c..71e5f711e2 100644
--- a/chip/stm32/jtag-stm32l15x.c
+++ b/chip/stm32/jtag-stm32l15x.c
@@ -7,10 +7,8 @@
#include "jtag.h"
#include "registers.h"
-int jtag_pre_init(void)
+void jtag_pre_init(void)
{
/* stop TIM2-4 and watchdogs when the JTAG stops the CPU */
STM32_DBGMCU_APB1FZ |= 0x00001807;
-
- return EC_SUCCESS;
}
diff --git a/include/jtag.h b/include/jtag.h
index 6dd83a92bf..690158b4ec 100644
--- a/include/jtag.h
+++ b/include/jtag.h
@@ -10,7 +10,9 @@
#include "common.h"
-/* Pre-initializes the module. */
-int jtag_pre_init(void);
+/**
+ * Pre-initialize the JTAG module.
+ */
+void jtag_pre_init(void);
#endif /* __CROS_EC_JTAG_H */