* [2.6 patch] ppc .gitignore update
From: Adrian Bunk @ 2007-08-01 13:30 UTC (permalink / raw)
To: Rutger Nijlunsing, Paul Mackerras; +Cc: linuxppc-dev, linux-kernel
arch/ppc/.gitignore shouldn't exclude arch/ppc/boot/include
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
--- /dev/null 2006-09-19 00:45:31.000000000 +0200
+++ linux-2.6.23-rc1-mm2/arch/ppc/boot/.gitignore 2007-08-01 15:18:33.000000000 +0200
@@ -0,0 +1 @@
+!include
^ permalink raw reply
* Re: [RFC][PATCH] MPC832x_RDB: update dts to use spi, register mmc_spi stub
From: Anton Vorontsov @ 2007-08-01 13:29 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: linuxppc-dev
In-Reply-To: <b3d36996792216ddd9dbae12212a4168@kernel.crashing.org>
On Wed, Aug 01, 2007 at 12:06:46AM +0200, Segher Boessenkool wrote:
>>>> spi@4c0 {
>>>> device_type = "spi";
>>>> + device-id = <1>;
>>>
>>> Can we just use the reg value for bus_num in the kernel.
>>
>> Sure, technically nothing prevents this. But, QE specs names
>> SPIs by these ids.
>
> As a minimum the property name should start with "fsl," then.
fsl,device-id = <1>;, correct?
>> Plus, from the kernel side spi name will be
>> not pretty, it will be spi1216.1.
>
> What, the kernel cannot implement a counter itself?
Just counter is especially meaningless and confusing. It will
work in that particular case, though. But then SPI bus number will
depend on definition order in the dts file. This isn't how SPI
bus numbers should be assigned. SPI bus numbers taken from specs,
this is how people know which SPI is which.
>>>> + max-chipselect = <1>;
>>>
>>> I'm not sure how I feel about this in here, I'm thinking it should go.
>>
>> It's board-specific, i.e. how much chips connected to this SPI bus.
>
> It is misnamed then. It should be automatically derived from
> the child nodes, though.
>
>>>> + mmc@01 {
>
> @01 should be @1. Except that it is wrong, since there is
> no "reg" property.
>
>>>> + device_type = "mmc";
>
> No device_type please.
>
>>>> + compatible = "mmc-spi";
>
> Needs to be more specific.
Um.. for example? I can't imagine anything specific for this. ;-)
>>>> + device-id = <1>;
>
> Get rid of this.
>
>>>> + max-speed-hz = <bebc20>; /* 12500000 Hz */
>
> Just max-speed.
>
>>>> + chip-select = <0>;
>
> This should be named "reg". And the parent needs #address-cells
> and #size-cells properties.
>
>>>> + pio-handle = <&mmc1pio>;
>
> What is this for?
To set up output function of GPIO pin for MMC chip select.
And well, I've just looked into par_io_of_config(), and I've found
that pio-handle is mandatory (obviously), and thus let's back to:
>>> we should do this in board code and not the device tree.
>>
>> Well, I've done this initially. But Vitaly hinted that this could
>> be done in the DT instead, which made sense to me - mmc is the child
>> device of SPI bus. Why do you think it shouldn't be in the DT? I'm
>> not arguing, just want understand this.
>
> The hardware should be described in the device tree. This isn't
> the same as simply copying all your Linux code into it ;-)
Ugh. SD/MMC slot is the hardware, isn't it? It have wired SPI pins,
and chip select pin. To set up this pin, I need mmc node, which means
that I can't completely move mmc definitions to the board file, as
suggested by Kumar Gala.
Advices?
> Segher
Thanks!
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH 2/2] [POWERPC] MPC8349E-mITX: use platform IDE driver for CF interface
From: Sergei Shtylyov @ 2007-08-01 13:11 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: linux-ide, linuxppc-dev, linux-kernel
In-Reply-To: <a414f3b506b7802a717e6e2c08befd1e@kernel.crashing.org>
Hello.
Segher Boessenkool wrote:
>>>> + ide@f0000000 {
>>>> + compatible = "mmio-ide";
>>>> + device_type = "ide";
>>> Why not "ata"?
> The hardware is called (E)IDE, the protocol is called ATA.
Sorry for not denouncing this earlier. :-)
ATA is the name of ANSI standard describing IDE.
> Or that's what I was told --
Re-check your sources. ;-)
> I think there's some historic revisionism involved, too.
IDE was probably an initial name of the infamous disk hardware/protocol
later standardized as ATA, EIDE (being more of a trademark) more or less
equals to ATA-2.
>> Also, what mmio-ide in the compat properly means in the context of
>> ide_platform which is able to handle both port and memory mapped IDE.
>> I think
>> we must get rid with this crap, and since this IDE register mapping is
>> pretty
>> much board specific, call it something like "mpc8349emitx-ide" instead.
> "mmio-ide" simply is not specific enough. The device_type
Yes.
> should go, too.
> If this IDE interface is board-specific, thee "compatible"
It's "thy", not "thee". ;-)
> property should include the board vendor name and board
> name. Oh, that's what "emitx" tries to do -- it could be
> a bit clearer perhaps ;-)
Yeah, I forgot about the vondor's "fsl," prefix.
> Segher
MBR, Sergei
^ permalink raw reply
* Re: Generic clk.h wrappers? [Was: Re: [PATCH 1/3] powerpc clk.h interface for platforms]
From: Christoph Hellwig @ 2007-08-01 12:57 UTC (permalink / raw)
To: Domen Puncer
Cc: David Brownell, linuxppc-dev, Christoph Hellwig, Russell King,
linux-mips
In-Reply-To: <20070801072807.GL4529@moe.telargo.com>
On Wed, Aug 01, 2007 at 09:28:07AM +0200, Domen Puncer wrote:
> > 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
It seems like arm really wants this optimized to the last cycle
and no abstraction inbetween so we're probably stuck with the status
quo. I'm pretty sure this will get too messy sooner and later and
people will clean the mess up, but due to the political issues I
don't think it's fair to put that burden on you just for submitting
the powerpc implementation.
So, please leave the patch as-is.
^ permalink raw reply
* Re: [PATCH] lite5200b: flash definition in dts
From: Grant Likely @ 2007-08-01 12:41 UTC (permalink / raw)
To: Domen Puncer; +Cc: linuxppc-embedded
In-Reply-To: <20070801065203.GK4529@moe.telargo.com>
On 8/1/07, Domen Puncer <domen.puncer@telargo.com> wrote:
> 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>;
I don't think this is the right approach. I think the SoC node is
intended for describing the on-chip devices, and the ranges property
reflects that. Shouldn't flash nodes be up 1 level?
Cheers,
g.
> 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";
> + };
> };
> };
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* 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
* 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
* 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: 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
* 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: [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: [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 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: 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 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: [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: 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
* [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
* [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 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
* 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
* 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: [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
* 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
* [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
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