sys_proto.h 2.2 KB

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