Path: blob/master/arch/arm/mach-mxs/devices/platform-dma.c
10819 views
/*1* Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.2*3* This program is free software; you can redistribute it and/or modify it under4* the terms of the GNU General Public License version 2 as published by the5* Free Software Foundation.6*/7#include <linux/compiler.h>8#include <linux/err.h>9#include <linux/init.h>1011#include <mach/mx23.h>12#include <mach/mx28.h>13#include <mach/devices-common.h>1415static struct platform_device *__init mxs_add_dma(const char *devid,16resource_size_t base)17{18struct resource res[] = {19{20.start = base,21.end = base + SZ_8K - 1,22.flags = IORESOURCE_MEM,23}24};2526return mxs_add_platform_device_dmamask(devid, -1,27res, ARRAY_SIZE(res), NULL, 0,28DMA_BIT_MASK(32));29}3031static int __init mxs_add_mxs_dma(void)32{33char *apbh = "mxs-dma-apbh";34char *apbx = "mxs-dma-apbx";3536if (cpu_is_mx23()) {37mxs_add_dma(apbh, MX23_APBH_DMA_BASE_ADDR);38mxs_add_dma(apbx, MX23_APBX_DMA_BASE_ADDR);39}4041if (cpu_is_mx28()) {42mxs_add_dma(apbh, MX28_APBH_DMA_BASE_ADDR);43mxs_add_dma(apbx, MX28_APBX_DMA_BASE_ADDR);44}4546return 0;47}48arch_initcall(mxs_add_mxs_dma);495051