* RE: I2C: Getting Compiation Error for application program
From: Sachin Rane @ 2006-09-21 11:10 UTC (permalink / raw)
To: Matthias Fuchs; +Cc: linuxppc-embedded
In-Reply-To: <200609211113.15457.matthias.fuchs@esd-electronics.com>
[-- Attachment #1: Type: text/plain, Size: 3396 bytes --]
Hello Matthias,
Thanks for the reply.
I got the reason from i2c mailing list on getting compilation errors.
A text from the I2C mailing list :
8<---------------------------------------------------------------------------------------
"All the above it caused by you including <linux/i2c.h>. As explained
before, this is a kernel-only header file, which you must _not_ include
in user-space code. You are not the only one to blame though, as in
fact this header file should not be in /usr/include at all, this is a
mistake which should be fixed "soon". "
--------------------------------------------------------------------------------------->8
Some of the error lines are appended for your reference.
Now I will do the changes in the code as per above above suggestion.
Tnaks and Regards,
Sachin Rane
> -bash-2.05b# gcc eeprom-client.c
> In file included from /usr/include/asm/div64.h:1,
> from /usr/include/linux/jiffies.h:9,
> from /usr/include/linux/sched.h:12,
> from /usr/include/linux/module.h:10,
> from /usr/include/linux/i2c.h:31,
> from eeprom-client.c:1:
> /usr/include/asm-generic/div64.h:54:3: #error do_div() does not yet support the C64
> In file included from /usr/include/linux/sched.h:12,
> from /usr/include/linux/module.h:10,
> from /usr/include/linux/i2c.h:31,
> from eeprom-client.c:1:
> /usr/include/linux/jiffies.h:84: error: parse error before "jiffies_64"
> /usr/include/linux/jiffies.h:88: error: parse error before "get_jiffies_64"
> In file included from /usr/include/linux/sched.h:12,
> from /usr/include/linux/module.h:10,
> from /usr/include/linux/i2c.h:31,
> from eeprom-
________________________________
From: Matthias Fuchs [mailto:matthias.fuchs@esd-electronics.com]
Sent: Thu 9/21/2006 5:13 AM
To: linuxppc-embedded@ozlabs.org
Cc: Sachin Rane
Subject: Re: I2C: Getting Compiation Error for application program
On Wednesday 20 September 2006 14:51, Sachin Rane wrote:
> Hi,
>
> I am trying to compile simple program (appended), but getting lots of
compilation error.
It's always helpful to see the compiler output. Could you post it?
> I am using Timesys Linux 2.6.13 for ppc440 evaluation board.
>
> Command used for compilation:
> $> gcc eeprom-client.c -o eeprom-client.o
Are you crosscompiling? Doesn't look like that...
>
> Could you help me to find out the reason behind getting the errors?
>
> Regards,
> Sachin Rane
>
>
>
8< ------------------------eeprom-client.c -------------------------------------------------------------------------------------
>
> #include <linux/i2c.h>
> #include <linux/i2c-dev.h>
>
> int main()
> {
> int file;
> int adapter_nr = 0; /* probably dynamically determined */
> char filename[20];
> int addr = 0xA1; /* The I2C address */
You propably have to use 0x50 here.
>
> sprintf(filename,"/dev/i2c-%d",adapter_nr);
> if ((file = open(filename,O_RDWR)) < 0)
> {
> exit(1);
> }
>
> if (ioctl(file,I2C_SLAVE,addr) < 0)
> {
> exit(1);
> }
> else
> {
> printf("\n Able to bind the adapter");
> }
> return 0;
> }
Matthias
[-- Attachment #2: Type: text/html, Size: 6315 bytes --]
^ permalink raw reply
* Re: [PATCH] kdump: don't call __ioremap() for pfn = 0
From: Michael Ellerman @ 2006-09-21 11:02 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev, Fastboot mailing list, Sachin P. Sant
In-Reply-To: <451216EE.8010404@in.ibm.com>
On Thu, 2006-09-21 at 10:07 +0530, Sachin P. Sant wrote:
> Hi
>
> While using dd command to retrive the dump from /dev/oldmem, there comes
> a rare case where pfn value is zero. In this case the __ioremap() call
> returns
> NULL and hence copying fails.
>
> # dd if=/dev/oldmem of=/dev/null
> dd: reading `/dev/oldmem': Bad address
> 0+0 records in
> 0+0 records out
> 0 bytes (0 B) copied, 0.000121 seconds, 0.0 kB/s
>
> Attached is a patch to fix this problem. During such rare cases don't call
> __ioremap() to do the address translation, instead use __va() .
It's not really rare, it's just when we're reading /dev/oldmem directly.
We can actually use the __va() trick for the whole linear mapping rather
than just pfn 0, which saves the ioremap. We also shouldn't really be
trying to iounmap(__va(0)).
So perhaps something more like this? Although it's a bit ugly because of
the need to conditionally call iounmap().
Paul you said we shouldn't be using ioremap(), but I really can't find
an alternative - map_vm_area() looks close but it requires struct pages
which we don't have. And I think your main objection was a cacheable
mapping, which we're not doing anyway by calling __ioremap().
...
Fix /dev/oldmem for kdump
A change to __ioremap() broke reading /dev/oldmem because we're no
longer able to ioremap pfn 0 (d177c207ba16b1db31283e2d1fee7ad4a863584b).
We actually don't need to ioremap for anything that's part of the linear
mapping, so just read it directly.
Also make sure we're only reading one page or less at a time.
Index: to-merge/arch/powerpc/kernel/crash_dump.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/crash_dump.c
+++ to-merge/arch/powerpc/kernel/crash_dump.c
@@ -80,6 +80,20 @@ static int __init parse_savemaxmem(char
}
__setup("savemaxmem=", parse_savemaxmem);
+
+static size_t copy_oldmem_vaddr(void *vaddr, char *buf, size_t csize,
+ unsigned long offset, int userbuf)
+{
+ if (userbuf) {
+ if (copy_to_user((char __user *)buf, (vaddr + offset), csize)) {
+ return -EFAULT;
+ }
+ } else
+ memcpy(buf, (vaddr + offset), csize);
+
+ return csize;
+}
+
/**
* copy_oldmem_page - copy one page from "oldmem"
* @pfn: page frame number to be copied
@@ -101,16 +115,16 @@ ssize_t copy_oldmem_page(unsigned long p
if (!csize)
return 0;
- vaddr = __ioremap(pfn << PAGE_SHIFT, PAGE_SIZE, 0);
+ csize = min(csize, PAGE_SIZE);
- if (userbuf) {
- if (copy_to_user((char __user *)buf, (vaddr + offset), csize)) {
- iounmap(vaddr);
- return -EFAULT;
- }
- } else
- memcpy(buf, (vaddr + offset), csize);
+ if (pfn < max_pfn) {
+ vaddr = __va(pfn << PAGE_SHIFT);
+ csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf);
+ } else {
+ vaddr = __ioremap(pfn << PAGE_SHIFT, PAGE_SIZE, 0);
+ csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf);
+ iounmap(vaddr);
+ }
- iounmap(vaddr);
return csize;
}
^ permalink raw reply
* [RFC/PATCH] Create a "wrapper" script and use it in arch/powerpc/boot
From: Paul Mackerras @ 2006-09-21 10:58 UTC (permalink / raw)
To: linuxppc-dev
This puts the knowledge of how to create various sorts of zImage
wrappers into a script called "wrapper" that could be used outside of
the kernel tree. This also changes arch/powerpc/boot so it first
builds the files that the wrapper script needs, then runs it to create
whatever flavours of zImage are required.
I haven't merged the uImage building stuff into this framework yet -
somebody want to send me a patch to do that?
Also, this probably doesn't do the right thing for maple, cell, etc.
Another point to note is that this renames the images: the one for
pSeries is called zImage.pseries rather than zImage, and the one for
powermacs is now zImage.pmac rather than zImage.vmode.
Signed-off-by: Paul Mackerras <paulus@samba.org>
---
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 01667d1..2bfb7ee 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -20,6 +20,7 @@ CROSS32_COMPILE ?=
CROSS32CC := $(CROSS32_COMPILE)gcc
CROSS32AS := $(CROSS32_COMPILE)as
CROSS32LD := $(CROSS32_COMPILE)ld
+CROSS32AR := $(CROSS32_COMPILE)ar
CROSS32OBJCOPY := $(CROSS32_COMPILE)objcopy
ifeq ($(HAS_BIARCH),y)
@@ -28,10 +29,11 @@ CROSS32CC := $(CC) -m32
CROSS32AS := $(AS) -a32
CROSS32LD := $(LD) -m elf32ppc
CROSS32OBJCOPY := $(OBJCOPY)
+CROSS32AR := $(AR)
endif
endif
-export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY
+export CROSS32CC CROSS32AS CROSS32LD CROSS32AR CROSS32OBJCOPY
KBUILD_DEFCONFIG := $(shell uname -m)_defconfig
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index e737741..95b0cdf 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -20,33 +20,34 @@ # To make it easier to setup a cross com
# CROSS32_COMPILE is setup as a prefix just like CROSS_COMPILE
# in the toplevel makefile.
+all: $(obj)/zImage
HOSTCC := gcc
BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem \
$(shell $(CROSS32CC) -print-file-name=include) -fPIC
BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
-OBJCOPYFLAGS := contents,alloc,load,readonly,data
-OBJCOPY_COFF_ARGS := -O aixcoff-rs6000 --set-start 0x500000
-OBJCOPY_MIB_ARGS := -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment
+
+ifeq ($(call cc-option-yn, -fstack-protector),y)
+BOOTCFLAGS += -fno-stack-protector
+endif
+
+BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
zlib := inffast.c inflate.c inftrees.c
zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
zliblinuxheader := zlib.h zconf.h zutil.h
-$(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader))
-#$(addprefix $(obj)/,main.o): $(addprefix $(obj)/,zlib.h)
+$(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) \
+ $(addprefix $(obj)/,$(zlibheader))
+
+src-wlib := string.S stdio.c main.c div64.S $(zlib)
+src-plat := of.c
+src-boot := crt0.S $(src-wlib) $(src-plat) empty.c
-src-boot-$(CONFIG_PPC_MULTIPLATFORM) := of.c
-src-boot := crt0.S string.S stdio.c main.c div64.S $(src-boot-y)
-src-boot += $(zlib)
src-boot := $(addprefix $(obj)/, $(src-boot))
obj-boot := $(addsuffix .o, $(basename $(src-boot)))
-
-ifeq ($(call cc-option-yn, -fstack-protector),y)
-BOOTCFLAGS += -fno-stack-protector
-endif
-
-BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
+obj-wlib := $(addsuffix .o, $(basename $(addprefix $(obj)/, $(src-wlib))))
+obj-plat := $(addsuffix .o, $(basename $(addprefix $(obj)/, $(src-plat))))
quiet_cmd_copy_zlib = COPY $@
cmd_copy_zlib = sed "s@__attribute_used__@@;s@<linux/\([^>]\+\).*@\"\1\"@" $< > $@
@@ -66,8 +67,14 @@ quiet_cmd_copy_zliblinuxheader = COPY
$(addprefix $(obj)/,$(zliblinuxheader)): $(obj)/%: $(srctree)/include/linux/%
$(call cmd,copy_zliblinuxheader)
-clean-files := $(zlib) $(zlibheader) $(zliblinuxheader)
+$(obj)/empty.c:
+ @touch $@
+$(obj)/zImage.lds $(obj)/zImage.coff.lds: $(obj)/%: $(srctree)/$(src)/%.S
+ @cp $< $@
+
+clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \
+ $(obj)/empty.c
quiet_cmd_bootcc = BOOTCC $@
cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $<
@@ -75,114 +82,86 @@ quiet_cmd_bootcc = BOOTCC $@
quiet_cmd_bootas = BOOTAS $@
cmd_bootas = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $<
-quiet_cmd_bootld = BOOTLD $@
- cmd_bootld = $(CROSS32LD) -T $(srctree)/$(src)/$(3) -o $@ $(2)
+quiet_cmd_bootar = BOOTAR $@
+ cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $^; mv $@.$$$$ $@
$(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c
$(call if_changed_dep,bootcc)
$(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S
$(call if_changed_dep,bootas)
-#-----------------------------------------------------------
-# ELF sections within the zImage bootloader/wrapper
-#-----------------------------------------------------------
-required := vmlinux.strip
-initrd := initrd
+$(obj)/wrapper.a: $(obj-wlib)
+ $(call cmd,bootar)
-obj-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.o, $(section)))
-src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section)))
-gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section)))
+hostprogs-y := addnote addRamDisk hack-coff
-hostprogs-y := addnote addRamDisk hack-coff
+extra-y := $(obj)/crt0.o $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
+ $(obj)/zImage.lds $(obj)/zImage.coff.lds
-targets += zImage.vmode zImage.initrd.vmode zImage zImage.initrd \
- zImage.coff zImage.initrd.coff miboot.image miboot.initrd.image \
- $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \
- $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \
- $(patsubst $(obj)/%,%, $(call gz-sec, $(required) $(initrd))) \
- vmlinux.initrd dummy.o
-extra-y := initrd.o
+wrapper :=$(srctree)/$(src)/wrapper
+wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff)
-quiet_cmd_ramdisk = RAMDISK $@
- cmd_ramdisk = $(obj)/addRamDisk $(obj)/ramdisk.image.gz $< $@
+#############
+# Bits for building various flavours of zImage
-quiet_cmd_stripvm = STRIP $@
- cmd_stripvm = $(STRIP) -s -R .comment $< -o $@
+ifneq ($(CROSS32_COMPILE),)
+CROSSWRAP := -C $(CROSS32_COMPILE)
+else
+ifneq ($(CROSS_COMPILE),)
+CROSSWRAP := -C $(CROSS_COMPILE)
+endif
+endif
-vmlinux.strip: vmlinux
- $(call if_changed,stripvm)
-$(obj)/vmlinux.initrd: vmlinux.strip $(obj)/addRamDisk $(obj)/ramdisk.image.gz
- $(call if_changed,ramdisk)
+quiet_cmd_wrap = WRAP $@
+ cmd_wrap =$(wrapper) -c -o $@ -p $2 $(CROSSWRAP) vmlinux
+quiet_cmd_wrap_initrd = WRAP $@
+ cmd_wrap_initrd =$(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \
+ -i $(obj)/ramdisk.image.gz vmlinux
-quiet_cmd_addsection = ADDSEC $@
- cmd_addsection = $(CROSS32OBJCOPY) $@ \
- --add-section=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $@))=$(patsubst %.o,%.gz, $@) \
- --set-section-flags=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $@))=$(OBJCOPYFLAGS)
+$(obj)/zImage.chrp: vmlinux $(wrapperbits)
+ $(call cmd,wrap,chrp)
-quiet_cmd_addnote = ADDNOTE $@
- cmd_addnote = $(obj)/addnote $@
+$(obj)/zImage.initrd.chrp: vmlinux $(wrapperbits)
+ $(call cmd,wrap_initrd,chrp)
-quiet_cmd_gen-miboot = GEN $@
- cmd_gen-miboot = $(OBJCOPY) $(OBJCOPY_MIB_ARGS) \
- --add-section=$1=$(word 2, $^) $< $@
+$(obj)/zImage.pseries: vmlinux $(wrapperbits)
+ $(call cmd,wrap,pseries)
-quiet_cmd_gencoff = COFF $@
- cmd_gencoff = $(OBJCOPY) $(OBJCOPY_COFF_ARGS) $@ && \
- $(obj)/hack-coff $@
+$(obj)/zImage.initrd.pseries: vmlinux $(wrapperbits)
+ $(call cmd,wrap_initrd,pseries)
-$(call gz-sec, $(required)): $(obj)/kernel-%.gz: %
- $(call if_changed,gzip)
+$(obj)/zImage.pmac: vmlinux $(wrapperbits)
+ $(call cmd,wrap,pmac)
-$(obj)/kernel-initrd.gz: $(obj)/ramdisk.image.gz
- cp -f $(obj)/ramdisk.image.gz $@
+$(obj)/zImage.initrd.pmac: vmlinux $(wrapperbits)
+ $(call cmd,wrap_initrd,pmac)
-$(call src-sec, $(required) $(initrd)): $(obj)/kernel-%.c: $(obj)/kernel-%.gz
- @touch $@
+$(obj)/zImage.coff: vmlinux $(wrapperbits)
+ $(call cmd,wrap,pmaccoff)
-$(call obj-sec, $(required) $(initrd)): $(obj)/kernel-%.o: $(obj)/kernel-%.c
- $(call if_changed_dep,bootcc)
- $(call cmd,addsection)
+$(obj)/zImage.initrd.coff: vmlinux $(wrapperbits)
+ $(call cmd,wrap_initrd,pmaccoff)
-$(obj)/zImage.vmode $(obj)/zImage.coff: obj-boot += $(call obj-sec, $(required))
-$(obj)/zImage.vmode: $(call obj-sec, $(required)) $(obj-boot) $(srctree)/$(src)/zImage.lds
- $(call cmd,bootld,$(obj-boot),zImage.lds)
+$(obj)/zImage.miboot: vmlinux $(wrapperbits)
+ $(call cmd,wrap,miboot)
-$(obj)/zImage.initrd.vmode $(obj)/zImage.initrd.coff: obj-boot += $(call obj-sec, $(required) $(initrd))
-$(obj)/zImage.initrd.vmode: $(call obj-sec, $(required) $(initrd)) $(obj-boot) $(srctree)/$(src)/zImage.lds
- $(call cmd,bootld,$(obj-boot),zImage.lds)
+$(obj)/zImage.initrd.miboot: vmlinux $(wrapperbits)
+ $(call cmd,wrap_initrd,miboot)
+
+image-$(CONFIG_PPC_PSERIES) += zImage.pseries
+image-$(CONFIG_PPC_PMAC) += zImage.pmac
+image-$(CONFIG_PPC_CHRP) += zImage.chrp
# For 32-bit powermacs, build the COFF and miboot images
# as well as the ELF images.
-coffimage-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/zImage.coff
-coffrdimg-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/zImage.initrd.coff
-mibootimg-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/miboot.image
-mibrdimg-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/miboot.initrd.image
-
-$(obj)/zImage: $(obj)/zImage.vmode $(obj)/addnote $(coffimage-y-y) \
- $(mibootimg-y-y)
- @cp -f $< $@
- $(call if_changed,addnote)
-
-$(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote \
- $(coffrdimg-y-y) $(mibrdimg-y-y)
- @cp -f $< $@
- $(call if_changed,addnote)
-
-$(obj)/zImage.coff: $(call obj-sec, $(required)) $(obj-boot) \
- $(srctree)/$(src)/zImage.coff.lds $(obj)/hack-coff
- $(call cmd,bootld,$(obj-boot),zImage.coff.lds)
- $(call cmd,gencoff)
-
-$(obj)/zImage.initrd.coff: $(call obj-sec, $(required) $(initrd)) $(obj-boot) \
- $(srctree)/$(src)/zImage.coff.lds $(obj)/hack-coff
- $(call cmd,bootld,$(obj-boot),zImage.coff.lds)
- $(call cmd,gencoff)
+ifeq ($(CONFIG_PPC32),y)
+image-$(CONFIG_PPC_PMAC) += zImage.coff zImage.miboot
+endif
-$(obj)/miboot.image: $(obj)/dummy.o $(obj)/vmlinux.gz
- $(call cmd,gen-miboot,image)
+initrd-y := $(patsubst zImage.%, zImage.initrd.%, $(image-y))
-$(obj)/miboot.initrd.image: $(obj)/miboot.image $(images)/ramdisk.image.gz
- $(call cmd,gen-miboot,initrd)
+$(obj)/zImage: $(addprefix $(obj)/, $(image-y))
+$(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y))
#-----------------------------------------------------------
# build u-boot images
@@ -217,4 +196,4 @@ extra-y += vmlinux.bin vmlinux.gz
install: $(CONFIGURE) $(BOOTIMAGE)
sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" "$(BOOTIMAGE)"
-clean-files += $(addprefix $(objtree)/, $(obj-boot) vmlinux.strip)
+clean-files += $(addprefix $(objtree)/, $(obj-boot) vmlinux.strip.gz)
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
new file mode 100755
index 0000000..98dc8b0
--- /dev/null
+++ b/arch/powerpc/boot/wrapper
@@ -0,0 +1,191 @@
+#!/bin/sh
+
+# Copyright (C) 2006 Paul Mackerras, IBM Corporation <paulus@samba.org>
+# This program may be used under the terms of version 2 of the GNU
+# General Public License.
+
+# This script takes a kernel binary and optionally an initrd image
+# and/or a device-tree blob, and creates a bootable zImage for a
+# given platform.
+
+# Options:
+# -o zImage specify output file
+# -p platform specify platform (links in $platform.o)
+# -i initrd specify initrd file
+# -d devtree specify device-tree blob
+# -s tree.dts specify device-tree source file (needs dtc installed)
+# -c cache $kernel.strip.gz (use if present & newer, else make)
+# -C prefix specify command prefix for cross-building tools
+# (strip, objcopy, ld)
+# -D dir specify directory containing data files used by script
+# (default ./arch/powerpc/boot)
+# -W dir specify working directory for temporary files (default .)
+
+# defaults
+kernel=
+ofile=zImage
+platform=of
+initrd=
+dtb=
+dts=
+cacheit=
+
+# cross-compilation prefix
+CROSS=
+
+# directory for object and other files used by this script
+object=arch/powerpc/boot
+
+# directory for working files
+tmpdir=.
+
+usage() {
+ echo 'Usage: wrapper [-o output] [-p platform] [-i initrd]' >&2
+ echo ' [-d devtree] [-s tree.dts] [-c] [-C cross-prefix]' >&2
+ echo ' [-D datadir] [-W workingdir] [vmlinux]' >&2
+ exit 1
+}
+
+while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -o)
+ shift
+ [ "$#" -gt 0 ] || usage
+ ofile="$1"
+ ;;
+ -p)
+ shift
+ [ "$#" -gt 0 ] || usage
+ platform="$1"
+ ;;
+ -i)
+ shift
+ [ "$#" -gt 0 ] || usage
+ initrd="$1"
+ ;;
+ -d)
+ shift
+ [ "$#" -gt 0 ] || usage
+ dtb="$1"
+ ;;
+ -s)
+ shift
+ [ "$#" -gt 0 ] || usage
+ dts="$1"
+ ;;
+ -c)
+ cacheit=y
+ ;;
+ -C)
+ shift
+ [ "$#" -gt 0 ] || usage
+ CROSS="$1"
+ ;;
+ -D)
+ shift
+ [ "$#" -gt 0 ] || usage
+ object="$1"
+ ;;
+ -W)
+ shift
+ [ "$#" -gt 0 ] || usage
+ tmpdir="$1"
+ ;;
+ -?)
+ usage
+ ;;
+ *)
+ [ -z "$kernel" ] || usage
+ kernel="$1"
+ ;;
+ esac
+ shift
+done
+
+if [ -n "$dts" ]; then
+ if [ -z "$dtb" ]; then
+ dtb="$platform.dtb"
+ fi
+ dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts" || exit 1
+fi
+
+if [ -z "$kernel" ]; then
+ kernel=vmlinux
+fi
+
+platformo=$object/"$platform".o
+lds=$object/zImage.lds
+
+case "$platform" in
+pmac|pseries|chrp)
+ platformo=$object/of.o
+ ;;
+pmaccoff)
+ platformo=$object/of.o
+ lds=$object/zImage.coff.lds
+ ;;
+miboot)
+ # this is quite different...
+ tmpvm=$tmpdir/vmlinux.bin.$$
+ ${CROSS}objcopy -O binary "$kernel" $tmpvm
+ gzip -f -9 $tmpvm
+ tmpir=
+ if [ -n "$initrd" ]; then
+ tmpir=--add-section=initrd="$initrd"
+ fi
+ ${CROSS}objcopy -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment \
+ --add-section=image=$tmpvm.gz $tmpir \
+ $object/empty.o "$ofile"
+ rm $tmpvm.gz
+ exit 0
+esac
+
+tmp=$tmpdir/zImage.$$.o
+cp $object/empty.o $tmp
+
+addsec() {
+ ${CROSS}objcopy $1 \
+ --add-section=.kernel:$3="$2" \
+ --set-section-flags=.kernel:$3=contents,alloc,load,readonly,data
+}
+
+if [ -n "$cacheit" ]; then
+ vmz="$tmpdir/`basename \"$kernel\"`.strip"
+ if [ ! -f "$vmz.gz" -o "$vmz.gz" -ot "$kernel" ]; then
+ cp "$kernel" "$vmz"
+ ${CROSS}strip "$vmz"
+ gzip -f -9 "$vmz"
+ fi
+ addsec $tmp "$vmz.gz" vmlinux.strip
+else
+ tmpvmz=$tmpdir/vmlinux.$$
+ cp "$kernel" $tmpvmz
+ ${CROSS}strip $tmpvmz
+ gzip -f -9 $tmpvmz
+ addsec $tmp $tmpvmz.gz vmlinux.strip
+ rm $tmpvmz.gz
+fi
+
+if [ -n "$initrd" ]; then
+ addsec $tmp "$initrd" initrd
+fi
+
+if [ -n "$dtb" ]; then
+ addsec $tmp "$dtb" dtb
+fi
+
+${CROSS}ld -m elf32ppc -T $lds -o "$ofile" \
+ $object/crt0.o $platformo $tmp $object/wrapper.a
+
+rm $tmp
+
+# post-processing needed for some platforms
+case "$platform" in
+pseries|chrp)
+ $object/addnote "$ofile"
+ ;;
+pmaccoff)
+ ${CROSS}objcopy -O aixcoff-rs6000 --set-start 0x500000 "$ofile"
+ $object/hack-coff "$ofile"
+ ;;
+esac
diff --git a/arch/powerpc/boot/zImage.coff.lds b/arch/powerpc/boot/zImage.coff.lds
deleted file mode 100644
index 6016251..0000000
--- a/arch/powerpc/boot/zImage.coff.lds
+++ /dev/null
@@ -1,46 +0,0 @@
-OUTPUT_ARCH(powerpc:common)
-ENTRY(_start)
-SECTIONS
-{
- . = (5*1024*1024);
- _start = .;
- .text :
- {
- *(.text)
- *(.fixup)
- }
- _etext = .;
- . = ALIGN(4096);
- .data :
- {
- *(.rodata*)
- *(.data*)
- *(.sdata*)
- __got2_start = .;
- *(.got2)
- __got2_end = .;
-
- _vmlinux_start = .;
- *(.kernel:vmlinux.strip)
- _vmlinux_end = .;
-
- _initrd_start = .;
- *(.kernel:initrd)
- _initrd_end = .;
- }
-
- . = ALIGN(4096);
- _edata = .;
- __bss_start = .;
- .bss :
- {
- *(.sbss)
- *(.bss)
- }
- _end = . ;
-
- /DISCARD/ :
- {
- *(.comment)
- }
-}
diff --git a/arch/powerpc/boot/zImage.coff.lds.S b/arch/powerpc/boot/zImage.coff.lds.S
new file mode 100644
index 0000000..6016251
--- /dev/null
+++ b/arch/powerpc/boot/zImage.coff.lds.S
@@ -0,0 +1,46 @@
+OUTPUT_ARCH(powerpc:common)
+ENTRY(_start)
+SECTIONS
+{
+ . = (5*1024*1024);
+ _start = .;
+ .text :
+ {
+ *(.text)
+ *(.fixup)
+ }
+ _etext = .;
+ . = ALIGN(4096);
+ .data :
+ {
+ *(.rodata*)
+ *(.data*)
+ *(.sdata*)
+ __got2_start = .;
+ *(.got2)
+ __got2_end = .;
+
+ _vmlinux_start = .;
+ *(.kernel:vmlinux.strip)
+ _vmlinux_end = .;
+
+ _initrd_start = .;
+ *(.kernel:initrd)
+ _initrd_end = .;
+ }
+
+ . = ALIGN(4096);
+ _edata = .;
+ __bss_start = .;
+ .bss :
+ {
+ *(.sbss)
+ *(.bss)
+ }
+ _end = . ;
+
+ /DISCARD/ :
+ {
+ *(.comment)
+ }
+}
diff --git a/arch/powerpc/boot/zImage.lds b/arch/powerpc/boot/zImage.lds
deleted file mode 100644
index 4b6bb3f..0000000
--- a/arch/powerpc/boot/zImage.lds
+++ /dev/null
@@ -1,46 +0,0 @@
-OUTPUT_ARCH(powerpc:common)
-ENTRY(_zimage_start)
-SECTIONS
-{
- . = (4*1024*1024);
- _start = .;
- .text :
- {
- *(.text)
- *(.fixup)
- }
- _etext = .;
- . = ALIGN(4096);
- .data :
- {
- *(.rodata*)
- *(.data*)
- *(.sdata*)
- __got2_start = .;
- *(.got2)
- __got2_end = .;
- }
-
- . = ALIGN(4096);
- _vmlinux_start = .;
- .kernel:vmlinux.strip : { *(.kernel:vmlinux.strip) }
- _vmlinux_end = .;
-
- . = ALIGN(4096);
- _initrd_start = .;
- .kernel:initrd : { *(.kernel:initrd) }
- _initrd_end = .;
-
- . = ALIGN(4096);
- _edata = .;
-
- . = ALIGN(4096);
- __bss_start = .;
- .bss :
- {
- *(.sbss)
- *(.bss)
- }
- . = ALIGN(4096);
- _end = . ;
-}
diff --git a/arch/powerpc/boot/zImage.lds.S b/arch/powerpc/boot/zImage.lds.S
new file mode 100644
index 0000000..4b6bb3f
--- /dev/null
+++ b/arch/powerpc/boot/zImage.lds.S
@@ -0,0 +1,46 @@
+OUTPUT_ARCH(powerpc:common)
+ENTRY(_zimage_start)
+SECTIONS
+{
+ . = (4*1024*1024);
+ _start = .;
+ .text :
+ {
+ *(.text)
+ *(.fixup)
+ }
+ _etext = .;
+ . = ALIGN(4096);
+ .data :
+ {
+ *(.rodata*)
+ *(.data*)
+ *(.sdata*)
+ __got2_start = .;
+ *(.got2)
+ __got2_end = .;
+ }
+
+ . = ALIGN(4096);
+ _vmlinux_start = .;
+ .kernel:vmlinux.strip : { *(.kernel:vmlinux.strip) }
+ _vmlinux_end = .;
+
+ . = ALIGN(4096);
+ _initrd_start = .;
+ .kernel:initrd : { *(.kernel:initrd) }
+ _initrd_end = .;
+
+ . = ALIGN(4096);
+ _edata = .;
+
+ . = ALIGN(4096);
+ __bss_start = .;
+ .bss :
+ {
+ *(.sbss)
+ *(.bss)
+ }
+ . = ALIGN(4096);
+ _end = . ;
+}
^ permalink raw reply related
* [PATCH] powerpc: fix building gdb against asm/ptrace.h
From: Arnd Bergmann @ 2006-09-21 10:29 UTC (permalink / raw)
To: linuxppc-dev
Cc: Ulrich Weigand, Anton Blanchard, Paul Mackerras, David Woodhouse
Ulrich Weigand found a bug with the current version of the
asm-powerpc/ptrace.h that prevents building at least the
SPU target version of gdb, since some ptrace opcodes are
not defined.
The problem seems to have originated in the merging of 32 and
64 bit versions of that file, the problem is that some opcodes
are only valid on 64 bit kernels, but are also used by 32 bit
programs, so they can't depends on the __powerpc64__ symbol.
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
--- a/include/asm-powerpc/ptrace.h
+++ b/include/asm-powerpc/ptrace.h
@@ -215,12 +215,10 @@ do { \
#define PTRACE_GETVRREGS 18
#define PTRACE_SETVRREGS 19
-#ifndef __powerpc64__
/* Get/set all the upper 32-bits of the SPE registers, accumulator, and
* spefscr, in one go */
#define PTRACE_GETEVRREGS 20
#define PTRACE_SETEVRREGS 21
-#endif /* __powerpc64__ */
/*
* Get or set a debug register. The first 16 are DABR registers and the
@@ -235,7 +233,6 @@ do { \
#define PPC_PTRACE_GETFPREGS 0x97 /* Get FPRs 0 - 31 */
#define PPC_PTRACE_SETFPREGS 0x96 /* Set FPRs 0 - 31 */
-#ifdef __powerpc64__
/* Calls to trace a 64bit program from a 32bit program */
#define PPC_PTRACE_PEEKTEXT_3264 0x95
#define PPC_PTRACE_PEEKDATA_3264 0x94
@@ -243,6 +240,5 @@ do { \
#define PPC_PTRACE_POKEDATA_3264 0x92
#define PPC_PTRACE_PEEKUSR_3264 0x91
#define PPC_PTRACE_POKEUSR_3264 0x90
-#endif /* __powerpc64__ */
#endif /* _ASM_POWERPC_PTRACE_H */
^ permalink raw reply
* RE: what's the difference between portwidth & chipwidth
From: Liu Dave-r63238 @ 2006-09-21 9:38 UTC (permalink / raw)
To: enorm, linuxppc-embedded
In-Reply-To: <004c01c6dd60$f4fa4880$a309a8c0@enorm>
> what's the difference between portwidth & chipwidth in file=20
> cif_flash.c?=20
Assuming the system has 4 flash chips, and each flash chip is 16 bits =
witdh.
So, the portwidth is 64bits, that is 4 *16. the chipwidth is 16bits.
> what does "8M =D7 8 BITS" mean?
Looks up some flash datasheet, you will perfect know what is the =
meaning.
-Dave
^ permalink raw reply
* what's the difference between portwidth & chipwidth
From: enorm @ 2006-09-21 9:33 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
what's the difference between portwidth & chipwidth in file cif_flash.c?
what does "8M × 8 BITS" mean?
Best regards
enorm
^ permalink raw reply
* Re: I2C: Getting Compiation Error for application program
From: Matthias Fuchs @ 2006-09-21 9:13 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: Sachin Rane
In-Reply-To: <8584FDC94AFF7640B17B8A89B23B19B34F6571@sbsserver.AlphionCorp.local>
On Wednesday 20 September 2006 14:51, Sachin Rane wrote:
> Hi,
>
> I am trying to compile simple program (appended), but getting lots of
compilation error.
It's always helpful to see the compiler output. Could you post it?
> I am using Timesys Linux 2.6.13 for ppc440 evaluation board.
>
> Command used for compilation:
> $> gcc eeprom-client.c -o eeprom-client.o
Are you crosscompiling? Doesn't look like that...
>
> Could you help me to find out the reason behind getting the errors?
>
> Regards,
> Sachin Rane
>
>
>
8< ------------------------eeprom-client.c -------------------------------------------------------------------------------------
>
> #include <linux/i2c.h>
> #include <linux/i2c-dev.h>
>
> int main()
> {
> int file;
> int adapter_nr = 0; /* probably dynamically determined */
> char filename[20];
> int addr = 0xA1; /* The I2C address */
You propably have to use 0x50 here.
>
> sprintf(filename,"/dev/i2c-%d",adapter_nr);
> if ((file = open(filename,O_RDWR)) < 0)
> {
> exit(1);
> }
>
> if (ioctl(file,I2C_SLAVE,addr) < 0)
> {
> exit(1);
> }
> else
> {
> printf("\n Able to bind the adapter");
> }
> return 0;
> }
Matthias
^ permalink raw reply
* Re: MPC5200b kernel module memory mapping
From: sudheer @ 2006-09-21 8:47 UTC (permalink / raw)
To: Steven Kaiser; +Cc: linuxppc-embedded
In-Reply-To: <000001c6dd12$417d7a50$6e4ec880@volt>
Hi Stevenson Kaiser,
Steven Kaiser wrote:
> #define MPC5xxx_MM_IPBI (MPC5xxx_MBAR + 0x0054)
>
> void *ioaddr = NULL;
>
>
> // map our physical address into kernal virtual address space
> // do I need this call?
> ioaddr = ioremap(MALab_MM_START,MALab_MM_SIZE);
>
>
Try typecasting. ioaddr = (u16 *)ioremap (start, size );
Regards
Sudheer
> return 0;
> }
>
> Later (in a ioctrl routine), I will try and write something to the first
> location in my address range. I tried these three ways:
>
> *(volatile u16 *)MALab_MM_START = 0x5555;
> outw(0x5555,MALab_MM_START);
> outw(0x5555,ioaddr);
>
> Any and all of the these calls crash the kernel so horrendously I have to
> reboot. Sometimes I have to delete and mknod a new /dev entry.
>
> I have tried the io memory map technique instead of the above io port map
> technique, using request_mem_region(), with the same crashing results upon
> any writew() call or direct variants. I tried things without the ioremap()
> call-- I get a segmentation fault in these cases.
>
> The request_region() or request_mem_region() seems to work ok. I can cat
> /proc/iomem or /proc/ioports and see my range in there. I am pretty sure I
> am setting up the LocalBus chip select registers ok.
>
> Yet obviously I am doing something profoundly stupid. Is my error obvious?
> Can someone enlighten me in my darkness?
>
> Steven Kaiser
> Chemistry Electronics Facility
> University of California, Irvine
> 2347 Natural Sciences 2
> Irvine, CA 92697-2025
> (949)824-7520
>
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
^ permalink raw reply
* [PATCH] Remove DISCONTIGMEM cruft from page.h
From: Michael Ellerman @ 2006-09-21 8:21 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
This looks like cruft to me, these functions don't exist AFAICT,
and I can't see that it's possible to even enable DISCONTIGMEM on
powerpc anymore. CC'ing some folks who might know better, based on
the who-touched-it-last principle.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
include/asm-powerpc/page.h | 6 ------
1 file changed, 6 deletions(-)
Index: to-merge/include/asm-powerpc/page.h
===================================================================
--- to-merge.orig/include/asm-powerpc/page.h
+++ to-merge/include/asm-powerpc/page.h
@@ -55,12 +55,6 @@
#define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START)
#define KERNELBASE (PAGE_OFFSET + PHYSICAL_START)
-#ifdef CONFIG_DISCONTIGMEM
-#define page_to_pfn(page) discontigmem_page_to_pfn(page)
-#define pfn_to_page(pfn) discontigmem_pfn_to_page(pfn)
-#define pfn_valid(pfn) discontigmem_pfn_valid(pfn)
-#endif
-
#ifdef CONFIG_FLATMEM
#define pfn_valid(pfn) ((pfn) < max_mapnr)
#endif
^ permalink raw reply
* Re: how an application program utilizes the driver.
From: Ming Liu @ 2006-09-21 8:13 UTC (permalink / raw)
To: dwh, jdub; +Cc: linuxppc-embedded
In-Reply-To: <451168F6.3030701@ovro.caltech.edu>
Dear Dave and Josh,
Thanks so much for your suggestion first.
Yes, it looks that I am really a beginner and there are so many points I
cannot understand well. So I will follow your suggestions and go through
those material first...
In fact, I am reading LDD3 now. However, it seems that the book is mainly
focused on the driver part and there is not some chapter to tell how apps
work with drivers. So after a rough glance, I still have much confusion. :(
I will read more to understand this topic. Thanks for your help again.
Regards
Ming
>From: David Hawkins <dwh@ovro.caltech.edu>
>To: Ming Liu <eemingliu@hotmail.com>
>CC: linuxppc-embedded@ozlabs.org
>Subject: Re: how an application program utilizes the driver.
>Date: Wed, 20 Sep 2006 09:14:46 -0700
>
>Hi Ming,
>
> > My situation is: I want to write a driver for my custom device.(In the
> > driver there are some functions defined to read or write my device.)
Then
> > in my application program, I use these defined functions to operate my
> > hardware device. I think this is a normal process to operate the
hardware
> > with driver+app, right?
>
>Right, but you've missed a few critical points.
>
>For your custom device, you'll create a driver that implements
>*kernel space* functions my_driver_open(), read(), write(), close()
>etc. You'll install that module and create an appropriate
>device node, eg. /dev/my_driver.
>
>In your *user-space* application code, you'll open that device
>
>int main(argc, argv) ...
>
> int fd = open("/dev/my_driver" ...)
>
>
>and then write to your device ...
>
> int write(fd, buffer, len);
>
>or read from your device ...
>
> int read(fd, buffer, len);
>
>The user-space calls open, read, write eventually call down into
>your driver space code. The driver and application are not
>linked, they communicate via the /dev interface.
>
>You really should read through Linux Device Drivers by Rubini,
>or check out a tutorial such as
>
>http://www.ovro.caltech.edu/~dwh/correlator/pdf/LNX-723-Hawkins.pdf
>http://www.ovro.caltech.edu/~dwh/correlator/software/driver_design.tar.gz
>http://www.ovro.caltech.edu/~dwh/correlator/index.html
>
>Regards,
>Dave
>
>
>
>
>
>
_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com
^ permalink raw reply
* [POWERPC] merge iSeries i/o operations with the rest
From: Stephen Rothwell @ 2006-09-21 8:00 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
In-Reply-To: <20060921100315.89d74f6f.sfr@canb.auug.org.au>
This patch changes the io operations so that they are out of line if
CONFIG_PPC_ISERIES is set and includes a firmware feature check in
that case.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/io.c | 14 ++
arch/powerpc/platforms/iseries/pci.c | 280 ++++++++++++++++++++++++------
include/asm-powerpc/io.h | 148 ++++++++--------
include/asm-powerpc/iseries/iseries_io.h | 60 ------
4 files changed, 319 insertions(+), 183 deletions(-)
This version depends on either of the patches that mark BUG() as noreturn
(with a preference for Michael's).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/io.c b/arch/powerpc/kernel/io.c
index 80a3209..e981806 100644
--- a/arch/powerpc/kernel/io.c
+++ b/arch/powerpc/kernel/io.c
@@ -22,12 +22,16 @@ #include <linux/compiler.h>
#include <linux/module.h>
#include <asm/io.h>
+#include <asm/firmware.h>
+#include <asm/bug.h>
void _insb(volatile u8 __iomem *port, void *buf, long count)
{
u8 *tbuf = buf;
u8 tmp;
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
if (unlikely(count <= 0))
return;
asm volatile("sync");
@@ -44,6 +48,8 @@ void _outsb(volatile u8 __iomem *port, c
{
const u8 *tbuf = buf;
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
if (unlikely(count <= 0))
return;
asm volatile("sync");
@@ -59,6 +65,8 @@ void _insw_ns(volatile u16 __iomem *port
u16 *tbuf = buf;
u16 tmp;
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
if (unlikely(count <= 0))
return;
asm volatile("sync");
@@ -75,6 +83,8 @@ void _outsw_ns(volatile u16 __iomem *por
{
const u16 *tbuf = buf;
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
if (unlikely(count <= 0))
return;
asm volatile("sync");
@@ -90,6 +100,8 @@ void _insl_ns(volatile u32 __iomem *port
u32 *tbuf = buf;
u32 tmp;
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
if (unlikely(count <= 0))
return;
asm volatile("sync");
@@ -106,6 +118,8 @@ void _outsl_ns(volatile u32 __iomem *por
{
const u32 *tbuf = buf;
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
if (unlikely(count <= 0))
return;
asm volatile("sync");
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index f4d427a..3eb1206 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -34,6 +34,7 @@ #include <asm/machdep.h>
#include <asm/pci-bridge.h>
#include <asm/iommu.h>
#include <asm/abs_addr.h>
+#include <asm/firmware.h>
#include <asm/iseries/hv_call_xm.h>
#include <asm/iseries/mf.h>
@@ -270,46 +271,6 @@ void pcibios_fixup_resources(struct pci_
}
/*
- * I/0 Memory copy MUST use mmio commands on iSeries
- * To do; For performance, include the hv call directly
- */
-void iSeries_memset_io(volatile void __iomem *dest, char c, size_t Count)
-{
- u8 ByteValue = c;
- long NumberOfBytes = Count;
-
- while (NumberOfBytes > 0) {
- iSeries_Write_Byte(ByteValue, dest++);
- -- NumberOfBytes;
- }
-}
-EXPORT_SYMBOL(iSeries_memset_io);
-
-void iSeries_memcpy_toio(volatile void __iomem *dest, void *source, size_t count)
-{
- char *src = source;
- long NumberOfBytes = count;
-
- while (NumberOfBytes > 0) {
- iSeries_Write_Byte(*src++, dest++);
- -- NumberOfBytes;
- }
-}
-EXPORT_SYMBOL(iSeries_memcpy_toio);
-
-void iSeries_memcpy_fromio(void *dest, const volatile void __iomem *src, size_t count)
-{
- char *dst = dest;
- long NumberOfBytes = count;
-
- while (NumberOfBytes > 0) {
- *dst++ = iSeries_Read_Byte(src++);
- -- NumberOfBytes;
- }
-}
-EXPORT_SYMBOL(iSeries_memcpy_fromio);
-
-/*
* Look down the chain to find the matching Device Device
*/
static struct device_node *find_Device_Node(int bus, int devfn)
@@ -491,7 +452,7 @@ static inline struct device_node *xlate_
* iSeries_Read_Word = Read Word (16 bit)
* iSeries_Read_Long = Read Long (32 bit)
*/
-u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress)
+static u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress)
{
u64 BarOffset;
u64 dsa;
@@ -518,9 +479,8 @@ u8 iSeries_Read_Byte(const volatile void
return (u8)ret.value;
}
-EXPORT_SYMBOL(iSeries_Read_Byte);
-u16 iSeries_Read_Word(const volatile void __iomem *IoAddress)
+static u16 iSeries_Read_Word(const volatile void __iomem *IoAddress)
{
u64 BarOffset;
u64 dsa;
@@ -548,9 +508,8 @@ u16 iSeries_Read_Word(const volatile voi
return swab16((u16)ret.value);
}
-EXPORT_SYMBOL(iSeries_Read_Word);
-u32 iSeries_Read_Long(const volatile void __iomem *IoAddress)
+static u32 iSeries_Read_Long(const volatile void __iomem *IoAddress)
{
u64 BarOffset;
u64 dsa;
@@ -578,7 +537,6 @@ u32 iSeries_Read_Long(const volatile voi
return swab32((u32)ret.value);
}
-EXPORT_SYMBOL(iSeries_Read_Long);
/*
* Write MM I/O Instructions for the iSeries
@@ -587,7 +545,7 @@ EXPORT_SYMBOL(iSeries_Read_Long);
* iSeries_Write_Word = Write Word(16 bit)
* iSeries_Write_Long = Write Long(32 bit)
*/
-void iSeries_Write_Byte(u8 data, volatile void __iomem *IoAddress)
+static void iSeries_Write_Byte(u8 data, volatile void __iomem *IoAddress)
{
u64 BarOffset;
u64 dsa;
@@ -612,9 +570,8 @@ void iSeries_Write_Byte(u8 data, volatil
rc = HvCall4(HvCallPciBarStore8, dsa, BarOffset, data, 0);
} while (CheckReturnCode("WWB", DevNode, &retry, rc) != 0);
}
-EXPORT_SYMBOL(iSeries_Write_Byte);
-void iSeries_Write_Word(u16 data, volatile void __iomem *IoAddress)
+static void iSeries_Write_Word(u16 data, volatile void __iomem *IoAddress)
{
u64 BarOffset;
u64 dsa;
@@ -639,9 +596,8 @@ void iSeries_Write_Word(u16 data, volati
rc = HvCall4(HvCallPciBarStore16, dsa, BarOffset, swab16(data), 0);
} while (CheckReturnCode("WWW", DevNode, &retry, rc) != 0);
}
-EXPORT_SYMBOL(iSeries_Write_Word);
-void iSeries_Write_Long(u32 data, volatile void __iomem *IoAddress)
+static void iSeries_Write_Long(u32 data, volatile void __iomem *IoAddress)
{
u64 BarOffset;
u64 dsa;
@@ -666,4 +622,224 @@ void iSeries_Write_Long(u32 data, volati
rc = HvCall4(HvCallPciBarStore32, dsa, BarOffset, swab32(data), 0);
} while (CheckReturnCode("WWL", DevNode, &retry, rc) != 0);
}
-EXPORT_SYMBOL(iSeries_Write_Long);
+
+extern unsigned char __raw_readb(const volatile void __iomem *addr)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ return *(volatile unsigned char __force *)addr;
+}
+EXPORT_SYMBOL(__raw_readb);
+
+extern unsigned short __raw_readw(const volatile void __iomem *addr)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ return *(volatile unsigned short __force *)addr;
+}
+EXPORT_SYMBOL(__raw_readw);
+
+extern unsigned int __raw_readl(const volatile void __iomem *addr)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ return *(volatile unsigned int __force *)addr;
+}
+EXPORT_SYMBOL(__raw_readl);
+
+extern unsigned long __raw_readq(const volatile void __iomem *addr)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ return *(volatile unsigned long __force *)addr;
+}
+EXPORT_SYMBOL(__raw_readq);
+
+extern void __raw_writeb(unsigned char v, volatile void __iomem *addr)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ *(volatile unsigned char __force *)addr = v;
+}
+EXPORT_SYMBOL(__raw_writeb);
+
+extern void __raw_writew(unsigned short v, volatile void __iomem *addr)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ *(volatile unsigned short __force *)addr = v;
+}
+EXPORT_SYMBOL(__raw_writew);
+
+extern void __raw_writel(unsigned int v, volatile void __iomem *addr)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ *(volatile unsigned int __force *)addr = v;
+}
+EXPORT_SYMBOL(__raw_writel);
+
+extern void __raw_writeq(unsigned long v, volatile void __iomem *addr)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ *(volatile unsigned long __force *)addr = v;
+}
+EXPORT_SYMBOL(__raw_writeq);
+
+int in_8(const volatile unsigned char __iomem *addr)
+{
+ if (firmware_has_feature(FW_FEATURE_ISERIES))
+ return iSeries_Read_Byte(addr);
+ return __in_8(addr);
+}
+EXPORT_SYMBOL(in_8);
+
+void out_8(volatile unsigned char __iomem *addr, int val)
+{
+ if (firmware_has_feature(FW_FEATURE_ISERIES))
+ iSeries_Write_Byte(val, addr);
+ else
+ __out_8(addr, val);
+}
+EXPORT_SYMBOL(out_8);
+
+int in_le16(const volatile unsigned short __iomem *addr)
+{
+ if (firmware_has_feature(FW_FEATURE_ISERIES))
+ return iSeries_Read_Word(addr);
+ return __in_le16(addr);
+}
+EXPORT_SYMBOL(in_le16);
+
+int in_be16(const volatile unsigned short __iomem *addr)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ return __in_be16(addr);
+}
+EXPORT_SYMBOL(in_be16);
+
+void out_le16(volatile unsigned short __iomem *addr, int val)
+{
+ if (firmware_has_feature(FW_FEATURE_ISERIES))
+ iSeries_Write_Word(val, addr);
+ else
+ __out_le16(addr, val);
+}
+EXPORT_SYMBOL(out_le16);
+
+void out_be16(volatile unsigned short __iomem *addr, int val)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ __out_be16(addr, val);
+}
+EXPORT_SYMBOL(out_be16);
+
+unsigned in_le32(const volatile unsigned __iomem *addr)
+{
+ if (firmware_has_feature(FW_FEATURE_ISERIES))
+ return iSeries_Read_Long(addr);
+ return __in_le32(addr);
+}
+EXPORT_SYMBOL(in_le32);
+
+unsigned in_be32(const volatile unsigned __iomem *addr)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ return __in_be32(addr);
+}
+EXPORT_SYMBOL(in_be32);
+
+void out_le32(volatile unsigned __iomem *addr, int val)
+{
+ if (firmware_has_feature(FW_FEATURE_ISERIES))
+ iSeries_Write_Long(val, addr);
+ else
+ __out_le32(addr, val);
+}
+EXPORT_SYMBOL(out_le32);
+
+void out_be32(volatile unsigned __iomem *addr, int val)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ __out_be32(addr, val);
+}
+EXPORT_SYMBOL(out_be32);
+
+unsigned long in_le64(const volatile unsigned long __iomem *addr)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ return __in_le64(addr);
+}
+EXPORT_SYMBOL(in_le64);
+
+unsigned long in_be64(const volatile unsigned long __iomem *addr)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ return __in_be64(addr);
+}
+EXPORT_SYMBOL(in_be64);
+
+void out_le64(volatile unsigned long __iomem *addr, unsigned long val)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ __out_le64(addr, val);
+}
+EXPORT_SYMBOL(out_le64);
+
+void out_be64(volatile unsigned long __iomem *addr, unsigned long val)
+{
+ BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
+
+ __out_be64(addr, val);
+}
+EXPORT_SYMBOL(out_be64);
+
+void memset_io(volatile void __iomem *addr, int c, unsigned long n)
+{
+ if (firmware_has_feature(FW_FEATURE_ISERIES)) {
+ volatile char __iomem *d = addr;
+
+ while (n-- > 0) {
+ iSeries_Write_Byte(c, d++);
+ }
+ } else
+ eeh_memset_io(addr, c, n);
+}
+EXPORT_SYMBOL(memset_io);
+
+void memcpy_fromio(void *dest, const volatile void __iomem *src,
+ unsigned long n)
+{
+ if (firmware_has_feature(FW_FEATURE_ISERIES)) {
+ char *d = dest;
+ const volatile char __iomem *s = src;
+
+ while (n-- > 0) {
+ *d++ = iSeries_Read_Byte(s++);
+ }
+ } else
+ eeh_memcpy_fromio(dest, src, n);
+}
+EXPORT_SYMBOL(memcpy_fromio);
+
+void memcpy_toio(volatile void __iomem *dest, const void *src, unsigned long n)
+{
+ if (firmware_has_feature(FW_FEATURE_ISERIES)) {
+ const char *s = src;
+ volatile char __iomem *d = dest;
+
+ while (n-- > 0) {
+ iSeries_Write_Byte(*s++, d++);
+ }
+ } else
+ eeh_memcpy_toio(dest, src, n);
+}
+EXPORT_SYMBOL(memcpy_toio);
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 174fb89..46bae1c 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -20,9 +20,6 @@ #include <linux/compiler.h>
#include <asm/page.h>
#include <asm/byteorder.h>
#include <asm/paca.h>
-#ifdef CONFIG_PPC_ISERIES
-#include <asm/iseries/iseries_io.h>
-#endif
#include <asm/synch.h>
#include <asm/delay.h>
@@ -37,41 +34,53 @@ extern unsigned long isa_io_base;
extern unsigned long pci_io_base;
#ifdef CONFIG_PPC_ISERIES
-/* __raw_* accessors aren't supported on iSeries */
-#define __raw_readb(addr) { BUG(); 0; }
-#define __raw_readw(addr) { BUG(); 0; }
-#define __raw_readl(addr) { BUG(); 0; }
-#define __raw_readq(addr) { BUG(); 0; }
-#define __raw_writeb(v, addr) { BUG(); 0; }
-#define __raw_writew(v, addr) { BUG(); 0; }
-#define __raw_writel(v, addr) { BUG(); 0; }
-#define __raw_writeq(v, addr) { BUG(); 0; }
-#define readb(addr) iSeries_Read_Byte(addr)
-#define readw(addr) iSeries_Read_Word(addr)
-#define readl(addr) iSeries_Read_Long(addr)
-#define writeb(data, addr) iSeries_Write_Byte((data),(addr))
-#define writew(data, addr) iSeries_Write_Word((data),(addr))
-#define writel(data, addr) iSeries_Write_Long((data),(addr))
-#define memset_io(a,b,c) iSeries_memset_io((a),(b),(c))
-#define memcpy_fromio(a,b,c) iSeries_memcpy_fromio((a), (b), (c))
-#define memcpy_toio(a,b,c) iSeries_memcpy_toio((a), (b), (c))
-
-#define inb(addr) readb(((void __iomem *)(long)(addr)))
-#define inw(addr) readw(((void __iomem *)(long)(addr)))
-#define inl(addr) readl(((void __iomem *)(long)(addr)))
-#define outb(data,addr) writeb(data,((void __iomem *)(long)(addr)))
-#define outw(data,addr) writew(data,((void __iomem *)(long)(addr)))
-#define outl(data,addr) writel(data,((void __iomem *)(long)(addr)))
-/*
- * The *_ns versions below don't do byte-swapping.
- * Neither do the standard versions now, these are just here
- * for older code.
- */
-#define insb(port, buf, ns) _insb((u8 __iomem *)((port)+pci_io_base), (buf), (ns))
-#define insw(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns))
-#define insl(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl))
-#else
+extern int in_8(const volatile unsigned char __iomem *addr);
+extern void out_8(volatile unsigned char __iomem *addr, int val);
+extern int in_le16(const volatile unsigned short __iomem *addr);
+extern int in_be16(const volatile unsigned short __iomem *addr);
+extern void out_le16(volatile unsigned short __iomem *addr, int val);
+extern void out_be16(volatile unsigned short __iomem *addr, int val);
+extern unsigned in_le32(const volatile unsigned __iomem *addr);
+extern unsigned in_be32(const volatile unsigned __iomem *addr);
+extern void out_le32(volatile unsigned __iomem *addr, int val);
+extern void out_be32(volatile unsigned __iomem *addr, int val);
+extern unsigned long in_le64(const volatile unsigned long __iomem *addr);
+extern unsigned long in_be64(const volatile unsigned long __iomem *addr);
+extern void out_le64(volatile unsigned long __iomem *addr, unsigned long val);
+extern void out_be64(volatile unsigned long __iomem *addr, unsigned long val);
+
+extern unsigned char __raw_readb(const volatile void __iomem *addr);
+extern unsigned short __raw_readw(const volatile void __iomem *addr);
+extern unsigned int __raw_readl(const volatile void __iomem *addr);
+extern unsigned long __raw_readq(const volatile void __iomem *addr);
+extern void __raw_writeb(unsigned char v, volatile void __iomem *addr);
+extern void __raw_writew(unsigned short v, volatile void __iomem *addr);
+extern void __raw_writel(unsigned int v, volatile void __iomem *addr);
+extern void __raw_writeq(unsigned long v, volatile void __iomem *addr);
+
+extern void memset_io(volatile void __iomem *addr, int c, unsigned long n);
+extern void memcpy_fromio(void *dest, const volatile void __iomem *src,
+ unsigned long n);
+extern void memcpy_toio(volatile void __iomem *dest, const void *src,
+ unsigned long n);
+
+#else /* CONFIG_PPC_ISERIES */
+
+#define in_8(addr) __in_8((addr))
+#define out_8(addr, val) __out_8((addr), (val))
+#define in_le16(addr) __in_le16((addr))
+#define in_be16(addr) __in_be16((addr))
+#define out_le16(addr, val) __out_le16((addr), (val))
+#define out_be16(addr, val) __out_be16((addr), (val))
+#define in_le32(addr) __in_le32((addr))
+#define in_be32(addr) __in_be32((addr))
+#define out_le32(addr, val) __out_le32((addr), (val))
+#define out_be32(addr, val) __out_be32((addr), (val))
+#define in_le64(addr) __in_le64((addr))
+#define in_be64(addr) __in_be64((addr))
+#define out_le64(addr, val) __out_le64((addr), (val))
+#define out_be64(addr, val) __out_be64((addr), (val))
static inline unsigned char __raw_readb(const volatile void __iomem *addr)
{
@@ -105,23 +114,11 @@ static inline void __raw_writeq(unsigned
{
*(volatile unsigned long __force *)addr = v;
}
-#define readb(addr) eeh_readb(addr)
-#define readw(addr) eeh_readw(addr)
-#define readl(addr) eeh_readl(addr)
-#define readq(addr) eeh_readq(addr)
-#define writeb(data, addr) eeh_writeb((data), (addr))
-#define writew(data, addr) eeh_writew((data), (addr))
-#define writel(data, addr) eeh_writel((data), (addr))
-#define writeq(data, addr) eeh_writeq((data), (addr))
#define memset_io(a,b,c) eeh_memset_io((a),(b),(c))
#define memcpy_fromio(a,b,c) eeh_memcpy_fromio((a),(b),(c))
#define memcpy_toio(a,b,c) eeh_memcpy_toio((a),(b),(c))
-#define inb(port) eeh_inb((unsigned long)port)
-#define outb(val, port) eeh_outb(val, (unsigned long)port)
-#define inw(port) eeh_inw((unsigned long)port)
-#define outw(val, port) eeh_outw(val, (unsigned long)port)
-#define inl(port) eeh_inl((unsigned long)port)
-#define outl(val, port) eeh_outl(val, (unsigned long)port)
+
+#endif /* CONFIG_PPC_ISERIES */
/*
* The insw/outsw/insl/outsl macros don't do byte-swapping.
@@ -132,12 +129,25 @@ #define insb(port, buf, ns) eeh_insb((po
#define insw(port, buf, ns) eeh_insw_ns((port), (buf), (ns))
#define insl(port, buf, nl) eeh_insl_ns((port), (buf), (nl))
-#endif
-
#define outsb(port, buf, ns) _outsb((u8 __iomem *)((port)+pci_io_base), (buf), (ns))
#define outsw(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns))
#define outsl(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl))
+#define readb(addr) eeh_readb(addr)
+#define readw(addr) eeh_readw(addr)
+#define readl(addr) eeh_readl(addr)
+#define readq(addr) eeh_readq(addr)
+#define writeb(data, addr) eeh_writeb((data), (addr))
+#define writew(data, addr) eeh_writew((data), (addr))
+#define writel(data, addr) eeh_writel((data), (addr))
+#define writeq(data, addr) eeh_writeq((data), (addr))
+#define inb(port) eeh_inb((unsigned long)port)
+#define outb(val, port) eeh_outb(val, (unsigned long)port)
+#define inw(port) eeh_inw((unsigned long)port)
+#define outw(val, port) eeh_outw(val, (unsigned long)port)
+#define inl(port) eeh_inl((unsigned long)port)
+#define outl(val, port) eeh_outl(val, (unsigned long)port)
+
#define readb_relaxed(addr) readb(addr)
#define readw_relaxed(addr) readw(addr)
#define readl_relaxed(addr) readl(addr)
@@ -258,7 +268,7 @@ #define iobarrier_w() eieio()
* and should not be used directly by device drivers. Use inb/readb
* instead.
*/
-static inline int in_8(const volatile unsigned char __iomem *addr)
+static inline int __in_8(const volatile unsigned char __iomem *addr)
{
int ret;
@@ -267,14 +277,14 @@ static inline int in_8(const volatile un
return ret;
}
-static inline void out_8(volatile unsigned char __iomem *addr, int val)
+static inline void __out_8(volatile unsigned char __iomem *addr, int val)
{
__asm__ __volatile__("sync; stb%U0%X0 %1,%0"
: "=m" (*addr) : "r" (val));
get_paca()->io_sync = 1;
}
-static inline int in_le16(const volatile unsigned short __iomem *addr)
+static inline int __in_le16(const volatile unsigned short __iomem *addr)
{
int ret;
@@ -283,7 +293,7 @@ static inline int in_le16(const volatile
return ret;
}
-static inline int in_be16(const volatile unsigned short __iomem *addr)
+static inline int __in_be16(const volatile unsigned short __iomem *addr)
{
int ret;
@@ -292,21 +302,21 @@ static inline int in_be16(const volatile
return ret;
}
-static inline void out_le16(volatile unsigned short __iomem *addr, int val)
+static inline void __out_le16(volatile unsigned short __iomem *addr, int val)
{
__asm__ __volatile__("sync; sthbrx %1,0,%2"
: "=m" (*addr) : "r" (val), "r" (addr));
get_paca()->io_sync = 1;
}
-static inline void out_be16(volatile unsigned short __iomem *addr, int val)
+static inline void __out_be16(volatile unsigned short __iomem *addr, int val)
{
__asm__ __volatile__("sync; sth%U0%X0 %1,%0"
: "=m" (*addr) : "r" (val));
get_paca()->io_sync = 1;
}
-static inline unsigned in_le32(const volatile unsigned __iomem *addr)
+static inline unsigned __in_le32(const volatile unsigned __iomem *addr)
{
unsigned ret;
@@ -315,7 +325,7 @@ static inline unsigned in_le32(const vol
return ret;
}
-static inline unsigned in_be32(const volatile unsigned __iomem *addr)
+static inline unsigned __in_be32(const volatile unsigned __iomem *addr)
{
unsigned ret;
@@ -324,21 +334,21 @@ static inline unsigned in_be32(const vol
return ret;
}
-static inline void out_le32(volatile unsigned __iomem *addr, int val)
+static inline void __out_le32(volatile unsigned __iomem *addr, int val)
{
__asm__ __volatile__("sync; stwbrx %1,0,%2" : "=m" (*addr)
: "r" (val), "r" (addr));
get_paca()->io_sync = 1;
}
-static inline void out_be32(volatile unsigned __iomem *addr, int val)
+static inline void __out_be32(volatile unsigned __iomem *addr, int val)
{
__asm__ __volatile__("sync; stw%U0%X0 %1,%0"
: "=m" (*addr) : "r" (val));
get_paca()->io_sync = 1;
}
-static inline unsigned long in_le64(const volatile unsigned long __iomem *addr)
+static inline unsigned long __in_le64(const volatile unsigned long __iomem *addr)
{
unsigned long tmp, ret;
@@ -358,7 +368,7 @@ static inline unsigned long in_le64(cons
return ret;
}
-static inline unsigned long in_be64(const volatile unsigned long __iomem *addr)
+static inline unsigned long __in_be64(const volatile unsigned long __iomem *addr)
{
unsigned long ret;
@@ -367,7 +377,7 @@ static inline unsigned long in_be64(cons
return ret;
}
-static inline void out_le64(volatile unsigned long __iomem *addr, unsigned long val)
+static inline void __out_le64(volatile unsigned long __iomem *addr, unsigned long val)
{
unsigned long tmp;
@@ -385,15 +395,13 @@ static inline void out_le64(volatile uns
get_paca()->io_sync = 1;
}
-static inline void out_be64(volatile unsigned long __iomem *addr, unsigned long val)
+static inline void __out_be64(volatile unsigned long __iomem *addr, unsigned long val)
{
__asm__ __volatile__("sync; std%U0%X0 %1,%0" : "=m" (*addr) : "r" (val));
get_paca()->io_sync = 1;
}
-#ifndef CONFIG_PPC_ISERIES
#include <asm/eeh.h>
-#endif
/**
* check_signature - find BIOS signatures
@@ -409,7 +417,6 @@ static inline int check_signature(const
const unsigned char *signature, int length)
{
int retval = 0;
-#ifndef CONFIG_PPC_ISERIES
do {
if (readb(io_addr) != *signature)
goto out;
@@ -419,7 +426,6 @@ #ifndef CONFIG_PPC_ISERIES
} while (length);
retval = 1;
out:
-#endif
return retval;
}
diff --git a/include/asm-powerpc/iseries/iseries_io.h b/include/asm-powerpc/iseries/iseries_io.h
deleted file mode 100644
index f29009b..0000000
--- a/include/asm-powerpc/iseries/iseries_io.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef _ASM_POWERPC_ISERIES_ISERIES_IO_H
-#define _ASM_POWERPC_ISERIES_ISERIES_IO_H
-
-
-#ifdef CONFIG_PPC_ISERIES
-#include <linux/types.h>
-/*
- * Created by Allan Trautman on Thu Dec 28 2000.
- *
- * Remaps the io.h for the iSeries Io
- * Copyright (C) 2000 Allan H Trautman, IBM Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 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
- *
- * Change Activity:
- * Created December 28, 2000
- * End Change Activity
- */
-
-#ifdef CONFIG_PCI
-extern u8 iSeries_Read_Byte(const volatile void __iomem * IoAddress);
-extern u16 iSeries_Read_Word(const volatile void __iomem * IoAddress);
-extern u32 iSeries_Read_Long(const volatile void __iomem * IoAddress);
-extern void iSeries_Write_Byte(u8 IoData, volatile void __iomem * IoAddress);
-extern void iSeries_Write_Word(u16 IoData, volatile void __iomem * IoAddress);
-extern void iSeries_Write_Long(u32 IoData, volatile void __iomem * IoAddress);
-
-extern void iSeries_memset_io(volatile void __iomem *dest, char x, size_t n);
-extern void iSeries_memcpy_toio(volatile void __iomem *dest, void *source,
- size_t n);
-extern void iSeries_memcpy_fromio(void *dest,
- const volatile void __iomem *source, size_t n);
-#else
-static inline u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress)
-{
- return 0xff;
-}
-
-static inline void iSeries_Write_Byte(u8 IoData,
- volatile void __iomem *IoAddress)
-{
-}
-#endif /* CONFIG_PCI */
-
-#endif /* CONFIG_PPC_ISERIES */
-#endif /* _ASM_POWERPC_ISERIES_ISERIES_IO_H */
--
1.4.2.1
^ permalink raw reply related
* Re: Linux on custom Xilinx board with PPC405 hangs on boot
From: Peter N. Andreasen @ 2006-09-21 7:40 UTC (permalink / raw)
To: Liu Dave-r63238, Linas Vepstas, linuxppc-dev
In-Reply-To: <995B09A8299C2C44B59866F6391D263516BFD2@zch01exm21.fsl.freescale.net>
[-- Attachment #1: Type: text/plain, Size: 1435 bytes --]
Liu, Linas, list
Thanks a lot for the answers. It helped me to review the hardware
configuration again.
The problem was the definition of the Flash size.
It turns out that the Xilinx generated header files define the size of the
Flash. But the kernel also has a configuration option: Memory Technology
Devices / Mapping Drivers for Chip Access / Physical Length of Chip Mapping
My arch/ppc/platforms/xilinx_ocp/xparameters_ml300.h defines this as 4Mbyte,
but the option in the kernel was set to 64 Mbyte (an extra 0 which I had not
seen)
thanks again
Peter
On 9/21/06, Liu Dave-r63238 <DaveLiu@freescale.com> wrote:
>
> <snip>
> > > Instruction machine check in kernel mode.
> > > Oops: machine check, sig: 7
> > > NIP: C00A2960 XER: 40000000 LR: C009CBD8 SP: C04D9D90 REGS:
> > c04d9ce0 TRAP:
> > > 0200 Not tainted
> > > MSR: 00009030 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
> >
> > Machine checks happen when some hunk of hardware is wired to
> > the machine-check pin of the cpu chip, and that bit of
> > hardware decides to raise the wire. I'd say the first step
> > is to figure ou what hardware is wired up this way, and what
> > would make it unhappy enough to assert a machine check.
> >
> > SRR1 has bits that state what caused he machine check. -- e.g
> > partity error on data or address bus, "transfer error", or MC signal.
>
> The PPC405 has different registers for machine check. Unlike classic
> powerpc.
>
> -Dave
>
[-- Attachment #2: Type: text/html, Size: 1870 bytes --]
^ permalink raw reply
* Re: Hang with isync
From: Manoj Sharma @ 2006-09-21 7:11 UTC (permalink / raw)
To: Liu Dave-r63238; +Cc: linuxppc-dev
In-Reply-To: <995B09A8299C2C44B59866F6391D263516C018@zch01exm21.fsl.freescale.net>
[-- Attachment #1: Type: text/plain, Size: 2299 bytes --]
The hang has trigerred watchdog timer exception. It points that there is
problem somewhere but don't know what is it.
Even with 2.4, it does not happen regularly. It occurs once in a while and
not reproducable.
On 9/20/06, Liu Dave-r63238 <DaveLiu@freescale.com> wrote:
>
> First, you must make sure if it really happen at watchdog timer
> exception.
> if it is, you need select one suitable way to fix it.
> Second, I don't believe the sync-isync instructions make it happen.
> you can try the 2.6, I don't know if 2.6 kernel can resolve your problem.
>
> -Dave
>
> ------------------------------
> Dave, watchdog timeout is around one second and no cpu activity for that
> long is something wrong. Is it ok to disable it to hide the problem lying
> somewhere else? Do you think it can be because of sync-isync
> instructions and moving to 2.6 might resolve it?
>
>
> On 9/20/06, Liu Dave-r63238 <DaveLiu@freescale.com> wrote:
> >
> >
> > No MSR is 00029030 and user mode bit is not set here.
> >
> > I had missed it in the prev mail:
> >
> > \x05NIP: C0005DA4 XER: 20000000 LR: C0004FE4 SP: C01F3000\x05 REGS: c01eff30
> > TRAP: 1020 Not tainted
> > MSR: 00029030 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
> > TASK = c01f1080[0] 'swapper' Last syscall: 120
> > last math 00000000 last altivec 00000000
> > \x05PLB0: bear= 0x08000000 acr= 0xbb000000 besr= 0x00000000
> >
> > Dave>I notice that MSR and TRAP, MSR is 00029030- the critical interrupt
> > enable.
> > Dave>TRAP is 1020. --WatchDog timer exception is happening
> > Dave>You can disable the MSR[CE] bit to no critical exception or disable
> > the WD timer
> >
> >
> >
> > On 9/20/06, Linas Vepstas <linas@austin.ibm.com > wrote:
> > >
> > > On Thu, Sep 21, 2006 at 08:38:13AM +1000, Benjamin Herrenschmidt
> > > wrote:
> > > > On Wed, 2006-09-20 at 15:31 -0700, Manoj Sharma wrote:
> > > > > This is the stack trace.
> > > > >
> > > > > Registers:
> > > > > GPR00: 00069030
> > >
> > > This is the MSR and it has the user-mode bit set, which is surely
> > > wrong.
> > > This is not how one gets to user space.
> > >
> > > 00048000
> > >
> > > The MSR had this or'ed into it, which is setting the user-mode bit.
> > > Surely that's wrong.
> > >
> > > --linas
> > >
> >
> >
>
[-- Attachment #2: Type: text/html, Size: 4865 bytes --]
^ permalink raw reply
* [PATCH] Use __builtin_trap() to indicate that BUG() never returns
From: Michael Ellerman @ 2006-09-21 6:48 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, Stephen Rothwell
By using __builtin_trap() in BUG() we tell the compiler that we
don't expect the code below to be executed, and in certain circumstances
this allows the compiler to elide that code altogether.
In fact it works so well that we have to put the bug section stuff
before the __builtin_trap() or else it isn't generated at all.
Tested on P5 LPAR, line numbers etc. all OK.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
include/asm-powerpc/bug.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
Index: to-merge/include/asm-powerpc/bug.h
===================================================================
--- to-merge.orig/include/asm-powerpc/bug.h
+++ to-merge/include/asm-powerpc/bug.h
@@ -37,12 +37,13 @@ struct bug_entry *find_bug(unsigned long
*/
#define BUG() do { \
- __asm__ __volatile__( \
- "1: twi 31,0,0\n" \
+ __asm__ __volatile__( \
".section __bug_table,\"a\"\n" \
- "\t"PPC_LONG" 1b,%0,%1,%2\n" \
- ".previous" \
+ "\t"PPC_LONG" 1f,%0,%1,%2\n" \
+ ".previous\n" \
+ "1: " \
: : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \
+ __builtin_trap(); \
} while (0)
#define BUG_ON(x) do { \
^ permalink raw reply
* RE: Hang with isync
From: Liu Dave-r63238 @ 2006-09-21 6:27 UTC (permalink / raw)
To: Manoj Sharma; +Cc: linuxppc-dev
In-Reply-To: <d6dada100609202317s8037f73o624015ac37402c2d@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1921 bytes --]
First, you must make sure if it really happen at watchdog timer
exception.
if it is, you need select one suitable way to fix it.
Second, I don't believe the sync-isync instructions make it happen.
you can try the 2.6, I don't know if 2.6 kernel can resolve your
problem.
-Dave
________________________________
Dave, watchdog timeout is around one second and no cpu activity
for that long is something wrong. Is it ok to disable it to hide the
problem lying somewhere else? Do you think it can be because of
sync-isync instructions and moving to 2.6 might resolve it?
On 9/20/06, Liu Dave-r63238 <DaveLiu@freescale.com> wrote:
No MSR is 00029030 and user mode bit is not set here.
I had missed it in the prev mail:
\x05NIP: C0005DA4 XER: 20000000 LR: C0004FE4 SP: C01F3000\x05
REGS: c01eff30 TRAP: 1020 Not tainted
MSR: 00029030 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
TASK = c01f1080[0] 'swapper' Last syscall: 120
last math 00000000 last altivec 00000000
\x05PLB0: bear= 0x08000000 acr= 0xbb000000 besr=
0x00000000
Dave>I notice that MSR and TRAP, MSR is 00029030- the
critical interrupt enable.
Dave>TRAP is 1020. --WatchDog timer exception is
happening
Dave>You can disable the MSR[CE] bit to no critical
exception or disable the WD timer
On 9/20/06, Linas Vepstas <linas@austin.ibm.com
> wrote:
On Thu, Sep 21, 2006 at 08:38:13AM
+1000, Benjamin Herrenschmidt wrote:
> On Wed, 2006-09-20 at 15:31 -0700,
Manoj Sharma wrote:
> > This is the stack trace.
> >
> > Registers:
> > GPR00: 00069030
This is the MSR and it has the user-mode
bit set, which is surely wrong.
This is not how one gets to user space.
00048000
The MSR had this or'ed into it, which is
setting the user-mode bit.
Surely that's wrong.
--linas
[-- Attachment #2: Type: text/html, Size: 4835 bytes --]
^ permalink raw reply
* Re: Hang with isync
From: Manoj Sharma @ 2006-09-21 6:17 UTC (permalink / raw)
To: Liu Dave-r63238; +Cc: linuxppc-dev
In-Reply-To: <995B09A8299C2C44B59866F6391D263516BFD7@zch01exm21.fsl.freescale.net>
[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]
Dave, watchdog timeout is around one second and no cpu activity for that
long is something wrong. Is it ok to disable it to hide the problem lying
somewhere else? Do you think it can be because of sync-isync
instructions and moving to 2.6 might resolve it?
On 9/20/06, Liu Dave-r63238 <DaveLiu@freescale.com> wrote:
>
>
> No MSR is 00029030 and user mode bit is not set here.
>
> I had missed it in the prev mail:
>
> \x05NIP: C0005DA4 XER: 20000000 LR: C0004FE4 SP: C01F3000\x05 REGS: c01eff30
> TRAP: 1020 Not tainted
> MSR: 00029030 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
> TASK = c01f1080[0] 'swapper' Last syscall: 120
> last math 00000000 last altivec 00000000
> \x05PLB0: bear= 0x08000000 acr= 0xbb000000 besr= 0x00000000
>
> Dave>I notice that MSR and TRAP, MSR is 00029030- the critical interrupt
> enable.
> Dave>TRAP is 1020. --WatchDog timer exception is happening
> Dave>You can disable the MSR[CE] bit to no critical exception or disable
> the WD timer
>
>
>
> On 9/20/06, Linas Vepstas <linas@austin.ibm.com> wrote:
> >
> > On Thu, Sep 21, 2006 at 08:38:13AM +1000, Benjamin Herrenschmidt wrote:
> > > On Wed, 2006-09-20 at 15:31 -0700, Manoj Sharma wrote:
> > > > This is the stack trace.
> > > >
> > > > Registers:
> > > > GPR00: 00069030
> >
> > This is the MSR and it has the user-mode bit set, which is surely wrong.
> > This is not how one gets to user space.
> >
> > 00048000
> >
> > The MSR had this or'ed into it, which is setting the user-mode bit.
> > Surely that's wrong.
> >
> > --linas
> >
>
>
[-- Attachment #2: Type: text/html, Size: 2975 bytes --]
^ permalink raw reply
* [POWERPC] mark BUG() as noreturn
From: Stephen Rothwell @ 2006-09-21 4:55 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, Hollis Blanchard
In-Reply-To: <1158798041.7062.4.camel@localhost.localdomain>
>From an idea from Michael Ellerman.
We finish the BUG() macro with a call to a function marked with attribute
"noreturn" so that the compiler will know that BUG() and BUG_ON()
(with a constant, non-zero argument) will not return.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
include/asm-powerpc/bug.h | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h
index f44b529..cf5c460 100644
--- a/include/asm-powerpc/bug.h
+++ b/include/asm-powerpc/bug.h
@@ -31,6 +31,16 @@ #define BUG_WARNING_TRAP 0x1000000
#ifdef CONFIG_BUG
/*
+ * This is so that we can tell the compiler that BUG() and
+ * BUG_ON() with a constant non-zero argument does not return.
+ */
+static inline void __attribute__((noreturn)) __bug_does_not_return(void)
+{
+ while (1)
+ /* do nothing */;
+}
+
+/*
* BUG_ON() and WARN_ON() do their best to cooperate with compile-time
* optimisations. However depending on the complexity of the condition
* some compiler versions may not produce optimal results.
@@ -43,6 +53,7 @@ #define BUG() do { \
"\t"PPC_LONG" 1b,%0,%1,%2\n" \
".previous" \
: : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \
+ __bug_does_not_return(); \
} while (0)
#define BUG_ON(x) do { \
--
1.4.2.1
^ permalink raw reply related
* [PATCH] kdump: don't call __ioremap() for pfn = 0
From: Sachin P. Sant @ 2006-09-21 4:37 UTC (permalink / raw)
To: linuxppc-dev; +Cc: paulus, Fastboot mailing list
[-- Attachment #1: Type: text/plain, Size: 517 bytes --]
Hi
While using dd command to retrive the dump from /dev/oldmem, there comes
a rare case where pfn value is zero. In this case the __ioremap() call
returns
NULL and hence copying fails.
# dd if=/dev/oldmem of=/dev/null
dd: reading `/dev/oldmem': Bad address
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000121 seconds, 0.0 kB/s
Attached is a patch to fix this problem. During such rare cases don't call
__ioremap() to do the address translation, instead use __va() .
Tested with 2.6.18.
Thanks
-Sachin
[-- Attachment #2: kdump-no-ioremap-for-pfn-zero-fix --]
[-- Type: text/plain, Size: 1027 bytes --]
* During some rare cases [like using dd command with /dev/oldmem] the pfn value
can be zero. Do not call __ioremap for zero pfn value, instead use __va to
calculate the virtual address.
Signed-off-by: Sachin Sant <sachinp@in.ibm.com>
diff -Naurp a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c
--- a/arch/powerpc/kernel/crash_dump.c 2006-09-20 09:12:06.000000000 +0530
+++ b/arch/powerpc/kernel/crash_dump.c 2006-09-21 09:06:35.000000000 +0530
@@ -101,7 +101,15 @@ ssize_t copy_oldmem_page(unsigned long p
if (!csize)
return 0;
- vaddr = __ioremap(pfn << PAGE_SHIFT, PAGE_SIZE, 0);
+ /* During some rare cases [like using dd command with /dev/oldmem]
+ * the pfn value can be zero. Do not call __ioremap for zero
+ * pfn value, instead use __va to calculate the virtual address.
+ */
+
+ if (pfn == 0)
+ vaddr = __va(pfn << PAGE_SHIFT);
+ else
+ vaddr = __ioremap(pfn << PAGE_SHIFT, PAGE_SIZE, 0);
if (userbuf) {
if (copy_to_user((char __user *)buf, (vaddr + offset), csize)) {
^ permalink raw reply
* RE: Hang with isync
From: Liu Dave-r63238 @ 2006-09-21 4:24 UTC (permalink / raw)
To: Manoj Sharma, Linas Vepstas; +Cc: linuxppc-dev
In-Reply-To: <d6dada100609201759r5dd047d7y2b60684d9c4feaa8@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1179 bytes --]
No MSR is 00029030 and user mode bit is not set here.
I had missed it in the prev mail:
\x05NIP: C0005DA4 XER: 20000000 LR: C0004FE4 SP: C01F3000\x05 REGS: c01eff30
TRAP: 1020 Not tainted
MSR: 00029030 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
TASK = c01f1080[0] 'swapper' Last syscall: 120
last math 00000000 last altivec 00000000
\x05PLB0: bear= 0x08000000 acr= 0xbb000000 besr= 0x00000000
Dave>I notice that MSR and TRAP, MSR is 00029030- the critical interrupt
enable.
Dave>TRAP is 1020. --WatchDog timer exception is happening
Dave>You can disable the MSR[CE] bit to no critical exception or disable
the WD timer
On 9/20/06, Linas Vepstas <linas@austin.ibm.com> wrote:
On Thu, Sep 21, 2006 at 08:38:13AM +1000, Benjamin
Herrenschmidt wrote:
> On Wed, 2006-09-20 at 15:31 -0700, Manoj Sharma wrote:
> > This is the stack trace.
> >
> > Registers:
> > GPR00: 00069030
This is the MSR and it has the user-mode bit set, which
is surely wrong.
This is not how one gets to user space.
00048000
The MSR had this or'ed into it, which is setting the
user-mode bit.
Surely that's wrong.
--linas
[-- Attachment #2: Type: text/html, Size: 2624 bytes --]
^ permalink raw reply
* Re: [Fastboot] [PATCH] kexec: remove memory reserve patching for powerpc device tree
From: Michael Neuling @ 2006-09-21 4:04 UTC (permalink / raw)
To: michael; +Cc: linuxppc-dev, Horms, Fastboot mailing list
In-Reply-To: <1158810033.7062.23.camel@localhost.localdomain>
> Sure it's hard, but we can at least try. If we put this patch in we'll
> be breaking backward compatibility simply in order to beautify the
> kexec-tools code a little.
Agreed.
> I think the best option is just to add a note somewhere in the kexec
> sources that we can remove that code sometime in the future.
Agreed. The code being removed is hacky, but mostly harmless.
Mikey
^ permalink raw reply
* RE: Linux on custom Xilinx board with PPC405 hangs on boot
From: Liu Dave-r63238 @ 2006-09-21 3:50 UTC (permalink / raw)
To: Linas Vepstas, Peter N. Andreasen; +Cc: linuxppc-dev
In-Reply-To: <20060920235716.GV29167@austin.ibm.com>
<snip>
> > Instruction machine check in kernel mode.
> > Oops: machine check, sig: 7
> > NIP: C00A2960 XER: 40000000 LR: C009CBD8 SP: C04D9D90 REGS:=20
> c04d9ce0 TRAP:
> > 0200 Not tainted
> > MSR: 00009030 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
>=20
> Machine checks happen when some hunk of hardware is wired to=20
> the machine-check pin of the cpu chip, and that bit of=20
> hardware decides to raise the wire. I'd say the first step=20
> is to figure ou what hardware is wired up this way, and what=20
> would make it unhappy enough to assert a machine check.
>=20
> SRR1 has bits that state what caused he machine check. -- e.g=20
> partity error on data or address bus, "transfer error", or MC signal.
The PPC405 has different registers for machine check. Unlike classic
powerpc.
-Dave
^ permalink raw reply
* RE: Linux on custom Xilinx board with PPC405 hangs on boot
From: Liu Dave-r63238 @ 2006-09-21 3:42 UTC (permalink / raw)
To: Peter N. Andreasen, linuxppc-dev
In-Reply-To: <36468a5c0609200216n753d69b0hdf8ff2cb53714f90@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4316 bytes --]
I have a custom Xilinx FPGA board which is similar to ML300 but
uses Uartllite and does not have disk or display.
When I start the Linux kernel I end up with an exception during
the probe for Flash - I think.
I have added a bunch of printk lines in order to see what is
happening but I am a little stuck at the moment.
The Flash chip is an AM29LV320D 4Mbyte in 16-bit access mode,
and it sits on address 0xFF80'0000
This is what I get on my terminal. I would be happy to hear your
advice.
Peter
loaded at: 00400000 004CF1E0
board data at: 004CC138 004CC150
relocated to: 004052F4 0040530C
zimage at: 00405801 00472CFB
initrd at: 00473000 004CB2FF
avail ram: 004D0000 02000000
Linux/PPC load: root=/dev/ram rw console=ttl0
Uncompressing Linux...done.
Now booting the kernel
id mach(): done
MMU:enter
MMU:hw init
MMU:mapin
MMU:mapin_ram done
MMU:setio
MMU:exit
Linux version 2.4.26 (pna@glazedevel) (gcc version 3.4.1) #50
Wed Sep 20 11:06:12 CEST 2006
setup_arch: enter
setup_arch: bootmem
Xilinx Virtex-II Pro port (C) 2002 MontaVista Software, Inc.
(source@mvista.com)
arch: exit
On node 0 totalpages: 8192
zone(0): 8192 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/ram rw console=ttl0
(start) init/main.c: parse_options
(end) parse_options
(start) arch/ppc/mm/pgtable.c: __ioremap
(end) arch/ppc/mm/pgtable.c: __ioremap
Xilinx INTC #0 at 0x81200000 mapped to 0xFDFFF000
(start) arch/ppc/mm/pgtable.c: __ioremap
(end) arch/ppc/mm/pgtable.c: __ioremap
Calibrating delay loop... 287.53 BogoMIPS
Memory: 30924k available (776k kernel code, 276k data, 44k init,
0k highmem)
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
POSIX conformance testing by UNIFIX
(start) init/main.c: init
(start) init/main.c: do_basic_setup
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
(start) init/main.c: do_initcalls
Starting kswapd
devfs: v1.12c (20020818) Richard Gooch ( rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
JFFS version 1.0, (C) 1999, 2000 Axis Communications AB
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis
Communications AB.
Generic RTC Driver v1.07
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024
blocksize
loop: loaded (max 8 devices)
(start) drivers/mtd/maps/physmap.c: init_physmap
physmap flash device: 4000000 at ff800000
(start) arch/ppc/mm/pgtable.c: __ioremap
(end) arch/ppc/mm/pgtable.c: __ioremap
(start) drivers/mtd/chips/chipreg.c: do_map_probe
(start) drivers/mtd/chips/chipreg.c: get_mtd_chip_driver
(end) drivers/mtd/chips/chipreg.c: get_mtd_chip_driver
(after get_mtd_chip_driver) drivers/mtd/chips/chipreg.c:
do_map_probe
(start) drivers/mtd/chips/gen_probe.c: mtd_do_chip_probe
(start) drivers/mtd/chips/gen_probe.c: genprobe_ident_chips
Instruction machine check in kernel mode.
^^^^^^^^^
You should make sure if it is instruction or data machinecheck.
The kernel you using is very old.
Oops: machine check, sig: 7
NIP: C00A2960 XER: 40000000 LR: C009CBD8 SP: C04D9D90 REGS:
c04d9ce0 TRAP: 0200 Not tainted
^^^^^^^^^^^
It has really machinecheck.
MSR: 00009030 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
TASK = c04d8000[1] 'swapper' Last syscall: 120
last math 00000000 last altivec 00000000
GPR00: C00A2958 C04D9D90 C04D8000 C00DC1C8 000000F0 00400000
C04D9DD0 C00DB387
GPR08: 00000002 C307D000 C0176360 00000001 C00F0000 000057E0
80001040 80000820
GPR16: 00001020 00000840 10021000 08040800 C00D0000 C00EAC18
C00D0000 00000000
GPR24: C00C0000 00000001 C04D9DD0 C04D9E10 C04D9E10 00400000
C04D9DD0 C00DC1C8
Call backtrace:
C009CE80 C00A26D0 C009D3A0 C009C750 C00E9BB0 C00024F4 C0005ED4
You need dump more register to find the cause. eg. ESR. MCSR...
Kernel panic: Attempted to kill init!
<0>Rebooting in 180 seconds..
[-- Attachment #2: Type: text/html, Size: 7040 bytes --]
^ permalink raw reply
* Re: [Fastboot] [PATCH] kexec: remove memory reserve patching for powerpc device tree
From: Michael Ellerman @ 2006-09-21 3:40 UTC (permalink / raw)
To: Horms; +Cc: linuxppc-dev, Michael Neuling, Fastboot mailing list
In-Reply-To: <20060921025122.GA8573@verge.net.au>
[-- Attachment #1: Type: text/plain, Size: 2274 bytes --]
On Thu, 2006-09-21 at 11:51 +0900, Horms wrote:
> On Thu, Sep 21, 2006 at 11:59:04AM +1000, Michael Ellerman wrote:
> > On Thu, 2006-09-21 at 11:10 +1000, Michael Neuling wrote:
> > > This code no longer needed with Jimi's auto reserve of device tree blob
> > > kernel patch now in 2.6.18.
> > >
> > > This patch will break Linux if you're kexecing to a kernel which doesn't
> > > have this patch (ie. earlier than 2.6.17). Required kernel patch is
> > > this one:
> > > http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d1f3f25d9c303d1ce63b42cc94c54ac0ab2e950
> > >
> >
> > Although it'd be nice to get rid of that code, I'm not sure we want to
> > go breaking this. This will mean RHEL5 and SLES10 users can't use
> > upstream kexec-tools :/
>
> Surely if they are using a RHEL5 or SLES10 kernel then its
> reasonably to expect they are also using a RHEL5 or SLES10 supplied
> kexec-tool.
Or Ubuntu Dapper .. Debian Stable .. FC whatever. In general they'll be
using the distro tools sure, but I'd rather not force them to. I
generally expect to be able to run mainline kernels without upgrading my
entire distro - it should cut both ways IMHO.
> I guess it all comes down to backwards compatibility.
> And IMHO thats a hard thing to maintain with something
> as green as kexec.
>
> I'm in favour of the patch, though I'm prepared to be convinced otherwise.
Sure it's hard, but we can at least try. If we put this patch in we'll
be breaking backward compatibility simply in order to beautify the
kexec-tools code a little.
> If the code needs to stay, perhaps this patch could be modified
> so that the code in question is only executed if the kernel
> is pre 2.6.18. Or is that just overly complex?
There's no need, it simply means the blob is reserved twice, which is
pretty harmless.
I think the best option is just to add a note somewhere in the kexec
sources that we can remove that code sometime in the future.
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply
* Re: [Fastboot] [PATCH] kexec: remove memory reserve patching for powerpc device tree
From: Horms @ 2006-09-21 2:51 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, Michael Neuling, Fastboot mailing list
In-Reply-To: <1158803944.7062.9.camel@localhost.localdomain>
On Thu, Sep 21, 2006 at 11:59:04AM +1000, Michael Ellerman wrote:
> On Thu, 2006-09-21 at 11:10 +1000, Michael Neuling wrote:
> > This code no longer needed with Jimi's auto reserve of device tree blob
> > kernel patch now in 2.6.18.
> >
> > This patch will break Linux if you're kexecing to a kernel which doesn't
> > have this patch (ie. earlier than 2.6.17). Required kernel patch is
> > this one:
> > http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d1f3f25d9c303d1ce63b42cc94c54ac0ab2e950
> >
>
> Although it'd be nice to get rid of that code, I'm not sure we want to
> go breaking this. This will mean RHEL5 and SLES10 users can't use
> upstream kexec-tools :/
Surely if they are using a RHEL5 or SLES10 kernel then its
reasonably to expect they are also using a RHEL5 or SLES10 supplied
kexec-tool.
I guess it all comes down to backwards compatibility.
And IMHO thats a hard thing to maintain with something
as green as kexec.
I'm in favour of the patch, though I'm prepared to be convinced otherwise.
If the code needs to stay, perhaps this patch could be modified
so that the code in question is only executed if the kernel
is pre 2.6.18. Or is that just overly complex?
--
Horms
H: http://www.vergenet.net/~horms/
W: http://www.valinux.co.jp/en/
^ permalink raw reply
* Re: [PATCH] kexec: remove memory reserve patching for powerpc device tree
From: Michael Ellerman @ 2006-09-21 1:59 UTC (permalink / raw)
To: Michael Neuling; +Cc: linuxppc-dev, Fastboot mailing list
In-Reply-To: <20060921011031.4BFEA67BCE@ozlabs.org>
[-- Attachment #1: Type: text/plain, Size: 892 bytes --]
On Thu, 2006-09-21 at 11:10 +1000, Michael Neuling wrote:
> This code no longer needed with Jimi's auto reserve of device tree blob
> kernel patch now in 2.6.18.
>
> This patch will break Linux if you're kexecing to a kernel which doesn't
> have this patch (ie. earlier than 2.6.17). Required kernel patch is
> this one:
> http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d1f3f25d9c303d1ce63b42cc94c54ac0ab2e950
>
Although it'd be nice to get rid of that code, I'm not sure we want to
go breaking this. This will mean RHEL5 and SLES10 users can't use
upstream kexec-tools :/
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox