1 /* 2 * Copyright (c) 2000-2021 Apple Inc. All rights reserved. 3 */ 4 #ifndef _PEXPERT_ARM_PROTOS_H 5 #define _PEXPERT_ARM_PROTOS_H 6 7 #ifdef __cplusplus 8 extern "C" { 9 #endif /* __cplusplus */ 10 11 extern vm_offset_t pe_arm_get_soc_base_phys(void); 12 extern uint32_t pe_arm_init_interrupts(void *args); 13 extern void pe_arm_init_debug(void *args); 14 15 #ifdef PEXPERT_KERNEL_PRIVATE 16 extern void console_write_unbuffered(char); 17 #endif 18 int serial_init(void); 19 20 /** 21 * Forbid or allow transmission over each serial until they receive data. 22 */ 23 void 24 serial_set_on_demand(bool); 25 26 #if HIBERNATION 27 void serial_hibernation_init(void); 28 #endif /* HIBERNATION */ 29 int serial_getc(void); 30 void serial_putc(char); 31 void uart_putc(char); 32 #ifdef PRIVATE 33 void serial_putc_options(char, bool); 34 void uart_putc_options(char, bool); 35 #endif /* PRIVATE */ 36 int uart_getc(void); 37 38 void pe_init_fiq(void); 39 40 #ifdef PRIVATE 41 /** 42 * One hot ids to distinquish between all supported serial devices 43 */ 44 typedef enum serial_device { 45 SERIAL_UNKNOWN=0x0, 46 SERIAL_APPLE_UART=0x1, 47 SERIAL_DOCKCHANNEL=0x2, 48 SERIAL_PI3_UART=0x4, 49 SERIAL_VMAPPLE_UART=0x8, 50 SERIAL_DCC_UART=0x10 51 } serial_device_t; 52 53 kern_return_t serial_irq_enable(serial_device_t device); 54 kern_return_t serial_irq_action(serial_device_t device); 55 bool serial_irq_filter(serial_device_t device); 56 57 void serial_go_to_sleep(void); 58 #endif /* PRIVATE */ 59 60 int switch_to_serial_console(void); 61 void switch_to_old_console(int); 62 63 #ifdef __cplusplus 64 } 65 #endif /* __cplusplus */ 66 #endif /* _PEXPERT_ARM_PROTOS_H */ 67