• Andreas Larsson's avatar
    i2c: ocores: Add support for the GRLIB port of the controller and use function... · a000b8c1
    Andreas Larsson authored
    i2c: ocores: Add support for the GRLIB port of the controller and use function pointers for getreg and setreg functions
    
    The registers in the GRLIB port of the controller are 32-bit and in big endian
    byte order. The PRELOW and PREHIGH registers are merged into one register. The
    subsequent registers have their offset decreased accordingly. Hence the register
    access needs to be handled in a non-standard manner using custom getreg and
    setreg functions.
    
    Add setreg and getreg functions for different register widths and let oc_setreg
    and oc_getreg use function pointers to call the appropriate functions.
    
    A type is added as the data of the of match table entries. A new entry with a
    different compatible string is added to the table. The type of that entry
    triggers usage of the custom grlib functions by setting the setreg and getreg
    function pointers.
    Signed-off-by: default avatarAndreas Larsson <andreas@gaisler.com>
    Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
    a000b8c1
i2c-ocores.c 11.8 KB