页次: 1
我是这样配置的
## 修改显示屏驱动方式
```
// chosen {
// #address-cells = <1>;
// #size-cells = <1>;
// ranges;
// framebuffer-lcd {
// compatible = "allwinner,simple-framebuffer",
// "simple-framebuffer";
// allwinner,pipeline = "mixer0-lcd0";
// clocks = <&display_clocks CLK_MIXER0>,
// <&ccu CLK_TCON0>;
// status = "disabled";
// };
// };
chosen {
#address-cells = <1>;
#size-cells = <1>;
ranges;
simplefb_lcd: framebuffer@0 {
compatible = "allwinner,simple-framebuffer",
"simple-framebuffer";
allwinner,pipeline = "de0-lcd0";
clocks = <&ccu CLK_BUS_TCON0>, <&display_clocks 0>,
<&display_clocks 6>, <&ccu CLK_TCON0>;
status = "disabled";
};
};
```
## 驱动摄像头
### sun8i-v3s.dtsi
```
/omit-if-no-ref/
csi1_mclk_pin: csi1-mclk-pin {
pins = "PE1";
function = "csi";
};
//增加//////////////////////////////////
csi1_clk: csi1-clk@0 {
pins = "PE0","PE2","PE3";
bias-disable;
function = "csi";
};
csi1_8bit: csi1-8bit@0 {
pins = "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15";
bias-disable;
function = "csi";
};
csi1_mclk: csi1-mclk@0 {
pins = "PE1";
bias-disable;
function = "csi";
};
//////////////////////////////////////
i2c0_pins: i2c0-pins {
pins = "PB6", "PB7";
function = "i2c0";
};
/omit-if-no-ref/
i2c1_pe_pins: i2c1-pe-pins {
pins = "PE21", "PE22";
function = "i2c1";
};
//增加//////////////////////////////////
i2c1_pins: i2c1-pins {
pins = "PE21", "PE22";
function = "i2c1";
};
//////////////////////////////////////
uart2: serial@1c28800 {
compatible = "snps,dw-apb-uart";
reg = <0x01c28800 0x400>;
interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
clocks = <&ccu CLK_BUS_UART2>;
resets = <&ccu RST_BUS_UART2>;
pinctrl-0 = <&uart2_pins>;
pinctrl-names = "default";
status = "disabled";
};
//增加//////////////////////////////////
dma: dma-controller@01c02000 {
compatible = "allwinner,sun8i-v3s-dma";
reg = <0x01c02000 0x1000>;
interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_DMA>;
resets = <&ccu RST_BUS_DMA>;
#dma-cells = <1>;
};
codec_analog: codec-analog@01c23000 {
compatible = "allwinner,sun8i-v3s-codec-analog";
reg = <0x01c23000 0x4>;
};
codec: codec@01c22c00 {
#sound-dai-cells = <0>;
compatible = "allwinner,sun8i-v3s-codec";
reg = <0x01c22c00 0x400>;
interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
clock-names = "apb", "codec";
resets = <&ccu RST_BUS_CODEC>;
dmas = <&dma 15>, <&dma 15>;
dma-names = "rx", "tx";
allwinner,codec-analog-controls = <&codec_analog>;
status = "disabled";
};
//////////////////////////////////////
csi1: camera@1cb4000 {
compatible = "allwinner,sun8i-v3s-csi";
reg = <0x01cb4000 0x3000>;
interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_CSI>,
<&ccu CLK_CSI1_SCLK>,
<&ccu CLK_DRAM_CSI>;
clock-names = "bus", "mod", "ram";
resets = <&ccu RST_BUS_CSI>;
status = "okay"; // "disabled"修改为"okay"
};
```
### sun8i-v3s-licheepi-zero-dock.dts
```
&mmc1 {
broken-cd;
bus-width = <4>;
vmmc-supply = <®_vcc3v3>;
status = "okay";
};
//增加----------------------------------------------------------------
&csi1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&csi1_clk &csi1_8bit>;
port {
csi1_ep: endpoint {
remote-endpoint = <&ov2640_0>;
hsync-active = <0>;
vsync-active = <0>;
bus-width = <10>;
pclk-sample = <1>;
};
};
};
&i2c1 {
pinctrl-0 = <&i2c1_pins>;
pinctrl-names = "default";
clock-frequency = <400000>;
status = "okay";
ov2640: camera@30 {
compatible = "ovti,ov2640";
reg = <0x30>;
pinctrl-names = "default";
pinctrl-0 = <&csi1_mclk_pin>;
clocks = <&ccu CLK_CSI1_MCLK>;
clock-names = "xvclk";
assigned-clocks = <&ccu CLK_CSI1_MCLK>;
assigned-clock-rates = <24000000>;
port {
ov2640_0: endpoint {
remote-endpoint = <&csi1_ep>;
bus-width = <10>;
};
};
};
};
&codec {
allwinner,audio-routing =
"Headphone", "HP",
"Headphone", "HPCOM",
"MIC1", "Mic",
"Mic", "HBIAS";
status = "okay";
};
//----------------------------------------------------------------
```
### 修改配置文件
```
> Device Drivers > Multimedia support > Media device types
[ *] Platform-specific devices
> Device Drivers > Multimedia support > Media drivers > V4L platform devices
<*> Video Multiplexer
<*> Allwinner V3s Camera Sensor Interface driver
> Device Drivers > Multimedia support > Media drivers > Memory-to-memory multimedia devices
<*> Deinterlace
<*> Allwinner Deinterlace
<*> Allwinner DE2 rotation driver
> Device Drivers > Multimedia support > Media ancillary drivers > Camera sensor devices
{*} OmniVision OV2640 sensor support
<*> OmniVision OV7670 sensor support
```
页次: 1