LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 09/28] cpm_uart: Be an of_platform device when CONFIG_PPC_CPM_NEW_BINDING is set.
From: Stephen Rothwell @ 2007-09-18  4:19 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20070917165738.GI6563@loki.buserror.net>

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

On Mon, 17 Sep 2007 11:57:38 -0500 Scott Wood <scottwood@freescale.com> wrote:
>
> +++ b/drivers/serial/cpm_uart/cpm_uart_core.c
> @@ -10,7 +10,7 @@
> +
> +#ifdef CONFIG_PPC_CPM_NEW_BINDING
> +#include <asm/of_platform.h>

linux/of_platform.h

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

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

^ permalink raw reply

* Re: [PATCH 0/7] MPC52xx Bestcomm submission for 2.6.24
From: Jon Smirl @ 2007-09-18  2:15 UTC (permalink / raw)
  To: Sylvain Munaut; +Cc: Grant Likely, Paul Mackerras, PowerPC dev list
In-Reply-To: <11899400103383-git-send-email-tnt@246tNt.com>

On 9/16/07, Sylvain Munaut <tnt@246tnt.com> wrote:
> Hello Paul, Hi everyone,
>
> This series of patch is mainly the bestcomm support for
> the mpc5200. It was posted a while ago and received some
> comments. Theses are all addressed here (afaik).

Does this series supersede these pacthes out of your older series?

0010-powerpc-In-rheap.c-move-the-EXPORT_SYMBOL-and-use.patch
0011-powerpc-BestComm-move-the-EXPORT_SYMBOL-and-use-th.patch
0012-powerpc-BestComm-ATA-task-move-the-EXPORT_SYMBOL-a.patch
0013-powerpc-BestComm-FEC-task-move-the-EXPORT_SYMBOL-a.patch
0014-powerpc-BestComm-GenBD-task-move-the-EXPORT_SYMBOL.patch
0015-powerpc-BestComm-Replace-global-variable-bcom-by-b.patch
0016-powerpc-Make-the-BestComm-driver-a-standard-of_plat.patch
0017-powerpc-Fix-typo-in-BestComm-ATA-task-support-code.patch
0018-powerpc-BestComm-ATA-task-microcode-insert-copyri.patch
0019-powerpc-BestComm-FEC-task-microcode-insert-copyri.patch
0020-powerpc-BestComm-GenBD-task-microcode-insert-copy.patch
0021-powerpc-Fix-errors-in-bcom-bcom_eng-renaming.patch



-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply

* Re: [PATCH] powerpc: Avoid pointless WARN_ON(irqs_disabled()) from panic codepath
From: Josh Boyer @ 2007-09-18  1:46 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Mailing List, Kamalesh Babulal, linuxppc-dev, Paul Mackerras,
	Linux, Satyam Sharma
In-Reply-To: <20070917183749.fd690505.randy.dunlap@oracle.com>

On Mon, 17 Sep 2007 18:37:49 -0700
Randy Dunlap <randy.dunlap@oracle.com> wrote:

> On Tue, 18 Sep 2007 05:13:40 +0530 (IST) Satyam Sharma wrote:
> 
> > Untested (not even compile-tested) patch.
> > Could someone point me to ppc32/64 cross-compilers for i386?
> 
> OSDL had some, but those are gone now.
> I downloaded all of them and still use them, although it would
> be good to have some more recent versions of them.
> 
> I put the power* compiler tarballs here:
> 
> http://userweb.kernel.org/~rdunlap/cross-compilers/

Crosstool is widely used.  It'll build several combinations of
gcc/binutils/glibc for you.  

http://www.kegel.com/crosstool/

There's also the ELDK from Denx:  

http://www.denx.de/en/view/Software/WebHome#Embedded_Linux_Development_Kit

josh

^ permalink raw reply

* dtc: Whitespace cleanup
From: David Gibson @ 2007-09-18  1:44 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev

This large patch removes all trailing whitespace from dtc (including
libfdt, the testsuite and documentation).  It also removes a handful
of redundant blank lines (at the end of functions, or when there are
two blank lines together for no particular reason).

As well as anything else, this means that quilt won't whinge when I go
to convert the whole of libfdt into a patch to apply to the kernel.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Index: dtc/data.c
===================================================================
--- dtc.orig/data.c	2007-09-18 11:05:03.000000000 +1000
+++ dtc/data.c	2007-09-18 11:05:55.000000000 +1000
@@ -1,7 +1,7 @@
 /*
  * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
  *
- * 
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of the
@@ -11,11 +11,11 @@
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  *  General Public License for more details.
- *                                                                       
- *  You should have received a copy of the GNU General Public License    
- *  along with this program; if not, write to the Free Software          
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
- *                                                                   USA 
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
  */
 
 #include "dtc.h"
@@ -106,7 +106,7 @@
 	val = strtol(x, &endx, 8);
 	if ((endx - x) == 0)
 		fprintf(stderr, "Empty \\nnn escape\n");
-		
+
 	(*i) += endx - x;
 	return val;
 }
@@ -125,7 +125,7 @@
 	val = strtol(x, &endx, 16);
 	if ((endx - x) == 0)
 		fprintf(stderr, "Empty \\x escape\n");
-		
+
 	(*i) += endx - x;
 	return val;
 }
Index: dtc/treesource.c
===================================================================
--- dtc.orig/treesource.c	2007-09-18 11:06:06.000000000 +1000
+++ dtc/treesource.c	2007-09-18 11:06:25.000000000 +1000
@@ -1,7 +1,7 @@
 /*
  * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
  *
- * 
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of the
@@ -11,11 +11,11 @@
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  *  General Public License for more details.
- *                                                                       
- *  You should have received a copy of the GNU General Public License    
- *  along with this program; if not, write to the Free Software          
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
- *                                                                   USA 
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
  */
 
 #include "dtc.h"
@@ -77,7 +77,6 @@
 		return PROP_CELLS;
 	else
 		return PROP_BYTES;
-		
 }
 
 
Index: dtc/tests/root_node.c
===================================================================
--- dtc.orig/tests/root_node.c	2007-09-18 11:06:53.000000000 +1000
+++ dtc/tests/root_node.c	2007-09-18 11:06:56.000000000 +1000
@@ -36,7 +36,7 @@
 
 	test_init(argc, argv);
 	fdt = load_blob_arg(argc, argv);
-	
+
 	nh = fdt_offset_ptr_typed(fdt, 0, nh);
 
 	if (! nh)
Index: dtc/tests/testutils.c
===================================================================
--- dtc.orig/tests/testutils.c	2007-09-18 11:06:40.000000000 +1000
+++ dtc/tests/testutils.c	2007-09-18 11:06:44.000000000 +1000
@@ -104,7 +104,6 @@
 		     name, proplen, len);
 	if (memcmp(val, prop->data, len) != 0)
 		FAIL("Data mismatch on property \"%s\"", name);
-	
 }
 
 const void *check_getprop(void *fdt, int nodeoffset, const char *name,
Index: dtc/tests/nop_property.c
===================================================================
--- dtc.orig/tests/nop_property.c	2007-09-18 11:07:23.000000000 +1000
+++ dtc/tests/nop_property.c	2007-09-18 11:07:26.000000000 +1000
@@ -53,7 +53,7 @@
 		FAIL("prop-int still present after nopping");
 	if (lenerr != -FDT_ERR_NOTFOUND)
 		FAIL("Unexpected error on second getprop: %s", fdt_strerror(err));
-	
+
 	strp = check_getprop(fdt, 0, "prop-str", strlen(TEST_STRING_1)+1,
 			     TEST_STRING_1);
 	verbose_printf("string value was \"%s\"\n", strp);
Index: dtc/tests/notfound.c
===================================================================
--- dtc.orig/tests/notfound.c	2007-09-18 11:07:10.000000000 +1000
+++ dtc/tests/notfound.c	2007-09-18 11:07:13.000000000 +1000
@@ -68,6 +68,6 @@
 
 	offset = fdt_path_offset(fdt, "/nonexistant-subnode");
 	check_error("fdt_path_offset(\"/nonexistant-subnode\")", offset);
-	
+
 	PASS();
 }
Index: dtc/tests/setprop.c
===================================================================
--- dtc.orig/tests/setprop.c	2007-09-18 11:08:17.000000000 +1000
+++ dtc/tests/setprop.c	2007-09-18 11:08:20.000000000 +1000
@@ -62,7 +62,7 @@
 
 	strp = check_getprop_string(fdt, 0, "prop-int", NEW_STRING);
 	verbose_printf("New value is \"%s\"\n", strp);
-	
+
 	strp = check_getprop(fdt, 0, "prop-str", strlen(TEST_STRING_1)+1,
 			     TEST_STRING_1);
 
Index: dtc/tests/setprop_inplace.c
===================================================================
--- dtc.orig/tests/setprop_inplace.c	2007-09-18 11:07:38.000000000 +1000
+++ dtc/tests/setprop_inplace.c	2007-09-18 11:07:45.000000000 +1000
@@ -51,7 +51,7 @@
 		     ~TEST_VALUE_1, fdt_strerror(err));
 	intp = check_getprop_typed(fdt, 0, "prop-int", ~TEST_VALUE_1);
 	verbose_printf("New int value is 0x%08x\n", *intp);
-	
+
 	strp = check_getprop(fdt, 0, "prop-str", strlen(TEST_STRING_1)+1,
 			     TEST_STRING_1);
 
@@ -66,7 +66,7 @@
 		     xstr, fdt_strerror(err));
 
 	strp = check_getprop(fdt, 0, "prop-str", xlen+1, xstr);
-	verbose_printf("New string value is \"%s\"\n", strp);	
+	verbose_printf("New string value is \"%s\"\n", strp);
 
 	PASS();
 }
Index: dtc/tests/trees.S
===================================================================
--- dtc.orig/tests/trees.S	2007-09-18 11:07:51.000000000 +1000
+++ dtc/tests/trees.S	2007-09-18 11:08:08.000000000 +1000
@@ -65,7 +65,7 @@
 #define STRING(tree, name, str) \
 tree##_##name:	\
 	.string	str
-	
+
 	.data
 
 	TREE_HDR(test_tree1)
@@ -77,7 +77,7 @@
 	BEGIN_NODE("")
 	PROP_INT(test_tree1, prop_int, TEST_VALUE_1)
 	PROP_STR(test_tree1, prop_str, TEST_STRING_1)
-	
+
 	BEGIN_NODE("subnode1")
 	PROP_INT(test_tree1, prop_int, TEST_VALUE_1)
 
@@ -110,7 +110,7 @@
 	BEGIN_NODE("")
 	PROPHDR(truncated_property, prop_truncated, 4)
 	/* Oops, no actual property data here */
-	
+
 truncated_property_strings:
 	STRING(truncated_property, prop_truncated, "truncated")
 truncated_property_end:
Index: dtc/flattree.c
===================================================================
--- dtc.orig/flattree.c	2007-09-18 11:08:45.000000000 +1000
+++ dtc/flattree.c	2007-09-18 11:09:53.000000000 +1000
@@ -1,7 +1,7 @@
 /*
  * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
  *
- * 
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of the
@@ -11,11 +11,11 @@
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  *  General Public License for more details.
- *                                                                       
- *  You should have received a copy of the GNU General Public License    
- *  along with this program; if not, write to the Free Software          
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
- *                                                                   USA 
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
  */
 
 #include "dtc.h"
@@ -111,7 +111,7 @@
 	.data = bin_emit_data,
 	.beginnode = bin_emit_beginnode,
 	.endnode = bin_emit_endnode,
-	.property = bin_emit_property,	
+	.property = bin_emit_property,
 };
 
 static void emit_label(FILE *f, char *prefix, char *label)
@@ -144,7 +144,7 @@
 		c = str[len];
 		str[len] = '\0';
 	}
-		
+
 	fprintf(f, "\t.string\t\"%s\"\n", str);
 
 	if (len != 0) {
@@ -178,7 +178,7 @@
 	}
 
 	if ((d.len - off) >= sizeof(u16)) {
-		fprintf(f, "\t.short\t0x%hx\n", 
+		fprintf(f, "\t.short\t0x%hx\n",
 			be16_to_cpu(*((u16 *)(d.val+off))));
 		off += sizeof(u16);
 	}
@@ -231,7 +231,7 @@
 	.data = asm_emit_data,
 	.beginnode = asm_emit_beginnode,
 	.endnode = asm_emit_endnode,
-	.property = asm_emit_property,	
+	.property = asm_emit_property,
 };
 
 static int stringtable_insert(struct data *d, char *str)
@@ -717,7 +717,7 @@
 
 	if (! strneq(ppath, cpath, plen))
 		return NULL;
-	
+
 	return strdup(lslash+1);
 }
 
@@ -766,7 +766,7 @@
 		node->name = flat_read_string(dtbuf);
 		node->fullpath = join_path(parent_path, node->name);
 	}
-	
+
 	node->basenamelen = check_node_name(node->name);
 	if (node->basenamelen < 0) {
 		fprintf(stderr, "Warning \"%s\" has incorrect format\n", node->name);
@@ -926,7 +926,7 @@
 		if (off_dt+size_dt > totalsize)
 			die("Structure block extends past total size\n");
 	}
-			
+
 	if (version < 16) {
 		flags |= FTF_FULLPATH | FTF_NAMEPROPS | FTF_VARALIGN;
 	} else {
Index: dtc/ftdump.c
===================================================================
--- dtc.orig/ftdump.c	2007-09-18 11:08:36.000000000 +1000
+++ dtc/ftdump.c	2007-09-18 11:08:39.000000000 +1000
@@ -81,7 +81,7 @@
 static void dump_blob(void *blob)
 {
 	struct boot_param_header *bph = blob;
-	struct reserve_entry *p_rsvmap = 
+	struct reserve_entry *p_rsvmap =
 		(struct reserve_entry *)(blob
 					 + be32_to_cpu(bph->off_mem_rsvmap));
 	char *p_struct = blob + be32_to_cpu(bph->off_dt_struct);
Index: dtc/Makefile
===================================================================
--- dtc.orig/Makefile	2007-09-18 11:09:44.000000000 +1000
+++ dtc/Makefile	2007-09-18 11:09:47.000000000 +1000
@@ -13,7 +13,7 @@
 SUBLEVEL = 0
 EXTRAVERSION =
 LOCAL_VERSION =
-CONFIG_LOCALVERSION = 
+CONFIG_LOCALVERSION =
 
 DTC_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 VERSION_FILE = version_gen.h
Index: dtc/dtc.c
===================================================================
--- dtc.orig/dtc.c	2007-09-18 11:10:00.000000000 +1000
+++ dtc/dtc.c	2007-09-18 11:11:00.000000000 +1000
@@ -1,7 +1,7 @@
 /*
  * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
  *
- * 
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of the
@@ -11,11 +11,11 @@
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  *  General Public License for more details.
- *                                                                       
- *  You should have received a copy of the GNU General Public License    
- *  along with this program; if not, write to the Free Software          
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
- *                                                                   USA 
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
  */
 
 #include "dtc.h"
@@ -218,6 +218,6 @@
 	} else {
 		die("Unknown output format \"%s\"\n", outform);
 	}
-		
+
 	exit(0);
 }
Index: dtc/dtc-lexer.l
===================================================================
--- dtc.orig/dtc-lexer.l	2007-09-18 11:10:28.000000000 +1000
+++ dtc/dtc-lexer.l	2007-09-18 11:10:42.000000000 +1000
@@ -1,7 +1,7 @@
 /*
  * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
  *
- * 
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of the
@@ -11,11 +11,11 @@
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  *  General Public License for more details.
- *                                                                       
- *  You should have received a copy of the GNU General Public License    
- *  along with this program; if not, write to the Free Software          
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
- *                                                                   USA 
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
  */
 
 %option noyywrap nounput yylineno
Index: dtc/dtc-parser.y
===================================================================
--- dtc.orig/dtc-parser.y	2007-09-18 11:11:36.000000000 +1000
+++ dtc/dtc-parser.y	2007-09-18 11:11:47.000000000 +1000
@@ -1,7 +1,7 @@
 /*
  * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
  *
- * 
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of the
@@ -11,11 +11,11 @@
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  *  General Public License for more details.
- *                                                                       
- *  You should have received a copy of the GNU General Public License    
- *  along with this program; if not, write to the Free Software          
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
- *                                                                   USA 
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
  */
 
 %glr-parser
Index: dtc/dtc.h
===================================================================
--- dtc.orig/dtc.h	2007-09-18 11:11:11.000000000 +1000
+++ dtc/dtc.h	2007-09-18 11:11:25.000000000 +1000
@@ -4,7 +4,7 @@
 /*
  * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
  *
- * 
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of the
@@ -14,11 +14,11 @@
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  *  General Public License for more details.
- *                                                                       
- *  You should have received a copy of the GNU General Public License    
- *  along with this program; if not, write to the Free Software          
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
- *                                                                   USA 
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
  */
 
 #include <stdio.h>
Index: dtc/Documentation/dtc-paper.tex
===================================================================
--- dtc.orig/Documentation/dtc-paper.tex	2007-09-18 11:12:23.000000000 +1000
+++ dtc/Documentation/dtc-paper.tex	2007-09-18 11:12:27.000000000 +1000
@@ -193,7 +193,7 @@
     \vdots & \multicolumn{1}{c|}{\vdots} & \\\cline{2-2}
     & \texttt{\dtendnode} \\\cline{2-2}
     & \texttt{\dtend} \\\cline{2-2}
-    \multicolumn{1}{r}{\vdots} & \multicolumn{1}{c}{\vdots} & \\\cline{2-2}    
+    \multicolumn{1}{r}{\vdots} & \multicolumn{1}{c}{\vdots} & \\\cline{2-2}
     \multicolumn{1}{r}{\emph{totalsize}} \\
   \end{tabular}
   \caption{Device tree blob layout}
Index: dtc/Documentation/manual.txt
===================================================================
--- dtc.orig/Documentation/manual.txt	2007-09-18 11:12:07.000000000 +1000
+++ dtc/Documentation/manual.txt	2007-09-18 11:12:11.000000000 +1000
@@ -140,7 +140,7 @@
 
     memreserve:   label 'memreserve' ADDR ADDR ';'
 		| label 'memreserve' ADDR '-' ADDR ';'
-                
+
     devicetree:   '/' nodedef
 
     nodedef:      '{' list_of_property list_of_subnode '}' ';'
Index: dtc/livetree.c
===================================================================
--- dtc.orig/livetree.c	2007-09-18 11:13:12.000000000 +1000
+++ dtc/livetree.c	2007-09-18 11:14:00.000000000 +1000
@@ -1,7 +1,7 @@
 /*
  * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
  *
- * 
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of the
@@ -11,11 +11,11 @@
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  *  General Public License for more details.
- *                                                                       
- *  You should have received a copy of the GNU General Public License    
- *  along with this program; if not, write to the Free Software          
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
- *                                                                   USA 
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
  */
 
 #include "dtc.h"
@@ -41,9 +41,9 @@
 struct property *chain_property(struct property *first, struct property *list)
 {
 	assert(first->next == NULL);
-	
+
 	first->next = list;
-	return first;      
+	return first;
 }
 
 struct node *build_node(struct property *proplist, struct node *children)
@@ -232,7 +232,7 @@
 
 static struct node *get_node_by_phandle(struct node *tree, cell_t phandle)
 {
-	struct node *child, *node;	
+	struct node *child, *node;
 
 	assert((phandle != 0) && (phandle != -1));
 
@@ -333,13 +333,12 @@
 					prop->name, node->fullpath);
 			}
 		}
-			
 
 		/* check name length */
 		if (strlen(prop->name) > MAX_PROPNAME_LEN)
 			WARNMSG("Property name %s is too long in %s\n",
 				prop->name, node->fullpath);
-			
+
 		/* check this property */
 		for (i = 0; i < ARRAY_SIZE(prop_checker_table); i++) {
 			if (streq(prop->name, prop_checker_table[i].propname))
@@ -426,7 +425,7 @@
 				(node)->fullpath, (propname), \
 				prop->val.val, (value)); \
 	} while (0)
-		 
+
 #define CHECK_HAVE_ONECELL(node, propname) \
 	do { \
 		CHECK_HAVE((node), (propname)); \
@@ -553,7 +552,7 @@
 			WARNMSG("physical boot CPU not set.  Use -b option to set\n");
 	}
 
-	return ok;	
+	return ok;
 }
 
 static int check_memory(struct node *root)
@@ -578,7 +577,7 @@
 		return 0;
 	}
 
-	return ok;	
+	return ok;
 }
 
 static int check_chosen(struct node *root)
Index: dtc/fstree.c
===================================================================
--- dtc.orig/fstree.c	2007-09-18 11:14:39.000000000 +1000
+++ dtc/fstree.c	2007-09-18 11:15:02.000000000 +1000
@@ -1,7 +1,7 @@
 /*
  * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
  *
- * 
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of the
@@ -11,11 +11,11 @@
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  *  General Public License for more details.
- *                                                                       
- *  You should have received a copy of the GNU General Public License    
- *  along with this program; if not, write to the Free Software          
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
- *                                                                   USA 
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
  */
 
 #include "dtc.h"
@@ -44,7 +44,7 @@
 			continue;
 
 		tmpnam = join_path(dirname, de->d_name);
-		
+
 		if (lstat(tmpnam, &st) < 0)
 			die("stat(%s): %s\n", tmpnam, strerror(errno));
 
Index: dtc/libfdt/fdt_ro.c
===================================================================
--- dtc.orig/libfdt/fdt_ro.c	2007-09-18 11:14:24.000000000 +1000
+++ dtc/libfdt/fdt_ro.c	2007-09-18 11:14:32.000000000 +1000
@@ -166,7 +166,7 @@
 		p = q;
 	}
 
-	return offset;	
+	return offset;
 }
 
 const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
@@ -244,7 +244,7 @@
 
 				if (lenp)
 					*lenp = len;
-				
+
 				return prop;
 			}
 			break;

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* Re: [PATCH] powerpc: Avoid pointless WARN_ON(irqs_disabled()) from panic codepath
From: Randy Dunlap @ 2007-09-18  1:37 UTC (permalink / raw)
  To: Satyam Sharma
  Cc: linuxppc-dev, Linux, Paul Mackerras, Mailing List,
	Kamalesh Babulal
In-Reply-To: <alpine.LFD.0.999.0709180511070.8863@enigma.security.iitk.ac.in>

On Tue, 18 Sep 2007 05:13:40 +0530 (IST) Satyam Sharma wrote:

> Untested (not even compile-tested) patch.
> Could someone point me to ppc32/64 cross-compilers for i386?

OSDL had some, but those are gone now.
I downloaded all of them and still use them, although it would
be good to have some more recent versions of them.

I put the power* compiler tarballs here:

http://userweb.kernel.org/~rdunlap/cross-compilers/

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply

* dtc: Add basic testcases for dtc
From: David Gibson @ 2007-09-18  0:33 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev

This patch adds a handful of simple testcases for dtc.  It adds a dts
file which should generate the same sample tree as is used for the
libfdt testcases, and tests invoking dtc on this dts, plus the
standard batch of libfdt cases on the resulting dtb, which effectively
checks that the dtb is correct.

Because the test framework assumes each testcase is an executable with
the right output conventions, we use a little shell script, dtc.sh, as
a wrapper around dtc itself.  It simply invokes dtc and returns a PASS
or FAIL depending on whether dtc returned an error.

It's not much, but it's a start.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

---

NB: Jon, you won't be able to simply git-applymbox this and have it
work.  You'll need to manually add execute permission to tests/dtc.sh
before git commiting it, since I can't encode the permissions in a
patch.  Sorry for the inconvenience, but it didn't really seem worth
setting up my own git to pull from just for that.

Index: dtc/tests/run_tests.sh
===================================================================
--- dtc.orig/tests/run_tests.sh	2007-09-18 10:06:28.000000000 +1000
+++ dtc/tests/run_tests.sh	2007-09-18 10:06:31.000000000 +1000
@@ -86,6 +86,14 @@
     run_test truncated_property
 }
 
+dtc_tests () {
+    # Make sure we don't have stale blobs lying around
+    rm -f *.test.dtb
+
+    run_test dtc.sh -f -I dts -O dtb -o dtc_tree1.test.dtb test_tree1.dts
+    tree1_tests dtc_tree1.test.dtb
+}
+
 while getopts "vdt:" ARG ; do
     case $ARG in
 	"v")
@@ -98,7 +106,7 @@
 done
 
 if [ -z "$TESTSETS" ]; then
-    TESTSETS="libfdt"
+    TESTSETS="libfdt dtc"
 fi
 
 for set in $TESTSETS; do
@@ -106,6 +114,9 @@
 	"libfdt")
 	    libfdt_tests
 	    ;;
+	"dtc")
+	    dtc_tests
+	    ;;
     esac
 done
 
Index: dtc/tests/test_tree1.dts
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ dtc/tests/test_tree1.dts	2007-09-18 10:06:31.000000000 +1000
@@ -0,0 +1,20 @@
+/ {
+	prop-int = <deadbeef>;
+	prop-str = "hello world";
+
+	subnode1 {
+		prop-int = <deadbeef>;
+
+		subsubnode {
+			prop-int = <deadbeef>;
+		};
+	};
+
+	subnode2 {
+		prop-int = <abcd1234>;
+
+		subsubnode {
+			prop-int = <abcd1234>;
+		};
+	};
+};
Index: dtc/tests/dtc.sh
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ dtc/tests/dtc.sh	2007-09-18 10:07:34.000000000 +1000
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+PASS () {
+    echo "PASS"
+    exit 0
+}
+
+FAIL () {
+    echo "FAIL" "$@"
+    exit 2
+}
+
+DTC=../dtc
+
+verbose_run () {
+    if [ -z "$QUIET_TEST" ]; then
+	"$@"
+    else
+	"$@" > /dev/null 2> /dev/null
+    fi
+}
+
+if verbose_run "$DTC" "$@"; then
+    PASS
+else
+    ret="$?"
+    FAIL "dtc returned error code $ret"
+fi
Index: dtc/tests/Makefile.tests
===================================================================
--- dtc.orig/tests/Makefile.tests	2007-09-18 10:27:30.000000000 +1000
+++ dtc/tests/Makefile.tests	2007-09-18 10:27:46.000000000 +1000
@@ -43,10 +43,10 @@
 	rm -f $(STD_CLEANFILES:%=$(TESTS_PREFIX)%)
 	rm -f $(TESTS_CLEANFILES)
 
-check:	tests
+check:	tests dtc
 	cd $(TESTS_PREFIX); ./run_tests.sh
 
-checkv:	tests
+checkv:	tests dtc
 	cd $(TESTS_PREFIX); ./run_tests.sh -v
 
 ifneq ($(DEPTARGETS),)

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* Re: [PATCH] powerpc: Avoid pointless WARN_ON(irqs_disabled()) from panic codepath
From: Satyam Sharma @ 2007-09-18  0:08 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Linux Kernel Mailing List, Kamalesh Babulal
In-Reply-To: <alpine.LFD.0.999.0709180511070.8863@enigma.security.iitk.ac.in>



On Tue, 18 Sep 2007, Satyam Sharma wrote:
> 
> > ------------[ cut here ]------------
> > Badness at arch/powerpc/kernel/smp.c:202
> 
> comes when smp_call_function_map() has been called with irqs disabled,
> which is illegal. However, there is a special case, the panic() codepath,
> when we do not want to warn about this -- warning at that time is pointless
> anyway, and only serves to scroll away the *real* cause of the panic and
> distracts from the real bug.

BTW arch/ppc/ has same issue, but that's gonna be removed by next year
anyways, so I think there's no point making a patch for that (?)

^ permalink raw reply

* [PATCH] powerpc: Avoid pointless WARN_ON(irqs_disabled()) from panic codepath
From: Satyam Sharma @ 2007-09-17 23:43 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Linux Kernel Mailing List, Kamalesh Babulal
In-Reply-To: <a781481a0709140337u2c26f770h2af6d457bc39f280@mail.gmail.com>


> ------------[ cut here ]------------
> Badness at arch/powerpc/kernel/smp.c:202

comes when smp_call_function_map() has been called with irqs disabled,
which is illegal. However, there is a special case, the panic() codepath,
when we do not want to warn about this -- warning at that time is pointless
anyway, and only serves to scroll away the *real* cause of the panic and
distracts from the real bug.

* So let's extract the WARN_ON() from smp_call_function_map() into all its
  callers -- smp_call_function() and smp_call_function_single()

* Also, introduce another caller of smp_call_function_map(), namely
  __smp_call_function() (and make smp_call_function() a wrapper over this)
  which does *not* warn about disabled irqs

* Use this __smp_call_function() from the panic codepath's smp_send_stop()

We also end having to move code of smp_send_stop() below the definition
of __smp_call_function().

Signed-off-by: Satyam Sharma <satyam@infradead.org>

---

Untested (not even compile-tested) patch.
Could someone point me to ppc32/64 cross-compilers for i386?

 arch/powerpc/kernel/smp.c |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 1ea4316..b24dcba 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -152,11 +152,6 @@ static void stop_this_cpu(void *dummy)
 		;
 }
 
-void smp_send_stop(void)
-{
-	smp_call_function(stop_this_cpu, NULL, 1, 0);
-}
-
 /*
  * Structure and data for smp_call_function(). This is designed to minimise
  * static memory requirements. It also looks cleaner.
@@ -198,9 +193,6 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
 	int cpu;
 	u64 timeout;
 
-	/* Can deadlock when called with interrupts disabled */
-	WARN_ON(irqs_disabled());
-
 	if (unlikely(smp_ops == NULL))
 		return ret;
 
@@ -270,10 +262,19 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
 	return ret;
 }
 
+static int __smp_call_function(void (*func)(void *info), void *info,
+			       int nonatomic, int wait)
+{
+	return smp_call_function_map(func,info,nonatomic,wait,cpu_online_map);
+}
+
 int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
 			int wait)
 {
-	return smp_call_function_map(func,info,nonatomic,wait,cpu_online_map);
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
+
+	return __smp_call_function(func, info, nonatomic, wait);
 }
 EXPORT_SYMBOL(smp_call_function);
 
@@ -283,6 +284,9 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int
 	cpumask_t map = CPU_MASK_NONE;
 	int ret = 0;
 
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
+
 	if (!cpu_online(cpu))
 		return -EINVAL;
 
@@ -299,6 +303,11 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int
 }
 EXPORT_SYMBOL(smp_call_function_single);
 
+void smp_send_stop(void)
+{
+	__smp_call_function(stop_this_cpu, NULL, 1, 0);
+}
+
 void smp_call_function_interrupt(void)
 {
 	void (*func) (void *info);

^ permalink raw reply related

* RE: [PATCH] [POWERPC] Fix build errors when BLOCK=n
From: Medve Emilian-EMMEDVE1 @ 2007-09-17 22:43 UTC (permalink / raw)
  To: dhowells; +Cc: linuxppc-dev, Gala Kumar-B11780, paulus, bzolnier, linux-ide
In-Reply-To: <16939.1190068482@redhat.com>

Hi David,


I've seen you patch earlier, but I'm not trying to solve the BSG related
problem/warnings. That's why I put a reference to an already existing
commit addressing the BSG/bsg.h warnings. I'm trying to address a
slightly different problem in the PowerPC code only.


Cheers,
Emil.


> -----Original Message-----
> From: dhowells@redhat.com [mailto:dhowells@redhat.com]=20
> Sent: Monday, September 17, 2007 5:35 PM
> To: Medve Emilian-EMMEDVE1
> Cc: dhowells@redhat.com; paulus@samba.org; Gala Kumar-B11780;=20
> linuxppc-dev@ozlabs.org; bzolnier@gmail.com; linux-ide@vger.kernel.org
> Subject: Re: [PATCH] [POWERPC] Fix build errors when BLOCK=3Dn
>=20
>=20
> Try the attached.
>=20
> David
> ---
> [PATCH] VFS: Make BSG declarations dependent on CONFIG_BLOCK
>=20
> From: David Howells <dhowells@redhat.com>
>=20
> Make BSG function declarations dependent on CONFIG_BLOCK as=20
> they are not
> compilable if the block layer is compiled out.
>=20
> Signed-off-by: David Howells <dhowells@redhat.com>
> ---
>=20
>  include/linux/bsg.h |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>=20
> diff --git a/include/linux/bsg.h b/include/linux/bsg.h
> index 60e377b..28f5d44 100644
> --- a/include/linux/bsg.h
> +++ b/include/linux/bsg.h
> @@ -52,6 +52,7 @@ struct sg_io_v4 {
>  };
> =20
>  #ifdef __KERNEL__
> +#ifdef CONFIG_BLOCK
> =20
>  #if defined(CONFIG_BLK_DEV_BSG)
>  struct bsg_class_device {
> @@ -73,6 +74,7 @@ static inline void=20
> bsg_unregister_queue(struct request_queue *rq)
>  }
>  #endif
> =20
> +#endif /* CONFIG_BLOCK */
>  #endif /* __KERNEL__ */
> =20
>  #endif

^ permalink raw reply

* Re: [PATCH] [POWERPC] Fix build errors when BLOCK=n
From: David Howells @ 2007-09-17 22:34 UTC (permalink / raw)
  To: Emil Medve; +Cc: bzolnier, linux-ide, kumar.gala, linuxppc-dev, paulus
In-Reply-To: <11900663131073-git-send-email-Emilian.Medve@Freescale.com>


Try the attached.

David
---
[PATCH] VFS: Make BSG declarations dependent on CONFIG_BLOCK

From: David Howells <dhowells@redhat.com>

Make BSG function declarations dependent on CONFIG_BLOCK as they are not
compilable if the block layer is compiled out.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/bsg.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/bsg.h b/include/linux/bsg.h
index 60e377b..28f5d44 100644
--- a/include/linux/bsg.h
+++ b/include/linux/bsg.h
@@ -52,6 +52,7 @@ struct sg_io_v4 {
 };
 
 #ifdef __KERNEL__
+#ifdef CONFIG_BLOCK
 
 #if defined(CONFIG_BLK_DEV_BSG)
 struct bsg_class_device {
@@ -73,6 +74,7 @@ static inline void bsg_unregister_queue(struct request_queue *rq)
 }
 #endif
 
+#endif /* CONFIG_BLOCK */
 #endif /* __KERNEL__ */
 
 #endif

^ permalink raw reply related

* Re: [PATCH 1/3] IB/ehca: Fix large page HW cap defines
From: Roland Dreier @ 2007-09-17 22:12 UTC (permalink / raw)
  To: Joachim Fenkes
  Cc: LKML, OF-EWG, LinuxPPC-Dev, Christoph Raisch, OF-General,
	Stefan Roscher
In-Reply-To: <200709131814.59307.fenkes@de.ibm.com>

obviously OK...applied.

^ permalink raw reply

* Re: [PATCH] phy: export phy_mii_ioctl
From: Jon Smirl @ 2007-09-17 22:08 UTC (permalink / raw)
  To: Domen Puncer; +Cc: netdev, Jeff Garzik, linuxppc-embedded
In-Reply-To: <20070917202140.GB2642@nd47.coderock.org>

On 9/17/07, Domen Puncer <domen@coderock.org> wrote:
> Export phy_mii_ioctl, so network drivers can use it when built
> as modules too.

Domen, do you want to collect all of these changes for MPC5200 FEC in
to a single patch series? The code is getting scattered around, I'll
check it over to make sure it is all working. I have these patches
applied individually and they all work.

It builds on this series:
[PATCH 0/7] MPC52xx Bestcomm submission for 2.6.24

If you can put this together is a clean series, I should be able to
layer support for the Phytec pcm030 on top of it.

It would be these three combined...

http://coderock.org/tmp/fec-v3rc1/

diff --git a/drivers/net/fec_mpc52xx/fec.c b/drivers/net/fec_mpc52xx/fec.c
index 922e9a8..c4442e0 100644
--- a/drivers/net/fec_mpc52xx/fec.c
+++ b/drivers/net/fec_mpc52xx/fec.c
@@ -1087,11 +1087,13 @@ static struct of_platform_driver mpc52xx_fec_driver = {
 /* ======================================================================== */
 /* Module                                                                   */
 /* ======================================================================== */
+extern int fec_mdio_init(void);
+void fec_mdio_exit(void);

 static int __init
 mpc52xx_fec_init(void)
 {
-#ifdef FEC_MPC52xx_MDIO
+#ifdef CONFIG_FEC_MPC52xx_MDIO
       int ret;
       ret = fec_mdio_init();
       if (ret) {
@@ -1106,7 +1108,7 @@ static void __exit
 mpc52xx_fec_exit(void)
 {
       of_unregister_platform_driver(&mpc52xx_fec_driver);
-#ifdef FEC_MPC52xx_MDIO
+#ifdef CONFIG_FEC_MPC52xx_MDIO
       fec_mdio_exit();
 #endif
 }


>
> Signed-off-by: Domen Puncer <domen@coderock.org>
>
> ---
> On 17/09/07 11:53 +0200, Sven Luther wrote:
> > On Sat, Sep 15, 2007 at 02:14:44PM +0200, Domen Puncer wrote:
> > > Updated and split version at:
> > > http://coderock.org/tmp/fec-v3rc1/
> > >
> > > I'll repost to lists once I run-test them.
> >
> > When applying those patches, the build did die with :
> >
> >
> >   ERROR: "phy_mii_ioctl" [drivers/net/fec_mpc52xx/fec_mpc52xx.ko] undefined!
> >
> > Apparently, phy_mii_ioctl is not an exported symbol.
> >
> > Domen, did you maybe forget a little snipplet when you cut the patches
> > in different pieces ? Or did i mess up applying them ?
> >
> > Friendly,
> >
> > Sven Luther
>
>
>  drivers/net/phy/phy.c |    1 +
>  1 files changed, 1 insertion(+)
>
> Index: linux.git/drivers/net/phy/phy.c
> ===================================================================
> --- linux.git.orig/drivers/net/phy/phy.c
> +++ linux.git/drivers/net/phy/phy.c
> @@ -409,6 +409,7 @@ int phy_mii_ioctl(struct phy_device *phy
>
>         return 0;
>  }
> +EXPORT_SYMBOL(phy_mii_ioctl);
>
>  /**
>   * phy_start_aneg - start auto-negotiation for this PHY device
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>


-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply related

* [PATCH] [POWERPC] Fix build errors when BLOCK=n
From: Emil Medve @ 2007-09-17 21:58 UTC (permalink / raw)
  To: paulus, kumar.gala, linuxppc-dev, bzolnier, linux-ide; +Cc: Emil Medve

These are the symptom error messages:

  CC      arch/powerpc/kernel/setup_32.o
In file included from include/linux/blkdev.h:17,
                 from include/linux/ide.h:13,
                 from arch/powerpc/kernel/setup_32.c:13:
include/linux/bsg.h:67: warning: 'struct request_queue' declared inside parameter list
include/linux/bsg.h:67: warning: its scope is only this definition or declaration, which is probably not what you want
include/linux/bsg.h:71: warning: 'struct request_queue' declared inside parameter list
In file included from arch/powerpc/kernel/setup_32.c:13:
include/linux/ide.h:857: error: field 'wrq' has incomplete type

  CC      arch/powerpc/kernel/ppc_ksyms.o
In file included from include/linux/blkdev.h:17,
                 from include/linux/ide.h:13,
                 from arch/powerpc/kernel/ppc_ksyms.c:15:
include/linux/bsg.h:67: warning: 'struct request_queue' declared inside parameter list
include/linux/bsg.h:67: warning: its scope is only this definition or declaration, which is probably not what you want
include/linux/bsg.h:71: warning: 'struct request_queue' declared inside parameter list
In file included from arch/powerpc/kernel/ppc_ksyms.c:15:
include/linux/ide.h:857: error: field 'wrq' has incomplete type

The fix tries to use the smallest scope CONFIG_* symbols that will fix the build
problem. In this case <linux/ide.h> needs to be included only if IDE=y or
IDE=m were selected. Also, ppc_ide_md is needed only if BLK_DEV_IDE=y or
BLK_DEV_IDE=m

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---

I tested that the code builds with this patch in various combinations of
configuration options: all the combinations involving BLOCK, IDE and BLK_DEV_IDE

A patch for the warnings above has been already commited here: http://git.kernel.org/?p=linux/kernel/git/jejb/scsi-misc-2.6.git;a=commitdiff;h=49892223f7d3a2333ef9e6cbdd526676e1fc517a

This a patch against Paul's tree (01f1c735f57548e6b862e815cc845e452405643d)

powerpc> scripts/checkpatch.pl 0001-POWERPC-Fix-build-errors-when-BLOCK-n.patch 
Your patch has no obvious style problems and is ready for submission.

 arch/powerpc/kernel/ppc_ksyms.c |    5 ++++-
 arch/powerpc/kernel/setup_32.c  |    4 ++++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 430c502..ba3a928 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -12,12 +12,15 @@
 #include <linux/irq.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
+#if defined(CONFIG_IDE) || defined(CONFIG_IDE_MODULE)
 #include <linux/ide.h>
+#endif
 #include <linux/bitops.h>
 
 #include <asm/page.h>
 #include <asm/semaphore.h>
 #include <asm/processor.h>
+#include <asm/cacheflush.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/atomic.h>
@@ -95,7 +98,7 @@ EXPORT_SYMBOL(__strnlen_user);
 EXPORT_SYMBOL(copy_4K_page);
 #endif
 
-#if defined(CONFIG_PPC32) && (defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE))
+#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
 EXPORT_SYMBOL(ppc_ide_md);
 #endif
 
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index a288a5f..3d46a30 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -10,7 +10,9 @@
 #include <linux/reboot.h>
 #include <linux/delay.h>
 #include <linux/initrd.h>
+#if defined(CONFIG_IDE) || defined(CONFIG_IDE_MODULE)
 #include <linux/ide.h>
+#endif
 #include <linux/tty.h>
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
@@ -49,7 +51,9 @@
 
 extern void bootx_init(unsigned long r4, unsigned long phys);
 
+#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
 struct ide_machdep_calls ppc_ide_md;
+#endif
 
 int boot_cpuid;
 EXPORT_SYMBOL_GPL(boot_cpuid);
-- 
1.5.3.GIT

^ permalink raw reply related

* Ethernet adapter not found in Xilinx ppc, with linux 2.6.22
From: Junqiang Hu @ 2007-09-17 21:48 UTC (permalink / raw)
  To: linuxppc-embedded



After several days of struggling I'm now able to boot the linux 2.6.22 and
run the busybox-1.7.1 root system.  Yet I could not find the Ethernet
adapter using Xilinx GMAC core.  Pretty sure that I've chosen the 10/100
Ethernet drivers.  Should I use the Xilinx driver xemac, or other drivers,
or any other way to apply a patch?

Thanks~
.J
-- 
View this message in context: http://www.nabble.com/Ethernet-adapter-not-found-in-Xilinx-ppc%2C-with-linux-2.6.22-tf4470255.html#a12745876
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* [PATCH] phy: export phy_mii_ioctl
From: Domen Puncer @ 2007-09-17 20:21 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, linuxppc-embedded
In-Reply-To: <20070917095334.GA4546@powerlinux.fr>

Export phy_mii_ioctl, so network drivers can use it when built
as modules too.

Signed-off-by: Domen Puncer <domen@coderock.org>

---
On 17/09/07 11:53 +0200, Sven Luther wrote:
> On Sat, Sep 15, 2007 at 02:14:44PM +0200, Domen Puncer wrote:
> > Updated and split version at:
> > http://coderock.org/tmp/fec-v3rc1/
> > 
> > I'll repost to lists once I run-test them.
> 
> When applying those patches, the build did die with :
> 
> 
>   ERROR: "phy_mii_ioctl" [drivers/net/fec_mpc52xx/fec_mpc52xx.ko] undefined!
> 
> Apparently, phy_mii_ioctl is not an exported symbol.
> 
> Domen, did you maybe forget a little snipplet when you cut the patches
> in different pieces ? Or did i mess up applying them ?
> 
> Friendly,
> 
> Sven Luther


 drivers/net/phy/phy.c |    1 +
 1 files changed, 1 insertion(+)

Index: linux.git/drivers/net/phy/phy.c
===================================================================
--- linux.git.orig/drivers/net/phy/phy.c
+++ linux.git/drivers/net/phy/phy.c
@@ -409,6 +409,7 @@ int phy_mii_ioctl(struct phy_device *phy
 
 	return 0;
 }
+EXPORT_SYMBOL(phy_mii_ioctl);
 
 /**
  * phy_start_aneg - start auto-negotiation for this PHY device

^ permalink raw reply

* [PATCH] [POWERPC] Support setting affinity for U3/U4 MSI sources
From: Olof Johansson @ 2007-09-17 20:12 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

Hook up affinity-setting for U3/U4 MSI interrupt sources.

Tested on Quad G5 with myri10ge.


Signed-off-by: Olof Johansson <olof@lixom.net>

diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 8de29f2..22600fd 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -768,7 +768,7 @@ static void mpic_end_ipi(unsigned int irq)
 
 #endif /* CONFIG_SMP */
 
-static void mpic_set_affinity(unsigned int irq, cpumask_t cpumask)
+void mpic_set_affinity(unsigned int irq, cpumask_t cpumask)
 {
 	struct mpic *mpic = mpic_from_irq(irq);
 	unsigned int src = mpic_irq_to_hw(irq);
diff --git a/arch/powerpc/sysdev/mpic.h b/arch/powerpc/sysdev/mpic.h
index 3a1c3d2..1cb6bd8 100644
--- a/arch/powerpc/sysdev/mpic.h
+++ b/arch/powerpc/sysdev/mpic.h
@@ -34,5 +34,6 @@ extern int mpic_set_irq_type(unsigned int virq, unsigned int flow_type);
 extern void mpic_end_irq(unsigned int irq);
 extern void mpic_mask_irq(unsigned int irq);
 extern void mpic_unmask_irq(unsigned int irq);
+extern void mpic_set_affinity(unsigned int irq, cpumask_t cpumask);
 
 #endif /* _POWERPC_SYSDEV_MPIC_H */
diff --git a/arch/powerpc/sysdev/mpic_u3msi.c b/arch/powerpc/sysdev/mpic_u3msi.c
index 305b864..0fc4e96 100644
--- a/arch/powerpc/sysdev/mpic_u3msi.c
+++ b/arch/powerpc/sysdev/mpic_u3msi.c
@@ -40,6 +40,7 @@ static struct irq_chip mpic_u3msi_chip = {
 	.unmask		= mpic_u3msi_unmask_irq,
 	.eoi		= mpic_end_irq,
 	.set_type	= mpic_set_irq_type,
+	.set_affinity	= mpic_set_affinity,
 	.typename	= "MPIC-U3MSI",
 };
 

^ permalink raw reply related

* Re: [PATCH] i2c: devtree-aware iic support for PPC4xx
From: Grant Likely @ 2007-09-17 19:27 UTC (permalink / raw)
  To: Stefan Roese; +Cc: Jean Delvare, linuxppc-dev, i2c
In-Reply-To: <200709170734.09079.sr@denx.de>

On 9/16/07, Stefan Roese <sr@denx.de> wrote:
> On Sunday 16 September 2007, Eugene Surovegin wrote:
> > Hmm, I just noticed that you basically added a copy of existing
> > driver with small changes to support OF while keeping OCP one.
> >
> > Why not just add OF support to the existing code (under some ifdef),
> > and then remove OCP support as soon as ppc -> powerpc transition is
> > finished? Why have two almost identical code in the tree?
>
> My understanding was, that adding many #ifdef's into the code was not the
> preferred way. I could of course change this patch to not add an additional
> driver but extend the existing driver with a bunch of #ifdef's to support
> both versions.
>
> This approach of multiple drivers seems to be common in the kernel right now:
>
> drivers/mtd/maps/physmap.c
> drivers/mtd/maps/physmap_of.c
>
> or
>
> drivers/usb/host/ohci-ppc-soc.c
> drivers/usb/host/ohci-ppc-of.c
>
> Any other opinions on this? How should this be handled to get accepted
> upstream? Two different drivers with removing the "old" one later when
> arch/ppc is gone, or one driver which supports both versions and removing the
> ocp support in this driver later?

FWIW, I'm not a big fan of duplicating drivers, and I don't think it
should be necessary.  If a large number of #ifdef block are needed
then it may be that it would be better to refactor parts of the driver
to localize the conditionally compiled code.

Also, neither of these examples are particularly strong support.  In
both cases (physmap and ohci-ppc) the mentioned C files are bus
mappings only, not the actual driver.  In this scenario it does make
sense to use separate files, but it requires the dependent driver to
be abstracted enough to support multiple bindings.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: libfdt: Consistently use big-endian property data in testcases
From: Jon Loeliger @ 2007-09-17 19:24 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20070917054236.GA9303@localhost.localdomain>

So, like, the other day David Gibson mumbled:
> Flat device trees always have integers in their structure stored as
> big-endian.  From this point of view, property values are
> bags-of-bytes and any endianness is up to users of the device tree to
> determine.
> 
> The libfdt testcases which use properties with integer values,
> currently use native endian format for the architecture on which the
> testcases are run.  This works ok for now, since both the creation and
> checking of the example device trees happen in the same endianness.
> 
> This will become a problem, however, for tests of dtc which we want to
> add in the nearish future.  dtc always uses big-endian format for
> 'cell' format data in properties; as it needs to in order to produce
> powerpc-usable device trees when hosted on a little-endian
> architecture.
> 
> This patch, therefore, changes the libfdt testsuite to use big-endian
> format always for integer format data, in order to interoperate sanely
> with future dtc testcases.  This also means that the example trees
> created by the testsuite should now be byte-for-byte identical
> regardless of dtc and libfdt's host platform, which is arguably an
> advantage.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Applied.

jdl

^ permalink raw reply

* Re: dtc: Cleanup testsuite organization
From: Jon Loeliger @ 2007-09-17 19:23 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20070917043924.GJ32725@localhost.localdomain>

So, like, the other day David Gibson mumbled:
> run_tests.sh from the dtc testsuite currently has a facility ro run
> just "functional" or just "stress" tests.  This distinction is carried
> over from libhugetlbfs where the test framework originated, and where
> it made sense.
> 
> In dtc, we have no stress tests, so running these subsections isn't
> particularly interesting.  This patch removes these test subsets,
> instead defining a single "libfdt" test subset for testcases related
> to libfdt (and not dtc proper only.  Currently that's all of the
> testcases, but with any luck we'll have some dtc testcases in the
> future.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Applied.

jdl

^ permalink raw reply

* Re: libfdt: Add fdt_node_offset_by_prop_value()
From: Jon Loeliger @ 2007-09-17 19:23 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20070917042834.GI32725@localhost.localdomain>

So, like, the other day David Gibson mumbled:
> This patch adds a function to libfdt to locate nodes containing a
> property with a specific value.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Applied.

jdl

^ permalink raw reply

* Re: [PATCH] i2c: devtree-aware iic support for PPC4xx
From: Jean Delvare @ 2007-09-17 18:16 UTC (permalink / raw)
  To: Stefan Roese; +Cc: linuxppc-dev, i2c
In-Reply-To: <200709170734.09079.sr@denx.de>

Hi Stefan,

On Mon, 17 Sep 2007 07:34:08 +0200, Stefan Roese wrote:
> On Sunday 16 September 2007, Eugene Surovegin wrote:
> > Hmm, I just noticed that you basically added a copy of existing
> > driver with small changes to support OF while keeping OCP one.
> >
> > Why not just add OF support to the existing code (under some ifdef),
> > and then remove OCP support as soon as ppc -> powerpc transition is
> > finished? Why have two almost identical code in the tree?
> 
> My understanding was, that adding many #ifdef's into the code was not the 
> preferred way. I could of course change this patch to not add an additional 
> driver but extend the existing driver with a bunch of #ifdef's to support 
> both versions.
> 
> This approach of multiple drivers seems to be common in the kernel right now:
> 
> drivers/mtd/maps/physmap.c
> drivers/mtd/maps/physmap_of.c
> 
> or
> 
> drivers/usb/host/ohci-ppc-soc.c
> drivers/usb/host/ohci-ppc-of.c
> 
> Any other opinions on this? How should this be handled to get accepted 
> upstream? Two different drivers with removing the "old" one later when 
> arch/ppc is gone, or one driver which supports both versions and removing the 
> ocp support in this driver later?

I'd prefer a single driver with ifdef's. Only the registration and
cleanup parts should be different, the actual I2C bus driving code
should be pretty much the same. With some efforts it should be possible
to reduce the ifdef clutter to a minimum.

> (...)
> The "old" name "i2c-ibm_iic" is kind of redundant. Nearly all bus drivers are 
> named "i2c-platform". Perhaps a better name would be "i2c-ppc4xx" then.

Agreed. But that being said, changing the name now while the old name
has been used for years might cause more trouble than it solves.

-- 
Jean Delvare

^ permalink raw reply

* [PATCH 0/1] ppc64: Convert cpu_sibling_map to a per_cpu data array ppc64 v2
From: travis @ 2007-09-17 18:35 UTC (permalink / raw)
  To: sfr, Andrew Morton
  Cc: linux-mm, Andi Kleen, linux-kernel, linuxppc-dev, sparclinux,
	Christoph Lameter


Stephen Rothwell wrote:
> On Mon, 17 Sep 2007 16:28:31 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>> 	the topology (on my POWERPC5+ box) is not correct:
>>
>> cpu0/topology/thread_siblings:0000000f
>> cpu1/topology/thread_siblings:0000000f
>> cpu2/topology/thread_siblings:0000000f
>> cpu3/topology/thread_siblings:0000000f
>>
>> it used to be:
>>
>> cpu0/topology/thread_siblings:00000003
>> cpu1/topology/thread_siblings:00000003
>> cpu2/topology/thread_siblings:0000000c
>> cpu3/topology/thread_siblings:0000000c
> 
> This would be because we are setting up the cpu_sibling map before we
> call setup_per_cpu_areas().

The following patch hopefully should fix this problem.  I'm
not able to build or test it but the few references to 
cpu_sibling_map seem to all occur well after setup_per_cpu_areas
is called.

Thanks Stephen for checking this out!

-- 

^ permalink raw reply

* [PATCH 1/1] ppc64: Convert cpu_sibling_map to a per_cpu data array ppc64 v2
From: travis @ 2007-09-17 18:35 UTC (permalink / raw)
  To: sfr, Andrew Morton
  Cc: linux-mm, Andi Kleen, linux-kernel, linuxppc-dev, sparclinux,
	Christoph Lameter
In-Reply-To: <20070917183507.332345000@sgi.com>

v2: 

This patch applies after:

	convert-cpu_sibling_map-to-a-per_cpu-data-array-ppc64.patch

and should fix the "reference cpu_sibling_map before setup_per_cpu_areas()
has been called" problem.  In addtion, the cpu_sibiling_map macro has been
removed [this was missed in my original submission.]

Original Notes:

Convert cpu_sibling_map to a per_cpu cpumask_t array for the ppc64
architecture.  This fixes build errors in block/blktrace.c and
kernel/sched.c when CONFIG_SCHED_SMT is defined.

Note: these changes have not been built nor tested.

Signed-off-by: Mike Travis <travis@sgi.com>
---
 arch/powerpc/kernel/setup-common.c        |   20 ++++++++++++++++----
 arch/powerpc/kernel/setup_64.c            |    3 +++
 arch/powerpc/platforms/cell/cbe_cpufreq.c |    2 +-
 include/asm-powerpc/smp.h                 |    2 +-
 include/asm-powerpc/topology.h            |    2 +-
 5 files changed, 22 insertions(+), 7 deletions(-)

--- a/include/asm-powerpc/smp.h
+++ b/include/asm-powerpc/smp.h
@@ -60,7 +60,6 @@
 #endif
 
 DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
-#define cpu_sibling_map(cpu) per_cpu(cpu_sibling_map, cpu)
 
 /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
  *
@@ -79,6 +78,7 @@
 void smp_init_cell(void);
 void smp_init_celleb(void);
 void smp_setup_cpu_maps(void);
+void smp_setup_cpu_sibling_map(void);
 
 extern int __cpu_disable(void);
 extern void __cpu_die(unsigned int cpu);
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -596,6 +596,9 @@
 		paca[i].data_offset = ptr - __per_cpu_start;
 		memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
 	}
+
+	/* Now that per_cpu is setup, initialize cpu_sibling_map */
+	smp_setup_cpu_sibling_map();
 }
 #endif
 
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -411,16 +411,28 @@
 		of_node_put(dn);
 	}
 
+	vdso_data->processorCount = num_present_cpus();
+#endif /* CONFIG_PPC64 */
+}
+
+/*
+ * Being that cpu_sibling_map is now a per_cpu array, then it cannot
+ * be initialized until the per_cpu areas have been created.  This
+ * function is now called from setup_per_cpu_areas().
+ */
+void __init smp_setup_cpu_sibling_map(void)
+{
+#if defined(CONFIG_PPC64)
+	int cpu;
+
 	/*
 	 * Do the sibling map; assume only two threads per processor.
 	 */
 	for_each_possible_cpu(cpu) {
-		cpu_set(cpu, cpu_sibling_map(cpu));
+		cpu_set(cpu, per_cpu(cpu_sibling_map, cpu));
 		if (cpu_has_feature(CPU_FTR_SMT))
-			cpu_set(cpu ^ 0x1, cpu_sibling_map(cpu));
+			cpu_set(cpu ^ 0x1, per_cpu(cpu_sibling_map, cpu));
 	}
-
-	vdso_data->processorCount = num_present_cpus();
 #endif /* CONFIG_PPC64 */
 }
 #endif /* CONFIG_SMP */
--- a/arch/powerpc/platforms/cell/cbe_cpufreq.c
+++ b/arch/powerpc/platforms/cell/cbe_cpufreq.c
@@ -119,7 +119,7 @@
 	policy->cur = cbe_freqs[cur_pmode].frequency;
 
 #ifdef CONFIG_SMP
-	policy->cpus = cpu_sibling_map(policy->cpu);
+	policy->cpus = per_cpu(cpu_sibling_map, policy->cpu);
 #endif
 
 	cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu);
--- a/include/asm-powerpc/topology.h
+++ b/include/asm-powerpc/topology.h
@@ -108,7 +108,7 @@
 #ifdef CONFIG_PPC64
 #include <asm/smp.h>
 
-#define topology_thread_siblings(cpu)	(cpu_sibling_map(cpu))
+#define topology_thread_siblings(cpu)	(per_cpu(cpu_sibling_map, cpu))
 #endif
 #endif
 

-- 

^ permalink raw reply

* [PATCH 1/3] usb: add device-tree-aware ehci driver
From: Valentine Barshak @ 2007-09-17 18:18 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-usb-devel
In-Reply-To: <20070917232809.1221acd9.sfr@canb.auug.org.au>

This adds ehci-ppc-of driver. The code is based on the
ehci-ppc-soc driver by Stefan Roese <sr@denx.de>.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
---
 drivers/usb/host/Kconfig       |    8 +
 drivers/usb/host/ehci-hcd.c    |   16 ++
 drivers/usb/host/ehci-ppc-of.c |  220 +++++++++++++++++++++++++++++++++++++++++
 drivers/usb/host/ehci.h        |    2 
 4 files changed, 244 insertions(+), 2 deletions(-)

diff -ruN linux-2.6.orig/drivers/usb/host/ehci.h linux-2.6/drivers/usb/host/ehci.h
--- linux-2.6.orig/drivers/usb/host/ehci.h	2007-09-15 14:28:42.000000000 +0400
+++ linux-2.6/drivers/usb/host/ehci.h	2007-09-15 15:12:04.000000000 +0400
@@ -725,7 +725,7 @@
  * definition below can die once the 4xx support is
  * finally ported over.
  */
-#if defined(CONFIG_PPC)
+#if defined(CONFIG_PPC) && !defined(CONFIG_PPC_MERGE)
 #define readl_be(addr)		in_be32((__force unsigned *)addr)
 #define writel_be(val, addr)	out_be32((__force unsigned *)addr, val)
 #endif
diff -ruN linux-2.6.orig/drivers/usb/host/ehci-hcd.c linux-2.6/drivers/usb/host/ehci-hcd.c
--- linux-2.6.orig/drivers/usb/host/ehci-hcd.c	2007-09-15 14:28:42.000000000 +0400
+++ linux-2.6/drivers/usb/host/ehci-hcd.c	2007-09-15 15:12:04.000000000 +0400
@@ -944,11 +944,16 @@
 #define	PS3_SYSTEM_BUS_DRIVER	ps3_ehci_driver
 #endif
 
-#ifdef CONFIG_440EPX
+#if defined(CONFIG_440EPX) && !defined(CONFIG_PPC_MERGE)
 #include "ehci-ppc-soc.c"
 #define	PLATFORM_DRIVER		ehci_ppc_soc_driver
 #endif
 
+#ifdef CONFIG_USB_EHCI_HCD_PPC_OF
+#include "ehci-ppc-of.c"
+#define OF_PLATFORM_DRIVER	ehci_hcd_ppc_of_driver
+#endif
+
 #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
     !defined(PS3_SYSTEM_BUS_DRIVER)
 #error "missing bus glue for ehci-hcd"
@@ -963,6 +968,12 @@
 		 sizeof(struct ehci_qh), sizeof(struct ehci_qtd),
 		 sizeof(struct ehci_itd), sizeof(struct ehci_sitd));
 
+#ifdef OF_PLATFORM_DRIVER
+	retval = of_register_platform_driver(&OF_PLATFORM_DRIVER);
+	if (retval < 0)
+		return retval;
+#endif
+
 #ifdef PLATFORM_DRIVER
 	retval = platform_driver_register(&PLATFORM_DRIVER);
 	if (retval < 0)
@@ -998,6 +1009,9 @@
 
 static void __exit ehci_hcd_cleanup(void)
 {
+#ifdef OF_PLATFORM_DRIVER
+	of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
+#endif
 #ifdef PLATFORM_DRIVER
 	platform_driver_unregister(&PLATFORM_DRIVER);
 #endif
diff -ruN linux-2.6.orig/drivers/usb/host/ehci-ppc-of.c linux-2.6/drivers/usb/host/ehci-ppc-of.c
--- linux-2.6.orig/drivers/usb/host/ehci-ppc-of.c	1970-01-01 03:00:00.000000000 +0300
+++ linux-2.6/drivers/usb/host/ehci-ppc-of.c	2007-09-15 16:12:56.000000000 +0400
@@ -0,0 +1,220 @@
+/*
+ * EHCI HCD (Host Controller Driver) for USB.
+ *
+ * Bus Glue for PPC On-Chip EHCI driver on the of_platform bus
+ * Tested on AMCC PPC 440EPx
+ *
+ * Valentine Barshak <vbarshak@ru.mvista.com>
+ *
+ * Based on "ehci-ppc-soc.c" by Stefan Roese <sr@denx.de>
+ * and "ohci-ppc-of.c" by Sylvain Munaut <tnt@246tNt.com>
+ *
+ * This file is licenced under the GPL.
+ */
+
+#include <linux/signal.h>
+
+#include <linux/of.h>
+#include <linux/of_platform.h>
+
+/* called during probe() after chip reset completes */
+static int ehci_ppc_of_setup(struct usb_hcd *hcd)
+{
+	struct ehci_hcd	*ehci = hcd_to_ehci(hcd);
+	int		retval;
+
+	retval = ehci_halt(ehci);
+	if (retval)
+		return retval;
+
+	retval = ehci_init(hcd);
+	if (retval)
+		return retval;
+
+	ehci->sbrn = 0x20;
+	return ehci_reset(ehci);
+}
+
+
+static const struct hc_driver ehci_ppc_of_hc_driver = {
+	.description = hcd_name,
+	.product_desc = "OF EHCI",
+	.hcd_priv_size = sizeof(struct ehci_hcd),
+
+	/*
+	 * generic hardware linkage
+	 */
+	.irq = ehci_irq,
+	.flags = HCD_MEMORY | HCD_USB2,
+
+	/*
+	 * basic lifecycle operations
+	 */
+	.reset = ehci_ppc_of_setup,
+	.start = ehci_run,
+	.stop = ehci_stop,
+	.shutdown = ehci_shutdown,
+
+	/*
+	 * managing i/o requests and associated device resources
+	 */
+	.urb_enqueue = ehci_urb_enqueue,
+	.urb_dequeue = ehci_urb_dequeue,
+	.endpoint_disable = ehci_endpoint_disable,
+
+	/*
+	 * scheduling support
+	 */
+	.get_frame_number = ehci_get_frame,
+
+	/*
+	 * root hub support
+	 */
+	.hub_status_data = ehci_hub_status_data,
+	.hub_control = ehci_hub_control,
+#ifdef	CONFIG_PM
+	.hub_suspend = ehci_hub_suspend,
+	.hub_resume = ehci_hub_resume,
+#endif
+};
+
+
+static int __devinit
+ehci_hcd_ppc_of_probe(struct of_device *op, const struct of_device_id *match)
+{
+	struct device_node *dn = op->node;
+	struct usb_hcd *hcd;
+	struct ehci_hcd	*ehci;
+	struct resource res;
+	int irq;
+	int rv;
+
+	if (usb_disabled())
+		return -ENODEV;
+
+	dev_dbg(&op->dev, "initializing PPC-OF USB Controller\n");
+
+	rv = of_address_to_resource(dn, 0, &res);
+	if (rv)
+		return rv;
+
+	hcd = usb_create_hcd(&ehci_ppc_of_hc_driver, &op->dev, "PPC-OF USB");
+	if (!hcd)
+		return -ENOMEM;
+
+	hcd->rsrc_start = res.start;
+	hcd->rsrc_len = res.end - res.start + 1;
+
+	if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
+		printk(KERN_ERR __FILE__ ": request_mem_region failed\n");
+		rv = -EBUSY;
+		goto err_rmr;
+	}
+
+	irq = irq_of_parse_and_map(dn, 0);
+	if (irq == NO_IRQ) {
+		printk(KERN_ERR __FILE__ ": irq_of_parse_and_map failed\n");
+		rv = -EBUSY;
+		goto err_irq;
+	}
+
+	hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
+	if (!hcd->regs) {
+		printk(KERN_ERR __FILE__ ": ioremap failed\n");
+		rv = -ENOMEM;
+		goto err_ioremap;
+	}
+
+	ehci = hcd_to_ehci(hcd);
+	if (of_device_is_compatible(dn, "ehci-be-desc"))
+		ehci->big_endian_desc = 1;
+	if (of_get_property(dn, "big-endian", NULL))
+		ehci->big_endian_mmio = 1;
+
+	ehci->caps = hcd->regs;
+	ehci->regs = hcd->regs + HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
+
+	/* cache this readonly data; minimize chip reads */
+	ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
+
+	if (of_device_is_compatible(dn, "ibm,ehci-440epx")) {
+		/*
+		 * 440EPx Errata USBH_3
+		 * Fix: Enable Break Memory Transfer (BMT) in INSNREG3
+		 */
+		out_be32((void *)((ulong)(&ehci->regs->command) + 0x8c), (1 << 0));
+		ehci_dbg(ehci, "Break Memory Transfer (BMT) has beed enabled!\n");
+	}
+
+	rv = usb_add_hcd(hcd, irq, 0);
+	if (rv == 0)
+		return 0;
+
+	iounmap(hcd->regs);
+err_ioremap:
+	irq_dispose_mapping(irq);
+err_irq:
+	release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+err_rmr:
+	usb_put_hcd(hcd);
+
+	return rv;
+}
+
+
+static int ehci_hcd_ppc_of_remove(struct of_device *op)
+{
+	struct usb_hcd *hcd = dev_get_drvdata(&op->dev);
+	dev_set_drvdata(&op->dev, NULL);
+
+	dev_dbg(&op->dev, "stopping PPC-OF USB Controller\n");
+
+	usb_remove_hcd(hcd);
+
+	iounmap(hcd->regs);
+	irq_dispose_mapping(hcd->irq);
+	release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+
+	usb_put_hcd(hcd);
+
+	return 0;
+}
+
+
+static int ehci_hcd_ppc_of_shutdown(struct of_device *op)
+{
+	struct usb_hcd *hcd = dev_get_drvdata(&op->dev);
+
+	if (hcd->driver->shutdown)
+		hcd->driver->shutdown(hcd);
+
+	return 0;
+}
+
+
+static struct of_device_id ehci_hcd_ppc_of_match[] = {
+	{
+		.type = "usb",
+		.compatible = "ehci",
+	},
+	{},
+};
+MODULE_DEVICE_TABLE(of, ehci_hcd_ppc_of_match);
+
+
+static struct of_platform_driver ehci_hcd_ppc_of_driver = {
+	.name		= "ppc-of-ehci",
+	.match_table	= ehci_hcd_ppc_of_match,
+	.probe		= ehci_hcd_ppc_of_probe,
+	.remove		= ehci_hcd_ppc_of_remove,
+	.shutdown 	= ehci_hcd_ppc_of_shutdown,
+#ifdef CONFIG_PM
+	/*.suspend	= ehci_hcd_ppc_of_drv_suspend,*/
+	/*.resume	= ehci_hcd_ppc_of_drv_resume,*/
+#endif
+	.driver		= {
+		.name	= "ppc-of-ehci",
+		.owner	= THIS_MODULE,
+	},
+};
+
diff -ruN linux-2.6.orig/drivers/usb/host/Kconfig linux-2.6/drivers/usb/host/Kconfig
--- linux-2.6.orig/drivers/usb/host/Kconfig	2007-09-15 14:28:42.000000000 +0400
+++ linux-2.6/drivers/usb/host/Kconfig	2007-09-15 15:12:04.000000000 +0400
@@ -84,6 +84,14 @@
 	---help---
 	  Variation of ARC USB block used in some Freescale chips.
 
+config USB_EHCI_HCD_PPC_OF
+	bool "EHCI support for PPC USB controller on OF platform bus"
+	depends on USB_EHCI_HCD && PPC_OF
+	default y
+	---help---
+	  Enables support for the USB controller PowerPC present on the
+	  OpenFirmware platform bus.
+
 config USB_ISP116X_HCD
 	tristate "ISP116X HCD support"
 	depends on USB

^ permalink raw reply

* Re: [PATCH 1/3] usb: add device-tree-aware ehci driver
From: Valentine Barshak @ 2007-09-17 18:17 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, linux-usb-devel
In-Reply-To: <20070917232809.1221acd9.sfr@canb.auug.org.au>

Stephen Rothwell wrote:
> On Mon, 17 Sep 2007 16:55:43 +0400 Valentine Barshak <vbarshak@ru.mvista.com> wrote:
>> +++ linux-2.6/drivers/usb/host/ehci-ppc-of.c	2007-09-15 16:12:56.000000000 +0400
>> @@ -0,0 +1,220 @@
>> +
>> +#include <asm/of_platform.h>
>> +#include <asm/prom.h>
> 
> Please use linux/of.h and linux/of_platform.h instead.
> 
>> +static int ehci_hcd_ppc_of_shutdown(struct of_device *op)
>> +{
>> +	struct usb_hcd *hcd = dev_get_drvdata(&op->dev);
>> +
>> +        if (hcd->driver->shutdown)
>> +                hcd->driver->shutdown(hcd);
> 
> White space has gone a bit funny here.
> 
Corrected...
Sending new patch in a minute.
Looks like we'll need a patch that replaces asm/prom.h and 
asm/of_platform.h with linux/of.h and linux/of_platform.h
in other drivers.
ohci-ppc-of is definitely gonna need it.
BTW, I think the ohci_hcd_ppc_of_match stuff for ohci-ppc-of.c has to be 
  modified.
I think it should be .type="usb" instead of .name="usb" and 
.compatible="ohci-littlendian" doesn't look good to me either.
Thanks,
Valentine.

^ 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