Deleted Added
full compact
ti_mmchs.c (239281) ti_mmchs.c (248407)
1/*-
2 * Copyright (c) 2011
3 * Ben Gray <ben.r.gray@gmail.com>.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 26 unchanged lines hidden (view full) ---

35 *
36 * This driver is still very much a work in progress, I've verified that basic
37 * sector reading can be performed. But I've yet to test it with a file system
38 * or even writing. In addition I've only tested the driver with an SD card,
39 * I've no idea if MMC cards work.
40 *
41 */
42#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2011
3 * Ben Gray <ben.r.gray@gmail.com>.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 26 unchanged lines hidden (view full) ---

35 *
36 * This driver is still very much a work in progress, I've verified that basic
37 * sector reading can be performed. But I've yet to test it with a file system
38 * or even writing. In addition I've only tested the driver with an SD card,
39 * I've no idea if MMC cards work.
40 *
41 */
42#include <sys/cdefs.h>
43__FBSDID("$FreeBSD: head/sys/arm/ti/ti_mmchs.c 239281 2012-08-15 06:31:32Z gonzo $");
43__FBSDID("$FreeBSD: head/sys/arm/ti/ti_mmchs.c 248407 2013-03-17 03:04:43Z ian $");
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/bio.h>
48#include <sys/bus.h>
49#include <sys/conf.h>
50#include <sys/endian.h>
51#include <sys/kernel.h>

--- 1527 unchanged lines hidden (view full) ---

1579 * RETURNS:
1580 * 0 on sucess
1581 * ENOMEM if failed to map register set
1582 */
1583static int
1584ti_mmchs_activate(device_t dev)
1585{
1586 struct ti_mmchs_softc *sc = device_get_softc(dev);
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/bio.h>
48#include <sys/bus.h>
49#include <sys/conf.h>
50#include <sys/endian.h>
51#include <sys/kernel.h>

--- 1527 unchanged lines hidden (view full) ---

1579 * RETURNS:
1580 * 0 on sucess
1581 * ENOMEM if failed to map register set
1582 */
1583static int
1584ti_mmchs_activate(device_t dev)
1585{
1586 struct ti_mmchs_softc *sc = device_get_softc(dev);
1587 unsigned long addr;
1588 int rid;
1589 int err;
1590
1591 /* Get the memory resource for the register mapping */
1592 rid = 0;
1593 sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
1594 RF_ACTIVE);
1595 if (sc->sc_mem_res == NULL)

--- 29 unchanged lines hidden (view full) ---

1625 else if (ti_chip() == CHIP_OMAP_4)
1626 sc->sc_reg_off = OMAP4_MMCHS_REG_OFFSET;
1627 else if (ti_chip() == CHIP_AM335X)
1628 sc->sc_reg_off = AM335X_MMCHS_REG_OFFSET;
1629 else
1630 panic("Unknown OMAP device\n");
1631
1632 /* Get the physical address of the MMC data register, needed for DMA */
1587 int rid;
1588 int err;
1589
1590 /* Get the memory resource for the register mapping */
1591 rid = 0;
1592 sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
1593 RF_ACTIVE);
1594 if (sc->sc_mem_res == NULL)

--- 29 unchanged lines hidden (view full) ---

1624 else if (ti_chip() == CHIP_OMAP_4)
1625 sc->sc_reg_off = OMAP4_MMCHS_REG_OFFSET;
1626 else if (ti_chip() == CHIP_AM335X)
1627 sc->sc_reg_off = AM335X_MMCHS_REG_OFFSET;
1628 else
1629 panic("Unknown OMAP device\n");
1630
1631 /* Get the physical address of the MMC data register, needed for DMA */
1633 addr = vtophys(rman_get_start(sc->sc_mem_res));
1634 sc->sc_data_reg_paddr = addr + sc->sc_reg_off + MMCHS_DATA;
1632 sc->sc_data_reg_paddr = BUS_SPACE_PHYSADDR(sc->sc_mem_res,
1633 sc->sc_reg_off + MMCHS_DATA);
1635
1636 /* Set the initial power state to off */
1637 sc->sc_cur_power_mode = power_off;
1638
1639 return (0);
1640
1641errout:
1642 ti_mmchs_deactivate(dev);

--- 197 unchanged lines hidden ---
1634
1635 /* Set the initial power state to off */
1636 sc->sc_cur_power_mode = power_off;
1637
1638 return (0);
1639
1640errout:
1641 ti_mmchs_deactivate(dev);

--- 197 unchanged lines hidden ---