Inheriting from Mmio class

Martin Stein martin.stein at ...1...
Thu Dec 8 15:37:05 CET 2016


Hi Johannes,

We actually had an internal discussion about such an approach. As far as
I remember, it was in the context of the Zynq drivers. I absolutely like
the idea of using the Mmio framework with different back-ends. I think
you would have to exchange merely the two raw-access methods of the
framework:

! template <typename _ACCESS_T>
! void Mmio::_write(off_t const, _ACCESS_T const)'
!
! template <typename _ACCESS_T>
! _ACCESS_T Mmio::_read(off_t const) const

The read<>() and write<>() methods you mention should not contain any
code that depends on the way of accessing registers but only the bit and
offset logic that could be reused.

I'm curious about the outcome of your idea and help willingly if you
have further questions.

Cheers,
Martin

Am 07.12.2016 um 18:26 schrieb Johannes Schlatow:
> Hi,
> 
> I really like Genode's Register API as it makes accessing memory mapped hardware registers quite clean and simple.
> 
> However, I recently encountered the need to access a rather complex I2C slave device. The I2C controller itself is accessible via MMIO. Yet, the slave device itself has a notion of registers. Basically, you first send the register address to the I2C slave and, in a second transaction, you can read/write the register's value.
> 
> Being used to the clean appearance of MMIO in Genode, I was wondering whether the access to I2C slave registers could be wrapped in a similar way. My intuition is that it might simply suffice to inherit from the Mmio class and modify the write<>() and read<>() functions but haven't checked the code in detail. Any suggestions/ideas?
> 
> Cheers
>  Johannes
> 
> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today.http://sdm.link/xeonphi
> _______________________________________________
> genode-main mailing list
> genode-main at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
> 




More information about the users mailing list