Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56292
b: refs/heads/master
c: 06cce43
h: refs/heads/master
v: v3
  • Loading branch information
Dale Farnsworth authored and Paul Mackerras committed May 12, 2007
1 parent e2de9e7 commit f000388
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e1a3107b06a9619773596cd46a9ce0574419aed4
refs/heads/master: 06cce43cf0980d0ed3581458fd23522ca2d24e42
3 changes: 3 additions & 0 deletions trunk/arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ config NOT_COHERENT_CACHE
bool
depends on 4xx || 8xx || E200
default y

config CONFIG_CHECK_CACHE_COHERENCY
bool
endmenu

source "init/Kconfig"
Expand Down
41 changes: 41 additions & 0 deletions trunk/arch/powerpc/kernel/setup-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,3 +530,44 @@ void __init setup_panic(void)
{
atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block);
}

#ifdef CONFIG_CHECK_CACHE_COHERENCY
/*
* For platforms that have configurable cache-coherency. This function
* checks that the cache coherency setting of the kernel matches the setting
* left by the firmware, as indicated in the device tree. Since a mismatch
* will eventually result in DMA failures, we print * and error and call
* BUG() in that case.
*/

#ifdef CONFIG_NOT_COHERENT_CACHE
#define KERNEL_COHERENCY 0
#else
#define KERNEL_COHERENCY 1
#endif

static int __init check_cache_coherency(void)
{
struct device_node *np;
const void *prop;
int devtree_coherency;

np = of_find_node_by_path("/");
prop = of_get_property(np, "coherency-off", NULL);
of_node_put(np);

devtree_coherency = prop ? 0 : 1;

if (devtree_coherency != KERNEL_COHERENCY) {
printk(KERN_ERR
"kernel coherency:%s != device tree_coherency:%s\n",
KERNEL_COHERENCY ? "on" : "off",
devtree_coherency ? "on" : "off");
BUG();
}

return 0;
}

late_initcall(check_cache_coherency);
#endif /* CONFIG_CHECK_CACHE_COHERENCY */
1 change: 1 addition & 0 deletions trunk/arch/powerpc/platforms/embedded6xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ config MPC10X_BRIDGE
config MV64X60
bool
select PPC_INDIRECT_PCI
select CONFIG_CHECK_CACHE_COHERENCY

config MPC10X_OPENPIC
bool
Expand Down

0 comments on commit f000388

Please sign in to comment.