pic32.h 1.5 KB

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