hw/sd: Remove omap2_mmc device
Remove the OMAP2 specific code from omap_mmc.c. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20240903160751.4100218-42-peter.maydell@linaro.org
This commit is contained in:
parent
7955b50ba1
commit
ce5dd27534
@ -573,24 +573,6 @@ static const MemoryRegionOps omap_mmc_ops = {
|
|||||||
.endianness = DEVICE_NATIVE_ENDIAN,
|
.endianness = DEVICE_NATIVE_ENDIAN,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void omap_mmc_cover_cb(void *opaque, int line, int level)
|
|
||||||
{
|
|
||||||
struct omap_mmc_s *host = opaque;
|
|
||||||
|
|
||||||
if (!host->cdet_state && level) {
|
|
||||||
host->status |= 0x0002;
|
|
||||||
omap_mmc_interrupts_update(host);
|
|
||||||
if (host->cdet_wakeup) {
|
|
||||||
/* TODO: Assert wake-up */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (host->cdet_state != level) {
|
|
||||||
qemu_set_irq(host->coverswitch, level);
|
|
||||||
host->cdet_state = level;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct omap_mmc_s *omap_mmc_init(hwaddr base,
|
struct omap_mmc_s *omap_mmc_init(hwaddr base,
|
||||||
MemoryRegion *sysmem,
|
MemoryRegion *sysmem,
|
||||||
BlockBackend *blk,
|
BlockBackend *blk,
|
||||||
@ -617,48 +599,3 @@ struct omap_mmc_s *omap_mmc_init(hwaddr base,
|
|||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,
|
|
||||||
BlockBackend *blk, qemu_irq irq, qemu_irq dma[],
|
|
||||||
omap_clk fclk, omap_clk iclk)
|
|
||||||
{
|
|
||||||
struct omap_mmc_s *s = g_new0(struct omap_mmc_s, 1);
|
|
||||||
|
|
||||||
s->irq = irq;
|
|
||||||
s->dma = dma;
|
|
||||||
s->clk = fclk;
|
|
||||||
s->lines = 4;
|
|
||||||
s->rev = 2;
|
|
||||||
|
|
||||||
memory_region_init_io(&s->iomem, NULL, &omap_mmc_ops, s, "omap.mmc",
|
|
||||||
omap_l4_region_size(ta, 0));
|
|
||||||
omap_l4_attach(ta, 0, &s->iomem);
|
|
||||||
|
|
||||||
/* Instantiate the storage */
|
|
||||||
s->card = sd_init(blk, false);
|
|
||||||
if (s->card == NULL) {
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
s->cdet = qemu_allocate_irq(omap_mmc_cover_cb, s, 0);
|
|
||||||
sd_set_cb(s->card, NULL, s->cdet);
|
|
||||||
|
|
||||||
omap_mmc_reset(s);
|
|
||||||
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void omap_mmc_handlers(struct omap_mmc_s *s, qemu_irq ro, qemu_irq cover)
|
|
||||||
{
|
|
||||||
if (s->cdet) {
|
|
||||||
sd_set_cb(s->card, ro, s->cdet);
|
|
||||||
s->coverswitch = cover;
|
|
||||||
qemu_set_irq(cover, s->cdet_state);
|
|
||||||
} else
|
|
||||||
sd_set_cb(s->card, ro, cover);
|
|
||||||
}
|
|
||||||
|
|
||||||
void omap_mmc_enable(struct omap_mmc_s *s, int enable)
|
|
||||||
{
|
|
||||||
sd_enable(s->card, enable);
|
|
||||||
}
|
|
||||||
|
@ -797,12 +797,7 @@ struct omap_mmc_s *omap_mmc_init(hwaddr base,
|
|||||||
MemoryRegion *sysmem,
|
MemoryRegion *sysmem,
|
||||||
BlockBackend *blk,
|
BlockBackend *blk,
|
||||||
qemu_irq irq, qemu_irq dma[], omap_clk clk);
|
qemu_irq irq, qemu_irq dma[], omap_clk clk);
|
||||||
struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,
|
|
||||||
BlockBackend *blk, qemu_irq irq, qemu_irq dma[],
|
|
||||||
omap_clk fclk, omap_clk iclk);
|
|
||||||
void omap_mmc_reset(struct omap_mmc_s *s);
|
void omap_mmc_reset(struct omap_mmc_s *s);
|
||||||
void omap_mmc_handlers(struct omap_mmc_s *s, qemu_irq ro, qemu_irq cover);
|
|
||||||
void omap_mmc_enable(struct omap_mmc_s *s, int enable);
|
|
||||||
|
|
||||||
/* omap_i2c.c */
|
/* omap_i2c.c */
|
||||||
I2CBus *omap_i2c_bus(DeviceState *omap_i2c);
|
I2CBus *omap_i2c_bus(DeviceState *omap_i2c);
|
||||||
|
Loading…
Reference in New Issue
Block a user