[WATCHDOG] davinci: use clock framework for timer frequency
[linux-ginger.git] / arch / ia64 / hp / sim / boot / boot_head.S
blob8808565491fb51b6d8e5a949d580d08646da8095
1 /*
2  * Copyright (C) 1998-2003 Hewlett-Packard Co
3  *      David Mosberger-Tang <davidm@hpl.hp.com>
4  */
6 #include <asm/asmmacro.h>
7 #include <asm/pal.h>
9         .bss
10         .align 16
11 stack_mem:
12         .skip 16834
14         .text
16 /* This needs to be defined because lib/string.c:strlcat() calls it in case of error... */
17 GLOBAL_ENTRY(printk)
18         break 0
19 END(printk)
21 GLOBAL_ENTRY(_start)
22         .prologue
23         .save rp, r0
24         .body
25         movl gp = __gp
26         movl sp = stack_mem+16384-16
27         bsw.1
28         br.call.sptk.many rp=start_bootloader
29 0:      nop 0             /* dummy nop to make unwinding work */
30 END(_start)
33  * Set a break point on this function so that symbols are available to set breakpoints in
34  * the kernel being debugged.
35  */
36 GLOBAL_ENTRY(debug_break)
37         br.ret.sptk.many b0
38 END(debug_break)
40 GLOBAL_ENTRY(ssc)
41         .regstk 5,0,0,0
42         mov r15=in4
43         break 0x80001
44         br.ret.sptk.many b0
45 END(ssc)
47 GLOBAL_ENTRY(jmp_to_kernel)
48         .regstk 2,0,0,0
49         mov r28=in0
50         mov b7=in1
51         br.sptk.few b7
52 END(jmp_to_kernel)
55  * r28 contains the index of the PAL function
56  * r29--31 the args
57  * Return values in ret0--3 (r8--11)
58  */
59 GLOBAL_ENTRY(pal_emulator_static)
60         mov r8=-1
61         mov r9=256
62         ;;
63         cmp.gtu p6,p7=r9,r28            /* r28 <= 255? */
64 (p6)    br.cond.sptk.few static
65         ;;
66         mov r9=512
67         ;;
68         cmp.gtu p6,p7=r9,r28
69 (p6)    br.cond.sptk.few stacked
70         ;;
71 static: cmp.eq p6,p7=PAL_PTCE_INFO,r28
72 (p7)    br.cond.sptk.few 1f
73         ;;
74         mov r8=0                        /* status = 0 */
75         movl r9=0x100000000             /* tc.base */
76         movl r10=0x0000000200000003     /* count[0], count[1] */
77         movl r11=0x1000000000002000     /* stride[0], stride[1] */
78         br.cond.sptk.few rp
79 1:      cmp.eq p6,p7=PAL_FREQ_RATIOS,r28
80 (p7)    br.cond.sptk.few 1f
81         mov r8=0                        /* status = 0 */
82         movl r9 =0x100000064            /* proc_ratio (1/100) */
83         movl r10=0x100000100            /* bus_ratio<<32 (1/256) */
84         movl r11=0x100000064            /* itc_ratio<<32 (1/100) */
85         ;;
86 1:      cmp.eq p6,p7=PAL_RSE_INFO,r28
87 (p7)    br.cond.sptk.few 1f
88         mov r8=0                        /* status = 0 */
89         mov r9=96                       /* num phys stacked */
90         mov r10=0                       /* hints */
91         mov r11=0
92         br.cond.sptk.few rp
93 1:      cmp.eq p6,p7=PAL_CACHE_FLUSH,r28                /* PAL_CACHE_FLUSH */
94 (p7)    br.cond.sptk.few 1f
95         mov r9=ar.lc
96         movl r8=524288                  /* flush 512k million cache lines (16MB) */
97         ;;
98         mov ar.lc=r8
99         movl r8=0xe000000000000000
100         ;;
101 .loop:  fc r8
102         add r8=32,r8
103         br.cloop.sptk.few .loop
104         sync.i
105         ;;
106         srlz.i
107         ;;
108         mov ar.lc=r9
109         mov r8=r0
110         ;;
111 1:      cmp.eq p6,p7=PAL_PERF_MON_INFO,r28
112 (p7)    br.cond.sptk.few 1f
113         mov r8=0                        /* status = 0 */
114         movl r9 =0x08122f04             /* generic=4 width=47 retired=8 cycles=18 */
115         mov r10=0                       /* reserved */
116         mov r11=0                       /* reserved */
117         mov r16=0xffff                  /* implemented PMC */
118         mov r17=0x3ffff                 /* implemented PMD */
119         add r18=8,r29                   /* second index */
120         ;;
121         st8 [r29]=r16,16                /* store implemented PMC */
122         st8 [r18]=r0,16                 /* clear remaining bits  */
123         ;;
124         st8 [r29]=r0,16                 /* clear remaining bits  */
125         st8 [r18]=r0,16                 /* clear remaining bits  */
126         ;;
127         st8 [r29]=r17,16                /* store implemented PMD */
128         st8 [r18]=r0,16                 /* clear remaining bits  */
129         mov r16=0xf0                    /* cycles count capable PMC */
130         ;;
131         st8 [r29]=r0,16                 /* clear remaining bits  */
132         st8 [r18]=r0,16                 /* clear remaining bits  */
133         mov r17=0xf0                    /* retired bundles capable PMC */
134         ;;
135         st8 [r29]=r16,16                /* store cycles capable */
136         st8 [r18]=r0,16                 /* clear remaining bits  */
137         ;;
138         st8 [r29]=r0,16                 /* clear remaining bits  */
139         st8 [r18]=r0,16                 /* clear remaining bits  */
140         ;;
141         st8 [r29]=r17,16                /* store retired bundle capable */
142         st8 [r18]=r0,16                 /* clear remaining bits  */
143         ;;
144         st8 [r29]=r0,16                 /* clear remaining bits  */
145         st8 [r18]=r0,16                 /* clear remaining bits  */
146         ;;
147 1:      cmp.eq p6,p7=PAL_VM_SUMMARY,r28
148 (p7)    br.cond.sptk.few 1f
149         mov     r8=0                    /* status = 0  */
150         movl    r9=0x2044040020F1865    /* num_tc_levels=2, num_unique_tcs=4 */
151                                         /* max_itr_entry=64, max_dtr_entry=64 */
152                                         /* hash_tag_id=2, max_pkr=15 */
153                                         /* key_size=24, phys_add_size=50, vw=1 */
154         movl    r10=0x183C              /* rid_size=24, impl_va_msb=60 */
155         ;;
156 1:      cmp.eq p6,p7=PAL_MEM_ATTRIB,r28
157 (p7)    br.cond.sptk.few 1f
158         mov     r8=0                    /* status = 0 */
159         mov     r9=0x80|0x01            /* NatPage|WB */
160         ;;
161 1:      br.cond.sptk.few rp
162 stacked:
163         br.ret.sptk.few rp
164 END(pal_emulator_static)