tytyty
Posts: 38
Joined: Wed Aug 30, 2017 4:40 am

How do I modify the dts file on raspbeery pi 3 B?

Thu Sep 14, 2017 6:39 am

Hi,
all ,I'm porting EV76C560's drive to raspberry Pi 3 B.Here's my driver.

Code: Select all

  #include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <asm/div64.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h>
#include <media/i2c/mt9v011.h>

struct ev76c560 {
	struct v4l2_subdev sd;
#ifdef CONFIG_MEDIA_CONTROLLER
	struct media_pad pad;
#endif
	struct v4l2_ctrl_handler ctrls;
	unsigned width, height;
	unsigned xtal;
	unsigned hflip:1;
	unsigned vflip:1;

	u16 global_gain, exposure;
	s16 red_bal, blue_bal;
};

static inline struct mt9v011 *to_ev76c560(struct v4l2_subdev *sd)
{
	return container_of(sd, struct ev76c560, sd);
}


static int ev76c560_read(struct v4l2_subdev *sd, unsigned char addr)
{
	struct i2c_client *c = v4l2_get_subdevdata(sd);
	__be16 buffer;
	int rc, val;

	rc = i2c_master_send(c, &addr, 1);
	//if (rc != 1)
	//	v4l2_dbg(0, debug, sd,
	//		 "i2c i/o error: rc == %d (should be 1)\n", rc);

	msleep(10);

	rc = i2c_master_recv(c, (char *)&buffer, 2);
//	if (rc != 2)
//		v4l2_dbg(0, debug, sd,
//			 "i2c i/o error: rc == %d (should be 2)\n", rc);

	val = be16_to_cpu(buffer);

//	v4l2_dbg(2, debug, sd, "mt9v011: read 0x%02x = 0x%04x\n", addr, val);

	return val;
}

static void ev76c560_write(struct v4l2_subdev *sd, unsigned char addr,
				 u16 value)
{
	struct i2c_client *c = v4l2_get_subdevdata(sd);
	unsigned char buffer[3];
	int rc;

	buffer[0] = addr;
	buffer[1] = value >> 8;
	buffer[2] = value & 0xff;

//	v4l2_dbg(2, debug, sd,
//		 "mt9v011: writing 0x%02x 0x%04x\n", buffer[0], value);
	rc = i2c_master_send(c, buffer, 3);
//	if (rc != 3)
//		v4l2_dbg(0, debug, sd,
//			 "i2c i/o error: rc == %d (should be 3)\n", rc);
}



static int ev76c560_set_fmt(struct v4l2_subdev *sd,
		struct v4l2_subdev_pad_config *cfg,
		struct v4l2_subdev_format *format)
{
	//struct v4l2_mbus_framefmt *fmt = &format->format;
	//struct 76c560 *core = to_76c560(sd);

	/*if (format->pad || fmt->code != MEDIA_BUS_FMT_SGRBG8_1X8)
		return -EINVAL;

	v4l_bound_align_image(&fmt->width, 48, 639, 1,
			      &fmt->height, 32, 480, 1, 0);
	fmt->field = V4L2_FIELD_NONE;
	fmt->colorspace = V4L2_COLORSPACE_SRGB;

	if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
		core->width = fmt->width;
		core->height = fmt->height;

		set_res(sd);
	} else {
		cfg->try_fmt = *fmt;
	}

	return 0;*/
}



static int ev76c560_enum_mbus_code(struct v4l2_subdev *sd,
		struct v4l2_subdev_pad_config *cfg,
		struct v4l2_subdev_mbus_code_enum *code)
{
	//if (code->pad || code->index > 0)
	//	return -EINVAL;
//
//	code->code = MEDIA_BUS_FMT_SGRBG8_1X8;
//	return 0;
}



static int ev76c560_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *parms)
{
	struct v4l2_captureparm *cp = &parms->parm.capture;
	struct v4l2_fract *tpf = &cp->timeperframe;
	u16 speed;

	if (parms->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
		return -EINVAL;
	if (cp->extendedmode != 0)
		return -EINVAL;

//	speed = calc_speed(sd, tpf->numerator, tpf->denominator);

//	mt9v011_write(sd, R0A_MT9V011_CLK_SPEED, speed);
//	v4l2_dbg(1, debug, sd, "Setting speed to %d\n", speed);

	/* Recalculate and update fps info */
//	calc_fps(sd, &tpf->numerator, &tpf->denominator);

	return 0;
}


static int ev76c560_g_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *parms)
{
	struct v4l2_captureparm *cp = &parms->parm.capture;

	if (parms->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
		return -EINVAL;

	memset(cp, 0, sizeof(struct v4l2_captureparm));
	cp->capability = V4L2_CAP_TIMEPERFRAME;
//	calc_fps(sd,
//		 &cp->timeperframe.numerator,
//		 &cp->timeperframe.denominator);

	return 0;
}






static int ev76c560_reset(struct v4l2_subdev *sd, u32 val)
{
//	int i;

//	for (i = 0; i < ARRAY_SIZE(mt9v011_init_default); i++)
//		mt9v011_write(sd, mt9v011_init_default[i].reg,
//			       mt9v011_init_default[i].value);

//	set_balance(sd);
//	set_res(sd);
//	set_read_mode(sd);

//	return 0;
}




static const struct v4l2_subdev_core_ops ev76c560_core_ops = {
	.reset = ev76c560_reset,
#ifdef CONFIG_VIDEO_ADV_DEBUG
	.g_register = mt9v011_g_register,
	.s_register = mt9v011_s_register,
#endif
};

static const struct v4l2_subdev_video_ops ev76c560_video_ops = {
	.g_parm = ev76c560_g_parm,
	.s_parm = ev76c560_s_parm,
};

static const struct v4l2_subdev_pad_ops ev76c560_pad_ops = {
	.enum_mbus_code = ev76c560_enum_mbus_code,
	.set_fmt = ev76c560_set_fmt,
};




static const struct v4l2_subdev_ops ev76c560_ops = {
	.core  = &ev76c560_core_ops,
	.video = &ev76c560_video_ops,
	.pad   = &ev76c560_pad_ops,
};





static int ev76c560_probe(struct i2c_client *c,
			 const struct i2c_device_id *id)
{
	printk("ev76c560 probe is by tangyuan===============================================\n");
	struct ev76c560 *core;
	struct v4l2_subdev *sd;
	
	
	if (!i2c_check_functionality(c->adapter,
	     I2C_FUNC_SMBUS_READ_BYTE | I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
		return -EIO;

	core = devm_kzalloc(&c->dev, sizeof(struct ev76c560), GFP_KERNEL);
	if (!core)
		return -ENOMEM;

	sd = &core->sd;
	v4l2_i2c_subdev_init(sd, c, &ev76c560_ops);
	return 0;










}

static int ev76c560_remove(struct i2c_client *c)
{
	struct v4l2_subdev *sd = i2c_get_clientdata(c);
	struct ev76c560 *core = to_ev76c560(sd);

//	v4l2_dbg(1, debug, sd,
//		"mt9v011.c: removing mt9v011 adapter on address 0x%x\n",
//		c->addr << 1);

	v4l2_device_unregister_subdev(sd);
	//v4l2_ctrl_handler_free(&core->ctrls);

	return 0;
}


static const struct i2c_device_id ev76c560_id[] = {
	{ "ev76c560", 0 },
	{ }
};
MODULE_DEVICE_TABLE(i2c, ev76c560_id);

static struct i2c_driver ev76c560_driver = {
	.driver = {
		.name	= "ev76c560",
	},
	.probe		= ev76c560_probe,
	.remove		= ev76c560_remove,
	.id_table	= ev76c560_id,
};

module_i2c_driver(ev76c560_driver);
MODULE_DESCRIPTION("Micron 76c560 sensor driver");
MODULE_AUTHOR("tangyuan");
MODULE_LICENSE("GPL");

However, the function ev76c560_probe has not been implemented.Do I have to modify the DTS file and match the id_table in ev76c560's driver?How do I change the DTS file about I2C?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4528
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How do I modify the dts file on raspbeery pi 3 B?

Thu Sep 14, 2017 7:42 am

I'm not sure that driver will do what you want as it appears to be a V4L2 subdevice driver. Normally those are associated with a secondary driver that handles receiving the data via DMA. What interface does the EV76C560 use to transfer the image data? I can't see a useful datasheet for it having done a quick search.

But to answer your question, the simplest solution is to use a device tree overlay, as documented at https://www.raspberrypi.org/documentati ... ce-tree.md
If you look in the kernel source tree at https://github.com/raspberrypi/linux/tr ... s/overlays you'll find the existing overlays, which includes many I2C devices. There's also a whole subforum on the subject - viewforum.php?f=107
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

tytyty
Posts: 38
Joined: Wed Aug 30, 2017 4:40 am

Re: How do I modify the dts file on raspbeery pi 3 B?

Thu Sep 14, 2017 8:47 am

HI,
Thank you for your reply!.
Firstly,i would like to ask I should modify the file bcm2710-rpi-3-b.dts, which exists in the arch/arm/boot/dts directory, or modify the file i2c-sensor-overlay.dts, which exists in arch/arm/boot/dts/overlays ?
Which file should I modify?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4528
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How do I modify the dts file on raspbeery pi 3 B?

Thu Sep 14, 2017 9:10 am

tytyty wrote:
Thu Sep 14, 2017 8:47 am
HI,
Thank you for your reply!.
Firstly,i would like to ask I should modify the file bcm2710-rpi-3-b.dts, which exists in the arch/arm/boot/dts directory, or modify the file i2c-sensor-overlay.dts, which exists in arch/arm/boot/dts/overlays ?
Which file should I modify?
Neither - create a new overlay.
bcm2710-rpi-3-b.dts defines the base hardware. You aren't modifying the base hardware
i2c-sensor-overlay.dts is "// Definitions for I2C based sensors using the Industrial IO or HWMON interface.". You aren't using those interfaces as you're using an image sensor.

Your other issue is that the mt9v011 driver you've based yours on doesn't support device tree. If you look at something like the ov5647 driver which does, then you'll see a section along the lines of

Code: Select all

#if IS_ENABLED(CONFIG_OF)
static const struct of_device_id ov5647_of_match[] = {
	{ .compatible = "ovti,ov5647" },
	{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, ov5647_of_match);
#endif
The "ovti,ov5647" string is what needs to go in the compatible section of your overlay, although you can normally skip the manufacturer bit (ovti in this case).
https://github.com/6by9/linux/blob/unic ... verlay.dts is an overlay for loading the OV5647 driver and attaching it to the CSI2 receiver driver. Please note that in the case of this overlay it is attaching to i2c_vc which is the one used by the camera, display, and HATs. You probably want i2c_arm if you're connecting to GPIOs 2&3 for the I2C.
Look at the commit that added that file if you want to see the other files to modify to get it built automatically. I should have added a description to the README file too, but forgot.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4528
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How do I modify the dts file on raspbeery pi 3 B?

Thu Sep 14, 2017 9:51 am

I've just merged your patch into a local 4.13 branch of mine, added the required overlay config, and fixed up a couple of compile errors. Have a look at https://github.com/6by9/linux/tree/ev76c50
Build with the normal commands, push to the Pi, and add "dtoverlay=ev76c560" to /boot/config.txt, and I get your printk logged.

I've only added the module for Pi2 & 3. You'll need to alter arch/arm/configs/bcmrpi_defconfig in the same way as I have done bcm2709_defconfig if you're on a Pi0 or 1.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

tytyty
Posts: 38
Joined: Wed Aug 30, 2017 4:40 am

Re: How do I modify the dts file on raspbeery pi 3 B?

Fri Sep 15, 2017 7:14 am

HI,
I did as you told me, but still can't get my printk logged.
I gave my process and please give me some idea
Firstly, my sensor driver is as follows:

Code: Select all

   static const struct of_device_id ev76c560_of_match[] = {

	{ .compatible = "ev76c560" },

	{ /* sentinel */ },

};

static const struct i2c_device_id ev76c560_id[] = {

	{ "ev76c560", 0 },

	{ }

};

MODULE_DEVICE_TABLE(i2c, ev76c560_id);

MODULE_DEVICE_TABLE(of, ev76c560_of_match);

static struct i2c_driver ev76c560_driver = {

	.driver = {

		.name	= "ev76c560",

		.of_match_table = of_match_ptr(ev76c560_of_match),

	},

	.probe		= ev76c560_probe,

	.remove		= ev76c560_remove,

	.id_table	= ev76c560_id,

};

module_i2c_driver(ev76c560_driver);

Secondly ,i added the file in arch/arm/boot/dts/overlays/ev76c560-overlay.dts 

// Definitions for EV76C560 camera module on ARM I2C bus
/dts-v1/;
/plugin/;

/{
	compatible = "brcm,bcm2708";

	fragment@0 {
		target = <&i2c_arm>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";

			ev76c50: ev76c560@36 {
				compatible = "ev76c560";
				reg = <0x36>;
				status = "okay";

				port {
					ev76c560_0: endpoint {
						remote-endpoint = <&csi1_ep>;
						clock-lanes = <0>;
						data-lanes = <1 2>;
						link-frequencies =
							/bits/ 64 <297000000>;
					};
				};
			};
		};
	};

	fragment@1 {
		target = <&csi1>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";

			port {
				#address-cells = <1>;
				#size-cells = <0>;
				csi1_ep: endpoint {
					remote-endpoint = <&ev76c560_0>;
				};
			};
		};
	};
};

Thirdly,i added one line in arch/arm/boot/dts/overlays/Makefile
dtbo-$(CONFIG_ARCH_BCM2835) += \
	adau1977-adc.dtbo \
	adau7002-simple.dtbo \
	ads1015.dtbo \
	ads1115.dtbo \
	ads7846.dtbo \
	akkordion-iqdacplus.dtbo \
	allo-boss-dac-pcm512x-audio.dtbo \
	allo-digione.dtbo \
	allo-piano-dac-pcm512x-audio.dtbo \
	allo-piano-dac-plus-pcm512x-audio.dtbo \
	at86rf233.dtbo \
	audioinjector-addons.dtbo \
	audioinjector-wm8731-audio.dtbo \
	audremap.dtbo \
	bmp085_i2c-sensor.dtbo \
	dht11.dtbo \
	dionaudio-loco.dtbo \
	dionaudio-loco-v2.dtbo \
	dpi18.dtbo \
	dpi24.dtbo \
	dwc-otg.dtbo \
	dwc2.dtbo \
	enc28j60.dtbo \
	enc28j60-spi2.dtbo \
	fe-pi-audio.dtbo \
	goodix.dtbo \
	ev76c560.dtbo \  

Finally,i added one line in /boot/config.txt

dtparam=audio=on
start_x=1
gpu_mem=128
enable_uart=1
dtoverlay=ev76c560

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4528
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How do I modify the dts file on raspbeery pi 3 B?

Fri Sep 15, 2017 8:37 am

Have you added your driver to a kconfig or makefile somewhere, or are you building the driver by itself?

I've done the work for you of integrating your driver into the full kernel tree. Are you reinventing the wheel for some reason?

Ps please use the code tags when posting code to make the posts more readable and preserve indentation.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

texy
Forum Moderator
Forum Moderator
Posts: 5003
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: How do I modify the dts file on raspbeery pi 3 B?

Fri Sep 15, 2017 8:44 am

6by9 wrote:
Fri Sep 15, 2017 8:37 am

Ps please use the code tags when posting code to make the posts more readable and preserve indentation.
I've done that for the OP this time, but good advice for future posts.....

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

tytyty
Posts: 38
Joined: Wed Aug 30, 2017 4:40 am

Re: How do I modify the dts file on raspbeery pi 3 B?

Fri Sep 15, 2017 8:49 am

HI,
i have already added my driver to a kconfig or makefile.I've seen the work you've done for me.Thank you very much.
Can you help me again?I still can't my printk logged

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4528
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How do I modify the dts file on raspbeery pi 3 B?

Fri Sep 15, 2017 11:01 am

tytyty wrote:
Fri Sep 15, 2017 8:49 am
i have already added my driver to a kconfig or makefile.I've seen the work you've done for me.Thank you very much.
Can you help me again?I still can't my printk logged
Far too many places where there could be a missed step.
- Check that you are running your new kernel using "uname -a" and looking at the version and build date.
- Add "dt_debug=1" to /boot/config.txt, and then check the log messages via "sudo vcdbg log msg" that your overlay is being applied.
- Look in the live dt config that nodes exist (ls -l /proc/device-tree/soc/i2c@7e804000/)
- Is your module installed? "modinfo ev76c560". If not, then "sudo depmod -a" and retry. Is it even on your device? "ls -l /lib/modules/`uname -r`/kernel/drivers/media/i2c/"
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

tytyty
Posts: 38
Joined: Wed Aug 30, 2017 4:40 am

Re: How do I modify the dts file on raspbeery pi 3 B?

Mon Sep 18, 2017 1:56 am

HI,
I have added the "dt_debug=1" to /boot/config.txt. I checked the log messages via "sudo vcdbg log msg".The message is as follows:
pi@raspberrypi:~$ sudo vcdbg log msg
001478.665: brfs: File read: /mfs/sd/config.txt
001479.844: brfs: File read: 2000 bytes
001489.496: HDMI:EDID error reading EDID block 0 attempt 0
001490.760: HDMI:EDID error reading EDID block 0 attempt 1
001492.019: HDMI:EDID error reading EDID block 0 attempt 2
001493.278: HDMI:EDID error reading EDID block 0 attempt 3
001494.536: HDMI:EDID error reading EDID block 0 attempt 4
001495.795: HDMI:EDID error reading EDID block 0 attempt 5
001497.052: HDMI:EDID error reading EDID block 0 attempt 6
001498.311: HDMI:EDID error reading EDID block 0 attempt 7
001499.569: HDMI:EDID error reading EDID block 0 attempt 8
001500.828: HDMI:EDID error reading EDID block 0 attempt 9
001501.850: HDMI:EDID giving up on reading EDID block 0
001518.671: brfs: File read: /mfs/sd/config.txt
001519.724: HDMI:Setting property pixel encoding to Default
001519.742: HDMI:Setting property pixel clock type to PAL
001519.761: HDMI:Setting property content type flag to No data
001519.779: HDMI:Setting property fuzzy format match to enabled
001719.472: hdmi: HDMI:>>>>>>>>>>>>>Rx sensed, reading EDID<<<<<<<<<<<<<
001719.785: hdmi: HDMI:EDID error reading EDID block 0 attempt 0
001721.053: hdmi: HDMI:EDID error reading EDID block 0 attempt 1
001722.317: hdmi: HDMI:EDID error reading EDID block 0 attempt 2
001723.580: hdmi: HDMI:EDID error reading EDID block 0 attempt 3
001724.844: hdmi: HDMI:EDID error reading EDID block 0 attempt 4
001726.108: hdmi: HDMI:EDID error reading EDID block 0 attempt 5
001727.371: hdmi: HDMI:EDID error reading EDID block 0 attempt 6
001728.634: hdmi: HDMI:EDID error reading EDID block 0 attempt 7
001729.897: hdmi: HDMI:EDID error reading EDID block 0 attempt 8
001731.160: hdmi: HDMI:EDID error reading EDID block 0 attempt 9
001732.186: hdmi: HDMI:EDID giving up on reading EDID block 0
001732.220: hdmi: HDMI: No lookup table for resolution group 0
001732.238: hdmi: HDMI: hotplug attached with DVI support
001732.272: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001732.577: hdmi: HDMI:EDID error reading EDID block 0 attempt 0
001733.838: hdmi: HDMI:EDID error reading EDID block 0 attempt 1
001735.100: hdmi: HDMI:EDID error reading EDID block 0 attempt 2
001736.361: hdmi: HDMI:EDID error reading EDID block 0 attempt 3
001737.622: hdmi: HDMI:EDID error reading EDID block 0 attempt 4
001738.883: hdmi: HDMI:EDID error reading EDID block 0 attempt 5
001740.144: hdmi: HDMI:EDID error reading EDID block 0 attempt 6
001741.405: hdmi: HDMI:EDID error reading EDID block 0 attempt 7
001742.666: hdmi: HDMI:EDID error reading EDID block 0 attempt 8
001743.927: hdmi: HDMI:EDID error reading EDID block 0 attempt 9
001744.951: hdmi: HDMI:EDID giving up on reading EDID block 0
001747.391: hdmi: HDMI: power_on to DMT mode Custom
001750.575: hdmi: HDMI: Action callback added to queue to happen at frame 2
001750.596: hdmi: HDMI: Action stop_3d_mode added to queue to happen at frame 2
001750.620: hdmi: HDMI: Action unmute added to queue to happen at frame 3
001750.646: hdmi: HDMI: Action cec_init added to queue to happen at frame 3
001801.318: *** Restart logging
001801.345: brfs: File read: 2000 bytes
001805.544: brfs: File read: /mfs/sd/cmdline.txt
001805.621: Read command line from file 'cmdline.txt'
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=4071b473-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait splash plymouth.ignore-serial-consoles
001805.895: brfs: File read: 182 bytes
002133.619: brfs: File read: /mfs/sd/kernel.img
002133.644: Loading 'kernel.img' to 0x8000 size 0x47c178
002137.273: No kernel trailer - assuming DT-capable
002137.302: brfs: File read: 4702584 bytes
002140.804: brfs: File read: /mfs/sd/bcm2710-rpi-3-b.dtb
002140.829: Loading 'bcm2710-rpi-3-b.dtb' to 0x484178 size 0x44d8
002247.027: brfs: File read: 17624 bytes
002252.435: brfs: File read: /mfs/sd/config.txt
002252.962: dtparam: i2c_arm=on
002262.156: dtparam: spi=on
002269.983: dtparam: audio=on
002281.732: brfs: File read: 2000 bytes
002289.488: brfs: File read: /mfs/sd/overlays/ev76c560.dtbo
002296.879: dterror: can't find symbol 'csi1'
002296.893: Failed to resolve overlay 'ev76c560'
003221.303: Device tree loaded to 0x2effb600 (size 0x4927)
003223.588: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
004563.532: vchiq_core: vchiq_init_state: slot_zero = 0xf7980000, is_master = 1
004567.881: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
004573.316: TV service:host side not connected, dropping notification 0x00000002, 0x00000002, 0x00000057

I run modinfo and the message is as follows:


pi@raspberrypi:~$ modinfo ev76c560
modinfo: ERROR: Module ev76c560 not found.
pi@raspberrypi:~$


I run ls -l /lib/modules/`uname -r`/kernel/drivers/media/i2c/ and the messgae is as follows:
pi@raspberrypi:~$ ls -l /lib/modules/`uname -r`/kernel/drivers/media/i2c/
total 224
-rw-r--r-- 1 root root 8972 Aug 29 07:59 cs53l32a.ko
drwxr-xr-x 2 root root 4096 Aug 29 07:59 cx25840
-rw-r--r-- 1 root root 14071 Aug 29 07:59 ir-kbd-i2c.ko
-rw-r--r-- 1 root root 42498 Aug 29 07:59 msp3400.ko
-rw-r--r-- 1 root root 13758 Aug 29 07:59 mt9v011.ko
-rw-r--r-- 1 root root 6202 Aug 29 07:59 ov7640.ko
-rw-r--r-- 1 root root 26359 Aug 29 07:59 saa7115.ko
-rw-r--r-- 1 root root 8904 Aug 29 07:59 sony-btf-mpx.ko
-rw-r--r-- 1 root root 27678 Aug 29 07:59 tvp5150.ko
-rw-r--r-- 1 root root 11470 Aug 29 07:59 tw2804.ko
-rw-r--r-- 1 root root 8484 Aug 29 07:59 tw9903.ko
-rw-r--r-- 1 root root 8420 Aug 29 07:59 tw9906.ko
-rw-r--r-- 1 root root 6392 Aug 29 07:59 uda1342.ko
-rw-r--r-- 1 root root 9321 Aug 29 07:59 wm8775.ko

Can you have a look at it? and give me some idea
Thanks

tytyty
Posts: 38
Joined: Wed Aug 30, 2017 4:40 am

Re: How do I modify the dts file on raspbeery pi 3 B?

Mon Sep 18, 2017 7:08 am

The latest phenomenon is this
I run sudo vcdbg log msg:
pi@raspberrypi:~$ sudo vcdbg log msg
001318.979: brfs: File read: /mfs/sd/config.txt
001319.857: brfs: File read: 1620 bytes
001329.544: HDMI:EDID error reading EDID block 0 attempt 0
001330.808: HDMI:EDID error reading EDID block 0 attempt 1
001332.065: HDMI:EDID error reading EDID block 0 attempt 2
001333.324: HDMI:EDID error reading EDID block 0 attempt 3
001334.581: HDMI:EDID error reading EDID block 0 attempt 4
001335.839: HDMI:EDID error reading EDID block 0 attempt 5
001337.097: HDMI:EDID error reading EDID block 0 attempt 6
001338.355: HDMI:EDID error reading EDID block 0 attempt 7
001339.612: HDMI:EDID error reading EDID block 0 attempt 8
001340.870: HDMI:EDID error reading EDID block 0 attempt 9
001341.891: HDMI:EDID giving up on reading EDID block 0
001359.004: brfs: File read: /mfs/sd/config.txt
001359.751: HDMI:Setting property pixel encoding to Default
001359.769: HDMI:Setting property pixel clock type to PAL
001359.789: HDMI:Setting property content type flag to No data
001359.807: HDMI:Setting property fuzzy format match to enabled
001861.094: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001861.122: hdmi: HDMI:>>>>>>>>>>>>>Rx sensed, reading EDID<<<<<<<<<<<<<
001861.435: hdmi: HDMI:EDID error reading EDID block 0 attempt 0
001862.701: hdmi: HDMI:EDID error reading EDID block 0 attempt 1
001863.962: hdmi: HDMI:EDID error reading EDID block 0 attempt 2
001865.223: hdmi: HDMI:EDID error reading EDID block 0 attempt 3
001866.484: hdmi: HDMI:EDID error reading EDID block 0 attempt 4
001867.745: hdmi: HDMI:EDID error reading EDID block 0 attempt 5
001869.006: hdmi: HDMI:EDID error reading EDID block 0 attempt 6
001870.267: hdmi: HDMI:EDID error reading EDID block 0 attempt 7
001871.528: hdmi: HDMI:EDID error reading EDID block 0 attempt 8
001872.790: hdmi: HDMI:EDID error reading EDID block 0 attempt 9
001873.815: hdmi: HDMI:EDID giving up on reading EDID block 0
001873.847: hdmi: HDMI: No lookup table for resolution group 0
001873.866: hdmi: HDMI: hotplug attached with DVI support
001873.898: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001874.191: hdmi: HDMI:EDID error reading EDID block 0 attempt 0
001875.454: hdmi: HDMI:EDID error reading EDID block 0 attempt 1
001876.717: hdmi: HDMI:EDID error reading EDID block 0 attempt 2
001877.980: hdmi: HDMI:EDID error reading EDID block 0 attempt 3
001879.243: hdmi: HDMI:EDID error reading EDID block 0 attempt 4
001880.506: hdmi: HDMI:EDID error reading EDID block 0 attempt 5
001881.769: hdmi: HDMI:EDID error reading EDID block 0 attempt 6
001883.032: hdmi: HDMI:EDID error reading EDID block 0 attempt 7
001884.295: hdmi: HDMI:EDID error reading EDID block 0 attempt 8
001885.558: hdmi: HDMI:EDID error reading EDID block 0 attempt 9
001886.585: hdmi: HDMI:EDID giving up on reading EDID block 0
001887.335: hdmi: HDMI: hotplug deassert
001887.348: hdmi: HDMI: HDMI is currently off
001887.361: hdmi: HDMI: changing mode to unplugged
001887.384: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001888.933: *** Restart logging
001888.960: brfs: File read: 1620 bytes
001893.510: brfs: File read: /mfs/sd/cmdline.txt
001893.589: Read command line from file 'cmdline.txt'
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=87292c29-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
001893.851: brfs: File read: 187 bytes
002212.442: brfs: File read: /mfs/sd/kernel7.img
002212.466: Loading 'kernel7.img' to 0x8000 size 0x47c1e8
002216.093: No kernel trailer - assuming DT-capable
002216.123: brfs: File read: 4702696 bytes
002220.205: brfs: File read: /mfs/sd/bcm2710-rpi-3-b.dtb
002220.237: Loading 'bcm2710-rpi-3-b.dtb' to 0x4841e8 size 0x44d8
002323.421: brfs: File read: 17624 bytes
002333.163: brfs: File read: /mfs/sd/overlays/rpi-ft5406.dtbo
002340.564: Loaded overlay 'rpi-ft5406'
002358.823: brfs: File read: 462 bytes
002367.740: brfs: File read: /mfs/sd/overlays/rpi-backlight.dtbo
002375.252: Loaded overlay 'rpi-backlight'
002397.259: brfs: File read: 489 bytes
002403.832: brfs: File read: /mfs/sd/config.txt
002404.330: dtparam: i2c_arm=on
002413.831: dtparam: audio=on
002425.801: brfs: File read: 1620 bytes
002432.937: brfs: File read: /mfs/sd/overlays/ev76c560.dtbo
002440.440: dterror: can't find symbol 'csi1'
002440.453: Failed to resolve overlay 'ev76c560'
003388.658: Device tree loaded to 0x2effb500 (size 0x4a0b)
003391.130: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
004533.443: vchiq_core: vchiq_init_state: slot_zero = 0xfad80000, is_master = 1
004537.603: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead


I run modinfo ev76c560
pi@raspberrypi:~$ modinfo ev76c560
filename: /lib/modules/4.9.45-v7+/kernel/drivers/media/i2c/ev76c560.ko
license: GPL
author: tangyuan
description: Micron 76c560 sensor driver
srcversion: F5B16E337E7240FFF8D6887
alias: of:N*T*Cmicron,ev76c50C*
alias: of:N*T*Cmicron,ev76c50
alias: i2c:ev76c560
depends:
intree: Y
vermagic: 4.9.45-v7+ SMP mod_unload modversions ARMv7 p2v8

I run ls -l /lib/modules/`uname -r`/kernel/drivers/media/i2c/
pi@raspberrypi:~$ ls -l /lib/modules/`uname -r`/kernel/drivers/media/i2c/
total 232
-rw-r--r-- 1 root root 8908 Sep 18 06:46 cs53l32a.ko
drwxr-xr-x 2 root root 4096 Sep 18 06:46 cx25840
-rw-r--r-- 1 root root 7700 Sep 18 06:46 ev76c560.ko
-rw-r--r-- 1 root root 14071 Sep 18 06:46 ir-kbd-i2c.ko
-rw-r--r-- 1 root root 42434 Sep 18 06:46 msp3400.ko
-rw-r--r-- 1 root root 13758 Sep 18 06:46 mt9v011.ko
-rw-r--r-- 1 root root 6202 Sep 18 06:46 ov7640.ko
-rw-r--r-- 1 root root 26295 Sep 18 06:46 saa7115.ko
-rw-r--r-- 1 root root 8904 Sep 18 06:46 sony-btf-mpx.ko
-rw-r--r-- 1 root root 27678 Sep 18 06:46 tvp5150.ko
-rw-r--r-- 1 root root 11470 Sep 18 06:46 tw2804.ko
-rw-r--r-- 1 root root 8484 Sep 18 06:46 tw9903.ko
-rw-r--r-- 1 root root 8420 Sep 18 06:46 tw9906.ko
-rw-r--r-- 1 root root 6328 Sep 18 06:46 uda1342.ko
-rw-r--r-- 1 root root 9321 Sep 18 06:46 wm8775.ko

I run ls -l /proc/device-tree/soc/i2c@7e804000/

pi@raspberrypi:~$ ls -l /proc/device-tree/soc/i2c@7e804000/
total 0
-r--r--r-- 1 root root 4 Sep 18 07:02 #address-cells
-r--r--r-- 1 root root 4 Sep 18 07:02 clock-frequency
-r--r--r-- 1 root root 8 Sep 18 07:02 clocks
-r--r--r-- 1 root root 17 Sep 18 07:02 compatible
-r--r--r-- 1 root root 8 Sep 18 07:02 interrupts
-r--r--r-- 1 root root 4 Sep 18 07:02 name
-r--r--r-- 1 root root 4 Sep 18 07:02 phandle
-r--r--r-- 1 root root 4 Sep 18 07:02 pinctrl-0
-r--r--r-- 1 root root 8 Sep 18 07:02 pinctrl-names
-r--r--r-- 1 root root 8 Sep 18 07:02 reg
-r--r--r-- 1 root root 4 Sep 18 07:02 #size-cells
-r--r--r-- 1 root root 5 Sep 18 07:02 status
pi@raspberrypi:~$

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4528
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How do I modify the dts file on raspbeery pi 3 B?

Mon Sep 18, 2017 9:00 am

You're going to have to do your own work here. You've got at least 2 issues.

The device tree parsing has told you the error:

Code: Select all

002432.937: brfs: File read: /mfs/sd/overlays/ev76c560.dtbo
002440.440: dterror: can't find symbol 'csi1'
002440.453: Failed to resolve overlay 'ev76c560'
That's partly my fault as I've given you a full DT using the V4L2 driver which provides the csi1 node. The tree I'd posted includes those entries in the base DT files.
Drop the overlay to just

Code: Select all

// Definitions for EV76C560 camera module on ARM I2C bus
/dts-v1/;
/plugin/;

/{
	compatible = "brcm,bcm2708";

	fragment@0 {
		target = <&i2c_arm>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";

			ev76c50: ev76c560@36 {
				compatible = "ev76c560";
				reg = <0x36>;
				status = "okay";

				port {
					ev76c560_0: endpoint {
						clock-lanes = <0>;
						data-lanes = <1 2>;
						link-frequencies =
							/bits/ 64 <297000000>;
					};
				};
			};
		};
	};
};
To spell it out, you also need to update the "ev76c560@36" and "reg = <0x36>;" to reflect the actual I2C address of the device as it is unlikely to be 0x36 (as used on OV5647).

Secondly you haven't got the driver present. You haven't documented your build process at all, but ev76c560.ko needs to be listed when you do "ls -l /lib/modules/`uname -r`/kernel/drivers/media/i2c/" otherwise it won't be able to load it. (I am assuming that you've put your driver in drivers/media/i2c/ within the kernel source tree. If not then amend the path that you are searching).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

tytyty
Posts: 38
Joined: Wed Aug 30, 2017 4:40 am

Re: How do I modify the dts file on raspbeery pi 3 B?

Mon Sep 18, 2017 9:22 am

HI,
6by9,
Thank you very much , i have already get my printk logged.Thank you so much for your assistance.There are more questions to ask you later

tytyty
Posts: 38
Joined: Wed Aug 30, 2017 4:40 am

Re: How do I modify the dts file on raspbeery pi 3 B?

Mon Sep 18, 2017 9:32 am

HI,
I have another question for you.
Drivers at this address: https://github.com/raspberrypi/linux/bl ... c/ov5647.c
Is he the driver of the raspberry pie OV5647? Can I refer to this driver when I write the ev76c560 driver?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4528
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How do I modify the dts file on raspbeery pi 3 B?

Mon Sep 18, 2017 10:18 am

tytyty wrote:
Mon Sep 18, 2017 9:32 am
I have another question for you.
Drivers at this address: https://github.com/raspberrypi/linux/bl ... c/ov5647.c
Is he the driver of the raspberry pie OV5647? Can I refer to this driver when I write the ev76c560 driver?
OV5647 is the V1 Pi camera module. Normally the camera module has been used with the firmware driving the camera, so this driver hasn't been used. Literally last week I sent the relevant kernel driver to the kernel mailing list to be reviewed such that the camera driver and receiver peripheral move to the ARM. All of that code is on the branch that I pointed you at, and it also includes a couple of bug fixes for the OV5647 driver.

You still haven't answered the question about how you intend to get the data back into the Pi. The Pi has a MIPI CSI-2 or CCP-2 interface. From my searches your sensor has a parallel interface. You'll need something to translate between the two. Have you got that in hand.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

tytyty
Posts: 38
Joined: Wed Aug 30, 2017 4:40 am

Re: How do I modify the dts file on raspbeery pi 3 B?

Tue Sep 19, 2017 3:18 am

Literally last week I sent the relevant kernel driver to the kernel mailing list to be reviewed such that the camera driver and receiver peripheral move to the ARM. All of that code is on the branch that I pointed you at,

You mean the link? http://www.spinics.net/lists/linux-media/msg116984.html

You still haven't answered the question about how you intend to get the data back into the Pi.

I will convert parallel to MIPI through the lcmxo2-1200hc-4tg100i. It is a component of Lattice.I intend to get the data back into the Pi with this way.

I would like to ask that the driver of ev76c560 that i wrote it myself Can use it properly? What's your point of view?I don't know what else I need to do about driving.My driver doesn't know if it fits the camera framework of BCM2837.
I come from china,and my English is very pool.I hope you don't mind

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4528
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How do I modify the dts file on raspbeery pi 3 B?

Tue Sep 19, 2017 2:12 pm

tytyty wrote:
Tue Sep 19, 2017 3:18 am
Literally last week I sent the relevant kernel driver to the kernel mailing list to be reviewed such that the camera driver and receiver peripheral move to the ARM. All of that code is on the branch that I pointed you at,

You mean the link? http://www.spinics.net/lists/linux-media/msg116984.html
Close, but that was v1 of the patch set.
v2 is
http://www.spinics.net/lists/linux-media/msg121810.html
http://www.spinics.net/lists/linux-media/msg121811.html
http://www.spinics.net/lists/linux-media/msg121812.html
http://www.spinics.net/lists/linux-media/msg121813.html
http://www.spinics.net/lists/linux-media/msg121814.html
v3 due out tomorrow as there have been a couple of changes requested to v2.
tytyty wrote:
You still haven't answered the question about how you intend to get the data back into the Pi.
I will convert parallel to MIPI through the lcmxo2-1200hc-4tg100i. It is a component of Lattice.I intend to get the data back into the Pi with this way.
OK, as long as you have something planned. It was looking like you were trying to write drivers for a pipeline that just wouldn't work. Using an FPGA to convert should work fine.
tytyty wrote:I would like to ask that the driver of ev76c560 that i wrote it myself Can use it properly? What's your point of view?I don't know what else I need to do about driving.My driver doesn't know if it fits the camera framework of BCM2837.
The Unicam driver linked to above deals with the CSI2 receiver, and DMA into memory. It'll ask your driver what colour format, resolution, and CSI setup it uses, configures the receiver based on that, and then requests the sensor driver to start streaming data. As buffers are received they are written in to memory, and at frame end they get returned to the V4L2 framework to be delivered to the application. Once finished, the app will request to stop streaming, the sensor driver gets told to stop, and then Unicam is shut down.
As long as your sensor driver implements the necessary V4L2 subdev API calls, then it should work fine.
tytyty wrote:I come from china,and my English is very pool.I hope you don't mind
No problem, you're doing fine (better than some native English speakers!!)
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

tytyty
Posts: 38
Joined: Wed Aug 30, 2017 4:40 am

Re: How do I modify the dts file on raspbeery pi 3 B?

Wed Sep 20, 2017 2:37 am

HI,
6by9,

Firstly,
According to what you said in the post above,am I the first to transplant the The Unicam driver into my kernel? Because it is the CSI2 recevier.This unicam driver should support the MIPI CSI receiver?
While I'm porting unicam driver, do I have to transplant a ev76c560 driver? I see your patch link with the TC358743 and OV5647 on it . https://github.com/6by9/upstream-linux/tree/unicam
Can I refer to the TC358743 and OV5647 driver on this link to write my own ev76c560 driver?

Secondly, the bcm2835-camera.c and mmal-vchiq.c need to be removed from the kernel,when i transplant the unicam driver into my kernel.

tytyty
Posts: 38
Joined: Wed Aug 30, 2017 4:40 am

Re: How do I modify the dts file on raspbeery pi 3 B?

Thu Sep 21, 2017 9:25 am

HI,
6by9,
When does V3's patch come out? I've ported V2's patch to my kernel

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4528
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How do I modify the dts file on raspbeery pi 3 B?

Thu Sep 21, 2017 10:25 am

tytyty wrote:
Wed Sep 20, 2017 2:37 am
According to what you said in the post above,am I the first to transplant the The Unicam driver into my kernel? Because it is the CSI2 recevier.This unicam driver should support the MIPI CSI receiver?
I have it running here with 3 different sources (TC358743 HDMI to CSI2 bridge, ADV7282M analogue video to CSI2, and OV5647), and others are doing some test work for me with the TC358743. You're the first that is attempting to add their own driver on top of it, although others have done a similar thing using the MMAL vc.ril.rawcam component and the raspiraw app.
tytyty wrote: While I'm porting unicam driver, do I have to transplant a ev76c560 driver? I see your patch link with the TC358743 and OV5647 on it . https://github.com/6by9/upstream-linux/tree/unicam
Can I refer to the TC358743 and OV5647 driver on this link to write my own ev76c560 driver?
OV5647 is a better example than TC358743 as it is a camera sensor driver rather than HDMI bridge. With TC358743 or ADV7282M, the signal you feed into that chip dictates the image format, resolution, etc, whilst with a camera sensor everything is set from the app and it obeys that.
Your mt9v011 that you initially took is probably a good enough template - I haven't got one to test, but it should fit within the framework quite happily. It is a parallel sensor though rather than CSI2 or CPP2, so there may be some subtle differences.
tytyty wrote: Secondly, the bcm2835-camera.c and mmal-vchiq.c need to be removed from the kernel,when i transplant the unicam driver into my kernel.
No, they'll live side by side quite happily. As is now documented in the DT bindings, if the firmware finds enabled DT nodes called csi0 or csi1 then it will disable access to those blocks from the firmware, leaving the kernel to do as it wishes with them.
tytyty wrote:
Thu Sep 21, 2017 9:25 am
When does V3's patch come out? I've ported V2's patch to my kernel
Yesterday afternoon - http://www.spinics.net/lists/linux-media/msg122297.html
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

tytyty
Posts: 38
Joined: Wed Aug 30, 2017 4:40 am

Re: How do I modify the dts file on raspbeery pi 3 B?

Fri Sep 22, 2017 8:22 am

HI,
6by9,
I have ported V3's patch to my kernel.
But the unicam_probe has not implemented and the ev76c560_probe has implementd
I think there's something wrong with my DTS.
My dts is ev76c560-overlay.dts.
My DTS is as follows:

Code: Select all

// Definitions for EV76C560 camera module on ARM I2C bus
/dts-v1/;
/plugin/;

/{
	csi1: csi1@7e801000 {
		compatible = "brcm,bcm2835-unicam";
		reg = <0x7e801000 0x800>,
		      <0x7e802004 0x4>;
		interrupts = <2 7>;
	//	clocks = <&clocks BCM2835_CLOCK_CAM1>;
		clock-names = "lp";

		port {
			csi1_ep: endpoint {
				//remote-endpoint = <&tc358743_0>;
				data-lanes = <1 2>;
			};
		};
	};

	fragment@0 {
		target = <&i2c_arm>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";

			ev76c50: ev76c560@36 {
				compatible = "ev76c560";
				reg = <0x36>;
				status = "okay";

				port {
					ev76c560_0: endpoint {
						clock-lanes = <0>;
						data-lanes = <1 2>;
						link-frequencies =
							/bits/ 64 <297000000>;
					};
				};
			};
		};
	};
};

tytyty
Posts: 38
Joined: Wed Aug 30, 2017 4:40 am

Re: How do I modify the dts file on raspbeery pi 3 B?

Fri Sep 22, 2017 8:34 am

Can you give me some idea!

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1361
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: How do I modify the dts file on raspbeery pi 3 B?

Fri Sep 22, 2017 8:35 am

That's not a well-formed overlay. Everything that is supposed to end up in the final DT must go in a fragment - only fragments are merged. Also, the csi1 node should probably be under "/soc" not "/". Try this (untested, but compiles and applies OK):

Code: Select all

// Definitions for EV76C560 camera module on ARM I2C bus
/dts-v1/;
/plugin/;

/{
	fragment@0 {
		target = <&soc>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <1>;

			csi1: csi1@7e801000 {
				compatible = "brcm,bcm2835-unicam";
				reg = <0x7e801000 0x800>,
				      <0x7e802004 0x4>;
				interrupts = <2 7>;
			//	clocks = <&clocks BCM2835_CLOCK_CAM1>;
				clock-names = "lp";

				port {
					csi1_ep: endpoint {
						//remote-endpoint = <&tc358743_0>;
						data-lanes = <1 2>;
					};
				};
			};
		};
	};

	fragment@1 {
		target = <&i2c_arm>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";

			ev76c50: ev76c560@36 {
				compatible = "ev76c560";
				reg = <0x36>;
				status = "okay";

				port {
					ev76c560_0: endpoint {
						clock-lanes = <0>;
						data-lanes = <1 2>;
						link-frequencies =
							/bits/ 64 <297000000>;
					};
				};
			};
		};
	};
};

tytyty
Posts: 38
Joined: Wed Aug 30, 2017 4:40 am

Re: How do I modify the dts file on raspbeery pi 3 B?

Fri Sep 22, 2017 8:51 am

Ok,i have a try

Return to “Device Tree”

Who is online

Users browsing this forum: No registered users and 3 guests