diff options
Diffstat (limited to 'arch/arm/mach-tegra/board.h')
-rw-r--r-- | arch/arm/mach-tegra/board.h | 136 |
1 files changed, 135 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h index 1d14df7eb7d..6d5a93cee6b 100644 --- a/arch/arm/mach-tegra/board.h +++ b/arch/arm/mach-tegra/board.h | |||
@@ -2,6 +2,7 @@ | |||
2 | * arch/arm/mach-tegra/board.h | 2 | * arch/arm/mach-tegra/board.h |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Google, Inc. | 4 | * Copyright (C) 2010 Google, Inc. |
5 | * Copyright (C) 2011-2012 NVIDIA Corporation. | ||
5 | * | 6 | * |
6 | * Author: | 7 | * Author: |
7 | * Colin Cross <ccross@google.com> | 8 | * Colin Cross <ccross@google.com> |
@@ -22,14 +23,147 @@ | |||
22 | #define __MACH_TEGRA_BOARD_H | 23 | #define __MACH_TEGRA_BOARD_H |
23 | 24 | ||
24 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | #include <linux/power_supply.h> | ||
27 | |||
28 | #define ADD_FIXED_VOLTAGE_REG(_name) (&_name##_fixed_voltage_device) | ||
29 | |||
30 | /* Macro for defining fixed voltage regulator */ | ||
31 | #define FIXED_VOLTAGE_REG_INIT(_id, _name, _microvolts, _gpio, \ | ||
32 | _startup_delay, _enable_high, _enabled_at_boot, \ | ||
33 | _valid_ops_mask, _always_on) \ | ||
34 | static struct regulator_init_data _name##_initdata = { \ | ||
35 | .consumer_supplies = _name##_consumer_supply, \ | ||
36 | .num_consumer_supplies = \ | ||
37 | ARRAY_SIZE(_name##_consumer_supply), \ | ||
38 | .constraints = { \ | ||
39 | .valid_ops_mask = _valid_ops_mask , \ | ||
40 | .always_on = _always_on, \ | ||
41 | }, \ | ||
42 | }; \ | ||
43 | static struct fixed_voltage_config _name##_config = { \ | ||
44 | .supply_name = #_name, \ | ||
45 | .microvolts = _microvolts, \ | ||
46 | .gpio = _gpio, \ | ||
47 | .startup_delay = _startup_delay, \ | ||
48 | .enable_high = _enable_high, \ | ||
49 | .enabled_at_boot = _enabled_at_boot, \ | ||
50 | .init_data = &_name##_initdata, \ | ||
51 | }; \ | ||
52 | static struct platform_device _name##_fixed_voltage_device = { \ | ||
53 | .name = "reg-fixed-voltage", \ | ||
54 | .id = _id, \ | ||
55 | .dev = { \ | ||
56 | .platform_data = &_name##_config, \ | ||
57 | }, \ | ||
58 | } | ||
59 | |||
60 | #if defined(CONFIG_TEGRA_NVMAP) | ||
61 | #define NVMAP_HEAP_CARVEOUT_IRAM_INIT \ | ||
62 | { .name = "iram", \ | ||
63 | .usage_mask = NVMAP_HEAP_CARVEOUT_IRAM, \ | ||
64 | .base = TEGRA_IRAM_BASE + TEGRA_RESET_HANDLER_SIZE, \ | ||
65 | .size = TEGRA_IRAM_SIZE - TEGRA_RESET_HANDLER_SIZE, \ | ||
66 | .buddy_size = 0, /* no buddy allocation for IRAM */ \ | ||
67 | } | ||
68 | #endif | ||
69 | |||
70 | struct memory_accessor; | ||
25 | 71 | ||
26 | void tegra_assert_system_reset(char mode, const char *cmd); | 72 | void tegra_assert_system_reset(char mode, const char *cmd); |
73 | void get_mac_addr(struct memory_accessor *, void *); | ||
27 | 74 | ||
28 | void __init tegra_init_early(void); | 75 | void __init tegra_init_early(void); |
76 | void __init tegra_mc_init(void); | ||
29 | void __init tegra_map_common_io(void); | 77 | void __init tegra_map_common_io(void); |
30 | void __init tegra_init_irq(void); | 78 | void __init tegra_init_irq(void); |
31 | void __init tegra_init_clock(void); | 79 | void __init tegra_init_clock(void); |
32 | int __init tegra_pcie_init(bool init_port0, bool init_port1); | 80 | void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size, |
81 | unsigned long fb2_size); | ||
82 | /* FIXME: The following needs to move common.h when arm_soc_desc is | ||
83 | introduced in a future version of the kernel */ | ||
84 | #ifdef CONFIG_CACHE_L2X0 | ||
85 | void tegra_init_cache(bool init); | ||
86 | #else | ||
87 | static inline void tegra_init_cache(bool init) {} | ||
88 | #endif | ||
89 | void __init tegra_ram_console_debug_reserve(unsigned long ram_console_size); | ||
90 | void __init tegra_ram_console_debug_init(void); | ||
91 | void __init tegra_release_bootloader_fb(void); | ||
92 | void __init tegra_protected_aperture_init(unsigned long aperture); | ||
93 | int __init tegra_init_board_info(void); | ||
94 | void tegra_move_framebuffer(unsigned long to, unsigned long from, | ||
95 | unsigned long size); | ||
96 | bool is_tegra_debug_uartport_hs(void); | ||
97 | int get_tegra_uart_debug_port_id(void); | ||
98 | int arb_lost_recovery(int scl_gpio, int sda_gpio); | ||
99 | |||
100 | extern unsigned long tegra_bootloader_fb_start; | ||
101 | extern unsigned long tegra_bootloader_fb_size; | ||
102 | extern unsigned long tegra_fb_start; | ||
103 | extern unsigned long tegra_fb_size; | ||
104 | extern unsigned long tegra_fb2_start; | ||
105 | extern unsigned long tegra_fb2_size; | ||
106 | extern unsigned long tegra_carveout_start; | ||
107 | extern unsigned long tegra_carveout_size; | ||
108 | extern unsigned long tegra_vpr_start; | ||
109 | extern unsigned long tegra_vpr_size; | ||
110 | extern unsigned long tegra_lp0_vec_start; | ||
111 | extern unsigned long tegra_lp0_vec_size; | ||
112 | extern bool tegra_lp0_vec_relocate; | ||
113 | extern unsigned long tegra_grhost_aperture; | ||
33 | 114 | ||
34 | extern struct sys_timer tegra_timer; | 115 | extern struct sys_timer tegra_timer; |
116 | |||
117 | enum board_fab { | ||
118 | BOARD_FAB_A = 0, | ||
119 | BOARD_FAB_B, | ||
120 | BOARD_FAB_C, | ||
121 | BOARD_FAB_D, | ||
122 | }; | ||
123 | |||
124 | struct board_info { | ||
125 | u16 board_id; | ||
126 | u16 sku; | ||
127 | u8 fab; | ||
128 | u8 major_revision; | ||
129 | u8 minor_revision; | ||
130 | }; | ||
131 | |||
132 | enum panel_type { | ||
133 | panel_type_lvds = 0, | ||
134 | panel_type_dsi, | ||
135 | }; | ||
136 | |||
137 | enum audio_codec_type { | ||
138 | audio_codec_none, | ||
139 | audio_codec_wm8903, | ||
140 | }; | ||
141 | |||
142 | enum image_type { | ||
143 | system_image = 0, | ||
144 | rck_image, | ||
145 | }; | ||
146 | |||
147 | void tegra_get_board_info(struct board_info *); | ||
148 | void tegra_get_pmu_board_info(struct board_info *bi); | ||
149 | void tegra_get_display_board_info(struct board_info *bi); | ||
150 | void tegra_get_camera_board_info(struct board_info *bi); | ||
151 | #ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND | ||
152 | #define SET_CONSERVATIVE_GOVERNOR_UP_THRESHOLD 95 | ||
153 | #define SET_CONSERVATIVE_GOVERNOR_DOWN_THRESHOLD 50 | ||
154 | #define SET_CONSERVATIVE_GOVERNOR_FREQ_STEP 3 | ||
155 | |||
156 | void cpufreq_save_default_governor(void); | ||
157 | void cpufreq_restore_default_governor(void); | ||
158 | void cpufreq_set_conservative_governor(void); | ||
159 | void cpufreq_set_conservative_governor_param(char *name, int value); | ||
160 | #endif | ||
161 | int get_core_edp(void); | ||
162 | enum panel_type get_panel_type(void); | ||
163 | int tegra_get_modem_id(void); | ||
164 | enum power_supply_type get_power_supply_type(void); | ||
165 | enum audio_codec_type get_audio_codec_type(void); | ||
166 | int get_maximum_cpu_current_supported(void); | ||
167 | enum image_type get_tegra_image_type(void); | ||
168 | |||
35 | #endif | 169 | #endif |