hikey_private.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef HIKEY_PRIVATE_H
  7. #define HIKEY_PRIVATE_H
  8. #include <common/bl_common.h>
  9. #define RANDOM_MAX 0x7fffffffffffffff
  10. #define RANDOM_MAGIC 0x9a4dbeaf
  11. enum {
  12. DDR_FREQ_150M = 150 * 1000,
  13. DDR_FREQ_266M = 266 * 1000,
  14. DDR_FREQ_400M = 400 * 1000,
  15. DDR_FREQ_533M = 533 * 1000,
  16. DDR_FREQ_800M = 800 * 1000
  17. };
  18. struct random_serial_num {
  19. uint64_t magic;
  20. uint64_t data;
  21. char serialno[32];
  22. };
  23. /*
  24. * Function and variable prototypes
  25. */
  26. void hikey_init_mmu_el1(unsigned long total_base,
  27. unsigned long total_size,
  28. unsigned long ro_start,
  29. unsigned long ro_limit,
  30. unsigned long coh_start,
  31. unsigned long coh_limit);
  32. void hikey_init_mmu_el3(unsigned long total_base,
  33. unsigned long total_size,
  34. unsigned long ro_start,
  35. unsigned long ro_limit,
  36. unsigned long coh_start,
  37. unsigned long coh_limit);
  38. void hikey_ddr_init(unsigned int ddr_freq);
  39. void hikey_io_setup(void);
  40. void hikey_sp804_init(void);
  41. void hikey_gpio_init(void);
  42. void hikey_pmussi_init(void);
  43. void hikey_hi6553_init(void);
  44. void init_mmc0_pll(void);
  45. void reset_mmc0_clk(void);
  46. void init_media_clk(void);
  47. void init_mmc1_pll(void);
  48. void reset_mmc1_clk(void);
  49. void hikey_mmc_pll_init(void);
  50. void hikey_rtc_init(void);
  51. int hikey_get_partition_size(const char *arg, int left, char *response);
  52. int hikey_get_partition_type(const char *arg, int left, char *response);
  53. int hikey_erase(const char *arg);
  54. int hikey_flash(const char *arg);
  55. int hikey_oem(const char *arg);
  56. int hikey_reboot(const char *arg);
  57. void hikey_security_setup(void);
  58. const char *hikey_init_serialno(void);
  59. int hikey_read_serialno(struct random_serial_num *serialno);
  60. int hikey_write_serialno(struct random_serial_num *serialno);
  61. void init_acpu_dvfs(void);
  62. int hikey_set_fip_addr(unsigned int image_id, const char *name);
  63. #endif /* HIKEY_PRIVATE_H */