[ 1984813 ] Bus driver cleanup, uniquify chain and part in bus_t struct (Hartley Sweeten)

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1285 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 17 years ago
parent 32dc74e986
commit 0da5bdae87

@ -1,3 +1,18 @@
2008-06-18 Arnim Laeuger <arniml@users.sourceforge.net>
* include/bus_driver.h, 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/au1500.c, src/bus/lh7a400.c, src/bus/sh7751r.c,
src/bus/mpc5200.c, src/bus/jopcyc.c, src/bus/bf561_ezkit.c,
src/bus/slsup3.c, src/bus/s3c4510x.c, src/bus/ejtag.c:
[ 1984813 ] Bus driver cleanup, uniquify chain and part in
bus_t struct (Hartley Sweeten)
2008-06-16 Arnim Laeuger <arniml@users.sourceforge.net>
* src/cmd/initbus.c (cmd_initbus_run),

@ -65,12 +65,17 @@ typedef struct bus_driver {
} bus_driver_t;
struct bus {
chain_t *chain;
part_t *part;
void *params;
const bus_driver_t *driver;
};
extern bus_t *bus;
#define CHAIN bus->chain
#define PART bus->part
#define bus_printinfo(bus) bus->driver->printinfo(bus)
#define bus_prepare(bus) bus->driver->prepare(bus)
#define bus_area(bus,adr,a) bus->driver->area(bus,adr,a)

@ -42,8 +42,6 @@
#include "generic_bus.h"
typedef struct{
chain_t *chain;
part_t *part;
signal_t *rad[32];
signal_t *nrcs[4];
signal_t *nrwe;
@ -51,9 +49,6 @@ typedef struct{
signal_t *rd[32];
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define RAD ((bus_params_t *) bus->params)->rad
#define nRCS ((bus_params_t *) bus->params)->nrcs
#define nRWE ((bus_params_t *) bus->params)->nrwe

@ -42,10 +42,7 @@
void jtag_reset (chain_t * chain);
typedef struct
{
chain_t *chain;
part_t *part;
typedef struct {
unsigned int mode;
unsigned int slave;
@ -63,8 +60,6 @@ typedef struct
#define BUS_MODE_x32 5
#define BP (( bus_params_t *) bus->params)
#define CHAIN (BP->chain)
#define PART (BP->part)
#define SLAVE (BP->slave)
#define MODE (BP->mode)
#define ADDR_MASK (BP->addr_mask)

@ -40,8 +40,6 @@
//#define USE_BCM_EJTAG
typedef struct {
chain_t *chain;
part_t *part;
signal_t *io_ad[32];
signal_t *io_cs_l[8];
signal_t *io_rw;
@ -49,9 +47,6 @@ typedef struct {
signal_t *io_oe_l;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define IO_AD ((bus_params_t *) bus->params)->io_ad
#define IO_CS_L ((bus_params_t *) bus->params)->io_cs_l
#define IO_RW ((bus_params_t *) bus->params)->io_rw

@ -38,8 +38,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
signal_t *ams[4];
signal_t *addr[19];
signal_t *data[16];
@ -52,8 +50,6 @@ typedef struct {
signal_t *swe;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define AMS ((bus_params_t *) bus->params)->ams
#define ADDR ((bus_params_t *) bus->params)->addr
#define DATA ((bus_params_t *) bus->params)->data

@ -38,8 +38,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
signal_t *ams[4];
signal_t *addr[19];
signal_t *data[16];
@ -52,8 +50,6 @@ typedef struct {
signal_t *swe;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define AMS ((bus_params_t *) bus->params)->ams
#define ADDR ((bus_params_t *) bus->params)->addr
#define DATA ((bus_params_t *) bus->params)->data

@ -38,8 +38,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
signal_t *ams[4];
signal_t *addr[19];
signal_t *data[16];
@ -52,8 +50,6 @@ typedef struct {
signal_t *swe;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define AMS ((bus_params_t *) bus->params)->ams
#define ADDR ((bus_params_t *) bus->params)->addr
#define DATA ((bus_params_t *) bus->params)->data

@ -37,8 +37,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
signal_t *ams[4];
signal_t *addr[24];
signal_t *data[16];
@ -49,8 +47,6 @@ typedef struct {
signal_t *nce;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define AMS ((bus_params_t *) bus->params)->ams
#define ADDR ((bus_params_t *) bus->params)->addr
#define DATA ((bus_params_t *) bus->params)->data

@ -38,8 +38,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
signal_t *ams[4];
signal_t *addr[24];
signal_t *abe[4];
@ -52,8 +50,6 @@ typedef struct {
signal_t *swe;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define AMS ((bus_params_t *) bus->params)->ams
#define ADDR ((bus_params_t *) bus->params)->addr
#define ABE ((bus_params_t *) bus->params)->abe

@ -42,8 +42,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
int initialized;
uint32_t impcode; /* EJTAG Implementation Register */
uint16_t adr_hi; /* cached high bits of $3 */
@ -51,9 +49,6 @@ typedef struct {
#define BP ((bus_params_t *) bus->params)
#define CHAIN (BP->chain)
#define PART (BP->part)
#define EJTAG_VER ((BP->impcode >> 29) & 7)
#define EJTAG_20 0

@ -68,16 +68,11 @@ struct block_desc {
typedef struct block_desc block_desc_t;
typedef struct {
chain_t *chain;
part_t *part;
uint32_t last_addr;
data_register *fjmem_reg;
block_desc_t block_desc;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define LAST_ADDR ((bus_params_t *) bus->params)->last_addr
#define FJMEM_REG ((bus_params_t *) bus->params)->fjmem_reg
#define BLOCK_DESC ((bus_params_t *) bus->params)->block_desc

@ -38,8 +38,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
signal_t *a[25];
signal_t *d[32];
signal_t *nRCS[4];
@ -47,8 +45,6 @@ typedef struct {
signal_t *nROE;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define A ((bus_params_t *) bus->params)->a
#define D ((bus_params_t *) bus->params)->d
#define nRCS ((bus_params_t *) bus->params)->nRCS

@ -38,8 +38,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
signal_t *ex_cs[8];
signal_t *ex_addr[24];
signal_t *ex_data[16];
@ -47,8 +45,6 @@ typedef struct {
signal_t *ex_rd;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define EX_CS ((bus_params_t *) bus->params)->ex_cs
#define EX_ADDR ((bus_params_t *) bus->params)->ex_addr
#define EX_DATA ((bus_params_t *) bus->params)->ex_data

@ -99,8 +99,6 @@ typedef struct {
} component_t;
typedef struct {
chain_t *chain;
part_t *part;
uint32_t last_addr; /* holds last address of read or write access */
component_t rama;
component_t ramb;
@ -111,8 +109,6 @@ typedef struct {
signal_t *ser_ncts;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define LAST_ADDR ((bus_params_t *) bus->params)->last_addr
#define A comp->a
#define D comp->d

@ -52,8 +52,6 @@
#define WIDTH_NUM 2
typedef struct {
chain_t *chain;
part_t *part;
signal_t *a[ADR_NUM];
signal_t *d[D_NUM];
signal_t *ncs[nCS_NUM];
@ -62,8 +60,6 @@ typedef struct {
signal_t *width[WIDTH_NUM];
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define A ((bus_params_t *) bus->params)->a
#define D ((bus_params_t *) bus->params)->d
#define nCS ((bus_params_t *) bus->params)->ncs

@ -41,8 +41,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
uint32_t last_adr;
signal_t *ad[24];
signal_t *ncs[4];
@ -51,8 +49,6 @@ typedef struct {
signal_t *d[8];
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define LAST_ADR ((bus_params_t *) bus->params)->last_adr
#define AD ((bus_params_t *) bus->params)->ad
#define nCS ((bus_params_t *) bus->params)->ncs

@ -41,8 +41,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
int boot_nfoe;
int boot_sdma1;
uint32_t last_adr;
@ -53,8 +51,6 @@ typedef struct {
signal_t *d[32];
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define boot_nFOE ((bus_params_t *) bus->params)->boot_nfoe
#define boot_SDMA1 ((bus_params_t *) bus->params)->boot_sdma1
#define LAST_ADR ((bus_params_t *) bus->params)->last_adr

@ -35,8 +35,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
signal_t *a[32];
signal_t *d[16];
signal_t *ncs;
@ -44,8 +42,6 @@ typedef struct {
signal_t *noe;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define A ((bus_params_t *) bus->params)->a
#define D ((bus_params_t *) bus->params)->d
#define nCS ((bus_params_t *) bus->params)->ncs

@ -37,8 +37,6 @@
#define PPC440GX_DATA_LINES 8
typedef struct {
chain_t *chain;
part_t *part;
signal_t *a[PPC440GX_ADDR_LINES];
signal_t *d[PPC440GX_DATA_LINES];
signal_t *ncs;
@ -46,8 +44,6 @@ typedef struct {
signal_t *noe;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define A ((bus_params_t *) bus->params)->a
#define D ((bus_params_t *) bus->params)->d
#define nCS ((bus_params_t *) bus->params)->ncs

@ -38,8 +38,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
signal_t *a[32];
signal_t *d[32];
signal_t *cs;
@ -49,8 +47,6 @@ typedef struct {
int ashift;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define A ((bus_params_t *) bus->params)->a
#define D ((bus_params_t *) bus->params)->d
#define CS ((bus_params_t *) bus->params)->cs

@ -104,8 +104,6 @@ static ncs_map_entry pxa27x_ncs_map[nCS_TOTAL] = {
typedef struct {
chain_t *chain;
part_t *part;
uint32_t last_adr;
signal_t *ma[26];
signal_t *md[32];
@ -120,8 +118,6 @@ typedef struct {
int proc;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define PROC ((bus_params_t *) bus->params)->proc
#define LAST_ADR ((bus_params_t *) bus->params)->last_adr
#define MA ((bus_params_t *) bus->params)->ma

@ -73,8 +73,6 @@
/** @brief Bus driver for Samsung S3C4510X */
typedef struct {
chain_t *chain;
part_t *part;
signal_t *a[22]; /**< Only 22-bits addressing */
signal_t *d[32]; /**< Data bus */
signal_t *nrcs[6]; /**< not ROM/SRAM/Flash Chip Select;
@ -87,8 +85,6 @@ typedef struct {
int dbuswidth;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define A ((bus_params_t *) bus->params)->a
#define D ((bus_params_t *) bus->params)->d
#define nRCS ((bus_params_t *) bus->params)->nrcs

@ -41,8 +41,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
signal_t *a[26];
signal_t *d[32];
signal_t *ncs[6];
@ -51,8 +49,6 @@ typedef struct {
signal_t *noe;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define A ((bus_params_t *) bus->params)->a
#define D ((bus_params_t *) bus->params)->d
#define nCS ((bus_params_t *) bus->params)->ncs

@ -38,8 +38,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
signal_t *a[26];
signal_t *d[32];
signal_t *cs[7];
@ -50,8 +48,6 @@ typedef struct {
signal_t *md4;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define A ((bus_params_t *) bus->params)->a
#define D ((bus_params_t *) bus->params)->d
#define CS ((bus_params_t *) bus->params)->cs

@ -38,8 +38,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
signal_t *a[26];
signal_t *d[64];
signal_t *cs[7];
@ -50,8 +48,6 @@ typedef struct {
signal_t *rd2;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define A ((bus_params_t *) bus->params)->a
#define D ((bus_params_t *) bus->params)->d
#define CS ((bus_params_t *) bus->params)->cs

@ -38,8 +38,6 @@
#include "generic_bus.h"
typedef struct {
chain_t *chain;
part_t *part;
signal_t *a[26];
signal_t *d[32];
signal_t *cs[8];
@ -49,8 +47,6 @@ typedef struct {
signal_t *bs;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define A ((bus_params_t *) bus->params)->a
#define D ((bus_params_t *) bus->params)->d
#define CS ((bus_params_t *) bus->params)->cs

@ -42,10 +42,7 @@
//no SDRAM access
typedef struct
{
chain_t *chain;
part_t *part;
typedef struct {
uint32_t last_adr;
signal_t *ma[19]; //19 - 512K flash address are used
signal_t *md[8]; //8 bit data bus connected to Flash are used
@ -54,9 +51,6 @@ typedef struct
signal_t *noe;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define LAST_ADR ((bus_params_t *) bus->params)->last_adr
#define MA ((bus_params_t *) bus->params)->ma
#define MD ((bus_params_t *) bus->params)->md

@ -43,8 +43,6 @@ int databusio[16] = {94,96,98,100,102,104,106,113,95,97,99,101,103,105,107,114};
int addrbusio[20] = {93,88,87,86,85,84,83,63,64,65,66,67,68,74,75,76,77,82,81,78};
typedef struct {
chain_t *chain;
part_t *part;
uint32_t last_adr;
signal_t *ad[20];
signal_t *dq[16];
@ -61,8 +59,6 @@ typedef struct {
signal_t *lcdrw;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define LAST_ADR ((bus_params_t *) bus->params)->last_adr
#define AD ((bus_params_t *) bus->params)->ad
#define DQ ((bus_params_t *) bus->params)->dq

@ -43,8 +43,6 @@
// on 29LV200 we use now.
typedef struct {
chain_t *chain;
part_t *part;
signal_t *oe;
signal_t *swe;
signal_t *romce[4];
@ -53,8 +51,6 @@ typedef struct {
signal_t *data[16];
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define OE ((bus_params_t *) bus->params)->oe
#define SWE ((bus_params_t *) bus->params)->swe
#define ROMCE ((bus_params_t *) bus->params)->romce

@ -118,8 +118,6 @@ typedef struct {
} component_t;
typedef struct {
chain_t *chain;
part_t *part;
uint32_t last_addr; /* holds last address of read or write access */
component_t flash;
component_t ram0;
@ -128,8 +126,6 @@ typedef struct {
component_t eeprom_status;
} bus_params_t;
#define CHAIN ((bus_params_t *) bus->params)->chain
#define PART ((bus_params_t *) bus->params)->part
#define LAST_ADDR ((bus_params_t *) bus->params)->last_addr
#define A comp->a
#define D comp->d

Loading…
Cancel
Save