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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [or1ksim/] [peripheral/] [atahost.c] - Diff between revs 1350 and 1358

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

Rev 1350 Rev 1358
Line 318... Line 318...
#endif
#endif
  }
  }
}
}
/* ========================================================================= */
/* ========================================================================= */
 
 
 No newline at end of file
 No newline at end of file
 
/*----------------------------------------------------[ ATA Configuration ]---*/
 
void ata_natas(union param_val val, void *dat)
 
{
 
  if (val.int_val >= 0 && val.int_val < MAX_ATAS)
 
    config.natas = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid number of devices.");
 
}
 
 
 
void ata_baseaddr(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.natas)
 
    config.atas[current_device].baseaddr = val.addr_val;
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void ata_irq(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.natas)
 
    config.atas[current_device].irq = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void ata_dev_type0(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.natas)
 
    config.atas[current_device].dev_type0 = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void ata_dev_file0(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.natas)
 
    strcpy (config.atas[current_device].dev_file0, val.str_val);
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void ata_dev_size0(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.natas)
 
    config.atas[current_device].dev_size0 = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void ata_dev_packet0(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.natas)
 
    config.atas[current_device].dev_packet0 = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void ata_dev_type1(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.natas)
 
    config.atas[current_device].dev_type1 = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void ata_dev_file1(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.natas)
 
    strcpy (config.atas[current_device].dev_file1, val.str_val);
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void ata_dev_size1(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.natas)
 
    config.atas[current_device].dev_size1 = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void ata_dev_packet1(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.natas)
 
    config.atas[current_device].dev_packet1 = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void reg_ata_sec(void)
 
{
 
  struct config_section *sec = reg_config_sec("ata", NULL, NULL);
 
 
 
  reg_config_param(sec, "natas", paramt_int, ata_natas);
 
  reg_config_param(sec, "device", paramt_int, change_device);
 
  reg_config_param(sec, "baseaddr", paramt_addr, ata_baseaddr);
 
  reg_config_param(sec, "irq", paramt_int, ata_irq);
 
  reg_config_param(sec, "dev_type0", paramt_int, ata_dev_type0);
 
  reg_config_param(sec, "dev_file0", paramt_str, ata_dev_file0);
 
  reg_config_param(sec, "dev_size0", paramt_int, ata_dev_size0);
 
  reg_config_param(sec, "dev_packet0", paramt_int, ata_dev_packet0);
 
  reg_config_param(sec, "dev_type1", paramt_int, ata_dev_type1);
 
  reg_config_param(sec, "dev_file1", paramt_str, ata_dev_file1);
 
  reg_config_param(sec, "dev_size1", paramt_int, ata_dev_size1);
 
  reg_config_param(sec, "dev_packet1", paramt_int, ata_dev_packet1);
 
  reg_config_param(sec, "enddevice", paramt_none, end_device);
 
}
 
 
 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.