mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
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>
This commit is contained in:
parent
3d6a69b6eb
commit
829de299d1
2 changed files with 42 additions and 0 deletions
|
@ -210,4 +210,12 @@ static inline int cxl_decoder_count_enc(int count)
|
|||
return 0;
|
||||
}
|
||||
|
||||
uint8_t cxl_interleave_ways_enc(int iw, Error **errp);
|
||||
uint8_t cxl_interleave_granularity_enc(uint64_t gran, Error **errp);
|
||||
|
||||
static inline hwaddr cxl_decode_ig(int ig)
|
||||
{
|
||||
return 1 << (ig + 8);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue