gpu: nvgpu: t23x: init hal for nvgpu-next

Add hooks for nvgpu-next init hal.

JIRA NVGPU-4383

Change-Id: Ia899878743bca35d911c74444749f254ba94bbe0
Signed-off-by: seshendra <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2243694
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
seshendra
2018-12-11 12:38:59 -08:00
committed by Alex Waterman
parent c7fa4109a8
commit 4ce4cdcd0f
3 changed files with 27 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
/* /*
* NVIDIA GPU HAL interface. * NVIDIA GPU HAL interface.
* *
* Copyright (c) 2014-2019, NVIDIA CORPORATION. All rights reserved. * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"), * copy of this software and associated documentation files (the "Software"),
@@ -36,6 +36,10 @@
#include "hal_tu104.h" #include "hal_tu104.h"
#endif #endif
#if defined(CONFIG_NVGPU_HAL_NON_FUSA) && defined(CONFIG_NVGPU_NEXT)
#include "nvgpu_next_gpuid.h"
#endif
#include "hal/mc/mc_gm20b.h" #include "hal/mc/mc_gm20b.h"
int nvgpu_init_hal(struct gk20a *g) int nvgpu_init_hal(struct gk20a *g)
@@ -62,6 +66,13 @@ int nvgpu_init_hal(struct gk20a *g)
return -ENODEV; return -ENODEV;
} }
break; break;
#if defined(CONFIG_NVGPU_NEXT)
case NVGPU_NEXT_GPUID:
if (NVGPU_NEXT_INIT_HAL(g) != 0) {
return -ENODEV;
}
break;
#endif
#endif #endif
case NVGPU_GPUID_GV11B: case NVGPU_GPUID_GV11B:

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
# #
# Permission is hereby granted, free of charge, to any person obtaining a # Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"), # copy of this software and associated documentation files (the "Software"),
@@ -38,6 +38,8 @@ CORE_OUT=$(OUT)/nvgpu_unit_core
# Nvgpu driver code. # Nvgpu driver code.
NVGPU_SRC=$(TWD)/../drivers/gpu/nvgpu NVGPU_SRC=$(TWD)/../drivers/gpu/nvgpu
# Nvgpu-next driver code.
NVGPU_NEXT_SRC=$(TWD)/../../nvgpu-next/drivers/gpu/nvgpu
NVGPU_OUT=$(OUT)/libnvgpu NVGPU_OUT=$(OUT)/libnvgpu
# Unit tests themselves. # Unit tests themselves.
@@ -47,6 +49,8 @@ UNIT_OUT=$(OUT)/units
INCLUDES= \ INCLUDES= \
-I$(NVGPU_SRC) \ -I$(NVGPU_SRC) \
-I$(NVGPU_SRC)/include \ -I$(NVGPU_SRC)/include \
-I$(NVGPU_NEXT_SRC) \
-I$(NVGPU_NEXT_SRC)/include \
-I$(TWD)/../include \ -I$(TWD)/../include \
-I$(TWD)/../include/uapi \ -I$(TWD)/../include/uapi \
-I$(TWD)/include \ -I$(TWD)/include \
@@ -133,6 +137,14 @@ $(NVGPU_OUT)/%.o : $(NVGPU_SRC)/%.c $(HEADERS)
fi fi
$(CC) --coverage $(CFLAGS) -c -o $@ $< $(CC) --coverage $(CFLAGS) -c -o $@ $<
# Default build target for all the nvgpu-next driver object files we want to
# build in userspace. These too get bundled into libnvgpu-drv.so.
$(NVGPU_OUT)/%.o : $(NVGPU_NEXT_SRC)/%.c $(HEADERS) $(HEADERS_NEXT)
@if [ ! -d $(dir $@) ] ; then \
mkdir -p $(dir $@) ; \
fi
$(CC) --coverage $(CFLAGS) $(configs) -c -o $@ $<
# Build target for unit test files. These are not part of the libnvgpu-drv.so. # Build target for unit test files. These are not part of the libnvgpu-drv.so.
# These comprise the unit test framework. # These comprise the unit test framework.
$(CORE_OUT)/%.o : $(CORE_SRC)/%.c $(CORE_HEADERS) $(CORE_OUT)/%.o : $(CORE_SRC)/%.c $(CORE_HEADERS)

View File

@@ -21,8 +21,9 @@
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
include $(NVGPU_SRC)/Makefile.sources include $(NVGPU_SRC)/Makefile.sources
include $(NVGPU_NEXT_SRC)/Makefile.sources
OBJS := $(srcs:%.c=$(NVGPU_OUT)/%.o) OBJS := $(srcs:%.c=$(NVGPU_OUT)/%.o) $(srcs_next:%.c=$(NVGPU_OUT)/%.o)
HEADERS := \ HEADERS := \
$(NVGPU_SRC)/include/nvgpu/*.h \ $(NVGPU_SRC)/include/nvgpu/*.h \