2 * arch/arm/mach-tegra/board.h
4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (C) 2011-2012 NVIDIA Corporation.
8 * Colin Cross <ccross@google.com>
9 * Erik Gilling <konkers@google.com>
11 * This software is licensed under the terms of the GNU General Public
12 * License version 2, as published by the Free Software Foundation, and
13 * may be copied, distributed, and modified under those terms.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
22 #ifndef __MACH_TEGRA_BOARD_H
23 #define __MACH_TEGRA_BOARD_H
25 #include <linux/types.h>
26 #include <linux/power_supply.h>
27 #include <linux/memory.h>
29 #define ADD_FIXED_VOLTAGE_REG(_name) (&_name##_fixed_voltage_device)
31 /* Macro for defining fixed voltage regulator */
32 #define FIXED_VOLTAGE_REG_INIT(_id, _name, _microvolts, _gpio, \
33 _startup_delay, _enable_high, _enabled_at_boot, \
34 _valid_ops_mask, _always_on) \
35 static struct regulator_init_data _name##_initdata = { \
36 .consumer_supplies = _name##_consumer_supply, \
37 .num_consumer_supplies = \
38 ARRAY_SIZE(_name##_consumer_supply), \
40 .valid_ops_mask = _valid_ops_mask , \
41 .always_on = _always_on, \
44 static struct fixed_voltage_config _name##_config = { \
45 .supply_name = #_name, \
46 .microvolts = _microvolts, \
48 .startup_delay = _startup_delay, \
49 .enable_high = _enable_high, \
50 .enabled_at_boot = _enabled_at_boot, \
51 .init_data = &_name##_initdata, \
53 static struct platform_device _name##_fixed_voltage_device = { \
54 .name = "reg-fixed-voltage", \
57 .platform_data = &_name##_config, \
61 #if defined(CONFIG_TEGRA_NVMAP)
62 #define NVMAP_HEAP_CARVEOUT_IRAM_INIT \
64 .usage_mask = NVMAP_HEAP_CARVEOUT_IRAM, \
65 .base = TEGRA_IRAM_BASE + TEGRA_RESET_HANDLER_SIZE, \
66 .size = TEGRA_IRAM_SIZE - TEGRA_RESET_HANDLER_SIZE, \
67 .buddy_size = 0, /* no buddy allocation for IRAM */ \
71 /* This information is passed by bootloader */
72 #define COMMCHIP_UNKNOWN 0
73 #define COMMCHIP_NOCHIP 1
74 #define COMMCHIP_BROADCOM_BCM4329 2
75 #define COMMCHIP BROADCOM_BCM4330 3
76 #define COMMCHIP_MARVELL_SD8797 4
79 struct memory_accessor;
81 void tegra_assert_system_reset(char mode, const char *cmd);
82 void get_mac_addr(struct memory_accessor *, void *);
84 void __init tegra_init_early(void);
85 void __init tegra_mc_init(void);
86 void __init tegra_map_common_io(void);
87 void __init tegra_init_irq(void);
88 void __init tegra_init_clock(void);
89 void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
90 unsigned long fb2_size);
91 /* FIXME: The following needs to move common.h when arm_soc_desc is
92 introduced in a future version of the kernel */
93 #ifdef CONFIG_CACHE_L2X0
94 void tegra_init_cache(bool init);
96 static inline void tegra_init_cache(bool init) {}
98 void __init tegra_ram_console_debug_reserve(unsigned long ram_console_size);
99 void __init tegra_ram_console_debug_init(void);
100 void __init tegra_release_bootloader_fb(void);
101 void __init tegra_protected_aperture_init(unsigned long aperture);
102 int __init tegra_init_board_info(void);
103 void tegra_move_framebuffer(unsigned long to, unsigned long from,
105 bool is_tegra_debug_uartport_hs(void);
106 int get_tegra_uart_debug_port_id(void);
107 int arb_lost_recovery(int scl_gpio, int sda_gpio);
109 extern unsigned long tegra_bootloader_fb_start;
110 extern unsigned long tegra_bootloader_fb_size;
111 extern unsigned long tegra_fb_start;
112 extern unsigned long tegra_fb_size;
113 extern unsigned long tegra_fb2_start;
114 extern unsigned long tegra_fb2_size;
115 extern unsigned long tegra_carveout_start;
116 extern unsigned long tegra_carveout_size;
117 extern unsigned long tegra_vpr_start;
118 extern unsigned long tegra_vpr_size;
119 extern unsigned long tegra_lp0_vec_start;
120 extern unsigned long tegra_lp0_vec_size;
121 extern bool tegra_lp0_vec_relocate;
122 extern unsigned long tegra_grhost_aperture;
124 extern struct sys_timer tegra_timer;
146 enum audio_codec_type {
156 void tegra_get_board_info(struct board_info *);
157 void tegra_get_pmu_board_info(struct board_info *bi);
158 void tegra_get_display_board_info(struct board_info *bi);
159 void tegra_get_camera_board_info(struct board_info *bi);
160 #ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
161 #define SET_CONSERVATIVE_GOVERNOR_UP_THRESHOLD 95
162 #define SET_CONSERVATIVE_GOVERNOR_DOWN_THRESHOLD 50
163 #define SET_CONSERVATIVE_GOVERNOR_FREQ_STEP 3
165 void cpufreq_save_default_governor(void);
166 void cpufreq_restore_default_governor(void);
167 void cpufreq_set_conservative_governor(void);
168 void cpufreq_set_conservative_governor_param(char *name, int value);
170 int get_core_edp(void);
171 enum panel_type get_panel_type(void);
172 int tegra_get_modem_id(void);
173 int tegra_get_commchip_id(void);
174 enum power_supply_type get_power_supply_type(void);
175 enum audio_codec_type get_audio_codec_type(void);
176 int get_maximum_cpu_current_supported(void);
177 enum image_type get_tegra_image_type(void);