1 /*
2  * Copyright (c) 2021 Nordic Semiconductor ASA
3  * Copyright (c) 2021 Yonatan Schachter
4  * Copyright (c) 2024 Andrew Featherstone
5  *
6  * SPDX-License-Identifier: Apache-2.0
7  */
8 
9 /**
10  * @file
11  * @brief System/hardware module for Raspberry Pi RP2xxx family of processors
12  *
13  * This module provides routines to initialize and support board-level hardware
14  * for the Raspberry Pi RP2xxx family of processors (RP2040, RP235x).
15  */
16 
17 #include <stdio.h>
18 
19 #include <zephyr/fatal.h>
20 #include <zephyr/logging/log.h>
21 
22 LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL);
23 
24 /*
25  * Some pico-sdk drivers call panic on fatal error.
26  * This alternative implementation of panic handles the panic
27  * through Zephyr.
28  */
panic(const char * fmt,...)29 void __attribute__((noreturn)) panic(const char *fmt, ...)
30 {
31 	va_list args;
32 
33 	va_start(args, fmt);
34 	vprintf(fmt, args);
35 	k_fatal_halt(K_ERR_CPU_EXCEPTION);
36 }
37