Remove clock-frequency generation for ttc

Remove property generation because driver is uses
clock framework and frequency in dts is not needed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

---
For 14.5 - requires Soren's patches available in my next tree.
Fix arm gic sensitivity according to ug585 v1.4

wdt and ethernet use rising edge sensitivity.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
pl310: Generate interrupt property for controller

Also setup "name" variable for force_type IPs
for easier switching when it is provided by SDK.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Declare vdma and dma variables

vdma and dma(currently unused) node generation code
use these variables. It is necessary to defined them
when device-tree is called from top level BSP.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Fix coding style issue in A9 core

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Generate proper clock slcr subnode

The patch add support for newly introduced clock bindings
to register add fixed rate clock with the clock framework.

Generated node:
ps7_slcr_0: ps7-slcr@f8000000 {
	compatible = "xlnx,ps7-slcr-1.00.a", "xlnx,zynq-slcr";
	reg = < 0xf8000000 0x1000 >;
	clocks {
		#address-cells = <1>;
		#size-cells = <0>;
		ps_clk: ps_clk {
			#clock-cells = <0>;
			clock-frequency = <33333333>;
			clock-output-names = "PS_CLK";
			compatible = "fixed-clock";
		} ;
	} ;
} ;

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
ps7: Do not generate clock-frequency property

All of these IPs use common clock framework
that's why we don't need to setup these clock-frequency
properties.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
smcc: Generate Nand/Nor/Sram as subnode of smcc

Generate smcc as the last ip in the list which ensure
that we can store all nand/nor/sram node descriptions
which we can add in smcc node.

Also replace ps7_sram by ps7_nor if we are working with flash.
It is not the best option to show ps7_sram if we know that it is nor flash.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Add pmu node generation to the DTS root

Generated node:
pmu {
	compatible = "arm,cortex-a9-pmu";
	interrupt-parent = <&ps7_scugic_0>;
	interrupts = < 0 5 4 0 6 4 >;
} ;

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Do not generate ps7_dma_ns node

ps7_dma is generated twice as ps7_dma ps7_dma_ns.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Fix the problem when IP has BASE/HIGH addresses pairs

For IPs which has not specific handler change logic
for looking for addresses. Directly looking for
address pairs and setup ranges list.
In case that IP has a lot of BASE/HIGH pairs but
only one is used.
Previous implementation detect number of pairs
but didn't check if all of them are valid.
Current implementation only working with valid
configurations.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Generate addresses for pmu node

pmu {
	compatible = "arm,cortex-a9-pmu";
	interrupt-parent = <&ps7_scugic_0>;
	interrupts = < 0 5 4 0 6 4 >;
	reg = < 0xf8891000 0x1000 0xf8893000 0x1000 >;
} ;

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
ttc: Do not generate default parameters for TTC

The reason is not to generate these useless confusing values
in connection to common clock support.

xlnx,ttc-clk0-clksrc = <0x0>;
xlnx,ttc-clk0-freq-hz = <0x69f6bcb>;
xlnx,ttc-clk1-clksrc = <0x0>;
xlnx,ttc-clk1-freq-hz = <0x69f6bcb>;
xlnx,ttc-clk2-clksrc = <0x0>;
xlnx,ttc-clk2-freq-hz = <0x69f6bcb>;

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
clock: Generate pll clock nodes - armpll, ddrpll, iopll

Also fix name for ps_clk (from PS_CLK)

Here is the new generated fragment in slcr node.
ps7_slcr_0: ps7-slcr@f8000000 {
	compatible = "xlnx,ps7-slcr-1.00.a", "xlnx,zynq-slcr";
	reg = < 0xf8000000 0x1000 >;
	clocks {
		#address-cells = <1>;
		#size-cells = <0>;
		armpll: armpll {
			#clock-cells = <0>;
			clock-output-names = "armpll";
			clocks = <&ps_clk>;
			compatible = "xlnx,zynq-pll";
			lockbit = <0>;
			reg = < 0x100 0x110 0x10c >;
		} ;
		ddrpll: ddrpll {
			#clock-cells = <0>;
			clock-output-names = "ddrpll";
			clocks = <&ps_clk>;
			compatible = "xlnx,zynq-pll";
			lockbit = <1>;
			reg = < 0x104 0x114 0x10c >;
		} ;
		iopll: iopll {
			#clock-cells = <0>;
			clock-output-names = "iopll";
			clocks = <&ps_clk>;
			compatible = "xlnx,zynq-pll";
			lockbit = <2>;
			reg = < 0x108 0x118 0x10c >;
		} ;
		ps_clk: ps_clk {
			#clock-cells = <0>;
			clock-frequency = <33333333>;
			clock-output-names = "ps_clk";
			compatible = "fixed-clock";
		} ;
	} ;
} ;

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
ps7_nand: Set ps7_nand node name as primary_flash

if it is set as primary flash from the menu option

Signed-off-by: Jason Wu <huanyu@xilinx.com>
Allow to create multiple node for write_nodes function

This is required for device can have multiple sub devices connected to
a device node
For an example, SMCC can have 2 nor flash subnodes in the device node.
e.g.
smcc:
	nor_flash:
	nor_flash:

Signed-off-by: Jason Wu <huanyu@xilinx.com>
ps7_sram: Remove the incorrect assumption on ps7_sram node

ps7_sram_* are refer to NOR flash in 14.4. Removes the if statement on
the assumption of ps_sram_0 is nor and ps7_sram_1 is sram. Note, this is
also the wrong assumption in 14.4.

Rename the node name to primary_flash if it is set as primary flash in
the menu options.

Signed-off-by: Jason Wu <huanyu@xilinx.com>
xadc: Use zynq_irq function for generating interrupts

Generated node:
ps7_xadc: ps7_xadc@f8007100 {
	compatible = "xlnx,ps7-xadc-1.00.a";
	interrupt-parent = <&ps7_scugic_0>;
	interrupts = < 0 7 4 >;
	reg = < 0xf8007100 0x20 >;
} ;

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
xadc: Generate ps7-xadc instead of ps7_xadc

Just synchronization with the rest of nodes.

ps7_xadc: ps7-xadc@f8007100 {
	compatible = "xlnx,ps7-xadc-1.00.a";
	interrupt-parent = <&ps7_scugic_0>;
	interrupts = < 0 7 4 >;
	reg = < 0xf8007100 0x20 >;
} ;

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Remove unused name property

Remove unused name variable. name and type are also main
variables in this function that's why it is not good practise
to use in local scope.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>