sys_proto.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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_essential(void);
  42. u32 wait_on_value(u32, u32, void *, u32);
  43. void sdelay(unsigned long);
  44. void setup_clocks_for_console(void);
  45. void prcm_init(void);
  46. void bypass_dpll(u32 const base);
  47. void freq_update_core(void);
  48. u32 get_sys_clk_freq(void);
  49. u32 omap5_ddr_clk(void);
  50. void cancel_out(u32 *num, u32 *den, u32 den_limit);
  51. void sdram_init(void);
  52. u32 omap_sdram_size(void);
  53. u32 cortex_rev(void);
  54. void save_omap_boot_params(void);
  55. void init_omap_revision(void);
  56. void do_io_settings(void);
  57. void sri2c_init(void);
  58. void gpi2c_init(void);
  59. int omap_vc_bypass_send_value(u8 sa, u8 reg_addr, u8 reg_data);
  60. u32 warm_reset(void);
  61. void force_emif_self_refresh(void);
  62. void get_ioregs(const struct ctrl_ioregs **regs);
  63. void srcomp_enable(void);
  64. void setup_warmreset_time(void);
  65. static inline u32 div_round_up(u32 num, u32 den)
  66. {
  67. return (num + den - 1)/den;
  68. }
  69. static inline u32 usec_to_32k(u32 usec)
  70. {
  71. return div_round_up(32768 * usec, 1000000);
  72. }
  73. #define OMAP5_SERVICE_L2ACTLR_SET 0x104
  74. #define OMAP5_SERVICE_ACR_SET 0x107
  75. #endif