2017-02-28 13:08:19 +01:00
|
|
|
/*
|
|
|
|
* Raspberry Pi (BCM2835) SD Host Controller
|
|
|
|
*
|
|
|
|
* Copyright (c) 2017 Antfield SAS
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Clement Deschamps <clement.deschamps@antfield.fr>
|
|
|
|
* Luc Michel <luc.michel@antfield.fr>
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BCM2835_SDHOST_H
|
|
|
|
#define BCM2835_SDHOST_H
|
|
|
|
|
|
|
|
#include "hw/sysbus.h"
|
|
|
|
#include "hw/sd/sd.h"
|
2020-09-03 22:43:22 +02:00
|
|
|
#include "qom/object.h"
|
2017-02-28 13:08:19 +01:00
|
|
|
|
|
|
|
#define TYPE_BCM2835_SDHOST "bcm2835-sdhost"
|
2020-09-16 20:25:19 +02:00
|
|
|
OBJECT_DECLARE_SIMPLE_TYPE(BCM2835SDHostState, BCM2835_SDHOST)
|
2017-02-28 13:08:19 +01:00
|
|
|
|
|
|
|
#define BCM2835_SDHOST_FIFO_LEN 16
|
|
|
|
|
2020-09-03 22:43:22 +02:00
|
|
|
struct BCM2835SDHostState {
|
2017-02-28 13:08:19 +01:00
|
|
|
SysBusDevice busdev;
|
|
|
|
SDBus sdbus;
|
|
|
|
MemoryRegion iomem;
|
|
|
|
|
|
|
|
uint32_t cmd;
|
|
|
|
uint32_t cmdarg;
|
|
|
|
uint32_t status;
|
|
|
|
uint32_t rsp[4];
|
|
|
|
uint32_t config;
|
|
|
|
uint32_t edm;
|
|
|
|
uint32_t vdd;
|
|
|
|
uint32_t hbct;
|
|
|
|
uint32_t hblc;
|
|
|
|
int32_t fifo_pos;
|
|
|
|
int32_t fifo_len;
|
|
|
|
uint32_t fifo[BCM2835_SDHOST_FIFO_LEN];
|
|
|
|
uint32_t datacnt;
|
|
|
|
|
|
|
|
qemu_irq irq;
|
2020-09-03 22:43:22 +02:00
|
|
|
};
|
2017-02-28 13:08:19 +01:00
|
|
|
|
|
|
|
#endif
|