1 /* 2 * (C) Copyright 2019 Rockchip Electronics Co., Ltd 3 * 4 * SPDX-License-Identifier: GPL-2.0+ 5 */ 6 7 #ifndef __ROCKCHIP_PARAM_H_ 8 #define __ROCKCHIP_PARAM_H_ 9 10 #include <memblk.h> 11 12 /** 13 * param_parse_ddr_mem() - Parse ddr memory region 14 * 15 * @out_count: valid count of memblock for memblock list. 16 * @return memblock structure list which contains base and size info. 17 */ 18 struct memblock *param_parse_ddr_mem(int *out_count); 19 20 /** 21 * param_simple_parse_ddr_mem() - Simple parse ddr memory region 22 */ 23 #ifndef CONFIG_BIDRAM 24 phys_size_t param_simple_parse_ddr_mem(int init_bank); 25 #endif 26 27 /** 28 * param_parse_atf_mem() - Parse atf memory region 29 * 30 * @return memblock structure which contains base and size info. 31 */ 32 struct memblock param_parse_atf_mem(void); 33 34 /** 35 * param_parse_atf_mem() - Parse op-tee memory region 36 * 37 * @return memblock structure which contains base and size info. 38 */ 39 struct memblock param_parse_optee_mem(void); 40 41 /** 42 * param_parse_atf_mem() - Parse platform common reserved memory region 43 * 44 * @return memblock structure which contains base and size info. 45 */ 46 struct memblock param_parse_common_resv_mem(void); 47 48 /** 49 * param_parse_atags_bootdev() - Parse boot device info from atags. 50 * 51 * @devtype: out data to store dev type 52 * @devnum: out data to store dev number 53 * 54 * @return 0 on success, otherwise failed. 55 */ 56 int param_parse_atags_bootdev(char **devtype, char **devtnum); 57 58 /** 59 * param_parse_assign_bootdev() - Parse boot device info from configuration. 60 * 61 * @devtype: out data to store dev type 62 * @devnum: out data to store dev number 63 * 64 * @return 0 on success, otherwise failed. 65 */ 66 int param_parse_assign_bootdev(char **devtype, char **devtnum); 67 68 /** 69 * param_parse_pre_serial() - Parse and Init serial according to pre-loader serial. 70 * 71 * @return 0 on success, otherwise failed. 72 */ 73 int param_parse_pre_serial(int *flags); 74 75 /** 76 * param_parse_pubkey_fuse_programmed() - Parse and pass fuse programmed state. 77 * 78 * @return 0 on success, otherwise failed. 79 */ 80 int param_parse_pubkey_fuse_programmed(void); 81 82 #ifdef CONFIG_PSTORE 83 /** 84 * param_parse_pstore() - Parse and Init pstore according to pre-loader atags. 85 * 86 * @return 0 on success, otherwise failed. 87 */ 88 int param_parse_pstore(void); 89 #endif 90 #endif 91