pic32.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (c) 2015 Paul Thacker <paul.thacker@microchip.com>
  4. *
  5. */
  6. #ifndef __PIC32_REGS_H__
  7. #define __PIC32_REGS_H__
  8. #include <asm/io.h>
  9. /* System Configuration */
  10. #define PIC32_CFG_BASE 0x1f800000
  11. /* System config register offsets */
  12. #define CFGCON 0x0000
  13. #define DEVID 0x0020
  14. #define SYSKEY 0x0030
  15. #define PMD1 0x0040
  16. #define PMD7 0x00a0
  17. #define CFGEBIA 0x00c0
  18. #define CFGEBIC 0x00d0
  19. #define CFGPG 0x00e0
  20. #define CFGMPLL 0x0100
  21. /* Non Volatile Memory (NOR flash) */
  22. #define PIC32_NVM_BASE (PIC32_CFG_BASE + 0x0600)
  23. /* Oscillator Configuration */
  24. #define PIC32_OSC_BASE (PIC32_CFG_BASE + 0x1200)
  25. /* Peripheral Pin Select Input */
  26. #define PPS_IN_BASE 0x1f801400
  27. /* Peripheral Pin Select Output */
  28. #define PPS_OUT_BASE 0x1f801500
  29. /* Pin Config */
  30. #define PINCTRL_BASE 0x1f860000
  31. /* USB Core */
  32. #define PIC32_USB_CORE_BASE 0x1f8e3000
  33. #define PIC32_USB_CTRL_BASE 0x1f884000
  34. /* SPI1-SPI6 */
  35. #define PIC32_SPI1_BASE 0x1f821000
  36. /* Prefetch Module */
  37. #define PREFETCH_BASE 0x1f8e0000
  38. /* DDR2 Controller */
  39. #define PIC32_DDR2C_BASE 0x1f8e8000
  40. /* DDR2 PHY */
  41. #define PIC32_DDR2P_BASE 0x1f8e9100
  42. /* EBI */
  43. #define PIC32_EBI_BASE 0x1f8e1000
  44. /* SQI */
  45. #define PIC32_SQI_BASE 0x1f8e2000
  46. struct pic32_reg_atomic {
  47. u32 raw;
  48. u32 clr;
  49. u32 set;
  50. u32 inv;
  51. };
  52. #define _CLR_OFFSET 0x04
  53. #define _SET_OFFSET 0x08
  54. #define _INV_OFFSET 0x0c
  55. static inline void __iomem *pic32_get_syscfg_base(void)
  56. {
  57. return (void __iomem *)CKSEG1ADDR(PIC32_CFG_BASE);
  58. }
  59. /* Core */
  60. const char *get_core_name(void);
  61. #endif /* __PIC32_REGS_H__ */