Ignore:
Timestamp:
Apr 26, 2017, 2:10:21 PM (8 years ago)
Author:
alain
Message:

Introduce the chdev_t structure in place of device_t.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/drivers/soclib/soclib_mmc.c

    r1 r4  
    2424
    2525#include <hal_types.h>
    26 #include <device.h>
     26#include <chdev.h>
    2727#include <dev_mmc.h>
    2828#include <soclib_mmc.h>
     
    3232
    3333
    34 /////////////////////////////////////
    35 void soclib_mmc_init( xptr_t dev_xp )
     34///////////////////////////////////////
     35void soclib_mmc_init( chdev_t * chdev )
    3636{
    37     // get local pointer on MMC device descriptor
    38     device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
    39 
    40     // get extended pointer on MMC peripheral from MMC device
    41     xptr_t  mmc_xp = dev_ptr->base;
    42 
    43     // get local pointer on MMC segment base
    44     uint32_t * base = (uint32_t *)GET_PTR( mmc_xp );
     37    // get pointer on MMC segment base
     38    uint32_t * base = (uint32_t *)GET_PTR( chdev->base );
    4539
    4640    // enable MMC IRQ
     
    4943
    5044
    51 //////////////////////////////////////////////////////////////////
    52 void __attribute__ ((noinline)) soclib_mmc_command( xptr_t th_xp )
     45//////////////////////////////////////////////////////////////
     46void __attribute__ ((noinline)) soclib_mmc_cmd( xptr_t th_xp )
    5347{
    5448    xptr_t     dev_xp;       // extended pointer on MMC device
     
    6458
    6559    // get command type and extended pointer on MMC device
    66     type   =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->dev.mmc.type   ) );
    67     dev_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->dev.mmc.dev_xp ) );
     60    type   =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->command.mmc.type   ) );
     61    dev_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->command.mmc.dev_xp ) );
    6862
    6963    // get MMC device cluster and local pointer
    70     cxy_t      dev_cxy = GET_CXY( dev_xp );
    71     device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
     64    cxy_t     dev_cxy = GET_CXY( dev_xp );
     65    chdev_t * dev_ptr = (chdev_t *)GET_PTR( dev_xp );
    7266
    7367    // get extended pointer on SOCLIB-MMC peripheral
     
    8175    {
    8276        // get buffer paddr
    83         buf_paddr = hal_remote_lwd( XPTR( th_cxy , &th_ptr->dev.mmc.buf_paddr ) );
     77        buf_paddr = hal_remote_lwd( XPTR( th_cxy , &th_ptr->command.mmc.buf_paddr ) );
    8478
    8579        // split buffer paddr in two 32 bits words
     
    8882
    8983        // get buffer size
    90         buf_size   = hal_remote_lw( XPTR( th_cxy , &th_ptr->dev.mmc.buf_size ) );
     84        buf_size   = hal_remote_lw( XPTR( th_cxy , &th_ptr->command.mmc.buf_size ) );
    9185
    9286        // get command type
     
    10296    {
    10397        // get src/dst buffer local pointer and register index
    104         reg_ptr   = (uint32_t *)hal_remote_lpt( XPTR( th_cxy , &th_ptr->dev.mmc.reg_ptr ) );
    105         reg_index = hal_remote_lw( XPTR( th_cxy , &th_ptr->dev.mmc.reg_index ) );
     98        reg_ptr   = (uint32_t *)hal_remote_lpt( XPTR( th_cxy , &th_ptr->command.mmc.reg_ptr ) );
     99        reg_index = hal_remote_lw( XPTR( th_cxy , &th_ptr->command.mmc.reg_index ) );
    106100
    107101        // move register to/from local buffer
     
    119113
    120114////////////////////////////////////////////////////////////////
    121 void __attribute__ ((noinline)) soclib_mmc_isr( device_t * dev )
     115void __attribute__ ((noinline)) soclib_mmc_isr( chdev_t * chdev )
    122116{
    123     // get extended pointer on MMC peripheral from MMC device
    124     xptr_t  mmc_xp = dev->base;
    125 
    126     // get local pointer on MMC segment base
    127     uint32_t * base = (uint32_t *)GET_PTR( mmc_xp );
     117    // get pointer on MMC segment base
     118    uint32_t * base = (uint32_t *)GET_PTR( chdev->base );
    128119
    129120    // get faulty ADDRESS and SRCID from MMC registers
Note: See TracChangeset for help on using the changeset viewer.