From: Joel Stanley <j...@jms.id.au>

With this correctly set we can use the enable bit to detect if
partition support is enabled.

Signed-off-by: Joel Stanley <j...@jms.id.au>
Signed-off-by: Cédric Le Goater <c...@kaod.org>
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
Also squash?
---
 hw/sd/sd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 291497468f..6aa83251f7 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1047,6 +1047,12 @@ static uint32_t emmc_bootpart_offset(SDState *sd)
 {
     unsigned int access = sd->ext_csd[EXT_CSD_PART_CONFIG]
                           & EXT_CSD_PART_CONFIG_ACC_MASK;
+    unsigned int enable = sd->ext_csd[EXT_CSD_PART_CONFIG]
+                          & EXT_CSD_PART_CONFIG_EN_MASK;
+
+    if (!enable) {
+        return 0;
+    }
 
     switch (access) {
     case EXT_CSD_PART_CONFIG_ACC_DEFAULT:
-- 
2.41.0


Reply via email to