diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-03-23 11:43:53 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-05-23 17:15:25 -0400 |
commit | fb64e1f1b9c2162f521dfe3956655accb911d6a7 (patch) | |
tree | 15236c00323c8d24102f5a1221f1b313d62bfac2 /drivers/gpu/nvgpu/gk20a | |
parent | c25e1da93e09a421b8c2b91df720d4bc603db378 (diff) |
gpu: nvgpu: Add support for gm204 and gm206
Add support for chips gm204 and gm206. Adds also support for reading
VBIOS and booting devinit and pre-os images on PMU.
Change-Id: I4824b44245611e5379ace62793cc37158048f432
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1120467
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ken Adams <kadams@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 43 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/hal.c | 11 |
3 files changed, 59 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 3ae30e88..3ab26fb9 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -792,6 +792,11 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
792 | if (err) | 792 | if (err) |
793 | goto done; | 793 | goto done; |
794 | 794 | ||
795 | if (g->ops.bios.init) | ||
796 | err = g->ops.bios.init(g); | ||
797 | if (err) | ||
798 | goto done; | ||
799 | |||
795 | if (!tegra_platform_is_silicon()) | 800 | if (!tegra_platform_is_silicon()) |
796 | gk20a_writel(g, bus_intr_en_0_r(), 0x0); | 801 | gk20a_writel(g, bus_intr_en_0_r(), 0x0); |
797 | else | 802 | else |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 49da164c..f5b4bb3f 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -592,6 +592,40 @@ struct gpu_ops { | |||
592 | 592 | ||
593 | int (*get_litter_value)(struct gk20a *g, enum nvgpu_litter_value value); | 593 | int (*get_litter_value)(struct gk20a *g, enum nvgpu_litter_value value); |
594 | int (*chip_init_gpu_characteristics)(struct gk20a *g); | 594 | int (*chip_init_gpu_characteristics)(struct gk20a *g); |
595 | |||
596 | struct { | ||
597 | int (*init)(struct gk20a *g); | ||
598 | } bios; | ||
599 | }; | ||
600 | |||
601 | struct nvgpu_bios_ucode { | ||
602 | u8 *bootloader; | ||
603 | u32 bootloader_phys_base; | ||
604 | u32 bootloader_size; | ||
605 | u8 *ucode; | ||
606 | u32 phys_base; | ||
607 | u32 size; | ||
608 | u8 *dmem; | ||
609 | u32 dmem_phys_base; | ||
610 | u32 dmem_size; | ||
611 | u32 code_entry_point; | ||
612 | }; | ||
613 | |||
614 | struct nvgpu_bios { | ||
615 | u8 *data; | ||
616 | |||
617 | struct nvgpu_bios_ucode devinit; | ||
618 | struct nvgpu_bios_ucode preos; | ||
619 | |||
620 | u8 *devinit_tables; | ||
621 | u32 devinit_tables_size; | ||
622 | u8 *bootscripts; | ||
623 | u32 bootscripts_size; | ||
624 | |||
625 | u32 devinit_tables_phys_base; | ||
626 | u32 devinit_script_phys_base; | ||
627 | |||
628 | u32 expansion_rom_offset; | ||
595 | }; | 629 | }; |
596 | 630 | ||
597 | struct gk20a { | 631 | struct gk20a { |
@@ -763,6 +797,9 @@ struct gk20a { | |||
763 | bool mmu_debug_ctrl; | 797 | bool mmu_debug_ctrl; |
764 | 798 | ||
765 | u32 tpc_fs_mask_user; | 799 | u32 tpc_fs_mask_user; |
800 | |||
801 | struct nvgpu_bios bios; | ||
802 | struct debugfs_blob_wrapper bios_blob; | ||
766 | }; | 803 | }; |
767 | 804 | ||
768 | static inline unsigned long gk20a_get_gr_idle_timeout(struct gk20a *g) | 805 | static inline unsigned long gk20a_get_gr_idle_timeout(struct gk20a *g) |
@@ -1020,6 +1057,12 @@ gk20a_request_firmware(struct gk20a *g, const char *fw_name); | |||
1020 | #define GK20A_GPUID_GM20B \ | 1057 | #define GK20A_GPUID_GM20B \ |
1021 | GK20A_GPUID(NVGPU_GPU_ARCH_GM200, NVGPU_GPU_IMPL_GM20B) | 1058 | GK20A_GPUID(NVGPU_GPU_ARCH_GM200, NVGPU_GPU_IMPL_GM20B) |
1022 | 1059 | ||
1060 | #define GK20A_GPUID_GM204 \ | ||
1061 | GK20A_GPUID(NVGPU_GPU_ARCH_GM200, NVGPU_GPU_IMPL_GM204) | ||
1062 | |||
1063 | #define GK20A_GPUID_GM206 \ | ||
1064 | GK20A_GPUID(NVGPU_GPU_ARCH_GM200, NVGPU_GPU_IMPL_GM206) | ||
1065 | |||
1023 | int gk20a_init_gpu_characteristics(struct gk20a *g); | 1066 | int gk20a_init_gpu_characteristics(struct gk20a *g); |
1024 | 1067 | ||
1025 | void gk20a_pbus_isr(struct gk20a *g); | 1068 | void gk20a_pbus_isr(struct gk20a *g); |
diff --git a/drivers/gpu/nvgpu/gk20a/hal.c b/drivers/gpu/nvgpu/gk20a/hal.c index 16ba4a03..52ec108b 100644 --- a/drivers/gpu/nvgpu/gk20a/hal.c +++ b/drivers/gpu/nvgpu/gk20a/hal.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include "gk20a.h" | 16 | #include "gk20a.h" |
17 | #include "hal_gk20a.h" | 17 | #include "hal_gk20a.h" |
18 | #include "gm20b/hal_gm20b.h" | 18 | #include "gm20b/hal_gm20b.h" |
19 | #include "gm206/hal_gm206.h" | ||
19 | 20 | ||
20 | #ifdef CONFIG_ARCH_TEGRA_18x_SOC | 21 | #ifdef CONFIG_ARCH_TEGRA_18x_SOC |
21 | #include "nvgpu_gpuid_t18x.h" | 22 | #include "nvgpu_gpuid_t18x.h" |
@@ -38,11 +39,21 @@ int gpu_init_hal(struct gk20a *g) | |||
38 | if (gm20b_init_hal(g)) | 39 | if (gm20b_init_hal(g)) |
39 | return -ENODEV; | 40 | return -ENODEV; |
40 | break; | 41 | break; |
42 | case GK20A_GPUID_GM204: | ||
43 | case GK20A_GPUID_GM206: | ||
44 | gk20a_dbg_info("gm20x detected"); | ||
45 | if (gm206_init_hal(g)) | ||
46 | return -ENODEV; | ||
47 | break; | ||
41 | #if defined(CONFIG_ARCH_TEGRA_18x_SOC) | 48 | #if defined(CONFIG_ARCH_TEGRA_18x_SOC) |
42 | case TEGRA_18x_GPUID: | 49 | case TEGRA_18x_GPUID: |
43 | if (TEGRA_18x_GPUID_HAL(g)) | 50 | if (TEGRA_18x_GPUID_HAL(g)) |
44 | return -ENODEV; | 51 | return -ENODEV; |
45 | break; | 52 | break; |
53 | case TEGRA_18x_GPUID2: | ||
54 | if (TEGRA_18x_GPUID2_HAL(g)) | ||
55 | return -ENODEV; | ||
56 | break; | ||
46 | #endif | 57 | #endif |
47 | #if defined(CONFIG_ARCH_TEGRA_19x_SOC) | 58 | #if defined(CONFIG_ARCH_TEGRA_19x_SOC) |
48 | case TEGRA_19x_GPUID: | 59 | case TEGRA_19x_GPUID: |