cma: Add vc_cma driver to enable use of CMA

Signed-off-by: popcornmix <popcornmix@gmail.com>

vc_cma: Make the vc_cma area the default contiguous DMA area

vc_cma: Provide empty functions when module is not built

Providing empty functions saves the users from guarding the
function call with an #if clause.
Move __init markings from prototypes to functions.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
This commit is contained in:
popcornmix
2013-07-03 00:31:47 +01:00
parent c58bec0d84
commit 36d8db5395
7 changed files with 1262 additions and 0 deletions

View File

@@ -4,6 +4,8 @@
menu "Character devices" menu "Character devices"
source "drivers/char/broadcom/Kconfig"
source "drivers/tty/Kconfig" source "drivers/tty/Kconfig"
config DEVMEM config DEVMEM

View File

@@ -60,3 +60,4 @@ js-rtc-y = rtc.o
obj-$(CONFIG_TILE_SROM) += tile-srom.o obj-$(CONFIG_TILE_SROM) += tile-srom.o
obj-$(CONFIG_XILLYBUS) += xillybus/ obj-$(CONFIG_XILLYBUS) += xillybus/
obj-$(CONFIG_BRCM_CHAR_DRIVERS) += broadcom/

View File

@@ -0,0 +1,15 @@
#
# Broadcom char driver config
#
menuconfig BRCM_CHAR_DRIVERS
bool "Broadcom Char Drivers"
help
Broadcom's char drivers
config BCM_VC_CMA
bool "Videocore CMA"
depends on CMA && BRCM_CHAR_DRIVERS && BCM2708_VCHIQ
default n
help
Helper for videocore CMA access.

View File

@@ -0,0 +1 @@
obj-$(CONFIG_BCM_VC_CMA) += vc_cma/

View File

@@ -0,0 +1,14 @@
ccflags-y += -Wall -Wstrict-prototypes -Wno-trigraphs
ccflags-y += -Werror
ccflags-y += -Iinclude/linux/broadcom
ccflags-y += -Idrivers/misc/vc04_services
ccflags-y += -Idrivers/misc/vc04_services/interface/vchi
ccflags-y += -Idrivers/misc/vc04_services/interface/vchiq_arm
ccflags-y += -D__KERNEL__
ccflags-y += -D__linux__
ccflags-y += -Werror
obj-$(CONFIG_BCM_VC_CMA) += vc-cma.o
vc-cma-objs := vc_cma.o

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,36 @@
/*****************************************************************************
* Copyright 2012 Broadcom Corporation. All rights reserved.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2, available at
* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a
* license other than the GPL, without Broadcom's express prior written
* consent.
*****************************************************************************/
#if !defined( VC_CMA_H )
#define VC_CMA_H
#include <linux/ioctl.h>
#define VC_CMA_IOC_MAGIC 0xc5
#define VC_CMA_IOC_RESERVE _IO(VC_CMA_IOC_MAGIC, 0)
#ifdef __KERNEL__
#ifdef CONFIG_BCM_VC_CMA
void vc_cma_early_init(void);
void vc_cma_reserve(void);
#else
static inline void vc_cma_early_init(void) { }
static inline void vc_cma_reserve(void) { }
#endif
#endif
#endif /* VC_CMA_H */