platform.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (c) 2008 Travis Geiselbrecht
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining
  5. * a copy of this software and associated documentation files
  6. * (the "Software"), to deal in the Software without restriction,
  7. * including without limitation the rights to use, copy, modify, merge,
  8. * publish, distribute, sublicense, and/or sell copies of the Software,
  9. * and to permit persons to whom the Software is furnished to do so,
  10. * subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be
  13. * included in all copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  18. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  19. * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  20. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  21. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. */
  23. #ifndef __PLATFORM_H
  24. #define __PLATFORM_H
  25. time_t current_time(void);
  26. bigtime_t current_time_hires(void);
  27. /* super early platform initialization, before almost everything */
  28. void platform_early_init(void);
  29. /* later init, after the kernel has come up */
  30. void platform_init(void);
  31. void platform_uninit(void);
  32. /* called by the arch init code to get the platform to set up any mmu mappings it may need */
  33. void platform_init_mmu_mappings(void);
  34. void platform_init_mmu(void);
  35. void display_init(void);
  36. void display_shutdown(void);
  37. void display_image_on_screen(void);
  38. unsigned board_machtype(void);
  39. unsigned board_platform_id(void);
  40. unsigned check_reboot_mode(void);
  41. void platform_uninit_timer(void);
  42. void reboot_device(unsigned);
  43. void config_L2_size(void);
  44. /* weakly defined function to get bootarg addr & size */
  45. __WEAK unsigned int platform_get_bootarg_addr(void);
  46. __WEAK unsigned int platform_get_bootarg_size(void);
  47. typedef struct { /* RAM configuration */
  48. unsigned int start_hi;
  49. unsigned int start_lo;
  50. unsigned int size_hi;
  51. unsigned int size_lo;
  52. } dt_dram_info;
  53. typedef struct {
  54. unsigned int size_hi;
  55. unsigned int size_lo;
  56. } dt_size_info;
  57. #endif