Changeset 4 for trunk/kernel/drivers/soclib/soclib_mmc.c
- Timestamp:
- Apr 26, 2017, 2:10:21 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/drivers/soclib/soclib_mmc.c
r1 r4 24 24 25 25 #include <hal_types.h> 26 #include < device.h>26 #include <chdev.h> 27 27 #include <dev_mmc.h> 28 28 #include <soclib_mmc.h> … … 32 32 33 33 34 ///////////////////////////////////// 35 void soclib_mmc_init( xptr_t dev_xp)34 /////////////////////////////////////// 35 void soclib_mmc_init( chdev_t * chdev ) 36 36 { 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 ); 45 39 46 40 // enable MMC IRQ … … 49 43 50 44 51 ////////////////////////////////////////////////////////////// ////52 void __attribute__ ((noinline)) soclib_mmc_c ommand( xptr_t th_xp )45 ////////////////////////////////////////////////////////////// 46 void __attribute__ ((noinline)) soclib_mmc_cmd( xptr_t th_xp ) 53 47 { 54 48 xptr_t dev_xp; // extended pointer on MMC device … … 64 58 65 59 // 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 ) ); 68 62 69 63 // get MMC device cluster and local pointer 70 cxy_t 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 ); 72 66 73 67 // get extended pointer on SOCLIB-MMC peripheral … … 81 75 { 82 76 // 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 ) ); 84 78 85 79 // split buffer paddr in two 32 bits words … … 88 82 89 83 // 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 ) ); 91 85 92 86 // get command type … … 102 96 { 103 97 // 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 ) ); 106 100 107 101 // move register to/from local buffer … … 119 113 120 114 //////////////////////////////////////////////////////////////// 121 void __attribute__ ((noinline)) soclib_mmc_isr( device_t *dev )115 void __attribute__ ((noinline)) soclib_mmc_isr( chdev_t * chdev ) 122 116 { 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 ); 128 119 129 120 // get faulty ADDRESS and SRCID from MMC registers
Note: See TracChangeset
for help on using the changeset viewer.