/*
 * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include "dra7-evm.dts"

/ {
	memory {
		device_type = "memory";
		reg = <0x0 0x80000000 0x0 0x10000000>; /* 256 MB */
	};

	leds {
		status = "disabled";
	};

	gpio_keys {
		status = "disabled";
	};
	jamr3_sound{
		status = "disabled";
	};
	
	primary_sound{
		status = "disabled";
	};

};

&evm_3v3_sd {
		gpio = <>;
};

&snd0 {
	status = "disabled";
};

&hdmi0 {
	status = "disabled";
};

&tpd12s015 {
	status = "disabled";
};

&pcf_lcd {
	status = "disabled";
};

&pcf_gpio_21 {
	status = "disabled";
};

&lcd_fpd {
	status = "disabled";
};

&extcon_usb1 {
	id-gpio = <&gpio1 31 GPIO_ACTIVE_HIGH>;
};

&extcon_usb2 {
	id-gpio = <&gpio1 30 GPIO_ACTIVE_HIGH>;
};

&tlv320aic3106 {
	status = "disabled";
};

&pcf_hdmi {
	status = "disabled";
};

&i2c_p3_exp {
	ov10633@37 {
		status = "disabled";
	};
};

&tvp_5158 {
	status = "disabled";
};

&disp_ser {
	status = "disabled";
};

&pcie1_rc {
	status = "disabled";
};


&elm {
	status = "okay";
};

&gpmc {
	status = "okay";

	pinctrl-names = "default"; /* add by shawn */
	pinctrl-0 = <&nand_flash_x16>; /* add by shawn */

	ranges = <0 0 0 0x01000000>;	/* minimum GPMC partition = 16MB */
	nand@0,0 {
		reg = <0 0 4>;		/* device IO registers */
		ti,nand-ecc-opt = "bch8";
		ti,elm-id = <&elm>;
		nand-bus-width = <16>;
		gpmc,device-width = <2>;
		gpmc,sync-clk-ps = <0>;
		gpmc,cs-on-ns = <0>;
		gpmc,cs-rd-off-ns = <80>;
		gpmc,cs-wr-off-ns = <80>;
		gpmc,adv-on-ns = <0>;
		gpmc,adv-rd-off-ns = <60>;
		gpmc,adv-wr-off-ns = <60>;
		gpmc,we-on-ns = <10>;
		gpmc,we-off-ns = <50>;
		gpmc,oe-on-ns = <4>;
		gpmc,oe-off-ns = <40>;
		gpmc,access-ns = <40>;
		gpmc,wr-access-ns = <80>;
		gpmc,rd-cycle-ns = <80>;
		gpmc,wr-cycle-ns = <80>;
		gpmc,bus-turnaround-ns = <0>;
		gpmc,cycle2cycle-delay-ns = <0>;
		gpmc,clk-activation-ns = <0>;
		gpmc,wait-monitoring-ns = <0>;
		gpmc,wr-data-mux-bus-ns = <0>;
		/* MTD partition table */
		/* All SPL-* partitions are sized to minimal length
		 * which can be independently programmable. For
		 * NAND flash this is equal to size of erase-block */
		#address-cells = <1>;
		#size-cells = <1>;

		partition@0 {
			label = "NAND.device.0";
			reg = <0x00000000 0x10000000>;  /*256 MB*/
		};

		/*
		partition@0 {
			label = "NAND.SPL";
			reg = <0x00000000 0x000020000>;
		};
		partition@1 {
			label = "NAND.SPL.backup1";
			reg = <0x00020000 0x00020000>;
		};
		partition@2 {
			label = "NAND.SPL.backup2";
			reg = <0x00040000 0x00020000>;
		};
		partition@3 {
			label = "NAND.SPL.backup3";
			reg = <0x00060000 0x00020000>;
		};
		partition@4 {
			label = "NAND.u-boot-spl-os";
			reg = <0x00080000 0x00040000>;
		};
		partition@5 {
			label = "NAND.u-boot";
			reg = <0x000c0000 0x00100000>;
		};
		partition@6 {
			label = "NAND.u-boot-env";
			reg = <0x001c0000 0x00020000>;
		};
		partition@7 {
			label = "NAND.u-boot-env.backup1";
			reg = <0x001e0000 0x00020000>;
		};
		partition@8 {
			label = "NAND.kernel";
			reg = <0x00200000 0x00800000>;
		};
		partition@9 {
			label = "NAND.file-system";
			reg = <0x00a00000 0x0f600000>;
		};
		*/
	};
};


&mailbox5 {
	status = "disabled";
};

&mailbox6 {
	status = "disabled";
};

&mmu0_dsp1 {
	status = "disabled";
};

&mmu1_dsp1 {
	status = "disabled";
};

&mmu0_dsp2 {
	status = "disabled";
};

&mmu1_dsp2 {
	status = "disabled";
};

&mmu_ipu1 {
	status = "disabled";
};

&mmu_ipu2 {
	status = "disabled";
};

&ipu2 {
	status = "disabled";
};

&ipu1 {
	status = "disabled";
};

&dsp1 {
	status = "disabled";
};

&dsp2 {
	status = "disabled";
};

&dss {
	status = "disabled";
};

&hdmi {
	status = "disabled";
};

&vip1 {
	status = "disabled";
};

&video_in {
	status = "disabled";
};


&reserved_mem {
	status = "disabled";
};


&pcf_jamr3_21 {
	status = "disabled";
};

&tlv320aic3106a {
	status = "disabled";
};

&tlv320aic3106b {
	status = "disabled";
};

&tlv320aic3106c {
	status = "disabled";
};

&mcasp7 {
	status = "disabled";
};

&mcasp8 {
	status = "disabled";
};

&mcasp2 {
	status = "disabled";
};

&mcasp6 {
	status = "disabled";
};

&qspi {
	status = "okay";

	spi-max-frequency = <32000000>;
	m25p80@0 {
		compatible = "n25q128a13";
		spi-max-frequency = <32000000>;
		reg = <0>;
		spi-tx-bus-width = <1>;
		spi-rx-bus-width = <4>;
		#address-cells = <1>;
		#size-cells = <1>;

		/* MTD partition table.
		 * The ROM checks the first four physical blocks
		 * for a valid file to boot and the flash here is
		 * 64KiB block size.
		 */
		/*
		partition@0 {
			label = "QSPI.SPL";
			reg = <0x00000000 0x000010000>;
		};
		partition@1 {
			label = "QSPI.SPL.backup1";
			reg = <0x00010000 0x00010000>;
		};
		partition@2 {
			label = "QSPI.SPL.backup2";
			reg = <0x00020000 0x00010000>;
		};
		partition@3 {
			label = "QSPI.SPL.backup3";
			reg = <0x00030000 0x00010000>;
		};
		*/
		partition@0 {
			label = "QSPI.MLO";
			reg = <0x00000000 0x000040000>;
		};
		partition@1 {
			label = "QSPI.u-boot";
			reg = <0x00040000 0x00100000>;
		};
		partition@2 {
			label = "QSPI.DRA7-evm.dtb";
			reg = <0x00140000 0x00080000>;
		};
		partition@3 {
			label = "QSPI.u-boot-env";
			reg = <0x001c0000 0x00010000>;
		};
		partition@4 {
			label = "QSPI.u-boot-env.backup1";
			reg = <0x001d0000 0x0010000>;
		};
		partition@5 {
			label = "QSPI.uImage";
			reg = <0x001e0000 0x0800000>;
		};
		partition@6 {
			label = "QSPI.IPU-exe";
			reg = <0x009e0000 0x01620000>;
		};
	};
};

&ipu2_cma_pool {
	status = "disabled";
};

&dsp1_cma_pool {
	status = "disabled";
};

&ipu1_cma_pool {
	status = "disabled";
};

&dsp2_cma_pool {
	status = "disabled";
};

&cmem_radio {
	status = "disabled";
};

&dsp1_sr0 {
	status = "disabled";
};

&uart4 {
	status = "okay";
};

&uart8 {
	status = "okay";
};

&mmc4 {
	status = "disabled";
};

&i2c1 {
	status = "okay";
	clock-frequency = <400000>;
};

&i2c2 {
	status = "okay";
	clock-frequency = <400000>;
};

&i2c3 {
	status = "okay";
	clock-frequency = <400000>;
};

&i2c4 {
	status = "okay";
	clock-frequency = <400000>;
};

&i2c5 {
	status = "okay";
	clock-frequency = <400000>;
};

&mcspi1 {
	status = "okay";
			
	spidev@0 {
                spi-max-frequency = <24000000>;
                reg = <0>;
               compatible = "rohm,dh2228fv";
               /*compatible = "linux,spidev";*/
           	};
};

&mcspi2 {
	status = "okay";
	
	spidev@1 {
	spi-max-frequency = <24000000>;
	reg = <0>;
	compatible = "rohm,dh2228fv";
               };
};

&mcspi3 {
	status = "okay";
	spidev@2 {
		spi-max-frequency = <24000000>;
		reg = <0>;
		compatible = "rohm,dh2228fv";
               };
};

&mcspi4 {
	status = "okay";
	spidev@3 {
		spi-max-frequency = <24000000>;
		reg = <0>;
		compatible = "rohm,dh2228fv";
               };
};


&mcasp1 {
	#sound-dai-cells = <0>;

	assigned-clocks = <&mcasp1_ahclkx_mux>;
	assigned-clock-parents = <&atl_clkin1_ck>;

	status = "okay";

	op-mode = <0>;          // MCASP_IIS_MODE //
	tdm-slots = <2>;
	// 4 serializer //
	serial-dir = <  // 0: INACTIVE, 1: TX, 2: RX //
		0 0 1 2
	>;
	tx-num-evt = <32>;
	rx-num-evt = <32>;
};


&atl {
	assigned-clock-parents = <&sys_clkin1>, <&dpll_abe_m2_ck>;
};
