1 Index: kernel-cssu-2.6.28/arch/arm/mach-omap2/Makefile
2 ===================================================================
3 --- kernel-cssu-2.6.28.orig/arch/arm/mach-omap2/Makefile 2012-05-25 02:00:58.981062096 -0400
4 +++ kernel-cssu-2.6.28/arch/arm/mach-omap2/Makefile 2012-05-25 01:58:35.689019000 -0400
6 board-rx51-peripherals.o \
11 + board-rx51-smc.o board-rx51-secure.o
13 obj-$(CONFIG_MACH_NOKIA_RX71) += board-rx71.o \
14 board-rx71-peripherals.o
16 Index: kernel-cssu-2.6.28/arch/arm/mach-omap2/board-rx51-secure.c
17 ===================================================================
18 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
19 +++ kernel-cssu-2.6.28/arch/arm/mach-omap2/board-rx51-secure.c 2012-05-25 01:58:35.689019000 -0400
22 + * RX51 Secure PPA API.
24 + * Copyright (C) 2012 Ivaylo Dimitrov <freemangordon@abv.bg>
27 + * This program is free software,you can redistribute it and/or modify
28 + * it under the terms of the GNU General Public License version 2 as
29 + * published by the Free Software Foundation.
31 +#include <asm/cacheflush.h>
33 +#include "board-rx51-secure.h"
36 + * rx51_secure_dispatcher: Routine to dispatch secure PPA API calls
37 + * @idx: The PPA API index
38 + * @flag: The flag indicating criticality of operation
39 + * @nargs: Number of valid arguments out of four.
40 + * @arg1, arg2, arg3 args4: Parameters passed to secure API
42 + * Return the non-zero error value on failure.
44 +u32 rx51_secure_dispatcher(u32 idx, u32 flag, u32 nargs, u32 arg1, u32 arg2,
57 + * Secure API needs physical address
58 + * pointer for the parameters
61 + outer_clean_range(__pa(param), __pa(param + 5));
62 + ret = rx51_ppa_smc(idx, flag, __pa(param));
68 + * rx51_secure_update_aux_cr: Routine to modify the contents of Auxiliary Control Register
69 + * @set_bits: bits to set in ACR
70 + * @clr_bits: bits to clear in ACR
72 + * Return the non-zero error value on failure.
74 +u32 rx51_secure_update_aux_cr(u32 set_bits, u32 clear_bits)
79 + asm volatile ("mrc p15, 0, %0, c1, c0, 1" : "=r" (acr));
83 + return rx51_secure_dispatcher(RX51_PPA_WRITE_ACR,
84 + FLAG_START_CRITICAL,
87 Index: kernel-cssu-2.6.28/arch/arm/mach-omap2/board-rx51-secure.h
88 ===================================================================
89 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
90 +++ kernel-cssu-2.6.28/arch/arm/mach-omap2/board-rx51-secure.h 2012-05-25 01:58:35.689019000 -0400
93 + * board-rx51-secure.h: OMAP Secure infrastructure header.
95 + * Copyright (C) 2012 Ivaylo Dimitrov <freemangordon@abv.bg>
97 + * This program is free software; you can redistribute it and/or modify
98 + * it under the terms of the GNU General Public License version 2 as
99 + * published by the Free Software Foundation.
101 +#ifndef OMAP_RX51_SECURE_H
102 +#define OMAP_RX51_SECURE_H
104 +/* HAL API error codes */
105 +#define API_HAL_RET_VALUE_OK 0x00
106 +#define API_HAL_RET_VALUE_FAIL 0x01
108 +/* Secure HAL API flags */
109 +#define FLAG_START_CRITICAL 0x4
110 +#define FLAG_IRQFIQ_MASK 0x3
111 +#define FLAG_IRQ_ENABLE 0x2
112 +#define FLAG_FIQ_ENABLE 0x1
115 +/* Secure PPA(Primary Protected Application) APIs */
116 +#define RX51_PPA_L2_INVAL 40
117 +#define RX51_PPA_WRITE_ACR 42
119 +#ifndef __ASSEMBLER__
121 +extern u32 rx51_secure_dispatcher(u32 idx, u32 flag, u32 nargs,
122 + u32 arg1, u32 arg2, u32 arg3, u32 arg4);
123 +extern u32 rx51_ppa_smc(u32 id, u32 flag, u32 pargs);
125 +extern u32 rx51_secure_update_aux_cr(u32 set_bits, u32 clear_bits);
126 +#endif /* __ASSEMBLER__ */
127 +#endif /* OMAP_RX51_SECURE_H */
128 Index: kernel-cssu-2.6.28/arch/arm/mach-omap2/board-rx51-smc.S
129 ===================================================================
130 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
131 +++ kernel-cssu-2.6.28/arch/arm/mach-omap2/board-rx51-smc.S 2012-05-25 02:09:15.244206814 -0400
134 + * RX51 secure APIs file.
136 + * Copyright (C) 2012 Ivaylo Dimitrov <freemangordon@abv.bg>
139 + * This program is free software,you can redistribute it and/or modify
140 + * it under the terms of the GNU General Public License version 2 as
141 + * published by the Free Software Foundation.
144 +#include <linux/linkage.h>
147 + * u32 rx51_ppa_smc(u32 id, u32 flag, u32 pargs)
148 + * Low level common routine for secure HAL and PPA APIs.
149 + * @id: Secure Service ID
150 + * @flag: Flag to indicate the criticality of operation
151 + * @pargs: Physical address of parameter list starting
152 + * with number of parametrs
155 + stmfd sp!, {r4-r12, lr}
156 + mov r12, r0 @ Copy the secure service ID
157 + mov r3, r2 @ Copy the pointer to va_list in R3
158 + mov r2, r1 @ Copy the flags in R2
159 + mov r1, #0x0 @ Process ID - 0
160 + mov r6, #0xff @ Indicate new Task call
163 + .word 0xe1600071 @ SMC #1 to call PPA service - hand assembled
164 + ldmfd sp!, {r4-r12, pc}
165 +ENDPROC(rx51_ppa_smc)