...
 
Commits (153)
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- copy this file to %{WORKSPACE}/.metadata/.plugins/org.eclipse.cdt.core/-->
<project>
<configuration id="cdt.managedbuild.toolchain.gnu.base.1636449201" name="Default">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider id="org.eclipse.cdt.ui.UserLanguageSettingsProvider">
<language id="org.eclipse.cdt.core.gcc">
<resource project-relative-path="">
<entry kind="includeFile" name="/${ProjName}/linux/include/generated/autoconf.h">
<flag value="LOCAL|VALUE_WORKSPACE_PATH"/>
</entry>
</resource>
</language>
</provider>
</extension>
</configuration>
</project>
/**/
/ {
chosen {
bootargs = "cma=336M console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootwait rootfstype=ext4";
linux,stdout-path = "/amba@0/serial@e0000000";
bootargs = "earlycon cma=336M root=/dev/mmcblk0p2 rw rootwait rootfstype=ext4 debug";
stdout-path = "serial0:115200n8";
};
};
/**/
/ {
chosen {
bootargs = "cma=336M console=ttyPS0,115200 root=ubi0:elphel393-rootfs earlyprintk rootwait rootfstype=ubifs ubi.mtd=4,2048";
linux,stdout-path = "/amba@0/serial@e0000000";
bootargs = "earlycon cma=336M root=ubi0:elphel393-rootfs rootwait rootfstype=ubifs ubi.mtd=4,2048";
stdout-path = "serial0:115200n8";
};
};
/**/
/ {
chosen {
bootargs = "cma=336M console=ttyPS0,115200 root=/dev/ram rw earlyprintk ramdisk_size=262144";
linux,stdout-path = "/amba@0/serial@e0000000";
bootargs = "earlycon cma=336M root=/dev/ram rw ramdisk_size=262144";
stdout-path = "serial0:115200n8";
};
};
......@@ -11,8 +11,8 @@
} ;
chosen {
/* bootargs = "console=ttyPS0,115200 debug root=/dev/ram rw ip=192.168.0.9 earlyprintk ramdisk_size=262144";*/
bootargs = "cma=128M console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootwait rootfstype=ext4";
linux,stdout-path = "/amba@0/serial@e0000000";
bootargs = "earlycon cma=128M root=/dev/mmcblk0p2 rw rootwait rootfstype=ext4";
stdout-path = "serial0:115200n8";
} ;
cpus {
#address-cells = <1>;
......@@ -88,6 +88,12 @@
compatible = "xlnx,ps7-afi-1.00.a";
reg = <0xf800b000 0x1000>;
} ;
ocmc: ocmc@f800c000 {
compatible = "xlnx,zynq-ocmc-1.0";
interrupt-parent = <&ps7_scugic_0>;
interrupts = <0 3 4>;
reg = <0xf800c000 0x1000>;
};
ps7_ddrc_0: ps7-ddrc@f8006000 {
compatible = "xlnx,zynq-ddrc-a05";
reg = <0xf8006000 0x1000>;
......@@ -96,7 +102,7 @@
ps7_dev_cfg_0: ps7-dev-cfg@f8007000 {
clock-names = "ref_clk", "fclk0", "fclk1", "fclk2", "fclk3";
clocks = <&clkc 12>, <&clkc 15>, <&clkc 16>, <&clkc 17>, <&clkc 18>;
compatible = "xlnx,zynq-devcfg-1.0", "xlnx,ps7-dev-cfg-1.00.a";
compatible = "xlnx,zynq-devcfg-1.0";
interrupt-parent = <&ps7_scugic_0>;
interrupts = <0 8 4>;
reg = <0xf8007000 0x100>;
......@@ -118,23 +124,19 @@
ps7_ethernet_0: ps7-ethernet@e000b000 {
#address-cells = <1>;
#size-cells = <0>;
clock-names = "ref_clk", "aper_clk";
clocks = <&clkc 13>, <&clkc 30>;
compatible = "xlnx,ps7-ethernet-1.00.a";
clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
clock-names = "pclk", "hclk", "tx_clk";
compatible = "cdns,zynq-gem", "cdns,gem";
interrupt-parent = <&ps7_scugic_0>;
interrupts = <0 22 4>;
phy-mode = "rgmii-id";
reg = <0xe000b000 0x1000>;
xlnx,enet-reset = <0xffffffff>;
xlnx,eth-mode = <0x1>;
xlnx,has-mdio = <0x1>;
xlnx,ptp-enet-clock = <111111115>;
} ;
ps7_i2c_0: ps7-i2c@e0004000 {
bus-id = <0>;
clocks = <&clkc 38>;
compatible = "cdns,i2c-r1p10", "xlnx,ps7-i2c-1.00.a";
compatible = "cdns,i2c-r1p10";
i2c-clk = <400000>;
input-clk = <111111114>;
interrupt-parent = <&ps7_scugic_0>;
......@@ -146,12 +148,12 @@
#address-cells = <1>;
#size-cells = <0>;
} ;
ps7_gpio_0: ps7-gpio@e000a000 {
#gpio-cells = <2>;
#interrupt-cells = <2>;
clocks = <&clkc 42>;
compatible = "xlnx,zynq-gpio-1.0", "xlnx,ps7-gpio-1.00.a";
compatible = "xlnx,zynq-gpio-1.0";
emio-gpio-width = <64>;
gpio-controller ;
gpio-mask-high = <0x0>;
......@@ -185,22 +187,26 @@
#address-cells = <2>;
#interrupt-cells = <3>;
#size-cells = <1>;
compatible = "xlnx,ps7-scugic-1.00.a", "arm,cortex-a9-gic", "arm,gic";
compatible = "arm,cortex-a9-gic";
interrupt-controller ;
num_cpus = <2>;
num_interrupts = <96>;
reg = <0xf8f01000 0x1000>, <0xf8f00100 0x100>;
} ;
efuse: efuse@f800d000 {
compatible = "xlnx,zynq-efuse";
reg = <0xf800d000 0x20>;
};
ps7_globaltimer_0: ps7-globaltimer@f8f00200 {
clocks = <&clkc 4>;
compatible = "arm,cortex-a9-global-timer", "xlnx,ps7-globaltimer-1.00.a";
compatible = "arm,cortex-a9-global-timer";
interrupt-parent = <&ps7_scugic_0>;
interrupts = <1 11 0x301>;
reg = <0xf8f00200 0x100>;
} ;
ps7_scutimer_0: ps7-scutimer@f8f00600 {
scutimer: timer@f8f00600 {
clocks = <&clkc 4>;
compatible = "arm,cortex-a9-twd-timer", "xlnx,ps7-scutimer-1.00.a";
compatible = "arm,cortex-a9-twd-timer";
interrupt-parent = <&ps7_scugic_0>;
interrupts = <1 13 0x301>;
reg = <0xf8f00600 0x20>;
......@@ -213,11 +219,11 @@
interrupts = <1 14 0x301>;
reg = <0xf8f00620 0xe0>;
} ;
ps7_wdt_0: ps7-wdt@f8005000 {
watchdog0: watchdog@f8005000 {
clocks = <&clkc 45>;
compatible = "cdns,wdt-r1p2", "xlnx,zynq-wdt-r1p2";
compatible = "cdns,wdt-r1p2";
interrupt-parent = <&ps7_scugic_0>;
interrupts = <0 9 4>;
interrupts = <0 9 1>;
reg = <0xf8005000 0x1000>;
reset = <0>;
timeout-sec = <10>;
......@@ -321,7 +327,7 @@
#size-cells = <0x1>;
} ;
} ;
ps7_uart_0: serial@e0000000 {
clock-names = "uart_clk", "pclk", "ref_clk", "aper_clk";
clocks = <&clkc 23>, <&clkc 40>, <&clkc 23>, <&clkc 40>;
......@@ -352,7 +358,7 @@
interrupts = <0 7 4>;
} ;
} ;
usb_phy0: phy0{
compatible = "ulpi-phy";
#phy-cells = <0>;
......
......@@ -4,9 +4,9 @@
/ {
model = "Elphel 10393";
ps7_axi_interconnect_0: amba@0 {
ps7_i2c_0: ps7-i2c@e0004000 {
bus-id = <0>;
i2c-clk = <400000>;
......@@ -14,7 +14,7 @@
compatible = "stm,m41t62";
reg = <0x68>;
};
vsc330x@1 {
compatible = "vsc,vsc3304";
reg = <0x01>;
......@@ -71,7 +71,7 @@
si5338,out0_freq_int= <15000000>; /* 15Mhz to output 0 */
si5338,spread_spectrum_0= <1 500 31500>; /* Set spread spectrum for channel0 : enabled, 5%, 31.5KHz - high value, for testing */
};
ltc3589@34 {
compatible = "ltc,ltc3589";
reg = <0x34>;
......@@ -99,7 +99,7 @@
reg = <0x1a>;
};
};
ps7_ethernet_0: ps7-ethernet@e000b000 {
local-mac-address = [00 0e 64 10 00 00];
phy-handle = <&phy3>;
......@@ -108,13 +108,17 @@
#address-cells = <1>;
#size-cells = <0>;
phy3: phy@3 {
compatible = "atheros,8035";
/* Atheros 8035 */
compatible = "ethernet-phy-id004d.d072";
/* compatible = "ethernet-phy-ieee802.3-c22";*/
device_type = "ethernet-phy";
reg = <0x3>;
/* rev0 - revB: reg = <0x3> */
/* revC: reg = <0x0> */
reg = <0x0>;
};
};
};
ps7_smcc_0: ps7-smcc@e000e000 {
ps7_nand_0: ps7-nand@e1000000 {
compatible = "arm,pl353-nand-r2p1";
......@@ -152,7 +156,7 @@
};
} ;
} ;
elphel_ahci: elphel-ahci@80000000 {
compatible = "elphel,elphel-ahci";
interrupt-parent = <&ps7_scugic_0>;
......@@ -162,7 +166,7 @@
fb_offs = <0xc00>;
};
};
elphel393_pwr: elphel393-pwr@0 {
compatible = "elphel,elphel393-pwr-1.00";
elphel393_pwr,simulate= <0>;
......@@ -185,17 +189,26 @@
elphel393_pwr,10389-init-value= <0x100>;
/* elphel393_pwr,channels_enable= "vcc_sens01 vp33sens01"; */
} ;
elphel393_mem: elphel393-mem@0 {
compatible = "elphel,elphel393-mem-1.00";
/*memsize = <25600>;*/
memsize = <76800>;
memsize = <76800>; /* sum of sizes from line1 and line2 must be <= memsize*/
memsize-partitions-circbuf = <16384 16384 16384 16384>; /* line 1 */
/* memsize-partitions-raw = <16384 16384 16384 16384>; /* line 2 */
memsize-partitions-raw = <0 0 0 0>; /* line 2 */
memsize-circbuf-start-offset = <0x100000>;
h2d_size = <1024>;
d2h_size = <1024>;
bidir_size = <1024>;
histograms_size = <1024>;
logger_size = <1024>;
} ;
elphel393_init: elphel393-init {
compatible = "elphel,elphel393-init-1.00";
} ;
elphel393_circbuf: elphel393-circbuf@0 {
compatible = "elphel,elphel393-circbuf-1.00";
/* set this to "disable" to disable drivers */
......@@ -219,7 +232,7 @@
/* reg = <0x80000000 0x1000>; */
interrupt-names = "mult_saxi_0", "mult_saxi_1", "mult_saxi_2", "mult_saxi_3";
};
elphel393_videomem: elphel393-videomem@0 {
compatible = "elphel,elphel393-videomem-1.00";
/* set this to "disable" to disable drivers */
......@@ -233,7 +246,7 @@
frame_full_width = <8192>; /* in bytes, will be transformed to bursts (16 bytes). 1 memory page is 2048 bytes (128 bursts) */
frame_height = <8192>; /* in pixel lines */
frames_in_buffer = <2>; /* Each channel has this number of frames in buffer */
frame_start_chn0 = <0x00000000>; /* Channel 0 frame start (in bytes) */
frame_start_chn1 = <0x08000000>; /* Channel 1 frame start (in bytes) */
frame_start_chn2 = <0x10000000>; /* Channel 2 frame start (in bytes) */
......@@ -260,7 +273,7 @@
"none",
"none";
};
elphel393_sensor_i2c: elphel393-sensor-i2c@0 {
compatible = "elphel,elphel393-sensor-i2c-1.00";
/* Add known devices: name, slave address (7-bit), number of address bytes, number of data bytes, SCL frequency (kHz) */
......@@ -277,7 +290,7 @@
framepars_operations: elphel393-framepars@0 {
compatible = "elphel,elphel393-framepars-1.00";
};
histograms_operations: elphel393-histograms@0 {
compatible = "elphel,elphel393-histograms-1.00";
};
......@@ -290,16 +303,20 @@
compatible = "elphel,elphel393-mt9x001-1.00";
};
elphel393_mt9f002: elphel393-mt9f002@0 {
compatible = "elphel,elphel393-mt9f002-1.00";
};
elphel393_clock10359:elphel393-clock10359@0{
compatible = "elphel,elphel393_clock10359-1.00";
compatible = "elphel,elphel393_clock10359-1.00";
};
klogger_393: klogger-393@0 {
compatible = "elphel,klogger-393-1.00";
klogger-393,buffer_size = <1048576>;
klogger-393,buffer_size = <1048576>;
} ;
/* i2c driver for the extension boards, such as imu, gps, etc */
/* i2c driver for the extension boards, such as imu, gps, etc */
elphel393_ext_i2c:elphel393-ext-i2c@0{
compatible = "elphel,elphel393-ext-i2c-1.00";
time_scl_high = <3>; /* SCL high duration (us) */
......@@ -309,5 +326,5 @@
filter_sda = <7>; /* filter SDA read data by testing multiple times - currently just zero/non zero */
filter_scl = <7>; /* filter SCL read data by testing multiple times - currently just zero/non zero */
};
};
\ No newline at end of file
};
This diff is collapsed.
......@@ -4,17 +4,17 @@
/ {
model = "Elphel 10393";
ps7_axi_interconnect_0: amba@0 {
ps7_i2c_0: ps7-i2c@e0004000 {
bus-id = <0>;
i2c-clk = <400000>;
/* bus-id = <0>;*/
/* i2c-clk = <400000>;*/
rtc@68 {
compatible = "stm,m41t62";
reg = <0x68>;
};
vsc330x@1 {
compatible = "vsc,vsc3304";
reg = <0x01>;
......@@ -71,7 +71,7 @@
si5338,out0_freq_int= <15000000>; /* 15Mhz to output 0 */
si5338,spread_spectrum_0= <1 500 31500>; /* Set spread spectrum for channel0 : enabled, 5%, 31.5KHz - high value, for testing */
};
ltc3589@34 {
compatible = "ltc,ltc3589";
reg = <0x34>;
......@@ -99,7 +99,7 @@
reg = <0x1a>;
};
};
ps7_ethernet_0: ps7-ethernet@e000b000 {
local-mac-address = [00 0e 64 10 00 00];
phy-handle = <&phy3>;
......@@ -108,13 +108,17 @@
#address-cells = <1>;
#size-cells = <0>;
phy3: phy@3 {
compatible = "atheros,8035";
/* Atheros 8035 */
compatible = "ethernet-phy-id004d.d072";
/* compatible = "ethernet-phy-ieee802.3-c22";*/
device_type = "ethernet-phy";
reg = <0x3>;
/* rev0 - revB: reg = <0x3> */
/* revC: reg = <0x0> */
reg = <0x0>;
};
};
};
ps7_smcc_0: ps7-smcc@e000e000 {
ps7_nand_0: ps7-nand@e1000000 {
compatible = "arm,pl353-nand-r2p1";
......@@ -152,7 +156,7 @@
};
} ;
} ;
elphel_ahci: elphel-ahci@80000000 {
compatible = "elphel,elphel-ahci";
interrupt-parent = <&ps7_scugic_0>;
......@@ -162,7 +166,7 @@
fb_offs = <0xc00>;
};
};
elphel393_pwr: elphel393-pwr@0 {
compatible = "elphel,elphel393-pwr-1.00";
elphel393_pwr,simulate= <0>;
......@@ -185,17 +189,26 @@
elphel393_pwr,10389-init-value= <0x100>;
/* elphel393_pwr,channels_enable= "vcc_sens01 vp33sens01"; */
} ;
elphel393_mem: elphel393-mem@0 {
compatible = "elphel,elphel393-mem-1.00";
/*memsize = <25600>;*/
memsize = <76800>;
memsize = <76800>; /* sum of sizes from line1 and line2 must be <= memsize*/
memsize-partitions-circbuf = <16384 16384 16384 16384>; /* line 1 */
/* memsize-partitions-raw = <16384 16384 16384 16384>; /* line 2 */
memsize-partitions-raw = <0 0 0 0>; /* line 2 */
memsize-circbuf-start-offset = <0x100000>;
h2d_size = <1024>;
d2h_size = <1024>;
bidir_size = <1024>;
histograms_size = <1024>;
logger_size = <1024>;
} ;
elphel393_init: elphel393-init {
compatible = "elphel,elphel393-init-1.00";
} ;
elphel393_circbuf: elphel393-circbuf@0 {
compatible = "elphel,elphel393-circbuf-1.00";
/* set this to "disable" to disable drivers */
......@@ -219,7 +232,7 @@
/* reg = <0x80000000 0x1000>; */
interrupt-names = "mult_saxi_0", "mult_saxi_1", "mult_saxi_2", "mult_saxi_3";
};
elphel393_videomem: elphel393-videomem@0 {
compatible = "elphel,elphel393-videomem-1.00";
/* set this to "disable" to disable drivers */
......@@ -233,7 +246,7 @@
frame_full_width = <8192>; /* in bytes, will be transformed to bursts (16 bytes). 1 memory page is 2048 bytes (128 bursts) */
frame_height = <8192>; /* in pixel lines */
frames_in_buffer = <2>; /* Each channel has this number of frames in buffer */
frame_start_chn0 = <0x00000000>; /* Channel 0 frame start (in bytes) */
frame_start_chn1 = <0x08000000>; /* Channel 1 frame start (in bytes) */
frame_start_chn2 = <0x10000000>; /* Channel 2 frame start (in bytes) */
......@@ -260,7 +273,7 @@
"mt9p006",
"mt9p006";
};
elphel393_sensor_i2c: elphel393-sensor-i2c@0 {
compatible = "elphel,elphel393-sensor-i2c-1.00";
/* Add known devices: name, slave address (7-bit), number of address bytes, number of data bytes, SCL frequency (kHz) */
......@@ -271,13 +284,14 @@
"pca9500_eeprom 0x50 1 1 100",
"sensor_eeprom 0x50 1 1 100",
"sensor_temp 0x18 1 2 100",
"cy22393 0x69 1 1 100";
"cy22393 0x69 1 1 100",
"lepton35 0x2a 2 2 500";
} ;
framepars_operations: elphel393-framepars@0 {
compatible = "elphel,elphel393-framepars-1.00";
};
histograms_operations: elphel393-histograms@0 {
compatible = "elphel,elphel393-histograms-1.00";
};
......@@ -290,15 +304,23 @@
compatible = "elphel,elphel393-mt9x001-1.00";
};
elphel393_mt9f002: elphel393-mt9f002@0 {
compatible = "elphel,elphel393-mt9f002-1.00";
};
elphel393_lepton: elphel393-lepton@0 {
compatible = "elphel,elphel393-lepton-1.00";
};
elphel393_clock10359:elphel393-clock10359@0{
compatible = "elphel,elphel393_clock10359-1.00";
compatible = "elphel,elphel393_clock10359-1.00";
};
klogger_393: klogger-393@0 {
compatible = "elphel,klogger-393-1.00";
klogger-393,buffer_size = <1048576>;
klogger-393,buffer_size = <1048576>;
} ;
/* i2c driver for the extension boards, such as imu, gps, etc */
/* i2c driver for the extension boards, such as imu, gps, etc */
elphel393_ext_i2c:elphel393-ext-i2c@0{
compatible = "elphel,elphel393-ext-i2c-1.00";
time_scl_high = <3>; /* SCL high duration (us) */
......@@ -308,5 +330,5 @@
filter_sda = <7>; /* filter SDA read data by testing multiple times - currently just zero/non zero */
filter_scl = <7>; /* filter SCL read data by testing multiple times - currently just zero/non zero */
};
};
\ No newline at end of file
};
This diff is collapsed.
......@@ -4,9 +4,9 @@
/ {
model = "Elphel 10393";
ps7_axi_interconnect_0: amba@0 {
ps7_i2c_0: ps7-i2c@e0004000 {
bus-id = <0>;
i2c-clk = <400000>;
......@@ -14,7 +14,7 @@
compatible = "stm,m41t62";
reg = <0x68>;
};
vsc330x@1 {
compatible = "vsc,vsc3304";
reg = <0x01>;
......@@ -71,7 +71,7 @@
si5338,out0_freq_int= <15000000>; /* 15Mhz to output 0 */
si5338,spread_spectrum_0= <1 500 31500>; /* Set spread spectrum for channel0 : enabled, 5%, 31.5KHz - high value, for testing */
};
ltc3589@34 {
compatible = "ltc,ltc3589";
reg = <0x34>;
......@@ -99,7 +99,7 @@
reg = <0x1a>;
};
};
ps7_ethernet_0: ps7-ethernet@e000b000 {
local-mac-address = [00 0e 64 10 00 00];
phy-handle = <&phy3>;
......@@ -108,13 +108,15 @@
#address-cells = <1>;
#size-cells = <0>;
phy3: phy@3 {
compatible = "atheros,8035";
/* Atheros 8035 */
compatible = "ethernet-phy-id004d.d072";
/* compatible = "ethernet-phy-ieee802.3-c22";*/
device_type = "ethernet-phy";
reg = <0x3>;
};
};
};
ps7_smcc_0: ps7-smcc@e000e000 {
ps7_nand_0: ps7-nand@e1000000 {
compatible = "arm,pl353-nand-r2p1";
......@@ -152,7 +154,7 @@
};
} ;
} ;
elphel_ahci: elphel-ahci@80000000 {
compatible = "elphel,elphel-ahci";
interrupt-parent = <&ps7_scugic_0>;
......@@ -162,7 +164,7 @@
fb_offs = <0xc00>;
};
};
elphel393_pwr: elphel393-pwr@0 {
compatible = "elphel,elphel393-pwr-1.00";
elphel393_pwr,simulate= <0>;
......@@ -185,17 +187,26 @@
elphel393_pwr,10389-init-value= <0x100>;
/* elphel393_pwr,channels_enable= "vcc_sens01 vp33sens01"; */
} ;
elphel393_mem: elphel393-mem@0 {
compatible = "elphel,elphel393-mem-1.00";
/*memsize = <25600>;*/
memsize = <76800>;
memsize-partitions-circbuf = <16384 16384 16384 16384>; /* line 1 */
/* memsize-partitions-raw = <16384 16384 16384 16384>; /* line 2 */
memsize-partitions-raw = <0 0 0 0>; /* line 2 */
memsize-circbuf-start-offset = <0x100000>;
h2d_size = <1024>;
d2h_size = <1024>;
bidir_size = <1024>;
histograms_size = <1024>;
logger_size = <1024>;
} ;
elphel393_init: elphel393-init {
compatible = "elphel,elphel393-init-1.00";
} ;
elphel393_circbuf: elphel393-circbuf@0 {
compatible = "elphel,elphel393-circbuf-1.00";
/* set this to "disable" to disable drivers */
......@@ -219,7 +230,7 @@
/* reg = <0x80000000 0x1000>; */
interrupt-names = "mult_saxi_0", "mult_saxi_1", "mult_saxi_2", "mult_saxi_3";
};
elphel393_videomem: elphel393-videomem@0 {
compatible = "elphel,elphel393-videomem-1.00";
/* set this to "disable" to disable drivers */
......@@ -233,7 +244,7 @@
frame_full_width = <8192>; /* in bytes, will be transformed to bursts (16 bytes). 1 memory page is 2048 bytes (128 bursts) */
frame_height = <8192>; /* in pixel lines */
frames_in_buffer = <2>; /* Each channel has this number of frames in buffer */
frame_start_chn0 = <0x00000000>; /* Channel 0 frame start (in bytes) */
frame_start_chn1 = <0x08000000>; /* Channel 1 frame start (in bytes) */
frame_start_chn2 = <0x10000000>; /* Channel 2 frame start (in bytes) */
......@@ -260,7 +271,7 @@
"mt9p006 mt9p006 mt9p006",
"mt9p006 mt9p006 mt9p006";
};
elphel393_sensor_i2c: elphel393-sensor-i2c@0 {
compatible = "elphel,elphel393-sensor-i2c-1.00";
/* Add known devices: name, slave address (7-bit), number of address bytes, number of data bytes, SCL frequency (kHz) */
......@@ -277,7 +288,7 @@
framepars_operations: elphel393-framepars@0 {
compatible = "elphel,elphel393-framepars-1.00";
};
histograms_operations: elphel393-histograms@0 {
compatible = "elphel,elphel393-histograms-1.00";
};
......@@ -290,16 +301,20 @@
compatible = "elphel,elphel393-mt9x001-1.00";
};
elphel393_mt9f002: elphel393-mt9f002@0 {
compatible = "elphel,elphel393-mt9f002-1.00";
};
elphel393_clock10359:elphel393-clock10359@0{
compatible = "elphel,elphel393_clock10359-1.00";
compatible = "elphel,elphel393_clock10359-1.00";
};
klogger_393: klogger-393@0 {
compatible = "elphel,klogger-393-1.00";
klogger-393,buffer_size = <1048576>;
klogger-393,buffer_size = <1048576>;
} ;
/* i2c driver for the extension boards, such as imu, gps, etc */
/* i2c driver for the extension boards, such as imu, gps, etc */
elphel393_ext_i2c:elphel393-ext-i2c@0{
compatible = "elphel,elphel393-ext-i2c-1.00";
time_scl_high = <3>; /* SCL high duration (us) */
......@@ -309,5 +324,5 @@
filter_sda = <7>; /* filter SDA read data by testing multiple times - currently just zero/non zero */
filter_scl = <7>; /* filter SCL read data by testing multiple times - currently just zero/non zero */
};
};
\ No newline at end of file
......@@ -4,9 +4,9 @@
/ {
model = "Elphel 10393";
ps7_axi_interconnect_0: amba@0 {
ps7_i2c_0: ps7-i2c@e0004000 {
bus-id = <0>;
i2c-clk = <400000>;
......@@ -14,7 +14,7 @@
compatible = "stm,m41t62";
reg = <0x68>;
};
vsc330x@1 {
compatible = "vsc,vsc3304";
reg = <0x01>;
......@@ -71,7 +71,7 @@
si5338,out0_freq_int= <15000000>; /* 15Mhz to output 0 */
si5338,spread_spectrum_0= <1 500 31500>; /* Set spread spectrum for channel0 : enabled, 5%, 31.5KHz - high value, for testing */
};
ltc3589@34 {
compatible = "ltc,ltc3589";
reg = <0x34>;
......@@ -99,7 +99,7 @@
reg = <0x1a>;
};
};
ps7_ethernet_0: ps7-ethernet@e000b000 {
local-mac-address = [00 0e 64 10 00 00];
phy-handle = <&phy3>;
......@@ -108,13 +108,15 @@
#address-cells = <1>;
#size-cells = <0>;
phy3: phy@3 {
compatible = "atheros,8035";
/* Atheros 8035 */
compatible = "ethernet-phy-id004d.d072";
/* compatible = "ethernet-phy-ieee802.3-c22";*/
device_type = "ethernet-phy";
reg = <0x3>;
};
};
};
ps7_smcc_0: ps7-smcc@e000e000 {
ps7_nand_0: ps7-nand@e1000000 {
compatible = "arm,pl353-nand-r2p1";
......@@ -152,7 +154,7 @@
};
} ;
} ;
elphel_ahci: elphel-ahci@80000000 {
compatible = "elphel,elphel-ahci";
interrupt-parent = <&ps7_scugic_0>;
......@@ -162,7 +164,7 @@
fb_offs = <0xc00>;
};
};
elphel393_pwr: elphel393-pwr@0 {
compatible = "elphel,elphel393-pwr-1.00";
elphel393_pwr,simulate= <0>;
......@@ -185,17 +187,26 @@
elphel393_pwr,10389-init-value= <0x100>;
/* elphel393_pwr,channels_enable= "vcc_sens01 vp33sens01"; */
} ;
elphel393_mem: elphel393-mem@0 {
compatible = "elphel,elphel393-mem-1.00";
/*memsize = <25600>;*/
memsize = <76800>;
memsize = <76800>; /* sum of sizes from line1 and line2 must be <= memsize*/
memsize-partitions-circbuf = <16384 16384 16384 16384>; /* line 1 */
/* memsize-partitions-raw = <16384 16384 16384 16384>; /* line 2 */
memsize-partitions-raw = <0 0 0 0>; /* line 2 */
memsize-circbuf-start-offset = <0x100000>;
h2d_size = <1024>;
d2h_size = <1024>;
bidir_size = <1024>;
histograms_size = <1024>;
logger_size = <1024>;
} ;
elphel393_init: elphel393-init {
compatible = "elphel,elphel393-init-1.00";
} ;
elphel393_circbuf: elphel393-circbuf@0 {
compatible = "elphel,elphel393-circbuf-1.00";
/* set this to "disable" to disable drivers */
......@@ -219,7 +230,7 @@
/* reg = <0x80000000 0x1000>; */
interrupt-names = "mult_saxi_0", "mult_saxi_1", "mult_saxi_2", "mult_saxi_3";
};
elphel393_videomem: elphel393-videomem@0 {
compatible = "elphel,elphel393-videomem-1.00";
/* set this to "disable" to disable drivers */
......@@ -233,7 +244,7 @@
frame_full_width = <8192>; /* in bytes, will be transformed to bursts (16 bytes). 1 memory page is 2048 bytes (128 bursts) */
frame_height = <8192>; /* in pixel lines */
frames_in_buffer = <2>; /* Each channel has this number of frames in buffer */
frame_start_chn0 = <0x00000000>; /* Channel 0 frame start (in bytes) */
frame_start_chn1 = <0x08000000>; /* Channel 1 frame start (in bytes) */
frame_start_chn2 = <0x10000000>; /* Channel 2 frame start (in bytes) */
......@@ -260,7 +271,7 @@
"mt9p006",
"mt9p006";
};
elphel393_sensor_i2c: elphel393-sensor-i2c@0 {
compatible = "elphel,elphel393-sensor-i2c-1.00";
/* Add known devices: name, slave address (7-bit), number of address bytes, number of data bytes, SCL frequency (kHz) */
......@@ -277,7 +288,7 @@
framepars_operations: elphel393-framepars@0 {
compatible = "elphel,elphel393-framepars-1.00";
};
histograms_operations: elphel393-histograms@0 {
compatible = "elphel,elphel393-histograms-1.00";
};
......@@ -290,16 +301,20 @@
compatible = "elphel,elphel393-mt9x001-1.00";
};
elphel393_mt9f002: elphel393-mt9f002@0 {
compatible = "elphel,elphel393-mt9f002-1.00";
};
elphel393_clock10359:elphel393-clock10359@0{
compatible = "elphel,elphel393_clock10359-1.00";
compatible = "elphel,elphel393_clock10359-1.00";
};
klogger_393: klogger-393@0 {
compatible = "elphel,klogger-393-1.00";
klogger-393,buffer_size = <1048576>;
klogger-393,buffer_size = <1048576>;
} ;
/* i2c driver for the extension boards, such as imu, gps, etc */
/* i2c driver for the extension boards, such as imu, gps, etc */
elphel393_ext_i2c:elphel393-ext-i2c@0{
compatible = "elphel,elphel393-ext-i2c-1.00";
time_scl_high = <3>; /* SCL high duration (us) */
......@@ -309,5 +324,5 @@
filter_sda = <7>; /* filter SDA read data by testing multiple times - currently just zero/non zero */
filter_scl = <7>; /* filter SCL read data by testing multiple times - currently just zero/non zero */
};
};
\ No newline at end of file
#
# Makefile for the Linux kernel device drivers.
#
# 15 Sep 2000, Christoph Hellwig <hch@infradead.org>
# Rewritten to use lists instead of if-statements.
#
obj-y += irqchip/
obj-y += bus/
obj-$(CONFIG_GENERIC_PHY) += phy/
# GPIO must come after pinctrl as gpios may need to mux pins etc
obj-y += pinctrl/
obj-y += gpio/
obj-y += pwm/
obj-$(CONFIG_PCI) += pci/
obj-$(CONFIG_PARISC) += parisc/
obj-$(CONFIG_RAPIDIO) += rapidio/
obj-y += video/
obj-y += idle/
# IPMI must come before ACPI in order to provide IPMI opregion support
obj-$(CONFIG_IPMI_HANDLER) += char/ipmi/
obj-$(CONFIG_ACPI) += acpi/
obj-$(CONFIG_SFI) += sfi/
# PnP must come after ACPI since it will eventually need to check if acpi
# was used and do nothing if so
obj-$(CONFIG_PNP) += pnp/
obj-y += amba/
# Many drivers will want to use DMA so this has to be made available
# really early.
obj-$(CONFIG_DMADEVICES) += dma/
# SOC specific infrastructure drivers.
obj-y += soc/
obj-$(CONFIG_VIRTIO) += virtio/
obj-$(CONFIG_XEN) += xen/
# regulators early, since some subsystems rely on them to initialize
obj-$(CONFIG_REGULATOR) += regulator/
# reset controllers early, since gpu drivers might rely on them to initialize
obj-$(CONFIG_RESET_CONTROLLER) += reset/
# tty/ comes before char/ so that the VT console is the boot-time
# default.
obj-y += tty/
obj-y += char/
# iommu/ comes before gpu as gpu are using iommu controllers
obj-$(CONFIG_IOMMU_SUPPORT) += iommu/
# gpu/ comes after char for AGP vs DRM startup and after iommu
obj-y += gpu/
obj-$(CONFIG_CONNECTOR) += connector/
# i810fb and intelfb depend on char/agp/
obj-$(CONFIG_FB_I810) += video/fbdev/i810/
obj-$(CONFIG_FB_INTEL) += video/fbdev/intelfb/
obj-$(CONFIG_PARPORT) += parport/
obj-y += base/ block/ misc/ mfd/ nfc/
obj-$(CONFIG_DMA_SHARED_BUFFER) += dma-buf/
obj-$(CONFIG_NUBUS) += nubus/
obj-y += macintosh/
obj-$(CONFIG_IDE) += ide/
obj-$(CONFIG_SCSI) += scsi/
obj-$(CONFIG_ATA) += ata/
obj-$(CONFIG_TARGET_CORE) += target/
obj-$(CONFIG_MTD) += mtd/
obj-$(CONFIG_SPI) += spi/
obj-$(CONFIG_SPMI) += spmi/
obj-y += hsi/
obj-$(CONFIG_ATM) += atm/
obj-$(CONFIG_FUSION) += message/
obj-y += firewire/
obj-$(CONFIG_UIO) += uio/
obj-$(CONFIG_VFIO) += vfio/
obj-y += cdrom/
obj-y += auxdisplay/
obj-$(CONFIG_PCCARD) += pcmcia/
obj-$(CONFIG_DIO) += dio/
obj-$(CONFIG_SBUS) += sbus/
obj-$(CONFIG_ZORRO) += zorro/
obj-$(CONFIG_ATA_OVER_ETH) += block/aoe/
obj-$(CONFIG_PARIDE) += block/paride/
obj-$(CONFIG_TC) += tc/
obj-$(CONFIG_UWB) += uwb/
obj-$(CONFIG_USB_PHY) += usb/
obj-$(CONFIG_USB) += usb/
obj-$(CONFIG_PCI) += usb/
obj-$(CONFIG_USB_GADGET) += usb/
obj-$(CONFIG_SERIO) += input/serio/
obj-$(CONFIG_GAMEPORT) += input/gameport/
obj-$(CONFIG_INPUT) += input/
obj-$(CONFIG_I2O) += message/
obj-$(CONFIG_RTC_LIB) += rtc/
obj-y += i2c/ media/
obj-$(CONFIG_PPS) += pps/
obj-$(CONFIG_PTP_1588_CLOCK) += ptp/
obj-$(CONFIG_W1) += w1/
obj-$(CONFIG_POWER_SUPPLY) += power/
obj-$(CONFIG_HWMON) += hwmon/
obj-$(CONFIG_THERMAL) += thermal/
obj-$(CONFIG_WATCHDOG) += watchdog/
obj-$(CONFIG_MD) += md/
obj-$(CONFIG_BT) += bluetooth/
obj-$(CONFIG_ACCESSIBILITY) += accessibility/
obj-$(CONFIG_ISDN) += isdn/
obj-$(CONFIG_EDAC) += edac/
obj-$(CONFIG_EISA) += eisa/
obj-y += lguest/
obj-$(CONFIG_CPU_FREQ) += cpufreq/
obj-$(CONFIG_CPU_IDLE) += cpuidle/
obj-y += mmc/
obj-$(CONFIG_MEMSTICK) += memstick/
obj-y += leds/
obj-$(CONFIG_INFINIBAND) += infiniband/
obj-$(CONFIG_SGI_SN) += sn/
obj-y += firmware/
obj-$(CONFIG_CRYPTO) += crypto/
obj-$(CONFIG_SUPERH) += sh/
obj-$(CONFIG_ARCH_SHMOBILE) += sh/
ifndef CONFIG_ARCH_USES_GETTIMEOFFSET
obj-y += clocksource/
endif
obj-$(CONFIG_DCA) += dca/
obj-$(CONFIG_HID) += hid/
obj-$(CONFIG_PPC_PS3) += ps3/
obj-$(CONFIG_OF) += of/
obj-$(CONFIG_SSB) += ssb/
obj-$(CONFIG_BCMA) += bcma/
obj-$(CONFIG_VHOST_RING) += vhost/
obj-$(CONFIG_VLYNQ) += vlynq/
obj-$(CONFIG_STAGING) += staging/
obj-y += platform/
#common clk code
obj-y += clk/
obj-$(CONFIG_MAILBOX) += mailbox/
obj-$(CONFIG_HWSPINLOCK) += hwspinlock/
obj-$(CONFIG_REMOTEPROC) += remoteproc/
obj-$(CONFIG_RPMSG) += rpmsg/
# Virtualization drivers
obj-$(CONFIG_VIRT_DRIVERS) += virt/
obj-$(CONFIG_HYPERV) += hv/
obj-$(CONFIG_PM_DEVFREQ) += devfreq/
obj-$(CONFIG_EXTCON) += extcon/
obj-$(CONFIG_MEMORY) += memory/
obj-$(CONFIG_IIO) += iio/
obj-$(CONFIG_VME_BUS) += vme/
obj-$(CONFIG_IPACK_BUS) += ipack/
obj-$(CONFIG_NTB) += ntb/
obj-$(CONFIG_FMC) += fmc/
obj-$(CONFIG_POWERCAP) += powercap/
obj-$(CONFIG_MCB) += mcb/
obj-$(CONFIG_RAS) += ras/
obj-$(CONFIG_THUNDERBOLT) += thunderbolt/
obj-$(CONFIG_CORESIGHT) += coresight/
obj-$(CONFIG_ANDROID) += android/
obj-$(CONFIG_ELPHEL393) += elphel/
obj-$(CONFIG_ELPHELDRVONMICROZED) += elphel/
obj-$(CONFIG_ELPHEL393_EXTERNAL) += elphel/
obj-y += net/
......@@ -290,7 +290,9 @@ static irqreturn_t elphel_irq_handler(int irq, void * dev_instance)
dpriv->datascope.reg_stat[IRQ_COUNTER_SYS] = dpriv->datascope.reg_stat[IRQ_COUNTER_SYS] + 1;
/* pass handling to AHCI level and then decide if the resource should be freed */
handled = ahci_single_irq_intr(irq, dev_instance);
// Elphel, Rocko migration
//handled = ahci_single_irq_intr(irq, dev_instance);
handled = ahci_single_level_irq_intr(irq, dev_instance);
spin_lock_irqsave(&dpriv->flags_lock, irq_flags);
if (is_cmdq_empty(dpriv)) {
dpriv->flags &= ~DISK_BUSY;
......
......@@ -26,6 +26,8 @@ obj-$(CONFIG_ELPHEL393) += gamma_tables.o
obj-$(CONFIG_ELPHEL393) += histograms.o
obj-$(CONFIG_ELPHEL393) += pgm_functions.o
obj-$(CONFIG_ELPHEL393) += mt9x001.o
obj-$(CONFIG_ELPHEL393) += mt9f002.o
obj-$(CONFIG_ELPHEL393) += lepton.o
obj-$(CONFIG_ELPHEL393) += multi10359.o
obj-$(CONFIG_ELPHEL393) += imu_log393.o
......
......@@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//#define DEBUG
#include <linux/device.h>
#include <linux/module.h>
#include <linux/mm.h>
......@@ -47,9 +48,44 @@
#include "x393_macro.h"
//#include "x393_helpers.h"
static const char * const circbuf_devs[] = {
DEV393_DEVNAME(DEV393_CIRCBUF0),
DEV393_DEVNAME(DEV393_CIRCBUF1),
DEV393_DEVNAME(DEV393_CIRCBUF2),
DEV393_DEVNAME(DEV393_CIRCBUF3),
DEV393_DEVNAME(DEV393_JPEGHEAD0),
DEV393_DEVNAME(DEV393_JPEGHEAD1),
DEV393_DEVNAME(DEV393_JPEGHEAD2),
DEV393_DEVNAME(DEV393_JPEGHEAD3),
DEV393_DEVNAME(DEV393_HUFFMAN0),
DEV393_DEVNAME(DEV393_HUFFMAN1),
DEV393_DEVNAME(DEV393_HUFFMAN2),
DEV393_DEVNAME(DEV393_HUFFMAN3)
};
static const int circbuf_major = DEV393_MAJOR(DEV393_CIRCBUF0);
static const int circbuf_minor[] = {
DEV393_MINOR(DEV393_CIRCBUF0),
DEV393_MINOR(DEV393_CIRCBUF1),
DEV393_MINOR(DEV393_CIRCBUF2),
DEV393_MINOR(DEV393_CIRCBUF3),
DEV393_MINOR(DEV393_JPEGHEAD0),
DEV393_MINOR(DEV393_JPEGHEAD1),
DEV393_MINOR(DEV393_JPEGHEAD2),
DEV393_MINOR(DEV393_JPEGHEAD3),
DEV393_MINOR(DEV393_HUFFMAN0),
DEV393_MINOR(DEV393_HUFFMAN1),
DEV393_MINOR(DEV393_HUFFMAN2),
DEV393_MINOR(DEV393_HUFFMAN3)
};
/** @brief Driver name displayed in system logs */
//#define CIRCBUF_DRIVER_NAME "circbuf driver"
/** device class */
static struct class *circbuf_dev_class;
/** @brief Wait queue for the processes waiting for a new frame to appear in the circular buffer. Each channel has
* its own instance of wait queue to prevent race conditions when one channel wakes up the queue while the other
* channel is processing interrupt and moved its write pointer, but has not finished all other functions yet.
......@@ -98,7 +134,32 @@ int init_ccam_dma_buf_ptr(struct platform_device *pdev)
}
}
circbuf_priv[0].buf_size = pElphel_buf->circbuf_chn0_size*PAGE_SIZE;
circbuf_priv[0].phys_addr = pElphel_buf->circbuf_chn0_paddr;
circbuf_priv[0].buf_ptr = pElphel_buf->circbuf_chn0_vaddr;
circbuf_priv[1].buf_size = pElphel_buf->circbuf_chn1_size*PAGE_SIZE;
circbuf_priv[1].phys_addr = pElphel_buf->circbuf_chn1_paddr;
circbuf_priv[1].buf_ptr = pElphel_buf->circbuf_chn1_vaddr;
circbuf_priv[2].buf_size = pElphel_buf->circbuf_chn2_size*PAGE_SIZE;
circbuf_priv[2].phys_addr = pElphel_buf->circbuf_chn2_paddr;
circbuf_priv[2].buf_ptr = pElphel_buf->circbuf_chn2_vaddr;
circbuf_priv[3].buf_size = pElphel_buf->circbuf_chn3_size*PAGE_SIZE;
circbuf_priv[3].phys_addr = pElphel_buf->circbuf_chn3_paddr;
circbuf_priv[3].buf_ptr = pElphel_buf->circbuf_chn3_vaddr;
for (i = 0; i < SENSOR_PORTS; i++) {
circbuf_priv[i].buf_size32 = circbuf_priv[i].buf_size>>2; // used in many places
ccam_dma_buf_ptr[i] = circbuf_priv[i].buf_ptr;
set_globalParam(i, G_CIRCBUFSIZE, circbuf_priv[i].buf_size);
}
/*
// DONE: take data from pElphel_buf (calc buf_ptr for each channel)
for (i = 0; i < SENSOR_PORTS; i++) {
// nobody knows what the 1st 1MB is for...
circbuf_priv[i].buf_ptr = dma_buf_ptr + BYTE2DW(CIRCBUF_START_OFFSET + i * CCAM_DMA_SIZE);
circbuf_priv[i].phys_addr = dma_handle + CIRCBUF_START_OFFSET + i * CCAM_DMA_SIZE;
circbuf_priv[i].buf_size = CCAM_DMA_SIZE;
......@@ -108,6 +169,7 @@ int init_ccam_dma_buf_ptr(struct platform_device *pdev)
// set circular buffer size in bytes
set_globalParam(i, G_CIRCBUFSIZE, circbuf_priv[i].buf_size);
}
*/
return 0;
}
......@@ -116,10 +178,10 @@ ssize_t circbuf_get_ptr(int sensor_port, size_t offset, size_t len, struct fvec
{
int ret = 1;
if (offset > CCAM_DMA_SIZE || sensor_port >= SENSOR_PORTS)
if (offset > circbuf_priv[sensor_port].buf_size || sensor_port >= SENSOR_PORTS)
return -EINVAL;
if (offset + len < CCAM_DMA_SIZE) {
if (offset + len < circbuf_priv[sensor_port].buf_size) {
// the image is not split
vect_0->iov_base = &circbuf_priv[sensor_port].buf_ptr[BYTE2DW(offset)];
vect_0->iov_dma = circbuf_priv[sensor_port].phys_addr + offset;
......@@ -131,7 +193,7 @@ ssize_t circbuf_get_ptr(int sensor_port, size_t offset, size_t len, struct fvec
// the image is split into two segments
vect_0->iov_base = &circbuf_priv[sensor_port].buf_ptr[BYTE2DW(offset)];
vect_0->iov_dma = circbuf_priv[sensor_port].phys_addr + offset;
vect_0->iov_len = CCAM_DMA_SIZE - offset;
vect_0->iov_len = circbuf_priv[sensor_port].buf_size - offset;
vect_1->iov_base = circbuf_priv[sensor_port].buf_ptr;
vect_1->iov_dma = circbuf_priv[sensor_port].phys_addr;
vect_1->iov_len = len - vect_0->iov_len;
......@@ -140,7 +202,7 @@ ssize_t circbuf_get_ptr(int sensor_port, size_t offset, size_t len, struct fvec
return ret;
}
EXPORT_SYMBOL_GPL(circbuf_get_ptr);
EXPORT_SYMBOL_GPL(circbuf_get_ptr); // @suppress("Unused function declaration") it is still needed
/**
* @brief Process circular buffer file opening and define further action in accordance
......@@ -866,47 +928,69 @@ static struct file_operations circbuf_fops = {
*/
static int circbuf_all_init(struct platform_device *pdev)
{
int res, i;
struct device *dev = &pdev->dev;
const struct of_device_id *match;
/* sanity check */
match = of_match_device(elphel393_circbuf_of_match, dev);
if (!match)
return -EINVAL;
dev_dbg(dev, "registering character device with name 'circbuf_operations'");
res = register_chrdev(DEV393_MAJOR(DEV393_CIRCBUF0), "circbuf_operations", &circbuf_fops);
if(res < 0) {
dev_err(dev, "couldn't get a major number %d.\n", DEV393_MAJOR(DEV393_CIRCBUF0));
return res;
}
dev_info(dev, "registered MAJOR: %d\n", DEV393_MAJOR(DEV393_CIRCBUF0));
int res, i;
struct device *dev = &pdev->dev;
const struct of_device_id *match;
// char device for sensor port
struct device *chrdev;
res = jpeghead_init(pdev);
if (res < 0) {
dev_err(dev, "unable to initialize jpeghead module\n");
return res;
}
res = image_acq_init(pdev);
if (res < 0) {
dev_err(dev, "unable to initialize sensor_common module\n");
return res;
}
res = init_ccam_dma_buf_ptr(pdev);
if (res < 0) {
dev_err(dev, "ERROR allocating coherent DMA buffer\n");
return -ENOMEM;
}
/* sanity check */
match = of_match_device(elphel393_circbuf_of_match, dev);
if (!match)
return -EINVAL;
dev_dbg(dev, "registering character device with name 'circbuf_operations'");
res = register_chrdev(DEV393_MAJOR(DEV393_CIRCBUF0), "circbuf_operations", &circbuf_fops);
if(res < 0) {
dev_err(dev, "couldn't get a major number %d.\n", DEV393_MAJOR(DEV393_CIRCBUF0));
return res;
}
dev_info(dev, "registered MAJOR: %d\n", DEV393_MAJOR(DEV393_CIRCBUF0));
// create device class
circbuf_dev_class = class_create(THIS_MODULE, DEV393_NAME(DEV393_CIRCBUF0));
if (IS_ERR(circbuf_dev_class)) {
pr_err("Cannot create \"%s\" class", DEV393_NAME(DEV393_CIRCBUF0));
return PTR_ERR(circbuf_dev_class);
}
// create devices
for (i=0;i<(sizeof(circbuf_minor)/sizeof(int));i++){
chrdev = device_create(
circbuf_dev_class,
&pdev->dev,
MKDEV(circbuf_major, circbuf_minor[i]),
NULL,
"%s",circbuf_devs[i]);
if(IS_ERR(chrdev)){
pr_err("Failed to create a device (circbuf, %d). Error code: %ld\n",i,PTR_ERR(chrdev));
}
}
res = jpeghead_init(pdev);
if (res < 0) {
dev_err(dev, "unable to initialize jpeghead module\n");
return res;
}
res = image_acq_init(pdev);
if (res < 0) {
dev_err(dev, "unable to initialize sensor_common module\n");
return res;
}
res = init_ccam_dma_buf_ptr(pdev);
if (res < 0) {
dev_err(dev, "ERROR allocating coherent DMA buffer\n");
return -ENOMEM;
}
dev_dbg(dev, "initialize circbuf wait queue\n");
for (i = 0; i < SENSOR_PORTS; i++)
init_waitqueue_head(&circbuf_wait_queue[i]);
dev_dbg(dev, "initialize Huffman tables with default data\n");
dev_dbg(dev, "initialize circbuf wait queue\n");
for (i = 0; i < SENSOR_PORTS; i++)
init_waitqueue_head(&circbuf_wait_queue[i]);
dev_dbg(dev, "initialize Huffman tables with default data\n");
g_dev_ptr = dev;
g_dev_ptr = dev;
return 0;
return 0;
}
/**
......@@ -916,8 +1000,13 @@ static int circbuf_all_init(struct platform_device *pdev)
*/
static int circbuf_remove(struct platform_device *pdev)
{
int i;
for (i=0;i<(sizeof(circbuf_minor)/sizeof(int));i++){
device_destroy(
circbuf_dev_class,
MKDEV(circbuf_major, circbuf_minor[i]));
}
unregister_chrdev(DEV393_MAJOR(DEV393_CIRCBUF0), "circbuf_operations");
return 0;
}
......@@ -936,7 +1025,7 @@ static struct platform_driver elphel393_circbuf = {
},
};
module_platform_driver(elphel393_circbuf);
module_platform_driver(elphel393_circbuf); // @suppress("Unused variable declaration in file scope") because
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Andrey Filippov <andrey@elphel.com>.");
......
......@@ -23,6 +23,7 @@
#define _CIRCBUF_H
#include <linux/poll.h>
#include <uapi/elphel/c313a.h>
struct fvec {
void *iov_base; ///< pointer to allocated buffer
......
......@@ -164,6 +164,32 @@ static int xi2c_initialized=0; // configure GPIO puins access at first command;
static int i2c_hardware_on=0; // shadow register for FPFA I2C controller
#endif
static const char * const xi2c_devs[]={
DEV393_DEVNAME(DEV393_I2C_CTRL),
DEV393_DEVNAME(DEV393_I2C_8_AINC),
DEV393_DEVNAME(DEV393_I2C_16_AINC),
DEV393_DEVNAME(DEV393_I2C1_8_AINC),
DEV393_DEVNAME(DEV393_I2C1_16_AINC),
DEV393_DEVNAME(DEV393_I2C_RAW),
DEV393_DEVNAME(DEV393_I2C1_RAW),
DEV393_DEVNAME(DEV393_I2C_ENABLE)
};
static const int xi2c_major = DEV393_MAJOR(DEV393_I2C_CTRL);
static const int xi2c_minor[]={
DEV393_MINOR(DEV393_I2C_CTRL),
DEV393_MINOR(DEV393_I2C_8_AINC),
DEV393_MINOR(DEV393_I2C_16_AINC),
DEV393_MINOR(DEV393_I2C1_8_AINC),
DEV393_MINOR(DEV393_I2C1_16_AINC),
DEV393_MINOR(DEV393_I2C_RAW),
DEV393_MINOR(DEV393_I2C1_RAW),
DEV393_MINOR(DEV393_I2C_ENABLE)
};
/** @brief Global device class for sysfs */
static struct class *xi2c_dev_class;
//void i2c_disable(int n);
//void i2c_dir_out(int n);
......@@ -1360,6 +1386,8 @@ int xi2c_init(struct platform_device *pdev)
{
int i,res;
struct device *dev = &pdev->dev;
// char device for sensor port
struct device *chrdev;
elphel393_ext_i2c_sysfs_register(pdev);
dev_info(dev, DEV393_NAME(DEV393_I2C_CTRL)": registered sysfs\n");
......@@ -1373,6 +1401,26 @@ int xi2c_init(struct platform_device *pdev)
printk(X3X3_I2C_DRIVER_NAME" - %d, %d channels\n",DEV393_MAJOR(DEV393_I2C_CTRL),X3X3_I2C_CHANNELS);
// thisminor =0;
// create device class
xi2c_dev_class = class_create(THIS_MODULE, DEV393_NAME(DEV393_I2C_CTRL));
if (IS_ERR(xi2c_dev_class)) {
pr_err("Cannot create \"%s\" class", DEV393_NAME(DEV393_I2C_CTRL));
return PTR_ERR(xi2c_dev_class);
}
//create devices
for (i=0;i<(sizeof(xi2c_minor)/sizeof(int));i++){
chrdev = device_create(
xi2c_dev_class,
&pdev->dev,
MKDEV(xi2c_major, xi2c_minor[i]),
NULL,
"%s",xi2c_devs[i]);
if(IS_ERR(chrdev)){
pr_err("Failed to create a device (xi2c %d). Error code: %ld\n",i,PTR_ERR(chrdev));
}
}
elphel393_xi2c_init_of(pdev);
bitdelays[0].scl_high=2; //! SCL high:
......@@ -1474,6 +1522,12 @@ int xi2c_init(struct platform_device *pdev)
int xi2c_remove(struct platform_device *pdev)
{
int i;
for (i=0;i<(sizeof(xi2c_minor)/sizeof(int));i++){
device_destroy(
xi2c_dev_class,
MKDEV(xi2c_major, xi2c_minor[i]));
}
unregister_chrdev(DEV393_MAJOR(DEV393_I2C_CTRL), DEV393_NAME(DEV393_I2C_CTRL));
return 0;
}
......
......@@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
#define DEBUG
//#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/of_device.h>
......@@ -33,25 +33,26 @@
#include "x393.h"
#include <uapi/elphel/x393_devices.h>
#include <uapi/elphel/c313a.h>
#include "latency.h"
#include "mt9x001.h"
#include "mt9f002.h"
#include "multi10359.h"
#include "lepton.h"
#include "detect_sensors.h"
#define DETECT_SENSORS_MODULE_DESCRIPTION "Detect sensor type(s) attached to each of the ports"
#define OF_PREFIX_NAME "elphel393-detect_sensors"
struct sensor_port_config_t
{
u32 mux; ///< sensor multiplexer, currently 0 (SENSOR_DETECT, SENSOR_MUX_10359 or SENSOR_NONE)
u32 sensor[MAX_SENSORS]; ///< Without mux only [0] is used, with 10359 - 0..2 are used (i2c addressing is shifted so 0 is broadcast)
};
struct sensor_port_config_t *pSensorPortConfig;
// removed static to export
static struct sensor_port_config_t sensorPortConfig[] = {
{.mux=SENSOR_NONE,.sensor={SENSOR_NONE,SENSOR_NONE,SENSOR_NONE,SENSOR_NONE}},
{.mux=SENSOR_NONE,.sensor={SENSOR_NONE,SENSOR_NONE,SENSOR_NONE,SENSOR_NONE}},
{.mux=SENSOR_NONE,.sensor={SENSOR_NONE,SENSOR_NONE,SENSOR_NONE,SENSOR_NONE}},
{.mux=SENSOR_NONE,.sensor={SENSOR_NONE,SENSOR_NONE,SENSOR_NONE,SENSOR_NONE}}
{.mux=SENSOR_NONE,.broadcast_addr=0,.sensor={SENSOR_NONE,SENSOR_NONE,SENSOR_NONE,SENSOR_NONE}},
{.mux=SENSOR_NONE,.broadcast_addr=0,.sensor={SENSOR_NONE,SENSOR_NONE,SENSOR_NONE,SENSOR_NONE}},
{.mux=SENSOR_NONE,.broadcast_addr=0,.sensor={SENSOR_NONE,SENSOR_NONE,SENSOR_NONE,SENSOR_NONE}},
{.mux=SENSOR_NONE,.broadcast_addr=0,.sensor={SENSOR_NONE,SENSOR_NONE,SENSOR_NONE,SENSOR_NONE}}
};
//struct sensor_port_config_t *pSensorPortConfig;
static const struct of_device_id elphel393_detect_sensors_of_match[];
static struct device *g_dev_ptr; ///< Global pointer to basic device structure. This pointer is used in debugfs output functions
struct sensor_name_t {
......@@ -78,6 +79,7 @@ const struct sensor_name_t sensor_names[] ={
{.name="mt9f002", .type=1, .iface=HISPI4, .code = SENSOR_MT9F002}, // MT9F002
{.name="ibis51300", .type=1, .iface=PARALLEL12, .code = SENSOR_IBIS51300}, // FillFactory IBIS51300
{.name="kai11002", .type=1, .iface=PARALLEL12, .code = SENSOR_KAI11000}, // Kodak KAI11002
{.name="lepton35", .type=1, .iface=VOSPI, .code = SENSOR_LEPTON35}, // Kodak KAI11002
{.name=NULL, .type=0, .iface=NONE, .code = 0} // end of list
};
static sens_iface_t port_iface[SENSOR_PORTS];
......@@ -127,6 +129,11 @@ sens_iface_t get_iface_by_code(int code, ///< sensor code
return NONE;
}
/** Get sensor port multiplexer type */
int set_broadcast_address(int port,int value){
sensorPortConfig[port & 3].broadcast_addr = value;
return 0;
}
/** Get sensor port multiplexer type */
int get_detected_mux_code(int port) ///< Sensor port number (0..3)
......@@ -177,7 +184,8 @@ void update_port_iface(int port) ///< Sensor port number (0..3)
port_iface[port] = iface;
return;
}
port_iface[port] = get_iface_by_code(get_detected_sensor_code(port,-1), DETECT_MUX); // '-1' - any subchannel
//TODO: Check with 10359. was port_iface[port] = get_iface_by_code(get_detected_sensor_code(port,-1), DETECT_MUX);
port_iface[port] = get_iface_by_code(get_detected_sensor_code(port,-1), DETECT_SENSOR); // '-1' - any subchannel
}
/** Get per-port interface type */
......@@ -187,7 +195,13 @@ sens_iface_t get_port_interface(int port) ///< Sensor port number (0..3)
return port_iface[port];
}
/** init port and subchn with default ahead_tab from latency.h */
int init_port_ahead_table(int port,
int sub_chn)
{
sensorPortConfig[port & 3].ahead_tab[sub_chn] = ahead_tab;
return 0;
}