diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2016-05-20 02:12:23 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-06-08 15:05:05 -0400 |
commit | d215bc1107a8a032d18e515e55d5e29c7192f15e (patch) | |
tree | 2873d7d453cd727d7ee865b9f73408be3ec92539 /drivers/gpu/nvgpu/gm206/hw_fbpa_gm206.h | |
parent | 2219f38727ffa17291e15c1898bd3e65f43d09fd (diff) |
gpu: nvgpu: detect vidmem configuration from HW
Read video memory size from hardware during initialization for devices
that support it.
JIRA DNVGPU-14
Change-Id: If190f2d89f7148520ee274ca674f972987c8056d
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1157215
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm206/hw_fbpa_gm206.h')
-rw-r--r-- | drivers/gpu/nvgpu/gm206/hw_fbpa_gm206.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gm206/hw_fbpa_gm206.h b/drivers/gpu/nvgpu/gm206/hw_fbpa_gm206.h new file mode 100644 index 00000000..3a1d1981 --- /dev/null +++ b/drivers/gpu/nvgpu/gm206/hw_fbpa_gm206.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | /* | ||
17 | * Function naming determines intended use: | ||
18 | * | ||
19 | * <x>_r(void) : Returns the offset for register <x>. | ||
20 | * | ||
21 | * <x>_o(void) : Returns the offset for element <x>. | ||
22 | * | ||
23 | * <x>_w(void) : Returns the word offset for word (4 byte) element <x>. | ||
24 | * | ||
25 | * <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits. | ||
26 | * | ||
27 | * <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted | ||
28 | * and masked to place it at field <y> of register <x>. This value | ||
29 | * can be |'d with others to produce a full register value for | ||
30 | * register <x>. | ||
31 | * | ||
32 | * <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This | ||
33 | * value can be ~'d and then &'d to clear the value of field <y> for | ||
34 | * register <x>. | ||
35 | * | ||
36 | * <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted | ||
37 | * to place it at field <y> of register <x>. This value can be |'d | ||
38 | * with others to produce a full register value for <x>. | ||
39 | * | ||
40 | * <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register | ||
41 | * <x> value 'r' after being shifted to place its LSB at bit 0. | ||
42 | * This value is suitable for direct comparison with other unshifted | ||
43 | * values appropriate for use in field <y> of register <x>. | ||
44 | * | ||
45 | * <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for | ||
46 | * field <y> of register <x>. This value is suitable for direct | ||
47 | * comparison with unshifted values appropriate for use in field <y> | ||
48 | * of register <x>. | ||
49 | */ | ||
50 | #ifndef _hw_fbpa_gp106_h_ | ||
51 | #define _hw_fbpa_gp106_h_ | ||
52 | |||
53 | static inline u32 fbpa_cstatus_r(void) | ||
54 | { | ||
55 | return 0x0010f20c; | ||
56 | } | ||
57 | static inline u32 fbpa_cstatus_ramamount_v(u32 r) | ||
58 | { | ||
59 | return (r >> 0) & 0x1ffff; | ||
60 | } | ||
61 | #endif | ||