ralink_regs.h 957 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Ralink SoC register definitions
  3. *
  4. * Copyright (C) 2013 John Crispin <blogic@openwrt.org>
  5. * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
  6. * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License version 2 as published
  10. * by the Free Software Foundation.
  11. */
  12. #ifndef _RALINK_REGS_H_
  13. #define _RALINK_REGS_H_
  14. extern __iomem void *rt_sysc_membase;
  15. extern __iomem void *rt_memc_membase;
  16. static inline void rt_sysc_w32(u32 val, unsigned reg)
  17. {
  18. __raw_writel(val, rt_sysc_membase + reg);
  19. }
  20. static inline u32 rt_sysc_r32(unsigned reg)
  21. {
  22. return __raw_readl(rt_sysc_membase + reg);
  23. }
  24. static inline void rt_memc_w32(u32 val, unsigned reg)
  25. {
  26. __raw_writel(val, rt_memc_membase + reg);
  27. }
  28. static inline u32 rt_memc_r32(unsigned reg)
  29. {
  30. return __raw_readl(rt_memc_membase + reg);
  31. }
  32. #endif /* _RALINK_REGS_H_ */