aspeed: i2c: Add new mode support
commitba2cccd64e90f342673e3916dd1c0a8911813903
authorJoe Komlodi <komlodi@google.com>
Mon, 13 Jun 2022 12:05:48 +0000 (13 14:05 +0200)
committerCédric Le Goater <clg@kaod.org>
Wed, 22 Jun 2022 07:49:34 +0000 (22 09:49 +0200)
tree19e3ccb1babe06452827f911dcc2de0c750cf257
parent2260fc6ff3ff384bf384118a9be7aa6bec43b45b
aspeed: i2c: Add new mode support

On AST2600, I2C has a secondary mode, called "new mode", which changes
the layout of registers, adds some minor behavior changes, and
introduces a new way to transfer data called "packet mode".

Most of the bit positions of the fields are the same between old and new
mode, so we use SHARED_FIELD_XX macros to reuse most of the code between
the different modes.

For packet mode, most of the command behavior is the same compared to
other modes, but there are some minor changes to how interrupts are
handled compared to other modes.

Signed-off-by: Joe Komlodi <komlodi@google.com>
Change-Id: I072f8301964f623afc74af1fe50c12e5caef199e
Message-Id: <20220331043248.2237838-6-komlodi@google.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
hw/i2c/aspeed_i2c.c
include/hw/i2c/aspeed_i2c.h