Lines Matching +full:firmware +full:. +full:img
2 * Copyright (c) 2018, Mellanox Technologies, Ltd. All rights reserved.
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
11 * documentation and/or other materials provided with the distribution.
16 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
23 * SUCH DAMAGE.
26 #include <sys/param.h>
27 #include <sys/ioctl.h>
28 #include <sys/mman.h>
29 #include <sys/stat.h>
30 #include <dev/mlx5/mlx5io.h>
31 #include <ctype.h>
32 #include <err.h>
33 #include <errno.h>
34 #include <fcntl.h>
35 #include <paths.h>
36 #include <stdio.h>
37 #include <stdlib.h>
38 #include <string.h>
39 #include <unistd.h>
41 /* stolen from pciconf.c: parsesel() */
94 fdg.devaddr = *addr; in mlx5tool_save_dump()
100 rege = calloc(fdg.reg_filled, sizeof(*rege)); in mlx5tool_save_dump()
105 fdg.buf = rege; in mlx5tool_save_dump()
106 fdg.reg_cnt = fdg.reg_filled; in mlx5tool_save_dump()
115 for (cnt = 0; cnt < fdg.reg_cnt; cnt++, rege++) in mlx5tool_save_dump()
168 memcpy(&fwup.devaddr, addr, sizeof(fwup.devaddr)); in mlx5tool_fw_update()
169 fwup.img_fw_data = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, in mlx5tool_fw_update()
171 if (fwup.img_fw_data == MAP_FAILED) { in mlx5tool_fw_update()
176 fwup.img_fw_data_len = st.st_size; in mlx5tool_fw_update()
183 munmap(fwup.img_fw_data, st.st_size); in mlx5tool_fw_update()
254 eeprom_info.devaddr = *addr; in mlx5tool_get_eeprom_info()
261 eeprom_info.eeprom_info_buf = in mlx5tool_get_eeprom_info()
262 malloc(eeprom_info.eeprom_info_out_len + MLX5_EEPROM_PAGE_LENGTH); in mlx5tool_get_eeprom_info()
263 if (eeprom_info.eeprom_info_buf == NULL) { in mlx5tool_get_eeprom_info()
264 warn("alloc eeprom_info.eeprom_info_buf "); in mlx5tool_get_eeprom_info()
270 free(eeprom_info.eeprom_info_buf); in mlx5tool_get_eeprom_info()
276 free(eeprom_info.eeprom_info_buf); in mlx5tool_get_eeprom_info()
285 "Usage: mlx5tool -d pci<d:b:s:f> [-w -o dump.file | -r |" in usage()
286 " -e | -f fw.mfa2 | -z]\n"); in usage()
287 fprintf(stderr, "\t-w - write firmware dump to the specified file\n"); in usage()
291 fprintf(stderr, "\t-f fw.img - flash firmware from fw.img\n"); in usage()
292 fprintf(stderr, "\t-z - initiate firmware reset\n"); in usage()