linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Inconsistent fsl_get_sys_freq() implementation
From: Wolfgang Grandegger @ 2009-03-31  7:28 UTC (permalink / raw)
  To: linuxppc-dev, devicetree-discuss

Hello,

we realized an inconsistent implementation of fsl_get_sys_freq():

http://lxr.linux.no/linux+v2.6.29/arch/powerpc/sysdev/fsl_soc.c#L80

For 826x and 827x boards, the function is available but it cannot be
used because the "bus-frequency" property is not defined for the SOC and
U-Boot also does not try to do a fixup. I think that's a mistake, and
the DTS files and U-Boot should be fixed, right?
Furthermore, I find the name confusing. fsl_get_soc_bus_freq() would be
more appropriate also to distinguish from the frequencies of the CPU.
And why does the MPC52xx use a different name mpc52xx_find_ipb_freq()
for that frequency? It makes support for common hardware like I2C awkward.

Thanks.

Wolfgang.

^ permalink raw reply

* Re: linux-next: tracing/powerpc tree build failure
From: Stephen Rothwell @ 2009-03-31  5:54 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Benjamin, linuxppc-dev, linux-next, Paul Mackerras,
	H. Peter Anvin, Thomas Gleixner, Ingo Molnar
In-Reply-To: <1238158131.22033.10.camel@localhost.localdomain>

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

Hi all,

This patch is now applicable to the tracing tree after merging with
Linus' tree.

On Fri, 27 Mar 2009 08:48:51 -0400 Steven Rostedt <srostedt@redhat.com> wrote:
>
> 
> On Fri, 2009-03-27 at 23:08 +1100, Stephen Rothwell wrote:
> > Hi all,
> > 
> > Today's linux-next build (powerpc allyesconfig) failed like this:
> > 
> > arch/powerpc/kernel/ftrace.c: In function 'prepare_ftrace_return':
> > arch/powerpc/kernel/ftrace.c:612: warning: passing argument 3 of 'ftrace_push_return_trace' makes pointer from integer without a cast
> > arch/powerpc/kernel/ftrace.c:612: error: too many arguments to function 'ftrace_push_return_trace'
> > 
> > Caused by commit 5d1a03dc541dc6672e60e57249ed22f40654ca47
> > ("function-graph: moved the timestamp from arch to generic code") from
> > the tracing tree which (removed an argument from
> > ftrace_push_return_trace()) interacting with commit
> > 6794c78243bfda020ab184d6d578944f8e90d26c ("powerpc64: port of the
> > function graph tracer") from the powerpc tree.
> > 
> > I added the following patch and can carry it as necessary.
> 
> Thanks Stephen!!!
> 
> I knew this was going to break, but I needed to wait till powerpc merged
> with tip before I could make the change.
> 
> > -- 
> > Cheers,
> > Stephen Rothwell                    sfr@canb.auug.org.au
> > http://www.canb.auug.org.au/~sfr/
> > 
> > From: Stephen Rothwell <sfr@canb.auug.org.au>
> > Date: Fri, 27 Mar 2009 22:47:58 +1100
> > Subject: [PATCH] tracing: fixup for ftrace_push_return_trace API change
> > 
> > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > ---
> >  arch/powerpc/kernel/ftrace.c |    6 +-----
> >  1 files changed, 1 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
> > index 5b5d16b..5455943 100644
> > --- a/arch/powerpc/kernel/ftrace.c
> > +++ b/arch/powerpc/kernel/ftrace.c
> > @@ -557,7 +557,6 @@ extern void mod_return_to_handler(void);
> >  void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
> >  {
> >  	unsigned long old;
> > -	unsigned long long calltime;
> >  	int faulted;
> >  	struct ftrace_graph_ent trace;
> >  	unsigned long return_hooker = (unsigned long)&return_to_handler;
> > @@ -606,10 +605,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
> >  		return;
> >  	}
> >  
> > -	calltime = cpu_clock(raw_smp_processor_id());
> > -
> > -	if (ftrace_push_return_trace(old, calltime,
> > -				self_addr, &trace.depth) == -EBUSY) {
> > +	if (ftrace_push_return_trace(old, self_addr, &trace.depth) == -EBUSY) {
> 
> This is exactly what I would have done.
> 
> Acked-by: Steven Rostedt <srostedt@redhat.com>
> 
> -- Steve
> 
> >  		*parent = old;
> >  		return;
> >  	}
> 


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

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

^ permalink raw reply

* Move dtc and libfdt sources from arch/powerpc/boot to scripts/dtc
From: David Gibson @ 2009-03-31  4:47 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds
  Cc: monstr, linux-kernel, linuxppc-dev, Michal Simek

The powerpc kernel always requires an Open Firmware like device tree
to supply device information.  On systems without OF, this comes from
a flattened device tree blob.  This blob is usually generated by dtc,
a tool which compiles a text description of the device tree into the
flattened format used by the kernel.  Sometimes, the bootwrapper makes
small changes to the pre-compiled device tree blob (e.g. filling in
the size of RAM).  To do this it uses the libfdt library.

Because these are only used on powerpc, the code for both these tools
is included under arch/powerpc/boot (these were imported and are
periodically updated from the upstream dtc tree).

However, the microblaze architecture, currently being prepared for
merging to mainline also uses dtc to produce device tree blobs.  A few
other archs have also mentioned some interest in using dtc.
Therefore, this patch moves dtc and libfdt from arch/powerpc into
scripts, where it can be used by any architecture.

The vast bulk of this patch is a literal move, the rest is adjusting
the various Makefiles to use dtc and libfdt correctly from their new
locations.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 arch/powerpc/Kconfig                               |    4 +
 arch/powerpc/boot/Makefile                         |   67 +++++++-------------
 arch/powerpc/boot/simpleboot.c                     |    2 +-
 scripts/Makefile                                   |    1 +
 scripts/dtc/Makefile                               |   52 +++++++++++++++
 .../boot/dtc-src => scripts/dtc}/Makefile.dtc      |    0
 .../powerpc/boot/dtc-src => scripts/dtc}/checks.c  |    0
 {arch/powerpc/boot/dtc-src => scripts/dtc}/data.c  |    0
 .../boot/dtc-src => scripts/dtc}/dtc-lexer.l       |    0
 .../dtc}/dtc-lexer.lex.c_shipped                   |    0
 .../dtc}/dtc-parser.tab.c_shipped                  |    0
 .../dtc}/dtc-parser.tab.h_shipped                  |    0
 .../boot/dtc-src => scripts/dtc}/dtc-parser.y      |    0
 {arch/powerpc/boot/dtc-src => scripts/dtc}/dtc.c   |    0
 {arch/powerpc/boot/dtc-src => scripts/dtc}/dtc.h   |    0
 .../boot/dtc-src => scripts/dtc}/flattree.c        |    0
 .../powerpc/boot/dtc-src => scripts/dtc}/fstree.c  |    0
 .../boot => scripts/dtc}/libfdt/Makefile.libfdt    |    0
 {arch/powerpc/boot => scripts/dtc}/libfdt/fdt.c    |    0
 {arch/powerpc/boot => scripts/dtc}/libfdt/fdt.h    |    0
 {arch/powerpc/boot => scripts/dtc}/libfdt/fdt_ro.c |    0
 {arch/powerpc/boot => scripts/dtc}/libfdt/fdt_rw.c |    0
 .../boot => scripts/dtc}/libfdt/fdt_strerror.c     |    0
 {arch/powerpc/boot => scripts/dtc}/libfdt/fdt_sw.c |    0
 .../powerpc/boot => scripts/dtc}/libfdt/fdt_wip.c  |    0
 {arch/powerpc/boot => scripts/dtc}/libfdt/libfdt.h |    0
 .../dtc-src => scripts/dtc/libfdt}/libfdt_env.h    |    0
 .../boot => scripts/dtc}/libfdt/libfdt_internal.h  |    0
 .../boot/dtc-src => scripts/dtc}/livetree.c        |    0
 .../powerpc/boot/dtc-src => scripts/dtc}/srcpos.c  |    0
 .../powerpc/boot/dtc-src => scripts/dtc}/srcpos.h  |    0
 .../boot/dtc-src => scripts/dtc}/treesource.c      |    0
 .../boot/dtc-src => scripts/dtc}/version_gen.h     |    0
 33 files changed, 81 insertions(+), 45 deletions(-)
 create mode 100644 scripts/dtc/Makefile
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/Makefile.dtc (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/checks.c (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/data.c (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/dtc-lexer.l (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/dtc-lexer.lex.c_shipped (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/dtc-parser.tab.c_shipped (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/dtc-parser.tab.h_shipped (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/dtc-parser.y (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/dtc.c (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/dtc.h (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/flattree.c (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/fstree.c (100%)
 rename {arch/powerpc/boot => scripts/dtc}/libfdt/Makefile.libfdt (100%)
 rename {arch/powerpc/boot => scripts/dtc}/libfdt/fdt.c (100%)
 rename {arch/powerpc/boot => scripts/dtc}/libfdt/fdt.h (100%)
 rename {arch/powerpc/boot => scripts/dtc}/libfdt/fdt_ro.c (100%)
 rename {arch/powerpc/boot => scripts/dtc}/libfdt/fdt_rw.c (100%)
 rename {arch/powerpc/boot => scripts/dtc}/libfdt/fdt_strerror.c (100%)
 rename {arch/powerpc/boot => scripts/dtc}/libfdt/fdt_sw.c (100%)
 rename {arch/powerpc/boot => scripts/dtc}/libfdt/fdt_wip.c (100%)
 rename {arch/powerpc/boot => scripts/dtc}/libfdt/libfdt.h (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc/libfdt}/libfdt_env.h (100%)
 rename {arch/powerpc/boot => scripts/dtc}/libfdt/libfdt_internal.h (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/livetree.c (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/srcpos.c (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/srcpos.h (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/treesource.c (100%)
 rename {arch/powerpc/boot/dtc-src => scripts/dtc}/version_gen.h (100%)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index ad6b1c0..c881d69 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -181,6 +181,10 @@ config SYS_SUPPORTS_APM_EMULATION
 	default y if PMAC_APM_EMU
 	bool
 
+config DTC
+       bool
+       default y
+
 config DEFAULT_UIMAGE
 	bool
 	help
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 4458abb..8da2bf9 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -33,7 +33,7 @@ ifeq ($(call cc-option-yn, -fstack-protector),y)
 BOOTCFLAGS	+= -fno-stack-protector
 endif
 
-BOOTCFLAGS	+= -I$(obj) -I$(srctree)/$(obj) -I$(srctree)/$(src)/libfdt
+BOOTCFLAGS	+= -I$(obj) -I$(srctree)/$(obj)
 
 DTS_FLAGS	?= -p 1024
 
@@ -53,9 +53,14 @@ zliblinuxheader := zlib.h zconf.h zutil.h
 $(addprefix $(obj)/,$(zlib) cuboot-c2k.o gunzip_util.o main.o prpmc2800.o): \
 	$(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader))
 
-src-libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
+libfdt       := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
+libfdtheader := fdt.h libfdt.h libfdt_internal.h
+
+$(addprefix $(obj)/,$(libfdt) libfdt-wrapper.o simpleboot.o): \
+	$(addprefix $(obj)/,$(libfdtheader))
+
 src-wlib := string.S crt0.S crtsavres.S stdio.c main.c \
-		$(addprefix libfdt/,$(src-libfdt)) libfdt-wrapper.c \
+		$(libfdt) libfdt-wrapper.c \
 		ns16550.c serial.c simple_alloc.c div64.S util.S \
 		gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \
 		4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \
@@ -96,6 +101,12 @@ $(addprefix $(obj)/,$(zlibheader)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
 $(addprefix $(obj)/,$(zliblinuxheader)): $(obj)/%: $(srctree)/include/linux/%
 	$(call cmd,copy_zliblinuxheader)
 
+quiet_cmd_copy_libfdt = COPY    $@
+      cmd_copy_libfdt = cp $< $@
+
+$(addprefix $(obj)/,$(libfdt) $(libfdtheader)): $(obj)/%: $(srctree)/scripts/dtc/libfdt/%
+	$(call cmd,copy_libfdt)
+
 $(obj)/empty.c:
 	@touch $@
 
@@ -103,6 +114,7 @@ $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds: $(obj)/%: $(srct
 	@cp $< $@
 
 clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \
+		$(libfdt) $(libfdtheader) \
 		empty.c zImage.coff.lds zImage.ps3.lds zImage.lds
 
 quiet_cmd_bootcc = BOOTCC  $@
@@ -114,6 +126,8 @@ quiet_cmd_bootas = BOOTAS  $@
 quiet_cmd_bootar = BOOTAR  $@
       cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@
 
+$(obj-libfdt): $(obj)/%.o: $(srctree)/scripts/dtc/libfdt/%.c FORCE
+	$(call if_changed_dep,bootcc)
 $(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c FORCE
 	$(Q)mkdir -p $(dir $@)
 	$(call if_changed_dep,bootcc)
@@ -124,7 +138,7 @@ $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE
 $(obj)/wrapper.a: $(obj-wlib) FORCE
 	$(call if_changed,bootar)
 
-hostprogs-y	:= addnote addRamDisk hack-coff mktree dtc
+hostprogs-y	:= addnote addRamDisk hack-coff mktree
 
 targets		+= $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
 extra-y		:= $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
@@ -133,47 +147,10 @@ extra-y		:= $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
 dtstree		:= $(srctree)/$(src)/dts
 
 wrapper		:=$(srctree)/$(src)/wrapper
-wrapperbits	:= $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree dtc) \
+wrapperbits	:= $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
 			$(wrapper) FORCE
 
 #############
-# Bits for building dtc
-# DTC_GENPARSER      := 1    # Uncomment to rebuild flex/bison output
-
-dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o srcpos.o checks.o
-dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
-dtc-objs := $(addprefix dtc-src/, $(dtc-objs))
-
-# prerequisites on generated files needs to be explicit
-$(obj)/dtc-src/dtc-parser.tab.o: $(obj)/dtc-src/dtc-parser.tab.c $(obj)/dtc-src/dtc-parser.tab.h
-$(obj)/dtc-src/dtc-lexer.lex.o:  $(obj)/dtc-src/dtc-lexer.lex.c $(obj)/dtc-src/dtc-parser.tab.h
-
-HOSTCFLAGS += -I$(src)/dtc-src/ -I$(src)/libfdt/
-
-targets += dtc-src/dtc-parser.tab.c
-targets += dtc-src/dtc-lexer.lex.c
-
-clean-files += dtc-src/dtc-parser.tab.h
-
-ifdef DTC_GENPARSER
-BISON = bison
-FLEX = flex
-
-quiet_cmd_bison = BISON   $@
-      cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
-quiet_cmd_flex = FLEX    $@
-      cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped
-
-$(obj)/dtc-src/dtc-parser.tab.c: $(src)/dtc-src/dtc-parser.y FORCE
-	$(call if_changed,bison)
-
-$(obj)/dtc-src/dtc-parser.tab.h: $(obj)/dtc-src/dtc-parser.tab.c
-
-$(obj)/dtc-src/dtc-lexer.lex.c: $(src)/dtc-src/dtc-lexer.l FORCE
-	$(call if_changed,flex)
-endif
-
-#############
 # Bits for building various flavours of zImage
 
 ifneq ($(CROSS32_COMPILE),)
@@ -347,8 +324,10 @@ $(obj)/treeImage.%: vmlinux $(obj)/%.dtb $(wrapperbits)
 	$(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb)
 
 # Rule to build device tree blobs
-$(obj)/%.dtb: $(dtstree)/%.dts $(obj)/dtc
-	$(obj)/dtc -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(dtstree)/$*.dts
+DTC = $(objtree)/scripts/dtc/dtc
+
+$(obj)/%.dtb: $(dtstree)/%.dts
+	$(DTC) -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(dtstree)/$*.dts
 
 # If there isn't a platform selected then just strip the vmlinux.
 ifeq (,$(image-y))
diff --git a/arch/powerpc/boot/simpleboot.c b/arch/powerpc/boot/simpleboot.c
index c58a0da..21cd480 100644
--- a/arch/powerpc/boot/simpleboot.c
+++ b/arch/powerpc/boot/simpleboot.c
@@ -19,7 +19,7 @@
 #include "types.h"
 #include "io.h"
 #include "stdio.h"
-#include "libfdt/libfdt.h"
+#include <libfdt.h>
 
 BSS_STACK(4*1024);
 
diff --git a/scripts/Makefile b/scripts/Makefile
index 035182e..1a807ed 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -22,6 +22,7 @@ hostprogs-y += unifdef
 subdir-$(CONFIG_MODVERSIONS) += genksyms
 subdir-y                     += mod
 subdir-$(CONFIG_SECURITY_SELINUX) += selinux
+subdir-$(CONFIG_DTC)         += dtc
 
 # Let clean descend into subdirs
 subdir-	+= basic kconfig package selinux
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
new file mode 100644
index 0000000..c178428
--- /dev/null
+++ b/scripts/dtc/Makefile
@@ -0,0 +1,52 @@
+# scripts/dtc makefile
+
+hostprogs-y	:= dtc
+always		:= $(hostprogs-y)
+
+dtc-objs	:= dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
+		   srcpos.o checks.o
+dtc-objs	+= dtc-lexer.lex.o dtc-parser.tab.o
+
+# Source files need to get at the userspace version of libfdt_env.h to compile
+
+HOSTCFLAGS_checks.o := -I$(src)/libfdt
+HOSTCFLAGS_data.o := -I$(src)/libfdt
+HOSTCFLAGS_dtc.o := -I$(src)/libfdt
+HOSTCFLAGS_flattree.o := -I$(src)/libfdt
+HOSTCFLAGS_fstree.o := -I$(src)/libfdt
+HOSTCFLAGS_livetree.o := -I$(src)/libfdt
+HOSTCFLAGS_srcpos.o := -I$(src)/libfdt
+HOSTCFLAGS_treesource.o := -I$(src)/libfdt
+
+HOSTCFLAGS_dtc-lexer.lex.o := -I$(src)/libfdt
+HOSTCFLAGS_dtc-parser.tab.o := -I$(src)/libfdt
+
+# dependencies on generated files need to be listed explicitly
+$(obj)/dtc-parser.tab.o: $(obj)/dtc-parser.tab.c $(obj)/dtc-parser.tab.h
+$(obj)/dtc-lexer.lex.o:  $(obj)/dtc-lexer.lex.c $(obj)/dtc-parser.tab.h
+
+targets += dtc-parser.tab.c dtc-lexer.lex.c
+
+clean-files += dtc-parser.tab.h
+
+# GENERATE_PARSER := 1		# Uncomment to rebuild flex/bison output
+
+ifdef GENERATE_PARSER
+
+BISON = bison
+FLEX = flex
+
+quiet_cmd_bison = BISON   $@
+      cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
+quiet_cmd_flex = FLEX    $@
+      cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped
+
+$(obj)/dtc-parser.tab.c: $(src)/dtc-parser.y FORCE
+        $(call if_changed,bison)
+
+$(obj)/dtc-parser.tab.h: $(obj)/dtc-parser.tab.c
+
+$(obj)/dtc-lexer.lex.c: $(src)/dtc-lexer.l FORCE
+        $(call if_changed,flex)
+
+endif
diff --git a/arch/powerpc/boot/dtc-src/Makefile.dtc b/scripts/dtc/Makefile.dtc
similarity index 100%
rename from arch/powerpc/boot/dtc-src/Makefile.dtc
rename to scripts/dtc/Makefile.dtc
diff --git a/arch/powerpc/boot/dtc-src/checks.c b/scripts/dtc/checks.c
similarity index 100%
rename from arch/powerpc/boot/dtc-src/checks.c
rename to scripts/dtc/checks.c
diff --git a/arch/powerpc/boot/dtc-src/data.c b/scripts/dtc/data.c
similarity index 100%
rename from arch/powerpc/boot/dtc-src/data.c
rename to scripts/dtc/data.c
diff --git a/arch/powerpc/boot/dtc-src/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
similarity index 100%
rename from arch/powerpc/boot/dtc-src/dtc-lexer.l
rename to scripts/dtc/dtc-lexer.l
diff --git a/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped
similarity index 100%
rename from arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped
rename to scripts/dtc/dtc-lexer.lex.c_shipped
diff --git a/arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped b/scripts/dtc/dtc-parser.tab.c_shipped
similarity index 100%
rename from arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped
rename to scripts/dtc/dtc-parser.tab.c_shipped
diff --git a/arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped b/scripts/dtc/dtc-parser.tab.h_shipped
similarity index 100%
rename from arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped
rename to scripts/dtc/dtc-parser.tab.h_shipped
diff --git a/arch/powerpc/boot/dtc-src/dtc-parser.y b/scripts/dtc/dtc-parser.y
similarity index 100%
rename from arch/powerpc/boot/dtc-src/dtc-parser.y
rename to scripts/dtc/dtc-parser.y
diff --git a/arch/powerpc/boot/dtc-src/dtc.c b/scripts/dtc/dtc.c
similarity index 100%
rename from arch/powerpc/boot/dtc-src/dtc.c
rename to scripts/dtc/dtc.c
diff --git a/arch/powerpc/boot/dtc-src/dtc.h b/scripts/dtc/dtc.h
similarity index 100%
rename from arch/powerpc/boot/dtc-src/dtc.h
rename to scripts/dtc/dtc.h
diff --git a/arch/powerpc/boot/dtc-src/flattree.c b/scripts/dtc/flattree.c
similarity index 100%
rename from arch/powerpc/boot/dtc-src/flattree.c
rename to scripts/dtc/flattree.c
diff --git a/arch/powerpc/boot/dtc-src/fstree.c b/scripts/dtc/fstree.c
similarity index 100%
rename from arch/powerpc/boot/dtc-src/fstree.c
rename to scripts/dtc/fstree.c
diff --git a/arch/powerpc/boot/libfdt/Makefile.libfdt b/scripts/dtc/libfdt/Makefile.libfdt
similarity index 100%
rename from arch/powerpc/boot/libfdt/Makefile.libfdt
rename to scripts/dtc/libfdt/Makefile.libfdt
diff --git a/arch/powerpc/boot/libfdt/fdt.c b/scripts/dtc/libfdt/fdt.c
similarity index 100%
rename from arch/powerpc/boot/libfdt/fdt.c
rename to scripts/dtc/libfdt/fdt.c
diff --git a/arch/powerpc/boot/libfdt/fdt.h b/scripts/dtc/libfdt/fdt.h
similarity index 100%
rename from arch/powerpc/boot/libfdt/fdt.h
rename to scripts/dtc/libfdt/fdt.h
diff --git a/arch/powerpc/boot/libfdt/fdt_ro.c b/scripts/dtc/libfdt/fdt_ro.c
similarity index 100%
rename from arch/powerpc/boot/libfdt/fdt_ro.c
rename to scripts/dtc/libfdt/fdt_ro.c
diff --git a/arch/powerpc/boot/libfdt/fdt_rw.c b/scripts/dtc/libfdt/fdt_rw.c
similarity index 100%
rename from arch/powerpc/boot/libfdt/fdt_rw.c
rename to scripts/dtc/libfdt/fdt_rw.c
diff --git a/arch/powerpc/boot/libfdt/fdt_strerror.c b/scripts/dtc/libfdt/fdt_strerror.c
similarity index 100%
rename from arch/powerpc/boot/libfdt/fdt_strerror.c
rename to scripts/dtc/libfdt/fdt_strerror.c
diff --git a/arch/powerpc/boot/libfdt/fdt_sw.c b/scripts/dtc/libfdt/fdt_sw.c
similarity index 100%
rename from arch/powerpc/boot/libfdt/fdt_sw.c
rename to scripts/dtc/libfdt/fdt_sw.c
diff --git a/arch/powerpc/boot/libfdt/fdt_wip.c b/scripts/dtc/libfdt/fdt_wip.c
similarity index 100%
rename from arch/powerpc/boot/libfdt/fdt_wip.c
rename to scripts/dtc/libfdt/fdt_wip.c
diff --git a/arch/powerpc/boot/libfdt/libfdt.h b/scripts/dtc/libfdt/libfdt.h
similarity index 100%
rename from arch/powerpc/boot/libfdt/libfdt.h
rename to scripts/dtc/libfdt/libfdt.h
diff --git a/arch/powerpc/boot/dtc-src/libfdt_env.h b/scripts/dtc/libfdt/libfdt_env.h
similarity index 100%
rename from arch/powerpc/boot/dtc-src/libfdt_env.h
rename to scripts/dtc/libfdt/libfdt_env.h
diff --git a/arch/powerpc/boot/libfdt/libfdt_internal.h b/scripts/dtc/libfdt/libfdt_internal.h
similarity index 100%
rename from arch/powerpc/boot/libfdt/libfdt_internal.h
rename to scripts/dtc/libfdt/libfdt_internal.h
diff --git a/arch/powerpc/boot/dtc-src/livetree.c b/scripts/dtc/livetree.c
similarity index 100%
rename from arch/powerpc/boot/dtc-src/livetree.c
rename to scripts/dtc/livetree.c
diff --git a/arch/powerpc/boot/dtc-src/srcpos.c b/scripts/dtc/srcpos.c
similarity index 100%
rename from arch/powerpc/boot/dtc-src/srcpos.c
rename to scripts/dtc/srcpos.c
diff --git a/arch/powerpc/boot/dtc-src/srcpos.h b/scripts/dtc/srcpos.h
similarity index 100%
rename from arch/powerpc/boot/dtc-src/srcpos.h
rename to scripts/dtc/srcpos.h
diff --git a/arch/powerpc/boot/dtc-src/treesource.c b/scripts/dtc/treesource.c
similarity index 100%
rename from arch/powerpc/boot/dtc-src/treesource.c
rename to scripts/dtc/treesource.c
diff --git a/arch/powerpc/boot/dtc-src/version_gen.h b/scripts/dtc/version_gen.h
similarity index 100%
rename from arch/powerpc/boot/dtc-src/version_gen.h
rename to scripts/dtc/version_gen.h
-- 
1.6.2.1




-- 
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 related

* [PATCH] powerpc/pmac: Fix internal modem IRQ on Wallstreet PowerBook
From: Benjamin Herrenschmidt @ 2009-03-31  3:34 UTC (permalink / raw)
  To: linuxppc-dev

The (relatively) new pmac_zilog driver doesn't use the pre-munged
IRQ numbers from the macio_dev unlike other macio things, it
directly maps it off the OF device-tree.

It does that because it can be initialized much earlier than the
registration of the macio devices, in order to get a serial
console early.

Unfortunately, that means that it "misses" some fixups done
by the macio layer to work around missing interrupt descriptions
in the device-tree of the Wallstreet machines.

This patch brings the necessary workaround into the pmac_zilog
driver itself to bring it back to working condition.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---


 drivers/serial/pmac_zilog.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

--- linux-work.orig/drivers/serial/pmac_zilog.c	2009-03-31 14:15:13.000000000 +1100
+++ linux-work/drivers/serial/pmac_zilog.c	2009-03-31 14:31:34.000000000 +1100
@@ -1538,6 +1538,21 @@ no_dma:
 	uap->port.type = PORT_PMAC_ZILOG;
 	uap->port.flags = 0;
 
+	/*
+	 * Fixup for the port on Gatwick for which the device-tree has
+	 * missing interrupts. Normally, the macio_dev would contain
+	 * fixed up interrupt info, but we use the device-tree directly
+	 * here due to early probing so we need the fixup too.
+	 */
+	if (uap->port.irq == NO_IRQ &&
+	    np->parent && np->parent->parent &&
+	    of_device_is_compatible(np->parent->parent, "gatwick")) {
+		/* IRQs on gatwick are offset by 64 */
+		uap->port.irq = irq_create_mapping(NULL, 64 + 15);
+		uap->tx_dma_irq = irq_create_mapping(NULL, 64 + 4);
+		uap->rx_dma_irq = irq_create_mapping(NULL, 64 + 5);
+	}
+
 	/* Setup some valid baud rate information in the register
 	 * shadows so we don't write crap there before baud rate is
 	 * first initialized.

^ permalink raw reply

* [PATCH] net/fec_mpc52xx: fix BUG on missing dma_ops
From: Grant Likely @ 2009-03-31  2:25 UTC (permalink / raw)
  To: netdev, linuxppc-dev, David Miller, Becky Bruce; +Cc: galak

From: Grant Likely <grant.likely@secretlab.ca>

The driver triggers a BUG_ON() when allocating DMA buffers if the
arch/powerpc dma_ops from the of_platform device are not copied
into net_device structure.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

Becky, does this look better to you?

g.

 drivers/net/fec_mpc52xx.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)


diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index 049b0a7..f99463f 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -129,7 +129,8 @@ static void mpc52xx_fec_free_rx_buffers(struct net_device *dev, struct bcom_task
 		struct sk_buff *skb;
 
 		skb = bcom_retrieve_buffer(s, NULL, (struct bcom_bd **)&bd);
-		dma_unmap_single(&dev->dev, bd->skb_pa, skb->len, DMA_FROM_DEVICE);
+		dma_unmap_single(dev->dev.parent, bd->skb_pa, skb->len,
+				 DMA_FROM_DEVICE);
 		kfree_skb(skb);
 	}
 }
@@ -150,7 +151,7 @@ static int mpc52xx_fec_alloc_rx_buffers(struct net_device *dev, struct bcom_task
 		bd = (struct bcom_fec_bd *)bcom_prepare_next_buffer(rxtsk);
 
 		bd->status = FEC_RX_BUFFER_SIZE;
-		bd->skb_pa = dma_map_single(&dev->dev, skb->data,
+		bd->skb_pa = dma_map_single(dev->dev.parent, skb->data,
 				FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);
 
 		bcom_submit_next_buffer(rxtsk, skb);
@@ -388,7 +389,8 @@ static int mpc52xx_fec_hard_start_xmit(struct sk_buff *skb, struct net_device *d
 		bcom_prepare_next_buffer(priv->tx_dmatsk);
 
 	bd->status = skb->len | BCOM_FEC_TX_BD_TFD | BCOM_FEC_TX_BD_TC;
-	bd->skb_pa = dma_map_single(&dev->dev, skb->data, skb->len, DMA_TO_DEVICE);
+	bd->skb_pa = dma_map_single(dev->dev.parent, skb->data, skb->len,
+				    DMA_TO_DEVICE);
 
 	bcom_submit_next_buffer(priv->tx_dmatsk, skb);
 
@@ -430,7 +432,8 @@ static irqreturn_t mpc52xx_fec_tx_interrupt(int irq, void *dev_id)
 		struct bcom_fec_bd *bd;
 		skb = bcom_retrieve_buffer(priv->tx_dmatsk, NULL,
 				(struct bcom_bd **)&bd);
-		dma_unmap_single(&dev->dev, bd->skb_pa, skb->len, DMA_TO_DEVICE);
+		dma_unmap_single(dev->dev.parent, bd->skb_pa, skb->len,
+				 DMA_TO_DEVICE);
 
 		dev_kfree_skb_irq(skb);
 	}
@@ -455,7 +458,8 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
 
 		rskb = bcom_retrieve_buffer(priv->rx_dmatsk, &status,
 				(struct bcom_bd **)&bd);
-		dma_unmap_single(&dev->dev, bd->skb_pa, rskb->len, DMA_FROM_DEVICE);
+		dma_unmap_single(dev->dev.parent, bd->skb_pa, rskb->len,
+				 DMA_FROM_DEVICE);
 
 		/* Test for errors in received frame */
 		if (status & BCOM_FEC_RX_BD_ERRORS) {
@@ -464,7 +468,8 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
 				bcom_prepare_next_buffer(priv->rx_dmatsk);
 
 			bd->status = FEC_RX_BUFFER_SIZE;
-			bd->skb_pa = dma_map_single(&dev->dev, rskb->data,
+			bd->skb_pa = dma_map_single(dev->dev.parent,
+					rskb->data,
 					FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);
 
 			bcom_submit_next_buffer(priv->rx_dmatsk, rskb);
@@ -499,7 +504,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
 			bcom_prepare_next_buffer(priv->rx_dmatsk);
 
 		bd->status = FEC_RX_BUFFER_SIZE;
-		bd->skb_pa = dma_map_single(&dev->dev, skb->data,
+		bd->skb_pa = dma_map_single(dev->dev.parent, skb->data,
 				FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);
 
 		bcom_submit_next_buffer(priv->rx_dmatsk, skb);

^ permalink raw reply related

* please disable several items in 44x/canyonlands_defconfig
From: Cheng Renquan @ 2009-03-31  2:16 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

These 3 items are generally not used in 44x/canyonlands board, please
consider disable them when you change 44x/canyonlands_defconfig next
time,

CONFIG_PCI_LEGACY
CONFIG_DAB
CONFIG_VIDEO_OUTPUT_CONTROL

Thanks,

$ git diff HEAD -- arch/powerpc/configs/44x/canyonlands_defconfig
diff --git a/arch/powerpc/configs/44x/canyonlands_defconfig
b/arch/powerpc/configs/44x/canyonlands_defconfig
index f9a08ee..8792045 100644
--- a/arch/powerpc/configs/44x/canyonlands_defconfig
+++ b/arch/powerpc/configs/44x/canyonlands_defconfig
@@ -262,7 +262,7 @@ CONFIG_PCI_SYSCALL=y
 # CONFIG_PCIEPORTBUS is not set
 CONFIG_ARCH_SUPPORTS_MSI=y
 # CONFIG_PCI_MSI is not set
-CONFIG_PCI_LEGACY=y
+CONFIG_PCI_LEGACY=n
 # CONFIG_PCI_DEBUG is not set
 # CONFIG_PCI_STUB is not set
 # CONFIG_PCCARD is not set
@@ -716,7 +716,7 @@ CONFIG_SSB_POSSIBLE=y
 #
 # Multimedia drivers
 #
-CONFIG_DAB=y
+CONFIG_DAB=n
 # CONFIG_USB_DABUSB is not set

 #
@@ -725,7 +725,7 @@ CONFIG_DAB=y
 # CONFIG_AGP is not set
 # CONFIG_DRM is not set
 # CONFIG_VGASTATE is not set
-CONFIG_VIDEO_OUTPUT_CONTROL=m
+CONFIG_VIDEO_OUTPUT_CONTROL=n
 # CONFIG_FB is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set

-- 
Cheng Renquan, Shenzhen, China
Casey Stengel  - "All right everyone, line up alphabetically according
to your height."

^ permalink raw reply related

* [PATCH] linux-next remove wmb() from ide-dma-sff.c and scc_pata.c
From: Grant Grundler @ 2009-03-31  0:39 UTC (permalink / raw)
  To: IDE/ATA Devel, Bartlomiej Zolnierkiewicz; +Cc: linuxppc-dev, LKML

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

Followup to "[PATCH 03/10] ide: destroy DMA mappings after ending DMA"
email on March 14th:
    http://lkml.org/lkml/2009/3/14/17

No maintainer is listed for "Toshiba CELL Reference Set IDE" (BLK_DEV_CELLEB)
or tx4939ide.c in MAINTAINERS. I've CC'd "Ishizaki Kou" @Toshiba (Maintainer for
"Spidernet Network Driver for CELL") and linuxppc-dev list in the hope
someone else
would know or would be able to ACK this patch.

This patch:
o replaces "mask" variable in ide_dma_end() with #define.
o removes use of wmb() in ide-dma-sff.c and scc_pata.c.
o is not tested - I don't have (or want) the HW.

I did NOT remove wmb() use in tx4939ide.c. tx4939ide.c __raw_writeb()
for MMIO transactions. __raw_writeb() does NOT guarantee memory
transaction ordering.

tx4939ide also uses mmiowb(). AFAIK, mmiowb() only has an effect on
SGI IA64 NUMA machines. I'm not going to guess how this driver might work.

Gmail is broken for sending patches (word wrap). My apologies.
I've attached the patch: diff-next-remove_wmb_from_ide-01.txt

Patch is against linux-next tree:
     git://git.kernel.org/pub/scm/linux/kernel/git/sfr/linux-next

Signed-off-by: Grant Grundler <grundler@google.com>

[-- Attachment #2: diff-next-remove_wmb_from_ide-01.txt --]
[-- Type: text/plain, Size: 1702 bytes --]

diff --git a/drivers/ide/ide-dma-sff.c b/drivers/ide/ide-dma-sff.c
index 16fc46e..e4cdf78 100644
--- a/drivers/ide/ide-dma-sff.c
+++ b/drivers/ide/ide-dma-sff.c
@@ -277,8 +277,6 @@ void ide_dma_start(ide_drive_t *drive)
 		dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD);
 		outb(dma_cmd | ATA_DMA_START, hwif->dma_base + ATA_DMA_CMD);
 	}
-
-	wmb();
 }
 EXPORT_SYMBOL_GPL(ide_dma_start);
 
@@ -286,7 +284,7 @@ EXPORT_SYMBOL_GPL(ide_dma_start);
 int ide_dma_end(ide_drive_t *drive)
 {
 	ide_hwif_t *hwif = drive->hwif;
-	u8 dma_stat = 0, dma_cmd = 0, mask;
+	u8 dma_stat = 0, dma_cmd = 0;
 
 	/* stop DMA */
 	if (hwif->host_flags & IDE_HFLAG_MMIO) {
@@ -304,11 +302,10 @@ int ide_dma_end(ide_drive_t *drive)
 	/* clear INTR & ERROR bits */
 	ide_dma_sff_write_status(hwif, dma_stat | ATA_DMA_ERR | ATA_DMA_INTR);
 
-	wmb();
+#define CHECK_DMA_MASK (ATA_DMA_ACTIVE | ATA_DMA_ERR | ATA_DMA_INTR)
 
 	/* verify good DMA status */
-	mask = ATA_DMA_ACTIVE | ATA_DMA_ERR | ATA_DMA_INTR;
-	if ((dma_stat & mask) != ATA_DMA_INTR)
+	if ((dma_stat & CHECK_DMA_MASK) != ATA_DMA_INTR)
 		return 0x10 | dma_stat;
 	return 0;
 }
diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c
index 97f8e0e..dcbb299 100644
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -337,7 +337,6 @@ static void scc_dma_start(ide_drive_t *drive)
 
 	/* start DMA */
 	scc_ide_outb(dma_cmd | 1, hwif->dma_base);
-	wmb();
 }
 
 static int __scc_dma_end(ide_drive_t *drive)
@@ -354,7 +353,6 @@ static int __scc_dma_end(ide_drive_t *drive)
 	/* clear the INTR & ERROR bits */
 	scc_ide_outb(dma_stat | 6, hwif->dma_base + 4);
 	/* verify good DMA status */
-	wmb();
 	return (dma_stat & 7) != 4 ? (0x10 | dma_stat) : 0;
 }
 

^ permalink raw reply related

* Re: Build error
From: Benjamin Herrenschmidt @ 2009-03-30 23:18 UTC (permalink / raw)
  To: avorontsov; +Cc: linuxppc-dev list
In-Reply-To: <20090330135903.GA11614@oksana.dev.rtsoft.ru>

On Mon, 2009-03-30 at 17:59 +0400, Anton Vorontsov wrote:
> On Mon, Mar 30, 2009 at 08:51:38AM -0500, Kumar Gala wrote:
> >
> > On Mar 29, 2009, at 10:25 PM, Benjamin Herrenschmidt wrote:
> >
> >> My next branch (after merging from you):
> >>
> >> ERROR: "fsl_pq_mdio_bus_name" [drivers/net/gianfar_driver.ko]  
> >> undefined!
> >>
> >> I'll ask Linus to pull anyway though.
> >>
> >> Cheers,
> >> Ben.
> >
> > I believe this is fixed in net-next (and possible linus has already  
> > pulled that in.)
> 
> FWIW, I can't reproduce the issue neither in benh/powerpc.git `next'
> branch nor in `merge' branch...

Ah .. .weird :-)

Oh well, I'll see if it still happens after I pull back from Linus (who
merged all our stuff) and if it does, I'll send you my .config.

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH] Fix ptrace compat wrapper for fpu register access
From: Michael Neuling @ 2009-03-30 22:53 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: linuxppc-dev
In-Reply-To: <m2myb32rk8.fsf@igel.home>



In message <m2myb32rk8.fsf@igel.home> you wrote:
> Michael Neuling <mikey@neuling.org> writes:
> 
> >> @@ -263,7 +263,9 @@ long compat_arch_ptrace(struct task_stru
> >>  			ret = ptrace_put_reg(child, numReg, freg);
> >>  		} else {
> >>  			flush_fp_to_thread(child);
> >> -			((unsigned int *)child->thread.regs)[index] = data;
> >> +			((unsigned int *)child->thread.fpr)
> >> +				[TS_FPRWIDTH * (numReg - PT_FPR0) * 2 +
> >> +				 index % 2] = data;
> >
> > I think the indexing here should be the same as PEEKUSR_3264.  This
> > looks better but all this magic indexing makes me want to vomit.
> 
> How about this instead:
> 
> @@ -241,6 +241,7 @@ long compat_arch_ptrace(struct task_stru
>  	case PPC_PTRACE_POKEUSR_3264: {
>  		u32 index;
>  		u32 numReg;
> +		u32 *tmp;
>  
>  		ret = -EIO;
>  		/* Determine which register the user wants */
> @@ -263,7 +264,8 @@ long compat_arch_ptrace(struct task_stru
>  			ret = ptrace_put_reg(child, numReg, freg);
>  		} else {
>  			flush_fp_to_thread(child);
> -			((unsigned int *)child->thread.regs)[index] = data;
> +			tmp = (u32 *)child->thread.fpr[numReg - PT_FPR0];
> +			tmp[index % 2] = data;

I do like this approach better (two arrays) but there is no accounting
for TS_WIDTH, so I'm not sure it works.

We *really* need a test case for this stuff :-)

Mikey

>  			ret = 0;
>  		}
>  		break;
> 
> Andreas.
> 
> -- 
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
> 

^ permalink raw reply

* Re: [PATCH] net/fec_mpc52xx: fix BUG on missing dma_ops
From: Becky Bruce @ 2009-03-30 22:30 UTC (permalink / raw)
  To: Grant Likely; +Cc: netdev, David Miller, linuxppc-dev
In-Reply-To: <20090330184423.31699.61150.stgit@localhost.localdomain>


On Mar 30, 2009, at 1:53 PM, Grant Likely wrote:

> From: Grant Likely <grant.likely@secretlab.ca>
>
> The driver triggers a BUG_ON() when allocating DMA buffers if the
> arch/powerpc dma_ops from the of_platform device are not copied
> into net_device structure.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> David, do you want to pick this one up right away, or should I merge  
> it
> through Ben's powerpc tree?


Grant,

I really think you need to do what Kumar did for gianfar (http://patchwork.ozlabs.org/patch/24562/ 
) - your  patch just fixes the dma_ops problem, not the problem with  
getting to the correct archdata, which contains an offset (dma_data)  
that is used to form a bus address used in the various dma  
operations.  Grep for get_dma_direct_offset in arch/powerpc and you'll  
see it used in the various dma operations.

Cheers,
B

>
>
> g.
>
> drivers/net/fec_mpc52xx.c |    3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
>
> diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
> index 049b0a7..215207d 100644
> --- a/drivers/net/fec_mpc52xx.c
> +++ b/drivers/net/fec_mpc52xx.c
> @@ -928,6 +928,9 @@ mpc52xx_fec_probe(struct of_device *op, const  
> struct of_device_id *match)
> 	if (!request_mem_region(mem.start, sizeof(struct mpc52xx_fec),  
> DRIVER_NAME))
> 		return -EBUSY;
>
> +	/* Copy the PowerPC dma_ops from the of_device */
> +	set_dma_ops(&ndev->dev, get_dma_ops(&op->dev));
> +
> 	/* Init ether ndev with what we have */
> 	ndev->open		= mpc52xx_fec_open;
> 	ndev->stop		= mpc52xx_fec_close;
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply

* Re: [PATCH] hvc_console: prevent wrapping in hvc_console_print()
From: Andrew Morton @ 2009-03-30 21:18 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev, roel.kluin, linux-kernel
In-Reply-To: <20090330205553.GA19278@yoda.jdub.homelinux.org>

On Mon, 30 Mar 2009 16:55:53 -0400
Josh Boyer <jwboyer@linux.vnet.ibm.com> wrote:

> On Mon, Mar 30, 2009 at 01:35:31PM -0700, Andrew Morton wrote:
> >Guys, could we have a MAINTAINERS entry for this driver please?
> 
> To my knowledge, there isn't one.  Would be Ben now by default I
> guess.  The previous developers have disclaimed ownership for a
> while from what I remember.
> 

A MAINAINERS record doesn't have to identify an individual.  It can at
least point people at the appropriate mailing list(s).

^ permalink raw reply

* Re: Bootlog bug?
From: Ron Madrid @ 2009-03-30 21:11 UTC (permalink / raw)
  To: michael; +Cc: linuxppc-dev
In-Reply-To: <1238107887.15460.3.camel@localhost>


--- On Thu, 3/26/09, Michael Ellerman <michael@ellerman.id.au> wrote:

> From: Michael Ellerman <michael@ellerman.id.au>
> Subject: Re: Bootlog bug?
> To: ron_madrid@sbcglobal.net
> Cc: linuxppc-dev@ozlabs.org
> Date: Thursday, March 26, 2009, 3:51 PM
> On Thu, 2009-03-26 at 11:25 -0700, Ron Madrid wrote:
> > I have a little problem with my boot messages. 
> I'm not sure what this
> > is, but does anyone have any ideas as to what it could
> be or what
> > further information I could give to help track this
> down.  As of now
> > this is not manifesting itself, but I don't know
> what it might do.
> 
> You have ended up with a duplicate device, or duplicate
> device _name_,
> somehow.

Thank you.  I found my duplicate device!

Ron

^ permalink raw reply

* Re: [PATCH] hvc_console: prevent wrapping in hvc_console_print()
From: Josh Boyer @ 2009-03-30 20:55 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, Roel Kluin, linux-kernel
In-Reply-To: <20090330133531.f5d99c09.akpm@linux-foundation.org>

On Mon, Mar 30, 2009 at 01:35:31PM -0700, Andrew Morton wrote:
>Guys, could we have a MAINTAINERS entry for this driver please?

To my knowledge, there isn't one.  Would be Ben now by default I
guess.  The previous developers have disclaimed ownership for a
while from what I remember.

josh

^ permalink raw reply

* Re: [PATCH] hvc_console: prevent wrapping in hvc_console_print()
From: Andrew Morton @ 2009-03-30 20:35 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <49BF956B.9030109@gmail.com>

On Tue, 17 Mar 2009 13:19:55 +0100
Roel Kluin <roel.kluin@gmail.com> wrote:

> This was found by code analysis, is it needed?
> ------------------------------>8-------------8<---------------------------------
> If we subtract too much on unsigned i it wraps.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
> index 94e7e3c..d06313c 100644
> --- a/drivers/char/hvc_console.c
> +++ b/drivers/char/hvc_console.c
> @@ -161,10 +161,10 @@ static void hvc_console_print(struct console *co, const char *b,
>  			}
>  		} else {
>  			r = cons_ops[index]->put_chars(vtermnos[index], c, i);
> -			if (r <= 0) {
> +			if (r <= 0 || r > i) {
>  				/* throw away chars on error */
>  				i = 0;
> -			} else if (r > 0) {
> +			} else {
>  				i -= r;
>  				if (i > 0)
>  					memmove(c, c+r, i);

I expect that ->put_chars() will either return a -ve errno or will
return the number of chars which were written, which will be less than
or equal to `i'.

Or maybe I miss your point.

Guys, could we have a MAINTAINERS entry for this driver please?

^ permalink raw reply

* Re: [PATCH] ucc_geth: Move freeing of TX packets to NAPI context.
From: David Miller @ 2009-03-30 20:36 UTC (permalink / raw)
  To: Joakim.Tjernlund; +Cc: linuxppc-dev, leoli, pku.leo, netdev
In-Reply-To: <OF42785A57.F2F3AFE4-ONC1257589.0035B462-C1257589.003712D0@transmode.se>

From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Date: Mon, 30 Mar 2009 12:01:33 +0200

> I don't know. But the question you should ask is: Does the networking
> code promise this now and for the future? If not, you should
> fix the driver not to relay on netif_queue_stopped() here.

Stop this nonsense talk.

If the driver can't be the one and only controller of the TX queue
state, everything would essentially explode.

The fact is, it does.

^ permalink raw reply

* Setting eth interface oper state from user space
From: vb @ 2009-03-30 20:04 UTC (permalink / raw)
  To: LinuxPPC-Embedded, linuxppc-dev

I'm debugging a fairly awkward system, where the ehernet controller
and the phy device connected to the controller's mac are completely
independent. (this is in the 2.6.25 tree, btw).

The phy device interface is through SysFs attributes, there is no
interrupts, link state is polled by a user space thread.

When I try using this new ethernet interface, it's never in the
operational 'running' state, so it never gets used.

I see that many drivers use netif_carrier_on() to set oper state, but
this is invoked from the driver code in the kernel.

Is there a recommended way of controlling the interface operstate from
user space? Or maybe someone has a suggestion on how to do this in the
cleanest possible way?

As always, any hints/comments will be highly appreciated,
TIA,
Vadim

^ permalink raw reply

* Re: [PATCH] ucc_geth: Rework the TX logic.
From: Scott Wood @ 2009-03-30 19:32 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: linuxppc-dev, Li Yang, pku.leo, netdev
In-Reply-To: <OF70832E04.3DC53F05-ONC1257589.00663AFF-C1257589.0066C397@transmode.se>

Joakim Tjernlund wrote:
>> different since descriptors are in MURAM which is ioremap()ed -- though 
>> switching to a cacheable mapping with barriers should be a performance 
>> improvement.
> 
> I always thought that MURAM was very fast. The whole reason to have BDs in
> MURAM is that it is faster than normal RAM, at least that is what I 
> thought.

Yeah, on second thought it probably wouldn't be worth it.  There's also 
the question of under what circumstances the QE's MURAM accesses will be 
cache-coherent.

As for the CPU not reordering guarded+cache inhibited accesses, that 
initially seemed to be true for the new arch stuff (book3e/book3s, but 
not really, see below), but the classic arch documentation only 
guarantees stores to such regions to be in-order (and the 
explicitly-specified operation of eieio on I+G accesses wouldn't make 
much sense if they were already guaranteed to be in-order).

Then I looked at the EREF to see what older book E documents had to say 
on the issue, and it suggests that when the architecture document says 
"out of order", it really means "speculative" (and reading the arch 
doc's definition of "out of order" seems to confirm this -- redefining 
terms is bad, m'kay?).  So it seems that the simple answer is no, 
guarded storage is not guaranteed to be in order, unless the only thing 
that can cause an out-of-order access is speculative execution.

-Scott

^ permalink raw reply

* [PATCH] net/fec_mpc52xx: fix BUG on missing dma_ops
From: Grant Likely @ 2009-03-30 18:53 UTC (permalink / raw)
  To: netdev, linuxppc-dev, David Miller

From: Grant Likely <grant.likely@secretlab.ca>

The driver triggers a BUG_ON() when allocating DMA buffers if the
arch/powerpc dma_ops from the of_platform device are not copied
into net_device structure.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
David, do you want to pick this one up right away, or should I merge it
through Ben's powerpc tree?

g.

 drivers/net/fec_mpc52xx.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)


diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index 049b0a7..215207d 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -928,6 +928,9 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
 	if (!request_mem_region(mem.start, sizeof(struct mpc52xx_fec), DRIVER_NAME))
 		return -EBUSY;
 
+	/* Copy the PowerPC dma_ops from the of_device */
+	set_dma_ops(&ndev->dev, get_dma_ops(&op->dev));
+
 	/* Init ether ndev with what we have */
 	ndev->open		= mpc52xx_fec_open;
 	ndev->stop		= mpc52xx_fec_close;

^ permalink raw reply related

* Re: [PATCH] ucc_geth: Rework the TX logic.
From: Joakim Tjernlund @ 2009-03-30 18:42 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, Li Yang, pku.leo, netdev
In-Reply-To: <49D1052D.2050609@freescale.com>

Scott Wood <scottwood@freescale.com> wrote on 30/03/2009 19:45:17:
> 
> Joakim Tjernlund wrote:
> > Scott Wood <scottwood@freescale.com> wrote on 30/03/2009 19:22:03:
> >> Joakim Tjernlund wrote:
> >>> gianfar does not seem to use in_/out_ functions for the BDs. Works 
> > just
> >>> fine that too it seems.
> >> It does now that it has explicit barriers in a few places.  Before 
they
> > 
> > In 2.6.29 or later?
> 
> No, it was earlier.

Ah, I see now. The eieio() stuff.

> 
> >> were added, it would sometimes fail under load.  That was due to a 
> >> compiler reordering, but CPU reordering was possible as well.
> > 
> > Does not the CPU skip reordering if the guarded bit is set?
> 
> The guarded bit is typically not set for DMA buffers.  ucc_geth is a bit 

> different since descriptors are in MURAM which is ioremap()ed -- though 
> switching to a cacheable mapping with barriers should be a performance 
> improvement.

I always thought that MURAM was very fast. The whole reason to have BDs in
MURAM is that it is faster than normal RAM, at least that is what I 
thought.

 Jocke

^ permalink raw reply

* Re: [PATCH] ucc_geth: Rework the TX logic.
From: Scott Wood @ 2009-03-30 17:45 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: linuxppc-dev, Li Yang, pku.leo, netdev
In-Reply-To: <OF3127420C.081D4097-ONC1257589.00603E3D-C1257589.006093B3@transmode.se>

Joakim Tjernlund wrote:
> Scott Wood <scottwood@freescale.com> wrote on 30/03/2009 19:22:03:
>> Joakim Tjernlund wrote:
>>> gianfar does not seem to use in_/out_ functions for the BDs. Works 
> just
>>> fine that too it seems.
>> It does now that it has explicit barriers in a few places.  Before they
> 
> In 2.6.29 or later?

No, it was earlier.

>> were added, it would sometimes fail under load.  That was due to a 
>> compiler reordering, but CPU reordering was possible as well.
> 
> Does not the CPU skip reordering if the guarded bit is set?

The guarded bit is typically not set for DMA buffers.  ucc_geth is a bit 
different since descriptors are in MURAM which is ioremap()ed -- though 
switching to a cacheable mapping with barriers should be a performance 
improvement.

-Scott

^ permalink raw reply

* Re: [PATCH] ucc_geth: Rework the TX logic.
From: Joakim Tjernlund @ 2009-03-30 17:34 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, Li Yang, pku.leo, netdev
In-Reply-To: <49D0FFBB.7000009@freescale.com>

Scott Wood <scottwood@freescale.com> wrote on 30/03/2009 19:22:03:
> 
> Joakim Tjernlund wrote:
> > gianfar does not seem to use in_/out_ functions for the BDs. Works 
just
> > fine that too it seems.
> 
> It does now that it has explicit barriers in a few places.  Before they

In 2.6.29 or later?
 
> were added, it would sometimes fail under load.  That was due to a 
> compiler reordering, but CPU reordering was possible as well.

Does not the CPU skip reordering if the guarded bit is set?

Could we not use the same in ucc_geth as well? Then people would
not need to worry about "performance issues".

 Jocke

^ permalink raw reply

* Re: [PATCH] ucc_geth: Rework the TX logic.
From: Scott Wood @ 2009-03-30 17:22 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: linuxppc-dev, Li Yang, pku.leo, netdev
In-Reply-To: <OFEFCEAFB5.CC21FFBB-ONC1257589.005AEF16-C1257589.005B64EB@transmode.se>

Joakim Tjernlund wrote:
> gianfar does not seem to use in_/out_ functions for the BDs. Works just
> fine that too it seems.

It does now that it has explicit barriers in a few places.  Before they 
were added, it would sometimes fail under load.  That was due to a 
compiler reordering, but CPU reordering was possible as well.

-Scott

^ permalink raw reply

* Re: using IRQ1 in mpc5121ads
From: Grant Likely @ 2009-03-30 16:42 UTC (permalink / raw)
  To: sylvain.louchez; +Cc: linuxppc-dev
In-Reply-To: <49d0d82a.09038e0a.585d.348b@mx.google.com>

On Mon, Mar 30, 2009 at 8:33 AM, sylvain louchez
<sylvain.louchez@gmail.com> wrote:
> Hello, I=92m a newbie looking for where the documentation and implementat=
ion
> model can be found=85
>
> My custom driver is looking for an interrupt notification from the kernel=
 -
> and it registers in the /proc/interrupts file as expected when installed,
> i.e.
>
> $insmod custom_driver.ko gps_irq=3D<n>

You don't want to do this with PowerPC.  There is no reliable way to
know what the IRQ number is at module load time.  Note that the IRQ
numbers listed in /proc/interrupts are *not* the same as the hardware
interrupt number.  /proc/interrupts on powerpc shows 'virtual IRQ'
numbers which are assigned dynamically as needed.  This is so that the
kernel can handle multiple cascaded IRQ controllers, each with
different hardware IRQ numbering schemes.

> 1. create an entry in the dts file; I think we've got this understood
> through advice already received - for example the new interrupt entry can=
 be
> created in the dts file - something like:
>
>
>
> gps@0 {=A0=A0=A0=A0=A0 // there is no address so just make it 0

There is no address so just make it "gps {", unless you have more than
one of them.

>
> =A0=A0=A0 compatible =3D "gps_interrupt";

Change this to: compatible =3D "<vendor>,<name-of-gps-device>";

Note that this node should describe the whole GPS device, not just IRQ
line for the GPS device.  Is this device addressable in any way?  Does
it have any memory mapped registers?  SPI?  I2C?

>
> =A0=A0=A0 interrupts =3D <17 0x8>;=A0=A0=A0=A0=A0=A0=A0=A0 // 17 is irq1,=
 8 is level low, see
> include/linux/irq.h for others
>
> =A0=A0=A0 interrupt-parent =3D < &ipic >;

This looks correct

> 2. but now we need to relate the actual interrupt to the virtual interrup=
t
> called in the driver... by invoking the function irq_of_parse_and_map - b=
ut
> we don't know how to do it - nor have we found how to do it in browsing
> through the open source documentation

You need to write an of_platform_driver which will bind against the
'compatible' property in your GPS node.

> A secondary question: where to properly add this function call in the fil=
e
> system?

Use of_register_platform_driver() to register your of_platform_driver
in your module's init function.

> Are we on the right track here? Is there sample/ tutorial code you could
> point us to?

Search for of_register_platform_driver() in the kernel source.

g.

--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [PATCH] ucc_geth: Rework the TX logic.
From: Joakim Tjernlund @ 2009-03-30 16:38 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, Li Yang, pku.leo, netdev
In-Reply-To: <49CCD3E8.9040007@freescale.com>

Scott Wood <scottwood@freescale.com> wrote on 27/03/2009 14:26:00:
> 
> Joakim Tjernlund wrote:
> > This is a bit better than the current type casts. Moving over to qe_bd
> > accesses is a bigger cleanup that will have to be a seperate patch.
> > I am not sure it is an all win as you probably loose the ability
> > to read both status and len in one access.
> 
> Not if you define the struct to have one status_len field (or a union of 

> that with separate fields), as gianfar does.

gianfar does not seem to use in_/out_ functions for the BDs. Works just
fine that too it seems. I always felt that the in_/out_ functions
was extra baggage that the Freescale CPUs don't need. There is
something in between that is missing.

 Jocke

^ permalink raw reply

* Re: Interrupts on GPIO
From: Grant Likely @ 2009-03-30 16:32 UTC (permalink / raw)
  To: Yann Pelletier; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <9A8B45DD4DE17F4783430D784DA0B68811C41F9D9F@HEXMBVS12.hostedmsx.local>

On Mon, Mar 30, 2009 at 9:57 AM, Yann Pelletier
<ypelletier@haivision.com> wrote:
>
> Hi,
> I'd like to add supports for interrupts handling from GPIO controller. =
=A0Some of these interrupts are from I2C devices and some others are from S=
PI devices.
>
> What is the best approach to enable interrupts handling for those devices=
 through GPIO.

Modify the GPIO driver to also be a cascaded IRQ driver (see
http://patchwork.ozlabs.org/patch/21914/ for an example).

> Also,
>
> # cat /proc/interrupts
> =A0 =A0 =A0 =A0 =A0 CPU0
> =A016: =A0 =A0 =A0 =A0 60 =A0 IPIC =A0 Level =A0 =A0 serial
> =A017: =A0 =A0 =A0 =A0 =A00 =A0 IPIC =A0 Level =A0 =A0 fpga
> =A018: =A0 =A0 =A0 =A0 =A04 =A0 IPIC =A0 Level =A0 =A0 mpc83xx_spi
> =A021: =A0 =A0 =A0 =A0 =A00 =A0 IPIC =A0 Level =A0 =A0 i2c-mpc
> =A022: =A0 =A0 =A0 =A0 =A07 =A0 IPIC =A0 Level =A0 =A0 i2c-mpc
>
> According to my platform device tree, serial irq should be on int9, SPI o=
n int16 and i2c on int14,15. =A0This causes me some problems as I need int1=
8 to map to external IRQ2.

These numbers are *Linux internal* virtual irq numbers.  They have no
relation to the physical IRQ number for each interrupt controller.
Just make sure your Device Tree maps the IRQs correctly and you'll be
okay.

g.

--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ 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;
as well as URLs for NNTP newsgroup(s).