blob: 144b346f41a34253ed21cb273850aed1d89ded4b [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
28/* super early platform initialization, before almost everything */
29void target_early_init(void);
30
31/* later init, after the kernel has come up */
32void target_init(void);
33
David Ng3679bc52010-02-09 15:43:43 -080034/* get memory address for fastboot image loading */
35void *target_get_scratch_address(void);
36
Vivek Mehta5f1c9d42011-04-01 20:11:59 -070037/* get the max allowed flash size */
38unsigned target_get_max_flash_size(void);
39
David Ng183a7422009-12-07 14:55:21 -080040/* if target is using eMMC bootup */
41int target_is_emmc_boot(void);
42
Greg Griscod6250552011-06-29 14:40:23 -070043unsigned* target_atag_mem(unsigned* ptr);
Greg Griscod6250552011-06-29 14:40:23 -070044void target_battery_charging_enable(unsigned enable, unsigned disconnect);
45unsigned target_pause_for_battery_charge(void);
46unsigned target_baseband(void);
47void target_serialno(unsigned char *buf);
48void target_fastboot_init(void);
Stanimir Varbanov677001e2013-07-18 18:16:39 +030049void target_load_ssd_keystore(void);
Stanimir Varbanov8bc68c72013-07-08 18:22:04 +030050bool target_is_ssd_enabled(void);
Channagoud Kadabi9fbdcdf2013-09-19 16:24:16 -070051void *target_mmc_device();
Sundarajan Srinivasan29cb66e2013-10-30 18:48:27 -070052uint32_t target_boot_device_emmc();
Greg Griscod6250552011-06-29 14:40:23 -070053
Dhaval Patelcdcb6462013-07-18 14:46:57 -070054bool target_display_panel_node(char *pbuf, uint16_t buf_size);
Aravind Venkateswaran6385f7e2014-02-25 16:45:11 -080055void target_display_init(const char *panel_name);
Aravind Venkateswarandd50c1a2014-02-25 14:42:43 -080056void target_display_shutdown(void);
57
Sundarajan Srinivasan289ff3f2013-09-30 16:46:29 -070058uint32_t target_get_boot_device();
59
Amol Jadi9ff7bb52013-10-11 14:11:45 -070060const char * target_usb_controller();
61void target_usb_phy_reset(void);
62void target_usb_phy_mux_configure(void);
63
Sundarajan Srinivasan289ff3f2013-09-30 16:46:29 -070064/* Boot device */
65enum boot_device
66{
67 BOOT_DEFAULT=0,
68 BOOT_EMMC=2,
69 BOOT_UFS=4,
70};
Greg Griscod6250552011-06-29 14:40:23 -070071
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070072#endif