diff --git a/scalp_mipi/.petalinux/metadata b/scalp_mipi/.petalinux/metadata index 221c446aa1b1eed1db6efaebc0ce0febca992d6a..cedfb4a2d119d4296ee4ac6dd97e1ff06e41d1fb 100644 --- a/scalp_mipi/.petalinux/metadata +++ b/scalp_mipi/.petalinux/metadata @@ -1,6 +1,6 @@ PETALINUX_VER=2020.2 VALIDATE_HW_CHKSUM=1 -HARDWARE_CHECKSUM=6c31bbdb75a850f24b76171de480c2fd +HARDWARE_CHECKSUM=9530777292ab337e6ffec029633406cf YOCTO_SDK=5ff8fc5f85d1566b314bb73eaa378212 RFSCONFIG_CHKSUM=234f2f09c23647961a2fbda891ad049b -HARDWARE_PATH=/home/scalpuser/Desktop/scalp/scalp_firmware/designs/vivado/scalp_mipi/2020.2/lin64/scalp_mipi/scalp_mipi.xsa +HARDWARE_PATH=/home/orphee/Documents/recherche/scalp/scalp_firmware/designs/vivado/scalp_mipi/2020.2/lin64/scalp_mipi/scalp_mipi.xsa diff --git a/scalp_mipi/project-spec/configs/config b/scalp_mipi/project-spec/configs/config index b5f467515084476517403becd5037c7188aeee18..392676e84dd7a612bb85bf60db2ea42cfe59b45f 100644 --- a/scalp_mipi/project-spec/configs/config +++ b/scalp_mipi/project-spec/configs/config @@ -256,6 +256,4 @@ CONFIG_YOCTO_NETWORK_SSTATE_FEEDS_URL="http://petalinux.xilinx.com/sswreleases/r # User Layers # CONFIG_USER_LAYER_0="" - - CONFIG_SUBSYSTEM_BOOTARGS_GENERATED="console=ttyPS0,115200 earlycon" diff --git a/scalp_mipi/project-spec/configs/u-boot-xlnx/platform-auto.h b/scalp_mipi/project-spec/configs/u-boot-xlnx/platform-auto.h index b8bd524969aa79f0819041f74a7f2e86e622fd7e..2bda8f7eefccb655db5fd5f318df416defda7779 100644 --- a/scalp_mipi/project-spec/configs/u-boot-xlnx/platform-auto.h +++ b/scalp_mipi/project-spec/configs/u-boot-xlnx/platform-auto.h @@ -35,7 +35,7 @@ #define CONFIG_MII #define CONFIG_NET_MULTI #define CONFIG_NETCONSOLE 1 -#define CONFIG_SERVERIP 172.16.251.154 +#define CONFIG_SERVERIP 10.136.125.49 #define CONFIG_IPADDR 192.168.0.10 #define CONFIG_GATEWAYIP 192.168.0.1 #define CONFIG_NETMASK 255.255.255.0 diff --git a/scalp_mipi/project-spec/hw-description/scalp_mipi.bit b/scalp_mipi/project-spec/hw-description/scalp_mipi.bit index d39ebc7cad0de9961297234b46b3a9ceff387688..2e6728c13da34ff4a1a5c78d519c88c115787e91 100644 Binary files a/scalp_mipi/project-spec/hw-description/scalp_mipi.bit and b/scalp_mipi/project-spec/hw-description/scalp_mipi.bit differ diff --git a/scalp_mipi/project-spec/hw-description/system.xsa b/scalp_mipi/project-spec/hw-description/system.xsa index cb8d8e1d63a10b64cb2b6e72f83d9d5112ef9b29..027074128e7056a6435e4303006f8b584e335f68 100644 Binary files a/scalp_mipi/project-spec/hw-description/system.xsa and b/scalp_mipi/project-spec/hw-description/system.xsa differ diff --git a/scalp_mipi/project-spec/meta-user/recipes-apps/pcam5c-stream/files/pcam5c-stream b/scalp_mipi/project-spec/meta-user/recipes-apps/pcam5c-stream/files/pcam5c-stream index 4a6733cea735844695518b97d97f51a874a0961a..bae4c4019ec44bccf611b94bc577781393d100bc 100644 --- a/scalp_mipi/project-spec/meta-user/recipes-apps/pcam5c-stream/files/pcam5c-stream +++ b/scalp_mipi/project-spec/meta-user/recipes-apps/pcam5c-stream/files/pcam5c-stream @@ -1,7 +1,8 @@ #!/bin/sh - -media-ctl -d /dev/media0 -V '"ov5640 1-003c":0 [fmt:UYVY/'640x480'@1/'30' field:none]' -media-ctl -d /dev/media0 -V '"43c20000.mipi_csi2_rx_subsystem":0 [fmt:UYVY/'640x480' field:none]' -v4l2-ctl -d /dev/video0 --set-fmt-video=width=640,height=480,pixelformat=UYVY -v4l2-ctl -d /dev/video0 --stream-mmap --stream-count=1 --stream-to=test.raw - +width=640 +height=480 +rate=60 +media-ctl -d /dev/media0 -V '"ov5640 1-003c":0 [fmt:UYVY/'"$width"x"$height"'@1/'"$rate"' field:none]' +media-ctl -d /dev/media0 -V '"43c20000.mipi_csi2_rx_subsystem":0 [fmt:UYVY/'"$width"x"$height"' field:none]' +v4l2-ctl -d /dev/video0 --set-fmt-video=width="$width",height="$height",pixelformat='YUYV' +yavta -c1 -f YUYV -s "$width"x"$height" -F /dev/video0 diff --git a/scalp_mipi/project-spec/meta-user/recipes-bsp/device-tree/files/pl-user.dtsi b/scalp_mipi/project-spec/meta-user/recipes-bsp/device-tree/files/pl-user.dtsi index 1527fc036e7f9b7350ba8284e2ac39d1ad5fb425..245b49368717a1ae167f916c4323542cb585109c 100644 --- a/scalp_mipi/project-spec/meta-user/recipes-bsp/device-tree/files/pl-user.dtsi +++ b/scalp_mipi/project-spec/meta-user/recipes-bsp/device-tree/files/pl-user.dtsi @@ -28,88 +28,89 @@ mipi_csi2_rx_subsyst_0: mipi_csi2_rx_subsystem@43c20000 { clock-names = "lite_aclk", "dphy_clk_200M", "video_aclk"; - clocks = <&clkc 15>, <&misc_clk_0>, <&clkc 15>; + clocks = <&clkc 15>, <&misc_clk_0>, <&clkc 15>; compatible = "xlnx,mipi-csi2-rx-subsystem-5.1"; + interrupt-names = "csirxss_csi_irq"; + interrupt-parent = <&intc>; + interrupts = <0 30 4>; reg = <0x43c20000 0x1000>; - interrupt-names = "csirxss_csi_irq"; - interrupt-parent = <&intc>; - interrupts = <0 30 4>; - xlnx,axis-tdata-width = <32>; - xlnx,cal-mode = "NONE"; - xlnx,clk-io-swap = "false"; - xlnx,clk-lane-io-position = <0x0>; - xlnx,clk-lp-io-swap = "false"; - xlnx,csi-en-activelanes = "false"; - xlnx,csi-en-crc = "true"; - xlnx,csi-filter-userdatatype = "false"; - xlnx,csi-opt1-regs = "false"; - xlnx,csi-pxl-format = "YUV422_8bit"; - xlnx,csi2rx-dbg = <0x0>; - xlnx,data-lane0-io-position = <0x2>; - xlnx,data-lane1-io-position = <0x4>; - xlnx,data-lane2-io-position = <0x6>; - xlnx,data-lane3-io-position = <0x8>; - xlnx,dl0-io-swap = "false"; - xlnx,dl0-lp-io-swap = "false"; - xlnx,dl1-io-swap = "false"; - xlnx,dl1-lp-io-swap = "false"; - xlnx,dl2-io-swap = "false"; - xlnx,dl2-lp-io-swap = "false"; - xlnx,dl3-io-swap = "false"; - xlnx,dl3-lp-io-swap = "false"; - xlnx,dphy-lanes = <0x2>; - xlnx,dphy-mode = "SLAVE"; - xlnx,en-7s-linerate-check = "false"; - xlnx,en-bg0-pin0 = "false"; - xlnx,en-bg0-pin6 = "false"; - xlnx,en-bg1-pin0 = "false"; - xlnx,en-bg1-pin6 = "false"; - xlnx,en-bg2-pin0 = "false"; - xlnx,en-bg2-pin6 = "false"; - xlnx,en-bg3-pin0 = "false"; - xlnx,en-bg3-pin6 = "false"; - xlnx,en-clk300m = "false"; - xlnx,en-cnts-byte-clk = "false"; - xlnx,en-csi-v2-0 = "false"; - xlnx,en-exdesigns = "false"; - xlnx,en-ext-tap = "false"; - xlnx,en-timeout-regs = "false"; - xlnx,en-vcx = "false"; - xlnx,esc-timeout = <0x6400>; - xlnx,exdes-board = "ZCU102"; - xlnx,exdes-config = "MIPI_Video_Pipe_Camera_to_Display"; - xlnx,exdes-fmc = "LI-IMX274MIPI-FMC V1.0 Single Sensor"; - xlnx,exdesboard-version = "xilinx.com:vck190:part0:2.0"; - xlnx,fifo-rd-en-control = "true"; - xlnx,hs-line-rate = <0x320>; - xlnx,hs-settle-ns = <0x93>; - xlnx,hs-timeout = <0x10005>; - xlnx,idly-group-name = "mipi_csi2rx_idly_group"; - xlnx,idly-tap = <0x1>; - xlnx,init = <0x186a0>; - xlnx,int-qor-check = <0x0>; - xlnx,is-7series = "true"; - xlnx,is-versal = "false"; - xlnx,lprx-disable-extport = <0x0>; - xlnx,max-lanes = <2>; - xlnx,mipi-slv-int = <0x0>; - xlnx,ooc-vid-clk = "6.666"; - xlnx,ppc = <1>; - xlnx,rcve-alt-deskew-seq = "false"; - xlnx,rcve-deskew-seq = "false"; - xlnx,share-idlyctrl = "false"; - xlnx,stretch-line-rate = <0xdac>; - xlnx,vc = <4>; - xlnx,vfb ; - mipi_csi_portsmipi_csi2_rx_subsyst_0: ports { - #address-cells = <1>; - #size-cells = <0>; - mipi_csi_port0mipi_csi2_rx_subsyst_0: port@0 { - reg = <0>; - xlnx,cfa-pattern = "rggb"; + xlnx,axis-tdata-width = <32>; + xlnx,cal-mode = "FIXED"; + xlnx,clk-io-swap = "false"; + xlnx,clk-lane-io-position = <0x0>; + xlnx,clk-lp-io-swap = "false"; + xlnx,csi-en-activelanes = "false"; + xlnx,csi-en-crc = "true"; + xlnx,csi-filter-userdatatype = "false"; + xlnx,csi-opt1-regs = "false"; + xlnx,csi-pxl-format = "YUV422_8bit"; + xlnx,csi2rx-dbg = <0x0>; + xlnx,data-lane0-io-position = <0x2>; + xlnx,data-lane1-io-position = <0x4>; + xlnx,data-lane2-io-position = <0x6>; + xlnx,data-lane3-io-position = <0x8>; + xlnx,dl0-io-swap = "false"; + xlnx,dl0-lp-io-swap = "false"; + xlnx,dl1-io-swap = "false"; + xlnx,dl1-lp-io-swap = "false"; + xlnx,dl2-io-swap = "false"; + xlnx,dl2-lp-io-swap = "false"; + xlnx,dl3-io-swap = "false"; + xlnx,dl3-lp-io-swap = "false"; + xlnx,dphy-lanes = <0x2>; + xlnx,dphy-mode = "SLAVE"; + xlnx,dphy-present ; + xlnx,en-7s-linerate-check = "false"; + xlnx,en-bg0-pin0 = "false"; + xlnx,en-bg0-pin6 = "false"; + xlnx,en-bg1-pin0 = "false"; + xlnx,en-bg1-pin6 = "false"; + xlnx,en-bg2-pin0 = "false"; + xlnx,en-bg2-pin6 = "false"; + xlnx,en-bg3-pin0 = "false"; + xlnx,en-bg3-pin6 = "false"; + xlnx,en-clk300m = "false"; + xlnx,en-cnts-byte-clk = "false"; + xlnx,en-csi-v2-0 = "false"; + xlnx,en-exdesigns = "false"; + xlnx,en-ext-tap = "false"; + xlnx,en-timeout-regs = "false"; + xlnx,en-vcx = "false"; + xlnx,esc-timeout = <0x6400>; + xlnx,exdes-board = "SP701"; + xlnx,exdes-config = "MIPI_Video_Pipe_Camera_to_Display"; + xlnx,exdes-fmc = "LI-IMX274MIPI-FMC V1.0 Single Sensor"; + xlnx,exdesboard-version = "xilinx.com:vck190:part0:2.0"; + xlnx,fifo-rd-en-control = "true"; + xlnx,hs-line-rate = <0x150>; + xlnx,hs-settle-ns = <0xa4>; + xlnx,hs-timeout = <0x10005>; + xlnx,idly-group-name = "mipi_csi2rx_idly_group"; + xlnx,idly-tap = <0x2>; + xlnx,init = <0x186a0>; + xlnx,int-qor-check = <0x0>; + xlnx,is-7series = "true"; + xlnx,is-versal = "false"; + xlnx,lprx-disable-extport = <0x0>; + xlnx,max-lanes = <2>; + xlnx,mipi-slv-int = <0x0>; + xlnx,ooc-vid-clk = "6.666"; + xlnx,ppc = <1>; + xlnx,rcve-alt-deskew-seq = "false"; + xlnx,rcve-deskew-seq = "false"; + xlnx,share-idlyctrl = "true"; + xlnx,stretch-line-rate = <0xdac>; + xlnx,vc = <4>; + xlnx,vfb ; + mipi_csi_portsmipi_csi2_rx_subsyst_0: ports { + #address-cells = <1>; + #size-cells = <0>; + mipi_csi_port0mipi_csi2_rx_subsyst_0: port@0 { + reg = <0>; + xlnx,cfa-pattern = "rggb"; xlnx,video-format = <12>; xlnx,video-width = <8>; - mipi_csirx_outmipi_csi2_rx_subsyst_0: endpoint { + mipi_csirx_outmipi_csi2_rx_subsyst_0: endpoint { remote-endpoint = <&v_frmbuf_wr_0mipi_csi2_rx_subsyst_0>; }; }; @@ -127,31 +128,31 @@ v_frmbuf_wr_0: v_frmbuf_wr@43c30000 { #dma-cells = <1>; clock-names = "ap_clk"; - clocks = <&clkc 15>; + clocks = <&clkc 15>; compatible = "xlnx,v-frmbuf-wr-2.2", "xlnx,axi-frmbuf-wr-v2.1"; + interrupt-names = "interrupt"; + interrupt-parent = <&intc>; + interrupts = <0 31 4>; reg = <0x43c30000 0x10000>; - interrupt-names = "interrupt"; - interrupt-parent = <&intc>; - interrupts = <0 31 4>; - xlnx,dma-addr-width = <32>; - xlnx,dma-align = <8>; - xlnx,max-height = <480>; - xlnx,max-width = <640>; - xlnx,pixels-per-clock = <1>; - xlnx,s-axi-ctrl-addr-width = <0x7>; - xlnx,s-axi-ctrl-data-width = <0x20>; - xlnx,vid-formats = "rgb888", "uyvy"; - xlnx,video-width = <8>; - }; - - vcap_mipi_csi2_rx_subsyst_0 { + xlnx,dma-addr-width = <32>; + xlnx,dma-align = <16>; + xlnx,max-height = <2160>; + xlnx,max-width = <3840>; + xlnx,pixels-per-clock = <2>; + xlnx,s-axi-ctrl-addr-width = <0x7>; + xlnx,s-axi-ctrl-data-width = <0x20>; + xlnx,vid-formats = "uyvy", "yuyv", "nv16"; + xlnx,video-width = <8>; + }; + + vcap_mipi_csi2_rx_subsyst_0 { compatible = "xlnx,video"; dma-names = "port0"; dmas = <&v_frmbuf_wr_0 0>; vcap_portsmipi_csi2_rx_subsyst_0: ports { - #address-cells = <1>; - #size-cells = <0>; - vcap_portmipi_csi2_rx_subsyst_0: port@0 { + #address-cells = <1>; + #size-cells = <0>; + vcap_portmipi_csi2_rx_subsyst_0: port@0 { direction = "input"; reg = <0>; v_frmbuf_wr_0mipi_csi2_rx_subsyst_0: endpoint { diff --git a/scalp_mipi/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi b/scalp_mipi/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi index 6945b9f6c9c0c094558a894669ac4750d62efe0a..df17d9b2aa41d7d508aa0febd729309ca5590254 100644 --- a/scalp_mipi/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi +++ b/scalp_mipi/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi @@ -45,31 +45,31 @@ /* PS_Clk50M_i */ &clkc { - fclk-enable = <0x1>; - ps-clk-frequency = <50000000>; + fclk-enable = <0x1>; + ps-clk-frequency = <50000000>; }; &intc { - num_cpus = <2>; - num_interrupts = <96>; + num_cpus = <2>; + num_interrupts = <96>; }; /* serial0 */ &uart0 { - u-boot,dm-pre-reloc; - cts-override ; - device_type = "serial"; - port-number = <0>; - status = "okay"; + u-boot,dm-pre-reloc; + cts-override ; + device_type = "serial"; + port-number = <0>; + status = "okay"; }; /* serial1 */ &uart1 { - u-boot,dm-pre-reloc; - cts-override ; - device_type = "serial"; - port-number = <1>; - status = "okay"; + u-boot,dm-pre-reloc; + cts-override ; + device_type = "serial"; + port-number = <1>; + status = "okay"; }; &qspi { @@ -291,7 +291,7 @@ /*&usb0 { u-boot,dm-pre-reloc; phy_type = "ulpi"; - status = "okay"; + status = "okay"; };*/ /* i2c0 */ @@ -307,38 +307,38 @@ /* can0 */ &can1 { u-boot,dm-pre-reloc; - status = "okay"; + status = "okay"; }; /* i2c1 - Camera */ / { - pcam_clk: pcam_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <12000000>; - }; - pcam_1v8: regulator-1v8 { - compatible = "regulator-fixed"; - regulator-name = "1v8"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - //gpio = <&gpio0 58 GPIO_ACTIVE_HIGH>; - //startup-delay-us = <50000>; - //enable-active-high; - }; - pcam_2v8: regulator-2v8 { - compatible = "regulator-fixed"; - regulator-name = "2v8"; - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <2800000>; - }; - pcam_1v5: regulator-1v5 { - compatible = "regulator-fixed"; - regulator-name = "1v5"; - regulator-min-microvolt = <1500000>; - regulator-max-microvolt = <1500000>; - }; + pcam_clk: pcam_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <12000000>; + }; + pcam_1v8: regulator-1v8 { + compatible = "regulator-fixed"; + regulator-name = "1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + //gpio = <&gpio0 58 GPIO_ACTIVE_HIGH>; + //startup-delay-us = <50000>; + //enable-active-high; + }; + pcam_2v8: regulator-2v8 { + compatible = "regulator-fixed"; + regulator-name = "2v8"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + }; + pcam_1v5: regulator-1v5 { + compatible = "regulator-fixed"; + regulator-name = "1v5"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + }; }; @@ -367,7 +367,7 @@ &mipi_csi2_rx_subsyst_0 { compatible = "xlnx,mipi-csi2-rx-subsystem-4.0"; - reset-gpios = <&gpio0 55 GPIO_ACTIVE_LOW>; + // reset-gpios = <&gpio0 55 GPIO_ACTIVE_LOW>; }; &mipi_csi_port0mipi_csi2_rx_subsyst_0 { diff --git a/scalp_mipi/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/0001-ov5640-mono-lane.patch b/scalp_mipi/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/0001-ov5640-mono-lane.patch new file mode 100644 index 0000000000000000000000000000000000000000..20ae2a20f4fccb5c3bf294958792381dbba83048 --- /dev/null +++ b/scalp_mipi/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/0001-ov5640-mono-lane.patch @@ -0,0 +1,39 @@ +commit 923c6b9c7cd7a4a4a740b60e660d0caa1159bd6e +Author: orphee.antoniad <orphee.antoniadis@hesge.ch> +Date: Tue Aug 10 17:58:02 2021 +0200 + + [PATCH] ov5640: Set driver to use only one lane + + Signed-off-by: Orphee Antoniadis <orphee.antoniadis@hesge.ch> + +diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c +index d332c45a89aa..ae5ba98ace12 100644 +--- a/drivers/media/i2c/ov5640.c ++++ b/drivers/media/i2c/ov5640.c +@@ -1315,7 +1315,7 @@ static int ov5640_set_stream_mipi(struct ov5640_dev *sensor, bool on) + * [1:0] = 01/00: FIXME: 'debug' + */ + ret = ov5640_write_reg(sensor, OV5640_REG_IO_MIPI_CTRL00, +- on ? 0x45 : 0x40); ++ on ? 0x05 : 0x00); + if (ret) + return ret; + +@@ -2013,7 +2013,7 @@ static int ov5640_set_power(struct ov5640_dev *sensor, bool on) + * [2] = 0 : MIPI interface disabled + */ + ret = ov5640_write_reg(sensor, +- OV5640_REG_IO_MIPI_CTRL00, 0x40); ++ OV5640_REG_IO_MIPI_CTRL00, 0x00); + if (ret) + goto power_off; + +@@ -2049,7 +2049,7 @@ static int ov5640_set_power(struct ov5640_dev *sensor, bool on) + if (sensor->ep.bus_type == V4L2_MBUS_CSI2_DPHY) { + /* Reset MIPI bus settings to their default values. */ + ov5640_write_reg(sensor, +- OV5640_REG_IO_MIPI_CTRL00, 0x58); ++ OV5640_REG_IO_MIPI_CTRL00, 0x18); + ov5640_write_reg(sensor, + OV5640_REG_MIPI_CTRL00, 0x04); + ov5640_write_reg(sensor,