[POWERPC] Add correct interrupt property for pegasos ide
The firmware assigns irq 20/21 to the VIA IDE device on Pegasos. But the required interrupt is 14/15. Maybe someone confused decimal vs. hexadecimal values. Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
committed by
Paul Mackerras
parent
9c1a2bae0c
commit
e48059225c
@@ -2035,39 +2035,50 @@ static void __init fixup_device_tree_maple(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_PPC_CHRP
|
#ifdef CONFIG_PPC_CHRP
|
||||||
/* Pegasos and BriQ lacks the "ranges" property in the isa node */
|
/*
|
||||||
|
* Pegasos and BriQ lacks the "ranges" property in the isa node
|
||||||
|
* Pegasos needs decimal IRQ 14/15, not hexadecimal
|
||||||
|
*/
|
||||||
static void __init fixup_device_tree_chrp(void)
|
static void __init fixup_device_tree_chrp(void)
|
||||||
{
|
{
|
||||||
phandle isa;
|
phandle ph;
|
||||||
u32 isa_ranges[6];
|
u32 prop[6];
|
||||||
u32 rloc = 0x01006000; /* IO space; PCI device = 12 */
|
u32 rloc = 0x01006000; /* IO space; PCI device = 12 */
|
||||||
char *name;
|
char *name;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
name = "/pci@80000000/isa@c";
|
name = "/pci@80000000/isa@c";
|
||||||
isa = call_prom("finddevice", 1, 1, ADDR(name));
|
ph = call_prom("finddevice", 1, 1, ADDR(name));
|
||||||
if (!PHANDLE_VALID(isa)) {
|
if (!PHANDLE_VALID(ph)) {
|
||||||
name = "/pci@ff500000/isa@6";
|
name = "/pci@ff500000/isa@6";
|
||||||
isa = call_prom("finddevice", 1, 1, ADDR(name));
|
ph = call_prom("finddevice", 1, 1, ADDR(name));
|
||||||
rloc = 0x01003000; /* IO space; PCI device = 6 */
|
rloc = 0x01003000; /* IO space; PCI device = 6 */
|
||||||
}
|
}
|
||||||
if (!PHANDLE_VALID(isa))
|
if (PHANDLE_VALID(ph)) {
|
||||||
return;
|
rc = prom_getproplen(ph, "ranges");
|
||||||
|
if (rc == 0 || rc == PROM_ERROR) {
|
||||||
|
prom_printf("Fixing up missing ISA range on Pegasos...\n");
|
||||||
|
|
||||||
rc = prom_getproplen(isa, "ranges");
|
prop[0] = 0x1;
|
||||||
if (rc != 0 && rc != PROM_ERROR)
|
prop[1] = 0x0;
|
||||||
return;
|
prop[2] = rloc;
|
||||||
|
prop[3] = 0x0;
|
||||||
|
prop[4] = 0x0;
|
||||||
|
prop[5] = 0x00010000;
|
||||||
|
prom_setprop(ph, name, "ranges", prop, sizeof(prop));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
prom_printf("Fixing up missing ISA range on Pegasos...\n");
|
name = "/pci@80000000/ide@C,1";
|
||||||
|
ph = call_prom("finddevice", 1, 1, ADDR(name));
|
||||||
isa_ranges[0] = 0x1;
|
if (PHANDLE_VALID(ph)) {
|
||||||
isa_ranges[1] = 0x0;
|
prom_printf("Fixing up IDE interrupt on Pegasos...\n");
|
||||||
isa_ranges[2] = rloc;
|
prop[0] = 14;
|
||||||
isa_ranges[3] = 0x0;
|
prop[1] = 0x0;
|
||||||
isa_ranges[4] = 0x0;
|
prop[2] = 15;
|
||||||
isa_ranges[5] = 0x00010000;
|
prop[3] = 0x0;
|
||||||
prom_setprop(isa, name, "ranges",
|
prom_setprop(ph, name, "interrupts", prop, 4*sizeof(u32));
|
||||||
isa_ranges, sizeof(isa_ranges));
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define fixup_device_tree_chrp()
|
#define fixup_device_tree_chrp()
|
||||||
|
@@ -35,10 +35,6 @@
|
|||||||
#include <linux/ide.h>
|
#include <linux/ide.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
|
||||||
#ifdef CONFIG_PPC_CHRP
|
|
||||||
#include <asm/processor.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "ide-timing.h"
|
#include "ide-timing.h"
|
||||||
|
|
||||||
#define DISPLAY_VIA_TIMINGS
|
#define DISPLAY_VIA_TIMINGS
|
||||||
@@ -436,13 +432,6 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
|
|||||||
hwif->tuneproc = &via82cxxx_tune_drive;
|
hwif->tuneproc = &via82cxxx_tune_drive;
|
||||||
hwif->speedproc = &via_set_drive;
|
hwif->speedproc = &via_set_drive;
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_PPC_CHRP
|
|
||||||
if(machine_is(chrp) && _chrp_type == _CHRP_Pegasos) {
|
|
||||||
hwif->irq = hwif->channel ? 15 : 14;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
hwif->drives[i].io_32bit = 1;
|
hwif->drives[i].io_32bit = 1;
|
||||||
hwif->drives[i].unmask = (vdev->via_config->flags & VIA_NO_UNMASK) ? 0 : 1;
|
hwif->drives[i].unmask = (vdev->via_config->flags & VIA_NO_UNMASK) ? 0 : 1;
|
||||||
|
Reference in New Issue
Block a user