From beae9356bba73eaf59fc6c646495b59dc9f93da5 Mon Sep 17 00:00:00 2001 From: Todor Tomov Date: Wed, 27 Jun 2018 16:06:38 +0300 Subject: [PATCH 1/2] Makefile: Run C preprocessor on dts files Device tree files in kernel source use C defines for meaningful names of some values. When device tree is compiled in kernel source, the C preprocessor is run first on dts files and then the dtc compiler. To be able to use in overlays values with the same meaningful values, run the C preprocessor first on the dts files. This requires also the kernel source as the definitions of the values are found there. When dtbo files are built it is now required to set KERNEL_PATH variable with kernel source path. Also use dtc from the kernel source path and remove no-avoid_unnecessary_addr_size option as it is not avilable in the dtc compiler from the latest lts kernel (4.14). Signed-off-by: Todor Tomov --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3a77f3f..f8d427a 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,12 @@ maintainer-clean : clean $(RM) $(DTBS) %.dtbo : %.dts - dtc -Wno-avoid_default_addr_size -Wno-avoid_unnecessary_addr_size \ +ifndef KERNEL_PATH + $(error KERNEL_PATH is not set) +else + $(CC) -E -nostdinc -I$(KERNEL_PATH)/include/ -x assembler-with-cpp $< | \ + $(KERNEL_PATH)/scripts/dtc/dtc -Wno-avoid_default_addr_size \ -Wno-reg_format -Wno-unit_address_vs_reg -Odtb\ -o $@ \ - -@ $< + -@ +endif From cc93c7b36505ee99619d4003e49e6161b041aa3f Mon Sep 17 00:00:00 2001 From: Todor Tomov Date: Wed, 27 Jun 2018 16:16:55 +0300 Subject: [PATCH 2/2] Update camera overlays Update camera overlays for OV5645 and OV5640 on DB410c and DB820c. There is no need to keep separate scripts for different camera configs as the only difference is the overlay being applied. Add generic overlay-apply.sh script which can be used to apply all camera overlays. Signed-off-by: Todor Tomov --- scripts/db410c/enable-d3-mezzanine.sh | 37 ------- scripts/db410c/enable-ov5645.sh | 32 ------ .../db410c/overlays/db410c-d3-mezzanine.dtbo | Bin 458 -> 0 bytes .../db410c/overlays/db410c-d3-mezzanine.dts | 34 ------- .../overlays/db410c-d3-rear-ov5640.dtbo | Bin 0 -> 2771 bytes .../db410c/overlays/db410c-d3-rear-ov5640.dts | 93 +++++++++++++++++ scripts/db410c/overlays/db410c-ov5645.dtbo | Bin 414 -> 0 bytes scripts/db410c/overlays/db410c-ov5645.dts | 29 ------ .../overlays/db410c-stm32-front-ov5645.dtbo | Bin 0 -> 2723 bytes .../overlays/db410c-stm32-front-ov5645.dts | 94 ++++++++++++++++++ .../overlays/db410c-stm32-rear-ov5645.dtbo | Bin 0 -> 2710 bytes .../overlays/db410c-stm32-rear-ov5645.dts | 94 ++++++++++++++++++ .../db820c/overlays/db820c-board-ov5645.dtbo | Bin 0 -> 2692 bytes .../db820c/overlays/db820c-board-ov5645.dts | 92 +++++++++++++++++ .../overlays/db820c-d3-rear-ov5640.dtbo | Bin 0 -> 2654 bytes .../db820c/overlays/db820c-d3-rear-ov5640.dts | 91 +++++++++++++++++ .../overlays/db820c-stm32-front-ov5645.dtbo | Bin 0 -> 2692 bytes .../overlays/db820c-stm32-front-ov5645.dts | 92 +++++++++++++++++ .../overlays/db820c-stm32-rear-ov5645.dtbo | Bin 0 -> 2679 bytes .../overlays/db820c-stm32-rear-ov5645.dts | 92 +++++++++++++++++ scripts/overlay-apply.sh | 40 ++++++++ 21 files changed, 688 insertions(+), 132 deletions(-) delete mode 100755 scripts/db410c/enable-d3-mezzanine.sh delete mode 100755 scripts/db410c/enable-ov5645.sh delete mode 100644 scripts/db410c/overlays/db410c-d3-mezzanine.dtbo delete mode 100644 scripts/db410c/overlays/db410c-d3-mezzanine.dts create mode 100644 scripts/db410c/overlays/db410c-d3-rear-ov5640.dtbo create mode 100644 scripts/db410c/overlays/db410c-d3-rear-ov5640.dts delete mode 100644 scripts/db410c/overlays/db410c-ov5645.dtbo delete mode 100644 scripts/db410c/overlays/db410c-ov5645.dts create mode 100644 scripts/db410c/overlays/db410c-stm32-front-ov5645.dtbo create mode 100644 scripts/db410c/overlays/db410c-stm32-front-ov5645.dts create mode 100644 scripts/db410c/overlays/db410c-stm32-rear-ov5645.dtbo create mode 100644 scripts/db410c/overlays/db410c-stm32-rear-ov5645.dts create mode 100644 scripts/db820c/overlays/db820c-board-ov5645.dtbo create mode 100644 scripts/db820c/overlays/db820c-board-ov5645.dts create mode 100644 scripts/db820c/overlays/db820c-d3-rear-ov5640.dtbo create mode 100644 scripts/db820c/overlays/db820c-d3-rear-ov5640.dts create mode 100644 scripts/db820c/overlays/db820c-stm32-front-ov5645.dtbo create mode 100644 scripts/db820c/overlays/db820c-stm32-front-ov5645.dts create mode 100644 scripts/db820c/overlays/db820c-stm32-rear-ov5645.dtbo create mode 100644 scripts/db820c/overlays/db820c-stm32-rear-ov5645.dts create mode 100755 scripts/overlay-apply.sh diff --git a/scripts/db410c/enable-d3-mezzanine.sh b/scripts/db410c/enable-d3-mezzanine.sh deleted file mode 100755 index 5b9e24c..0000000 --- a/scripts/db410c/enable-d3-mezzanine.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -BOOTIMG=${1:-/dev/disk/by-partlabel/boot} -DT_ROOT=`dirname $0`/../.. -DBOOTIMG=`which dbootimg` -DBOOTIMG=${DBOOTIMG:-${DT_ROOT}/tools/dbootimg/dbootimg} -DTBTOOL=`which dtbtool` -DTBTOOL=${DTBTOOL:-${DT_ROOT}/tools/dtbtool/dtbtool} - -if [ ! -f ${BOOTIMG} ]; then - echo "Invalid bootimg: ${BOOTIMG}" - exit 1 -fi - -# Check DTB already has camera subsystem node present -${DBOOTIMG} ${BOOTIMG} -x dtb | ${DTBTOOL} -n camss@1b00000 -p > /dev/null -if [ "$?" -ne 0 ]; then - echo "Failed to enable D3 mezzanine, no camss node, upgrade your bootimg." - exit 1 -fi - -# Check rear camera node is already defined -${DBOOTIMG} ${BOOTIMG} -x dtb | ${DTBTOOL} -n camera_rear@3b -p > /dev/null -if [ "$?" -ne 0 ]; then - echo "Failed to enable D3 mezzanine, no rear camera node, upgrade your bootimg." - return -1 -fi - -${DBOOTIMG} ${BOOTIMG} -x dtb | ${DTBTOOL} -m `dirname $0`/overlays/db410c-d3-mezzanine.dtbo | ${DBOOTIMG} ${BOOTIMG} -u dtb - -if [ "$?" -ne 0 ]; then - echo "Failed to update DTB" - exit 1 -fi - -echo "D3 mezzanine enabled, please reboot" -sync diff --git a/scripts/db410c/enable-ov5645.sh b/scripts/db410c/enable-ov5645.sh deleted file mode 100755 index e7b0643..0000000 --- a/scripts/db410c/enable-ov5645.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -BOOTIMG=${1:-/dev/disk/by-partlabel/boot} -DT_ROOT=`dirname $0`/../.. -DBOOTIMG=`which dbootimg` -DBOOTIMG=${DBOOTIMG:-${DT_ROOT}/tools/dbootimg/dbootimg} -DTBTOOL=`which dtbtool` -DTBTOOL=${DTBTOOL:-${DT_ROOT}/tools/dtbtool/dtbtool} - -# Check DTB already has camera subsystem node present -${DBOOTIMG} ${BOOTIMG} -x dtb | ${DTBTOOL} -n camss@1b00000 -p > /dev/null -if [ "$?" -ne 0 ]; then - echo "Failed to enable ov5645, no camss node, upgrade your bootimg." - exit 1 -fi - -# Check rear camera node is already defined -${DBOOTIMG} ${BOOTIMG} -x dtb | ${DTBTOOL} -n camera_rear@3b -p > /dev/null -if [ "$?" -ne 0 ]; then - echo "Failed to enable ov5645, no rear camera node, upgrade your bootimg." - return -1 -fi - -${DBOOTIMG} ${BOOTIMG} -x dtb | ${DTBTOOL} -m `dirname $0`/overlays/db410c-ov5645.dtbo | ${DBOOTIMG} ${BOOTIMG} -u dtb - -if [ "$?" -ne 0 ]; then - echo "Failed to update DTB" - exit 1 -fi - -echo "ov5645 enabled, please reboot" -sync diff --git a/scripts/db410c/overlays/db410c-d3-mezzanine.dtbo b/scripts/db410c/overlays/db410c-d3-mezzanine.dtbo deleted file mode 100644 index 94d54436182308043a5932069d80b172a08e5eab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 458 zcmah_F;2uV5L^Qdf|EcLbQDw+hb|FtI=cMC+87fe&T+6!1V7>}RD6UlAZDGMPEdfQ z$?VQ-HWPo$zCMZ6I}xqGZ{Q2y7&rptoI~%&^2bw6-7a`0^^@^#?xI`WmdnXg_kkN{ zyHpifky+V&u!!C)jA^T~E=*C3E%30%J>U#@0egoTL o?e2Qtc4@T!%(TfSypOBxIkolLQsU6qbcyzXV&e21DcFX-0gwhpG5`Po diff --git a/scripts/db410c/overlays/db410c-d3-mezzanine.dts b/scripts/db410c/overlays/db410c-d3-mezzanine.dts deleted file mode 100644 index 006c7ec..0000000 --- a/scripts/db410c/overlays/db410c-d3-mezzanine.dts +++ /dev/null @@ -1,34 +0,0 @@ -/dts-v1/; -/plugin/; -/ { - compatible = "qcom,msm8916"; - - /* db410c dtb already includes default camera nodes (ov5645), here - * we just enable these nodes and replace the sensor model (ov5640). - */ - fragment@0 { - target-path = "/soc/cci@1b0c000"; - __overlay__ { - status = "ok"; - camera_rear@3b { - compatible = "ovti,ov5640"; - reg = <0x78>; - status = "ok"; - }; - }; - }; - - fragment@1 { - target-path = "/soc/camss@1b00000"; - __overlay__ { - status = "ok"; - ports { - port@0 { - endpoint { - status = "ok"; - }; - }; - }; - }; - }; -}; diff --git a/scripts/db410c/overlays/db410c-d3-rear-ov5640.dtbo b/scripts/db410c/overlays/db410c-d3-rear-ov5640.dtbo new file mode 100644 index 0000000000000000000000000000000000000000..97735f41061ecaea28bc86913836383d57491240 GIT binary patch literal 2771 zcmbVOy^ho{5O(+zzY;$Z6m*<8A#`E0z?}dgw213z5Cu)}CBD5t5{Eduw@U*O1rI<; z!4ps;8XkZOiGl~X8u0)iV7}N+yy4h8ou%2#jAyqTbzndF|Q8Tx6F& zzBE|K;f^E2w3{z-bMu9~Q@&RLL}M@c#@e-sxya6LJvLZ6-&TfcH($hb^965n)_L1r z(pAMg>Q?tsFN%^ue=UfDKzADLOQ)|a{zN_{FPeAyV{k31b+9=OPL8W&NsgCSuGetT zV+}8eZWCF%SAS@be1QnV>fads0_kku947u)6=PmKES9YY?7Q`_>qksmZ(9%4$E_FY1G!rp$h2NH&DLb9^qmNdWm5Nh z?Sy+RmOi*a=Z zqwa^=br5u%O?|0iqr#N8?vb4EUbJ}ga=KN>O;N^jGxvu@BGs*c?b5LnN>q&#?W(Tn zHH!Uumk>pgM^%~n0Y$a`#CdOb=^v#sdWw{3m|BpAr{PRR2(W22z5CrW_`mxTJ&n5w z!}dPzCJZZYX;Gg=%Wt#CgjL@&FxmE;G&$<-`X@){UU1L-f6n>bST_CPdE8g`7&o|l8+`!#Rkt~3Z^Pv zjT8V_r~gRTv=y`cfh<%b1x)X|{`h)w_5Q=vRbP#YBAv3k4!`Q~wV$8zoX}!kal@7( zla=tBO +#include + +/ { + compatible = "qcom,msm8916"; + + fragment@0 { + target-path = "/soc"; + __overlay__ { + camera_rear_vdddo: fixedregulator_camera_rear@0 { + compatible = "regulator-fixed"; + regulator-name = "camera_rear_vdddo"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + camera_rear_vdda: fixedregulator_camera_rear@1 { + compatible = "regulator-fixed"; + regulator-name = "camera_rear_vdda"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-always-on; + }; + + camera_rear_vddd: fixedregulator_camera_rear@2 { + compatible = "regulator-fixed"; + regulator-name = "camera_rear_vddd"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-always-on; + }; + }; + }; + + fragment@1 { + target-path = "/soc/cci@1b0c000"; + __overlay__ { + status = "ok"; + + camera_rear@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + + powerdown-gpios = <&msmgpio 34 GPIO_ACTIVE_HIGH>; + reset-gpios = <&msmgpio 35 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&camera_rear_default>; + + clocks = <&gcc GCC_CAMSS_MCLK0_CLK>; + clock-names = "xclk"; + + DOVDD-supply = <&camera_rear_vdddo>; + AVDD-supply = <&camera_rear_vdda>; + DVDD-supply = <&camera_rear_vddd>; + + status = "ok"; + + port { + camera_rear_ep: endpoint { + clock-lanes = <0>; + data-lanes = <1 2>; + remote-endpoint = <&csiphy0_ep>; + }; + }; + }; + }; + }; + + fragment@2 { + target-path = "/soc/camss@1b00000"; + __overlay__ { + status = "ok"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + csiphy0_ep: endpoint { + clock-lanes = <1>; + data-lanes = <0 2>; + remote-endpoint = <&camera_rear_ep>; + status = "ok"; + }; + }; + }; + }; + }; +}; diff --git a/scripts/db410c/overlays/db410c-ov5645.dtbo b/scripts/db410c/overlays/db410c-ov5645.dtbo deleted file mode 100644 index a1419af4d6dba901b5fd7c5b3829e5c5b8ec6d4f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 414 zcmah_OK!q25FM8lLXnDCbk}tkR7q5+N_Sau3u|Ib8a0kn+f?d~lW-<3!WF8{P5_mlmzv|PAT@2NPV#N8kvSw+#$v)Eep(i#D zOQV~RCmq9DzIzsXt74_9JS`HHBz>2Rq_jWU)%YtVA7DM>$$oJOLZQ(PrPJv0x1!^& zH4ns&IQyq3?SitwAC31s0k5uq*T1zc_)ZFf^Wj}WH|y3`P3T)UbC2^}$0>bTi=irN R4FO%L!z-1a-~)!OhkqSnKqdeH diff --git a/scripts/db410c/overlays/db410c-ov5645.dts b/scripts/db410c/overlays/db410c-ov5645.dts deleted file mode 100644 index 85072e6..0000000 --- a/scripts/db410c/overlays/db410c-ov5645.dts +++ /dev/null @@ -1,29 +0,0 @@ -/dts-v1/; -/plugin/; -/ { - compatible = "qcom,msm8916"; - - fragment@0 { - target-path = "/soc/cci@1b0c000"; - __overlay__ { - status = "ok"; - camera_rear@3b { - status = "ok"; - }; - }; - }; - - fragment@1 { - target-path = "/soc/camss@1b00000"; - __overlay__ { - status = "ok"; - ports { - port@0 { - endpoint { - status = "ok"; - }; - }; - }; - }; - }; -}; diff --git a/scripts/db410c/overlays/db410c-stm32-front-ov5645.dtbo b/scripts/db410c/overlays/db410c-stm32-front-ov5645.dtbo new file mode 100644 index 0000000000000000000000000000000000000000..43a0280cddb8e1df733b420fccde1e733772bff2 GIT binary patch literal 2723 zcmbtWId9ZJ6drR(T#+~=D1ZV*LI}m|Zb+h#BHEsw1|c)CXEz4h<9NKAEE0k`B?W%~ zBnl)t3Oe`)_cH$>}ZxEa# zI7>jwdrS0>dOQ8&S@bAP{_&*gB=}TCFW}_=!18G;8IgD7)Mbg!Pfj^ z^u5k5Z}uDbY6B-SyVu}7qCN6Gg704O^+H^@y$c?knu&euBqR}uMe#)6JL!(vK=34;$k#$y52BF1OFU>?u||u#{J$}H|%yz z=TO~SeFAwvAs^E(@tfz}zpbkY{uwakxQyrIcyVcA5h&=0c|x#aamYRWO^d$Q2(X;~ zwxwSo8u|eA69g|KG2o-5q-|yMwUu=;?<{`b%Ao(>Z-t48y4L&TCA{CTvqO953$cD7 zK;2*$_&2);4yfvo%R&c4G*4tvF5}GMPWK0RR*&-VU>B=l-@{D9kJG^nAa=;Kp`LTo zV9>z~+Oy=TQaDX4qLRb?&JsB&E$aMxSD{B>)=IhJ(W*J3H( z`X`+yn|z{tnX!DGXA!wkB`-$`s;t?3M5tPdxz2!dRbgFbPTYKa!_*{yP>79@$ifNJ z?;Br@@;uQ9Z|oztH%bZ5$a=&}?wf5PQdtVW8qrxE(fdm&KNLx#*sO}52)l32wtZ8z hNu0GQ(KJQmEL3s6KIsLtr3WLXa9YIutq#MG{Q +#include + +/ { + compatible = "qcom,msm8916"; + + fragment@0 { + target-path = "/soc"; + __overlay__ { + camera_front_vdddo: fixedregulator_camera_front@0 { + compatible = "regulator-fixed"; + regulator-name = "camera_front_vdddo"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + camera_front_vdda: fixedregulator_camera_front@1 { + compatible = "regulator-fixed"; + regulator-name = "camera_front_vdda"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-always-on; + }; + + camera_front_vddd: fixedregulator_camera_front@2 { + compatible = "regulator-fixed"; + regulator-name = "camera_front_vddd"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-always-on; + }; + }; + }; + + fragment@1 { + target-path = "/soc/cci@1b0c000"; + __overlay__ { + status = "ok"; + + camera_front@3a { + compatible = "ovti,ov5645"; + reg = <0x3a>; + + enable-gpios = <&msmgpio 33 GPIO_ACTIVE_HIGH>; + reset-gpios = <&msmgpio 28 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&camera_front_default>; + + clocks = <&gcc GCC_CAMSS_MCLK1_CLK>; + clock-names = "xclk"; + clock-frequency = <23880000>; + + vdddo-supply = <&camera_front_vdddo>; + vdda-supply = <&camera_front_vdda>; + vddd-supply = <&camera_front_vddd>; + + status = "ok"; + + port { + camera_front_ep: endpoint { + clock-lanes = <1>; + data-lanes = <0 2>; + remote-endpoint = <&csiphy1_ep>; + }; + }; + }; + }; + }; + + fragment@2 { + target-path = "/soc/camss@1b00000"; + __overlay__ { + status = "ok"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@1 { + reg = <1>; + csiphy1_ep: endpoint { + clock-lanes = <1>; + data-lanes = <0 2>; + remote-endpoint = <&camera_front_ep>; + status = "ok"; + }; + }; + }; + }; + }; +}; diff --git a/scripts/db410c/overlays/db410c-stm32-rear-ov5645.dtbo b/scripts/db410c/overlays/db410c-stm32-rear-ov5645.dtbo new file mode 100644 index 0000000000000000000000000000000000000000..97bb230cdaf0fca94adae674a1b29c849a3cc1e0 GIT binary patch literal 2710 zcmbtWNsH7#6t1{{E4Y9j#ESzWGO;smj3Y>&{Q(~I5Nnc}o@kPasdPK72%bE6@Hjs} z#G^MskNyMw175rdf+vsa`)Wz5<7|utuk+rkx7Ay!>+{jyKNvf-&KO%{?7&a@ULZJ5 zaEyRf@Rs-=3_kN4SZXhQj{<*`$YQ=w#o~>H>vk_#srjf7WiyO42eSJK4iA(}oJ<_c ziKufvjbpHam26Fr2tp$DTogg^vDaMmDO(k~C z{yzGiXJ;M{J^GeM6Pw-f_8t(9^X|cSi})63A8Wh#kl%iMTx!zc+V!i~K!T5$rvx`G4Y_B3Xwml^ z0hZH$Y58-+Lmz;DfM7ipD}0!0zgrwMpv^-iYaI~r0#T-w%t}W)-Cx+VdUTEecCkGB0cIM0oDOCHu|uX0 z-JF{agU(3;TT5Ojg=%6EmmF?aOPoPzQRhE63q1lGPcUz`SpZq@esOih_WzzA=Y>Cj z%dhp%kPrCk=K?gHPfd$unJaUrL5CVISR8a0;=s$nV2eA&^}n-mdlxp$gqd?7j(fYX z;olvwk#{y0X3jD@hXa&nut6VQA{$RT8<%Hn==y8bVboK$`K64FE1OT&h#Aukqu|0jnQ=0 zKQVfDfIs7#%=DJNod1LLM5%a_QSn*B>k*Zc$W_)oBT9O0cw~{4VUZ=ZoJhLmJF$YV zZOG^OV?I@(ELpY6%aq)xhBspcRpxgcG1_Kgt}WnPwN%7Rxy>guo0=7_)Z)=tl*yFo zhfS!)Rh4UkdwA+_qm=WKtf#!;p+Rd=$VPqOxjr8pVXtBN3xFBjNr@M@ho|0ykknTmS$7 literal 0 HcmV?d00001 diff --git a/scripts/db410c/overlays/db410c-stm32-rear-ov5645.dts b/scripts/db410c/overlays/db410c-stm32-rear-ov5645.dts new file mode 100644 index 0000000..fba2e1f --- /dev/null +++ b/scripts/db410c/overlays/db410c-stm32-rear-ov5645.dts @@ -0,0 +1,94 @@ +/dts-v1/; +/plugin/; + +#include +#include + +/ { + compatible = "qcom,msm8916"; + + fragment@0 { + target-path = "/soc"; + __overlay__ { + camera_rear_vdddo: fixedregulator_camera_rear@0 { + compatible = "regulator-fixed"; + regulator-name = "camera_rear_vdddo"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + camera_rear_vdda: fixedregulator_camera_rear@1 { + compatible = "regulator-fixed"; + regulator-name = "camera_rear_vdda"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-always-on; + }; + + camera_rear_vddd: fixedregulator_camera_rear@2 { + compatible = "regulator-fixed"; + regulator-name = "camera_rear_vddd"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-always-on; + }; + }; + }; + + fragment@1 { + target-path = "/soc/cci@1b0c000"; + __overlay__ { + status = "ok"; + + camera_rear@3b { + compatible = "ovti,ov5645"; + reg = <0x3b>; + + enable-gpios = <&msmgpio 34 GPIO_ACTIVE_HIGH>; + reset-gpios = <&msmgpio 35 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&camera_rear_default>; + + clocks = <&gcc GCC_CAMSS_MCLK0_CLK>; + clock-names = "xclk"; + clock-frequency = <23880000>; + + vdddo-supply = <&camera_rear_vdddo>; + vdda-supply = <&camera_rear_vdda>; + vddd-supply = <&camera_rear_vddd>; + + status = "ok"; + + port { + camera_rear_ep: endpoint { + clock-lanes = <1>; + data-lanes = <0 2>; + remote-endpoint = <&csiphy0_ep>; + }; + }; + }; + }; + }; + + fragment@2 { + target-path = "/soc/camss@1b00000"; + __overlay__ { + status = "ok"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + csiphy0_ep: endpoint { + clock-lanes = <1>; + data-lanes = <0 2>; + remote-endpoint = <&camera_rear_ep>; + status = "ok"; + }; + }; + }; + }; + }; +}; diff --git a/scripts/db820c/overlays/db820c-board-ov5645.dtbo b/scripts/db820c/overlays/db820c-board-ov5645.dtbo new file mode 100644 index 0000000000000000000000000000000000000000..684474eaf613df2900257afe5f5149b328fba2c8 GIT binary patch literal 2692 zcmbVOJ8#rL5MJ{T0VNU-2?|6N2_Y177f7OzBD$WQ4w*fBFEO#b#_PM}kPs9|NGU0( zDUfIo9R(%-fOJ$ebV#(6zV{DbNneQ~; zBDzF$k%)%(k@W90JNe^T(Hj(eBNbWM>uSwu`aKJ-qhzQx6eI}bNE8Vl2LV*xAl?yC zAvT5yFJ%#gJQW2G`jQus4Z{!z7-lOoUwgqHYgdS_H64Rd6h#utdi@N|H`(>=UPE4Q z$fRZu8*5L9M^2|OPs6uJ1~iVscbRPV;p5u1f$#R0mo^sguCrQ(Wg8!`9f|KQJWq%( zs(nrUuKs*%V;Ow449hk?)Wl&lI9+d;qPd#s-sps3+~eJ_+trQJ?h)963b{qUbSBNS z?%lf&9oA<-a#Y3(aqmKbh>OvP@6C~neVh;aAJ}2jruvSX=7JCU+nys&m7eVHipp23F>*IVt>k71`#gU+<~#MaEkcyN*!raU?q;COVB7>#!WF=QQM zaUz%2J?!9oI+KlvT<%be7j=xg6EWbUv}bRzmMdE+yZJdY&}TH zlVGAM6trqL(*W&zci5YWzTUI(ksoBdKNwEN`-7qHpJ5NXZ~85P$$@vJ!e|<7A4c5^ zW`pKkKjdyt-OKHNzU0LQon+3-O%}?O=9v0{)t?d>eQ`9zG|v1q4huPw^xD^EDc?Cz z&y#IFR=&(wzR9zQLaUOOLj_mXY(7#{EyY}CU~^STU1m<)OukvvDt}Ojr$dp2W2V1t zd^ODTL<_vZM~*j63C}2c#7piQwh*Z-gn26+aV}Z{BVDJ=Iom g*49Lm8j-V5#rfuVF(5WoDQ@AUiThhk(=cTJ0shEDH2?qr literal 0 HcmV?d00001 diff --git a/scripts/db820c/overlays/db820c-board-ov5645.dts b/scripts/db820c/overlays/db820c-board-ov5645.dts new file mode 100644 index 0000000..16a8ac7 --- /dev/null +++ b/scripts/db820c/overlays/db820c-board-ov5645.dts @@ -0,0 +1,92 @@ +/dts-v1/; +/plugin/; + +#include +#include + +/ { + fragment@0 { + target-path = "/soc"; + __overlay__ { + camera_board_vdddo: fixedregulator_camera_board@0 { + compatible = "regulator-fixed"; + regulator-name = "camera_board_vdddo"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + camera_board_vdda: fixedregulator_camera_board@1 { + compatible = "regulator-fixed"; + regulator-name = "camera_board_vdda"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-always-on; + }; + + camera_board_vddd: fixedregulator_camera_board@2 { + compatible = "regulator-fixed"; + regulator-name = "camera_board_vddd"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-always-on; + }; + }; + }; + + fragment@1 { + target-path = "/soc/cci@a0c000"; + __overlay__ { + status = "ok"; + + camera_board@39 { + compatible = "ovti,ov5645"; + reg = <0x39>; + + enable-gpios = <&msmgpio 98 GPIO_ACTIVE_HIGH>; + reset-gpios = <&msmgpio 104 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&camera_board_default>; + + clocks = <&mmcc CAMSS_MCLK1_CLK>; + clock-names = "xclk"; + clock-frequency = <24000000>; + + vdddo-supply = <&camera_board_vdddo>; + vdda-supply = <&camera_board_vdda>; + vddd-supply = <&camera_board_vddd>; + + status = "ok"; + + port { + camera_board_ep: endpoint { + clock-lanes = <1>; + data-lanes = <0 2>; + remote-endpoint = <&csiphy1_ep>; + }; + }; + }; + }; + }; + + fragment@2 { + target-path = "/soc/camss@a00000"; + __overlay__ { + status = "ok"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@1 { + reg = <1>; + csiphy1_ep: endpoint { + clock-lanes = <7>; + data-lanes = <0 1>; + remote-endpoint = <&camera_board_ep>; + status = "ok"; + }; + }; + }; + }; + }; +}; diff --git a/scripts/db820c/overlays/db820c-d3-rear-ov5640.dtbo b/scripts/db820c/overlays/db820c-d3-rear-ov5640.dtbo new file mode 100644 index 0000000000000000000000000000000000000000..1c22da8b97c6f04c99e8a1a7596f2a9bd5643fba GIT binary patch literal 2654 zcmbVOy>8S%5Z>cQ1QaBo009L>B!mESPC^ihAUdS0p-YL`*qg*)do8c;l0!m*h6+jw zcmZlU=<@*Z08~^Il(fKn`*Yqi$tB84b2~FTGyCoA%$~oV{_~5mQ;!*AcNv@6q4^ro zS)wyUG&&zh|HkkWza1-e)+@e|i=ys@T62_skAv$f8EXv%i6S`^RmMkA1XX7}-4;nD zHU=55WfjFd7Zr~x!7CeuF~k9e*|Axmz2J|vb3_+B$7q-&iNvZ|KSuLac6qDk$t#{r zYPRaFJtZDzI)Zr$zIj^5*bg6a*v7}Tr;qRYmzOpc@UE~%hG`ogu1xAd&0*5D(T(G@$HO=bb>XyY1h$|`KBHf{6Ys8j zi?P;WeHJ8#b$U|{m+suwv7iUu5z##&XZPYS4U#VrVL1I;tG`G()ByA|MDG)^&Iegd ztkxmsM{DbBK3Vy-wL$HF-i|Yay7Ai~y^D=F--wVS#DV&uaXYu_1+TX2KR_D?ffTb9ecX-YkRAs82bD;ZyOtA?16k>b~*58 zI-eTlYcf;j{esUD#k|pN9>1=agYJ~~!=_B*K#co`h+(?PoCPr+9wLVSP9R3q#F(Er z%VghmaXsB#>hKoDD4G}x6EWbVv}-SHIU~=MU&`2^wCUBkDM&qP;!VS}T*@s`C333> zHp*10<&YiFu@XwuV<$pla=J)+zdB%uGA-h|%7Tz~b^gS4-W||C&Sd-ykZIUlkcMZI z8KHpVQZu*T?zz3*N7VEVg41xdj<*NH$#{D(bnh8#2LWJx|uW+Mr7;dA-SEnbVxEWr8)I4F!E&cw(LwL7v8y97=lG8?&5m@2cn7 z79XiV7OdRlMM9xf&Fg`JD{ECA>Ba@cTxDQ?HI_nVZrn_PS?oVr?e_yUD9dcb9(a7; zDtH0yjVa literal 0 HcmV?d00001 diff --git a/scripts/db820c/overlays/db820c-d3-rear-ov5640.dts b/scripts/db820c/overlays/db820c-d3-rear-ov5640.dts new file mode 100644 index 0000000..645ef4b --- /dev/null +++ b/scripts/db820c/overlays/db820c-d3-rear-ov5640.dts @@ -0,0 +1,91 @@ +/dts-v1/; +/plugin/; + +#include +#include + +/ { + fragment@0 { + target-path = "/soc"; + __overlay__ { + camera_rear_vdddo: fixedregulator_camera_rear@0 { + compatible = "regulator-fixed"; + regulator-name = "camera_rear_vdddo"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + camera_rear_vdda: fixedregulator_camera_rear@1 { + compatible = "regulator-fixed"; + regulator-name = "camera_rear_vdda"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-always-on; + }; + + camera_rear_vddd: fixedregulator_camera_rear@2 { + compatible = "regulator-fixed"; + regulator-name = "camera_rear_vddd"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-always-on; + }; + }; + }; + + fragment@1 { + target-path = "/soc/cci@a0c000"; + __overlay__ { + status = "ok"; + + camera_rear@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + + powerdown-gpios = <&msmgpio 26 GPIO_ACTIVE_HIGH>; + reset-gpios = <&msmgpio 25 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&camera_rear_default>; + + clocks = <&mmcc CAMSS_MCLK0_CLK>; + clock-names = "xclk"; + + DOVDD-supply = <&camera_rear_vdddo>; + AVDD-supply = <&camera_rear_vdda>; + DVDD-supply = <&camera_rear_vddd>; + + status = "ok"; + + port { + camera_rear_ep: endpoint { + clock-lanes = <0>; + data-lanes = <1 2>; + remote-endpoint = <&csiphy0_ep>; + }; + }; + }; + }; + }; + + fragment@2 { + target-path = "/soc/camss@a00000"; + __overlay__ { + status = "ok"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + csiphy0_ep: endpoint { + clock-lanes = <7>; + data-lanes = <0 1>; + remote-endpoint = <&camera_rear_ep>; + status = "ok"; + }; + }; + }; + }; + }; +}; diff --git a/scripts/db820c/overlays/db820c-stm32-front-ov5645.dtbo b/scripts/db820c/overlays/db820c-stm32-front-ov5645.dtbo new file mode 100644 index 0000000000000000000000000000000000000000..9b68042e85e701d7726b2e6186a349f6a7b13217 GIT binary patch literal 2692 zcmbVOJ8#rL5MJ{T0TGFZL<&TOgb<3kBP3CjBD$WQ4w=Q?yBKV*@%k<~Bm@OWh?0Vu z0*MCEQBd*^prfLpL!zYw=G%w8XUGv{rM;b*oyRw`vwQxu`0EE_C!R3IHW*v@LhEIk zr)i#|Nh5em@>iOi{Ru1^3@bj$MNtp>T5_0vkAmtc8EXkSi6S`>RmP`L1W_noa!R0?`gL;R=@ZE)mFg(8hJ=3XJpeKW2UV`TPEnKl1Hj1CJP}2i9&ablfOX z)BKLilzGo!Lx&q|^xDU;=hdJ$?>(_Kb3Sey#D}?FIv3!$br2uky8$1v^>J+`m(D%x z;e2|tjfh;Xl8;BNkCho8uu0`-6e}z~lYFa6H~041NC$xz~NuZwXZXc~=^YrosNgsC&T#@bCH_ zcYAIu7yo$8s}Y@K$?I(v%beDf`hm5d5(Ry6cx;{)VV=g7oJe}@TeY0;{!`Ag9X?f| zELgeCi-cUOn%83mQ|31x37VE-t}_r^HC&&W6E{m}Hnk`mR^t9x6!DblZ<|n!%QDjp z_vpmY#wg~m$e9+D|(S9^zEfo7>g`Z?4n8^2uu5S+kQ`VMVxgd$*e?_ ZELLf`Jza^2%vFwCIIH6RR`WcL*&pZYN811Z literal 0 HcmV?d00001 diff --git a/scripts/db820c/overlays/db820c-stm32-front-ov5645.dts b/scripts/db820c/overlays/db820c-stm32-front-ov5645.dts new file mode 100644 index 0000000..b218304 --- /dev/null +++ b/scripts/db820c/overlays/db820c-stm32-front-ov5645.dts @@ -0,0 +1,92 @@ +/dts-v1/; +/plugin/; + +#include +#include + +/ { + fragment@0 { + target-path = "/soc"; + __overlay__ { + camera_front_vdddo: fixedregulator_camera_front@0 { + compatible = "regulator-fixed"; + regulator-name = "camera_front_vdddo"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + camera_front_vdda: fixedregulator_camera_front@1 { + compatible = "regulator-fixed"; + regulator-name = "camera_front_vdda"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-always-on; + }; + + camera_front_vddd: fixedregulator_camera_front@2 { + compatible = "regulator-fixed"; + regulator-name = "camera_front_vddd"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-always-on; + }; + }; + }; + + fragment@1 { + target-path = "/soc/cci@a0c000"; + __overlay__ { + status = "ok"; + + camera_front@3a { + compatible = "ovti,ov5645"; + reg = <0x3a>; + + enable-gpios = <&msmgpio 133 GPIO_ACTIVE_HIGH>; + reset-gpios = <&msmgpio 23 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&camera_front_default>; + + clocks = <&mmcc CAMSS_MCLK2_CLK>; + clock-names = "xclk"; + clock-frequency = <24000000>; + + vdddo-supply = <&camera_front_vdddo>; + vdda-supply = <&camera_front_vdda>; + vddd-supply = <&camera_front_vddd>; + + status = "ok"; + + port { + camera_front_ep: endpoint { + clock-lanes = <1>; + data-lanes = <0 2>; + remote-endpoint = <&csiphy2_ep>; + }; + }; + }; + }; + }; + + fragment@2 { + target-path = "/soc/camss@a00000"; + __overlay__ { + status = "ok"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@2 { + reg = <2>; + csiphy2_ep: endpoint { + clock-lanes = <7>; + data-lanes = <0 1>; + remote-endpoint = <&camera_front_ep>; + status = "ok"; + }; + }; + }; + }; + }; +}; diff --git a/scripts/db820c/overlays/db820c-stm32-rear-ov5645.dtbo b/scripts/db820c/overlays/db820c-stm32-rear-ov5645.dtbo new file mode 100644 index 0000000000000000000000000000000000000000..35cb460669d87112a287a149a1dfbae44bedf482 GIT binary patch literal 2679 zcmbVOJ8#rL5MJ{T4+RM*K!B(sA%rkz5{M#@(AE3^8Va+q_YxD^YrMWo4unKSK|zVA z5fU981ttFg{s0Xf5-lY#-#+X;lU$;#w6`;}^Z0glX3t+w{rSb%$t}j%Dr3jL(t4HV z8JeeQ(g;3~{H>v9egn$|qnfW5qHKndmK>(vqo4*#CR##H;#f{Zo%3lNLllg%ZIRYu zeVp?~)^WlMQS-PKytZB#gCAg6Xw^b(1$*qBrFq^nj3;TDO6;2bBeY&&m$rr;f6wDd z%pQ1qkBP>a4q=^x?c<-@}hiV@mub}rm%-QZQ0?PGOo!3nbhTl!<}m5n7$iwHB>r|l#+s5`qaLAm1l`9_S31+3p`B4-Z!PfLTxZ1YgbS_2|k zAj-6oS?PFZ`x|@Kj?NLlFNWtoI7K|-IvdnKutTRmyB;^y1sn9Ay+>XsMK_57AqDL9 zJM=MU&Y+;##t$wN?JyIr;JV%=0_XMK7I&}Mo_GFZw2zqn`F;O5KhE371|Bhx53K!M zfT#1RX|X1AW!^K`P~iougYGdLcsUr%c~5N0G!FQcplGW zgB-SHW^TUUZ@ayfsAs%87_QFo?qE0`?+%9UJ45c)XZj6+%8otKVl%7Xg0Md9M$5>5rOFjjJlx z4EN~N(Z(p}C3#PI!$U*XqL7UU+umH{DSdM(6(%Cj6 +#include + +/ { + fragment@0 { + target-path = "/soc"; + __overlay__ { + camera_rear_vdddo: fixedregulator_camera_rear@0 { + compatible = "regulator-fixed"; + regulator-name = "camera_rear_vdddo"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + camera_rear_vdda: fixedregulator_camera_rear@1 { + compatible = "regulator-fixed"; + regulator-name = "camera_rear_vdda"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-always-on; + }; + + camera_rear_vddd: fixedregulator_camera_rear@2 { + compatible = "regulator-fixed"; + regulator-name = "camera_rear_vddd"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-always-on; + }; + }; + }; + + fragment@1 { + target-path = "/soc/cci@a0c000"; + __overlay__ { + status = "ok"; + + camera_rear@3b { + compatible = "ovti,ov5645"; + reg = <0x3b>; + + enable-gpios = <&msmgpio 26 GPIO_ACTIVE_HIGH>; + reset-gpios = <&msmgpio 25 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&camera_rear_default>; + + clocks = <&mmcc CAMSS_MCLK0_CLK>; + clock-names = "xclk"; + clock-frequency = <24000000>; + + vdddo-supply = <&camera_rear_vdddo>; + vdda-supply = <&camera_rear_vdda>; + vddd-supply = <&camera_rear_vddd>; + + status = "ok"; + + port { + camera_rear_ep: endpoint { + clock-lanes = <1>; + data-lanes = <0 2>; + remote-endpoint = <&csiphy0_ep>; + }; + }; + }; + }; + }; + + fragment@2 { + target-path = "/soc/camss@a00000"; + __overlay__ { + status = "ok"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + csiphy0_ep: endpoint { + clock-lanes = <7>; + data-lanes = <0 1>; + remote-endpoint = <&camera_rear_ep>; + status = "ok"; + }; + }; + }; + }; + }; +}; diff --git a/scripts/overlay-apply.sh b/scripts/overlay-apply.sh new file mode 100755 index 0000000..b66b5ad --- /dev/null +++ b/scripts/overlay-apply.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +OVERLAY=${1} +BOOTIMG=${2:-/dev/disk/by-partlabel/boot} +DT_ROOT=`dirname $0`/../.. +DBOOTIMG=`which dbootimg` +DBOOTIMG=${DBOOTIMG:-${DT_ROOT}/tools/dbootimg/dbootimg} +DTBTOOL=`which dtbtool` +DTBTOOL=${DTBTOOL:-${DT_ROOT}/tools/dtbtool/dtbtool} + +usage() +{ + echo "usage: ${0} overlay.dtbo [boot-image]" + echo "boot-image defaults to ${BOOTIMG}" +} + +if [ $# -lt 1 ]; then + usage + exit 2 +fi + +if [ ! -e ${OVERLAY} ]; then + echo "${OVERLAY} doesn't exist." + exit 3 +fi + +if [ ! -e ${BOOTIMG} ]; then + echo "${BOOTIMG} doesn't exist." + exit 4 +fi + +${DBOOTIMG} ${BOOTIMG} -x dtb | ${DTBTOOL} -m ${OVERLAY} | ${DBOOTIMG} ${BOOTIMG} -u dtb + +if [ "$?" -ne 0 ]; then + echo "Failed to apply ${OVERLAY} to ${BOOTIMG}" + exit 1 +fi + +sync +echo "${OVERLAY} applied to ${BOOTIMG}"