[PATCH] powerpc: Fix Maple build
The changes to the device node structure broke Maple build. This fixes it. Unfortunately I coudn't test as my Maple board appears to be dead. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
committed by
Paul Mackerras
parent
8385a6a3ac
commit
4c882b0191
@@ -316,7 +316,6 @@ static int __init add_bridge(struct device_node *dev)
|
|||||||
char* disp_name;
|
char* disp_name;
|
||||||
int *bus_range;
|
int *bus_range;
|
||||||
int primary = 1;
|
int primary = 1;
|
||||||
struct property *of_prop;
|
|
||||||
|
|
||||||
DBG("Adding PCI host bridge %s\n", dev->full_name);
|
DBG("Adding PCI host bridge %s\n", dev->full_name);
|
||||||
|
|
||||||
|
@@ -71,38 +71,60 @@
|
|||||||
#define DBG(fmt...)
|
#define DBG(fmt...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static unsigned long maple_find_nvram_base(void)
|
||||||
|
{
|
||||||
|
struct device_node *rtcs;
|
||||||
|
unsigned long result = 0;
|
||||||
|
|
||||||
|
/* find NVRAM device */
|
||||||
|
rtcs = of_find_compatible_node(NULL, "nvram", "AMD8111");
|
||||||
|
if (rtcs) {
|
||||||
|
struct resource r;
|
||||||
|
if (of_address_to_resource(rtcs, 0, &r)) {
|
||||||
|
printk(KERN_EMERG "Maple: Unable to translate NVRAM"
|
||||||
|
" address\n");
|
||||||
|
goto bail;
|
||||||
|
}
|
||||||
|
if (!(r.flags & IORESOURCE_IO)) {
|
||||||
|
printk(KERN_EMERG "Maple: NVRAM address isn't PIO!\n");
|
||||||
|
goto bail;
|
||||||
|
}
|
||||||
|
result = r.start;
|
||||||
|
} else
|
||||||
|
printk(KERN_EMERG "Maple: Unable to find NVRAM\n");
|
||||||
|
bail:
|
||||||
|
of_node_put(rtcs);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
static void maple_restart(char *cmd)
|
static void maple_restart(char *cmd)
|
||||||
{
|
{
|
||||||
unsigned int maple_nvram_base;
|
unsigned int maple_nvram_base;
|
||||||
unsigned int maple_nvram_offset;
|
unsigned int maple_nvram_offset;
|
||||||
unsigned int maple_nvram_command;
|
unsigned int maple_nvram_command;
|
||||||
struct device_node *rtcs;
|
struct device_node *sp;
|
||||||
|
|
||||||
/* find NVRAM device */
|
maple_nvram_base = maple_find_nvram_base();
|
||||||
rtcs = find_compatible_devices("nvram", "AMD8111");
|
if (maple_nvram_base == 0)
|
||||||
if (rtcs && rtcs->addrs) {
|
goto fail;
|
||||||
maple_nvram_base = rtcs->addrs[0].address;
|
|
||||||
} else {
|
|
||||||
printk(KERN_EMERG "Maple: Unable to find NVRAM\n");
|
|
||||||
printk(KERN_EMERG "Maple: Manual Restart Required\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* find service processor device */
|
/* find service processor device */
|
||||||
rtcs = find_devices("service-processor");
|
sp = of_find_node_by_name(NULL, "service-processor");
|
||||||
if (!rtcs) {
|
if (!sp) {
|
||||||
printk(KERN_EMERG "Maple: Unable to find Service Processor\n");
|
printk(KERN_EMERG "Maple: Unable to find Service Processor\n");
|
||||||
printk(KERN_EMERG "Maple: Manual Restart Required\n");
|
goto fail;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
maple_nvram_offset = *(unsigned int*) get_property(rtcs,
|
maple_nvram_offset = *(unsigned int*) get_property(sp,
|
||||||
"restart-addr", NULL);
|
"restart-addr", NULL);
|
||||||
maple_nvram_command = *(unsigned int*) get_property(rtcs,
|
maple_nvram_command = *(unsigned int*) get_property(sp,
|
||||||
"restart-value", NULL);
|
"restart-value", NULL);
|
||||||
|
of_node_put(sp);
|
||||||
|
|
||||||
/* send command */
|
/* send command */
|
||||||
outb_p(maple_nvram_command, maple_nvram_base + maple_nvram_offset);
|
outb_p(maple_nvram_command, maple_nvram_base + maple_nvram_offset);
|
||||||
for (;;) ;
|
for (;;) ;
|
||||||
|
fail:
|
||||||
|
printk(KERN_EMERG "Maple: Manual Restart Required\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void maple_power_off(void)
|
static void maple_power_off(void)
|
||||||
@@ -110,33 +132,29 @@ static void maple_power_off(void)
|
|||||||
unsigned int maple_nvram_base;
|
unsigned int maple_nvram_base;
|
||||||
unsigned int maple_nvram_offset;
|
unsigned int maple_nvram_offset;
|
||||||
unsigned int maple_nvram_command;
|
unsigned int maple_nvram_command;
|
||||||
struct device_node *rtcs;
|
struct device_node *sp;
|
||||||
|
|
||||||
/* find NVRAM device */
|
maple_nvram_base = maple_find_nvram_base();
|
||||||
rtcs = find_compatible_devices("nvram", "AMD8111");
|
if (maple_nvram_base == 0)
|
||||||
if (rtcs && rtcs->addrs) {
|
goto fail;
|
||||||
maple_nvram_base = rtcs->addrs[0].address;
|
|
||||||
} else {
|
|
||||||
printk(KERN_EMERG "Maple: Unable to find NVRAM\n");
|
|
||||||
printk(KERN_EMERG "Maple: Manual Power-Down Required\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* find service processor device */
|
/* find service processor device */
|
||||||
rtcs = find_devices("service-processor");
|
sp = of_find_node_by_name(NULL, "service-processor");
|
||||||
if (!rtcs) {
|
if (!sp) {
|
||||||
printk(KERN_EMERG "Maple: Unable to find Service Processor\n");
|
printk(KERN_EMERG "Maple: Unable to find Service Processor\n");
|
||||||
printk(KERN_EMERG "Maple: Manual Power-Down Required\n");
|
goto fail;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
maple_nvram_offset = *(unsigned int*) get_property(rtcs,
|
maple_nvram_offset = *(unsigned int*) get_property(sp,
|
||||||
"power-off-addr", NULL);
|
"power-off-addr", NULL);
|
||||||
maple_nvram_command = *(unsigned int*) get_property(rtcs,
|
maple_nvram_command = *(unsigned int*) get_property(sp,
|
||||||
"power-off-value", NULL);
|
"power-off-value", NULL);
|
||||||
|
of_node_put(sp);
|
||||||
|
|
||||||
/* send command */
|
/* send command */
|
||||||
outb_p(maple_nvram_command, maple_nvram_base + maple_nvram_offset);
|
outb_p(maple_nvram_command, maple_nvram_base + maple_nvram_offset);
|
||||||
for (;;) ;
|
for (;;) ;
|
||||||
|
fail:
|
||||||
|
printk(KERN_EMERG "Maple: Manual Power-Down Required\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void maple_halt(void)
|
static void maple_halt(void)
|
||||||
@@ -179,9 +197,6 @@ void __init maple_setup_arch(void)
|
|||||||
*/
|
*/
|
||||||
static void __init maple_init_early(void)
|
static void __init maple_init_early(void)
|
||||||
{
|
{
|
||||||
unsigned int default_speed;
|
|
||||||
u64 physport;
|
|
||||||
|
|
||||||
DBG(" -> maple_init_early\n");
|
DBG(" -> maple_init_early\n");
|
||||||
|
|
||||||
/* Initialize hash table, from now on, we can take hash faults
|
/* Initialize hash table, from now on, we can take hash faults
|
||||||
|
@@ -168,11 +168,24 @@ unsigned long __init maple_get_boot_time(void)
|
|||||||
struct rtc_time tm;
|
struct rtc_time tm;
|
||||||
struct device_node *rtcs;
|
struct device_node *rtcs;
|
||||||
|
|
||||||
rtcs = find_compatible_devices("rtc", "pnpPNP,b00");
|
rtcs = of_find_compatible_node(NULL, "rtc", "pnpPNP,b00");
|
||||||
if (rtcs && rtcs->addrs) {
|
if (rtcs) {
|
||||||
maple_rtc_addr = rtcs->addrs[0].address;
|
struct resource r;
|
||||||
printk(KERN_INFO "Maple: Found RTC at 0x%x\n", maple_rtc_addr);
|
if (of_address_to_resource(rtcs, 0, &r)) {
|
||||||
} else {
|
printk(KERN_EMERG "Maple: Unable to translate RTC"
|
||||||
|
" address\n");
|
||||||
|
goto bail;
|
||||||
|
}
|
||||||
|
if (!(r.flags & IORESOURCE_IO)) {
|
||||||
|
printk(KERN_EMERG "Maple: RTC address isn't PIO!\n");
|
||||||
|
goto bail;
|
||||||
|
}
|
||||||
|
maple_rtc_addr = r.start;
|
||||||
|
printk(KERN_INFO "Maple: Found RTC at IO 0x%x\n",
|
||||||
|
maple_rtc_addr);
|
||||||
|
}
|
||||||
|
bail:
|
||||||
|
if (maple_rtc_addr == 0) {
|
||||||
maple_rtc_addr = RTC_PORT(0); /* legacy address */
|
maple_rtc_addr = RTC_PORT(0); /* legacy address */
|
||||||
printk(KERN_INFO "Maple: No device node for RTC, assuming "
|
printk(KERN_INFO "Maple: No device node for RTC, assuming "
|
||||||
"legacy address (0x%x)\n", maple_rtc_addr);
|
"legacy address (0x%x)\n", maple_rtc_addr);
|
||||||
|
Reference in New Issue
Block a user