LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: Kernel for MPC Lite 5200 will not compile
From: Wolfgang Denk @ 2006-03-30  0:34 UTC (permalink / raw)
  To: Sylvain Munaut; +Cc: linuxppc-embedded
In-Reply-To: <442B11E8.7020107@246tNt.com>

In message <442B11E8.7020107@246tNt.com> you wrote:
>
> It is ?

I think so.

> I don't know about the 2.6-denx, but the stock 2.6.15 should work just fine.
> What's wrong with it ? (except it misses some drivers ... it should compile
> and boot just fine)

Isn't the current reengineered implementation of  the  BestComm  code
based  on  an very old Freescale version, which has known limitations
and problems?

Or has there any action resulted  out  of  the  discussion  with  the
Freescale engineers, and I have missed it?

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
In accord with UNIX philosophy, Perl gives you enough  rope  to  hang
yourself.              - L. Wall & R. L. Schwartz, _Programming Perl_

^ permalink raw reply

* Re: [PATCH] powerpc: Extends HCALL interface for InfiniBand usage
From: Benjamin Herrenschmidt @ 2006-03-30  4:19 UTC (permalink / raw)
  To: Heiko J Schick; +Cc: linuxppc-dev, paulus
In-Reply-To: <FEF4C367-872B-416D-8166-E439D1F4F9A4@schihei.de>


> if StudlyCaps are better (and more readable) than SHOUTING CAPS I can
> change it. Not a big deal.

They are not... but consistency is better :)

Ben.

^ permalink raw reply

* Re: [PATCH] PowerMac11,2 i2c-bus@0 duplicate dev-tree workaround
From: Benjamin Herrenschmidt @ 2006-03-30  4:26 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linuxppc-dev
In-Reply-To: <1143631816.9481.5.camel@localhost>


> +		/* so if the workaround is in effect, and we have the right
> +		 * node found, we increase the workaround count (we use the
> +		 * same variable) and then set allnextpp to NULL on the second
> +		 * one around so the node isn't added to the allnodes list */
> +		if (powermac_i2c_bus_0_workaround &&
> +		    strcmp(np->full_name,
> +		           "/ht@0,f2000000/pci@8/mac-io@7/i2c@18000/i2c-bus@0") == 0) {
> +			powermac_i2c_bus_0_workaround++;
> +			if (powermac_i2c_bus_0_workaround == 3)
> +				allnextpp = NULL;
> +		}
> +		if (allnextpp) {
> +			**allnextpp = np;
> +			*allnextpp = &np->allnext;
> +			if (dad != NULL) {
> +				np->parent = dad;
> +				/* we temporarily use the next field as `last_child'*/
> +				if (dad->next == 0)
> +					dad->child = np;
> +				else
> +					dad->next->sibling = np;
> +				dad->next = np;
> +			}
>  		}
>  		kref_init(&np->kref);
>  	}

Hrm... you set allnextpp to NULL ... won't that prevent any further node
from being enqueued in the global node list ?

In fact, I think the workaround should be in prom_init.c when
flattening... easier to skip a node there, and that's also where you are
reasonably sure of getting the nodes in the right order, not when
unflattening. 

Also, you don't even need to test for PowerMac11,2 .. .prom_init.c
already has a machine type, so just test that it's a mac and has this
node duplicated, and if yes, remove the dup. In fact, you could probably
even run a bit of forth with "interpret" to do so before the tree is
even walked though :)

Ben.

^ permalink raw reply

* Re: [PATCH] powerpc: Extends HCALL interface for InfiniBand usage
From: Heiko J Schick @ 2006-03-30  5:11 UTC (permalink / raw)
  To: Herrenschmidt Benjamin; +Cc: linuxppc-dev, paulus
In-Reply-To: <1143692376.16706.5.camel@localhost.localdomain>


Ok, I will change it to StudlyCaps. ;)

On 30.03.2006, at 06:19, Benjamin Herrenschmidt wrote:

>
>> if StudlyCaps are better (and more readable) than SHOUTING CAPS I can
>> change it. Not a big deal.
>
> They are not... but consistency is better :)
>
> Ben.
>
>

^ permalink raw reply

* Re: [PATCH] powerpc: Add FSL CPM2 device tree node documentation
From: Dan Malek @ 2006-03-30  5:05 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <20060328161431.18517.82573.stgit@vitb.ru.mvista.com>


On Mar 28, 2006, at 11:14 AM, Vitaly Bordug wrote:

> Updated the documentation to include the initial description of the 
> CPM2
> device that are used on PQII and PQIII families.

I haven't followed the device tree development in detail, but when
looking at this the only question that comes to mind is wondering
what this really does to help me.  None of the information provided
here is variable nor configurable .... except I guess for the internal
register base address (IMMR), which for some reason has turned
into a variable which hasn't changed since I did the first kernel port.
About the only thing that is variable, which is the two different bank
addresses of the CPM memory that affects the configuration of
the FCCs in Ethernet mode, isn't reflected here in any way.

> +		brg@119f0 {
> +			device_type = "brg";
> +			model = "BRG1";
> +			reg = <119f0>;
> +			linux,phandle = <775>;
> +		};

Why?  We already know it's at this address offset.

> +
> +		cpmux@11b04 {
> +			device_type = "cpmux";
> +			compatible = "fcc";
> +			reg = <11b04>;
> +		};
> +
> +		cpmux@11b08 {
> +			device_type = "cpmux";
> +			compatible = "scc";
> +			reg = <11b08>;
> +		};

I don't understand the value of these either.

> +
> +		scc@11a20 {
> +			device_type = "serial";
> +			compatible = "cpm_uart";
> +			model = "SCC1";
> +			reg = <11a20 100>;
> +			reg_pram = <8000 ff>;
> +			clock_setup = <0x00ffffff 0>;
> +			interrupts = <28 3>;

None of this is variable.  If you know you are using scc1,
you must use certain configuration bits in the cmxscr (the
thing you are calling cpmux).  Why would you want to make
this variable and prone to error?  The driver knows, and
there are no options.  Same for the interrupts that are used.

> +		fcc@11300 {
> +			device_type = "network";
> +			compatible = "fs_enet";
> +			model = "FCC1";
> +			reg = <11300 1f>;
> +			reg_pram = <8400 ff>;
> +			address = [00 00 00 00 00 00];

I'm assuming this is the MAC address, and is probably
the only thing I see of value here.

>     More devices will be defined as this spec matures.

I just don't understand the value of this.  Will you explain
it for me?

Thanks.


	-- Dan

^ permalink raw reply

* LINUX source code of  WRED Queuing Algorithm
From: Prabhat_Singh @ 2006-03-30  5:20 UTC (permalink / raw)
  To: linuxppc-embedded

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

Hi all,
         I am implementing voice enabled vpn router using mpc8248 processor so i want to implement WRED algorithm for congestion mangement in Qos implementation of linux-2.4.24 source code. 
 
        Can anyone please tell me , is the implementation of WRED algorithm  is available as open source ? If it is not available what will be the best solution for  congestion management at peak bandwidth(100% traffic) so that voice packet get priortized and not dropped at layer-3,only data packet is  
       dropped.
 
 
 
Thanks
Prabhat Singh
SE
Satyam Computer Services Ltd.   


DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.

[-- Attachment #2: Type: text/html, Size: 2038 bytes --]

^ permalink raw reply

* Re: [PATCH] powerpc: Extends HCALL interface for InfiniBand usage
From: Segher Boessenkool @ 2006-03-30  6:06 UTC (permalink / raw)
  To: Heiko J Schick; +Cc: paulus, linuxppc-dev
In-Reply-To: <57A56F67-44B3-489D-A600-537CE65D6FC2@schihei.de>

> Ok, I will change it to StudlyCaps. ;)
>
>>> if StudlyCaps are better (and more readable) than SHOUTING CAPS I  
>>> can
>>> change it. Not a big deal.
>>
>> They are not... but consistency is better :)

Don't top-post, please.

How about we change the existing Studly's?  It's only 132 lines...
Opinions?

I guess I'll have to volunteer for that job now.  Oops.


Segher

^ permalink raw reply

* Re: [PATCH] powerpc: Add FSL CPM2 device tree node documentation
From: Paul Mackerras @ 2006-03-30  6:10 UTC (permalink / raw)
  To: Dan Malek; +Cc: linuxppc-dev
In-Reply-To: <bed6c40abe7664da7506270a46611d00@embeddededge.com>

Dan Malek writes:

> I haven't followed the device tree development in detail, but when
> looking at this the only question that comes to mind is wondering
> what this really does to help me.  None of the information provided
> here is variable nor configurable .... except I guess for the internal
> register base address (IMMR), which for some reason has turned
> into a variable which hasn't changed since I did the first kernel port.
> About the only thing that is variable, which is the two different bank
> addresses of the CPM memory that affects the configuration of
> the FCCs in Ethernet mode, isn't reflected here in any way.

I don't know much about the CPM or CPM2, so I don't know precisely why
these bits have been put in.  If the CPM2 is completely unique and is
identical across all possible past and future implementations, then
indeed there isn't a lot of value in putting details about it in the
device tree.  Having details in the device tree becomes useful if:

* there are variants that have different collections of subdevices, or
  subdevices at different offsets, or

* there are common subdevices between CPM and CPM2 (or future CPM*
  devices), potentially with subtle variations in offset, method of
  enabling, etc., or

* there are subdevices in CPM/CPM2 which match some common device
  (e.g. a 16550 uart) for which a generic driver can be used with some
  appropriate configuration.

As I say, I don't know if these points apply to CPM/CPM2 specifically.

Paul.

^ permalink raw reply

* Re: [PATCH] powerpc: Extends HCALL interface for InfiniBand usage
From: Paul Mackerras @ 2006-03-30  6:11 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev
In-Reply-To: <74436DEF-2E23-440B-B797-E4CADEB70BA1@kernel.crashing.org>

Segher Boessenkool writes:

> How about we change the existing Studly's?  It's only 132 lines...
> Opinions?

Yes, that's the best idea.

> I guess I'll have to volunteer for that job now.  Oops.

Thanks, Segher! :)

Paul.

^ permalink raw reply

* [PATCH 0/5] powerpc: Cleanup htab code a little
From: Michael Ellerman @ 2006-03-30  6:12 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

A few cleanups to the htab. Built for pSeries, iSeries, pmac, pmac32 and maple. Booted on P5 LPAR and iSeries.

^ permalink raw reply

* [PATCH 1/5] powerpc: Initialise ppc_md htab pointers earlier
From: Michael Ellerman @ 2006-03-30  6:12 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <1143699173.339118.857634197021.qpush@concordia>

Initialise the ppc_md htab callbacks earlier, in the probe routines. This
allows us to call htab_finish_init() from htab_initialize(), and makes it
private to hash_utils_64.c.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 arch/powerpc/kernel/setup_64.c          |    6 --
 arch/powerpc/mm/hash_native_64.c        |    3 -
 arch/powerpc/mm/hash_utils_64.c         |   72 ++++++++++++++++----------------
 arch/powerpc/platforms/iseries/htab.c   |    4 -
 arch/powerpc/platforms/iseries/setup.c  |    7 ---
 arch/powerpc/platforms/maple/setup.c    |    7 ---
 arch/powerpc/platforms/powermac/setup.c |    9 ----
 arch/powerpc/platforms/pseries/lpar.c   |    4 -
 arch/powerpc/platforms/pseries/setup.c  |   10 ++--
 include/asm-powerpc/mmu.h               |    1 
 10 files changed, 52 insertions(+), 71 deletions(-)

Index: to-merge/arch/powerpc/kernel/setup_64.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/setup_64.c
+++ to-merge/arch/powerpc/kernel/setup_64.c
@@ -371,11 +371,7 @@ void __init setup_system(void)
 	 * Fill the ppc64_caches & systemcfg structures with informations
 	 * retrieved from the device-tree. Need to be called before
 	 * finish_device_tree() since the later requires some of the
-	 * informations filled up here to properly parse the interrupt
-	 * tree.
-	 * It also sets up the cache line sizes which allows to call
-	 * routines like flush_icache_range (used by the hash init
-	 * later on).
+	 * informations filled up here to properly parse the interrupt tree.
 	 */
 	initialize_cache_info();
 
Index: to-merge/arch/powerpc/mm/hash_native_64.c
===================================================================
--- to-merge.orig/arch/powerpc/mm/hash_native_64.c
+++ to-merge/arch/powerpc/mm/hash_native_64.c
@@ -520,7 +520,7 @@ static inline int tlb_batching_enabled(v
 }
 #endif
 
-void hpte_init_native(void)
+void __init hpte_init_native(void)
 {
 	ppc_md.hpte_invalidate	= native_hpte_invalidate;
 	ppc_md.hpte_updatepp	= native_hpte_updatepp;
@@ -530,5 +530,4 @@ void hpte_init_native(void)
 	ppc_md.hpte_clear_all	= native_hpte_clear;
 	if (tlb_batching_enabled())
 		ppc_md.flush_hash_range = native_flush_hash_range;
-	htab_finish_init();
 }
Index: to-merge/arch/powerpc/mm/hash_utils_64.c
===================================================================
--- to-merge.orig/arch/powerpc/mm/hash_utils_64.c
+++ to-merge/arch/powerpc/mm/hash_utils_64.c
@@ -397,6 +397,41 @@ void create_section_mapping(unsigned lon
 }
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
+static inline void make_bl(unsigned int *insn_addr, void *func)
+{
+	unsigned long funcp = *((unsigned long *)func);
+	int offset = funcp - (unsigned long)insn_addr;
+
+	*insn_addr = (unsigned int)(0x48000001 | (offset & 0x03fffffc));
+	flush_icache_range((unsigned long)insn_addr, 4+
+			   (unsigned long)insn_addr);
+}
+
+static void __init htab_finish_init(void)
+{
+	extern unsigned int *htab_call_hpte_insert1;
+	extern unsigned int *htab_call_hpte_insert2;
+	extern unsigned int *htab_call_hpte_remove;
+	extern unsigned int *htab_call_hpte_updatepp;
+
+#ifdef CONFIG_PPC_64K_PAGES
+	extern unsigned int *ht64_call_hpte_insert1;
+	extern unsigned int *ht64_call_hpte_insert2;
+	extern unsigned int *ht64_call_hpte_remove;
+	extern unsigned int *ht64_call_hpte_updatepp;
+
+	make_bl(ht64_call_hpte_insert1, ppc_md.hpte_insert);
+	make_bl(ht64_call_hpte_insert2, ppc_md.hpte_insert);
+	make_bl(ht64_call_hpte_remove, ppc_md.hpte_remove);
+	make_bl(ht64_call_hpte_updatepp, ppc_md.hpte_updatepp);
+#endif /* CONFIG_PPC_64K_PAGES */
+
+	make_bl(htab_call_hpte_insert1, ppc_md.hpte_insert);
+	make_bl(htab_call_hpte_insert2, ppc_md.hpte_insert);
+	make_bl(htab_call_hpte_remove, ppc_md.hpte_remove);
+	make_bl(htab_call_hpte_updatepp, ppc_md.hpte_updatepp);
+}
+
 void __init htab_initialize(void)
 {
 	unsigned long table;
@@ -509,6 +544,8 @@ void __init htab_initialize(void)
 					 mmu_linear_psize));
 	}
 
+	htab_finish_init();
+
 	DBG(" <- htab_initialize()\n");
 }
 #undef KB
@@ -721,16 +758,6 @@ void flush_hash_range(unsigned long numb
 	}
 }
 
-static inline void make_bl(unsigned int *insn_addr, void *func)
-{
-	unsigned long funcp = *((unsigned long *)func);
-	int offset = funcp - (unsigned long)insn_addr;
-
-	*insn_addr = (unsigned int)(0x48000001 | (offset & 0x03fffffc));
-	flush_icache_range((unsigned long)insn_addr, 4+
-			   (unsigned long)insn_addr);
-}
-
 /*
  * low_hash_fault is called when we the low level hash code failed
  * to instert a PTE due to an hypervisor error
@@ -749,28 +776,3 @@ void low_hash_fault(struct pt_regs *regs
 	}
 	bad_page_fault(regs, address, SIGBUS);
 }
-
-void __init htab_finish_init(void)
-{
-	extern unsigned int *htab_call_hpte_insert1;
-	extern unsigned int *htab_call_hpte_insert2;
-	extern unsigned int *htab_call_hpte_remove;
-	extern unsigned int *htab_call_hpte_updatepp;
-
-#ifdef CONFIG_PPC_64K_PAGES
-	extern unsigned int *ht64_call_hpte_insert1;
-	extern unsigned int *ht64_call_hpte_insert2;
-	extern unsigned int *ht64_call_hpte_remove;
-	extern unsigned int *ht64_call_hpte_updatepp;
-
-	make_bl(ht64_call_hpte_insert1, ppc_md.hpte_insert);
-	make_bl(ht64_call_hpte_insert2, ppc_md.hpte_insert);
-	make_bl(ht64_call_hpte_remove, ppc_md.hpte_remove);
-	make_bl(ht64_call_hpte_updatepp, ppc_md.hpte_updatepp);
-#endif /* CONFIG_PPC_64K_PAGES */
-
-	make_bl(htab_call_hpte_insert1, ppc_md.hpte_insert);
-	make_bl(htab_call_hpte_insert2, ppc_md.hpte_insert);
-	make_bl(htab_call_hpte_remove, ppc_md.hpte_remove);
-	make_bl(htab_call_hpte_updatepp, ppc_md.hpte_updatepp);
-}
Index: to-merge/arch/powerpc/platforms/iseries/htab.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/iseries/htab.c
+++ to-merge/arch/powerpc/platforms/iseries/htab.c
@@ -242,13 +242,11 @@ static void iSeries_hpte_invalidate(unsi
 	local_irq_restore(flags);
 }
 
-void hpte_init_iSeries(void)
+void __init hpte_init_iSeries(void)
 {
 	ppc_md.hpte_invalidate	= iSeries_hpte_invalidate;
 	ppc_md.hpte_updatepp	= iSeries_hpte_updatepp;
 	ppc_md.hpte_updateboltedpp = iSeries_hpte_updateboltedpp;
 	ppc_md.hpte_insert	= iSeries_hpte_insert;
 	ppc_md.hpte_remove	= iSeries_hpte_remove;
-
-	htab_finish_init();
 }
Index: to-merge/arch/powerpc/platforms/iseries/setup.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/iseries/setup.c
+++ to-merge/arch/powerpc/platforms/iseries/setup.c
@@ -326,11 +326,6 @@ static void __init iSeries_init_early(vo
 	iSeries_recal_titan = HvCallXm_loadTod();
 
 	/*
-	 * Initialize the hash table management pointers
-	 */
-	hpte_init_iSeries();
-
-	/*
 	 * Initialize the DMA/TCE management
 	 */
 	iommu_init_early_iSeries();
@@ -684,6 +679,8 @@ static int __init iseries_probe(void)
 	powerpc_firmware_features |= FW_FEATURE_ISERIES;
 	powerpc_firmware_features |= FW_FEATURE_LPAR;
 
+	hpte_init_iSeries();
+
 	return 1;
 }
 
Index: to-merge/arch/powerpc/platforms/maple/setup.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/maple/setup.c
+++ to-merge/arch/powerpc/platforms/maple/setup.c
@@ -199,11 +199,6 @@ static void __init maple_init_early(void
 {
 	DBG(" -> maple_init_early\n");
 
-	/* Initialize hash table, from now on, we can take hash faults
-	 * and call ioremap
-	 */
-	hpte_init_native();
-
 	/* Setup interrupt mapping options */
 	ppc64_interrupt_controller = IC_OPEN_PIC;
 
@@ -272,6 +267,8 @@ static int __init maple_probe(void)
 	 */
 	alloc_dart_table();
 
+	hpte_init_native();
+
 	return 1;
 }
 
Index: to-merge/arch/powerpc/platforms/powermac/setup.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/powermac/setup.c
+++ to-merge/arch/powerpc/platforms/powermac/setup.c
@@ -588,13 +588,6 @@ pmac_halt(void)
  */
 static void __init pmac_init_early(void)
 {
-#ifdef CONFIG_PPC64
-	/* Initialize hash table, from now on, we can take hash faults
-	 * and call ioremap
-	 */
-	hpte_init_native();
-#endif
-
 	/* Enable early btext debug if requested */
 	if (strstr(cmd_line, "btextdbg")) {
 		udbg_adb_init_early();
@@ -671,6 +664,8 @@ static int __init pmac_probe(void)
 	 * part of the cacheable linar mapping
 	 */
 	alloc_dart_table();
+
+	hpte_init_native();
 #endif
 
 #ifdef CONFIG_PPC32
Index: to-merge/arch/powerpc/platforms/pseries/lpar.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/pseries/lpar.c
+++ to-merge/arch/powerpc/platforms/pseries/lpar.c
@@ -512,7 +512,7 @@ void pSeries_lpar_flush_hash_range(unsig
 		spin_unlock_irqrestore(&pSeries_lpar_tlbie_lock, flags);
 }
 
-void hpte_init_lpar(void)
+void __init hpte_init_lpar(void)
 {
 	ppc_md.hpte_invalidate	= pSeries_lpar_hpte_invalidate;
 	ppc_md.hpte_updatepp	= pSeries_lpar_hpte_updatepp;
@@ -521,6 +521,4 @@ void hpte_init_lpar(void)
 	ppc_md.hpte_remove	= pSeries_lpar_hpte_remove;
 	ppc_md.flush_hash_range	= pSeries_lpar_flush_hash_range;
 	ppc_md.hpte_clear_all   = pSeries_lpar_hptab_clear;
-
-	htab_finish_init();
 }
Index: to-merge/arch/powerpc/platforms/pseries/setup.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/pseries/setup.c
+++ to-merge/arch/powerpc/platforms/pseries/setup.c
@@ -322,11 +322,6 @@ static void __init pSeries_init_early(vo
 	DBG(" -> pSeries_init_early()\n");
 
 	fw_feature_init();
-	
-	if (firmware_has_feature(FW_FEATURE_LPAR))
-		hpte_init_lpar();
-	else
-		hpte_init_native();
 
 	if (firmware_has_feature(FW_FEATURE_LPAR))
 		find_udbg_vterm();
@@ -384,6 +379,11 @@ static int __init pSeries_probe_hypertas
 	if (of_get_flat_dt_prop(node, "ibm,hypertas-functions", NULL) != NULL)
  		powerpc_firmware_features |= FW_FEATURE_LPAR;
 
+	if (firmware_has_feature(FW_FEATURE_LPAR))
+		hpte_init_lpar();
+	else
+		hpte_init_native();
+
  	return 1;
 }
 
Index: to-merge/include/asm-powerpc/mmu.h
===================================================================
--- to-merge.orig/include/asm-powerpc/mmu.h
+++ to-merge/include/asm-powerpc/mmu.h
@@ -226,7 +226,6 @@ extern int hash_huge_page(struct mm_stru
 			  unsigned long ea, unsigned long vsid, int local,
 			  unsigned long trap);
 
-extern void htab_finish_init(void);
 extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
 			     unsigned long pstart, unsigned long mode,
 			     int psize);

^ permalink raw reply

* [PATCH 2/5] powerpc: Use ppc_md.hpte_insert() in htab_bolt_mapping()
From: Michael Ellerman @ 2006-03-30  6:12 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <1143699173.339118.857634197021.qpush@concordia>

With the ppc_md htab pointers setup earlier, we can use ppc_md.hpte_insert
in htab_bolt_mapping(), rather than deciding which version to call by hand.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 arch/powerpc/mm/hash_utils_64.c |   34 ++++++----------------------------
 1 files changed, 6 insertions(+), 28 deletions(-)

Index: to-merge/arch/powerpc/mm/hash_utils_64.c
===================================================================
--- to-merge.orig/arch/powerpc/mm/hash_utils_64.c
+++ to-merge/arch/powerpc/mm/hash_utils_64.c
@@ -162,34 +162,12 @@ int htab_bolt_mapping(unsigned long vsta
 		hash = hpt_hash(va, shift);
 		hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
 
-		/* The crap below can be cleaned once ppd_md.probe() can
-		 * set up the hash callbacks, thus we can just used the
-		 * normal insert callback here.
-		 */
-#ifdef CONFIG_PPC_ISERIES
-		if (machine_is(iseries))
-			ret = iSeries_hpte_insert(hpteg, va,
-						  paddr,
-						  tmp_mode,
-						  HPTE_V_BOLTED,
-						  psize);
-		else
-#endif
-#ifdef CONFIG_PPC_PSERIES
-		if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR))
-			ret = pSeries_lpar_hpte_insert(hpteg, va,
-						       paddr,
-						       tmp_mode,
-						       HPTE_V_BOLTED,
-						       psize);
-		else
-#endif
-#ifdef CONFIG_PPC_MULTIPLATFORM
-			ret = native_hpte_insert(hpteg, va,
-						 paddr,
-						 tmp_mode, HPTE_V_BOLTED,
-						 psize);
-#endif
+		DBG("htab_bolt_mapping: calling %p\n", ppc_md.hpte_insert);
+
+		BUG_ON(!ppc_md.hpte_insert);
+		ret = ppc_md.hpte_insert(hpteg, va, paddr,
+				tmp_mode, HPTE_V_BOLTED, psize);
+
 		if (ret < 0)
 			break;
 	}

^ permalink raw reply

* [PATCH 3/5] powerpc: Move create_(instruction|branch|function_call) into util.h
From: Michael Ellerman @ 2006-03-30  6:12 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <1143699173.339118.857634197021.qpush@concordia>

These functions don't really belong in system.h, and they can't be there if
the next patch is going to work. So create util.h for them.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 arch/powerpc/kernel/crash_dump.c      |    1 
 arch/powerpc/platforms/powermac/smp.c |    1 
 include/asm-powerpc/system.h          |   48 -----------------------------
 include/asm-powerpc/util.h            |   56 ++++++++++++++++++++++++++++++++++
 4 files changed, 58 insertions(+), 48 deletions(-)

Index: to-merge/arch/powerpc/kernel/crash_dump.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/crash_dump.c
+++ to-merge/arch/powerpc/kernel/crash_dump.c
@@ -17,6 +17,7 @@
 #include <asm/lmb.h>
 #include <asm/firmware.h>
 #include <asm/uaccess.h>
+#include <asm/util.h>
 
 #ifdef DEBUG
 #include <asm/udbg.h>
Index: to-merge/arch/powerpc/platforms/powermac/smp.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/powermac/smp.c
+++ to-merge/arch/powerpc/platforms/powermac/smp.c
@@ -53,6 +53,7 @@
 #include <asm/keylargo.h>
 #include <asm/pmac_low_i2c.h>
 #include <asm/pmac_pfunc.h>
+#include <asm/util.h>
 
 #define DEBUG
 
Index: to-merge/include/asm-powerpc/system.h
===================================================================
--- to-merge.orig/include/asm-powerpc/system.h
+++ to-merge/include/asm-powerpc/system.h
@@ -378,54 +378,6 @@ extern void reloc_got2(unsigned long);
 
 #define PTRRELOC(x)	((typeof(x)) add_reloc_offset((unsigned long)(x)))
 
-static inline void create_instruction(unsigned long addr, unsigned int instr)
-{
-	unsigned int *p;
-	p  = (unsigned int *)addr;
-	*p = instr;
-	asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (p));
-}
-
-/* Flags for create_branch:
- * "b"   == create_branch(addr, target, 0);
- * "ba"  == create_branch(addr, target, BRANCH_ABSOLUTE);
- * "bl"  == create_branch(addr, target, BRANCH_SET_LINK);
- * "bla" == create_branch(addr, target, BRANCH_ABSOLUTE | BRANCH_SET_LINK);
- */
-#define BRANCH_SET_LINK	0x1
-#define BRANCH_ABSOLUTE	0x2
-
-static inline void create_branch(unsigned long addr,
-		unsigned long target, int flags)
-{
-	unsigned int instruction;
-
-	if (! (flags & BRANCH_ABSOLUTE))
-		target = target - addr;
-
-	/* Mask out the flags and target, so they don't step on each other. */
-	instruction = 0x48000000 | (flags & 0x3) | (target & 0x03FFFFFC);
-
-	create_instruction(addr, instruction);
-}
-
-static inline void create_function_call(unsigned long addr, void * func)
-{
-	unsigned long func_addr;
-
-#ifdef CONFIG_PPC64
-	/*
-	 * On PPC64 the function pointer actually points to the function's
-	 * descriptor. The first entry in the descriptor is the address
-	 * of the function text.
-	 */
-	func_addr = *(unsigned long *)func;
-#else
-	func_addr = (unsigned long)func;
-#endif
-	create_branch(addr, func_addr, BRANCH_SET_LINK);
-}
-
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING
 extern void account_system_vtime(struct task_struct *);
 #endif
Index: to-merge/include/asm-powerpc/util.h
===================================================================
--- /dev/null
+++ to-merge/include/asm-powerpc/util.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2005,2006 IBM Corporation.
+ */
+
+#ifndef _ASM_POWERPC_UTIL_H
+#define _ASM_POWERPC_UTIL_H
+
+static inline void create_instruction(unsigned long addr, unsigned int instr)
+{
+	unsigned int *p;
+	p  = (unsigned int *)addr;
+	*p = instr;
+	asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (p));
+}
+
+/* Flags for create_branch:
+ * "b"   == create_branch(addr, target, 0);
+ * "ba"  == create_branch(addr, target, BRANCH_ABSOLUTE);
+ * "bl"  == create_branch(addr, target, BRANCH_SET_LINK);
+ * "bla" == create_branch(addr, target, BRANCH_ABSOLUTE | BRANCH_SET_LINK);
+ */
+#define BRANCH_SET_LINK	0x1
+#define BRANCH_ABSOLUTE	0x2
+
+static inline void create_branch(unsigned long addr,
+		unsigned long target, int flags)
+{
+	unsigned int instruction;
+
+	if (! (flags & BRANCH_ABSOLUTE))
+		target = target - addr;
+
+	/* Mask out the flags and target, so they don't step on each other. */
+	instruction = 0x48000000 | (flags & 0x3) | (target & 0x03FFFFFC);
+
+	create_instruction(addr, instruction);
+}
+
+static inline void create_function_call(unsigned long addr, void *func)
+{
+	unsigned long func_addr;
+
+#ifdef CONFIG_PPC64
+	/*
+	 * On PPC64 the function pointer actually points to the function's
+	 * descriptor. The first entry in the descriptor is the address
+	 * of the function text.
+	 */
+	func_addr = *(unsigned long *)func;
+#else
+	func_addr = (unsigned long)func;
+#endif
+	create_branch(addr, func_addr, BRANCH_SET_LINK);
+}
+
+#endif /* _ASM_POWERPC_UTIL_H */

^ permalink raw reply

* [PATCH 4/5] powerpc: Use flush_icache_range() in create_instruction()
From: Michael Ellerman @ 2006-03-30  6:13 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <1143699173.339118.857634197021.qpush@concordia>

Now that ppc64_caches is setup with default values, we can call
flush_icache_range() from create_instruction() rather than using our own
asm version.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 include/asm-powerpc/util.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

Index: to-merge/include/asm-powerpc/util.h
===================================================================
--- to-merge.orig/include/asm-powerpc/util.h
+++ to-merge/include/asm-powerpc/util.h
@@ -5,12 +5,14 @@
 #ifndef _ASM_POWERPC_UTIL_H
 #define _ASM_POWERPC_UTIL_H
 
+#include <asm/cacheflush.h>
+
 static inline void create_instruction(unsigned long addr, unsigned int instr)
 {
 	unsigned int *p;
 	p  = (unsigned int *)addr;
 	*p = instr;
-	asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (p));
+	flush_icache_range(addr, addr + 4);
 }
 
 /* Flags for create_branch:

^ permalink raw reply

* [PATCH 5/5] powerpc: Replace calls to make_bl() with create_function_call()
From: Michael Ellerman @ 2006-03-30  6:13 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <1143699173.339118.857634197021.qpush@concordia>

Use create_function_call() instead of make_bl() in htab_finish_init().

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 arch/powerpc/mm/hash_utils_64.c |   45 ++++++++++++++++------------------------
 1 files changed, 18 insertions(+), 27 deletions(-)

Index: to-merge/arch/powerpc/mm/hash_utils_64.c
===================================================================
--- to-merge.orig/arch/powerpc/mm/hash_utils_64.c
+++ to-merge/arch/powerpc/mm/hash_utils_64.c
@@ -52,6 +52,7 @@
 #include <asm/cputable.h>
 #include <asm/abs_addr.h>
 #include <asm/sections.h>
+#include <asm/util.h>
 
 #ifdef DEBUG
 #define DBG(fmt...) udbg_printf(fmt)
@@ -375,39 +376,29 @@ void create_section_mapping(unsigned lon
 }
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
-static inline void make_bl(unsigned int *insn_addr, void *func)
-{
-	unsigned long funcp = *((unsigned long *)func);
-	int offset = funcp - (unsigned long)insn_addr;
-
-	*insn_addr = (unsigned int)(0x48000001 | (offset & 0x03fffffc));
-	flush_icache_range((unsigned long)insn_addr, 4+
-			   (unsigned long)insn_addr);
-}
-
 static void __init htab_finish_init(void)
 {
-	extern unsigned int *htab_call_hpte_insert1;
-	extern unsigned int *htab_call_hpte_insert2;
-	extern unsigned int *htab_call_hpte_remove;
-	extern unsigned int *htab_call_hpte_updatepp;
+	extern unsigned long htab_call_hpte_insert1;
+	extern unsigned long htab_call_hpte_insert2;
+	extern unsigned long htab_call_hpte_remove;
+	extern unsigned long htab_call_hpte_updatepp;
 
 #ifdef CONFIG_PPC_64K_PAGES
-	extern unsigned int *ht64_call_hpte_insert1;
-	extern unsigned int *ht64_call_hpte_insert2;
-	extern unsigned int *ht64_call_hpte_remove;
-	extern unsigned int *ht64_call_hpte_updatepp;
-
-	make_bl(ht64_call_hpte_insert1, ppc_md.hpte_insert);
-	make_bl(ht64_call_hpte_insert2, ppc_md.hpte_insert);
-	make_bl(ht64_call_hpte_remove, ppc_md.hpte_remove);
-	make_bl(ht64_call_hpte_updatepp, ppc_md.hpte_updatepp);
+	extern unsigned long ht64_call_hpte_insert1;
+	extern unsigned long ht64_call_hpte_insert2;
+	extern unsigned long ht64_call_hpte_remove;
+	extern unsigned long ht64_call_hpte_updatepp;
+
+	create_function_call(ht64_call_hpte_insert1, ppc_md.hpte_insert);
+	create_function_call(ht64_call_hpte_insert2, ppc_md.hpte_insert);
+	create_function_call(ht64_call_hpte_remove, ppc_md.hpte_remove);
+	create_function_call(ht64_call_hpte_updatepp, ppc_md.hpte_updatepp);
 #endif /* CONFIG_PPC_64K_PAGES */
 
-	make_bl(htab_call_hpte_insert1, ppc_md.hpte_insert);
-	make_bl(htab_call_hpte_insert2, ppc_md.hpte_insert);
-	make_bl(htab_call_hpte_remove, ppc_md.hpte_remove);
-	make_bl(htab_call_hpte_updatepp, ppc_md.hpte_updatepp);
+	create_function_call(htab_call_hpte_insert1, ppc_md.hpte_insert);
+	create_function_call(htab_call_hpte_insert2, ppc_md.hpte_insert);
+	create_function_call(htab_call_hpte_remove, ppc_md.hpte_remove);
+	create_function_call(htab_call_hpte_updatepp, ppc_md.hpte_updatepp);
 }
 
 void __init htab_initialize(void)

^ permalink raw reply

* Re: Kernel for MPC Lite 5200 will not compile
From: Sylvain Munaut @ 2006-03-30  6:36 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: linuxppc-embedded
In-Reply-To: <20060330003419.3FF71353A37@atlas.denx.de>

Wolfgang Denk wrote:
> In message <442B11E8.7020107@246tNt.com> you wrote:
>   
>> It is ?
>>     
>
> I think so.
>   
The stock 2.6.15 doesn't have bestcomm.

>   
>> I don't know about the 2.6-denx, but the stock 2.6.15 should work just fine.
>> What's wrong with it ? (except it misses some drivers ... it should compile
>> and boot just fine)
>>     
>
> Isn't the current reengineered implementation of  the  BestComm  code
> based  on  an very old Freescale version, which has known limitations
> and problems?
>
> Or has there any action resulted  out  of  the  discussion  with  the
> Freescale engineers, and I have missed it?
>   
The microcode is updated each time I get a new copy from Freescale and the
last time I checked it was up to date is when John Rigby sent me a copy
of the
latest one.
Freescale doesn't change the software interface of the microcode tasks that
much so upgrading isn't that hard.


Regards,

    Sylvain

^ permalink raw reply

* linux 2.4 on ml403
From: jean-francois.hasson @ 2006-03-30  6:34 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,

I have been trying to run a linux 2.4 devel from the montavista site on an
ml403 following among other things some advice from BYU website. I managed
to have Linux start on the ml403 after downaloading it with XMD but then I
have an error message :

Xilinx Virtex-II Pro port (C) 2002 MontaVista Software, Inc.
(source@mvista.com)
On node 0 totalpages: 16384
zone(0): 16384 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: console=ttyS0,9600 root=/dev/xsysace/disc0/part3 rw
Xilinx INTC #0 at 0x41200000 mapped to 0xFDFFE000
Calibrating delay loop... 99.73 BogoMIPS
Oops: kernel access of bad area, sig: 11
NIP: 00000000 XER: 0000005E LR: 00000000 SP: C0182E50 REGS: c0182da0 TRAP:
0400
   Not tainted
MSR: 00001030 EE: 0 PR: 0 FP: 0 ME: 1 IR/DR: 11
TASK = c0181020[0] 'swapper' Last syscall: 0
last math 00000000 last altivec 00000000
GPR00: 00000000 C0182E50 C0181020 C0181020 00000000 00000001 C0181120
00000048
GPR08: 00000048 00000000 00000000 00000017 24000022 0000CC60 00000000
00000000
GPR16: 00000000 00000000 00000000 00000000 00001032 00182ED0 00000000
C0000000
GPR24: C019DDB0 00000001 C01A0000 C01A0000 044AA234 00000001 00000000
C0181020
Call backtrace:
00000000 C001C27C C0005F30 C00047C0 C0196064 C01943B8 C019154C
C0002328
Kernel panic: Aiee, killing interrupt handler!
In interrupt handler - not syncing
 <0>Rebooting in 180 seconds..

Does anyone have an idea as to what is wrong ? How could I investigate it ?
I have turned on the xmon option while building the kernel and it indicates
I have a kernel stack overflow. If it could help.

Best regards,

JF H



#
  This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, please advise the sender immediately and delete this e-mail and all attached documents from your computer system. Any unauthorised disclosure, distribution or copying hereof is prohibited. 

  Ce courriel et les documents qui y sont attaches peuvent contenir des informations confidentielles. Au cas ou vous ne seriez pas le destinataire de ce courriel, vous etes prie d'en informer l'expediteur immediatement et de le detruire  ainsi que tous les documents attaches de votre systeme informatique. Toute divulgation, distribution ou copie du present courriel et des documents attaches sans autorisation prealable de son emetteur est interdite. 
#

^ permalink raw reply

* Re: linux 2.4 on ml403
From: Peter Ryser @ 2006-03-30  7:48 UTC (permalink / raw)
  To: jean-francois.hasson; +Cc: linuxppc-embedded
In-Reply-To: <OF281713A1.B46F6CC0-ONC1257141.0023B19E-C1257141.00241646@win-master.hsa.snecma>

Jean-Francois,

follow the instructions in the ML403 Reference Design Users Guide (pg 
39). In particular, create the board support package with the Linux MLD 
and use the patch_linux script in the linux sub-directory of the ML403 
reference design. The patch sets bits 1 and 3 in CCR0 which is required 
for ES silicon, i.e. silicon where the PPC405 has a PVR of 0x20011430. 
After applying the patch the problem will be gone.

- Peter


Links:
- ML403 Web Page: http://www.xilinx.com/ml403
- ML403 Users Guide: http://www.xilinx.com/bvdocs/userguides/ug082.pdf
- ML403 reference design: 
http://www.xilinx.com/products/boards/ml403/files/ml403_emb_ref_ppc_81.zip


jean-francois.hasson@hispano-suiza-sa.com wrote:

>Hi,
>
>I have been trying to run a linux 2.4 devel from the montavista site on an
>ml403 following among other things some advice from BYU website. I managed
>to have Linux start on the ml403 after downaloading it with XMD but then I
>have an error message :
>
>Xilinx Virtex-II Pro port (C) 2002 MontaVista Software, Inc.
>(source@mvista.com)
>On node 0 totalpages: 16384
>zone(0): 16384 pages.
>zone(1): 0 pages.
>zone(2): 0 pages.
>Kernel command line: console=ttyS0,9600 root=/dev/xsysace/disc0/part3 rw
>Xilinx INTC #0 at 0x41200000 mapped to 0xFDFFE000
>Calibrating delay loop... 99.73 BogoMIPS
>Oops: kernel access of bad area, sig: 11
>NIP: 00000000 XER: 0000005E LR: 00000000 SP: C0182E50 REGS: c0182da0 TRAP:
>0400
>   Not tainted
>MSR: 00001030 EE: 0 PR: 0 FP: 0 ME: 1 IR/DR: 11
>TASK = c0181020[0] 'swapper' Last syscall: 0
>last math 00000000 last altivec 00000000
>GPR00: 00000000 C0182E50 C0181020 C0181020 00000000 00000001 C0181120
>00000048
>GPR08: 00000048 00000000 00000000 00000017 24000022 0000CC60 00000000
>00000000
>GPR16: 00000000 00000000 00000000 00000000 00001032 00182ED0 00000000
>C0000000
>GPR24: C019DDB0 00000001 C01A0000 C01A0000 044AA234 00000001 00000000
>C0181020
>Call backtrace:
>00000000 C001C27C C0005F30 C00047C0 C0196064 C01943B8 C019154C
>C0002328
>Kernel panic: Aiee, killing interrupt handler!
>In interrupt handler - not syncing
> <0>Rebooting in 180 seconds..
>
>Does anyone have an idea as to what is wrong ? How could I investigate it ?
>I have turned on the xmon option while building the kernel and it indicates
>I have a kernel stack overflow. If it could help.
>
>Best regards,
>
>JF H
>
>
>
>#
>  This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, please advise the sender immediately and delete this e-mail and all attached documents from your computer system. Any unauthorised disclosure, distribution or copying hereof is prohibited. 
>
>  Ce courriel et les documents qui y sont attaches peuvent contenir des informations confidentielles. Au cas ou vous ne seriez pas le destinataire de ce courriel, vous etes prie d'en informer l'expediteur immediatement et de le detruire  ainsi que tous les documents attaches de votre systeme informatique. Toute divulgation, distribution ou copie du present courriel et des documents attaches sans autorisation prealable de son emetteur est interdite. 
>#
>_______________________________________________
>Linuxppc-embedded mailing list
>Linuxppc-embedded@ozlabs.org
>https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
>  
>

^ permalink raw reply

* Re: [PATCH] powerpc: Add FSL CPM2 device tree node documentation
From: Vitaly Bordug @ 2006-03-30 10:37 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17451.30312.967754.699319@cargo.ozlabs.ibm.com>

On Thu, 30 Mar 2006 17:10:48 +1100
Paul Mackerras <paulus@samba.org> wrote:

> Dan Malek writes:
> 
> > I haven't followed the device tree development in detail, but when
> > looking at this the only question that comes to mind is wondering
> > what this really does to help me.  None of the information provided
> > here is variable nor configurable .... except I guess for the internal
> > register base address (IMMR), which for some reason has turned
> > into a variable which hasn't changed since I did the first kernel port.
> > About the only thing that is variable, which is the two different bank
> > addresses of the CPM memory that affects the configuration of
> > the FCCs in Ethernet mode, isn't reflected here in any way.
> 
> I don't know much about the CPM or CPM2, so I don't know precisely why
> these bits have been put in.  If the CPM2 is completely unique and is
> identical across all possible past and future implementations, then
> indeed there isn't a lot of value in putting details about it in the
> device tree.  Having details in the device tree becomes useful if:
> 
> * there are variants that have different collections of subdevices, or
>   subdevices at different offsets, or
> 
Yes. Offsets differ across the different PQ families. Collections may differ even on the same reference design, 885 for instance could have all the scc's/smc's utilized as UARTs, while on classic SMC1+SMC2, only, SCC may be used as 10M network.

> * there are common subdevices between CPM and CPM2 (or future CPM*
>   devices), potentially with subtle variations in offset, method of
>   enabling, etc., or
> 
Yes, but this is similar with the first point... Well even cpm and cpm2 differ (different immap.h ), and we have CPM future heading for QE. 
> * there are subdevices in CPM/CPM2 which match some common device
>   (e.g. a 16550 uart) for which a generic driver can be used with some
>   appropriate configuration.
Yep - cpm_uart and fs_enet are live examples. Both are intended to deal with serial and Ethernet stuff from the different variations of CPM. Right now they are not ideal, because they still have to remap the whole immr (say to access cpm command register) ,and such parts are still board-specific which is not good...
> 
> As I say, I don't know if these points apply to CPM/CPM2 specifically.
> 
> Paul.
> 
> 
Thank you for your comments - now I'm sure all this following the right way...

-- 
Sincerely, 
Vitaly

^ permalink raw reply

* Re: [PATCH] powerpc: Add FSL CPM2 device tree node documentation
From: Vitaly Bordug @ 2006-03-30 10:26 UTC (permalink / raw)
  To: Dan Malek; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <bed6c40abe7664da7506270a46611d00@embeddededge.com>

On Thu, 30 Mar 2006 00:05:38 -0500
Dan Malek <dan@embeddededge.com> wrote:

> 
> On Mar 28, 2006, at 11:14 AM, Vitaly Bordug wrote:
> 
> > Updated the documentation to include the initial description of the 
> > CPM2
> > device that are used on PQII and PQIII families.
> 
> I haven't followed the device tree development in detail, but when
> looking at this the only question that comes to mind is wondering
> what this really does to help me.  None of the information provided
> here is variable nor configurable .... except I guess for the internal
> register base address (IMMR), which for some reason has turned
> into a variable which hasn't changed since I did the first kernel port.
> About the only thing that is variable, which is the two different bank
> addresses of the CPM memory that affects the configuration of
> the FCCs in Ethernet mode, isn't reflected here in any way.

Why do you think/guess the values below _should_ be variable? Well they could, but the target is to have the auto-config only in places it makes sense. (I currently see only PCI stuff in this relation). The dts will be compiled together with the firmware, and provide the correct information to the kernel. The dts is a board-specific thing, it is intended to present all the necessary devices to live happily without all the immr structure. In other words, what it should present, is the same logical construction uniting all the legacy (CPM on 8xx), up-to-date (CPM2 on PQ2 and PQ3) and future (QuiccEngine on 8360) boards in an easy to maintain and extensible  way.

I'll elaborate of course if needed - note I am not the theoretical fanatic of this idea, but it 
-	makes sense, 
- 	the new way, all that will not follow it will be obsoleted sooner or later


> 
> > +		brg@119f0 {
> > +			device_type = "brg";
> > +			model = "BRG1";
> > +			reg = <119f0>;
> > +			linux,phandle = <775>;
> > +		};
> 
> Why?  We already know it's at this address offset.
Hmm? The same offset for 8xx, 82xx PQII and new QE? don't think so...
> 
> > +
> > +		cpmux@11b04 {
> > +			device_type = "cpmux";
> > +			compatible = "fcc";
> > +			reg = <11b04>;
> > +		};
> > +
> > +		cpmux@11b08 {
> > +			device_type = "cpmux";
> > +			compatible = "scc";
> > +			reg = <11b08>;
> > +		};
> 
> I don't understand the value of these either.

As far as I got the idea, on startup I'll have _only_ devicetree, in order to configure the stuff, and insert the devices properly. Hereby, I need the offsets to configure things. And I don't really want to hide those into *.h - or we'll return to #ifdef hell there. These offsets are *not* constant if we look over different PQ generations. 

> 
> > +
> > +		scc@11a20 {
> > +			device_type = "serial";
> > +			compatible = "cpm_uart";
> > +			model = "SCC1";
> > +			reg = <11a20 100>;
> > +			reg_pram = <8000 ff>;
> > +			clock_setup = <0x00ffffff 0>;
> > +			interrupts = <28 3>;
> 
> None of this is variable.  If you know you are using scc1,
> you must use certain configuration bits in the cmxscr (the
> thing you are calling cpmux).  Why would you want to make
> this variable and prone to error?  The driver knows, and
> there are no options.  Same for the interrupts that are used.
> 

Just compared in CPM, CPM2 and QE reference manuals - found no equal values. The aim is to move all that specific offsets over to BSP land in devicetree source. The logic is common, but the numbers/offsets are different, and features as well, for instance, QE UCC is much more flexible than SCC/FCC, differing technically but is really common logically.

> > +		fcc@11300 {
> > +			device_type = "network";
> > +			compatible = "fs_enet";
> > +			model = "FCC1";
> > +			reg = <11300 1f>;
> > +			reg_pram = <8400 ff>;
> > +			address = [00 00 00 00 00 00];
> 
> I'm assuming this is the MAC address, and is probably
> the only thing I see of value here.
> 
> >     More devices will be defined as this spec matures.
> 
> I just don't understand the value of this.  Will you explain
> it for me?
> 
I am not a good "explainer", but AFAIR, the powerpc land is generic-code-prone. All the bsp stuff should be either dealt in the firmware, of passed as a flattened devtree and unpacked/used in one function. 

Even conflicting IOPs in 8xx I am going to be configured completely within u-boot, using env or something like that. I know, the kernel should be able to deal with tuning like the upper dependless of the firmware, but there are no much such designs remaining (that are targeting to the new-generation kernel),
and all of them (I know about) are using u-boot.
 
> Thanks.
>
Thanks for attention to this :) 
> 
> 	-- Dan
> 
> 


-- 
Sincerely, 
Vitaly

^ permalink raw reply

* Re: snd-aoa: new apple sound driver
From: Johannes Berg @ 2006-03-30  0:38 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, debian-powerpc, Alastair Poole
In-Reply-To: <1143604878.3585.5.camel@localhost.localdomain>

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

On Wed, 2006-03-29 at 15:01 +1100, Benjamin Herrenschmidt wrote:

> Oh, and jackd seems to be unhappy even if I tell it to ignore the
> capture channels, it's probably a problem with setting the sample
> formats, I haven't looked in detail (yet).

Yeah, that's exactly it, it is trying to set 48KHz which I don't support
yet because I'd need to do i2s cell manipulations (serial format
register etc)

$ jackd -d alsa -r 44100 -S

starts for me. Not like it actually seems to work though...

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]

^ permalink raw reply

* [PATCH] Change H_StudlyCaps to H_SHOUTING_CAPS
From: Segher Boessenkool @ 2006-03-30 11:58 UTC (permalink / raw)
  To: Paul Mackerras, linuxppc-dev

[I hope I got my mailer script to work okay, don't kill me please.]

Also cleans up some nearby whitespace problems.

Signed-of-by: Segher Boessenkool <segher@kernel.crashing.org>

---
 arch/powerpc/kernel/lparcfg.c              |   22 ++---
 arch/powerpc/kernel/rtas.c                 |   12 +-
 arch/powerpc/platforms/pseries/hvconsole.c |    6 -
 arch/powerpc/platforms/pseries/hvcserver.c |   22 ++---
 arch/powerpc/platforms/pseries/lpar.c      |   28 +++---
 arch/powerpc/platforms/pseries/setup.c     |    2 
 arch/powerpc/platforms/pseries/vio.c       |    4 
 arch/powerpc/platforms/pseries/xics.c      |    8 -
 drivers/char/hvcs.c                        |    2 
 drivers/net/ibmveth.c                      |   30 +++----
 drivers/scsi/ibmvscsi/rpa_vscsi.c          |   10 +-
 include/asm-powerpc/hvcall.h               |   85 +++++++++++----------
 12 files changed, 119 insertions(+), 112 deletions(-)

Index: linux-2.6/arch/powerpc/kernel/lparcfg.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/lparcfg.c
+++ linux-2.6/arch/powerpc/kernel/lparcfg.c
@@ -149,17 +149,17 @@
 	if (rc == 0)		/* success, return */
 		return;
 /* check for null tag ? */
-	if (rc == H_Hardware)
+	if (rc == H_HARDWARE)
 		printk(KERN_INFO
 		       "plpar-hcall (%s) failed with hardware fault\n", tag);
-	else if (rc == H_Function)
+	else if (rc == H_FUNCTION)
 		printk(KERN_INFO
 		       "plpar-hcall (%s) failed; function not allowed\n", tag);
-	else if (rc == H_Authority)
+	else if (rc == H_AUTHORITY)
 		printk(KERN_INFO
-		       "plpar-hcall (%s) failed; not authorized to this function\n",
-		       tag);
-	else if (rc == H_Parameter)
+		       "plpar-hcall (%s) failed; not authorized to this"
+		       " function\n", tag);
+	else if (rc == H_PARAMETER)
 		printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n",
 		       tag);
 	else
@@ -209,7 +209,7 @@
 	unsigned long dummy;
 	rc = plpar_hcall(H_PIC, 0, 0, 0, 0, pool_idle_time, num_procs, &dummy);
 
-	if (rc != H_Authority)
+	if (rc != H_AUTHORITY)
 		log_plpar_hcall_return(rc, "H_PIC");
 }
 
@@ -529,13 +529,13 @@
 	retval = plpar_hcall_norets(H_SET_PPP, *new_entitled_ptr,
 				    *new_weight_ptr);
 
-	if (retval == H_Success || retval == H_Constrained) {
+	if (retval == H_SUCCESS || retval == H_CONSTRAINED) {
 		retval = count;
-	} else if (retval == H_Busy) {
+	} else if (retval == H_BUSY) {
 		retval = -EBUSY;
-	} else if (retval == H_Hardware) {
+	} else if (retval == H_HARDWARE) {
 		retval = -EIO;
-	} else if (retval == H_Parameter) {
+	} else if (retval == H_PARAMETER) {
 		retval = -EINVAL;
 	} else {
 		printk(KERN_WARNING "%s: received unknown hv return code %ld",
Index: linux-2.6/arch/powerpc/kernel/rtas.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/rtas.c
+++ linux-2.6/arch/powerpc/kernel/rtas.c
@@ -578,18 +578,18 @@
 	 * We use "waiting" to indicate our state.  As long
 	 * as it is >0, we are still trying to all join up.
 	 * If it goes to 0, we have successfully joined up and
-	 * one thread got H_Continue.  If any error happens,
+	 * one thread got H_CONTINUE.  If any error happens,
 	 * we set it to <0.
 	 */
 	local_irq_save(flags);
 	do {
 		rc = plpar_hcall_norets(H_JOIN);
 		smp_rmb();
-	} while (rc == H_Success && data->waiting > 0);
-	if (rc == H_Success)
+	} while (rc == H_SUCCESS && data->waiting > 0);
+	if (rc == H_SUCCESS)
 		goto out;
 
-	if (rc == H_Continue) {
+	if (rc == H_CONTINUE) {
 		data->waiting = 0;
 		data->args->args[data->args->nargs] =
 			rtas_call(ibm_suspend_me_token, 0, 1, NULL);
@@ -597,7 +597,7 @@
 			plpar_hcall_norets(H_PROD,i);
 	} else {
 		data->waiting = -EBUSY;
-		printk(KERN_ERR "Error on H_Join hypervisor call\n");
+		printk(KERN_ERR "Error on H_JOIN hypervisor call\n");
 	}
 
 out:
@@ -624,7 +624,7 @@
 		printk(KERN_ERR "Error doing global join\n");
 
 	/* Prod each CPU.  This won't hurt, and will wake
-	 * anyone we successfully put to sleep with H_Join
+	 * anyone we successfully put to sleep with H_JOIN.
 	 */
 	for_each_possible_cpu(i)
 		plpar_hcall_norets(H_PROD, i);
Index: linux-2.6/arch/powerpc/platforms/pseries/hvconsole.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pseries/hvconsole.c
+++ linux-2.6/arch/powerpc/platforms/pseries/hvconsole.c
@@ -41,7 +41,7 @@
 	unsigned long got;
 
 	if (plpar_hcall(H_GET_TERM_CHAR, vtermno, 0, 0, 0, &got,
-		(unsigned long *)buf, (unsigned long *)buf+1) == H_Success)
+		(unsigned long *)buf, (unsigned long *)buf+1) == H_SUCCESS)
 		return got;
 	return 0;
 }
@@ -69,9 +69,9 @@
 
 	ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0],
 				 lbuf[1]);
-	if (ret == H_Success)
+	if (ret == H_SUCCESS)
 		return count;
-	if (ret == H_Busy)
+	if (ret == H_BUSY)
 		return 0;
 	return -EIO;
 }
Index: linux-2.6/arch/powerpc/platforms/pseries/hvcserver.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pseries/hvcserver.c
+++ linux-2.6/arch/powerpc/platforms/pseries/hvcserver.c
@@ -43,21 +43,21 @@
 static int hvcs_convert(long to_convert)
 {
 	switch (to_convert) {
-		case H_Success:
+		case H_SUCCESS:
 			return 0;
-		case H_Parameter:
+		case H_PARAMETER:
 			return -EINVAL;
-		case H_Hardware:
+		case H_HARDWARE:
 			return -EIO;
-		case H_Busy:
-		case H_LongBusyOrder1msec:
-		case H_LongBusyOrder10msec:
-		case H_LongBusyOrder100msec:
-		case H_LongBusyOrder1sec:
-		case H_LongBusyOrder10sec:
-		case H_LongBusyOrder100sec:
+		case H_BUSY:
+		case H_LONG_BUSY_ORDER_1_MSEC:
+		case H_LONG_BUSY_ORDER_10_MSEC:
+		case H_LONG_BUSY_ORDER_100_MSEC:
+		case H_LONG_BUSY_ORDER_1_SEC:
+		case H_LONG_BUSY_ORDER_10_SEC:
+		case H_LONG_BUSY_ORDER_100_SEC:
 			return -EBUSY;
-		case H_Function: /* fall through */
+		case H_FUNCTION: /* fall through */
 		default:
 			return -EPERM;
 	}
Index: linux-2.6/arch/powerpc/platforms/pseries/lpar.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pseries/lpar.c
+++ linux-2.6/arch/powerpc/platforms/pseries/lpar.c
@@ -72,7 +72,7 @@
 
 	do {
 		rc = plpar_put_term_char(vtermno, sizeof(packet), packet);
-	} while (rc == H_Busy);
+	} while (rc == H_BUSY);
 }
 
 static long hvsi_udbg_buf_len;
@@ -85,7 +85,7 @@
 
 	if (hvsi_udbg_buf_len == 0) {
 		rc = plpar_get_term_char(vtermno, &hvsi_udbg_buf_len, hvsi_udbg_buf);
-		if (rc != H_Success || hvsi_udbg_buf[0] != 0xff) {
+		if (rc != H_SUCCESS || hvsi_udbg_buf[0] != 0xff) {
 			/* bad read or non-data packet */
 			hvsi_udbg_buf_len = 0;
 		} else {
@@ -139,7 +139,7 @@
 	buf[0] = c;
 	do {
 		rc = plpar_put_term_char(vtermno, 1, buf);
-	} while(rc == H_Busy);
+	} while(rc == H_BUSY);
 }
 
 /* Buffered chars getc */
@@ -158,7 +158,7 @@
 		/* get some more chars. */
 		inbuflen = 0;
 		rc = plpar_get_term_char(vtermno, &inbuflen, buf);
-		if (rc != H_Success)
+		if (rc != H_SUCCESS)
 			inbuflen = 0;	/* otherwise inbuflen is garbage */
 	}
 	if (inbuflen <= 0 || inbuflen > 16) {
@@ -304,7 +304,7 @@
 
 	lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v,
 			      hpte_r, &slot, &dummy0, &dummy1);
-	if (unlikely(lpar_rc == H_PTEG_Full)) {
+	if (unlikely(lpar_rc == H_PTEG_FULL)) {
 		if (!(vflags & HPTE_V_BOLTED))
 			DBG_LOW(" full\n");
 		return -1;
@@ -315,7 +315,7 @@
 	 * will fail. However we must catch the failure in hash_page
 	 * or we will loop forever, so return -2 in this case.
 	 */
-	if (unlikely(lpar_rc != H_Success)) {
+	if (unlikely(lpar_rc != H_SUCCESS)) {
 		if (!(vflags & HPTE_V_BOLTED))
 			DBG_LOW(" lpar err %d\n", lpar_rc);
 		return -2;
@@ -346,9 +346,9 @@
 		/* don't remove a bolted entry */
 		lpar_rc = plpar_pte_remove(H_ANDCOND, hpte_group + slot_offset,
 					   (0x1UL << 4), &dummy1, &dummy2);
-		if (lpar_rc == H_Success)
+		if (lpar_rc == H_SUCCESS)
 			return i;
-		BUG_ON(lpar_rc != H_Not_Found);
+		BUG_ON(lpar_rc != H_NOT_FOUND);
 
 		slot_offset++;
 		slot_offset &= 0x7;
@@ -391,14 +391,14 @@
 
 	lpar_rc = plpar_pte_protect(flags, slot, want_v & HPTE_V_AVPN);
 
-	if (lpar_rc == H_Not_Found) {
+	if (lpar_rc == H_NOT_FOUND) {
 		DBG_LOW("not found !\n");
 		return -1;
 	}
 
 	DBG_LOW("ok\n");
 
-	BUG_ON(lpar_rc != H_Success);
+	BUG_ON(lpar_rc != H_SUCCESS);
 
 	return 0;
 }
@@ -417,7 +417,7 @@
 
 	lpar_rc = plpar_pte_read(flags, slot, &dword0, &dummy_word1);
 
-	BUG_ON(lpar_rc != H_Success);
+	BUG_ON(lpar_rc != H_SUCCESS);
 
 	return dword0;
 }
@@ -468,7 +468,7 @@
 	flags = newpp & 7;
 	lpar_rc = plpar_pte_protect(flags, slot, 0);
 
-	BUG_ON(lpar_rc != H_Success);
+	BUG_ON(lpar_rc != H_SUCCESS);
 }
 
 static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
@@ -484,10 +484,10 @@
 	want_v = hpte_encode_v(va, psize);
 	lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v & HPTE_V_AVPN,
 				   &dummy1, &dummy2);
-	if (lpar_rc == H_Not_Found)
+	if (lpar_rc == H_NOT_FOUND)
 		return;
 
-	BUG_ON(lpar_rc != H_Success);
+	BUG_ON(lpar_rc != H_SUCCESS);
 }
 
 /*
Index: linux-2.6/arch/powerpc/platforms/pseries/setup.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pseries/setup.c
+++ linux-2.6/arch/powerpc/platforms/pseries/setup.c
@@ -463,7 +463,7 @@
 	 * very low priority.  The cede enables interrupts, which
 	 * doesn't matter here.
 	 */
-	if (!lppaca[cpu ^ 1].idle || poll_pending() == H_Pending)
+	if (!lppaca[cpu ^ 1].idle || poll_pending() == H_PENDING)
 		cede_processor();
 
 out:
Index: linux-2.6/arch/powerpc/platforms/pseries/vio.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pseries/vio.c
+++ linux-2.6/arch/powerpc/platforms/pseries/vio.c
@@ -258,7 +258,7 @@
 int vio_enable_interrupts(struct vio_dev *dev)
 {
 	int rc = h_vio_signal(dev->unit_address, VIO_IRQ_ENABLE);
-	if (rc != H_Success)
+	if (rc != H_SUCCESS)
 		printk(KERN_ERR "vio: Error 0x%x enabling interrupts\n", rc);
 	return rc;
 }
@@ -267,7 +267,7 @@
 int vio_disable_interrupts(struct vio_dev *dev)
 {
 	int rc = h_vio_signal(dev->unit_address, VIO_IRQ_DISABLE);
-	if (rc != H_Success)
+	if (rc != H_SUCCESS)
 		printk(KERN_ERR "vio: Error 0x%x disabling interrupts\n", rc);
 	return rc;
 }
Index: linux-2.6/arch/powerpc/platforms/pseries/xics.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pseries/xics.c
+++ linux-2.6/arch/powerpc/platforms/pseries/xics.c
@@ -168,7 +168,7 @@
 	unsigned long return_value;
 
 	lpar_rc = plpar_xirr(&return_value);
-	if (lpar_rc != H_Success)
+	if (lpar_rc != H_SUCCESS)
 		panic(" bad return code xirr - rc = %lx \n", lpar_rc);
 	return (int)return_value;
 }
@@ -179,7 +179,7 @@
 	unsigned long val64 = value & 0xffffffff;
 
 	lpar_rc = plpar_eoi(val64);
-	if (lpar_rc != H_Success)
+	if (lpar_rc != H_SUCCESS)
 		panic("bad return code EOI - rc = %ld, value=%lx\n", lpar_rc,
 		      val64);
 }
@@ -189,7 +189,7 @@
 	unsigned long lpar_rc;
 
 	lpar_rc = plpar_cppr(value);
-	if (lpar_rc != H_Success)
+	if (lpar_rc != H_SUCCESS)
 		panic("bad return code cppr - rc = %lx\n", lpar_rc);
 }
 
@@ -198,7 +198,7 @@
 	unsigned long lpar_rc;
 
 	lpar_rc = plpar_ipi(get_hard_smp_processor_id(n_cpu), value);
-	if (lpar_rc != H_Success)
+	if (lpar_rc != H_SUCCESS)
 		panic("bad return code qirr - rc = %lx\n", lpar_rc);
 }
 
Index: linux-2.6/drivers/char/hvcs.c
===================================================================
--- linux-2.6.orig/drivers/char/hvcs.c
+++ linux-2.6/drivers/char/hvcs.c
@@ -904,7 +904,7 @@
 		 * It is possible the vty-server was removed after the irq was
 		 * requested but before we have time to enable interrupts.
 		 */
-		if (vio_enable_interrupts(vdev) == H_Success)
+		if (vio_enable_interrupts(vdev) == H_SUCCESS)
 			return 0;
 		else {
 			printk(KERN_ERR "HVCS: int enable failed for"
Index: linux-2.6/drivers/net/ibmveth.c
===================================================================
--- linux-2.6.orig/drivers/net/ibmveth.c
+++ linux-2.6/drivers/net/ibmveth.c
@@ -235,7 +235,7 @@
 
 		lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc);
 		    
-		if(lpar_rc != H_Success) {
+		if(lpar_rc != H_SUCCESS) {
 			pool->free_map[free_index] = index;
 			pool->skbuff[index] = NULL;
 			pool->consumer_index--;
@@ -373,7 +373,7 @@
 
 	lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc);
 		    
-	if(lpar_rc != H_Success) {
+	if(lpar_rc != H_SUCCESS) {
 		ibmveth_debug_printk("h_add_logical_lan_buffer failed during recycle rc=%ld", lpar_rc);
 		ibmveth_remove_buffer_from_pool(adapter, adapter->rx_queue.queue_addr[adapter->rx_queue.index].correlator);
 	}
@@ -511,7 +511,7 @@
 					 adapter->filter_list_dma,
 					 mac_address);
 
-	if(lpar_rc != H_Success) {
+	if(lpar_rc != H_SUCCESS) {
 		ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc);
 		ibmveth_error_printk("buffer TCE:0x%lx filter TCE:0x%lx rxq desc:0x%lx MAC:0x%lx\n",
 				     adapter->buffer_list_dma,
@@ -527,7 +527,7 @@
 		ibmveth_error_printk("unable to request irq 0x%x, rc %d\n", netdev->irq, rc);
 		do {
 			rc = h_free_logical_lan(adapter->vdev->unit_address);
-		} while (H_isLongBusy(rc) || (rc == H_Busy));
+		} while (H_IS_LONG_BUSY(rc) || (rc == H_BUSY));
 
 		ibmveth_cleanup(adapter);
 		return rc;
@@ -556,9 +556,9 @@
 
 	do {
 		lpar_rc = h_free_logical_lan(adapter->vdev->unit_address);
-	} while (H_isLongBusy(lpar_rc) || (lpar_rc == H_Busy));
+	} while (H_IS_LONG_BUSY(lpar_rc) || (lpar_rc == H_BUSY));
 
-	if(lpar_rc != H_Success)
+	if(lpar_rc != H_SUCCESS)
 	{
 		ibmveth_error_printk("h_free_logical_lan failed with %lx, continuing with close\n",
 				     lpar_rc);
@@ -693,9 +693,9 @@
 					     desc[4].desc,
 					     desc[5].desc,
 					     correlator);
-	} while ((lpar_rc == H_Busy) && (retry_count--));
+	} while ((lpar_rc == H_BUSY) && (retry_count--));
     
-	if(lpar_rc != H_Success && lpar_rc != H_Dropped) {
+	if(lpar_rc != H_SUCCESS && lpar_rc != H_DROPPED) {
 		int i;
 		ibmveth_error_printk("tx: h_send_logical_lan failed with rc=%ld\n", lpar_rc);
 		for(i = 0; i < 6; i++) {
@@ -786,14 +786,14 @@
 	/* we think we are done - reenable interrupts, then check once more to make sure we are done */
 	lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_ENABLE);
 
-	ibmveth_assert(lpar_rc == H_Success);
+	ibmveth_assert(lpar_rc == H_SUCCESS);
 
 	netif_rx_complete(netdev);
 
 	if(ibmveth_rxq_pending_buffer(adapter) && netif_rx_reschedule(netdev, frames_processed))
 	{
 		lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE);
-		ibmveth_assert(lpar_rc == H_Success);
+		ibmveth_assert(lpar_rc == H_SUCCESS);
 		more_work = 1;
 		goto restart_poll;
 	}
@@ -813,7 +813,7 @@
 
 	if(netif_rx_schedule_prep(netdev)) {
 		lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE);
-		ibmveth_assert(lpar_rc == H_Success);
+		ibmveth_assert(lpar_rc == H_SUCCESS);
 		__netif_rx_schedule(netdev);
 	}
 	return IRQ_HANDLED;
@@ -835,7 +835,7 @@
 					   IbmVethMcastEnableRecv |
 					   IbmVethMcastDisableFiltering,
 					   0);
-		if(lpar_rc != H_Success) {
+		if(lpar_rc != H_SUCCESS) {
 			ibmveth_error_printk("h_multicast_ctrl rc=%ld when entering promisc mode\n", lpar_rc);
 		}
 	} else {
@@ -847,7 +847,7 @@
 					   IbmVethMcastDisableFiltering |
 					   IbmVethMcastClearFilterTable,
 					   0);
-		if(lpar_rc != H_Success) {
+		if(lpar_rc != H_SUCCESS) {
 			ibmveth_error_printk("h_multicast_ctrl rc=%ld when attempting to clear filter table\n", lpar_rc);
 		}
 		/* add the addresses to the filter table */
@@ -858,7 +858,7 @@
 			lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address,
 						   IbmVethMcastAddFilter,
 						   mcast_addr);
-			if(lpar_rc != H_Success) {
+			if(lpar_rc != H_SUCCESS) {
 				ibmveth_error_printk("h_multicast_ctrl rc=%ld when adding an entry to the filter table\n", lpar_rc);
 			}
 		}
@@ -867,7 +867,7 @@
 		lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address,
 					   IbmVethMcastEnableFiltering,
 					   0);
-		if(lpar_rc != H_Success) {
+		if(lpar_rc != H_SUCCESS) {
 			ibmveth_error_printk("h_multicast_ctrl rc=%ld when enabling filtering\n", lpar_rc);
 		}
 	}
Index: linux-2.6/drivers/scsi/ibmvscsi/rpa_vscsi.c
===================================================================
--- linux-2.6.orig/drivers/scsi/ibmvscsi/rpa_vscsi.c
+++ linux-2.6/drivers/scsi/ibmvscsi/rpa_vscsi.c
@@ -80,7 +80,7 @@
 	tasklet_kill(&hostdata->srp_task);
 	do {
 		rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
-	} while ((rc == H_Busy) || (H_isLongBusy(rc)));
+	} while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
 	dma_unmap_single(hostdata->dev,
 			 queue->msg_token,
 			 queue->size * sizeof(*queue->msgs), DMA_BIDIRECTIONAL);
@@ -230,7 +230,7 @@
 	rc = plpar_hcall_norets(H_REG_CRQ,
 				vdev->unit_address,
 				queue->msg_token, PAGE_SIZE);
-	if (rc == H_Resource) 
+	if (rc == H_RESOURCE)
 		/* maybe kexecing and resource is busy. try a reset */
 		rc = ibmvscsi_reset_crq_queue(queue,
 					      hostdata);
@@ -269,7 +269,7 @@
       req_irq_failed:
 	do {
 		rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
-	} while ((rc == H_Busy) || (H_isLongBusy(rc)));
+	} while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
       reg_crq_failed:
 	dma_unmap_single(hostdata->dev,
 			 queue->msg_token,
@@ -295,7 +295,7 @@
 	/* Re-enable the CRQ */
 	do {
 		rc = plpar_hcall_norets(H_ENABLE_CRQ, vdev->unit_address);
-	} while ((rc == H_InProgress) || (rc == H_Busy) || (H_isLongBusy(rc)));
+	} while ((rc == H_IN_PROGRESS) || (rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
 
 	if (rc)
 		printk(KERN_ERR "ibmvscsi: Error %d enabling adapter\n", rc);
@@ -317,7 +317,7 @@
 	/* Close the CRQ */
 	do {
 		rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
-	} while ((rc == H_Busy) || (H_isLongBusy(rc)));
+	} while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
 
 	/* Clean out the queue */
 	memset(queue->msgs, 0x00, PAGE_SIZE);
Index: linux-2.6/include/asm-powerpc/hvcall.h
===================================================================
--- linux-2.6.orig/include/asm-powerpc/hvcall.h
+++ linux-2.6/include/asm-powerpc/hvcall.h
@@ -4,47 +4,54 @@
 
 #define HVSC			.long 0x44000022
 
-#define H_Success	0
-#define H_Busy		1	/* Hardware busy -- retry later */
-#define H_Closed	2	/* Resource closed */
-#define H_Constrained	4	/* Resource request constrained to max allowed */
-#define H_InProgress   14	/* Kind of like busy */
-#define H_Pending      17	/* returned from H_POLL_PENDING */
-#define H_Continue     18	/* Returned from H_Join on success */
-#define H_LongBusyStartRange   9900  /* Start of long busy range */
-#define H_LongBusyOrder1msec   9900  /* Long busy, hint that 1msec is a good time to retry */
-#define H_LongBusyOrder10msec  9901  /* Long busy, hint that 10msec is a good time to retry */
-#define H_LongBusyOrder100msec 9902  /* Long busy, hint that 100msec is a good time to retry */
-#define H_LongBusyOrder1sec    9903  /* Long busy, hint that 1sec is a good time to retry */
-#define H_LongBusyOrder10sec   9904  /* Long busy, hint that 10sec is a good time to retry */
-#define H_LongBusyOrder100sec  9905  /* Long busy, hint that 100sec is a good time to retry */
-#define H_LongBusyEndRange     9905  /* End of long busy range */
-#define H_Hardware	-1	/* Hardware error */
-#define H_Function	-2	/* Function not supported */
-#define H_Privilege	-3	/* Caller not privileged */
-#define H_Parameter	-4	/* Parameter invalid, out-of-range or conflicting */
-#define H_Bad_Mode	-5	/* Illegal msr value */
-#define H_PTEG_Full	-6	/* PTEG is full */
-#define H_Not_Found	-7	/* PTE was not found" */
-#define H_Reserved_DABR	-8	/* DABR address is reserved by the hypervisor on this processor" */
-#define H_NoMem                 -9
-#define H_Authority            -10
-#define H_Permission           -11
-#define H_Dropped              -12
-#define H_SourceParm           -13
-#define H_DestParm             -14
-#define H_RemoteParm           -15
-#define H_Resource             -16
+#define H_SUCCESS	0
+#define H_BUSY		1	/* Hardware busy -- retry later */
+#define H_CLOSED	2	/* Resource closed */
+#define H_CONSTRAINED	4	/* Resource request constrained to max allowed */
+#define H_IN_PROGRESS	14	/* Kind of like busy */
+#define H_PENDING	17	/* returned from H_POLL_PENDING */
+#define H_CONTINUE	18	/* Returned from H_Join on success */
+#define H_LONG_BUSY_START_RANGE		9900  /* Start of long busy range */
+#define H_LONG_BUSY_ORDER_1_MSEC	9900  /* Long busy, hint that 1msec \
+						 is a good time to retry */
+#define H_LONG_BUSY_ORDER_10_MSEC	9901  /* Long busy, hint that 10msec \
+						 is a good time to retry */
+#define H_LONG_BUSY_ORDER_100_MSEC 	9902  /* Long busy, hint that 100msec \
+						 is a good time to retry */
+#define H_LONG_BUSY_ORDER_1_SEC		9903  /* Long busy, hint that 1sec \
+						 is a good time to retry */
+#define H_LONG_BUSY_ORDER_10_SEC	9904  /* Long busy, hint that 10sec \
+						 is a good time to retry */
+#define H_LONG_BUSY_ORDER_100_SEC	9905  /* Long busy, hint that 100sec \
+						 is a good time to retry */
+#define H_LONG_BUSY_END_RANGE		9905  /* End of long busy range */
+#define H_HARDWARE	-1	/* Hardware error */
+#define H_FUNCTION	-2	/* Function not supported */
+#define H_PRIVILEGE	-3	/* Caller not privileged */
+#define H_PARAMETER	-4	/* Parameter invalid, out-of-range or conflicting */
+#define H_BAD_MODE	-5	/* Illegal msr value */
+#define H_PTEG_FULL	-6	/* PTEG is full */
+#define H_NOT_FOUND	-7	/* PTE was not found" */
+#define H_RESERVED_DABR	-8	/* DABR address is reserved by the hypervisor on this processor" */
+#define H_NO_MEM	-9
+#define H_AUTHORITY	-10
+#define H_PERMISSION	-11
+#define H_DROPPED	-12
+#define H_SOURCE_PARM	-13
+#define H_DEST_PARM	-14
+#define H_REMOTE_PARM	-15
+#define H_RESOURCE	-16
 
 /* Long Busy is a condition that can be returned by the firmware
  * when a call cannot be completed now, but the identical call
  * should be retried later.  This prevents calls blocking in the
- * firmware for long periods of time. Annoyingly the firmware can return
+ * firmware for long periods of time.  Annoyingly the firmware can return
  * a range of return codes, hinting at how long we should wait before
  * retrying.  If you don't care for the hint, the macro below is a good
  * way to check for the long_busy return codes
  */
-#define H_isLongBusy(x)  ((x >= H_LongBusyStartRange) && (x <= H_LongBusyEndRange))
+#define H_IS_LONG_BUSY(x)  ((x >= H_LONG_BUSY_START_RANGE) \
+			     && (x <= H_LONG_BUSY_END_RANGE))
 
 /* Flags */
 #define H_LARGE_PAGE		(1UL<<(63-16))
@@ -99,25 +106,25 @@
 #define H_PERFMON		0x7c
 #define H_MIGRATE_DMA		0x78
 #define H_REGISTER_VPA		0xDC
-#define H_CEDE		        0xE0
+#define H_CEDE			0xE0
 #define H_CONFER		0xE4
-#define H_PROD		        0xE8
+#define H_PROD			0xE8
 #define H_GET_PPP		0xEC
 #define H_SET_PPP		0xF0
 #define H_PURR			0xF4
-#define H_PIC		        0xF8
+#define H_PIC			0xF8
 #define H_REG_CRQ		0xFC
 #define H_FREE_CRQ		0x100
 #define H_VIO_SIGNAL		0x104
 #define H_SEND_CRQ		0x108
-#define H_COPY_RDMA             0x110
+#define H_COPY_RDMA		0x110
 #define H_SET_XDABR		0x134
 #define H_STUFF_TCE		0x138
 #define H_PUT_TCE_INDIRECT	0x13C
 #define H_VTERM_PARTNER_INFO	0x150
 #define H_REGISTER_VTERM	0x154
 #define H_FREE_VTERM		0x158
-#define H_POLL_PENDING	        0x1D8
+#define H_POLL_PENDING		0x1D8
 #define H_JOIN			0x298
 #define H_ENABLE_CRQ		0x2B0
 
@@ -152,7 +159,7 @@
  */
 long plpar_hcall_8arg_2ret(unsigned long opcode,
 			   unsigned long arg1,
-		  	   unsigned long arg2,
+			   unsigned long arg2,
 			   unsigned long arg3,
 			   unsigned long arg4,
 			   unsigned long arg5,

^ permalink raw reply

* [PATCH] Change H_StudlyCaps to H_SHOUTING_CAPS
From: Segher Boessenkool @ 2006-03-30 12:49 UTC (permalink / raw)
  To: Paul Mackerras, linuxppc-dev

[I hope I got my mailer script to work okay, don't kill me please.]

Also cleans up some nearby whitespace problems.

Signed-of-by: Segher Boessenkool <segher@kernel.crashing.org>

---
 arch/powerpc/kernel/lparcfg.c              |   22 ++---
 arch/powerpc/kernel/rtas.c                 |   12 +-
 arch/powerpc/platforms/pseries/hvconsole.c |    6 -
 arch/powerpc/platforms/pseries/hvcserver.c |   22 ++---
 arch/powerpc/platforms/pseries/lpar.c      |   28 +++---
 arch/powerpc/platforms/pseries/setup.c     |    2 
 arch/powerpc/platforms/pseries/vio.c       |    4 
 arch/powerpc/platforms/pseries/xics.c      |    8 -
 drivers/char/hvcs.c                        |    2 
 drivers/net/ibmveth.c                      |   30 +++----
 drivers/scsi/ibmvscsi/rpa_vscsi.c          |   10 +-
 include/asm-powerpc/hvcall.h               |   85 +++++++++++----------
 12 files changed, 119 insertions(+), 112 deletions(-)

Index: linux-2.6/arch/powerpc/kernel/lparcfg.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/lparcfg.c
+++ linux-2.6/arch/powerpc/kernel/lparcfg.c
@@ -149,17 +149,17 @@
 	if (rc == 0)		/* success, return */
 		return;
 /* check for null tag ? */
-	if (rc == H_Hardware)
+	if (rc == H_HARDWARE)
 		printk(KERN_INFO
 		       "plpar-hcall (%s) failed with hardware fault\n", tag);
-	else if (rc == H_Function)
+	else if (rc == H_FUNCTION)
 		printk(KERN_INFO
 		       "plpar-hcall (%s) failed; function not allowed\n", tag);
-	else if (rc == H_Authority)
+	else if (rc == H_AUTHORITY)
 		printk(KERN_INFO
-		       "plpar-hcall (%s) failed; not authorized to this function\n",
-		       tag);
-	else if (rc == H_Parameter)
+		       "plpar-hcall (%s) failed; not authorized to this"
+		       " function\n", tag);
+	else if (rc == H_PARAMETER)
 		printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n",
 		       tag);
 	else
@@ -209,7 +209,7 @@
 	unsigned long dummy;
 	rc = plpar_hcall(H_PIC, 0, 0, 0, 0, pool_idle_time, num_procs, &dummy);
 
-	if (rc != H_Authority)
+	if (rc != H_AUTHORITY)
 		log_plpar_hcall_return(rc, "H_PIC");
 }
 
@@ -529,13 +529,13 @@
 	retval = plpar_hcall_norets(H_SET_PPP, *new_entitled_ptr,
 				    *new_weight_ptr);
 
-	if (retval == H_Success || retval == H_Constrained) {
+	if (retval == H_SUCCESS || retval == H_CONSTRAINED) {
 		retval = count;
-	} else if (retval == H_Busy) {
+	} else if (retval == H_BUSY) {
 		retval = -EBUSY;
-	} else if (retval == H_Hardware) {
+	} else if (retval == H_HARDWARE) {
 		retval = -EIO;
-	} else if (retval == H_Parameter) {
+	} else if (retval == H_PARAMETER) {
 		retval = -EINVAL;
 	} else {
 		printk(KERN_WARNING "%s: received unknown hv return code %ld",
Index: linux-2.6/arch/powerpc/kernel/rtas.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/rtas.c
+++ linux-2.6/arch/powerpc/kernel/rtas.c
@@ -578,18 +578,18 @@
 	 * We use "waiting" to indicate our state.  As long
 	 * as it is >0, we are still trying to all join up.
 	 * If it goes to 0, we have successfully joined up and
-	 * one thread got H_Continue.  If any error happens,
+	 * one thread got H_CONTINUE.  If any error happens,
 	 * we set it to <0.
 	 */
 	local_irq_save(flags);
 	do {
 		rc = plpar_hcall_norets(H_JOIN);
 		smp_rmb();
-	} while (rc == H_Success && data->waiting > 0);
-	if (rc == H_Success)
+	} while (rc == H_SUCCESS && data->waiting > 0);
+	if (rc == H_SUCCESS)
 		goto out;
 
-	if (rc == H_Continue) {
+	if (rc == H_CONTINUE) {
 		data->waiting = 0;
 		data->args->args[data->args->nargs] =
 			rtas_call(ibm_suspend_me_token, 0, 1, NULL);
@@ -597,7 +597,7 @@
 			plpar_hcall_norets(H_PROD,i);
 	} else {
 		data->waiting = -EBUSY;
-		printk(KERN_ERR "Error on H_Join hypervisor call\n");
+		printk(KERN_ERR "Error on H_JOIN hypervisor call\n");
 	}
 
 out:
@@ -624,7 +624,7 @@
 		printk(KERN_ERR "Error doing global join\n");
 
 	/* Prod each CPU.  This won't hurt, and will wake
-	 * anyone we successfully put to sleep with H_Join
+	 * anyone we successfully put to sleep with H_JOIN.
 	 */
 	for_each_possible_cpu(i)
 		plpar_hcall_norets(H_PROD, i);
Index: linux-2.6/arch/powerpc/platforms/pseries/hvconsole.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pseries/hvconsole.c
+++ linux-2.6/arch/powerpc/platforms/pseries/hvconsole.c
@@ -41,7 +41,7 @@
 	unsigned long got;
 
 	if (plpar_hcall(H_GET_TERM_CHAR, vtermno, 0, 0, 0, &got,
-		(unsigned long *)buf, (unsigned long *)buf+1) == H_Success)
+		(unsigned long *)buf, (unsigned long *)buf+1) == H_SUCCESS)
 		return got;
 	return 0;
 }
@@ -69,9 +69,9 @@
 
 	ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0],
 				 lbuf[1]);
-	if (ret == H_Success)
+	if (ret == H_SUCCESS)
 		return count;
-	if (ret == H_Busy)
+	if (ret == H_BUSY)
 		return 0;
 	return -EIO;
 }
Index: linux-2.6/arch/powerpc/platforms/pseries/hvcserver.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pseries/hvcserver.c
+++ linux-2.6/arch/powerpc/platforms/pseries/hvcserver.c
@@ -43,21 +43,21 @@
 static int hvcs_convert(long to_convert)
 {
 	switch (to_convert) {
-		case H_Success:
+		case H_SUCCESS:
 			return 0;
-		case H_Parameter:
+		case H_PARAMETER:
 			return -EINVAL;
-		case H_Hardware:
+		case H_HARDWARE:
 			return -EIO;
-		case H_Busy:
-		case H_LongBusyOrder1msec:
-		case H_LongBusyOrder10msec:
-		case H_LongBusyOrder100msec:
-		case H_LongBusyOrder1sec:
-		case H_LongBusyOrder10sec:
-		case H_LongBusyOrder100sec:
+		case H_BUSY:
+		case H_LONG_BUSY_ORDER_1_MSEC:
+		case H_LONG_BUSY_ORDER_10_MSEC:
+		case H_LONG_BUSY_ORDER_100_MSEC:
+		case H_LONG_BUSY_ORDER_1_SEC:
+		case H_LONG_BUSY_ORDER_10_SEC:
+		case H_LONG_BUSY_ORDER_100_SEC:
 			return -EBUSY;
-		case H_Function: /* fall through */
+		case H_FUNCTION: /* fall through */
 		default:
 			return -EPERM;
 	}
Index: linux-2.6/arch/powerpc/platforms/pseries/lpar.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pseries/lpar.c
+++ linux-2.6/arch/powerpc/platforms/pseries/lpar.c
@@ -72,7 +72,7 @@
 
 	do {
 		rc = plpar_put_term_char(vtermno, sizeof(packet), packet);
-	} while (rc == H_Busy);
+	} while (rc == H_BUSY);
 }
 
 static long hvsi_udbg_buf_len;
@@ -85,7 +85,7 @@
 
 	if (hvsi_udbg_buf_len == 0) {
 		rc = plpar_get_term_char(vtermno, &hvsi_udbg_buf_len, hvsi_udbg_buf);
-		if (rc != H_Success || hvsi_udbg_buf[0] != 0xff) {
+		if (rc != H_SUCCESS || hvsi_udbg_buf[0] != 0xff) {
 			/* bad read or non-data packet */
 			hvsi_udbg_buf_len = 0;
 		} else {
@@ -139,7 +139,7 @@
 	buf[0] = c;
 	do {
 		rc = plpar_put_term_char(vtermno, 1, buf);
-	} while(rc == H_Busy);
+	} while(rc == H_BUSY);
 }
 
 /* Buffered chars getc */
@@ -158,7 +158,7 @@
 		/* get some more chars. */
 		inbuflen = 0;
 		rc = plpar_get_term_char(vtermno, &inbuflen, buf);
-		if (rc != H_Success)
+		if (rc != H_SUCCESS)
 			inbuflen = 0;	/* otherwise inbuflen is garbage */
 	}
 	if (inbuflen <= 0 || inbuflen > 16) {
@@ -304,7 +304,7 @@
 
 	lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v,
 			      hpte_r, &slot, &dummy0, &dummy1);
-	if (unlikely(lpar_rc == H_PTEG_Full)) {
+	if (unlikely(lpar_rc == H_PTEG_FULL)) {
 		if (!(vflags & HPTE_V_BOLTED))
 			DBG_LOW(" full\n");
 		return -1;
@@ -315,7 +315,7 @@
 	 * will fail. However we must catch the failure in hash_page
 	 * or we will loop forever, so return -2 in this case.
 	 */
-	if (unlikely(lpar_rc != H_Success)) {
+	if (unlikely(lpar_rc != H_SUCCESS)) {
 		if (!(vflags & HPTE_V_BOLTED))
 			DBG_LOW(" lpar err %d\n", lpar_rc);
 		return -2;
@@ -346,9 +346,9 @@
 		/* don't remove a bolted entry */
 		lpar_rc = plpar_pte_remove(H_ANDCOND, hpte_group + slot_offset,
 					   (0x1UL << 4), &dummy1, &dummy2);
-		if (lpar_rc == H_Success)
+		if (lpar_rc == H_SUCCESS)
 			return i;
-		BUG_ON(lpar_rc != H_Not_Found);
+		BUG_ON(lpar_rc != H_NOT_FOUND);
 
 		slot_offset++;
 		slot_offset &= 0x7;
@@ -391,14 +391,14 @@
 
 	lpar_rc = plpar_pte_protect(flags, slot, want_v & HPTE_V_AVPN);
 
-	if (lpar_rc == H_Not_Found) {
+	if (lpar_rc == H_NOT_FOUND) {
 		DBG_LOW("not found !\n");
 		return -1;
 	}
 
 	DBG_LOW("ok\n");
 
-	BUG_ON(lpar_rc != H_Success);
+	BUG_ON(lpar_rc != H_SUCCESS);
 
 	return 0;
 }
@@ -417,7 +417,7 @@
 
 	lpar_rc = plpar_pte_read(flags, slot, &dword0, &dummy_word1);
 
-	BUG_ON(lpar_rc != H_Success);
+	BUG_ON(lpar_rc != H_SUCCESS);
 
 	return dword0;
 }
@@ -468,7 +468,7 @@
 	flags = newpp & 7;
 	lpar_rc = plpar_pte_protect(flags, slot, 0);
 
-	BUG_ON(lpar_rc != H_Success);
+	BUG_ON(lpar_rc != H_SUCCESS);
 }
 
 static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
@@ -484,10 +484,10 @@
 	want_v = hpte_encode_v(va, psize);
 	lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v & HPTE_V_AVPN,
 				   &dummy1, &dummy2);
-	if (lpar_rc == H_Not_Found)
+	if (lpar_rc == H_NOT_FOUND)
 		return;
 
-	BUG_ON(lpar_rc != H_Success);
+	BUG_ON(lpar_rc != H_SUCCESS);
 }
 
 /*
Index: linux-2.6/arch/powerpc/platforms/pseries/setup.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pseries/setup.c
+++ linux-2.6/arch/powerpc/platforms/pseries/setup.c
@@ -463,7 +463,7 @@
 	 * very low priority.  The cede enables interrupts, which
 	 * doesn't matter here.
 	 */
-	if (!lppaca[cpu ^ 1].idle || poll_pending() == H_Pending)
+	if (!lppaca[cpu ^ 1].idle || poll_pending() == H_PENDING)
 		cede_processor();
 
 out:
Index: linux-2.6/arch/powerpc/platforms/pseries/vio.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pseries/vio.c
+++ linux-2.6/arch/powerpc/platforms/pseries/vio.c
@@ -258,7 +258,7 @@
 int vio_enable_interrupts(struct vio_dev *dev)
 {
 	int rc = h_vio_signal(dev->unit_address, VIO_IRQ_ENABLE);
-	if (rc != H_Success)
+	if (rc != H_SUCCESS)
 		printk(KERN_ERR "vio: Error 0x%x enabling interrupts\n", rc);
 	return rc;
 }
@@ -267,7 +267,7 @@
 int vio_disable_interrupts(struct vio_dev *dev)
 {
 	int rc = h_vio_signal(dev->unit_address, VIO_IRQ_DISABLE);
-	if (rc != H_Success)
+	if (rc != H_SUCCESS)
 		printk(KERN_ERR "vio: Error 0x%x disabling interrupts\n", rc);
 	return rc;
 }
Index: linux-2.6/arch/powerpc/platforms/pseries/xics.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pseries/xics.c
+++ linux-2.6/arch/powerpc/platforms/pseries/xics.c
@@ -168,7 +168,7 @@
 	unsigned long return_value;
 
 	lpar_rc = plpar_xirr(&return_value);
-	if (lpar_rc != H_Success)
+	if (lpar_rc != H_SUCCESS)
 		panic(" bad return code xirr - rc = %lx \n", lpar_rc);
 	return (int)return_value;
 }
@@ -179,7 +179,7 @@
 	unsigned long val64 = value & 0xffffffff;
 
 	lpar_rc = plpar_eoi(val64);
-	if (lpar_rc != H_Success)
+	if (lpar_rc != H_SUCCESS)
 		panic("bad return code EOI - rc = %ld, value=%lx\n", lpar_rc,
 		      val64);
 }
@@ -189,7 +189,7 @@
 	unsigned long lpar_rc;
 
 	lpar_rc = plpar_cppr(value);
-	if (lpar_rc != H_Success)
+	if (lpar_rc != H_SUCCESS)
 		panic("bad return code cppr - rc = %lx\n", lpar_rc);
 }
 
@@ -198,7 +198,7 @@
 	unsigned long lpar_rc;
 
 	lpar_rc = plpar_ipi(get_hard_smp_processor_id(n_cpu), value);
-	if (lpar_rc != H_Success)
+	if (lpar_rc != H_SUCCESS)
 		panic("bad return code qirr - rc = %lx\n", lpar_rc);
 }
 
Index: linux-2.6/drivers/char/hvcs.c
===================================================================
--- linux-2.6.orig/drivers/char/hvcs.c
+++ linux-2.6/drivers/char/hvcs.c
@@ -904,7 +904,7 @@
 		 * It is possible the vty-server was removed after the irq was
 		 * requested but before we have time to enable interrupts.
 		 */
-		if (vio_enable_interrupts(vdev) == H_Success)
+		if (vio_enable_interrupts(vdev) == H_SUCCESS)
 			return 0;
 		else {
 			printk(KERN_ERR "HVCS: int enable failed for"
Index: linux-2.6/drivers/net/ibmveth.c
===================================================================
--- linux-2.6.orig/drivers/net/ibmveth.c
+++ linux-2.6/drivers/net/ibmveth.c
@@ -235,7 +235,7 @@
 
 		lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc);
 		    
-		if(lpar_rc != H_Success) {
+		if(lpar_rc != H_SUCCESS) {
 			pool->free_map[free_index] = index;
 			pool->skbuff[index] = NULL;
 			pool->consumer_index--;
@@ -373,7 +373,7 @@
 
 	lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc);
 		    
-	if(lpar_rc != H_Success) {
+	if(lpar_rc != H_SUCCESS) {
 		ibmveth_debug_printk("h_add_logical_lan_buffer failed during recycle rc=%ld", lpar_rc);
 		ibmveth_remove_buffer_from_pool(adapter, adapter->rx_queue.queue_addr[adapter->rx_queue.index].correlator);
 	}
@@ -511,7 +511,7 @@
 					 adapter->filter_list_dma,
 					 mac_address);
 
-	if(lpar_rc != H_Success) {
+	if(lpar_rc != H_SUCCESS) {
 		ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc);
 		ibmveth_error_printk("buffer TCE:0x%lx filter TCE:0x%lx rxq desc:0x%lx MAC:0x%lx\n",
 				     adapter->buffer_list_dma,
@@ -527,7 +527,7 @@
 		ibmveth_error_printk("unable to request irq 0x%x, rc %d\n", netdev->irq, rc);
 		do {
 			rc = h_free_logical_lan(adapter->vdev->unit_address);
-		} while (H_isLongBusy(rc) || (rc == H_Busy));
+		} while (H_IS_LONG_BUSY(rc) || (rc == H_BUSY));
 
 		ibmveth_cleanup(adapter);
 		return rc;
@@ -556,9 +556,9 @@
 
 	do {
 		lpar_rc = h_free_logical_lan(adapter->vdev->unit_address);
-	} while (H_isLongBusy(lpar_rc) || (lpar_rc == H_Busy));
+	} while (H_IS_LONG_BUSY(lpar_rc) || (lpar_rc == H_BUSY));
 
-	if(lpar_rc != H_Success)
+	if(lpar_rc != H_SUCCESS)
 	{
 		ibmveth_error_printk("h_free_logical_lan failed with %lx, continuing with close\n",
 				     lpar_rc);
@@ -693,9 +693,9 @@
 					     desc[4].desc,
 					     desc[5].desc,
 					     correlator);
-	} while ((lpar_rc == H_Busy) && (retry_count--));
+	} while ((lpar_rc == H_BUSY) && (retry_count--));
     
-	if(lpar_rc != H_Success && lpar_rc != H_Dropped) {
+	if(lpar_rc != H_SUCCESS && lpar_rc != H_DROPPED) {
 		int i;
 		ibmveth_error_printk("tx: h_send_logical_lan failed with rc=%ld\n", lpar_rc);
 		for(i = 0; i < 6; i++) {
@@ -786,14 +786,14 @@
 	/* we think we are done - reenable interrupts, then check once more to make sure we are done */
 	lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_ENABLE);
 
-	ibmveth_assert(lpar_rc == H_Success);
+	ibmveth_assert(lpar_rc == H_SUCCESS);
 
 	netif_rx_complete(netdev);
 
 	if(ibmveth_rxq_pending_buffer(adapter) && netif_rx_reschedule(netdev, frames_processed))
 	{
 		lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE);
-		ibmveth_assert(lpar_rc == H_Success);
+		ibmveth_assert(lpar_rc == H_SUCCESS);
 		more_work = 1;
 		goto restart_poll;
 	}
@@ -813,7 +813,7 @@
 
 	if(netif_rx_schedule_prep(netdev)) {
 		lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE);
-		ibmveth_assert(lpar_rc == H_Success);
+		ibmveth_assert(lpar_rc == H_SUCCESS);
 		__netif_rx_schedule(netdev);
 	}
 	return IRQ_HANDLED;
@@ -835,7 +835,7 @@
 					   IbmVethMcastEnableRecv |
 					   IbmVethMcastDisableFiltering,
 					   0);
-		if(lpar_rc != H_Success) {
+		if(lpar_rc != H_SUCCESS) {
 			ibmveth_error_printk("h_multicast_ctrl rc=%ld when entering promisc mode\n", lpar_rc);
 		}
 	} else {
@@ -847,7 +847,7 @@
 					   IbmVethMcastDisableFiltering |
 					   IbmVethMcastClearFilterTable,
 					   0);
-		if(lpar_rc != H_Success) {
+		if(lpar_rc != H_SUCCESS) {
 			ibmveth_error_printk("h_multicast_ctrl rc=%ld when attempting to clear filter table\n", lpar_rc);
 		}
 		/* add the addresses to the filter table */
@@ -858,7 +858,7 @@
 			lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address,
 						   IbmVethMcastAddFilter,
 						   mcast_addr);
-			if(lpar_rc != H_Success) {
+			if(lpar_rc != H_SUCCESS) {
 				ibmveth_error_printk("h_multicast_ctrl rc=%ld when adding an entry to the filter table\n", lpar_rc);
 			}
 		}
@@ -867,7 +867,7 @@
 		lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address,
 					   IbmVethMcastEnableFiltering,
 					   0);
-		if(lpar_rc != H_Success) {
+		if(lpar_rc != H_SUCCESS) {
 			ibmveth_error_printk("h_multicast_ctrl rc=%ld when enabling filtering\n", lpar_rc);
 		}
 	}
Index: linux-2.6/drivers/scsi/ibmvscsi/rpa_vscsi.c
===================================================================
--- linux-2.6.orig/drivers/scsi/ibmvscsi/rpa_vscsi.c
+++ linux-2.6/drivers/scsi/ibmvscsi/rpa_vscsi.c
@@ -80,7 +80,7 @@
 	tasklet_kill(&hostdata->srp_task);
 	do {
 		rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
-	} while ((rc == H_Busy) || (H_isLongBusy(rc)));
+	} while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
 	dma_unmap_single(hostdata->dev,
 			 queue->msg_token,
 			 queue->size * sizeof(*queue->msgs), DMA_BIDIRECTIONAL);
@@ -230,7 +230,7 @@
 	rc = plpar_hcall_norets(H_REG_CRQ,
 				vdev->unit_address,
 				queue->msg_token, PAGE_SIZE);
-	if (rc == H_Resource) 
+	if (rc == H_RESOURCE)
 		/* maybe kexecing and resource is busy. try a reset */
 		rc = ibmvscsi_reset_crq_queue(queue,
 					      hostdata);
@@ -269,7 +269,7 @@
       req_irq_failed:
 	do {
 		rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
-	} while ((rc == H_Busy) || (H_isLongBusy(rc)));
+	} while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
       reg_crq_failed:
 	dma_unmap_single(hostdata->dev,
 			 queue->msg_token,
@@ -295,7 +295,7 @@
 	/* Re-enable the CRQ */
 	do {
 		rc = plpar_hcall_norets(H_ENABLE_CRQ, vdev->unit_address);
-	} while ((rc == H_InProgress) || (rc == H_Busy) || (H_isLongBusy(rc)));
+	} while ((rc == H_IN_PROGRESS) || (rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
 
 	if (rc)
 		printk(KERN_ERR "ibmvscsi: Error %d enabling adapter\n", rc);
@@ -317,7 +317,7 @@
 	/* Close the CRQ */
 	do {
 		rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
-	} while ((rc == H_Busy) || (H_isLongBusy(rc)));
+	} while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
 
 	/* Clean out the queue */
 	memset(queue->msgs, 0x00, PAGE_SIZE);
Index: linux-2.6/include/asm-powerpc/hvcall.h
===================================================================
--- linux-2.6.orig/include/asm-powerpc/hvcall.h
+++ linux-2.6/include/asm-powerpc/hvcall.h
@@ -4,47 +4,54 @@
 
 #define HVSC			.long 0x44000022
 
-#define H_Success	0
-#define H_Busy		1	/* Hardware busy -- retry later */
-#define H_Closed	2	/* Resource closed */
-#define H_Constrained	4	/* Resource request constrained to max allowed */
-#define H_InProgress   14	/* Kind of like busy */
-#define H_Pending      17	/* returned from H_POLL_PENDING */
-#define H_Continue     18	/* Returned from H_Join on success */
-#define H_LongBusyStartRange   9900  /* Start of long busy range */
-#define H_LongBusyOrder1msec   9900  /* Long busy, hint that 1msec is a good time to retry */
-#define H_LongBusyOrder10msec  9901  /* Long busy, hint that 10msec is a good time to retry */
-#define H_LongBusyOrder100msec 9902  /* Long busy, hint that 100msec is a good time to retry */
-#define H_LongBusyOrder1sec    9903  /* Long busy, hint that 1sec is a good time to retry */
-#define H_LongBusyOrder10sec   9904  /* Long busy, hint that 10sec is a good time to retry */
-#define H_LongBusyOrder100sec  9905  /* Long busy, hint that 100sec is a good time to retry */
-#define H_LongBusyEndRange     9905  /* End of long busy range */
-#define H_Hardware	-1	/* Hardware error */
-#define H_Function	-2	/* Function not supported */
-#define H_Privilege	-3	/* Caller not privileged */
-#define H_Parameter	-4	/* Parameter invalid, out-of-range or conflicting */
-#define H_Bad_Mode	-5	/* Illegal msr value */
-#define H_PTEG_Full	-6	/* PTEG is full */
-#define H_Not_Found	-7	/* PTE was not found" */
-#define H_Reserved_DABR	-8	/* DABR address is reserved by the hypervisor on this processor" */
-#define H_NoMem                 -9
-#define H_Authority            -10
-#define H_Permission           -11
-#define H_Dropped              -12
-#define H_SourceParm           -13
-#define H_DestParm             -14
-#define H_RemoteParm           -15
-#define H_Resource             -16
+#define H_SUCCESS	0
+#define H_BUSY		1	/* Hardware busy -- retry later */
+#define H_CLOSED	2	/* Resource closed */
+#define H_CONSTRAINED	4	/* Resource request constrained to max allowed */
+#define H_IN_PROGRESS	14	/* Kind of like busy */
+#define H_PENDING	17	/* returned from H_POLL_PENDING */
+#define H_CONTINUE	18	/* Returned from H_Join on success */
+#define H_LONG_BUSY_START_RANGE		9900  /* Start of long busy range */
+#define H_LONG_BUSY_ORDER_1_MSEC	9900  /* Long busy, hint that 1msec \
+						 is a good time to retry */
+#define H_LONG_BUSY_ORDER_10_MSEC	9901  /* Long busy, hint that 10msec \
+						 is a good time to retry */
+#define H_LONG_BUSY_ORDER_100_MSEC 	9902  /* Long busy, hint that 100msec \
+						 is a good time to retry */
+#define H_LONG_BUSY_ORDER_1_SEC		9903  /* Long busy, hint that 1sec \
+						 is a good time to retry */
+#define H_LONG_BUSY_ORDER_10_SEC	9904  /* Long busy, hint that 10sec \
+						 is a good time to retry */
+#define H_LONG_BUSY_ORDER_100_SEC	9905  /* Long busy, hint that 100sec \
+						 is a good time to retry */
+#define H_LONG_BUSY_END_RANGE		9905  /* End of long busy range */
+#define H_HARDWARE	-1	/* Hardware error */
+#define H_FUNCTION	-2	/* Function not supported */
+#define H_PRIVILEGE	-3	/* Caller not privileged */
+#define H_PARAMETER	-4	/* Parameter invalid, out-of-range or conflicting */
+#define H_BAD_MODE	-5	/* Illegal msr value */
+#define H_PTEG_FULL	-6	/* PTEG is full */
+#define H_NOT_FOUND	-7	/* PTE was not found" */
+#define H_RESERVED_DABR	-8	/* DABR address is reserved by the hypervisor on this processor" */
+#define H_NO_MEM	-9
+#define H_AUTHORITY	-10
+#define H_PERMISSION	-11
+#define H_DROPPED	-12
+#define H_SOURCE_PARM	-13
+#define H_DEST_PARM	-14
+#define H_REMOTE_PARM	-15
+#define H_RESOURCE	-16
 
 /* Long Busy is a condition that can be returned by the firmware
  * when a call cannot be completed now, but the identical call
  * should be retried later.  This prevents calls blocking in the
- * firmware for long periods of time. Annoyingly the firmware can return
+ * firmware for long periods of time.  Annoyingly the firmware can return
  * a range of return codes, hinting at how long we should wait before
  * retrying.  If you don't care for the hint, the macro below is a good
  * way to check for the long_busy return codes
  */
-#define H_isLongBusy(x)  ((x >= H_LongBusyStartRange) && (x <= H_LongBusyEndRange))
+#define H_IS_LONG_BUSY(x)  ((x >= H_LONG_BUSY_START_RANGE) \
+			     && (x <= H_LONG_BUSY_END_RANGE))
 
 /* Flags */
 #define H_LARGE_PAGE		(1UL<<(63-16))
@@ -99,25 +106,25 @@
 #define H_PERFMON		0x7c
 #define H_MIGRATE_DMA		0x78
 #define H_REGISTER_VPA		0xDC
-#define H_CEDE		        0xE0
+#define H_CEDE			0xE0
 #define H_CONFER		0xE4
-#define H_PROD		        0xE8
+#define H_PROD			0xE8
 #define H_GET_PPP		0xEC
 #define H_SET_PPP		0xF0
 #define H_PURR			0xF4
-#define H_PIC		        0xF8
+#define H_PIC			0xF8
 #define H_REG_CRQ		0xFC
 #define H_FREE_CRQ		0x100
 #define H_VIO_SIGNAL		0x104
 #define H_SEND_CRQ		0x108
-#define H_COPY_RDMA             0x110
+#define H_COPY_RDMA		0x110
 #define H_SET_XDABR		0x134
 #define H_STUFF_TCE		0x138
 #define H_PUT_TCE_INDIRECT	0x13C
 #define H_VTERM_PARTNER_INFO	0x150
 #define H_REGISTER_VTERM	0x154
 #define H_FREE_VTERM		0x158
-#define H_POLL_PENDING	        0x1D8
+#define H_POLL_PENDING		0x1D8
 #define H_JOIN			0x298
 #define H_ENABLE_CRQ		0x2B0
 
@@ -152,7 +159,7 @@
  */
 long plpar_hcall_8arg_2ret(unsigned long opcode,
 			   unsigned long arg1,
-		  	   unsigned long arg2,
+			   unsigned long arg2,
 			   unsigned long arg3,
 			   unsigned long arg4,
 			   unsigned long arg5,

^ permalink raw reply

* Re: [PATCH] PowerMac11,2 i2c-bus@0 duplicate dev-tree workaround
From: Johannes Berg @ 2006-03-30 13:04 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1143692765.16706.10.camel@localhost.localdomain>

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

On Thu, 2006-03-30 at 15:26 +1100, Benjamin Herrenschmidt wrote:

> Hrm... you set allnextpp to NULL ... won't that prevent any further node
> from being enqueued in the global node list ?

No, it only prevents all *child* nodes, since the function recurses so
once you go out allnextpp is valid again. I'm not setting *allnextpp :)

> In fact, I think the workaround should be in prom_init.c when
> flattening... easier to skip a node there, and that's also where you are
> reasonably sure of getting the nodes in the right order, not when
> unflattening. 

Ok. I'll look at that code then.

> Also, you don't even need to test for PowerMac11,2 .. .prom_init.c
> already has a machine type, so just test that it's a mac and has this
> node duplicated, and if yes, remove the dup. In fact, you could probably
> even run a bit of forth with "interpret" to do so before the tree is
> even walked though :)

Heh. Well, if you tell me what you prefer I'll try to do it. Meanwhile
I'll use this patch so the sound stuff etc. doesn't get too confusing
(it keeps telling me about two onyx codecs found...)

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]

^ permalink raw reply

* Re: [PATCH] powerpc: Add FSL CPM2 device tree node documentation
From: Dan Malek @ 2006-03-30 13:09 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <20060330142626.1a9d22f5@vitb.ru.mvista.com>


On Mar 30, 2006, at 5:26 AM, Vitaly Bordug wrote:

> - 	the new way, all that will not follow it will be obsoleted sooner 
> or later

The problem I see is the "new way" is done for the sake of doing 
something
new, without adding any value.  If you want to make the drivers 
dynamically
configurable, which I'll continue to argue is silly in an embedded 
environment
of the type with CPMs, all you need to know is personality of the 
device.
The reason it's silly is the wiring on the particular board dictates 
how a
CPM peripheral will be used.  The SCC1 can't be a serial uart one
moment and an Ethernet the next time you boot up.  Since you have 
already
done a "board port", you may as well wire this as part of the 
configuration
and eliminate potential mistakes.  If you insist on making this dynamic
(and as a port maintainer I would reject such patches), the only thing
you need to describe is the device type.  For example, the SCC1 can be
an Ethernet or uart.  We only support FCCs as Ethernets, and unless
someone submits some other kind of driver, like ATM/UTOPIA, there
isn't anything variable to configure.

All of the truly configurable options, like NMSI vs. TSA, are so complex
the device tree would not be helpful, as that would be built into the
custom driver to configure as necessary.

The offsets into the internal register maps are not so variable that 
adding
the information into the device tree is useful.  There is CPM1 and CPM2,
some common code shared between them that already solves the
problems, and the real difference between the two different CPM2 maps
on 82xx isn't reflected here (but again is already solved in the 
existing
software).  As I said in the past message, this seems more likely to 
cause
errors than be helpful.  To me it just seems new for the sake of being
new, rather than providing any real value.

I'd rather we spend our time adding the xmon and kgdb over serial port
features back into the driver that were lost during the "great driver 
clean up"
than pursing stuff like this.

Thanks.

	-- Dan

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox