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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [peripheral/] [dma.c] - Diff between revs 1350 and 1358

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

Rev 1350 Rev 1358
Line 487... Line 487...
void masked_increase( unsigned long *value, unsigned long mask )
void masked_increase( unsigned long *value, unsigned long mask )
{
{
  *value = (*value & ~mask) | ((*value + 4) & mask);
  *value = (*value & ~mask) | ((*value + 4) & mask);
}
}
 
 
 No newline at end of file
 No newline at end of file
 
/*----------------------------------------------------[ DMA configuration ]---*/
 
void dma_ndmas(union param_val val, void *dat)
 
{
 
  if (val.int_val >= 0 && val.int_val < MAX_DMAS)
 
    config.ndmas = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid number of devices.");
 
}
 
 
 
void dma_baseaddr(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.ndmas)
 
    config.dmas[current_device].baseaddr = val.addr_val;
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void dma_irq(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.ndmas)
 
    config.dmas[current_device].irq = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void dma_vapi_id(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.ndmas)
 
    config.dmas[current_device].vapi_id = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void reg_dma_sec(void)
 
{
 
  struct config_section *sec = reg_config_sec("dma", NULL, NULL);
 
 
 
  reg_config_param(sec, "ndmas", paramt_int, dma_ndmas);
 
  reg_config_param(sec, "device", paramt_int, change_device);
 
  reg_config_param(sec, "enddevice", paramt_none, end_device);
 
  reg_config_param(sec, "irq", paramt_int, dma_irq);
 
  reg_config_param(sec, "baseaddr", paramt_addr, dma_baseaddr);
 
  reg_config_param(sec, "vapi_id", paramt_addr, dma_vapi_id);
 
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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