aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStrahinja Jankovic <strahinjapjankovic@gmail.com>2022-11-21 11:45:12 +0000
committerPeter Maydell <peter.maydell@linaro.org>2022-11-21 11:45:12 +0000
commit93e2da36ed944d05e78905e95983a44624ed064c (patch)
tree5b65e2526641d4c4c993904bef3bda8b6dea3724 /include
parenta082fab9d259473a9d5d53307cf83b1223301181 (diff)
downloadqemu-93e2da36ed944d05e78905e95983a44624ed064c.zip
qemu-93e2da36ed944d05e78905e95983a44624ed064c.tar.gz
qemu-93e2da36ed944d05e78905e95983a44624ed064c.tar.bz2
hw/sd: Fix sun4i allwinner-sdhost for U-Boot
Trying to run U-Boot for Cubieboard (Allwinner A10) fails because it cannot access SD card. The problem is that FIFO register in current allwinner-sdhost implementation is at the address corresponding to Allwinner H3, but not A10. Linux kernel is not affected since Linux driver uses DMA access and does not use FIFO register for reading/writing. This patch adds new class parameter `is_sun4i` and based on that parameter uses register at offset 0x100 either as FIFO register (if sun4i) or as threshold register (if not sun4i; in this case register at 0x200 is FIFO register). Tested with U-Boot and Linux kernel image built for Cubieboard and OrangePi PC. Signed-off-by: Strahinja Jankovic <strahinja.p.jankovic@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20221112214900.24152-1-strahinja.p.jankovic@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/hw/sd/allwinner-sdhost.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/hw/sd/allwinner-sdhost.h b/include/hw/sd/allwinner-sdhost.h
index bfe08ff..30c1e60 100644
--- a/include/hw/sd/allwinner-sdhost.h
+++ b/include/hw/sd/allwinner-sdhost.h
@@ -130,6 +130,7 @@ struct AwSdHostClass {
/** Maximum buffer size in bytes per DMA descriptor */
size_t max_desc_size;
+ bool is_sun4i;
};