diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2020-12-04 10:49:00 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2021-02-11 11:49:52 +1000 |
commit | e07f50d3558a83b5c92a7b768447a092a282472c (patch) | |
tree | 95036d6f5a9e22f513cfe3e9ccfe20bc980e586a | |
parent | 917b24a3c79bde07c763736e3c9ffa01f96f7050 (diff) | |
download | linux-stable-e07f50d3558a83b5c92a7b768447a092a282472c.tar.gz linux-stable-e07f50d3558a83b5c92a7b768447a092a282472c.tar.bz2 linux-stable-e07f50d3558a83b5c92a7b768447a092a282472c.zip |
drm/nouveau/bios: switch to instanced constructor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/core/device.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/core/layout.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/subdev/bios.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/core/subdev.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 171 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c | 5 |
6 files changed, 90 insertions, 92 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h index 7ef3d99f3939..b1872fa3b883 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h @@ -60,7 +60,6 @@ struct nvkm_device { struct notifier_block nb; } acpi; - struct nvkm_bios *bios; struct nvkm_bus *bus; struct nvkm_clk *clk; struct nvkm_devinit *devinit; @@ -146,7 +145,6 @@ struct nvkm_device_chip { #include <core/layout.h> #undef NVKM_LAYOUT_INST #undef NVKM_LAYOUT_ONCE - int (*bios )(struct nvkm_device *, int idx, struct nvkm_bios **); int (*bus )(struct nvkm_device *, int idx, struct nvkm_bus **); int (*clk )(struct nvkm_device *, int idx, struct nvkm_clk **); int (*devinit )(struct nvkm_device *, int idx, struct nvkm_devinit **); diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/layout.h b/drivers/gpu/drm/nouveau/include/nvkm/core/layout.h index dea9dd519881..73252f0ef604 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/layout.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/layout.h @@ -1,3 +1,4 @@ /* SPDX-License-Identifier: MIT */ +NVKM_LAYOUT_ONCE(NVKM_SUBDEV_VBIOS , struct nvkm_bios , bios) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_BAR , struct nvkm_bar , bar) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_ACR , struct nvkm_acr , acr) diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios.h index f2860f8e0c2e..b61cfb077533 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios.h @@ -30,5 +30,5 @@ u8 nvbios_rd08(struct nvkm_bios *, u32 addr); u16 nvbios_rd16(struct nvkm_bios *, u32 addr); u32 nvbios_rd32(struct nvkm_bios *, u32 addr); -int nvkm_bios_new(struct nvkm_device *, int, struct nvkm_bios **); +int nvkm_bios_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_bios **); #endif diff --git a/drivers/gpu/drm/nouveau/nvkm/core/subdev.c b/drivers/gpu/drm/nouveau/nvkm/core/subdev.c index f5e76986de4b..5e13e09baf29 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/subdev.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/subdev.c @@ -33,7 +33,6 @@ nvkm_subdev_type[NVKM_SUBDEV_NR] = { #include <core/layout.h> #undef NVKM_LAYOUT_ONCE #undef NVKM_LAYOUT_INST - [NVKM_SUBDEV_VBIOS ] = "bios", [NVKM_SUBDEV_BUS ] = "bus", [NVKM_SUBDEV_CLK ] = "clk", [NVKM_SUBDEV_DEVINIT ] = "devinit", diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c index b4f5e6c837f4..ff3539799750 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c @@ -71,13 +71,13 @@ nvkm_device_list(u64 *name, int size) static const struct nvkm_device_chip null_chipset = { .name = "NULL", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, }; static const struct nvkm_device_chip nv4_chipset = { .name = "NV04", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv04_devinit_new, @@ -98,7 +98,7 @@ nv4_chipset = { static const struct nvkm_device_chip nv5_chipset = { .name = "NV05", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv05_devinit_new, @@ -119,7 +119,7 @@ nv5_chipset = { static const struct nvkm_device_chip nv10_chipset = { .name = "NV10", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv10_devinit_new, @@ -139,7 +139,7 @@ nv10_chipset = { static const struct nvkm_device_chip nv11_chipset = { .name = "NV11", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv10_devinit_new, @@ -161,7 +161,7 @@ nv11_chipset = { static const struct nvkm_device_chip nv15_chipset = { .name = "NV15", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv10_devinit_new, @@ -183,7 +183,7 @@ nv15_chipset = { static const struct nvkm_device_chip nv17_chipset = { .name = "NV17", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv10_devinit_new, @@ -205,7 +205,7 @@ nv17_chipset = { static const struct nvkm_device_chip nv18_chipset = { .name = "NV18", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv10_devinit_new, @@ -227,7 +227,7 @@ nv18_chipset = { static const struct nvkm_device_chip nv1a_chipset = { .name = "nForce", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv1a_devinit_new, @@ -249,7 +249,7 @@ nv1a_chipset = { static const struct nvkm_device_chip nv1f_chipset = { .name = "nForce2", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv1a_devinit_new, @@ -271,7 +271,7 @@ nv1f_chipset = { static const struct nvkm_device_chip nv20_chipset = { .name = "NV20", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv20_devinit_new, @@ -293,7 +293,7 @@ nv20_chipset = { static const struct nvkm_device_chip nv25_chipset = { .name = "NV25", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv20_devinit_new, @@ -315,7 +315,7 @@ nv25_chipset = { static const struct nvkm_device_chip nv28_chipset = { .name = "NV28", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv20_devinit_new, @@ -337,7 +337,7 @@ nv28_chipset = { static const struct nvkm_device_chip nv2a_chipset = { .name = "NV2A", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv20_devinit_new, @@ -359,7 +359,7 @@ nv2a_chipset = { static const struct nvkm_device_chip nv30_chipset = { .name = "NV30", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv20_devinit_new, @@ -381,7 +381,7 @@ nv30_chipset = { static const struct nvkm_device_chip nv31_chipset = { .name = "NV31", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv04_clk_new, .devinit = nv20_devinit_new, @@ -404,7 +404,7 @@ nv31_chipset = { static const struct nvkm_device_chip nv34_chipset = { .name = "NV34", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv04_clk_new, .devinit = nv10_devinit_new, @@ -427,7 +427,7 @@ nv34_chipset = { static const struct nvkm_device_chip nv35_chipset = { .name = "NV35", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv04_bus_new, .clk = nv04_clk_new, .devinit = nv20_devinit_new, @@ -449,7 +449,7 @@ nv35_chipset = { static const struct nvkm_device_chip nv36_chipset = { .name = "NV36", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv04_clk_new, .devinit = nv20_devinit_new, @@ -472,7 +472,7 @@ nv36_chipset = { static const struct nvkm_device_chip nv40_chipset = { .name = "NV40", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -498,7 +498,7 @@ nv40_chipset = { static const struct nvkm_device_chip nv41_chipset = { .name = "NV41", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -524,7 +524,7 @@ nv41_chipset = { static const struct nvkm_device_chip nv42_chipset = { .name = "NV42", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -550,7 +550,7 @@ nv42_chipset = { static const struct nvkm_device_chip nv43_chipset = { .name = "NV43", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -576,7 +576,7 @@ nv43_chipset = { static const struct nvkm_device_chip nv44_chipset = { .name = "NV44", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -602,7 +602,7 @@ nv44_chipset = { static const struct nvkm_device_chip nv45_chipset = { .name = "NV45", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -628,7 +628,7 @@ nv45_chipset = { static const struct nvkm_device_chip nv46_chipset = { .name = "G72", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -654,7 +654,7 @@ nv46_chipset = { static const struct nvkm_device_chip nv47_chipset = { .name = "G70", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -680,7 +680,7 @@ nv47_chipset = { static const struct nvkm_device_chip nv49_chipset = { .name = "G71", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -706,7 +706,7 @@ nv49_chipset = { static const struct nvkm_device_chip nv4a_chipset = { .name = "NV44A", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -732,7 +732,7 @@ nv4a_chipset = { static const struct nvkm_device_chip nv4b_chipset = { .name = "G73", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -758,7 +758,7 @@ nv4b_chipset = { static const struct nvkm_device_chip nv4c_chipset = { .name = "C61", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -784,7 +784,7 @@ nv4c_chipset = { static const struct nvkm_device_chip nv4e_chipset = { .name = "C51", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -811,7 +811,7 @@ static const struct nvkm_device_chip nv50_chipset = { .name = "G80", .bar = { 0x00000001, nv50_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv50_bus_new, .clk = nv50_clk_new, .devinit = nv50_devinit_new, @@ -839,7 +839,7 @@ nv50_chipset = { static const struct nvkm_device_chip nv63_chipset = { .name = "C73", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -865,7 +865,7 @@ nv63_chipset = { static const struct nvkm_device_chip nv67_chipset = { .name = "C67", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -891,7 +891,7 @@ nv67_chipset = { static const struct nvkm_device_chip nv68_chipset = { .name = "C68", - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv31_bus_new, .clk = nv40_clk_new, .devinit = nv1a_devinit_new, @@ -918,7 +918,7 @@ static const struct nvkm_device_chip nv84_chipset = { .name = "G84", .bar = { 0x00000001, g84_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv50_bus_new, .clk = g84_clk_new, .devinit = g84_devinit_new, @@ -950,7 +950,7 @@ static const struct nvkm_device_chip nv86_chipset = { .name = "G86", .bar = { 0x00000001, g84_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv50_bus_new, .clk = g84_clk_new, .devinit = g84_devinit_new, @@ -982,7 +982,7 @@ static const struct nvkm_device_chip nv92_chipset = { .name = "G92", .bar = { 0x00000001, g84_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = nv50_bus_new, .clk = g84_clk_new, .devinit = g84_devinit_new, @@ -1014,7 +1014,7 @@ static const struct nvkm_device_chip nv94_chipset = { .name = "G94", .bar = { 0x00000001, g84_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = g94_bus_new, .clk = g84_clk_new, .devinit = g84_devinit_new, @@ -1046,7 +1046,7 @@ static const struct nvkm_device_chip nv96_chipset = { .name = "G96", .bar = { 0x00000001, g84_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = g94_bus_new, .clk = g84_clk_new, .devinit = g84_devinit_new, @@ -1078,7 +1078,7 @@ static const struct nvkm_device_chip nv98_chipset = { .name = "G98", .bar = { 0x00000001, g84_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = g94_bus_new, .clk = g84_clk_new, .devinit = g98_devinit_new, @@ -1110,7 +1110,7 @@ static const struct nvkm_device_chip nva0_chipset = { .name = "GT200", .bar = { 0x00000001, g84_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = g94_bus_new, .clk = g84_clk_new, .devinit = g84_devinit_new, @@ -1142,7 +1142,7 @@ static const struct nvkm_device_chip nva3_chipset = { .name = "GT215", .bar = { 0x00000001, g84_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = g94_bus_new, .clk = gt215_clk_new, .devinit = gt215_devinit_new, @@ -1176,7 +1176,7 @@ static const struct nvkm_device_chip nva5_chipset = { .name = "GT216", .bar = { 0x00000001, g84_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = g94_bus_new, .clk = gt215_clk_new, .devinit = gt215_devinit_new, @@ -1209,7 +1209,7 @@ static const struct nvkm_device_chip nva8_chipset = { .name = "GT218", .bar = { 0x00000001, g84_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = g94_bus_new, .clk = gt215_clk_new, .devinit = gt215_devinit_new, @@ -1242,7 +1242,7 @@ static const struct nvkm_device_chip nvaa_chipset = { .name = "MCP77/MCP78", .bar = { 0x00000001, g84_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = g94_bus_new, .clk = mcp77_clk_new, .devinit = g98_devinit_new, @@ -1274,7 +1274,7 @@ static const struct nvkm_device_chip nvac_chipset = { .name = "MCP79/MCP7A", .bar = { 0x00000001, g84_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = g94_bus_new, .clk = mcp77_clk_new, .devinit = g98_devinit_new, @@ -1306,7 +1306,7 @@ static const struct nvkm_device_chip nvaf_chipset = { .name = "MCP89", .bar = { 0x00000001, g84_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = g94_bus_new, .clk = gt215_clk_new, .devinit = mcp89_devinit_new, @@ -1339,7 +1339,7 @@ static const struct nvkm_device_chip nvc0_chipset = { .name = "GF100", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gf100_clk_new, .devinit = gf100_devinit_new, @@ -1376,7 +1376,7 @@ static const struct nvkm_device_chip nvc1_chipset = { .name = "GF108", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gf100_clk_new, .devinit = gf100_devinit_new, @@ -1412,7 +1412,7 @@ static const struct nvkm_device_chip nvc3_chipset = { .name = "GF106", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gf100_clk_new, .devinit = gf100_devinit_new, @@ -1448,7 +1448,7 @@ static const struct nvkm_device_chip nvc4_chipset = { .name = "GF104", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gf100_clk_new, .devinit = gf100_devinit_new, @@ -1485,7 +1485,7 @@ static const struct nvkm_device_chip nvc8_chipset = { .name = "GF110", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gf100_clk_new, .devinit = gf100_devinit_new, @@ -1522,7 +1522,7 @@ static const struct nvkm_device_chip nvce_chipset = { .name = "GF114", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gf100_clk_new, .devinit = gf100_devinit_new, @@ -1559,7 +1559,7 @@ static const struct nvkm_device_chip nvcf_chipset = { .name = "GF116", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gf100_clk_new, .devinit = gf100_devinit_new, @@ -1595,7 +1595,7 @@ static const struct nvkm_device_chip nvd7_chipset = { .name = "GF117", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gf100_clk_new, .devinit = gf100_devinit_new, @@ -1630,7 +1630,7 @@ static const struct nvkm_device_chip nvd9_chipset = { .name = "GF119", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gf100_clk_new, .devinit = gf100_devinit_new, @@ -1666,7 +1666,7 @@ static const struct nvkm_device_chip nve4_chipset = { .name = "GK104", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gk104_clk_new, .devinit = gf100_devinit_new, @@ -1705,7 +1705,7 @@ static const struct nvkm_device_chip nve6_chipset = { .name = "GK106", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gk104_clk_new, .devinit = gf100_devinit_new, @@ -1744,7 +1744,7 @@ static const struct nvkm_device_chip nve7_chipset = { .name = "GK107", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gk104_clk_new, .devinit = gf100_devinit_new, @@ -1808,7 +1808,7 @@ static const struct nvkm_device_chip nvf0_chipset = { .name = "GK110", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gk104_clk_new, .devinit = gf100_devinit_new, @@ -1846,7 +1846,7 @@ static const struct nvkm_device_chip nvf1_chipset = { .name = "GK110B", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gk104_clk_new, .devinit = gf100_devinit_new, @@ -1884,7 +1884,7 @@ static const struct nvkm_device_chip nv106_chipset = { .name = "GK208B", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gk104_clk_new, .devinit = gf100_devinit_new, @@ -1922,7 +1922,7 @@ static const struct nvkm_device_chip nv108_chipset = { .name = "GK208", .bar = { 0x00000001, gf100_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gk104_clk_new, .devinit = gf100_devinit_new, @@ -1960,7 +1960,7 @@ static const struct nvkm_device_chip nv117_chipset = { .name = "GM107", .bar = { 0x00000001, gm107_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gk104_clk_new, .devinit = gm107_devinit_new, @@ -1996,7 +1996,7 @@ static const struct nvkm_device_chip nv118_chipset = { .name = "GM108", .bar = { 0x00000001, gm107_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .clk = gk104_clk_new, .devinit = gm107_devinit_new, @@ -2031,7 +2031,7 @@ nv120_chipset = { .name = "GM200", .acr = { 0x00000001, gm200_acr_new }, .bar = { 0x00000001, gm107_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = gm200_devinit_new, .fb = gm200_fb_new, @@ -2069,7 +2069,7 @@ nv124_chipset = { .name = "GM204", .acr = { 0x00000001, gm200_acr_new }, .bar = { 0x00000001, gm107_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = gm200_devinit_new, .fb = gm200_fb_new, @@ -2107,7 +2107,7 @@ nv126_chipset = { .name = "GM206", .acr = { 0x00000001, gm200_acr_new }, .bar = { 0x00000001, gm107_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = gm200_devinit_new, .fb = gm200_fb_new, @@ -2169,7 +2169,7 @@ nv130_chipset = { .name = "GP100", .acr = { 0x00000001, gm200_acr_new }, .bar = { 0x00000001, gm107_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = gm200_devinit_new, .fault = gp100_fault_new, @@ -2209,7 +2209,7 @@ nv132_chipset = { .name = "GP102", .acr = { 0x00000001, gp102_acr_new }, .bar = { 0x00000001, gm107_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = gm200_devinit_new, .fault = gp100_fault_new, @@ -2247,7 +2247,7 @@ nv134_chipset = { .name = "GP104", .acr = { 0x00000001, gp102_acr_new }, .bar = { 0x00000001, gm107_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = gm200_devinit_new, .fault = gp100_fault_new, @@ -2285,7 +2285,7 @@ nv136_chipset = { .name = "GP106", .acr = { 0x00000001, gp102_acr_new }, .bar = { 0x00000001, gm107_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = gm200_devinit_new, .fault = gp100_fault_new, @@ -2322,7 +2322,7 @@ nv137_chipset = { .name = "GP107", .acr = { 0x00000001, gp102_acr_new }, .bar = { 0x00000001, gm107_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = gm200_devinit_new, .fault = gp100_fault_new, @@ -2360,7 +2360,7 @@ nv138_chipset = { .name = "GP108", .acr = { 0x00000001, gp108_acr_new }, .bar = { 0x00000001, gm107_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = gm200_devinit_new, .fault = gp100_fault_new, @@ -2420,7 +2420,7 @@ nv140_chipset = { .name = "GV100", .acr = { 0x00000001, gp108_acr_new }, .bar = { 0x00000001, gm107_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = gv100_devinit_new, .fault = gv100_fault_new, @@ -2464,7 +2464,7 @@ nv162_chipset = { .name = "TU102", .acr = { 0x00000001, tu102_acr_new }, .bar = { 0x00000001, tu102_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = tu102_devinit_new, .fault = tu102_fault_new, @@ -2502,7 +2502,7 @@ nv164_chipset = { .name = "TU104", .acr = { 0x00000001, tu102_acr_new }, .bar = { 0x00000001, tu102_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = tu102_devinit_new, .fault = tu102_fault_new, @@ -2541,7 +2541,7 @@ nv166_chipset = { .name = "TU106", .acr = { 0x00000001, tu102_acr_new }, .bar = { 0x00000001, tu102_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = tu102_devinit_new, .fault = tu102_fault_new, @@ -2581,7 +2581,7 @@ nv167_chipset = { .name = "TU117", .acr = { 0x00000001, tu102_acr_new }, .bar = { 0x00000001, tu102_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = tu102_devinit_new, .fault = tu102_fault_new, @@ -2619,7 +2619,7 @@ nv168_chipset = { .name = "TU116", .acr = { 0x00000001, tu102_acr_new }, .bar = { 0x00000001, tu102_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .bus = gf100_bus_new, .devinit = tu102_devinit_new, .fault = tu102_fault_new, @@ -2656,7 +2656,7 @@ static const struct nvkm_device_chip nv170_chipset = { .name = "GA100", .bar = { 0x00000001, tu102_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .devinit = ga100_devinit_new, .fb = ga100_fb_new, .gpio = gk104_gpio_new, @@ -2673,7 +2673,7 @@ static const struct nvkm_device_chip nv172_chipset = { .name = "GA102", .bar = { 0x00000001, tu102_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .devinit = ga100_devinit_new, .fb = ga102_fb_new, .gpio = ga102_gpio_new, @@ -2692,7 +2692,7 @@ static const struct nvkm_device_chip nv174_chipset = { .name = "GA104", .bar = { 0x00000001, tu102_bar_new }, - .bios = nvkm_bios_new, + .bios = { 0x00000001, nvkm_bios_new }, .devinit = ga100_devinit_new, .fb = ga102_fb_new, .gpio = ga102_gpio_new, @@ -3248,7 +3248,6 @@ nvkm_device_ctor(const struct nvkm_device_func *func, #include <core/layout.h> #undef NVKM_LAYOUT_INST #undef NVKM_LAYOUT_ONCE - _(NVKM_SUBDEV_VBIOS , bios); _(NVKM_SUBDEV_BUS , bus); _(NVKM_SUBDEV_CLK , clk); _(NVKM_SUBDEV_DEVINIT , devinit); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c index f3c30b2a788e..d0f52d59fc2f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c @@ -140,7 +140,8 @@ nvkm_bios = { }; int -nvkm_bios_new(struct nvkm_device *device, int index, struct nvkm_bios **pbios) +nvkm_bios_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, + struct nvkm_bios **pbios) { struct nvkm_bios *bios; struct nvbios_image image; @@ -149,7 +150,7 @@ nvkm_bios_new(struct nvkm_device *device, int index, struct nvkm_bios **pbios) if (!(bios = *pbios = kzalloc(sizeof(*bios), GFP_KERNEL))) return -ENOMEM; - nvkm_subdev_ctor(&nvkm_bios, device, index, &bios->subdev); + nvkm_subdev_ctor(&nvkm_bios, device, type, inst, &bios->subdev); ret = nvbios_shadow(bios); if (ret) |