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

Subversion Repositories or1k

[/] [or1k/] [tags/] [stable_0_2_0_rc2/] [or1ksim/] [peripheral/] [atahost.c] - Diff between revs 1358 and 1359

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

Rev 1358 Rev 1359
Line 81... Line 81...
     if (!first_time)
     if (!first_time)
     {
     {
       /* Connect ata_devices.                                            */
       /* Connect ata_devices.                                            */
       ata_devices_init(&ata->devices, config.atas[i].dev_file0, config.atas[i].dev_file1);
       ata_devices_init(&ata->devices, config.atas[i].dev_file0, config.atas[i].dev_file1);
 
 
       register_memoryarea(ata->baseaddr, ATA_ADDR_SPACE, 4, 0, ata_read32, ata_write32);
       register_memoryarea(ata->baseaddr, ATA_ADDR_SPACE, 4, 0, ata_read32, ata_write32, NULL);
     }
     }
 
 
     /* the reset bit in the control register 'ctrl' is set, reset connect ata-devices */
     /* the reset bit in the control register 'ctrl' is set, reset connect ata-devices */
     ata_devices_hw_reset(&ata->devices, 1);
     ata_devices_hw_reset(&ata->devices, 1);
   }
   }
Line 122... Line 122...
 
 
 
 
/*
/*
  Read a register
  Read a register
*/
*/
uint32_t ata_read32( oraddr_t addr )
uint32_t ata_read32( oraddr_t addr, void *dat )
{
{
    ata_host *ata;
    ata_host *ata;
 
 
    if ( !ata_find_device( addr, &ata, &addr ) )    {
    if ( !ata_find_device( addr, &ata, &addr ) )    {
        fprintf(stderr, "ata_read32( 0x%"PRIxADDR" ): Not in registered range(s)\n", addr );
        fprintf(stderr, "ata_read32( 0x%"PRIxADDR" ): Not in registered range(s)\n", addr );
Line 196... Line 196...
 
 
 
 
/*
/*
  Write a register
  Write a register
*/
*/
void ata_write32( oraddr_t addr, uint32_t value )
void ata_write32( oraddr_t addr, uint32_t value, void *dat )
{
{
    ata_host *ata;
    ata_host *ata;
 
 
    if ( !ata_find_device( addr, &ata, &addr ) )
    if ( !ata_find_device( addr, &ata, &addr ) )
    {
    {

powered by: WebSVN 2.1.0

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