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,