From 8ddecd8538f688bde0f2c8c6d71b2062bac04b09 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Thu, 28 Apr 2022 18:34:38 +0200 Subject: libpayload/nvme: Fix controller disablement in (de)init sequence We wrote to the wrong register. The EN bit is in the CC (Controller Configuration) register at 0x14. Fixes re-initialization in QEMU and on siemens/chili during a second FILO run. Change-Id: I125de55d7f1a7c9f070437190c5a08a288b274f8 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/coreboot/+/63935 Tested-by: build bot (Jenkins) Reviewed-by: Thomas Heijligen Reviewed-by: Angel Pons --- payloads/libpayload/drivers/storage/nvme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/payloads/libpayload/drivers/storage/nvme.c b/payloads/libpayload/drivers/storage/nvme.c index 7bcb05dec1..f6076d35e8 100644 --- a/payloads/libpayload/drivers/storage/nvme.c +++ b/payloads/libpayload/drivers/storage/nvme.c @@ -147,7 +147,7 @@ static void nvme_detach_device(struct storage_dev *dev) if (delete_admin_queues(nvme)) printf("NVME ERROR: Failed to delete admin queues\n"); - write32(nvme->config + 0x1c, 0); + write32(nvme->config + 0x14, 0); int status, timeout = (read64(nvme->config) >> 24 & 0xff) * 500; do { @@ -347,7 +347,7 @@ static void nvme_init(pcidev_t dev) const uint32_t cc = NVME_CC_EN | NVME_CC_CSS | NVME_CC_MPS | NVME_CC_AMS | NVME_CC_SHN | NVME_CC_IOSQES | NVME_CC_IOCQES; - write32(nvme->config + 0x1c, 0); + write32(nvme->config + 0x14, 0); int status, timeout = (read64(nvme->config) >> 24 & 0xff) * 500; do { -- cgit v1.2.3