OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or_debug_proxy/] [src/] [usb_functions.c] - Diff between revs 79 and 94

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 79 Rev 94
Line 1104... Line 1104...
 
 
        retry_ok();
        retry_ok();
        return DBG_ERR_OK;
        return DBG_ERR_OK;
}
}
 
 
 
 
 
/* read a word from wishbone */
 
int usb_dbg_wb_read8(uint32_t adr, uint8_t *data) {
 
  if ((err = usb_dbg_set_chain(DC_WISHBONE))) return err;
 
  if ((err = usb_dbg_command(DBG_WB_READ8, adr, 1))) return err;
 
  if ((err = usb_dbg_go((unsigned char*)data, 1, 1))) return err;
 
  //*data = ntohl(*data);
 
  return err;
 
}
 
 
/* read a word from wishbone */
/* read a word from wishbone */
int usb_dbg_wb_read32(uint32_t adr, uint32_t *data) {
int usb_dbg_wb_read32(uint32_t adr, uint32_t *data) {
  // uint32_t err;
  // uint32_t err;
  if ((err = usb_dbg_set_chain(DC_WISHBONE))) return err;
  if ((err = usb_dbg_set_chain(DC_WISHBONE))) return err;
  if ((err = usb_dbg_command(DBG_WB_READ32, adr, 4))) return err;
  if ((err = usb_dbg_command(DBG_WB_READ32, adr, 4))) return err;
  if ((err = usb_dbg_go((unsigned char*)data, 4, 1))) return err;
  if ((err = usb_dbg_go((unsigned char*)data, 4, 1))) return err;
  //*data = ntohl(*data);
  //*data = ntohl(*data);
  return err;
  return err;
}
}
 
 
/* write a word to wishbone */
/* write a byte to wishbone */
int usb_dbg_wb_write8(uint32_t adr, uint8_t data) {
int usb_dbg_wb_write8(uint32_t adr, uint8_t data) {
  if ((err = usb_dbg_set_chain(DC_WISHBONE))) return err;
  if ((err = usb_dbg_set_chain(DC_WISHBONE))) return err;
  if ((err = usb_dbg_command(DBG_WB_WRITE8, adr, 1))) return err;
  if ((err = usb_dbg_command(DBG_WB_WRITE8, adr, 1))) return err;
  if ((err = usb_dbg_go((unsigned char*)&data, 1, 0))) return err;
  if ((err = usb_dbg_go((unsigned char*)&data, 1, 0))) return err;
  return DBG_ERR_OK;
  return DBG_ERR_OK;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.