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 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) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) /* Empirical constants... */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #ifdef CONFIG_SUN3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #define KADB_DEBUGGER_BEGVM     0x0fee0000    /* There is no kadb yet but...*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #define LINUX_OPPROM_BEGVM      0x0fef0000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #define LINUX_OPPROM_ENDVM      0x0ff10000    /* I think this is right - tm */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #define KADB_DEBUGGER_BEGVM     0xffc00000    /* Where kern debugger is in virt-mem */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #define	LINUX_OPPROM_BEGVM	0xffd00000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #define	LINUX_OPPROM_ENDVM	0xfff00000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #define	LINUX_OPPROM_MAGIC      0x10010407
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #ifndef __ASSEMBLY__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) /* V0 prom device operations. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) struct linux_dev_v0_funcs {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	int (*v0_devopen)(char *device_str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	int (*v0_devclose)(int dev_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	int (*v0_rdblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	int (*v0_wrblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	int (*v0_wrnetdev)(int dev_desc, int num_bytes, char *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	int (*v0_rdnetdev)(int dev_desc, int num_bytes, char *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	int (*v0_rdchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	int (*v0_wrchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	int (*v0_seekdev)(int dev_desc, long logical_offst, int from);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) /* V2 and later prom device operations. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) struct linux_dev_v2_funcs {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	int (*v2_inst2pkg)(int d);	/* Convert ihandle to phandle */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	char * (*v2_dumb_mem_alloc)(char *va, unsigned sz);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	void (*v2_dumb_mem_free)(char *va, unsigned sz);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	/* To map devices into virtual I/O space. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	char * (*v2_dumb_mmap)(char *virta, int which_io, unsigned paddr, unsigned sz);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	void (*v2_dumb_munmap)(char *virta, unsigned size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	int (*v2_dev_open)(char *devpath);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	void (*v2_dev_close)(int d);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	int (*v2_dev_read)(int d, char *buf, int nbytes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	int (*v2_dev_write)(int d, char *buf, int nbytes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	int (*v2_dev_seek)(int d, int hi, int lo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	/* Never issued (multistage load support) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	void (*v2_wheee2)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	void (*v2_wheee3)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) struct linux_mlist_v0 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	struct linux_mlist_v0 *theres_more;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	char *start_adr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	unsigned num_bytes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) struct linux_mem_v0 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	struct linux_mlist_v0 **v0_totphys;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	struct linux_mlist_v0 **v0_prommap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	struct linux_mlist_v0 **v0_available; /* What we can use */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) /* Arguments sent to the kernel from the boot prompt. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) struct linux_arguments_v0 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	char *argv[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	char args[100];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	char boot_dev[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	int boot_dev_ctrl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	int boot_dev_unit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	int dev_partition;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	char *kernel_file_name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	void *aieee1;           /* XXX */
^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) /* V2 and up boot things. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) struct linux_bootargs_v2 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	char **bootpath;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	char **bootargs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	int *fd_stdin;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	int *fd_stdout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) #if defined(CONFIG_SUN3) || defined(CONFIG_SUN3X)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) struct linux_romvec {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	char		*pv_initsp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	int		(*pv_startmon)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	int		*diagberr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	struct linux_arguments_v0 **pv_v0bootargs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	unsigned	*pv_sun3mem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	unsigned char	(*pv_getchar)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	int		(*pv_putchar)(int ch);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	int		(*pv_nbgetchar)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	int		(*pv_nbputchar)(int ch);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	unsigned char	*pv_echo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	unsigned char	*pv_insource;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	unsigned char	*pv_outsink;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	int		(*pv_getkey)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	int		(*pv_initgetkey)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	unsigned int	*pv_translation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	unsigned char	*pv_keybid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	int		*pv_screen_x;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	int		*pv_screen_y;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	struct keybuf	*pv_keybuf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	char		*pv_monid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	 * Frame buffer output and terminal emulation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	int		(*pv_fbwritechar)(char);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	int		*pv_fbaddr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	char		**pv_font;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	int		(*pv_fbwritestr)(char);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	void		(*pv_reboot)(char *bootstr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	 * Line input and parsing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	unsigned char	*pv_linebuf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	unsigned char	**pv_lineptr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	int		*pv_linesize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	int		(*pv_getline)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	unsigned char	(*pv_getnextchar)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	unsigned char	(*pv_peeknextchar)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	int		*pv_fbthere;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	int		(*pv_getnum)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	void		(*pv_printf)(const char *fmt, ...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	int		(*pv_printhex)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	unsigned char	*pv_leds;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	int		(*pv_setleds)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	 * Non-maskable interrupt  (nmi) information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	int		(*pv_nmiaddr)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	int		(*pv_abortentry)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	int		*pv_nmiclock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	int		*pv_fbtype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	 * Assorted other things
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	unsigned	pv_romvers;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	struct globram  *pv_globram;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	char		*pv_kbdzscc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	int		*pv_keyrinit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	unsigned char	*pv_keyrtick;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	unsigned	*pv_memoryavail;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	long		*pv_resetaddr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	long		*pv_resetmap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	void		(*pv_halt)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	unsigned char	*pv_memorybitmap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) #ifdef CONFIG_SUN3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	void		(*pv_setctxt)(int ctxt, char *va, int pmeg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	void		(*pv_vector_cmd)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	int		dummy1z;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	int		dummy2z;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	int		dummy3z;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	int		dummy4z;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) /* The top level PROM vector. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) struct linux_romvec {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	/* Version numbers. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	unsigned int pv_magic_cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	unsigned int pv_romvers;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	unsigned int pv_plugin_revision;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	unsigned int pv_printrev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	/* Version 0 memory descriptors. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	struct linux_mem_v0 pv_v0mem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	/* Node operations. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	struct linux_nodeops *pv_nodeops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	char **pv_bootstr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	struct linux_dev_v0_funcs pv_v0devops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	char *pv_stdin;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	char *pv_stdout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) #define	PROMDEV_KBD	0		/* input from keyboard */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) #define	PROMDEV_SCREEN	0		/* output to screen */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) #define	PROMDEV_TTYA	1		/* in/out to ttya */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) #define	PROMDEV_TTYB	2		/* in/out to ttyb */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	/* Blocking getchar/putchar.  NOT REENTRANT! (grr) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	int (*pv_getchar)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	void (*pv_putchar)(int ch);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	/* Non-blocking variants. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	int (*pv_nbgetchar)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	int (*pv_nbputchar)(int ch);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	void (*pv_putstr)(char *str, int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	/* Miscellany. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	void (*pv_reboot)(char *bootstr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	void (*pv_printf)(__const__ char *fmt, ...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	void (*pv_abort)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	__volatile__ int *pv_ticks;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	void (*pv_halt)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	void (**pv_synchook)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	/* Evaluate a forth string, not different proto for V0 and V2->up. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 		void (*v0_eval)(int len, char *str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 		void (*v2_eval)(char *str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	} pv_fortheval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	struct linux_arguments_v0 **pv_v0bootargs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	/* Get ether address. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	unsigned int (*pv_enaddr)(int d, char *enaddr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	struct linux_bootargs_v2 pv_v2bootargs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	struct linux_dev_v2_funcs pv_v2devops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	int filler[15];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 	/* This one is sun4c/sun4 only. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 	void (*pv_setctxt)(int ctxt, char *va, int pmeg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 	/* Prom version 3 Multiprocessor routines. This stuff is crazy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 	 * No joke. Calling these when there is only one cpu probably
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	 * crashes the machine, have to test this. :-)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 	/* v3_cpustart() will start the cpu 'whichcpu' in mmu-context
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 	 * 'thiscontext' executing at address 'prog_counter'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	int (*v3_cpustart)(unsigned int whichcpu, int ctxtbl_ptr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 			   int thiscontext, char *prog_counter);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 	/* v3_cpustop() will cause cpu 'whichcpu' to stop executing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 	 * until a resume cpu call is made.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	int (*v3_cpustop)(unsigned int whichcpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 	/* v3_cpuidle() will idle cpu 'whichcpu' until a stop or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 	 * resume cpu call is made.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 	int (*v3_cpuidle)(unsigned int whichcpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 	/* v3_cpuresume() will resume processor 'whichcpu' executing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 	 * starting with whatever 'pc' and 'npc' were left at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 	 * last 'idle' or 'stop' call.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 	int (*v3_cpuresume)(unsigned int whichcpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) /* Routines for traversing the prom device tree. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) struct linux_nodeops {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 	int (*no_nextnode)(int node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 	int (*no_child)(int node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 	int (*no_proplen)(int node, char *name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 	int (*no_getprop)(int node, char *name, char *val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 	int (*no_setprop)(int node, char *name, char *val, int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 	char * (*no_nextprop)(int node, char *name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) /* More fun PROM structures for device probing. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) #define PROMREG_MAX     16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) #define PROMVADDR_MAX   16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) #define PROMINTR_MAX    15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) struct linux_prom_registers {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 	int which_io;         /* is this in OBIO space? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 	char *phys_addr;      /* The physical address of this register */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 	int reg_size;         /* How many bytes does this register take up? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) struct linux_prom_irqs {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 	int pri;    /* IRQ priority */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 	int vector; /* This is foobar, what does it do? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) /* Element of the "ranges" vector */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) struct linux_prom_ranges {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 	unsigned int ot_child_space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 	unsigned int ot_child_base;		/* Bus feels this */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 	unsigned int ot_parent_space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 	unsigned int ot_parent_base;		/* CPU looks from here */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 	unsigned int or_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) #endif /* !(__ASSEMBLY__) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) #endif /* !(__SPARC_OPENPROM_H) */