mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
hw/cxl: Add utility functions decoder interleave ways and target count.
As an encoded version of these key configuration parameters is available in a register, provide functions to extract it again so as to avoid the need for duplicating the storage. Whilst here update the _enc() function to include additional values as defined in the CXL 3.0 specification. Whilst they are not currently used in the emulation, they may be in future and it is easier to compare with the specification if all values are covered. Add a spec reference for cxl_interleave_ways_enc() for consistency with the target count equivalent (and because it's nice to know where the magic numbers come from). Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Fan Ni <fan.ni@samsung.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Message-Id: <20230913132523.29780-3-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
f5a4e1a697
commit
87de174ac4
2 changed files with 56 additions and 6 deletions
|
@ -226,8 +226,10 @@ void cxl_component_create_dvsec(CXLComponentState *cxl_cstate,
|
|||
uint16_t type, uint8_t rev, uint8_t *body);
|
||||
|
||||
int cxl_decoder_count_enc(int count);
|
||||
int cxl_decoder_count_dec(int enc_cnt);
|
||||
|
||||
uint8_t cxl_interleave_ways_enc(int iw, Error **errp);
|
||||
int cxl_interleave_ways_dec(uint8_t iw_enc, Error **errp);
|
||||
uint8_t cxl_interleave_granularity_enc(uint64_t gran, Error **errp);
|
||||
|
||||
hwaddr cxl_decode_ig(int ig);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue