* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw.h"
#include "omap.h"
#include "sd.h"
struct omap_mmc_s {
- target_phys_addr_t base;
qemu_irq irq;
qemu_irq *dma;
qemu_irq coverswitch;
{
uint32_t rspstatus, mask;
int rsplen, timeout;
- struct sd_request_s request;
+ SDRequest request;
uint8_t response[16];
if (init && cmd == 0) {
}
}
-static CPUReadMemoryFunc *omap_mmc_readfn[] = {
+static CPUReadMemoryFunc * const omap_mmc_readfn[] = {
omap_badwidth_read16,
omap_mmc_read,
omap_badwidth_read16,
};
-static CPUWriteMemoryFunc *omap_mmc_writefn[] = {
+static CPUWriteMemoryFunc * const omap_mmc_writefn[] = {
omap_badwidth_write16,
omap_mmc_write,
omap_badwidth_write16,
if (!host->cdet_state && level) {
host->status |= 0x0002;
omap_mmc_interrupts_update(host);
- if (host->cdet_wakeup)
- /* TODO: Assert wake-up */;
+ if (host->cdet_wakeup) {
+ /* TODO: Assert wake-up */
+ }
}
if (host->cdet_state != level) {
qemu_mallocz(sizeof(struct omap_mmc_s));
s->irq = irq;
- s->base = base;
s->dma = dma;
s->clk = clk;
s->lines = 1; /* TODO: needs to be settable per-board */
omap_mmc_reset(s);
- iomemtype = cpu_register_io_memory(0, omap_mmc_readfn,
- omap_mmc_writefn, s);
- cpu_register_physical_memory(s->base, 0x800, iomemtype);
+ iomemtype = cpu_register_io_memory(omap_mmc_readfn,
+ omap_mmc_writefn, s, DEVICE_NATIVE_ENDIAN);
+ cpu_register_physical_memory(base, 0x800, iomemtype);
/* Instantiate the storage */
s->card = sd_init(bd, 0);
omap_mmc_reset(s);
- iomemtype = l4_register_io_memory(0, omap_mmc_readfn,
+ iomemtype = l4_register_io_memory(omap_mmc_readfn,
omap_mmc_writefn, s);
- s->base = omap_l4_attach(ta, 0, iomemtype);
+ omap_l4_attach(ta, 0, iomemtype);
/* Instantiate the storage */
s->card = sd_init(bd, 0);
s->cdet = qemu_allocate_irqs(omap_mmc_cover_cb, s, 1)[0];
- sd_set_cb(s->card, 0, s->cdet);
+ sd_set_cb(s->card, NULL, s->cdet);
return s;
}