escore-uart-common.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * escore-uart-common.h -- UART interface for Audience earSmart chips
  3. *
  4. * Copyright 2013 Audience, Inc.
  5. *
  6. * Author: Matt Lupfer <mlupfer@cardinalpeak.com>
  7. *
  8. *
  9. * This program 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. #ifndef _ESCORE_UART_COMMON_H
  14. #define _ESCORE_UART_COMMON_H
  15. #define UART_TTY_DEVICE_NODE "/dev/ttyHS1"
  16. #define UART_TTY_BAUD_RATE_BOOTLOADER 460800
  17. #define UART_TTY_BAUD_RATE_FIRMWARE 3000000
  18. #define UART_TTY_STOP_BITS 2
  19. #define UART_TTY_WRITE_SZ 512
  20. #define ESCORE_SBL_SYNC_CMD 0x00
  21. #define ESCORE_SBL_SYNC_ACK ESCORE_SBL_SYNC_CMD
  22. #define ESCORE_SBL_BOOT_CMD 0x01
  23. #define ESCORE_SBL_BOOT_ACK ESCORE_SBL_BOOT_CMD
  24. #define ESCORE_SBL_FW_ACK 0x02
  25. int escore_uart_read(struct escore_priv *escore, void *buf, int len);
  26. int escore_uart_write(struct escore_priv *escore, const void *buf, int len);
  27. int escore_uart_cmd(struct escore_priv *escore, u32 cmd, int sr, u32 *resp);
  28. int escore_configure_tty(struct tty_struct *tty, u32 bps, int stop);
  29. int escore_uart_open(struct escore_priv *escore);
  30. int escore_uart_close(struct escore_priv *escore);
  31. int escore_uart_wait(struct escore_priv *escore);
  32. extern struct es_stream_device es_uart_streamdev;
  33. #endif