Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2008 Travis Geiselbrecht |
| 3 | * |
Aravind Venkateswaran | dd50c1a | 2014-02-25 14:42:43 -0800 | [diff] [blame] | 4 | * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. |
Channagoud Kadabi | c3ecbf4 | 2013-05-08 12:54:05 -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 __TARGET_H |
| 26 | #define __TARGET_H |
| 27 | |
Channagoud Kadabi | 77b5227 | 2014-02-04 17:01:16 -0800 | [diff] [blame] | 28 | /* Target helper functions exposed to USB driver */ |
| 29 | typedef struct { |
| 30 | void (*mux_config) (); |
| 31 | void (*phy_reset) (); |
| 32 | void (*phy_init) (); |
| 33 | void (*clock_init) (); |
| 34 | uint8_t vbus_override; |
| 35 | } target_usb_iface_t; |
| 36 | |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 37 | /* super early platform initialization, before almost everything */ |
| 38 | void target_early_init(void); |
| 39 | |
| 40 | /* later init, after the kernel has come up */ |
| 41 | void target_init(void); |
| 42 | |
David Ng | 3679bc5 | 2010-02-09 15:43:43 -0800 | [diff] [blame] | 43 | /* get memory address for fastboot image loading */ |
| 44 | void *target_get_scratch_address(void); |
| 45 | |
Vivek Mehta | 5f1c9d4 | 2011-04-01 20:11:59 -0700 | [diff] [blame] | 46 | /* get the max allowed flash size */ |
| 47 | unsigned target_get_max_flash_size(void); |
| 48 | |
David Ng | 183a742 | 2009-12-07 14:55:21 -0800 | [diff] [blame] | 49 | /* if target is using eMMC bootup */ |
| 50 | int target_is_emmc_boot(void); |
| 51 | |
Greg Grisco | d625055 | 2011-06-29 14:40:23 -0700 | [diff] [blame] | 52 | unsigned* target_atag_mem(unsigned* ptr); |
Greg Grisco | d625055 | 2011-06-29 14:40:23 -0700 | [diff] [blame] | 53 | void target_battery_charging_enable(unsigned enable, unsigned disconnect); |
| 54 | unsigned target_pause_for_battery_charge(void); |
| 55 | unsigned target_baseband(void); |
| 56 | void target_serialno(unsigned char *buf); |
| 57 | void target_fastboot_init(void); |
Stanimir Varbanov | 677001e | 2013-07-18 18:16:39 +0300 | [diff] [blame] | 58 | void target_load_ssd_keystore(void); |
Stanimir Varbanov | 8bc68c7 | 2013-07-08 18:22:04 +0300 | [diff] [blame] | 59 | bool target_is_ssd_enabled(void); |
Channagoud Kadabi | 9fbdcdf | 2013-09-19 16:24:16 -0700 | [diff] [blame] | 60 | void *target_mmc_device(); |
Matthew Qin | defd556 | 2014-07-11 18:02:40 +0800 | [diff] [blame] | 61 | uint32_t is_user_force_reset(void); |
Greg Grisco | d625055 | 2011-06-29 14:40:23 -0700 | [diff] [blame] | 62 | |
Ajay Singh Parmar | 430bbb3 | 2014-03-18 15:26:30 -0700 | [diff] [blame] | 63 | bool target_display_panel_node(char *panel_name, char *pbuf, |
| 64 | uint16_t buf_size); |
Aravind Venkateswaran | 6385f7e | 2014-02-25 16:45:11 -0800 | [diff] [blame] | 65 | void target_display_init(const char *panel_name); |
Aravind Venkateswaran | dd50c1a | 2014-02-25 14:42:43 -0800 | [diff] [blame] | 66 | void target_display_shutdown(void); |
| 67 | |
Sundarajan Srinivasan | 289ff3f | 2013-09-30 16:46:29 -0700 | [diff] [blame] | 68 | uint32_t target_get_boot_device(); |
| 69 | |
Amol Jadi | 9ff7bb5 | 2013-10-11 14:11:45 -0700 | [diff] [blame] | 70 | const char * target_usb_controller(); |
| 71 | void target_usb_phy_reset(void); |
| 72 | void target_usb_phy_mux_configure(void); |
Channagoud Kadabi | 77b5227 | 2014-02-04 17:01:16 -0800 | [diff] [blame] | 73 | target_usb_iface_t * target_usb30_init(); |
Sundarajan Srinivasan | 8031f6c | 2014-03-12 15:45:28 -0700 | [diff] [blame] | 74 | bool target_is_cdp_qvga(); |
Channagoud Kadabi | 62ac4cb | 2014-05-13 11:55:38 -0700 | [diff] [blame] | 75 | uint32_t target_hw_interposer(); |
Channagoud Kadabi | d6ded11 | 2014-05-12 18:07:24 -0700 | [diff] [blame] | 76 | uint32_t target_override_pll(); |
Channagoud Kadabi | 41c81a6 | 2014-10-08 19:55:30 -0700 | [diff] [blame] | 77 | uint32_t target_ddr_cfg_val(); |
Unnati Gandhi | 7c53673 | 2014-07-17 14:37:49 +0530 | [diff] [blame] | 78 | void target_usb_init(void); |
| 79 | void target_usb_stop(void); |
| 80 | uint32_t target_get_hlos_subtype(void); |
| 81 | void shutdown_device(); |
| 82 | bool target_warm_boot(void); |
| 83 | bool target_use_signed_kernel(void); |
| 84 | int _emmc_recovery_init(void); |
| 85 | void ulpi_write(unsigned val, unsigned reg); |
Veera Sundaram Sankaran | b0f9e11 | 2014-12-18 14:37:48 -0800 | [diff] [blame] | 86 | void target_crypto_init_params(void); |
Sridhar Parasuram | 1136446 | 2015-01-05 12:22:50 -0800 | [diff] [blame] | 87 | int target_cont_splash_screen(void); |
Channagoud Kadabi | 2021cef | 2015-02-25 12:08:32 -0800 | [diff] [blame] | 88 | bool target_build_variant_user(); |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 89 | #endif |