ibm_emac_tah.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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/init.h>
  19. #include <asm/ocp.h>
  20. /* TAH */
  21. struct tah_regs {
  22. u32 revid;
  23. u32 pad[3];
  24. u32 mr;
  25. u32 ssr0;
  26. u32 ssr1;
  27. u32 ssr2;
  28. u32 ssr3;
  29. u32 ssr4;
  30. u32 ssr5;
  31. u32 tsr;
  32. };
  33. /* TAH engine */
  34. #define TAH_MR_CVR 0x80000000
  35. #define TAH_MR_SR 0x40000000
  36. #define TAH_MR_ST_256 0x01000000
  37. #define TAH_MR_ST_512 0x02000000
  38. #define TAH_MR_ST_768 0x03000000
  39. #define TAH_MR_ST_1024 0x04000000
  40. #define TAH_MR_ST_1280 0x05000000
  41. #define TAH_MR_ST_1536 0x06000000
  42. #define TAH_MR_TFS_16KB 0x00000000
  43. #define TAH_MR_TFS_2KB 0x00200000
  44. #define TAH_MR_TFS_4KB 0x00400000
  45. #define TAH_MR_TFS_6KB 0x00600000
  46. #define TAH_MR_TFS_8KB 0x00800000
  47. #define TAH_MR_TFS_10KB 0x00a00000
  48. #define TAH_MR_DTFP 0x00100000
  49. #define TAH_MR_DIG 0x00080000
  50. #ifdef CONFIG_IBM_EMAC_TAH
  51. int tah_attach(void *emac) __init;
  52. void __tah_fini(struct ocp_device *ocpdev) __exit;
  53. static inline void tah_fini(struct ocp_device *ocpdev)
  54. {
  55. if (ocpdev)
  56. __tah_fini(ocpdev);
  57. }
  58. void __tah_reset(struct ocp_device *ocpdev);
  59. static inline void tah_reset(struct ocp_device *ocpdev)
  60. {
  61. if (ocpdev)
  62. __tah_reset(ocpdev);
  63. }
  64. int __tah_get_regs_len(struct ocp_device *ocpdev);
  65. static inline int tah_get_regs_len(struct ocp_device *ocpdev)
  66. {
  67. return ocpdev ? __tah_get_regs_len(ocpdev) : 0;
  68. }
  69. void *tah_dump_regs(struct ocp_device *ocpdev, void *buf);
  70. #else
  71. # define tah_attach(x) 0
  72. # define tah_fini(x) ((void)0)
  73. # define tah_reset(x) ((void)0)
  74. # define tah_get_regs_len(x) 0
  75. # define tah_dump_regs(x,buf) (buf)
  76. #endif /* !CONFIG_IBM_EMAC_TAH */
  77. #endif /* _IBM_EMAC_TAH_H */