From 6dc2c2ce970863a079f101d84a0c47b37b682c76 Mon Sep 17 00:00:00 2001 From: zwelch Date: Tue, 9 Jun 2009 08:40:31 +0000 Subject: Encapsulate jtag_reset_config using accessors: - Update handle_reset_config_command in tcl.c to use new helpers. - Replace direct accesses in JTAG interface and target drivers. git-svn-id: svn://svn.berlios.de/openocd/trunk@2161 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/jtag/ft2232.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/jtag/ft2232.c') diff --git a/src/jtag/ft2232.c b/src/jtag/ft2232.c index 734833b1..4bc2f3fe 100644 --- a/src/jtag/ft2232.c +++ b/src/jtag/ft2232.c @@ -1193,6 +1193,7 @@ static int ft2232_predict_scan_in(int scan_size, enum scan_type type) static void usbjtag_reset(int trst, int srst) { + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (trst == 1) { if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) @@ -1232,6 +1233,7 @@ static void usbjtag_reset(int trst, int srst) static void jtagkey_reset(int trst, int srst) { + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (trst == 1) { if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) @@ -1273,6 +1275,7 @@ static void jtagkey_reset(int trst, int srst) static void olimex_jtag_reset(int trst, int srst) { + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (trst == 1) { if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) @@ -2155,6 +2158,7 @@ static int usbjtag_init(void) return ERROR_JTAG_INIT_FAILED; } + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) { low_direction &= ~nTRSTnOE; /* nTRST input */ @@ -2229,6 +2233,7 @@ static int axm0432_jtag_init(void) high_output = 0x0; high_direction = 0x0c; + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) { LOG_ERROR("can't set nTRSTOE to push-pull on the Dicarlo jtag"); @@ -2307,6 +2312,7 @@ static int jtagkey_init(void) high_output = 0x0; high_direction = 0x0f; + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) { high_output |= nTRSTnOE; @@ -2373,6 +2379,7 @@ static int olimex_jtag_init(void) high_output = 0x0; high_direction = 0x0f; + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) { high_output |= nTRSTnOE; @@ -2944,6 +2951,7 @@ static int icebear_jtag_init(void) { nTRST = 0x10; nSRST = 0x20; + enum reset_types jtag_reset_config = jtag_get_reset_config(); if ((jtag_reset_config & RESET_TRST_OPEN_DRAIN) != 0) { low_direction &= ~nTRST; /* nTRST high impedance */ } @@ -2991,6 +2999,7 @@ static void icebear_jtag_reset(int trst, int srst) { low_output &= ~nTRST; } else if (trst == 0) { + enum reset_types jtag_reset_config = jtag_get_reset_config(); if ((jtag_reset_config & RESET_TRST_OPEN_DRAIN) != 0) low_direction &= ~nTRST; else -- cgit v1.2.3