ffu.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. *
  3. * ffu.h
  4. *
  5. * Copyright (c) 2013 SanDisk Corp.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * This program was created by SanDisk Corp
  13. * The ffu.h file is obtained under the GPL v2.0 license that is
  14. * available via http://www.gnu.org/licenses/,
  15. * or http://www.opensource.org/licenses/gpl-2.0.php
  16. */
  17. #if !defined(_FFU_H_)
  18. #define _FFU_H_
  19. #include <linux/mmc/card.h>
  20. #define CARD_BLOCK_SIZE 512
  21. /*
  22. * eMMC5.0 Field Firmware Update (FFU) opcodes
  23. */
  24. #define MMC_FFU_DOWNLOAD_OP 302
  25. #define MMC_FFU_INSTALL_OP 303
  26. #define MMC_FFU_MODE_SET 0x1
  27. #define MMC_FFU_MODE_NORMAL 0x0
  28. #define MMC_FFU_INSTALL_SET 0x1
  29. #ifdef CONFIG_MMC_FFU
  30. #define MMC_FFU_ENABLE 0x0
  31. #define MMC_FFU_CONFIG 0x1
  32. #define MMC_FFU_SUPPORTED_MODES 0x1
  33. #define MMC_FFU_FEATURES 0x1
  34. #define FFU_ENABLED(ffu_enable) (ffu_enable & MMC_FFU_CONFIG)
  35. #define FFU_SUPPORTED_MODE(ffu_sup_mode) \
  36. (ffu_sup_mode && MMC_FFU_SUPPORTED_MODES)
  37. #define FFU_CONFIG(ffu_config) (ffu_config & MMC_FFU_CONFIG)
  38. #define FFU_FEATURES(ffu_fetures) (ffu_fetures & MMC_FFU_FEATURES)
  39. struct mmc_blk_ioc_data *mmc_ffu_ioctl_copy_from_user(
  40. struct mmc_ioc_cmd __user *user);
  41. int mmc_ffu_download(struct mmc_card *card, struct mmc_command *cmd,
  42. u8 *data, int buf_bytes);
  43. int mmc_ffu_install(struct mmc_card *card, u8 *ext_csd);
  44. #endif
  45. #endif /* FFU_H_ */