From 688955f887fb21127a1811377a2ad1e9825f4c77 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Fri, 25 Oct 2002 08:42:27 +0000 Subject: [PATCH] Added pxa250_bus_read_start(), pxa250_bus_read_next() and pxa250_bus_read_end(). git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@214 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/src/pxa250.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- jtag/src/pxa250.h | 3 +++ 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/jtag/src/pxa250.c b/jtag/src/pxa250.c index 88e55e3b..b54e6e93 100644 --- a/jtag/src/pxa250.c +++ b/jtag/src/pxa250.c @@ -66,11 +66,12 @@ setup_data( part *p, uint32_t d ) } } -uint32_t -pxa250_bus_read( parts *ps, uint32_t adr ) +void +pxa250_bus_read_start( parts *ps, uint32_t adr ) { part *p = ps->parts[0]; + /* see Figure 6-13 in PXA doc */ part_set_signal( p, "nCS[0]", 1, 0 ); part_set_signal( p, "DQM[0]", 1, 0 ); part_set_signal( p, "DQM[1]", 1, 0 ); @@ -85,6 +86,15 @@ pxa250_bus_read( parts *ps, uint32_t adr ) set_data_in( p ); parts_shift_data_registers( ps ); +} + +uint32_t +pxa250_bus_read_next( parts *ps, uint32_t adr ) +{ + part *p = ps->parts[0]; + + /* see Figure 6-13 in PXA doc */ + setup_address( p, adr ); parts_shift_data_registers( ps ); { @@ -101,6 +111,39 @@ pxa250_bus_read( parts *ps, uint32_t adr ) } } +uint32_t +pxa250_bus_read_end( parts *ps ) +{ + part *p = ps->parts[0]; + + /* see Figure 6-13 in PXA doc */ + part_set_signal( p, "nCS[0]", 1, 1 ); + part_set_signal( p, "nOE", 1, 1 ); + part_set_signal( p, "nSDCAS", 1, 1 ); + + parts_shift_data_registers( ps ); + + { + int i; + char buff[10]; + uint32_t d = 0; + + for (i = 0; i < 32; i++) { + sprintf( buff, "MD[%d]", i ); + d |= (uint32_t) (part_get_signal( p, buff ) << i); + } + + return d; + } +} + +uint32_t +pxa250_bus_read( parts *ps, uint32_t adr ) +{ + pxa250_bus_read_start( ps, adr ); + return pxa250_bus_read_end( ps ); +} + void pxa250_bus_write( parts *ps, uint32_t adr, uint32_t data ) { diff --git a/jtag/src/pxa250.h b/jtag/src/pxa250.h index 53d1348c..9a08dc9f 100644 --- a/jtag/src/pxa250.h +++ b/jtag/src/pxa250.h @@ -29,6 +29,9 @@ #include "part.h" +void pxa250_bus_read_start( parts *ps, uint32_t adr ); +uint32_t pxa250_bus_read_next( parts *ps, uint32_t adr ); +uint32_t pxa250_bus_read_end( parts *ps ); uint32_t pxa250_bus_read( parts *ps, uint32_t adr ); void pxa250_bus_write( parts *ps, uint32_t adr, uint32_t data );