/** * bus->driver->(*area) * */ static int s3c4510_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) { int b0size0, b0size1; // , endian; area->description = NULL; area->start = UINT32_C(0x00000000); area->length = UINT64_C(0x100000000); // endian = part_get_signal( PART, part_find_signal( PART, "LITTLE" )); b0size0 = part_get_signal( PART, part_find_signal( PART, "B0SIZE0" )); b0size1 = part_get_signal( PART, part_find_signal( PART, "B0SIZE1" )); switch ((b0size1 << 1) | b0size0) { case 1: area->width = dbus_width = 8; return URJTAG_STATUS_OK; case 2: area->width = dbus_width = 16; return URJTAG_STATUS_OK; case 3: area->width = dbus_width = 32; return URJTAG_STATUS_OK; default: printf( "B0SIZE[1:0]: Unknown\n" ); area->width = 0; return URJTAG_STATUS_FAIL; } }
/** * bus->driver->(*area) * */ static int sh7727_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) { part_t *p = PART; area->description = NULL; area->start = UINT32_C(0x00000000); area->length = UINT64_C(0x100000000); switch (part_get_signal( p, MD4 ) << 1 | part_get_signal( p, MD3 )) { case 1: area->width = 8; return URJTAG_STATUS_OK; case 2: area->width = 16; return URJTAG_STATUS_OK; case 3: area->width = 32; return URJTAG_STATUS_OK; default: printf( _("Error: Invalid bus width (MD3 = MD4 = 0)!\n") ); area->width = 0; return URJTAG_STATUS_FAIL; } }
/** * bus->driver->(*read_end) * */ static uint32_t sh7727_bus_read_end( bus_t *bus ) { part_t *p = PART; int i; uint32_t d = 0; bus_area_t area; sh7727_bus_area( bus, 0, &area ); part_set_signal( p, CS[0], 1, 1 ); part_set_signal( p, CS[2], 1, 1 ); part_set_signal( p, CS[3], 1, 1 ); part_set_signal( p, CS[4], 1, 1 ); part_set_signal( p, CS[5], 1, 1 ); part_set_signal( p, CS[6], 1, 1 ); part_set_signal( p, RD, 1, 1 ); chain_shift_data_registers( CHAIN, 1 ); for (i = 0; i < area.width; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); return d; }
/** * bus->driver->(*read_end) * */ static uint32_t sh7750r_bus_read_end( bus_t *bus ) { part_t *p = PART; int cs[8]; int i; uint32_t d = 0; for (i = 0; i < 8; i++) cs[i] = 1; part_set_signal( p, CS[0], 1, cs[0] ); part_set_signal( p, CS[1], 1, cs[1] ); part_set_signal( p, CS[2], 1, cs[2] ); part_set_signal( p, CS[3], 1, cs[3] ); part_set_signal( p, CS[4], 1, cs[4] ); part_set_signal( p, CS[5], 1, cs[5] ); part_set_signal( p, CS[6], 1, cs[6] ); part_set_signal( p, RD, 1, 1 ); part_set_signal( p, RD2, 1, 1 ); chain_shift_data_registers( CHAIN, 1 ); for (i = 0; i < 32; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); return d; }
/** * bus->driver->(*read_end) * */ static uint32_t jopcyc_bus_read_end( bus_t *bus ) { part_t *p = PART; chain_t *chain = CHAIN; int i; uint32_t d = 0; bus_area_t area; component_t *comp; /* use last address of access to determine component */ comp_bus_area( bus, LAST_ADDR, &area, &comp ); if (!comp) { printf( _("Address out of range\n") ); return 0; } part_set_signal( p, nCS, 1, 1 ); part_set_signal( p, nOE, 1, 1 ); if (comp->ctype == RAM) { part_set_signal( p, nLB, 1, 1 ); part_set_signal( p, nUB, 1, 1 ); } chain_shift_data_registers( chain, 1 ); for (i = 0; i < area.width; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); return d; }
/** * bus->driver->(*read_next) * */ static uint32_t sharc_21065L_bus_read_next( bus_t *bus, uint32_t adr ) { part_t *p = PART; chain_t *chain = CHAIN; uint32_t d; //uint32_t old_last_adr = LAST_ADR; LAST_ADR = adr; if (adr < UINT32_C(0x080000)) { int i; bus_area_t area; sharc_21065L_bus_area( bus, adr, &area ); setup_address( bus, adr ); chain_shift_data_registers( chain, 1 ); d = 0; for (i = 0; i < area.width; i++) d |= (uint32_t) (part_get_signal( p, MD[i] ) << i); return d; } return 0; }
/** * bus->driver->(*read_next) * */ static uint32_t jopcyc_bus_read_next( bus_t *bus, uint32_t adr ) { part_t *p = PART; chain_t *chain = CHAIN; int i; uint32_t d = 0; bus_area_t area; component_t *comp; comp_bus_area( bus, adr, &area, &comp ); if (!comp) { printf( _("Address out of range\n") ); LAST_ADDR = adr; return 0; } setup_address( bus, adr, comp ); chain_shift_data_registers( chain, 1 ); for (i = 0; i < area.width; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); return d; }
/** * bus->driver->(*read_end) * */ static uint32_t sharc_21065L_bus_read_end( bus_t *bus ) { part_t *p = PART; chain_t *chain = CHAIN; if (LAST_ADR < UINT32_C(0x080000)) { int i; uint32_t d = 0; bus_area_t area; sharc_21065L_bus_area( bus, LAST_ADR, &area ); part_set_signal( p, BMS, 1, 1 ); part_set_signal( p, nWE, 1, 1 ); part_set_signal( p, nOE, 1, 1 ); chain_shift_data_registers( chain, 1 ); for (i = 0; i < area.width; i++) d |= (uint32_t) (part_get_signal( p, MD[i] ) << i); return d; } return 0; }
static uint32_t s3c4510_bus_read_end( bus_t *bus ) { /* see Figure 4-19 in [1] */ part_t *p = PART; chain_t *chain = CHAIN; int i; uint32_t d = 0; part_set_signal( p, nRCS[0], 1, 1 ); part_set_signal( p, nRCS[1], 1, 1 ); part_set_signal( p, nRCS[2], 1, 1 ); part_set_signal( p, nRCS[3], 1, 1 ); part_set_signal( p, nRCS[4], 1, 1 ); part_set_signal( p, nRCS[5], 1, 1 ); part_set_signal( p, nWBE[0], 1, 1 ); part_set_signal( p, nWBE[1], 1, 1 ); part_set_signal( p, nWBE[2], 1, 1 ); part_set_signal( p, nWBE[3], 1, 1 ); part_set_signal( p, nOE, 1, 1 ); chain_shift_data_registers( chain, 1 ); for (i = 0; i < dbus_width; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); return d; }
int sa1110_bus_width( parts *ps ) { if (part_get_signal( ps->parts[0], "ROM_SEL" )) { printf( "ROM_SEL: 32 bits\n" ); return 32; } else { printf( "ROM_SEL: 16 bits\n" ); return 16; } }
/** * bus->driver->(*read_next) * */ static uint32_t sh7750r_bus_read_next( bus_t *bus, uint32_t adr ) { part_t *p = PART; int i; uint32_t d = 0; setup_address( bus, adr ); chain_shift_data_registers( CHAIN, 1 ); for (i = 0; i < 32; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); return d; }
/** * bus->driver->(*read_next) * */ static uint32_t bf533_ezkit_bus_read_next( bus_t *bus, uint32_t adr ) { part_t *p = PART; chain_t *chain = CHAIN; int i; uint32_t d = 0; setup_address( bus, adr ); chain_shift_data_registers( chain, 1 ); for (i = 0; i < 16; i++) d |= (uint32_t) (part_get_signal( p, DATA[i] ) << i); return d; }
static uint32_t s3c4510_bus_read_next( bus_t *bus, uint32_t adr ) { /* see Figure 4-20 in [1] */ part_t *p = PART; chain_t *chain = CHAIN; int i; uint32_t d = 0; setup_address( bus, adr ); chain_shift_data_registers( chain, 1 ); for (i = 0; i < dbus_width; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); return d; }
/** * bus->driver->(*read_end) * */ static uint32_t s3c4510_bus_read_end( bus_t *bus ) { /* see Figure 4-19 in [1] */ part_t *p = PART; chain_t *chain = CHAIN; int i; uint32_t d = 0; s3c4510_bus_setup_ctrl( bus, 0x01ffff); /* nOE=1, nRCS0 =1 */ chain_shift_data_registers( chain, 1 ); for (i = 0; i < dbus_width; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); return d; }
/** * bus->driver->(*read_next) * */ static uint32_t sh7727_bus_read_next( bus_t *bus, uint32_t adr ) { part_t *p = PART; int i; uint32_t d = 0; bus_area_t area; sh7727_bus_area( bus, 0, &area ); setup_address( bus, adr ); chain_shift_data_registers( CHAIN, 1 ); for (i = 0; i < area.width; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); return d; }
/** * bus->driver->(*read_end) * */ static uint32_t bf533_ezkit_bus_read_end( bus_t *bus ) { part_t *p = PART; chain_t *chain = CHAIN; int i; uint32_t d = 0; unselect_flash( bus ); part_set_signal( p, AOE, 1, 1 ); part_set_signal( p, AWE, 1, 1 ); chain_shift_data_registers( chain, 1 ); for (i = 0; i < 16; i++) d |= (uint32_t) (part_get_signal( p, DATA[i] ) << i); return d; }
static uint32_t ppc440gx_ebc8_bus_read_next( bus_t *bus, uint32_t adr ) { part_t *p = PART; chain_t *chain = CHAIN; int i; uint32_t d = 0; bus_area_t area; ppc440gx_ebc8_bus_area( bus, adr, &area ); setup_address( bus, adr ); chain_shift_data_registers( chain, 1 ); for (i = 0; i < area.width; i++) d |= (uint32_t) (part_get_signal( p, D[PPC440GX_DATA_LINES-1-i] ) << i); return d; }
static uint32_t ppc440gx_ebc8_bus_read_end( bus_t *bus ) { part_t *p = PART; chain_t *chain = CHAIN; int i; uint32_t d = 0; bus_area_t area; ppc440gx_ebc8_bus_area( bus, 0, &area ); part_set_signal( p, nCS, 1, 1 ); part_set_signal( p, nOE, 1, 1 ); chain_shift_data_registers( chain, 1 ); for (i = 0; i < area.width; i++) d |= (uint32_t) (part_get_signal( p, D[PPC440GX_DATA_LINES-1-i] ) << i); return d; }
uint32_t sa1110_bus_read_next( parts *ps, uint32_t adr ) { /* see Figure 10-12 in SA doc */ part *p = ps->parts[0]; setup_address( p, adr ); parts_shift_data_registers( ps ); { int i; char buff[10]; uint32_t d = 0; for (i = 0; i < 32; i++) { sprintf( buff, "D%d", i ); d |= (uint32_t) (part_get_signal( p, buff ) << i); } return d; } }
uint32_t sa1110_bus_read_end( parts *ps ) { /* see Figure 10-12 in SA doc */ part *p = ps->parts[0]; part_set_signal( p, "nCS0", 1, 1 ); part_set_signal( p, "nOE", 1, 1 ); parts_shift_data_registers( ps ); { int i; char buff[10]; uint32_t d = 0; for (i = 0; i < 32; i++) { sprintf( buff, "D%d", i ); d |= (uint32_t) (part_get_signal( p, buff ) << i); } return d; } }
static int cmd_get_run( char *params[] ) { int data; signal_t *s; if (cmd_params( params ) != 3) return -1; if (strcmp( params[1], "signal") != 0) return -1; if (!cmd_test_cable()) return 1; if (!chain->parts) { printf( _("Run \"detect\" first.\n") ); return 1; } if (chain->active_part >= chain->parts->len) { printf( _("%s: no active part\n"), "get" ); return 1; } s = part_find_signal( chain->parts->parts[chain->active_part], params[2] ); if (!s) { printf( _("signal '%s' not found\n"), params[2] ); return 1; } data = part_get_signal( chain->parts->parts[chain->active_part], s ); if (data != -1) printf( _("%s = %d\n"), params[2], data ); return 1; }