summaryrefslogtreecommitdiffstats
path: root/payloads
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2022-04-28 18:34:38 +0200
committerNico Huber <nico.h@gmx.de>2022-05-11 12:19:03 +0000
commit8ddecd8538f688bde0f2c8c6d71b2062bac04b09 (patch)
treebaa1abfbea90df30b83e6657cee85124274b9b90 /payloads
parent88b041897f382d07a3fdc109dcb87cfc5152b9fe (diff)
downloadcoreboot-8ddecd8538f688bde0f2c8c6d71b2062bac04b09.tar.gz
coreboot-8ddecd8538f688bde0f2c8c6d71b2062bac04b09.tar.bz2
coreboot-8ddecd8538f688bde0f2c8c6d71b2062bac04b09.zip
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 <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63935 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'payloads')
-rw-r--r--payloads/libpayload/drivers/storage/nvme.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/payloads/libpayload/drivers/storage/nvme.c b/payloads/libpayload/drivers/storage/nvme.c
index 7bcb05dec14e..f6076d35e8d8 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 {