hw/sd/sdcard: Remove SEND_DSR dead case (CMD4)
commit617c5a734571145f65423336376001bac8fc371a
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 13 Jun 2024 20:38:17 +0000 (13 22:38 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 2 Jul 2024 08:08:32 +0000 (2 10:08 +0200)
treeb3e1563e8ba700ddbca1b385cd4decfb0dee0887
parentde32f0aa9a53db5d4cac8e9a5944c688b0ab24a2
hw/sd/sdcard: Remove SEND_DSR dead case (CMD4)

The CSD::CSR_IMP bit defines whether the Driver Stage
Register (DSR) is implemented or not. We do not set
this bit in CSD:

    static void sd_set_csd(SDState *sd, uint64_t size)
    {
        ...
        if (size <= SDSC_MAX_CAPACITY) { /* Standard Capacity SD */
            ...
            sd->csd[6] = 0xe0 |     /* Partial block for read allowed */
                ((csize >> 10) & 0x03);
            ...
        } else {                    /* SDHC */
            ...
            sd->csd[6] = 0x00;
            ...
        }
        ...
    }

The sd_normal_command() switch case for the SEND_DSR
command do nothing and fallback to "illegal command".
Since the command is mandatory (although the register
isn't...) call the sd_cmd_unimplemented() handler.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-Id: <20240628070216.92609-43-philmd@linaro.org>
hw/sd/sd.c