diff -uNr linux-2.4.18-p4.orig/arch/ppc/kernel/Makefile linux-2.4.18-p4.cur/arch/ppc/kernel/Makefile --- linux-2.4.18-p4.orig/arch/ppc/kernel/Makefile Wed Jan 23 11:49:43 2002 +++ linux-2.4.18-p4.cur/arch/ppc/kernel/Makefile Wed Jan 23 11:45:57 2002 @@ -59,7 +59,7 @@ pmac_feature.o pmac_pci.o chrp_setup.o \ chrp_time.o chrp_pci.o open_pic.o \ indirect_pci.o i8259.o prep_pci.o \ - prep_time.o prep_nvram.o prep_setup.o + prep_time.o prep_nvram.o prep_setup.o pci_auto.o obj-$(CONFIG_NVRAM) += pmac_nvram.o obj-$(CONFIG_PMAC_BACKLIGHT) += pmac_backlight.o obj-$(CONFIG_PMAC_PBOOK) += sleep.o diff -uNr linux-2.4.18-p4.orig/arch/ppc/kernel/chrp_pci.c linux-2.4.18-p4.cur/arch/ppc/kernel/chrp_pci.c --- linux-2.4.18-p4.orig/arch/ppc/kernel/chrp_pci.c Sat Sep 8 14:38:41 2001 +++ linux-2.4.18-p4.cur/arch/ppc/kernel/chrp_pci.c Wed Jan 23 11:45:57 2002 @@ -214,12 +214,14 @@ struct device_node *np; /* PCI interrupts are controlled by the OpenPIC */ +#if 0 pci_for_each_dev(dev) { np = pci_device_to_OF_node(dev); if ((np != 0) && (np->n_intrs > 0) && (np->intrs[0].line != 0)) dev->irq = np->intrs[0].line; pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); } +#endif } void __init @@ -302,9 +304,22 @@ gg2_pci_config_base = (unsigned long) ioremap(GG2_PCI_CONFIG_BASE, 0x80000); } else { + printk("model not found ... using POP %s\n",model); + + setup_grackle(hose); + hose->cfg_addr += 0x0cf8; + hose->cfg_data += 0x0cfc; + + setup_indirect_pci(hose, (u32) hose->cfg_addr, (u32) hose->cfg_data); + hose->last_busno = pciauto_bus_scan(hose, hose->first_busno); + + /* these are mapped via bat so shouldn't need to io remap */ + +/* printk("No methods for %s (model %s), using RTAS\n", dev->full_name, model); hose->ops = &rtas_pci_ops; +*/ } pci_process_bridge_OF_ranges(hose, dev, index == 0); diff -uNr linux-2.4.18-p4.orig/arch/ppc/kernel/chrp_setup.c linux-2.4.18-p4.cur/arch/ppc/kernel/chrp_setup.c --- linux-2.4.18-p4.orig/arch/ppc/kernel/chrp_setup.c Wed Jan 23 11:49:43 2002 +++ linux-2.4.18-p4.cur/arch/ppc/kernel/chrp_setup.c Wed Jan 23 11:45:57 2002 @@ -83,6 +83,8 @@ extern unsigned char pckbd_sysrq_xlate[128]; extern void select_adb_keyboard(void); extern int of_show_percpuinfo(struct seq_file *, int); +extern void pop_init_IRQ(void); +extern int poppic_get_irq(struct pt_regs *regs); extern kdev_t boot_dev; @@ -480,6 +482,7 @@ * -- Cort */ name = get_property(find_path_device("/"), "name", NULL); +/* if (name && strncmp(name, "IBM-70", 6) == 0 && strstr(name, "-F50")) { io_block_mapping(0x80000000, 0x80000000, 0x10000000, _PAGE_IO); @@ -488,6 +491,9 @@ } else { io_block_mapping(0xf8000000, 0xf8000000, 0x04000000, _PAGE_IO); } +*/ +io_block_mapping(0x80000000, 0x80000000, 0x10000000, _PAGE_IO); +io_block_mapping(0xf8000000, 0xf8000000, 0x08000000, _PAGE_IO); } void __init @@ -513,8 +519,10 @@ ppc_md.show_cpuinfo = chrp_show_cpuinfo; ppc_md.irq_cannonicalize = chrp_irq_cannonicalize; #ifndef CONFIG_POWER4 - ppc_md.init_IRQ = chrp_init_IRQ; - ppc_md.get_irq = openpic_get_irq; +/* ppc_md.init_IRQ = pop_init_IRQ;*/ + ppc_md.init_IRQ = chrp_init_IRQ; +/* ppc_md.get_irq = openpic_get_irq; */ + ppc_md.get_irq = poppic_get_irq; #else ppc_md.init_IRQ = xics_init_IRQ; ppc_md.get_irq = xics_get_irq; diff -uNr linux-2.4.18-p4.orig/arch/ppc/kernel/chrp_time.c linux-2.4.18-p4.cur/arch/ppc/kernel/chrp_time.c --- linux-2.4.18-p4.orig/arch/ppc/kernel/chrp_time.c Sat Sep 8 14:38:41 2001 +++ linux-2.4.18-p4.cur/arch/ppc/kernel/chrp_time.c Wed Jan 23 11:45:57 2002 @@ -181,6 +181,7 @@ * to tell us the rate at which the decrementer counts. */ freq = 16666000; /* hardcoded default */ + cpu = find_type_devices("cpu"); if (cpu != 0) { fp = (unsigned int *) @@ -188,6 +189,8 @@ if (fp != 0) freq = *fp; } + freq= 25000000; /* POP3 clock runs too fast with 16666000 + and the OF value isn't any better*/ printk("time_init: decrementer frequency = %u.%.6u MHz\n", freq/1000000, freq%1000000); tb_ticks_per_jiffy = freq / HZ; diff -uNr linux-2.4.18-p4.orig/arch/ppc/kernel/cputable.c linux-2.4.18-p4.cur/arch/ppc/kernel/cputable.c --- linux-2.4.18-p4.orig/arch/ppc/kernel/cputable.c Wed Jan 23 11:49:43 2002 +++ linux-2.4.18-p4.cur/arch/ppc/kernel/cputable.c Wed Jan 23 11:45:57 2002 @@ -122,6 +122,14 @@ 32, 32, __setup_cpu_750 }, + { /* 740/750 (0x4202, don't support TAU ?) TAG - POP */ + 0xffffffff, 0x00082202, "740/750CXe", + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE, + COMMON_PPC, + 32, 32, + __setup_cpu_750 + }, { /* 745/755 */ 0xfffff000, 0x00083000, "745/755", CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | diff -uNr linux-2.4.18-p4.orig/arch/ppc/kernel/open_pic.c linux-2.4.18-p4.cur/arch/ppc/kernel/open_pic.c --- linux-2.4.18-p4.orig/arch/ppc/kernel/open_pic.c Wed Jan 23 11:49:43 2002 +++ linux-2.4.18-p4.cur/arch/ppc/kernel/open_pic.c Wed Jan 23 11:45:57 2002 @@ -778,6 +778,70 @@ #endif /* CONFIG_SMP */ +__init void +pop_init_IRQ(void) +{ + int i; + struct device_node *np; + unsigned int *addrp; + unsigned char* chrp_int_ack_special = 0; + unsigned char init_senses[NR_IRQS - NUM_8259_INTERRUPTS]; + int nmi_irq = -1; +#if defined(CONFIG_VT) && defined(CONFIG_ADB_KEYBOARD) && defined(XMON) + struct device_node *kbd; +#endif + + for ( i = 0 ; i < NUM_8259_INTERRUPTS ; i++ ) + irq_desc[i].handler = &i8259_pic; + i8259_init(NULL); + + if (!(np = find_devices("pci")) + || !(addrp = (unsigned int *) + get_property(np, "8259-interrupt-acknowledge", NULL))) + printk("Cannot find pci to get ack address\n"); + else + chrp_int_ack_special = (unsigned char *) + ioremap(addrp[prom_n_addr_cells(np)-1], 1); + + i8259_init(NULL); +#if defined(CONFIG_VT) && defined(CONFIG_ADB_KEYBOARD) && defined(XMON) + /* see if there is a keyboard in the device tree + with a parent of type "adb" */ + for (kbd = find_devices("keyboard"); kbd; kbd = kbd->next) + if (kbd->parent && kbd->parent->type + && strcmp(kbd->parent->type, "adb") == 0) + break; + if (kbd) + request_irq( HYDRA_INT_ADB_NMI, xmon_irq, 0, "XMON break", 0); +#endif + + +} + +int +poppic_get_irq(struct pt_regs *regs) +{ + int irq; + +/* if ( chrp_int_ack_special ) + irq = *chrp_int_ack_special; + else + irq = i8259_poll(); +*/ + + + if ( (irq = i8259_poll()) < 0 ) { +#if 0 + printk(KERN_DEBUG "Bogus interrupt from PC = %lx\n", + regs->nip); +#endif + return -1; + } + + printk("int %x\n",irq); + return irq; +} + /* This one may be merged with PReP and CHRP */ int openpic_get_irq(struct pt_regs *regs) diff -uNr linux-2.4.18-p4.orig/arch/ppc/kernel/pci_auto.c linux-2.4.18-p4.cur/arch/ppc/kernel/pci_auto.c --- linux-2.4.18-p4.orig/arch/ppc/kernel/pci_auto.c Wed Dec 31 18:00:00 1969 +++ linux-2.4.18-p4.cur/arch/ppc/kernel/pci_auto.c Wed Jan 23 11:45:58 2002 @@ -0,0 +1,519 @@ +/* + * arch/ppc/kernel/pci_auto.c + * + * PCI autoconfiguration library + * + * Author: Matt Porter + * + * Copyright 2001 MontaVista Software Inc. + * + * 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; either version 2 of the License, or (at your + * option) any later version. + */ + +/* + * The CardBus support is very preliminary. Preallocating space is + * the way to go but will require some change in card services to + * make it useful. Eventually this will ensure that we can put + * multiple CB bridges behind multiple P2P bridges. For now, at + * least it ensures that we place the CB bridge BAR and assigned + * initial bus numbers. I definitely need to do something about + * the lack of 16-bit I/O support. -MDP + */ + +#include +#include +#include + +#include + +#define PCIAUTO_IDE_MODE_MASK 0x05 + +#define DEBUG + +#ifdef DEBUG +#define DBG(x...) printk(x) +#else +#define DBG(x...) +#endif /* DEBUG */ + +static int pciauto_upper_iospc; +static int pciauto_upper_memspc; + +void __init pciauto_setup_bars(struct pci_controller *hose, + int current_bus, + int pci_devfn, + int bar_limit) +{ + int bar_response, bar_size, bar_value; + int bar, addr_mask; + int * upper_limit; + int found_mem64 = 0; + + DBG("PCI Autoconfig: Found Bus %d, Device %d, Function %d\n", + current_bus, PCI_SLOT(pci_devfn), PCI_FUNC(pci_devfn) ); + + for (bar = PCI_BASE_ADDRESS_0; bar <= bar_limit; bar+=4) { + /* Tickle the BAR and get the response */ + early_write_config_dword(hose, + current_bus, + pci_devfn, + bar, + 0xffffffff); + early_read_config_dword(hose, + current_bus, + pci_devfn, + bar, + &bar_response); + + /* If BAR is not implemented go to the next BAR */ + if (!bar_response) + continue; + + /* Check the BAR type and set our address mask */ + if (bar_response & PCI_BASE_ADDRESS_SPACE) { + addr_mask = PCI_BASE_ADDRESS_IO_MASK; + upper_limit = &pciauto_upper_iospc; + DBG("PCI Autoconfig: BAR 0x%x, I/O, ", bar); + } else { + if ( (bar_response & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == + PCI_BASE_ADDRESS_MEM_TYPE_64) + found_mem64 = 1; + + addr_mask = PCI_BASE_ADDRESS_MEM_MASK; + upper_limit = &pciauto_upper_memspc; + DBG("PCI Autoconfig: BAR 0x%x, Mem ", bar); + } + + /* Calculate requested size */ + bar_size = ~(bar_response & addr_mask) + 1; + + /* Allocate a base address */ + bar_value = (*upper_limit - bar_size) & ~(bar_size - 1); + + /* Write it out and update our limit */ + early_write_config_dword(hose, + current_bus, + pci_devfn, + bar, + bar_value); + + *upper_limit = bar_value; + + /* + * If we are a 64-bit decoder then increment to the + * upper 32 bits of the bar and force it to locate + * in the lower 4GB of memory. + */ + if (found_mem64) { + bar += 4; + early_write_config_dword(hose, + current_bus, + pci_devfn, + bar, + 0x00000000); + found_mem64 = 0; + } + + DBG("size=0x%x, address=0x%x\n", + bar_size, bar_value); + } + +} + +void __init pciauto_prescan_setup_bridge(struct pci_controller *hose, + int current_bus, + int pci_devfn, + int sub_bus, + int *iosave, + int *memsave) +{ + /* Configure bus number registers */ + early_write_config_byte(hose, + current_bus, + pci_devfn, + PCI_PRIMARY_BUS, + current_bus); + early_write_config_byte(hose, + current_bus, + pci_devfn, + PCI_SECONDARY_BUS, + sub_bus + 1); + early_write_config_byte(hose, + current_bus, + pci_devfn, + PCI_SUBORDINATE_BUS, + 0xff); + + /* Round memory allocator to 1MB boundary */ + pciauto_upper_memspc &= ~(0x100000 - 1); + *memsave = pciauto_upper_memspc; + + /* Round I/O allocator to 4KB boundary */ + pciauto_upper_iospc &= ~(0x1000 - 1); + *iosave = pciauto_upper_iospc; + + /* Set up memory and I/O filter limits, assume 32-bit I/O space */ + early_write_config_word(hose, + current_bus, + pci_devfn, + PCI_MEMORY_LIMIT, + ((pciauto_upper_memspc - 1) & 0xfff00000) >> 16); + early_write_config_byte(hose, + current_bus, + pci_devfn, + PCI_IO_LIMIT, + ((pciauto_upper_iospc - 1) & 0x0000f000) >> 8); + early_write_config_word(hose, + current_bus, + pci_devfn, + PCI_IO_LIMIT_UPPER16, + ((pciauto_upper_iospc - 1) & 0xffff0000) >> 16); + + /* Zero upper 32 bits of prefetchable base/limit */ + early_write_config_dword(hose, + current_bus, + pci_devfn, + PCI_PREF_BASE_UPPER32, + 0); + early_write_config_dword(hose, + current_bus, + pci_devfn, + PCI_PREF_LIMIT_UPPER32, + 0); +} + +void __init pciauto_postscan_setup_bridge(struct pci_controller *hose, + int current_bus, + int pci_devfn, + int sub_bus, + int *iosave, + int *memsave) +{ + int cmdstat; + + /* Configure bus number registers */ + early_write_config_byte(hose, + current_bus, + pci_devfn, + PCI_SUBORDINATE_BUS, + sub_bus); + + /* + * Round memory allocator to 1MB boundary. + * If no space used, allocate minimum. + */ + pciauto_upper_memspc &= ~(0x100000 - 1); + if (*memsave == pciauto_upper_memspc) + pciauto_upper_memspc -= 0x00100000; + + early_write_config_word(hose, + current_bus, + pci_devfn, + PCI_MEMORY_BASE, + pciauto_upper_memspc >> 16); + + /* Allocate 1MB for pre-fretch */ + early_write_config_word(hose, + current_bus, + pci_devfn, + PCI_PREF_MEMORY_LIMIT, + ((pciauto_upper_memspc - 1) & 0xfff00000) >> 16); + + pciauto_upper_memspc -= 0x100000; + + early_write_config_word(hose, + current_bus, + pci_devfn, + PCI_PREF_MEMORY_BASE, + pciauto_upper_memspc >> 16); + + /* Round I/O allocator to 4KB boundary */ + pciauto_upper_iospc &= ~(0x1000 - 1); + if (*iosave == pciauto_upper_iospc) + pciauto_upper_iospc -= 0x1000; + + early_write_config_byte(hose, + current_bus, + pci_devfn, + PCI_IO_BASE, + (pciauto_upper_iospc & 0x0000f000) >> 8); + early_write_config_word(hose, + current_bus, + pci_devfn, + PCI_IO_BASE_UPPER16, + pciauto_upper_iospc >> 16); + + /* Enable memory and I/O accesses, enable bus master */ + early_read_config_dword(hose, + current_bus, + pci_devfn, + PCI_COMMAND, + &cmdstat); + early_write_config_dword(hose, + current_bus, + pci_devfn, + PCI_COMMAND, + cmdstat | + PCI_COMMAND_IO | + PCI_COMMAND_MEMORY | + PCI_COMMAND_MASTER); +} + +void __init pciauto_prescan_setup_cardbus_bridge(struct pci_controller *hose, + int current_bus, + int pci_devfn, + int sub_bus, + int *iosave, + int *memsave) +{ + /* Configure bus number registers */ + early_write_config_byte(hose, + current_bus, + pci_devfn, + PCI_PRIMARY_BUS, + current_bus); + early_write_config_byte(hose, + current_bus, + pci_devfn, + PCI_SECONDARY_BUS, + sub_bus + 1); + early_write_config_byte(hose, + current_bus, + pci_devfn, + PCI_SUBORDINATE_BUS, + 0xff); + + /* Round memory allocator to 4KB boundary */ + pciauto_upper_memspc &= ~(0x1000 - 1); + *memsave = pciauto_upper_memspc; + + /* Round I/O allocator to 4 byte boundary */ + pciauto_upper_iospc &= ~(0x4 - 1); + *iosave = pciauto_upper_iospc; + + /* Set up memory and I/O filter limits, assume 32-bit I/O space */ + early_write_config_dword(hose, + current_bus, + pci_devfn, + 0x20, + pciauto_upper_memspc - 1); + early_write_config_dword(hose, + current_bus, + pci_devfn, + 0x30, + pciauto_upper_iospc - 1); +} + +void __init pciauto_postscan_setup_cardbus_bridge(struct pci_controller *hose, + int current_bus, + int pci_devfn, + int sub_bus, + int *iosave, + int *memsave) +{ + int cmdstat; + + /* + * Configure subordinate bus number. The PCI subsystem + * bus scan will renumber buses (reserving three additional + * for this PCI<->CardBus bridge for the case where a CardBus + * adapter contains a P2P or CB2CB bridge. + */ + early_write_config_byte(hose, + current_bus, + pci_devfn, + PCI_SUBORDINATE_BUS, + sub_bus); + + /* + * Reserve an additional 4MB for mem space and 16KB for + * I/O space. This should cover any additional space + * requirement of unusual CardBus devices with + * additional bridges that can consume more address space. + * + * Although pcmcia-cs currently will reprogram bridge + * windows, the goal is to add an option to leave them + * alone and use the bridge window ranges as the regions + * that are searched for free resources upon hot-insertion + * of a device. This will allow a PCI<->CardBus bridge + * configured by this routine to happily live behind a + * P2P bridge in a system. + */ + pciauto_upper_memspc -= 0x00400000; + pciauto_upper_iospc -= 0x00004000; + + /* Round memory allocator to 4KB boundary */ + pciauto_upper_memspc &= ~(0x1000 - 1); + + early_write_config_dword(hose, + current_bus, + pci_devfn, + 0x1c, + pciauto_upper_memspc); + + /* Round I/O allocator to 4 byte boundary */ + pciauto_upper_iospc &= ~(0x4 - 1); + early_write_config_dword(hose, + current_bus, + pci_devfn, + 0x2c, + pciauto_upper_iospc); + + /* Enable memory and I/O accesses, enable bus master */ + early_read_config_dword(hose, + current_bus, + pci_devfn, + PCI_COMMAND, + &cmdstat); + early_write_config_dword(hose, + current_bus, + pci_devfn, + PCI_COMMAND, + cmdstat | + PCI_COMMAND_IO | + PCI_COMMAND_MEMORY | + PCI_COMMAND_MASTER); +} + +int __init pciauto_bus_scan(struct pci_controller *hose, int current_bus) +{ + int sub_bus, pci_devfn, pci_class, cmdstat, found_multi = 0; + unsigned short vid; + unsigned char header_type; + + /* + * Fetch our I/O and memory space upper boundaries used + * to allocated base addresses on this hose. + */ + if (current_bus == hose->first_busno) { + pciauto_upper_iospc = hose->io_space.end + 1; + pciauto_upper_memspc = hose->mem_space.end + 1; + } + + sub_bus = current_bus; + + for (pci_devfn = 0; pci_devfn < 0xff; pci_devfn++) { + /* Skip our host bridge */ + if ( (current_bus == hose->first_busno) && (pci_devfn == 0) ) + continue; + + if (PCI_FUNC(pci_devfn) && !found_multi) + continue; + + /* If config space read fails from this device, move on */ + if (early_read_config_byte(hose, + current_bus, + pci_devfn, + PCI_HEADER_TYPE, + &header_type)) + continue; + + if (!PCI_FUNC(pci_devfn)) + found_multi = header_type & 0x80; + + early_read_config_word(hose, + current_bus, + pci_devfn, + PCI_VENDOR_ID, + &vid); + + if (vid != 0xffff) { + early_read_config_dword(hose, + current_bus, + pci_devfn, + PCI_CLASS_REVISION, &pci_class); + if ( (pci_class >> 16) == PCI_CLASS_BRIDGE_PCI ) { + int iosave, memsave; + + DBG("PCI Autoconfig: Found P2P bridge, device %d\n", PCI_SLOT(pci_devfn)); + /* Allocate PCI I/O and/or memory space */ + pciauto_setup_bars(hose, + current_bus, + pci_devfn, + PCI_BASE_ADDRESS_1); + + pciauto_prescan_setup_bridge(hose, + current_bus, + pci_devfn, + sub_bus, + &iosave, + &memsave); + sub_bus = pciauto_bus_scan(hose, sub_bus+1); + pciauto_postscan_setup_bridge(hose, + current_bus, + pci_devfn, + sub_bus, + &iosave, + &memsave); + } else if ((pci_class >> 16) == PCI_CLASS_BRIDGE_CARDBUS) { + int iosave, memsave; + + DBG("PCI Autoconfig: Found CardBus bridge, device %d function %d\n", PCI_SLOT(pci_devfn), PCI_FUNC(pci_devfn)); + /* Place CardBus Socket/ExCA registers */ + pciauto_setup_bars(hose, + current_bus, + pci_devfn, + PCI_BASE_ADDRESS_0); + + pciauto_prescan_setup_cardbus_bridge(hose, + current_bus, + pci_devfn, + sub_bus, + &iosave, + &memsave); + sub_bus = pciauto_bus_scan(hose, sub_bus+1); + pciauto_postscan_setup_cardbus_bridge(hose, + current_bus, + pci_devfn, + sub_bus, + &iosave, + &memsave); + } else { + if ((pci_class >> 16) == PCI_CLASS_STORAGE_IDE) { + unsigned char prg_iface; + + early_read_config_byte(hose, + current_bus, + pci_devfn, + PCI_CLASS_PROG, + &prg_iface); + if (!(prg_iface & PCIAUTO_IDE_MODE_MASK)) { + DBG("PCI Autoconfig: Skipping legacy mode IDE controller\n"); + continue; + } + } + /* Allocate PCI I/O and/or memory space */ + pciauto_setup_bars(hose, + current_bus, + pci_devfn, + PCI_BASE_ADDRESS_5); + + /* + * Enable some standard settings + */ + early_read_config_dword(hose, + current_bus, + pci_devfn, + PCI_COMMAND, + &cmdstat); + early_write_config_dword(hose, + current_bus, + pci_devfn, + PCI_COMMAND, + cmdstat | + PCI_COMMAND_IO | + PCI_COMMAND_MEMORY | + PCI_COMMAND_MASTER); + early_write_config_byte(hose, + current_bus, + pci_devfn, + PCI_LATENCY_TIMER, + 0x80); + } + } + } + return sub_bus; +} diff -uNr linux-2.4.18-p4.orig/arch/ppc/kernel/prom.c linux-2.4.18-p4.cur/arch/ppc/kernel/prom.c --- linux-2.4.18-p4.orig/arch/ppc/kernel/prom.c Wed Jan 23 11:49:43 2002 +++ linux-2.4.18-p4.cur/arch/ppc/kernel/prom.c Wed Jan 23 11:45:57 2002 @@ -653,8 +653,11 @@ #endif /* Use quiesce call to get OF to shut down any devices it's using */ +/* can't do on POP prom_print(RELOC("Calling quiesce ...\n")); call_prom(RELOC("quiesce"), 0, 0); +*/ +prom_print(RELOC("Skipping quiesce ...\n")); #ifdef CONFIG_BOOTX_TEXT if (RELOC(prom_disp_node) != 0) @@ -811,13 +814,15 @@ * method is available. * Should update this to use set-colors. */ +/* don't do this on POP */ +#if 0 for (i = 0; i < 32; i++) if (prom_set_color(ih, i, RELOC(default_colors)[i*3], RELOC(default_colors)[i*3+1], RELOC(default_colors)[i*3+2]) != 0) break; -#ifdef CONFIG_FB +/* #ifdef CONFIG_FB */ for (i = 0; i < LINUX_LOGO_COLORS; i++) if (prom_set_color(ih, i + 32, RELOC(linux_logo_red)[i], @@ -1033,6 +1038,7 @@ void __init finish_device_tree(void) { + unsigned long offset = reloc_offset(); unsigned long mem = (unsigned long) klimit; struct device_node *np; @@ -1043,6 +1049,7 @@ break; } } + use_of_interrupt_tree=0; if (_machine == _MACH_Pmac && use_of_interrupt_tree) pmac_newworld = 1; @@ -1064,7 +1071,7 @@ int n = 0; char *name, *ic; int iclen; - +#if 0 /*POP POOP */ for (np = allnodes; np != NULL; np = np->allnext) { ic = get_property(np, "interrupt-controller", &iclen); name = get_property(np, "name", NULL); @@ -1078,9 +1085,10 @@ ++n; } } +#endif + dflt_interrupt_controller=NULL; num_interrupt_controllers = n; } - mem = finish_node(allnodes, mem, NULL, 1, 1); dev_tree_size = mem - (unsigned long) allnodes; klimit = (char *) mem; @@ -1112,6 +1120,13 @@ { struct device_node *child; int *ip; + unsigned long offset = reloc_offset(); + + if (np==NULL) + { + btext_drawstring(RELOC("NULL np\n")); + return mem_start; + } np->name = get_property(np, "name", 0); np->type = get_property(np, "device_type", 0); @@ -1144,6 +1159,7 @@ * no compatible property. And very rarely we won't have a name * property either. -- Tom */ + if(np->name !=NULL) if (!strcmp(np->name, "display")) np->name = get_property(np, "compatible", 0); if (!np->name) @@ -1871,10 +1887,15 @@ { struct property *pp; + if (np!=NULL) for (pp = np->properties; pp != 0; pp = pp->next) if (pp->name != NULL && strcmp(pp->name, name) == 0) { if (lenp != 0) *lenp = pp->length; + if (!(pp->length)) + { + return NULL; + } return pp->value; } return 0; diff -uNr linux-2.4.18-p4.orig/arch/ppc/kernel/setup.c linux-2.4.18-p4.cur/arch/ppc/kernel/setup.c --- linux-2.4.18-p4.orig/arch/ppc/kernel/setup.c Wed Jan 23 11:49:43 2002 +++ linux-2.4.18-p4.cur/arch/ppc/kernel/setup.c Wed Jan 23 11:45:57 2002 @@ -342,6 +342,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { + unsigned long offset = reloc_offset(); #ifdef CONFIG_BOOTX_TEXT extern boot_infos_t *disp_bi; @@ -351,6 +352,8 @@ } #endif + + /* if we didn't get any bootinfo telling us what we are... */ if (_machine == 0) { /* prep boot loader tells us if we're prep or not */ @@ -373,8 +376,11 @@ if (_machine == 0) intuit_machine_type(); + btext_drawstring(RELOC("before fin dev tree\n")); + /* finish_device_tree may need _machine defined. */ finish_device_tree(); + btext_drawstring(RELOC("after fin dev tree\n")); /* * If we were booted via quik, r3 points to the physical @@ -430,6 +436,8 @@ } cmd_line[sizeof(cmd_line) - 1] = 0; +btext_drawstring(RELOC("before chrp init\n")); + switch (_machine) { case _MACH_Pmac: pmac_init(r3, r4, r5, r6, r7); @@ -437,7 +445,11 @@ case _MACH_chrp: chrp_init(r3, r4, r5, r6, r7); break; + default: + chrp_init(r3, r4, r5, r6, r7); + break; } +btext_drawstring(RELOC("after chrp init\n")); } #endif /* CONFIG_ALL_PPC */ diff -uNr linux-2.4.18-p4.orig/include/asm-ppc/pci-bridge.h linux-2.4.18-p4.cur/include/asm-ppc/pci-bridge.h --- linux-2.4.18-p4.orig/include/asm-ppc/pci-bridge.h Mon May 21 17:02:06 2001 +++ linux-2.4.18-p4.cur/include/asm-ppc/pci-bridge.h Wed Jan 23 11:45:01 2002 @@ -65,6 +65,12 @@ struct resource io_resource; struct resource mem_resources[3]; int mem_resource_count; + + /* Host bridge I/O and Memory space + * Used for BAR placement algorithms + */ + struct resource io_space; + struct resource mem_space; }; /* These are used for config access before all the PCI probing diff -uNr linux-2.4.18-p4.orig/init/main.c linux-2.4.18-p4.cur/init/main.c --- linux-2.4.18-p4.orig/init/main.c Fri Dec 21 11:42:04 2001 +++ linux-2.4.18-p4.cur/init/main.c Wed Jan 23 11:44:50 2002 @@ -757,6 +757,7 @@ real_root_dev = ROOT_DEV; #endif +#if 0 #ifdef CONFIG_BLK_DEV_RAM #ifdef CONFIG_BLK_DEV_INITRD if (mount_initrd) @@ -765,7 +766,7 @@ #endif rd_load(); #endif - +#endif /* Mount the root filesystem.. */ mount_root();