drivers/interrupt_controller: Fix command write in VT-D

A surprising issue: while sys_set_bit() on VTD_GCMD_REG work on
apollo_lake, it seems to create border effect on elkhart_lake: it may
reset some previous bit to 0.

So switching to full write of the register at once, which works for
both.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2021-03-11 18:55:58 +01:00 committed by Anas Nashif
commit f44062a8e6

View file

@ -68,8 +68,12 @@ static void vtd_send_cmd(const struct device *dev,
uint16_t cmd_bit, uint16_t status_bit)
{
uintptr_t base_address = DEVICE_MMIO_GET(dev);
uint32_t value;
sys_set_bit((base_address + VTD_GCMD_REG), cmd_bit);
value = vtd_read_reg32(dev, VTD_GSTS_REG);
value |= BIT(cmd_bit);
vtd_write_reg32(dev, VTD_GCMD_REG, value);
while (!sys_test_bit((base_address + VTD_GSTS_REG),
status_bit)) {