mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
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:
@@ -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
|
||||||
|
|||||||
@@ -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/
|
||||||
|
|||||||
15
drivers/char/broadcom/Kconfig
Normal file
15
drivers/char/broadcom/Kconfig
Normal 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.
|
||||||
1
drivers/char/broadcom/Makefile
Normal file
1
drivers/char/broadcom/Makefile
Normal file
@@ -0,0 +1 @@
|
|||||||
|
obj-$(CONFIG_BCM_VC_CMA) += vc_cma/
|
||||||
14
drivers/char/broadcom/vc_cma/Makefile
Normal file
14
drivers/char/broadcom/vc_cma/Makefile
Normal 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
|
||||||
1193
drivers/char/broadcom/vc_cma/vc_cma.c
Normal file
1193
drivers/char/broadcom/vc_cma/vc_cma.c
Normal file
File diff suppressed because it is too large
Load Diff
36
include/linux/broadcom/vc_cma.h
Normal file
36
include/linux/broadcom/vc_cma.h
Normal 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 */
|
||||||
Reference in New Issue
Block a user