Path: blob/master/arch/mips/include/asm/dec/prom.h
17370 views
/*1* include/asm-mips/dec/prom.h2*3* DECstation PROM interface.4*5* Copyright (C) 2002 Maciej W. Rozycki6*7* This program is free software; you can redistribute it and/or8* modify it under the terms of the GNU General Public License9* as published by the Free Software Foundation; either version10* 2 of the License, or (at your option) any later version.11*12* Based on arch/mips/dec/prom/prom.h by the Anonymous.13*/14#ifndef _ASM_DEC_PROM_H15#define _ASM_DEC_PROM_H1617#include <linux/types.h>1819#include <asm/addrspace.h>2021/*22* PMAX/3MAX PROM entry points for DS2100/3100's and DS5000/2xx's.23* Many of these will work for MIPSen as well!24*/25#define VEC_RESET (u64 *)CKSEG1ADDR(0x1fc00000)26/* Prom base address */2728#define PMAX_PROM_ENTRY(x) (VEC_RESET + (x)) /* Prom jump table */2930#define PMAX_PROM_HALT PMAX_PROM_ENTRY(2) /* valid on MIPSen */31#define PMAX_PROM_AUTOBOOT PMAX_PROM_ENTRY(5) /* valid on MIPSen */32#define PMAX_PROM_OPEN PMAX_PROM_ENTRY(6)33#define PMAX_PROM_READ PMAX_PROM_ENTRY(7)34#define PMAX_PROM_CLOSE PMAX_PROM_ENTRY(10)35#define PMAX_PROM_LSEEK PMAX_PROM_ENTRY(11)36#define PMAX_PROM_GETCHAR PMAX_PROM_ENTRY(12)37#define PMAX_PROM_PUTCHAR PMAX_PROM_ENTRY(13) /* 12 on MIPSen */38#define PMAX_PROM_GETS PMAX_PROM_ENTRY(15)39#define PMAX_PROM_PRINTF PMAX_PROM_ENTRY(17)40#define PMAX_PROM_GETENV PMAX_PROM_ENTRY(33) /* valid on MIPSen */414243/*44* Magic number indicating REX PROM available on DECstation. Found in45* register a2 on transfer of control to program from PROM.46*/47#define REX_PROM_MAGIC 0x304643544849#ifdef CONFIG_64BIT5051#define prom_is_rex(magic) 1 /* KN04 and KN05 are REX PROMs. */5253#else /* !CONFIG_64BIT */5455#define prom_is_rex(magic) ((magic) == REX_PROM_MAGIC)5657#endif /* !CONFIG_64BIT */585960/*61* 3MIN/MAXINE PROM entry points for DS5000/1xx's, DS5000/xx's and62* DS5000/2x0.63*/64#define REX_PROM_GETBITMAP 0x84/4 /* get mem bitmap */65#define REX_PROM_GETCHAR 0x24/4 /* getch() */66#define REX_PROM_GETENV 0x64/4 /* get env. variable */67#define REX_PROM_GETSYSID 0x80/4 /* get system id */68#define REX_PROM_GETTCINFO 0xa4/469#define REX_PROM_PRINTF 0x30/4 /* printf() */70#define REX_PROM_SLOTADDR 0x6c/4 /* slotaddr */71#define REX_PROM_BOOTINIT 0x54/4 /* open() */72#define REX_PROM_BOOTREAD 0x58/4 /* read() */73#define REX_PROM_CLEARCACHE 0x7c/4747576/*77* Used by rex_getbitmap().78*/79typedef struct {80int pagesize;81unsigned char bitmap[0];82} memmap;838485/*86* Function pointers as read from a PROM's callback vector.87*/88extern int (*__rex_bootinit)(void);89extern int (*__rex_bootread)(void);90extern int (*__rex_getbitmap)(memmap *);91extern unsigned long *(*__rex_slot_address)(int);92extern void *(*__rex_gettcinfo)(void);93extern int (*__rex_getsysid)(void);94extern void (*__rex_clear_cache)(void);9596extern int (*__prom_getchar)(void);97extern char *(*__prom_getenv)(char *);98extern int (*__prom_printf)(char *, ...);99100extern int (*__pmax_open)(char*, int);101extern int (*__pmax_lseek)(int, long, int);102extern int (*__pmax_read)(int, void *, int);103extern int (*__pmax_close)(int);104105106#ifdef CONFIG_64BIT107108/*109* On MIPS64 we have to call PROM functions via a helper110* dispatcher to accommodate ABI incompatibilities.111*/112#define __DEC_PROM_O32(fun, arg) fun arg __asm__(#fun); \113__asm__(#fun " = call_o32")114115int __DEC_PROM_O32(_rex_bootinit, (int (*)(void)));116int __DEC_PROM_O32(_rex_bootread, (int (*)(void)));117int __DEC_PROM_O32(_rex_getbitmap, (int (*)(memmap *), memmap *));118unsigned long *__DEC_PROM_O32(_rex_slot_address,119(unsigned long *(*)(int), int));120void *__DEC_PROM_O32(_rex_gettcinfo, (void *(*)(void)));121int __DEC_PROM_O32(_rex_getsysid, (int (*)(void)));122void __DEC_PROM_O32(_rex_clear_cache, (void (*)(void)));123124int __DEC_PROM_O32(_prom_getchar, (int (*)(void)));125char *__DEC_PROM_O32(_prom_getenv, (char *(*)(char *), char *));126int __DEC_PROM_O32(_prom_printf, (int (*)(char *, ...), char *, ...));127128129#define rex_bootinit() _rex_bootinit(__rex_bootinit)130#define rex_bootread() _rex_bootread(__rex_bootread)131#define rex_getbitmap(x) _rex_getbitmap(__rex_getbitmap, x)132#define rex_slot_address(x) _rex_slot_address(__rex_slot_address, x)133#define rex_gettcinfo() _rex_gettcinfo(__rex_gettcinfo)134#define rex_getsysid() _rex_getsysid(__rex_getsysid)135#define rex_clear_cache() _rex_clear_cache(__rex_clear_cache)136137#define prom_getchar() _prom_getchar(__prom_getchar)138#define prom_getenv(x) _prom_getenv(__prom_getenv, x)139#define prom_printf(x...) _prom_printf(__prom_printf, x)140141#else /* !CONFIG_64BIT */142143/*144* On plain MIPS we just call PROM functions directly.145*/146#define rex_bootinit __rex_bootinit147#define rex_bootread __rex_bootread148#define rex_getbitmap __rex_getbitmap149#define rex_slot_address __rex_slot_address150#define rex_gettcinfo __rex_gettcinfo151#define rex_getsysid __rex_getsysid152#define rex_clear_cache __rex_clear_cache153154#define prom_getchar __prom_getchar155#define prom_getenv __prom_getenv156#define prom_printf __prom_printf157158#define pmax_open __pmax_open159#define pmax_lseek __pmax_lseek160#define pmax_read __pmax_read161#define pmax_close __pmax_close162163#endif /* !CONFIG_64BIT */164165166extern void prom_meminit(u32);167extern void prom_identify_arch(u32);168extern void prom_init_cmdline(s32, s32 *, u32);169170extern void register_prom_console(void);171extern void unregister_prom_console(void);172173#endif /* _ASM_DEC_PROM_H */174175176