[ 2821545 ] IXP465 support (TedM)

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1670 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 16 years ago
parent 02e1e6d4ca
commit 4b48e26b58

@ -1,5 +1,10 @@
2009-08-11 Arnim Laeuger <arniml>
* src/bus/ixp465.c, src/bus/buses.c, src/bus/buses.h,
src/bus/Makefile.am, configure.ac, data/Makefile.am,
data/intel/ixp465/ixp465, data/intel/ixp465/STEPPINGS, data/intel/PARTS:
[ 2821545 ] IXP465 support (TedM)
* src/global/parse.c: [ 2822900 ] more characters in each lines.
(MURANAKA Masaki)

@ -478,7 +478,7 @@ AC_DEFUN([CHECK_DRIVER], [
# Enable bus drivers
AC_DEFUN([DEF_ENABLE_BUSDRIVERS], [\
arm9tdmi au1500 avr32 bcm1250 bf526_ezkit bf527_ezkit bf533_stamp bf533_ezkit bf537_stamp bf537_ezkit bf538f_ezkit bf548_ezkit bf561_ezkit bscoach ejtag ejtag_dma \
fjmem ixp425 ixp435 jopcyc h7202 lh7a400 mpc5200 mpc824x ppc405ep ppc440gx_ebc8 prototype pxa2x0 pxa27x \
fjmem ixp425 ixp435 ixp465 jopcyc h7202 lh7a400 mpc5200 mpc824x ppc405ep ppc440gx_ebc8 prototype pxa2x0 pxa27x \
s3c4510 sa1110 sh7727 sh7750r sh7751r sharc_21065L slsup3 tx4925 zefant_xs3])
AC_ARG_ENABLE(bus,
[AS_HELP_STRING([--enable-bus], [Enable default set or specific bus drivers:])]
@ -514,6 +514,7 @@ CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [ejtag_dma], [ENABLE_BUS_
CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [fjmem], [ENABLE_BUS_FJMEM])
CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [ixp425], [ENABLE_BUS_IXP425])
CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [ixp435], [ENABLE_BUS_IXP435])
CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [ixp465], [ENABLE_BUS_IXP465])
CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [jopcyc], [ENABLE_BUS_JOPCYC])
CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [h7202], [ENABLE_BUS_H7202])
CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [lh7a400], [ENABLE_BUS_LH7A400])

@ -131,6 +131,8 @@ nobase_dist_pkgdata_DATA = \
intel/sa1110/sa1110 \
intel/ixp425/STEPPINGS \
intel/ixp425/ixp425 \
intel/ixp465/STEPPINGS \
intel/ixp465/ixp465 \
lattice/PARTS \
lattice/lc4032v-tqfp48/STEPPINGS \
lattice/lc4032v-tqfp48/lc4032v-tqfp48 \

@ -35,5 +35,6 @@
1001001001110100 ixp425 IXP425-533MHz # see IXP425 bdsl file from the devel CD
1001001001110101 ixp425 IXP425-400MHz # see IXP425 bdsl file from the devel CD
1001001001110111 ixp425 IXP425-266MHz # see IXP425 bdsl file from the devel CD
1001001001111010 ixp465 IXP465 # see IXP465 bdsl file
1001001001100101 pxa270 PXA270 # see bulbcx.dat from Intel Jflash source code

@ -0,0 +1,26 @@
#
# $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 Christian Pellegrin <chri@ascensit.com>, 2003.
#
# bits 31-28 of the Device Identification Register
0001 ixp465 A0
0010 ixp465 B0

File diff suppressed because it is too large Load Diff

@ -114,6 +114,10 @@ if ENABLE_BUS_IXP435
libbus_la_SOURCES += ixp435.c
endif
if ENABLE_BUS_IXP465
libbus_la_SOURCES += ixp465.c
endif
if ENABLE_BUS_JOPCYC
libbus_la_SOURCES += jopcyc.c
endif

@ -91,6 +91,9 @@ const urj_bus_driver_t *urj_bus_drivers[] = {
#ifdef ENABLE_BUS_IXP435
&urj_bus_ixp435_bus,
#endif
#ifdef ENABLE_BUS_IXP465
&urj_bus_ixp465_bus,
#endif
#ifdef ENABLE_BUS_JOPCYC
&urj_bus_jopcyc_bus,
#endif

@ -44,6 +44,7 @@ extern const urj_bus_driver_t urj_bus_fjmem_bus;
extern const urj_bus_driver_t urj_bus_h7202_bus;
extern const urj_bus_driver_t urj_bus_ixp425_bus;
extern const urj_bus_driver_t urj_bus_ixp435_bus;
extern const urj_bus_driver_t urj_bus_ixp465_bus;
extern const urj_bus_driver_t urj_bus_jopcyc_bus;
extern const urj_bus_driver_t urj_bus_lh7a400_bus;
extern const urj_bus_driver_t urj_bus_mpc5200_bus;

@ -0,0 +1,313 @@
/*
* $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 Christian Pellegrin <chri@ascensit.com>, 2003.
* Modified by Marcel Telka <marcel@telka.sk>, 2003.
*
*/
#include "sysdep.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "part.h"
#include "bus.h"
#include "chain.h"
#include "bssignal.h"
#include "jtag.h"
#include "buses.h"
#include "generic_bus.h"
typedef struct {
urj_part_signal_t *ex_cs[8];
urj_part_signal_t *ex_addr[24];
urj_part_signal_t *ex_data[16];
urj_part_signal_t *ex_wr;
urj_part_signal_t *ex_rd;
} bus_params_t;
#define ex_cs_n ((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
#define ex_wr_n ((bus_params_t *) bus->params)->ex_wr
#define ex_rd_n ((bus_params_t *) bus->params)->ex_rd
/**
* bus->driver->(*new_bus)
*
*/
static urj_bus_t *
ixp465_bus_new (urj_chain_t *chain,
const urj_bus_driver_t *driver,
const urj_param_t *cmd_params[])
{
urj_bus_t *bus;
urj_part_t *part;
char buff[15];
int i;
int failed = 0;
// bus = calloc( 1, sizeof (urj_bus_t) );
// if (!bus)
// return NULL;
// bus->driver = driver;
// bus->params = calloc( 1, sizeof (bus_params_t) );
// if (!bus->params) {
// free( bus );
// return NULL;
// }
// CHAIN = chain;
// PART = part = chain->parts->parts[chain->active_part];
bus = urj_bus_generic_new (chain, driver, sizeof (bus_params_t));
if (bus == NULL)
return NULL;
part = bus->part;
for (i = 0; i < 8; i++) {
sprintf (buff, "ex_cs_n_%d", i);
failed |= urj_bus_generic_attach_sig (part, &(ex_cs_n[i]), buff);
}
for (i = 0; i < 24; i++) {
sprintf (buff, "ex_addr_%d", i);
failed |= urj_bus_generic_attach_sig (part, &(ex_addr[i]), buff);
}
for (i = 0; i < 16; i++) {
sprintf (buff, "ex_data_%d", i);
failed |= urj_bus_generic_attach_sig (part, &(ex_data[i]), buff);
}
failed |= urj_bus_generic_attach_sig (part, &(ex_wr_n), "ex_wr_n");
failed |= urj_bus_generic_attach_sig (part, &(ex_rd_n), "ex_rd_n");
if (failed) {
urj_bus_generic_free (bus);
return NULL;
}
return bus;
}
/**
* bus->driver->(*printinfo)
*
*/
static void
ixp465_bus_printinfo (urj_log_level_t ll, urj_bus_t *bus)
{
int i;
for (i = 0; i < bus->chain->parts->len; i++)
if (bus->part == bus->chain->parts->parts[i])
break;
urj_log (ll, _("Intel IXP465 compatible bus driver (JTAG part No. %d)\n"),
i);
}
/**
* bus->driver->(*area)
*
*/
static int
ixp465_bus_area (urj_bus_t *bus, uint32_t adr, urj_bus_area_t *area)
{
area->description = NULL;
area->start = UINT32_C (0x00000000);
area->length = UINT64_C (0x100000000);
area->width = 16;
return URJ_STATUS_OK;
}
static void
select_flash (urj_bus_t *bus)
{
//urj_part_t *p = PART;
urj_part_t *p = bus->part;
urj_part_set_signal (p, ex_cs_n[0], 1, 0);
urj_part_set_signal (p, ex_cs_n[1], 1, 1);
urj_part_set_signal (p, ex_cs_n[2], 1, 1);
urj_part_set_signal (p, ex_cs_n[3], 1, 1);
urj_part_set_signal (p, ex_cs_n[4], 1, 1);
urj_part_set_signal (p, ex_cs_n[5], 1, 1);
urj_part_set_signal (p, ex_cs_n[6], 1, 1);
urj_part_set_signal (p, ex_cs_n[7], 1, 1);
}
static void
unselect_flash (urj_bus_t *bus)
{
urj_part_t *p = bus->part;
urj_part_set_signal (p, ex_cs_n[0], 1, 1);
urj_part_set_signal (p, ex_cs_n[1], 1, 1);
urj_part_set_signal (p, ex_cs_n[2], 1, 1);
urj_part_set_signal (p, ex_cs_n[3], 1, 1);
urj_part_set_signal (p, ex_cs_n[4], 1, 1);
urj_part_set_signal (p, ex_cs_n[5], 1, 1);
urj_part_set_signal (p, ex_cs_n[6], 1, 1);
urj_part_set_signal (p, ex_cs_n[7], 1, 1);
}
static void
setup_address (urj_bus_t *bus, uint32_t a)
{
int i;
urj_part_t *p = bus->part;
for (i = 0; i < 24; i++)
urj_part_set_signal (p, ex_addr[i], 1, (a >> i) & 1);
}
static void
set_data_in (urj_bus_t *bus)
{
int i;
urj_part_t *p = bus->part;
for (i = 0; i < 16; i++)
urj_part_set_signal (p, ex_data[i], 0, 0);
}
static void
setup_data (urj_bus_t *bus, uint32_t d)
{
int i;
urj_part_t *p = bus->part;
for (i = 0; i < 16; i++)
urj_part_set_signal (p, ex_data[i], 1, (d >> i) & 1);
}
/**
* bus->driver->(*read_start)
*
*/
static int
ixp465_bus_read_start (urj_bus_t *bus, uint32_t adr)
{
urj_part_t *p = bus->part;
urj_chain_t *chain = bus->chain;
select_flash( bus );
urj_part_set_signal (p, ex_rd_n, 1, 0);
urj_part_set_signal (p, ex_wr_n, 1, 1);
setup_address (bus, adr);
set_data_in (bus);
urj_tap_chain_shift_data_registers (chain, 0);
return URJ_STATUS_OK;
}
/**
* bus->driver->(*read_next)
*
*/
static uint32_t
ixp465_bus_read_next (urj_bus_t *bus, uint32_t adr)
{
urj_part_t *p = bus->part;
urj_chain_t *chain = bus->chain;
int i;
uint32_t d = 0;
setup_address (bus, adr);
urj_tap_chain_shift_data_registers (chain, 1);
for (i = 0; i < 16; i++)
d |= (uint32_t) (urj_part_get_signal (p, ex_data[i] ) << i);
return d;
}
/**
* bus->driver->(*read_end)
*
*/
static uint32_t
ixp465_bus_read_end (urj_bus_t *bus)
{
urj_part_t *p = bus->part;
urj_chain_t *chain = bus->chain;
int i;
uint32_t d = 0;
unselect_flash (bus);
urj_part_set_signal (p, ex_rd_n, 1, 1);
urj_part_set_signal (p, ex_wr_n, 1, 1);
urj_tap_chain_shift_data_registers (chain, 1);
for (i = 0; i < 16; i++)
d |= (uint32_t) (urj_part_get_signal (p, ex_data[i] ) << i);
return d;
}
/**
* bus->driver->(*write)
*
*/
static void
ixp465_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data)
{
urj_part_t *p = bus->part;
urj_chain_t *chain = bus->chain;
select_flash (bus);
urj_part_set_signal (p, ex_rd_n, 1, 1);
setup_address (bus, adr);
setup_data (bus, data);
urj_tap_chain_shift_data_registers (chain, 0);
urj_part_set_signal (p, ex_wr_n, 1, 0);
urj_tap_chain_shift_data_registers (chain, 0);
urj_part_set_signal (p, ex_wr_n, 1, 1);
unselect_flash (bus);
urj_tap_chain_shift_data_registers (chain, 0);
}
const urj_bus_driver_t urj_bus_ixp465_bus = {
"ixp465",
N_("Intel IXP465 compatible bus driver via BSR"),
ixp465_bus_new,
urj_bus_generic_free,
ixp465_bus_printinfo,
urj_bus_generic_prepare_extest,
ixp465_bus_area,
ixp465_bus_read_start,
ixp465_bus_read_next,
ixp465_bus_read_end,
urj_bus_generic_read,
ixp465_bus_write,
urj_bus_generic_no_init
};
Loading…
Cancel
Save