[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [XenPPC] [pushed] [ppc] find the OpenPIC by the device tree
changeset: 9957:ffa41af2e455738f8fe3a0af8ae8952e9d4cc47c user: jimix@xxxxxxxxxxxxxxxxxxxxx date: Thu Apr 27 14:40:10 2006 -0400 files: xen/arch/ppc/boot_of.c xen/arch/ppc/external.c description: [ppc] find the OpenPIC by the device tree diff -r 392b622c462327f6a5cab6f26635a2292bb4867d -r ffa41af2e455738f8fe3a0af8ae8952e9d4cc47c xen/arch/ppc/boot_of.c --- a/xen/arch/ppc/boot_of.c Thu Apr 27 14:37:58 2006 -0400 +++ b/xen/arch/ppc/boot_of.c Thu Apr 27 14:40:10 2006 -0400 @@ -33,6 +33,7 @@ static char dom0args[256]; static char dom0args[256]; extern unsigned int timebase_freq; +extern unsigned long opic_addr; #undef OF_DEBUG @@ -865,6 +866,31 @@ static int __init boot_of_rtas(void) return 1; } +static void __init boot_of_pic(void) +{ + int root; + int p; + u32 addr_cells = 1; + int rc; + u32 addr[2]; + + root = of_finddevice("/"); + p = of_getchild(root); + + /* code is writen to assume sizes of 1 */ + of_getprop(root, "#address-cells", &addr_cells, sizeof (addr_cells)); + rc = of_getprop(root, "platform-open-pic", addr, sizeof (addr)); + if (rc <= 0) { + of_panic("cannot find the openpic\n"); + } + opic_addr = addr[0]; + if (addr_cells == 2) { + opic_addr <<= 32; + opic_addr |= addr[1]; + } + of_printf("OF: found OpenPIC at: 0x%lx\n", opic_addr); +} + multiboot_info_t __init *boot_of_init( ulong r3, ulong r4, ulong vec, ulong r6, ulong r7, ulong orig_msr) { @@ -901,6 +927,7 @@ multiboot_info_t __init *boot_of_init( boot_of_serial(); boot_of_cpus(); boot_of_rtas(); + boot_of_pic(); /* end of OF */ of_printf("closing OF stdout...\n"); diff -r 392b622c462327f6a5cab6f26635a2292bb4867d -r ffa41af2e455738f8fe3a0af8ae8952e9d4cc47c xen/arch/ppc/external.c --- a/xen/arch/ppc/external.c Thu Apr 27 14:37:58 2006 -0400 +++ b/xen/arch/ppc/external.c Thu Apr 27 14:40:10 2006 -0400 @@ -38,6 +38,7 @@ extern void do_IRQ(struct cpu_user_regs int vector_irq[NR_VECTORS] __read_mostly = { [0 ... NR_VECTORS - 1] = -1}; +unsigned long opic_addr; unsigned long io_apic_irqs; int ioapic_ack_new = 1; @@ -167,7 +168,6 @@ static void xen_set_affinity(unsigned in void init_IRQ(void) { - unsigned long opic_addr; unsigned int isu_size; unsigned int irq_offset; unsigned int irq_count; @@ -181,11 +181,6 @@ void init_IRQ(void) irq_vector[0] = FIRST_DEVICE_VECTOR; vector_irq[FIRST_DEVICE_VECTOR] = 0; - /* should find this in the devtree: - * G5 is at 0xffc00000 - * Maple is at 0xf8040000 - */ - opic_addr = 0xf8040000; isu_size = 0; irq_offset = 0; irq_count = 128; _______________________________________________ Xen-ppc-devel mailing list Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-ppc-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |