FlashDevice3.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*====================================================================*
  2. *
  3. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  4. *
  5. * All rights reserved.
  6. *
  7. *====================================================================*/
  8. /*====================================================================*
  9. *
  10. * signed FlashDevice3 (struct plc * plc);
  11. *
  12. * plc.h
  13. *
  14. * permanently write parameters and firmware to flash memory using
  15. * VS_WR_MOD messagesand VS_MOD_NVM messages;
  16. *
  17. * paramters and firmware are written to device SDRAM and stored
  18. * until commited to flash memory;
  19. *
  20. * Contributor(s):
  21. * Charles Maier <cmaier@qca.qualcomm.com>
  22. *
  23. *--------------------------------------------------------------------*/
  24. #ifndef FLASHDEVICE3_SOURCE
  25. #define FLASHDEVICE3_SOURCE
  26. #include "../plc/plc.h"
  27. signed FlashDevice3 (struct plc * plc)
  28. {
  29. if (WritePIB (plc))
  30. {
  31. return (-1);
  32. }
  33. if (WriteNVM (plc))
  34. {
  35. return (-1);
  36. }
  37. if (FlashPTS (plc))
  38. {
  39. return (-1);
  40. }
  41. if (WaitForRestart (plc))
  42. {
  43. return (-1);
  44. }
  45. sleep (PLC_PAUSE);
  46. return (0);
  47. }
  48. #endif