From 0d0169db280f0bec85d273d35c6282f231b09c76 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 20 Aug 2015 14:54:15 +1000 Subject: device: simplify subdev construction Replaces the piece-by-piece (in response to NV_DEVICE ctor args) device contruction with a once-off all-or-nothing approach, eliminating some tricky refcounting issues. The partial device init capability was only required by some tools, and has been moved to probe time instead. Temporarily removes a workaround for some boards where we need to fiddle with AGP registers before executing the DEVINIT scripts. A later commit in this series reinstates it. Signed-off-by: Ben Skeggs --- bin/util.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/util.h b/bin/util.h index 2b07e5e79..af6feac44 100644 --- a/bin/util.h +++ b/bin/util.h @@ -5,6 +5,8 @@ #include +#include "../lib/priv.h" + #define U_GETOPT "a:b:c:d:" static const char *u_drv; @@ -31,6 +33,9 @@ u_client(const char *drv, const char *name, const char *dbg, bool detect, bool mmio, u64 subdev, struct nvif_client **pclient) { + os_device_detect = detect; + os_device_mmio = mmio; + os_device_subdev = subdev; return nvif_client_new(u_drv ? u_drv : drv, name, u_dev, u_cfg, u_dbg ? u_dbg : dbg, pclient); } @@ -46,13 +51,6 @@ u_device(const char *drv, const char *name, const char *dbg, ret = nvif_device_new(client->object, handle, NV_DEVICE, &(struct nv_device_v0) { .device = ~0ULL, - .disable = ~( - (detect ? NV_DEVICE_V0_DISABLE_IDENTIFY : 0) | - ( mmio ? NV_DEVICE_V0_DISABLE_MMIO : 0) | - ((subdev & (1ULL << NVDEV_SUBDEV_VBIOS)) ? - NV_DEVICE_V0_DISABLE_VBIOS : 0) | - (subdev ? NV_DEVICE_V0_DISABLE_CORE : 0)), - .debug0 = ~subdev, }, sizeof(struct nv_device_v0), pdevice); nvif_client_ref(NULL, &client); -- cgit v1.2.1