Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2008 Travis Geiselbrecht |
| 3 | * |
Sundarajan Srinivasan | 79e5f51 | 2014-03-28 16:43:06 -0700 | [diff] [blame] | 4 | * Copyright (c) 2014, The Linux Foundation. All rights reserved. |
| 5 | * |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 6 | * Permission is hereby granted, free of charge, to any person obtaining |
| 7 | * a copy of this software and associated documentation files |
| 8 | * (the "Software"), to deal in the Software without restriction, |
| 9 | * including without limitation the rights to use, copy, modify, merge, |
| 10 | * publish, distribute, sublicense, and/or sell copies of the Software, |
| 11 | * and to permit persons to whom the Software is furnished to do so, |
| 12 | * subject to the following conditions: |
| 13 | * |
| 14 | * The above copyright notice and this permission notice shall be |
| 15 | * included in all copies or substantial portions of the Software. |
| 16 | * |
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 20 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 21 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 22 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 23 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 24 | */ |
| 25 | #ifndef __PLATFORM_H |
| 26 | #define __PLATFORM_H |
| 27 | |
Pavel Nedev | a4c9d3a | 2013-05-15 14:42:34 +0300 | [diff] [blame] | 28 | #include <dload_util.h> |
| 29 | |
Deepa Dinamani | 20cb9e5 | 2012-10-18 12:20:47 -0700 | [diff] [blame] | 30 | #define PA(x) platform_get_virt_to_phys_mapping(x) |
| 31 | #define VA(x) platform_get_phys_to_virt_mapping(x) |
| 32 | |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 33 | time_t current_time(void); |
| 34 | bigtime_t current_time_hires(void); |
| 35 | |
| 36 | /* super early platform initialization, before almost everything */ |
| 37 | void platform_early_init(void); |
| 38 | |
| 39 | /* later init, after the kernel has come up */ |
| 40 | void platform_init(void); |
| 41 | |
| 42 | /* called by the arch init code to get the platform to set up any mmu mappings it may need */ |
Deepa Dinamani | 3e5cf0d | 2012-10-29 12:15:17 -0700 | [diff] [blame] | 43 | int platform_use_identity_mmu_mappings(void); |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 44 | void platform_init_mmu_mappings(void); |
Deepa Dinamani | 20cb9e5 | 2012-10-18 12:20:47 -0700 | [diff] [blame] | 45 | addr_t platform_get_virt_to_phys_mapping(addr_t virt_addr); |
| 46 | addr_t platform_get_phys_to_virt_mapping(addr_t phys_addr); |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 47 | |
Greg Grisco | d625055 | 2011-06-29 14:40:23 -0700 | [diff] [blame] | 48 | void display_init(void); |
| 49 | void display_shutdown(void); |
| 50 | void display_image_on_screen(void); |
| 51 | |
| 52 | unsigned board_machtype(void); |
Amol Jadi | a63aaff | 2012-02-01 15:51:50 -0800 | [diff] [blame] | 53 | unsigned board_platform_id(void); |
Greg Grisco | d625055 | 2011-06-29 14:40:23 -0700 | [diff] [blame] | 54 | unsigned check_reboot_mode(void); |
| 55 | void platform_uninit_timer(void); |
| 56 | void reboot_device(unsigned); |
Pavel Nedev | a4c9d3a | 2013-05-15 14:42:34 +0300 | [diff] [blame] | 57 | int set_download_mode(enum dload_mode mode); |
Sundarajan Srinivasan | 79e5f51 | 2014-03-28 16:43:06 -0700 | [diff] [blame] | 58 | uint32_t platform_get_smem_base_addr(); |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 59 | #endif |