Standard SD host controller model
Subsystems (2)
cover Standard SD host controller model
[Original cover by Igor]
First patch introduces standard SD host controller model. This is accumulated version of my previous patch I sent a while ago and a recent SDHCI patch by Peter A. G. Crosthwaite. Second patch introduces Exynos4210-specific SDHCI built on top of standard SDHCI model.
[New]
Third patch changes the -sd command line argument to be repeatable, to support multiple SD controllers in one system. Fourth patch adds 2x SDHCI controllers to the Xilinx Zynq machine
This revision is typo fixes and rebasing only.
Changelog:
Changed from v3:
Rebased for new Makefile system
Fixed include guard in sdhci.h
Typos in commit messages
Changed from v2:
corrected typo errors in ADMA1 support
added patches 3-4v1->v2
PATCH1:
add support for ADMA1 (I havn't tested it though).
fixed s->prnsts <-> s->pwrcon typo (thanks to Peter, strange that it even worked before).
PATCH2:
change header prefix from "target-arm" to "exynos4210".
Igor Mitsyanko (2):
hw: introduce standard SD host controller
exynos4210: Added SD host controller model
Peter A. G. Crosthwaite (2):
vl.c: allow for repeated -sd arguments
xilinx_zynq: Added SD controllers
default-configs/arm-softmmu.mak | 1 + hw/Makefile.objs | 1 + hw/arm/Makefile.objs | 1 + hw/exynos4210.c | 20 + hw/exynos4210_sdhci.c | 438 +++++++++++++ hw/sdhci.c | 1306 +++++++++++++++++++++++++++++++++++++++ hw/sdhci.h | 310 +++++++++ hw/xilinx_zynq.c | 12 + vl.c | 2 +- 9 files changed, 2090 insertions(+), 1 deletions(-) create mode 100644 hw/exynos4210_sdhci.c create mode 100644 hw/sdhci.c create mode 100644 hw/sdhci.h
Signature · 1 line
1.7.3.2
PATCH 1/4 hw: introduce standard SD host controller
From: Igor Mitsyanko <[email protected]>
Device model for standard SD Host Controller Interface (SDHCI) compliant with version 2.00 of SD association specification.
---
changed from v1:
Fixed include guard (Andreas review)
Rebased for new Makefile system
changed from v2:
Typographical fixes for adma implementation:
-dscr->attr = (uint8_t)(adma2 & 0x3F);
+dscr->attr = (uint8_t)(adma1 & 0x3F);
-#define SDHC_CTRL_ADMA1_32 0x01
+#define SDHC_CTRL_ADMA1_32 0x08
default-configs/arm-softmmu.mak | 1 + hw/Makefile.objs | 1 + hw/sdhci.c | 1306 +++++++++++++++++++++++++++++++++++++++ hw/sdhci.h | 310 +++++++++ 4 files changed, 1618 insertions(+), 0 deletions(-) create mode 100644 hw/sdhci.c create mode 100644 hw/sdhci.h
default-configs/arm-softmmu.mak +1 -0
@@ -27,3 +27,4 @@ CONFIG_SMC91C111=y CONFIG_DS1338=y CONFIG_PFLASH_CFI01=y CONFIG_PFLASH_CFI02=y +CONFIG_SDHCI=y
hw/Makefile.objs +1 -0
@@ -35,6 +35,7 @@ hw-obj-$(CONFIG_APPLESMC) += applesmc.o hw-obj-$(CONFIG_SMARTCARD) += ccid-card-passthru.o hw-obj-$(CONFIG_SMARTCARD_NSS) += ccid-card-emulated.o hw-obj-$(CONFIG_I8259) += i8259_common.o i8259.o +hw-obj-$(CONFIG_SDHCI) += sdhci.o # PPC devices hw-obj-$(CONFIG_PREP_PCI) += prep_pci.o
hw/sdhci.c new file +1306 -0
1,306 lines not on this page · raw message
hw/sdhci.h new file +310 -0
310 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 2/4 exynos4210: Added SD host controller model
In reply to Peter A. G. CrosthwaiteFrom: Igor Mitsyanko <[email protected]>
Custom Exynos4210 SD/MMC host controller, based on SD association standard host controller ver. 2.00.
---
changed from v3:
rebased for new Makefile system
fixed commit msg typo (Andreas review)
hw/arm/Makefile.objs | 1 + hw/exynos4210.c | 20 +++ hw/exynos4210_sdhci.c | 438 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 459 insertions(+), 0 deletions(-) create mode 100644 hw/exynos4210_sdhci.c
hw/arm/Makefile.objs +1 -0
@@ -11,6 +11,7 @@ obj-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o obj-y += exynos4210_gic.o exynos4210_combiner.o exynos4210.o obj-y += exynos4_boards.o exynos4210_uart.o exynos4210_pwm.o obj-y += exynos4210_pmu.o exynos4210_mct.o exynos4210_fimd.o +obj-y += exynos4210_sdhci.o obj-y += arm_l2x0.o obj-y += arm_mptimer.o a15mpcore.o obj-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
hw/exynos4210.c +20 -0
@@ -56,6 +56,12 @@#define EXYNOS4210_EXT_COMBINER_BASE_ADDR 0x10440000#define EXYNOS4210_INT_COMBINER_BASE_ADDR 0x10448000 +/* SD/MMC host controllers SFR base addresses */ +#define EXYNOS4210_SDHC0_BASE_ADDR 0x12510000 +#define EXYNOS4210_SDHC1_BASE_ADDR 0x12520000 +#define EXYNOS4210_SDHC2_BASE_ADDR 0x12530000 +#define EXYNOS4210_SDHC3_BASE_ADDR 0x12540000 +/* PMU SFR base address */ #define EXYNOS4210_PMU_BASE_ADDR 0x10020000
@@ -290,6 +296,20 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem,EXYNOS4210_UART3_FIFO_SIZE ,3 ,NULL , s->irq_table[exynos4210_get_irq(EXYNOS4210_UART_INT_GRP, 3)]); +/*** SD/MMC host controllers ***/ + +sysbus_create_simple ("exynos4210.sdhci" ,EXYNOS4210_SDHC0_BASE_ADDR , + s->irq_table[exynos4210_get_irq (29 ,0 )]); + +sysbus_create_simple ("exynos4210.sdhci" ,EXYNOS4210_SDHC1_BASE_ADDR , + s->irq_table[exynos4210_get_irq (29 ,1 )]); + +sysbus_create_simple ("exynos4210.sdhci" ,EXYNOS4210_SDHC2_BASE_ADDR , + s->irq_table[exynos4210_get_irq (29 ,2 )]); + +sysbus_create_simple ("exynos4210.sdhci" ,EXYNOS4210_SDHC3_BASE_ADDR , + s->irq_table[exynos4210_get_irq (29 ,3 )]); +/*** Display controller (FIMD) ***/ sysbus_create_varargs("exynos4210.fimd", EXYNOS4210_FIMD0_BASE_ADDR, s->irq_table[exynos4210_get_irq(11, 0)],
hw/exynos4210_sdhci.c new file +438 -0
438 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 3/4 vl.c: allow for repeated -sd arguments
In reply to Peter A. G. CrosthwaiteAllows for repeating of -sd arugments in the same way as -pflash and -mtdblock.
---
changed from v3:
fixed commit msg typo
vl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
vl.c +1 -1
@@ -2431,7 +2431,7 @@ int main(int argc, char **argv, char **envp)drive_add (IF_MTD ,-1 , optarg,MTD_OPTS );break ;case QEMU_OPTION_sd: -drive_add (IF_SD ,0 , optarg,SD_OPTS ); +drive_add (IF_SD ,-1 , optarg,SD_OPTS );break ;case QEMU_OPTION_pflash:drive_add (IF_PFLASH ,-1 , optarg,PFLASH_OPTS );
Signature · 1 line
1.7.3.2
PATCH 4/4 xilinx_zynq: Added SD controllers
In reply to Peter A. G. CrosthwaiteThe Xilinx Zynq device has two SDHCI controllers. Added to the machine model.
---
changed from v3:
fixed indentation
tweaked commit msg
hw/xilinx_zynq.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
hw/xilinx_zynq.c +12 -0
@@ -130,6 +130,18 @@ static void zynq_init(ram_addr_t ram_size, const char *boot_device, } } + { + dev =qdev_create (NULL ,"sdhci" ); +qdev_init_nofail (dev); +sysbus_mmio_map (sysbus_from_qdev (dev),0 ,0xE0100000 ); +sysbus_connect_irq (sysbus_from_qdev (dev),0 , pic[56 -IRQ_OFFSET ]); + + dev =qdev_create (NULL ,"sdhci" ); +qdev_init_nofail (dev); +sysbus_mmio_map (sysbus_from_qdev (dev),0 ,0xE0101000 ); +sysbus_connect_irq (sysbus_from_qdev (dev),0 , pic[79 -IRQ_OFFSET ]); + } + zynq_binfo.ram_size = ram_size; zynq_binfo.kernel_filename = kernel_filename; zynq_binfo.kernel_cmdline = kernel_cmdline;
Signature · 1 line
1.7.3.2
ergh,
series version number is incorrect, this is v4.
Quoted 50 lines · Peter A. G. Crosthwaite
[Original cover by Igor]
First patch introduces standard SD host controller model. This is accumulated version of my previous patch I sent a while ago and a recent SDHCI patch by Peter A. G. Crosthwaite. Second patch introduces Exynos4210-specific SDHCI built on top of standard SDHCI model.[New]
Third patch changes the -sd command line argument to be repeatable, to support multiple SD controllers in one system. Fourth patch adds 2x SDHCI controllers to the Xilinx Zynq machineThis revision is typo fixes and rebasing only.
Changelog:
Changed from v3:
Rebased for newMakefilesystem
Fixed include guard insdhci.h
Typos in commit messages
Changed from v2:
corrected typo errors in ADMA1 support
added patches 3-4v1->v2
PATCH1:
add support for ADMA1 (I havn't tested it though).
fixeds->prnsts<->s->pwrcontypo (thanks to Peter, strange that it even worked before).
PATCH2:
change header prefix from "target-arm" to "exynos4210".Igor Mitsyanko (2):
hw: introduce standard SD host controller
exynos4210: Added SD host controller modelPeter A. G. Crosthwaite (2):
vl.c: allow for repeated -sd arguments
xilinx_zynq: Added SD controllersdefault-configs/arm-softmmu.mak | 1 +
hw/Makefile.objs | 1 +
hw/arm/Makefile.objs | 1 +
hw/exynos4210.c | 20 +
hw/exynos4210_sdhci.c | 438 +++++++++++++
hw/sdhci.c | 1306 +++++++++++++++++++++++++++++++++++++++hw/sdhci.h| 310 +++++++++
hw/xilinx_zynq.c | 12 +
vl.c | 2 +-9 files changed, 2090 insertions(+), 1 deletions(-)create mode 100644
hw/exynos4210_sdhci.c
create mode 100644hw/sdhci.c
create mode 100644hw/sdhci.h--
1.7.3.2
Re: [Qemu-devel] [PATCH v1 3/4] vl.c: allow for repeated -sd arguments
In reply to Peter A. G. CrosthwaiteQuoted 15 lines · Peter A. G. Crosthwaite
Allows for repeating of -sd arugments in the same way as -pflash and -mtdblock.
Signed-off-by Peter A. G. Crosthwaite<[email protected]>---
changed from v3:
fixed commit msg typovl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)vl.c +0
-0
vl.c int main(int argc, char **argv, char **envp) · line 2437
Quoted 8 lines
vl.c +1
-1@@ -2431,7 +2431,7 @@ int main(int argc, char **argv, char **envp)drive_add (IF_MTD ,-1 , optarg,MTD_OPTS );break ;case QEMU_OPTION_sd: -drive_add (IF_SD ,0 , optarg,SD_OPTS ); +drive_add (IF_SD ,-1 , optarg,SD_OPTS );break ;case QEMU_OPTION_pflash:drive_add (IF_PFLASH ,-1 , optarg,PFLASH_OPTS );
Nice. Sometimes its really annoying to type full "-drive .." command
Ping!
We good to go on this one? Whose queue should this go in or should I PULL?
Quoted 56 lines · Peter Crosthwaite
ergh,
series version number is incorrect, this is v4.
Quoted 50 lines · Peter A. G. Crosthwaite
[Original cover by Igor]
First patch introduces standard SD host controller model. This is accumulated version of my previous patch I sent a while ago and a recent SDHCI patch by Peter A. G. Crosthwaite. Second patch introduces Exynos4210-specific SDHCI built on top of standard SDHCI model.[New]
Third patch changes the -sd command line argument to be repeatable, to support multiple SD controllers in one system. Fourth patch adds 2x SDHCI controllers to the Xilinx Zynq machineThis revision is typo fixes and rebasing only.
Changelog:
Changed from v3:
Rebased for newMakefilesystem
Fixed include guard insdhci.h
Typos in commit messages
Changed from v2:
corrected typo errors in ADMA1 support
added patches 3-4v1->v2
PATCH1:
add support for ADMA1 (I havn't tested it though).
fixeds->prnsts<->s->pwrcontypo (thanks to Peter, strange that it even worked before).
PATCH2:
change header prefix from "target-arm" to "exynos4210".Igor Mitsyanko (2):
hw: introduce standard SD host controller
exynos4210: Added SD host controller modelPeter A. G. Crosthwaite (2):
vl.c: allow for repeated -sd arguments
xilinx_zynq: Added SD controllersdefault-configs/arm-softmmu.mak | 1 +
hw/Makefile.objs | 1 +
hw/arm/Makefile.objs | 1 +
hw/exynos4210.c | 20 +
hw/exynos4210_sdhci.c | 438 +++++++++++++
hw/sdhci.c | 1306 +++++++++++++++++++++++++++++++++++++++hw/sdhci.h| 310 +++++++++
hw/xilinx_zynq.c | 12 +
vl.c | 2 +-9 files changed, 2090 insertions(+), 1 deletions(-)create mode 100644
hw/exynos4210_sdhci.c
create mode 100644hw/sdhci.c
create mode 100644hw/sdhci.h--
1.7.3.2