-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
John Rigby
authored and
Grant Likely
committed
Jul 12, 2008
1 parent
175ee85
commit 8ed6ef5
Showing
7 changed files
with
178 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 137e95906e294913fab02162e8a1948ade49acb5 | ||
refs/heads/master: fb1803224ea145e3424d6295d4aaa8e9fef70642 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# | ||
# Makefile for the Freescale PowerPC 512x linux kernel. | ||
# | ||
obj-y += clock.o | ||
obj-y += clock.o mpc512x_shared.o | ||
obj-$(CONFIG_MPC5121_ADS) += mpc5121_ads.o | ||
obj-$(CONFIG_MPC5121_GENERIC) += mpc5121_generic.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (C) 2007,2008 Freescale Semiconductor, Inc. All rights reserved. | ||
* | ||
* Author: John Rigby, <jrigby@freescale.com> | ||
* | ||
* Description: | ||
* MPC5121 SoC setup | ||
* | ||
* This 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/kernel.h> | ||
#include <linux/of_platform.h> | ||
|
||
#include <asm/machdep.h> | ||
#include <asm/ipic.h> | ||
#include <asm/prom.h> | ||
#include <asm/time.h> | ||
|
||
#include "mpc512x.h" | ||
|
||
/* | ||
* list of supported boards | ||
*/ | ||
static char *board[] __initdata = { | ||
"prt,prtlvt", | ||
NULL | ||
}; | ||
|
||
/* | ||
* Called very early, MMU is off, device-tree isn't unflattened | ||
*/ | ||
static int __init mpc5121_generic_probe(void) | ||
{ | ||
unsigned long node = of_get_flat_dt_root(); | ||
int i = 0; | ||
|
||
while (board[i]) { | ||
if (of_flat_dt_is_compatible(node, board[i])) | ||
break; | ||
i++; | ||
} | ||
|
||
return board[i] != NULL; | ||
} | ||
|
||
define_machine(mpc5121_generic) { | ||
.name = "MPC5121 generic", | ||
.probe = mpc5121_generic_probe, | ||
.init = mpc512x_declare_of_platform_devices, | ||
.init_IRQ = mpc512x_init_IRQ, | ||
.get_irq = ipic_get_irq, | ||
.calibrate_decr = generic_calibrate_decr, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved. | ||
* | ||
* 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. | ||
* | ||
* Prototypes for MPC512x shared code | ||
*/ | ||
|
||
#ifndef __MPC512X_H__ | ||
#define __MPC512X_H__ | ||
extern unsigned long mpc512x_find_ips_freq(struct device_node *node); | ||
extern void __init mpc512x_init_IRQ(void); | ||
void __init mpc512x_declare_of_platform_devices(void); | ||
#endif /* __MPC512X_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Copyright (C) 2007,2008 Freescale Semiconductor, Inc. All rights reserved. | ||
* | ||
* Author: John Rigby <jrigby@freescale.com> | ||
* | ||
* Description: | ||
* MPC512x Shared code | ||
* | ||
* This 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/kernel.h> | ||
#include <linux/io.h> | ||
#include <linux/irq.h> | ||
#include <linux/of_platform.h> | ||
|
||
#include <asm/machdep.h> | ||
#include <asm/ipic.h> | ||
#include <asm/prom.h> | ||
#include <asm/time.h> | ||
|
||
#include "mpc512x.h" | ||
|
||
unsigned long | ||
mpc512x_find_ips_freq(struct device_node *node) | ||
{ | ||
struct device_node *np; | ||
const unsigned int *p_ips_freq = NULL; | ||
|
||
of_node_get(node); | ||
while (node) { | ||
p_ips_freq = of_get_property(node, "bus-frequency", NULL); | ||
if (p_ips_freq) | ||
break; | ||
|
||
np = of_get_parent(node); | ||
of_node_put(node); | ||
node = np; | ||
} | ||
if (node) | ||
of_node_put(node); | ||
|
||
return p_ips_freq ? *p_ips_freq : 0; | ||
} | ||
EXPORT_SYMBOL(mpc512x_find_ips_freq); | ||
|
||
void __init mpc512x_init_IRQ(void) | ||
{ | ||
struct device_node *np; | ||
|
||
np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-ipic"); | ||
if (!np) | ||
return; | ||
|
||
ipic_init(np, 0); | ||
of_node_put(np); | ||
|
||
/* | ||
* Initialize the default interrupt mapping priorities, | ||
* in case the boot rom changed something on us. | ||
*/ | ||
ipic_set_default_priority(); | ||
} | ||
|
||
/* | ||
* Nodes to do bus probe on, soc and localbus | ||
*/ | ||
static struct of_device_id __initdata of_bus_ids[] = { | ||
{ .compatible = "fsl,mpc5121-immr", }, | ||
{ .compatible = "fsl,mpc5121-localbus", }, | ||
{}, | ||
}; | ||
|
||
void __init mpc512x_declare_of_platform_devices(void) | ||
{ | ||
if (of_platform_bus_probe(NULL, of_bus_ids, NULL)) | ||
printk(KERN_ERR __FILE__ ": " | ||
"Error while probing of_platform bus\n"); | ||
} | ||
|