aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/include')
-rw-r--r--arch/sparc/include/asm/leon.h12
-rw-r--r--arch/sparc/include/asm/leon_amba.h6
-rw-r--r--arch/sparc/include/asm/oplib_32.h48
-rw-r--r--arch/sparc/include/asm/oplib_64.h4
4 files changed, 22 insertions, 48 deletions
diff --git a/arch/sparc/include/asm/leon.h b/arch/sparc/include/asm/leon.h
index 3ea5964c43b4..8580d1764f90 100644
--- a/arch/sparc/include/asm/leon.h
+++ b/arch/sparc/include/asm/leon.h
@@ -224,6 +224,18 @@ static inline void sparc_leon3_disable_cache(void)
224 "sta %%l2, [%%g0] 2\n\t" : : : "l1", "l2"); 224 "sta %%l2, [%%g0] 2\n\t" : : : "l1", "l2");
225}; 225};
226 226
227static inline unsigned long sparc_leon3_asr17(void)
228{
229 u32 asr17;
230 __asm__ __volatile__ ("rd %%asr17, %0\n\t" : "=r"(asr17));
231 return asr17;
232};
233
234static inline int sparc_leon3_cpuid(void)
235{
236 return sparc_leon3_asr17() >> 28;
237}
238
227#endif /*!__ASSEMBLY__*/ 239#endif /*!__ASSEMBLY__*/
228 240
229#ifdef CONFIG_SMP 241#ifdef CONFIG_SMP
diff --git a/arch/sparc/include/asm/leon_amba.h b/arch/sparc/include/asm/leon_amba.h
index 618e88821795..263c719e96f5 100644
--- a/arch/sparc/include/asm/leon_amba.h
+++ b/arch/sparc/include/asm/leon_amba.h
@@ -100,9 +100,8 @@ struct leon3_irqctrl_regs_map {
100 u32 mpbroadcast; 100 u32 mpbroadcast;
101 u32 notused02; 101 u32 notused02;
102 u32 notused03; 102 u32 notused03;
103 u32 notused10; 103 u32 ampctrl;
104 u32 notused11; 104 u32 icsel[2];
105 u32 notused12;
106 u32 notused13; 105 u32 notused13;
107 u32 notused20; 106 u32 notused20;
108 u32 notused21; 107 u32 notused21;
@@ -112,6 +111,7 @@ struct leon3_irqctrl_regs_map {
112 u32 force[16]; 111 u32 force[16];
113 /* Extended IRQ registers */ 112 /* Extended IRQ registers */
114 u32 intid[16]; /* 0xc0 */ 113 u32 intid[16]; /* 0xc0 */
114 u32 unused[(0x1000-0x100)/4];
115}; 115};
116 116
117struct leon3_apbuart_regs_map { 117struct leon3_apbuart_regs_map {
diff --git a/arch/sparc/include/asm/oplib_32.h b/arch/sparc/include/asm/oplib_32.h
index 9e5c64084b86..71e5e9aeb67e 100644
--- a/arch/sparc/include/asm/oplib_32.h
+++ b/arch/sparc/include/asm/oplib_32.h
@@ -48,18 +48,6 @@ extern void prom_init(struct linux_romvec *rom_ptr);
48/* Boot argument acquisition, returns the boot command line string. */ 48/* Boot argument acquisition, returns the boot command line string. */
49extern char *prom_getbootargs(void); 49extern char *prom_getbootargs(void);
50 50
51/* Device utilities. */
52
53/* Map and unmap devices in IO space at virtual addresses. Note that the
54 * virtual address you pass is a request and the prom may put your mappings
55 * somewhere else, so check your return value as that is where your new
56 * mappings really are!
57 *
58 * Another note, these are only available on V2 or higher proms!
59 */
60extern char *prom_mapio(char *virt_hint, int io_space, unsigned int phys_addr, unsigned int num_bytes);
61extern void prom_unmapio(char *virt_addr, unsigned int num_bytes);
62
63/* Miscellaneous routines, don't really fit in any category per se. */ 51/* Miscellaneous routines, don't really fit in any category per se. */
64 52
65/* Reboot the machine with the command line passed. */ 53/* Reboot the machine with the command line passed. */
@@ -76,7 +64,7 @@ extern void prom_cmdline(void);
76/* Enter the prom, with no chance of continuation for the stand-alone 64/* Enter the prom, with no chance of continuation for the stand-alone
77 * which calls this. 65 * which calls this.
78 */ 66 */
79extern void prom_halt(void) __attribute__ ((noreturn)); 67extern void __noreturn prom_halt(void);
80 68
81/* Set the PROM 'sync' callback function to the passed function pointer. 69/* Set the PROM 'sync' callback function to the passed function pointer.
82 * When the user gives the 'sync' command at the prom prompt while the 70 * When the user gives the 'sync' command at the prom prompt while the
@@ -117,25 +105,6 @@ extern void prom_write(const char *buf, unsigned int len);
117extern int prom_startcpu(int cpunode, struct linux_prom_registers *context_table, 105extern int prom_startcpu(int cpunode, struct linux_prom_registers *context_table,
118 int context, char *program_counter); 106 int context, char *program_counter);
119 107
120/* Stop the CPU with the passed device tree node. */
121extern int prom_stopcpu(int cpunode);
122
123/* Idle the CPU with the passed device tree node. */
124extern int prom_idlecpu(int cpunode);
125
126/* Re-Start the CPU with the passed device tree node. */
127extern int prom_restartcpu(int cpunode);
128
129/* PROM memory allocation facilities... */
130
131/* Allocated at possibly the given virtual address a chunk of the
132 * indicated size.
133 */
134extern char *prom_alloc(char *virt_hint, unsigned int size);
135
136/* Free a previously allocated chunk. */
137extern void prom_free(char *virt_addr, unsigned int size);
138
139/* Sun4/sun4c specific memory-management startup hook. */ 108/* Sun4/sun4c specific memory-management startup hook. */
140 109
141/* Map the passed segment in the given context at the passed 110/* Map the passed segment in the given context at the passed
@@ -144,6 +113,8 @@ extern void prom_free(char *virt_addr, unsigned int size);
144extern void prom_putsegment(int context, unsigned long virt_addr, 113extern void prom_putsegment(int context, unsigned long virt_addr,
145 int physical_segment); 114 int physical_segment);
146 115
116/* Initialize the memory lists based upon the prom version. */
117void prom_meminit(void);
147 118
148/* PROM device tree traversal functions... */ 119/* PROM device tree traversal functions... */
149 120
@@ -178,19 +149,11 @@ extern int prom_getbool(phandle node, char *prop);
178/* Acquire a string property, null string on error. */ 149/* Acquire a string property, null string on error. */
179extern void prom_getstring(phandle node, char *prop, char *buf, int bufsize); 150extern void prom_getstring(phandle node, char *prop, char *buf, int bufsize);
180 151
181/* Does the passed node have the given "name"? YES=1 NO=0 */
182extern int prom_nodematch(phandle thisnode, char *name);
183
184/* Search all siblings starting at the passed node for "name" matching 152/* Search all siblings starting at the passed node for "name" matching
185 * the given string. Returns the node on success, zero on failure. 153 * the given string. Returns the node on success, zero on failure.
186 */ 154 */
187extern phandle prom_searchsiblings(phandle node_start, char *name); 155extern phandle prom_searchsiblings(phandle node_start, char *name);
188 156
189/* Return the first property type, as a string, for the given node.
190 * Returns a null string on error.
191 */
192extern char *prom_firstprop(phandle node, char *buffer);
193
194/* Returns the next property after the passed property for the given 157/* Returns the next property after the passed property for the given
195 * node. Returns null string on failure. 158 * node. Returns null string on failure.
196 */ 159 */
@@ -199,9 +162,6 @@ extern char *prom_nextprop(phandle node, char *prev_property, char *buffer);
199/* Returns phandle of the path specified */ 162/* Returns phandle of the path specified */
200extern phandle prom_finddevice(char *name); 163extern phandle prom_finddevice(char *name);
201 164
202/* Returns 1 if the specified node has given property. */
203extern int prom_node_has_property(phandle node, char *property);
204
205/* Set the indicated property at the given node with the passed value. 165/* Set the indicated property at the given node with the passed value.
206 * Returns the number of bytes of your value that the prom took. 166 * Returns the number of bytes of your value that the prom took.
207 */ 167 */
@@ -219,6 +179,8 @@ extern void prom_apply_obio_ranges(struct linux_prom_registers *obioregs, int nr
219extern void prom_apply_generic_ranges(phandle node, phandle parent, 179extern void prom_apply_generic_ranges(phandle node, phandle parent,
220 struct linux_prom_registers *sbusregs, int nregs); 180 struct linux_prom_registers *sbusregs, int nregs);
221 181
182void prom_ranges_init(void);
183
222/* CPU probing helpers. */ 184/* CPU probing helpers. */
223int cpu_find_by_instance(int instance, phandle *prom_node, int *mid); 185int cpu_find_by_instance(int instance, phandle *prom_node, int *mid);
224int cpu_find_by_mid(int mid, phandle *prom_node); 186int cpu_find_by_mid(int mid, phandle *prom_node);
diff --git a/arch/sparc/include/asm/oplib_64.h b/arch/sparc/include/asm/oplib_64.h
index 8cd0df34e82b..97a90475c314 100644
--- a/arch/sparc/include/asm/oplib_64.h
+++ b/arch/sparc/include/asm/oplib_64.h
@@ -18,8 +18,8 @@ extern char prom_version[];
18 */ 18 */
19extern phandle prom_root_node; 19extern phandle prom_root_node;
20 20
21/* PROM stdin and stdout */ 21/* PROM stdout */
22extern int prom_stdin, prom_stdout; 22extern int prom_stdout;
23 23
24/* /chosen node of the prom device tree, this stays constant after 24/* /chosen node of the prom device tree, this stays constant after
25 * initialization is complete. 25 * initialization is complete.