public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Dobson <colpatch@us.ibm.com>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: linux-kernel@vger.kernel.org, "Martin J. Bligh" <mbligh@aracnet.com>
Subject: Re: [patch] Summit support for pcibus <-> cpumask topology [1/2]
Date: Fri, 14 Mar 2003 17:41:30 -0800	[thread overview]
Message-ID: <3E7284CA.6010907@us.ibm.com> (raw)
In-Reply-To: 1047676332.5409.374.camel@mulgrave

[-- Attachment #1: Type: text/plain, Size: 1047 bytes --]

James Bottomley wrote:
> 
>>This patch adds a new file, arch/i386/kernel/summit.c, for 
>>summit-specific code.  Adds some structures to mach_mpparse.h.  Also 
>>adds a hook in setup_arch() to dig out the PCI info, and stores it in 
>>the mp_bus_id_to_node[] array, where it can be read by the topology 
>>functions.
> 
> 
> Wouldn't this file be better in arch/i386/mach-summit in keeping with
> all the other subarch stuff?
> 
> While you're creating a separate file for summit, could you move the
> summit specific variables (mpparse.c:x86_summit is the only one, I
> think) into it so we can clean all the summit references out of the main
> line?
> 
> Thanks,
> 
> James

Ok...  Split into two patches now.  Patch 1 moves summit stuff into 
subarch.  Just creates the directory and populates it with setup.c, 
topology.c, and the Makefile from mach-default.  Also creates a summit.c 
which only has the x86_summit variable you referred to.

Patch 2 adds all pcimapping code, but adds it in the subarch dir, not 
i386/kernel/.

Cheers!

-Matt

[-- Attachment #2: summit_subarch-2.5.64.patch --]
[-- Type: text/plain, Size: 8168 bytes --]

diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.64-vanilla/arch/i386/Makefile linux-2.5.64-summit_subarch/arch/i386/Makefile
--- linux-2.5.64-vanilla/arch/i386/Makefile	Tue Mar  4 19:29:16 2003
+++ linux-2.5.64-summit_subarch/arch/i386/Makefile	Fri Mar 14 17:32:48 2003
@@ -71,7 +71,7 @@
 
 #Summit subarch support
 mflags-$(CONFIG_X86_SUMMIT) := -Iinclude/asm-i386/mach-summit
-mcore-$(CONFIG_X86_SUMMIT)  := mach-default
+mcore-$(CONFIG_X86_SUMMIT)  := mach-summit
 
 # default subarch .h files
 mflags-y += -Iinclude/asm-i386/mach-default
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.64-vanilla/arch/i386/kernel/mpparse.c linux-2.5.64-summit_subarch/arch/i386/kernel/mpparse.c
--- linux-2.5.64-vanilla/arch/i386/kernel/mpparse.c	Tue Mar  4 19:29:05 2003
+++ linux-2.5.64-summit_subarch/arch/i386/kernel/mpparse.c	Fri Mar 14 17:32:48 2003
@@ -72,7 +72,6 @@
 /* Bitmask of physically existing CPUs */
 unsigned long phys_cpu_present_map;
 
-int x86_summit = 0;
 u8 bios_cpu_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
 
 /*
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.64-vanilla/arch/i386/mach-summit/Makefile linux-2.5.64-summit_subarch/arch/i386/mach-summit/Makefile
--- linux-2.5.64-vanilla/arch/i386/mach-summit/Makefile	Wed Dec 31 16:00:00 1969
+++ linux-2.5.64-summit_subarch/arch/i386/mach-summit/Makefile	Fri Mar 14 17:32:48 2003
@@ -0,0 +1,7 @@
+#
+# Makefile for the linux kernel.
+#
+
+EXTRA_CFLAGS	+= -I../kernel
+
+obj-y				:= setup.o topology.o summit.o
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.64-vanilla/arch/i386/mach-summit/setup.c linux-2.5.64-summit_subarch/arch/i386/mach-summit/setup.c
--- linux-2.5.64-vanilla/arch/i386/mach-summit/setup.c	Wed Dec 31 16:00:00 1969
+++ linux-2.5.64-summit_subarch/arch/i386/mach-summit/setup.c	Fri Mar 14 17:32:48 2003
@@ -0,0 +1,104 @@
+/*
+ *	Machine specific setup for generic
+ */
+
+#include <linux/config.h>
+#include <linux/smp.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <asm/arch_hooks.h>
+
+/**
+ * pre_intr_init_hook - initialisation prior to setting up interrupt vectors
+ *
+ * Description:
+ *	Perform any necessary interrupt initialisation prior to setting up
+ *	the "ordinary" interrupt call gates.  For legacy reasons, the ISA
+ *	interrupts should be initialised here if the machine emulates a PC
+ *	in any way.
+ **/
+void __init pre_intr_init_hook(void)
+{
+	init_ISA_irqs();
+}
+
+/*
+ * IRQ2 is cascade interrupt to second interrupt controller
+ */
+static struct irqaction irq2 = { no_action, 0, 0, "cascade", NULL, NULL};
+
+/**
+ * intr_init_hook - post gate setup interrupt initialisation
+ *
+ * Description:
+ *	Fill in any interrupts that may have been left out by the general
+ *	init_IRQ() routine.  interrupts having to do with the machine rather
+ *	than the devices on the I/O bus (like APIC interrupts in intel MP
+ *	systems) are started here.
+ **/
+void __init intr_init_hook(void)
+{
+#ifdef CONFIG_X86_LOCAL_APIC
+	apic_intr_init();
+#endif
+
+	setup_irq(2, &irq2);
+}
+
+/**
+ * pre_setup_arch_hook - hook called prior to any setup_arch() execution
+ *
+ * Description:
+ *	generally used to activate any machine specific identification
+ *	routines that may be needed before setup_arch() runs.  On VISWS
+ *	this is used to get the board revision and type.
+ **/
+void __init pre_setup_arch_hook(void)
+{
+}
+
+/**
+ * trap_init_hook - initialise system specific traps
+ *
+ * Description:
+ *	Called as the final act of trap_init().  Used in VISWS to initialise
+ *	the various board specific APIC traps.
+ **/
+void __init trap_init_hook(void)
+{
+}
+
+static struct irqaction irq0  = { timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL};
+
+/**
+ * time_init_hook - do any specific initialisations for the system timer.
+ *
+ * Description:
+ *	Must plug the system timer interrupt source at HZ into the IRQ listed
+ *	in irq_vectors.h:TIMER_IRQ
+ **/
+void __init time_init_hook(void)
+{
+	setup_irq(0, &irq0);
+}
+
+#ifdef CONFIG_MCA
+/**
+ * mca_nmi_hook - hook into MCA specific NMI chain
+ *
+ * Description:
+ *	The MCA (Microchannel Arcitecture) has an NMI chain for NMI sources
+ *	along the MCA bus.  Use this to hook into that chain if you will need
+ *	it.
+ **/
+void __init mca_nmi_hook(void)
+{
+	/* If I recall correctly, there's a whole bunch of other things that
+	 * we can do to check for NMI problems, but that's all I know about
+	 * at the moment.
+	 */
+
+	printk("NMI generated from unknown source!\n");
+}
+#endif
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.64-vanilla/arch/i386/mach-summit/summit.c linux-2.5.64-summit_subarch/arch/i386/mach-summit/summit.c
--- linux-2.5.64-vanilla/arch/i386/mach-summit/summit.c	Wed Dec 31 16:00:00 1969
+++ linux-2.5.64-summit_subarch/arch/i386/mach-summit/summit.c	Fri Mar 14 17:32:48 2003
@@ -0,0 +1,29 @@
+/*
+ * arch/i386/kernel/summit.c - IBM Summit-Specific Code
+ *
+ * Written By: Matthew Dobson, IBM Corporation
+ *
+ * Copyright (c) 2003 IBM Corp.
+ *
+ * All rights reserved.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Send feedback to <colpatch@us.ibm.com>
+ *
+ */
+
+int x86_summit = 0;
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.64-vanilla/arch/i386/mach-summit/topology.c linux-2.5.64-summit_subarch/arch/i386/mach-summit/topology.c
--- linux-2.5.64-vanilla/arch/i386/mach-summit/topology.c	Wed Dec 31 16:00:00 1969
+++ linux-2.5.64-summit_subarch/arch/i386/mach-summit/topology.c	Fri Mar 14 17:32:48 2003
@@ -0,0 +1,68 @@
+/*
+ * arch/i386/mach-generic/topology.c - Populate driverfs with topology information
+ *
+ * Written by: Matthew Dobson, IBM Corporation
+ * Original Code: Paul Dorwin, IBM Corporation, Patrick Mochel, OSDL
+ *
+ * Copyright (C) 2002, IBM Corp.
+ *
+ * All rights reserved.          
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Send feedback to <colpatch@us.ibm.com>
+ */
+#include <linux/init.h>
+#include <linux/smp.h>
+#include <asm/cpu.h>
+
+struct i386_cpu cpu_devices[NR_CPUS];
+
+#ifdef CONFIG_NUMA
+#include <linux/mmzone.h>
+#include <asm/node.h>
+#include <asm/memblk.h>
+
+struct i386_node node_devices[MAX_NUMNODES];
+struct i386_memblk memblk_devices[MAX_NR_MEMBLKS];
+
+static int __init topology_init(void)
+{
+	int i;
+
+	for (i = 0; i < num_online_nodes(); i++)
+		arch_register_node(i);
+	for (i = 0; i < NR_CPUS; i++)
+		if (cpu_possible(i)) arch_register_cpu(i);
+	for (i = 0; i < num_online_memblks(); i++)
+		arch_register_memblk(i);
+	return 0;
+}
+
+#else /* !CONFIG_NUMA */
+
+static int __init topology_init(void)
+{
+	int i;
+
+	for (i = 0; i < NR_CPUS; i++)
+		if (cpu_possible(i)) arch_register_cpu(i);
+	return 0;
+}
+
+#endif /* CONFIG_NUMA */
+
+subsys_initcall(topology_init);

  reply	other threads:[~2003-03-15  1:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-14 21:12 [patch] Summit support for pcibus <-> cpumask topology James Bottomley
2003-03-15  1:41 ` Matthew Dobson [this message]
2003-03-15  1:43   ` [patch] Summit support for pcibus <-> cpumask topology [2/2] Matthew Dobson
2003-03-15  1:46   ` [patch] NUMAQ subarchification Matthew Dobson
2003-03-15  2:05     ` Martin J. Bligh
2003-03-15 17:53       ` James Bottomley
2003-03-15 17:58         ` Martin J. Bligh
2003-03-16  2:53         ` Kai Germaschewski
2003-03-16  3:22           ` Martin J. Bligh
2003-03-16  5:05           ` James Bottomley
2003-03-16  5:55             ` Kai Germaschewski
2003-03-16 14:36               ` James Bottomley
2003-03-16  1:07       ` Alan Cox
2003-03-16  2:24         ` Martin J. Bligh
2003-03-16  4:31         ` James Bottomley
2003-03-18  1:58       ` Matthew Dobson
2003-03-18 16:16         ` James Bottomley
2003-03-18 16:30           ` Martin J. Bligh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E7284CA.6010907@us.ibm.com \
    --to=colpatch@us.ibm.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox