Lines Matching refs:len
19 static u16 fru_cal_area_len(u8 len) in fru_cal_area_len() argument
21 return len * FRU_COMMON_HDR_LEN_MULTIPLIER; in fru_cal_area_len()
39 u8 fru_checksum(u8 *addr, u8 len) in fru_checksum() argument
43 while (len--) { in fru_checksum()
53 int len; in fru_check_type_len() local
60 len = type_len & FRU_TYPELEN_LEN_MASK; in fru_check_type_len()
62 return len; in fru_check_type_len()
68 int len = strlen(name); in fru_gen_type_len() local
73 member->type_len |= len; in fru_gen_type_len()
76 (ulong)&member->type_len, name, (ulong)&member->name, len); in fru_gen_type_len()
77 memcpy(&member->name, name, len); in fru_gen_type_len()
80 return 1 + len; in fru_gen_type_len()
89 u8 len, pad, modulo; in fru_generate() local
120 len = fru_gen_type_len(member, manufacturer); /* Board Manufacturer */ in fru_generate()
121 member += len; in fru_generate()
122 len = fru_gen_type_len(member, board_name); /* Board Product name */ in fru_generate()
123 member += len; in fru_generate()
124 len = fru_gen_type_len(member, serial_no); /* Board Serial number */ in fru_generate()
125 member += len; in fru_generate()
126 len = fru_gen_type_len(member, part_no); /* Board part number */ in fru_generate()
127 member += len; in fru_generate()
128 len = fru_gen_type_len(member, "U-Boot generator"); /* File ID */ in fru_generate()
129 member += len; in fru_generate()
130 len = fru_gen_type_len(member, revision); /* Revision */ in fru_generate()
131 member += len; in fru_generate()
135 len = member - (u8 *)board_info; /* Find current length */ in fru_generate()
136 len += 1; /* Add checksum there too for calculation */ in fru_generate()
138 modulo = len % 8; in fru_generate()
146 len += 8 - modulo; in fru_generate()
149 board_info->len = len / 8; /* Size in multiples of 8 bytes */ in fru_generate()
152 *member = 0 - fru_checksum((u8 *)board_info, len); in fru_generate()
154 debug("checksum %x(addr %x)\n", *member, len); in fru_generate()
165 int len; in fru_parse_board() local
176 len = fru_check_type_len(*(u8 *)addr, fru_data.brd.lang_code, in fru_parse_board()
181 if (len == -EINVAL) in fru_parse_board()
185 if (data + len > limit) in fru_parse_board()
194 if (!len) in fru_parse_board()
198 memcpy(data, (u8 *)addr, len); in fru_parse_board()
199 term = data + (u8)len; in fru_parse_board()
201 addr += len; in fru_parse_board()
245 int len; in fru_display_board() local
267 printf("Board Area Length:%d\n", fru_cal_area_len(brd->len)); in fru_display_board()
282 len = fru_check_type_len(*data++, brd->lang_code, in fru_display_board()
284 if (len == -EINVAL) { in fru_display_board()
296 if (!len) { in fru_display_board()
303 debug("Length: %d\n", len); in fru_display_board()
307 debug("Length: %d\n", len); in fru_display_board()