Esempio n. 1
0
File: setup.c Progetto: 1314cc/linux
void __init plat_mem_setup(void)
{
	void *dtb;
	const struct bmips_quirk *q;

	set_io_port_base(0);
	ioport_resource.start = 0;
	ioport_resource.end = ~0;

	/* intended to somewhat resemble ARM; see Documentation/arm/Booting */
	if (fw_arg0 == 0 && fw_arg1 == 0xffffffff)
		dtb = phys_to_virt(fw_arg2);
	else if (fw_arg0 == -2) /* UHI interface */
		dtb = (void *)fw_arg1;
	else if (__dtb_start != __dtb_end)
		dtb = (void *)__dtb_start;
	else
		panic("no dtb found");

	__dt_setup_arch(dtb);

	for (q = bmips_quirk_list; q->quirk_fn; q++) {
		if (of_flat_dt_is_compatible(of_get_flat_dt_root(),
					     q->compatible)) {
			q->quirk_fn();
		}
	}
}
Esempio n. 2
0
int __init s5p_fdt_find_mfc_mem(unsigned long node, const char *uname,
				int depth, void *data)
{
	__be32 *prop;
	unsigned long len;
	struct s5p_mfc_dt_meminfo *mfc_mem = data;

	if (!data)
		return 0;

	if (!of_flat_dt_is_compatible(node, mfc_mem->compatible))
		return 0;

	prop = of_get_flat_dt_prop(node, "samsung,mfc-l", &len);
	if (!prop || (len != 2 * sizeof(unsigned long)))
		return 0;

	mfc_mem->loff = be32_to_cpu(prop[0]);
	mfc_mem->lsize = be32_to_cpu(prop[1]);

	prop = of_get_flat_dt_prop(node, "samsung,mfc-r", &len);
	if (!prop || (len != 2 * sizeof(unsigned long)))
		return 0;

	mfc_mem->roff = be32_to_cpu(prop[0]);
	mfc_mem->rsize = be32_to_cpu(prop[1]);

	return 1;
}
Esempio n. 3
0
static int __init twr_p1025_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	return of_flat_dt_is_compatible(root, "fsl,TWR-P1025");

}
Esempio n. 4
0
static int __init mmp_fdt_find_fb_info(unsigned long node, const char *uname,
		int depth, void *data)
{
	__be32 *prop;
	unsigned long len;

	if (!of_flat_dt_is_compatible(node, "marvell,mmp-fb"))
		return 0;

	prop = of_get_flat_dt_prop(node, "marvell,buffer-num", &len);
	if (!prop || (len != sizeof(u32))) {
		pr_err("%s: Can't find buf num property\n", __func__);
		return 0;
	}

	buf_num = be32_to_cpu(prop[0]);

	prop = of_get_flat_dt_prop(node, "marvell,fb-mem", &len);
	if (!prop || (len != sizeof(u32))) {
		pr_err("%s: Can't find fb-mem property\n", __func__);
		return 0;
	}

	fb_addr = be32_to_cpu(prop[0]);

	return 1;
}
Esempio n. 5
0
void __init exynos_init_io(struct map_desc *mach_desc, int size)
{
	struct map_desc *iodesc = exynos_iodesc;
	int iodesc_sz = ARRAY_SIZE(exynos_iodesc);
#if defined(CONFIG_OF) && defined(CONFIG_ARCH_EXYNOS5)
	unsigned long root = of_get_flat_dt_root();

	/* initialize the io descriptors we need for initialization */
	if (of_flat_dt_is_compatible(root, "samsung,exynos5440")) {
		iodesc = exynos5440_iodesc;
		iodesc_sz = ARRAY_SIZE(exynos5440_iodesc);
	}
#endif

	debug_ll_io_init();

	iotable_init(iodesc, iodesc_sz);

	if (mach_desc)
		iotable_init(mach_desc, size);

	/* detect cpu id and rev. */
	s5p_init_cpu(S5P_VA_CHIPID);

	s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));

	/* TO support Watch dog reset */
	wdt_reset_init();

	/* Setup platform-specific resume code */
	s5p_resume_cpu_id = samsung_cpu_id;
	plat_cpu_resume = s3c_cpu_resume;
}
Esempio n. 6
0
static int __init cell_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (!of_flat_dt_is_compatible(root, "IBM,CBEA") &&
	    !of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
		return 0;

#ifdef CONFIG_UDBG_RTAS_CONSOLE
	udbg_init_rtas_console();
#endif

	hpte_init_native();

	return 1;
}
Esempio n. 7
0
static int __init p1021_mds_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	return of_flat_dt_is_compatible(root, "fsl,P1021MDS");

}
Esempio n. 8
0
/*
 * Called very early, device-tree isn't unflattened
 */
static int __init c293_pcie_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (of_flat_dt_is_compatible(root, "fsl,C293PCIE"))
		return 1;
	return 0;
}
Esempio n. 9
0
static int __init ppc460ex_probe(void)
{
	unsigned long root = of_get_flat_dt_root();
	if (of_flat_dt_is_compatible(root, "amcc,canyonlands")) {
<<<<<<< HEAD
		pci_set_flags(PCI_REASSIGN_ALL_RSRC);
=======
<<<<<<< HEAD
Esempio n. 10
0
/*
 * Called very early, device-tree isn't unflattened
 */
static int __init mpc7448_hpc2_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (!of_flat_dt_is_compatible(root, "mpc74xx"))
		return 0;
	return 1;
}
Esempio n. 11
0
/*
 * Called very early, device-tree isn't unflattened
 */
static int __init holly_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (!of_flat_dt_is_compatible(root, "ibm,holly"))
		return 0;
	return 1;
}
Esempio n. 12
0
static int __init p2020_rdb_pc_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (of_flat_dt_is_compatible(root, "fsl,P2020RDB-PC"))
		return 1;
	return 0;
}
Esempio n. 13
0
static int __init ep405_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (!of_flat_dt_is_compatible(root, "ep405"))
		return 0;

	return 1;
}
Esempio n. 14
0
File: chroma.c Progetto: 08opt/linux
static int __init chroma_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (!of_flat_dt_is_compatible(root, "ibm,wsp-chroma"))
		return 0;

	return 1;
}
Esempio n. 15
0
static void __init exynos5_dt_map_io(void)
{
	unsigned long root = of_get_flat_dt_root();

	exynos_init_io(NULL, 0);

	if (of_flat_dt_is_compatible(root, "samsung,exynos5250"))
		s3c24xx_init_clocks(24000000);
}
Esempio n. 16
0
/*
 * Called very early, device-tree isn't unflattened
 */
static int __init socrates_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (of_flat_dt_is_compatible(root, "abb,socrates"))
		return 1;

	return 0;
}
Esempio n. 17
0
/*
 * Called very early, device-tree isn't unflattened
 */
static int __init sbc8641_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (of_flat_dt_is_compatible(root, "wind,sbc8641"))
		return 1;	/* Looks good */

	return 0;
}
Esempio n. 18
0
static void __init arc_set_early_base_baud(unsigned long dt_root)
{
	unsigned int core_clk = arc_get_core_freq();

	if (of_flat_dt_is_compatible(dt_root, "abilis,arc-tb10x"))
		arc_base_baud = core_clk/3;
	else
		arc_base_baud = core_clk;
}
Esempio n. 19
0
static int __init virtex_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (!of_flat_dt_is_compatible(root, "xlnx,virtex"))
		return 0;

	return 1;
}
static int __init ppc460ex_probe(void)
{
	unsigned long root = of_get_flat_dt_root();
	if (of_flat_dt_is_compatible(root, "amcc,canyonlands")) {
		ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC);
		return 1;
		}
	return 0;
}
Esempio n. 21
0
static int __init hcu4_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (!of_flat_dt_is_compatible(root, "netstal,hcu4"))
		return 0;

	return 1;
}
Esempio n. 22
0
/*
 * Called very early, device-tree isn't unflattened
 *
 * This function is called to determine whether the BSP is compatible with the
 * supplied device-tree, which is assumed to be the correct one for the actual
 * board. It is expected thati, in the future, a kernel may support multiple
 * boards.
 */
static int __init gef_ppc9a_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (of_flat_dt_is_compatible(root, "gef,ppc9a"))
		return 1;

	return 0;
}
Esempio n. 23
0
static int __init fdt_find_cpu_features(unsigned long node, const char *uname,
					int depth, void *data)
{
	if (of_flat_dt_is_compatible(node, "ibm,powerpc-cpu-features")
	    && of_get_flat_dt_prop(node, "isa", NULL))
		return 1;

	return 0;
}
Esempio n. 24
0
static int __init wii_probe(void)
{
	unsigned long dt_root;

	dt_root = of_get_flat_dt_root();
	if (!of_flat_dt_is_compatible(dt_root, "nintendo,wii"))
		return 0;

	return 1;
}
Esempio n. 25
0
static int __init linkstation_probe(void)
{
	unsigned long root;

	root = of_get_flat_dt_root();

	if (!of_flat_dt_is_compatible(root, "linkstation"))
		return 0;
	return 1;
}
Esempio n. 26
0
static int __init check_for_compat(unsigned long node)
{
	char **start = __compat_exports_start;

	for ( ; start < __compat_exports_end; start++)
		if (of_flat_dt_is_compatible(node, *start))
			return 1;

	return 0;
}
Esempio n. 27
0
/*
 * Called very early, device-tree isn't unflattened
 */
static int __init t4240_qds_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (of_flat_dt_is_compatible(root, "fsl,T4240QDS"))
		return 1;

	/* Check if we're running under the Freescale hypervisor */
	if (of_flat_dt_is_compatible(root, "fsl,T4240QDS-hv")) {
		ppc_md.init_IRQ = ehv_pic_init;
		ppc_md.get_irq = ehv_pic_get_irq;
		ppc_md.restart = fsl_hv_restart;
		ppc_md.power_off = fsl_hv_halt;
		ppc_md.halt = fsl_hv_halt;
		return 1;
	}

	return 0;
}
Esempio n. 28
0
/*
 * Called very early, MMU is off, device-tree isn't unflattened
 */
static int __init ebony_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (!of_flat_dt_is_compatible(root, "ibm,ebony"))
		return 0;

	ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;

	return 1;
}
Esempio n. 29
0
/*
 * Called very early, MMU is off, device-tree isn't unflattened
 */
static int __init lite52xx_probe(void)
{
	unsigned long node = of_get_flat_dt_root();
	const char *model = of_get_flat_dt_prop(node, "model", NULL);

	if (!of_flat_dt_is_compatible(node, "lite52xx"))
		return 0;
	pr_debug("%s board w/ mpc52xx found\n", model ? model : "unknown");

	return 1;
}
static int __init sam440ep_probe(void)
{
	unsigned long root = of_get_flat_dt_root();

	if (!of_flat_dt_is_compatible(root, "acube,sam440ep"))
		return 0;

	ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC);

	return 1;
}