* Re: ipv6 in yaboot
From: Segher Boessenkool @ 2007-08-01 5:12 UTC (permalink / raw)
To: Doug Maxey; +Cc: Linux PowerPC List, Paul Mackerras, Paul Nasrat, yaboot-devel
In-Reply-To: <18071.1185935876@bebe.enoyolf.org>
>>> I just got asked about ipv6 support in yaboot and a quick
>>> investigation
>>> showed _no_ knowledge of the address formats in the code.
>>>
>>> Should I be submitting an RFC for a full parser that can pick that
>>> apart? Or does has someone have code lurking in the shadows, that
>>> just needed some prompting? :)
>>
>> I would have thought that yaboot would just be passing any network
>> addresses in text form to some OF method, so it's up to OF to
>> understand ipv6 address formats. No?
>
> Yes, yaboot _should_ just pass the text representation around.
> However, there are places that the context determination, for
> disklabels, is a simple check for the presence of ':'.
The network address is passed to OF as (part of) the device
argument for the network device; and colons aren't legal
characters in a device argument, so any OF implementation that
would use colons in IPv6 addresses is terminally broken. This
is completely analogous to the fact that filesystem paths cannot
use forward slashes. (The third disallowed character is the
at-sign, for completeness).
Segher
^ permalink raw reply
* Re: [PATCH] fixes for the SLB shadow buffer
From: Paul Mackerras @ 2007-08-01 5:28 UTC (permalink / raw)
To: Michael Neuling; +Cc: linuxppc-dev
In-Reply-To: <17055.1185944172@neuling.org>
Michael Neuling writes:
> + slb_shadow_update(mk_esid_data(VMALLOC_START, 1),
> + mk_vsid_data(VMALLOC_START, vflags), 1);
Could you re-jig slb_shadow_update to take ea, slot and vflags, and
call mk_[ev]sid_data itself, rather than exposing mk_esid_data and
mk_vsid_data, please?
Paul.
^ permalink raw reply
* Re: [PATCH] powerpc: Add of_register_i2c_devices()
From: Guennadi Liakhovetski @ 2007-08-01 5:41 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <235e0ff22961e25016727c0e74fd0c0f@kernel.crashing.org>
On Wed, 1 Aug 2007, Segher Boessenkool wrote:
> > > > + strncpy(info->driver_name, i2c_devices[i].i2c_driver,
> > > > KOBJ_NAME_LEN);
> > > > + strncpy(info->type, i2c_devices[i].i2c_type, I2C_NAME_SIZE);
> > >
> > > Why not just strcpy(), btw?
> >
> > Because target strings are finite length, and sources are just pointers to
> > some constant strings, which one might make arbitrarily long.
>
> So it's no problem if the name or type string gets cut short?
> Just checking :-)
Then it just won't match. Which is also the expected behaviour, IMHO, if
someone specifies a name longer than possible maximum length of the
variable it should match.
Have I passed or failed?:-)
Thanks
Guennadi
---
Guennadi Liakhovetski
^ permalink raw reply
* Re: [PATCH 2/6] PowerPC 440EPx: Sequoia DTS
From: David Gibson @ 2007-08-01 5:47 UTC (permalink / raw)
To: Segher Boessenkool, linuxppc-dev
In-Reply-To: <20070801050422.GI31391@localhost.localdomain>
On Wed, Aug 01, 2007 at 03:04:22PM +1000, David Gibson wrote:
> On Wed, Aug 01, 2007 at 06:57:33AM +0200, Segher Boessenkool wrote:
> > >> + UIC0: interrupt-controller0 {
> > >> + compatible = "ibm,uic-440gp","ibm,uic";
> > >
> > > The first compatible entry should always be the precise model, so in
> > > this case "ibm,uic-440epx".
> >
> > This isn't really _required_, but it is a very good idea in
> > almost all cases (the exception is for very generic or legacy
> > devices).
>
> Well, yes. That's a "should" not a "must" in rfc-speak.
>
> > > If it is (supposed to be) identical to
> > > the UIC in the 440GP, it can also have an "ibm,uic-440gp" entry, but
> > > since I believe all the UICs are supposed to operate the same, I think
> > > that's implicit in the "ibm,uic" entry.
> >
> > Sure, but there is no harm in having the better qualified 440gp
> > name in there as well -- bytes are cheap :-)
> >
> > >> + SDR0: sdr {
> > >
> > > What is the SDR?
> > >
> > >> + compatible = "ibm,sdr-440ep";
> > >> + dcr-reg = <00e 002>;
> > >> + };
> > >> +
> > >> + CPR0: cpr {
> > >
> > > And the CPR?
> >
> > Yeah, better names please -- if possible, something that someone
> > without knowledge of this SoC will understand what it is.
>
> I think the names are probably ok - I'm assuming they're in keeping
> with the convention I've used of using the same names / abbreviations
> as in the CPU user manual. I'm asking just for my own information,
> although a comment might not be a bad idea.
>
> > >> + nor_flash@0,0 {
> > >> + device_type = "rom";
> > >> + compatible = "direct-mapped";
> > >> + probe-type = "CFI";
> > >
> > > This flash binding needs to be replaced, but I guess that's not really
> > > your problem.
> >
> > Yeah, that's my problem, thanks for the prod :-)
>
> Also mine. I've been home sick the last couple of days, but by way of
> a sharper prod, see my draft work below. It patches both
> booting-without-of.txt with a revised binding, and implements it in
> the physmap_of driver (which needs renaming, but that's another
> story). It also revises the ebony device tree as an example.
>
> This is certainly not complete - it defines none of the extra
> properties that JEDEC chips need (although the mtd drivers'
> defaults/probing seem to cope for ebony). And there are various other
> ommisions. Still, it's a starting point - something precise for you
> to flame Segher :-p.
Duh, forgot to attach the actual patch. Here it is:
Index: working-2.6/Documentation/powerpc/booting-without-of.txt
===================================================================
--- working-2.6.orig/Documentation/powerpc/booting-without-of.txt 2007-07-30 17:07:14.000000000 +1000
+++ working-2.6/Documentation/powerpc/booting-without-of.txt 2007-07-30 17:07:14.000000000 +1000
@@ -1757,45 +1757,23 @@ platforms are moved over to use the flat
};
};
- j) Flash chip nodes
+ j) CFI or JEDEC memory-mapped NOR flash
Flash chips (Memory Technology Devices) are often used for solid state
file systems on embedded devices.
- Required properties:
+ - compatible : should contain the specific model of flash chip(s) used
+ followed by either "cfi-flash" or "jedec-flash"
+ - reg : Address range of the flash chip
+ - bank-width : Width (in bytes) of the flash bank. Equal to the device width
+ times the number of interleaved chips.
+ - device-width : (optional) Width of a single flash chip. If omitted,
+ assumed to be equal to 'bank-width'.
+
- - device_type : has to be "rom"
- - compatible : Should specify what this flash device is compatible with.
- Currently, this is most likely to be "direct-mapped" (which
- corresponds to the MTD physmap mapping driver).
- - reg : Offset and length of the register set (or memory mapping) for
- the device.
- - bank-width : Width of the flash data bus in bytes. Required
- for the NOR flashes (compatible == "direct-mapped" and others) ONLY.
-
- Recommended properties :
-
- - partitions : Several pairs of 32-bit values where the first value is
- partition's offset from the start of the device and the second one is
- partition size in bytes with LSB used to signify a read only
- partition (so, the partition size should always be an even number).
- - partition-names : The list of concatenated zero terminated strings
- representing the partition names.
- - probe-type : The type of probe which should be done for the chip
- (JEDEC vs CFI actually). Valid ONLY for NOR flashes.
-
- Example:
-
- flash@ff000000 {
- device_type = "rom";
- compatible = "direct-mapped";
- probe-type = "CFI";
- reg = <ff000000 01000000>;
- bank-width = <4>;
- partitions = <00000000 00f80000
- 00f80000 00080001>;
- partition-names = "fs\0firmware";
- };
+ Flash partitions
+ - reg :
+ - read-only : (optional)
k) Global Utilities Block
Index: working-2.6/drivers/mtd/maps/physmap_of.c
===================================================================
--- working-2.6.orig/drivers/mtd/maps/physmap_of.c 2007-07-30 17:07:11.000000000 +1000
+++ working-2.6/drivers/mtd/maps/physmap_of.c 2007-07-30 17:07:14.000000000 +1000
@@ -4,6 +4,9 @@
* Copyright (C) 2006 MontaVista Software Inc.
* Author: Vitaly Wool <vwool@ru.mvista.com>
*
+ * Revised to handle newer style flash binding by:
+ * Copyright (C) 2007 David Gibson, 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
@@ -30,17 +33,72 @@ struct physmap_flash_info {
struct map_info map;
struct resource *res;
#ifdef CONFIG_MTD_PARTITIONS
- int nr_parts;
struct mtd_partition *parts;
#endif
};
-static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL };
#ifdef CONFIG_MTD_PARTITIONS
-static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
-#endif
+static int __devinit handle_of_flash_partitions(struct physmap_flash_info *info,
+ struct of_device *dev)
+{
+ static const char *part_probe_types[]
+ = { "cmdlinepart", "RedBoot", NULL };
+ struct device_node *dp = dev->node, *pp;
+ int nr_parts, i, err;
+
+ /* First look for RedBoot table or partitions on the command
+ * line, these take precedence over device tree information */
+ nr_parts = parse_mtd_partitions(info->mtd, part_probe_types,
+ &info->parts, 0);
+ if (nr_parts > 0) {
+ add_mtd_partitions(info->mtd, info->parts, err);
+ return 0;
+ }
+
+ /* First count the subnodes */
+ nr_parts = 0;
+ for (pp = dp->child; pp; pp = pp->sibling)
+ nr_parts++;
+
+ info->parts = kzalloc(nr_parts * sizeof(struct mtd_partition), GFP_KERNEL);
+ if (!info->parts) {
+ printk(KERN_ERR "Can't allocate the flash partition data!\n");
+ return -ENOMEM;
+ }
+
+ for (pp = dp->child, i = 0 ; pp; pp = pp->sibling, i++) {
+ const u32 *reg;
+ const char *name;
+ const void *ro;
+ int len;
+
+ reg = of_get_property(pp, "reg", &len);
+ if (! reg || (len != 2*sizeof(u32))) {
+ dev_err(&dev->dev, "Invalid 'reg' on %s\n",
+ dp->full_name);
+ err = -EINVAL;
+ goto fail;
+ }
+ info->parts[i].offset = reg[0];
+ info->parts[i].size = reg[1];
+
+ name = of_get_property(pp, "name", &len);
+ info->parts[i].name = name;
+
+ ro = of_get_property(pp, "read-only", &len);
+ if (ro)
+ info->parts[i].mask_flags = MTD_WRITEABLE;
+ }
+
+ add_mtd_partitions(info->mtd, info->parts, nr_parts);
+ return 0;
+
+ fail:
+ kfree(info->parts);
+ info->parts = NULL;
+ return err;
+}
-#ifdef CONFIG_MTD_PARTITIONS
static int parse_flash_partitions(struct device_node *node,
struct mtd_partition **parts)
{
@@ -79,7 +137,14 @@ static int parse_flash_partitions(struct
err:
return retval;
}
-#endif
+#else /* MTD_PARTITIONS */
+static int __devinit handle_of_flash_partitions(struct physmap_flash_info *info,
+ struct device_node *dev)
+{
+ add_mtd_device(info->mtd);
+ return 0;
+}
+#endif /* MTD_PARTITIONS */
static int of_physmap_remove(struct of_device *dev)
{
@@ -92,7 +157,7 @@ static int of_physmap_remove(struct of_d
if (info->mtd != NULL) {
#ifdef CONFIG_MTD_PARTITIONS
- if (info->nr_parts) {
+ if (info->parts) {
del_mtd_partitions(info->mtd);
kfree(info->parts);
} else {
@@ -115,13 +180,45 @@ static int of_physmap_remove(struct of_d
return 0;
}
+/* Helper function to handle probing of the obsolete "direct-mapped"
+ * compatible binding, which has an extra "probe-type" property
+ * describing the type of flash probe necessary. */
+static struct mtd_info * __devinit obsolete_probe(struct of_device *dev,
+ struct map_info *map)
+{
+ struct device_node *dp = dev->node;
+ const char *of_probe;
+ struct mtd_info *mtd;
+ static const char *rom_probe_types[]
+ = { "cfi_probe", "jedec_probe", "map_rom"};
+ int i;
+
+ of_probe = of_get_property(dp, "probe-type", NULL);
+ if (!of_probe) {
+ for (i = 0; i < ARRAY_SIZE(rom_probe_types); i++) {
+ mtd = do_map_probe(rom_probe_types[i], map);
+ if (mtd)
+ return mtd;
+ }
+ return NULL;
+ } else if (strcmp(of_probe, "CFI") == 0) {
+ return do_map_probe("cfi_probe", map);
+ } else if (strcmp(of_probe, "JEDEC") == 0) {
+ return do_map_probe("jedec_probe", map);
+ } else {
+ if (strcmp(of_probe, "ROM") != 0)
+ dev_dbg(&dev->dev, "obsolete_probe: don't know probe type "
+ "'%s', mapping as rom\n", of_probe);
+ return do_map_probe("mtd_rom", map);
+ }
+}
+
static int __devinit of_physmap_probe(struct of_device *dev, const struct of_device_id *match)
{
struct device_node *dp = dev->node;
struct resource res;
struct physmap_flash_info *info;
- const char **probe_type;
- const char *of_probe;
+ const char *probe_type = (const char *)match->data;
const u32 *width;
int err;
@@ -174,21 +271,11 @@ static int __devinit of_physmap_probe(st
simple_map_init(&info->map);
- of_probe = of_get_property(dp, "probe-type", NULL);
- if (of_probe == NULL) {
- probe_type = rom_probe_types;
- for (; info->mtd == NULL && *probe_type != NULL; probe_type++)
- info->mtd = do_map_probe(*probe_type, &info->map);
- } else if (!strcmp(of_probe, "CFI"))
- info->mtd = do_map_probe("cfi_probe", &info->map);
- else if (!strcmp(of_probe, "JEDEC"))
- info->mtd = do_map_probe("jedec_probe", &info->map);
- else {
- if (strcmp(of_probe, "ROM"))
- dev_dbg(&dev->dev, "map_probe: don't know probe type "
- "'%s', mapping as rom\n", of_probe);
- info->mtd = do_map_probe("mtd_rom", &info->map);
- }
+ if (probe_type)
+ info->mtd = do_map_probe(probe_type, &info->map);
+ else
+ info->mtd = obsolete_probe(dev, &info->map);
+
if (info->mtd == NULL) {
dev_err(&dev->dev, "map_probe failed\n");
err = -ENXIO;
@@ -196,18 +283,7 @@ static int __devinit of_physmap_probe(st
}
info->mtd->owner = THIS_MODULE;
-#ifdef CONFIG_MTD_PARTITIONS
- err = parse_mtd_partitions(info->mtd, part_probe_types, &info->parts, 0);
- if (err > 0) {
- add_mtd_partitions(info->mtd, info->parts, err);
- } else if ((err = parse_flash_partitions(dp, &info->parts)) > 0) {
- dev_info(&dev->dev, "Using OF partition information\n");
- add_mtd_partitions(info->mtd, info->parts, err);
- info->nr_parts = err;
- } else
-#endif
-
- add_mtd_device(info->mtd);
+ handle_of_flash_partitions(info, dev);
return 0;
err_out:
@@ -221,6 +297,14 @@ err_out:
static struct of_device_id of_physmap_match[] = {
{
+ .compatible = "cfi-flash",
+ .data = (void *)"cfi_probe",
+ },
+ {
+ .compatible = "jedec-flash",
+ .data = (void *)"jedec_probe",
+ },
+ {
.type = "rom",
.compatible = "direct-mapped"
},
Index: working-2.6/arch/powerpc/boot/dts/ebony.dts
===================================================================
--- working-2.6.orig/arch/powerpc/boot/dts/ebony.dts 2007-07-30 17:07:14.000000000 +1000
+++ working-2.6/arch/powerpc/boot/dts/ebony.dts 2007-07-30 17:07:14.000000000 +1000
@@ -142,13 +142,16 @@
interrupt-parent = <&UIC1>;
small-flash@0,80000 {
- device_type = "rom";
- compatible = "direct-mapped";
- probe-type = "JEDEC";
+ compatible = "jedec-flash";
bank-width = <1>;
- partitions = <0 80000>;
- partition-names = "OpenBIOS";
+// partitions = <0 80000>;
+// partition-names = "OpenBIOS";
reg = <0 80000 80000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ OpenBIOS@0 {
+ reg = <0 80000>;
+ };
};
ds1743@1,0 {
@@ -158,14 +161,20 @@
};
large-flash@2,0 {
- device_type = "rom";
- compatible = "direct-mapped";
- probe-type = "JEDEC";
+ compatible = "jedec-flash";
bank-width = <1>;
- partitions = <0 380000
- 380000 80000>;
- partition-names = "fs", "firmware";
+// partitions = <0 380000
+// 380000 80000>;
+// partition-names = "fs", "firmware";
reg = <2 0 400000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ fs@0 {
+ reg = <0 380000>;
+ };
+ firmware@380000 {
+ reg = <380000 80000>;
+ };
};
ir@3,0 {
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply
* [PATCH] fixes for the SLB shadow buffer
From: Michael Neuling @ 2007-08-01 6:02 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <18096.6654.934841.561238@cargo.ozlabs.ibm.com>
We sometimes change the vmalloc segment in slb_flush_and_rebolt but we
never updated with slb shadow buffer. This fixes it. Thanks to paulus
for finding this.
Also added some write barriers to ensure the shadow buffer is always
valid.
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
> > + slb_shadow_update(mk_esid_data(VMALLOC_START, 1),
> > + mk_vsid_data(VMALLOC_START, vflags), 1);
>
> Could you re-jig slb_shadow_update to take ea, slot and vflags, and
> call mk_[ev]sid_data itself, rather than exposing mk_esid_data and
> mk_vsid_data, please?
Sure... this closer to what you want?
arch/powerpc/kernel/entry_64.S | 2 ++
arch/powerpc/mm/hash_utils_64.c | 6 ++++++
arch/powerpc/mm/slb.c | 19 +++++++++----------
include/asm-powerpc/mmu-hash64.h | 3 +++
4 files changed, 20 insertions(+), 10 deletions(-)
Index: linux-2.6-ozlabs/arch/powerpc/kernel/entry_64.S
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/entry_64.S
+++ linux-2.6-ozlabs/arch/powerpc/kernel/entry_64.S
@@ -389,7 +389,9 @@ BEGIN_FTR_SECTION
ld r9,PACA_SLBSHADOWPTR(r13)
li r12,0
std r12,SLBSHADOW_STACKESID(r9) /* Clear ESID */
+ eieio
std r7,SLBSHADOW_STACKVSID(r9) /* Save VSID */
+ eieio
std r0,SLBSHADOW_STACKESID(r9) /* Save ESID */
slbie r6
Index: linux-2.6-ozlabs/arch/powerpc/mm/hash_utils_64.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/mm/hash_utils_64.c
+++ linux-2.6-ozlabs/arch/powerpc/mm/hash_utils_64.c
@@ -629,6 +629,9 @@ int hash_page(unsigned long ea, unsigned
cpumask_t tmp;
int rc, user_region = 0, local = 0;
int psize;
+#ifdef CONFIG_PPC_64K_PAGES
+ unsigned long vflags;
+#endif
DBG_LOW("hash_page(ea=%016lx, access=%lx, trap=%lx\n",
ea, access, trap);
@@ -759,6 +762,9 @@ int hash_page(unsigned long ea, unsigned
mmu_psize_defs[mmu_vmalloc_psize].sllp) {
get_paca()->vmalloc_sllp =
mmu_psize_defs[mmu_vmalloc_psize].sllp;
+ vflags = SLB_VSID_KERNEL |
+ mmu_psize_defs[mmu_vmalloc_psize].sllp;
+ slb_shadow_update(VMALLOC_START, vflags, 1);
slb_flush_and_rebolt();
}
#endif /* CONFIG_PPC_64K_PAGES */
Index: linux-2.6-ozlabs/arch/powerpc/mm/slb.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/mm/slb.c
+++ linux-2.6-ozlabs/arch/powerpc/mm/slb.c
@@ -53,18 +53,19 @@ static inline unsigned long mk_vsid_data
return (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | flags;
}
-static inline void slb_shadow_update(unsigned long esid, unsigned long vsid,
- unsigned long entry)
+void slb_shadow_update(unsigned long ea,
+ unsigned long flags,
+ unsigned long entry)
{
/*
* Clear the ESID first so the entry is not valid while we are
* updating it.
*/
get_slb_shadow()->save_area[entry].esid = 0;
- barrier();
- get_slb_shadow()->save_area[entry].vsid = vsid;
- barrier();
- get_slb_shadow()->save_area[entry].esid = esid;
+ smp_wmb();
+ get_slb_shadow()->save_area[entry].vsid = mk_vsid_data(ea, flags);
+ smp_wmb();
+ get_slb_shadow()->save_area[entry].esid = mk_esid_data(ea, entry);
}
@@ -76,8 +77,7 @@ static inline void create_shadowed_slbe(
* we don't get a stale entry here if we get preempted by PHYP
* between these two statements.
*/
- slb_shadow_update(mk_esid_data(ea, entry), mk_vsid_data(ea, flags),
- entry);
+ slb_shadow_update(ea, flags, entry);
asm volatile("slbmte %0,%1" :
: "r" (mk_vsid_data(ea, flags)),
@@ -104,8 +104,7 @@ void slb_flush_and_rebolt(void)
ksp_esid_data &= ~SLB_ESID_V;
/* Only third entry (stack) may change here so only resave that */
- slb_shadow_update(ksp_esid_data,
- mk_vsid_data(ksp_esid_data, lflags), 2);
+ slb_shadow_update(get_paca()->kstack, lflags, 2);
/* We need to do this all in asm, so we're sure we don't touch
* the stack between the slbia and rebolting it. */
Index: linux-2.6-ozlabs/include/asm-powerpc/mmu-hash64.h
===================================================================
--- linux-2.6-ozlabs.orig/include/asm-powerpc/mmu-hash64.h
+++ linux-2.6-ozlabs/include/asm-powerpc/mmu-hash64.h
@@ -262,6 +262,9 @@ extern void slb_initialize(void);
extern void slb_flush_and_rebolt(void);
extern void stab_initialize(unsigned long stab);
+extern void slb_shadow_update(unsigned long ea,
+ unsigned long flags,
+ unsigned long entry);
#endif /* __ASSEMBLY__ */
/*
^ permalink raw reply
* [PATCH] lite5200b: flash definition in dts
From: Domen Puncer @ 2007-08-01 6:52 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: Sylvain Munaut
In-Reply-To: <20070619095408.GK23294@moe.telargo.com>
Add flash definition for to lite5200b dts, and while at it
fix "ranges" for soc node.
Signed-off-by: Domen Puncer <domen.puncer@telargo.com>
---
Hi!
Sylvain, it would be nice to have this merged.
# cat /proc/mtd
dev: size erasesize name
mtd0: 01000000 00020000 "data0"
mtd1: 00f00000 00020000 "data1"
mtd2: 00100000 00020000 "u-boot"
Some benchmarks:
read: 2.3 MB/s
erase: 168 kB/s
write: 7.3 kB/s
arch/powerpc/boot/dts/lite5200b.dts | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
Index: work-powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
===================================================================
--- work-powerpc.git.orig/arch/powerpc/boot/dts/lite5200b.dts
+++ work-powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
@@ -52,7 +52,8 @@
revision = ""; // from bootloader
#interrupt-cells = <3>;
device_type = "soc";
- ranges = <0 f0000000 f0010000>;
+ ranges = <00000000 f0000000 00010000
+ fe000000 fe000000 02000000>;
reg = <f0000000 00010000>;
bus-frequency = <0>; // from bootloader
system-frequency = <0>; // from bootloader
@@ -403,5 +404,26 @@
compatible = "mpc5200b-sram\0mpc5200-sram\0sram";
reg = <8000 4000>;
};
+
+ flash@fe000000 {
+ device_type = "rom";
+ compatible = "direct-mapped";
+ probe-type = "CFI";
+ reg = <fe000000 01000000>;
+ bank-width = <1>;
+ partitions = <00000000 01000000>;
+ partition-names = "data0";
+ };
+
+ flash@ff000000 {
+ device_type = "rom";
+ compatible = "direct-mapped";
+ probe-type = "CFI";
+ reg = <ff000000 01000000>;
+ bank-width = <1>;
+ partitions = <00000000 00f00000
+ 00f00000 00100000>;
+ partition-names = "data1", "u-boot";
+ };
};
};
^ permalink raw reply
* Re: [PATCH] powerpc: Pegasos keyboard detection
From: Matt Sealey @ 2007-08-01 7:25 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: linuxppc-dev, Alan Curry, linux-kernel
In-Reply-To: <3a538bd3f5db759abb55a661e6e94c7a@kernel.crashing.org>
Yeah please do a fixup for the boot wrapper.
Or, if you have trouble, go into the firmware and type "nvedit", add
these lines;
" /isa/8042" find-device
" 8042" encode-string device-type
(then ctrl-c to exit and nvstore to run it on next reboot. Try it without
the patch first, on the firmware console, just to be sure I got it right,
because I can't test it here)
You don't need to patch Linux at all. In fact for silly things like this
I would recommend against it :)
--
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations
Segher Boessenkool wrote:
>> As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse
>> controller
>> on the PegasosPPC. This is because of a feature/bug in the OF device
>> tree:
>> the "device_type" attribute is an empty string instead of "8042" as the
>> kernel expects. This patch (against 2.6.22.1) adds a secondary
>> detection
>> which looks for a device whose *name* is "8042" if there is no device
>> whose
>> *type* is "8042".
>>
>> Signed-off-by: Alan Curry <pacman@world.std.com>
>>
>> --- arch/powerpc/kernel/setup-common.c.orig 2007-07-24
>> 19:04:17.000000000 -0500
>> +++ arch/powerpc/kernel/setup-common.c 2007-07-24 19:06:36.000000000
>> -0500
>> @@ -487,6 +487,10 @@ int check_legacy_ioport(unsigned long ba
>> switch(base_port) {
>> case I8042_DATA_REG:
>> np = of_find_node_by_type(NULL, "8042");
>> + /* Pegasos has no device_type on its 8042 node, look for the
>> + * name instead */
>> + if (!np)
>> + np = of_find_node_by_name(NULL, "8042");
>
> [I know it already got merged, I'm behind on mail, but anyway...]
>
> Could board-specific quirks like this please always include a
> check for that board? Or, even better, do a fixup in the
> bootwrapper.
>
> In this case the workaround won't likely trigger on the wrong
> boards, but "just a little bit" more dangerous workarounds
> _will_, and the law of big numbers works against us...
>
>
> Segher
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH] powerpc: Pegasos keyboard detection
From: Matt Sealey @ 2007-08-01 7:28 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: linuxppc-dev, Alan Curry, linux-kernel
In-Reply-To: <46B03561.9090800@genesi-usa.com>
Just so you guys have it all in one pretty little package, these will remove
the need for the Pegasos IDE and ISA fixups in the prom_init.c too.
s" /pci@80000000/ide@C,1" find-device
d# 14 encode-int 0 encode-int
d# 15 encode-int 0 encode-int
encode+ encode+ encode+ s" interrupts" property
0x1018a encode-int s" class-code" property
device-end
s" /pci@80000000/isa@C" find-device
0x1 encode-int 0x0 encode-int 0x1006000 encode-int
0x0 encode-int 0x0 encode-int 0x1000 encode-int
encode+ encode+ encode+ encode+ encode+ s" ranges" property
device-end
If anyone wants to test and confirm the 8042 fix and then we can add
it to the end here.. we can unclutter the kernel.
--
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations
Matt Sealey wrote:
> Yeah please do a fixup for the boot wrapper.
>
> Or, if you have trouble, go into the firmware and type "nvedit", add
> these lines;
>
> " /isa/8042" find-device
> " 8042" encode-string device-type
>
> (then ctrl-c to exit and nvstore to run it on next reboot. Try it without
> the patch first, on the firmware console, just to be sure I got it right,
> because I can't test it here)
>
> You don't need to patch Linux at all. In fact for silly things like this
> I would recommend against it :)
>
^ permalink raw reply
* Generic clk.h wrappers? [Was: Re: [PATCH 1/3] powerpc clk.h interface for platforms]
From: Domen Puncer @ 2007-08-01 7:28 UTC (permalink / raw)
To: Domen Puncer
Cc: David Brownell, linuxppc-dev, Christoph Hellwig, Russell King,
linux-mips
In-Reply-To: <20070713091203.GE11476@nd47.coderock.org>
On 13/07/07 11:12 +0200, Domen Puncer wrote:
> On 11/07/07 21:34 +0100, Russell King wrote:
> > On Wed, Jul 11, 2007 at 10:02:54AM -0700, David Brownell wrote:
> > > On Wednesday 11 July 2007, Christoph Hellwig wrote:
> > > > On Wed, Jul 11, 2007 at 08:56:58AM -0700, David Brownell wrote:
> > > > > > Umm, this is about the fifth almost identical implementation of
> > > > > > the clk_ functions. Please, please put it into common code.
> > > > > >
> > > > > > And talk to the mips folks which just got a similar comment from me.
> > > > >
> > > > > You mean like a lib/clock.c core, rather than an opsvector?
> > > >
> > > > I mean an ops vector and surrounding wrappers. Every architecture
> > > > is reimplementing their own dispatch table which is rather annoying.
> > >
> > > ARM doesn't. :)
> > >
> > > But then, nobody expects one kernel to support more than one
> > > vendor's ARM chips; or usually, more than one generation of
> > > that vendor's chips. So any dispatch table is specific to
> > > a given platform, and tuned to its quirks. Not much to share
> > > between OMAP and AT91, for example, except in some cases maybe
> > > an arm926ejs block.
> >
> > And also the information stored within a 'struct clk' is very platform
> > dependent. In the most basic situation, 'struct clk' may not actually
> > be a structure, but the clock rate. All functions with the exception of
> > clk_get() and clk_get_rate() could well be no-ops, clk_get() just returns
> > the 'struct clk' representing the rate and 'clk_get_rate' returns that
> > as an integer.
> >
> > More complex setups might want 'struct clk' to contain the address of a
> > clock enable register, the bit position to enable that clock source, the
> > clock rate, a refcount, and so on, all of which would be utterly useless
> > for a platform which had fixed rate clocks.
>
> The patch that triggered this discussion is at the end.
> It doesn't make any assumption on struct clk, it's just a
> wrapper around functions from clk.h.
> Point of this patch was to abstract exported functions, since
> arch/powerpc/ can support multiple platfroms in one binary.
So... the thread just ended without any consensus, ACK or whatever.
Choices I see:
- have EXPORT_SYMBOL for clk.h functions in ie. lib/clock.c and have
every implemenation fill some global struct.
- leave this patch as it is, abstraction only for arch/powerpc/.
- or I can just forget about this, and leave it for the next sucker
who will want nicer clock handling in some driver.
Domen
^ permalink raw reply
* Re: 2.6.23-rc1-mm2
From: Mariusz Kozlowski @ 2007-08-01 8:02 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev, gregkh, paulus, linux-kernel, linux-usb-devel
In-Reply-To: <20070731230932.a9459617.akpm@linux-foundation.org>
Hello,
I get this warning. Looking at the comment in kernel/irq/resend.c
it's harmless. Is it?
WARNING: at kernel/irq/resend.c:69 check_irq_resend()
[<c010456a>] show_trace_log_lvl+0x1a/0x30
[<c010508d>] show_trace+0x12/0x14
[<c01051e0>] dump_stack+0x15/0x17
[<c013b001>] check_irq_resend+0x91/0xa0
[<c013ab58>] enable_irq+0xb1/0xb3
[<c02d7b81>] ide_config_drive_speed+0xda/0x269
[<c02d391c>] ali15x3_tune_chipset+0xcc/0x161
[<c02dd367>] ide_tune_dma+0x43/0x4d
[<c02d29e0>] ali15x3_config_drive_for_dma+0xf/0x2a
[<c02dc89a>] ide_set_dma+0x11/0x40
[<c02d41cf>] set_using_dma+0x84/0xd1
[<c02d4dfe>] generic_ide_ioctl+0xb9/0x3fb
[<c02df7e4>] idedisk_ioctl+0x3f/0x10c
[<c023d779>] blkdev_driver_ioctl+0x55/0x5e
[<c023da3e>] blkdev_ioctl+0x2bc/0x83e
[<c017e5ca>] block_ioctl+0x1b/0x21
[<c01664c2>] do_ioctl+0x22/0x71
[<c0166566>] vfs_ioctl+0x55/0x28a
[<c01667ce>] sys_ioctl+0x33/0x51
[<c0103f32>] sysenter_past_esp+0x5f/0x85
=======================
Then reattaching a usb mouse caused this (only once)
usb 2-1: USB disconnect, address 2
BUG: atomic counter underflow at:
[<c010456a>] show_trace_log_lvl+0x1a/0x30
[<c010508d>] show_trace+0x12/0x14
[<c01051e0>] dump_stack+0x15/0x17
[<c01418cf>] __free_pages+0x50/0x52
[<c01418f0>] free_pages+0x1f/0x21
[<c010783d>] dma_free_coherent+0x43/0x9c
[<c0315067>] hcd_buffer_free+0x43/0x6a
[<c030b2b4>] usb_buffer_free+0x23/0x29
[<c0346db4>] hid_free_buffers+0x23/0x71
[<c0346eb2>] hid_disconnect+0xb0/0xc8
[<c0313676>] usb_unbind_interface+0x30/0x72
[<c02c6df0>] __device_release_driver+0x6a/0x92
[<c02c71c3>] device_release_driver+0x20/0x36
[<c02c6736>] bus_remove_device+0x62/0x85
[<c02c49f8>] device_del+0x16d/0x27c
[<c0310f25>] usb_disable_device+0x7a/0xe2
[<c030d0bc>] usb_disconnect+0x94/0xde
[<c030e030>] hub_thread+0x2fe/0xc1b
[<c0128aee>] kthread+0x36/0x58
[<c0104233>] kernel_thread_helper+0x7/0x14
=======================
uhci_hcd 0000:00:0c.0: dma_pool_free buffer-32, 6b6b6b6b/6b6b6b6b (bad dma)
Every new try shows:
usb 2-1: new low speed USB device using uhci_hcd and address 3
usb 2-1: new device found, idVendor=046d, idProduct=c00e
usb 2-1: new device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-1: Product: USB-PS/2 Optical Mouse
usb 2-1: Manufacturer: Logitech
usb 2-1: configuration #1 chosen from 1 choice
input: Logitech USB-PS/2 Optical Mouse as /class/input/input9
input: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:0c.0-1
usb 2-1: USB disconnect, address 3
uhci_hcd 0000:00:0c.0: dma_pool_free buffer-32, 6b6b6b6b/6b6b6b6b (bad dma)
But mouse works ok.
Second issue as reported earilier allmodconfig fails to build on imac g3.
CC arch/powerpc/kernel/lparmap.s
AS arch/powerpc/kernel/head_64.o
lparmap.c: Assembler messages:
lparmap.c:84: Error: file number 1 already allocated
make[1]: *** [arch/powerpc/kernel/head_64.o] Blad 1
make: *** [arch/powerpc/kernel] Blad 2
Regards,
Mariusz
^ permalink raw reply
* [PATCH 0/2] Use common quirks routines for ULI chips
From: Zhang Wei @ 2007-08-01 8:14 UTC (permalink / raw)
To: paulus, galak; +Cc: linuxppc-dev
Hi,
These two patches add common quirks routines for
ULI chip on MPC8641HPCN and MPC8544DS board.
It supposes to support future powerpc platform using ULI chips.
[PATCH 1/2] Add sysdev/pci_quirks.c file into PowerPC architecture with ULI chip quirk functions.
[PATCH 2/2] Remove ULI chip quirks functions from MPC8641HPCN and MPC8544DS boards.
Best Regards,
Zhang Wei
^ permalink raw reply
* [PATCH 1/2] Add sysdev/pci_quirks.c file into PowerPC architecture with ULI chip quirk functions.
From: Zhang Wei @ 2007-08-01 8:14 UTC (permalink / raw)
To: paulus, galak; +Cc: linuxppc-dev
In-Reply-To: <11859560681182-git-send-email-wei.zhang@freescale.com>
Add sysdev/pci_quirks.c file into PowerPC architecture with
ULI chip quirk functions.
We add generic quirk functions for ULI chips
from individual platform into arch/powerpc/sysdev/pci_quirks.c file.
Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
---
arch/powerpc/platforms/Kconfig | 4 +
arch/powerpc/sysdev/Makefile | 1 +
arch/powerpc/sysdev/pci_quirks.c | 252 ++++++++++++++++++++++++++++++++++++++
3 files changed, 257 insertions(+), 0 deletions(-)
create mode 100644 arch/powerpc/sysdev/pci_quirks.c
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 932538a..10bfbe8 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -160,6 +160,10 @@ config PPC_INDIRECT_IO
select GENERIC_IOMAP
default n
+config PPC_PCI_QUIRKS
+ bool
+ default n
+
config GENERIC_IOMAP
bool
default n
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 08ce31e..d14bd73 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_U3_DART) += dart_iommu.o
obj-$(CONFIG_MMIO_NVRAM) += mmio_nvram.o
obj-$(CONFIG_FSL_SOC) += fsl_soc.o
obj-$(CONFIG_FSL_PCI) += fsl_pci.o
+obj-$(CONFIG_PPC_PCI_QUIRKS) += pci_quirks.o
obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o
obj-$(CONFIG_QUICC_ENGINE) += qe_lib/
mv64x60-$(CONFIG_PCI) += mv64x60_pci.o
diff --git a/arch/powerpc/sysdev/pci_quirks.c b/arch/powerpc/sysdev/pci_quirks.c
new file mode 100644
index 0000000..2dc7016
--- /dev/null
+++ b/arch/powerpc/sysdev/pci_quirks.c
@@ -0,0 +1,252 @@
+/*
+ * PCI quirks for PowerPC architecture.
+ *
+ * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+ * Zhang Wei <wei.zhang@freescale.com>, Jul 2007
+ *
+ * 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 file contains work-arounds or the special setting for
+ * PCI hardware devices on PowerPC architecture.
+ *
+ * Note: any quirks for hotpluggable devices must _NOT_ be declared __init.
+ *
+ */
+
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <asm-generic/rtc.h>
+
+/* The ULI1575 chip is used for MPC8641 and MPC8544 boards.
+ * The PIC in ULI1575 and legacy devices should be initialized.
+ */
+enum pirq{PIRQA = 8, PIRQB, PIRQC, PIRQD, PIRQE, PIRQF, PIRQG, PIRQH};
+const unsigned char uli1575_irq_route_table[16] = {
+ 0, /* 0: Reserved */
+ 0x8, /* 1: 0b1000 */
+ 0, /* 2: Reserved */
+ 0x2, /* 3: 0b0010 */
+ 0x4, /* 4: 0b0100 */
+ 0x5, /* 5: 0b0101 */
+ 0x7, /* 6: 0b0111 */
+ 0x6, /* 7: 0b0110 */
+ 0, /* 8: Reserved */
+ 0x1, /* 9: 0b0001 */
+ 0x3, /* 10: 0b0011 */
+ 0x9, /* 11: 0b1001 */
+ 0xb, /* 12: 0b1011 */
+ 0, /* 13: Reserved */
+ 0xd, /* 14, 0b1101 */
+ 0xf, /* 15, 0b1111 */
+};
+
+static int __devinit
+get_pci_irq_from_of(struct pci_controller *hose, int slot, int pin)
+{
+ struct of_irq oirq;
+ u32 laddr[3];
+ struct device_node *hosenode = hose ? hose->arch_data : NULL;
+
+ if (!hosenode)
+ return -EINVAL;
+
+ laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(slot, 0) << 8);
+ laddr[1] = 0;
+ laddr[2] = 0;
+ of_irq_map_raw(hosenode, &pin, 1, laddr, &oirq);
+ pr_debug("get_pci_irq_from_of: "
+ "pci irq addr %x, slot %d, pin %d, irq %d\n",
+ laddr[0], slot, pin, oirq.specifier[0]);
+ return oirq.specifier[0];
+}
+
+static void __devinit quirk_uli1575(struct pci_dev *dev)
+{
+ unsigned short temp;
+ struct pci_controller *hose = pci_bus_to_host(dev->bus);
+ unsigned char irq2pin[16];
+ unsigned long pirq_map_word = 0;
+ u32 irq;
+ int i;
+
+ /*
+ * ULI1575 interrupts route setup
+ */
+ memset(irq2pin, 0, 16); /* Initialize default value 0 */
+
+ /*
+ * PIRQA -> PIRQD mapping read from OF-tree
+ *
+ * interrupts for PCI slot0 -- PIRQA / PIRQB / PIRQC / PIRQD
+ * PCI slot1 -- PIRQB / PIRQC / PIRQD / PIRQA
+ */
+ for (i = 0; i < 4; i++) {
+ irq = get_pci_irq_from_of(hose, 0x1a, i + 1);
+ if (irq > 0 && irq < 16)
+ irq2pin[irq] = PIRQA + (i + 3) % 4;
+ else
+ printk(KERN_WARNING "ULI1575 device"
+ "(slot %d, pin %d) irq %d is invalid.\n",
+ 17, i, irq);
+ }
+
+ /*
+ * PIRQE -> PIRQF mapping set manually
+ *
+ * IRQ pin IRQ#
+ * PIRQE ---- 9
+ * PIRQF ---- 10
+ * PIRQG ---- 11
+ * PIRQH ---- 12
+ */
+ for (i = 0; i < 4; i++)
+ irq2pin[i + 9] = PIRQE + i;
+
+ /* Set IRQ-PIRQ Mapping to ULI1575 */
+ for (i = 0; i < 16; i++)
+ if (irq2pin[i])
+ pirq_map_word |= (uli1575_irq_route_table[i] & 0xf)
+ << ((irq2pin[i] - PIRQA) * 4);
+
+ pirq_map_word |= 1<<26; /* disable all PCI-Ex INTx in EP mode*/
+
+ /* ULI1575 IRQ mapping conf register default value is 0xb9317542 */
+ dev_dbg(&dev->dev,
+ "Setup ULI1575 IRQ mapping configuration register value = "
+ "0x%lx\n", pirq_map_word);
+ pci_write_config_dword(dev, 0x48, pirq_map_word);
+
+#define ULI1575_SET_DEV_IRQ(slot, pin, reg) \
+ do { \
+ int irq; \
+ irq = get_pci_irq_from_of(hose, slot, pin); \
+ if (irq > 0 && irq < 16) \
+ pci_write_config_byte(dev, reg, irq2pin[irq]); \
+ else \
+ printk(KERN_WARNING "ULI1575 device" \
+ "(slot %d, pin %d) irq %d is invalid.\n", \
+ slot, pin, irq); \
+ } while (0)
+
+ /* USB 1.1 OHCI controller 1, slot 28, pin 1 */
+ ULI1575_SET_DEV_IRQ(28, 1, 0x86);
+
+ /* USB 1.1 OHCI controller 2, slot 28, pin 2 */
+ ULI1575_SET_DEV_IRQ(28, 2, 0x87);
+
+ /* USB 1.1 OHCI controller 3, slot 28, pin 3 */
+ ULI1575_SET_DEV_IRQ(28, 3, 0x88);
+
+ /* USB 2.0 controller, slot 28, pin 4 */
+ irq = get_pci_irq_from_of(hose, 28, 4);
+ if (irq >= 0 && irq <= 15)
+ pci_write_config_dword(dev, 0x74, uli1575_irq_route_table[irq]);
+
+ /* Audio controller, slot 29, pin 1 */
+ ULI1575_SET_DEV_IRQ(29, 1, 0x8a);
+
+ /* Modem controller, slot 29, pin 2 */
+ ULI1575_SET_DEV_IRQ(29, 2, 0x8b);
+
+ /* HD audio controller, slot 29, pin 3 */
+ ULI1575_SET_DEV_IRQ(29, 3, 0x8c);
+
+ /* SMB interrupt: slot 30, pin 1 */
+ ULI1575_SET_DEV_IRQ(30, 1, 0x8e);
+
+ /* PMU ACPI SCI interrupt: slot 30, pin 2 */
+ ULI1575_SET_DEV_IRQ(30, 2, 0x8f);
+
+ /* Serial ATA interrupt: slot 31, pin 1 */
+ ULI1575_SET_DEV_IRQ(31, 1, 0x8d);
+
+ /* Primary PATA IDE IRQ: 14
+ * Secondary PATA IDE IRQ: 15
+ */
+ pci_write_config_byte(dev, 0x44, 0x30 | uli1575_irq_route_table[14]);
+ pci_write_config_byte(dev, 0x75, uli1575_irq_route_table[15]);
+
+ /* Set IRQ14 and IRQ15 to legacy IRQs */
+ pci_read_config_word(dev, 0x46, &temp);
+ temp |= 0xc000;
+ pci_write_config_word(dev, 0x46, temp);
+
+ /* Set i8259 interrupt trigger
+ * IRQ 3: Level
+ * IRQ 4: Level
+ * IRQ 5: Level
+ * IRQ 6: Level
+ * IRQ 7: Level
+ * IRQ 9: Level
+ * IRQ 10: Level
+ * IRQ 11: Level
+ * IRQ 12: Level
+ * IRQ 14: Edge
+ * IRQ 15: Edge
+ */
+ outb(0xfa, 0x4d0);
+ outb(0x1e, 0x4d1);
+
+#undef ULI1575_SET_DEV_IRQ
+#ifdef CONFIG_GEN_RTC
+ /* RTC interface.
+ * If there is no initialization for rtc of ppc_md,
+ * using the sample functions in include/asm-generic/rtc.h
+ */
+ if (!ppc_md.get_rtc_time)
+ ppc_md.get_rtc_time = get_rtc_time;
+ if (!ppc_md.set_rtc_time)
+ ppc_md.set_rtc_time = set_rtc_time;
+#endif
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, quirk_uli1575);
+
+static void __devinit quirk_uli5288(struct pci_dev *dev)
+{
+ u8 c;
+ u32 l;
+
+ pci_read_config_byte(dev, 0x83, &c);
+ c |= 0x80; /* Unlock the writing to PCI_CLASS_REVISION */
+ pci_write_config_byte(dev, 0x83, c);
+
+ pci_read_config_dword(dev, PCI_CLASS_REVISION, &l);
+ pci_write_config_dword(dev, PCI_CLASS_REVISION,
+ (PCI_CLASS_STORAGE_SATA_AHCI << 8) | (l & 0xff));
+
+ pci_read_config_byte(dev, 0x83, &c);
+ c &= 0x7f; /* Lock the writing to PCI_CLASS_REVISION */
+ pci_write_config_byte(dev, 0x83, c);
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288);
+
+static void __devinit quirk_uli5229(struct pci_dev *dev)
+{
+ unsigned short temp;
+ pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_IO
+ | PCI_COMMAND_MASTER | PCI_COMMAND_INTX_DISABLE);
+ dev->class &= ~0x5;
+ pci_read_config_word(dev, 0x4a, &temp);
+ temp |= 0x1000; /* Enable Native IRQ 14/15 */
+ pci_write_config_word(dev, 0x4a, temp);
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
+
+static void __devinit early_uli5249(struct pci_dev *dev)
+{
+ unsigned char temp;
+ pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_IO
+ | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
+ pci_read_config_byte(dev, 0x7c, &temp);
+ pci_write_config_byte(dev, 0x7c, 0x80); /* Unlock R/W control */
+ /* set as pci-pci bridge */
+ pci_write_config_byte(dev, PCI_CLASS_PROG, 0x01);
+ pci_write_config_byte(dev, 0x7c, temp); /* Lock R/W control */
+ dev->class |= 0x1;
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, 0x5249, early_uli5249);
--
1.5.1
^ permalink raw reply related
* [PATCH 2/2] Remove ULI chip quirks functions from MPC8641HPCN and MPC8544DS boards.
From: Zhang Wei @ 2007-08-01 8:14 UTC (permalink / raw)
To: paulus, galak; +Cc: linuxppc-dev
In-Reply-To: <11859560694083-git-send-email-wei.zhang@freescale.com>
Remove ULI chip quirks functions from MPC8641HPCN and MPC8544DS boards.
Use common quirks functions instead.
Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
---
arch/powerpc/platforms/85xx/Kconfig | 1 +
arch/powerpc/platforms/85xx/mpc8544_ds.c | 207 --------------------------
arch/powerpc/platforms/86xx/Kconfig | 1 +
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 217 ----------------------------
4 files changed, 2 insertions(+), 424 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index f581840..34306a7 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -32,6 +32,7 @@ config MPC85xx_MDS
config MPC8544_DS
bool "Freescale MPC8544 DS"
select PPC_I8259
+ select PPC_PCI_QUIRKS
select DEFAULT_UIMAGE
help
This option enables support for the MPC8544 DS board
diff --git a/arch/powerpc/platforms/85xx/mpc8544_ds.c b/arch/powerpc/platforms/85xx/mpc8544_ds.c
index 4905f6f..9b9a1f1 100644
--- a/arch/powerpc/platforms/85xx/mpc8544_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8544_ds.c
@@ -113,213 +113,6 @@ void __init mpc8544_ds_pic_init(void)
#endif /* CONFIG_PPC_I8259 */
}
-#ifdef CONFIG_PCI
-enum pirq { PIRQA = 8, PIRQB, PIRQC, PIRQD, PIRQE, PIRQF, PIRQG, PIRQH };
-
-/*
- * Value in table -- IRQ number
- */
-const unsigned char uli1575_irq_route_table[16] = {
- 0, /* 0: Reserved */
- 0x8,
- 0, /* 2: Reserved */
- 0x2,
- 0x4,
- 0x5,
- 0x7,
- 0x6,
- 0, /* 8: Reserved */
- 0x1,
- 0x3,
- 0x9,
- 0xb,
- 0, /* 13: Reserved */
- 0xd,
- 0xf,
-};
-
-static int __devinit
-get_pci_irq_from_of(struct pci_controller *hose, int slot, int pin)
-{
- struct of_irq oirq;
- u32 laddr[3];
- struct device_node *hosenode = hose ? hose->arch_data : NULL;
-
- if (!hosenode)
- return -EINVAL;
-
- laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(slot, 0) << 8);
- laddr[1] = laddr[2] = 0;
- of_irq_map_raw(hosenode, &pin, 1, laddr, &oirq);
- DBG("mpc8544_ds: pci irq addr %x, slot %d, pin %d, irq %d\n",
- laddr[0], slot, pin, oirq.specifier[0]);
- return oirq.specifier[0];
-}
-
-/*8259*/
-static void __devinit quirk_uli1575(struct pci_dev *dev)
-{
- unsigned short temp;
- struct pci_controller *hose = pci_bus_to_host(dev->bus);
- unsigned char irq2pin[16];
- unsigned long pirq_map_word = 0;
- u32 irq;
- int i;
-
- /*
- * ULI1575 interrupts route setup
- */
- memset(irq2pin, 0, 16); /* Initialize default value 0 */
-
- irq2pin[6]=PIRQA+3; /* enabled mapping for IRQ6 to PIRQD, used by SATA */
-
- /*
- * PIRQE -> PIRQF mapping set manually
- *
- * IRQ pin IRQ#
- * PIRQE ---- 9
- * PIRQF ---- 10
- * PIRQG ---- 11
- * PIRQH ---- 12
- */
- for (i = 0; i < 4; i++)
- irq2pin[i + 9] = PIRQE + i;
-
- /* Set IRQ-PIRQ Mapping to ULI1575 */
- for (i = 0; i < 16; i++)
- if (irq2pin[i])
- pirq_map_word |= (uli1575_irq_route_table[i] & 0xf)
- << ((irq2pin[i] - PIRQA) * 4);
-
- pirq_map_word |= 1<<26; /* disable INTx in EP mode*/
-
- /* ULI1575 IRQ mapping conf register default value is 0xb9317542 */
- DBG("Setup ULI1575 IRQ mapping configuration register value = 0x%x\n",
- (int)pirq_map_word);
- pci_write_config_dword(dev, 0x48, pirq_map_word);
-
-#define ULI1575_SET_DEV_IRQ(slot, pin, reg) \
- do { \
- int irq; \
- irq = get_pci_irq_from_of(hose, slot, pin); \
- if (irq > 0 && irq < 16) \
- pci_write_config_byte(dev, reg, irq2pin[irq]); \
- else \
- printk(KERN_WARNING "ULI1575 device" \
- "(slot %d, pin %d) irq %d is invalid.\n", \
- slot, pin, irq); \
- } while(0)
-
- /* USB 1.1 OHCI controller 1, slot 28, pin 1 */
- ULI1575_SET_DEV_IRQ(28, 1, 0x86);
-
- /* USB 1.1 OHCI controller 2, slot 28, pin 2 */
- ULI1575_SET_DEV_IRQ(28, 2, 0x87);
-
- /* USB 1.1 OHCI controller 3, slot 28, pin 3 */
- ULI1575_SET_DEV_IRQ(28, 3, 0x88);
-
- /* USB 2.0 controller, slot 28, pin 4 */
- irq = get_pci_irq_from_of(hose, 28, 4);
- if (irq >= 0 && irq <= 15)
- pci_write_config_dword(dev, 0x74, uli1575_irq_route_table[irq]);
-
- /* Audio controller, slot 29, pin 1 */
- ULI1575_SET_DEV_IRQ(29, 1, 0x8a);
-
- /* Modem controller, slot 29, pin 2 */
- ULI1575_SET_DEV_IRQ(29, 2, 0x8b);
-
- /* HD audio controller, slot 29, pin 3 */
- ULI1575_SET_DEV_IRQ(29, 3, 0x8c);
-
- /* SMB interrupt: slot 30, pin 1 */
- ULI1575_SET_DEV_IRQ(30, 1, 0x8e);
-
- /* PMU ACPI SCI interrupt: slot 30, pin 2 */
- ULI1575_SET_DEV_IRQ(30, 2, 0x8f);
-
- /* Serial ATA interrupt: slot 31, pin 1 */
- ULI1575_SET_DEV_IRQ(31, 1, 0x8d);
-
- /* Primary PATA IDE IRQ: 14
- * Secondary PATA IDE IRQ: 15
- */
- pci_write_config_byte(dev, 0x44, 0x30 | uli1575_irq_route_table[14]);
- pci_write_config_byte(dev, 0x75, uli1575_irq_route_table[15]);
-
- /* Set IRQ14 and IRQ15 to legacy IRQs */
- pci_read_config_word(dev, 0x46, &temp);
- temp |= 0xc000;
- pci_write_config_word(dev, 0x46, temp);
-
- /* Set i8259 interrupt trigger
- * IRQ 3: Level
- * IRQ 4: Level
- * IRQ 5: Level
- * IRQ 6: Level
- * IRQ 7: Level
- * IRQ 9: Level
- * IRQ 10: Level
- * IRQ 11: Level
- * IRQ 12: Level
- * IRQ 14: Edge
- * IRQ 15: Edge
- */
- outb(0xfa, 0x4d0);
- outb(0x1e, 0x4d1);
-
-#undef ULI1575_SET_DEV_IRQ
-}
-
-/* SATA */
-static void __devinit quirk_uli5288(struct pci_dev *dev)
-{
- unsigned char c;
-
- pci_read_config_byte(dev, 0x83, &c);
- c |= 0x80; /* read/write lock */
- pci_write_config_byte(dev, 0x83, c);
-
- pci_write_config_byte(dev, 0x09, 0x01); /* Base class code: storage */
- pci_write_config_byte(dev, 0x0a, 0x06); /* IDE disk */
-
- pci_read_config_byte(dev, 0x83, &c);
- c &= 0x7f;
- pci_write_config_byte(dev, 0x83, c);
-
- pci_read_config_byte(dev, 0x84, &c);
- c |= 0x01; /* emulated PATA mode enabled */
- pci_write_config_byte(dev, 0x84, c);
-}
-
-/* PATA */
-static void __devinit quirk_uli5229(struct pci_dev *dev)
-{
- unsigned short temp;
- pci_write_config_word(dev, 0x04, 0x0405); /* MEM IO MSI */
- pci_read_config_word(dev, 0x4a, &temp);
- temp |= 0x1000; /* Enable Native IRQ 14/15 */
- pci_write_config_word(dev, 0x4a, temp);
-}
-
-/*Bridge*/
-static void __devinit early_uli5249(struct pci_dev *dev)
-{
- unsigned char temp;
- pci_write_config_word(dev, 0x04, 0x0007); /* mem access */
- pci_read_config_byte(dev, 0x7c, &temp);
- pci_write_config_byte(dev, 0x7c, 0x80); /* R/W lock control */
- pci_write_config_byte(dev, 0x09, 0x01); /* set as pci-pci bridge */
- pci_write_config_byte(dev, 0x7c, temp); /* restore pci bus debug control */
- dev->class |= 0x1;
-}
-
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, quirk_uli1575);
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288);
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
-DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, 0x5249, early_uli5249);
-#endif /* CONFIG_PCI */
/*
* Setup the architecture
diff --git a/arch/powerpc/platforms/86xx/Kconfig b/arch/powerpc/platforms/86xx/Kconfig
index 343b76d..9cebfc6 100644
--- a/arch/powerpc/platforms/86xx/Kconfig
+++ b/arch/powerpc/platforms/86xx/Kconfig
@@ -6,6 +6,7 @@ choice
config MPC8641_HPCN
bool "Freescale MPC8641 HPCN"
select PPC_I8259
+ select PPC_PCI_QUIRKS
select DEFAULT_UIMAGE
help
This option enables support for the MPC8641 HPCN board.
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index e9eaa07..b958f0e 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -106,223 +106,6 @@ mpc86xx_hpcn_init_irq(void)
#endif
}
-#ifdef CONFIG_PCI
-
-enum pirq{PIRQA = 8, PIRQB, PIRQC, PIRQD, PIRQE, PIRQF, PIRQG, PIRQH};
-const unsigned char uli1575_irq_route_table[16] = {
- 0, /* 0: Reserved */
- 0x8, /* 1: 0b1000 */
- 0, /* 2: Reserved */
- 0x2, /* 3: 0b0010 */
- 0x4, /* 4: 0b0100 */
- 0x5, /* 5: 0b0101 */
- 0x7, /* 6: 0b0111 */
- 0x6, /* 7: 0b0110 */
- 0, /* 8: Reserved */
- 0x1, /* 9: 0b0001 */
- 0x3, /* 10: 0b0011 */
- 0x9, /* 11: 0b1001 */
- 0xb, /* 12: 0b1011 */
- 0, /* 13: Reserved */
- 0xd, /* 14, 0b1101 */
- 0xf, /* 15, 0b1111 */
-};
-
-static int __devinit
-get_pci_irq_from_of(struct pci_controller *hose, int slot, int pin)
-{
- struct of_irq oirq;
- u32 laddr[3];
- struct device_node *hosenode = hose ? hose->arch_data : NULL;
-
- if (!hosenode) return -EINVAL;
-
- laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(slot, 0) << 8);
- laddr[1] = laddr[2] = 0;
- of_irq_map_raw(hosenode, &pin, 1, laddr, &oirq);
- DBG("mpc86xx_hpcn: pci irq addr %x, slot %d, pin %d, irq %d\n",
- laddr[0], slot, pin, oirq.specifier[0]);
- return oirq.specifier[0];
-}
-
-static void __devinit quirk_uli1575(struct pci_dev *dev)
-{
- unsigned short temp;
- struct pci_controller *hose = pci_bus_to_host(dev->bus);
- unsigned char irq2pin[16], c;
- unsigned long pirq_map_word = 0;
- u32 irq;
- int i;
-
- /*
- * ULI1575 interrupts route setup
- */
- memset(irq2pin, 0, 16); /* Initialize default value 0 */
-
- /*
- * PIRQA -> PIRQD mapping read from OF-tree
- *
- * interrupts for PCI slot0 -- PIRQA / PIRQB / PIRQC / PIRQD
- * PCI slot1 -- PIRQB / PIRQC / PIRQD / PIRQA
- */
- for (i = 0; i < 4; i++){
- irq = get_pci_irq_from_of(hose, 17, i + 1);
- if (irq > 0 && irq < 16)
- irq2pin[irq] = PIRQA + i;
- else
- printk(KERN_WARNING "ULI1575 device"
- "(slot %d, pin %d) irq %d is invalid.\n",
- 17, i, irq);
- }
-
- /*
- * PIRQE -> PIRQF mapping set manually
- *
- * IRQ pin IRQ#
- * PIRQE ---- 9
- * PIRQF ---- 10
- * PIRQG ---- 11
- * PIRQH ---- 12
- */
- for (i = 0; i < 4; i++) irq2pin[i + 9] = PIRQE + i;
-
- /* Set IRQ-PIRQ Mapping to ULI1575 */
- for (i = 0; i < 16; i++)
- if (irq2pin[i])
- pirq_map_word |= (uli1575_irq_route_table[i] & 0xf)
- << ((irq2pin[i] - PIRQA) * 4);
-
- /* ULI1575 IRQ mapping conf register default value is 0xb9317542 */
- DBG("Setup ULI1575 IRQ mapping configuration register value = 0x%x\n",
- pirq_map_word);
- pci_write_config_dword(dev, 0x48, pirq_map_word);
-
-#define ULI1575_SET_DEV_IRQ(slot, pin, reg) \
- do { \
- int irq; \
- irq = get_pci_irq_from_of(hose, slot, pin); \
- if (irq > 0 && irq < 16) \
- pci_write_config_byte(dev, reg, irq2pin[irq]); \
- else \
- printk(KERN_WARNING "ULI1575 device" \
- "(slot %d, pin %d) irq %d is invalid.\n", \
- slot, pin, irq); \
- } while(0)
-
- /* USB 1.1 OHCI controller 1, slot 28, pin 1 */
- ULI1575_SET_DEV_IRQ(28, 1, 0x86);
-
- /* USB 1.1 OHCI controller 2, slot 28, pin 2 */
- ULI1575_SET_DEV_IRQ(28, 2, 0x87);
-
- /* USB 1.1 OHCI controller 3, slot 28, pin 3 */
- ULI1575_SET_DEV_IRQ(28, 3, 0x88);
-
- /* USB 2.0 controller, slot 28, pin 4 */
- irq = get_pci_irq_from_of(hose, 28, 4);
- if (irq >= 0 && irq <=15)
- pci_write_config_dword(dev, 0x74, uli1575_irq_route_table[irq]);
-
- /* Audio controller, slot 29, pin 1 */
- ULI1575_SET_DEV_IRQ(29, 1, 0x8a);
-
- /* Modem controller, slot 29, pin 2 */
- ULI1575_SET_DEV_IRQ(29, 2, 0x8b);
-
- /* HD audio controller, slot 29, pin 3 */
- ULI1575_SET_DEV_IRQ(29, 3, 0x8c);
-
- /* SMB interrupt: slot 30, pin 1 */
- ULI1575_SET_DEV_IRQ(30, 1, 0x8e);
-
- /* PMU ACPI SCI interrupt: slot 30, pin 2 */
- ULI1575_SET_DEV_IRQ(30, 2, 0x8f);
-
- /* Serial ATA interrupt: slot 31, pin 1 */
- ULI1575_SET_DEV_IRQ(31, 1, 0x8d);
-
- /* Primary PATA IDE IRQ: 14
- * Secondary PATA IDE IRQ: 15
- */
- pci_write_config_byte(dev, 0x44, 0x30 | uli1575_irq_route_table[14]);
- pci_write_config_byte(dev, 0x75, uli1575_irq_route_table[15]);
-
- /* Set IRQ14 and IRQ15 to legacy IRQs */
- pci_read_config_word(dev, 0x46, &temp);
- temp |= 0xc000;
- pci_write_config_word(dev, 0x46, temp);
-
- /* Set i8259 interrupt trigger
- * IRQ 3: Level
- * IRQ 4: Level
- * IRQ 5: Level
- * IRQ 6: Level
- * IRQ 7: Level
- * IRQ 9: Level
- * IRQ 10: Level
- * IRQ 11: Level
- * IRQ 12: Level
- * IRQ 14: Edge
- * IRQ 15: Edge
- */
- outb(0xfa, 0x4d0);
- outb(0x1e, 0x4d1);
-
-#undef ULI1575_SET_DEV_IRQ
-
- /* Disable the HD interface and enable the AC97 interface. */
- pci_read_config_byte(dev, 0xb8, &c);
- c &= 0x7f;
- pci_write_config_byte(dev, 0xb8, c);
-}
-
-static void __devinit quirk_uli5288(struct pci_dev *dev)
-{
- unsigned char c;
-
- pci_read_config_byte(dev,0x83,&c);
- c |= 0x80;
- pci_write_config_byte(dev, 0x83, c);
-
- pci_write_config_byte(dev, 0x09, 0x01);
- pci_write_config_byte(dev, 0x0a, 0x06);
-
- pci_read_config_byte(dev,0x83,&c);
- c &= 0x7f;
- pci_write_config_byte(dev, 0x83, c);
-
- pci_read_config_byte(dev,0x84,&c);
- c |= 0x01;
- pci_write_config_byte(dev, 0x84, c);
-}
-
-static void __devinit quirk_uli5229(struct pci_dev *dev)
-{
- unsigned short temp;
- pci_write_config_word(dev, 0x04, 0x0405);
- dev->class &= ~0x5;
- pci_read_config_word(dev, 0x4a, &temp);
- temp |= 0x1000;
- pci_write_config_word(dev, 0x4a, temp);
-}
-
-static void __devinit early_uli5249(struct pci_dev *dev)
-{
- unsigned char temp;
- pci_write_config_word(dev, 0x04, 0x0007);
- pci_read_config_byte(dev, 0x7c, &temp);
- pci_write_config_byte(dev, 0x7c, 0x80);
- pci_write_config_byte(dev, 0x09, 0x01);
- pci_write_config_byte(dev, 0x7c, temp);
- dev->class |= 0x1;
-}
-
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, quirk_uli1575);
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288);
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
-DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, 0x5249, early_uli5249);
-#endif /* CONFIG_PCI */
-
static void __init
mpc86xx_hpcn_setup_arch(void)
--
1.5.1
^ permalink raw reply related
* Re: 2.6.23-rc1-mm2
From: Andrew Morton @ 2007-08-01 8:13 UTC (permalink / raw)
To: Mariusz Kozlowski, Ingo Molnar
Cc: linuxppc-dev, gregkh, paulus, linux-kernel, linux-usb-devel
In-Reply-To: <200708011002.30962.m.kozlowski@tuxland.pl>
On Wed, 1 Aug 2007 10:02:30 +0200 Mariusz Kozlowski <m.kozlowski@tuxland.pl> wrote:
> Hello,
>
> I get this warning. Looking at the comment in kernel/irq/resend.c
> it's harmless. Is it?
>
> WARNING: at kernel/irq/resend.c:69 check_irq_resend()
> [<c010456a>] show_trace_log_lvl+0x1a/0x30
> [<c010508d>] show_trace+0x12/0x14
> [<c01051e0>] dump_stack+0x15/0x17
> [<c013b001>] check_irq_resend+0x91/0xa0
> [<c013ab58>] enable_irq+0xb1/0xb3
> [<c02d7b81>] ide_config_drive_speed+0xda/0x269
> [<c02d391c>] ali15x3_tune_chipset+0xcc/0x161
> [<c02dd367>] ide_tune_dma+0x43/0x4d
> [<c02d29e0>] ali15x3_config_drive_for_dma+0xf/0x2a
> [<c02dc89a>] ide_set_dma+0x11/0x40
> [<c02d41cf>] set_using_dma+0x84/0xd1
> [<c02d4dfe>] generic_ide_ioctl+0xb9/0x3fb
> [<c02df7e4>] idedisk_ioctl+0x3f/0x10c
> [<c023d779>] blkdev_driver_ioctl+0x55/0x5e
> [<c023da3e>] blkdev_ioctl+0x2bc/0x83e
> [<c017e5ca>] block_ioctl+0x1b/0x21
> [<c01664c2>] do_ioctl+0x22/0x71
> [<c0166566>] vfs_ioctl+0x55/0x28a
> [<c01667ce>] sys_ioctl+0x33/0x51
> [<c0103f32>] sysenter_past_esp+0x5f/0x85
> =======================
Ingo debug stuff.
> Then reattaching a usb mouse caused this (only once)
>
> usb 2-1: USB disconnect, address 2
> BUG: atomic counter underflow at:
> [<c010456a>] show_trace_log_lvl+0x1a/0x30
> [<c010508d>] show_trace+0x12/0x14
> [<c01051e0>] dump_stack+0x15/0x17
> [<c01418cf>] __free_pages+0x50/0x52
> [<c01418f0>] free_pages+0x1f/0x21
> [<c010783d>] dma_free_coherent+0x43/0x9c
> [<c0315067>] hcd_buffer_free+0x43/0x6a
> [<c030b2b4>] usb_buffer_free+0x23/0x29
> [<c0346db4>] hid_free_buffers+0x23/0x71
> [<c0346eb2>] hid_disconnect+0xb0/0xc8
> [<c0313676>] usb_unbind_interface+0x30/0x72
> [<c02c6df0>] __device_release_driver+0x6a/0x92
> [<c02c71c3>] device_release_driver+0x20/0x36
> [<c02c6736>] bus_remove_device+0x62/0x85
> [<c02c49f8>] device_del+0x16d/0x27c
> [<c0310f25>] usb_disable_device+0x7a/0xe2
> [<c030d0bc>] usb_disconnect+0x94/0xde
> [<c030e030>] hub_thread+0x2fe/0xc1b
> [<c0128aee>] kthread+0x36/0x58
> [<c0104233>] kernel_thread_helper+0x7/0x14
> =======================
> uhci_hcd 0000:00:0c.0: dma_pool_free buffer-32, 6b6b6b6b/6b6b6b6b (bad dma)
whoa. huuuuuuuuuuge USB bug!
> Every new try shows:
>
> usb 2-1: new low speed USB device using uhci_hcd and address 3
> usb 2-1: new device found, idVendor=046d, idProduct=c00e
> usb 2-1: new device strings: Mfr=1, Product=2, SerialNumber=0
> usb 2-1: Product: USB-PS/2 Optical Mouse
> usb 2-1: Manufacturer: Logitech
> usb 2-1: configuration #1 chosen from 1 choice
> input: Logitech USB-PS/2 Optical Mouse as /class/input/input9
> input: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:0c.0-1
> usb 2-1: USB disconnect, address 3
> uhci_hcd 0000:00:0c.0: dma_pool_free buffer-32, 6b6b6b6b/6b6b6b6b (bad dma)
>
> But mouse works ok.
>
ok..
>
> Second issue as reported earilier allmodconfig fails to build on imac g3.
>
> CC arch/powerpc/kernel/lparmap.s
> AS arch/powerpc/kernel/head_64.o
> lparmap.c: Assembler messages:
> lparmap.c:84: Error: file number 1 already allocated
> make[1]: *** [arch/powerpc/kernel/head_64.o] Blad 1
> make: *** [arch/powerpc/kernel] Blad 2
hm, someone is working that, I think?
^ permalink raw reply
* Re: [PATCH] powerpc: Add of_register_i2c_devices()
From: Segher Boessenkool @ 2007-08-01 8:18 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <Pine.LNX.4.60.0708010739560.4228@poirot.grange>
>>>>> + strncpy(info->driver_name, i2c_devices[i].i2c_driver,
>>>>> KOBJ_NAME_LEN);
>>>>> + strncpy(info->type, i2c_devices[i].i2c_type, I2C_NAME_SIZE);
>>>>
>>>> Why not just strcpy(), btw?
>>>
>>> Because target strings are finite length, and sources are just
>>> pointers to
>>> some constant strings, which one might make arbitrarily long.
>>
>> So it's no problem if the name or type string gets cut short?
>> Just checking :-)
>
> Then it just won't match.
strncpy() won't put a terminating zero on there, is everything
that uses the resulting string okay with that? Also, if the
name gets cut short, it might match some _other_ expected name.
> Have I passed or failed?:-)
Dunno, what is this test, anyway? :-)
Segher
^ permalink raw reply
* Re: [PATCH 2/2] powerpc: MPC85xx EDAC device driver
From: Arnd Bergmann @ 2007-08-01 8:36 UTC (permalink / raw)
To: Dave Jiang; +Cc: linuxppc-dev, bluesmoke-devel, norsk5
In-Reply-To: <46AFD0C8.5010704@mvista.com>
On Wednesday 01 August 2007, Dave Jiang wrote:
> Do you mean the pci_controller hose that's allocated in fsl_add_bridge? Couple
> questions....
> 1. How do I even get access to that? (in fsl_soc.c that is)
> 2. pci_controller has no "struct device" member. It only has "struct device
> *parent". What do I set the dev->parent of the platform device to?
You already have the device_node, and can simply call
of_find_device_by_node() on it to get the of_device.
The current fsl_pci code does not use the of_device of the hose but
adds the hose at the top of the device tree, afaics, but that can
change when the ppc32 PCI initialization gets changed to do the
initialization later during boot.
Arnd <><
^ permalink raw reply
* Re: 2.6.23-rc1-mm2
From: Ingo Molnar @ 2007-08-01 8:16 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-usb-devel, gregkh, linux-kernel, linuxppc-dev,
Mariusz Kozlowski, paulus
In-Reply-To: <20070801011323.6e8d8259.akpm@linux-foundation.org>
* Andrew Morton <akpm@linux-foundation.org> wrote:
> On Wed, 1 Aug 2007 10:02:30 +0200 Mariusz Kozlowski <m.kozlowski@tuxland.pl> wrote:
>
> > Hello,
> >
> > I get this warning. Looking at the comment in kernel/irq/resend.c
> > it's harmless. Is it?
yeah, harmless.
Ingo
^ permalink raw reply
* Re: [patch 07/35] pasemi_mac: stop using the pci config space accessors for register read/writes
From: Marian Balakowicz @ 2007-08-01 9:27 UTC (permalink / raw)
To: Olof Johansson; +Cc: linuxppc-dev
In-Reply-To: <20070728083530.GA4580@lixom.net>
Olof Johansson wrote:
> On Thu, Jul 26, 2007 at 11:25:04PM +0200, Marian Balakowicz wrote:
>>
>> Olof Johansson wrote:
>>> Move away from using the pci config access functions for simple register
>>> access. Our device has all of the registers in the config space (hey,
>>> from the hardware point of view it looks reasonable :-), so we need to
>>> somehow get to it. Newer firmwares have it in the device tree such that
>>> we can just get it and ioremap it there (in case it ever moves in future
>>> products). For now, provide a hardcoded fallback for older firmwares.
>> I have recently tried to apply a group of your MAC patches that
>> includes the one from this email. Strangely, I got a pretty random
>> kernel panics (or kernel freezes) when this patch is included. Panics
>> happen in a random, places and have random causes. What I observed is
>> that replacing newly introduced mac->iob_regs with the corresponding
>> offset from (already ioremapped) hose->cfg_data removed the problem. So,
>> it seems that dereferencing pointers based on a second ioremap on a
>> subset of 0xe000_0000 addresses is problematic.
>
> The problem is that the IOB register range is 8K, not 4K. I have since
> fixed that bug but I didn't repost the patch series. It does cause weird
> and strange errors to happen since register writes into the second 4K
> would really go to another mapping somewhere else.
>
> So, the quick fix is to always map 0x2000 in map_one_reg, the slightly better
> one is to check the PCI dev and only map 2K for the IOB.
Thanks for the pointer. Using 0x2000 for IOB solves the problem.
Regards,
Marian
^ permalink raw reply
* Re: [PATCH] [POWERPC] Typo fixes interrrupt -> interrupt
From: Gabriel C @ 2007-08-01 9:38 UTC (permalink / raw)
To: Stephen Rothwell
Cc: linuxppc-dev, Linux Kernel Mailing List, linuxppc-embedded
In-Reply-To: <20070801144318.f81fd988.sfr@canb.auug.org.au>
Stephen Rothwell wrote:
> On Wed, 01 Aug 2007 05:16:27 +0200 Gabriel C <nix.or.die@googlemail.com> wrote:
>> arch/powerpc/platforms/iseries/it_lp_naca.h | 87 +++++++++++----------
>
> NAK this part as it just makes a lot of the lines more than 80 characters
> for no real gain on a platform that is moving on ...
Well some were there before but with the wrong comment style.
I'll send an new patch in a bit without the comments fixes.
Gabriel
^ permalink raw reply
* Re: [PATCH] [POWERPC] Typo fixes interrrupt -> interrupt ( try 2 )
From: Gabriel C @ 2007-08-01 9:41 UTC (permalink / raw)
To: Stephen Rothwell
Cc: linuxppc-dev, Linux Kernel Mailing List, linuxppc-embedded
In-Reply-To: <20070801144318.f81fd988.sfr@canb.auug.org.au>
This patch fixes some interrrupt -> interrupt typos
Signed-off-by: Gabriel Craciunescu <nix.or.die@googlemail.com>
---
arch/powerpc/platforms/embedded6xx/holly.c | 2 +-
arch/powerpc/platforms/embedded6xx/linkstation.c | 2 +-
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c | 2 +-
arch/powerpc/platforms/iseries/it_lp_naca.h | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c
index 6292e36..fda16e8 100644
--- a/arch/powerpc/platforms/embedded6xx/holly.c
+++ b/arch/powerpc/platforms/embedded6xx/holly.c
@@ -147,7 +147,7 @@ static void __init holly_setup_arch(void)
}
/*
- * Interrupt setup and service. Interrrupts on the holly come
+ * Interrupt setup and service. Interrupts on the holly come
* from the four external INT pins, PCI interrupts are routed via
* PCI interrupt control registers, it generates internal IRQ23
*
diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c
index bd5ca58..8c60e02 100644
--- a/arch/powerpc/platforms/embedded6xx/linkstation.c
+++ b/arch/powerpc/platforms/embedded6xx/linkstation.c
@@ -99,7 +99,7 @@ static void __init linkstation_setup_arch(void)
}
/*
- * Interrupt setup and service. Interrrupts on the linkstation come
+ * Interrupt setup and service. Interrupts on the linkstation come
* from the four PCI slots plus onboard 8241 devices: I2C, DUART.
*/
static void __init linkstation_init_IRQ(void)
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
index 1e3cc69..25c29bc 100644
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -91,7 +91,7 @@ static void __init mpc7448_hpc2_setup_arch(void)
}
/*
- * Interrupt setup and service. Interrrupts on the mpc7448_hpc2 come
+ * Interrupt setup and service. Interrupts on the mpc7448_hpc2 come
* from the four external INT pins, PCI interrupts are routed via
* PCI interrupt control registers, it generates internal IRQ23
*
diff --git a/arch/powerpc/platforms/iseries/it_lp_naca.h b/arch/powerpc/platforms/iseries/it_lp_naca.h
index 9bbf589..cf6dcf6 100644
--- a/arch/powerpc/platforms/iseries/it_lp_naca.h
+++ b/arch/powerpc/platforms/iseries/it_lp_naca.h
@@ -60,7 +60,7 @@ struct ItLpNaca {
u8 xRsvd2_0[128]; // Reserved x00-x7F
// CACHE_LINE_3-6 0x0100 - 0x02FF Contains LP Queue indicators
-// NB: Padding required to keep xInterrruptHdlr at x300 which is required
+// NB: Padding required to keep xInterruptHdlr at x300 which is required
// for v4r4 PLIC.
u8 xOldLpQueue[128]; // LP Queue needed for v4r4 100-17F
u8 xRsvd3_0[384]; // Reserved 180-2FF
^ permalink raw reply related
* Re: 2.6.23-rc1-mm2
From: Paul Mackerras @ 2007-08-01 10:32 UTC (permalink / raw)
To: Mariusz Kozlowski
Cc: linuxppc-dev, Andrew Morton, gregkh, linux-kernel,
linux-usb-devel
In-Reply-To: <200708011002.30962.m.kozlowski@tuxland.pl>
Mariusz Kozlowski writes:
> Second issue as reported earilier allmodconfig fails to build on imac g3.
Do you really mean g3? If so it's a 32-bit kernel and it shouldn't be
building lparmap.s. Or do you mean G5?
> CC arch/powerpc/kernel/lparmap.s
> AS arch/powerpc/kernel/head_64.o
> lparmap.c: Assembler messages:
> lparmap.c:84: Error: file number 1 already allocated
> make[1]: *** [arch/powerpc/kernel/head_64.o] Blad 1
> make: *** [arch/powerpc/kernel] Blad 2
Weird. Could you do make V=1 and send me the output?
Paul.
^ permalink raw reply
* Re: Embedded linux FTP Server
From: Clemens Koller @ 2007-08-01 11:20 UTC (permalink / raw)
To: khollan; +Cc: linuxppc-embedded
In-Reply-To: <11935088.post@talk.nabble.com>
khollan schrieb:
> Hey
>
> Im looking for a basic ftp server to run on my ML410 Xilinx board, I was
> looking on the net and couldn't find anything that stands out. Does anyone
> have suggestions, or know of something that works well.
> Thanks
> kholland
netkit-ftp seems to be standard.
I am using vsftp because it seems to be good for production.
The
http://vsftpd.beasts.org
http://www.proftpd.org
http://www.wu-ftpd.org
are propably the well known/often used ones.
And there are also tftp servers (trivial ftp)...
if that's what you mean with "basic".
Just choose one from:
http://crux.nu/portdb/?q=ftp&a=search
Regards,
--
Clemens Koller
__________________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Straße 45/1
Linhof Werksgelände
D-81379 München
Tel.089-741518-50
Fax 089-741518-19
http://www.anagramm-technology.com
^ permalink raw reply
* GPIO interrupts on mpc8313e
From: Yoni Levin @ 2007-08-01 11:45 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 366 bytes --]
I want to receive interrupt from 1 GPIO port (for example 14)
I changed the GPIMR to 0xffffffff (so I need to get interrupts from all GPIO
ports)
And then request the irq by :
irq_create_mapping(NULL,74);
request_irq(74,handler,IRQF_DISABLED,"GPIO",NULL);
the return value is 0 (OK)
but I cant receive any interrupt.
do I need to do something else?
[-- Attachment #2: Type: text/html, Size: 3527 bytes --]
^ permalink raw reply
* Re: [RFC][PATCH] MPC832x_RDB: update dts to use spi, register mmc_spi stub
From: Anton Vorontsov @ 2007-08-01 12:34 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: linuxppc-dev
In-Reply-To: <692e6dabbfb62dc6d6ace3ea7552ef68@kernel.crashing.org>
On Wed, Aug 01, 2007 at 12:10:28AM +0200, Segher Boessenkool wrote:
>> + spi1pio:spi_pin@01 {
>
> There should be whitespace after the label. @01 should be
> spelled @1. Except there is no "reg" property.
Hm. I've just tried to keep original style in this particular dts.
Want to ack patch below?
What is prefered style of <&label> vs. < &label > usage, btw?
arch/powerpc/boot/dts$ grep "<&" -r . | wc -l
327
arch/powerpc/boot/dts$ grep "< &" -r . | wc -l
92
I can only guess - the first?
> What is this
> stuff, anyway?
Which one? pio-map for spi? This is GPIO pins configuration, to use
dedicated functions (SPI) for these pins, otherwise SPI will not work.
>> + pio-map = <
>> + /* port pin dir open_drain assignment has_irq */
>> + 3 0 3 0 1 0 /* SPI1 MOSI, I/O */
>> + 3 1 3 0 1 0 /* SPI1 MISO, I/O */
>> + 3 2 3 0 1 0 /* SPI1 CLK, I/O */
>> + 3 3 2 0 1 0>; /* SPI1 SEL, I */
>> + };
p.s. mpc8272ads.dts is broken wrt spaces/tabs, very.
- - - -
From: Anton Vorontsov <avorontsov@ru.mvista.com>
Subject: [POWERPC] boot/dts/*: cleanup labels usage
There should be whitespace after labels.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
arch/powerpc/boot/dts/mpc8272ads.dts | 6 +++---
arch/powerpc/boot/dts/mpc832x_rdb.dts | 12 ++++++------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts
index 1934b80..97c5d4e 100644
--- a/arch/powerpc/boot/dts/mpc8272ads.dts
+++ b/arch/powerpc/boot/dts/mpc8272ads.dts
@@ -66,14 +66,14 @@
reg = <0 0>;
#address-cells = <1>;
#size-cells = <0>;
- phy0:ethernet-phy@0 {
+ phy0: ethernet-phy@0 {
interrupt-parent = <&Cpm_pic>;
interrupts = <17 4>;
reg = <0>;
bitbang = [ 12 12 13 02 02 01 ];
device_type = "ethernet-phy";
};
- phy1:ethernet-phy@1 {
+ phy1: ethernet-phy@1 {
interrupt-parent = <&Cpm_pic>;
interrupts = <17 4>;
bitbang = [ 12 12 13 02 02 01 ];
@@ -153,7 +153,7 @@
};
};
- cpm_pic:interrupt-controller@10c00 {
+ cpm_pic: interrupt-controller@10c00 {
#address-cells = <0>;
#interrupt-cells = <2>;
interrupt-controller;
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 7c4beff..e9c332f 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -127,7 +127,7 @@
device_type = "pci";
};
- pic:pic@700 {
+ pic: pic@700 {
interrupt-controller;
#address-cells = <0>;
#interrupt-cells = <2>;
@@ -141,7 +141,7 @@
device_type = "par_io";
num-ports = <7>;
- ucc2pio:ucc_pin@02 {
+ ucc2pio: ucc_pin@02 {
pio-map = <
/* port pin dir open_drain assignment has_irq */
3 4 3 0 2 0 /* MDIO */
@@ -163,7 +163,7 @@
0 1e 1 0 1 0 /* TX_EN */
0 1f 2 0 1 0>; /* CRS */
};
- ucc3pio:ucc_pin@03 {
+ ucc3pio: ucc_pin@03 {
pio-map = <
/* port pin dir open_drain assignment has_irq */
0 d 2 0 1 0 /* RX_CLK (CLK9) */
@@ -272,13 +272,13 @@
device_type = "mdio";
compatible = "ucc_geth_phy";
- phy00:ethernet-phy@00 {
+ phy00: ethernet-phy@00 {
interrupt-parent = <&pic>;
interrupts = <0>;
reg = <0>;
device_type = "ethernet-phy";
};
- phy04:ethernet-phy@04 {
+ phy04: ethernet-phy@04 {
interrupt-parent = <&pic>;
interrupts = <0>;
reg = <4>;
@@ -286,7 +286,7 @@
};
};
- qeic:qeic@80 {
+ qeic: qeic@80 {
interrupt-controller;
device_type = "qeic";
#address-cells = <0>;
--
1.5.0.6
^ permalink raw reply related
* Re: [PATCH 1/2] [IDE] Platform IDE driver
From: Sergei Shtylyov @ 2007-08-01 12:39 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: linuxppc-dev, linux-kernel, linux-ide
In-Reply-To: <d04530fcd6e879e0bc059049b7951aef@kernel.crashing.org>
Hello.
Segher Boessenkool wrote:
>> This doesn't mean that shift is better anyway. If everyone
>> considers it
>> better, I give up. But be warned that shift (stride) is not the only
>> property
>> characterizing register accesses -- the regs might be only accessible as
>> 16/32-bit quantities, for example (16-bit is a real world example -- from
>> Amiga or smth of that sort, IIRC).
> More importantly, "reg-shift" doesn't say what part of
> the bigger words to access. A common example is byte-wide
> registers on a 32-bit-only bus; it's about 50%-50% between
> connecting the registers to the low byte vs. connecting it
> to the byte with the lowest address.
We already have "big-endian" prop used in MPIC nodes, IIRC. Could try to
"reuse" it here as well...
> The only realistic way to handle all this is to put some
> knowledge into the device driver. This does of course
> also mean that no "reg-shift" property is needed; the
> device driver can look at your "compatible" property,
> instead.
>>>> Why the heck should we care about the UART code taling about IDE?!
>>> Consistency?
>> We're not obliged to be consistent with every piece of the kernel
>> code.
> It would be nice to not name similar properties in the
> device tree dissimilarly. Kernel code doesn't come into
> the picture here.
The "reg-shift" prop is yet unaccepted ad-hockery at this point. ;-)
So, I don't see why we have to be consistent with it.
> Segher
WBR, Sergei
^ 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