Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48cfef99 authored by Oana Medvesan's avatar Oana Medvesan Committed by Hariprasad Dhalinarasimha
Browse files

t-base-300: First Release of t-base-300 Kernel Module.



Change-Id: I139758371c6a0a1298952d7ebf52f979d7aec965
Signed-off-by: default avatarOana Medvesan <medvesan.oana@gmail.com>
[hnamgund@codeaurora.org: platform.h enable MC_CRYPTO_CLOCK_MANAGEMENT for
all targets and correct include path, Makefile resolve compile errors]
Signed-off-by: default avatarHariprasad Dhalinarasimha <hnamgund@codeaurora.org>
Acked-by: default avatarTony Hamilton <tonyh@qti.qualcomm.com>
parent 2afb5bf2
Loading
Loading
Loading
Loading
+21 −20
Original line number Diff line number Diff line
@@ -3,34 +3,35 @@
#
GUD_ROOT_FOLDER := drivers/gud
# add our modules to kernel.
obj-$(CONFIG_MOBICORE_API) += mckernelapi.o
obj-$(CONFIG_MOBICORE_SUPPORT) += mcdrvmodule.o
obj-$(CONFIG_MOBICORE_API) += mcKernelApi.o
obj-$(CONFIG_MOBICORE_SUPPORT) += mcDrvModule.o

mcdrvmodule-objs := mobicore_driver/logging.o \
		mobicore_driver/ops.o \
		mobicore_driver/mem.o \
		mobicore_driver/api.o \
		mobicore_driver/main.o \
		mobicore_driver/pm.o
mcDrvModule-objs := MobiCoreDriver/logging.o \
		MobiCoreDriver/ops.o \
		MobiCoreDriver/mem.o \
		MobiCoreDriver/api.o \
		MobiCoreDriver/pm.o \
		MobiCoreDriver/main.o

mckernelapi-objs := mobicore_kernelapi/main.o \
		mobicore_kernelapi/clientlib.o \
		mobicore_kernelapi/device.o \
		mobicore_kernelapi/session.o \
		mobicore_kernelapi/connection.o
mcKernelApi-objs := MobiCoreKernelApi/main.o \
		MobiCoreKernelApi/clientlib.o \
		MobiCoreKernelApi/device.o \
		MobiCoreKernelApi/session.o \
		MobiCoreKernelApi/connection.o

# Release mode by default
ccflags-y := -DNDEBUG -include $(PWD)/$(GUD_ROOT_FOLDER)/mobicore_driver/build_tag.h
ccflags-y := -DNDEBUG -I$(GUD_ROOT_FOLDER)
ccflags-y += -Wno-declaration-after-statement

ccflags-$(CONFIG_MOBICORE_DEBUG) += -DDEBUG
ccflags-$(CONFIG_MOBICORE_VERBOSE) += -DDEBUG_VERBOSE

# Choose one platform from the folder
MOBICORE_PLATFORM := $(shell (ls -1 $(PWD)/$(GUD_ROOT_FOLDER)/mobicore_driver/platforms | tail -1) )
MOBICORE_PLATFORM := $(shell (ls -1 $(PWD)/$(GUD_ROOT_FOLDER)/MobiCoreDriver/platforms | tail -1) )
# Use the available platform folder
ccflags-y += -I$(GUD_ROOT_FOLDER)/mobicore_driver/platforms/$(MOBICORE_PLATFORM)


ccflags-y += -I$(GUD_ROOT_FOLDER)/mobicore_driver/public
ccflags-y += -I$(GUD_ROOT_FOLDER)/mobicore_kernelapi/include
ccflags-y += -I$(GUD_ROOT_FOLDER)/MobiCoreDriver/platforms/$(MOBICORE_PLATFORM)
# MobiCore Driver includes
ccflags-y += -I$(GUD_ROOT_FOLDER)/MobiCoreDriver/public
# MobiCore KernelApi required incldes
ccflags-y += -I$(GUD_ROOT_FOLDER)/MobiCoreKernelApi/include
ccflags-y += -I$(GUD_ROOT_FOLDER)/MobiCoreKernelApi/public
+26 −0
Original line number Diff line number Diff line
#
# this makefile is called from the kernel make system. Thus we basically
# add things to "obj-m" here.

ifeq ($(MODE),release)
    ccflags-y = -O2 -DNDEBUG
else
    ccflags-y = -DDEBUG
endif # DEBUG/RELEASE

# CFLAGS from the build script
ifdef MOBICORE_CFLAGS
	ccflags-y += $(MOBICORE_CFLAGS)
endif
#EXTRA_CFLAGS+=-DDEBUG_VERBOSE

ccflags-y += -I$(M) -Wall -D__$(PLATFORM)__
# add our module to kernel.
obj-m += mcDrvModule.o

mcDrvModule-objs :=logging.o ops.o mem.o api.o pm.o main.o

clean:
	rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions \
		Module.markers Module.symvers modules.order
+17 −20
Original line number Diff line number Diff line
@@ -14,23 +14,12 @@
#include "mem.h"
#include "debug.h"


/*
 * Map a virtual memory buffer structure to Mobicore
 * @param instance
 * @param addr		address of the buffer(NB it must be kernel virtual!)
 * @param len		buffer length
 * @param handle	pointer to handle
 * @param phys_wsm_l2_table	pointer to physical L2 table(?)
 *
 * @return 0 if no error
 *
 */
int mobicore_map_vmem(struct mc_instance *instance, void *addr,
	uint32_t len, uint32_t *handle, uint32_t *phys)
	uint32_t len, uint32_t *handle)
{
	return mc_register_wsm_l2(instance, (uint32_t)addr, len,
		handle, phys);
	phys_addr_t phys;
	return mc_register_wsm_mmu(instance, addr, len,
		handle, &phys);
}
EXPORT_SYMBOL(mobicore_map_vmem);

@@ -44,7 +33,7 @@ EXPORT_SYMBOL(mobicore_map_vmem);
 */
int mobicore_unmap_vmem(struct mc_instance *instance, uint32_t handle)
{
	return mc_unregister_wsm_l2(instance, handle);
	return mc_unregister_wsm_mmu(instance, handle);
}
EXPORT_SYMBOL(mobicore_unmap_vmem);

@@ -70,13 +59,11 @@ EXPORT_SYMBOL(mobicore_free_wsm);
 * @param requested_size		size of the WSM
 * @param handle		pointer where the handle will be saved
 * @param virt_kernel_addr	pointer for the kernel virtual address
 * @param phys_addr		pointer for the physical address
 *
 * @return error code or 0 for success
 */
int mobicore_allocate_wsm(struct mc_instance *instance,
	unsigned long requested_size, uint32_t *handle, void **virt_kernel_addr,
	void **phys_addr)
	unsigned long requested_size, uint32_t *handle, void **virt_kernel_addr)
{
	struct mc_buffer *buffer = NULL;

@@ -85,7 +72,6 @@ int mobicore_allocate_wsm(struct mc_instance *instance,
		return -EFAULT;

	*handle = buffer->handle;
	*phys_addr = buffer->phys;
	*virt_kernel_addr = buffer->addr;
	return 0;
}
@@ -117,3 +103,14 @@ int mobicore_release(struct mc_instance *instance)
}
EXPORT_SYMBOL(mobicore_release);

/*
 * Test if mobicore can sleep
 *
 * @return true if mobicore can sleep, false if it can't sleep
 */
bool mobicore_sleep_ready(void)
{
	return mc_sleep_ready();
}
EXPORT_SYMBOL(mobicore_sleep_ready);
+28 −0
Original line number Diff line number Diff line
#!/bin/bash

#  source the setup script
if [ -z $COMP_PATH_ROOT ]; then
	echo "The build environment is not set!"
	echo "Trying to source setupDrivers.sh automatically!"
	source ../setupDrivers.sh || exit 1
fi

ROOT_PATH=$(dirname $(readlink -f $0))
#  These folders need to be relative to the kernel dir or absolute!
PLATFORM=EXYNOS_5410_STD
CODE_INCLUDE=$(readlink -f $ROOT_PATH/Locals/Code)
PLATFORM_INCLUDE="$CODE_INCLUDE/platforms/$PLATFORM"
MOBICORE_DAEMON=$COMP_PATH_MobiCoreDriverLib/Public

MOBICORE_CFLAGS="-I$MOBICORE_DRIVER/Public -I$MOBICORE_DAEMON -I$COMP_PATH_MobiCore/inc/Mci -I$COMP_PATH_MobiCore/inc -I${PLATFORM_INCLUDE}"

# Clean first
make -C $CODE_INCLUDE clean

make -C $LINUX_PATH \
	MODE=$MODE \
	ARCH=arm \
	CROSS_COMPILE=$CROSS_COMPILE \
	M=$CODE_INCLUDE \
	"MOBICORE_CFLAGS=$MOBICORE_CFLAGS" \
	modules
Loading