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 * ddr_mem_get_usable_size() - Get ddr memory region size that loader can use 14 * 15 * @base: ddr memory region base. 16 * @size: ddr memory region size. 17 * @return ddr memory region size that loader can use. 18 */ 19 phys_size_t ddr_mem_get_usable_size(u64 base, u64 size); 20 21 /** 22 * param_parse_ddr_mem() - Parse ddr memory region 23 * 24 * @out_count: valid count of memblock for memblock list. 25 * @return memblock structure list which contains base and size info. 26 */ 27 struct memblock *param_parse_ddr_mem(int *out_count); 28 29 /** 30 * param_simple_parse_ddr_mem() - Simple parse ddr memory region 31 */ 32 #ifndef CONFIG_BIDRAM 33 phys_size_t param_simple_parse_ddr_mem(int init_bank); 34 #endif 35 36 /** 37 * param_parse_atf_mem() - Parse atf memory region 38 * 39 * @return memblock structure which contains base and size info. 40 */ 41 struct memblock param_parse_atf_mem(void); 42 43 /** 44 * param_parse_atf_mem() - Parse op-tee memory region 45 * 46 * @return memblock structure which contains base and size info. 47 */ 48 struct memblock param_parse_optee_mem(void); 49 50 /** 51 * param_parse_atf_mem() - Parse platform common reserved memory region 52 * 53 * @return memblock structure which contains base and size info. 54 */ 55 struct memblock param_parse_common_resv_mem(void); 56 57 /** 58 * param_parse_atags_bootdev() - Parse boot device info from atags. 59 * 60 * @devtype: out data to store dev type 61 * @devnum: out data to store dev number 62 * 63 * @return 0 on success, otherwise failed. 64 */ 65 int param_parse_atags_bootdev(char **devtype, char **devtnum); 66 67 /** 68 * param_parse_assign_bootdev() - Parse boot device info from configuration. 69 * 70 * @devtype: out data to store dev type 71 * @devnum: out data to store dev number 72 * 73 * @return 0 on success, otherwise failed. 74 */ 75 int param_parse_assign_bootdev(char **devtype, char **devtnum); 76 77 /** 78 * param_parse_pre_serial() - Parse and Init serial according to pre-loader serial. 79 * 80 * @return 0 on success, otherwise failed. 81 */ 82 int param_parse_pre_serial(int *flags); 83 84 /** 85 * param_parse_pubkey_fuse_programmed() - Parse and pass fuse programmed state. 86 * 87 * @return 0 on success, otherwise failed. 88 */ 89 int param_parse_pubkey_fuse_programmed(void); 90 91 #ifdef CONFIG_PSTORE 92 /** 93 * param_parse_pstore() - Parse and Init pstore according to pre-loader atags. 94 * 95 * @return 0 on success, otherwise failed. 96 */ 97 int param_parse_pstore(void); 98 #endif 99 #endif 100