Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) #ifndef __SPARC_OPENPROM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) #define __SPARC_OPENPROM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) /* openprom.h:  Prom structures and defines for access to the OPENBOOT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *              prom routines and data areas.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) /* Empirical constants... */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #define LINUX_OPPROM_MAGIC      0x10010407
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #ifndef __ASSEMBLY__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/of.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) /* V0 prom device operations. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) struct linux_dev_v0_funcs {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 	int (*v0_devopen)(char *device_str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 	int (*v0_devclose)(int dev_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 	int (*v0_rdblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 	int (*v0_wrblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	int (*v0_wrnetdev)(int dev_desc, int num_bytes, char *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	int (*v0_rdnetdev)(int dev_desc, int num_bytes, char *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 	int (*v0_rdchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	int (*v0_wrchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	int (*v0_seekdev)(int dev_desc, long logical_offst, int from);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) /* V2 and later prom device operations. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) struct linux_dev_v2_funcs {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	phandle (*v2_inst2pkg)(int d);	/* Convert ihandle to phandle */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	char * (*v2_dumb_mem_alloc)(char *va, unsigned int sz);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	void (*v2_dumb_mem_free)(char *va, unsigned int sz);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	/* To map devices into virtual I/O space. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	char * (*v2_dumb_mmap)(char *virta, int which_io, unsigned int paddr, unsigned int sz);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	void (*v2_dumb_munmap)(char *virta, unsigned int size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	int (*v2_dev_open)(char *devpath);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	void (*v2_dev_close)(int d);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	int (*v2_dev_read)(int d, char *buf, int nbytes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	int (*v2_dev_write)(int d, const char *buf, int nbytes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	int (*v2_dev_seek)(int d, int hi, int lo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	/* Never issued (multistage load support) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	void (*v2_wheee2)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	void (*v2_wheee3)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) struct linux_mlist_v0 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	struct linux_mlist_v0 *theres_more;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	unsigned int start_adr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	unsigned int num_bytes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) struct linux_mem_v0 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	struct linux_mlist_v0 **v0_totphys;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	struct linux_mlist_v0 **v0_prommap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	struct linux_mlist_v0 **v0_available; /* What we can use */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) /* Arguments sent to the kernel from the boot prompt. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) struct linux_arguments_v0 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	char *argv[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	char args[100];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	char boot_dev[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	int boot_dev_ctrl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	int boot_dev_unit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	int dev_partition;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	char *kernel_file_name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	void *aieee1;           /* XXX */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) /* V2 and up boot things. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) struct linux_bootargs_v2 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	char **bootpath;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	char **bootargs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	int *fd_stdin;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	int *fd_stdout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) /* The top level PROM vector. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) struct linux_romvec {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	/* Version numbers. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	unsigned int pv_magic_cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	unsigned int pv_romvers;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	unsigned int pv_plugin_revision;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	unsigned int pv_printrev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	/* Version 0 memory descriptors. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	struct linux_mem_v0 pv_v0mem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	/* Node operations. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	struct linux_nodeops *pv_nodeops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	char **pv_bootstr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	struct linux_dev_v0_funcs pv_v0devops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	char *pv_stdin;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	char *pv_stdout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) #define	PROMDEV_KBD	0		/* input from keyboard */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) #define	PROMDEV_SCREEN	0		/* output to screen */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) #define	PROMDEV_TTYA	1		/* in/out to ttya */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) #define	PROMDEV_TTYB	2		/* in/out to ttyb */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	/* Blocking getchar/putchar.  NOT REENTRANT! (grr) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	int (*pv_getchar)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	void (*pv_putchar)(int ch);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	/* Non-blocking variants. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	int (*pv_nbgetchar)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	int (*pv_nbputchar)(int ch);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	void (*pv_putstr)(char *str, int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	/* Miscellany. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	void (*pv_reboot)(char *bootstr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	void (*pv_printf)(__const__ char *fmt, ...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	void (*pv_abort)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	__volatile__ int *pv_ticks;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	void (*pv_halt)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	void (**pv_synchook)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	/* Evaluate a forth string, not different proto for V0 and V2->up. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		void (*v0_eval)(int len, char *str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 		void (*v2_eval)(char *str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	} pv_fortheval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	struct linux_arguments_v0 **pv_v0bootargs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	/* Get ether address. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	unsigned int (*pv_enaddr)(int d, char *enaddr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	struct linux_bootargs_v2 pv_v2bootargs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	struct linux_dev_v2_funcs pv_v2devops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	int filler[15];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	/* This one is sun4c/sun4 only. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	void (*pv_setctxt)(int ctxt, char *va, int pmeg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	/* Prom version 3 Multiprocessor routines. This stuff is crazy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	 * No joke. Calling these when there is only one cpu probably
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	 * crashes the machine, have to test this. :-)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	/* v3_cpustart() will start the cpu 'whichcpu' in mmu-context
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	 * 'thiscontext' executing at address 'prog_counter'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	int (*v3_cpustart)(unsigned int whichcpu, int ctxtbl_ptr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 			   int thiscontext, char *prog_counter);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	/* v3_cpustop() will cause cpu 'whichcpu' to stop executing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	 * until a resume cpu call is made.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	int (*v3_cpustop)(unsigned int whichcpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	/* v3_cpuidle() will idle cpu 'whichcpu' until a stop or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	 * resume cpu call is made.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	int (*v3_cpuidle)(unsigned int whichcpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	/* v3_cpuresume() will resume processor 'whichcpu' executing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	 * starting with whatever 'pc' and 'npc' were left at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	 * last 'idle' or 'stop' call.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	int (*v3_cpuresume)(unsigned int whichcpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) /* Routines for traversing the prom device tree. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) struct linux_nodeops {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	phandle (*no_nextnode)(phandle node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	phandle (*no_child)(phandle node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	int (*no_proplen)(phandle node, const char *name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	int (*no_getprop)(phandle node, const char *name, char *val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	int (*no_setprop)(phandle node, const char *name, char *val, int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	char * (*no_nextprop)(phandle node, char *name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) /* More fun PROM structures for device probing. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) #if defined(__sparc__) && defined(__arch64__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) #define PROMREG_MAX     24
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) #define PROMVADDR_MAX   16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) #define PROMINTR_MAX    32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) #define PROMREG_MAX     16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) #define PROMVADDR_MAX   16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) #define PROMINTR_MAX    15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) struct linux_prom_registers {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	unsigned int which_io;	/* hi part of physical address */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	unsigned int phys_addr;	/* The physical address of this register */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	unsigned int reg_size;	/* How many bytes does this register take up? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) struct linux_prom64_registers {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	unsigned long phys_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	unsigned long reg_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) struct linux_prom_irqs {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	int pri;    /* IRQ priority */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	int vector; /* This is foobar, what does it do? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) /* Element of the "ranges" vector */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) struct linux_prom_ranges {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	unsigned int ot_child_space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	unsigned int ot_child_base;		/* Bus feels this */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	unsigned int ot_parent_space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	unsigned int ot_parent_base;		/* CPU looks from here */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	unsigned int or_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)  * Ranges and reg properties are a bit different for PCI.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) #if defined(__sparc__) && defined(__arch64__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) struct linux_prom_pci_registers {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	unsigned int phys_hi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	unsigned int phys_mid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	unsigned int phys_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	unsigned int size_hi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	unsigned int size_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) struct linux_prom_pci_registers {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	 * We don't know what information this field contain.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	 * We guess, PCI device function is in bits 15:8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	 * So, ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	unsigned int which_io;  /* Let it be which_io */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	unsigned int phys_hi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	unsigned int phys_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	unsigned int size_hi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 	unsigned int size_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) struct linux_prom_pci_ranges {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	unsigned int child_phys_hi;	/* Only certain bits are encoded here. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	unsigned int child_phys_mid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	unsigned int child_phys_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 	unsigned int parent_phys_hi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	unsigned int parent_phys_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	unsigned int size_hi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	unsigned int size_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) struct linux_prom_pci_intmap {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	unsigned int phys_hi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 	unsigned int phys_mid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 	unsigned int phys_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 	unsigned int interrupt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 	int          cnode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 	unsigned int cinterrupt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) struct linux_prom_pci_intmask {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 	unsigned int phys_hi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 	unsigned int phys_mid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 	unsigned int phys_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 	unsigned int interrupt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) #endif /* !(__ASSEMBLY__) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) #endif /* !(__SPARC_OPENPROM_H) */