[ 2102453 ] Use macros for std return values instead of literals

started with the bus driver stack


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1366 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 16 years ago
parent 82d4259e71
commit a76a13a632

@ -1,13 +1,31 @@
2008-09-27 Arnim Laeuger <arniml@users.sourceforge.net>
* include/jtag.h, src/cmd/detect.c, src/cmd/initbus.c,
src/cmd/print.c, src/bus/bf548_ezkit.c, src/bus/fjmem.c,
src/bus/ppc405ep.c, src/bus/sh7727.c, src/bus/prototype.c,
src/bus/sa1110.c, src/bus/ppc440gx_ebc8.c, src/bus/tx4925.c,
src/bus/sh7750r.c, src/bus/pxa2x0.c, src/bus/bf533_stamp.c,
src/bus/bf533_ezkit.c, src/bus/bf537_stamp.c, src/bus/ixp425.c,
src/bus/avr32.c, src/bus/h7202.c, src/bus/zefant-xs3.c,
src/bus/mpc824x.c, src/bus/bcm1250.c, src/bus/sharc21065l.c,
src/bus/readmem.c, src/bus/au1500.c, src/bus/lh7a400.c,
src/bus/sh7751r.c, src/bus/generic_bus.c, src/bus/mpc5200.c,
src/bus/jopcyc.c, src/bus/bf561_ezkit.c, src/bus/slsup3.c,
src/bus/writemem.c, src/bus/s3c4510x.c, src/bus/ejtag.c,
src/flash/amd_flash.c, src/flash/cfi.c, src/flash/jedec_exp.c,
src/flash/jedec.c, src/flash/intel.c:
[ 2102453 ] Use macros for std return values instead of literals
2008-09-16 Mike Frysinger <vapier@gentoo.org>
* data/analog/bf527/STEPPINGS: Add bf527 0.2.
* data/analog/bf533/STEPPINGS: Add bf533 0.5 and 0.6.
* data/analog/bf548/STEPPINGS: Add bf548 0.2.
* data/analog/bf527/STEPPINGS: Add bf527 0.2.
* data/analog/bf533/STEPPINGS: Add bf533 0.5 and 0.6.
* data/analog/bf548/STEPPINGS: Add bf548 0.2.
2008-09-15 Arnim Laeuger <arniml@users.sourceforge.net>
* src/svf/svf.h, src/svf/svf_flex.l: SVF player fix for
[ 2112823 ] Conversion with strtod and similar influenced by locale
* src/svf/svf.h, src/svf/svf_flex.l: SVF player fix for
[ 2112823 ] Conversion with strtod and similar influenced by locale
2008-09-14 Kolja Waschk <kawk>

@ -34,6 +34,11 @@
#include "bus.h"
#include "part.h"
#define URJTAG_STATUS_OK 0
#define URJTAG_STATUS_FAIL 1
#define URJTAG_STATUS_SYNTAX_ERROR -1
extern bus_t *bus;
extern int big_endian;
extern int debug_mode;

@ -140,7 +140,7 @@ au1500_bus_area(bus_t *bus, uint32_t addr, bus_area_t *area)
area->width = part_get_signal( PART, part_find_signal( PART, "ROMSIZ" ) ) ? 16 : 32;
return 0;
return URJTAG_STATUS_OK;
}

@ -636,7 +636,7 @@ avr32_bus_area (bus_t * bus, uint32_t addr, bus_area_t * area)
break;
}
return 0;
return URJTAG_STATUS_OK;
}
/**

@ -132,7 +132,7 @@ bcm1250_bus_area( bus_t *bus, uint32_t addr, bus_area_t *area )
area->length = UINT64_C(0x100000000);
area->width = 8;
return 0;
return URJTAG_STATUS_OK;
}
#ifndef USE_BCM_EJTAG
@ -422,7 +422,7 @@ bcm1250_ejtag_do(bus_t *bus, uint64_t ad, uint64_t da, int read, int type,
printf("\n");
}
}
return 0;
return URJTAG_STATUS_OK;
}
/**

@ -155,7 +155,7 @@ bf533_ezkit_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x100000000);
area->width = 16;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -156,7 +156,7 @@ bf533_stamp_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x100000000);
area->width = 16;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -140,7 +140,7 @@ bf537_stamp_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x100000000);
area->width = 16;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -154,7 +154,7 @@ bf548_ezkit_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x100000000);
area->width = 16;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -158,7 +158,7 @@ bf561_ezkit_bus_area( bus_t *bus, uint32_t addr, bus_area_t *area )
area->start = UINT32_C(0x00000000);
area->length = UINT64_C(0x100000000);
area->width = 16;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -354,7 +354,7 @@ ejtag_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0xa0000000);
area->width = 0;
}
return 0;
return URJTAG_STATUS_OK;
}
static int

@ -522,7 +522,7 @@ block_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area, block_param_t **bl_m
bl = bl->next;
}
return 0;
return URJTAG_STATUS_OK;
}
/**

@ -26,17 +26,19 @@
#include <stdlib.h>
#include <jtag.h>
#include "generic_bus.h"
int
generic_bus_attach_sig( part_t *part, signal_t **sig, char *id )
{
int failed = 0;
int failed = URJTAG_STATUS_OK;
*sig = part_find_signal( part, id );
if (!*sig) {
printf( _("signal '%s' not found\n"), id );
failed = 1;
failed = URJTAG_STATUS_FAIL;
}
return failed;
@ -62,7 +64,7 @@ generic_bus_no_init( bus_t *bus )
{
INITIALIZED = 1;
return 0;
return URJTAG_STATUS_OK;
}
/**

@ -136,7 +136,7 @@ h7202_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x100000000);
area->width = 16; //part_get_signal( PART, part_find_signal( PART, "ROM_SEL" ) ) ? 32 : 16;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -133,7 +133,7 @@ ixp425_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x100000000);
area->width = 16;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -476,7 +476,7 @@ jopcyc_bus_init( bus_t *bus )
INITIALIZED = 1;
return 0;
return URJTAG_STATUS_OK;
}
static int
@ -508,7 +508,7 @@ comp_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area, component_t **comp )
*comp = NULL;
}
return 0;
return URJTAG_STATUS_OK;
}
/**

@ -160,7 +160,7 @@ lh7a400_bus_area ( bus_t *bus, uint32_t adr, bus_area_t *area )
width |= part_get_signal( PART, part_find_signal( PART, "WIDTH1" ) ) << 1;
if (width < 0)
return -1;
return URJTAG_STATUS_FAIL;
switch (width) {
case 0:
@ -174,7 +174,7 @@ lh7a400_bus_area ( bus_t *bus, uint32_t adr, bus_area_t *area )
area->width = 32;
}
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -140,14 +140,14 @@ mpc5200_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->start = UINT32_C(0x00000000);
area->length = UINT64_C(0x01000000);
area->width = 8;
return 0;
return URJTAG_STATUS_OK;
}
area->description = NULL;
area->start = 0x01000000;
area->length = 0xFF000000;
area->width = 0;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -249,7 +249,7 @@ mpc824x_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0xFF000000);
area->width = 0;
return 0;
return URJTAG_STATUS_OK;
}
if (adr < UINT32_C(0xFF800000)) {
@ -258,7 +258,7 @@ mpc824x_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x00800000);
area->width = 0;
return 0;
return URJTAG_STATUS_OK;
}
if (boot_SDMA1 == 0) {
@ -267,7 +267,7 @@ mpc824x_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x00800000);
area->width = BUS_WIDTH;
return 0;
return URJTAG_STATUS_OK;
}
/* extended addresing mode is disabled (SDMA1 is 1) */
@ -277,7 +277,7 @@ mpc824x_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x00400000);
area->width = BUS_WIDTH;
return 0;
return URJTAG_STATUS_OK;
}
area->description = N_("Base ROM Interface (Bank 0)");
@ -285,7 +285,7 @@ mpc824x_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x00400000);
area->width = BUS_WIDTH;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -128,7 +128,7 @@ ppc405ep_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x100000000);
area->width = 16;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -130,7 +130,7 @@ ppc440gx_ebc8_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x100000000); /* ??????????? */
area->width = PPC440GX_DATA_LINES;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -295,7 +295,7 @@ prototype_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x100000000);
area->width = DW;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -275,7 +275,7 @@ pxa2xx_bus_init( bus_t *bus )
INITIALIZED = 1;
return 0;
return URJTAG_STATUS_OK;
}
/**
@ -317,13 +317,13 @@ pxa2xx_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
case 6:
case 7:
printf( "TODO - BOOT_SEL: %d\n", get_BOOT_DEF_BOOT_SEL(BOOT_DEF) );
return -1;
return URJTAG_STATUS_FAIL;
default:
printf( "BUG in the code, file %s, line %d.\n", __FILE__, __LINE__ );
return -1;
return URJTAG_STATUS_FAIL;
}
}
return 0;
return URJTAG_STATUS_OK;
}
/* Static Chip Select 1..5 (per 64 MB) */
@ -338,7 +338,7 @@ pxa2xx_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x04000000);
area->width = pxa25x_ncs_map[ncs_index].bus_width;
return 0;
return URJTAG_STATUS_OK;
}
}
@ -348,7 +348,7 @@ pxa2xx_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x30000000);
area->width = 0;
return 0;
return URJTAG_STATUS_OK;
}
if (adr < UINT32_C(0x4C000000)) {
@ -357,7 +357,7 @@ pxa2xx_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x04000000);
area->width = 32;
return 0;
return URJTAG_STATUS_OK;
}
area->description = NULL;
@ -365,7 +365,7 @@ pxa2xx_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0xB4000000);
area->width = 0;
return 0;
return URJTAG_STATUS_OK;
}
/**
@ -407,13 +407,13 @@ pxa27x_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
case 6:
case 7:
printf( "TODO - BOOT_SEL: %d\n", get_BOOT_DEF_BOOT_SEL(BOOT_DEF) );
return -1;
return URJTAG_STATUS_FAIL;
default:
printf( "BUG in the code, file %s, line %d.\n", __FILE__, __LINE__ );
return -1;
return URJTAG_STATUS_FAIL;
}
}
return 0;
return URJTAG_STATUS_OK;
}
/* Static Chip Select 1..5 (per 64 MB) */
@ -430,7 +430,7 @@ pxa27x_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x04000000);
area->width = pxa27x_ncs_map[ncs_index].bus_width;
return 0;
return URJTAG_STATUS_OK;
}
//else printf( "no match\n");
}
@ -441,7 +441,7 @@ pxa27x_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x28000000);
area->width = 0;
return 0;
return URJTAG_STATUS_OK;
}
if (adr < UINT32_C(0x60000000)) {
@ -450,7 +450,7 @@ pxa27x_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x20000000);
area->width = 32;
return 0;
return URJTAG_STATUS_OK;
}
if (adr < UINT32_C(0xA0000000)) {
@ -459,7 +459,7 @@ pxa27x_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x40000000);
area->width = 0;
return 0;
return URJTAG_STATUS_OK;
}
if (adr < UINT32_C(0xB0000000)) {
@ -468,7 +468,7 @@ pxa27x_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x10000000);
area->width = 32;
return 0;
return URJTAG_STATUS_OK;
}
area->description = NULL;
@ -476,7 +476,7 @@ pxa27x_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x50000000);
area->width = 0;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -58,7 +58,7 @@ readmem( bus_t *bus, FILE *f, uint32_t addr, uint32_t len )
bus_prepare( bus );
if (bus_area( bus, addr, &area ) != 0) {
if (bus_area( bus, addr, &area ) != URJTAG_STATUS_OK) {
printf( _("Error: Bus width detection failed\n") );
return;
}

@ -197,7 +197,7 @@ s3c4510_bus_init( bus_t *bus )
INITIALIZED = 1;
return 0;
return URJTAG_STATUS_OK;
}
/**
@ -220,17 +220,17 @@ s3c4510_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
switch ((b0size1 << 1) | b0size0) {
case 1:
area->width = dbus_width = 8;
return 0;
return URJTAG_STATUS_OK;
case 2:
area->width = dbus_width = 16;
return 0;
return URJTAG_STATUS_OK;
case 3:
area->width = dbus_width = 32;
return 0;
return URJTAG_STATUS_OK;
default:
printf( "B0SIZE[1:0]: Unknown\n" );
area->width = 0;
return -1;
return URJTAG_STATUS_FAIL;
}
}

@ -140,7 +140,7 @@ sa1110_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x100000000);
area->width = part_get_signal( PART, part_find_signal( PART, "ROM_SEL" ) ) ? 32 : 16;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -154,17 +154,17 @@ sh7727_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
switch (part_get_signal( p, MD4 ) << 1 | part_get_signal( p, MD3 )) {
case 1:
area->width = 8;
return 0;
return URJTAG_STATUS_OK;
case 2:
area->width = 16;
return 0;
return URJTAG_STATUS_OK;
case 3:
area->width = 32;
return 0;
return URJTAG_STATUS_OK;
default:
printf( _("Error: Invalid bus width (MD3 = MD4 = 0)!\n") );
area->width = 0;
return -1;
return URJTAG_STATUS_FAIL;
}
}

@ -148,7 +148,7 @@ sh7750r_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x100000000);
area->width = 32;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -142,7 +142,7 @@ sh7751r_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x100000000);
area->width = 16;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -137,14 +137,14 @@ sharc_21065L_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x080000);
area->width = 8;
return 0;
return URJTAG_STATUS_OK;
}
area->description = NULL;
area->start = UINT32_C(0xffffffff);
area->length = UINT64_C(0x080000);
area->width = 0;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -180,7 +180,7 @@ slsup3_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = FLASHSIZE;
area->width = 8; /* 16 */
return 0;
return URJTAG_STATUS_OK;
}
if ((adr >= SRAMSTART) && (adr < (SRAMSTART + SRAMSIZE))) {
@ -189,7 +189,7 @@ slsup3_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = SRAMSIZE;
area->width = 16;
return 0;
return URJTAG_STATUS_OK;
}
if ((adr >= LCDSTART) && (adr < (LCDSTART + LCDSIZE))) {
@ -198,7 +198,7 @@ slsup3_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = LCDSIZE;
area->width = 8;
return 0;
return URJTAG_STATUS_OK;
}
area->description = NULL;
@ -206,7 +206,7 @@ slsup3_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0xFFC00000);
area->width = 0;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -152,7 +152,7 @@ tx4925_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area )
area->length = UINT64_C(0x100000000);
area->width = 16;
return 0;
return URJTAG_STATUS_OK;
}
static void

@ -52,7 +52,7 @@ writemem( bus_t *bus, FILE *f, uint32_t addr, uint32_t len )
bus_prepare( bus );
if (bus_area( bus, addr, &area ) != 0) {
if (bus_area( bus, addr, &area ) != URJTAG_STATUS_OK) {
printf( _("Error: Bus width detection failed\n") );
return;
}

@ -607,7 +607,7 @@ zefant_xs3_bus_init( bus_t *bus )
INITIALIZED = 1;
return 0;
return URJTAG_STATUS_OK;
}
static int
@ -651,7 +651,7 @@ comp_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area, component_t **comp )
*comp = NULL;
}
return 0;
return URJTAG_STATUS_OK;
}
/**

@ -68,7 +68,7 @@ cmd_detect_run( chain_t *chain, char *params[] )
abus = buses.buses[i];
if(abus->driver->init)
{
if(abus->driver->init(abus))
if(abus->driver->init(abus) != URJTAG_STATUS_OK)
return -1;
}
}

@ -60,7 +60,7 @@ cmd_initbus_run( chain_t *chain, char *params[] )
return 1;
}
buses_add( bus );
if (bus_init( bus ))
if (bus_init( bus ) != URJTAG_STATUS_OK)
printf( _("bus initialization failed!\n") );
return 1;
}

@ -134,7 +134,7 @@ cmd_print_run( chain_t *chain, char *params[] )
bus_printinfo( bus );
for (a = 0; a < UINT64_C(0x100000000); a = area.start + area.length) {
if (bus_area( bus, a, &area ) != 0) {
if (bus_area( bus, a, &area ) != URJTAG_STATUS_OK) {
printf( _("Error in bus area discovery at 0x%08llX\n"), (long long unsigned int)a );
break;
}

@ -36,6 +36,7 @@
#include <flash/intel.h>
#include <unistd.h>
#include <jtag.h>
#include <flash.h>
#include <bus.h>
@ -123,7 +124,7 @@ int amd_detect(bus_t *bus, uint32_t adr, cfi_array_t **cfi_array )
(*cfi_array)->bus = bus;
(*cfi_array)->address = 0;
if (bus_area( bus, adr+0, &area ) != 0)
if (bus_area( bus, adr+0, &area ) != URJTAG_STATUS_OK)
return -8; /* bus width detection failed */
unsigned int bw = area.width;
int ba,i;

@ -34,6 +34,7 @@
#include <stdlib.h>
#include <flash/cfi.h>
#include <jtag.h>
#include <flash.h>
#include <bus.h>
@ -79,7 +80,7 @@ cfi_detect( bus_t *bus, uint32_t adr, cfi_array_t **cfi_array )
(*cfi_array)->bus = bus;
(*cfi_array)->address = adr;
if (bus_area( bus, adr, &area ) != 0)
if (bus_area( bus, adr, &area ) != URJTAG_STATUS_OK)
return -8; /* bus width detection failed */
bw = area.width;
if (bw != 8 && bw != 16 && bw != 32)

@ -42,6 +42,7 @@
#include <flash/intel.h>
#include <flash/mic.h>
#include <jtag.h>
#include <flash.h>
#include <bus.h>
@ -58,7 +59,7 @@ intel_flash_autodetect32( cfi_array_t *cfi_array )
{
bus_area_t area;
if (bus_area( cfi_array->bus, cfi_array->address, &area ) != 0)
if (bus_area( cfi_array->bus, cfi_array->address, &area ) != URJTAG_STATUS_OK)
return 0;
return ((cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == CFI_VENDOR_MITSUBISHI_SCS)
@ -73,7 +74,7 @@ intel_flash_autodetect( cfi_array_t *cfi_array )
{
bus_area_t area;
if (bus_area( cfi_array->bus, cfi_array->address, &area ) != 0)
if (bus_area( cfi_array->bus, cfi_array->address, &area ) != URJTAG_STATUS_OK)
return 0;
return ((cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == CFI_VENDOR_MITSUBISHI_SCS)
@ -88,7 +89,7 @@ intel_flash_autodetect8( cfi_array_t *cfi_array )
{
bus_area_t area;
if (bus_area( cfi_array->bus, cfi_array->address, &area ) != 0)
if (bus_area( cfi_array->bus, cfi_array->address, &area ) != URJTAG_STATUS_OK)
return 0;
return ((cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == CFI_VENDOR_MITSUBISHI_SCS)

@ -6,6 +6,7 @@
#include <flash/intel.h>
#include <unistd.h>
#include <jtag.h>
#include <flash.h>
#include <bus.h>
@ -383,7 +384,7 @@ jedec_detect( bus_t *bus, uint32_t adr, cfi_array_t **cfi_array )
(*cfi_array)->bus = bus;
(*cfi_array)->address = adr;
if (bus_area( bus, adr, &area ) != 0)
if (bus_area( bus, adr, &area ) != URJTAG_STATUS_OK)
return -8; /* bus width detection failed */
bw = area.width;
if (bw != 8 && bw != 16 && bw != 32)

@ -6,6 +6,7 @@
#include <flash/intel.h>
#include <unistd.h>
#include <jtag.h>
#include <flash.h>
#include <bus.h>
#include <bitmask.h>
@ -45,7 +46,7 @@ jedec_exp_detect( bus_t *bus, uint32_t adr, cfi_array_t **cfi_array )
(*cfi_array)->bus = bus;
(*cfi_array)->address = adr;
if (bus_area( bus, adr, &area ) != 0)
if (bus_area( bus, adr, &area ) != URJTAG_STATUS_OK)
return -8; /* bus width detection failed */
bw = area.width;

Loading…
Cancel
Save