Skip to contentSkip to conversation

video: omap-fb: Rework to enable COMPILE_TEST option

PATCH Applied Alexander Shiyan 2 participants 2 messages Apr 22, 2022 – Apr 25, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: omap-fb: Rework to enable COMPILE_TEST option

To add a compilation check for the omap-fb driver, move the omap-fb.h header to a global location.
The "omap_add_display" function is used only for legacy boards, so we will move it to a common place for such calls (omap_devices.c).

---
 arch/arm/boards/archosg9/board.c              |  2 +-
 .../boards/phytec-phycore-omap4460/board.c    |  5 ++-
 arch/arm/mach-omap/Makefile                   |  2 +-
 arch/arm/mach-omap/include/mach/devices.h     |  3 ++
 arch/arm/mach-omap/omap_devices.c             | 29 +++++++++++++++
 arch/arm/mach-omap/omap_fb.c                  | 36 -------------------
 drivers/video/Kconfig                         |  2 +-
 drivers/video/omap.c                          |  3 +-
 .../include/mach => include/video}/omap-fb.h  | 10 ++----
 9 files changed, 41 insertions(+), 51 deletions(-)
 delete mode 100644 arch/arm/mach-omap/omap_fb.c
 rename {arch/arm/mach-omap/include/mach => include/video}/omap-fb.h (80%)
arch/arm/boards/archosg9/board.c +1 -1
index 3289cfda3d..597830432b 100644
@@ -5,10 +5,10 @@
 #include <init.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
+#include <mach/devices.h>
 #include <mach/omap4-silicon.h>
 #include <mach/omap4-devices.h>
 #include <mach/omap4_rom_usb.h>
-#include <mach/omap-fb.h>
 #include <linux/sizes.h>
 #include <i2c/i2c.h>
 #include <gpio.h>
arch/arm/boards/phytec-phycore-omap4460/board.c +2 -3
index 9e8b9e56a7..e25ff5eb31 100644
@@ -10,10 +10,10 @@
 #include <envfs.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
+#include <mach/devices.h>
 #include <mach/omap4-silicon.h>
 #include <mach/omap4-devices.h>
 #include <mach/omap4-clock.h>
-#include <mach/omap-fb.h>
 #include <mach/sdrc.h>
 #include <mach/sys_info.h>
 #include <mach/syslib.h>
@@ -292,8 +292,7 @@ static int pcm049_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_PCM049);
 
-	if (IS_ENABLED(CONFIG_DRIVER_VIDEO_OMAP))
-		omap_add_display(&pcm049_fb_data);
+	omap_add_display(&pcm049_fb_data);
 
 	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
 		defaultenv_append_directory(defaultenv_phytec_phycore_omap4460);
arch/arm/mach-omap/Makefile +1 -1
index 36b2aa090e..e81284ec3b 100644
@@ -15,7 +15,7 @@
 # GNU General Public License for more details.
 #
 #
-obj-$(CONFIG_ARCH_OMAP) += syslib.o omap_devices.o omap_generic.o omap_fb.o
+obj-$(CONFIG_ARCH_OMAP) += syslib.o omap_devices.o omap_generic.o
 pbl-$(CONFIG_ARCH_OMAP) += syslib.o
 obj-$(CONFIG_ARCH_OMAP3) += omap3_generic.o auxcr.o
 pbl-$(CONFIG_ARCH_OMAP3) += omap3_generic.o auxcr.o
arch/arm/mach-omap/include/mach/devices.h +3 -0
index 0f9fdf1ca5..06fd2a8dd3 100644
@@ -4,6 +4,7 @@
 #define __MACH_OMAP_DEVICES_H
 
 #include <mach/omap_hsmmc.h>
+#include <video/omap-fb.h>
 
 void omap_add_ram0(resource_size_t size);
 
@@ -11,4 +12,6 @@ void omap_add_sram0(resource_size_t base, resource_size_t size);
 
 struct device_d *omap_add_uart(int id, unsigned long base);
 
+struct device_d *omap_add_display(struct omapfb_platform_data *o_pdata);
+
 #endif /* __MACH_OMAP_DEVICES_H */
arch/arm/mach-omap/omap_devices.c +29 -0
index 7c36b8819d..beae59f74d 100644
@@ -26,3 +26,32 @@ struct device_d *omap_add_uart(int id, unsigned long base)
 	return add_generic_device("omap-uart", id, NULL, base, 1024,
 				  IORESOURCE_MEM | IORESOURCE_MEM_8BIT, &serial_plat);
 }
+
+#if defined(CONFIG_DRIVER_VIDEO_OMAP)
+static struct resource omapfb_resources[] = {
+	{
+		.name	= "omap4_dss",
+		.start	= 0x48040000,
+		.end	= 0x48040000 + 512 - 1,
+		.flags	= IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
+	}, {
+		.name	= "omap4_dispc",
+		.start	= 0x48041000,
+		.end	= 0x48041000 + 3072 - 1,
+		.flags	= IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
+	},
+};
+
+struct device_d *omap_add_display(struct omapfb_platform_data *o_pdata)
+{
+	return add_generic_device_res("omap_fb", -1,
+				      omapfb_resources,
+				      ARRAY_SIZE(omapfb_resources),
+				      o_pdata);
+}
+#else
+struct device_d *omap_add_display(struct omapfb_platform_data *o_pdata)
+{
+	return NULL;
+}
+#endif
arch/arm/mach-omap/omap_fb.c deleted +0 -36
deleted file mode 100644
index 0bd51c5f55..0000000000
@@ -1,36 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-
-#include <driver.h>
-#include <common.h>
-#include <linux/ioport.h>
-#include <mach/omap-fb.h>
-
-#if defined(CONFIG_DRIVER_VIDEO_OMAP)
-static struct resource omapfb_resources[] = {
-	{
-		.name	= "omap4_dss",
-		.start	= 0x48040000,
-		.end	= 0x48040000 + 512 - 1,
-		.flags	= IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
-	}, {
-		.name	= "omap4_dispc",
-		.start	= 0x48041000,
-		.end	= 0x48041000 + 3072 - 1,
-		.flags	= IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
-	},
-};
-
-struct device_d *omap_add_display(struct omapfb_platform_data *o_pdata)
-{
-	return add_generic_device_res("omap_fb", -1,
-				      omapfb_resources,
-				      ARRAY_SIZE(omapfb_resources),
-				      o_pdata);
-}
-#else
-struct device_d *omap_add_display(struct omapfb_platform_data *o_pdata)
-{
-	return NULL;
-}
-#endif
-EXPORT_SYMBOL(omap_add_display);
drivers/video/Kconfig +1 -1
index dcdc6c2135..a20b7bbee9 100644
@@ -75,7 +75,7 @@ config DRIVER_VIDEO_S3C24XX
 
 config DRIVER_VIDEO_OMAP
 	bool "OMAP framebuffer driver"
-	depends on ARCH_OMAP4
+	depends on ARCH_OMAP4 || COMPILE_TEST
 	help
 	  Add support for OMAP Display Controller. Currently this
 	  driver only supports OMAP4 SoCs in DISPC parallel mode on
drivers/video/omap.c +1 -2
index 62c51a1dfc..ca41ab36fc 100644
@@ -20,8 +20,7 @@
 #include <clock.h>
 #include <linux/err.h>
 
-#include <mach/omap4-silicon.h>
-#include <mach/omap-fb.h>
+#include <video/omap-fb.h>
 
 #include <mmu.h>
 
include/video/omap-fb.h renamed from arch/arm/mach-omap/include/mach/omap-fb.h +3 -7
similarity index 80%
rename from arch/arm/mach-omap/include/mach/omap-fb.h
rename to include/video/omap-fb.h
index f727164434..519460f0d5 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_FB4_H
-#define H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_FB4_H
+#ifndef OMAP_FB_H
+#define OMAP_FB_H
 
 #include <fb.h>
 
@@ -42,8 +42,4 @@ struct omapfb_platform_data {
 	void (*enable)(int p);
 };
 
-struct device_d;
-struct device_d *omap_add_display(struct omapfb_platform_data *o_pdata);
-
-
-#endif	/* H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_FB4_H */
+#endif /* OMAP_FB_H */
Signature · 7 lines
2.32.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 6 lines · Alexander Shiyan

To add a compilation check for the omap-fb driver, move the omap-fb.h header to a global location.
The "omap_add_display" function is used only for legacy boards, so we will move it to a common place for such calls (omap_devices.c).

Quoted 13 lines
---
 arch/arm/boards/archosg9/board.c              |  2 +-
 .../boards/phytec-phycore-omap4460/board.c    |  5 ++-
 arch/arm/mach-omap/Makefile                   |  2 +-
 arch/arm/mach-omap/include/mach/devices.h     |  3 ++
 arch/arm/mach-omap/omap_devices.c             | 29 +++++++++++++++
 arch/arm/mach-omap/omap_fb.c                  | 36 -------------------
 drivers/video/Kconfig                         |  2 +-
 drivers/video/omap.c                          |  3 +-
 .../include/mach => include/video}/omap-fb.h  | 10 ++----
 9 files changed, 41 insertions(+), 51 deletions(-)
 delete mode 100644 arch/arm/mach-omap/omap_fb.c
 rename {arch/arm/mach-omap/include/mach => include/video}/omap-fb.h (80%)

Applied, thanks

Sascha

Quoted 217 lines
arch/arm/boards/archosg9/board.c +1 -1
index 3289cfda3d..597830432b 100644
@@ -5,10 +5,10 @@
 #include <init.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
+#include <mach/devices.h>
 #include <mach/omap4-silicon.h>
 #include <mach/omap4-devices.h>
 #include <mach/omap4_rom_usb.h>
-#include <mach/omap-fb.h>
 #include <linux/sizes.h>
 #include <i2c/i2c.h>
 #include <gpio.h>
arch/arm/boards/phytec-phycore-omap4460/board.c +2 -3
index 9e8b9e56a7..e25ff5eb31 100644
@@ -10,10 +10,10 @@
 #include <envfs.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
+#include <mach/devices.h>
 #include <mach/omap4-silicon.h>
 #include <mach/omap4-devices.h>
 #include <mach/omap4-clock.h>
-#include <mach/omap-fb.h>
 #include <mach/sdrc.h>
 #include <mach/sys_info.h>
 #include <mach/syslib.h>
@@ -292,8 +292,7 @@ static int pcm049_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_PCM049);
 
-	if (IS_ENABLED(CONFIG_DRIVER_VIDEO_OMAP))
-		omap_add_display(&pcm049_fb_data);
+	omap_add_display(&pcm049_fb_data);
 
 	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
 		defaultenv_append_directory(defaultenv_phytec_phycore_omap4460);
arch/arm/mach-omap/Makefile +1 -1
index 36b2aa090e..e81284ec3b 100644
@@ -15,7 +15,7 @@
 # GNU General Public License for more details.
 #
 #
-obj-$(CONFIG_ARCH_OMAP) += syslib.o omap_devices.o omap_generic.o omap_fb.o
+obj-$(CONFIG_ARCH_OMAP) += syslib.o omap_devices.o omap_generic.o
 pbl-$(CONFIG_ARCH_OMAP) += syslib.o
 obj-$(CONFIG_ARCH_OMAP3) += omap3_generic.o auxcr.o
 pbl-$(CONFIG_ARCH_OMAP3) += omap3_generic.o auxcr.o
arch/arm/mach-omap/include/mach/devices.h +3 -0
index 0f9fdf1ca5..06fd2a8dd3 100644
@@ -4,6 +4,7 @@
 #define __MACH_OMAP_DEVICES_H
 
 #include <mach/omap_hsmmc.h>
+#include <video/omap-fb.h>
 
 void omap_add_ram0(resource_size_t size);
 
@@ -11,4 +12,6 @@ void omap_add_sram0(resource_size_t base, resource_size_t size);
 
 struct device_d *omap_add_uart(int id, unsigned long base);
 
+struct device_d *omap_add_display(struct omapfb_platform_data *o_pdata);
+
 #endif /* __MACH_OMAP_DEVICES_H */
arch/arm/mach-omap/omap_devices.c +29 -0
index 7c36b8819d..beae59f74d 100644
@@ -26,3 +26,32 @@ struct device_d *omap_add_uart(int id, unsigned long base)
 	return add_generic_device("omap-uart", id, NULL, base, 1024,
 				  IORESOURCE_MEM | IORESOURCE_MEM_8BIT, &serial_plat);
 }
+
+#if defined(CONFIG_DRIVER_VIDEO_OMAP)
+static struct resource omapfb_resources[] = {
+	{
+		.name	= "omap4_dss",
+		.start	= 0x48040000,
+		.end	= 0x48040000 + 512 - 1,
+		.flags	= IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
+	}, {
+		.name	= "omap4_dispc",
+		.start	= 0x48041000,
+		.end	= 0x48041000 + 3072 - 1,
+		.flags	= IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
+	},
+};
+
+struct device_d *omap_add_display(struct omapfb_platform_data *o_pdata)
+{
+	return add_generic_device_res("omap_fb", -1,
+				      omapfb_resources,
+				      ARRAY_SIZE(omapfb_resources),
+				      o_pdata);
+}
+#else
+struct device_d *omap_add_display(struct omapfb_platform_data *o_pdata)
+{
+	return NULL;
+}
+#endif
arch/arm/mach-omap/omap_fb.c deleted +0 -36
deleted file mode 100644
index 0bd51c5f55..0000000000
@@ -1,36 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-
-#include <driver.h>
-#include <common.h>
-#include <linux/ioport.h>
-#include <mach/omap-fb.h>
-
-#if defined(CONFIG_DRIVER_VIDEO_OMAP)
-static struct resource omapfb_resources[] = {
-	{
-		.name	= "omap4_dss",
-		.start	= 0x48040000,
-		.end	= 0x48040000 + 512 - 1,
-		.flags	= IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
-	}, {
-		.name	= "omap4_dispc",
-		.start	= 0x48041000,
-		.end	= 0x48041000 + 3072 - 1,
-		.flags	= IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
-	},
-};
-
-struct device_d *omap_add_display(struct omapfb_platform_data *o_pdata)
-{
-	return add_generic_device_res("omap_fb", -1,
-				      omapfb_resources,
-				      ARRAY_SIZE(omapfb_resources),
-				      o_pdata);
-}
-#else
-struct device_d *omap_add_display(struct omapfb_platform_data *o_pdata)
-{
-	return NULL;
-}
-#endif
-EXPORT_SYMBOL(omap_add_display);
drivers/video/Kconfig +1 -1
index dcdc6c2135..a20b7bbee9 100644
@@ -75,7 +75,7 @@ config DRIVER_VIDEO_S3C24XX
 
 config DRIVER_VIDEO_OMAP
 	bool "OMAP framebuffer driver"
-	depends on ARCH_OMAP4
+	depends on ARCH_OMAP4 || COMPILE_TEST
 	help
 	  Add support for OMAP Display Controller. Currently this
 	  driver only supports OMAP4 SoCs in DISPC parallel mode on
drivers/video/omap.c +1 -2
index 62c51a1dfc..ca41ab36fc 100644
@@ -20,8 +20,7 @@
 #include <clock.h>
 #include <linux/err.h>
 
-#include <mach/omap4-silicon.h>
-#include <mach/omap-fb.h>
+#include <video/omap-fb.h>
 
 #include <mmu.h>
 
include/video/omap-fb.h renamed from arch/arm/mach-omap/include/mach/omap-fb.h +3 -7
similarity index 80%
rename from arch/arm/mach-omap/include/mach/omap-fb.h
rename to include/video/omap-fb.h
index f727164434..519460f0d5 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_FB4_H
-#define H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_FB4_H
+#ifndef OMAP_FB_H
+#define OMAP_FB_H
 
 #include <fb.h>
 
@@ -42,8 +42,4 @@ struct omapfb_platform_data {
 	void (*enable)(int p);
 };
 
-struct device_d;
-struct device_d *omap_add_display(struct omapfb_platform_data *o_pdata);
-
-
-#endif	/* H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_FB4_H */
+#endif /* OMAP_FB_H */
Signature · 7 lines
2.32.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox