OSDN Git Service

hw/cxl/component: Add utils for interleave parameter encoding/decoding
authorJonathan Cameron <jonathan.cameron@huawei.com>
Fri, 29 Apr 2022 14:40:51 +0000 (15:40 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 13 May 2022 10:13:36 +0000 (06:13 -0400)
commit829de299d1a4dcac3cd6c494d1c974bdbc608611
tree10ee4ca91c16548a4980a462f08e24743fcd844c
parent3d6a69b6eb973e5761c8dc489990dcd983f6c099
hw/cxl/component: Add utils for interleave parameter encoding/decoding

Both registers and the CFMWS entries in CDAT use simple encodings
for the number of interleave ways and the interleave granularity.
Introduce simple conversion functions to/from the unencoded
number / size.  So far the iw decode has not been needed so is
it not implemented.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20220429144110.25167-27-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/cxl/cxl-component-utils.c
include/hw/cxl/cxl_component.h