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

Commit 4f9d6e95 authored by Alessio Igor Bogani's avatar Alessio Igor Bogani Committed by Scott Wood
Browse files

powerpc/86xx: Consolidate common platform code

parent 737b01fc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
# Makefile for the PowerPC 86xx linux kernel.
#

obj-y				:= pic.o
obj-y				:= pic.o common.o
obj-$(CONFIG_SMP)		+= mpc86xx_smp.o
obj-$(CONFIG_MPC8641_HPCN)	+= mpc86xx_hpcn.o
obj-$(CONFIG_SBC8641D)		+= sbc8641d.o
+43 −0
Original line number Diff line number Diff line
/*
 * Routines common to most mpc86xx-based boards.
 *
 * This 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 <linux/of_platform.h>
#include <asm/synch.h>

#include "mpc86xx.h"

static const struct of_device_id mpc86xx_common_ids[] __initconst = {
	{ .type = "soc", },
	{ .compatible = "soc", },
	{ .compatible = "simple-bus", },
	{ .name = "localbus", },
	{ .compatible = "gianfar", },
	{ .compatible = "fsl,mpc8641-pcie", },
	{},
};

int __init mpc86xx_common_publish_devices(void)
{
	return of_platform_bus_probe(NULL, mpc86xx_common_ids, NULL);
}

long __init mpc86xx_time_init(void)
{
	unsigned int temp;

	/* Set the time base to zero */
	mtspr(SPRN_TBWL, 0);
	mtspr(SPRN_TBWU, 0);

	temp = mfspr(SPRN_HID0);
	temp |= HID0_TBEN;
	mtspr(SPRN_HID0, temp);
	isync();

	return 0;
}
+1 −31
Original line number Diff line number Diff line
@@ -197,37 +197,7 @@ static int __init gef_ppc9a_probe(void)
	return 0;
}

static long __init mpc86xx_time_init(void)
{
	unsigned int temp;

	/* Set the time base to zero */
	mtspr(SPRN_TBWL, 0);
	mtspr(SPRN_TBWU, 0);

	temp = mfspr(SPRN_HID0);
	temp |= HID0_TBEN;
	mtspr(SPRN_HID0, temp);
	asm volatile("isync");

	return 0;
}

static const struct of_device_id of_bus_ids[] __initconst = {
	{ .compatible = "simple-bus", },
	{ .compatible = "gianfar", },
	{ .compatible = "fsl,mpc8641-pcie", },
	{},
};

static int __init declare_of_platform_devices(void)
{
	printk(KERN_DEBUG "Probe platform devices\n");
	of_platform_bus_probe(NULL, of_bus_ids, NULL);

	return 0;
}
machine_arch_initcall(gef_ppc9a, declare_of_platform_devices);
machine_arch_initcall(gef_ppc9a, mpc86xx_common_publish_devices);

define_machine(gef_ppc9a) {
	.name			= "GE PPC9A",
+1 −31
Original line number Diff line number Diff line
@@ -184,37 +184,7 @@ static int __init gef_sbc310_probe(void)
	return 0;
}

static long __init mpc86xx_time_init(void)
{
	unsigned int temp;

	/* Set the time base to zero */
	mtspr(SPRN_TBWL, 0);
	mtspr(SPRN_TBWU, 0);

	temp = mfspr(SPRN_HID0);
	temp |= HID0_TBEN;
	mtspr(SPRN_HID0, temp);
	asm volatile("isync");

	return 0;
}

static const struct of_device_id of_bus_ids[] __initconst = {
	{ .compatible = "simple-bus", },
	{ .compatible = "gianfar", },
	{ .compatible = "fsl,mpc8641-pcie", },
	{},
};

static int __init declare_of_platform_devices(void)
{
	printk(KERN_DEBUG "Probe platform devices\n");
	of_platform_bus_probe(NULL, of_bus_ids, NULL);

	return 0;
}
machine_arch_initcall(gef_sbc310, declare_of_platform_devices);
machine_arch_initcall(gef_sbc310, mpc86xx_common_publish_devices);

define_machine(gef_sbc310) {
	.name			= "GE SBC310",
+1 −31
Original line number Diff line number Diff line
@@ -174,37 +174,7 @@ static int __init gef_sbc610_probe(void)
	return 0;
}

static long __init mpc86xx_time_init(void)
{
	unsigned int temp;

	/* Set the time base to zero */
	mtspr(SPRN_TBWL, 0);
	mtspr(SPRN_TBWU, 0);

	temp = mfspr(SPRN_HID0);
	temp |= HID0_TBEN;
	mtspr(SPRN_HID0, temp);
	asm volatile("isync");

	return 0;
}

static const struct of_device_id of_bus_ids[] __initconst = {
	{ .compatible = "simple-bus", },
	{ .compatible = "gianfar", },
	{ .compatible = "fsl,mpc8641-pcie", },
	{},
};

static int __init declare_of_platform_devices(void)
{
	printk(KERN_DEBUG "Probe platform devices\n");
	of_platform_bus_probe(NULL, of_bus_ids, NULL);

	return 0;
}
machine_arch_initcall(gef_sbc610, declare_of_platform_devices);
machine_arch_initcall(gef_sbc610, mpc86xx_common_publish_devices);

define_machine(gef_sbc610) {
	.name			= "GE SBC610",
Loading