mirror of https://gitee.com/openkylin/linux.git
[PATCH] powerpc: Lindent platforms/83xx
Ran arch/powerpc/platforms/83xx through Lindent Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
parent
30f5933657
commit
e060e084e7
|
@ -69,15 +69,14 @@ mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
|
||||||
const long min_idsel = 0x11, max_idsel = 0x20, irqs_per_slot = 4;
|
const long min_idsel = 0x11, max_idsel = 0x20, irqs_per_slot = 4;
|
||||||
return PCI_IRQ_TABLE_LOOKUP;
|
return PCI_IRQ_TABLE_LOOKUP;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PCI */
|
#endif /* CONFIG_PCI */
|
||||||
|
|
||||||
/* ************************************************************************
|
/* ************************************************************************
|
||||||
*
|
*
|
||||||
* Setup the architecture
|
* Setup the architecture
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void __init
|
static void __init mpc834x_sys_setup_arch(void)
|
||||||
mpc834x_sys_setup_arch(void)
|
|
||||||
{
|
{
|
||||||
struct device_node *np;
|
struct device_node *np;
|
||||||
|
|
||||||
|
@ -86,14 +85,14 @@ mpc834x_sys_setup_arch(void)
|
||||||
|
|
||||||
np = of_find_node_by_type(NULL, "cpu");
|
np = of_find_node_by_type(NULL, "cpu");
|
||||||
if (np != 0) {
|
if (np != 0) {
|
||||||
unsigned int *fp = (int *) get_property(np, "clock-frequency", NULL);
|
unsigned int *fp =
|
||||||
|
(int *)get_property(np, "clock-frequency", NULL);
|
||||||
if (fp != 0)
|
if (fp != 0)
|
||||||
loops_per_jiffy = *fp / HZ;
|
loops_per_jiffy = *fp / HZ;
|
||||||
else
|
else
|
||||||
loops_per_jiffy = 50000000 / HZ;
|
loops_per_jiffy = 50000000 / HZ;
|
||||||
of_node_put(np);
|
of_node_put(np);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
|
for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
|
||||||
add_bridge(np);
|
add_bridge(np);
|
||||||
|
@ -104,14 +103,13 @@ mpc834x_sys_setup_arch(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ROOT_NFS
|
#ifdef CONFIG_ROOT_NFS
|
||||||
ROOT_DEV = Root_NFS;
|
ROOT_DEV = Root_NFS;
|
||||||
#else
|
#else
|
||||||
ROOT_DEV = Root_HDA1;
|
ROOT_DEV = Root_HDA1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init
|
void __init mpc834x_sys_init_IRQ(void)
|
||||||
mpc834x_sys_init_IRQ(void)
|
|
||||||
{
|
{
|
||||||
u8 senses[8] = {
|
u8 senses[8] = {
|
||||||
0, /* EXT 0 */
|
0, /* EXT 0 */
|
||||||
|
@ -140,28 +138,27 @@ mpc834x_sys_init_IRQ(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374)
|
#if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374)
|
||||||
extern ulong ds1374_get_rtc_time(void);
|
extern ulong ds1374_get_rtc_time(void);
|
||||||
extern int ds1374_set_rtc_time(ulong);
|
extern int ds1374_set_rtc_time(ulong);
|
||||||
|
|
||||||
static int __init
|
static int __init mpc834x_rtc_hookup(void)
|
||||||
mpc834x_rtc_hookup(void)
|
|
||||||
{
|
{
|
||||||
struct timespec tv;
|
struct timespec tv;
|
||||||
|
|
||||||
ppc_md.get_rtc_time = ds1374_get_rtc_time;
|
ppc_md.get_rtc_time = ds1374_get_rtc_time;
|
||||||
ppc_md.set_rtc_time = ds1374_set_rtc_time;
|
ppc_md.set_rtc_time = ds1374_set_rtc_time;
|
||||||
|
|
||||||
tv.tv_nsec = 0;
|
tv.tv_nsec = 0;
|
||||||
tv.tv_sec = (ppc_md.get_rtc_time)();
|
tv.tv_sec = (ppc_md.get_rtc_time) ();
|
||||||
do_settimeofday(&tv);
|
do_settimeofday(&tv);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
late_initcall(mpc834x_rtc_hookup);
|
late_initcall(mpc834x_rtc_hookup);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void __init
|
void __init platform_init(void)
|
||||||
platform_init(void)
|
|
||||||
{
|
{
|
||||||
/* setup the PowerPC module struct */
|
/* setup the PowerPC module struct */
|
||||||
ppc_md.setup_arch = mpc834x_sys_setup_arch;
|
ppc_md.setup_arch = mpc834x_sys_setup_arch;
|
||||||
|
|
|
@ -20,4 +20,4 @@
|
||||||
#define PIRQC MPC83xx_IRQ_EXT6
|
#define PIRQC MPC83xx_IRQ_EXT6
|
||||||
#define PIRQD MPC83xx_IRQ_EXT7
|
#define PIRQD MPC83xx_IRQ_EXT7
|
||||||
|
|
||||||
#endif /* __MACH_MPC83XX_SYS_H__ */
|
#endif /* __MACH_MPC83XX_SYS_H__ */
|
||||||
|
|
|
@ -14,4 +14,4 @@ extern int mpc83xx_exclude_device(u_char bus, u_char devfn);
|
||||||
extern void mpc83xx_restart(char *cmd);
|
extern void mpc83xx_restart(char *cmd);
|
||||||
extern long mpc83xx_time_init(void);
|
extern long mpc83xx_time_init(void);
|
||||||
|
|
||||||
#endif /* __MPC83XX_H__ */
|
#endif /* __MPC83XX_H__ */
|
||||||
|
|
|
@ -61,7 +61,7 @@ int __init add_bridge(struct device_node *dev)
|
||||||
has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
|
has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
|
||||||
|
|
||||||
/* Get bus range if any */
|
/* Get bus range if any */
|
||||||
bus_range = (int *) get_property(dev, "bus-range", &len);
|
bus_range = (int *)get_property(dev, "bus-range", &len);
|
||||||
if (bus_range == NULL || len < 2 * sizeof(int)) {
|
if (bus_range == NULL || len < 2 * sizeof(int)) {
|
||||||
printk(KERN_WARNING "Can't get bus-range for %s, assume"
|
printk(KERN_WARNING "Can't get bus-range for %s, assume"
|
||||||
" bus 0\n", dev->full_name);
|
" bus 0\n", dev->full_name);
|
||||||
|
@ -83,7 +83,7 @@ int __init add_bridge(struct device_node *dev)
|
||||||
if ((rsrc.start & 0xfffff) == 0x8500) {
|
if ((rsrc.start & 0xfffff) == 0x8500) {
|
||||||
setup_indirect_pci(hose, immr + 0x8300, immr + 0x8304);
|
setup_indirect_pci(hose, immr + 0x8300, immr + 0x8304);
|
||||||
}
|
}
|
||||||
/* PCI 2*/
|
/* PCI 2 */
|
||||||
if ((rsrc.start & 0xfffff) == 0x8600) {
|
if ((rsrc.start & 0xfffff) == 0x8600) {
|
||||||
setup_indirect_pci(hose, immr + 0x8380, immr + 0x8384);
|
setup_indirect_pci(hose, immr + 0x8380, immr + 0x8384);
|
||||||
primary = 0;
|
primary = 0;
|
||||||
|
@ -93,10 +93,10 @@ int __init add_bridge(struct device_node *dev)
|
||||||
|
|
||||||
printk(KERN_INFO "Found MPC83xx PCI host bridge at 0x%08lx. "
|
printk(KERN_INFO "Found MPC83xx PCI host bridge at 0x%08lx. "
|
||||||
"Firmware bus number: %d->%d\n",
|
"Firmware bus number: %d->%d\n",
|
||||||
rsrc.start, hose->first_busno, hose->last_busno);
|
rsrc.start, hose->first_busno, hose->last_busno);
|
||||||
|
|
||||||
DBG(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",
|
DBG(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",
|
||||||
hose, hose->cfg_addr, hose->cfg_data);
|
hose, hose->cfg_addr, hose->cfg_data);
|
||||||
|
|
||||||
/* Interpret the "ranges" property */
|
/* Interpret the "ranges" property */
|
||||||
/* This also maps the I/O region and sets isa_io/mem_base */
|
/* This also maps the I/O region and sets isa_io/mem_base */
|
||||||
|
|
Loading…
Reference in New Issue