blob: 7e06f28d17f1402d4584ee803cf96d128cf0f468 [file] [log] [blame]
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -07001/*
2 * Copyright (c) 2008 Travis Geiselbrecht
3 *
Aravind Venkateswaran497653f2014-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
Unnati Gandhie8262ac2014-07-17 14:37:49 +053028/* 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 Kadabic3ecbf42013-05-08 12:54:05 -070060struct mmc_device *target_mmc_device();
Greg Griscod6250552011-06-29 14:40:23 -070061
Dhaval Patelcdcb6462013-07-18 14:46:57 -070062bool target_display_panel_node(char *pbuf, uint16_t buf_size);
Aravind Venkateswaran35d110b2014-02-25 16:45:11 -080063void target_display_init(const char *panel_name);
Aravind Venkateswaran497653f2014-02-25 14:42:43 -080064void target_display_shutdown(void);
Sridhar Parasuramd04ee852015-08-29 10:56:14 -070065bool target_build_variant_user();
Unnati Gandhie8262ac2014-07-17 14:37:49 +053066uint32_t target_hw_interposer();
67uint32_t target_override_pll();
68uint32_t target_ddr_cfg_val();
69void target_usb_init(void);
70void target_usb_stop(void);
71uint32_t target_get_hlos_subtype(void);
72void shutdown_device();
73bool target_warm_boot(void);
74bool target_use_signed_kernel(void);
75int _emmc_recovery_init(void);
76void ulpi_write(unsigned val, unsigned reg);
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070077#endif