Linux Audio

Check our new training course

Loading...
v3.5.6
 
 1/*
 2 * OMAP44xx secure APIs file.
 3 *
 4 * Copyright (C) 2010 Texas Instruments, Inc.
 5 * Written by Santosh Shilimkar <santosh.shilimkar@ti.com>
 6 *
 7 *
 8 * This program is free software,you can redistribute it and/or modify
 9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/linkage.h>
14
15/*
16 * This is common routine to manage secure monitor API
17 * used to modify the PL310 secure registers.
18 * 'r0' contains the value to be modified and 'r12' contains
19 * the monitor API number. It uses few CPU registers
20 * internally and hence they need be backed up including
21 * link register "lr".
22 * Function signature : void omap_smc1(u32 fn, u32 arg)
23 */
24
25ENTRY(omap_smc1)
 
26	stmfd   sp!, {r2-r12, lr}
27	mov	r12, r0
28	mov 	r0, r1
29	dsb
30	smc	#0
31	ldmfd   sp!, {r2-r12, pc}
32ENDPROC(omap_smc1)
33
34/**
35 * u32 omap_smc2(u32 id, u32 falg, u32 pargs)
36 * Low level common routine for secure HAL and PPA APIs.
37 * @id: Application ID of HAL APIs
38 * @flag: Flag to indicate the criticality of operation
39 * @pargs: Physical address of parameter list starting
40 *	    with number of parametrs
41 */
42ENTRY(omap_smc2)
43	stmfd   sp!, {r4-r12, lr}
44	mov	r3, r2
45	mov	r2, r1
46	mov	r1, #0x0	@ Process ID
47	mov	r6, #0xff
48	mov	r12, #0x00	@ Secure Service ID
49	mov	r7, #0
50	mcr	p15, 0, r7, c7, c5, 6
51	dsb
52	dmb
53	smc	#0
54	ldmfd   sp!, {r4-r12, pc}
55ENDPROC(omap_smc2)
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57ENTRY(omap_modify_auxcoreboot0)
58	stmfd   sp!, {r1-r12, lr}
59	ldr	r12, =0x104
60	dsb
61	smc	#0
62	ldmfd   sp!, {r1-r12, pc}
63ENDPROC(omap_modify_auxcoreboot0)
64
65ENTRY(omap_auxcoreboot_addr)
66	stmfd   sp!, {r2-r12, lr}
67	ldr	r12, =0x105
68	dsb
69	smc	#0
70	ldmfd   sp!, {r2-r12, pc}
71ENDPROC(omap_auxcoreboot_addr)
72
73ENTRY(omap_read_auxcoreboot0)
74	stmfd   sp!, {r2-r12, lr}
75	ldr	r12, =0x103
76	dsb
77	smc	#0
78	mov	r0, r0, lsr #9
79	ldmfd   sp!, {r2-r12, pc}
80ENDPROC(omap_read_auxcoreboot0)
v6.13.7
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/*
 3 * OMAP34xx and OMAP44xx secure APIs file.
 4 *
 5 * Copyright (C) 2010 Texas Instruments, Inc.
 6 * Written by Santosh Shilimkar <santosh.shilimkar@ti.com>
 7 *
 8 * Copyright (C) 2012 Ivaylo Dimitrov <freemangordon@abv.bg>
 9 * Copyright (C) 2013 Pali Rohár <pali@kernel.org>
 
 
10 */
11
12#include <linux/linkage.h>
13
14/*
15 * This is common routine to manage secure monitor API
16 * used to modify the PL310 secure registers.
17 * 'r0' contains the value to be modified and 'r12' contains
18 * the monitor API number. It uses few CPU registers
19 * internally and hence they need be backed up including
20 * link register "lr".
21 * Function signature : void _omap_smc1(u32 fn, u32 arg)
22 */
23	.arch armv7-a
24	.arch_extension sec
25ENTRY(_omap_smc1)
26	stmfd   sp!, {r2-r12, lr}
27	mov	r12, r0
28	mov 	r0, r1
29	dsb
30	smc	#0
31	ldmfd   sp!, {r2-r12, pc}
32ENDPROC(_omap_smc1)
33
34/**
35 * u32 omap_smc2(u32 id, u32 falg, u32 pargs)
36 * Low level common routine for secure HAL and PPA APIs.
37 * @id: Application ID of HAL APIs
38 * @flag: Flag to indicate the criticality of operation
39 * @pargs: Physical address of parameter list starting
40 *	    with number of parametrs
41 */
42ENTRY(omap_smc2)
43	stmfd   sp!, {r4-r12, lr}
44	mov	r3, r2
45	mov	r2, r1
46	mov	r1, #0x0	@ Process ID
47	mov	r6, #0xff
48	mov	r12, #0x00	@ Secure Service ID
49	mov	r7, #0
50	mcr	p15, 0, r7, c7, c5, 6
51	dsb
52	dmb
53	smc	#0
54	ldmfd   sp!, {r4-r12, pc}
55ENDPROC(omap_smc2)
56
57/**
58 * u32 omap_smc3(u32 service_id, u32 process_id, u32 flag, u32 pargs)
59 * Low level common routine for secure HAL and PPA APIs via smc #1
60 * r0 - @service_id: Secure Service ID
61 * r1 - @process_id: Process ID
62 * r2 - @flag: Flag to indicate the criticality of operation
63 * r3 - @pargs: Physical address of parameter list
64 */
65ENTRY(omap_smc3)
66	stmfd	sp!, {r4-r11, lr}
67	mov	r12, r0		@ Copy the secure service ID
68	mov	r6, #0xff	@ Indicate new Task call
69	dsb			@ Memory Barrier (not sure if needed, copied from omap_smc2)
70	smc	#1		@ Call PPA service
71	ldmfd	sp!, {r4-r11, pc}
72ENDPROC(omap_smc3)
73
74ENTRY(omap_modify_auxcoreboot0)
75	stmfd   sp!, {r1-r12, lr}
76	ldr	r12, =0x104
77	dsb
78	smc	#0
79	ldmfd   sp!, {r1-r12, pc}
80ENDPROC(omap_modify_auxcoreboot0)
81
82ENTRY(omap_auxcoreboot_addr)
83	stmfd   sp!, {r2-r12, lr}
84	ldr	r12, =0x105
85	dsb
86	smc	#0
87	ldmfd   sp!, {r2-r12, pc}
88ENDPROC(omap_auxcoreboot_addr)
89
90ENTRY(omap_read_auxcoreboot0)
91	stmfd   sp!, {r2-r12, lr}
92	ldr	r12, =0x103
93	dsb
94	smc	#0
 
95	ldmfd   sp!, {r2-r12, pc}
96ENDPROC(omap_read_auxcoreboot0)