You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

279 lines
8.3 KiB
C

/*
* $Id$
*
* Copyright (C) 2002 ETC s.r.o.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Written by Marcel Telka <marcel@telka.sk>, 2002.
*
* Documentation:
* [1] Advanced Micro Devices, "Common Flash Memory Interface Specification Release 2.0",
* December 1, 2001
* [2] Intel Corporation, "Intel PXA250 and PXA210 Application Processors
* Developer's Manual", February 2002, Order Number: 278522-001
* [3] Intel Corporation, "Common Flash Interface (CFI) and Command Sets
* Application Note 646", April 2000, Order Number: 292204-004
* [4] Advanced Micro Devices, "Common Flash Memory Interface Publication 100 Vendor & Device
* ID Code Assignments", December 1, 2001, Volume Number: 96.1
*
*/
#include <stdint.h>
#include <string.h>
#include <flash/cfi.h>
#include <flash/intel.h>
#include <std/mic.h>
2003-03-13 Marcel Telka <marcel@telka.sk> * include/chain.h: New file. * src/tap/chain.c: Ditto. * src/tap/Makefile.am (libtap_a_SOURCES): Added chain.c. * include/Makefile.am (noinst_HEADERS): Added chain.h. * src/jtag.c: Encapsulated parts, cable and TAP state into one object - chain. All relevant function parameters changed to `chain'. * src/tap/state.c: `trst' state moved to cable drivers. All cable drivers changed. * include/cable.h (cable_driver_t) <set_trst>: Changed return value from void to int. All cable drivers changed. (cable_driver_t) <get_trst>: New function. Implemented this function to all cable drivers. * include/part.h (part_shift_instruction, part_shift_data_register) (parts_shift_instructions, parts_shift_data_registers): Funcions removed. * src/part/part.c (part_shift_instruction, part_shift_data_register) (parts_shift_instructions, parts_shift_data_registers): Ditto. * src/tap/cable/arcom.c: Removed dependency on state.h. * src/tap/cable/byteblaster.c: Ditto. * src/tap/cable/dlc5.c: Ditto. * src/tap/cable/ea253.c: Ditto. * src/tap/cable/ei012.c: Ditto. * src/tap/cable/mpcbdm.c: Ditto. * src/tap/cable/wiggler.c: Ditto. * include/state.h (bit): Replaced with common.h include. (Unknown_State, Run_Test_Idle, Select_DR_Scan, Select_IR_Scan): Removed parentheses. * include/tap.h (write_command): Removed unused declaration. * src/detect.h: Removed file. * src/jtag.h: New file with common jtag function declarations. * src/Makefile.am (jtag_SOURCES): Removed detect.h, added jtag.h. * src/cfi.c: Added jtag.h include. Moved common function declarations to jtag.h file. * src/detect.c: Ditto. * src/discovery.c: Ditto. * src/flash.c: Ditto. * src/help.c: Ditto. * src/jtag.c: Ditto. * src/readmem.c: Ditto. * src/jtag.c (jtag_create_jtagdir, jtag_load_history, jtag_save_history, jtag_parse_line) (jtag_readline_loop, jtag_parse_file, jtag_parse_rc): Changed functions to `static'. * src/tap/tap.c: Added l10n support. * po/POTFILES.in: Added src/tap/chain.c and src/tap/tap.c. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@392 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
#include "jtag.h"
#include <arpa/inet.h>
/* for ntohs */
#include "bus.h"
#include "flash.h"
void
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
detectflash( bus_t *bus )
{
int o = 0;
cfi_query_structure_t *cfi;
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
if (!bus) {
printf( "Error: Missing bus driver!\n" );
return;
}
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
bus_prepare( bus );
printf( "Note: Supported configuration is 2 x 16 bit or 1 x 16 bit only\n" );
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
switch (bus_width( bus )) {
case 16:
o = 1;
break;
case 32:
o = 2;
break;
default:
printf( "Error: Unknown bus width!\n" );
return;
}
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
cfi = detect_cfi( bus );
if (!cfi) {
printf( "Flash not found!\n" );
return;
}
/* detect CFI capable devices */
/* TODO: Low chip only */
/* see 3.3.2 in [1] */
printf( "CFI Query Identification String:\n" );
printf( "\tPrimary Vendor Command Set and Control Interface ID Code: 0x%04X ", cfi->identification_string.pri_id_code );
/* see Section 1. in [4] */
switch (cfi->identification_string.pri_id_code) {
case CFI_VENDOR_NULL:
printf( "(null)\n" );
break;
case CFI_VENDOR_INTEL_ECS:
printf( "(Intel/Sharp Extended Command Set)\n" );
break;
case CFI_VENDOR_AMD_SCS:
printf( "(AMD/Fujitsu Standard Commanf Set)\n" );
break;
case CFI_VENDOR_INTEL_SCS:
printf( "(Intel Standard Command Set)\n" );
break;
case CFI_VENDOR_AMD_ECS:
printf( "(AMD/Fujitsu Extended Command Set)\n" );
break;
case CFI_VENDOR_MITSUBISHI_SCS:
printf( "(Mitsubishi Standard Command Set)\n" );
break;
case CFI_VENDOR_MITSUBISHI_ECS:
printf( "(Mitsubishi Extended Command Set)\n" );
break;
case CFI_VENDOR_SST_PWCS:
printf( "(Page Write Command Set)\n" );
break;
default:
printf( "(unknown!!!)\n" );
break;
}
printf( "\tAddress of Primary Algorithm extended Query table: P = 0x????\n" );
printf( "\tAlternate Vendor Command Set and Control Interface ID Code: 0x%04X ", cfi->identification_string.alt_id_code );
switch (cfi->identification_string.alt_id_code) {
case CFI_VENDOR_NULL:
printf( "(null)\n" );
break;
case CFI_VENDOR_INTEL_ECS:
printf( "(Intel/Sharp Extended Command Set)\n" );
break;
case CFI_VENDOR_AMD_SCS:
printf( "(AMD/Fujitsu Standard Commanf Set)\n" );
break;
case CFI_VENDOR_INTEL_SCS:
printf( "(Intel Standard Command Set)\n" );
break;
case CFI_VENDOR_AMD_ECS:
printf( "(AMD/Fujitsu Extended Command Set)\n" );
break;
case CFI_VENDOR_MITSUBISHI_SCS:
printf( "(Mitsubishi Standard Command Set)\n" );
break;
case CFI_VENDOR_MITSUBISHI_ECS:
printf( "(Mitsubishi Extended Command Set)\n" );
break;
case CFI_VENDOR_SST_PWCS:
printf( "(Page Write Command Set)\n" );
break;
default:
printf( "(unknown!!!)\n" );
break;
}
printf( "\tAddress of Alternate Algorithm extended Query table: A = 0x????\n" );
/* see 3.3.3 in [1] */
printf( "CFI Query System Interface Information:\n" );
printf( "\tVcc Logic Supply Minimum Write/Erase voltage: %d mV\n", cfi->system_interface_info.vcc_min_wev );
printf( "\tVcc Logic Supply Maximum Write/Erase voltage: %d mV\n", cfi->system_interface_info.vcc_max_wev );
printf( "\tVpp [Programming] Logic Supply Minimum Write/Erase voltage: %d mV\n", cfi->system_interface_info.vpp_min_wev );
printf( "\tVpp [Programming] Logic Supply Maximum Write/Erase voltage: %d mV\n", cfi->system_interface_info.vpp_max_wev );
printf( "\tTypical timeout per single byte/word write: %d us\n", cfi->system_interface_info.typ_single_write_timeout );
printf( "\tTypical timeout for minimum-size buffer write: %d us\n", cfi->system_interface_info.typ_buffer_write_timeout );
printf( "\tTypical timeout per individual block erase: %d ms\n", cfi->system_interface_info.typ_block_erase_timeout );
printf( "\tTypical timeout for full chip erase: %d ms\n", cfi->system_interface_info.typ_chip_erase_timeout );
printf( "\tMaximum timeout for byte/word write: %d us\n", cfi->system_interface_info.max_single_write_timeout );
printf( "\tMaximum timeout for buffer write: %d us\n", cfi->system_interface_info.max_buffer_write_timeout );
printf( "\tMaximum timeout per individual block erase: %d ms\n", cfi->system_interface_info.max_block_erase_timeout );
printf( "\tMaximum timeout for chip erase: %d ms\n", cfi->system_interface_info.max_chip_erase_timeout );
/* see 3.3.4 in [1] */
printf( "Device Geometry Definition:\n" );
printf( "\tDevice Size: %d B (%d KiB, %d MiB)\n",
cfi->device_geometry.device_size,
cfi->device_geometry.device_size / 1024,
cfi->device_geometry.device_size / (1024 * 1024) );
printf( "\tFlash Device Interface description: 0x%04X ", cfi->device_geometry.device_interface );
/* see Section 2. in [4] */
switch (cfi->device_geometry.device_interface) {
case CFI_INTERFACE_X8:
printf( "(x8)\n" );
break;
case CFI_INTERFACE_X16:
printf( "(x16)\n" );
break;
case CFI_INTERFACE_X8_X16:
printf( "(x8/x16)\n" );
break;
case CFI_INTERFACE_X32:
printf( "(x32)\n" );
break;
case CFI_INTERFACE_X16_X32:
printf( "(x16/x32)\n" );
break;
default:
printf( "(unknown!!!)\n" );
break;
}
printf( "\tMaximum number of bytes in multi-byte write: %d\n", cfi->device_geometry.max_bytes_write );
printf( "\tNumber of Erase Block Regions within device: %d\n", cfi->device_geometry.number_of_erase_regions );
printf( "\tErase Block Region Information:\n" );
{
int i;
for (i = 0; i < cfi->device_geometry.number_of_erase_regions; i++) {
printf( "\t\tRegion %d:\n", i );
printf( "\t\t\tErase Block Size: %d B (%d KiB)\n",
cfi->device_geometry.erase_block_regions[i].erase_block_size,
cfi->device_geometry.erase_block_regions[i].erase_block_size / 1024 );
printf( "\t\t\tNumber of Erase Blocks: %d\n", cfi->device_geometry.erase_block_regions[i].number_of_erase_blocks );
}
}
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
set_flash_driver( bus, cfi );
if (flash_driver)
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
flash_driver->flash_print_info( bus );
}
void
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
readmem( bus_t *bus, FILE *f, uint32_t addr, uint32_t len )
{
int step = 0;
uint32_t a;
int bc = 0;
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
if (!bus) {
printf( "Error: Missing bus driver!\n" );
return;
}
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
bus_prepare( bus );
step = bus_width( bus ) / 8;
if (step == 0) {
printf( "Unknown bus width!\n" );
return;
}
addr = addr & (~(step - 1));
len = (len + step - 1) & (~(step - 1));
printf( "address: 0x%08X\n", addr );
printf( "length: 0x%08X\n", len );
if (len == 0) {
printf( "length is 0.\n" );
return;
}
printf( "reading:\n" );
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
bus_read_start( bus, addr );
for (a = addr + step; a <= addr + len; a += step) {
uint32_t d = 0;
uint16_t d16 = 0;
#define BSIZE 4096
char b[BSIZE];
if (a < addr + len) {
if (step == 2)
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
d16 = bus_read_next( bus, a );
else
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
d = bus_read_next( bus, a );
}
else {
if (step == 2)
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
d16 = bus_read_end( bus );
else
2003-04-29 Marcel Telka <marcel@telka.sk> * data/MANUFACTURERS: Added new manufacturer: DEC. * src/jtag.c (jtag_create_jtagdir): Changed permissions for jtag directory. * include/part.h (part_alloc, read_part): Changed return type from `part *' to `part_t *'. (struct parts): Changed parts member type from `part **' to `part_t **'. (parts_alloc): Changed return type from `parts *' to `parts_t *'. * src/bus/ixp425.c (select_flash, unselect_flash, setup_address, set_data_in, setup_data): Changed first parameter type from `part *' to `part_t *'. * src/bus/pxa250.c (setup_address, set_data_in, setup_data): Ditto. * src/bus/sa1110.c (setup_address, set_data_in, setup_data): Ditto. * include/bus.h: Replaced static bus_driver_t architecture with dynamic bus_t. Removed direct chain_t dependency. Added `params' and `prepare' members. All related functions' parameter types changed. * src/bus/ixp425.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (ixp425_bus_prepare, ixp425_bus_free, new_ixp425_bus): New functions. (ixp425_bus_driver, ixp425_bus): Renamed `ixp425_bus_driver' to `ixp425_bus' and updated for new bus driver architecture. * src/bus/pxa250.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (pxa250_bus_prepare, pxa250_bus_free, new_pxa250_bus): New functions. (pxa250_bus_driver, pxa250_bus): Renamed `pxa250_bus_driver' to `pxa250_bus' and updated for new bus driver architecture. * src/bus/sa1110.c (bus_params_t): New structure typedef. (CHAIN, PART): New macros. (sa1110_bus_prepare, sa1110_bus_free, new_sa1110_bus): New functions. (sa1110_bus_driver, sa1110_bus): Renamed `sa1110_bus_driver' to `sa1110_bus' and updated for new bus driver architecture. * src/readmem.c (detectflash, readmem): Moved JTAG chain initialization to bus->prepare(). * src/flash.c (flashcheck): Ditto. (flashmsbin, flashmem): Removed BYPASS instruction setup. * src/jtag.c (bus_driver, bus): Replaced `bus_driver' with `bus' global variable. (jtag_parse_line, main): Added `bus' deallocation. * src/flash.h (flash_driver_t): Changed parameter type for all function members from `chain_t*' to `bus_t *'. All function callers changed. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@423 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
22 years ago
d = bus_read_end( bus );
}
if (step == 2)
*((uint16_t *) &b[bc]) = ntohs(d16);
else
*((uint32_t *) &b[bc]) = d;
bc += step;
if ((bc >= BSIZE) || (a >= (addr + len)) ) {
printf( "addr: 0x%08X\r", a );
fwrite( b, bc, 1, f );
bc = 0;
}
}
printf( "\nDone.\n" );
}