Skip to contentSkip to conversation

ARM: dts: mx53qsb: Enable VPU support

PATCH New Fabio Estevam 6 participants 11 messages Jun 28, 2013 – Feb 6, 2016

Subsystems (3)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/2 ARM: dts: mx53qsb: Enable VPU support

From: Fabio Estevam <[email protected]>

Enable Video Processing Unit (VPU) support.

---
Depends on Philipp Zabel's patch:
[PATCH] ARM: dts: add sram for imx53 and imx6q

Philipp,

I tried using the original mx53 vpu firmware that comes with the FSL BSP, but it failed to load:

coda 63ff4000.vpu: firmware get command error
coda 63ff4000.vpu: HW initialization failed

Any suggestions?

Thanks!

 arch/arm/boot/dts/imx53-qsb.dts |  4 ++++
 arch/arm/boot/dts/imx53.dtsi    | 10 ++++++++++
 2 files changed, 14 insertions(+)
arch/arm/boot/dts/imx53-qsb.dts +4 -0
index 512a1f6..eedd27e 100644
@@ -297,6 +297,10 @@
 	status = "okay";
 };
 
+&vpu {
+	status = "okay";
+};
+
 &usbh1 {
        status = "okay";
 };
arch/arm/boot/dts/imx53.dtsi +10 -0
index 3def46f..f94d4e5 100644
@@ -1086,6 +1086,16 @@
 				crtcs = <&ipu 1>;
 				status = "disabled";
 			};
+
+			vpu: vpu at 63ff4000 {
+				compatible = "fsl,imx53-vpu";
+				reg = <0x63ff4000 0x1000>;
+				interrupts = <9>;
+				clocks = <&clks 63>, <&clks 63>;
+				clock-names = "per", "ahb";
+				iram = <&ocram>;
+				status = "disabled";
+			};
 		};
 
 		ocram: ocram at f8000000 {
Signature · 1 line
1.8.1.2
author reviewer
#1 lore raw

PATCH 2/2 ARM: imx_v6_v7_defconfig: Enable VPU driver

From: Fabio Estevam <[email protected]>

Let VPU driver be selected by default.

VPU driver requires a SRAM pool, so select CONFIG_SRAM as well.

---
 arch/arm/configs/imx_v6_v7_defconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/configs/imx_v6_v7_defconfig +3 -0
index 2353bde..e16384f 100644
@@ -88,6 +88,7 @@ CONFIG_MTD_UBI=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=65536
+CONFIG_SRAM=y
 CONFIG_EEPROM_AT24=y
 CONFIG_EEPROM_AT25=y
 # CONFIG_SCSI_PROC_FS is not set
@@ -169,6 +170,8 @@ CONFIG_SOC_CAMERA=y
 CONFIG_SOC_CAMERA_OV2640=y
 CONFIG_DRM=y
 CONFIG_VIDEO_MX3=y
+CONFIG_V4L_MEM2MEM_DRIVERS=y
+CONFIG_VIDEO_CODA=y
 CONFIG_FB=y
 CONFIG_LCD_PLATFORM=y
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
Signature · 1 line
1.8.1.2
#2 lore raw

PATCH 1/2 ARM: dts: mx53qsb: Enable VPU support

In reply to Fabio Estevam
Quoted 51 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Enable Video Processing Unit (VPU) support.

---
Depends on Philipp Zabel's patch:
[PATCH] ARM: dts: add sram for imx53 and imx6q

Philipp,

I tried using the original mx53 vpu firmware that comes with the FSL BSP, but it failed to load:

coda 63ff4000.vpu: firmware get command error
coda 63ff4000.vpu: HW initialization failed

Any suggestions?

Thanks!

 arch/arm/boot/dts/imx53-qsb.dts |  4 ++++
 arch/arm/boot/dts/imx53.dtsi    | 10 ++++++++++
 2 files changed, 14 insertions(+)
arch/arm/boot/dts/imx53-qsb.dts +4 -0
index 512a1f6..eedd27e 100644
@@ -297,6 +297,10 @@
        status = "okay";
 };
 
+&vpu {
+       status = "okay";
+};
+
 &usbh1 {
        status = "okay";
 };
arch/arm/boot/dts/imx53.dtsi +3 -0
index 3def46f..f94d4e5 100644
@@ -1086,6 +1086,16 @@
                                crtcs = <&ipu 1>;
                                status = "disabled";
                        };
+
+                       vpu: vpu at 63ff4000 {
+                               compatible = "fsl,imx53-vpu";

arch/arm/boot/dts/imx53.dtsi line 1101

Quoted 10 lines
arch/arm/boot/dts/imx53.dtsi +7 -0
+                               reg = <0x63ff4000 0x1000>;
+                               interrupts = <9>;
+                               clocks = <&clks 63>, <&clks 63>;
+                               clock-names = "per", "ahb";
+                               iram = <&ocram>;
+                               status = "disabled";
+                       };
                };
 
                ocram: ocram at f8000000 {

Nitpick: what I see here around enabling the VPU driver is;

* A property called iram
* ... that references a node called ocram
* ... which is coincidentally driven by a driver called sram

Could we make up our minds as to what to call it? Something generic that's potentially not i.MX-specific (since it does change over the models, and it may not be technically SRAM..) that gets used everywhere and belies it's purpose rather than naming a particular technology, or particular IP core documentation if it changes a lot?

--
Matt Sealey <[email protected]>

#3 lore raw

PATCH 1/2 ARM: dts: mx53qsb: Enable VPU support

Hi Matt,

[Cc: devicetree-discuss at lists.ozlabs.org]

Am Freitag, den 28.06.2013, 23:49 -0500 schrieb Matt Sealey:

Quoted 69 lines · Fabio Estevam
Quoted 51 lines

From: Fabio Estevam <[email protected]>

Enable Video Processing Unit (VPU) support.

---
Depends on Philipp Zabel's patch:
[PATCH] ARM: dts: add sram for imx53 and imx6q

Philipp,

I tried using the original mx53 vpu firmware that comes with the FSL BSP, but it failed to load:

coda 63ff4000.vpu: firmware get command error
coda 63ff4000.vpu: HW initialization failed

Any suggestions?

Thanks!

 arch/arm/boot/dts/imx53-qsb.dts |  4 ++++
 arch/arm/boot/dts/imx53.dtsi    | 10 ++++++++++
 2 files changed, 14 insertions(+)
arch/arm/boot/dts/imx53-qsb.dts +4 -0
index 512a1f6..eedd27e 100644
@@ -297,6 +297,10 @@
        status = "okay";
 };
 
+&vpu {
+       status = "okay";
+};
+
 &usbh1 {
        status = "okay";
 };
arch/arm/boot/dts/imx53.dtsi +3 -0
index 3def46f..f94d4e5 100644
@@ -1086,6 +1086,16 @@
                                crtcs = <&ipu 1>;
                                status = "disabled";
                        };
+
+                       vpu: vpu at 63ff4000 {
+                               compatible = "fsl,imx53-vpu";

arch/arm/boot/dts/imx53.dtsi line 1101

Quoted 10 lines
arch/arm/boot/dts/imx53.dtsi +7 -0
+                               reg = <0x63ff4000 0x1000>;
+                               interrupts = <9>;
+                               clocks = <&clks 63>, <&clks 63>;
+                               clock-names = "per", "ahb";
+                               iram = <&ocram>;
+                               status = "disabled";
+                       };
                };
 
                ocram: ocram at f8000000 {

Nitpick: what I see here around enabling the VPU driver is;

* A property called iram
* ... that references a node called ocram
* ... which is coincidentally driven by a driver called sram

Quoted 5 lines

Could we make up our minds as to what to call it? Something generic that's potentially not i.MX-specific (since it does change over the models, and it may not be technically SRAM..) that gets used everywhere and belies it's purpose rather than naming a particular technology, or particular IP core documentation if it changes a lot?

I'd be in favor of changing
- ocram: ocram at f8000000 {
+ ocram: sram at f8000000 {
but it is very convenient to have the IP vendor's creative name in there, too, if I have to look it up in the reference manual.

Quoted 1 line

From point of view of the VPU, the SRAM is a more local memory, in most

implementations connected via a dedicated AXI bus to avoid load on the main memory bus.

regards
Philipp

#4 lore raw

PATCH 1/2 ARM: dts: mx53qsb: Enable VPU support

In reply to Fabio Estevam

Hi Fabio,

Am Freitag, den 28.06.2013, 19:49 -0300 schrieb Fabio Estevam:

Quoted 14 lines

From: Fabio Estevam <[email protected]>

Enable Video Processing Unit (VPU) support.

---
Depends on Philipp Zabel's patch:
[PATCH] ARM: dts: add sram for imx53 and imx6q

Philipp,

I tried using the original mx53 vpu firmware that comes with the FSL BSP, but it failed to load:

Quoted 6 lines

coda 63ff4000.vpu: firmware get command error
coda 63ff4000.vpu: HW initialization failed

Any suggestions?

Thanks!

/*
* The CODA driver needs the raw firmware without header in memory order.
* This is how I converted vpu_fw_imx53.bin from the Freescale BSP into
* v4l2-coda7541-imx53.bin:
*/

#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>

struct fw_header_info {
	u_int8_t  platform[12];
	u_int32_t size;
};

int main(int argc, char *argv[])

{
	int fd, i, n, size;
	struct fw_header_info header;
	u_int32_t *buf;

	if (argc < 3) {
		fprintf(stderr, "usage: %s <infile> <outfile>\n", argv[0]);
		fprintf(stderr, "example: %s vpu_fw_imx53.bin v4l2-coda7541-imx53.bin\n", argv[0]);
		return 0;
	}

	fd = open(argv[1], O_RDONLY);
	if (fd < 0) {
		fprintf(stderr, "Failed to open source file '%s'.\n", argv[1]);
		return EXIT_FAILURE;
	}

	n = read(fd, &header, sizeof(header));
	if (n != sizeof(header)) {
		fprintf(stderr, "Failed to read header.\n");
		return EXIT_FAILURE;
	}

	size = header.size * sizeof(u_int16_t);
	buf = malloc(size);
	if (buf == NULL)
		return EXIT_FAILURE;

	n = read(fd, buf, size);
	if (n != size) {
		fprintf(stderr, "Failed to read firmware.\n");
		return EXIT_FAILURE;
	}

	close(fd);

	for (i = 0; i < size / 4; i += 2) {
		u_int32_t tmp = buf[i + 1] << 16 | buf[i + 1] >> 16;
		buf[i + 1] = buf[i] << 16 | buf[i] >> 16;
		buf[i] = tmp;
	}

	fd = open(argv[2], O_RDWR | O_CREAT, 0644);
	if (fd < 0)
		error("Failed to open target file '%s'.\n", argv[2]);

	n = write(fd, buf, size);
	if (n != size)
		error("Failed to write reordered firmware\n");

	close(fd);

	return 0;
}

/*
* regards
* Philipp
*/

author reviewer
#5 lore raw

PATCH 1/2 ARM: dts: mx53qsb: Enable VPU support

Quoted 22 lines · Philipp Zabel

Hi Fabio,

Am Freitag, den 28.06.2013, 19:49 -0300 schrieb Fabio Estevam:

Quoted 19 lines

From: Fabio Estevam <[email protected]>

Enable Video Processing Unit (VPU) support.

---
Depends on Philipp Zabel's patch:
[PATCH] ARM: dts: add sram for imx53 and imx6q

Philipp,

I tried using the original mx53 vpu firmware that comes with the FSL BSP, but it failed to load:

coda 63ff4000.vpu: firmware get command error
coda 63ff4000.vpu: HW initialization failed

Any suggestions?

Quoted 7 lines
Quoted 1 line

Thanks!

/*
* The CODA driver needs the raw firmware without header in memory order.
* This is how I converted vpu_fw_imx53.bin from the Freescale BSP into
* v4l2-coda7541-imx53.bin:
*/

Thanks for your C code, Philipp.

Now I get:

coda 63ff4000.vpu: Initialized CODA7541.
coda 63ff4000.vpu: Unsupported firmware version: 13.4.41 coda 63ff4000.vpu: codec registered as /dev/video0

As input file I am using the vpu_fw_imx53.bin from FSL BSP version 11.09.

Where should I get the vpu_fw_imx53.bin file so that I do not get the unsupported warning?

Thanks,

Fabio Estevam

author reviewer
#6 lore raw

PATCH 1/2 ARM: dts: mx53qsb: Enable VPU support

Hi Philipp,

Quoted 4 lines · Fabio Estevam

Thanks for your C code, Philipp.

Now I get:

Quoted 8 lines

coda 63ff4000.vpu: Initialized CODA7541.
coda 63ff4000.vpu: Unsupported firmware version: 13.4.41 coda 63ff4000.vpu: codec registered as /dev/video0

As input file I am using the vpu_fw_imx53.bin from FSL BSP version 11.09.

Where should I get the vpu_fw_imx53.bin file so that I do not get the unsupported warning?

Ok, now I used the mx53 firmware from the latest FSL 4.0.0 BSP and I get:

coda 63ff4000.vpu: Initialized CODA7541.
coda 63ff4000.vpu: Unsupported firmware version: 1.4.50 coda 63ff4000.vpu: codec registered as /dev/video0

and it seems that the version warning appears because your patch:
https://linuxtv.org/patch/19020/ is not applied in the tree linux-next tree I am using.

Thanks,

Fabio Estevam

#7 lore raw

PATCH 1/2 ARM: dts: mx53qsb: Enable VPU support

In reply to Fabio Estevam

Hi Fabio,

Am Montag, den 01.07.2013, 10:46 -0300 schrieb Fabio Estevam:

Quoted 35 lines · Philipp Zabel
Quoted 22 lines

Hi Fabio,

Am Freitag, den 28.06.2013, 19:49 -0300 schrieb Fabio Estevam:

Quoted 19 lines

From: Fabio Estevam <[email protected]>

Enable Video Processing Unit (VPU) support.

---
Depends on Philipp Zabel's patch:
[PATCH] ARM: dts: add sram for imx53 and imx6q

Philipp,

I tried using the original mx53 vpu firmware that comes with the FSL BSP, but it failed to load:

coda 63ff4000.vpu: firmware get command error
coda 63ff4000.vpu: HW initialization failed

Any suggestions?

Quoted 7 lines
Quoted 1 line

Thanks!

/*
* The CODA driver needs the raw firmware without header in memory order.
* This is how I converted vpu_fw_imx53.bin from the Freescale BSP into
* v4l2-coda7541-imx53.bin:
*/

Thanks for your C code, Philipp.

Now I get:

Quoted 8 lines

coda 63ff4000.vpu: Initialized CODA7541.
coda 63ff4000.vpu: Unsupported firmware version: 13.4.41 coda 63ff4000.vpu: codec registered as /dev/video0

As input file I am using the vpu_fw_imx53.bin from FSL BSP version 11.09.

Where should I get the vpu_fw_imx53.bin file so that I do not get the unsupported warning?

The current firmware version is 1.4.50 (yes, 1.4.50 > 13.4.41). It is contained in the L3.0.35_12.09.01 or L3.0.35_4.0.0 (20130424) BSP releases.

regards
Philipp

#8 lore raw

PATCH 1/2 ARM: dts: mx53qsb: Enable VPU support

In reply to Philipp Zabel
Quoted 5 lines · Philipp Zabel

/*
* The CODA driver needs the raw firmware without header in memory order.
* This is how I converted vpu_fw_imx53.bin from the Freescale BSP into
* v4l2-coda7541-imx53.bin:
*/

That code sniplet should get a GPL license header.

rsc

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#9 lore raw

PATCH 1/2 ARM: dts: mx53qsb: Enable VPU support

In reply to Philipp Zabel

Hi Philipp,

Quoted 22 lines · Philipp Zabel

Hi Fabio,

Am Freitag, den 28.06.2013, 19:49 -0300 schrieb Fabio Estevam:

Quoted 19 lines

From: Fabio Estevam <[email protected]>

Enable Video Processing Unit (VPU) support.

---
Depends on Philipp Zabel's patch:
[PATCH] ARM: dts: add sram for imx53 and imx6q

Philipp,

I tried using the original mx53 vpu firmware that comes with the FSL BSP, but it failed to load:

coda 63ff4000.vpu: firmware get command error
coda 63ff4000.vpu: HW initialization failed

Any suggestions?

Quoted 7 lines
Quoted 1 line

Thanks!

/*
* The CODA driver needs the raw firmware without header in memory order.
* This is how I converted vpu_fw_imx53.bin from the Freescale BSP into
* v4l2-coda7541-imx53.bin:
*/

Sorry to revive an old thread but I was wondering if that firmware conversion tool is available somewhere on a git repo?

Regards,
Gary