Fwd: Barebox 2017.02 works great but no Linux Framebuffer... :-/

gianluca gianlucarenzi at eurekelettronica.it
Tue Feb 21 05:04:27 PST 2017


Hello everybody!

I am fighting to enable ldb in Linux 4.9.7. In barebox the SAME 
device-tree is modified by barebox to enable/disable the ldb or hdmi 
depending on what is found.

During Linux bootup with HDMI only, it works with no hassle.

If booting with ldb it does not start the ldb driver registration due to 
a panel/bridge missing.

In the config of linux kernel I have (as imx_v6_v7_defconfig) all drm 
and simple panel enabled.

What is missing???

Best regards,
Gianluca

-------- Forwarded Message --------
Subject: Barebox 2017.02 works great but no Linux Framebuffer... :-/
Date: Mon, 20 Feb 2017 16:36:06 +0100
From: gianluca <gianlucarenzi at eurekelettronica.it>
To: Sascha Hauer <s.hauer at pengutronix.de>

Hello Sascha,

During last week I was able to activate/deactivate the hdmi and ldb 
nodes from internal device-tree of Barebox and everything is working great.

Now I would like to boot up with the kernel 4.9.7 with the following 
commandline but it fails.

The kernelcmd line is:

> console=ttymxc2,115200 rootwait noswap ip=none noinitrd rootfstype=nilfs2 root=/dev/mmcblk1p3 fec.macaddr=0x7a,0x3f,0x03,0xe3,0xa2,0xff system_rev=0xe3600000 system_serialnr=0x00000000 lcd_type=am1280800n3tz fastboot quiet loglevel=3 console=tty0  video=mxcfb0:dev=ldb,if=RGB24,bpp=32 fbmem=32M vmalloc=400M

The problem is the ldb (imx-ldb.c you wrote in kernel 
drivers/gpu/drm/imx...). It fails with the following error:

> [    7.526349] imx-ldb 2000000.aips-bus:ldb at 020e0008: panel/bridge not found: /panel --
> [    7.526369] imx-drm display-subsystem: failed to bind 2000000.aips-bus:ldb at 020e0008 (ops 0xc097aaa0): -517
> [    7.526785] imx-drm display-subsystem: master bind failed: -517

The device-tree is attached.

The device tree is the same as Barebox (it has only an #included 
commented out).

Both hdmi and ldb nodes are initially left "disabled" then barebox 
enable the node corresponding to the hardware found (i.e. it changes the 
status to "okay")

In barebox everything is working.

In linux NOT. What is exactly a 'channel->bridge' and 'channel->panel' 
in device-tree therminology?

Barebox is working without it, so I suppose it was working in Linux 
kernel too...

Regards,
-- 
Eurek s.r.l.                          |
Electronic Engineering                | http://www.eurek.it
via Celletta 8/B, 40026 Imola, Italy  | Phone: +39-(0)542-609120
p.iva 00690621206 - c.f. 04020030377  | Fax:   +39-(0)542-609212

-------------- next part --------------
/*
 * $Id: imx6q-eurek-ek360.dts,v 1.16 2017/02/20 12:18:14 gianluca Exp $
 *
 * Copyright 2016/2017 Gianluca Renzi, Eurek Elettronica S.R.L.
 * Copyright 2014 Raphaël Poggi
 * Copyright 2012 Freescale Semiconductor, Inc.
 * Copyright 2011 Linaro Ltd.
 *
 * The code contained herein is licensed under the GNU General Public
 * License. You may obtain a copy of the GNU General Public License
 * Version 2 or later at the following locations:
 *
 * http://www.opensource.org/licenses/gpl-license.html
 * http://www.gnu.org/copyleft/gpl.html
 */

/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <arm/imx6q.dtsi>
#include "imx6q.dtsi"

/ {
	model = "Eurek EK360 i.MX6Q/D";
	compatible = "eurek,ek360", "fsl,imx6q";

	chosen {
		linux,stdout-path = &uart3;
	};

	memory {
		reg = <0x10000000 0x40000000>;
	};

	regulators {
		compatible = "simple-bus";
		#address-cells = <1>;
		#size-cells = <0>;

		reg_1p2v: regulator at 0 {
			compatible = "regulator-fixed";
			reg = <0>;
			regulator-name = "1P2V";
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-always-on;
		};

		reg_1p5v: regulator at 1 {
			compatible = "regulator-fixed";
			reg = <1>;
			regulator-name = "1P5V";
			regulator-min-microvolt = <1500000>;
			regulator-max-microvolt = <1500000>;
			regulator-always-on;
		};

		reg_2p5v: regulator at 2 {
			compatible = "regulator-fixed";
			reg = <2>;
			regulator-name = "2P5V";
			regulator-min-microvolt = <2500000>;
			regulator-max-microvolt = <2500000>;
			regulator-always-on;
		};

		reg_3p3v: regulator at 3 {
			compatible = "regulator-fixed";
			reg = <3>;
			regulator-name = "3P3V";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			regulator-always-on;
		};

		reg_usb_otg_vbus: regulator at 4 {
			compatible = "regulator-fixed";
			reg = <4>;
			regulator-name = "usb_otg_vbus";
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
			gpio = <&gpio3 22 GPIO_ACTIVE_LOW>;
			enable-active-low;
		};

		reg_usb_h1_vbus: regulator at 5 {
			compatible = "regulator-fixed";
			reg = <5>;
			regulator-name = "usb_h1_vbus";
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
			gpio = <&gpio3 31 GPIO_ACTIVE_LOW>;
			enable-active-low;
			regulator-always-on;
		};

		reg_sdio_en: regulator at 6 {
			compatible = "regulator-fixed";
			reg = <6>;
			regulator-name = "sdio_en";
			regulator-min-microvolt = <33000000>;
			regulator-max-microvolt = <33000000>;
			gpio = <&gpio2 3 GPIO_ACTIVE_LOW>;
			enable-active-low;
			regulator-always-on;
		};

		reg_5p0v: regulator at 7 {
			compatible = "regulator-fixed";
			reg = <7>;
			regulator-name = "5P0V";
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
			regulator-always-on;
		};

	};

	leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_led>;

		led0: led0 {
			label = "led";
			gpios = <&gpio5 11 GPIO_ACTIVE_LOW>;
			default-state = "off";
		};
	};

	backlight_lvds: backlight-lvds {
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_pwm1>;
		compatible = "pwm-backlight";
		pwms = <&pwm1 0 6666666>;
		brightness-levels = <0 4 8 16 32 64 128 255>;
		default-brightness-level = <6>;
		power-supply = <&reg_3p3v>;
		status = "okay";
	};

	sound {
		compatible = "fsl,imx6-ek360-sgtl5000",
			     "fsl,imx-audio-sgtl5000";
		model = "imx6-ek360-sgtl5000";
		ssi-controller = <&ssi1>;
		audio-codec = <&codec>;
		micbias-resistor-k-ohms = <2>;
		micbias-voltage-m-volts = <3000>;
		audio-routing =
			"MIC_IN", "Mic Jack",
			"Mic Jack", "Mic Bias",
			"Headphone Jack", "HP_OUT";
		mux-int-port = <1>;
		mux-ext-port = <3>;
	};

	panel {
		backlight = <&backlight_lvds>;
		port {
			in_lvds0: endpoint {
				remote-endpoint = <&lvds0_out>;
			};
		};
	};

};

&iomuxc {
	pinctrl-names = "default";

	imx6q-ek360 {
		pinctrl_uart1: uart1grp {
			/* RS232 port */
			fsl,pins = <
				MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA	0x1b0b1
				MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA	0x1b0b1
			>;
		};

		pinctrl_uart2: uart2grp {
			/* RS485 port */
			fsl,pins = <
				MX6QDL_PAD_EIM_D26__UART2_TX_DATA	0x1b0b1
				MX6QDL_PAD_EIM_D27__UART2_RX_DATA	0x1b0b1
				/* UART2_DIR */
				MX6QDL_PAD_EIM_D18__GPIO3_IO18			0x1b0b1
			>;
		};

		pinctrl_uart3: uart3grp {
			/* debug port, serial console */
			fsl,pins = <
				MX6QDL_PAD_EIM_D24__UART3_TX_DATA 0x1b0b1
				MX6QDL_PAD_EIM_D25__UART3_RX_DATA 0x1b0b1
			>;
		};

		pinctrl_usdhc2: usdhc2grp {
			/* SDIO / WiFi Module */
			fsl,pins = <
				MX6QDL_PAD_SD2_CMD__SD2_CMD			0x17059
				MX6QDL_PAD_SD2_CLK__SD2_CLK			0x10059
				MX6QDL_PAD_SD2_DAT0__SD2_DATA0		0x17059
				MX6QDL_PAD_SD2_DAT1__SD2_DATA1		0x17059
				MX6QDL_PAD_SD2_DAT2__SD2_DATA2		0x17059
				MX6QDL_PAD_SD2_DAT3__SD2_DATA3		0x17059
				/* SD2_EN */
				MX6QDL_PAD_NANDF_D3__GPIO2_IO03		0x1b0b1
			>;
		};

		pinctrl_usdhc3: usdhc3grp {
			/* uSD/MMC */
			fsl,pins = <
				MX6QDL_PAD_SD3_CMD__SD3_CMD			0x17059
				MX6QDL_PAD_SD3_CLK__SD3_CLK			0x10059
				MX6QDL_PAD_SD3_DAT0__SD3_DATA0		0x17059
				MX6QDL_PAD_SD3_DAT1__SD3_DATA1		0x17059
				MX6QDL_PAD_SD3_DAT2__SD3_DATA2		0x17059
				MX6QDL_PAD_SD3_DAT3__SD3_DATA3		0x17059
				/* SD3_CD */
				MX6QDL_PAD_NANDF_D0__GPIO2_IO00		0x1f071
				/* SD3_WP */
				MX6QDL_PAD_NANDF_D1__GPIO2_IO01		0x1f071
			>;
		};

		pinctrl_usdhc4: usdhc4grp {
			/* eMMC */
			fsl,pins = <
				MX6QDL_PAD_SD4_CMD__SD4_CMD			0x17059
				MX6QDL_PAD_SD4_CLK__SD4_CLK			0x10059
				MX6QDL_PAD_SD4_DAT0__SD4_DATA0		0x17059
				MX6QDL_PAD_SD4_DAT1__SD4_DATA1		0x17059
				MX6QDL_PAD_SD4_DAT2__SD4_DATA2		0x17059
				MX6QDL_PAD_SD4_DAT3__SD4_DATA3		0x17059
				MX6QDL_PAD_SD4_DAT4__SD4_DATA4		0x17059
				MX6QDL_PAD_SD4_DAT5__SD4_DATA5		0x17059
				MX6QDL_PAD_SD4_DAT6__SD4_DATA6		0x17059
				MX6QDL_PAD_SD4_DAT7__SD4_DATA7		0x17059
			>;
		};

		pinctrl_i2c1: i2c1grp {
			fsl,pins = <
				MX6QDL_PAD_CSI0_DAT8__I2C1_SDA		0x4001b8b1
				MX6QDL_PAD_CSI0_DAT9__I2C1_SCL		0x4001b8b1
			>;
		};

		pinctrl_i2c2: i2c2grp {
			fsl,pins = <
				MX6QDL_PAD_KEY_ROW3__I2C2_SDA		0x4001b8b1
				MX6QDL_PAD_KEY_COL3__I2C2_SCL		0x4001b8b1
			>;
		};

		pinctrl_i2c3: i2c3grp {
			fsl,pins = <
				MX6QDL_PAD_GPIO_6__I2C3_SDA			0x4001b8b1
				MX6QDL_PAD_GPIO_3__I2C3_SCL			0x4001b8b1
			>;
		};

		pinctrl_enet: enetgrp {
			fsl,pins = <
				MX6QDL_PAD_RGMII_RXC__RGMII_RXC		0x1b0b0
				MX6QDL_PAD_RGMII_RD0__RGMII_RD0		0x1b0b0
				MX6QDL_PAD_RGMII_RD1__RGMII_RD1		0x1b0b0
				MX6QDL_PAD_RGMII_RD2__RGMII_RD2		0x1b0b0
				MX6QDL_PAD_RGMII_RD3__RGMII_RD3		0x1b0b0
				MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL	0x1b0b0
				MX6QDL_PAD_RGMII_TXC__RGMII_TXC		0x1b0b0
				MX6QDL_PAD_RGMII_TD0__RGMII_TD0		0x1b0b0
				MX6QDL_PAD_RGMII_TD1__RGMII_TD1		0x1b0b0
				MX6QDL_PAD_RGMII_TD2__RGMII_TD2		0x1b0b0
				MX6QDL_PAD_RGMII_TD3__RGMII_TD3		0x1b0b0
				MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL	0x1b0b0
				MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK	0x1b0b0
				MX6QDL_PAD_ENET_MDIO__ENET_MDIO		0x1b0b0
				MX6QDL_PAD_ENET_MDC__ENET_MDC		0x1b0b0
				/* KSZ9031 PHY Reset */
				MX6QDL_PAD_EIM_D23__GPIO3_IO23			0x80000000
			>;
		};

		pinctrl_usbh1: usbh1grp {
			fsl,pins = <
				MX6QDL_PAD_EIM_D30__USB_H1_OC			0x1b0b0
			>;
		};

		pinctrl_usbh1_vcc: usbh1vccgrp {
			fsl,pins = <
				MX6QDL_PAD_EIM_D31__GPIO3_IO31			0x1b0b0
			>;
		};

		pinctrl_usbotg: usbotggrp {
			fsl,pins = <
				MX6QDL_PAD_GPIO_1__USB_OTG_ID			0x17059
				MX6QDL_PAD_EIM_D21__USB_OTG_OC			0x1b0b0
			>;
		};

		pinctrl_usbotg_vcc: usbotgvccgrp {
			fsl,pins = <
				MX6QDL_PAD_EIM_D22__GPIO3_IO22			0x1b0b1
			>;
		};

		pinctrl_pwm1: pwm1grp {
			fsl,pins = <
				MX6QDL_PAD_SD1_DAT3__PWM1_OUT			0x1b0b1
			>;
		};

		pinctrl_audmux: audmuxgrp {
			fsl,pins = <
				/* SGTL5000 sys_mclk */
				MX6QDL_PAD_GPIO_0__CCM_CLKO1		0x030b0
				MX6QDL_PAD_CSI0_DAT4__AUD3_TXC		0x130b0
				MX6QDL_PAD_CSI0_DAT5__AUD3_TXD		0x110b0
				MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS		0x130b0
				MX6QDL_PAD_CSI0_DAT7__AUD3_RXD		0x130b0
			>;
		};

		pinctrl_led: ledgrp {
			fsl,pins = <
				/* user led */
				MX6QDL_PAD_DISP0_DAT17__GPIO5_IO11		0x1b0b1
			>;
		};

		pinctrl_flexcan1: flexcan1grp {
			fsl,pins = <
				MX6QDL_PAD_GPIO_7__FLEXCAN1_TX		0x1b0b0
				MX6QDL_PAD_GPIO_8__FLEXCAN1_RX		0x1b0b0
			>;
		};

		pinctrl_display: dispgrp {
			fsl,pins = <
				/* DISP GPIO2 1,20 */
				MX6QDL_PAD_SD1_CLK__GPIO1_IO20			0x1b0b1
				/* DISP INT   1,17 */
				MX6QDL_PAD_SD1_DAT1__GPIO1_IO17			0x1b0b1
				/* DISP GPIO1 1,19 */
				MX6QDL_PAD_SD1_DAT2__GPIO1_IO19			0x1b0b1
			>;
		};
	};
};

&can1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_flexcan1>;
	xceiver-supply = <&reg_5p0v>;
	status = "okay";
};

&audmux {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_audmux>;
	status = "okay";
};

&ssi1 {
	status = "okay";
};

&pwm1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_pwm1>;
	status = "okay";
};

&fec {
	phy-supply=<&reg_3p3v>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_enet>;
	phy-mode = "rgmii";
	phy-reset-gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
	phy-reset-duration = <100>;
	status = "okay";
};

&uart1 {
	/* RS-232C Port */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart1>;
	status = "okay";
};

&uart2 {
	/* RS-485 Port */
	compatible = "fsl,imx6-ekuart";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart2>;
	rs485-rts-active-low;
	rts-gpio = <&gpio3 18 GPIO_ACTIVE_LOW>;
	linux,rs485-enabled-at-boot-time;
	rs485-rts-delay = <0 0>;
	status = "okay";
};

&uart3 {
	/* Debug port / console */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart3>;
	status = "okay";
};

&usdhc2 {
	/* WiFi SDIO */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usdhc2>;
	bus-width = <4>;
	non-removable;
	vmmc-supply = <&reg_sdio_en>;
	vqmmc-supply = <&reg_3p3v>;
	voltage-ranges = <3300 3300>;
	no-1-8-v;
	max-frequency = <25000000>;
	status = "okay";
};

&usdhc3 {
	/* uSD / MMC */
	compatible = "fsl,imx6q-usdhc";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usdhc3>;
	cd-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
	bus-width = <4>;
	vmmc-supply = <&reg_3p3v>;
	vqmmc-supply = <&reg_3p3v>;
	voltage-ranges = <3300 3300>;
	no-1-8-v;
	status = "okay";
};

&usdhc4 {
	/* eMMC */
	compatible = "fsl,imx6q-usdhc";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usdhc4>;
	bus-width = <8>;
	vmmc-supply = <&reg_3p3v>;
	vqmmc-supply = <&reg_3p3v>;
	voltage-ranges = <3300 3300>;
	no-1-8-v;
	non-removable;
	status = "okay";
};

&i2c1 {
	clock-frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c1>;
	status = "okay";

	codec: sgtl5000 at 0a {
		compatible = "fsl,sgtl5000";
		reg = <0x0a>;
		clocks = <&clks IMX6QDL_CLK_CKO>;
		VDDA-supply = <&reg_3p3v>;
		VDDIO-supply = <&reg_3p3v>;
		VDDD-supply = <&reg_1p2v>;
	};

	at24 at 50 {
		compatible = "at24,24c64";
		pagesize = <64>;
		reg = <0x50>;
	};

	pcf8563: rtc at 51 {
		compatible = "phg,pcf8563";
		reg = <0x51>;
	};
};

&i2c2 {
	clock-frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c2>;
	status = "okay";
};

&i2c3 {
	clock-frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c3>;
	status = "okay";
};

&usbh1 {
	vbus-supply = <&reg_usb_h1_vbus>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usbh1
					&pinctrl_usbh1_vcc>;
	dr_mode = "host";
	status = "okay";
};

&usbotg {
	vbus-supply = <&reg_usb_otg_vbus>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usbotg
					&pinctrl_usbotg_vcc>;
	dr_mode = "otg";
	status = "okay";
};

&hdmi {
	ddc-i2c-bus = <&i2c2>;
	status = "disabled";
};

&ldb {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "disabled";

	lvds0: lvds-channel at 0 {
		fsl,data-mapping = "spwg";
		fsl,data-width = <24>;
		status = "disabled";

		display-timings {
			native-mode = <&am1024600l>;
			/* DISPLAY 800x480 */
			ph800480t013: ph800480t013 {
				clock-frequency = <33300000>;
				hactive = <800>;
				vactive = <480>;
				hback-porch = <46>;
				hfront-porch = <210>;
				vback-porch = <23>;
				vfront-porch = <22>;
				hsync-len = <1>;
				vsync-len = <1>;
				hsync-active = <0>;
				vsync-active = <0>;
				de-active = <1>;
				pixelclk-active = <0>;
			};
			/* DISPLAY 1024x600 AMPIRE AM-1024600LTM LVDS */
			am1024600l: am1024600l {
				clock-frequency = <51200000>;
				hactive = <1024>;
				vactive = <600>;
				hback-porch = <0>;
				hfront-porch = <320>;
				vback-porch = <0>;
				vfront-porch = <35>;
				hsync-len = <1>;
				vsync-len = <1>;
				hsync-active = <0>;
				vsync-active = <0>;
				de-active = <1>;
				pixelclk-active = <0>;
			};
			/* DISPLAY 1280x800 AMPIRE AM1280800N3TZ */
			am128080n3tz: am1280800n3tz {
				clock-frequency = <71000000>;
				hactive = <1280>;
				vactive = <800>;
				hback-porch = <50>;
				hfront-porch = <50>;
				vback-porch = <5>;
				vfront-porch = <5>;
				hsync-len = <60>;
				vsync-len = <13>;
				hsync-active = <0>;
				vsync-active = <0>;
				de-active = <1>;
				pixelclk-active = <0>;
			};
		};

		port at 4 {
			reg = <4>;
			lvds0_out: endpoint {
				remote-endpoint = <&in_lvds0>;
			};
		};

	};
};


More information about the barebox mailing list