/include/ "system-conf.dtsi"
/ {
	chosen{
		bootargs = "console=ttyPS0,115200 earlyprintk
		uio_pdrv_genirq.of_id=generic-uio";
		};
};

&amba {
	  gpio-leds {
        compatible = "gpio-leds";
        
        en_ps_n {
            label = "en_ps_n";
            gpios = <&gpio0 32 1>;
            default-state = "on";
            linux,default-trigger = "default-on";
        };

        line_ps {
            /* Off green, on red */ 
            label = "line_ps";
            gpios = <&gpio0 33 0>;
            default-state = "off";
            linux,default-trigger = "default-off";
        };

        ps1 {
            label = "led-ps1";
            gpios = <&gpio0 34 0>;
            default-state = "on";
            linux,default-trigger = "heartbeat";
        };

        ps2 {
            label = "led-ps2";
            gpios = <&gpio0 35 0>;
            default-state = "on";
            linux,default-trigger = "heartbeat";
        };

        ps3 {
            label = "led-ps3";
            gpios = <&gpio0 36 0>;
            default-state = "on";
            linux,default-trigger = "heartbeat";
        };

        ps4 {
            label = "led-ps4";
            gpios = <&gpio0 37 0>;
            default-state = "on";
            linux,default-trigger = "heartbeat";
        };
    };

    /*
    fasc_watchdog {
        compatible = "linux,wdt-gpio";
        gpios = <&gpio0 51 1>;
        hw_algo = "toggle";
    };
    */
    
};

&gem0 {
	compatible = "cdns,gem";
	phy-mode = "moca";
/*	below will be changed by uboot before passing to kernel */
	local-mac-address = [08 00 30 00 38 00];
	fixed-link {
		   speed = <1000>;
		   full-duplex;
		   reg = <0x4>;
	};
	mdio {
	     #address-cells = <1>;
	     #size-cells = <0>;

	     phy0: phy@1 {
	     	   reg = <0x1>;
	     };
	     phy1: phy@2 {
	     	   reg = <0x2>;
	     };
             switch0: switch0@0 {
             	      compatible = "marvell,mv88e6085";
                      #address-cells = <1>;
		      #size-cells = <0>;
		      reg = <0>;

		      ports {
		      	    #address-cells = <1>;
			    #size-cells = <0>;

                            port@1 {
			    	   reg = <1>;
				   label = "eth1";
				   phy-handle = <&phy0>;
			    };
			    port@2 {
			    	   reg = <2>;
				   label = "eth2";
				   phy-handle = <&phy1>;
			    };
			    port@4 {
			    	   reg = <4>;
				   label = "cpu";
				   ethernet = <&gem0>;
				   fixed-link {
				   	      speed = <1000>;
					      full-duplex;
				   };
			   };

		     };
	     };
	};
};

&axi_wb_i2c_master_2{
	#address-cells = <1>;
	#size-cells = <0>;	
	compatible = "opencores,i2c-ocores";
	status = "okay";
	reg = <0x43c00000 0x8>;
	interrupt-parent = <&intc>;
	interrupts = <0 30 4>;	
	opencores,ip-clock-frequency = <100000000>;
	clock-frequency = <400000>;

	/* shift & width to accomodate AXI4 addressing */
	reg-shift = <2>;
	reg-io-width = <4>;
	
	/* below devices only there when FMC card is plugged in!
	 * moreover addresses depend on FMC-slot - done for both
	 */
	eeprom_fmc1@50{
		compatible = "microchip,24c64";
		reg = <0x50>;
		pagesize = <32>;
	};
	gpio_fmc1@74{
		compatible = "ti,tca9539";
		reg = <0x74>;
	};
	eeprom_fmc2@52{
		compatible = "microchip,24c64";
		reg = <0x52>;
		pagesize = <32>;
	};
	gpio_fmc2@75{
		compatible = "ti,tca9539";
		reg = <0x75>;
	};

};

&FID_top_0{
	compatible = "cern,fasec_hwtest";
	interrupt-parent = <&intc>;
	interrupts = <0 32 1>; /* intr_led_o */
};

/* MIO pins 38, 39 - PMBus power controller */
&i2c0{
	compatible = "cdns,i2c-r1p10";	/* r1p14 for Zynq Ultrascale MP */
	status = "okay";
	clock-frequency = <100000>;
	ucd90120@5B {
		compatible = "ti,ucd90120";
		reg = <0x5B>;
	};
};

/* MIO pins 28, 29 - external patch panel */
&i2c1{
	compatible = "cdns,i2c-r1p10";	/* r1p14 for Zynq Ultrascale MP */
	status = "okay";
	clock-frequency = <100000>;
/* commented out, fasec_hwtest driver creates i2c_client structs now
	gpio_patch_ic3@74{
		compatible = "ti,tca9539";
		reg = <0x74>;
	};
	gpio_patch_ic2@75{
		compatible = "ti,tca9539";
		reg = <0x75>;
	};
	gpio_patch_ic1@77{
		compatible = "ti,tca9539";
		reg = <0x77>;
	};
*/	
};

/* disable adc driver from zynq-7000.dtsi */
&adc{
	status = "disabled";
};
	
&xadc_wiz_0{
	compatible = "xlnx,axi-xadc-1.00.a";
	clocks = <&clkc 15>;
	xlnx,channels{
		#address-cells = <1>;
		#size-cells = <0>;
		/* from bindings info: 1 is vauxp/n[0]! */		
		channel@1 {
			  reg = <1>;
			  xlnx,bipolar;			  
		};
		channel@2 {
			  reg = <2>;
			  xlnx,bipolar;			  
		};
		channel@3 {
			  reg = <3>;
			  xlnx,bipolar;
		};		
		channel@9 {
			  reg = <9>;
			  xlnx,bipolar;			  
		};
		channel@10 {
			  reg = <10>;
			  xlnx,bipolar;			  
		};
		channel@11 {
			  reg = <11>;
			  xlnx,bipolar;			  
		};
	};
};

&flash0 {
	compatible = "s25fl128s1";
};
