ibm_emac_tah.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * drivers/net/ibm_emac/ibm_emac_tah.h
  3. *
  4. * Driver for PowerPC 4xx on-chip ethernet controller, TAH support.
  5. *
  6. * Copyright 2004 MontaVista Software, Inc.
  7. * Matt Porter <mporter@kernel.crashing.org>
  8. *
  9. * Copyright (c) 2005 Eugene Surovegin <ebs@ebshome.net>
  10. *
  11. * This program is free software; you can redistribute it and/or modify it
  12. * under the terms of the GNU General Public License as published by the
  13. * Free Software Foundation; either version 2 of the License, or (at your
  14. * option) any later version.
  15. */
  16. #ifndef _IBM_EMAC_TAH_H
  17. #define _IBM_EMAC_TAH_H
  18. #include <linux/config.h>
  19. #include <linux/init.h>
  20. #include <asm/ocp.h>
  21. /* TAH */
  22. struct tah_regs {
  23. u32 revid;
  24. u32 pad[3];
  25. u32 mr;
  26. u32 ssr0;
  27. u32 ssr1;
  28. u32 ssr2;
  29. u32 ssr3;
  30. u32 ssr4;
  31. u32 ssr5;
  32. u32 tsr;
  33. };
  34. /* TAH engine */
  35. #define TAH_MR_CVR 0x80000000
  36. #define TAH_MR_SR 0x40000000
  37. #define TAH_MR_ST_256 0x01000000
  38. #define TAH_MR_ST_512 0x02000000
  39. #define TAH_MR_ST_768 0x03000000
  40. #define TAH_MR_ST_1024 0x04000000
  41. #define TAH_MR_ST_1280 0x05000000
  42. #define TAH_MR_ST_1536 0x06000000
  43. #define TAH_MR_TFS_16KB 0x00000000
  44. #define TAH_MR_TFS_2KB 0x00200000
  45. #define TAH_MR_TFS_4KB 0x00400000
  46. #define TAH_MR_TFS_6KB 0x00600000
  47. #define TAH_MR_TFS_8KB 0x00800000
  48. #define TAH_MR_TFS_10KB 0x00a00000
  49. #define TAH_MR_DTFP 0x00100000
  50. #define TAH_MR_DIG 0x00080000
  51. #ifdef CONFIG_IBM_EMAC_TAH
  52. int tah_attach(void *emac) __init;
  53. void __tah_fini(struct ocp_device *ocpdev) __exit;
  54. static inline void tah_fini(struct ocp_device *ocpdev)
  55. {
  56. if (ocpdev)
  57. __tah_fini(ocpdev);
  58. }
  59. void __tah_reset(struct ocp_device *ocpdev);
  60. static inline void tah_reset(struct ocp_device *ocpdev)
  61. {
  62. if (ocpdev)
  63. __tah_reset(ocpdev);
  64. }
  65. int __tah_get_regs_len(struct ocp_device *ocpdev);
  66. static inline int tah_get_regs_len(struct ocp_device *ocpdev)
  67. {
  68. return ocpdev ? __tah_get_regs_len(ocpdev) : 0;
  69. }
  70. void *tah_dump_regs(struct ocp_device *ocpdev, void *buf);
  71. #else
  72. # define tah_attach(x) 0
  73. # define tah_fini(x) ((void)0)
  74. # define tah_reset(x) ((void)0)
  75. # define tah_get_regs_len(x) 0
  76. # define tah_dump_regs(x,buf) (buf)
  77. #endif /* !CONFIG_IBM_EMAC_TAH */
  78. #endif /* _IBM_EMAC_TAH_H */