fsl_rio.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Freescale MPC85xx/MPC86xx RapidIO support
  3. *
  4. * Copyright 2009 Sysgo AG
  5. * Thomas Moll <thomas.moll@sysgo.com>
  6. * - fixed maintenance access routines, check for aligned access
  7. *
  8. * Copyright 2009 Integrated Device Technology, Inc.
  9. * Alex Bounine <alexandre.bounine@idt.com>
  10. * - Added Port-Write message handling
  11. * - Added Machine Check exception handling
  12. *
  13. * Copyright (C) 2007, 2008, 2010, 2011 Freescale Semiconductor, Inc.
  14. * Zhang Wei <wei.zhang@freescale.com>
  15. * Lian Minghuan-B31939 <Minghuan.Lian@freescale.com>
  16. * Liu Gang <Gang.Liu@freescale.com>
  17. *
  18. * Copyright 2005 MontaVista Software, Inc.
  19. * Matt Porter <mporter@kernel.crashing.org>
  20. *
  21. * This program is free software; you can redistribute it and/or modify it
  22. * under the terms of the GNU General Public License as published by the
  23. * Free Software Foundation; either version 2 of the License, or (at your
  24. * option) any later version.
  25. */
  26. #ifndef __FSL_RIO_H
  27. #define __FSL_RIO_H
  28. #include <linux/rio.h>
  29. #include <linux/rio_drv.h>
  30. #include <linux/kfifo.h>
  31. #define RIO_REGS_WIN(mport) (((struct rio_priv *)(mport->priv))->regs_win)
  32. #define RIO_MAINT_WIN_SIZE 0x400000
  33. #define RIO_LTLEDCSR 0x0608
  34. struct rio_atmu_regs {
  35. u32 rowtar;
  36. u32 rowtear;
  37. u32 rowbar;
  38. u32 pad2;
  39. u32 rowar;
  40. u32 pad3[3];
  41. };
  42. struct rio_port_write_msg {
  43. void *virt;
  44. dma_addr_t phys;
  45. u32 msg_count;
  46. u32 err_count;
  47. u32 discard_count;
  48. };
  49. struct rio_priv {
  50. struct device *dev;
  51. void __iomem *regs_win;
  52. struct rio_atmu_regs __iomem *atmu_regs;
  53. struct rio_atmu_regs __iomem *maint_atmu_regs;
  54. void __iomem *maint_win;
  55. struct rio_port_write_msg port_write_msg;
  56. int pwirq;
  57. struct work_struct pw_work;
  58. struct kfifo pw_fifo;
  59. spinlock_t pw_fifo_lock;
  60. void *rmm_handle; /* RapidIO message manager(unit) Handle */
  61. };
  62. extern void __iomem *rio_regs_win;
  63. extern int fsl_rio_setup_rmu(struct rio_mport *mport,
  64. struct device_node *node);
  65. extern int fsl_rio_port_write_init(struct rio_mport *mport);
  66. extern int fsl_rio_pw_enable(struct rio_mport *mport, int enable);
  67. extern void fsl_rio_port_error_handler(struct rio_mport *port, int offset);
  68. #endif