usb_rdl.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (c) 2011 Broadcom Corporation
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  11. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  13. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef _USB_RDL_H
  17. #define _USB_RDL_H
  18. /* Control messages: bRequest values */
  19. #define DL_GETSTATE 0 /* returns the rdl_state_t struct */
  20. #define DL_CHECK_CRC 1 /* currently unused */
  21. #define DL_GO 2 /* execute downloaded image */
  22. #define DL_START 3 /* initialize dl state */
  23. #define DL_REBOOT 4 /* reboot the device in 2 seconds */
  24. #define DL_GETVER 5 /* returns the bootrom_id_t struct */
  25. #define DL_GO_PROTECTED 6 /* execute the downloaded code and set reset
  26. * event to occur in 2 seconds. It is the
  27. * responsibility of the downloaded code to
  28. * clear this event
  29. */
  30. #define DL_EXEC 7 /* jump to a supplied address */
  31. #define DL_RESETCFG 8 /* To support single enum on dongle
  32. * - Not used by bootloader
  33. */
  34. #define DL_DEFER_RESP_OK 9 /* Potentially defer the response to setup
  35. * if resp unavailable
  36. */
  37. /* states */
  38. #define DL_WAITING 0 /* waiting to rx first pkt */
  39. #define DL_READY 1 /* hdr was good, waiting for more of the
  40. * compressed image */
  41. #define DL_BAD_HDR 2 /* hdr was corrupted */
  42. #define DL_BAD_CRC 3 /* compressed image was corrupted */
  43. #define DL_RUNNABLE 4 /* download was successful,waiting for go cmd */
  44. #define DL_START_FAIL 5 /* failed to initialize correctly */
  45. #define DL_NVRAM_TOOBIG 6 /* host specified nvram data exceeds DL_NVRAM
  46. * value */
  47. #define DL_IMAGE_TOOBIG 7 /* download image too big (exceeds DATA_START
  48. * for rdl) */
  49. struct rdl_state_le {
  50. __le32 state;
  51. __le32 bytes;
  52. };
  53. struct bootrom_id_le {
  54. __le32 chip; /* Chip id */
  55. __le32 chiprev; /* Chip rev */
  56. __le32 ramsize; /* Size of RAM */
  57. __le32 remapbase; /* Current remap base address */
  58. __le32 boardtype; /* Type of board */
  59. __le32 boardrev; /* Board revision */
  60. };
  61. #define RDL_CHUNK 1500 /* size of each dl transfer */
  62. #define TRX_OFFSETS_DLFWLEN_IDX 0
  63. #define TRX_OFFSETS_JUMPTO_IDX 1
  64. #define TRX_OFFSETS_NVM_LEN_IDX 2
  65. #define TRX_OFFSETS_DLBASE_IDX 0
  66. #endif /* _USB_RDL_H */