Skip to content

Commit 016794a

Browse files
hal-fengMichaelZhuxx
authored andcommitted
media/starfive: add starfive v4l2 driver framework
1. Add starfive video v4l2 driver framework 2. Support DVP sensor and MIPI csi sensor, eg: imx219, ov4689, dvp ov5640, sc2235 Signed-off-by: sw.multimedia <sw.multimedia@starfivetech.com> Signed-off-by: david.li <david.li@starfivetech.com> Signed-off-by: jack.zhu <jack.zhu@starfivetech.com> Signed-off-by: keithzhao <keith.zhao@starfivetech.com> Signed-off-by: andy.hu <andy.hu@starfivetech.com> Signed-off-by: Curry Zhang <curry.zhang@starfivetech.com>
1 parent 32f645a commit 016794a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+28765
-1
lines changed

arch/riscv/boot/dts/starfive/jh7100-common.dtsi

Lines changed: 340 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <dt-bindings/gpio/gpio.h>
1010
#include <dt-bindings/leds/common.h>
1111
#include <dt-bindings/pinctrl/pinctrl-starfive.h>
12+
#include <dt-bindings/starfive_fb.h>
1213

1314
/ {
1415
aliases {
@@ -441,6 +442,29 @@
441442
pinctrl-0 = <&i2c0_pins>;
442443
status = "okay";
443444

445+
imx219@10 {
446+
compatible = "imx219";
447+
reg = <0x10>;
448+
clocks = <&clk_ext_camera>;
449+
clock-names = "xclk";
450+
// powerdown-gpio = <&gpio 21 GPIO_ACTIVE_HIGH>;
451+
reset-gpio = <&gpio 58 GPIO_ACTIVE_HIGH>;
452+
//DOVDD-supply = <&v2v8>;
453+
rotation = <0>;
454+
orientation = <1>; //CAMERA_ORIENTATION_BACK
455+
456+
port {
457+
/* CSI2 bus endpoint */
458+
imx219_to_csi2rx0: endpoint {
459+
remote-endpoint = <&csi2rx0_from_imx219>;
460+
bus-type = <4>; /* MIPI CSI-2 D-PHY */
461+
clock-lanes = <0>;
462+
data-lanes = <1 2>;
463+
link-frequencies = /bits/ 64 <456000000>;
464+
};
465+
};
466+
};
467+
444468
pmic@5e {
445469
compatible = "ti,tps65086";
446470
reg = <0x5e>;
@@ -478,6 +502,56 @@
478502
#sound-dai-cells = <0>;
479503
wlf,shared-lrclk;
480504
};
505+
506+
seeed_plane_i2c@45 {
507+
compatible = "seeed_panel";
508+
reg = <0x45>;
509+
};
510+
511+
/* TODO: Used for EVB board, should comment here for starlight board, remove it later*/
512+
ov5640: ov5640@3c {
513+
compatible = "ovti,ov5640";
514+
reg = <0x3c>;
515+
clocks = <&clk_ext_camera>;
516+
clock-names = "xclk";
517+
powerdown-gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
518+
reset-gpios = <&gpio 28 GPIO_ACTIVE_HIGH>;
519+
//DOVDD-supply = <&v2v8>;
520+
rotation = <180>;
521+
port {
522+
// Parallel bus endpoint
523+
ov5640_to_parallel: endpoint {
524+
remote-endpoint = <&parallel_from_ov5640>;
525+
bus-type = <5>; // Parallel
526+
bus-width = <8>;
527+
data-shift = <2>; // lines 9:2 are used
528+
hsync-active = <0>;
529+
vsync-active = <1>;
530+
pclk-sample = <1>;
531+
};
532+
};
533+
};
534+
sc2235@30 {
535+
compatible = "sc2235";
536+
reg = <0x30>;
537+
clocks = <&clk_ext_camera>;
538+
clock-names = "xclk";
539+
powerdown-gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
540+
reset-gpios = <&gpio 28 GPIO_ACTIVE_HIGH>;
541+
//DOVDD-supply = <&v2v8>;
542+
port {
543+
// Parallel bus endpoint
544+
sc2235_to_parallel: endpoint {
545+
remote-endpoint = <&parallel_from_sc2235>;
546+
bus-type = <5>; // Parallel
547+
bus-width = <8>;
548+
data-shift = <2>; // lines 13:6 are used
549+
hsync-active = <1>;
550+
vsync-active = <1>;
551+
pclk-sample = <1>;
552+
};
553+
};
554+
};
481555
};
482556

483557
&i2c2 {
@@ -488,6 +562,40 @@
488562
pinctrl-names = "default";
489563
pinctrl-0 = <&i2c2_pins>;
490564
status = "okay";
565+
566+
seeed_plane_i2c@45 {
567+
compatible = "seeed_panel";
568+
reg = <0x45>;
569+
570+
port {
571+
panel_dsi_port: endpoint {
572+
remote-endpoint = <&dsi_out_port>;
573+
};
574+
};
575+
};
576+
577+
imx219sub@10 {
578+
compatible = "imx219";
579+
reg = <0x10>;
580+
clocks = <&clk_ext_camera>;
581+
clock-names = "xclk";
582+
// powerdown-gpio = <&gpio 21 GPIO_ACTIVE_HIGH>;
583+
reset-gpio = <&gpio 57 GPIO_ACTIVE_HIGH>;
584+
//DOVDD-supply = <&v2v8>;
585+
rotation = <0>;
586+
orientation = <0>; //CAMERA_ORIENTATION_FRONT
587+
588+
port {
589+
/* CSI2 bus endpoint */
590+
imx219_to_csi2rx1: endpoint {
591+
remote-endpoint = <&csi2rx1_from_imx219>;
592+
bus-type = <4>; /* MIPI CSI-2 D-PHY */
593+
clock-lanes = <0>;
594+
data-lanes = <1 2>;
595+
link-frequencies = /bits/ 64 <456000000>;
596+
};
597+
};
598+
};
491599
};
492600

493601
&osc_sys {
@@ -570,6 +678,238 @@
570678
};
571679
};
572680

681+
&sfivefb {
682+
status = "okay";
683+
684+
pp1 {
685+
pp-id = <1>;
686+
fifo-out;
687+
src-format = <COLOR_YUV420_NV21>;
688+
src-width = <1920>;
689+
src-height = <1080>;
690+
dst-format = <COLOR_RGB888_ARGB>;
691+
dst-width = <1920>;
692+
dst-height = <1080>;
693+
};
694+
695+
tda_998x_1080p {
696+
compatible = "starfive,display-dev";
697+
panel_name = "tda_998x_1080p";
698+
panel_lcd_id = <22>; /* 1080p */
699+
interface_info = "rgb_interface";
700+
refresh_en = <1>;
701+
bits-per-pixel = <16>;
702+
physical-width = <62>;
703+
physical-height = <114>;
704+
panel-width = <1920>;
705+
panel-height = <1080>;
706+
pixel-clock = <78000000>;
707+
/*dyn_fps;*/ /*dynamic frame rate support*/
708+
709+
/*.flags = PREFER_CMD_SEND_MONOLITHIC | CE_CMD_SEND_MONOLITHIC | RESUME_WITH_PREFER | RESUME_WITH_CE*/
710+
/*gamma-command-monolithic;*/
711+
/*ce-command-monolithic;*/
712+
/*resume-with-gamma;*/
713+
/*resume-with-ce;*/
714+
715+
/*mipi info*/
716+
mipi-byte-clock = <78000>;
717+
mipi-escape-clock = <13000>;
718+
lane-no = <4>;
719+
display_mode = "video_mode"; /*video_mode, command_mode*/
720+
721+
/*
722+
auto_stop_clklane_en;
723+
im_pin_val;*/
724+
725+
color_bits = <COLOR_CODE_24BIT>;
726+
/*is_18bit_loosely;*/
727+
728+
/*video mode info*/
729+
h-pulse-width = <44>;
730+
h-back-porch = <148>;
731+
h-front-porch = <88>;
732+
v-pulse-width = <5>;
733+
v-back-porch = <36>;
734+
v-front-porch = <4>;
735+
status = "okay";
736+
sync_pol = "vsync_high_act"; /*vsync_high_act, hsync_high_act*/
737+
lp_cmd_en;
738+
/*lp_hfp_en;*/
739+
/*lp_hbp_en;*/
740+
/*lp_vact_en;*/
741+
lp_vfp_en;
742+
lp_vbp_en;
743+
lp_vsa_en;
744+
traffic-mode = "burst_with_sync_pulses"; /*non_burst_with_sync_pulses, non_burst_with_sync_events*/
745+
746+
/*phy info*/
747+
data_tprepare = /bits/ 8 <0>;
748+
data_hs_zero = /bits/ 8 <0>;
749+
data_hs_exit = /bits/ 8 <0>;
750+
data_hs_trail = /bits/ 8 <0>;
751+
752+
/*te info*/
753+
te_source = "external_pin"; /*external_pin, dsi_te_trigger*/
754+
te_trigger_mode = "rising_edge"; /*rising_edge, high_1000us*/
755+
te_enable = <0>;
756+
cm_te_effect_sync_enable = <0>; /*used in command mode*/
757+
te_count_per_sec = <64>; /*used in esd*/
758+
759+
/*ext info*/
760+
/*
761+
crc_rx_en;
762+
ecc_rx_en;
763+
eotp_rx_en;
764+
*/
765+
eotp_tx_en;
766+
767+
dev_read_time = <0x7fff>;
768+
/*type cmd return_count return_code*/
769+
/*id_read_cmd_info = [];*/
770+
/*pre_id_cmd = [];*/
771+
/*esd_read_cmd_info = [DCS_CMD 0A 01 9C];*/
772+
/*pre_esd_cmd = [];*/
773+
/*panel-on-command = [];*/
774+
/*panel-off-command = [];*/
775+
/*reset-sequence = <1 5>, <0 10>, <1 30>;*/
776+
/*
777+
panel-gamma-warm-command = [
778+
779+
];
780+
panel-gamma-nature-command = [
781+
782+
];
783+
panel-gamma-cool-command = [
784+
785+
];
786+
787+
panel-ce-std-command = [
788+
789+
];
790+
panel-ce-vivid-command = [
791+
792+
];
793+
*/
794+
};
795+
796+
seeed_5_inch {
797+
compatible = "starfive,display-dev";
798+
panel_name = "seeed_5_inch";
799+
panel_lcd_id = <22>; /* 480p */
800+
interface_info = "mipi_interface";
801+
refresh_en = <1>;
802+
bits-per-pixel = <24>;
803+
physical-width = <62>;
804+
physical-height = <114>;
805+
panel-width = <800>;
806+
panel-height = <480>;
807+
pixel-clock = <27500000>;
808+
/*dyn_fps;*/ /*dynamic frame rate support*/
809+
fps = <50>;
810+
/*.flags = PREFER_CMD_SEND_MONOLITHIC | CE_CMD_SEND_MONOLITHIC | RESUME_WITH_PREFER | RESUME_WITH_CE*/
811+
/*gamma-command-monolithic;*/
812+
/*ce-command-monolithic;*/
813+
/*resume-with-gamma;*/
814+
/*resume-with-ce;*/
815+
816+
/*mipi info*/
817+
mipi-byte-clock = <78000>;
818+
mipi-escape-clock = <13000>;
819+
lane-no = <1>;
820+
display_mode = "video_mode"; /*video_mode, command_mode*/
821+
822+
/*
823+
auto_stop_clklane_en;
824+
im_pin_val;
825+
*/
826+
827+
color_bits = <COLOR_CODE_24BIT>;
828+
/*is_18bit_loosely;*/
829+
830+
/*video mode info*/
831+
h-pulse-width = <10>;
832+
h-back-porch = <20>;
833+
h-front-porch = <50>;
834+
v-pulse-width = <5>;
835+
v-back-porch = <5>;
836+
v-front-porch = <135>;
837+
838+
/*seeed panel mode info*/
839+
dphy_bps = <700000000>;
840+
dsi_burst_mode = <0>;
841+
dsi_sync_pulse = <1>;
842+
// bytes
843+
dsi_hsa = <30>;
844+
dsi_hbp = <211>;
845+
dsi_hfp = <159>;
846+
// lines
847+
dsi_vsa = <5>;
848+
dsi_vbp = <5>;
849+
dsi_vfp = <134>;
850+
851+
status = "okay";
852+
sync_pol = "vsync_high_act"; /*vsync_high_act, hsync_high_act*/
853+
lp_cmd_en;
854+
/*lp_hfp_en;*/
855+
/*lp_hbp_en;*/
856+
/*lp_vact_en;*/
857+
lp_vfp_en;
858+
lp_vbp_en;
859+
lp_vsa_en;
860+
traffic-mode = "burst_with_sync_pulses"; /*non_burst_with_sync_pulses, non_burst_with_sync_events*/
861+
862+
/*phy info*/
863+
data_tprepare = /bits/ 8 <0>;
864+
data_hs_zero = /bits/ 8 <0>;
865+
data_hs_exit = /bits/ 8 <0>;
866+
data_hs_trail = /bits/ 8 <0>;
867+
868+
/*te info*/
869+
te_source = "external_pin"; /*external_pin, dsi_te_trigger*/
870+
te_trigger_mode = "rising_edge"; /*rising_edge, high_1000us*/
871+
te_enable = <0>;
872+
cm_te_effect_sync_enable = <0>; /*used in command mode*/
873+
te_count_per_sec = <64>; /*used in esd*/
874+
875+
/*ext info*/
876+
/*
877+
crc_rx_en;
878+
ecc_rx_en;
879+
eotp_rx_en;
880+
*/
881+
eotp_tx_en;
882+
883+
dev_read_time = <0x7fff>;
884+
/*type cmd return_count return_code*/
885+
/*id_read_cmd_info = [];*/
886+
/*pre_id_cmd = [];*/
887+
/*esd_read_cmd_info = [DCS_CMD 0A 01 9C];*/
888+
/*pre_esd_cmd = [];*/
889+
/*panel-on-command = [];*/
890+
/*panel-off-command = [];*/
891+
/*reset-sequence = <1 5>, <0 10>, <1 30>;*/
892+
/*
893+
panel-gamma-warm-command = [
894+
895+
];
896+
panel-gamma-nature-command = [
897+
898+
];
899+
panel-gamma-cool-command = [
900+
901+
];
902+
903+
panel-ce-std-command = [
904+
905+
];
906+
panel-ce-vivid-command = [
907+
908+
];
909+
*/
910+
};
911+
};
912+
573913
&spi2 {
574914
pinctrl-names = "default";
575915
pinctrl-0 = <&spi2_pins>;

0 commit comments

Comments
 (0)