blob: 609ea7f4751dbd20cba456ff020dede98b873dcc [file] [log] [blame]
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -07001/*
2 * Copyright (c) 2008 Travis Geiselbrecht
3 *
Jeevan Shriram8d5e5ee2015-01-07 11:35:55 -08004 * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
Sundarajan Srinivasan79e5f512014-03-28 16:43:06 -07005 *
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -07006 * 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 Nedeva4c9d3a2013-05-15 14:42:34 +030028#include <dload_util.h>
29
Deepa Dinamani20cb9e52012-10-18 12:20:47 -070030#define PA(x) platform_get_virt_to_phys_mapping(x)
31#define VA(x) platform_get_phys_to_virt_mapping(x)
32
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070033time_t current_time(void);
34bigtime_t current_time_hires(void);
35
36/* super early platform initialization, before almost everything */
37void platform_early_init(void);
38
39/* later init, after the kernel has come up */
40void 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 Dinamani3e5cf0d2012-10-29 12:15:17 -070043int platform_use_identity_mmu_mappings(void);
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070044void platform_init_mmu_mappings(void);
Deepa Dinamani20cb9e52012-10-18 12:20:47 -070045addr_t platform_get_virt_to_phys_mapping(addr_t virt_addr);
46addr_t platform_get_phys_to_virt_mapping(addr_t phys_addr);
Unnati Gandhi7c536732014-07-17 14:37:49 +053047addr_t get_bs_info_addr(void);
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070048
Greg Griscod6250552011-06-29 14:40:23 -070049void display_init(void);
50void display_shutdown(void);
51void display_image_on_screen(void);
vijay kumar7ad71162015-05-21 11:38:20 +053052void display_fbcon_message(char *str);
Greg Griscod6250552011-06-29 14:40:23 -070053
54unsigned board_machtype(void);
Amol Jadia63aaff2012-02-01 15:51:50 -080055unsigned board_platform_id(void);
Greg Griscod6250552011-06-29 14:40:23 -070056unsigned check_reboot_mode(void);
lijuangc518f5d2015-02-10 10:22:53 +080057unsigned check_hard_reboot_mode(void);
lijuangdc20de12015-02-11 12:09:57 +080058uint32_t check_alarm_boot(void);
Greg Griscod6250552011-06-29 14:40:23 -070059void platform_uninit_timer(void);
60void reboot_device(unsigned);
Pavel Nedeva4c9d3a2013-05-15 14:42:34 +030061int set_download_mode(enum dload_mode mode);
Sundarajan Srinivasan79e5f512014-03-28 16:43:06 -070062uint32_t platform_get_smem_base_addr();
Unnati Gandhi7c536732014-07-17 14:37:49 +053063uint32_t platform_get_sclk_count(void);
64void clock_config_cdc(uint32_t interface);
65int platform_is_msm8939();
Unnati Gandhibdddf0d2014-11-18 18:00:34 +053066int platform_is_msm8909();
Jeevan Shriram8d5e5ee2015-01-07 11:35:55 -080067int platform_is_msm8992();
Unnati Gandhia4084922015-05-28 14:22:09 +053068int platform_is_msm8956();
Unnati Gandhibdddf0d2014-11-18 18:00:34 +053069int boot_device_mask(int);
Unnati Gandhi6bc34fa2014-11-27 16:55:54 +053070uint32_t platform_detect_panel();
Aparna Mallavarapu711119b2015-03-29 03:35:07 +053071uint32_t platform_get_max_periph();
Channagoud Kadabi53a21262015-04-09 16:18:23 -070072int platform_is_msm8996();
Channagoud Kadabi2324bd52015-07-13 15:02:20 -070073uint64_t platform_get_ddr_start();
Channagoud Kadabie35356f2015-08-05 18:06:38 -070074bool platform_use_qmp_misc_settings();
lijuang4ece1e72015-08-14 21:02:36 +080075void set_device_unlock_value(int type, bool status);
76void get_product_name(unsigned char *buf);
77void get_bootloader_version(unsigned char *buf);
78void get_baseband_version(unsigned char *buf);
79bool is_device_locked();
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070080#endif