platform.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
  3. * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
  4. */
  5. /*
  6. * The code contained herein is licensed under the GNU General Public
  7. * License. You may obtain a copy of the GNU General Public License
  8. * Version 2 or later at the following locations:
  9. *
  10. * http://www.opensource.org/licenses/gpl-license.html
  11. * http://www.gnu.org/copyleft/gpl.html
  12. */
  13. #ifndef __ASM_PLAT_PLATFORM_H
  14. #define __ASM_PLAT_PLATFORM_H
  15. #ifndef __ASSEMBLER__
  16. #include <linux/io.h>
  17. #endif
  18. #include <asm/sizes.h>
  19. /* Virtual address where registers are mapped */
  20. #define STMP3XXX_REGS_PHBASE 0x80000000
  21. #ifdef __ASSEMBLER__
  22. #define STMP3XXX_REGS_BASE 0xF0000000
  23. #else
  24. #define STMP3XXX_REGS_BASE (void __iomem *)0xF0000000
  25. #endif
  26. #define STMP3XXX_REGS_SIZE SZ_1M
  27. /* Virtual address where OCRAM is mapped */
  28. #define STMP3XXX_OCRAM_PHBASE 0x00000000
  29. #ifdef __ASSEMBLER__
  30. #define STMP3XXX_OCRAM_BASE 0xf1000000
  31. #else
  32. #define STMP3XXX_OCRAM_BASE (void __iomem *)0xf1000000
  33. #endif
  34. #define STMP3XXX_OCRAM_SIZE (32 * SZ_1K)
  35. #ifdef CONFIG_ARCH_STMP37XX
  36. #define IRQ_PRIORITY_REG_RD HW_ICOLL_PRIORITYn_RD
  37. #define IRQ_PRIORITY_REG_WR HW_ICOLL_PRIORITYn_WR
  38. #endif
  39. #ifdef CONFIG_ARCH_STMP378X
  40. #define IRQ_PRIORITY_REG_RD HW_ICOLL_INTERRUPTn_RD
  41. #define IRQ_PRIORITY_REG_WR HW_ICOLL_INTERRUPTn_WR
  42. #endif
  43. #define HW_STMP3XXX_SET 0x04
  44. #define HW_STMP3XXX_CLR 0x08
  45. #define HW_STMP3XXX_TOG 0x0c
  46. #ifndef __ASSEMBLER__
  47. static inline void stmp3xxx_clearl(u32 v, void __iomem *r)
  48. {
  49. __raw_writel(v, r + HW_STMP3XXX_CLR);
  50. }
  51. static inline void stmp3xxx_setl(u32 v, void __iomem *r)
  52. {
  53. __raw_writel(v, r + HW_STMP3XXX_SET);
  54. }
  55. #endif
  56. #define BF(value, field) (((value) << BP_##field) & BM_##field)
  57. #endif /* __ASM_ARCH_PLATFORM_H */