---
 src/jtag/at91rm9200.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

Index: b/src/jtag/at91rm9200.c
===================================================================
--- a/src/jtag/at91rm9200.c
+++ b/src/jtag/at91rm9200.c
@@ -177,14 +177,14 @@ void at91rm9200_write(int tck, int tms, 
 void at91rm9200_reset(int trst, int srst)
 {
 	if (trst == 0)
-		pio_base[device->TRST_PIO + PIO_SODR] = device->TRST_MASK;
-	else if (trst == 1)
 		pio_base[device->TRST_PIO + PIO_CODR] = device->TRST_MASK;
+	else if (trst == 1)
+		pio_base[device->TRST_PIO + PIO_SODR] = device->TRST_MASK;
 
 	if (srst == 0)
-		pio_base[device->SRST_PIO + PIO_SODR] = device->SRST_MASK;
-	else if (srst == 1)
 		pio_base[device->SRST_PIO + PIO_CODR] = device->SRST_MASK;
+	else if (srst == 1)
+		pio_base[device->SRST_PIO + PIO_SODR] = device->SRST_MASK;
 }
 
 int at91rm9200_speed(int speed)
@@ -263,7 +263,7 @@ int at91rm9200_init(void)
 
 	/*
 	 * Configure TDO as an input, and TDI, TCK, TMS, TRST, SRST
-	 * as outputs.  Drive TDI and TCK low, and TMS/TRST/SRST high.
+	 * as outputs.  Drive TDI/TCK/TRST/SRST low, and TMS high.
 	 */
 	pio_base[device->TDI_PIO + PIO_CODR] = device->TDI_MASK;
 	pio_base[device->TDI_PIO + PIO_OER] = device->TDI_MASK;
@@ -274,10 +274,10 @@ int at91rm9200_init(void)
 	pio_base[device->TMS_PIO + PIO_SODR] = device->TMS_MASK;
 	pio_base[device->TMS_PIO + PIO_OER] = device->TMS_MASK;
 	pio_base[device->TMS_PIO + PIO_PER] = device->TMS_MASK;
-	pio_base[device->TRST_PIO + PIO_SODR] = device->TRST_MASK;
+	pio_base[device->TRST_PIO + PIO_CODR] = device->TRST_MASK;
 	pio_base[device->TRST_PIO + PIO_OER] = device->TRST_MASK;
 	pio_base[device->TRST_PIO + PIO_PER] = device->TRST_MASK;
-	pio_base[device->SRST_PIO + PIO_SODR] = device->SRST_MASK;
+	pio_base[device->SRST_PIO + PIO_CODR] = device->SRST_MASK;
 	pio_base[device->SRST_PIO + PIO_OER] = device->SRST_MASK;
 	pio_base[device->SRST_PIO + PIO_PER] = device->SRST_MASK;
 	pio_base[device->TDO_PIO + PIO_ODR] = device->TDO_MASK;

