Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2008 Travis Geiselbrecht |
| 3 | * |
Channagoud Kadabi | d0395a5 | 2015-02-18 11:08:36 -0800 | [diff] [blame] | 4 | * Copyright (c) 2014-2015, 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 | #include <err.h> |
| 26 | #include <debug.h> |
| 27 | #include <platform.h> |
Amol Jadi | 02ca2ee | 2013-03-15 16:06:34 -0700 | [diff] [blame] | 28 | #include <boot_stats.h> |
Sundarajan Srinivasan | 79e5f51 | 2014-03-28 16:43:06 -0700 | [diff] [blame] | 29 | #include <platform/iomap.h> |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 30 | |
Amol Jadi | 4421e65 | 2011-06-16 15:00:48 -0700 | [diff] [blame] | 31 | /* |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 32 | * default implementations of these routines, if the platform code |
| 33 | * chooses not to implement. |
| 34 | */ |
Deepa Dinamani | 20cb9e5 | 2012-10-18 12:20:47 -0700 | [diff] [blame] | 35 | __WEAK int platform_use_identity_mmu_mappings(void) |
| 36 | { |
| 37 | return 1; |
| 38 | } |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 39 | |
| 40 | __WEAK void platform_init_mmu_mappings(void) |
| 41 | { |
| 42 | } |
| 43 | |
Deepa Dinamani | 20cb9e5 | 2012-10-18 12:20:47 -0700 | [diff] [blame] | 44 | __WEAK addr_t platform_get_virt_to_phys_mapping(addr_t virt_addr) |
| 45 | { |
| 46 | ASSERT(platform_use_identity_mmu_mappings()); |
| 47 | |
| 48 | return virt_addr; |
| 49 | } |
| 50 | |
| 51 | __WEAK addr_t platform_get_phys_to_virt_mapping(addr_t phys_addr) |
| 52 | { |
| 53 | ASSERT(platform_use_identity_mmu_mappings()); |
| 54 | |
| 55 | return phys_addr; |
| 56 | } |
| 57 | |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 58 | __WEAK void platform_early_init(void) |
| 59 | { |
| 60 | } |
| 61 | |
| 62 | __WEAK void platform_init(void) |
| 63 | { |
| 64 | } |
| 65 | |
Chandan Uddaraju | 2412050 | 2009-12-12 19:17:04 -0800 | [diff] [blame] | 66 | __WEAK void display_init(void) |
| 67 | { |
| 68 | } |
Shashank Mittal | 23b8f42 | 2010-04-16 19:27:21 -0700 | [diff] [blame] | 69 | |
Shashank Mittal | c648e71 | 2010-10-06 18:37:42 -0700 | [diff] [blame] | 70 | __WEAK void display_shutdown(void) |
| 71 | { |
| 72 | } |
| 73 | |
Chandan Uddaraju | 14e57eb | 2010-06-28 12:11:06 -0700 | [diff] [blame] | 74 | __WEAK void platform_config_interleaved_mode_gpios(void) |
| 75 | { |
| 76 | } |
Shashank Mittal | ed17773 | 2011-05-06 19:12:59 -0700 | [diff] [blame] | 77 | |
| 78 | __WEAK void uart_clock_init(void) |
| 79 | { |
| 80 | } |
| 81 | |
Amol Jadi | 4421e65 | 2011-06-16 15:00:48 -0700 | [diff] [blame] | 82 | __WEAK void platform_uninit(void) |
| 83 | { |
| 84 | } |
Shashank Mittal | cd98d47 | 2011-08-02 14:29:24 -0700 | [diff] [blame] | 85 | |
| 86 | __WEAK int image_verify(unsigned char * image_ptr, |
| 87 | unsigned char * signature_ptr, |
| 88 | unsigned int image_size, |
| 89 | unsigned hash_type) |
| 90 | { |
| 91 | return 0; |
| 92 | } |
Deepa Dinamani | 5e5c21a | 2012-02-16 18:59:57 -0800 | [diff] [blame] | 93 | |
Pavel Nedev | 36c2337 | 2013-03-19 15:38:53 +0200 | [diff] [blame] | 94 | __WEAK void ce_clock_init(void) |
Deepa Dinamani | 5e5c21a | 2012-02-16 18:59:57 -0800 | [diff] [blame] | 95 | { |
| 96 | } |
Amol Jadi | 02ca2ee | 2013-03-15 16:06:34 -0700 | [diff] [blame] | 97 | |
sundarajan srinivasan | caab0f4 | 2013-05-10 14:21:30 -0700 | [diff] [blame] | 98 | __WEAK addr_t get_bs_info_addr() |
Amol Jadi | 02ca2ee | 2013-03-15 16:06:34 -0700 | [diff] [blame] | 99 | { |
Unnati Gandhi | e12c2bf | 2014-07-17 15:07:44 +0530 | [diff] [blame] | 100 | return 0; |
sundarajan srinivasan | caab0f4 | 2013-05-10 14:21:30 -0700 | [diff] [blame] | 101 | } |
| 102 | |
| 103 | __WEAK uint32_t platform_get_sclk_count(void) |
| 104 | { |
| 105 | return 0; |
Amol Jadi | 02ca2ee | 2013-03-15 16:06:34 -0700 | [diff] [blame] | 106 | } |
Channagoud Kadabi | 071b2d8 | 2013-08-20 15:31:32 -0700 | [diff] [blame] | 107 | |
Unnati Gandhi | e12c2bf | 2014-07-17 15:07:44 +0530 | [diff] [blame] | 108 | __WEAK void clock_config_cdc(uint32_t slot) |
Channagoud Kadabi | 071b2d8 | 2013-08-20 15:31:32 -0700 | [diff] [blame] | 109 | { |
Unnati Gandhi | e12c2bf | 2014-07-17 15:07:44 +0530 | [diff] [blame] | 110 | |
Channagoud Kadabi | 071b2d8 | 2013-08-20 15:31:32 -0700 | [diff] [blame] | 111 | } |
Joonwoo Park | 6111278 | 2013-10-02 19:50:39 -0700 | [diff] [blame] | 112 | |
| 113 | __WEAK int get_target_boot_params(const char *cmdline, const char *part, |
vijay kumar | 870515d | 2015-08-31 16:37:24 +0530 | [diff] [blame] | 114 | char **buf) |
Joonwoo Park | 6111278 | 2013-10-02 19:50:39 -0700 | [diff] [blame] | 115 | { |
| 116 | return -1; |
| 117 | } |
Sundarajan Srinivasan | 79e5f51 | 2014-03-28 16:43:06 -0700 | [diff] [blame] | 118 | |
| 119 | __WEAK uint32_t platform_get_smem_base_addr() |
| 120 | { |
| 121 | return (uint32_t)MSM_SHARED_BASE; |
| 122 | } |
Sundarajan Srinivasan | 1f5fa15 | 2014-03-21 17:30:52 -0700 | [diff] [blame] | 123 | |
| 124 | __WEAK uint32_t platform_boot_dev_isemmc() |
| 125 | { |
| 126 | return 1; |
| 127 | } |
| 128 | |
| 129 | __WEAK uint32_t platform_get_boot_dev() |
| 130 | { |
| 131 | return 0; |
| 132 | } |
Channagoud Kadabi | 000e8b3 | 2014-12-08 16:48:52 -0800 | [diff] [blame] | 133 | |
| 134 | __WEAK int boot_device_mask(int val) |
| 135 | { |
| 136 | return ((val & 0x3E) >> 1); |
| 137 | } |
Unnati Gandhi | 2488505 | 2014-11-27 16:57:49 +0530 | [diff] [blame] | 138 | |
| 139 | __WEAK uint32_t platform_detect_panel() |
| 140 | { |
| 141 | return 0; |
| 142 | } |
Channagoud Kadabi | d0395a5 | 2015-02-18 11:08:36 -0800 | [diff] [blame] | 143 | |
| 144 | __WEAK uint32_t use_hsonly_mode() |
| 145 | { |
| 146 | return 0; |
| 147 | } |
lijuang | dc20de1 | 2015-02-11 12:09:57 +0800 | [diff] [blame] | 148 | |
| 149 | __WEAK uint32_t check_alarm_boot() |
| 150 | { |
| 151 | return 0; |
| 152 | } |
Aparna Mallavarapu | 711119b | 2015-03-29 03:35:07 +0530 | [diff] [blame] | 153 | __WEAK uint32_t platform_get_max_periph() |
| 154 | { |
| 155 | return 128; |
| 156 | } |