bf533_serial.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * U-boot bf533_serial.h
  3. *
  4. * Copyright (c) 2005 blackfin.uclinux.org
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22. * MA 02111-1307 USA
  23. */
  24. #ifndef _BF533_SERIAL_H_
  25. #define _BF533_SERIAL_H_
  26. #define BYTE_REF(addr) (*((volatile char*)addr))
  27. #define HALFWORD_REF(addr) (*((volatile short*)addr))
  28. #define WORD_REF(addr) (*((volatile long*)addr))
  29. #define UART_THR_LO HALFWORD_REF(UART_THR)
  30. #define UART_RBR_LO HALFWORD_REF(UART_RBR)
  31. #define UART_DLL_LO HALFWORD_REF(UART_DLL)
  32. #define UART_IER_LO HALFWORD_REF(UART_IER)
  33. #define UART_IER_ERBFI 0x01
  34. #define UART_IER_ETBEI 0x02
  35. #define UART_IER_ELSI 0x04
  36. #define UART_IER_EDDSI 0x08
  37. #define UART_DLH_LO HALFWORD_REF(UART_DLH)
  38. #define UART_IIR_LO HALFWORD_REF(UART_IIR)
  39. #define UART_IIR_NOINT 0x01
  40. #define UART_IIR_STATUS 0x06
  41. #define UART_IIR_LSR 0x06
  42. #define UART_IIR_RBR 0x04
  43. #define UART_IIR_THR 0x02
  44. #define UART_IIR_MSR 0x00
  45. #define UART_LCR_LO HALFWORD_REF(UART_LCR)
  46. #define UART_LCR_WLS5 0
  47. #define UART_LCR_WLS6 0x01
  48. #define UART_LCR_WLS7 0x02
  49. #define UART_LCR_WLS8 0x03
  50. #define UART_LCR_STB 0x04
  51. #define UART_LCR_PEN 0x08
  52. #define UART_LCR_EPS 0x10
  53. #define UART_LCR_SP 0x20
  54. #define UART_LCR_SB 0x40
  55. #define UART_LCR_DLAB 0x80
  56. #define UART_MCR_LO HALFWORD_REF(UART_MCR)
  57. #define UART_LSR_LO HALFWORD_REF(UART_LSR)
  58. #define UART_LSR_DR 0x01
  59. #define UART_LSR_OE 0x02
  60. #define UART_LSR_PE 0x04
  61. #define UART_LSR_FE 0x08
  62. #define UART_LSR_BI 0x10
  63. #define UART_LSR_THRE 0x20
  64. #define UART_LSR_TEMT 0x40
  65. #define UART_MSR_LO HALFWORD_REF(UART_MSR)
  66. #define UART_SCR_LO HALFWORD_REF(UART_SCR)
  67. #define UART_GCTL_LO HALFWORD_REF(UART_GCTL)
  68. #define UART_GCTL_UCEN 0x01
  69. #endif