From b582a44057bfe5cba7cf20b4dd82da22b3be3727 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 18 May 2021 13:51:33 +0200 Subject: [PATCH 1/2] video: fbdev: starfive: FB_STARFIVE_HDMI_TDA998X depends on DRM_FBDEV_EMULATION riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `.L0 ': tda998x.c:(.text+0x51c): undefined reference to `drm_encoder_cleanup' riscv64-linux-gnu-ld: tda998x.c:(.text+0x534): undefined reference to `drm_encoder_cleanup' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `.L75': tda998x.c:(.text+0x564): undefined reference to `drm_of_find_possible_crtcs' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `tda998x_encoder_destroy': tda998x.c:(.text+0x58a): undefined reference to `drm_encoder_init' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `tda998x_bind': tda998x.c:(.text+0x5b2): undefined reference to `drm_bridge_attach' riscv64-linux-gnu-ld: tda998x.c:(.text+0x5c0): undefined reference to `drm_encoder_cleanup' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `.L0 ': tda998x.c:(.text+0x692): undefined reference to `drm_bridge_remove' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `.L124': tda998x.c:(.text+0x904): undefined reference to `hdmi_infoframe_pack' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `.L135': tda998x.c:(.text+0x9e8): undefined reference to `drm_connector_cleanup' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `.L0 ': tda998x.c:(.text+0xa00): undefined reference to `drm_connector_cleanup' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `.L143': tda998x.c:(.text+0xa56): undefined reference to `drm_connector_init' riscv64-linux-gnu-ld: tda998x.c:(.text+0xa66): undefined reference to `drm_connector_attach_encoder' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `tda998x_bridge_detach': tda998x.c:(.text+0xa8a): undefined reference to `__drm_err' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `.L189': tda998x.c:(.text+0xd16): undefined reference to `drm_do_get_edid' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `.L0 ': tda998x.c:(.text+0xd34): undefined reference to `drm_connector_update_edid_property' riscv64-linux-gnu-ld: tda998x.c:(.text+0xd4e): undefined reference to `drm_add_edid_modes' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `.L165': tda998x.c:(.text+0xd5a): undefined reference to `drm_detect_monitor_audio' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `.L0 ': tda998x.c:(.text+0xfb0): undefined reference to `__drm_dbg' riscv64-linux-gnu-ld: tda998x.c:(.text+0x108a): undefined reference to `drm_kms_helper_hotplug_event' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `.L283': tda998x.c:(.text+0x1844): undefined reference to `drm_hdmi_avi_infoframe_from_display_mode' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `.L361': tda998x.c:(.text+0x2078): undefined reference to `drm_bridge_add' riscv64-linux-gnu-ld: drivers/video/fbdev/starfive/tda998x.o: in function `.LANCHOR0': tda998x.c:(.rodata+0x90): undefined reference to `drm_helper_connector_dpms' riscv64-linux-gnu-ld: tda998x.c:(.rodata+0x98): undefined reference to `drm_atomic_helper_connector_reset' riscv64-linux-gnu-ld: tda998x.c:(.rodata+0xb0): undefined reference to `drm_helper_probe_single_connector_modes' riscv64-linux-gnu-ld: tda998x.c:(.rodata+0xd8): undefined reference to `drm_atomic_helper_connector_duplicate_state' riscv64-linux-gnu-ld: tda998x.c:(.rodata+0xe0): undefined reference to `drm_atomic_helper_connector_destroy_state' Signed-off-by: Geert Uytterhoeven --- drivers/video/fbdev/starfive/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/fbdev/starfive/Kconfig b/drivers/video/fbdev/starfive/Kconfig index c80c7d632ccc1c..35511e508e3afe 100644 --- a/drivers/video/fbdev/starfive/Kconfig +++ b/drivers/video/fbdev/starfive/Kconfig @@ -16,6 +16,7 @@ config FB_STARFIVE_HDMI_ADV7513 config FB_STARFIVE_HDMI_TDA998X bool "HDMI TDA998X displayer support" + depends on DRM_FBDEV_EMULATION help Say Y here if you want to have support for TDA998X displayer From feadd1807e26408a94bbf7fcd6575e549647317b Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 18 May 2021 13:57:54 +0200 Subject: [PATCH 2/2] video: fbdev: starfive: Fix frame buffer reserved memory resource conflict starfive,vpp-lcdc 12000000.sfivefb: can't request region for resource [mem 0xfb000000-0xfcffffff] starfive,vpp-lcdc 12000000.sfivefb: Fail to allocate video RAM starfive,vpp-lcdc 12000000.sfivefb: starfive fb init fail starfive,vpp-lcdc 12000000.sfivefb: fb info init FAIL starfive,vpp-lcdc: probe of 12000000.sfivefb failed with error -16 devm_ioremap_resource() calls devm_request_mem_region(), which fails as the reserved memory for the frame buffer is already present in the resource list, cfr. /proc/iomem: fb000000-fcffffff : Reserved Fix this by mapping the frame buffer memory using devm_ioremap(). Signed-off-by: Geert Uytterhoeven --- drivers/video/fbdev/starfive/starfive_fb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/starfive/starfive_fb.c b/drivers/video/fbdev/starfive/starfive_fb.c index 1ff9434ea0b3bf..e73bf1223a631c 100755 --- a/drivers/video/fbdev/starfive/starfive_fb.c +++ b/drivers/video/fbdev/starfive/starfive_fb.c @@ -656,7 +656,8 @@ static int sf_fb_map_video_memory(struct sf_fb_data *sf_dev) sf_dev->fb.screen_size = resource_size(&res_mem); sf_dev->fb.fix.smem_start = res_mem.start; - sf_dev->fb.screen_base = devm_ioremap_resource(sf_dev->dev, &res_mem); + sf_dev->fb.screen_base = devm_ioremap(sf_dev->dev, res_mem.start, + resource_size(&res_mem)); if (IS_ERR(sf_dev->fb.screen_base)) return PTR_ERR(sf_dev->fb.screen_base);