From: kfx Date: Tue, 10 Jul 2012 03:53:00 +0000 (+0800) Subject: rk2928: dma init X-Git-Tag: firefly_0821_release~8912^2~105 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=897f46a57c24bded11d148fb5e694a6cee566371;p=firefly-linux-kernel-4.4.55.git rk2928: dma init --- diff --git a/arch/arm/mach-rk2928/devices.c b/arch/arm/mach-rk2928/devices.c index 3da7cfc3f95e..8a1cac7d6b99 100755 --- a/arch/arm/mach-rk2928/devices.c +++ b/arch/arm/mach-rk2928/devices.c @@ -1,4 +1,4 @@ -/* arch/arm/mach-rk30/devices.c +/* arch/arm/mach-rk2928/devices.c * * Copyright (C) 2012 ROCKCHIP, Inc. * @@ -24,13 +24,87 @@ #include #include #include -#include +#include #include //#include #include + +static u64 dma_dmamask = DMA_BIT_MASK(32); + +static struct resource resource_dmac[] = { + [0] = { + .start = RK2928_DMAC_PHYS, + .end = RK2928_DMAC_PHYS + RK2928_DMAC_SIZE -1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_DMAC_0, + .end = IRQ_DMAC_1, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct rk29_pl330_platdata dmac_pdata = { + .peri = { + [0] = DMACH_I2S0_8CH_TX, + [1] = DMACH_I2S0_8CH_RX, + [2] = DMACH_UART0_TX, + [3] = DMACH_UART0_RX, + [4] = DMACH_UART1_TX, + [5] = DMACH_UART1_RX, + [6] = DMACH_UART2_TX, + [7] = DMACH_UART2_RX, + [8] = DMACH_SPI0_TX, + [9] = DMACH_SPI0_RX, + [10] = DMACH_SDMMC, + [11] = DMACH_SDIO, + [12] = DMACH_EMMC, + [13] = DMACH_DMAC1_MEMTOMEM, + [14] = DMACH_MAX, + [15] = DMACH_MAX, + [16] = DMACH_MAX, + [17] = DMACH_MAX, + [18] = DMACH_MAX, + [19] = DMACH_MAX, + [20] = DMACH_MAX, + [21] = DMACH_MAX, + [22] = DMACH_MAX, + [23] = DMACH_MAX, + [24] = DMACH_MAX, + [25] = DMACH_MAX, + [26] = DMACH_MAX, + [27] = DMACH_MAX, + [28] = DMACH_MAX, + [29] = DMACH_MAX, + [30] = DMACH_MAX, + [31] = DMACH_MAX, + }, +}; + +static struct platform_device device_dmac = { + .name = "rk29-pl330", + .id = -1, + .num_resources = ARRAY_SIZE(resource_dmac), + .resource = resource_dmac, + .dev = { + .dma_mask = &dma_dmamask, + .coherent_dma_mask = DMA_BIT_MASK(32), + .platform_data = &dmac_pdata, + }, +}; + +static struct platform_device *rk2928_dmacs[] __initdata = { + &device_dmac, +}; + +static void __init rk2928_init_dma(void) +{ + platform_add_devices(rk2928_dmacs, ARRAY_SIZE(rk2928_dmacs)); +} static int __init rk2928_init_devices(void) { + rk2928_init_dma(); #if defined(CONFIG_FIQ_DEBUGGER) && defined(DEBUG_UART_PHYS) rk_serial_debug_init(DEBUG_UART_BASE, IRQ_DEBUG_UART, IRQ_UART_SIGNAL, -1); #endif diff --git a/arch/arm/plat-rk/Makefile b/arch/arm/plat-rk/Makefile index 1fd707849d73..d6b65428a9ef 100644 --- a/arch/arm/plat-rk/Makefile +++ b/arch/arm/plat-rk/Makefile @@ -2,6 +2,7 @@ obj-$(CONFIG_RK29_LAST_LOG) += last_log.o obj-$(CONFIG_USB_GADGET) += usb_detect.o obj-$(CONFIG_RK29_VPU) += vpu_service.o obj-$(CONFIG_ARCH_RK30) += dma-pl330.o +obj-$(CONFIG_ARCH_RK2928) += dma-pl330.o obj-$(CONFIG_FIQ) += fiq.o obj-$(CONFIG_FIQ_DEBUGGER) += rk_fiq_debugger.o obj-$(CONFIG_RK_EARLY_PRINTK) += early_printk.o ../kernel/debug.o