diff --git a/drivers/gpu/nvgpu/libnvgpu-drv_safe.export b/drivers/gpu/nvgpu/libnvgpu-drv_safe.export index c10d66f29..8a9e545c7 100644 --- a/drivers/gpu/nvgpu/libnvgpu-drv_safe.export +++ b/drivers/gpu/nvgpu/libnvgpu-drv_safe.export @@ -91,6 +91,8 @@ nvgpu_gr_config_get_sm_info_sm_index nvgpu_gr_config_set_gpc_tpc_mask nvgpu_gr_config_get_gpc_tpc_mask nvgpu_can_busy +nvgpu_gr_prepare_sw +nvgpu_gr_enable_hw nvgpu_channel_alloc_inst nvgpu_channel_cleanup_sw nvgpu_channel_close diff --git a/userspace/install-unit.sh b/userspace/install-unit.sh index 6a28b889f..be2a59b8c 100755 --- a/userspace/install-unit.sh +++ b/userspace/install-unit.sh @@ -103,6 +103,7 @@ fi # Building the necessary directory structure. It may not be present # first time this is run. ssh $target mkdir -p nvgpu_unit/units +ssh $target mkdir -p nvgpu_unit/firmware ssh $target mkdir -p $TOP/kernel if [ $? != 0 ]; then echo @@ -121,6 +122,7 @@ jcp $TOP/kernel/nvgpu/userspace/gcov.sh nvgpu_unit/gcov.sh jcp $TOP/kernel/nvgpu/userspace/testlist.py nvgpu_unit/testlist.py jcp $TOP/kernel/nvgpu/userspace/required_tests.json \ nvgpu_unit/required_tests.json +jcp $TOP/kernel/nvgpu/userspace/firmware/ nvgpu_unit/firmware/ find $nvgpu_bins/userspace/units -name "*.so" -not -path "*unit.so" \ -not -path "*drv.so" -exec ls {} \; | while read unit_so ; do diff --git a/userspace/units/gr/config/nvgpu-gr-config.c b/userspace/units/gr/config/nvgpu-gr-config.c index f9f5528c4..ffcae8010 100644 --- a/userspace/units/gr/config/nvgpu-gr-config.c +++ b/userspace/units/gr/config/nvgpu-gr-config.c @@ -291,6 +291,7 @@ set_get_fail: struct unit_module_test nvgpu_gr_config_tests[] = { UNIT_TEST(init_support, test_gr_init_support, NULL, 0), + UNIT_TEST(init_prepare, test_gr_init_prepare, NULL, 0), UNIT_TEST(config_init, test_gr_config_init, NULL, 0), UNIT_TEST(config_check_init, test_gr_config_count, NULL, 0), UNIT_TEST(config_check_set_get, test_gr_config_set_get, NULL, 0), diff --git a/userspace/units/gr/libnvgpu-gr.export b/userspace/units/gr/libnvgpu-gr.export index aed6e7b85..f11302967 100644 --- a/userspace/units/gr/libnvgpu-gr.export +++ b/userspace/units/gr/libnvgpu-gr.export @@ -22,4 +22,5 @@ test_gr_init_support test_gr_remove_support +test_gr_init_prepare diff --git a/userspace/units/gr/nvgpu-gr-gv11b-regs.h b/userspace/units/gr/nvgpu-gr-gv11b-regs.h index 7632570cd..d06ac1f40 100644 --- a/userspace/units/gr/nvgpu-gr-gv11b-regs.h +++ b/userspace/units/gr/nvgpu-gr-gv11b-regs.h @@ -2980,6 +2980,275 @@ u32 gv11b_gr_regs[] = { /* 0x00409200 */ 0x00000000, 0x00000000, 0x00000000, 0x87000484, /* 0x00409210 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, /* 0x00409220 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409230 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409240 */ 0x00007021, 0x40000000, 0x00000000, 0x00000000, +/* 0x00409250 */ 0x00000000, 0x000001ff, 0x00000000, 0x00000000, +/* 0x00409260 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409270 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409280 */ 0x00000067, 0x00000067, 0x00000067, 0x00000067, +/* 0x00409290 */ 0x00000077, 0x00000077, 0x00000047, 0x00000077, +/* 0x004092a0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004092b0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004092c0 */ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* 0x004092d0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004092e0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004092f0 */ 0x00000000, 0x00010022, 0x00000000, 0x00000000, +/* 0x00409300 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409310 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409320 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409330 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409340 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409350 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409360 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409370 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409380 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409390 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004093a0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004093b0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004093c0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004093d0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004093e0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004093f0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409400 */ 0x00000180, 0x00002003, 0x00000000, 0x00000001, +/* 0x00409410 */ 0x00000001, 0x00000001, 0x00000000, 0x00000000, +/* 0x00409420 */ 0x0000000f, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409430 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409440 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409450 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409460 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409470 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409480 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409490 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004094a0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004094b0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004094c0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004094d0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004094e0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004094f0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409500 */ 0xb04628f6, 0x00000000, 0x00000000, 0x800a4300, +/* 0x00409510 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409520 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409530 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409540 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409550 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409560 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409570 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409580 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409590 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004095a0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004095b0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004095c0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004095d0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004095e0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004095f0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409600 */ 0x00000000, 0x02010001, 0x00000000, 0x00000000, +/* 0x00409610 */ 0x00000000, 0x00000770, 0x00000000, 0x00000000, +/* 0x00409620 */ 0x00002080, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409630 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409640 */ 0xfffffe00, 0x00000000, 0x00000000, 0x000000ff, +/* 0x00409650 */ 0x0000008f, 0x00000080, 0x00100010, 0x00040000, +/* 0x00409660 */ 0xff8ff100, 0x00000100, 0x00000000, 0x00000000, +/* 0x00409670 */ 0x0000008f, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409680 */ 0x00000000, 0x00001400, 0x000000ff, 0x00000000, +/* 0x00409690 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004096a0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004096b0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004096c0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004096d0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004096e0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004096f0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409700 */ 0x00000003, 0x00000003, 0x00000007, 0x00000020, +/* 0x00409710 */ 0x00000000, 0x20001010, 0x00000000, 0x00000000, +/* 0x00409720 */ 0x00000000, 0x00000000, 0x74404170, 0x00000000, +/* 0x00409730 */ 0x00000010, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409740 */ 0x00000501, 0x00000000, 0x00000130, 0x00000130, +/* 0x00409750 */ 0x00000000, 0x80325006, 0x1e011060, 0x00000000, +/* 0x00409760 */ 0x000000ef, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409770 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409780 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409790 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004097a0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004097b0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004097c0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004097d0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004097e0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004097f0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409800 */ 0x00000001, 0x00000000, 0x00000001, 0x00000000, +/* 0x00409810 */ 0x001ffda0, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409820 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409830 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409840 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409850 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409860 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409870 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409880 */ 0x00000009, 0x0003ffff, 0x00000000, 0x00000000, +/* 0x00409890 */ 0x00000000, 0x0000fffe, 0x49a40a0a, 0xff053977, +/* 0x004098a0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004098b0 */ 0x00000000, 0x00000000, 0x00100002, 0x00000000, +/* 0x004098c0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004098d0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004098e0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004098f0 */ 0x00000000, 0x00000000, 0x00000008, 0x00000008, +/* 0x00409900 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409910 */ 0x000008a9, 0x00000501, 0x00000000, 0x00000000, +/* 0x00409920 */ 0x803f0041, 0x0000000d, 0x00000000, 0x0000002a, +/* 0x00409930 */ 0x0000002c, 0x000008a9, 0x00000000, 0x00000003, +/* 0x00409940 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409950 */ 0x000000cf, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409960 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409970 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409980 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409990 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004099a0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004099b0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004099c0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004099d0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004099e0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x004099f0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409a00 */ 0x00000018, 0x1f004400, 0x00000501, 0x304628f6, +/* 0x00409a10 */ 0x00000000, 0x00000100, 0x00000001, 0x00000002, +/* 0x00409a20 */ 0x00000000, 0x00000000, 0x000000cf, 0x00000000, +/* 0x00409a30 */ 0x00000045, 0x33333333, 0x00000000, 0x00000000, +/* 0x00409a40 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409a50 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409a60 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409a70 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409a80 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409a90 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409aa0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409ab0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409ac0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409ad0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409ae0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409af0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409b00 */ 0x304628f6, 0x304628f6, 0x00000000, 0x00000000, +/* 0x00409b10 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409b20 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409b30 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409b40 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409b50 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409b60 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409b70 */ 0x00000000, 0x00100002, 0x00000000, 0x00000000, +/* 0x00409b80 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409b90 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409ba0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409bb0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409bc0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409bd0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409be0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409bf0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409c00 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409c10 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409c20 */ 0x00000000, 0x00002020, 0x00000000, 0x00000000, +/* 0x00409c30 */ 0x00000000, 0x007f0003, 0x00000000, 0x00000000, +/* 0x00409c40 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409c50 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409c60 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409c70 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409c80 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409c90 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409ca0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409cb0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409cc0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409cd0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409ce0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409cf0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409d00 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409d10 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409d20 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409d30 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409d40 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409d50 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409d60 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409d70 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409d80 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409d90 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409da0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409db0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409dc0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409dd0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409de0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409df0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409e00 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409e10 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409e20 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409e30 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409e40 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409e50 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409e60 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409e70 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409e80 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409e90 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409ea0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409eb0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409ec0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409ed0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409ee0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409ef0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409f00 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409f10 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409f20 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409f30 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409f40 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409f50 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409f60 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409f70 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409f80 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409f90 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409fa0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409fb0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409fc0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409fd0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409fe0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x00409ff0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a000 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a010 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a020 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a030 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a040 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a050 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a060 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a070 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a080 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a090 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a0a0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a0b0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a0c0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a0d0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a0e0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a0f0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a100 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a110 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a120 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a130 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a140 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a150 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a160 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a170 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a180 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a190 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a1a0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a1b0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a1c0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a1d0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a1e0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a1f0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a200 */ 0x0000000f, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a210 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a220 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a230 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a240 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a250 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a260 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a270 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a280 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a290 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a2a0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a2b0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a2c0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a2d0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a2e0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* 0x0040a2f0 */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; struct nvgpu_posix_io_reg_space gv11b_gr_reg_space = { diff --git a/userspace/units/gr/nvgpu-gr-gv11b.c b/userspace/units/gr/nvgpu-gr-gv11b.c index df042b633..66c762962 100644 --- a/userspace/units/gr/nvgpu-gr-gv11b.c +++ b/userspace/units/gr/nvgpu-gr-gv11b.c @@ -39,6 +39,8 @@ #include "nvgpu-gr-gv11b.h" #include "nvgpu-gr-gv11b-regs.h" +#define NV_PBB_FBHUB_REGSPACE 0x100B00 +#define NV_PRI_GPCCS_PPCS_PES_VSC_VPC_REGSPACE 0x41BE04 /* * Mock I/O */ @@ -132,6 +134,56 @@ int test_gr_setup_gv11b_reg_space(struct unit_module *m, struct gk20a *g) goto clean_up_pes_tpc_mask; } + /* + * GPCS_SWDX reg space + * + */ + if (nvgpu_posix_io_add_reg_space(g, + gr_gpcs_swdx_dss_zbc_color_r_r(0), 0xEFF) != 0) { + unit_err(m, "Add gpcs swdx reg space failed!\n"); + goto clean_up_fs_space; + } + + /* + * PRI_GPCS_GCC reg space + * + */ + if (nvgpu_posix_io_add_reg_space(g, + gr_pri_gpcs_gcc_dbg_r(), 0x60) != 0) { + unit_err(m, "Add gpcs gcc dbg reg space failed!\n"); + goto clean_up_swdx_space; + } + + /* + * PRI_GPCS_TPCS reg space + * + */ + if (nvgpu_posix_io_add_reg_space(g, + gr_gpcs_tpcs_pe_vaf_r(), 0x9FF) != 0) { + unit_err(m, "Add tpcs pe reg space failed!\n"); + goto clean_up_gcc_space; + } + + /* + * PRI_GPCS_PPCS reg space + * + */ + if (nvgpu_posix_io_add_reg_space(g, + NV_PRI_GPCCS_PPCS_PES_VSC_VPC_REGSPACE, 0x1FF) != 0) { + unit_err(m, "Add gpcs ppcs pes reg space failed!\n"); + goto clean_up_gcc_tpcs_space; + } + + /* + * FB partition reg space + * + */ + if (nvgpu_posix_io_add_reg_space(g, + NV_PBB_FBHUB_REGSPACE, 0x1FF) != 0) { + unit_err(m, "Add fbhub reg space failed!\n"); + goto clean_up_gcc_ppcs_space; + } + /* * MC register mc_enable_r() is set during gr_init_prepare_hw hence * add it to reg space @@ -139,13 +191,25 @@ int test_gr_setup_gv11b_reg_space(struct unit_module *m, struct gk20a *g) if (nvgpu_posix_io_add_reg_space(g, mc_enable_r(), 0x4) != 0) { unit_err(m, "Add mc enable reg space failed!\n"); - goto clean_up_priv_ring; + goto clean_up_fbhub_space; } (void)nvgpu_posix_register_io(g, &gr_test_reg_callbacks); return 0; +clean_up_fbhub_space: + nvgpu_posix_io_delete_reg_space(g, NV_PBB_FBHUB_REGSPACE); +clean_up_gcc_ppcs_space: + nvgpu_posix_io_delete_reg_space(g, gr_gpcs_tpcs_pes_vsc_vpc_r()); +clean_up_gcc_tpcs_space: + nvgpu_posix_io_delete_reg_space(g, gr_gpcs_tpcs_pe_vaf_r()); +clean_up_gcc_space: + nvgpu_posix_io_delete_reg_space(g, gr_pri_gpcs_gcc_dbg_r()); +clean_up_swdx_space: + nvgpu_posix_io_delete_reg_space(g, gr_gpcs_swdx_dss_zbc_color_r_r(0)); +clean_up_fs_space: + nvgpu_posix_io_unregister_reg_space(g, &gv11b_gr_fs_reg_space); clean_up_pes_tpc_mask: nvgpu_posix_io_unregister_reg_space(g, &gv11b_gr_pes_tpc_mask_reg_space); clean_up_priv_ring: @@ -164,6 +228,11 @@ clean_up_master: void test_gr_cleanup_gv11b_reg_space(struct unit_module *m, struct gk20a *g) { + nvgpu_posix_io_delete_reg_space(g, NV_PBB_FBHUB_REGSPACE); + nvgpu_posix_io_delete_reg_space(g, gr_gpcs_tpcs_pes_vsc_vpc_r()); + nvgpu_posix_io_delete_reg_space(g, gr_gpcs_tpcs_pe_vaf_r()); + nvgpu_posix_io_delete_reg_space(g, gr_pri_gpcs_gcc_dbg_r()); + nvgpu_posix_io_delete_reg_space(g, gr_gpcs_swdx_dss_zbc_color_r_r(0)); nvgpu_posix_io_unregister_reg_space(g, &gv11b_top_reg_space); nvgpu_posix_io_unregister_reg_space(g, &gv11b_master_reg_space); nvgpu_posix_io_unregister_reg_space(g, &gv11b_fuse_reg_space); diff --git a/userspace/units/gr/nvgpu-gr.c b/userspace/units/gr/nvgpu-gr.c index 44bc97365..cdc444d8f 100644 --- a/userspace/units/gr/nvgpu-gr.c +++ b/userspace/units/gr/nvgpu-gr.c @@ -61,9 +61,31 @@ fail: return UNIT_FAIL; } +int test_gr_init_prepare(struct unit_module *m, struct gk20a *g, void *args) +{ + int err; + + err = nvgpu_gr_prepare_sw(g); + if (err) { + goto prep_fail; + } + + err = nvgpu_gr_enable_hw(g); + if (err) { + goto prep_fail; + } + + return UNIT_SUCCESS; + +prep_fail: + return UNIT_FAIL; + +} + int test_gr_remove_support(struct unit_module *m, struct gk20a *g, void *args) { + test_gr_cleanup_gv11b_reg_space(m, g); nvgpu_gr_free(g); return UNIT_SUCCESS; diff --git a/userspace/units/gr/nvgpu-gr.h b/userspace/units/gr/nvgpu-gr.h index ab14a134f..965494a3b 100644 --- a/userspace/units/gr/nvgpu-gr.h +++ b/userspace/units/gr/nvgpu-gr.h @@ -39,5 +39,6 @@ int test_gr_init_support(struct unit_module *m, struct gk20a *g, void *args); int test_gr_remove_support(struct unit_module *m, struct gk20a *g, void *args); - +int test_gr_init_prepare(struct unit_module *m, + struct gk20a *g, void *args); #endif /* UNIT_NVGPU_GR_H */