1 /* 2 * This file and its contents are supplied under the terms of the 3 * Common Development and Distribution License ("CDDL"), version 1.0. 4 * You may only use this file in accordance with the terms of version 5 * 1.0 of the CDDL. 6 * 7 * A full copy of the text of the CDDL should have accompanied this 8 * source. A copy of the CDDL is also available via the Internet at 9 * http://www.illumos.org/license/CDDL. 10 */ 11 12 /* 13 * Copyright (c) 2013 Joyent, Inc. All rights reserved. 14 * Copyright (c) 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> 15 */ 16 17 #ifndef _FAKELOADER_H 18 #define _FAKELOADER_H 19 20 /* 21 * The hacky version of arm uniboot that is exactly for a few systems. 22 */ 23 24 #include <sys/stdint.h> 25 #include <sys/atag.h> 26 27 #ifdef __cplusplus 28 extern "C" { 29 #endif 30 31 typedef struct fakeloader_hdr { 32 unsigned char fh_magic[4]; /* Magic! */ 33 uint32_t fh_unix_size; /* How large is unix */ 34 uint32_t fh_unix_offset; /* Offset from start to unix */ 35 uint32_t fh_archive_size; /* How large is the archive */ 36 uint32_t fh_archive_offset; /* Offset from start to archive */ 37 } fakeloader_hdr_t; 38 39 #define FH_MAGIC0 'i' 40 #define FH_MAGIC1 'f' 41 #define FH_MAGIC2 'b' 42 #define FH_MAGIC3 'h' 43 44 /* 45 * Backend operations, eg. what a given board must implement at the moment 46 */ 47 extern void fakeload_backend_init(void); 48 extern void fakeload_backend_putc(int); 49 extern void fakeload_backend_addmaps(atag_header_t *); 50 51 /* 52 * ASM operations 53 */ 54 extern void fakeload_unaligned_enable(void); 55 extern void fakeload_mmu_enable(void); 56 extern void fakeload_pt_setup(uintptr_t); 57 extern void fakeload_exec(void *, void *, atag_header_t *, uintptr_t); 58 59 extern void armv6_dcache_disable(void); 60 extern void armv6_dcache_enable(void); 61 extern void armv6_dcache_inval(void); 62 extern void armv6_dcache_flush(void); 63 64 extern void armv6_icache_disable(void); 65 extern void armv6_icache_enable(void); 66 extern void armv6_icache_inval(void); 67 68 #ifdef __cplusplus 69 } 70 #endif 71 72 #endif /* _FAKELOADER_H */