blob: 46f934c3ec74de6b5ab2977b02e1896af9d57a11 [file] [log] [blame]
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -07001/*
2 * Copyright (c) 2008 Travis Geiselbrecht
3 *
Anmolpreet Kaur6281f362019-03-08 17:56:06 +05304 * Copyright (c) 2014-2016,2019 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#include <err.h>
26#include <debug.h>
27#include <platform.h>
Amol Jadi02ca2ee2013-03-15 16:06:34 -070028#include <boot_stats.h>
Sundarajan Srinivasan79e5f512014-03-28 16:43:06 -070029#include <platform/iomap.h>
P.V. Phani Kumar68d13012016-04-05 17:30:17 +053030#include <image_verify.h>
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070031
Amol Jadi4421e652011-06-16 15:00:48 -070032/*
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070033 * default implementations of these routines, if the platform code
34 * chooses not to implement.
35 */
Deepa Dinamani20cb9e52012-10-18 12:20:47 -070036__WEAK int platform_use_identity_mmu_mappings(void)
37{
38 return 1;
39}
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070040
41__WEAK void platform_init_mmu_mappings(void)
42{
43}
44
Deepa Dinamani20cb9e52012-10-18 12:20:47 -070045__WEAK addr_t platform_get_virt_to_phys_mapping(addr_t virt_addr)
46{
47 ASSERT(platform_use_identity_mmu_mappings());
48
49 return virt_addr;
50}
51
52__WEAK addr_t platform_get_phys_to_virt_mapping(addr_t phys_addr)
53{
54 ASSERT(platform_use_identity_mmu_mappings());
55
56 return phys_addr;
57}
58
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070059__WEAK void platform_early_init(void)
60{
61}
62
63__WEAK void platform_init(void)
64{
65}
66
Chandan Uddaraju24120502009-12-12 19:17:04 -080067__WEAK void display_init(void)
68{
69}
Shashank Mittal23b8f422010-04-16 19:27:21 -070070
Shashank Mittalc648e712010-10-06 18:37:42 -070071__WEAK void display_shutdown(void)
72{
73}
74
Chandan Uddaraju14e57eb2010-06-28 12:11:06 -070075__WEAK void platform_config_interleaved_mode_gpios(void)
76{
77}
Shashank Mittaled177732011-05-06 19:12:59 -070078
79__WEAK void uart_clock_init(void)
80{
81}
82
Amol Jadi4421e652011-06-16 15:00:48 -070083__WEAK void platform_uninit(void)
84{
85}
Shashank Mittalcd98d472011-08-02 14:29:24 -070086
87__WEAK int image_verify(unsigned char * image_ptr,
88 unsigned char * signature_ptr,
89 unsigned int image_size,
90 unsigned hash_type)
91{
92 return 0;
93}
Deepa Dinamani5e5c21a2012-02-16 18:59:57 -080094
Pavel Nedev36c23372013-03-19 15:38:53 +020095__WEAK void ce_clock_init(void)
Deepa Dinamani5e5c21a2012-02-16 18:59:57 -080096{
97}
Amol Jadi02ca2ee2013-03-15 16:06:34 -070098
sundarajan srinivasancaab0f42013-05-10 14:21:30 -070099__WEAK addr_t get_bs_info_addr()
Amol Jadi02ca2ee2013-03-15 16:06:34 -0700100{
Unnati Gandhie12c2bf2014-07-17 15:07:44 +0530101 return 0;
sundarajan srinivasancaab0f42013-05-10 14:21:30 -0700102}
103
104__WEAK uint32_t platform_get_sclk_count(void)
105{
106 return 0;
Amol Jadi02ca2ee2013-03-15 16:06:34 -0700107}
Channagoud Kadabi071b2d82013-08-20 15:31:32 -0700108
Unnati Gandhie12c2bf2014-07-17 15:07:44 +0530109__WEAK void clock_config_cdc(uint32_t slot)
Channagoud Kadabi071b2d82013-08-20 15:31:32 -0700110{
Unnati Gandhie12c2bf2014-07-17 15:07:44 +0530111
Channagoud Kadabi071b2d82013-08-20 15:31:32 -0700112}
Joonwoo Park61112782013-10-02 19:50:39 -0700113
114__WEAK int get_target_boot_params(const char *cmdline, const char *part,
vijay kumar870515d2015-08-31 16:37:24 +0530115 char **buf)
Joonwoo Park61112782013-10-02 19:50:39 -0700116{
117 return -1;
118}
Sundarajan Srinivasan79e5f512014-03-28 16:43:06 -0700119
120__WEAK uint32_t platform_get_smem_base_addr()
121{
122 return (uint32_t)MSM_SHARED_BASE;
123}
Sundarajan Srinivasan1f5fa152014-03-21 17:30:52 -0700124
125__WEAK uint32_t platform_boot_dev_isemmc()
126{
127 return 1;
128}
129
Anmolpreet Kaur6281f362019-03-08 17:56:06 +0530130__WEAK uint32_t platform_boot_dev_is_nand()
131{
132 return 0;
133}
134
Sundarajan Srinivasan1f5fa152014-03-21 17:30:52 -0700135__WEAK uint32_t platform_get_boot_dev()
136{
137 return 0;
138}
Channagoud Kadabi000e8b32014-12-08 16:48:52 -0800139
140__WEAK int boot_device_mask(int val)
141{
142 return ((val & 0x3E) >> 1);
143}
Unnati Gandhi24885052014-11-27 16:57:49 +0530144
145__WEAK uint32_t platform_detect_panel()
146{
147 return 0;
148}
Channagoud Kadabid0395a52015-02-18 11:08:36 -0800149
150__WEAK uint32_t use_hsonly_mode()
151{
152 return 0;
153}
lijuangdc20de12015-02-11 12:09:57 +0800154
155__WEAK uint32_t check_alarm_boot()
156{
157 return 0;
158}
Aparna Mallavarapu711119b2015-03-29 03:35:07 +0530159__WEAK uint32_t platform_get_max_periph()
160{
161 return 128;
162}
P.V. Phani Kumar68d13012016-04-05 17:30:17 +0530163
164/* This function definition should not be used if VERIFIED_BOOT
165is enabled. And this is expected to be called only for MDM Targets */
166__WEAK uint32_t read_der_message_length(unsigned char* input, unsigned sz)
167{
168 return SIGNATURE_SIZE;
169}
Mayank Grover90457012016-12-29 18:24:04 +0530170
171/* Check if glink is supported or not */
172__WEAK bool platform_is_glink_enabled()
173{
174#if GLINK_SUPPORT
175 return 1;
176#else
177 return 0;
178#endif
179}
180