platform.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. * arch/arm/mach-ixp4xx/include/mach/platform.h
  3. *
  4. * Constants and functions that are useful to IXP4xx platform-specific code
  5. * and device drivers.
  6. *
  7. * Copyright (C) 2004 MontaVista Software, Inc.
  8. */
  9. #ifndef __ASM_ARCH_HARDWARE_H__
  10. #error "Do not include this directly, instead #include <mach/hardware.h>"
  11. #endif
  12. #ifndef __ASSEMBLY__
  13. #include <linux/reboot.h>
  14. #include <asm/types.h>
  15. #ifndef __ARMEB__
  16. #define REG_OFFSET 0
  17. #else
  18. #define REG_OFFSET 3
  19. #endif
  20. /*
  21. * Expansion bus memory regions
  22. */
  23. #define IXP4XX_EXP_BUS_BASE_PHYS (0x50000000)
  24. /*
  25. * The expansion bus on the IXP4xx can be configured for either 16 or
  26. * 32MB windows and the CS offset for each region changes based on the
  27. * current configuration. This means that we cannot simply hardcode
  28. * each offset. ixp4xx_sys_init() looks at the expansion bus configuration
  29. * as setup by the bootloader to determine our window size.
  30. */
  31. extern unsigned long ixp4xx_exp_bus_size;
  32. #define IXP4XX_EXP_BUS_BASE(region)\
  33. (IXP4XX_EXP_BUS_BASE_PHYS + ((region) * ixp4xx_exp_bus_size))
  34. #define IXP4XX_EXP_BUS_END(region)\
  35. (IXP4XX_EXP_BUS_BASE(region) + ixp4xx_exp_bus_size - 1)
  36. /* Those macros can be used to adjust timing and configure
  37. * other features for each region.
  38. */
  39. #define IXP4XX_EXP_BUS_RECOVERY_T(x) (((x) & 0x0f) << 16)
  40. #define IXP4XX_EXP_BUS_HOLD_T(x) (((x) & 0x03) << 20)
  41. #define IXP4XX_EXP_BUS_STROBE_T(x) (((x) & 0x0f) << 22)
  42. #define IXP4XX_EXP_BUS_SETUP_T(x) (((x) & 0x03) << 26)
  43. #define IXP4XX_EXP_BUS_ADDR_T(x) (((x) & 0x03) << 28)
  44. #define IXP4XX_EXP_BUS_SIZE(x) (((x) & 0x0f) << 10)
  45. #define IXP4XX_EXP_BUS_CYCLES(x) (((x) & 0x03) << 14)
  46. #define IXP4XX_EXP_BUS_CS_EN (1L << 31)
  47. #define IXP4XX_EXP_BUS_BYTE_RD16 (1L << 6)
  48. #define IXP4XX_EXP_BUS_HRDY_POL (1L << 5)
  49. #define IXP4XX_EXP_BUS_MUX_EN (1L << 4)
  50. #define IXP4XX_EXP_BUS_SPLT_EN (1L << 3)
  51. #define IXP4XX_EXP_BUS_WR_EN (1L << 1)
  52. #define IXP4XX_EXP_BUS_BYTE_EN (1L << 0)
  53. #define IXP4XX_EXP_BUS_CYCLES_INTEL 0x00
  54. #define IXP4XX_EXP_BUS_CYCLES_MOTOROLA 0x01
  55. #define IXP4XX_EXP_BUS_CYCLES_HPI 0x02
  56. #define IXP4XX_FLASH_WRITABLE (0x2)
  57. #define IXP4XX_FLASH_DEFAULT (0xbcd23c40)
  58. #define IXP4XX_FLASH_WRITE (0xbcd23c42)
  59. /*
  60. * Clock Speed Definitions.
  61. */
  62. #define IXP4XX_PERIPHERAL_BUS_CLOCK (66) /* 66MHzi APB BUS */
  63. #define IXP4XX_UART_XTAL 14745600
  64. /*
  65. * This structure provide a means for the board setup code
  66. * to give information to th pata_ixp4xx driver. It is
  67. * passed as platform_data.
  68. */
  69. struct ixp4xx_pata_data {
  70. volatile u32 *cs0_cfg;
  71. volatile u32 *cs1_cfg;
  72. unsigned long cs0_bits;
  73. unsigned long cs1_bits;
  74. void __iomem *cs0;
  75. void __iomem *cs1;
  76. };
  77. #define IXP4XX_ETH_NPEA 0x00
  78. #define IXP4XX_ETH_NPEB 0x10
  79. #define IXP4XX_ETH_NPEC 0x20
  80. /* Information about built-in Ethernet MAC interfaces */
  81. struct eth_plat_info {
  82. u8 phy; /* MII PHY ID, 0 - 31 */
  83. u8 rxq; /* configurable, currently 0 - 31 only */
  84. u8 txreadyq;
  85. u8 hwaddr[6];
  86. };
  87. /* Information about built-in HSS (synchronous serial) interfaces */
  88. struct hss_plat_info {
  89. int (*set_clock)(int port, unsigned int clock_type);
  90. int (*open)(int port, void *pdev,
  91. void (*set_carrier_cb)(void *pdev, int carrier));
  92. void (*close)(int port, void *pdev);
  93. u8 txreadyq;
  94. };
  95. /*
  96. * Frequency of clock used for primary clocksource
  97. */
  98. extern unsigned long ixp4xx_timer_freq;
  99. /*
  100. * Functions used by platform-level setup code
  101. */
  102. extern void ixp4xx_map_io(void);
  103. extern void ixp4xx_init_early(void);
  104. extern void ixp4xx_init_irq(void);
  105. extern void ixp4xx_sys_init(void);
  106. extern void ixp4xx_timer_init(void);
  107. extern void ixp4xx_restart(enum reboot_mode, const char *);
  108. extern void ixp4xx_pci_preinit(void);
  109. struct pci_sys_data;
  110. extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
  111. extern struct pci_ops ixp4xx_ops;
  112. #endif // __ASSEMBLY__