* Re: [PATCH] powerpc: allow PHBs anywhere in the device tree
From: Olof Johansson @ 2006-09-12 19:54 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev, cbe-oss-dev
In-Reply-To: <200609121952.04779.arnd.bergmann@de.ibm.com>
Hi,
Looks good. Two very minor nitpicks below.
-Olof
On Tue, 12 Sep 2006 19:52:04 +0200 Arnd Bergmann <arnd.bergmann@de.ibm.com> wrote:
> The rtas_pci code currently restricts pci host bridges to
> locations directly under the device tree root. In order to
> correctly model a north bridge that has multiple PCI buses,
> that restriction needs to be relaxed.
>
> The new definition is a device node of type "pci" whose
> parent is of a different type, so we don't treat pci-to-pci
> bridges as host bridges.
> It also accepts any device type of "pci", "pcie", "ht" and
> "pciex" in order to match anything that is currently in use.
>
> I have added a new helper "of_find_phb_node" to prom.c so
> that pci implementations of non-rtas platforms can use this
> as well.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Index: linux-2.6/arch/powerpc/kernel/prom.c
> ===================================================================
> --- linux-2.6.orig/arch/powerpc/kernel/prom.c
> +++ linux-2.6/arch/powerpc/kernel/prom.c
> @@ -1325,6 +1325,72 @@ struct device_node *of_get_next_child(co
> EXPORT_SYMBOL(of_get_next_child);
>
> /**
> + * of_node_is_pci - Test if a node a pci host
> + * @node: node to compare
> + *
> + * returns 1 for PCI hosts and 0 for anything else
> + *
> + * This function is meant to be called from
> + * of_find_phb_node as a helper. We compare both
> + * the compatible and the device_type properties
> + * to known strings used to indicate PCI hosts.
> + */
> +static int of_node_is_pci(struct device_node *node)
> +{
> + if (!node->type)
> + return 0;
> +
> + if (strcasecmp(node->type, "pci") == 0 ||
> + strcasecmp(node->type, "ht") == 0 ||
> + strcasecmp(node->type, "pciex") == 0 ||
> + strcasecmp(node->type, "pcie") == 0)
!strcasecmp(...) instead?
Do they ever exist in non-lowercase versions? Old code just did
strcmp().
> + return 1;
> +
> + if (device_is_compatible(node, "pci") ||
> + device_is_compatible(node, "ht") ||
> + device_is_compatible(node, "pciex") ||
> + device_is_compatible(node, "pcie"))
> + return 1;
> +
> + return 0;
> +}
> +
> +/**
> + *
> + * of_find_phb_node - Iterate all PCI host bridge device nodes
> + *
> + * @from: The node to start searching from or NULL, the node
> + * you pass will not be searched, only the next one
> + * will; typically, you pass what the previous call
> + * returned. of_node_put() will be called on it
Convention seems to be to call this "prev", not "from"?
> + *
> + * Returns a node pointer with refcount incremented, use
> + * of_node_put() on it when done.
> + *
> + * since we only want to return host bridges, not pci-pci
> + * bridges, check if the parent is not also a pci host.
> + */
> +struct device_node *of_find_phb_node(struct device_node *from)
> +{
> + struct device_node *np;
> +
> + read_lock(&devtree_lock);
> + np = from ? from->allnext : allnodes;
> + for (; np; np = np->allnext) {
> + if (of_node_is_pci(np) &&
> + np->parent &&
> + !of_node_is_pci(np->parent))
> + break;
> + }
> + if (np)
> + of_node_get(np);
> + if (from)
> + of_node_put(from);
> + read_unlock(&devtree_lock);
> + return np;
> +}
> +
> +/**
> * of_node_get - Increment refcount of a node
> * @node: Node to inc refcount, NULL is supported to
> * simplify writing of callers
> Index: linux-2.6/arch/powerpc/kernel/rtas_pci.c
> ===================================================================
> --- linux-2.6.orig/arch/powerpc/kernel/rtas_pci.c
> +++ linux-2.6/arch/powerpc/kernel/rtas_pci.c
> @@ -240,13 +240,6 @@ unsigned long __devinit get_phb_buid (st
>
> if (ibm_read_pci_config == -1) return 0;
>
> - /* PHB's will always be children of the root node,
> - * or so it is promised by the current firmware. */
> - if (phb->parent == NULL)
> - return 0;
> - if (phb->parent->parent)
> - return 0;
> -
> buid_vals = (unsigned int *) get_property(phb, "reg", &len);
> if (buid_vals == NULL)
> return 0;
> @@ -297,17 +290,10 @@ unsigned long __init find_and_init_phbs(
> struct device_node *node;
> struct pci_controller *phb;
> unsigned int index;
> - struct device_node *root = of_find_node_by_path("/");
>
> + node = NULL;
> index = 0;
> - for (node = of_get_next_child(root, NULL);
> - node != NULL;
> - node = of_get_next_child(root, node)) {
> -
> - if (node->type == NULL || (strcmp(node->type, "pci") != 0 &&
> - strcmp(node->type, "pciex") != 0))
> - continue;
> -
> + while ((node = of_find_phb_node(node))) {
> phb = pcibios_alloc_controller(node);
> if (!phb)
> continue;
> @@ -316,8 +302,6 @@ unsigned long __init find_and_init_phbs(
> pci_setup_phb_io(phb, index == 0);
> index++;
> }
> -
> - of_node_put(root);
> pci_devs_phb_init();
>
> /*
> Index: linux-2.6/include/asm-powerpc/prom.h
> ===================================================================
> --- linux-2.6.orig/include/asm-powerpc/prom.h
> +++ linux-2.6/include/asm-powerpc/prom.h
> @@ -131,6 +131,7 @@ extern struct device_node *of_find_compa
> extern struct device_node *of_find_node_by_path(const char *path);
> extern struct device_node *of_find_node_by_phandle(phandle handle);
> extern struct device_node *of_find_all_nodes(struct device_node *prev);
> +extern struct device_node *of_find_phb_node(struct device_node *from);
> extern struct device_node *of_get_parent(const struct device_node *node);
> extern struct device_node *of_get_next_child(const struct device_node *node,
> struct device_node *prev);
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [Cbe-oss-dev] [PATCH] powerpc: allow PHBs anywhere in the device tree
From: Arnd Bergmann @ 2006-09-12 21:16 UTC (permalink / raw)
To: cbe-oss-dev; +Cc: Olof Johansson, linuxppc-dev
In-Reply-To: <20060912145438.30b6bf80@localhost.localdomain>
On Tuesday 12 September 2006 21:54, Olof Johansson wrote:
> !strcasecmp(...) instead?
I do that normally for functions that return either a truth value
or a pointer to an object that may be NULL, whereas strcasecmp
returns a numerical value that I'm checking for a specific result.
This is also consistant with how it is used elsewhere in the file.
> Do they ever exist in non-lowercase versions? Old code just did
> strcmp().
I took that from device_is_compatible(), which also does
strncasecmp, so I assumed that was done for a reason.
> > + *=A0=A0=A0@from:=A0=A0The node to start searching from or NULL, the n=
ode
> > + *=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0you pass will not be searched, only=
the next one
> > + *=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0will; typically, you pass what the =
previous call
> > + *=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0returned. of_node_put() will be cal=
led on it
>=20
> Convention seems to be to call this "prev", not "from"?
ok
Arnd <><
^ permalink raw reply
* Re: [Cbe-oss-dev] [PATCH] powerpc: allow PHBs anywhere in the device tree
From: Olof Johansson @ 2006-09-12 21:44 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev, cbe-oss-dev
In-Reply-To: <200609122316.21820.arnd@arndb.de>
On Tue, 12 Sep 2006 23:16:21 +0200 Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 12 September 2006 21:54, Olof Johansson wrote:
> > !strcasecmp(...) instead?
>
> I do that normally for functions that return either a truth value
> or a pointer to an object that may be NULL, whereas strcasecmp
> returns a numerical value that I'm checking for a specific result.
> This is also consistant with how it is used elsewhere in the file.
Ok.
> > Do they ever exist in non-lowercase versions? Old code just did
> > strcmp().
>
> I took that from device_is_compatible(), which also does
> strncasecmp, so I assumed that was done for a reason.
I think it might be because compatible is by tradition less specific. I
was also mostly looking at the patch, not the rest of the file. Either
is fine with me though, I just wanted to bring it up.
-Olof
^ permalink raw reply
* Re: [PATCH] powerpc: allow PHBs anywhere in the device tree
From: Paul Mackerras @ 2006-09-12 22:20 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev, cbe-oss-dev
In-Reply-To: <200609121952.04779.arnd.bergmann@de.ibm.com>
Arnd Bergmann writes:
> The rtas_pci code currently restricts pci host bridges to
> locations directly under the device tree root. In order to
> correctly model a north bridge that has multiple PCI buses,
> that restriction needs to be relaxed.
Ummm, how do you think we've managed on pSeries all this time?
I could understand this if you said you needed to represent multiple
north bridges, though that would be a rather peculiar system
topology. Having multiple PCI domains hanging off a single north
bridge can be represented perfectly well with the host bridges being
children of the root, because the root node represents the address
space directly accessible to the processor(s), and it is the north
bridge that implements that address space.
What specifically do you want this for?
Paul.
^ permalink raw reply
* Re: [Cbe-oss-dev] [PATCH] powerpc: allow PHBs anywhere in the device tree
From: Arnd Bergmann @ 2006-09-12 22:39 UTC (permalink / raw)
To: cbe-oss-dev; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <17671.12953.147098.637600@cargo.ozlabs.ibm.com>
On Wednesday 13 September 2006 00:20, Paul Mackerras wrote:
> Ummm, how do you think we've managed on pSeries all this time?
>=20
> I could understand this if you said you needed to represent multiple
> north bridges, though that would be a rather peculiar system
> topology. =A0Having multiple PCI domains hanging off a single north
> bridge can be represented perfectly well with the host bridges being
> children of the root, because the root node represents the address
> space directly accessible to the processor(s), and it is the north
> bridge that implements that address space.
>=20
> What specifically do you want this for?
=46or the cell blade, we have two bridge chips that are directly
connected to one of the CPUs each and are in separate address spaces.
Besides the PCI host bridges on them (between 1 and 3 per chip,
depending on the model), there are other devices on each bridge chip
that I would like to represent there as well. To make things
worse, they are behind logical bridges on the chip itself, something
like
/bridge@1/interrupt-controller
/plb5/pcie
/plb4/pci
/ethernet
/serial
/bridge@2/plb5/pcie
/plb4/pci
each of axon, plb5, plb4 and the pci buses has their own ranges
property to map addresses.
While we could probably put all the phbs at the root, i'd much
prefer having the real topology reflected in the device tree.
Arnd <><
^ permalink raw reply
* Re: [PATCH] Unwire set/get_robust_list
From: Paul Mackerras @ 2006-09-12 23:04 UTC (permalink / raw)
To: Andreas Schwab; +Cc: linuxppc-dev, David Woodhouse
In-Reply-To: <je8xkzfbx2.fsf@sykes.suse.de>
Andreas Schwab writes:
> Thanks, sucessfully tested on 32bit (with the nptl testsuite of glibc).
> Will do some 64bit testing tomorrow.
Did you do that testing? What was the result?
Could you test David's latest patch without the memory clobber? For
reference, here it is.
Thanks,
Paul.
diff --git a/include/asm-powerpc/futex.h b/include/asm-powerpc/futex.h
index f1b3c00..936422e 100644
--- a/include/asm-powerpc/futex.h
+++ b/include/asm-powerpc/futex.h
@@ -84,7 +84,33 @@ static inline int futex_atomic_op_inuser
static inline int
futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
{
- return -ENOSYS;
+ int prev;
+
+ if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
+ return -EFAULT;
+
+ __asm__ __volatile__ (
+ LWSYNC_ON_SMP
+"1: lwarx %0,0,%2 # futex_atomic_cmpxchg_inatomic\n\
+ cmpw 0,%0,%3\n\
+ bne- 3f\n"
+ PPC405_ERR77(0,%2)
+"2: stwcx. %4,0,%2\n\
+ bne- 1b\n"
+ ISYNC_ON_SMP
+"3: .section .fixup,\"ax\"\n\
+4: li %0,%5\n\
+ b 3b\n\
+ .previous\n\
+ .section __ex_table,\"a\"\n\
+ .align 3\n\
+ " PPC_LONG "1b,4b,2b,4b\n\
+ .previous" \
+ : "=&r" (prev), "+m" (*uaddr)
+ : "r" (uaddr), "r" (oldval), "r" (newval), "i" (-EFAULT)
+ : "cc");
+
+ return prev;
}
#endif /* __KERNEL__ */
^ permalink raw reply related
* Re: [PATCH] powerpc: allow PHBs anywhere in the device tree
From: Segher Boessenkool @ 2006-09-13 0:23 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, Arnd Bergmann, cbe-oss-dev
In-Reply-To: <17671.12953.147098.637600@cargo.ozlabs.ibm.com>
>> The rtas_pci code currently restricts pci host bridges to
>> locations directly under the device tree root. In order to
>> correctly model a north bridge that has multiple PCI buses,
>> that restriction needs to be relaxed.
>
> Ummm, how do you think we've managed on pSeries all this time?
>
> I could understand this if you said you needed to represent multiple
> north bridges, though that would be a rather peculiar system
> topology.
Yes, although it actually already exists.
> Having multiple PCI domains hanging off a single north
> bridge can be represented perfectly well with the host bridges being
> children of the root, because the root node represents the address
> space directly accessible to the processor(s), and it is the north
> bridge that implements that address space.
There are some cases where you *really* want to model the PCI bridges'
parents in the OF tree as well.
And even if it wouldn't be sane -- why would Linux refuse an OF device
tree that makes perfect sense an sich? If some 970 OF would put the
HyperTransport node under the U4 node, should that really be a problem
for Linux?
> What specifically do you want this for?
Not on a public list ;-)
Segher
^ permalink raw reply
* Re: Perhaps git-update-server-info needs to be run on .../paulus/powerpc.git?
From: Paul Mackerras @ 2006-09-13 1:09 UTC (permalink / raw)
To: Kim Phillips; +Cc: linuxppc-dev
In-Reply-To: <20060911150549.0e08bbcd.kim.phillips@freescale.com>
Kim Phillips writes:
> funnily enough, I can't seem to clone your tree again today; I'm
> using the http: protocol.
>
> hopefully, the fix should only be a matter of:
>
> chmod +x hooks/post-update
Nope. This patch (to git) from Junio Hamano seems to fix it, though.
Paul.
diff --git a/http-fetch.c b/http-fetch.c
index fac1760..d870390 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -559,7 +559,13 @@ static void process_alternates_response(
char *target = NULL;
char *path;
if (data[i] == '/') {
- serverlen = strchr(base + 8, '/') - base;
+ /* This counts
+ * http://git.host/pub/scm/linux.git
+ * 1234567----here^
+ * so strcpy(dst, base, serverlen) will
+ * copy up to "...git.host/"
+ */
+ serverlen = strchr(base + 7, '/') - base;
okay = 1;
} else if (!memcmp(data + i, "../", 3)) {
i += 3;
@@ -586,7 +592,7 @@ static void process_alternates_response(
/* skip 'objects' at end */
if (okay) {
target = xmalloc(serverlen + posn - i - 6);
- strlcpy(target, base, serverlen);
+ memcpy(target, base, serverlen);
strlcpy(target + serverlen, data + i, posn - i - 6);
if (get_verbosely)
fprintf(stderr,
^ permalink raw reply related
* Re: [Cbe-oss-dev] [PATCH] powerpc: allow PHBs anywhere in the device tree
From: Benjamin Herrenschmidt @ 2006-09-13 1:46 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev, Paul Mackerras, cbe-oss-dev
In-Reply-To: <200609130039.22193.arnd@arndb.de>
> For the cell blade, we have two bridge chips that are directly
> connected to one of the CPUs each and are in separate address spaces.
> Besides the PCI host bridges on them (between 1 and 3 per chip,
> depending on the model), there are other devices on each bridge chip
> that I would like to represent there as well. To make things
> worse, they are behind logical bridges on the chip itself, something
> like
>
> /bridge@1/interrupt-controller
> /plb5/pcie
> /plb4/pci
> /ethernet
> /serial
> /bridge@2/plb5/pcie
> /plb4/pci
>
> each of axon, plb5, plb4 and the pci buses has their own ranges
> property to map addresses.
> While we could probably put all the phbs at the root, i'd much
> prefer having the real topology reflected in the device tree.
There's one more thing I think your patch isn't fixing and that will
need fixing, is pci_process_OF_bridge_ranges() which currently parses
the PHB's "ranges" property assuming that the addresses it gets for the
"parent" bus are system bus physical addresses. It needs instead to get
those translated all the way up the tree (which isn't hard btw).
As soon as I'm over this TG3 data corruption problem, I'll finally
finish setting up SIMICS here and will look into making that stuff work.
Ben.
^ permalink raw reply
* Re: 11-16-05 2.6.14 on AMCC Yosemite boar d(PCI-IDE card boot error)
From: Stephen Yee @ 2006-09-13 3:44 UTC (permalink / raw)
To: kylongmu; +Cc: linuxppc-embedded
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1: Type: text/plain; charset="gb2312", Size: 8723 bytes --]
Hi Mr. KylongMu & all,
Have you solved the issues about PCI-IDE card?
I also have tested two PCI-IDE cards and a PCI-SATA card with
2.6.13(packaged in AMCC CD) and 2.6.14(ELDK ) kernel on Yosemite board,
this issues are the same with Mr. KylongMu. the PCI-SATA is work fine.
but the two PCI-IDE cards, ITE8212 and PDC20269 failed, the panic
message was similar with Mr. KylongMu. the attached file is the
ITE8212 module driver OOPS log.
would you please give me some advice about it?
Thanks and Best regards,
stephen
KylongMu wrote:
> Dear Denk,
>
> Thanks for your help; it makes my Yosemite run up! I'm try to add a
> PCI-IDE
>
> Card on it. I test my Promise-PDC20268 card and AEC6280 (ATP865-B chip
> type) card,
>
> Both of them all failed with same error, the boot message included in
> the attachment.
>
> The kernel configure is based on the Yosemite_defconfig, add with:
>
> Device Drivers-->
>
> ATA/ATAPI/MFM/RLL support-->
>
> [*]AEC62XX Chipset support
>
> [*]PROMISE PDC202{68|69|70|71|75|76|77} SUPPORT
>
> Both of the PCI-IDE cards can work with X86PC+FEDORA4 configure, I
> don¡¯t know
>
> What cause them fail on Yosemite with final 2.6.14 kernel.
>
> About my 2.6.14 tree, I type with ¡°cg-log ¨Cs¡± command it shows:
>
> 99a21389c2b0e55f30b6cf6550cb492b87dbaa3b Heiko Schocher 2005-11-11
> 12:47 [PATCH] ppc32: fix Kernel Panic for PM82x Board with gcc-4.0.
>
> ff1df84b3c3154ffdb646941e1c70d17554e3042 Wolfgang Denk 2005-11-10
> 00:41 Merge with /home/wd/git/linux-2.6/stefan_roese
>
> It only shows 2.6.14 on the kernel message, I don¡¯t know why it
> doesn¡¯t show the message as you told.
>
> But it can work, and fixed the bugs on Yosemite.
>
> Cordially,
>
> Kylong Mu
>
>------------------------------------------------------------------------
>
>U-Boot 1.1.4 (Nov 11 2005 - 19:35:30)
>
>AMCC PowerPC 440EP Rev. B
>Board: Yosemite - AMCC PPC440EP Evaluation Board
> VCO: 1066 MHz
> CPU: 533 MHz
> PLB: 133 MHz
> OPB: 66 MHz
> EPB: 66 MHz
> PCI: 66 MHz
>I2C: ready
>DRAM: 256 MB
>FLASH: 64 MB
>PCI: Bus Dev VenId DevId Class Int
> 00 0c 1191 0009 0180 00
>In: serial
>Out: serial
>Err: serial
>Net: ppc_4xx_eth0, ppc_4xx_eth1
>
>Type "run flash_nfs" to mount root filesystem over NFS
>
>Hit any key to stop autoboot: 0
>=> tftp 400000 uImage
>ENET Speed is 100 Mbps - FULL duplex connection
>Using ppc_4xx_eth0 device
>TFTP from server 192.168.0.93; our IP address is 192.168.0.66
>Filename 'uImage'.
>Load address: 0x400000
>Loading: #################################################################
> #################################################################
> #################################################################
> ###########################################
>done
>Bytes transferred = 1217393 (129371 hex)
>=> bootram
>Unknown command 'bootram' - try 'help'
>=> run bootram
>## Booting image at 00400000 ...
> Image Name: Linux-2.6.14
> Image Type: PowerPC Linux Kernel Image (gzip compressed)
> Data Size: 1217329 Bytes = 1.2 MB
> Load Address: 00000000
> Entry Point: 00000000
> Verifying Checksum ... OK
> Uncompressing Kernel Image ... OK
>## Loading RAMDisk Image at fed40000 ...
> Image Name: Yosemite Ramdisk
> Image Type: PowerPC Linux RAMDisk Image (gzip compressed)
> Data Size: 17770706 Bytes = 16.9 MB
> Load Address: 00000000
> Entry Point: 00000000
> Verifying Checksum ... OK
> Loading Ramdisk to 0ee47000, end 0ff398d2 ... OK
>Linux version 2.6.14 (root@dxp) (gcc version 4.0.0) #7 Sun Nov 13 21:59:01 CST 2005
>AMCC PowerPC 440EP Yosemite Platform
>Built 1 zonelists
>Kernel command line: ramdisk_size=49152 root=/dev/ram rw
ip=192.168.0.66:192.168.0.93::255.255.255.0:yosemite:eth0:off panic=1
console=ttyS0,115200
>PID hash table entries: 2048 (order: 11, 32768 bytes)
>Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
>Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
>Memory: 239616k available (1860k kernel code, 596k data, 140k init, 0k highmem)
>Mount-cache hash table entries: 512
>checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
>softlockup thread 0 started up.
>Freeing initrd memory: 17354k freed
>NET: Registered protocol family 16
>PCI: Probing PCI hardware
>usbcore: registered new driver usbfs
>usbcore: registered new driver hub
>SCSI subsystem initialized
>io scheduler noop registered
>io scheduler anticipatory registered
>io scheduler deadline registered
>io scheduler cfq registered
>usbmon: debugfs is not available
>ppc-soc-ohci ppc-soc-ohci.0: USB Host Controller
>ppc-soc-ohci ppc-soc-ohci.0: new USB bus registered, assigned bus number 1
>ppc-soc-ohci ppc-soc-ohci.0: irq 40, io mem 0xef601000
>usb usb1: Product: USB Host Controller
>usb usb1: Manufacturer: Linux 2.6.14 ohci_hcd
>usb usb1: SerialNumber: PPC-SOC USB
>hub 1-0:1.0: USB hub found
>hub 1-0:1.0: 2 ports detected
>Initializing USB Mass Storage driver...
>usbcore: registered new driver usb-storage
>USB Mass Storage support registered.
>pegasus: v0.6.12 (2005/01/13), Pegasus/Pegasus II USB Ethernet driver
>usbcore: registered new driver pegasus
>Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
>serial8250: ttyS0 at MMIO 0x0 (irq = 0) is a 16550A
>serial8250: ttyS1 at MMIO 0x0 (irq = 1) is a 16550A
>RAMDISK driver initialized: 16 RAM disks of 49152K size 1024 blocksize
>PPC 4xx OCP EMAC driver, version 3.53
>mal0: initialized, 4 TX channels, 2 RX channels
>zmii0: bridge in RMII mode
>eth0: emac0, MAC 00:10:ec:00:87:40
>eth0: found Generic MII PHY (0x01)
>eth1: emac1, MAC 00:10:ec:00:87:47
>eth1: found Generic MII PHY (0x03)
>Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
>ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
>Data machine check in kernel mode.
>PLB0: BEAR=0x0000000000000000 ACR= 0x00000000 BESR= 0xfffff7ff
>POB0: BEAR=0xc27e3194ffffffff BESR0=0x00000000 BESR1=0x00000000
>OPB0: BEAR=0x0000000000000151 BSTAT=0x00000000
>Oops: machine check, sig: 7 [#1]
>NIP: 00000000 LR: C0263628 SP: CFF41F40 REGS: c0271f50 TRAP: 0202 Not tainted
>MSR: 00000000 EE: 0 PR: 0 FP: 0 ME: 0 IR/DR: 00
>TASK = c04f8b10[1] 'swapper' THREAD: cff40000
>Last syscall: 120
>GPR00: FDFFEF02 CFF41F40 C04F8B10 C04FC000 C026C6B4 C04FC000 00000009 CFF41EF4
>GPR08: C04F9F70 00000000 00004000 C0270000 24254322 61000408 0FFB6800 00000001
>GPR16: 00800000 0FFCEAD4 FFFFFFFF 00000000 007FFF00 0FFB1210 00000003 00000002
>GPR24: C01D0000 C01D0000 C0270000 C01D0000 C0270000 C0223E10 C026C6B4 C04FC000
>NIP [00000000] 0x0
>LR [c0263628] aec62xx_init_one+0x38/0x48
>Call trace:
> [c0263628] aec62xx_init_one+0x38/0x48
> [c02649b8] ide_scan_pcidev+0x68/0xb0
> [c0264a34] ide_scan_pcibus+0x34/0xe8
> [c026492c] ide_init+0x68/0x8c
> [c00013ac] init+0xb4/0x254
> [c00046c0] kernel_thread+0x48/0x64
>Data machine check in kernel mode.
>PLB0: BEAR=0x0000000000000000 ACR= 0x00000000 BESR= 0xfffff7ff
>POB0: BEAR=0xc27e3194ffffffff BESR0=0x00000000 BESR1=0x00000000
>OPB0: BEAR=0x0000000000000151 BSTAT=0x00000000
>Oops: machine check, sig: 7 [#2]
>NIP: 00000000 LR: C000235C SP: C0271E70 REGS: c0271f50 TRAP: 0202 Not tainted
>MSR: 00000000 EE: 0 PR: 0 FP: 0 ME: 0 IR/DR: 00
>TASK = c04f8b10[1] 'swapper' THREAD: cff40000
>Last syscall: 120
>GPR00: 08000000 C0271E70 C04F8B10 C0271E80 00001568 FFFFFFFF C0270000 00004000
>GPR08: C0270000 C000235C 00021002 C00039E8 C04F8CD8 61000408 0FFB6800 00000001
>GPR16: 00800000 0FFCEAD4 FFFFFFFF 00000000 007FFF00 0FFB1210 00000003 00000002
>GPR24: C01D0000 C01D0000 C0270000 C01D0000 C0270000 C0223E10 00000007 C0271F50
>NIP [00000000] 0x0
>LR [c000235c] ret_from_except+0x0/0x18
>Kernel panic - not syncing: Attempted to kill init!
> <0>Rebooting in 1 seconds..
>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Linuxppc-embedded mailing list
>Linuxppc-embedded@ozlabs.org
>https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
[-- Attachment #1.2: Type: text/html, Size: 10596 bytes --]
[-- Attachment #2: pci-ide-card-oops.txt --]
[-- Type: text/plain, Size: 3304 bytes --]
root@192.168.7.67:/lib/modules/2.6.13/kernel/drivers/ide/pci# insmod it821x.ko
T8212: IDE controller at PCI slot 0000:00:0c.0
IT8212: chipset revision 17
it8212: forcing bypass mode.
it821x: controller in pass through mode.
IT8212: 100% native mode on irq 25
Data machine check in kernel mode.
PLB0: BEAR=0x0000000000000000 ACR= 0x00000000 BESR= 0xfffbffbf
POB0: BEAR=0xc27e3194fffbffff BESR0=0x00000000 BESR1=0x00000000
OPB0: BEAR=0x0000000000000151 BSTAT=0x00000000
Oops: machine check, sig: 7 [#1]
NIP: 00000000 LR: C0133138 SP: CF49DD50 REGS: c02c8f50 TRAP: 0202 Not tainted
MSR: 00000000 EE: 0 PR: 0 FP: 0 ME: 0 IR/DR: 00
TASK = c0295b90[184] 'insmod' THREAD: cf49c000
Last syscall: 128
GPR00: FDFFEFD2 CF49DD50 C0295B90 00000000 00000060 FDFEE004 00000002 CF49DD38
GPR08: 00000000 C02C0000 00000008 FDFEE004 00000000 10019538 C02D5B38 C02D5B38
GPR16: C02D5B38 00000019 00000000 C02D5B38 C02D5B38 C0565000 CF49DDE8 C0565000
GPR24: D102F8D2 C0565000 00000000 0000FFD0 D102F8B0 40000000 C02D5B38 C02D5B38
NIP [00000000] 0x0
LR [c0133138] ide_pci_setup_ports+0x61c/0x718
Call trace:
[c0133450] do_ide_setup_pci_device+0x21c/0x46c
[c01336c0] ide_setup_pci_device+0x20/0x9c
[d102f574] it821x_init_one+0x24/0x38 [it821x]
[c00f1af4] pci_device_probe+0x80/0xa0
[c010a880] driver_probe_device+0x50/0xf4
[c010aa88] __driver_attach+0x84/0xc4
[c0109e14] bus_for_each_dev+0x54/0x98
[c010aaec] driver_attach+0x24/0x34
[c010a388] bus_add_driver+0x88/0x158
[c010b004] driver_register+0x38/0x4c
[c00f18f4] pci_register_driver+0x7c/0x8c
[c0133864] ide_pci_register_driver+0x54/0x6c
[d102f5dc] it821x_ide_init+0x54/0x328 [it821x]
[c003514c] sys_init_module+0x230/0x33c
[c0001c74] ret_from_syscall+0x0/0x48
Data machine check in kernel mode.
PLB0: BEAR=0x0000000000000000 ACR= 0x00000000 BESR= 0xfffbffbf
POB0: BEAR=0xc27e3194fffbffff BESR0=0x00000000 BESR1=0x00000000
OPB0: BEAR=0x0000000000000151 BSTAT=0x00000000
Oops: machine check, sig: 7 [#2]
NIP: 00000000 LR: C000237C SP: C02C8E70 REGS: c02c8f50 TRAP: 0202 Not tainted
MSR: 00000000 EE: 0 PR: 0 FP: 0 ME: 0 IR/DR: 00
TASK = c0295b90[184] 'insmod' THREAD: cf49c000
Last syscall: 128
GPR00: 08000000 C02C8E70 C0295B90 C02C8E80 00001E34 FFFFFFFF C0230000 C0237244
GPR08: C0230000 C000237C 00021002 C0003774 C0295D58 10019538 C02D5B38 C02D5B38
GPR16: C02D5B38 00000019 00000000 C02D5B38 C02D5B38 C0565000 CF49DDE8 C0565000
GPR24: D102F8D2 C0565000 00000000 0000FFD0 D102F8B0 40000000 C02C8F50 00000007
NIP [00000000] 0x0
LR [c000237c] ret_from_except+0x0/0x18
Data machine check in kernel mode.
PLB0: BEAR=0x0000000000000000 ACR= 0x00000000 BESR= 0xfffbffbf
POB0: BEAR=0xc27e3194fffbffff BESR0=0x00000000 BESR1=0x00000000
OPB0: BEAR=0x0000000000000151 BSTAT=0x00000000
Oops: machine check, sig: 7 [#3]
NIP: 00000000 LR: C0004834 SP: CFA0DE30 REGS: c02c8f50 TRAP: 0202 Not tainted
MSR: 00000000 EE: 0 PR: 0 FP: 0 ME: 0 IR/DR: 00
TASK = c02957f0[144] 'klogd' THREAD: cfa0c000
Last syscall: 3
GPR00: 220024E4 CFA0DE30 C02957F0 C0295B90 C0004834 C02C9200 C02C28C0 00000000
GPR08: 165A2272 C02C0000 22044284 00000000 0000270B 1001D13C 7FEAB844 65786563
GPR16: 10000000 7FEAB880 10010000 10000000 10010000 C02D0000 C02D0000 C029591C
GPR24: 00000F5F C02CB500 C02CB500 C02C28C0 F8F6DF16 C0295450 C02957F0 00021000
NIP [00000000] 0x0
LR [c000483
^ permalink raw reply
* USB problem in linux 2.4.20
From: ductusrhe @ 2006-09-13 6:42 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]
Hi,
We have a problem with the usb-lowlevel and/or usb-storage components.
OS Montavista Preview Linux 2.4.20
Processor PPC440EP
We use an USB disc-on-chip quite heavily to store data from many threads (about 17).
The problem is that sometimes all threads/apps that use the usb device hangs (forever) waiting for disc access, and the CPU load goes down to 0.
We have located the hanging to wait_for_completion() in command_abort() in scsiglue.c.
Since this is an error handling function, it might either be a bug in it, or that which caused the error to happen is the problem. The hanging happens every time the command_abort() is run.
Perhaps it's the scsi timeout of 30 sec, since so many threads are running...?
I wonder if someone have encountered this problem, solved it, found patches, or if someone knows of fixes that are currently in the 2.6 kernel for this processor that solves the problem.
Some files involved:
drivers/usb/usb-ocp-ohci.c
drivers/usb/usb.c
drivers/usb/storage/scsiglue.c
drivers/usb/storage/scsi_error.c
/Ronnie Hedlund
[-- Attachment #2: Type: text/html, Size: 1864 bytes --]
^ permalink raw reply
* RE: How to move from /ppc/ to /powerpc/
From: Claus Gindhart @ 2006-09-13 6:58 UTC (permalink / raw)
To: Fredrik Roubert, linuxppc-embedded
Hi Fredrik,
i am running a Kontron board (which has the same SoC as the MPC834x_SYS =
onboard) with the Freescale version of the 2.6.17-Kernel, and its =
working well.
Together with my update from 2.6.13 i migrated from arch/ppc to =
arch/powerpc.
The most important modification is (besides changing the ARCH env from =
ppc to powerpc), that your U-Boot has to provide the flattened device =
tree.
Please read Documentation/powerpc/booting-without-of.txt
within the kernel source tree.
So, its mainly an issue for the Bootloader, because many of the board =
dependent definitions is now migrated to the flattened device tree.
The U-Boot, which comes with the Freescale LTIB, supports flattened =
device tree, so the first step is updating U-Boot. Then, the kernel will =
work, if you compile it with ARCH=3Dpowerpc setting.
--=20
Mit freundlichen Gruessen / Best regards
Claus Gindhart
SW R&D
Kontron Modular Computers
phone :++49 (0)8341-803-374
mailto:claus.gindhart@kontron-modular.com
http://www.kontron.com
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GU d- s++:>++:+ a+ C++$ !U !P L++>$ E-- W+(-) N- o?
K? w !O !M V !PS PE- Y+ PGP+ t 5? X R* tv- b+ DI+++
D-- G e++> h--- !r x+++
------END GEEK CODE BLOCK------
=20
-----Original Message-----
From: linuxppc-embedded-bounces+claus.gindhart=3Dkontron.com@ozlabs.org
[mailto:linuxppc-embedded-bounces+claus.gindhart=3Dkontron.com@ozlabs.org=
]
On Behalf Of Fredrik Roubert
Sent: Dienstag, 12. September 2006 17:33
To: linuxppc-embedded@ozlabs.org
Subject: How to move from /ppc/ to /powerpc/
Hi!
I have a custom board on which I currently run Linux 2.6.18-rc6
configured for MPC834x_SYS in the /ppc/ tree, which just a few minor
changes. Now I'm interested to move to using the /powerpc/ source tree
instead, but I can't figure out exactly what steps are necessary to do
this.
Does anyone run a MPC834x_SYS built with ARCH=3Dpowerpc?
I boot the board with U-Boot (version 1.1.4, customized), and I assume
that I need to add some stuff for this new device tree thing, but I
can't figure out exactly what the kernel will expect.
Does anyone have some pointers on how to do this?
Cheers // Fredrik Roubert
--=20
Visserij 192 | +32 473 344527 / +46 708 776974
BE-9000 Gent | http://www.df.lth.se/~roubert/
^ permalink raw reply
* Re: [PATCH] Unwire set/get_robust_list
From: Andreas Schwab @ 2006-09-13 8:56 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, David Woodhouse
In-Reply-To: <17671.15625.76850.349526@cargo.ozlabs.ibm.com>
Paul Mackerras <paulus@samba.org> writes:
> Andreas Schwab writes:
>
>> Thanks, sucessfully tested on 32bit (with the nptl testsuite of glibc).
>> Will do some 64bit testing tomorrow.
>
> Did you do that testing? What was the result?
Yes, I did, successful.
> Could you test David's latest patch without the memory clobber?
I'll do.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* JTAG Flash programmer for MPC8248
From: Laurent Pinchart @ 2006-09-13 9:38 UTC (permalink / raw)
To: linuxppc-embedded
Hi everybody,
I'm looking for a solution to program flash memory on a MPC8248 board for
production.
I remember hearing about a JTAG flash programmer that used boundary scan to
control the flash signals, but can't find any reference to it anymore.
I know the BDI2000 is able to program the target flash memory, but I'm looking
for a less expensive solution (I don't need debugging capabilities, just a
plain flash programmer).
Any help will be appreciated.
Laurent Pinchart
^ permalink raw reply
* RE: JTAG Flash programmer for MPC8248
From: Liu Dave-r63238 @ 2006-09-13 9:43 UTC (permalink / raw)
To: Laurent Pinchart, linuxppc-embedded
In-Reply-To: <200609131138.45308.laurent.pinchart@tbox.biz>
> Hi everybody,
>=20
> I'm looking for a solution to program flash memory on a=20
> MPC8248 board for production.
>=20
> I remember hearing about a JTAG flash programmer that used=20
> boundary scan to control the flash signals, but can't find=20
> any reference to it anymore.
Look this
http://www.intellitech.com/products/eclipseboundaryscanflash.asp
See if this is what you need.
I think this tool is not cheaper than BDI2000. and need 8248 BSDL.
> I know the BDI2000 is able to program the target flash=20
> memory, but I'm looking for a less expensive solution (I=20
> don't need debugging capabilities, just a plain flash programmer).
>=20
> Any help will be appreciated.
>=20
> Laurent Pinchart
^ permalink raw reply
* [PATCH] Fix MMIO ops to provide expected barrier behaviour
From: Paul Mackerras @ 2006-09-13 9:51 UTC (permalink / raw)
To: linuxppc-dev
This changes the writeX family of functions to have a sync instruction
before the MMIO store rather than after, because the generally expected
behaviour is that the device receiving the MMIO store can be guaranteed
to see the effects of any preceding writes to normal memory.
To preserve ordering between writeX and readX, the readX family of
functions have had an eieio added before the load.
Although writeX followed by spin_unlock is not officially guaranteed
to keep the writeX inside the spin-locked region unless an mmiowb()
is used, there are currently drivers that depend on the previous
behaviour on powerpc, which was that the mmiowb wasn't actually required.
Therefore we have a per-cpu flag that is set by writeX, cleared by
__raw_spin_lock and mmiowb, and tested by __raw_spin_unlock. If it is
set, __raw_spin_unlock does a sync and clears it.
Tested on G5 (PPC970) and POWER5.
Signed-off-by: Paul Mackerras <paulus@samba.org>
---
diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S
index fc23040..6e95578 100644
--- a/arch/powerpc/kernel/misc.S
+++ b/arch/powerpc/kernel/misc.S
@@ -74,11 +74,12 @@ _GLOBAL(_insb)
mtctr r5
subi r4,r4,1
blelr-
-00: lbz r5,0(r3)
- eieio
+00: eieio
+ lbz r5,0(r3)
stbu r5,1(r4)
bdnz 00b
- IN_SYNC
+ twi 0,r5,0
+ isync
blr
_GLOBAL(_outsb)
@@ -86,11 +87,10 @@ _GLOBAL(_outsb)
mtctr r5
subi r4,r4,1
blelr-
+ sync
00: lbzu r5,1(r4)
stb r5,0(r3)
- EIEIO_32
bdnz 00b
- SYNC_64
blr
_GLOBAL(_insw)
@@ -98,11 +98,12 @@ _GLOBAL(_insw)
mtctr r5
subi r4,r4,2
blelr-
-00: lhbrx r5,0,r3
- eieio
+00: eieio
+ lhbrx r5,0,r3
sthu r5,2(r4)
bdnz 00b
- IN_SYNC
+ twi 0,r5,0
+ isync
blr
_GLOBAL(_outsw)
@@ -110,11 +111,10 @@ _GLOBAL(_outsw)
mtctr r5
subi r4,r4,2
blelr-
+ sync
00: lhzu r5,2(r4)
- EIEIO_32
sthbrx r5,0,r3
bdnz 00b
- SYNC_64
blr
_GLOBAL(_insl)
@@ -122,11 +122,12 @@ _GLOBAL(_insl)
mtctr r5
subi r4,r4,4
blelr-
-00: lwbrx r5,0,r3
- eieio
+00: eieio
+ lwbrx r5,0,r3
stwu r5,4(r4)
bdnz 00b
- IN_SYNC
+ twi 0,r5,0
+ isync
blr
_GLOBAL(_outsl)
@@ -134,11 +135,10 @@ _GLOBAL(_outsl)
mtctr r5
subi r4,r4,4
blelr-
+ sync
00: lwzu r5,4(r4)
stwbrx r5,0,r3
- EIEIO_32
bdnz 00b
- SYNC_64
blr
#ifdef CONFIG_PPC32
@@ -149,11 +149,12 @@ _GLOBAL(_insw_ns)
mtctr r5
subi r4,r4,2
blelr-
-00: lhz r5,0(r3)
- eieio
+00: eieio
+ lhz r5,0(r3)
sthu r5,2(r4)
bdnz 00b
- IN_SYNC
+ twi 0,r5,0
+ isync
blr
#ifdef CONFIG_PPC32
@@ -164,11 +165,10 @@ _GLOBAL(_outsw_ns)
mtctr r5
subi r4,r4,2
blelr-
+ sync
00: lhzu r5,2(r4)
sth r5,0(r3)
- EIEIO_32
bdnz 00b
- SYNC_64
blr
#ifdef CONFIG_PPC32
@@ -179,11 +179,12 @@ _GLOBAL(_insl_ns)
mtctr r5
subi r4,r4,4
blelr-
-00: lwz r5,0(r3)
- eieio
+00: eieio
+ lwz r5,0(r3)
stwu r5,4(r4)
bdnz 00b
- IN_SYNC
+ twi 0,r5,0
+ isync
blr
#ifdef CONFIG_PPC32
@@ -194,10 +195,9 @@ _GLOBAL(_outsl_ns)
mtctr r5
subi r4,r4,4
blelr-
+ sync
00: lwzu r5,4(r4)
stw r5,0(r3)
- EIEIO_32
bdnz 00b
- SYNC_64
blr
diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h
index 4df3e80..c8f0a94 100644
--- a/include/asm-powerpc/eeh.h
+++ b/include/asm-powerpc/eeh.h
@@ -229,6 +229,7 @@ static inline void eeh_memcpy_fromio(voi
void *destsave = dest;
unsigned long nsave = n;
+ __asm__ __volatile__ ("eieio" : : : "memory");
while(n && (!EEH_CHECK_ALIGN(vsrc, 4) || !EEH_CHECK_ALIGN(dest, 4))) {
*((u8 *)dest) = *((volatile u8 *)vsrc);
__asm__ __volatile__ ("eieio" : : : "memory");
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 36c4c34..e97934a 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -19,6 +19,7 @@ #else
#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
@@ -162,7 +163,11 @@ extern void _outsw_ns(volatile u16 __iom
extern void _insl_ns(volatile u32 __iomem *port, void *buf, int nl);
extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl);
-#define mmiowb()
+static inline void mmiowb(void)
+{
+ __asm__ __volatile__ ("sync" : : : "memory");
+ get_paca()->io_sync = 0;
+}
/*
* output pause versions need a delay at least for the
@@ -278,22 +283,23 @@ static inline int in_8(const volatile un
{
int ret;
- __asm__ __volatile__("lbz%U1%X1 %0,%1; twi 0,%0,0; isync"
+ __asm__ __volatile__("eieio; lbz%U1%X1 %0,%1; twi 0,%0,0; isync"
: "=r" (ret) : "m" (*addr));
return ret;
}
static inline void out_8(volatile unsigned char __iomem *addr, int val)
{
- __asm__ __volatile__("stb%U0%X0 %1,%0; sync"
+ __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)
{
int ret;
- __asm__ __volatile__("lhbrx %0,0,%1; twi 0,%0,0; isync"
+ __asm__ __volatile__("eieio; lhbrx %0,0,%1; twi 0,%0,0; isync"
: "=r" (ret) : "r" (addr), "m" (*addr));
return ret;
}
@@ -302,28 +308,30 @@ static inline int in_be16(const volatile
{
int ret;
- __asm__ __volatile__("lhz%U1%X1 %0,%1; twi 0,%0,0; isync"
+ __asm__ __volatile__("eieio; lhz%U1%X1 %0,%1; twi 0,%0,0; isync"
: "=r" (ret) : "m" (*addr));
return ret;
}
static inline void out_le16(volatile unsigned short __iomem *addr, int val)
{
- __asm__ __volatile__("sthbrx %1,0,%2; sync"
+ __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)
{
- __asm__ __volatile__("sth%U0%X0 %1,%0; sync"
+ __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)
{
unsigned ret;
- __asm__ __volatile__("lwbrx %0,0,%1; twi 0,%0,0; isync"
+ __asm__ __volatile__("eieio; lwbrx %0,0,%1; twi 0,%0,0; isync"
: "=r" (ret) : "r" (addr), "m" (*addr));
return ret;
}
@@ -332,21 +340,23 @@ static inline unsigned in_be32(const vol
{
unsigned ret;
- __asm__ __volatile__("lwz%U1%X1 %0,%1; twi 0,%0,0; isync"
+ __asm__ __volatile__("eieio; lwz%U1%X1 %0,%1; twi 0,%0,0; isync"
: "=r" (ret) : "m" (*addr));
return ret;
}
static inline void out_le32(volatile unsigned __iomem *addr, int val)
{
- __asm__ __volatile__("stwbrx %1,0,%2; sync" : "=m" (*addr)
+ __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)
{
- __asm__ __volatile__("stw%U0%X0 %1,%0; sync"
+ __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)
@@ -354,6 +364,7 @@ static inline unsigned long in_le64(cons
unsigned long tmp, ret;
__asm__ __volatile__(
+ "eieio\n"
"ld %1,0(%2)\n"
"twi 0,%1,0\n"
"isync\n"
@@ -372,7 +383,7 @@ static inline unsigned long in_be64(cons
{
unsigned long ret;
- __asm__ __volatile__("ld%U1%X1 %0,%1; twi 0,%0,0; isync"
+ __asm__ __volatile__("eieio; ld%U1%X1 %0,%1; twi 0,%0,0; isync"
: "=r" (ret) : "m" (*addr));
return ret;
}
@@ -389,14 +400,16 @@ static inline void out_le64(volatile uns
"rldicl %1,%1,32,0\n"
"rlwimi %0,%1,8,8,31\n"
"rlwimi %0,%1,24,16,23\n"
- "std %0,0(%3)\n"
- "sync"
+ "sync\n"
+ "std %0,0(%3)"
: "=&r" (tmp) , "=&r" (val) : "1" (val) , "b" (addr) , "m" (*addr));
+ get_paca()->io_sync = 1;
}
static inline void out_be64(volatile unsigned long __iomem *addr, unsigned long val)
{
- __asm__ __volatile__("std%U0%X0 %1,%0; sync" : "=m" (*addr) : "r" (val));
+ __asm__ __volatile__("sync; std%U0%X0 %1,%0" : "=m" (*addr) : "r" (val));
+ get_paca()->io_sync = 1;
}
#ifndef CONFIG_PPC_ISERIES
diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h
index 2d4585f..3d5d590 100644
--- a/include/asm-powerpc/paca.h
+++ b/include/asm-powerpc/paca.h
@@ -93,6 +93,7 @@ #endif /* CONFIG_PPC_ISERIES */
u64 saved_r1; /* r1 save for RTAS calls */
u64 saved_msr; /* MSR saved here by enter_rtas */
u8 proc_enabled; /* irq soft-enable flag */
+ u8 io_sync; /* writel() needs spin_unlock sync */
/* Stuff for accurate time accounting */
u64 user_time; /* accumulated usermode TB ticks */
diff --git a/include/asm-powerpc/spinlock.h b/include/asm-powerpc/spinlock.h
index 895cb6d..c31e438 100644
--- a/include/asm-powerpc/spinlock.h
+++ b/include/asm-powerpc/spinlock.h
@@ -36,6 +36,19 @@ #else
#define LOCK_TOKEN 1
#endif
+#if defined(CONFIG_PPC64) && defined(CONFIG_SMP)
+#define CLEAR_IO_SYNC (get_paca()->io_sync = 0)
+#define SYNC_IO do { \
+ if (unlikely(get_paca()->io_sync)) { \
+ mb(); \
+ get_paca()->io_sync = 0; \
+ } \
+ } while (0)
+#else
+#define CLEAR_IO_SYNC
+#define SYNC_IO
+#endif
+
/*
* This returns the old value in the lock, so we succeeded
* in getting the lock if the return value is 0.
@@ -61,6 +74,7 @@ static __inline__ unsigned long __spin_t
static int __inline__ __raw_spin_trylock(raw_spinlock_t *lock)
{
+ CLEAR_IO_SYNC;
return __spin_trylock(lock) == 0;
}
@@ -91,6 +105,7 @@ #endif
static void __inline__ __raw_spin_lock(raw_spinlock_t *lock)
{
+ CLEAR_IO_SYNC;
while (1) {
if (likely(__spin_trylock(lock) == 0))
break;
@@ -107,6 +122,7 @@ static void __inline__ __raw_spin_lock_f
{
unsigned long flags_dis;
+ CLEAR_IO_SYNC;
while (1) {
if (likely(__spin_trylock(lock) == 0))
break;
@@ -124,6 +140,7 @@ static void __inline__ __raw_spin_lock_f
static __inline__ void __raw_spin_unlock(raw_spinlock_t *lock)
{
+ SYNC_IO;
__asm__ __volatile__("# __raw_spin_unlock\n\t"
LWSYNC_ON_SMP: : :"memory");
lock->slock = 0;
^ permalink raw reply related
* Re: [PATCH] Fix MMIO ops to provide expected barrier behaviour
From: Segher Boessenkool @ 2006-09-13 10:41 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17671.54461.77700.184852@cargo.ozlabs.ibm.com>
> This changes the writeX family of functions to have a sync instruction
> before the MMIO store rather than after, because the generally
> expected
> behaviour is that the device receiving the MMIO store can be
> guaranteed
> to see the effects of any preceding writes to normal memory.
Yay, progress!
> To preserve ordering between writeX and readX, the readX family of
> functions have had an eieio added before the load.
readX() is supposed to be ordered to memory as well; the only
example I can think of where the difference would would show is
a readX() setting off a DMA; maybe such devices do not exist
anyway, but if you care, the eieio should be a full sync.
> Although writeX followed by spin_unlock is not officially guaranteed
> to keep the writeX inside the spin-locked region unless an mmiowb()
> is used, there are currently drivers that depend on the previous
> behaviour on powerpc, which was that the mmiowb wasn't actually
> required.
> Therefore we have a per-cpu flag that is set by writeX, cleared by
> __raw_spin_lock and mmiowb, and tested by __raw_spin_unlock. If it is
> set, __raw_spin_unlock does a sync and clears it.
Why is this done on 64-bit systems only?
Segher
^ permalink raw reply
* IDE DMA Issue ppc
From: Akhilesh @ 2006-09-13 11:11 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1.1: Type: text/plain, Size: 610 bytes --]
Hi All,
I'm using IBM redwood6 stb025xx(ppc405gp) platform with 2.6.14 kernel. I'm trying to get DMA working for IDE interface (PIO is working). The problem I'm facing is that my DMA is completing and I'm getting a error in DMA status register that "A DMA request from an external device is pending"
I'm attaching the console message along with the sample code of the driver. Please help me to resolve this issue. What I feel is that DMA is completing and IDE is not getting anything. ( IDE status register is giving 0x58).
Any pointers to same will be highly appreciated.
Regards,
Akhilesh
[-- Attachment #1.2: Type: text/html, Size: 1495 bytes --]
[-- Attachment #2: console.txt --]
[-- Type: text/plain, Size: 15322 bytes --]
IBM Set-Top-Box BIOS 1.50 (Feb-16-2004)
Platform support <Redwood6/STBx25xx 1.03 (Jun/24/2002)>
Initializing devices, please wait.....
------- System Info --------
Processor speed = 252 MHz
EBIU speed = 63 MHz
Amount of RAM = 64 MBytes
DM9000 : dmfe_probe() : Checking DM9000 chip
DM9000 : Chip Found ID : 90000a46
--- Device Configuration ---
Power-On Test Devices:
000 Disabled System Memory [RAM]
----------------------------
Boot Sources:
001 Disabled Application in Flash [FLASH]
002 Enabled Ethernet [ENET]
local=192.168.18.28 remote=192.168.18.101 hwaddr=bad0add00000
003 Disabled Serial Port 1 [S1]
Baud = 9600
----------------------------
Update Flash : Disabled
Automatic Boot: Disabled
----------------------------
1 - Toggle Power-On Tests
2 - Change a Boot Device
3 - Change IP Addresses
4 - Ping test
5 - Change Baud Rate for S1 Boot
6 - Toggle Update Flash
7 - Toggle Automatic Boot
B - Bootlogo Management
D - Display Configuration
S - Save Changes
Z - Set Ethernet HW Address
0 - Exit Menu and Boot Application
C - Enable CHOIS Debug
->0
DM900 : dmfe_init_dm9000 : initialising dm9000
Booting from [ENET] Ethernet...
Sending bootp request ...
bootp packets sent = 1
DM900 : dmfe_send : hold frame collision, outbound frame.
Got bootp response from : 192.168.18.101
My ip address is : 192.168.18.28
Loading file "zImage.treeboot" by TFTP for net boot ...
block 268
block 1440
Transfer completed, 897568 bytes received
Loaded successfully ...
Entry point at 0x500000 ...
loaded at: 00500000 005DC164
relocated to: 00400000 004DC164
board data at: 004DA124 004DA164
relocated to: 0040515C 0040519C
zimage at: 0040591D 004D9A6C
avail ram: 004DD000 02000000
Linux/PPC load: ip=on
Uncompressing Linux...done.
Now booting the kernel
Linux version 2.6.14 (root@localhost.localdomain) (gcc version 4.0.0 (DENX ELDK 4.0 4.0.0)) #258 Wed Sep 13 16:12:58 IST 2006
ocp: ocp_early_init()...
ocp: ocp_add_one_device()...
ocp: ocp_add_one_device()...done
ocp: ocp_add_one_device()...
ocp: ocp_add_one_device()...done
ocp: ocp_add_one_device()...
ocp: ocp_add_one_device()...done
ocp: ocp_add_one_device()...
ocp: ocp_add_one_device()...done
ocp: ocp_add_one_device()...
ocp: ocp_add_one_device()...done
ocp: ocp_add_one_device()...
ocp: ocp_add_one_device()...done
ocp: ocp_early_init()... done.
IBM Redwood6 (STBx25XX) Platform
Port by MontaVista Software, Inc. (source@mvista.com)
Built 1 zonelists
Kernel command line: ip=on
PID hash table entries: 256 (order: 8, 4096 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 30488k available (1452k kernel code, 344k data, 96k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
ocp: ocp_driver_init()...
ocp: ocp_driver_init()... done.
Adding platform devices
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
ttyS0 at MMIO 0x0 (irq = 22) is a 16550A
ttyS1 at MMIO 0x0 (irq = 20) is a 16550A
ttyS2 at MMIO 0x0 (irq = 21) is a 16550A
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
dm9000 Ethernet Driver
dm9000_set_io : byte_width 2
eth0: dm9000 at c3000000,c3000004 IRQ 26 MAC: ba:d0:ad:d0:00:00
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
TCP bic registered
NET: Registered protocol family 1
inside stb04xxx_ide_init
IBM STB025xx OCP IDE driver version 1.0 f2100000
ide_redwood: waiting for drive ready......Drive spun up
ocp_ide_setup_dma
probing for hda: present=0, media=32, probetype=ATA
hda: probing with STATUS(0x51) instead of ALTSTATUS(0x00)
hda: WDC WD400EB-00CPF0, ATA DISK drive
probing for hdb: present=0, media=32, probetype=ATA
probing for hdb: present=0, media=32, probetype=ATAPI
hdb: probing with STATUS(0x01) instead of ALTSTATUS(0x00)
ocp_ide_tune_drive pio 4
got ocp_ide_dma_off_quietly
got ocp_ide_dma_check
redwood_config_drive_for_dma 22
ocp_ide_tune_drive pio 4
got ocp_ide_dma_on
ide0 at 0xc3004000-0xc3004007,0xc3006000 on irq 27
hda: max request size: 128KiB
ide_execute_command : 0x91
ide_execute_command : 0x10
ide_execute_command : 0xf8
hda: 78165360 sectors (40020 MB) w/2048KiB Cache, CHS=65535/16/63, (U)DMA
hda: cache flushes not supported
hda:__ide_do_rw_disk : dma 1 lba48 0 LBA=0
got ocp_ide_dma_setup
ide_execute_command : 0xc8
got ocp_ide_dma_begin 0x1000
DMA addr c0340000 340000 count 8 dmastat 0
got ocp_ide_dma_test_irq
got ocp_ide_dma_end 0 20000000
ide_dma_intr : stat 50
DMA complete stat 0 500000
hda1
IDE probe finished
eth0: link up, 100Mbps, full-duplex, lpa 0x41E1
Sending BOOTP and RARP requests . OK
IP-Config: Got BOOTP answer from 192.168.18.101, my address is 192.168.18.28
IP-Config: Complete:
device=eth0, addr=192.168.18.28, mask=255.255.255.0, gw=192.168.18.1,
host=192.168.18.28, domain=, nis-domain=(none),
bootserver=192.168.18.101, rootserver=192.168.18.101, rootpath=/opt/eldk/ppc_4xx
Looking up port of RPC 100003/2 on 192.168.18.101
Looking up port of RPC 100005/1 on 192.168.18.101
VFS: Mounted root (nfs filesystem) readonly.
Freeing unused kernel memory: 96k init
modprobe: FATAL: Could not load /lib/modules/2.6.14/modules.dep: No such file or directory
modprobe: FATAL: Could not load /lib/modules/2.6.14/modules.dep: No such file or directory
INIT: version 2.85 booting
Came here in rc.sysinit creating var\n
mounting
ln: `/proc/mounts': File exists
Welcome to DENX Embedded Linux Environment
Press 'I' to enter interactive startup.
Building the cache [ OK ]
storage network audio done[ OK ]
modprobe: FATAL: Could not load /lib/modules/2.6.14/modules.dep: No such file or directory
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
Setting clock : Thu Jan 1 01:00:12 MET 1970 [ OK ]
Setting hostname CHOISpad-110: [ OK ]
Mounting local filesystems: [ OK ]
Enabling swap space: [ OK ]
INIT: Entering runlevel: 3
Entering non-interactive startup
Bringing up loopback interface: modprobe: FATAL: Could not load /lib/modules/2.6.14/modules.dep: No such file or directory
arping: socket: Address family not supported by protocol
Error, some other host already uses address 127.0.0.1.
[FAILED]
Starting system logger: [ OK ]
Starting kernel logger: [ OK ]
Starting portmap: [ OK ]
Mounting NFS filesystems: [ OK ]
Mounting other filesystems: [ OK ]
Starting xinetd: [ OK ]
DENX ELDK version 4.0 build 2006-01-11
Linux 2.6.14 on a ppc
CHOISpad-110 login: root
Last login: Thu Jan 1 01:00:19 on console
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00# hdparm -t\b \b\b \b/dev/hda
/dev/hda:
multcount = 0 (off)
I/O support = 0 (default 16-bit)
unmaskirq = 1 (on)
using_dma = 1 (on)
keepsettings = 0 (off)
nowerr = 0 (off)
readonly = 0 (off)
readahead = 256 (on)
geometry = 65535/16/63, sectors = 78165360, start = 0
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00#
bash-3.00# hdparm -t /dev/hda
/dev/hda:
Timing buffered__ide_do_rw_disk : dma 1 lba48 0 LBA=0
disk reads: got ocp_ide_dma_setup
ide_execute_command : 0xc8
got ocp_ide_dma_begin 0x1000
DMA addr c1238000 1238000 count 8 dmastat 0
DMA complete stat 20001000 0
hda: lost interrupt
got ocp_ide_dma_end 0 20000000
ide_dma_intr : stat 58
hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }
ide: failed opcode was: unknown
__ide_do_rw_disk : dma 1 lba48 0 LBA=0
got ocp_ide_dma_setup
ide_execute_command : 0xc8
got ocp_ide_dma_begin 0x1000
DMA addr c1238000 1238000 count 8 dmastat 0
DMA complete stat 20001000 0
hda: lost interrupt
got ocp_ide_dma_end 0 20000000
ide_dma_intr : stat 58
hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }
ide: failed opcode was: unknown
ide_execute_command : 0x10
__ide_do_rw_disk : dma 1 lba48 0 LBA=0
got ocp_ide_dma_setup
ide_execute_command : 0xc8
got ocp_ide_dma_begin 0x1000
DMA addr c1238000 1238000 count 8 dmastat 0
DMA complete stat 20001000 0
hda: lost interrupt
got ocp_ide_dma_end 0 20000000
ide_dma_intr : stat 58
hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }
ide: failed opcode was: unknown
__ide_do_rw_disk : dma 1 lba48 0 LBA=0
got ocp_ide_dma_setup
ide_execute_command : 0xc8
got ocp_ide_dma_begin 0x1000
DMA addr c1238000 1238000 count 8 dmastat 0
DMA complete stat 20001000 0
hda: lost interrupt
got ocp_ide_dma_end 0 20000000
ide_dma_intr : stat 58
hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }
ide: failed opcode was: unknown
got ocp_ide_dma_off_quietly
ide0: reset: master: error (0x00?)
ide_execute_command : 0x91
ide_execute_command : 0x10
__ide_do_rw_disk : dma 1 lba48 0 LBA=0
got ocp_ide_dma_setup
ide_execute_command : 0xc8
got ocp_ide_dma_begin 0x1000
DMA addr c1238000 1238000 count 8 dmastat 0
DMA complete stat 20001000 0
hda: lost interrupt
got ocp_ide_dma_end 0 20000000
ide_dma_intr : stat 58
hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }
ide: failed opcode was: unknown
__ide_do_rw_disk : dma 1 lba48 0 LBA=0
got ocp_ide_dma_setup
ide_execute_command : 0xc8
got ocp_ide_dma_begin 0x1000
DMA addr c1238000 1238000 count 8 dmastat 0
DMA complete stat 20001000 0
hda: lost interrupt
got ocp_ide_dma_end 0 20000000
ide_dma_intr : stat 58
hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }
ide: failed opcode was: unknown
ide_execute_command : 0x10
__ide_do_rw_disk : dma 1 lba48 0 LBA=0
got ocp_ide_dma_setup
ide_execute_command : 0xc8
got ocp_ide_dma_begin 0x1000
DMA addr c1238000 1238000 count 8 dmastat 0
DMA complete stat 20001000 0
hda: lost interrupt
got ocp_ide_dma_end 0 20000000
ide_dma_intr : stat 58
hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }
ide: failed opcode was: unknown
__ide_do_rw_disk : dma 1 lba48 0 LBA=0
got ocp_ide_dma_setup
ide_execute_command : 0xc8
got ocp_ide_dma_begin 0x1000
DMA addr c1238000 1238000 count 8 dmastat 0
DMA complete stat 20001000 0
hda: lost interrupt
got ocp_ide_dma_end 0 20000000
ide_dma_intr : stat 58
hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }
ide: failed opcode was: unknown
got ocp_ide_dma_off_quietly
ide0: reset: master: error (0x00?)
end_request: I/O error, dev hda, sector 0
Buffer I/O error on device hda, logical block 0
end_request: I/O error, dev hda, sector 8
Buffer I/O error on device hda, logical block 1
end_request: I/O error, dev hda, sector 16
Buffer I/O error on device hda, logical block 2
end_request: I/O error, dev hda, sector 24
Buffer I/O error on device hda, logical block 3
end_request: I/O error, dev hda, sector 32
Buffer I/O error on device hda, logical block 4
end_request: I/O error, dev hda, sector 40
Buffer I/O error on device hda, logical block 5
end_request: I/O error, dev hda, sector 48
Buffer I/O error on device hda, logical block 6
end_request: I/O error, dev hda, sector 56
Buffer I/O error on device hda, logical block 7
end_request: I/O error, dev hda, sector 64
Buffer I/O error on device hda, logical block 8
end_request: I/O error, dev hda, sector 72
Buffer I/O error on device hda, logical block 9
end_request: I/O error, dev hda, sector 80
end_request: I/O error, dev hda, sector 88
end_request: I/O error, dev hda, sector 96
end_request: I/O error, dev hda, sector 104
end_request: I/O error, dev hda, sector 112
end_request: I/O error, dev hda, sector 120
end_request: I/O error, dev hda, sector 128
end_request: I/O error, dev hda, sector 136
end_request: I/O error, dev hda, sector 144
end_request: I/O error, dev hda, sector 152
end_request: I/O error, dev hda, sector 160
end_request: I/O error, dev hda, sector 168
end_request: I/O error, dev hda, sector 176
end_request: I/O error, dev hda, sector 184
end_request: I/O error, dev hda, sector 192
end_request: I/O error, dev hda, sector 200
end_request: I/O error, dev hda, sector 208
end_request: I/O error, dev hda, sector 216
end_request: I/O error, dev hda, sector 224
end_request: I/O error, dev hda, sector 232
end_request: I/O error, dev hda, sector 240
end_request: I/O error, dev hda, sector 248
end_request: I/O error, dev hda, sector 256
end_request: I/O error, dev hda, sector 264
end_request: I/O error, dev hda, sector 272
end_request: I/O error, dev hda, sector 280
end_request: I/O error, dev hda, sector 288
end_request: I/O error, dev hda, sector 296
end_request: I/O error, dev hda, sector 304
end_request: I/O error, dev hda, sector 312
end_request: I/O error, dev hda, sector 320
end_request: I/O error, dev hda, sector 328
end_request: I/O error, dev hda, sector 336
end_request: I/O error, dev hda, sector 344
end_request: I/O error, dev hda, sector 352
end_request: I/O error, dev hda, sector 360
end_request: I/O error, dev hda, sector 368
end_request: I/O error, dev hda, sector 376
end_request: I/O error, dev hda, sector 384
end_request: I/O error, dev hda, sector 392
end_request: I/O error, dev hda, sector 400
end_request: I/O error, dev hda, sector 408
end_request: I/O error, dev hda, sector 416
end_request: I/O error, dev hda, sector 424
end_request: I/O error, dev hda, sector 432
end_request: I/O error, dev hda, sector 440
end_request: I/O error, dev hda, sector 448
end_request: I/O error, dev hda, sector 456
end_request: I/O error, dev hda, sector 464
end_request: I/O error, dev hda, sector 472
end_request: I/O error, dev hda, sector 480
end_request: I/O error, dev hda, sector 488
end_request: I/O error, dev hda, sector 496
end_request: I/O error, dev hda, sector 504
end_request: I/O error, dev hda, sector 0
read() failed: Input/output error
bash-3.00#
[-- Attachment #3: ibm_ocp_ide.c --]
[-- Type: application/octet-stream, Size: 16736 bytes --]
/*
* IDE Driver Based on ocp_stbxxxx.c
*/
#include <linux/types.h>
#include <linux/hdreg.h>
#include <linux/delay.h>
#include <linux/ide.h>
#include <asm/ocp.h>
#include <asm/io.h>
#include <asm/scatterlist.h>
#include <asm/ppc4xx_dma.h>
#include "ide_modes.h"
#define IDEVR "1.0"
#define TRUE 1
#define FALSE 0
#define IN_BYTE(p) (byte)inb_p(p)
#define OUT_BYTE(b,p) outb((b),(p))
typedef unsigned int ide_ioreg_t;
static int pio_mode[2] = { -1, -1 };
ppc_dma_ch_t dma_ch;
/* use DMA channel 2 for IDE DMA operations */
#define IDE_DMACH 2 /* 2nd DMA channel */
#define IDE_DMA_INT 6 /* IDE dma channel 2 interrupt */
//#define WMODE 1 /* default to DMA line mode */
#define PIOMODE 0
static volatile unsigned long dmastat;
/* Function Prototypes */
static void ocp_ide_tune_drive(ide_drive_t *, byte);
static byte ocp_ide_dma_2_pio(byte);
static int ocp_ide_tune_chipset(ide_drive_t *, byte);
static int ocp_ide_dma_on(ide_drive_t *drive);
static void ocp_dma_exec_cmd (ide_drive_t * const drive, u8 command);
static void
ocp_ide_tune_drive(ide_drive_t * drive, byte pio)
{
pio = ide_get_best_pio_mode(drive, pio, 5, NULL);
printk("ocp_ide_tune_drive pio %d\n",pio);
}
static byte
ocp_ide_dma_2_pio(byte xfer_rate)
{
switch (xfer_rate) {
case XFER_UDMA_5:
case XFER_UDMA_4:
case XFER_UDMA_3:
case XFER_UDMA_2:
case XFER_UDMA_1:
case XFER_UDMA_0:
case XFER_MW_DMA_2:
case XFER_PIO_4:
return 4;
case XFER_MW_DMA_1:
case XFER_PIO_3:
return 3;
case XFER_SW_DMA_2:
case XFER_PIO_2:
return 2;
case XFER_MW_DMA_0:
case XFER_SW_DMA_1:
case XFER_SW_DMA_0:
case XFER_PIO_1:
case XFER_PIO_0:
case XFER_PIO_SLOW:
default:
return 0;
}
}
static int
ocp_ide_tune_chipset(ide_drive_t * drive, byte speed)
{
int err = 0;
printk("ocp_ide_tune_chipset speed %d\n",speed);
ocp_ide_tune_drive(drive, ocp_ide_dma_2_pio(speed));
if (!drive->init_speed)
drive->init_speed = speed;
err = ide_config_drive_speed(drive, speed);
drive->current_speed = speed;
printk("ocp_ide_tune_chipset speed %d\n",speed);
return err;
}
static int
redwood_config_drive_for_dma(ide_drive_t * drive)
{
struct hd_driveid *id = drive->id;
byte speed;
/*
* Enable DMA on any drive that has multiword DMA
*/
if (id->field_valid & 2) {
if (id->dma_mword & 0x0004) {
speed = XFER_MW_DMA_2;
} else if (id->dma_mword & 0x0002) {
speed = XFER_MW_DMA_1;
} else if (id->dma_mword & 1) {
speed = XFER_MW_DMA_0;
} else if (id->dma_1word & 0x0004) {
speed = XFER_SW_DMA_2;
} else {
speed = XFER_PIO_0 +
ide_get_best_pio_mode(drive, 255, 5, NULL);
}
}
printk("redwood_config_drive_for_dma %x\n",speed);
ocp_ide_tune_drive(drive, ocp_ide_dma_2_pio(speed));
return ocp_ide_dma_on(drive);
}
int
ocp_ide_dma_intr(int irq, void *dev_id, struct pt_regs *regs)
{
unsigned long flags;
unsigned long tmp;
local_irq_save(flags);
//dmastat = ppc4xx_get_dma_status();
dmastat = mfdcr(DCRN_DMASR);
#ifdef WMODE
if (dmastat & 0x1000) {
//This should not happen at least in Word Mode, I have noticed this. Is it some timing problem ?
printk
("ocp_ide_dma_intr dma req pending from external device\n");
}
#endif
//mtdcr(DCRN_DMASR, ((u32)DMA_CH2_ERR | (u32)DMA_CS2 | (u32)DMA_TS2));
mtdcr(DCRN_DMASR,0x22211120);
/* disable DMA */
/*uicdcr = mfdcr (DCRN_UIC_PR (UIC0));
uicdcr &= ~(0x80000000ul >> IDE_DMA_INT);
mtdcr (DCRN_UIC_PR(UIC0), uicdcr);
mtdcr (DCRN_UIC_TR(UIC0),
mfdcr (DCRN_UIC_TR (UIC0)) | (0x80000000ul >> IDE_DMA_INT));
*/
//ppc4xx_disable_dma_interrupt(IDE_DMACH);
tmp = mfdcr(DCRN_DMASR);
mtdcr (DCRN_UIC_SR(UIC0),(0x80000000ul >> IDE_DMA_INT));
printk("GOT DMA interrupt %x %x\n",dmastat,tmp);
local_irq_restore(flags);
return 0;
//ppc4xx_clr_dma_status(IDE_DMACH);
}
void
ibm25xx_ide_spinup(int index)
{
int i,j;
ide_ioreg_t *io_ports;
printk("ide_redwood: waiting for drive ready..");
io_ports = ide_hwifs[index].io_ports;
/* wait until drive is not busy (it may be spinning up) */
for (i = 0; i < 30; i++) {
unsigned char stat;
stat = inb_p(io_ports[7]);
/* wait for !busy & ready */
if ((stat & 0x80) == 0) {
break;
}
for(j=0;j<10;j++)
udelay(1000 * 100); /* 1 second */
}
printk("..");
/* select slave */
outb_p(0xa0 | 0x10, io_ports[6]);
for (i = 0; i < 30; i++) {
unsigned char stat;
stat = inb_p(io_ports[7]);
/* wait for !busy & ready */
if ((stat & 0x80) == 0) {
break;
}
for(j=0;j<10;j++)
udelay(1000 * 100); /* 1 second */
}
printk("..");
outb_p(0xa0, io_ports[6]);
printk("Drive spun up \n");
}
static int ocp_ide_dma_off(ide_drive_t *drive){
printk("got ocp_ide_dma_off\n");
return 0;;
}
static int ocp_ide_dma_off_quietly(ide_drive_t *drive){
printk("got ocp_ide_dma_off_quietly\n");
return 0;
}
static int ocp_ide_dma_on(ide_drive_t *drive){
ide_hwif_t *hwif = HWIF(drive);
int i, reading = 0;
struct request *rq = HWGROUP(drive)->rq;
unsigned long flags;
unsigned long length;
printk("got ocp_ide_dma_on\n");
#if PIOMODE
return 1;
#endif
mtdcr(DCRN_DMACR2, 0);
ppc4xx_clr_dma_status(IDE_DMACH);
/*save_flags(flags);
cli();
if (request_irq (IDE_DMA_INT, &ocp_ide_dma_intr, SA_INTERRUPT,"IDE-DMA", hwif->hwgroup)) {
printk("ide_redwood6: ide_request_irq failed int=%d\n", IDE_DMA_INT);
//restore_flags(flags);
//return 1;
}
restore_flags(flags);
*/
drive->using_dma = 1;
#ifdef WMODE
mtdcr(DCRN_DCRXBCR, 0);
mtdcr(DCRN_CICCR, mfdcr(DCRN_CICCR) | 0x00000400);
#else
/* Configure CIC reg for line mode dma */
mtdcr(DCRN_CICCR, mfdcr(DCRN_CICCR) & ~0x00000400);
#endif
return 0;
}
static int ocp_ide_dma_check(ide_drive_t *drive){
printk("got ocp_ide_dma_check\n");
return redwood_config_drive_for_dma(drive);
}
static void ocp_ide_dma_begin(ide_drive_t *drive){
int i,reading=0,length;
struct request * const rq = HWGROUP(drive)->rq;
unsigned long control;
if(rq_data_dir (rq) == READ) reading = 1;
printk("got ocp_ide_dma_begin 0x%x\n",mfdcr(DCRN_DMASR));
/* enable DMA */
ppc4xx_enable_dma_interrupt(IDE_DMACH);
/*dmastat = mfdcr(DCRN_DMASR);
mtdcr(DCRN_DMASR,((u32)DMA_CH2_ERR | (u32)DMA_CS2 | (u32)DMA_TS2));
*/
mtdcr(DCRN_DMASR,0x22200120);
/*Configure CIC reg for line mode DMA*/
#ifdef WMODE
mtdcr(DCRN_CICCR,(mfdcr(DCRN_CICCR) | 0x00000400));
#else
mtdcr(DCRN_CICCR,(mfdcr(DCRN_CICCR) & ~0x00000400));
#endif
if(drive->media != ide_disk) {
printk("ocp_ide_dma_begin : Invalid media \n");
return;
}
if(ppc4xx_get_channel_config(IDE_DMACH,&dma_ch) & DMA_CHANNEL_BUSY){
printk("DMA channel busy \n");
return;
}
memset(rq->buffer,0,rq->current_nr_sectors*512);
if(reading){
dma_cache_inv((unsigned long) rq->buffer, rq->current_nr_sectors * 512);
#ifdef WMODE
mtdcr(DCRN_DMASA2,(u32)0x00000000);// set src address for DMA channel 2
mtdcr(DCRN_DMADA2,(u32)virt_to_bus(rq->buffer));//set dst address for DMA channel 2
mtdcr(DCRN_DCRXBCR,0x00000000);
control = 0xE600CB02;
#else
mtdcr(DCRN_DMASA2,(u32)0xfce00000);// set src address for DMA channel 2
mtdcr(DCRN_DMADA2,(u32)virt_to_bus(rq->buffer));//set dst address for DMA channel 2
mtdcr(DCRN_DCRXBCR,0x90000000);
control = 0xEE602b02;
#endif
}
else {
dma_cache_wback_inv((unsigned long) rq->buffer, rq->current_nr_sectors * 512);
#ifdef WMODE
mtdcr(DCRN_DMASA2,(u32)0x00000000);// set dst address for DMA channel 2
mtdcr(DCRN_DMADA2,(u32)virt_to_bus(rq->buffer));// set src address for DMA channel 2
mtdcr(DCRN_DCRXBCR,0x00000000);
control = 0xC600CB02;
#else
mtdcr(DCRN_DMADA2,(u32)0xfce00000);// set dst address for DMA channel 2
mtdcr(DCRN_DMASA2,(u32)virt_to_bus(rq->buffer));// set src address for DMA channel 2
mtdcr(DCRN_DCRXBCR,0xB0000000);
control = 0xcd602b02;
#endif
}
#ifdef WMODE
length = (rq->current_nr_sectors *512)/2;
#else
length = (rq->current_nr_sectors *512)/16;
#endif
mtdcr(DCRN_DMACT2,length);
/*control = mfdcr(DCRN_DMACR2);
control |= DMA_CIE_ENABLE; Channel Interrupt Enable
*/
control &= ~DMA_CIE_ENABLE;
mtdcr(DCRN_DMACR2, control);
//ppc4xx_enable_dma_interrupt(IDE_DMACH);
printk("DMA addr %x %x count %d dmastat %x\n",rq->buffer,virt_to_bus(rq->buffer),rq->current_nr_sectors,dmastat);
/* wait for dma to complete (channel 2 terminal count) */
for (i = 0; i < 500000; i++) {
if(i%1000 == 0)
dmastat = mfdcr(DCRN_DMASR);
if (dmastat & DMA_CS2)
break;
}
printk("DMA complete stat %x %d\n",dmastat,i);
mtdcr(DCRN_DCRXBCR,0x00000000);
mtdcr(DCRN_DMACR2, 0x00000000);
drive->waiting_for_dma = 0;
//dmastat = 0;
}
static int ocp_ide_dma_end(ide_drive_t *drive){
unsigned int tmp = mfdcr(DCRN_DMASR);
mtdcr (DCRN_UIC_SR(UIC0),(0x80000000ul >> IDE_DMA_INT));
mtdcr(DCRN_DMASR,0x22200120);
dmastat = mfdcr(DCRN_DMASR);
printk("got ocp_ide_dma_end %x %x\n",dmastat,tmp);
drive->waiting_for_dma = 0;
/* disable DMA */
//ppc4xx_disable_dma_interrupt(IDE_DMACH);
return 0;
}
static int ocp_ide_dma_test_irq(ide_drive_t *drive){
printk("got ocp_ide_dma_test_irq\n");
return 1; /* returns 1 if dma irq issued, 0 otherwise */
}
static int ocp_ide_dma_verbose(ide_drive_t *drive){
printk("got ocp_ide_dma_verbose\n");
return 1;
}
static int ocp_ide_dma_lostirq(ide_drive_t *drive){
printk("got ocp_ide_dma_lostirq\n");
return 1;
}
static int ocp_ide_dma_timeout(ide_drive_t *drive){
printk("got ocp_ide_dma_timeout\n");
return 1;
}
static void
ocp_dma_exec_cmd (ide_drive_t * const drive, u8 command){
ide_hwif_t *hwif = HWIF(drive);
//hwif->OUTBSYNC(drive,command, IDE_COMMAND_REG);
//printk("ide_dma_exec_cmd %x\n",command);
ide_execute_command (drive, command,&ide_dma_intr, 2*WAIT_CMD, NULL);
}
static int ocp_ide_dma_setup(ide_drive_t * const drive){
ide_hwif_t * const hwif = HWIF(drive);
struct request * const rq = HWGROUP(drive)->rq;
printk("got ocp_ide_dma_setup \n");
/*if(rq->current_nr_sectors < 2){
printk("request for less no of sectors %d\n",rq->current_nr_sectors);
ide_map_sg(drive,rq);drive->waiting_for_dma=0;
return 1;
}*/
drive->waiting_for_dma = 1;
return 0;
}
static void
ocp_ide_setup_dma (ide_hwif_t * const hwif)
{
printk("ocp_ide_setup_dma \n");
hwif->dma = IDE_DMACH;
#ifdef WMODE
/*Word Mode psc(11-12)=00,pwc(13-18)=000110, phc(19-21)=010, 22=1, 30=1 ---- 0xCB02*/
dma_ch.mode =TM_S_MM; /* xfer from peripheral to mem */
dma_ch.td = DMA_TD;
dma_ch.buffer_enable = FALSE;
dma_ch.tce_enable = FALSE;
dma_ch.etd_output = FALSE;
dma_ch.pce = FALSE;
dma_ch.pl = EXTERNAL_PERIPHERAL; /* no op */
dma_ch.pwidth = PW_16;
dma_ch.dai = TRUE;
dma_ch.sai = FALSE;
dma_ch.psc = 0; /* set the max setup cycles */
dma_ch.pwc = 6; /* set the max wait cycles */
dma_ch.phc = 2; /* set the max hold cycles */
dma_ch.cp = PRIORITY_LOW;
dma_ch.int_enable = FALSE;
dma_ch.ch_enable = FALSE; /* No chaining */
dma_ch.tcd_disable = TRUE; /* No chaining */
#else
/*Line Mode psc(11-12)=00,pwc(13-18)=000001, phc(19-21)=010, 22=1, 30=1 ---- 0x2B02*/
dma_ch.mode =DMA_MODE_MM_DEVATSRC; /* xfer from peripheral to mem */
dma_ch.td = DMA_TD;
dma_ch.buffer_enable = FALSE;
dma_ch.tce_enable = FALSE;
dma_ch.etd_output = FALSE;
dma_ch.pce = FALSE;
dma_ch.pl = EXTERNAL_PERIPHERAL; /* no op */
dma_ch.pwidth = PW_64; /* Line mode on stbs */
dma_ch.dai = TRUE;
dma_ch.sai = FALSE;
dma_ch.psc = 0; /* set the max setup cycles */
dma_ch.pwc = 1; /* set the max wait cycles */
dma_ch.phc = 2; /* set the max hold cycles */
dma_ch.cp = PRIORITY_LOW;
dma_ch.int_enable = FALSE;
dma_ch.ch_enable = FALSE; /* No chaining */
dma_ch.tcd_disable = TRUE; /* No chaining */
#endif
if (ppc4xx_init_dma_channel(IDE_DMACH, &dma_ch) != DMA_STATUS_GOOD){
printk("ppc4xx_init_dma_channel failed\n");
return -EBUSY;
}
//ppc4xx_disable_dma_interrupt(IDE_DMACH);
/*init CIC control register to enable IDE interface PIO mode*/
mtdcr(DCRN_CICCR,(mfdcr(DCRN_CICCR) & 0xffff7bff) | 0x00000003);
mtdcr(DCRN_DMACR2, 0);
ppc4xx_clr_dma_status(IDE_DMACH);
/* init CIC select2 reg to connect external DMA port 3 to internal
* DMA channel 2
*/
mtdcr(DCRN_DMAS2,(mfdcr(DCRN_DMAS2) & 0xfffffff0) | 0x00000002);
hwif->autodma = 1;hwif->udma_four=0;
hwif->drives[0].autotune = hwif->drives[1].autotune = IDE_TUNE_AUTO;
hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma;
hwif->atapi_dma = 0;
hwif->ultra_mask = hwif->udma_four ? 0x1f : 0x07;
hwif->mwdma_mask = 0x07;
hwif->swdma_mask = 0x00;
/* set everything to something != NULL */
hwif->ide_dma_host_off = &ocp_ide_dma_off_quietly;
hwif->ide_dma_host_on = &ocp_ide_dma_on;
hwif->ide_dma_check = &ocp_ide_dma_check;
hwif->ide_dma_off_quietly = &ocp_ide_dma_off_quietly;
hwif->ide_dma_on = &ocp_ide_dma_on;
hwif->dma_setup = &ocp_ide_dma_setup;
hwif->dma_exec_cmd = &ocp_dma_exec_cmd;
hwif->dma_start = &ocp_ide_dma_begin;
hwif->ide_dma_end = &ocp_ide_dma_end;
hwif->ide_dma_test_irq = &ocp_ide_dma_test_irq;
hwif->ide_dma_lostirq = &ocp_ide_dma_lostirq;
hwif->ide_dma_timeout = &ocp_ide_dma_timeout;
}
static int __init
stb025xx_ide_probe (struct ocp_device * const ocp)
{
int err;
unsigned int uicdcr;
volatile unsigned long ide_regs;
unsigned long flags,ioaddr;
ide_hwif_t * const hwif = &ide_hwifs[0];
unsigned char * ip;
int i;
printk ("IBM STB025xx OCP IDE driver version %s %x \n", IDEVR,ocp->def->paddr);
if (!request_region(REDWOOD_IDE_CMD, 0x10, "IDE"))
return -EBUSY;
if (!request_region(REDWOOD_IDE_CTRL, 2, "IDE")) {
release_region(REDWOOD_IDE_CMD, 0x10);
return -EBUSY;
}
ide_regs = ioaddr = (unsigned long) ioremap(REDWOOD_IDE_CMD, 0x10);
for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
hwif->io_ports[i] = ioaddr;
ioaddr += 2;
}
hwif->io_ports[IDE_CONTROL_OFFSET] =
(unsigned long) ioremap(REDWOOD_IDE_CTRL, 2);
ocp_force_power_on (ocp);
/* initialize */
hwif->gendev.parent = &ocp->dev;
ocp_set_drvdata (ocp, hwif);
/* setup MMIO ops */
default_hwif_mmiops (hwif);
/* tell common code _not_ to mess with resources */
hwif->mmio = 2;
ide_set_hwifdata (hwif, (void *) ide_regs);
hwif->chipset = ide_generic;
hwif->irq = IDE0_IRQ;
hwif->noprobe = 0;
hwif->hold = 1;
hwif->udma_four = 0;
hwif->tuneproc = &ocp_ide_tune_drive;
hwif->speedproc = &ocp_ide_tune_chipset;
hwif->drives[0].io_32bit = hwif->drives[1].io_32bit = 0;
hwif->drives[0].unmask = hwif->drives[1].unmask = 1;
pio_mode[0] = pio_mode[1] = -1;
ibm25xx_ide_spinup(0);
ocp_ide_setup_dma (hwif);
probe_hwif_init (hwif);
create_proc_ide_interfaces ();
printk("IDE probe finished \n");
return 0;
}
static void
stb025xx_ide_remove (struct ocp_device * const ocp)
{
ide_hwif_t * const hwif = ocp_get_drvdata (ocp);
hwif->dmatable_cpu = NULL;
hwif->dmatable_dma = 0;
ide_unregister (hwif->index);
ocp_force_power_off (ocp);
}
static struct ocp_device_id stb025xx_ide_ids[] __devinitdata =
{
{ .vendor = OCP_VENDOR_IBM, .function = OCP_FUNC_IDE},
{ .vendor = OCP_VENDOR_INVALID }
};
MODULE_DEVICE_TABLE (ocp, stb04xxx_ide_ids);
static struct ocp_driver stb025xx_ide_driver = {
.name = "ide",
.id_table = stb025xx_ide_ids,
.probe = stb025xx_ide_probe,
.remove = __devexit_p (stb025xx_ide_remove),
#if defined(CONFIG_PM)
.suspend = NULL,
.resume = NULL,
#endif
};
int __init
stb025xx_ide_init (void)
{
printk("inside stb04xxx_ide_init \n");
return ocp_register_driver (&stb025xx_ide_driver);
}
static void __exit
stb025xx_ide_exit (void)
{
printk("inside stb04xxx_ide_exit \n");
ocp_unregister_driver (&stb025xx_ide_driver);
}
/* needs to be called after ide has been initialized */
late_initcall (stb025xx_ide_init);
module_exit (stb025xx_ide_exit);
MODULE_LICENSE ("GPL");
MODULE_AUTHOR ("Akhilesh Soni <akhilesh@innomedia.soft.net>");
MODULE_DESCRIPTION ("driver for IBM OCP IDE on STB025xx");
^ permalink raw reply
* RE: JTAG Flash programmer for MPC8248
From: Steven Blakeslee @ 2006-09-13 11:38 UTC (permalink / raw)
To: Laurent Pinchart, linuxppc-embedded
>=20
> I know the BDI2000 is able to program the target flash=20
> memory, but I'm looking for a less expensive solution (I=20
> don't need debugging capabilities, just a plain flash programmer).
>=20
Macraigor is cost effective.
http://www.macraigor.com/
^ permalink raw reply
* Please pull powerpc.git 'merge' branch
From: Paul Mackerras @ 2006-09-13 12:47 UTC (permalink / raw)
To: torvalds; +Cc: linuxppc-dev
Linus,
Please do:
git pull \
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git merge
to get the last set of PowerPC updates for 2.6.18.
There are:
* A fix for the DART code from Ben H, which fixes the tg3 data
corruption issue that we have been chasing (it turned out that
adding barriers in tg3.c or to readl/writel didn't fix the problem).
* Changes to the readX/writeX and related functions to make them have
the expected semantics, i.e. ordered w.r.t. previous accesses to
RAM, etc.
* An implementation of futex_atomic_cmpxchg_inatomic.
* A compile fix for the 86xx platforms.
* A couple of kdump fixes.
* A couple of defconfig updates.
Thanks,
Paul.
arch/powerpc/configs/cell_defconfig | 58 ++-
arch/powerpc/configs/chrp32_defconfig | 31 +
arch/powerpc/configs/g5_defconfig | 9
arch/powerpc/configs/iseries_defconfig | 7
arch/powerpc/configs/maple_defconfig | 129 ++++--
arch/powerpc/configs/mpc7448_hpc2_defconfig | 64 ++-
arch/powerpc/configs/mpc834x_itx_defconfig | 20 +
arch/powerpc/configs/mpc834x_mds_defconfig | 104 ++++-
arch/powerpc/configs/mpc8540_ads_defconfig | 84 +++-
arch/powerpc/configs/mpc85xx_cds_defconfig | 75 +++
arch/powerpc/configs/mpc8641_hpcn_defconfig | 62 ++-
arch/powerpc/configs/pmac32_defconfig | 18 +
arch/powerpc/configs/ppc64_defconfig | 198 ++++++---
arch/powerpc/configs/pseries_defconfig | 8
arch/powerpc/kernel/crash.c | 2
arch/powerpc/kernel/misc.S | 49 +-
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 2
arch/powerpc/sysdev/dart_iommu.c | 7
arch/ppc/configs/prep_defconfig | 585 +++++++++++++++------------
include/asm-powerpc/eeh.h | 3
include/asm-powerpc/futex.h | 28 +
include/asm-powerpc/io.h | 43 +-
include/asm-powerpc/kdump.h | 2
include/asm-powerpc/paca.h | 1
include/asm-powerpc/spinlock.h | 17 +
include/asm-ppc/io.h | 20 +
26 files changed, 1102 insertions(+), 524 deletions(-)
commit eeac5c142b8687e35780b11b54b4c2f95b1a2436
Author: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Wed Sep 13 22:12:52 2006 +1000
[POWERPC] Fix G5 DART (IOMMU) race causing occasional data corruption
It seems that the occasional data corruption observed with the tg3
driver wasn't due to missing barriers after all, but rather seems to
be due to the DART (= IOMMU) in the U4 northbridge reading stale
IOMMU table entries from memory due to a race. This fixes it by
making the CPU read the entry back from memory before using it.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
commit f007cacffc8870702a1473d83ba5e4922d54e17c
Author: Paul Mackerras <paulus@samba.org>
Date: Wed Sep 13 22:08:26 2006 +1000
[POWERPC] Fix MMIO ops to provide expected barrier behaviour
This changes the writeX family of functions to have a sync instruction
before the MMIO store rather than after, because the generally expected
behaviour is that the device receiving the MMIO store can be guaranteed
to see the effects of any preceding writes to normal memory.
To preserve ordering between writeX and readX, and to preserve ordering
between preceding stores and the readX, the readX family of functions
have had an sync added before the load.
Although writeX followed by spin_unlock is not officially guaranteed
to keep the writeX inside the spin-locked region unless an mmiowb()
is used, there are currently drivers that depend on the previous
behaviour on powerpc, which was that the mmiowb wasn't actually required.
Therefore we have a per-cpu flag that is set by writeX, cleared by
__raw_spin_lock and mmiowb, and tested by __raw_spin_unlock. If it is
set, __raw_spin_unlock does a sync and clears it.
This changes both 32-bit and 64-bit readX/writeX. 32-bit already has a
sync in __raw_spin_unlock (since lwsync doesn't exist on 32-bit), and thus
doesn't need the per-cpu flag.
Tested on G5 (PPC970) and POWER5.
Signed-off-by: Paul Mackerras <paulus@samba.org>
commit 2e8e8dacc566cc91cd8707cb092e76c7bbfab178
Author: Mohan Kumar M <mohan@in.ibm.com>
Date: Tue Sep 12 17:48:21 2006 +0530
[POWERPC] Fix interrupt clearing in kdump shutdown sequence
Call chip->eoi(irq) to clear any pending interrupt in case of kdump
shutdown sequence. chip->end(irq) does not serve this purpose.
Signed-off-by: Mohan Kumar M <mohan@in.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
commit ebf2ed283897b752daa743952aff43d78b725183
Author: Olaf Hering <olaf@aepfle.de>
Date: Thu Sep 7 14:44:45 2006 +0200
[POWERPC] update prep_defconfig
Update PReP defconfig, disable some drivers for hardware that is not
used on those systems; enable SL82C105 IDE driver for Powerstack.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
commit e269d269e0b53a7a6cb1d04290f8174bf0488cb4
Author: Sachin P. Sant <sachinp@in.ibm.com>
Date: Fri Sep 8 07:59:52 2006 +0530
[POWERPC] kdump: Support kernels having 64k page size.
This is required to generate proper core files using kdump on ppc64.
Create a backup region of 64K size irrespective of the PAGE SIZE.
At present 32K was used as backup size. In the case of 64K page size,
second PT_LOAD segments starts at 32K and the first one is not page
aligned. __ioremap() (crash_dump.c) fails if pfn = 0 which is the
case for the second PT_LOAD segment. This is not an issue for 4K page
size because the the first page (32K backup) is copied to second
kernel memory and thus referencing with the second kernel pfn.
Signed-off-by: Sachin Sant <sachinp@in.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
commit 69588298188b40ed7f75c98a6fd328d82f23ca21
Author: David Woodhouse <dwmw2@infradead.org>
Date: Mon Sep 4 21:53:14 2006 -0700
[POWERPC] Implement PowerPC futex_atomic_cmpxchg_inatomic().
The sys_[gs]et_robust_list() syscalls were wired up on PowerPC but
didn't work correctly because futex_atomic_cmpxchg_inatomic() wasn't
implemented. Implement it, based on __cmpxchg_u32().
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
commit 20fb96e2aa009ae9892fde9ef7ffa82f56eebd11
Author: Jon Loeliger <jdl@freescale.com>
Date: Fri Sep 1 10:17:20 2006 -0500
[POWERPC] Add new, missing argument to of_irq_map_raw() for 86xx.
Ben speaks; we follow.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
commit fb7d527c1aec5e224fb3a0772337f8b5e59eecd0
Author: Paul Mackerras <paulus@samba.org>
Date: Sun Sep 10 11:04:36 2006 +1000
[POWERPC] Update defconfigs
Signed-off-by: Paul Mackerras <paulus@samba.org>
^ permalink raw reply
* Re: [PATCH] Unwire set/get_robust_list
From: Andreas Schwab @ 2006-09-13 12:54 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, David Woodhouse
In-Reply-To: <17671.15625.76850.349526@cargo.ozlabs.ibm.com>
Paul Mackerras <paulus@samba.org> writes:
> Could you test David's latest patch without the memory clobber?
Looks good (only tested on ppc64 kernel this time, but both 32 and 64 bit
userland).
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* Re: How to move from /ppc/ to /powerpc/
From: Fredrik Roubert @ 2006-09-13 13:28 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <20060912105830.3923d537.kim.phillips@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 1192 bytes --]
On Tue 12 Sep 17:58 CEST 2006, Kim Phillips wrote:
> The 8349EMDS device tree source is now in linux/arch/powerpc/boot/dts.
Is that the right dts to use for a MPC8349SYS board?
I tried compiling it like this:
$ dtc -f -I dts -O dtb mpc8349emds.dts > devices.dtb
DTC: dts->dtb on file "mpc8349emds.dts"
Warning: No cpu has "linux,boot-cpu" property
ERROR: Missing /chosen node
Input tree has errors
Is that really correct? Should I invoke dtc in some other way or modify
the dts or use some other dts file?
> Matt's u-boot patches address the issue well for 85xx, they are
> straightforward to adapt to 83xx:
>
> http://sourceforge.net/mailarchive/forum.php?thread_id=15518792&forum_id=12898
>
> they allow you to tftp the dtb into mem, and "bootm ${loadaddr} -
> ${oftaddr}" to start an ARCH=powerpc kernel.
OK, I've adapted and applied those patches now. However, when I try to
boot with the dtd I generated above, then the kernel just hangs. For
now, I assume that is because of errors in the dtd and not in u-boot ...
Cheers // Fredrik Roubert
--
Visserij 192 | +32 473 344527 / +46 708 776974
BE-9000 Gent | http://www.df.lth.se/~roubert/
[-- Attachment #2: Type: application/pgp-signature, Size: 303 bytes --]
^ permalink raw reply
* Re: How to move from /ppc/ to /powerpc/
From: Fredrik Roubert @ 2006-09-13 13:30 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <DADA32856852FC458E0F96B664A6F55E011E24CC@kom-mailsrv1.kontron-modular.com>
[-- Attachment #1: Type: text/plain, Size: 478 bytes --]
On Wed 13 Sep 08:58 CEST 2006, Claus Gindhart wrote:
> i am running a Kontron board (which has the same SoC as the MPC834x_SYS
> onboard) with the Freescale version of the 2.6.17-Kernel, and its
> working well. Together with my update from 2.6.13 i migrated from
> arch/ppc to arch/powerpc.
Interesting! What dts file are you using?
Cheers // Fredrik Roubert
--
Visserij 192 | +32 473 344527 / +46 708 776974
BE-9000 Gent | http://www.df.lth.se/~roubert/
[-- Attachment #2: Type: application/pgp-signature, Size: 303 bytes --]
^ permalink raw reply
* RE: How to move from /ppc/ to /powerpc/
From: Claus Gindhart @ 2006-09-13 14:07 UTC (permalink / raw)
To: Fredrik Roubert, linuxppc-embedded
Hi Fredrik,
our Kontron board is not identical to the SYS-Board, but has the same =
processor/chipset.
We are also not using U-Boot, but the Kontron NetBootloader, and our FDT =
implemtation does not use the dts. We have implemented this from scratch =
using the available documents regarding the required data to be passed.
For this reason, this will not be helpful for you.
Best regards,
Claus
-----Original Message-----
From: linuxppc-embedded-bounces+claus.gindhart=3Dkontron.com@ozlabs.org
[mailto:linuxppc-embedded-bounces+claus.gindhart=3Dkontron.com@ozlabs.org=
]
On Behalf Of Fredrik Roubert
Sent: Mittwoch, 13. September 2006 15:30
To: linuxppc-embedded@ozlabs.org
Subject: Re: How to move from /ppc/ to /powerpc/
On Wed 13 Sep 08:58 CEST 2006, Claus Gindhart wrote:
> i am running a Kontron board (which has the same SoC as the =
MPC834x_SYS
> onboard) with the Freescale version of the 2.6.17-Kernel, and its
> working well. Together with my update from 2.6.13 i migrated from
> arch/ppc to arch/powerpc.
Interesting! What dts file are you using?
Cheers // Fredrik Roubert
--=20
Visserij 192 | +32 473 344527 / +46 708 776974
BE-9000 Gent | http://www.df.lth.se/~roubert/
^ permalink raw reply
* Re: How to move from /ppc/ to /powerpc/
From: Jon Loeliger @ 2006-09-13 14:46 UTC (permalink / raw)
To: Fredrik Roubert; +Cc: linuxppc-embedded@ozlabs.org
In-Reply-To: <20060913132817.GD18263@igloo.df.lth.se>
On Wed, 2006-09-13 at 08:28, Fredrik Roubert wrote:
> On Tue 12 Sep 17:58 CEST 2006, Kim Phillips wrote:
>
> > The 8349EMDS device tree source is now in linux/arch/powerpc/boot/dts.
>
> Is that the right dts to use for a MPC8349SYS board?
>
> I tried compiling it like this:
>
> $ dtc -f -I dts -O dtb mpc8349emds.dts > devices.dtb
> DTC: dts->dtb on file "mpc8349emds.dts"
> Warning: No cpu has "linux,boot-cpu" property
> ERROR: Missing /chosen node
> Input tree has errors
>
> Is that really correct? Should I invoke dtc in some other way or modify
> the dts or use some other dts file?
You must use the -V 16 flag too. Likely, -b 0 as well.
jdl
^ 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