liquidio_image.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**********************************************************************
  2. * Author: Cavium, Inc.
  3. *
  4. * Contact: support@cavium.com
  5. * Please include "LiquidIO" in the subject.
  6. *
  7. * Copyright (c) 2003-2016 Cavium, Inc.
  8. *
  9. * This file is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License, Version 2, as
  11. * published by the Free Software Foundation.
  12. *
  13. * This file is distributed in the hope that it will be useful, but
  14. * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
  15. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
  16. * NONINFRINGEMENT. See the GNU General Public License for more details.
  17. ***********************************************************************/
  18. #ifndef _LIQUIDIO_IMAGE_H_
  19. #define _LIQUIDIO_IMAGE_H_
  20. #define LIO_MAX_FW_TYPE_LEN (8)
  21. #define LIO_MAX_FW_FILENAME_LEN (256)
  22. #define LIO_FW_DIR "liquidio/"
  23. #define LIO_FW_BASE_NAME "lio_"
  24. #define LIO_FW_NAME_SUFFIX ".bin"
  25. #define LIO_FW_NAME_TYPE_NIC "nic"
  26. #define LIO_FW_NAME_TYPE_AUTO "auto"
  27. #define LIO_FW_NAME_TYPE_NONE "none"
  28. #define LIO_MAX_FIRMWARE_VERSION_LEN 16
  29. #define LIO_MAX_BOOTCMD_LEN 1024
  30. #define LIO_MAX_IMAGES 16
  31. #define LIO_NIC_MAGIC 0x434E4943 /* "CNIC" */
  32. struct octeon_firmware_desc {
  33. __be64 addr;
  34. __be32 len;
  35. __be32 crc32; /* crc32 of image */
  36. };
  37. /* Following the header is a list of 64-bit aligned binary images,
  38. * as described by the desc field.
  39. * Numeric fields are in network byte order.
  40. */
  41. struct octeon_firmware_file_header {
  42. __be32 magic;
  43. char version[LIO_MAX_FIRMWARE_VERSION_LEN];
  44. char bootcmd[LIO_MAX_BOOTCMD_LEN];
  45. __be32 num_images;
  46. struct octeon_firmware_desc desc[LIO_MAX_IMAGES];
  47. __be32 pad;
  48. __be32 crc32; /* header checksum */
  49. };
  50. #endif /* _LIQUIDIO_IMAGE_H_ */