Beispiel #1
0
/**
 * 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;
}
Beispiel #2
0
/**
 * 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;
}
Beispiel #3
0
/**
 * bus->driver->(*read_start)
 *
 */
static void
jopcyc_bus_read_start( bus_t *bus, uint32_t adr )
{
	part_t *p = PART;
	chain_t *chain = CHAIN;
	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;
	}

	part_set_signal( p, nCS, 1, 0 );
	part_set_signal( p, nWE, 1, 1 );
	part_set_signal( p, nOE, 1, 0 );
	if (comp->ctype == RAM) {
		part_set_signal( p, nLB, 1, 0 );
		part_set_signal( p, nUB, 1, 0 );
	}

	setup_address( bus, adr, comp );
	set_data_in( bus, comp );

	chain_shift_data_registers( chain, 0 );
}
Beispiel #4
0
/**
 * 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;
}
Beispiel #5
0
static void
ppc440gx_ebc8_bus_read_start( bus_t *bus, uint32_t adr )
{
	part_t *p = PART;
	chain_t *chain = CHAIN;

	part_set_signal( p, nCS, 1, 0 );
	part_set_signal( p, nWE, 1, 1 );
	part_set_signal( p, nOE, 1, 0 );

	setup_address( bus, adr );
	set_data_in( bus );

	chain_shift_data_registers( chain, 0 );
}
Beispiel #6
0
/**
 * bus->driver->(*read_start)
 *
 */
static void
bf533_ezkit_bus_read_start( bus_t *bus, uint32_t adr )
{
	part_t *p = PART;
	chain_t *chain = CHAIN;

	select_flash( bus );
	part_set_signal( p, AOE, 1, 0 );
	part_set_signal( p, AWE, 1, 1 );

	setup_address( bus, adr );
	set_data_in( bus );

	chain_shift_data_registers( chain, 0 );
}
Beispiel #7
0
/**
 * 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;
}
Beispiel #8
0
static void
unselect_flash( bus_t *bus )
{
	part_t *p = PART;

	part_set_signal( p, AMS[0], 1, 1 );
	part_set_signal( p, AMS[1], 1, 1 );
	part_set_signal( p, AMS[2], 1, 1 );
	part_set_signal( p, AMS[3], 1, 1 );

	part_set_signal( p, ABE[0], 1, 1 );
	part_set_signal( p, ABE[1], 1, 1 );

	part_set_signal( p, SRAS, 1, 1 );
	part_set_signal( p, SCAS, 1, 1 );
	part_set_signal( p, SWE, 1, 1 );
	part_set_signal( p, SMS, 1, 1 );
}
Beispiel #9
0
static void
set_data_in( bus_t *bus )
{
	int i;
	part_t *p = PART;

	for (i = 0; i < 16; i++)
		part_set_signal( p, DATA[i], 0, 0 );
}
Beispiel #10
0
static void
set_data_in( bus_t *bus )
{
        int i;
        part_t *p = PART;

        for (i = 0; i < dbus_width; i++)
                part_set_signal( p, D[i], 0, 0 );
}
Beispiel #11
0
static void s3c4510_bus_setup_ctrl( bus_t *bus, int mode )
{
  int k;
  part_t *p = PART;

  for (k = 0; k < 6; k++)
	part_set_signal( p, nRCS[k], 1, (mode & (1 << k)) ? 1 : 0 );

  for (k = 0; k < 4; k++)
	part_set_signal( p, nECS[k], 1, 1 );

  for (k = 0; k < 4; k++)
	part_set_signal( p, nSDCS[k], 1, 1 );

  for (k = 0; k < 4; k++)
	part_set_signal( p, nWBE[k], 1, (mode & (1 << (k + 8))) ? 1 : 0 );

  part_set_signal( p, nOE, 1, (mode & (1 << 16)) ? 1 : 0 );
}
Beispiel #12
0
/**
 * 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;
}
Beispiel #13
0
/**
 * bus->driver->(*read_start)
 *
 */
static void
sharc_21065L_bus_read_start( bus_t *bus, uint32_t adr )
{
	chain_t *chain = CHAIN;
	part_t *p = PART;

	LAST_ADR = adr;
	if (adr >= 0x080000)
		return;


	part_set_signal( p, BMS, 1, 0 );
	part_set_signal( p, nWE, 1, 1 );
	part_set_signal( p, nOE, 1, 0 );

	setup_address( bus, adr );
	set_data_in( bus, adr );

	chain_shift_data_registers( chain, 0 );
}
Beispiel #14
0
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;
}
Beispiel #15
0
static void
set_data_in( part *p )
{
	int i;
	char buff[10];

	for (i = 0; i < 32; i++) {
		sprintf( buff, "D%d", i );
		part_set_signal( p, buff, 0, 0 );
	}
}
Beispiel #16
0
static void
set_data_in( bus_t *bus )
{
	int i;
	part_t *p = PART;
	bus_area_t area;

	ppc440gx_ebc8_bus_area( bus, 0, &area );

	for (i = 0; i < area.width; i++)
		part_set_signal( p, D[i], 0, 0 );
}
Beispiel #17
0
static void
set_data_in( bus_t *bus, uint32_t adr )
{
	int i;
	part_t *p = PART;
	bus_area_t area;

	sharc_21065L_bus_area( bus, adr, &area );

	for (i = 0; i < area.width; i++)
		part_set_signal( p, MD[i], 0, 0 );
}
Beispiel #18
0
static void
setup_data( bus_t *bus, uint32_t d )
{
        int i;
        part_t *p = PART;

        for (i = 0; i < dbus_width; i++)
                part_set_signal( p, D[i], 1, (d >> i) & 1 );
        /* Set other bits as 0 */
        for (i = dbus_width; i < 32; i++)
                part_set_signal( p, D[i], 1, 0 );
}
Beispiel #19
0
static void
set_data_in( bus_t *bus, component_t *comp )
{
	int i;
	part_t *p = PART;
	int width;

	width = detect_data_width( comp );

	for (i = 0; i < width; i++)
		part_set_signal( p, D[i], 0, 0 );
}
Beispiel #20
0
/**
 * bus->driver->(*write)
 *
 */
static void
bf533_ezkit_bus_write( bus_t *bus, uint32_t adr, uint32_t data )
{
	part_t *p = PART;
	chain_t *chain = CHAIN;

//	printf("Writing %04X to %08X...\n", data, adr);

	select_flash( bus );
	part_set_signal( p, AOE, 1, 1 );

	setup_address( bus, adr );
	setup_data( bus, data );

	chain_shift_data_registers( chain, 0 );

	part_set_signal( p, AWE, 1, 0 );
	chain_shift_data_registers( chain, 0 );
	part_set_signal( p, AWE, 1, 1 );
	unselect_flash( bus );
	chain_shift_data_registers( chain, 0 );
}
Beispiel #21
0
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;
	}
}
Beispiel #22
0
/**
 * bus->driver->(*write)
 *
 */
static void
sharc_21065L_bus_write( bus_t *bus, uint32_t adr, uint32_t data )
{
	part_t *p = PART;
	chain_t *chain = CHAIN;

	if (adr >= 0x080000)
		return;


	part_set_signal( p, BMS, 1, 0 );
	part_set_signal( p, nWE, 1, 1 );
	part_set_signal( p, nOE, 1, 1 );

	setup_address( bus, adr );
	setup_data( bus, adr, data );

	chain_shift_data_registers( chain, 0 );

	part_set_signal( p, nWE, 1, 0 );
	chain_shift_data_registers( chain, 0 );
	part_set_signal( p, nWE, 1, 1 );
	chain_shift_data_registers( chain, 0 );
}
Beispiel #23
0
void
sa1110_bus_read_start( parts *ps, uint32_t adr )
{
	/* see Figure 10-12 in SA doc */
	part *p = ps->parts[0];

	part_set_signal( p, "nCS0", 1, 0 );
	part_set_signal( p, "nCS1", 1, 1 );
	part_set_signal( p, "nCS2", 1, 1 );
	part_set_signal( p, "nCS3", 1, 1 );
	part_set_signal( p, "nCS4", 1, 1 );
	part_set_signal( p, "nCS5", 1, 1 );
	part_set_signal( p, "RD_nWR", 1, 1 );
	part_set_signal( p, "nWE", 1, 1 );
	part_set_signal( p, "nOE", 1, 0 );

	setup_address( p, adr );
	set_data_in( p );

	parts_shift_data_registers( ps );
}
Beispiel #24
0
/**
 * bus->driver->(*read_start)
 *
 */
static void
sh7727_bus_read_start( bus_t *bus, uint32_t adr )
{
	part_t *p = PART;
	int cs[8];
	int i;

	for (i = 0; i < 8; i++)
		cs[i] = 1;
	cs[(adr & 0x1C000000) >> 26] = 0;

	part_set_signal( p, CS[0], 1, cs[0] );
	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, RDWR, 1, 1 );
	part_set_signal( p, WE[0], 1, 1 );
	part_set_signal( p, WE[1], 1, 1 );
	part_set_signal( p, WE[2], 1, 1 );
	part_set_signal( p, WE[3], 1, 1 );
	part_set_signal( p, RD, 1, 0 );

	setup_address( bus, adr );
	set_data_in( bus );

	chain_shift_data_registers( CHAIN, 0 );
}
Beispiel #25
0
/**
 * bus->driver->(*write)
 *
 */
static void
sh7750r_bus_write( bus_t *bus, uint32_t adr, uint32_t data )
{
    chain_t *chain = CHAIN;
    part_t *p = PART;
    int cs[8];
    int i;

    for (i = 0; i < 8 ; i++)
        cs[i] = 1;
    cs[(adr & 0x1C000000) >> 26] = 0;

    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, RDWR, 1, 0 );
    part_set_signal( p, RDWR2, 1, 0 );
    part_set_signal( p, WE[0], 1, 1 );
    part_set_signal( p, WE[1], 1, 1 );
    part_set_signal( p, WE[2], 1, 1 );
    part_set_signal( p, WE[3], 1, 1 );
    part_set_signal( p, RD, 1, 1 );
    part_set_signal( p, RD2, 1, 1 );

    setup_address( bus, adr );
    setup_data( bus, data );

    chain_shift_data_registers( chain, 0 );

    part_set_signal( p, WE[0], 1, 0 );
    part_set_signal( p, WE[1], 1, 0 );
    part_set_signal( p, WE[2], 1, 0 );
    part_set_signal( p, WE[3], 1, 0 );

    chain_shift_data_registers( chain, 0 );

    part_set_signal( p, WE[0], 1, 1 );
    part_set_signal( p, WE[1], 1, 1 );
    part_set_signal( p, WE[2], 1, 1 );
    part_set_signal( p, WE[3], 1, 1 );

    chain_shift_data_registers( chain, 0 );
}
Beispiel #26
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;
}
Beispiel #27
0
/**
 * bus->driver->(*init)
 *
 */
static int
jopcyc_bus_init( bus_t *bus )
{
	part_t *p = PART;
	chain_t *chain = CHAIN;
	component_t *comp;

	if (tap_state(chain) != Run_Test_Idle) {
		/* silently skip initialization if TAP isn't in RUNTEST/IDLE state
		   this is required to avoid interfering with detect when initbus
		   is contained in the part description file
		   bus_init() will be called latest by bus_prepare() */
		return URJTAG_STATUS_OK;
	}

	/* Preload update registers
	   See AN039, "Guidelines for IEEE Std. 1149.1 Boundary Scan Testing */

	part_set_instruction( p, "SAMPLE/PRELOAD" );
	chain_shift_instructions( chain );

	/* RAMA */
	comp = COMP_RAMA;
	set_data_in( bus, comp );
	part_set_signal( p, nCS, 1, 1 );
	part_set_signal( p, nWE, 1, 1 );
	part_set_signal( p, nOE, 1, 1 );
	part_set_signal( p, nLB, 1, 1 );
	part_set_signal( p, nUB, 1, 1 );

	/* RAMB */
	comp = COMP_RAMB;
	set_data_in( bus, comp );
	part_set_signal( p, nCS, 1, 1 );
	part_set_signal( p, nWE, 1, 1 );
	part_set_signal( p, nOE, 1, 1 );
	part_set_signal( p, nLB, 1, 1 );
	part_set_signal( p, nUB, 1, 1 );

	/* FLASH */
	comp = COMP_FLASH;
	set_data_in( bus, comp );
	part_set_signal( p, nCS,  1, 1 );
	part_set_signal( p, nWE,  1, 1 );
	part_set_signal( p, nOE,  1, 1 );
	part_set_signal( p, nCS2, 1, 1 );
	part_set_signal( p, nRDY, 0, 0 );

	/* Serial Port */
	part_set_signal( p, SER_RXD,  0, 0 );
	part_set_signal( p, SER_NRTS, 1, 1 );
	part_set_signal( p, SER_TXD,  1, 1 );
	part_set_signal( p, SER_NCTS, 0, 0 );

	chain_shift_data_registers( chain, 0 );

	INITIALIZED = 1;

	return URJTAG_STATUS_OK;
}
Beispiel #28
0
/**
**  @brief
**    ROM/SRAM/FlashPage Write Access Timing
*/
static void
s3c4510_bus_write( bus_t *bus, uint32_t adr, uint32_t data )
{
        /* see Figure 4-21 in [1] */
        part_t *p = PART;
        chain_t *chain = CHAIN;

        part_set_signal( p, nRCS[0], 1, 0 );
        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 );

        setup_address( bus, adr );
        setup_data( bus, data );

        chain_shift_data_registers( chain, 0 );

        part_set_signal( p, nWBE[0], 1, 0 );
        chain_shift_data_registers( chain, 0 );
        part_set_signal( p, nWBE[0], 1, 1 );
        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 );
        chain_shift_data_registers( chain, 0 );
}
Beispiel #29
0
void
sa1110_bus_write( parts *ps, uint32_t adr, uint32_t data )
{
	/* see Figure 10-16 in SA doc */
	part *p = ps->parts[0];

	if ( (adr==0x49000000) && (data==1) ) {
		part_set_signal( p, "nCS0", 1, 1 );
		part_set_signal( p, "nCS5", 1, 0 );
	} else {
		part_set_signal( p, "nCS0", 1, 0 );
		part_set_signal( p, "nCS5", 1, 1 );
	}
	part_set_signal( p, "nCS1", 1, 1 );
	part_set_signal( p, "nCS2", 1, 1 );
	part_set_signal( p, "nCS3", 1, 1 );
	part_set_signal( p, "nCS4", 1, 1 );
	part_set_signal( p, "RD_nWR", 1, 0 );
	part_set_signal( p, "nWE", 1, 1 );
	part_set_signal( p, "nOE", 1, 1 );

	setup_address( p, adr );
	setup_data( p, data );

	parts_shift_data_registers( ps );

	part_set_signal( p, "nWE", 1, 0 );
	parts_shift_data_registers( ps );
	part_set_signal( p, "nWE", 1, 1 );
	parts_shift_data_registers( ps );
	part_set_signal( p, "nCS0", 1, 1 );
	part_set_signal( p, "nCS5", 1, 1 );
	parts_shift_data_registers( ps );
}