xref: /linux/arch/powerpc/boot/planetcore.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2fec60470SScott Wood #ifndef _PPC_BOOT_PLANETCORE_H_
3fec60470SScott Wood #define _PPC_BOOT_PLANETCORE_H_
4fec60470SScott Wood 
5fec60470SScott Wood #include "types.h"
6fec60470SScott Wood 
7fec60470SScott Wood #define PLANETCORE_KEY_BOARD_TYPE   "BO"
8fec60470SScott Wood #define PLANETCORE_KEY_BOARD_REV    "BR"
9fec60470SScott Wood #define PLANETCORE_KEY_MB_RAM       "D1"
10fec60470SScott Wood #define PLANETCORE_KEY_MAC_ADDR     "EA"
11fec60470SScott Wood #define PLANETCORE_KEY_FLASH_SPEED  "FS"
12fec60470SScott Wood #define PLANETCORE_KEY_IP_ADDR      "IP"
13fec60470SScott Wood #define PLANETCORE_KEY_KB_NVRAM     "NV"
14fec60470SScott Wood #define PLANETCORE_KEY_PROCESSOR    "PR"
15fec60470SScott Wood #define PLANETCORE_KEY_PROC_VARIANT "PV"
16fec60470SScott Wood #define PLANETCORE_KEY_SERIAL_BAUD  "SB"
17fec60470SScott Wood #define PLANETCORE_KEY_SERIAL_PORT  "SP"
18fec60470SScott Wood #define PLANETCORE_KEY_SWITCH       "SW"
19fec60470SScott Wood #define PLANETCORE_KEY_TEMP_OFFSET  "TC"
20fec60470SScott Wood #define PLANETCORE_KEY_TARGET_IP    "TIP"
21fec60470SScott Wood #define PLANETCORE_KEY_CRYSTAL_HZ   "XT"
22fec60470SScott Wood 
23fec60470SScott Wood /* Prepare the table for processing, by turning all newlines
24fec60470SScott Wood  * into NULL bytes.
25fec60470SScott Wood  */
26fec60470SScott Wood void planetcore_prepare_table(char *table);
27fec60470SScott Wood 
28fec60470SScott Wood /* Return the value associated with a given key in text,
29fec60470SScott Wood  * decimal, or hex format.
30fec60470SScott Wood  *
31fec60470SScott Wood  * Returns zero/NULL on failure, non-zero on success.
32fec60470SScott Wood  */
33fec60470SScott Wood const char *planetcore_get_key(const char *table, const char *key);
34fec60470SScott Wood int planetcore_get_decimal(const char *table, const char *key, u64 *val);
35fec60470SScott Wood int planetcore_get_hex(const char *table, const char *key, u64 *val);
36fec60470SScott Wood 
37fec60470SScott Wood /* Updates the device tree local-mac-address properties based
38fec60470SScott Wood  * on the EA tag.
39fec60470SScott Wood  */
40fec60470SScott Wood void planetcore_set_mac_addrs(const char *table);
41fec60470SScott Wood 
42fec60470SScott Wood /* Sets the linux,stdout-path in the /chosen node.  This requires the
43fec60470SScott Wood  * linux,planetcore-label property in each serial node.
44fec60470SScott Wood  */
45fec60470SScott Wood void planetcore_set_stdout_path(const char *table);
46fec60470SScott Wood 
47fec60470SScott Wood #endif
48