fh_pmu.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * This file is part of FH8620 BSP for RT-Thread distribution.
  3. *
  4. * Copyright (c) 2016 Shanghai Fullhan Microelectronics Co., Ltd.
  5. * All rights reserved
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program; if not, write to the Free Software Foundation, Inc.,
  19. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  20. *
  21. * Visit http://www.fullhan.com to get contact with Fullhan.
  22. *
  23. * Change Logs:
  24. * Date Author Notes
  25. */
  26. #ifndef FH_PMU_H_
  27. #define FH_PMU_H_
  28. #include <rtdef.h>
  29. #define REG_PMU_CHIP_ID (0x000)
  30. #define REG_PMU_IP_VER (0x004)
  31. #define REG_PMU_FW_VER (0x008)
  32. #define REG_PMU_SYS_CTRL (0x00c)
  33. #define REG_PMU_PLL0_CTRL (0x010)
  34. #define REG_PMU_PLL1_CTRL (0x014)
  35. #define REG_PMU_ARC_CLK_GATE (0x018)
  36. #define REG_PMU_CLK_GATE (0x01c)
  37. #define REG_PMU_CLK_SEL (0x020)
  38. #define REG_PMU_CLK_DIV0 (0x024)
  39. #define REG_PMU_CLK_DIV1 (0x028)
  40. #define REG_PMU_CLK_DIV2 (0x02c)
  41. #define REG_PMU_CLK_DIV3 (0x030)
  42. #define REG_PMU_CLK_DIV4 (0x034)
  43. #define REG_PMU_CLK_DIV5 (0x038)
  44. #define REG_PMU_CLK_DIV6 (0x03c)
  45. #define REG_PMU_SWRST_MAIN_CTRL (0x040)
  46. #define REG_PMU_SWRST_AXI_CTRL (0x044)
  47. #define REG_PMU_SWRST_AHB_CTRL (0x048)
  48. #define REG_PMU_SWRST_APB_CTRL (0x04c)
  49. #define REG_PMU_VDAC_CTRL (0x050)
  50. #define REG_PMU_MAC_REF_CLK_CFG (0x0a4)
  51. int fh_pmu_read(rt_uint32_t offset,rt_uint32_t *value);
  52. int fh_pmu_write(rt_uint32_t offset, const rt_uint32_t value);
  53. int fh_pmu_write_mask(rt_uint32_t offset,const rt_uint32_t value, const rt_uint32_t mask);
  54. #endif /* FH_PMU_H_ */