1 /****************************************************************************** 2 * Copyright (c) 2004, 2008 IBM Corporation 3 * All rights reserved. 4 * This program and the accompanying materials 5 * are made available under the terms of the BSD License 6 * which accompanies this distribution, and is available at 7 * http://www.opensource.org/licenses/bsd-license.php 8 * 9 * Contributors: 10 * IBM Corporation - initial implementation 11 *****************************************************************************/ 12 13 #ifndef OF_H 14 #define OF_H 15 16 #include <stdint.h> 17 #include <stddef.h> 18 19 #define p32 int 20 #define p32cast (int) (unsigned long) (void*) 21 22 #define phandle_t p32 23 #define ihandle_t p32 24 25 typedef struct 26 { 27 unsigned int serv; 28 int nargs; 29 int nrets; 30 unsigned int args[16]; 31 } of_arg_t; 32 33 34 phandle_t of_finddevice (const char *); 35 phandle_t of_peer (phandle_t); 36 phandle_t of_child (phandle_t); 37 phandle_t of_parent (phandle_t); 38 phandle_t of_instance_to_package(ihandle_t ihandle); 39 int of_getprop (phandle_t, const char *, void *, int); 40 void * of_call_method_3 (const char *, ihandle_t, int); 41 int of_test(const char *name); 42 int of_interpret_1(void *s, void *ret); 43 44 ihandle_t of_open (const char *); 45 void of_close(ihandle_t); 46 int of_read (ihandle_t , void*, int); 47 int of_write (ihandle_t, void*, int); 48 int of_seek (ihandle_t, int, int); 49 50 void * of_claim(void *, unsigned int , unsigned int ); 51 void of_release(void *, unsigned int ); 52 53 int of_yield(void); 54 void * of_set_callback(void *); 55 56 unsigned int romfs_lookup(const char *, void **); 57 int vpd_read(unsigned int , unsigned int , char *); 58 int vpd_write(unsigned int , unsigned int , char *); 59 int write_mm_log(char *, unsigned int , unsigned short ); 60 61 int of_get_mac(phandle_t device, char *mac); 62 uint64_t get_puid(phandle_t node); 63 void translate_address_dev(uint64_t *, phandle_t); 64 void translate_address(unsigned long *addr); 65 66 int of_glue_init(unsigned int * timebase, 67 size_t _client_start, size_t _client_size); 68 void of_glue_release(void); 69 70 #endif 71