2003-05-15 Marcel Telka <marcel@telka.sk>

* configure.ac (CPPFLAGS): Added path to the openwince include arm directory.
	* include/bus.h (bus_width): Added new `adr' parameter for this macro.
	All relevant functions and callers updated.

	* src/bus/pxa2x0.c (bus_params_t): Added last_adr and MC_registers structure members.
	(LAST_ADR, MC_pointer): New macros.
	(pxa250_bus_read_start, pxa250_bus_read_next, pxa250_bus_read_end, pxa250_bus_write): Disabled
		external bus cycles for addresses above 0x0400000.
	(pxa250_bus_width): Removed some output messages. Implemented BOOT_DEF emulation.
	(new_pxa250_bus): Implemented BOOT_DEF emulation.


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@428 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Marcel Telka 22 years ago
parent 246966636e
commit d5b5b52ff3

@ -1,3 +1,16 @@
2003-05-15 Marcel Telka <marcel@telka.sk>
* configure.ac (CPPFLAGS): Added path to the openwince include arm directory.
* include/bus.h (bus_width): Added new `adr' parameter for this macro.
All relevant functions and callers updated.
* src/bus/pxa2x0.c (bus_params_t): Added last_adr and MC_registers structure members.
(LAST_ADR, MC_pointer): New macros.
(pxa250_bus_read_start, pxa250_bus_read_next, pxa250_bus_read_end, pxa250_bus_write): Disabled
external bus cycles for addresses above 0x0400000.
(pxa250_bus_width): Removed some output messages. Implemented BOOT_DEF emulation.
(new_pxa250_bus): Implemented BOOT_DEF emulation.
2003-05-14 Marcel Telka <marcel@telka.sk>
* include/Makefile.am (noinst_HEADERS): Added cfi.h.

@ -2,6 +2,7 @@ $Id$
* Added new manufacturer: DEC.
* Added support for executing scripts directly from stdin (parameter '-').
* Disabled external bus cycles for PXA250 for addresses above 0x04000000.
jtag-0.3.2 (2003-04-04):

@ -73,7 +73,7 @@ AC_CACHE_CHECK([for the openwince includes], openwince_includes_path, [
if test "$openwince_includes_path" = "no"; then
AC_MSG_ERROR([The openwince include package not found.])
fi
CPPFLAGS="$CPPFLAGS -I$openwince_includes_path -I$openwince_includes_path/device"
CPPFLAGS="$CPPFLAGS -I$openwince_includes_path -I$openwince_includes_path/device -I$openwince_includes_path/arm"
AC_SEARCH_LIBS([ioperm], [ioperm])
if test "$ac_cv_search_ioperm" != "no"; then

@ -34,7 +34,7 @@ typedef struct bus bus_t;
struct bus {
void *params;
void (*prepare)( bus_t *bus );
int (*width)( bus_t *bus );
int (*width)( bus_t *bus, uint32_t adr );
void (*read_start)( bus_t *bus, uint32_t adr );
uint32_t (*read_next)( bus_t *bus, uint32_t adr );
uint32_t (*read_end)( bus_t *bus );
@ -44,7 +44,7 @@ struct bus {
};
#define bus_prepare(bus) bus->prepare(bus)
#define bus_width(bus) bus->width(bus)
#define bus_width(bus,adr) bus->width(bus,adr)
#define bus_read_start(bus,adr) bus->read_start(bus,adr)
#define bus_read_next(bus,adr) bus->read_next(bus,adr)
#define bus_read_end(bus) bus->read_end(bus)

@ -201,7 +201,7 @@ ixp425_bus_write( bus_t *bus, uint32_t adr, uint32_t data )
}
static int
ixp425_bus_width( bus_t *bus )
ixp425_bus_width( bus_t *bus, uint32_t adr )
{
return 16;
}

@ -30,16 +30,23 @@
#include <stdint.h>
#include <string.h>
#include <pxa2x0/mc.h>
#include "part.h"
#include "bus.h"
typedef struct {
chain_t *chain;
part_t *part;
uint32_t last_adr;
MC_registers_t MC_registers;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define LAST_ADR ((bus_params_t *) bus->params)->last_adr
#define MC_pointer (&((bus_params_t *) bus->params)->MC_registers)
static void
setup_address( part_t *p, uint32_t a )
@ -90,6 +97,10 @@ pxa250_bus_read_start( bus_t *bus, uint32_t adr )
chain_t *chain = CHAIN;
part_t *p = PART;
LAST_ADR = adr;
if (adr >= 0x04000000)
return;
/* see Figure 6-13 in [1] */
part_set_signal( p, "nCS[0]", 1, 0 );
part_set_signal( p, "DQM[0]", 1, 0 );
@ -107,12 +118,20 @@ pxa250_bus_read_start( bus_t *bus, uint32_t adr )
chain_shift_data_registers( chain );
}
static uint32_t pxa250_bus_read_end( bus_t *bus );
static uint32_t
pxa250_bus_read_next( bus_t *bus, uint32_t adr )
{
part_t *p = PART;
chain_t *chain = CHAIN;
if (LAST_ADR >= 0x04000000)
pxa250_bus_read_start( bus, adr );
if (adr >= 0x04000000)
return pxa250_bus_read_end( bus );
LAST_ADR = adr;
/* see Figure 6-13 in [1] */
setup_address( p, adr );
chain_shift_data_registers( chain );
@ -137,6 +156,9 @@ pxa250_bus_read_end( bus_t *bus )
part_t *p = PART;
chain_t *chain = CHAIN;
if (LAST_ADR >= 0x04000000)
return 0;
/* see Figure 6-13 in [1] */
part_set_signal( p, "nCS[0]", 1, 1 );
part_set_signal( p, "nOE", 1, 1 );
@ -172,6 +194,9 @@ pxa250_bus_write( bus_t *bus, uint32_t adr, uint32_t data )
part_t *p = PART;
chain_t *chain = CHAIN;
if (adr >= 0x04000000)
return;
part_set_signal( p, "nCS[0]", 1, 0 );
part_set_signal( p, "DQM[0]", 1, 0 );
part_set_signal( p, "DQM[1]", 1, 0 );
@ -194,20 +219,16 @@ pxa250_bus_write( bus_t *bus, uint32_t adr, uint32_t data )
}
static int
pxa250_bus_width( bus_t *bus )
pxa250_bus_width( bus_t *bus, uint32_t adr )
{
part_t *p = PART;
uint8_t boot_sel = (part_get_signal( p, "BOOT_SEL[2]" ) << 2)
| (part_get_signal( p, "BOOT_SEL[1]" ) << 1)
| part_get_signal( p, "BOOT_SEL[0]" );
if (adr >= 0x04000000)
return 32;
/* see Table 6-36. in [1] */
switch (boot_sel) {
switch (get_BOOT_DEF_BOOT_SEL(BOOT_DEF)) {
case 0:
printf( "BOOT_SEL: Asynchronous 32-bit ROM\n" );
return 32;
case 1:
printf( "BOOT_SEL: Asynchronous 16-bit ROM\n" );
return 16;
case 2:
case 3:
@ -215,7 +236,7 @@ pxa250_bus_width( bus_t *bus )
case 5:
case 6:
case 7:
printf( "TODO - BOOT_SEL: %d\n", boot_sel );
printf( "TODO - BOOT_SEL: %d\n", get_BOOT_DEF_BOOT_SEL(BOOT_DEF) );
return 0;
default:
printf( "BUG in code, file %s, line %d.\n", __FILE__, __LINE__ );
@ -256,7 +277,7 @@ new_pxa250_bus( chain_t *chain, int pn )
memcpy( bus, &pxa250_bus, sizeof (bus_t) );
bus->params = malloc( sizeof (bus_params_t) );
bus->params = calloc( 1, sizeof (bus_params_t) );
if (!bus->params) {
free( bus );
return NULL;
@ -265,5 +286,9 @@ new_pxa250_bus( chain_t *chain, int pn )
CHAIN = chain;
PART = chain->parts->parts[pn];
BOOT_DEF = BOOT_DEF_PKG_TYPE | BOOT_DEF_BOOT_SEL(part_get_signal( PART, "BOOT_SEL[2]" ) << 2
| part_get_signal( PART, "BOOT_SEL[1]" ) << 1
| part_get_signal( PART, "BOOT_SEL[0]" ));
return bus;
}

@ -204,7 +204,7 @@ sa1110_bus_write( bus_t *bus, uint32_t adr, uint32_t data )
}
static int
sa1110_bus_width( bus_t *bus )
sa1110_bus_width( bus_t *bus, uint32_t adr )
{
if (part_get_signal( PART, "ROM_SEL" )) {
printf( "ROM_SEL: 32 bits\n" );

@ -86,7 +86,7 @@ flashcheck( bus_t *bus, cfi_query_structure_t **cfi )
printf( "Note: Supported configuration is 2 x 16 bit or 1 x 16 bit only\n" );
switch (bus_width( bus )) {
switch (bus_width( bus, 0 )) {
case 16:
o = 1;
break;

@ -36,7 +36,7 @@
#include "bus.h"
/* function to cover 2x16 and 1x16 modes */
#define BW16(x) ( (bus_width(bus) == 16) ? x : ( (x<<16) | x ) )
#define BW16(x) ( (bus_width(bus, 0) == 16) ? x : ( (x<<16) | x ) )
static uint16_t
read2( bus_t *bus, uint32_t adr, int o )
@ -55,7 +55,7 @@ detect_cfi( bus_t *bus )
int o = 2;
uint32_t tmp;
if (bus_width( bus ) == 16)
if (bus_width( bus, 0 ) == 16)
o = 1;
/* detect CFI capable devices - see Table 1 in [1] */

@ -54,13 +54,13 @@ static int intel_flash_program32( bus_t *bus, uint32_t adr, uint32_t data );
static int
intel_flash_autodetect32( bus_t *bus, cfi_query_structure_t *cfi )
{
return (cfi->identification_string.pri_id_code == CFI_VENDOR_INTEL_ECS) && (bus_width( bus ) == 32);
return (cfi->identification_string.pri_id_code == CFI_VENDOR_INTEL_ECS) && (bus_width( bus, 0 ) == 32);
}
static int
intel_flash_autodetect( bus_t *bus, cfi_query_structure_t *cfi )
{
return (cfi->identification_string.pri_id_code == CFI_VENDOR_INTEL_ECS) && (bus_width( bus ) == 16);
return (cfi->identification_string.pri_id_code == CFI_VENDOR_INTEL_ECS) && (bus_width( bus, 0 ) == 16);
}
static void

@ -60,7 +60,7 @@ detectflash( bus_t *bus )
printf( "Note: Supported configuration is 2 x 16 bit or 1 x 16 bit only\n" );
switch (bus_width( bus )) {
switch (bus_width( bus, 0 )) {
case 16:
o = 1;
break;
@ -223,7 +223,7 @@ readmem( bus_t *bus, FILE *f, uint32_t addr, uint32_t len )
bus_prepare( bus );
step = bus_width( bus ) / 8;
step = bus_width( bus, 0 ) / 8;
if (step == 0) {
printf( "Unknown bus width!\n" );

Loading…
Cancel
Save