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