From 1d35bbd545ba587964e45c80b0e89b7af4b9d974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Tue, 15 Jan 2008 20:58:06 +0000 Subject: [PATCH] parameter 'amode' added git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@919 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 4 ++++ jtag/src/bus/prototype.c | 24 ++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 164e894f..26890236 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,7 @@ +2008-01-15 Arnim Laeuger + + * src/bus/prototype.c (prototype_bus_new): parameter amode added + 2008-01-11 Arnim Laeuger * src/bus/prototype.c: added diff --git a/jtag/src/bus/prototype.c b/jtag/src/bus/prototype.c index 3d81e2cd..1c1d9091 100644 --- a/jtag/src/bus/prototype.c +++ b/jtag/src/bus/prototype.c @@ -280,9 +280,23 @@ prototype_bus_new( char *cmd_params[] ) CS = OE = WE = NULL; ALSBI = AMSBI = DLSBI = DMSBI = -1; + N_BYTES = 0; for ( i = 2; cmd_params[i]; i++ ) { if (!strstr( cmd_params[i], "=")) continue; sscanf( cmd_params[i], "%[^=]%*c%s", param, value ); + + if (!strcmp( "amode", param )) { + if (!strcmp( "x8", value )) + N_BYTES = 1; + else if (!strcmp( "x16", value )) + N_BYTES = 2; + else if (!strcmp( "x32", value )) + N_BYTES = 4; + else if (strcmp( "auto", value )) + printf( _("value %s not defined for parameter %s\n"), value, param ); + continue; + } + prototype_bus_signal_parse( value, fmt, &inst ); if( inst > 31 ) continue; @@ -375,9 +389,11 @@ prototype_bus_new( char *cmd_params[] ) /* bus drivers are called with a byte address this address needs to be adjusted by setup_address() to the memory data width */ - N_BYTES = DW / 8; - if ( DW % 8 > 0 ) - N_BYTES++; + if (N_BYTES == 0) { + N_BYTES = DW / 8; + if ( DW % 8 > 0 ) + N_BYTES++; + } } else { printf( _("parameters dlsb= and/or dmsb= are not defined\n") ); failed = 1; @@ -412,7 +428,7 @@ const bus_driver_t prototype_bus = { "prototype", N_("Configurable prototype bus driver via BSR, requires parameters:\n" " amsb= alsb= dmsb= dlsb=\n" - " ncs=|cs= noe=|oe= nwe=|we="), + " ncs=|cs= noe=|oe= nwe=|we= [amode=auto|x8|x16|x32]"), prototype_bus_new, prototype_bus_free, prototype_bus_printinfo,