• Sander Vanheule's avatar
    gpio: Add Realtek Otto GPIO support · 0d82fb11
    Sander Vanheule authored
    Realtek MIPS SoCs (platform name Otto) have GPIO controllers with up to
    64 GPIOs, divided over two banks. Each bank has a set of registers for
    32 GPIOs, with support for edge-triggered interrupts.
    
    Each GPIO bank consists of four 8-bit GPIO ports (ABCD and EFGH). Most
    registers pack one bit per GPIO, except for the IMR register, which
    packs two bits per GPIO (AB-CD).
    
    Although the byte order is currently assumed to have port A..D at offset
    0x0..0x3, this has been observed to be reversed on other, Lexra-based,
    SoCs (e.g. RTL8196E/97D/97F).
    
    Interrupt support is disabled for the fallback devicetree-compatible
    'realtek,otto-gpio'. This allows for quick support of GPIO banks in
    which the byte order would be unknown. In this case, the port ordering
    in the IMR registers may not match the reversed order in the other
    registers (DCBA, and BA-DC or DC-BA).
    Signed-off-by: default avatarSander Vanheule <sander@svanheule.net>
    Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
    Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
    0d82fb11
Makefile 7.97 KB