plat
— Platform API
The platform API constitutes the minimum and mandatory functions each platform must provide.
The ‘plat_init’ function in each platform is expected to perform the follwing basic initialization:
Initialize a watchdog
Configure the systick
Load and decode system boot reason
Initialize debug console
Configure the MMU
The ‘plat_init’ and ‘plat_board_init’ functions are called early during boot, se Boot Process for more details.
Source code: include/pb/plat.h
Punch BOOT
Copyright (C) 2020 Jonas Blixt jonpe960@gmail.com
SPDX-License-Identifier: BSD-3-Clause
Functions
-
int plat_init(void)
Initialize the platform
- Returns:
PB_OK on success or a negative number
-
int plat_board_init(void)
Initialize the board
- Returns:
PB_OK on success or a negative number
-
void plat_reset(void)
Platform specific reset function
-
unsigned int plat_get_us_tick(void)
Read platform/system tick
- Returns:
current micro second tick
-
void plat_wdog_kick(void)
Kick watchdog
-
int plat_boot_reason(void)
Returns a platform specific boot reason as an integer.
- Returns:
>= 0 for valid boot reasons or a negative number on error
-
const char *plat_boot_reason_str(void)
Returns a platform specific boot reason as an string
- Returns:
Boot reason string or “”
-
int plat_get_unique_id(uint8_t *output, size_t *length)
Platform / SoC Unique data. This function is called by the device_uuid module to generate a device unique identifer
- Parameters:
output – [out] Unique data output
length – [inout] Size of output buffer and result length
- Returns:
PB_OK on success or a negative number