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

Commit c2348aa9 authored by Keith Fallows's avatar Keith Fallows
Browse files

t-base-301: First release of t-base-301 Kernel Module and Kernel Api



Change-Id: I99b031cb9a376f29267a937bfab36b43a7bf4d0f
Signed-off-by: default avatarOana Medvesan <medvesan.oana@gmail.com>
[keithf@codeaurora.org: platform.h Update scm.h file path]
Signed-off-by: default avatarKeith Fallows <keithf@codeaurora.org>
Acked-by: default avatarTony Hamilton <tonyh@qti.qualcomm.com>
parent a42b4099
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -20,7 +20,7 @@ mcKernelApi-objs := MobiCoreKernelApi/main.o \
		MobiCoreKernelApi/connection.o
		MobiCoreKernelApi/connection.o


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


ccflags-$(CONFIG_MOBICORE_DEBUG) += -DDEBUG
ccflags-$(CONFIG_MOBICORE_DEBUG) += -DDEBUG
+6 −1
Original line number Original line Diff line number Diff line
@@ -8,13 +8,18 @@ else
    ccflags-y = -DDEBUG
    ccflags-y = -DDEBUG
endif # DEBUG/RELEASE
endif # DEBUG/RELEASE


# CFLAG for testable mode
ifeq ($(IS_TESTABLE),yes)
	ccflags-y = -DTEST
endif

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


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


+10 −7
Original line number Original line Diff line number Diff line
/* MobiCore driver module.(interface to the secure world SWD)
/*
 * MobiCore Driver Kernel Module.
 * Copyright (c) 2013 TRUSTONIC LIMITED
 * All Rights Reserved.
 *
 *
 * <-- Copyright Giesecke & Devrient GmbH 2009-2012 -->
 * This program is free software; you can redistribute it and/or
 * <-- Copyright Trustonic Limited 2013 -->
 * modify it under the terms of the GNU General Public License
 * version 2 as published by the Free Software Foundation.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is distributed in the hope that it will be useful,
 * it under the terms of the GNU General Public License version 2 as
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * published by the Free Software Foundation.
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 */
 */
#include <linux/module.h>
#include <linux/module.h>


+22 −8
Original line number Original line Diff line number Diff line
/*
/*
 * MobiCore driver module.(interface to the secure world SWD)
 * Copyright (c) 2013 TRUSTONIC LIMITED
 * All Rights Reserved.
 *
 *
 * <-- Copyright Giesecke & Devrient GmbH 2009-2012 -->
 * This program is free software; you can redistribute it and/or
 * <-- Copyright Trustonic Limited 2013 -->
 * modify it under the terms of the GNU General Public License
 * version 2 as published by the Free Software Foundation.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is distributed in the hope that it will be useful,
 * it under the terms of the GNU General Public License version 2 as
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * published by the Free Software Foundation.
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 */
 */

#ifndef _MC_ARM_H_
#ifndef _MC_ARM_H_
#define _MC_ARM_H_
#define _MC_ARM_H_


#include "debug.h"
#include "debug.h"


#ifdef CONFIG_ARM64
inline bool has_security_extensions(void)
{
	return true;
}

inline bool is_secure_mode(void)
{
	return false;
}
#else
/*
/*
 * ARM Trustzone specific masks and modes
 * ARM Trustzone specific masks and modes
 * Vanilla Linux is unaware of TrustZone extension.
 * Vanilla Linux is unaware of TrustZone extension.
@@ -21,7 +34,7 @@
 * Also TZ bits in cpuid are not defined, ARM port uses magic numbers,
 * Also TZ bits in cpuid are not defined, ARM port uses magic numbers,
 * see arch/arm/kernel/setup.c
 * see arch/arm/kernel/setup.c
 */
 */
#define ARM_MONITOR_MODE		(0b10110)
#define ARM_MONITOR_MODE		(0x16) /*(0b10110)*/
#define ARM_SECURITY_EXTENSION_MASK	(0x30)
#define ARM_SECURITY_EXTENSION_MASK	(0x30)


/* check if CPU supports the ARM TrustZone Security Extensions */
/* check if CPU supports the ARM TrustZone Security Extensions */
@@ -69,5 +82,6 @@ inline bool is_secure_mode(void)


	return false;
	return false;
}
}
#endif


#endif /* _MC_ARM_H_ */
#endif /* _MC_ARM_H_ */
+9 −7
Original line number Original line Diff line number Diff line
/*
/*
 * MobiCore driver module.(interface to the secure world SWD)
 * Copyright (c) 2013 TRUSTONIC LIMITED
 * All Rights Reserved.
 *
 *
 * <-- Copyright Giesecke & Devrient GmbH 2009-2012 -->
 * This program is free software; you can redistribute it and/or
 * <-- Copyright Trustonic Limited 2013 -->
 * modify it under the terms of the GNU General Public License
 * version 2 as published by the Free Software Foundation.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is distributed in the hope that it will be useful,
 * it under the terms of the GNU General Public License version 2 as
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * published by the Free Software Foundation.
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 */
 */

#ifndef _MC_DEBUG_H_
#ifndef _MC_DEBUG_H_
#define _MC_DEBUG_H_
#define _MC_DEBUG_H_
/* Found in main.c */
/* Found in main.c */
Loading