18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * MPC8610 HPCD board specific routines
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Initial author: Xianghua Xiao <x.xiao@freescale.com>
68c2ecf20Sopenharmony_ci * Recode: Jason Jin <jason.jin@freescale.com>
78c2ecf20Sopenharmony_ci *         York Sun <yorksun@freescale.com>
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * Rewrite the interrupt routing. remove the 8259PIC support,
108c2ecf20Sopenharmony_ci * All the integrated device in ULI use sideband interrupt.
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci * Copyright 2008 Freescale Semiconductor Inc.
138c2ecf20Sopenharmony_ci */
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#include <linux/stddef.h>
168c2ecf20Sopenharmony_ci#include <linux/kernel.h>
178c2ecf20Sopenharmony_ci#include <linux/pci.h>
188c2ecf20Sopenharmony_ci#include <linux/interrupt.h>
198c2ecf20Sopenharmony_ci#include <linux/kdev_t.h>
208c2ecf20Sopenharmony_ci#include <linux/delay.h>
218c2ecf20Sopenharmony_ci#include <linux/seq_file.h>
228c2ecf20Sopenharmony_ci#include <linux/of.h>
238c2ecf20Sopenharmony_ci#include <linux/fsl/guts.h>
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#include <asm/time.h>
268c2ecf20Sopenharmony_ci#include <asm/machdep.h>
278c2ecf20Sopenharmony_ci#include <asm/pci-bridge.h>
288c2ecf20Sopenharmony_ci#include <asm/prom.h>
298c2ecf20Sopenharmony_ci#include <mm/mmu_decl.h>
308c2ecf20Sopenharmony_ci#include <asm/udbg.h>
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#include <asm/mpic.h>
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#include <linux/of_platform.h>
358c2ecf20Sopenharmony_ci#include <sysdev/fsl_pci.h>
368c2ecf20Sopenharmony_ci#include <sysdev/fsl_soc.h>
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#include "mpc86xx.h"
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_cistatic struct device_node *pixis_node;
418c2ecf20Sopenharmony_cistatic unsigned char *pixis_bdcfg0, *pixis_arch;
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci/* DIU Pixel Clock bits of the CLKDVDR Global Utilities register */
448c2ecf20Sopenharmony_ci#define CLKDVDR_PXCKEN		0x80000000
458c2ecf20Sopenharmony_ci#define CLKDVDR_PXCKINV		0x10000000
468c2ecf20Sopenharmony_ci#define CLKDVDR_PXCKDLY		0x06000000
478c2ecf20Sopenharmony_ci#define CLKDVDR_PXCLK_MASK	0x001F0000
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci#ifdef CONFIG_SUSPEND
508c2ecf20Sopenharmony_cistatic irqreturn_t mpc8610_sw9_irq(int irq, void *data)
518c2ecf20Sopenharmony_ci{
528c2ecf20Sopenharmony_ci	pr_debug("%s: PIXIS' event (sw9/wakeup) IRQ handled\n", __func__);
538c2ecf20Sopenharmony_ci	return IRQ_HANDLED;
548c2ecf20Sopenharmony_ci}
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_cistatic void __init mpc8610_suspend_init(void)
578c2ecf20Sopenharmony_ci{
588c2ecf20Sopenharmony_ci	int irq;
598c2ecf20Sopenharmony_ci	int ret;
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci	if (!pixis_node)
628c2ecf20Sopenharmony_ci		return;
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci	irq = irq_of_parse_and_map(pixis_node, 0);
658c2ecf20Sopenharmony_ci	if (!irq) {
668c2ecf20Sopenharmony_ci		pr_err("%s: can't map pixis event IRQ.\n", __func__);
678c2ecf20Sopenharmony_ci		return;
688c2ecf20Sopenharmony_ci	}
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci	ret = request_irq(irq, mpc8610_sw9_irq, 0, "sw9:wakeup", NULL);
718c2ecf20Sopenharmony_ci	if (ret) {
728c2ecf20Sopenharmony_ci		pr_err("%s: can't request pixis event IRQ: %d\n",
738c2ecf20Sopenharmony_ci		       __func__, ret);
748c2ecf20Sopenharmony_ci		irq_dispose_mapping(irq);
758c2ecf20Sopenharmony_ci	}
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci	enable_irq_wake(irq);
788c2ecf20Sopenharmony_ci}
798c2ecf20Sopenharmony_ci#else
808c2ecf20Sopenharmony_cistatic inline void mpc8610_suspend_init(void) { }
818c2ecf20Sopenharmony_ci#endif /* CONFIG_SUSPEND */
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_cistatic const struct of_device_id mpc8610_ids[] __initconst = {
848c2ecf20Sopenharmony_ci	{ .compatible = "fsl,mpc8610-immr", },
858c2ecf20Sopenharmony_ci	{ .compatible = "fsl,mpc8610-guts", },
868c2ecf20Sopenharmony_ci	/* So that the DMA channel nodes can be probed individually: */
878c2ecf20Sopenharmony_ci	{ .compatible = "fsl,eloplus-dma", },
888c2ecf20Sopenharmony_ci	/* PCI controllers */
898c2ecf20Sopenharmony_ci	{ .compatible = "fsl,mpc8610-pci", },
908c2ecf20Sopenharmony_ci	{}
918c2ecf20Sopenharmony_ci};
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_cistatic int __init mpc8610_declare_of_platform_devices(void)
948c2ecf20Sopenharmony_ci{
958c2ecf20Sopenharmony_ci	/* Enable wakeup on PIXIS' event IRQ. */
968c2ecf20Sopenharmony_ci	mpc8610_suspend_init();
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci	mpc86xx_common_publish_devices();
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci	/* Without this call, the SSI device driver won't get probed. */
1018c2ecf20Sopenharmony_ci	of_platform_bus_probe(NULL, mpc8610_ids, NULL);
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci	return 0;
1048c2ecf20Sopenharmony_ci}
1058c2ecf20Sopenharmony_cimachine_arch_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices);
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci/*
1108c2ecf20Sopenharmony_ci * DIU Area Descriptor
1118c2ecf20Sopenharmony_ci *
1128c2ecf20Sopenharmony_ci * The MPC8610 reference manual shows the bits of the AD register in
1138c2ecf20Sopenharmony_ci * little-endian order, which causes the BLUE_C field to be split into two
1148c2ecf20Sopenharmony_ci * parts. To simplify the definition of the MAKE_AD() macro, we define the
1158c2ecf20Sopenharmony_ci * fields in big-endian order and byte-swap the result.
1168c2ecf20Sopenharmony_ci *
1178c2ecf20Sopenharmony_ci * So even though the registers don't look like they're in the
1188c2ecf20Sopenharmony_ci * same bit positions as they are on the P1022, the same value is written to
1198c2ecf20Sopenharmony_ci * the AD register on the MPC8610 and on the P1022.
1208c2ecf20Sopenharmony_ci */
1218c2ecf20Sopenharmony_ci#define AD_BYTE_F		0x10000000
1228c2ecf20Sopenharmony_ci#define AD_ALPHA_C_MASK		0x0E000000
1238c2ecf20Sopenharmony_ci#define AD_ALPHA_C_SHIFT	25
1248c2ecf20Sopenharmony_ci#define AD_BLUE_C_MASK		0x01800000
1258c2ecf20Sopenharmony_ci#define AD_BLUE_C_SHIFT		23
1268c2ecf20Sopenharmony_ci#define AD_GREEN_C_MASK		0x00600000
1278c2ecf20Sopenharmony_ci#define AD_GREEN_C_SHIFT	21
1288c2ecf20Sopenharmony_ci#define AD_RED_C_MASK		0x00180000
1298c2ecf20Sopenharmony_ci#define AD_RED_C_SHIFT		19
1308c2ecf20Sopenharmony_ci#define AD_PALETTE		0x00040000
1318c2ecf20Sopenharmony_ci#define AD_PIXEL_S_MASK		0x00030000
1328c2ecf20Sopenharmony_ci#define AD_PIXEL_S_SHIFT	16
1338c2ecf20Sopenharmony_ci#define AD_COMP_3_MASK		0x0000F000
1348c2ecf20Sopenharmony_ci#define AD_COMP_3_SHIFT		12
1358c2ecf20Sopenharmony_ci#define AD_COMP_2_MASK		0x00000F00
1368c2ecf20Sopenharmony_ci#define AD_COMP_2_SHIFT		8
1378c2ecf20Sopenharmony_ci#define AD_COMP_1_MASK		0x000000F0
1388c2ecf20Sopenharmony_ci#define AD_COMP_1_SHIFT		4
1398c2ecf20Sopenharmony_ci#define AD_COMP_0_MASK		0x0000000F
1408c2ecf20Sopenharmony_ci#define AD_COMP_0_SHIFT		0
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ci#define MAKE_AD(alpha, red, blue, green, size, c0, c1, c2, c3) \
1438c2ecf20Sopenharmony_ci	cpu_to_le32(AD_BYTE_F | (alpha << AD_ALPHA_C_SHIFT) | \
1448c2ecf20Sopenharmony_ci	(blue << AD_BLUE_C_SHIFT) | (green << AD_GREEN_C_SHIFT) | \
1458c2ecf20Sopenharmony_ci	(red << AD_RED_C_SHIFT) | (c3 << AD_COMP_3_SHIFT) | \
1468c2ecf20Sopenharmony_ci	(c2 << AD_COMP_2_SHIFT) | (c1 << AD_COMP_1_SHIFT) | \
1478c2ecf20Sopenharmony_ci	(c0 << AD_COMP_0_SHIFT) | (size << AD_PIXEL_S_SHIFT))
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ciu32 mpc8610hpcd_get_pixel_format(enum fsl_diu_monitor_port port,
1508c2ecf20Sopenharmony_ci				 unsigned int bits_per_pixel)
1518c2ecf20Sopenharmony_ci{
1528c2ecf20Sopenharmony_ci	static const u32 pixelformat[][3] = {
1538c2ecf20Sopenharmony_ci		{
1548c2ecf20Sopenharmony_ci			MAKE_AD(3, 0, 2, 1, 3, 8, 8, 8, 8),
1558c2ecf20Sopenharmony_ci			MAKE_AD(4, 2, 0, 1, 2, 8, 8, 8, 0),
1568c2ecf20Sopenharmony_ci			MAKE_AD(4, 0, 2, 1, 1, 5, 6, 5, 0)
1578c2ecf20Sopenharmony_ci		},
1588c2ecf20Sopenharmony_ci		{
1598c2ecf20Sopenharmony_ci			MAKE_AD(3, 2, 0, 1, 3, 8, 8, 8, 8),
1608c2ecf20Sopenharmony_ci			MAKE_AD(4, 0, 2, 1, 2, 8, 8, 8, 0),
1618c2ecf20Sopenharmony_ci			MAKE_AD(4, 2, 0, 1, 1, 5, 6, 5, 0)
1628c2ecf20Sopenharmony_ci		},
1638c2ecf20Sopenharmony_ci	};
1648c2ecf20Sopenharmony_ci	unsigned int arch_monitor;
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci	/* The DVI port is mis-wired on revision 1 of this board. */
1678c2ecf20Sopenharmony_ci	arch_monitor =
1688c2ecf20Sopenharmony_ci		((*pixis_arch == 0x01) && (port == FSL_DIU_PORT_DVI)) ? 0 : 1;
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ci	switch (bits_per_pixel) {
1718c2ecf20Sopenharmony_ci	case 32:
1728c2ecf20Sopenharmony_ci		return pixelformat[arch_monitor][0];
1738c2ecf20Sopenharmony_ci	case 24:
1748c2ecf20Sopenharmony_ci		return pixelformat[arch_monitor][1];
1758c2ecf20Sopenharmony_ci	case 16:
1768c2ecf20Sopenharmony_ci		return pixelformat[arch_monitor][2];
1778c2ecf20Sopenharmony_ci	default:
1788c2ecf20Sopenharmony_ci		pr_err("fsl-diu: unsupported pixel depth %u\n", bits_per_pixel);
1798c2ecf20Sopenharmony_ci		return 0;
1808c2ecf20Sopenharmony_ci	}
1818c2ecf20Sopenharmony_ci}
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_civoid mpc8610hpcd_set_gamma_table(enum fsl_diu_monitor_port port,
1848c2ecf20Sopenharmony_ci				 char *gamma_table_base)
1858c2ecf20Sopenharmony_ci{
1868c2ecf20Sopenharmony_ci	int i;
1878c2ecf20Sopenharmony_ci	if (port == FSL_DIU_PORT_DLVDS) {
1888c2ecf20Sopenharmony_ci		for (i = 0; i < 256*3; i++)
1898c2ecf20Sopenharmony_ci			gamma_table_base[i] = (gamma_table_base[i] << 2) |
1908c2ecf20Sopenharmony_ci					 ((gamma_table_base[i] >> 6) & 0x03);
1918c2ecf20Sopenharmony_ci	}
1928c2ecf20Sopenharmony_ci}
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci#define PX_BRDCFG0_DVISEL	(1 << 3)
1958c2ecf20Sopenharmony_ci#define PX_BRDCFG0_DLINK	(1 << 4)
1968c2ecf20Sopenharmony_ci#define PX_BRDCFG0_DIU_MASK	(PX_BRDCFG0_DVISEL | PX_BRDCFG0_DLINK)
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_civoid mpc8610hpcd_set_monitor_port(enum fsl_diu_monitor_port port)
1998c2ecf20Sopenharmony_ci{
2008c2ecf20Sopenharmony_ci	switch (port) {
2018c2ecf20Sopenharmony_ci	case FSL_DIU_PORT_DVI:
2028c2ecf20Sopenharmony_ci		clrsetbits_8(pixis_bdcfg0, PX_BRDCFG0_DIU_MASK,
2038c2ecf20Sopenharmony_ci			     PX_BRDCFG0_DVISEL | PX_BRDCFG0_DLINK);
2048c2ecf20Sopenharmony_ci		break;
2058c2ecf20Sopenharmony_ci	case FSL_DIU_PORT_LVDS:
2068c2ecf20Sopenharmony_ci		clrsetbits_8(pixis_bdcfg0, PX_BRDCFG0_DIU_MASK,
2078c2ecf20Sopenharmony_ci			     PX_BRDCFG0_DLINK);
2088c2ecf20Sopenharmony_ci		break;
2098c2ecf20Sopenharmony_ci	case FSL_DIU_PORT_DLVDS:
2108c2ecf20Sopenharmony_ci		clrbits8(pixis_bdcfg0, PX_BRDCFG0_DIU_MASK);
2118c2ecf20Sopenharmony_ci		break;
2128c2ecf20Sopenharmony_ci	}
2138c2ecf20Sopenharmony_ci}
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_ci/**
2168c2ecf20Sopenharmony_ci * mpc8610hpcd_set_pixel_clock: program the DIU's clock
2178c2ecf20Sopenharmony_ci *
2188c2ecf20Sopenharmony_ci * @pixclock: the wavelength, in picoseconds, of the clock
2198c2ecf20Sopenharmony_ci */
2208c2ecf20Sopenharmony_civoid mpc8610hpcd_set_pixel_clock(unsigned int pixclock)
2218c2ecf20Sopenharmony_ci{
2228c2ecf20Sopenharmony_ci	struct device_node *guts_np = NULL;
2238c2ecf20Sopenharmony_ci	struct ccsr_guts __iomem *guts;
2248c2ecf20Sopenharmony_ci	unsigned long freq;
2258c2ecf20Sopenharmony_ci	u64 temp;
2268c2ecf20Sopenharmony_ci	u32 pxclk;
2278c2ecf20Sopenharmony_ci
2288c2ecf20Sopenharmony_ci	/* Map the global utilities registers. */
2298c2ecf20Sopenharmony_ci	guts_np = of_find_compatible_node(NULL, NULL, "fsl,mpc8610-guts");
2308c2ecf20Sopenharmony_ci	if (!guts_np) {
2318c2ecf20Sopenharmony_ci		pr_err("mpc8610hpcd: missing global utilities device node\n");
2328c2ecf20Sopenharmony_ci		return;
2338c2ecf20Sopenharmony_ci	}
2348c2ecf20Sopenharmony_ci
2358c2ecf20Sopenharmony_ci	guts = of_iomap(guts_np, 0);
2368c2ecf20Sopenharmony_ci	of_node_put(guts_np);
2378c2ecf20Sopenharmony_ci	if (!guts) {
2388c2ecf20Sopenharmony_ci		pr_err("mpc8610hpcd: could not map global utilities device\n");
2398c2ecf20Sopenharmony_ci		return;
2408c2ecf20Sopenharmony_ci	}
2418c2ecf20Sopenharmony_ci
2428c2ecf20Sopenharmony_ci	/* Convert pixclock from a wavelength to a frequency */
2438c2ecf20Sopenharmony_ci	temp = 1000000000000ULL;
2448c2ecf20Sopenharmony_ci	do_div(temp, pixclock);
2458c2ecf20Sopenharmony_ci	freq = temp;
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_ci	/*
2488c2ecf20Sopenharmony_ci	 * 'pxclk' is the ratio of the platform clock to the pixel clock.
2498c2ecf20Sopenharmony_ci	 * On the MPC8610, the value programmed into CLKDVDR is the ratio
2508c2ecf20Sopenharmony_ci	 * minus one.  The valid range of values is 2-31.
2518c2ecf20Sopenharmony_ci	 */
2528c2ecf20Sopenharmony_ci	pxclk = DIV_ROUND_CLOSEST(fsl_get_sys_freq(), freq) - 1;
2538c2ecf20Sopenharmony_ci	pxclk = clamp_t(u32, pxclk, 2, 31);
2548c2ecf20Sopenharmony_ci
2558c2ecf20Sopenharmony_ci	/* Disable the pixel clock, and set it to non-inverted and no delay */
2568c2ecf20Sopenharmony_ci	clrbits32(&guts->clkdvdr,
2578c2ecf20Sopenharmony_ci		  CLKDVDR_PXCKEN | CLKDVDR_PXCKDLY | CLKDVDR_PXCLK_MASK);
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_ci	/* Enable the clock and set the pxclk */
2608c2ecf20Sopenharmony_ci	setbits32(&guts->clkdvdr, CLKDVDR_PXCKEN | (pxclk << 16));
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ci	iounmap(guts);
2638c2ecf20Sopenharmony_ci}
2648c2ecf20Sopenharmony_ci
2658c2ecf20Sopenharmony_cienum fsl_diu_monitor_port
2668c2ecf20Sopenharmony_cimpc8610hpcd_valid_monitor_port(enum fsl_diu_monitor_port port)
2678c2ecf20Sopenharmony_ci{
2688c2ecf20Sopenharmony_ci	return port;
2698c2ecf20Sopenharmony_ci}
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_ci#endif
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_cistatic void __init mpc86xx_hpcd_setup_arch(void)
2748c2ecf20Sopenharmony_ci{
2758c2ecf20Sopenharmony_ci	struct resource r;
2768c2ecf20Sopenharmony_ci	unsigned char *pixis;
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci	if (ppc_md.progress)
2798c2ecf20Sopenharmony_ci		ppc_md.progress("mpc86xx_hpcd_setup_arch()", 0);
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ci	fsl_pci_assign_primary();
2828c2ecf20Sopenharmony_ci
2838c2ecf20Sopenharmony_ci#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
2848c2ecf20Sopenharmony_ci	diu_ops.get_pixel_format	= mpc8610hpcd_get_pixel_format;
2858c2ecf20Sopenharmony_ci	diu_ops.set_gamma_table		= mpc8610hpcd_set_gamma_table;
2868c2ecf20Sopenharmony_ci	diu_ops.set_monitor_port	= mpc8610hpcd_set_monitor_port;
2878c2ecf20Sopenharmony_ci	diu_ops.set_pixel_clock		= mpc8610hpcd_set_pixel_clock;
2888c2ecf20Sopenharmony_ci	diu_ops.valid_monitor_port	= mpc8610hpcd_valid_monitor_port;
2898c2ecf20Sopenharmony_ci#endif
2908c2ecf20Sopenharmony_ci
2918c2ecf20Sopenharmony_ci	pixis_node = of_find_compatible_node(NULL, NULL, "fsl,fpga-pixis");
2928c2ecf20Sopenharmony_ci	if (pixis_node) {
2938c2ecf20Sopenharmony_ci		of_address_to_resource(pixis_node, 0, &r);
2948c2ecf20Sopenharmony_ci		of_node_put(pixis_node);
2958c2ecf20Sopenharmony_ci		pixis = ioremap(r.start, 32);
2968c2ecf20Sopenharmony_ci		if (!pixis) {
2978c2ecf20Sopenharmony_ci			printk(KERN_ERR "Err: can't map FPGA cfg register!\n");
2988c2ecf20Sopenharmony_ci			return;
2998c2ecf20Sopenharmony_ci		}
3008c2ecf20Sopenharmony_ci		pixis_bdcfg0 = pixis + 8;
3018c2ecf20Sopenharmony_ci		pixis_arch = pixis + 1;
3028c2ecf20Sopenharmony_ci	} else
3038c2ecf20Sopenharmony_ci		printk(KERN_ERR "Err: "
3048c2ecf20Sopenharmony_ci				"can't find device node 'fsl,fpga-pixis'\n");
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ci	printk("MPC86xx HPCD board from Freescale Semiconductor\n");
3078c2ecf20Sopenharmony_ci}
3088c2ecf20Sopenharmony_ci
3098c2ecf20Sopenharmony_ci/*
3108c2ecf20Sopenharmony_ci * Called very early, device-tree isn't unflattened
3118c2ecf20Sopenharmony_ci */
3128c2ecf20Sopenharmony_cistatic int __init mpc86xx_hpcd_probe(void)
3138c2ecf20Sopenharmony_ci{
3148c2ecf20Sopenharmony_ci	if (of_machine_is_compatible("fsl,MPC8610HPCD"))
3158c2ecf20Sopenharmony_ci		return 1;	/* Looks good */
3168c2ecf20Sopenharmony_ci
3178c2ecf20Sopenharmony_ci	return 0;
3188c2ecf20Sopenharmony_ci}
3198c2ecf20Sopenharmony_ci
3208c2ecf20Sopenharmony_cidefine_machine(mpc86xx_hpcd) {
3218c2ecf20Sopenharmony_ci	.name			= "MPC86xx HPCD",
3228c2ecf20Sopenharmony_ci	.probe			= mpc86xx_hpcd_probe,
3238c2ecf20Sopenharmony_ci	.setup_arch		= mpc86xx_hpcd_setup_arch,
3248c2ecf20Sopenharmony_ci	.init_IRQ		= mpc86xx_init_irq,
3258c2ecf20Sopenharmony_ci	.get_irq		= mpic_get_irq,
3268c2ecf20Sopenharmony_ci	.time_init		= mpc86xx_time_init,
3278c2ecf20Sopenharmony_ci	.calibrate_decr		= generic_calibrate_decr,
3288c2ecf20Sopenharmony_ci	.progress		= udbg_progress,
3298c2ecf20Sopenharmony_ci#ifdef CONFIG_PCI
3308c2ecf20Sopenharmony_ci	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
3318c2ecf20Sopenharmony_ci#endif
3328c2ecf20Sopenharmony_ci};
333