455af6196c84f28185116df29a17c60923bb4f2f
[bootloader-ap.git] / arch / msm7x30-init.S
1 /*
2   Initialise the Qualcomm MSM7x30 Processor
3   Copyright (c) 2010 TJ <linux@tjworld.net>
4
5     This program is free software: you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation, either version 3 of the License, or
8     (at your option) any later version.
9
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License
16     along with this program (See the COPYRIGHT file the base directory).
17     If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include <boot/linkage.h>
21
22
23 #define DSB .byte 0x4f, 0xf0, 0x7f, 0xf5
24 #define ISB .byte 0x6f, 0xf0, 0x7f, 0xf5
25
26 /*
27  ; LVT Ring Osc counter
28  ; used to determine sense amp settings
29  ; Clobbers registers r0, r4, r5, r6, r7, r9, r10, r11
30 */
31 .equ CLK_CTL_BASE,     0xA8600000
32 .equ A_GLBL_CLK_ENA,   0x0000
33 .equ A_PRPH_WEB_NS_REG,0x0080
34 .equ A_MSM_CLK_RINGOSC,0x00D0
35 .equ A_TCXO_CNT,       0x00D4
36 .equ A_TCXO_CNT_DONE,  0x00D8
37 .equ A_RINGOSC_CNT,    0x00DC
38 .equ A_MISC_CLK_CTL,   0x0108
39 .equ CLK_TEST,         0xA8600114
40 .equ SPSS_CSR_BASE,    0xAC100000
41 .equ A_SCRINGOSC,      0x0510
42
43 //;; Number of TCXO cycles to count ring oscillations
44 .equ TCXO_CNT_VAL,     0x100
45
46 //; Halcyon addresses
47 .equ TCSR_CONF_FUSE_1, 0xAB600060 //; TCSR_CONF_FUSE_1 register
48 .equ TCSR_CONF_FUSE_4, 0xAB60006C //; TCSR_CONF_FUSE_4 register
49
50 //; SCORPION_L1_ACC (1:0) Fuses bit location
51 .equ L1_ACC_BIT_0,     12       //;12th bit of TCSR_CONF_FUSE_4
52 .equ L1_ACC_BIT_1,     13       //;13th bit of TCSR_CONF_FUSE_4
53 //; SCORPION_L2_ACC (2:0) Fuses bit location
54 .equ L2_ACC_BIT_0,     25       //;25th bit of TCSR_CONF_FUSE_1
55 .equ L2_ACC_BIT_1,     10       //;10th bit of TCSR_CONF_FUSE_4
56 .equ L2_ACC_BIT_2,     11       //;11th bit of TCSR_CONF_FUSE_4
57
58 //; CP15: PVR2F0 values according to  SCORPION_L1_ACC (1:0)
59 .equ PVR2F0_00,        0x00000000
60 .equ PVR2F0_01,        0x04000000
61 .equ PVR2F0_10,        0x08000000
62 .equ PVR2F0_11,        0x0C000000
63
64 //; CP15: PVR2F1 values according to  SCORPION_L1_ACC (1:0)
65 .equ PVR2F1_00,        0x00000008
66 .equ PVR2F1_01,        0x00000008
67 .equ PVR2F1_10,        0x00000208
68 .equ PVR2F1_11,        0x00000208
69
70 //; CP15: PVR0F2 values according to  SCORPION_L1_ACC (1:0)
71 .equ PVR0F2_00,        0x00000000
72 .equ PVR0F2_01,        0x00000000
73 .equ PVR0F2_10,        0x00000200
74 .equ PVR0F2_11,        0x00000200
75
76 //; CP15: PVR0F0 values according to  SCORPION_L1_ACC (1:0)
77 .equ PVR0F0_00,        0x7F000000
78 .equ PVR0F0_01,        0x7F000400
79 .equ PVR0F0_10,        0x7F000000
80 .equ PVR0F0_11,        0x7F000400
81
82 //; CP15: L2VR3F1 values according to  SCORPION_L2_ACC (2:0)
83 .equ L2VR3F1_000,      0x00FFFF60
84 .equ L2VR3F1_001,      0x00FFFF40
85 .equ L2VR3F1_010,      0x00FFFC60
86 .equ L2VR3F1_011,      0x00FFFC40
87 .equ L2VR3F1_100,      0x00FCFF60
88 .equ L2VR3F1_101,      0x00FCFF40
89 .equ L2VR3F1_110,      0x00FCFC60
90 .equ L2VR3F1_111,      0x00FCFC40
91
92     .section ".start", #alloc, #execinstr
93 ENTRY(__init_msm_7x30)
94     mov     r4,#0
95     ldr     r1,=TCSR_CONF_FUSE_4
96     mov     r2,#0x0C
97     ldr     r3,[r1]
98     bx      lr
99
100 .ltorg
101
102 // EOF