/* * Driver for MMC and SSD cards for Cavium ThunderX SOCs. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2016 Cavium Inc.
*/ #include <linux/device.h> #include <linux/dma-mapping.h> #include <linux/interrupt.h> #include <linux/mmc/mmc.h> #include <linux/module.h> #include <linux/of.h> #include <linux/of_platform.h> #include <linux/platform_device.h> #include <linux/pci.h> #include"cavium.h"
ret = dma_set_mask(dev, DMA_BIT_MASK(48)); if (ret) goto error;
/* * Clear out any pending interrupts that may be left over from * bootloader. Writing 1 to the bits clears them.
*/
writeq(127, host->base + MIO_EMM_INT_EN(host));
writeq(3, host->base + MIO_EMM_DMA_INT_ENA_W1C(host)); /* Clear DMA FIFO */
writeq(BIT_ULL(16), host->base + MIO_EMM_DMA_FIFO_CFG(host));
ret = thunder_mmc_register_interrupts(host, pdev); if (ret) goto error;
for_each_child_of_node(node, child_node) { /* * mmc_of_parse and devm* require one device per slot. * Create a dummy device per slot and set the node pointer to * the slot. The easiest way to get this is using * of_platform_device_create.
*/ if (of_device_is_compatible(child_node, "mmc-slot")) {
host->slot_pdev[i] = of_platform_device_create(child_node, NULL,
&pdev->dev); if (!host->slot_pdev[i]) continue;
ret = cvm_mmc_of_slot_probe(&host->slot_pdev[i]->dev, host); if (ret) {
of_node_put(child_node); goto error;
}
}
i++;
}
dev_info(dev, "probed\n"); return 0;
error: for (i = 0; i < CAVIUM_MAX_MMC; i++) { if (host->slot[i])
cvm_mmc_of_slot_remove(host->slot[i]); if (host->slot_pdev[i]) {
get_device(&host->slot_pdev[i]->dev);
of_platform_device_destroy(&host->slot_pdev[i]->dev, NULL);
put_device(&host->slot_pdev[i]->dev);
}
}
clk_disable_unprepare(host->clk); return ret;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.