diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /drivers/media/video/tegra/avp/headavp.S | |
parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) |
Diffstat (limited to 'drivers/media/video/tegra/avp/headavp.S')
-rw-r--r-- | drivers/media/video/tegra/avp/headavp.S | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/drivers/media/video/tegra/avp/headavp.S b/drivers/media/video/tegra/avp/headavp.S new file mode 100644 index 00000000000..c1f8e9fea1c --- /dev/null +++ b/drivers/media/video/tegra/avp/headavp.S | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/headavp.S | ||
3 | * | ||
4 | * AVP kernel launcher stub; programs the AVP MMU and jumps to the | ||
5 | * kernel code. Must use ONLY ARMv4 instructions, and must be compiled | ||
6 | * in ARM mode. | ||
7 | * | ||
8 | * Copyright (c) 2010, NVIDIA Corporation. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
17 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
18 | * more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License along | ||
21 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
23 | */ | ||
24 | |||
25 | #include <linux/linkage.h> | ||
26 | #include <asm/assembler.h> | ||
27 | #include "headavp.h" | ||
28 | |||
29 | #define PTE0_COMPARE 0 | ||
30 | /* the default translation will translate any VA within | ||
31 | * 0x0010:0000..0x001f:ffff to the (megabyte-aligned) value written to | ||
32 | * _tegra_avp_boot_stub_data.map_phys_addr | ||
33 | */ | ||
34 | #define PTE0_DEFAULT (AVP_KERNEL_VIRT_BASE | 0x3ff0) | ||
35 | |||
36 | #define PTE0_TRANSLATE 4 | ||
37 | |||
38 | #define TRANSLATE_DATA (1 << 11) | ||
39 | #define TRANSLATE_CODE (1 << 10) | ||
40 | #define TRANSLATE_WR (1 << 9) | ||
41 | #define TRANSLATE_RD (1 << 8) | ||
42 | #define TRANSLATE_HIT (1 << 7) | ||
43 | #define TRANSLATE_EN (1 << 2) | ||
44 | |||
45 | #define TRANSLATE_OPT (TRANSLATE_DATA | TRANSLATE_CODE | TRANSLATE_WR | \ | ||
46 | TRANSLATE_RD | TRANSLATE_HIT) | ||
47 | |||
48 | ENTRY(_tegra_avp_boot_stub) | ||
49 | adr r4, _tegra_avp_boot_stub_data | ||
50 | ldmia r4, {r0-r3} | ||
51 | #ifdef CONFIG_TEGRA_AVP_KERNEL_ON_MMU | ||
52 | str r2, [r0, #PTE0_COMPARE] | ||
53 | bic r3, r3, #0xff0 | ||
54 | bic r3, r3, #0x00f | ||
55 | orr r3, r3, #TRANSLATE_OPT | ||
56 | orr r3, r3, #TRANSLATE_EN | ||
57 | str r3, [r0, #PTE0_TRANSLATE] | ||
58 | #endif | ||
59 | bx r1 | ||
60 | b . | ||
61 | ENDPROC(_tegra_avp_boot_stub) | ||
62 | .type _tegra_avp_boot_stub_data, %object | ||
63 | ENTRY(_tegra_avp_boot_stub_data) | ||
64 | .long AVP_MMU_TLB_BASE | ||
65 | .long 0xdeadbeef | ||
66 | .long PTE0_DEFAULT | ||
67 | .long 0xdeadd00d | ||
68 | .size _tegra_avp_boot_stub_data, . - _tegra_avp_boot_stub_data | ||