Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8159df72 authored by Heiko Schocher's avatar Heiko Schocher Committed by Kumar Gala
Browse files

83xx: add support for the kmeter1 board.

The following series implements basic board support for
the kmeter1 board from keymile, based on a MPC8360.

This series provides the following functionality:

- The board can boot with a serial console on UART1
- Ethernet:
    UCC1 in RGMII mode
    UCC2 in RGMII mode
    UCC4 in RMII mode
    UCC5 in RMII mode
    UCC6 in RMII mode
    UCC7 in RMII mode
    UCC8 in RMII mode

    following patch is necessary for working UCC in RMII mode:

    http://lists.ozlabs.org/pipermail/linuxppc-dev/2009-April/070804.html

- Flash accessed via MTD layer

  On this hardware there is an Intel P30 flash, following patch
  series is necessary for working with this hardware:

  http://lists.ozlabs.org/pipermail/linuxppc-dev/2009-April/070624.html



- I2C using I2C Bus 1 from the MPC8360 cpu

Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent 40aa7353
Loading
Loading
Loading
Loading
+520 −0
Original line number Diff line number Diff line
/*
 * Keymile KMETER1 Device Tree Source
 *
 * 2008 DENX Software Engineering GmbH
 *
 * This program is free software; you can redistribute  it and/or modify it
 * under  the terms of  the GNU General  Public License as published by the
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
 */

/dts-v1/;

/ {
	model = "KMETER1";
	compatible = "keymile,KMETER1";
	#address-cells = <1>;
	#size-cells = <1>;

	aliases {
		ethernet0 = &enet_piggy2;
		ethernet1 = &enet_estar1;
		ethernet2 = &enet_estar2;
		ethernet3 = &enet_eth1;
		ethernet4 = &enet_eth2;
		ethernet5 = &enet_eth3;
		ethernet6 = &enet_eth4;
		serial0 = &serial0;
	};

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

		PowerPC,8360@0 {
			device_type = "cpu";
			reg = <0x0>;
			d-cache-line-size = <32>;	// 32 bytes
			i-cache-line-size = <32>;	// 32 bytes
			d-cache-size = <32768>;		// L1, 32K
			i-cache-size = <32768>;		// L1, 32K
			timebase-frequency = <0>;	/* Filled in by U-Boot */
			bus-frequency = <0>;	/* Filled in by U-Boot */
			clock-frequency = <0>;	/* Filled in by U-Boot */
		};
	};

	memory {
		device_type = "memory";
		reg = <0 0>;	/* Filled in by U-Boot */
	};

	soc8360@e0000000 {
		#address-cells = <1>;
		#size-cells = <1>;
		device_type = "soc";
		compatible = "fsl,mpc8360-immr", "simple-bus";
		ranges = <0x0 0xe0000000 0x00200000>;
		reg = <0xe0000000 0x00000200>;
		bus-frequency = <0>;	/* Filled in by U-Boot */

		i2c@3000 {
			#address-cells = <1>;
			#size-cells = <0>;
			cell-index = <0>;
			compatible = "fsl-i2c";
			reg = <0x3000 0x100>;
			interrupts = <14 0x8>;
			interrupt-parent = <&ipic>;
			dfsrr;
		};

		serial0: serial@4500 {
			cell-index = <0>;
			device_type = "serial";
			compatible = "ns16550";
			reg = <0x4500 0x100>;
			clock-frequency = <264000000>;
			interrupts = <9 0x8>;
			interrupt-parent = <&ipic>;
		};

		dma@82a8 {
			#address-cells = <1>;
			#size-cells = <1>;
			compatible = "fsl,mpc8360-dma", "fsl,elo-dma";
			reg = <0x82a8 4>;
			ranges = <0 0x8100 0x1a8>;
			interrupt-parent = <&ipic>;
			interrupts = <71 8>;
			cell-index = <0>;
			dma-channel@0 {
				compatible = "fsl,mpc8360-dma-channel", "fsl,elo-dma-channel";
				reg = <0 0x80>;
				interrupt-parent = <&ipic>;
				interrupts = <71 8>;
			};
			dma-channel@80 {
				compatible = "fsl,mpc8360-dma-channel", "fsl,elo-dma-channel";
				reg = <0x80 0x80>;
				interrupt-parent = <&ipic>;
				interrupts = <71 8>;
			};
			dma-channel@100 {
				compatible = "fsl,mpc8360-dma-channel", "fsl,elo-dma-channel";
				reg = <0x100 0x80>;
				interrupt-parent = <&ipic>;
				interrupts = <71 8>;
			};
			dma-channel@180 {
				compatible = "fsl,mpc8360-dma-channel", "fsl,elo-dma-channel";
				reg = <0x180 0x28>;
				interrupt-parent = <&ipic>;
				interrupts = <71 8>;
			};
		};

		ipic: pic@700 {
			#address-cells = <0>;
			#interrupt-cells = <2>;
			compatible = "fsl,pq2pro-pic", "fsl,ipic";
			interrupt-controller;
			reg = <0x700 0x100>;
		};

		par_io@1400 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0x1400 0x100>;
			compatible = "fsl,mpc8360-par_io";
			num-ports = <7>;

			pio_ucc1: ucc_pin@0 {
				reg = <0>;

				pio-map = <
					/* port pin dir open_drain assignment has_irq */
					0   1  3  0  2  0	/* MDIO   */
					0   2  1  0  1  0	/* MDC    */

					0   3  1  0  1  0	/* TxD0   */
					0   4  1  0  1  0	/* TxD1   */
					0   5  1  0  1  0	/* TxD2   */
					0   6  1  0  1  0	/* TxD3   */
					0   9  2  0  1  0	/* RxD0   */
					0  10  2  0  1  0	/* RxD1   */
					0  11  2  0  1  0	/* RxD2   */
					0  12  2  0  1  0	/* RxD3   */
					0   7  1  0  1  0	/* TX_EN  */
					0   8  1  0  1  0	/* TX_ER  */
					0  15  2  0  1  0	/* RX_DV  */
					0  16  2  0  1  0	/* RX_ER  */
					0   0  2  0  1  0	/* RX_CLK */
					2   9  1  0  3  0	/* GTX_CLK - CLK10 */
					2   8  2  0  1  0	/* GTX125  - CLK9  */
				>;
			};

			pio_ucc2: ucc_pin@1 {
				reg = <1>;

				pio-map = <
					/* port pin dir open_drain assignment has_irq */
					0   1  3  0  2  0	/* MDIO   */
					0   2  1  0  1  0	/* MDC    */

					0  17  1  0  1  0	/* TxD0   */
					0  18  1  0  1  0	/* TxD1   */
					0  19  1  0  1  0	/* TxD2   */
					0  20  1  0  1  0	/* TxD3   */
					0  23  2  0  1  0	/* RxD0   */
					0  24  2  0  1  0	/* RxD1   */
					0  25  2  0  1  0	/* RxD2   */
					0  26  2  0  1  0	/* RxD3   */
					0  21  1  0  1  0	/* TX_EN  */
					0  22  1  0  1  0	/* TX_ER  */
					0  29  2  0  1  0	/* RX_DV  */
					0  30  2  0  1  0	/* RX_ER  */
					0  31  2  0  1  0	/* RX_CLK */
					2  2   1  0  2  0	/* GTX_CLK - CLK3  */
					2  3   2  0  1  0	/* GTX125  - CLK4  */
				>;
			};

			pio_ucc4: ucc_pin@3 {
				reg = <3>;

				pio-map = <
					/* port pin dir open_drain assignment has_irq */
					0   1  3  0  2  0	/* MDIO */
					0   2  1  0  1  0	/* MDC  */

					1  14  1  0  1  0	/* TxD0   (PB14, out, f1) */
					1  15  1  0  1  0	/* TxD1   (PB15, out, f1) */
					1  20  2  0  1  0	/* RxD0   (PB20, in,  f1) */
					1  21  2  0  1  0	/* RxD1   (PB21, in,  f1) */
					1  18  1  0  1  0	/* TX_EN  (PB18, out, f1) */
					1  26  2  0  1  0	/* RX_DV  (PB26, in,  f1) */
					1  27  2  0  1  0	/* RX_ER  (PB27, in,  f1) */

					2  16  2  0  1  0	/* UCC4_RMII_CLK (CLK17) */
				>;
			};

			pio_ucc5: ucc_pin@4 {
				reg = <4>;

				pio-map = <
					/* port pin dir open_drain assignment has_irq */
					0   1  3  0  2  0	/* MDIO */
					0   2  1  0  1  0	/* MDC  */

					3   0  1  0  1  0	/* TxD0  (PD0,  out, f1) */
					3   1  1  0  1  0	/* TxD1  (PD1,  out, f1) */
					3   6  2  0  1  0	/* RxD0  (PD6,   in, f1) */
					3   7  2  0  1  0	/* RxD1  (PD7,   in, f1) */
					3   4  1  0  1  0	/* TX_EN (PD4,  out, f1) */
					3  12  2  0  1  0	/* RX_DV (PD12,  in, f1) */
					3  13  2  0  1  0	/* RX_ER (PD13,  in, f1) */
				>;
			};

			pio_ucc6: ucc_pin@5 {
				reg = <5>;

				pio-map = <
					/* port pin dir open_drain assignment has_irq */
					0   1  3  0  2  0	/* MDIO */
					0   2  1  0  1  0	/* MDC  */

					3  14  1  0  1  0	/* TxD0   (PD14, out, f1) */
					3  15  1  0  1  0	/* TxD1   (PD15, out, f1) */
					3  20  2  0  1  0	/* RxD0   (PD20, in,  f1) */
					3  21  2  0  1  0	/* RxD1   (PD21, in,  f1) */
					3  18  1  0  1  0	/* TX_EN  (PD18, out, f1) */
					3  26  2  0  1  0	/* RX_DV  (PD26, in,  f1) */
					3  27  2  0  1  0	/* RX_ER  (PD27, in,  f1) */
				>;
			};

			pio_ucc7: ucc_pin@6 {
				reg = <6>;

				pio-map = <
					/* port pin dir open_drain assignment has_irq */
					0   1  3  0  2  0	/* MDIO */
					0   2  1  0  1  0	/* MDC  */

					4   0  1  0  1  0	/* TxD0   (PE0,  out, f1) */
					4   1  1  0  1  0	/* TxD1   (PE1,  out, f1) */
					4   6  2  0  1  0	/* RxD0   (PE6,   in, f1) */
					4   7  2  0  1  0	/* RxD1   (PE7,   in, f1) */
					4   4  1  0  1  0	/* TX_EN  (PE4,  out, f1) */
					4  12  2  0  1  0	/* RX_DV  (PE12,  in, f1) */
					4  13  2  0  1  0	/* RX_ER  (PE13,  in, f1) */
				>;
			};

			pio_ucc8: ucc_pin@7 {
				reg = <7>;

				pio-map = <
					/* port pin dir open_drain assignment has_irq */
					0   1  3  0  2  0	/* MDIO */
					0   2  1  0  1  0	/* MDC  */

					4  14  1  0  2  0	/* TxD0   (PE14, out, f2) */
					4  15  1  0  1  0	/* TxD1   (PE15, out, f1) */
					4  20  2  0  1  0	/* RxD0   (PE20, in,  f1) */
					4  21  2  0  1  0	/* RxD1   (PE21, in,  f1) */
					4  18  1  0  1  0	/* TX_EN  (PE18, out, f1) */
					4  26  2  0  1  0	/* RX_DV  (PE26, in,  f1) */
					4  27  2  0  1  0	/* RX_ER  (PE27, in,  f1) */

					2  15  2  0  1  0	/* UCCx_RMII_CLK (CLK16) */
				>;
			};

		};

		qe@100000 {
			#address-cells = <1>;
			#size-cells = <1>;
			compatible = "fsl,qe";
			ranges = <0x0 0x100000 0x100000>;
			reg = <0x100000 0x480>;
			clock-frequency = <0>;	/* Filled in by U-Boot */
			brg-frequency = <0>;	/* Filled in by U-Boot */
			bus-frequency = <0>;	/* Filled in by U-Boot */

			muram@10000 {
				#address-cells = <1>;
				#size-cells = <1>;
				compatible = "fsl,qe-muram", "fsl,cpm-muram";
				ranges = <0x0 0x00010000 0x0000c000>;

				data-only@0 {
					compatible = "fsl,qe-muram-data",
						     "fsl,cpm-muram-data";
					reg = <0x0 0xc000>;
				};
			};

			/* ESTAR-1 (UCC1, MDIO 0x10, RGMII) */
			enet_estar1: ucc@2000 {
				device_type = "network";
				compatible = "ucc_geth";
				cell-index = <1>;
				reg = <0x2000 0x200>;
				interrupts = <32>;
				interrupt-parent = <&qeic>;
				local-mac-address = [ 00 00 00 00 00 00 ];
				rx-clock-name = "none";
				tx-clock-name = "clk9";
				phy-handle = <&phy_estar1>;
				phy-connection-type = "rgmii-id";
				pio-handle = <&pio_ucc1>;
			};

			/* ESTAR-2 (UCC2, MDIO 0x11, RGMII) */
			enet_estar2: ucc@3000 {
				device_type = "network";
				compatible = "ucc_geth";
				cell-index = <2>;
				reg = <0x3000 0x200>;
				interrupts = <33>;
				interrupt-parent = <&qeic>;
				local-mac-address = [ 00 00 00 00 00 00 ];
				rx-clock-name = "none";
				tx-clock-name = "clk4";
				phy-handle = <&phy_estar2>;
				phy-connection-type = "rgmii-id";
				pio-handle = <&pio_ucc2>;
			};

			/* Piggy2 (UCC4, MDIO 0x00, RMII) */
			enet_piggy2: ucc@3200 {
				device_type = "network";
				compatible = "ucc_geth";
				cell-index = <4>;
				reg = <0x3200 0x200>;
				interrupts = <35>;
				interrupt-parent = <&qeic>;
				local-mac-address = [ 00 00 00 00 00 00 ];
				rx-clock-name = "none";
				tx-clock-name = "clk17";
				phy-handle = <&phy_piggy2>;
				phy-connection-type = "rmii";
				pio-handle = <&pio_ucc4>;
			};

			/* Eth-1 (UCC5, MDIO 0x08, RMII) */
			enet_eth1: ucc@2400 {
				device_type = "network";
				compatible = "ucc_geth";
				cell-index = <5>;
				reg = <0x2400 0x200>;
				interrupts = <40>;
				interrupt-parent = <&qeic>;
				local-mac-address = [ 00 00 00 00 00 00 ];
				rx-clock-name = "none";
				tx-clock-name = "clk16";
				phy-handle = <&phy_eth1>;
				phy-connection-type = "rmii";
				pio-handle = <&pio_ucc5>;
			};

			/* Eth-2 (UCC6, MDIO 0x09, RMII) */
			enet_eth2: ucc@3400 {
				device_type = "network";
				compatible = "ucc_geth";
				cell-index = <6>;
				reg = <0x3400 0x200>;
				interrupts = <41>;
				interrupt-parent = <&qeic>;
				local-mac-address = [ 00 00 00 00 00 00 ];
				rx-clock-name = "none";
				tx-clock-name = "clk16";
				phy-handle = <&phy_eth2>;
				phy-connection-type = "rmii";
				pio-handle = <&pio_ucc6>;
			};

			/* Eth-3 (UCC7, MDIO 0x0a, RMII) */
			enet_eth3: ucc@2600 {
				device_type = "network";
				compatible = "ucc_geth";
				cell-index = <7>;
				reg = <0x2600 0x200>;
				interrupts = <42>;
				interrupt-parent = <&qeic>;
				local-mac-address = [ 00 00 00 00 00 00 ];
				rx-clock-name = "none";
				tx-clock-name = "clk16";
				phy-handle = <&phy_eth3>;
				phy-connection-type = "rmii";
				pio-handle = <&pio_ucc7>;
			};

			/* Eth-4 (UCC8, MDIO 0x0b, RMII) */
			enet_eth4: ucc@3600 {
				device_type = "network";
				compatible = "ucc_geth";
				cell-index = <8>;
				reg = <0x3600 0x200>;
				interrupts = <43>;
				interrupt-parent = <&qeic>;
				local-mac-address = [ 00 00 00 00 00 00 ];
				rx-clock-name = "none";
				tx-clock-name = "clk16";
				phy-handle = <&phy_eth4>;
				phy-connection-type = "rmii";
				pio-handle = <&pio_ucc8>;
			};

			mdio@3320 {
				#address-cells = <1>;
				#size-cells = <0>;
				reg = <0x3320 0x18>;
				compatible = "fsl,ucc-mdio";

				/* Piggy2 (UCC4, MDIO 0x00, RMII) */
				phy_piggy2: ethernet-phy@00 {
					reg = <0x0>;
				};

				/* Eth-1 (UCC5, MDIO 0x08, RMII) */
				phy_eth1: ethernet-phy@08 {
					reg = <0x08>;
				};

				/* Eth-2 (UCC6, MDIO 0x09, RMII) */
				phy_eth2: ethernet-phy@09 {
					reg = <0x09>;
				};

				/* Eth-3 (UCC7, MDIO 0x0a, RMII) */
				phy_eth3: ethernet-phy@0a {
					reg = <0x0a>;
				};

				/* Eth-4 (UCC8, MDIO 0x0b, RMII) */
				phy_eth4: ethernet-phy@0b {
					reg = <0x0b>;
				};

				/* ESTAR-1 (UCC1, MDIO 0x10, RGMII) */
				phy_estar1: ethernet-phy@10 {
					interrupt-parent = <&ipic>;
					interrupts = <17 0x8>;
					reg = <0x10>;
				};

				/* ESTAR-2 (UCC2, MDIO 0x11, RGMII) */
				phy_estar2: ethernet-phy@11 {
					interrupt-parent = <&ipic>;
					interrupts = <18 0x8>;
					reg = <0x11>;
				};
			};

			qeic: interrupt-controller@80 {
				interrupt-controller;
				compatible = "fsl,qe-ic";
				#address-cells = <0>;
				#interrupt-cells = <1>;
				reg = <0x80 0x80>;
				interrupts = <32 8 33 8>;
				interrupt-parent = <&ipic>;
			};
		};
	};

	localbus@e0005000 {
		#address-cells = <2>;
		#size-cells = <1>;
		compatible = "fsl,mpc8360-localbus", "fsl,pq2pro-localbus",
			     "simple-bus";
		reg = <0xe0005000 0xd8>;
		ranges = <0 0 0xf0000000 0x04000000>;	/* Filled in by U-Boot */

		flash@f0000000,0 {
			compatible = "cfi-flash";
			/*
			 * The Intel P30 chip has 2 non-identical chips on
			 * one die, so we need to define 2 seperate regions
			 * that are scanned by physmap_of independantly.
			 */
			reg = <0 0x00000000 0x02000000
			       0 0x02000000 0x02000000>;	/* Filled in by U-Boot */
			bank-width = <2>;
			#address-cells = <1>;
			#size-cells = <1>;
			partition@0 {
				label = "u-boot";
				reg = <0 0x40000>;
			};
			partition@40000 {
				label = "env";
				reg = <0x40000 0x40000>;
			};
			partition@80000 {
				label = "dtb";
				reg = <0x80000 0x20000>;
			};
			partition@a0000 {
				label = "kernel";
				reg = <0xa0000 0x300000>;
			};
			partition@3a0000 {
				label = "ramdisk";
				reg = <0x3a0000 0x800000>;
			};
			partition@ba0000 {
				label = "user";
				reg = <0xba0000 0x3460000>;
			};
		};
	};
};
+908 −0

File added.

Preview size limit exceeded, changes collapsed.

+7 −0
Original line number Diff line number Diff line
@@ -96,6 +96,13 @@ config ASP834x
	  This enables support for the Analogue & Micro ASP 83xx
	  board.

config KMETER1
	bool "Keymile KMETER1"
	select DEFAULT_UIMAGE
	select QUICC_ENGINE
	help
	  This enables support for the Keymile KMETER1 board.


endif

+1 −0
Original line number Diff line number Diff line
@@ -15,3 +15,4 @@ obj-$(CONFIG_MPC837x_MDS) += mpc837x_mds.o
obj-$(CONFIG_SBC834x)		+= sbc834x.o
obj-$(CONFIG_MPC837x_RDB)	+= mpc837x_rdb.o
obj-$(CONFIG_ASP834x)		+= asp834x.o
obj-$(CONFIG_KMETER1)		+= kmeter1.o
+191 −0
Original line number Diff line number Diff line
/*
 * Copyright 2008 DENX Software Engineering GmbH
 * Author: Heiko Schocher <hs@denx.de>
 *
 * Description:
 * Keymile KMETER1 board specific routines.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under  the terms of  the GNU General  Public License as published by the
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
 */

#include <linux/stddef.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/reboot.h>
#include <linux/pci.h>
#include <linux/kdev_t.h>
#include <linux/major.h>
#include <linux/console.h>
#include <linux/delay.h>
#include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <linux/initrd.h>
#include <linux/of_platform.h>
#include <linux/of_device.h>

#include <asm/system.h>
#include <asm/atomic.h>
#include <asm/time.h>
#include <asm/io.h>
#include <asm/machdep.h>
#include <asm/ipic.h>
#include <asm/irq.h>
#include <asm/prom.h>
#include <asm/udbg.h>
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include <asm/qe.h>
#include <asm/qe_ic.h>

#include "mpc83xx.h"

#define SVR_REV(svr)    (((svr) >>  0) & 0xFFFF) /* Revision field */
/* ************************************************************************
 *
 * Setup the architecture
 *
 */
static void __init kmeter1_setup_arch(void)
{
	struct device_node *np;

	if (ppc_md.progress)
		ppc_md.progress("kmeter1_setup_arch()", 0);

#ifdef CONFIG_PCI
	for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
		mpc83xx_add_bridge(np);
#endif

#ifdef CONFIG_QUICC_ENGINE
	qe_reset();

	np = of_find_node_by_name(NULL, "par_io");
	if (np != NULL) {
		par_io_init(np);
		of_node_put(np);

		for (np = NULL; (np = of_find_node_by_name(np, "ucc")) != NULL;)
			par_io_of_config(np);
	}

	np = of_find_compatible_node(NULL, "network", "ucc_geth");
	if (np != NULL) {
		uint svid;

		/* handle mpc8360ea rev.2.1 erratum 2: RGMII Timing */
		svid = mfspr(SPRN_SVR);
		if (SVR_REV(svid) == 0x0021) {
			struct	device_node *np_par;
			struct	resource res;
			void	__iomem *base;
			int	ret;

			np_par = of_find_node_by_name(NULL, "par_io");
			if (np_par == NULL) {
				printk(KERN_WARNING "%s couldn;t find par_io node\n",
					__func__);
				return;
			}
			/* Map Parallel I/O ports registers */
			ret = of_address_to_resource(np_par, 0, &res);
			if (ret) {
				printk(KERN_WARNING "%s couldn;t map par_io registers\n",
					__func__);
				return;
			}
			base = ioremap(res.start, res.end - res.start + 1);

			/*
			 * IMMR + 0x14A8[4:5] = 11 (clk delay for UCC 2)
			 * IMMR + 0x14A8[18:19] = 11 (clk delay for UCC 1)
			 */
			setbits32((base + 0xa8), 0x0c003000);

			/*
			 * IMMR + 0x14AC[20:27] = 10101010
			 * (data delay for both UCC's)
			 */
			clrsetbits_be32((base + 0xac), 0xff0, 0xaa0);
			iounmap(base);
			of_node_put(np_par);
		}
		of_node_put(np);
	}
#endif				/* CONFIG_QUICC_ENGINE */
}

static struct of_device_id kmeter_ids[] = {
	{ .type = "soc", },
	{ .compatible = "soc", },
	{ .compatible = "simple-bus", },
	{ .type = "qe", },
	{ .compatible = "fsl,qe", },
	{},
};

static int __init kmeter_declare_of_platform_devices(void)
{
	/* Publish the QE devices */
	of_platform_bus_probe(NULL, kmeter_ids, NULL);

	return 0;
}
machine_device_initcall(kmeter1, kmeter_declare_of_platform_devices);

static void __init kmeter1_init_IRQ(void)
{
	struct device_node *np;

	np = of_find_compatible_node(NULL, NULL, "fsl,pq2pro-pic");
	if (!np) {
		np = of_find_node_by_type(NULL, "ipic");
		if (!np)
			return;
	}

	ipic_init(np, 0);

	/* Initialize the default interrupt mapping priorities,
	 * in case the boot rom changed something on us.
	 */
	ipic_set_default_priority();
	of_node_put(np);

#ifdef CONFIG_QUICC_ENGINE
	np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
	if (!np) {
		np = of_find_node_by_type(NULL, "qeic");
		if (!np)
			return;
	}
	qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
	of_node_put(np);
#endif				/* CONFIG_QUICC_ENGINE */
}

/*
 * Called very early, MMU is off, device-tree isn't unflattened
 */
static int __init kmeter1_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	return of_flat_dt_is_compatible(root, "keymile,KMETER1");
}

define_machine(kmeter1) {
	.name		= "KMETER1",
	.probe		= kmeter1_probe,
	.setup_arch	= kmeter1_setup_arch,
	.init_IRQ	= kmeter1_init_IRQ,
	.get_irq	= ipic_get_irq,
	.restart	= mpc83xx_restart,
	.time_init	= mpc83xx_time_init,
	.calibrate_decr	= generic_calibrate_decr,
	.progress	= udbg_progress,
};