sys_proto.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * (C) Copyright 2010
  3. * Texas Instruments, <www.ti.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef _SYS_PROTO_H_
  8. #define _SYS_PROTO_H_
  9. #include <asm/arch/omap.h>
  10. #include <asm/io.h>
  11. #include <asm/arch/clock.h>
  12. #include <asm/omap_common.h>
  13. #include <linux/mtd/omap_gpmc.h>
  14. #include <asm/arch/clock.h>
  15. #include <asm/ti-common/sys_proto.h>
  16. DECLARE_GLOBAL_DATA_PTR;
  17. /*
  18. * Structure for Iodelay configuration registers.
  19. * Theoretical max for g_delay is 21560 ps.
  20. * Theoretical max for a_delay is 1/3rd of g_delay max.
  21. * So using u16 for both a/g_delay.
  22. */
  23. struct iodelay_cfg_entry {
  24. u16 offset;
  25. u16 a_delay;
  26. u16 g_delay;
  27. };
  28. struct pad_conf_entry {
  29. u32 offset;
  30. u32 val;
  31. };
  32. struct omap_sysinfo {
  33. char *board_string;
  34. };
  35. extern const struct omap_sysinfo sysinfo;
  36. void gpmc_init(void);
  37. void watchdog_init(void);
  38. u32 get_device_type(void);
  39. void do_set_mux(u32 base, struct pad_conf_entry const *array, int size);
  40. void do_set_mux32(u32 base, struct pad_conf_entry const *array, int size);
  41. void set_muxconf_regs(void);
  42. u32 wait_on_value(u32, u32, void *, u32);
  43. void sdelay(unsigned long);
  44. void setup_early_clocks(void);
  45. void prcm_init(void);
  46. void do_board_detect(void);
  47. void vcores_init(void);
  48. void bypass_dpll(u32 const base);
  49. void freq_update_core(void);
  50. u32 get_sys_clk_freq(void);
  51. u32 omap5_ddr_clk(void);
  52. void cancel_out(u32 *num, u32 *den, u32 den_limit);
  53. void sdram_init(void);
  54. u32 omap_sdram_size(void);
  55. u32 cortex_rev(void);
  56. void save_omap_boot_params(void);
  57. void init_omap_revision(void);
  58. void init_package_revision(void);
  59. void do_io_settings(void);
  60. void sri2c_init(void);
  61. int omap_vc_bypass_send_value(u8 sa, u8 reg_addr, u8 reg_data);
  62. u32 warm_reset(void);
  63. void force_emif_self_refresh(void);
  64. void get_ioregs(const struct ctrl_ioregs **regs);
  65. void srcomp_enable(void);
  66. void setup_warmreset_time(void);
  67. static inline u32 div_round_up(u32 num, u32 den)
  68. {
  69. return (num + den - 1)/den;
  70. }
  71. static inline u32 usec_to_32k(u32 usec)
  72. {
  73. return div_round_up(32768 * usec, 1000000);
  74. }
  75. #define OMAP5_SERVICE_L2ACTLR_SET 0x104
  76. #define OMAP5_SERVICE_ACR_SET 0x107
  77. #endif