ppc4xx.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*----------------------------------------------------------------------------+
  2. |
  3. | This source code has been made available to you by IBM on an AS-IS
  4. | basis. Anyone receiving this source is licensed under IBM
  5. | copyrights to use it in any way he or she deems fit, including
  6. | copying it, modifying it, compiling it, and redistributing it either
  7. | with or without modifications. No license under IBM patents or
  8. | patent applications is to be implied by the copyright license.
  9. |
  10. | Any user of this software should understand that IBM cannot provide
  11. | technical support for this software and will not be responsible for
  12. | any consequences resulting from the use of this software.
  13. |
  14. | Any person who transfers this source code or any derivative work
  15. | must include the IBM copyright notice, this paragraph, and the
  16. | preceding two paragraphs in the transferred software.
  17. |
  18. | COPYRIGHT I B M CORPORATION 1999
  19. | LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
  20. +----------------------------------------------------------------------------*/
  21. #ifndef __PPC4XX_H__
  22. #define __PPC4XX_H__
  23. #if defined(CONFIG_440)
  24. #include <ppc440.h>
  25. #else
  26. #include <ppc405.h>
  27. #endif
  28. /*
  29. * Common stuff for 4xx (405 and 440)
  30. */
  31. #define EXC_OFF_SYS_RESET 0x0100 /* System reset */
  32. #define _START_OFFSET (EXC_OFF_SYS_RESET + 0x2000)
  33. #define RESET_VECTOR 0xfffffffc
  34. #define CACHELINE_MASK (CFG_CACHELINE_SIZE - 1) /* Address mask for cache
  35. line aligned data. */
  36. #define CPR0_DCR_BASE 0x0C
  37. #define cprcfga (CPR0_DCR_BASE+0x0)
  38. #define cprcfgd (CPR0_DCR_BASE+0x1)
  39. #define SDR_DCR_BASE 0x0E
  40. #define sdrcfga (SDR_DCR_BASE+0x0)
  41. #define sdrcfgd (SDR_DCR_BASE+0x1)
  42. #define SDRAM_DCR_BASE 0x10
  43. #define memcfga (SDRAM_DCR_BASE+0x0)
  44. #define memcfgd (SDRAM_DCR_BASE+0x1)
  45. #define EBC_DCR_BASE 0x12
  46. #define ebccfga (EBC_DCR_BASE+0x0)
  47. #define ebccfgd (EBC_DCR_BASE+0x1)
  48. /*
  49. * Macros for indirect DCR access
  50. */
  51. #define mtcpr(reg, d) do { mtdcr(cprcfga,reg);mtdcr(cprcfgd,d); } while (0)
  52. #define mfcpr(reg, d) do { mtdcr(cprcfga,reg);d = mfdcr(cprcfgd); } while (0)
  53. #define mtebc(reg, d) do { mtdcr(ebccfga,reg);mtdcr(ebccfgd,d); } while (0)
  54. #define mfebc(reg, d) do { mtdcr(ebccfga,reg);d = mfdcr(ebccfgd); } while (0)
  55. #define mtsdram(reg, d) do { mtdcr(memcfga,reg);mtdcr(memcfgd,d); } while (0)
  56. #define mfsdram(reg, d) do { mtdcr(memcfga,reg);d = mfdcr(memcfgd); } while (0)
  57. #define mtsdr(reg, d) do { mtdcr(sdrcfga,reg);mtdcr(sdrcfgd,d); } while (0)
  58. #define mfsdr(reg, d) do { mtdcr(sdrcfga,reg);d = mfdcr(sdrcfgd); } while (0)
  59. #ifndef __ASSEMBLY__
  60. typedef struct
  61. {
  62. unsigned long freqDDR;
  63. unsigned long freqEBC;
  64. unsigned long freqOPB;
  65. unsigned long freqPCI;
  66. unsigned long freqPLB;
  67. unsigned long freqTmrClk;
  68. unsigned long freqUART;
  69. unsigned long freqProcessor;
  70. unsigned long freqVCOHz;
  71. unsigned long freqVCOMhz; /* in MHz */
  72. unsigned long pciClkSync; /* PCI clock is synchronous */
  73. unsigned long pciIntArbEn; /* Internal PCI arbiter is enabled */
  74. unsigned long pllExtBusDiv;
  75. unsigned long pllFbkDiv;
  76. unsigned long pllFwdDiv;
  77. unsigned long pllFwdDivA;
  78. unsigned long pllFwdDivB;
  79. unsigned long pllOpbDiv;
  80. unsigned long pllPciDiv;
  81. unsigned long pllPlbDiv;
  82. } PPC4xx_SYS_INFO;
  83. #endif /* __ASSEMBLY__ */
  84. #endif /* __PPC4XX_H__ */