diff mbox series

[Aspeed,v47,18/19] hw/sd/sdcard: Add boot config support

Message ID 20240709152556.52896-19-philmd@linaro.org
State New
Headers show
Series [v47,01/19] hw/sd/sdcard: Basis for eMMC support | expand

Commit Message

Philippe Mathieu-Daudé July 9, 2024, 3:25 p.m. UTC
From: Joel Stanley <joel@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 <joel@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
Also squash?
---
 hw/sd/sd.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Cédric Le Goater July 9, 2024, 3:52 p.m. UTC | #1
On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote:
> From: Joel Stanley <joel@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 <joel@jms.id.au>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> Also squash?

where is the "boot-config" property gone ?


Thanks,

C.


> ---
>   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:
Philippe Mathieu-Daudé July 9, 2024, 4:17 p.m. UTC | #2
On 9/7/24 17:52, Cédric Le Goater wrote:
> On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote:
>> From: Joel Stanley <joel@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 <joel@jms.id.au>
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> Also squash?
> 
> where is the "boot-config" property gone ?

Replaced by patch #15 "Implement eMMC 'boot-mode'".
diff mbox series

Patch

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: