m1n1/src/wdt.h
Vincent Duvert b15be6bcd7 Remove hardcoded UART/WDT addresses
The M1 Pro/Max Macs use a different base address for the UART and the
WDT than earlier models.

Remove hardcoded base addresses constants and replace them with loads
from the ADT.

- The base address of the WDT is already retrieved in wdt_disable; also
use this address when triggering a reboot.
- Retrieve the base address of uart0 in uart_init. If the operation
fails, the error will be signaled on the early uart (if not disabled).
- The early debug UART can’t use the ADT (or shouldn’t) so it is now
disabled by default. To enable it, add
-DEARLY_UART -DEARLY_UART_BASE=0xuart_address
to the CFLAGS.

Signed-off-by: Vincent Duvert <vincent@duvert.net>
2021-11-01 11:27:29 +09:00

9 lines
128 B
C

/* SPDX-License-Identifier: MIT */
#ifndef __WDT_H__
#define __WDT_H__
void wdt_disable(void);
void wdt_reboot(void);
#endif