Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2008 Travis Geiselbrecht |
| 3 | * |
anisha agarwal | 35eb803 | 2017-03-21 13:12:12 -0700 | [diff] [blame] | 4 | * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. |
Sundarajan Srinivasan | 79e5f51 | 2014-03-28 16:43:06 -0700 | [diff] [blame] | 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); |
Unnati Gandhi | 7c53673 | 2014-07-17 14:37:49 +0530 | [diff] [blame] | 47 | addr_t get_bs_info_addr(void); |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 48 | |
Greg Grisco | d625055 | 2011-06-29 14:40:23 -0700 | [diff] [blame] | 49 | void display_init(void); |
| 50 | void display_shutdown(void); |
| 51 | void display_image_on_screen(void); |
vijay kumar | 7ad7116 | 2015-05-21 11:38:20 +0530 | [diff] [blame] | 52 | void display_fbcon_message(char *str); |
Greg Grisco | d625055 | 2011-06-29 14:40:23 -0700 | [diff] [blame] | 53 | |
| 54 | unsigned board_machtype(void); |
Amol Jadi | a63aaff | 2012-02-01 15:51:50 -0800 | [diff] [blame] | 55 | unsigned board_platform_id(void); |
Greg Grisco | d625055 | 2011-06-29 14:40:23 -0700 | [diff] [blame] | 56 | unsigned check_reboot_mode(void); |
lijuang | c518f5d | 2015-02-10 10:22:53 +0800 | [diff] [blame] | 57 | unsigned check_hard_reboot_mode(void); |
lijuang | dc20de1 | 2015-02-11 12:09:57 +0800 | [diff] [blame] | 58 | uint32_t check_alarm_boot(void); |
Greg Grisco | d625055 | 2011-06-29 14:40:23 -0700 | [diff] [blame] | 59 | void platform_uninit_timer(void); |
| 60 | void reboot_device(unsigned); |
lijuang | 395b5e6 | 2015-11-19 17:39:44 +0800 | [diff] [blame] | 61 | int set_download_mode(enum reboot_reason mode); |
Sundarajan Srinivasan | 79e5f51 | 2014-03-28 16:43:06 -0700 | [diff] [blame] | 62 | uint32_t platform_get_smem_base_addr(); |
Unnati Gandhi | 7c53673 | 2014-07-17 14:37:49 +0530 | [diff] [blame] | 63 | uint32_t platform_get_sclk_count(void); |
| 64 | void clock_config_cdc(uint32_t interface); |
| 65 | int platform_is_msm8939(); |
Unnati Gandhi | bdddf0d | 2014-11-18 18:00:34 +0530 | [diff] [blame] | 66 | int platform_is_msm8909(); |
Jeevan Shriram | 8d5e5ee | 2015-01-07 11:35:55 -0800 | [diff] [blame] | 67 | int platform_is_msm8992(); |
Parth Dixit | 4552cba | 2015-10-20 01:18:59 +0530 | [diff] [blame] | 68 | int platform_is_msm8937(); |
Parth Dixit | 05f3c9f | 2016-03-18 17:14:57 +0530 | [diff] [blame] | 69 | int platform_is_msm8917(); |
Parth Dixit | deecdcd | 2016-01-12 15:12:56 +0530 | [diff] [blame] | 70 | uint32_t platform_get_apcs_ipc_base(); |
| 71 | int platform_is_msm8952(); |
Gaurav Nebhwani | 4157b05 | 2016-03-09 15:45:55 +0530 | [diff] [blame] | 72 | int platform_is_msm8953(); |
Unnati Gandhi | a408492 | 2015-05-28 14:22:09 +0530 | [diff] [blame] | 73 | int platform_is_msm8956(); |
vijay kumar | a0a7472 | 2015-09-04 15:45:49 +0530 | [diff] [blame] | 74 | uint32_t platform_is_msm8976_v_1_1(); |
Parth Dixit | 4734bd6 | 2016-01-13 11:06:28 +0530 | [diff] [blame] | 75 | uint32_t platform_get_tz_app_add(); |
| 76 | uint32_t platform_get_tz_app_size(); |
Unnati Gandhi | bdddf0d | 2014-11-18 18:00:34 +0530 | [diff] [blame] | 77 | int boot_device_mask(int); |
Unnati Gandhi | 6bc34fa | 2014-11-27 16:55:54 +0530 | [diff] [blame] | 78 | uint32_t platform_detect_panel(); |
Aparna Mallavarapu | 711119b | 2015-03-29 03:35:07 +0530 | [diff] [blame] | 79 | uint32_t platform_get_max_periph(); |
Channagoud Kadabi | 53a2126 | 2015-04-09 16:18:23 -0700 | [diff] [blame] | 80 | int platform_is_msm8996(); |
Shalini Krishnamoorthi | 3d4bb2a | 2016-06-24 15:17:29 -0700 | [diff] [blame] | 81 | int platform_is_apq8096_mediabox(); |
Channagoud Kadabi | e35356f | 2015-08-05 18:06:38 -0700 | [diff] [blame] | 82 | bool platform_use_qmp_misc_settings(); |
lijuang | 4ece1e7 | 2015-08-14 21:02:36 +0800 | [diff] [blame] | 83 | void set_device_unlock_value(int type, bool status); |
| 84 | void get_product_name(unsigned char *buf); |
| 85 | void get_bootloader_version(unsigned char *buf); |
| 86 | void get_baseband_version(unsigned char *buf); |
| 87 | bool is_device_locked(); |
Karthik Jadala | 8e6b219 | 2017-02-08 12:59:16 +0530 | [diff] [blame] | 88 | bool platform_is_mdm9650(); |
anisha agarwal | 35eb803 | 2017-03-21 13:12:12 -0700 | [diff] [blame] | 89 | bool platform_is_sdx20(); |
Channagoud Kadabi | c0dbac9 | 2016-01-11 16:49:01 -0800 | [diff] [blame] | 90 | uint64_t platform_get_ddr_start(); |
Mayank Grover | 9045701 | 2016-12-29 18:24:04 +0530 | [diff] [blame] | 91 | bool platform_is_glink_enabled(); |
Mayank Grover | 4266467 | 2017-03-06 17:57:26 +0530 | [diff] [blame] | 92 | bool platform_is_mdm9206(); |
AnilKumar Chimata | 29a19c3 | 2017-08-10 14:48:55 +0530 | [diff] [blame] | 93 | int is_vb_le_enabled(); |
Mayank Grover | e73aafb | 2017-11-02 12:52:33 +0530 | [diff] [blame] | 94 | void* get_rpmb_snd_rcv_buff(); |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 95 | #endif |