linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] [POWERPC] iSeries: set FW_FEATURE_ISERIES earlier
@ 2006-09-26  3:34 Stephen Rothwell
  2006-09-26  3:35 ` [PATCH 2/7] [POWERPC] The two vio HVC backends clash Stephen Rothwell
  0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2006-09-26  3:34 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev

This will help in the combined kernel as some really early things depend
on being able to check this.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/platforms/iseries/setup.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 7f19530..7cb6b5f 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -655,9 +655,6 @@ static int __init iseries_probe(void)
 	if (!of_flat_dt_is_compatible(root, "IBM,iSeries"))
 		return 0;
 
-	powerpc_firmware_features |= FW_FEATURE_ISERIES;
-	powerpc_firmware_features |= FW_FEATURE_LPAR;
-
 	hpte_init_iSeries();
 
 	return 1;
@@ -687,6 +684,9 @@ void * __init iSeries_early_setup(void)
 {
 	unsigned long phys_mem_size;
 
+	powerpc_firmware_features |= FW_FEATURE_ISERIES;
+	powerpc_firmware_features |= FW_FEATURE_LPAR;
+
 	iSeries_fixup_klimit();
 
 	/*
-- 
1.4.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/7] [POWERPC] The two vio HVC backends clash
  2006-09-26  3:34 [PATCH 1/7] [POWERPC] iSeries: set FW_FEATURE_ISERIES earlier Stephen Rothwell
@ 2006-09-26  3:35 ` Stephen Rothwell
  2006-09-26  3:36   ` [PATCH 3/7] [POWERPC] modify PCI code for a merged kernel Stephen Rothwell
  2006-09-26  5:10   ` [PATCH 2/7] [POWERPC] The two vio HVC backends clash Olof Johansson
  0 siblings, 2 replies; 14+ messages in thread
From: Stephen Rothwell @ 2006-09-26  3:35 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev

Make sure only one of them actually registered as a driver.

Also, remove cast from get_property().

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/char/hvc_iseries.c |    8 ++++++--
 drivers/char/hvc_vio.c     |    4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c
index 4747729..ea36201 100644
--- a/drivers/char/hvc_iseries.c
+++ b/drivers/char/hvc_iseries.c
@@ -29,6 +29,7 @@ #include <linux/console.h>
 #include <asm/hvconsole.h>
 #include <asm/vio.h>
 #include <asm/prom.h>
+#include <asm/firmware.h>
 #include <asm/iseries/vio.h>
 #include <asm/iseries/hv_call.h>
 #include <asm/iseries/hv_lp_config.h>
@@ -493,6 +494,9 @@ static int hvc_vio_init(void)
 	atomic_t wait_flag;
 	int rc;
 
+	if (!firmware_has_feature(FW_FEATURE_ISERIES))
+		return -EIO;
+
 	/* +2 for fudge */
 	rc = viopath_open(HvLpConfig_getPrimaryLpIndex(),
 			viomajorsubtype_chario, VIOCHAR_WINDOW + 2);
@@ -567,7 +571,7 @@ static int hvc_find_vtys(void)
 
 	for (vty = of_find_node_by_name(NULL, "vty"); vty != NULL;
 			vty = of_find_node_by_name(vty, "vty")) {
-		uint32_t *vtermno;
+		const uint32_t *vtermno;
 
 		/* We have statically defined space for only a certain number
 		 * of console adapters.
@@ -576,7 +580,7 @@ static int hvc_find_vtys(void)
 				(num_found >= VTTY_PORTS))
 			break;
 
-		vtermno = (uint32_t *)get_property(vty, "reg", NULL);
+		vtermno = get_property(vty, "reg", NULL);
 		if (!vtermno)
 			continue;
 
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c
index cc95941..f9c0084 100644
--- a/drivers/char/hvc_vio.c
+++ b/drivers/char/hvc_vio.c
@@ -35,6 +35,7 @@ #include <linux/init.h>
 #include <asm/hvconsole.h>
 #include <asm/vio.h>
 #include <asm/prom.h>
+#include <asm/firmware.h>
 
 #include "hvc_console.h"
 
@@ -120,6 +121,9 @@ static int hvc_vio_init(void)
 {
 	int rc;
 
+	if (firmware_has_feature(FW_FEATURE_ISERIES))
+		return -EIO;
+
 	/* Register as a vio device to receive callbacks */
 	rc = vio_register_driver(&hvc_vio_driver);
 
-- 
1.4.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/7] [POWERPC] modify PCI code for a merged kernel
  2006-09-26  3:35 ` [PATCH 2/7] [POWERPC] The two vio HVC backends clash Stephen Rothwell
@ 2006-09-26  3:36   ` Stephen Rothwell
  2006-09-26  3:37     ` [PATCH 4/7] [POWERPC] fix ioremap for a combined kernel Stephen Rothwell
  2006-10-04  8:02     ` [PATCH 3/7] [POWERPC] modify PCI code for a merged kernel Benjamin Herrenschmidt
  2006-09-26  5:10   ` [PATCH 2/7] [POWERPC] The two vio HVC backends clash Olof Johansson
  1 sibling, 2 replies; 14+ messages in thread
From: Stephen Rothwell @ 2006-09-26  3:36 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/kernel/pci_64.c         |   58 ++++++++++++++++++----------------
 arch/powerpc/platforms/iseries/pci.c |    4 --
 2 files changed, 30 insertions(+), 32 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index c1b1e14..78d3c0f 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -30,6 +30,7 @@ #include <asm/pci-bridge.h>
 #include <asm/byteorder.h>
 #include <asm/machdep.h>
 #include <asm/ppc-pci.h>
+#include <asm/firmware.h>
 
 #ifdef DEBUG
 #include <asm/udbg.h>
@@ -209,7 +210,6 @@ void pcibios_free_controller(struct pci_
 		kfree(phb);
 }
 
-#ifndef CONFIG_PPC_ISERIES
 void __devinit pcibios_claim_one_bus(struct pci_bus *b)
 {
 	struct pci_dev *dev;
@@ -238,10 +238,12 @@ static void __init pcibios_claim_of_setu
 {
 	struct pci_bus *b;
 
+	if (firmware_has_feature(FW_FEATURE_ISERIES))
+		return;
+
 	list_for_each_entry(b, &pci_root_buses, node)
 		pcibios_claim_one_bus(b);
 }
-#endif
 
 #ifdef CONFIG_PPC_MULTIPLATFORM
 static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
@@ -554,9 +556,8 @@ static int __init pcibios_init(void)
 	 */
 	ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
 
-#ifdef CONFIG_PPC_ISERIES
-	iSeries_pcibios_init(); 
-#endif
+	if (firmware_has_feature(FW_FEATURE_ISERIES))
+		iSeries_pcibios_init();
 
 	printk(KERN_DEBUG "PCI: Probing PCI hardware\n");
 
@@ -566,15 +567,15 @@ #endif
 		pci_bus_add_devices(hose->bus);
 	}
 
-#ifndef CONFIG_PPC_ISERIES
-	if (pci_probe_only)
-		pcibios_claim_of_setup();
-	else
-		/* FIXME: `else' will be removed when
-		   pci_assign_unassigned_resources() is able to work
-		   correctly with [partially] allocated PCI tree. */
-		pci_assign_unassigned_resources();
-#endif /* !CONFIG_PPC_ISERIES */
+	if (!firmware_has_feature(FW_FEATURE_ISERIES)) {
+		if (pci_probe_only)
+			pcibios_claim_of_setup();
+		else
+			/* FIXME: `else' will be removed when
+			   pci_assign_unassigned_resources() is able to work
+			   correctly with [partially] allocated PCI tree. */
+			pci_assign_unassigned_resources();
+	}
 
 	/* Call machine dependent final fixup */
 	if (ppc_md.pcibios_fixup)
@@ -586,8 +587,9 @@ #endif /* !CONFIG_PPC_ISERIES */
 		printk(KERN_DEBUG "ISA bridge at %s\n", pci_name(ppc64_isabridge_dev));
 
 #ifdef CONFIG_PPC_MULTIPLATFORM
-	/* map in PCI I/O space */
-	phbs_remap_io();
+	if (!firmware_has_feature(FW_FEATURE_ISERIES))
+		/* map in PCI I/O space */
+		phbs_remap_io();
 #endif
 
 	printk(KERN_DEBUG "PCI: Probing PCI hardware done\n");
@@ -637,13 +639,13 @@ int pcibios_enable_device(struct pci_dev
  */
 int pci_domain_nr(struct pci_bus *bus)
 {
-#ifdef CONFIG_PPC_ISERIES
-	return 0;
-#else
-	struct pci_controller *hose = pci_bus_to_host(bus);
+	if (firmware_has_feature(FW_FEATURE_ISERIES))
+		return 0;
+	else {
+		struct pci_controller *hose = pci_bus_to_host(bus);
 
-	return hose->global_number;
-#endif
+		return hose->global_number;
+	}
 }
 
 EXPORT_SYMBOL(pci_domain_nr);
@@ -651,12 +653,12 @@ EXPORT_SYMBOL(pci_domain_nr);
 /* Decide whether to display the domain number in /proc */
 int pci_proc_domain(struct pci_bus *bus)
 {
-#ifdef CONFIG_PPC_ISERIES
-	return 0;
-#else
-	struct pci_controller *hose = pci_bus_to_host(bus);
-	return hose->buid;
-#endif
+	if (firmware_has_feature(FW_FEATURE_ISERIES))
+		return 0;
+	else {
+		struct pci_controller *hose = pci_bus_to_host(bus);
+		return hose->buid;
+	}
 }
 
 /*
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 3eb1206..e904b36 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -262,10 +262,6 @@ void __init iSeries_pci_final_fixup(void
 	mf_display_src(0xC9000200);
 }
 
-void pcibios_fixup_bus(struct pci_bus *PciBus)
-{
-}
-
 void pcibios_fixup_resources(struct pci_dev *pdev)
 {
 }
-- 
1.4.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/7] [POWERPC] fix ioremap for a combined kernel
  2006-09-26  3:36   ` [PATCH 3/7] [POWERPC] modify PCI code for a merged kernel Stephen Rothwell
@ 2006-09-26  3:37     ` Stephen Rothwell
  2006-09-26  3:39       ` [PATCH 5/7] [POWERPC] Allow combined iSeries and MULTIPLATFORM build Stephen Rothwell
  2006-10-04  8:02     ` [PATCH 3/7] [POWERPC] modify PCI code for a merged kernel Benjamin Herrenschmidt
  1 sibling, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2006-09-26  3:37 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/mm/pgtable_64.c |   29 +++++++----------------------
 1 files changed, 7 insertions(+), 22 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index b1da031..ac64f4a 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -63,32 +63,13 @@ #include <asm/system.h>
 #include <asm/iommu.h>
 #include <asm/abs_addr.h>
 #include <asm/vdso.h>
+#include <asm/firmware.h>
 
 #include "mmu_decl.h"
 
 unsigned long ioremap_bot = IMALLOC_BASE;
 static unsigned long phbs_io_bot = PHBS_IO_BASE;
 
-#ifdef CONFIG_PPC_ISERIES
-
-void __iomem *ioremap(unsigned long addr, unsigned long size)
-{
-	return (void __iomem *)addr;
-}
-
-extern void __iomem *__ioremap(unsigned long addr, unsigned long size,
-		       unsigned long flags)
-{
-	return (void __iomem *)addr;
-}
-
-void iounmap(volatile void __iomem *addr)
-{
-	return;
-}
-
-#else
-
 /*
  * map_io_page currently only called by __ioremap
  * map_io_page adds an entry to the ioremap page table
@@ -161,6 +142,9 @@ void __iomem * __ioremap(unsigned long a
 	unsigned long pa, ea;
 	void __iomem *ret;
 
+	if (firmware_has_feature(FW_FEATURE_ISERIES))
+		return (void __iomem *)addr;
+
 	/*
 	 * Choose an address to map it to.
 	 * Once the imalloc system is running, we use it.
@@ -255,6 +239,9 @@ void iounmap(volatile void __iomem *toke
 {
 	void *addr;
 
+	if (firmware_has_feature(FW_FEATURE_ISERIES))
+		return;
+
 	if (!mem_init_done)
 		return;
 	
@@ -315,8 +302,6 @@ int iounmap_explicit(volatile void __iom
 	return 0;
 }
 
-#endif
-
 EXPORT_SYMBOL(ioremap);
 EXPORT_SYMBOL(__ioremap);
 EXPORT_SYMBOL(iounmap);
-- 
1.4.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 5/7] [POWERPC] Allow combined iSeries and MULTIPLATFORM build
  2006-09-26  3:37     ` [PATCH 4/7] [POWERPC] fix ioremap for a combined kernel Stephen Rothwell
@ 2006-09-26  3:39       ` Stephen Rothwell
  2006-09-26  3:40         ` [PATCH 6/7] [POWERPC] iSeries does not need pcibios_fixup_resources Stephen Rothwell
  2006-10-02 10:25         ` [PATCH 5/7] [POWERPC] Allow combined iSeries and MULTIPLATFORM build Paul Mackerras
  0 siblings, 2 replies; 14+ messages in thread
From: Stephen Rothwell @ 2006-09-26  3:39 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev

This will build with ISERIES, PSERIES and PMAC64 selected, but will only
boot on iSeries so far.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/Kconfig |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index de1ef2f..a715b28 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -328,20 +328,10 @@ menu "Platform support"
 	depends on PPC64 || CLASSIC32
 
 choice
+	depends on PPC32
 	prompt "Machine type"
 	default PPC_MULTIPLATFORM
 
-config PPC_MULTIPLATFORM
-	bool "Generic desktop/server/laptop"
-	help
-	  Select this option if configuring for an IBM pSeries or
-	  RS/6000 machine, an Apple machine, or a PReP, CHRP,
-	  Maple or Cell-based machine.
-
-config PPC_ISERIES
-	bool "IBM Legacy iSeries"
-	depends on PPC64
-
 config EMBEDDED6xx
 	bool "Embedded 6xx/7xx/7xxx-based board"
 	depends on PPC32 && (BROKEN||BROKEN_ON_SMP)
@@ -355,6 +345,10 @@ config APUS
 	  <http://linux-apus.sourceforge.net/>.
 endchoice
 
+config PPC_MULTIPLATFORM
+	depends on PPC64
+	def_bool y
+
 config PPC_PSERIES
 	depends on PPC_MULTIPLATFORM && PPC64
 	bool "IBM pSeries & new (POWER5-based) iSeries"
@@ -365,6 +359,10 @@ config PPC_PSERIES
 	select PPC_UDBG_16550
 	default y
 
+config PPC_ISERIES
+	bool "IBM Legacy iSeries"
+	depends on PPC_MULTIPLATFORM && PPC64
+
 config PPC_CHRP
 	bool "Common Hardware Reference Platform (CHRP) based machines"
 	depends on PPC_MULTIPLATFORM && PPC32
-- 
1.4.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 6/7] [POWERPC] iSeries does not need pcibios_fixup_resources
  2006-09-26  3:39       ` [PATCH 5/7] [POWERPC] Allow combined iSeries and MULTIPLATFORM build Stephen Rothwell
@ 2006-09-26  3:40         ` Stephen Rothwell
  2006-09-26  3:42           ` [PATCH 7/7] [POWERPC] implement BEGIN/END_FW_FTR_SECTION Stephen Rothwell
  2006-10-02 10:25         ` [PATCH 5/7] [POWERPC] Allow combined iSeries and MULTIPLATFORM build Paul Mackerras
  1 sibling, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2006-09-26  3:40 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/platforms/iseries/pci.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index e904b36..4aa165e 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -262,10 +262,6 @@ void __init iSeries_pci_final_fixup(void
 	mf_display_src(0xC9000200);
 }
 
-void pcibios_fixup_resources(struct pci_dev *pdev)
-{
-}
-
 /*
  * Look down the chain to find the matching Device Device
  */
-- 
1.4.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 7/7] [POWERPC] implement BEGIN/END_FW_FTR_SECTION
  2006-09-26  3:40         ` [PATCH 6/7] [POWERPC] iSeries does not need pcibios_fixup_resources Stephen Rothwell
@ 2006-09-26  3:42           ` Stephen Rothwell
  2006-10-04  7:58             ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2006-09-26  3:42 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev

and use it an all the obvious places in assembler code.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/kernel/entry_64.S    |   18 +++++++---
 arch/powerpc/kernel/head_64.S     |   28 ++++++++++++++-
 arch/powerpc/kernel/misc_64.S     |   46 +++++++++++++++++++++++++
 arch/powerpc/kernel/vmlinux.lds.S |    8 ++++
 arch/powerpc/mm/slb_low.S         |    3 ++
 include/asm-powerpc/firmware.h    |   67 ++++++++++++++++++++++++-------------
 6 files changed, 137 insertions(+), 33 deletions(-)

This has been booted as a combined kernel on iSeries (and also as just an
iSeries build).
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 2cd872b..748e74f 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -27,10 +27,7 @@ #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
 #include <asm/cputable.h>
-
-#ifdef CONFIG_PPC_ISERIES
-#define DO_SOFT_DISABLE
-#endif
+#include <asm/firmware.h>
 
 /*
  * System calls.
@@ -91,6 +88,7 @@ system_call_common:
 	ld	r11,exception_marker@toc(r2)
 	std	r11,-16(r9)		/* "regshere" marker */
 #ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
 	/* Hack for handling interrupts when soft-enabling on iSeries */
 	cmpdi	cr1,r0,0x5555		/* syscall 0x5555 */
 	andi.	r10,r12,MSR_PR		/* from kernel */
@@ -98,6 +96,7 @@ #ifdef CONFIG_PPC_ISERIES
 	beq	hardware_interrupt_entry
 	lbz	r10,PACAPROCENABLED(r13)
 	std	r10,SOFTE(r1)
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif
 	mfmsr	r11
 	ori	r11,r11,MSR_EE
@@ -462,6 +461,7 @@ #endif
 
 restore:
 #ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
 	ld	r5,SOFTE(r1)
 	cmpdi	0,r5,0
 	beq	4f
@@ -480,6 +480,7 @@ #ifdef CONFIG_PPC_ISERIES
 	b	.ret_from_except_lite		/* loop back and handle more */
 
 4:	stb	r5,PACAPROCENABLED(r13)
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif
 
 	ld	r3,_MSR(r1)
@@ -538,18 +539,23 @@ #ifdef CONFIG_PREEMPT
 	lwz	r8,TI_PREEMPT(r9)
 	cmpwi	cr1,r8,0
 #ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
 	ld	r0,SOFTE(r1)
 	cmpdi	r0,0
-#else
-	andi.	r0,r3,MSR_EE
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif
+BEGIN_FW_FTR_SECTION
+	andi.	r0,r3,MSR_EE
+END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
 	crandc	eq,cr1*4+eq,eq
 	bne	restore
 	/* here we are preempting the current task */
 1:
 #ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
 	li	r0,1
 	stb	r0,PACAPROCENABLED(r13)
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif
 	ori	r10,r10,MSR_EE
 	mtmsrd	r10,1		/* reenable interrupts */
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 3065b47..645c7f1 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -33,6 +33,7 @@ #include <asm/setup.h>
 #include <asm/hvcall.h>
 #include <asm/iseries/lpar_map.h>
 #include <asm/thread_info.h>
+#include <asm/firmware.h>
 
 #ifdef CONFIG_PPC_ISERIES
 #define DO_SOFT_DISABLE
@@ -365,19 +366,28 @@ label##_iSeries:							\
 
 #ifdef DO_SOFT_DISABLE
 #define DISABLE_INTS				\
+BEGIN_FW_FTR_SECTION;				\
 	lbz	r10,PACAPROCENABLED(r13);	\
 	li	r11,0;				\
 	std	r10,SOFTE(r1);			\
 	mfmsr	r10;				\
 	stb	r11,PACAPROCENABLED(r13);	\
 	ori	r10,r10,MSR_EE;			\
-	mtmsrd	r10,1
+	mtmsrd	r10,1;				\
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 
 #define ENABLE_INTS				\
+BEGIN_FW_FTR_SECTION;				\
 	lbz	r10,PACAPROCENABLED(r13);	\
 	mfmsr	r11;				\
 	std	r10,SOFTE(r1);			\
 	ori	r11,r11,MSR_EE;			\
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES);	\
+BEGIN_FW_FTR_SECTION;				\
+	ld	r12,_MSR(r1);			\
+	mfmsr	r11;				\
+	rlwimi	r11,r12,0,MSR_EE;		\
+END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES);	\
 	mtmsrd	r11,1
 
 #else	/* hard enable/disable interrupts */
@@ -1071,8 +1081,10 @@ _GLOBAL(slb_miss_realmode)
 	ld	r3,PACA_EXSLB+EX_R3(r13)
 	lwz	r9,PACA_EXSLB+EX_CCR(r13)	/* get saved CR */
 #ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
 	ld	r11,PACALPPACAPTR(r13)
 	ld	r11,LPPACASRR0(r11)		/* get SRR0 value */
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif /* CONFIG_PPC_ISERIES */
 
 	mtlr	r10
@@ -1087,8 +1099,10 @@ #endif /* CONFIG_PPC_ISERIES */
 .machine	pop
 
 #ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
 	mtspr	SPRN_SRR0,r11
 	mtspr	SPRN_SRR1,r12
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif /* CONFIG_PPC_ISERIES */
 	ld	r9,PACA_EXSLB+EX_R9(r13)
 	ld	r10,PACA_EXSLB+EX_R10(r13)
@@ -1301,6 +1315,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
 	cmpdi	r3,0			/* see if hash_page succeeded */
 
 #ifdef DO_SOFT_DISABLE
+BEGIN_FW_FTR_SECTION
 	/*
 	 * If we had interrupts soft-enabled at the point where the
 	 * DSI/ISI occurred, and an interrupt came in during hash_page,
@@ -1321,12 +1336,14 @@ #ifdef DO_SOFT_DISABLE
 	ld	r3,SOFTE(r1)
 	bl	.local_irq_restore
 	b	11f
-#else
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
+#endif
+BEGIN_FW_FTR_SECTION
 	beq	fast_exception_return   /* Return from exception on success */
 	ble-	12f			/* Failure return from hash_page */
 
 	/* fall through */
-#endif
+END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
 
 /* Here we have a page fault that hash_page can't handle. */
 _GLOBAL(handle_page_fault)
@@ -1861,7 +1878,9 @@ _GLOBAL(__secondary_start)
 	LOAD_REG_ADDR(r3, .start_secondary_prolog)
 	LOAD_REG_IMMEDIATE(r4, MSR_KERNEL)
 #ifdef DO_SOFT_DISABLE
+BEGIN_FW_FTR_SECTION
 	ori	r4,r4,MSR_EE
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif
 	mtspr	SPRN_SRR0,r3
 	mtspr	SPRN_SRR1,r4
@@ -1986,6 +2005,7 @@ _STATIC(start_here_common)
 	 */
 	li	r3,0
 	bl	.do_cpu_ftr_fixups
+	bl	.do_fw_ftr_fixups
 
 	/* ptr to current */
 	LOAD_REG_IMMEDIATE(r4, init_task)
@@ -2000,11 +2020,13 @@ _STATIC(start_here_common)
 	/* Load up the kernel context */
 5:
 #ifdef DO_SOFT_DISABLE
+BEGIN_FW_FTR_SECTION
 	li	r5,0
 	stb	r5,PACAPROCENABLED(r13)	/* Soft Disabled */
 	mfmsr	r5
 	ori	r5,r5,MSR_EE		/* Hard Enabled */
 	mtmsrd	r5
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif
 
 	bl .start_kernel
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index e3ed21c..465a764 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -325,6 +325,52 @@ _GLOBAL(do_cpu_ftr_fixups)
 	isync
 	b	1b
 
+/*
+ * do_fw_ftr_fixups - goes through the list of firmware feature fixups
+ * and writes nop's over sections of code that don't apply for this firmware.
+ * r3 = data offset (not changed)
+ */
+_GLOBAL(do_fw_ftr_fixups)
+	/* Get firmware features */
+	LOAD_REG_IMMEDIATE(r6,powerpc_firmware_features)
+	sub	r6,r6,r3
+	ld	r4,0(r6)
+	/* Get the fixup table */
+	LOAD_REG_IMMEDIATE(r6,__start___fw_ftr_fixup)
+	sub	r6,r6,r3
+	LOAD_REG_IMMEDIATE(r7,__stop___fw_ftr_fixup)
+	sub	r7,r7,r3
+	/* Do the fixup */
+1:	cmpld	r6,r7
+	bgelr
+	addi	r6,r6,32
+	ld	r8,-32(r6)	/* mask */
+	and	r8,r8,r4
+	ld	r9,-24(r6)	/* value */
+	cmpld	r8,r9
+	beq	1b
+	ld	r8,-16(r6)	/* section begin */
+	ld	r9,-8(r6)	/* section end */
+	subf.	r9,r8,r9
+	beq	1b
+	/* write nops over the section of code */
+	/* todo: if large section, add a branch at the start of it */
+	srwi	r9,r9,2
+	mtctr	r9
+	sub	r8,r8,r3
+	lis	r0,0x60000000@h	/* nop */
+3:	stw	r0,0(r8)
+BEGIN_FTR_SECTION
+	dcbst	0,r8		/* suboptimal, but simpler */
+	sync
+	icbi	0,r8
+END_FTR_SECTION_IFSET(CPU_FTR_SPLIT_ID_CACHE)
+	addi	r8,r8,4
+	bdnz	3b
+	sync			/* additional sync needed on g4 */
+	isync
+	b	1b
+
 #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE)
 /*
  * Do an IO access in real mode
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 02665a0..cb0e8d4 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -132,6 +132,14 @@ #endif
 		*(__ftr_fixup)
 		__stop___ftr_fixup = .;
 	}
+#ifdef CONFIG_PPC64
+	. = ALIGN(8);
+	__fw_ftr_fixup : {
+		__start___fw_ftr_fixup = .;
+		*(__fw_ftr_fixup)
+		__stop___fw_ftr_fixup = .;
+	}
+#endif
 
 	. = ALIGN(PAGE_SIZE);
 	.init.ramfs : {
diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
index dbc1abb..b10e470 100644
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -21,6 +21,7 @@ #include <asm/cputable.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
 #include <asm/pgtable.h>
+#include <asm/firmware.h>
 
 /* void slb_allocate_realmode(unsigned long ea);
  *
@@ -183,6 +184,7 @@ slb_finish_load:
  	 * dont have any LRU information to help us choose a slot.
  	 */
 #ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
 	/*
 	 * On iSeries, the "bolted" stack segment can be cast out on
 	 * shared processor switch so we need to check for a miss on
@@ -194,6 +196,7 @@ #ifdef CONFIG_PPC_ISERIES
 	li	r10,SLB_NUM_BOLTED-1	/* Stack goes in last bolted slot */
 	cmpld	r9,r3
 	beq	3f
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif /* CONFIG_PPC_ISERIES */
 
 	ld	r10,PACASTABRR(r13)
diff --git a/include/asm-powerpc/firmware.h b/include/asm-powerpc/firmware.h
index 77069df..1022737 100644
--- a/include/asm-powerpc/firmware.h
+++ b/include/asm-powerpc/firmware.h
@@ -14,34 +14,36 @@ #define __ASM_POWERPC_FIRMWARE_H
 
 #ifdef __KERNEL__
 
-#ifndef __ASSEMBLY__
+#include <asm/asm-compat.h>
 
 /* firmware feature bitmask values */
 #define FIRMWARE_MAX_FEATURES 63
 
-#define FW_FEATURE_PFT		(1UL<<0)
-#define FW_FEATURE_TCE		(1UL<<1)
-#define FW_FEATURE_SPRG0	(1UL<<2)
-#define FW_FEATURE_DABR		(1UL<<3)
-#define FW_FEATURE_COPY		(1UL<<4)
-#define FW_FEATURE_ASR		(1UL<<5)
-#define FW_FEATURE_DEBUG	(1UL<<6)
-#define FW_FEATURE_TERM		(1UL<<7)
-#define FW_FEATURE_PERF		(1UL<<8)
-#define FW_FEATURE_DUMP		(1UL<<9)
-#define FW_FEATURE_INTERRUPT	(1UL<<10)
-#define FW_FEATURE_MIGRATE	(1UL<<11)
-#define FW_FEATURE_PERFMON	(1UL<<12)
-#define FW_FEATURE_CRQ		(1UL<<13)
-#define FW_FEATURE_VIO		(1UL<<14)
-#define FW_FEATURE_RDMA		(1UL<<15)
-#define FW_FEATURE_LLAN		(1UL<<16)
-#define FW_FEATURE_BULK		(1UL<<17)
-#define FW_FEATURE_XDABR	(1UL<<18)
-#define FW_FEATURE_MULTITCE	(1UL<<19)
-#define FW_FEATURE_SPLPAR	(1UL<<20)
-#define FW_FEATURE_ISERIES	(1UL<<21)
-#define FW_FEATURE_LPAR		(1UL<<22)
+#define FW_FEATURE_PFT		ASM_CONST(0x0000000000000001)
+#define FW_FEATURE_TCE		ASM_CONST(0x0000000000000002)
+#define FW_FEATURE_SPRG0	ASM_CONST(0x0000000000000004)
+#define FW_FEATURE_DABR		ASM_CONST(0x0000000000000008)
+#define FW_FEATURE_COPY		ASM_CONST(0x0000000000000010)
+#define FW_FEATURE_ASR		ASM_CONST(0x0000000000000020)
+#define FW_FEATURE_DEBUG	ASM_CONST(0x0000000000000040)
+#define FW_FEATURE_TERM		ASM_CONST(0x0000000000000080)
+#define FW_FEATURE_PERF		ASM_CONST(0x0000000000000100)
+#define FW_FEATURE_DUMP		ASM_CONST(0x0000000000000200)
+#define FW_FEATURE_INTERRUPT	ASM_CONST(0x0000000000000400)
+#define FW_FEATURE_MIGRATE	ASM_CONST(0x0000000000000800)
+#define FW_FEATURE_PERFMON	ASM_CONST(0x0000000000001000)
+#define FW_FEATURE_CRQ		ASM_CONST(0x0000000000002000)
+#define FW_FEATURE_VIO		ASM_CONST(0x0000000000004000)
+#define FW_FEATURE_RDMA		ASM_CONST(0x0000000000008000)
+#define FW_FEATURE_LLAN		ASM_CONST(0x0000000000010000)
+#define FW_FEATURE_BULK		ASM_CONST(0x0000000000020000)
+#define FW_FEATURE_XDABR	ASM_CONST(0x0000000000040000)
+#define FW_FEATURE_MULTITCE	ASM_CONST(0x0000000000080000)
+#define FW_FEATURE_SPLPAR	ASM_CONST(0x0000000000100000)
+#define FW_FEATURE_ISERIES	ASM_CONST(0x0000000000200000)
+#define FW_FEATURE_LPAR		ASM_CONST(0x0000000000400000)
+
+#ifndef __ASSEMBLY__
 
 enum {
 #ifdef CONFIG_PPC64
@@ -94,6 +96,23 @@ extern void machine_check_fwnmi(void);
 /* This is true if we are using the firmware NMI handler (typically LPAR) */
 extern int fwnmi_active;
 
+#else /* __ASSEMBLY__ */
+
+#define BEGIN_FW_FTR_SECTION		96:
+
+#define END_FW_FTR_SECTION(msk, val)		\
+97:						\
+	.section __fw_ftr_fixup,"a";		\
+	.align 3;				\
+	.llong msk;				\
+	.llong val;				\
+	.llong 96b;				\
+	.llong 97b;				\
+	.previous
+
+#define END_FW_FTR_SECTION_IFSET(msk)	END_FW_FTR_SECTION((msk), (msk))
+#define END_FW_FTR_SECTION_IFCLR(msk)	END_FW_FTR_SECTION((msk), 0)
+
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* __ASM_POWERPC_FIRMWARE_H */
-- 
1.4.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/7] [POWERPC] The two vio HVC backends clash
  2006-09-26  3:35 ` [PATCH 2/7] [POWERPC] The two vio HVC backends clash Stephen Rothwell
  2006-09-26  3:36   ` [PATCH 3/7] [POWERPC] modify PCI code for a merged kernel Stephen Rothwell
@ 2006-09-26  5:10   ` Olof Johansson
  1 sibling, 0 replies; 14+ messages in thread
From: Olof Johansson @ 2006-09-26  5:10 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: ppc-dev, paulus

On Tue, 26 Sep 2006 13:35:48 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c
> index 4747729..ea36201 100644
> --- a/drivers/char/hvc_iseries.c
> +++ b/drivers/char/hvc_iseries.c
> @@ -29,6 +29,7 @@ #include <linux/console.h>
>  #include <asm/hvconsole.h>
>  #include <asm/vio.h>
>  #include <asm/prom.h>
> +#include <asm/firmware.h>
>  #include <asm/iseries/vio.h>
>  #include <asm/iseries/hv_call.h>
>  #include <asm/iseries/hv_lp_config.h>
> @@ -493,6 +494,9 @@ static int hvc_vio_init(void)
>  	atomic_t wait_flag;
>  	int rc;
>  
> +	if (!firmware_has_feature(FW_FEATURE_ISERIES))
> +		return -EIO;
> +

Shouldn't this be -ENODEV?


-Olof

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 5/7] [POWERPC] Allow combined iSeries and MULTIPLATFORM build
  2006-09-26  3:39       ` [PATCH 5/7] [POWERPC] Allow combined iSeries and MULTIPLATFORM build Stephen Rothwell
  2006-09-26  3:40         ` [PATCH 6/7] [POWERPC] iSeries does not need pcibios_fixup_resources Stephen Rothwell
@ 2006-10-02 10:25         ` Paul Mackerras
  2006-10-04  4:58           ` Stephen Rothwell
  1 sibling, 1 reply; 14+ messages in thread
From: Paul Mackerras @ 2006-10-02 10:25 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: ppc-dev

Stephen Rothwell writes:

> -config PPC_MULTIPLATFORM
> -	bool "Generic desktop/server/laptop"
> -	help
> -	  Select this option if configuring for an IBM pSeries or
> -	  RS/6000 machine, an Apple machine, or a PReP, CHRP,
> -	  Maple or Cell-based machine.

What have you got against my powerbook? :P

With this patch, I only get the option of building an EMBEDDED6xx
kernel - PPC_MULTIPLATFORM has disappeared for 32-bit, and the 32-bit
powermac kernel build with it.

Paul.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 5/7] [POWERPC] Allow combined iSeries and MULTIPLATFORM build
  2006-10-02 10:25         ` [PATCH 5/7] [POWERPC] Allow combined iSeries and MULTIPLATFORM build Paul Mackerras
@ 2006-10-04  4:58           ` Stephen Rothwell
  0 siblings, 0 replies; 14+ messages in thread
From: Stephen Rothwell @ 2006-10-04  4:58 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: ppc-dev

On Mon, 2 Oct 2006 20:25:38 +1000 Paul Mackerras <paulus@samba.org> wrote:
>
> What have you got against my powerbook? :P
> 
> With this patch, I only get the option of building an EMBEDDED6xx
> kernel - PPC_MULTIPLATFORM has disappeared for 32-bit, and the 32-bit
> powermac kernel build with it.

Sorry about that, how about the patch below instead.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

This will build with ISERIES, PSERIES and PMAC64 selected, but will only
boot on iSeries so far.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/Kconfig |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index de1ef2f..0969fe8 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -338,10 +338,6 @@ config PPC_MULTIPLATFORM
 	  RS/6000 machine, an Apple machine, or a PReP, CHRP,
 	  Maple or Cell-based machine.
 
-config PPC_ISERIES
-	bool "IBM Legacy iSeries"
-	depends on PPC64
-
 config EMBEDDED6xx
 	bool "Embedded 6xx/7xx/7xxx-based board"
 	depends on PPC32 && (BROKEN||BROKEN_ON_SMP)
@@ -365,6 +361,10 @@ config PPC_PSERIES
 	select PPC_UDBG_16550
 	default y
 
+config PPC_ISERIES
+	bool "IBM Legacy iSeries"
+	depends on PPC_MULTIPLATFORM && PPC64
+
 config PPC_CHRP
 	bool "Common Hardware Reference Platform (CHRP) based machines"
 	depends on PPC_MULTIPLATFORM && PPC32
-- 
1.4.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 7/7] [POWERPC] implement BEGIN/END_FW_FTR_SECTION
  2006-09-26  3:42           ` [PATCH 7/7] [POWERPC] implement BEGIN/END_FW_FTR_SECTION Stephen Rothwell
@ 2006-10-04  7:58             ` Benjamin Herrenschmidt
  2006-10-04  8:26               ` Stephen Rothwell
  0 siblings, 1 reply; 14+ messages in thread
From: Benjamin Herrenschmidt @ 2006-10-04  7:58 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: ppc-dev, paulus


> +/*
> + * do_fw_ftr_fixups - goes through the list of firmware feature fixups
> + * and writes nop's over sections of code that don't apply for this firmware.
> + * r3 = data offset (not changed)
> + */
> +_GLOBAL(do_fw_ftr_fixups)
> +	/* Get firmware features */
> +	LOAD_REG_IMMEDIATE(r6,powerpc_firmware_features)
> +	sub	r6,r6,r3
> +	ld	r4,0(r6)
> +	/* Get the fixup table */
> +	LOAD_REG_IMMEDIATE(r6,__start___fw_ftr_fixup)
> +	sub	r6,r6,r3
> +	LOAD_REG_IMMEDIATE(r7,__stop___fw_ftr_fixup)
> +	sub	r7,r7,r3
> +	/* Do the fixup */
> +1:	cmpld	r6,r7
> +	bgelr

 .../...

I'd rather have a single apply_ftr_fixups() that takes the start/stop of
the fixup table and the value to compare against. That could then be
called for fw fixups at boot, fw fixups from modules, cpu fixups at
boot, cpu fixups from modules, and possibly fixups in the vdso's is a
feature I've been thinking of, and which would be easier with just a
single function like that.

Ben.
 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/7] [POWERPC] modify PCI code for a merged kernel
  2006-09-26  3:36   ` [PATCH 3/7] [POWERPC] modify PCI code for a merged kernel Stephen Rothwell
  2006-09-26  3:37     ` [PATCH 4/7] [POWERPC] fix ioremap for a combined kernel Stephen Rothwell
@ 2006-10-04  8:02     ` Benjamin Herrenschmidt
  1 sibling, 0 replies; 14+ messages in thread
From: Benjamin Herrenschmidt @ 2006-10-04  8:02 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: ppc-dev, paulus

On Tue, 2006-09-26 at 13:36 +1000, Stephen Rothwell wrote:
> -#ifndef CONFIG_PPC_ISERIES
>  void __devinit pcibios_claim_one_bus(struct pci_bus *b)
>  {
>  	struct pci_dev *dev;
> @@ -238,10 +238,12 @@ static void __init pcibios_claim_of_setu
>  {
>  	struct pci_bus *b;
>  
> +	if (firmware_has_feature(FW_FEATURE_ISERIES))
> +		return;
> +
>  	list_for_each_entry(b, &pci_root_buses, node)
>  		pcibios_claim_one_bus(b);
>  }
> -#endif

Is the above actually needed ? That is, what kind of problem iseries
would expect if pcibios_claim_one_bus() was called ?

>  #ifdef CONFIG_PPC_MULTIPLATFORM
>  static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
> @@ -554,9 +556,8 @@ static int __init pcibios_init(void)
>  	 */
>  	ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
>  
> -#ifdef CONFIG_PPC_ISERIES
> -	iSeries_pcibios_init(); 
> -#endif
> +	if (firmware_has_feature(FW_FEATURE_ISERIES))
> +		iSeries_pcibios_init();

Why not do like all other platforms and allocate create the PHBs
setup_arch ? That would avoid an iSeries specific call in generic code.

>  	printk(KERN_DEBUG "PCI: Probing PCI hardware\n");
>  
> @@ -566,15 +567,15 @@ #endif
>  		pci_bus_add_devices(hose->bus);
>  	}
>  
> -#ifndef CONFIG_PPC_ISERIES
> -	if (pci_probe_only)
> -		pcibios_claim_of_setup();
> -	else
> -		/* FIXME: `else' will be removed when
> -		   pci_assign_unassigned_resources() is able to work
> -		   correctly with [partially] allocated PCI tree. */
> -		pci_assign_unassigned_resources();
> -#endif /* !CONFIG_PPC_ISERIES */
> +	if (!firmware_has_feature(FW_FEATURE_ISERIES)) {
> +		if (pci_probe_only)
> +			pcibios_claim_of_setup();
> +		else
> +			/* FIXME: `else' will be removed when
> +			   pci_assign_unassigned_resources() is able to work
> +			   correctly with [partially] allocated PCI tree. */
> +			pci_assign_unassigned_resources();
> +	}

What happens if you don't do the above and set pci_probe_only to 1 ?

>  	/* Call machine dependent final fixup */
>  	if (ppc_md.pcibios_fixup)
> @@ -586,8 +587,9 @@ #endif /* !CONFIG_PPC_ISERIES */
>  		printk(KERN_DEBUG "ISA bridge at %s\n", pci_name(ppc64_isabridge_dev));
>  
>  #ifdef CONFIG_PPC_MULTIPLATFORM
> -	/* map in PCI I/O space */
> -	phbs_remap_io();
> +	if (!firmware_has_feature(FW_FEATURE_ISERIES))
> +		/* map in PCI I/O space */
> +		phbs_remap_io();
>  #endif

IO space mapping is dodgy with iSeries... I suppose that is correct for
now though we might want to do something a bit nastier like actually
mapping it to unaccessible memory and SEGV'ing on access or stuff like
that if IO is really not supported....

>  	printk(KERN_DEBUG "PCI: Probing PCI hardware done\n");
> @@ -637,13 +639,13 @@ int pcibios_enable_device(struct pci_dev
>   */
>  int pci_domain_nr(struct pci_bus *bus)
>  {
> -#ifdef CONFIG_PPC_ISERIES
> -	return 0;
> -#else
> -	struct pci_controller *hose = pci_bus_to_host(bus);
> +	if (firmware_has_feature(FW_FEATURE_ISERIES))
> +		return 0;
> +	else {
> +		struct pci_controller *hose = pci_bus_to_host(bus);
>  
> -	return hose->global_number;
> -#endif
> +		return hose->global_number;
> +	}
>  }

Any reason why the above is useful at all ? Especially since it seems
you -can- have multiple busses and thus -want- the domain numbers to be
exposed.
 
>  EXPORT_SYMBOL(pci_domain_nr);
> @@ -651,12 +653,12 @@ EXPORT_SYMBOL(pci_domain_nr);
>  /* Decide whether to display the domain number in /proc */
>  int pci_proc_domain(struct pci_bus *bus)
>  {
> -#ifdef CONFIG_PPC_ISERIES
> -	return 0;
> -#else
> -	struct pci_controller *hose = pci_bus_to_host(bus);
> -	return hose->buid;
> -#endif
> +	if (firmware_has_feature(FW_FEATURE_ISERIES))
> +		return 0;
> +	else {
> +		struct pci_controller *hose = pci_bus_to_host(bus);
> +		return hose->buid;
> +	}
>  }

Same question. Why do that at all ?
 
Cheers,
Ben.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 7/7] [POWERPC] implement BEGIN/END_FW_FTR_SECTION
  2006-10-04  7:58             ` Benjamin Herrenschmidt
@ 2006-10-04  8:26               ` Stephen Rothwell
  2006-10-04 10:08                 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2006-10-04  8:26 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: ppc-dev, paulus

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

Hi Ben,

On Wed, 04 Oct 2006 17:58:03 +1000 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> I'd rather have a single apply_ftr_fixups() that takes the start/stop of
> the fixup table and the value to compare against. That could then be
> called for fw fixups at boot, fw fixups from modules, cpu fixups at
> boot, cpu fixups from modules, and possibly fixups in the vdso's is a
> feature I've been thinking of, and which would be easier with just a
> single function like that.

I agree entirely, but my PowerPC assembly skills are not up to it :-(

--
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 7/7] [POWERPC] implement BEGIN/END_FW_FTR_SECTION
  2006-10-04  8:26               ` Stephen Rothwell
@ 2006-10-04 10:08                 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 14+ messages in thread
From: Benjamin Herrenschmidt @ 2006-10-04 10:08 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: ppc-dev, paulus

On Wed, 2006-10-04 at 18:26 +1000, Stephen Rothwell wrote:
> Hi Ben,
> 
> On Wed, 04 Oct 2006 17:58:03 +1000 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> >
> > I'd rather have a single apply_ftr_fixups() that takes the start/stop of
> > the fixup table and the value to compare against. That could then be
> > called for fw fixups at boot, fw fixups from modules, cpu fixups at
> > boot, cpu fixups from modules, and possibly fixups in the vdso's is a
> > feature I've been thinking of, and which would be easier with just a
> > single function like that.
> 
> I agree entirely, but my PowerPC assembly skills are not up to it :-(

Ok, I'll do that with you later this week

Ben.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-10-04 10:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-26  3:34 [PATCH 1/7] [POWERPC] iSeries: set FW_FEATURE_ISERIES earlier Stephen Rothwell
2006-09-26  3:35 ` [PATCH 2/7] [POWERPC] The two vio HVC backends clash Stephen Rothwell
2006-09-26  3:36   ` [PATCH 3/7] [POWERPC] modify PCI code for a merged kernel Stephen Rothwell
2006-09-26  3:37     ` [PATCH 4/7] [POWERPC] fix ioremap for a combined kernel Stephen Rothwell
2006-09-26  3:39       ` [PATCH 5/7] [POWERPC] Allow combined iSeries and MULTIPLATFORM build Stephen Rothwell
2006-09-26  3:40         ` [PATCH 6/7] [POWERPC] iSeries does not need pcibios_fixup_resources Stephen Rothwell
2006-09-26  3:42           ` [PATCH 7/7] [POWERPC] implement BEGIN/END_FW_FTR_SECTION Stephen Rothwell
2006-10-04  7:58             ` Benjamin Herrenschmidt
2006-10-04  8:26               ` Stephen Rothwell
2006-10-04 10:08                 ` Benjamin Herrenschmidt
2006-10-02 10:25         ` [PATCH 5/7] [POWERPC] Allow combined iSeries and MULTIPLATFORM build Paul Mackerras
2006-10-04  4:58           ` Stephen Rothwell
2006-10-04  8:02     ` [PATCH 3/7] [POWERPC] modify PCI code for a merged kernel Benjamin Herrenschmidt
2006-09-26  5:10   ` [PATCH 2/7] [POWERPC] The two vio HVC backends clash Olof Johansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).