2008-09-04 08:58:22 +08:00
|
|
|
/*
|
|
|
|
* Generic PowerPC 40x platform support
|
|
|
|
*
|
|
|
|
* Copyright 2008 IBM Corporation
|
|
|
|
*
|
|
|
|
* 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; version 2 of the License.
|
|
|
|
*
|
|
|
|
* This implements simple platform support for PowerPC 44x chips. This is
|
|
|
|
* mostly used for eval boards or other simple and "generic" 44x boards. If
|
|
|
|
* your board has custom functions or hardware, then you will likely want to
|
|
|
|
* implement your own board.c file to accommodate it.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <asm/machdep.h>
|
|
|
|
#include <asm/pci-bridge.h>
|
|
|
|
#include <asm/ppc4xx.h>
|
|
|
|
#include <asm/prom.h>
|
|
|
|
#include <asm/time.h>
|
|
|
|
#include <asm/udbg.h>
|
|
|
|
#include <asm/uic.h>
|
|
|
|
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/of_platform.h>
|
|
|
|
|
2014-09-11 03:56:38 +08:00
|
|
|
static const struct of_device_id ppc40x_of_bus[] __initconst = {
|
2008-09-04 08:58:22 +08:00
|
|
|
{ .compatible = "ibm,plb3", },
|
|
|
|
{ .compatible = "ibm,plb4", },
|
|
|
|
{ .compatible = "ibm,opb", },
|
|
|
|
{ .compatible = "ibm,ebc", },
|
|
|
|
{ .compatible = "simple-bus", },
|
|
|
|
{},
|
|
|
|
};
|
|
|
|
|
|
|
|
static int __init ppc40x_device_probe(void)
|
|
|
|
{
|
|
|
|
of_platform_bus_probe(NULL, ppc40x_of_bus, NULL);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
machine_device_initcall(ppc40x_simple, ppc40x_device_probe);
|
|
|
|
|
|
|
|
/* This is the list of boards that can be supported by this simple
|
|
|
|
* platform code. This does _not_ mean the boards are compatible,
|
|
|
|
* as they most certainly are not from a device tree perspective.
|
|
|
|
* However, their differences are handled by the device tree and the
|
|
|
|
* drivers and therefore they don't need custom board support files.
|
|
|
|
*
|
|
|
|
* Again, if your board needs to do things differently then create a
|
|
|
|
* board.c file for it rather than adding it to this list.
|
|
|
|
*/
|
2012-10-05 08:11:37 +08:00
|
|
|
static const char * const board[] __initconst = {
|
2009-06-03 13:24:12 +08:00
|
|
|
"amcc,acadia",
|
2009-06-03 13:28:03 +08:00
|
|
|
"amcc,haleakala",
|
|
|
|
"amcc,kilauea",
|
2009-08-20 18:19:47 +08:00
|
|
|
"amcc,makalu",
|
2011-11-29 05:01:41 +08:00
|
|
|
"apm,klondike",
|
2011-12-02 03:35:08 +08:00
|
|
|
"est,hotfoot",
|
powerpc: Add missing NULL terminator to avoid boot panic on PPC40x
The missing NULL terminator can cause a panic on
PPC405 boards during boot:
Linux/PowerPC load: console=ttyS0,115200 root=/dev/mtdblock1 rootfstype=squashfs,jffs2 noinitrd init=/etc/preinit
Finalizing device tree... flat tree at 0x6a5160
bootconsole [udbg0] enabled
Page fault in user mode with in_atomic() = 1 mm = (null)
NIP = c0275f50 MSR = fffffffe
Oops: Weird page fault, sig: 11 [#1]
PowerPC 40x Platform
Modules linked in:
NIP: c0275f50 LR: c0275f60 CTR: c0280000
REGS: c0275eb0 TRAP: 636f7265 Not tainted (3.7.1)
MSR: fffffffe <VEC,VSX,EE,PR,FP,ME,SE,BE,IR,DR,PMM,RI> CR: c06a6190 XER: 00000001
TASK = c02662a8[0] 'swapper' THREAD: c0274000
GPR00: c0275ec0 c000c658 c027c4bf 00000000 c0275ee0 c000a0ec c020a1a8 c020a1f0
GPR08: c020f631 c020f404 c025f078 c025f080 c0275f10
Call Trace:
---[ end trace 31fd0ba7d8756001 ]---
Kernel panic - not syncing: Attempted to kill the idle task!
The panic happens since commit 9597abe00c1bab2aedce6b49866bf6d1e81c9eed
(sections: fix section conflicts in arch/powerpc), however the root
cause of this is that the NULL terminator were not added in commit
a4f740cf33f7f6c164bbde3c0cdbcc77b0c4997c (of/flattree: Add of_flat_dt_match()
helper function).
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: <stable@vger.kernel.org>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-12-20 11:44:28 +08:00
|
|
|
"plathome,obs600",
|
|
|
|
NULL
|
2008-09-04 08:58:22 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static int __init ppc40x_probe(void)
|
|
|
|
{
|
2016-07-05 13:04:05 +08:00
|
|
|
if (of_device_compatible_match(of_root, board)) {
|
2011-07-12 22:25:51 +08:00
|
|
|
pci_set_flags(PCI_REASSIGN_ALL_RSRC);
|
2010-10-30 23:49:09 +08:00
|
|
|
return 1;
|
2008-09-04 08:58:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
define_machine(ppc40x_simple) {
|
|
|
|
.name = "PowerPC 40x Platform",
|
|
|
|
.probe = ppc40x_probe,
|
|
|
|
.progress = udbg_progress,
|
|
|
|
.init_IRQ = uic_init_tree,
|
|
|
|
.get_irq = uic_get_irq,
|
|
|
|
.restart = ppc4xx_reset_system,
|
|
|
|
.calibrate_decr = generic_calibrate_decr,
|
|
|
|
};
|