pic32.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Joshua Henderson <joshua.henderson@microchip.com>
  3. * Copyright (C) 2015 Microchip Technology Inc. All rights reserved.
  4. *
  5. * This program is free software; you can distribute it and/or modify it
  6. * under the terms of the GNU General Public License (Version 2) as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12. * for more details.
  13. */
  14. #ifndef _ASM_MACH_PIC32_H
  15. #define _ASM_MACH_PIC32_H
  16. #include <linux/io.h>
  17. /*
  18. * PIC32 register offsets for SET/CLR/INV where supported.
  19. */
  20. #define PIC32_CLR(_reg) ((_reg) + 0x04)
  21. #define PIC32_SET(_reg) ((_reg) + 0x08)
  22. #define PIC32_INV(_reg) ((_reg) + 0x0C)
  23. /*
  24. * PIC32 Base Register Offsets
  25. */
  26. #define PIC32_BASE_CONFIG 0x1f800000
  27. #define PIC32_BASE_OSC 0x1f801200
  28. #define PIC32_BASE_RESET 0x1f801240
  29. #define PIC32_BASE_PPS 0x1f801400
  30. #define PIC32_BASE_UART 0x1f822000
  31. #define PIC32_BASE_PORT 0x1f860000
  32. #define PIC32_BASE_DEVCFG2 0x1fc4ff44
  33. /*
  34. * Register unlock sequence required for some register access.
  35. */
  36. void pic32_syskey_unlock_debug(const char *fn, const ulong ln);
  37. #define pic32_syskey_unlock() \
  38. pic32_syskey_unlock_debug(__func__, __LINE__)
  39. #endif /* _ASM_MACH_PIC32_H */