From: James S. <jsi...@us...> - 2002-05-16 18:01:40
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms In directory usw-pr-cvs1:/tmp/cvs-serv14367/linux/arch/ppc/platforms Modified Files: chrp_setup.c pmac_setup.c prep_setup.c Log Message: Synced to 2.5.15 Index: chrp_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/chrp_setup.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- chrp_setup.c 1 May 2002 18:07:49 -0000 1.3 +++ chrp_setup.c 16 May 2002 18:01:37 -0000 1.4 @@ -368,21 +368,21 @@ { struct device_node *np; int i; - unsigned char* chrp_int_ack_special = 0; + unsigned long chrp_int_ack; unsigned char init_senses[NR_IRQS - NUM_8259_INTERRUPTS]; int nmi_irq = -1; for (np = find_devices("pci"); np != NULL; np = np->next) { unsigned int *addrp = (unsigned int *) get_property(np, "8259-interrupt-acknowledge", NULL); + if (addrp == NULL) continue; - chrp_int_ack_special = (unsigned char *) - ioremap(addrp[prom_n_addr_cells(np)-1], 1); + chrp_int_ack = addrp[prom_n_addr_cells(np)-1]; break; } if (np == NULL) - printk("Cannot find pci to get ack address\n"); + printk(KERN_ERR "Cannot find PCI interrupt acknowledge address\n"); chrp_find_openpic(); @@ -390,18 +390,19 @@ OpenPIC_InitSenses = init_senses; OpenPIC_NumInitSenses = NR_IRQS - NUM_8259_INTERRUPTS; - openpic_init(1, NUM_8259_INTERRUPTS, chrp_int_ack_special, nmi_irq); + openpic_init(1, NUM_8259_INTERRUPTS, nmi_irq); for (i = 0; i < NUM_8259_INTERRUPTS; i++) irq_desc[i].handler = &i8259_pic; - i8259_init(0); + i8259_init(chrp_int_ack); } void __init chrp_init2(void) { #ifdef CONFIG_NVRAM - pmac_nvram_init(); +// XX replace this in a more saner way +// pmac_nvram_init(); #endif request_region(0x20,0x20,"pic1"); Index: pmac_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/pmac_setup.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pmac_setup.c 1 May 2002 18:07:50 -0000 1.2 +++ pmac_setup.c 16 May 2002 18:01:37 -0000 1.3 @@ -13,6 +13,8 @@ * Derived from "arch/alpha/kernel/setup.c" * Copyright (C) 1995 Linus Torvalds * + * Maintained by Benjamin Herrenschmidt (be...@ke...) + * * 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 @@ -82,9 +84,11 @@ extern int pmac_ide_check_base(ide_ioreg_t base); extern ide_ioreg_t pmac_ide_get_base(int index); extern void pmac_nvram_update(void); - +extern unsigned char pmac_nvram_read_byte(int addr); +extern void pmac_nvram_write_byte(int addr, unsigned char val); extern int pmac_pci_enable_device_hook(struct pci_dev *dev, int initial); extern void pmac_pcibios_after_init(void); +extern int of_show_percpuinfo(struct seq_file *m, int i); extern kdev_t sd_find_target(void *host, int tgt); @@ -115,56 +119,23 @@ #ifdef CONFIG_SMP extern struct smp_ops_t psurge_smp_ops; extern struct smp_ops_t core99_smp_ops; - -volatile static long int core99_l2_cache; -void __init -core99_init_l2(void) -{ - int cpu = smp_processor_id(); - - if (!(cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR)) - return; - - if (cpu == 0){ - core99_l2_cache = _get_L2CR(); - printk("CPU0: L2CR is %lx\n", core99_l2_cache); - } else { - printk("CPU%d: L2CR was %lx\n", cpu, _get_L2CR()); - _set_L2CR(0); - _set_L2CR(core99_l2_cache); - printk("CPU%d: L2CR set to %lx\n", cpu, core99_l2_cache); - } -} #endif /* CONFIG_SMP */ -/* - * Assume here that all clock rates are the same in a - * smp system. -- Cort - */ -int __openfirmware -of_show_percpuinfo(struct seq_file *m, int i) -{ - struct device_node *cpu_node; - int *fp, s; - - cpu_node = find_type_devices("cpu"); - if (!cpu_node) - return 0; - for (s = 0; s < i && cpu_node->next; s++) - cpu_node = cpu_node->next; - fp = (int *) get_property(cpu_node, "clock-frequency", NULL); - if (fp) - seq_printf(m, "clock\t\t: %dMHz\n", *fp / 1000000); - return 0; -} - int __pmac pmac_show_cpuinfo(struct seq_file *m) { struct device_node *np; char *pp; int plen; + int mbmodel = pmac_call_feature(PMAC_FTR_GET_MB_INFO, + NULL, PMAC_MB_INFO_MODEL, 0); + unsigned int mbflags = (unsigned int)pmac_call_feature(PMAC_FTR_GET_MB_INFO, + NULL, PMAC_MB_INFO_FLAGS, 0); + char* mbname; + if (pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL, PMAC_MB_INFO_NAME, (int)&mbname) != 0) + mbname = "Unknown"; + /* find motherboard type */ seq_printf(m, "machine\t\t: "); np = find_devices("device-tree"); @@ -188,6 +159,10 @@ } else seq_printf(m, "PowerMac\n"); + /* print parsed model */ + seq_printf(m, "detected as\t: %d (%s)\n", mbmodel, mbname); + seq_printf(m, "pmac flags\t: %08x\n", mbflags); + /* find l2 cache info */ np = find_devices("l2-cache"); if (np == 0) @@ -306,11 +281,6 @@ printk(KERN_INFO "L2CR overriden (0x%x), backside cache is %s\n", ppc_override_l2cr_value, (ppc_override_l2cr_value & 0x80000000) ? "enabled" : "disabled"); - -#ifdef CONFIG_SMP - /* somewhat of a hack */ - core99_init_l2(); -#endif #ifdef CONFIG_KGDB zs_kgdb_hook(0); @@ -379,21 +349,6 @@ int boot_part; extern kdev_t boot_dev; -void __init -pmac_init2(void) -{ -#ifdef CONFIG_ADB_PMU - via_pmu_start(); -#endif -#ifdef CONFIG_ADB_CUDA - via_cuda_start(); -#endif -#ifdef CONFIG_PMAC_PBOOK - media_bay_init(); -#endif - pmac_feature_late_init(); -} - #ifdef CONFIG_SCSI void __init note_scsi_host(struct device_node *node, void *host) @@ -657,7 +612,6 @@ ppc_md.irq_cannonicalize = NULL; ppc_md.init_IRQ = pmac_pic_init; ppc_md.get_irq = pmac_get_irq; /* Changed later on ... */ - ppc_md.init = pmac_init2; ppc_md.pcibios_fixup = pmac_pcibios_fixup; ppc_md.pcibios_enable_device_hook = pmac_pci_enable_device_hook; @@ -671,6 +625,11 @@ ppc_md.set_rtc_time = pmac_set_rtc_time; ppc_md.get_rtc_time = pmac_get_rtc_time; ppc_md.calibrate_decr = pmac_calibrate_decr; + +#ifdef CONFIG_NVRAM + ppc_md.nvram_read_val = pmac_nvram_read_byte; + ppc_md.nvram_write_val = pmac_nvram_write_byte; +#endif ppc_md.find_end_of_memory = pmac_find_end_of_memory; Index: prep_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/prep_setup.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- prep_setup.c 1 May 2002 18:07:50 -0000 1.2 +++ prep_setup.c 16 May 2002 18:01:37 -0000 1.3 @@ -55,6 +55,7 @@ #include <asm/raven.h> #include <asm/vga.h> #include <asm/time.h> +#include <asm/mpc10x.h> #include <asm/i8259.h> #include <asm/open_pic.h> @@ -674,22 +675,16 @@ } } -static int __prep -prep_get_irq(struct pt_regs *regs) -{ - return i8259_irq(); -} - static void __init prep_init_IRQ(void) { int i; if (OpenPIC_Addr != NULL) - openpic_init(1, NUM_8259_INTERRUPTS, 0, -1); + openpic_init(1, NUM_8259_INTERRUPTS, -1); for ( i = 0 ; i < NUM_8259_INTERRUPTS ; i++ ) irq_desc[i].handler = &i8259_pic; - i8259_init(0xbffffff0); /* PCI interrupt ack address for MPC105 and 106 */ + i8259_init(MPC10X_MAPA_PCI_INTACK_ADDR); } #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) @@ -856,7 +851,7 @@ ppc_md.irq_cannonicalize = prep_irq_cannonicalize; ppc_md.init_IRQ = prep_init_IRQ; /* this gets changed later on if we have an OpenPIC -- Cort */ - ppc_md.get_irq = prep_get_irq; + ppc_md.get_irq = i8259_irq; ppc_md.init = prep_init2; ppc_md.restart = prep_restart; |