2003-06-03 Marcel Telka <marcel@telka.sk>

* src/cmd/Makefile.am (libcmd_a_SOURCES): Added peekpoke.c (patch 747447, Matan Ziv-Av).
	* src/cmd/cmd.c (cmds): Added peek and poke commands (patch 747447, Matan Ziv-Av).
	* src/cmd/peekpoke.c: New file (patch 747447, Matan Ziv-Av).
	* po/POTFILES.in: Updated.

	* include/bus.h (bus_t): Declaration moved to include module (brux/bus.h).
	* include/cfi.h (cfi_chip_t, cfi_array_t, cfi_array_free, detect_cfi): Declarations moved
		to include module (brux/cfi.h).


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@456 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Marcel Telka 22 years ago
parent 977d3d3a20
commit 81de361cc5

@ -1,3 +1,14 @@
2003-06-03 Marcel Telka <marcel@telka.sk>
* src/cmd/Makefile.am (libcmd_a_SOURCES): Added peekpoke.c (patch 747447, Matan Ziv-Av).
* src/cmd/cmd.c (cmds): Added peek and poke commands (patch 747447, Matan Ziv-Av).
* src/cmd/peekpoke.c: New file (patch 747447, Matan Ziv-Av).
* po/POTFILES.in: Updated.
* include/bus.h (bus_t): Declaration moved to include module (brux/bus.h).
* include/cfi.h (cfi_chip_t, cfi_array_t, cfi_array_free, detect_cfi): Declarations moved
to include module (brux/cfi.h).
2003-06-02 Marcel Telka <marcel@telka.sk>
* Makefile.am (SUBDIRS): Added libbrux.

@ -1,6 +1,7 @@
$Id$
* Fixed bug with SELECT, AUTOFD, and STROBE signals handling (bug 745824).
* Added new commands 'peek' and 'poke' (patch 747447, Matan Ziv-Av).
jtag-0.4 (2003-05-29):

@ -29,28 +29,7 @@
#include <stdint.h>
#include "chain.h"
typedef struct bus bus_t;
struct bus {
void *params;
void (*prepare)( bus_t *bus );
int (*width)( bus_t *bus, uint32_t adr );
void (*read_start)( bus_t *bus, uint32_t adr );
uint32_t (*read_next)( bus_t *bus, uint32_t adr );
uint32_t (*read_end)( bus_t *bus );
uint32_t (*read)( bus_t *bus, uint32_t adr );
void (*write)( bus_t *bus, uint32_t adr, uint32_t data );
void (*free)( bus_t *bus );
};
#define bus_prepare(bus) bus->prepare(bus)
#define bus_width(bus,adr) bus->width(bus,adr)
#define bus_read_start(bus,adr) bus->read_start(bus,adr)
#define bus_read_next(bus,adr) bus->read_next(bus,adr)
#define bus_read_end(bus) bus->read_end(bus)
#define bus_read(bus,adr) bus->read(bus,adr)
#define bus_write(bus,adr,data) bus->write(bus,adr,data)
#define bus_free(bus) bus->free(bus)
#include <brux/bus.h>
bus_t *new_sa1110_bus( chain_t *chain, int pn );
bus_t *new_pxa250_bus( chain_t *chain, int pn );

@ -25,24 +25,8 @@
#ifndef CFI_H
#define CFI_H
#include <stdint.h>
#include <flash/cfi.h>
#include <brux/cfi.h>
#include "bus.h"
typedef struct {
int width; /* 1 for 8 bits, 2 for 16 bits, 4 for 32 bits, etc. */
cfi_query_structure_t cfi;
} cfi_chip_t;
typedef struct {
bus_t *bus;
uint32_t address;
int bus_width; /* in cfi_chips, e.g. 4 for 32 bits */
cfi_chip_t **cfi_chips;
} cfi_array_t;
void cfi_array_free( cfi_array_t *cfi_array );
int detect_cfi( bus_t *bus, uint32_t adr, cfi_array_t **cfi_array );
#define detect_cfi cfi_detect
#endif /* CFI_H */

@ -16,6 +16,7 @@ src/cmd/frequency.c
src/cmd/get.c
src/cmd/help.c
src/cmd/instruction.c
src/cmd/peekpoke.c
src/cmd/print.c
src/cmd/quit.c
src/cmd/readmem.c
@ -24,9 +25,7 @@ src/cmd/set.c
src/cmd/shift.c
src/detect.c
src/discovery.c
src/flash/amd.c
src/flash.c
src/flash/intel.c
src/jtag.c
src/part/data_register.c
src/part/instruction.c

@ -40,6 +40,7 @@ libcmd_a_SOURCES = \
get.c \
set.c \
endian.c \
peekpoke.c \
readmem.c \
detectflash.c \
flashmem.c \

@ -44,6 +44,8 @@ extern cmd_t cmd_dr;
extern cmd_t cmd_get;
extern cmd_t cmd_set;
extern cmd_t cmd_endian;
extern cmd_t cmd_peek;
extern cmd_t cmd_poke;
extern cmd_t cmd_readmem;
extern cmd_t cmd_detectflash;
extern cmd_t cmd_flashmem;
@ -63,6 +65,8 @@ const cmd_t *cmds[] = {
&cmd_get,
&cmd_set,
&cmd_endian,
&cmd_peek,
&cmd_poke,
&cmd_readmem,
&cmd_detectflash,
&cmd_flashmem,

@ -0,0 +1,127 @@
/*
* $Id$
*
* Copyright (C) 2003 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 Matan Ziv-Av <matan@svgalib.org>, 2003.
*
*/
#include <config.h>
#include <stdio.h>
#include <stdint.h>
#include "jtag.h"
#include "cmd.h"
static int
cmd_peek_run( char *params[] )
{
uint32_t adr, val;
if (cmd_params( params ) != 2)
return -1;
if (!cmd_test_cable())
return 1;
if (!bus) {
printf( _("Error: Bus driver missing.\n") );
return 1;
}
if (cmd_get_number( params[1], &adr ))
return -1;
bus_prepare( bus );
val = bus_read( bus, adr );
printf( _("bus_read(0x%08x) = 0x%08X (%i)\n"), adr, val, val );
return 1;
}
static void
cmd_peek_help( void )
{
printf( _(
"Usage: %s ADDR\n"
"Read a single word (bus width size).\n"
"\n"
"ADDR address to read from\n"
"\n"
"ADDR could be in decimal or hexadecimal (prefixed with 0x) form.\n"
"\n"
), "peek" );
}
cmd_t cmd_peek = {
"peek",
N_("read a single word"),
cmd_peek_help,
cmd_peek_run
};
static int
cmd_poke_run( char *params[] )
{
uint32_t adr, val;
if (cmd_params( params ) != 3)
return -1;
if (!cmd_test_cable())
return 1;
if (!bus) {
printf( _("Error: Bus driver missing.\n") );
return 1;
}
if (cmd_get_number( params[1], &adr ) || cmd_get_number( params[2], &val ))
return -1;
bus_prepare( bus );
bus_write( bus, adr, val );
return 1;
}
static void
cmd_poke_help( void )
{
printf( _(
"Usage: %s ADDR VAL\n"
"Write a single word (bus width size).\n"
"\n"
"ADDR address to write\n"
"VAL value to write\n"
"\n"
"ADDR and VAL could be in decimal or hexadecimal (prefixed with 0x) form.\n"
"\n"
), "poke" );
}
cmd_t cmd_poke = {
"poke",
N_("write a single word"),
cmd_poke_help,
cmd_poke_run
};
Loading…
Cancel
Save