blob: 772afdfac74178efbcf006e519cb7326006c90c1 [file] [log] [blame]
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -07001/*
2 * Copyright (c) 2008 Travis Geiselbrecht
3 *
Aravind Venkateswarandd50c1a2014-02-25 14:42:43 -08004 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
Channagoud Kadabic3ecbf42013-05-08 12:54:05 -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 __TARGET_H
26#define __TARGET_H
27
Channagoud Kadabi77b52272014-02-04 17:01:16 -080028/* Target helper functions exposed to USB driver */
29typedef 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 Geiselbrecht1d0df692008-09-01 02:26:09 -070037/* super early platform initialization, before almost everything */
38void target_early_init(void);
39
40/* later init, after the kernel has come up */
41void target_init(void);
42
David Ng3679bc52010-02-09 15:43:43 -080043/* get memory address for fastboot image loading */
44void *target_get_scratch_address(void);
45
Vivek Mehta5f1c9d42011-04-01 20:11:59 -070046/* get the max allowed flash size */
47unsigned target_get_max_flash_size(void);
48
David Ng183a7422009-12-07 14:55:21 -080049/* if target is using eMMC bootup */
50int target_is_emmc_boot(void);
51
Greg Griscod6250552011-06-29 14:40:23 -070052unsigned* target_atag_mem(unsigned* ptr);
Greg Griscod6250552011-06-29 14:40:23 -070053void target_battery_charging_enable(unsigned enable, unsigned disconnect);
54unsigned target_pause_for_battery_charge(void);
55unsigned target_baseband(void);
56void target_serialno(unsigned char *buf);
57void target_fastboot_init(void);
Stanimir Varbanov677001e2013-07-18 18:16:39 +030058void target_load_ssd_keystore(void);
Stanimir Varbanov8bc68c72013-07-08 18:22:04 +030059bool target_is_ssd_enabled(void);
Channagoud Kadabi9fbdcdf2013-09-19 16:24:16 -070060void *target_mmc_device();
Matthew Qindefd5562014-07-11 18:02:40 +080061uint32_t is_user_force_reset(void);
Greg Griscod6250552011-06-29 14:40:23 -070062
Ajay Singh Parmar430bbb32014-03-18 15:26:30 -070063bool target_display_panel_node(char *panel_name, char *pbuf,
64 uint16_t buf_size);
Aravind Venkateswaran6385f7e2014-02-25 16:45:11 -080065void target_display_init(const char *panel_name);
Aravind Venkateswarandd50c1a2014-02-25 14:42:43 -080066void target_display_shutdown(void);
67
Sundarajan Srinivasan289ff3f2013-09-30 16:46:29 -070068uint32_t target_get_boot_device();
69
Amol Jadi9ff7bb52013-10-11 14:11:45 -070070const char * target_usb_controller();
71void target_usb_phy_reset(void);
72void target_usb_phy_mux_configure(void);
Channagoud Kadabi77b52272014-02-04 17:01:16 -080073target_usb_iface_t * target_usb30_init();
Sundarajan Srinivasan8031f6c2014-03-12 15:45:28 -070074bool target_is_cdp_qvga();
Channagoud Kadabi62ac4cb2014-05-13 11:55:38 -070075uint32_t target_hw_interposer();
Channagoud Kadabid6ded112014-05-12 18:07:24 -070076uint32_t target_override_pll();
Channagoud Kadabi41c81a62014-10-08 19:55:30 -070077uint32_t target_ddr_cfg_val();
Unnati Gandhi7c536732014-07-17 14:37:49 +053078void target_usb_init(void);
79void target_usb_stop(void);
80uint32_t target_get_hlos_subtype(void);
81void shutdown_device();
82bool target_warm_boot(void);
83bool target_use_signed_kernel(void);
84int _emmc_recovery_init(void);
85void ulpi_write(unsigned val, unsigned reg);
Veera Sundaram Sankaranb0f9e112014-12-18 14:37:48 -080086void target_crypto_init_params(void);
Sridhar Parasuram11364462015-01-05 12:22:50 -080087int target_cont_splash_screen(void);
Channagoud Kadabi2021cef2015-02-25 12:08:32 -080088bool target_build_variant_user();
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070089#endif