18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef _PPC_BOOT_PLANETCORE_H_ 38c2ecf20Sopenharmony_ci#define _PPC_BOOT_PLANETCORE_H_ 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#include "types.h" 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_BOARD_TYPE "BO" 88c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_BOARD_REV "BR" 98c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_MB_RAM "D1" 108c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_MAC_ADDR "EA" 118c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_FLASH_SPEED "FS" 128c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_IP_ADDR "IP" 138c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_KB_NVRAM "NV" 148c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_PROCESSOR "PR" 158c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_PROC_VARIANT "PV" 168c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_SERIAL_BAUD "SB" 178c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_SERIAL_PORT "SP" 188c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_SWITCH "SW" 198c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_TEMP_OFFSET "TC" 208c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_TARGET_IP "TIP" 218c2ecf20Sopenharmony_ci#define PLANETCORE_KEY_CRYSTAL_HZ "XT" 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci/* Prepare the table for processing, by turning all newlines 248c2ecf20Sopenharmony_ci * into NULL bytes. 258c2ecf20Sopenharmony_ci */ 268c2ecf20Sopenharmony_civoid planetcore_prepare_table(char *table); 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci/* Return the value associated with a given key in text, 298c2ecf20Sopenharmony_ci * decimal, or hex format. 308c2ecf20Sopenharmony_ci * 318c2ecf20Sopenharmony_ci * Returns zero/NULL on failure, non-zero on success. 328c2ecf20Sopenharmony_ci */ 338c2ecf20Sopenharmony_ciconst char *planetcore_get_key(const char *table, const char *key); 348c2ecf20Sopenharmony_ciint planetcore_get_decimal(const char *table, const char *key, u64 *val); 358c2ecf20Sopenharmony_ciint planetcore_get_hex(const char *table, const char *key, u64 *val); 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci/* Updates the device tree local-mac-address properties based 388c2ecf20Sopenharmony_ci * on the EA tag. 398c2ecf20Sopenharmony_ci */ 408c2ecf20Sopenharmony_civoid planetcore_set_mac_addrs(const char *table); 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci/* Sets the linux,stdout-path in the /chosen node. This requires the 438c2ecf20Sopenharmony_ci * linux,planetcore-label property in each serial node. 448c2ecf20Sopenharmony_ci */ 458c2ecf20Sopenharmony_civoid planetcore_set_stdout_path(const char *table); 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci#endif 48