* PowerPC Cross Compiler's Arch doesnt match
From: Jeff Parent @ 2008-01-08 21:39 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 2629 bytes --]
I'm building a linux distro for work, that runs on embedded systems with
either and ARM 9 or a PowerPC 603. I've had great luck building a cross
compiler w/ crosstools and using them in the compiler jail created by
Scratchbox. Now I am working on porting all my work to the PowerPC. When I
build the cross compilers I have selected GCC-4.0.1 and GLIBC-2.3.5 for both
setups. I create my jail in Scratchbox for the PowerPC and try compiling
any of the GNU applications and when running the configure script I get:
<./configure for sed-4.1.5>
checking build system type... config/config.guess: unable to guess system
type
This script, last modified 2008-01-08, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
If the version you run (./config.guess.old) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = 2008-01-08
uname -m = powerpc
uname -r = 2.6.18-5-686
uname -s = Linux
uname -v = #1 SMP Fri Jun 1 00:47:00 UTC 2007
/usr/bin/uname -p =
/bin/uname -X =
hostinfo =
/bin/universe =
/usr/bin/arch -k = powerpc
/bin/arch = powerpc
/usr/bin/oslevel =
/usr/convex/getsysinfo =
UNAME_MACHINE = powerpc
UNAME_RELEASE = 2.6.18-5-686
UNAME_SYSTEM = Linux
UNAME_VERSION = #1 SMP Fri Jun 1 00:47:00 UTC 2007
configure: error: cannot guess build type; you must specify one
[sbox-PPC: ~/devel/packages/sed/sed-4.1.5] >
So I looked into configure.guess and I find:
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
<A bunch of Case Statements>
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;;
<More Case Statements.>
However I do not see a case where the UNAME_MACHINE is set to powerpc, other
than for the Machten. Is there something I did wrong when creating my
cross-compiler?
--
------------------------------------------------------------------
Jeff Parent
Computer Engineer
[-- Attachment #2: Type: text/html, Size: 3681 bytes --]
^ permalink raw reply
* Generic desktop/server/laptop lable is confusing [Was Re: [PATCH 3/7] Basic Freescale MPC512x support]
From: John Rigby @ 2008-01-08 20:37 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Scott Wood
In-Reply-To: <20080108192531.GB5296@loki.buserror.net>
>
> It may work, but it pulls in code like prom_init.c that is not needed on
> non-OF boards. It's also quite confusing to have an embedded board's
> checkbox only show up when you say yes to "Generic desktop/server/laptop".
>
I have to agree with this, I have been confused by this myself.
Perhaps the prompt should be changed to something less
confusing?
> -Scott
>
>
^ permalink raw reply
* [RFC] Xilinx: lltemac: use uboot bsp generated device tree style.
From: Stephen Neuendorffer @ 2008-01-08 21:18 UTC (permalink / raw)
To: linuxppc-dev, grant.likely
This driver is not in mainline, however since it is by far the most complex driver we have in terms of interacting with the device tree, I wouldn't mind some feedback. The complexity comes from the fact that the driver is capable of being connected through two different control interfaces. Previously, this information was all incoded in the device tree for the ll-temac, but now (to better reflect the actual hardware) it is split across two nodes with a link.
The xparameters for the lltemac not only includes information about
the lltemac parameters, but also the ip that the lltemac is connected
to, (usually either an ll_fifo or the dma port of the mpmc). Since
we'd like the device tree to reflect the actual hardware, the code for
querying device trees has to traverse the device tree to discover this
information and pass it to the driver.
The expected device tree structure is something like:
TriMode_MAC_MII: xps-ll-temac@81c00000 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,compound";
ethernet@81c00000 {
compatible = "xlnx,xps-ll-temac-1.00.b";
device_type = "network";
interrupt-parent = <&xps_intc_0>;
interrupts = < 1 2 >;
llink-connected = <&TriMode_MAC_MII_fifo>;
local-mac-address = [ 02 00 00 00 00 01 ];
reg = < 81c00000 40 >;
xlnx,bus2core-clk-ratio = <1>;
xlnx,phy-type = <0>;
xlnx,phyaddr = <1>;
xlnx,rxcsum = <0>;
xlnx,rxfifo = <1000>;
xlnx,temac-type = <1>;
xlnx,txcsum = <0>;
xlnx,txfifo = <1000>;
} ;
} ;
TriMode_MAC_MII_fifo: xps-ll-fifo@81a00000 {
compatible = "xlnx,xps-ll-fifo-1.00.a";
interrupt-parent = <&xps_intc_0>;
interrupts = < 0 2 >;
reg = < 81a00000 10000 >;
} ;
or
TriMode_MAC_MII: xps-ll-temac@81c00000 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,compound";
ethernet@81c00000 {
compatible = "xlnx,xps-ll-temac-1.00.b";
device_type = "network";
interrupt-parent = <&xps_intc_0>;
interrupts = < 2 2 >;
llink-connected = <&PIM2>;
local-mac-address = [ 00 00 00 00 00 00 ];
reg = < 81c00000 40 >;
xlnx,bus2core-clk-ratio = <1>;
xlnx,phy-type = <0>;
xlnx,phyaddr = <1>;
xlnx,rxcsum = <0>;
xlnx,rxfifo = <1000>;
xlnx,temac-type = <1>;
xlnx,txcsum = <0>;
xlnx,txfifo = <1000>;
} ;
} ;
mpmc@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,mpmc-3.00.b";
PIM2: sdma@84600100 {
compatible = "xlnx,ll-dma-1.00.a";
interrupt-parent = <&xps_intc_0>;
interrupts = < 1 2 0 2 >;
reg = < 84600100 80 >;
} ;
} ;
---
drivers/net/xilinx_lltemac/xlltemac_main.c | 88 ++++++++++++++++++++++++++--
1 files changed, 83 insertions(+), 5 deletions(-)
diff --git a/drivers/net/xilinx_lltemac/xlltemac_main.c b/drivers/net/xilinx_lltemac/xlltemac_main.c
index 420bd7e..758b1a1 100644
--- a/drivers/net/xilinx_lltemac/xlltemac_main.c
+++ b/drivers/net/xilinx_lltemac/xlltemac_main.c
@@ -3251,10 +3251,22 @@ static u32 get_u32(struct of_device *ofdev, const char *s) {
}
}
+static struct of_device_id xtenet_fifo_of_match[] = {
+ { .compatible = "xlnx,xps-ll-fifo-1.00.a", },
+ { /* end of list */ },
+};
+
+static struct of_device_id xtenet_sdma_of_match[] = {
+ { .compatible = "xlnx,ll-dma-1.00.a", },
+ { /* end of list */ },
+};
+
static int __devinit xtenet_of_probe(struct of_device *ofdev, const struct of_device_id *match)
{
struct resource r_irq_struct;
struct resource r_mem_struct;
+ struct resource r_connected_mem_struct;
+ struct resource r_connected_irq_struct;
struct xlltemac_platform_data pdata_struct;
struct resource *r_irq = &r_irq_struct; /* Interrupt resources */
@@ -3262,6 +3274,8 @@ static int __devinit xtenet_of_probe(struct of_device *ofdev, const struct of_de
struct xlltemac_platform_data *pdata = &pdata_struct;
void *mac_address;
int rc = 0;
+ const phandle *llink_connected_handle;
+ struct device_node *llink_connected_node;
printk(KERN_INFO "Device Tree Probing \'%s\'\n",
ofdev->node->name);
@@ -3283,11 +3297,74 @@ static int __devinit xtenet_of_probe(struct of_device *ofdev, const struct of_de
pdata_struct.tx_csum = get_u32(ofdev, "xlnx,txcsum");
pdata_struct.rx_csum = get_u32(ofdev, "xlnx,rxcsum");
pdata_struct.phy_type = get_u32(ofdev, "xlnx,phy-type");
- pdata_struct.ll_dev_type = get_u32(ofdev, "xlnx,llink-connected-type");
- pdata_struct.ll_dev_baseaddress = get_u32(ofdev, "xlnx,llink-connected-baseaddr");
- pdata_struct.ll_dev_dma_rx_irq = get_u32(ofdev, "xlnx,llink-connected-dmarx-intr");
- pdata_struct.ll_dev_dma_tx_irq = get_u32(ofdev, "xlnx,llink-connected-dmatx-intr");
- pdata_struct.ll_dev_fifo_irq = get_u32(ofdev, "xlnx,llink-connected-fifo-intr");
+ llink_connected_handle =
+ of_get_property(ofdev->node, "llink-connected", NULL);
+ if(!llink_connected_handle) {
+ dev_warn(&ofdev->dev, "no Locallink connection found.\n");
+ return rc;
+ }
+
+ llink_connected_node =
+ of_find_node_by_phandle(*llink_connected_handle);
+
+ rc = of_address_to_resource(
+ llink_connected_node,
+ 0,
+ &r_connected_mem_struct);
+ if(rc) {
+ dev_warn(&ofdev->dev, "invalid address\n");
+ return rc;
+ }
+
+ pdata_struct.ll_dev_baseaddress = r_connected_mem_struct.start;
+ /** Get the right information from whatever the locallink is
+ connected to. */
+ if(of_match_node(xtenet_fifo_of_match, llink_connected_node)) {
+ /** Connected to a fifo. */
+ pdata_struct.ll_dev_type = XPAR_LL_FIFO;
+ pdata_struct.ll_dev_dma_rx_irq = NO_IRQ;
+ pdata_struct.ll_dev_dma_tx_irq = NO_IRQ;
+
+ rc = of_irq_to_resource(
+ llink_connected_node,
+ 0,
+ &r_connected_irq_struct);
+ if(rc == NO_IRQ) {
+ dev_warn(&ofdev->dev, "no IRQ found.\n");
+ return rc;
+ }
+ pdata_struct.ll_dev_fifo_irq = r_connected_irq_struct.start;
+ } else if(of_match_node(xtenet_sdma_of_match, llink_connected_node)) {
+ /** Connected to a dma port. */
+ pdata_struct.ll_dev_type = XPAR_LL_DMA;
+
+ rc = of_irq_to_resource(
+ llink_connected_node,
+ 0,
+ &r_connected_irq_struct);
+ if(rc == NO_IRQ) {
+ dev_warn(&ofdev->dev, "First IRQ not found.\n");
+ return rc;
+ }
+ pdata_struct.ll_dev_dma_rx_irq = r_connected_irq_struct.start;
+
+ rc = of_irq_to_resource(
+ llink_connected_node,
+ 1,
+ &r_connected_irq_struct);
+ if(rc == NO_IRQ) {
+ dev_warn(&ofdev->dev, "Second IRQ not found.\n");
+ return rc;
+ }
+ pdata_struct.ll_dev_dma_tx_irq = r_connected_irq_struct.start;
+
+ pdata_struct.ll_dev_fifo_irq = NO_IRQ;
+ } else {
+ dev_warn(&ofdev->dev, "Locallink connection not matched.\n");
+ return rc;
+ }
+
+ of_node_put(llink_connected_node);
mac_address = of_get_mac_address(ofdev->node);
if(mac_address) {
memcpy(pdata_struct.mac_addr, mac_address, 6);
@@ -3305,6 +3382,7 @@ static int __devexit xtenet_of_remove(struct of_device *dev)
static struct of_device_id xtenet_of_match[] = {
{ .compatible = "xlnx,xps-ll-temac-1.00.a", },
+ { .compatible = "xlnx,xps-ll-temac-1.00.b", },
{ /* end of list */ },
};
--
1.5.3.4-dirty
^ permalink raw reply related
* Re: [PATCH] Miscellaneous for Taco
From: Benjamin Herrenschmidt @ 2008-01-08 20:41 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev, Sean MacLennan
In-Reply-To: <200801082023.11475.sr@denx.de>
On Tue, 2008-01-08 at 20:23 +0100, Stefan Roese wrote:
> On Tuesday 08 January 2008, Sean MacLennan wrote:
> > How about just 44x?
> >
> > Cheers,
> > Sean
> >
> > diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
> > index 7580aa5..682deae 100644
> > --- a/drivers/usb/Kconfig
> > +++ b/drivers/usb/Kconfig
> > @@ -39,6 +39,7 @@ config USB_ARCH_HAS_OHCI
> > # PPC:
> > default y if STB03xxx
> > default y if PPC_MPC52xx
> > + default y if 44x
>
> No. Not all 44x have OHCI built in. Currently 440EP, 440EPx and 405EZ have it.
> But since your patch only touches 440EP, you should just enable OHCI for
> exactly this platform.
Note that the above Kconfig stuff just enabling the choice to enable
OHCI, it's not enabling build of OHCI per-se.
Ben.
^ permalink raw reply
* Beta Release for MPC5121e Linux BSP
From: james.mertz @ 2008-01-08 20:37 UTC (permalink / raw)
To: Linuxppc-embedded
Just came across this post.
Here=E2=80=99s the link to the beta linux BSP for MPC5121e:
http://www.freescale.com/webapp/sps/site/overview.jsp?code=3DCW_BSP_PPC&fsr=
ch=3D1
James Mertz
Freescale Semiconductor
^ permalink raw reply
* Re: [PATCH] Hwmon for Taco
From: Josh Boyer @ 2008-01-08 20:20 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev, Sean MacLennan
In-Reply-To: <20080108201314.GA29127@localhost.localdomain>
On Tue, 8 Jan 2008 23:13:14 +0300
Anton Vorontsov <avorontsov@ru.mvista.com> wrote:
[snip mostly valid stuff]
> Yes, it's common sense and politeness to keep Signed-off-by lines
> intact (and the order of these lines), but it's not strict
> requirement. "Based on the patch from ..." is the equivalent of
> this politeness.
You took my statement slightly out of context (or I did a lousy job of
explaining for this case).
Basically, I _know_ that Stefan has S-o-b lines in his tree. I _know_
he did most of the work, and I _know_ he's fairly agreeable to adding
his S-o-b line to patches he isn't pushing himself.
So I was simply asking if Sean could get Stefan to add his S-o-b as
well. At the very least a "From:" would be warranted if Sean hasn't
change any code. Then authorship would still be attributed to Stefan.
Yeah, it might be "politeness" but there's really no reason to be
impolite when all the parties involved are in the same discussion...
josh
^ permalink raw reply
* Re: [PATCH 7/7] Add MPC512x PSC serial driver
From: Grant Likely @ 2008-01-08 20:16 UTC (permalink / raw)
To: John Rigby; +Cc: linuxppc-dev
In-Reply-To: <4783B74D.1040501@freescale.com>
On 1/8/08, John Rigby <jrigby@freescale.com> wrote:
> Thanks for the quick feedback Grant.
>
> Grant Likely wrote:
> > Exactly *how* different is the 5121 PSC from the 5200 PSC? If it is
> > really different, then it makes sense to clone.
> The fifo handling has completely changed that is the main difference.
> > In fact; I'd
> > duplicate the mpc52xx_psc.h file also to avoid any crossover.
> >
> I agree.
>
> > However, if the differences are manegable, I'd rather see a single
> > driver that can drive either type of PSC. In fact, can you post a
> > diff between this driver and the original PSC driver?
> >
> I simple diff will mostly show the removal of arch/ppc support so
> won't be much help. How about I do take a pass at a new version
> that supports 52xx and 512x but only for arch/powerpc?
I'm cool with that. arch/powerpc support has *far* surpassed arch/ppc
for the 5200, so it may be time to just let the old stuff die, even if
it is a little ahead of schedule.
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH 7/7] Add MPC512x PSC serial driver
From: John Rigby @ 2008-01-08 17:47 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40801080932g71fb6215wc3d6df107bec7238@mail.gmail.com>
Thanks for the quick feedback Grant.
Grant Likely wrote:
> Exactly *how* different is the 5121 PSC from the 5200 PSC? If it is
> really different, then it makes sense to clone.
The fifo handling has completely changed that is the main difference.
> In fact; I'd
> duplicate the mpc52xx_psc.h file also to avoid any crossover.
>
I agree.
> However, if the differences are manegable, I'd rather see a single
> driver that can drive either type of PSC. In fact, can you post a
> diff between this driver and the original PSC driver?
>
I simple diff will mostly show the removal of arch/ppc support so
won't be much help. How about I do take a pass at a new version
that supports 52xx and 512x but only for arch/powerpc?
^ permalink raw reply
* Re: [PATCH] Hwmon for Taco
From: Anton Vorontsov @ 2008-01-08 20:13 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev, Sean MacLennan
In-Reply-To: <20080108130251.7ae351c7@zod.rchland.ibm.com>
On Tue, Jan 08, 2008 at 01:02:51PM -0600, Josh Boyer wrote:
> On Tue, 08 Jan 2008 13:30:00 -0500
> Sean MacLennan <smaclennan@pikatech.com> wrote:
>
> > Ok, here is the ad7414 only. taco-dtm is no more!
>
> Cool. Couple more things.
>
> 1) This should go through the hwmon maintainer. Send it to him.
> (CC'ing this list is of course fine.)
>
> 2) You always need the Signed-off-by: for each patch you send
>
> 3) If you didn't author the code (this seems to come from Stefan), then
> you need the Signed-off-by from the original author.
Nope. Signed-off-by means completely different thing. It isn't
copyright, it isn't authorship. It's an information (for the history)
whom to bother if code appeared to be either:
a) broken;
b) stolen from the closed source product;
c) patented (where applicable).
There are Copyright (c) and Author: strings in the files for the
credits. If original patch had these strings, then yes, you must
keep them.
But no one needs author's Signed-off-by, it having zero information
you're hinting about. More than that, there were precedents when
author insisted on removing his Signed-off-by from the modified
patch (when S-o-b used as a permit into someone's tree).
Btw, kernel.org is distributing linux tarballs without changelogs,
thus without Signed-off-by lines. Nobody complains.
Yes, it's common sense and politeness to keep Signed-off-by lines
intact (and the order of these lines), but it's not strict
requirement. "Based on the patch from ..." is the equivalent of
this politeness.
> You're getting there :) These are all "newbie" type mistakes so keep
> plugging away.
>
> josh
Good luck,
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* trying to boot linux on MVME5100
From: Phil Howard @ 2008-01-08 19:54 UTC (permalink / raw)
To: linuxppc-embedded
Kernel version is 2.6.23.12 compiled with gcc 4.2.1.
I have an MVME5100 board with PPC6-Bug firmware on it. I'm trying to get a
Linux kernel loaded. The first problem I see is that even though I configure
the load and execute addresses (at 00400000 or 00400004) via NIOT, doing NBO
or NBH still loads things at 00005000. The time is set and the network is
working as I can see the kernel image there in memory at 00005000. When I do
NIOT a 2nd time (actually have done it a few times) it shows by default what
I set it to, even though I have power cycled in between. So it is definitely
saved to NVRAM. But it just seems to not be using it. Here are my latest
settings:
PPC6-Bug>niot
Controller LUN =00?
Device LUN =00?
Node Control Memory Address =03F1D850?
Client IP Address =172.30.1.3?
Server IP Address =172.30.1.1?
Subnet IP Address Mask =255.255.255.0?
Broadcast IP Address =172.30.1.255?
Gateway IP Address =172.30.1.2?
Boot File Name ("NULL" for None) =mvme5100/kernel.img?
Argument File Name ("NULL" for None) =?
Boot File Load Address =003F0000?
Boot File Execution Address =00400004?
Boot File Execution Delay =00000000?
Boot File Length =00000000?
Boot File Byte Offset =00000000?
BOOTP/RARP Request Retry =00?
TFTP/ARP Request Retry =00?
Trace Character Buffer Address =00000000?
BOOTP/RARP Request Control: Always/When-Needed (A/W)=W?
BOOTP/RARP Reply Update Control: Yes/No (Y/N) =Y?
PPC6-Bug>
The other issue I have is that this is a zImage kernel, and it does not
appear to be the right format for PPC6-Bug. The first word of the text
section is not an executable instruction. From the second word it looks
fine up to about 480 bytes into it, then at 512 bytes in there are more
valid CPU instructions. Maybe some padding alignment? So what is the
right entry point address? And where should the kernel really be loaded
if zImage is right?
PPC6-Bug>nbh
Network Booting from: I82559, Controller 0, Device 0
Device Name: /pci@fe000000/pci8086,1209@e,0:0,0
Loading: mvme5100/kernel.img
Client IP Address = 172.30.1.3
Server IP Address = 172.30.1.1
Gateway IP Address = 172.30.1.2
Subnet IP Address Mask = 255.255.255.0
Boot File Name = mvme5100/kernel.img
Argument File Name =
Network Boot File load in progress... To abort hit <BREAK>
Bytes Received =&1678856, Bytes Loaded =&1678856
Bytes/Second =&839428, Elapsed Time =2 Second(s)
Residual-Data Located at: $03FC26DC
IP =00005000 MSR =00003040 CR =20000004 FPSCR =00000000
R0 =00000000 R1 =03EFFE20 R2 =00000000 R3 =03FC26DC
R4 =00005000 R5 =00000000 R6 =00405030 R7 =00000000
R8 =03EFFE34 R9 =00000000 R10 =00000001 R11 =03EFFE7C
R12 =00000000 R13 =00000000 R14 =00000000 R15 =00000000
R16 =00000000 R17 =00000000 R18 =00000000 R19 =00000000
R20 =00000000 R21 =00000000 R22 =00000000 R23 =00000000
R24 =00000000 R25 =00000000 R26 =00000000 R27 =00000000
R28 =00000000 R29 =00000001 R30 =0040E228 R31 =00000001
SPR0 =00000000 SPR1 =00000000 SPR8 =00402AA0 SPR9 =00000000
00005000 7F454C46 WORD $7F454C46
PPC6-Bug>md 5000 50ff
00005000 7F454C46 01020100 00000000 00000000 .ELF............
00005010 00020014 00000001 00400200 00000034 .........@.....4
00005020 00199CA0 00008000 00340020 00040028 .........4. ...(
00005030 00090008 00000001 00010000 00400000 .............@..
00005040 00400000 00189AB8 00195C64 00000007 .@........\d....
00005050 00010000 6474E551 00000000 00000000 ....dt.Q........
00005060 00000000 00000000 00000000 00000007 ................
00005070 00000004 00000004 00000000 00000000 ................
00005080 00000000 00000000 00000000 00000000 ................
00005090 00000000 00000004 00000000 00000000 ................
000050A0 00000000 00000000 00000000 00000000 ................
000050B0 00000000 00000000 00000000 00000000 ................
000050C0 00000000 00000000 00000000 00000000 ................
000050D0 00000000 00000000 00000000 00000000 ................
000050E0 00000000 00000000 00000000 00000000 ................
000050F0 00000000 00000000 00000000 00000000 ................
PPC6-Bug>ds 15000 :20
00015000 0000E0F4 WORD $0000E0F4
00015004 9421FFF0 STWU R1,$FFFFFFF0(R1) ($03EFFE10)
00015008 7C0802A6 MFSPR R0,8
0001500C 429F0005 BCL 20,31,$00015010
00015010 BFC10008 STMW R30,$8(R1) ($03EFFE28)
00015014 7FC802A6 MFSPR R30,8
00015018 90010014 STW R0,$14(R1) ($03EFFE34)
0001501C 801EFFF0 LWZ R0,$FFFFFFF0(R30) ($0040E218)
00015020 7FC0F214 ADD R30,R0,R30
00015024 88030004 LBZ R0,$4(R3) ($03FC26E0)
00015028 2F800002 CMPI CRF7,0,R0,$2
0001502C 409E0024 BC 4,30,$00015050
00015030 817E8000 LWZ R11,$FFFF8000(R30) ($00406228)
00015034 3C00013F ADDIS R0,R0,$13F
00015038 6000FFFF ORI R0,R0,$FFFF
0001503C 812B0000 LWZ R9,$0(R11) ($03EFFE7C)
00015040 7F890040 CMPL CRF7,0,R9,R0
00015044 419D000C BC 12,29,$00015050
00015048 3C000140 ADDIS R0,R0,$140
0001504C 900B0000 STW R0,$0(R11) ($03EFFE7C)
00015050 80010014 LWZ R0,$14(R1) ($03EFFE34)
00015054 BBC10008 LMW R30,$8(R1) ($03EFFE28)
00015058 38210010 ADDI R1,R1,$10
0001505C 7C0803A6 MTSPR 8,R0
00015060 4E800020 BCLR 20,0
00015064 0000E090 WORD $0000E090
00015068 9421FFE0 STWU R1,$FFFFFFE0(R1) ($03EFFE00)
0001506C 7C0802A6 MFSPR R0,8
00015070 429F0005 BCL 20,31,$00015074
00015074 BF810010 STMW R28,$10(R1) ($03EFFE30)
00015078 7FC802A6 MFSPR R30,8
0001507C 90010024 STW R0,$24(R1) ($03EFFE44)
PPC6-Bug>
Executing at 00015004 hits a branch to 0 in just a few instructions.
Any ideas what are the proper steps with this board?
--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
^ permalink raw reply
* Re: [PATCH 0/7] [POWERPC] Xilinx: Device Tree updates for xilinx.
From: Grant Likely @ 2008-01-08 19:42 UTC (permalink / raw)
To: Stephen Neuendorffer; +Cc: linuxppc-dev, simekm2
In-Reply-To: <20080108193511.1A5A359005C@mail222-sin.bigfish.com>
On 1/8/08, Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> wrote:
> These patches synchronize all the in-kernel drivers to use the compatible names generated by the UBoot BSP generator. (at git://git.xilinx.com/gen-mhs-devtree.git)
>
> This set of patches should all be ready for 2.6.25: I've removed the ones that weren't and cleaned up the remainder. In particular, there was a nasty code/data section mismatch in the uartlite that showed up in the microblaze. I've also added a patch for the uartlite names in the boot serial that I missed the first time around and a patch that fixes some other section mismatch warnings in the uartlite.
>
> For reference, below is the device tree for a Virtex2Pro design. Except for some small changes mentioned before, this is entirely automatically generated from the EDK design.
Woo! Good looking device tree. :-)
I'll review your patches this afternoon.
Cheers,
g.
>
> Steve
>
> / {
> mem_size_cells: #address-cells = <1>;
> #size-cells = <1>;
> compatible = "xlnx,virtex";
> model = "testing";
> DDR_256MB_32MX64_rank1_row13_col10_cl2_5: memory@0 {
> device_type = "memory";
> reg = < 0 memsize:10000000 >;
> } ;
> chosen {
> bootargs = "root=/dev/nfs nfsroot=172.19.221.221:/exports/xup/ydl41 ip=dhcp console=ttyUL0";
> } ;
> cpus {
> #address-cells = <1>;
> #cpus = <1>;
> #size-cells = <0>;
> PowerPC,405@0 {
> clock-frequency = <11e1a300>;
> d-cache-line-size = <20>;
> d-cache-size = <4000>;
> device_type = "cpu";
> i-cache-line-size = <20>;
> i-cache-size = <4000>;
> reg = <0>;
> timebase: timebase-frequency = <11e1a300>;
> xlnx,dcr-resync = <0>;
> xlnx,deterministic-mult = <0>;
> xlnx,disable-operand-forwarding = <1>;
> xlnx,mmu-enable = <1>;
> } ;
> } ;
> plb_v34 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "xlnx,plb-v34-1.02.a";
> ranges ;
> Ethernet_MAC: ethernet@80400000 {
> compatible = "xlnx,plb-ethernet-1.01.a";
> device_type = "network";
> interrupt-parent = <&opb_intc_0>;
> interrupts = < 2 0 >;
> local-mac-address = [ 00 00 00 00 00 00 ];
> reg = < 80400000 10000 >;
> xlnx,dev-blk-id = <0>;
> xlnx,dev-mir-enable = <1>;
> xlnx,dma-intr-coalesce = <1>;
> xlnx,dma-present = <1>;
> xlnx,err-count-exist = <1>;
> xlnx,fcs-insert-exist = <1>;
> xlnx,half-duplex-exist = <1>;
> xlnx,include-dev-pencoder = <1>;
> xlnx,ipif-fifo-depth = <8000>;
> xlnx,mac-fifo-depth = <40>;
> xlnx,mii-exist = <1>;
> xlnx,miim-clkdvd = <13>;
> xlnx,pad-insert-exist = <1>;
> xlnx,reset-present = <1>;
> xlnx,source-addr-insert-exist = <1>;
> } ;
> opb_v20 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "xlnx,opb-v20-1.10.c";
> ranges ;
> Audio_Codec: opb-ac97@7d400000 {
> compatible = "xlnx,opb-ac97-2.00.a";
> interrupt-parent = <&opb_intc_0>;
> interrupts = < 1 0 >;
> reg = < 7d400000 10000 >;
> xlnx,intr-level = <1>;
> xlnx,playback = <1>;
> xlnx,record = <1>;
> xlnx,use-bram = <1>;
> } ;
> DIPSWs_4Bit: opb-gpio@40020000 {
> compatible = "xlnx,opb-gpio-3.01.b";
> reg = < 40020000 10000 >;
> xlnx,all-inputs = <1>;
> xlnx,all-inputs-2 = <0>;
> xlnx,dout-default = <0>;
> xlnx,dout-default-2 = <0>;
> xlnx,gpio-width = <4>;
> xlnx,interrupt-present = <0>;
> xlnx,is-bidir = <1>;
> xlnx,is-bidir-2 = <1>;
> xlnx,is-dual = <0>;
> xlnx,tri-default = <ffffffff>;
> xlnx,tri-default-2 = <ffffffff>;
> xlnx,user-id-code = <3>;
> } ;
> LEDs_4Bit: opb-gpio@40000000 {
> compatible = "xlnx,opb-gpio-3.01.b";
> reg = < 40000000 10000 >;
> xlnx,all-inputs = <0>;
> xlnx,all-inputs-2 = <0>;
> xlnx,dout-default = <0>;
> xlnx,dout-default-2 = <0>;
> xlnx,gpio-width = <4>;
> xlnx,interrupt-present = <0>;
> xlnx,is-bidir = <0>;
> xlnx,is-bidir-2 = <1>;
> xlnx,is-dual = <0>;
> xlnx,tri-default = <ffffffff>;
> xlnx,tri-default-2 = <ffffffff>;
> xlnx,user-id-code = <3>;
> } ;
> PS2_Ports: opb-ps2-dual-ref@7a400000 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "xlnx,compound";
> ranges = < 0 7a400000 10000 >;
> opb-ps2-dual-ref@0 {
> compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
> interrupt-parent = <&opb_intc_0>;
> interrupts = < 6 0 >;
> reg = < 0 40 >;
> } ;
> opb-ps2-dual-ref@1000 {
> compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
> interrupt-parent = <&opb_intc_0>;
> interrupts = < 5 0 >;
> reg = < 1000 40 >;
> } ;
> } ;
> PushButtons_5Bit: opb-gpio@40040000 {
> compatible = "xlnx,opb-gpio-3.01.b";
> reg = < 40040000 10000 >;
> xlnx,all-inputs = <1>;
> xlnx,all-inputs-2 = <0>;
> xlnx,dout-default = <0>;
> xlnx,dout-default-2 = <0>;
> xlnx,gpio-width = <5>;
> xlnx,interrupt-present = <0>;
> xlnx,is-bidir = <1>;
> xlnx,is-bidir-2 = <1>;
> xlnx,is-dual = <0>;
> xlnx,tri-default = <ffffffff>;
> xlnx,tri-default-2 = <ffffffff>;
> xlnx,user-id-code = <3>;
> } ;
> RS232_Uart_1: serial@40400000 {
> compatible = "xlnx,opb-uartlite-1.00.b";
> device_type = "serial";
> interrupt-parent = <&opb_intc_0>;
> interrupts = < 4 0 >;
> port-number = <0>;
> reg = < 40400000 10000 >;
> xlnx,baudrate = <2580>;
> xlnx,clk-freq = <5f5e100>;
> xlnx,data-bits = <8>;
> xlnx,odd-parity = <0>;
> xlnx,use-parity = <0>;
> } ;
> SysACE_CompactFlash: opb-sysace@41800000 {
> compatible = "xlnx,opb-sysace-1.00.c";
> interrupt-parent = <&opb_intc_0>;
> interrupts = < 3 0 >;
> reg = < 41800000 10000 >;
> xlnx,mem-width = <10>;
> } ;
> dcr_v29 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "xlnx,dcr-v29-1.00.a";
> ranges = < 0 40700000 1000 >;
> VGA_FrameBuffer: plb-tft-cntlr-ref@200 {
> compatible = "xlnx,plb-tft-cntlr-ref-1.00.a";
> reg = < 200 8 >;
> xlnx,default-tft-base-addr = <7f>;
> xlnx,dps-init = <1>;
> xlnx,on-init = <1>;
> xlnx,pixclk-is-busclk-divby4 = <1>;
> } ;
> } ;
> onewire_0: opb-onewire@7a200000 {
> compatible = "xlnx,opb-onewire-1.00.a";
> reg = < 7a200000 10000 >;
> xlnx,add-pullup = "true";
> xlnx,checkcrc = "true";
> xlnx,clk-div = <f>;
> } ;
> opb_hwicap_0: opb-hwicap@41300000 {
> compatible = "xlnx,opb-hwicap-1.00.b";
> reg = < 41300000 10000 >;
> } ;
> opb_intc_0: interrupt-controller@41200000 {
> #interrupt-cells = <2>;
> compatible = "xlnx,opb-intc-1.00.c";
> interrupt-controller ;
> reg = < 41200000 10000 >;
> xlnx,num-intr-inputs = <7>;
> } ;
> opb_timer_0: opb-timer@40800000 {
> compatible = "xlnx,opb-timer-1.00.b";
> interrupt-parent = <&opb_intc_0>;
> interrupts = < 0 0 >;
> reg = < 40800000 100 >;
> xlnx,count-width = <20>;
> xlnx,gen0-assert = <1>;
> xlnx,gen1-assert = <1>;
> xlnx,one-timer-only = <0>;
> xlnx,trig0-assert = <1>;
> xlnx,trig1-assert = <1>;
> } ;
> } ;
> } ;
> } ;
>
>
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH] i2c-ibm_iic driver - new patch
From: Stefan Roese @ 2008-01-08 19:33 UTC (permalink / raw)
To: Sean MacLennan; +Cc: Stephen Rothwell, Arnd Bergmann, linuxppc-dev
In-Reply-To: <4783C284.1070400@pikatech.com>
On Tuesday 08 January 2008, Sean MacLennan wrote:
> Let's try again.
Looks good now. Time to send it to the i2c mailing list <i2c@lm-sensors.org>
and the maintainer Jean Delvare <khali@linux-fr.org>. And please keep the
linuxppc-dev list on CC.
Thanks.
Ciao,
Stefan
^ permalink raw reply
* [PATCH 2/7] [POWERPC] Xilinx: update compatible list for interrupt controller
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
In-Reply-To: <1199820909-32341-2-git-send-email-stephen.neuendorffer@xilinx.com>
These values now match what is generated by the uboot BSP generator.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
arch/powerpc/sysdev/xilinx_intc.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/sysdev/xilinx_intc.c b/arch/powerpc/sysdev/xilinx_intc.c
index c2f17cc..ba8eea2 100644
--- a/arch/powerpc/sysdev/xilinx_intc.c
+++ b/arch/powerpc/sysdev/xilinx_intc.c
@@ -135,10 +135,16 @@ void __init xilinx_intc_init_tree(void)
struct device_node *np;
/* find top level interrupt controller */
- for_each_compatible_node(np, NULL, "xilinx,intc") {
+ for_each_compatible_node(np, NULL, "xlnx,opb-intc-1.00.c") {
if (!of_get_property(np, "interrupts", NULL))
break;
}
+ if (!np) {
+ for_each_compatible_node(np, NULL, "xlnx,xps-intc-1.00.a") {
+ if (!of_get_property(np, "interrupts", NULL))
+ break;
+ }
+ }
/* xilinx interrupt controller needs to be top level */
BUG_ON(!np);
--
1.5.3.4-dirty
^ permalink raw reply related
* [PATCH 5/7] [POWERPC] Xilinx: Update booting-without-of.
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
In-Reply-To: <1199820909-32341-5-git-send-email-stephen.neuendorffer@xilinx.com>
This now better describes what the UBoot device tree generator
actually does. In particular:
1) Nodes have a label derived from the device name, and a node name
derived from a generic version of the device type, e.g. 'ethernet',
'serial', etc.
2) Usage of compound nodes (representing more than one device in the
same IP) which actually works. This requires having a valid
compatible node, and all the other things that a bus normally has.
I've chosen 'xlnx,compound' as the bus name to describe these compound
nodes.
In addition, I've clarified some of the language relating to how mhs
nodes should be represent in the device tree.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
Documentation/powerpc/booting-without-of.txt | 56 +++++++++++++++-----------
1 files changed, 33 insertions(+), 23 deletions(-)
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index e9a3cb1..d14e45d 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -2276,7 +2276,7 @@ platforms are moved over to use the flattened-device-tree model.
properties of the device node. In general, device nodes for IP-cores
will take the following form:
- (name)@(base-address) {
+ (name): (generic-name)@(base-address) {
compatible = "xlnx,(ip-core-name)-(HW_VER)"
[, (list of compatible devices), ...];
reg = <(baseaddr) (size)>;
@@ -2286,6 +2286,9 @@ platforms are moved over to use the flattened-device-tree model.
xlnx,(parameter2) = <(int-value)>;
};
+ (generic-name): an open firmware-style name that describes the
+ generic class of device. Preferably, this is one word, such
+ as 'serial' or 'ethernet'.
(ip-core-name): the name of the ip block (given after the BEGIN
directive in system.mhs). Should be in lowercase
and all underscores '_' converted to dashes '-'.
@@ -2294,9 +2297,9 @@ platforms are moved over to use the flattened-device-tree model.
dropped from the parameter name, the name is converted
to lowercase and all underscore '_' characters are
converted to dashes '-'.
- (baseaddr): the C_BASEADDR parameter.
+ (baseaddr): the baseaddr parameter value (often named C_BASEADDR).
(HW_VER): from the HW_VER parameter.
- (size): equals C_HIGHADDR - C_BASEADDR + 1
+ (size): the address range size (often C_HIGHADDR - C_BASEADDR + 1).
Typically, the compatible list will include the exact IP core version
followed by an older IP core version which implements the same
@@ -2326,11 +2329,11 @@ platforms are moved over to use the flattened-device-tree model.
becomes the following device tree node:
- opb-uartlite-0@ec100000 {
+ opb_uartlite_0: serial@ec100000 {
device_type = "serial";
compatible = "xlnx,opb-uartlite-1.00.b";
reg = <ec100000 10000>;
- interrupt-parent = <&opb-intc>;
+ interrupt-parent = <&opb_intc_0>;
interrupts = <1 0>; // got this from the opb_intc parameters
current-speed = <d#115200>; // standard serial device prop
clock-frequency = <d#50000000>; // standard serial device prop
@@ -2339,16 +2342,19 @@ platforms are moved over to use the flattened-device-tree model.
xlnx,use-parity = <0>;
};
- Some IP cores actually implement 2 or more logical devices. In this case,
- the device should still describe the whole IP core with a single node
- and add a child node for each logical device. The ranges property can
- be used to translate from parent IP-core to the registers of each device.
- (Note: this makes the assumption that both logical devices have the same
- bus binding. If this is not true, then separate nodes should be used for
- each logical device). The 'cell-index' property can be used to enumerate
- logical devices within an IP core. For example, the following is the
- system.mhs entry for the dual ps2 controller found on the ml403 reference
- design.
+ Some IP cores actually implement 2 or more logical devices. In
+ this case, the device should still describe the whole IP core with
+ a single node and add a child node for each logical device. The
+ ranges property can be used to translate from parent IP-core to the
+ registers of each device. In addition, the parent node should be
+ compatible with the bus type 'xlnx,compound', and should contain
+ #address-cells and #size-cells, as with any other bus. (Note: this
+ makes the assumption that both logical devices have the same bus
+ binding. If this is not true, then separate nodes should be used
+ for each logical device). The 'cell-index' property can be used to
+ enumerate logical devices within an IP core. For example, the
+ following is the system.mhs entry for the dual ps2 controller found
+ on the ml403 reference design.
BEGIN opb_ps2_dual_ref
PARAMETER INSTANCE = opb_ps2_dual_ref_0
@@ -2370,21 +2376,24 @@ platforms are moved over to use the flattened-device-tree model.
It would result in the following device tree nodes:
- opb_ps2_dual_ref_0@a9000000 {
+ opb_ps2_dual_ref_0: opb-ps2-dual-ref@a9000000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "xlnx,compound";
ranges = <0 a9000000 2000>;
// If this device had extra parameters, then they would
// go here.
ps2@0 {
compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
reg = <0 40>;
- interrupt-parent = <&opb-intc>;
+ interrupt-parent = <&opb_intc_0>;
interrupts = <3 0>;
cell-index = <0>;
};
ps2@1000 {
compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
reg = <1000 40>;
- interrupt-parent = <&opb-intc>;
+ interrupt-parent = <&opb_intc_0>;
interrupts = <3 0>;
cell-index = <0>;
};
@@ -2447,17 +2456,18 @@ platforms are moved over to use the flattened-device-tree model.
Gives this device tree (some properties removed for clarity):
- plb-v34-0 {
+ plb@0 {
#address-cells = <1>;
#size-cells = <1>;
+ compatible = "xlnx,plb-v34-1.02.a";
device_type = "ibm,plb";
ranges; // 1:1 translation
- plb-bram-if-cntrl-0@ffff0000 {
+ plb_bram_if_cntrl_0: bram@ffff0000 {
reg = <ffff0000 10000>;
}
- opb-v20-0 {
+ opb@20000000 {
#address-cells = <1>;
#size-cells = <1>;
ranges = <20000000 20000000 20000000
@@ -2465,11 +2475,11 @@ platforms are moved over to use the flattened-device-tree model.
80000000 80000000 40000000
c0000000 c0000000 20000000>;
- opb-uart16550-0@a0000000 {
+ opb_uart16550_0: serial@a0000000 {
reg = <a00000000 2000>;
};
- opb-intc-0@d1000fc0 {
+ opb_intc_0: interrupt-controller@d1000fc0 {
reg = <d1000fc0 20>;
};
};
--
1.5.3.4-dirty
^ permalink raw reply related
* [PATCH 3/7] [POWERPC] Xilinx: Update compatible to use values generated by BSP generator.
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
In-Reply-To: <1199820909-32341-3-git-send-email-stephen.neuendorffer@xilinx.com>
Mainly, this involves two changes:
1) xilinx->xlnx (recognized standard is to use the stock ticker)
2) In order to have the device tree focus on describing what the
hardware is as exactly as possible, the compatible strings contain the
full IP name and IP version.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
arch/powerpc/platforms/40x/virtex.c | 2 +-
drivers/block/xsysace.c | 4 ++-
drivers/serial/uartlite.c | 43 ++++++++++++++++++++++-------------
drivers/video/xilinxfb.c | 2 +-
4 files changed, 32 insertions(+), 19 deletions(-)
diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
index 14bbc32..859ba1d 100644
--- a/arch/powerpc/platforms/40x/virtex.c
+++ b/arch/powerpc/platforms/40x/virtex.c
@@ -30,7 +30,7 @@ static int __init virtex_probe(void)
{
unsigned long root = of_get_flat_dt_root();
- if (!of_flat_dt_is_compatible(root, "xilinx,virtex"))
+ if (!of_flat_dt_is_compatible(root, "xlnx,virtex"))
return 0;
return 1;
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 82effce..45bc51b 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -1208,7 +1208,9 @@ static int __devexit ace_of_remove(struct of_device *op)
/* Match table for of_platform binding */
static struct of_device_id __devinit ace_of_match[] = {
- { .compatible = "xilinx,xsysace", },
+ { .compatible = "xlnx,opb-sysace-1.00.b", },
+ { .compatible = "xlnx,opb-sysace-1.00.c", },
+ { .compatible = "xlnx,xps-sysace-1.00.a", },
{},
};
MODULE_DEVICE_TABLE(of, ace_of_match);
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 71e4c0a..02c2d89 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -19,10 +19,21 @@
#include <linux/tty.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
+#include <linux/init.h>
#include <asm/io.h>
#if defined(CONFIG_OF)
+#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_platform.h>
+
+/* Match table for of_platform binding */
+static struct of_device_id __devinitdata ulite_of_match[] = {
+ { .type = "serial", .compatible = "xlnx,opb-uartlite-1.00.b", },
+ { .type = "serial", .compatible = "xlnx,xps-uartlite-1.00.a", },
+ {},
+};
+MODULE_DEVICE_TABLE(of, ulite_of_match);
+
#endif
#define ULITE_NAME "ttyUL"
@@ -427,18 +438,25 @@ static inline u32 __init ulite_console_of_find_device(int id)
struct resource res;
const unsigned int *of_id;
int rc;
+ const struct of_device_id *matches = ulite_of_match;
+
+ while (matches->compatible[0]) {
+ for_each_compatible_node(np, NULL, matches->compatible) {
+ if (!of_match_node(matches, np))
+ continue;
- for_each_compatible_node(np, NULL, "xilinx,uartlite") {
- of_id = of_get_property(np, "port-number", NULL);
- if ((!of_id) || (*of_id != id))
- continue;
+ of_id = of_get_property(np, "port-number", NULL);
+ if ((!of_id) || (*of_id != id))
+ continue;
- rc = of_address_to_resource(np, 0, &res);
- if (rc)
- continue;
+ rc = of_address_to_resource(np, 0, &res);
+ if (rc)
+ continue;
- of_node_put(np);
- return res.start+3;
+ of_node_put(np);
+ return res.start+3;
+ }
+ matches++;
}
return 0;
@@ -654,13 +672,6 @@ static int __devexit ulite_of_remove(struct of_device *op)
return ulite_release(&op->dev);
}
-/* Match table for of_platform binding */
-static struct of_device_id __devinit ulite_of_match[] = {
- { .type = "serial", .compatible = "xilinx,uartlite", },
- {},
-};
-MODULE_DEVICE_TABLE(of, ulite_of_match);
-
static struct of_platform_driver ulite_of_driver = {
.owner = THIS_MODULE,
.name = "uartlite",
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index e38d3b7..9b426d3 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -460,7 +460,7 @@ static int __devexit xilinxfb_of_remove(struct of_device *op)
/* Match table for of_platform binding */
static struct of_device_id __devinit xilinxfb_of_match[] = {
- { .compatible = "xilinx,ml300-fb", },
+ { .compatible = "xlnx,plb-tft-cntlr-ref-1.00.a", },
{},
};
MODULE_DEVICE_TABLE(of, xilinxfb_of_match);
--
1.5.3.4-dirty
^ permalink raw reply related
* [PATCH 7/7] [POWERPC] Xilinx: Uartlite: Section type fixups
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
In-Reply-To: <1199820909-32341-7-git-send-email-stephen.neuendorffer@xilinx.com>
All the __devexit functions are now appropriately tagged. This fixes
some ppc link warnings.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
drivers/serial/uartlite.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 02c2d89..ecd5540 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -594,7 +594,7 @@ static int __devinit ulite_assign(struct device *dev, int id, u32 base, int irq)
*
* @dev: pointer to device structure
*/
-static int __devinit ulite_release(struct device *dev)
+static int __devexit ulite_release(struct device *dev)
{
struct uart_port *port = dev_get_drvdata(dev);
int rc = 0;
@@ -627,7 +627,7 @@ static int __devinit ulite_probe(struct platform_device *pdev)
return ulite_assign(&pdev->dev, pdev->id, res->start, res2->start);
}
-static int ulite_remove(struct platform_device *pdev)
+static int __devexit ulite_remove(struct platform_device *pdev)
{
return ulite_release(&pdev->dev);
}
--
1.5.3.4-dirty
^ permalink raw reply related
* [PATCH 4/7] [POWERPC] Xilinx: Add correct compatible list for device tree bus bindings.
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
In-Reply-To: <1199820909-32341-4-git-send-email-stephen.neuendorffer@xilinx.com>
Includes both flavors of plb, opb, dcr, and a pseudo 'compound' bus
for representing compound peripherals containing more than one logical
device.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
arch/powerpc/platforms/40x/virtex.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
index 859ba1d..7590fa5 100644
--- a/arch/powerpc/platforms/40x/virtex.c
+++ b/arch/powerpc/platforms/40x/virtex.c
@@ -15,12 +15,22 @@
#include <asm/time.h>
#include <asm/xilinx_intc.h>
+static struct of_device_id xilinx_of_bus_ids[] = {
+ { .compatible = "xlnx,plb-v46-1.00.a", },
+ { .compatible = "xlnx,plb-v34-1.01.a", },
+ { .compatible = "xlnx,plb-v34-1.02.a", },
+ { .compatible = "xlnx,opb-v20-1.10.c", },
+ { .compatible = "xlnx,dcr-v29-1.00.a", },
+ { .compatible = "xlnx,compound", },
+ {},
+};
+
static int __init virtex_device_probe(void)
{
if (!machine_is(virtex))
return 0;
- of_platform_bus_probe(NULL, NULL, NULL);
+ of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL);
return 0;
}
--
1.5.3.4-dirty
^ permalink raw reply related
* [PATCH 1/7] [POWERPC] Xilinx: Uartlite: Make console output actually work.
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
In-Reply-To: <1199820909-32341-1-git-send-email-stephen.neuendorffer@xilinx.com>
From: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Fixed to apply against 2.6.24-rc5, and remove DEBUG information.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
drivers/serial/uartlite.c | 121 +++++++++++++++++++++++++++++----------------
1 files changed, 79 insertions(+), 42 deletions(-)
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 3f59324..71e4c0a 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -9,6 +9,8 @@
* kind, whether express or implied.
*/
+#undef DEBUG
+
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/console.h>
@@ -321,6 +323,49 @@ static struct uart_ops ulite_ops = {
.verify_port = ulite_verify_port
};
+/**
+ * ulite_get_port: Get the uart_port for a given port number and base addr
+ */
+static struct uart_port *ulite_get_port(int id)
+{
+ struct uart_port *port;
+
+ /* if id = -1; then scan for a free id and use that */
+ if (id < 0) {
+ for (id = 0; id < ULITE_NR_UARTS; id++)
+ if (ulite_ports[id].mapbase == 0)
+ break;
+ }
+
+ if ((id < 0) || (id >= ULITE_NR_UARTS)) {
+ printk(KERN_WARNING "uartlite: invalid id: %i\n", id);
+ return NULL;
+ }
+
+ /* The ID is valid, so get the address of the uart_port structure */
+ port = &ulite_ports[id];
+
+ /* Is the structure is already initialized? */
+ if (port->mapbase)
+ return port;
+
+ /* At this point, we've got an empty uart_port struct, initialize it */
+ spin_lock_init(&port->lock);
+ port->membase = NULL;
+ port->fifosize = 16;
+ port->regshift = 2;
+ port->iotype = UPIO_MEM;
+ port->iobase = 1; /* mark port in use */
+ port->ops = &ulite_ops;
+ port->irq = NO_IRQ;
+ port->flags = UPF_BOOT_AUTOCONF;
+ port->dev = NULL;
+ port->type = PORT_UNKNOWN;
+ port->line = id;
+
+ return port;
+}
+
/* ---------------------------------------------------------------------
* Console driver operations
*/
@@ -376,7 +421,7 @@ static void ulite_console_write(struct console *co, const char *s,
}
#if defined(CONFIG_OF)
-static inline void __init ulite_console_of_find_device(int id)
+static inline u32 __init ulite_console_of_find_device(int id)
{
struct device_node *np;
struct resource res;
@@ -392,13 +437,14 @@ static inline void __init ulite_console_of_find_device(int id)
if (rc)
continue;
- ulite_ports[id].mapbase = res.start;
of_node_put(np);
- return;
+ return res.start+3;
}
+
+ return 0;
}
#else /* CONFIG_OF */
-static inline void __init ulite_console_of_find_device(int id) { /* do nothing */ }
+static inline u32 __init ulite_console_of_find_device(int id) { return 0; }
#endif /* CONFIG_OF */
static int __init ulite_console_setup(struct console *co, char *options)
@@ -408,25 +454,33 @@ static int __init ulite_console_setup(struct console *co, char *options)
int bits = 8;
int parity = 'n';
int flow = 'n';
+ u32 base;
- if (co->index < 0 || co->index >= ULITE_NR_UARTS)
- return -EINVAL;
+ /* Find a matching uart port in the device tree */
+ base = ulite_console_of_find_device(co->index);
- port = &ulite_ports[co->index];
+ /* Get the port structure */
+ port = ulite_get_port(co->index);
+ if (!port)
+ return -ENODEV;
- /* Check if it is an OF device */
- if (!port->mapbase)
- ulite_console_of_find_device(co->index);
+ /* was it initialized for this device? */
+ if (base) {
+ if ((port->mapbase) && (port->mapbase != base)) {
+ pr_debug(KERN_DEBUG "ulite: addr mismatch; %x != %x\n",
+ port->mapbase, base);
+ return -ENODEV; /* port used by another device; bail */
+ }
+ port->mapbase = base;
+ }
- /* Do we have a device now? */
- if (!port->mapbase) {
- pr_debug("console on ttyUL%i not present\n", co->index);
+ if (!port->mapbase)
return -ENODEV;
- }
- /* not initialized yet? */
+ /* registers mapped yet? */
if (!port->membase) {
- if (ulite_request_port(port))
+ port->membase = ioremap(port->mapbase, ULITE_REGION);
+ if (!port->membase)
return -ENODEV;
}
@@ -488,39 +542,22 @@ static int __devinit ulite_assign(struct device *dev, int id, u32 base, int irq)
struct uart_port *port;
int rc;
- /* if id = -1; then scan for a free id and use that */
- if (id < 0) {
- for (id = 0; id < ULITE_NR_UARTS; id++)
- if (ulite_ports[id].mapbase == 0)
- break;
- }
- if (id < 0 || id >= ULITE_NR_UARTS) {
- dev_err(dev, "%s%i too large\n", ULITE_NAME, id);
- return -EINVAL;
+ port = ulite_get_port(id);
+ if (!port) {
+ dev_err(dev, "Cannot get uart_port structure\n");
+ return -ENODEV;
}
- if ((ulite_ports[id].mapbase) && (ulite_ports[id].mapbase != base)) {
- dev_err(dev, "cannot assign to %s%i; it is already in use\n",
- ULITE_NAME, id);
- return -EBUSY;
+ /* was it initialized for this device? */
+ if ((port->mapbase) && (port->mapbase != base)) {
+ pr_debug(KERN_DEBUG "ulite: addr mismatch; %x != %x\n",
+ port->mapbase, base);
+ return -ENODEV;
}
- port = &ulite_ports[id];
-
- spin_lock_init(&port->lock);
- port->fifosize = 16;
- port->regshift = 2;
- port->iotype = UPIO_MEM;
- port->iobase = 1; /* mark port in use */
port->mapbase = base;
- port->membase = NULL;
- port->ops = &ulite_ops;
port->irq = irq;
- port->flags = UPF_BOOT_AUTOCONF;
port->dev = dev;
- port->type = PORT_UNKNOWN;
- port->line = id;
-
dev_set_drvdata(dev, port);
/* Register the port */
--
1.5.3.4-dirty
^ permalink raw reply related
* [PATCH 6/7] [POWERPC] Xilinx: updated device tree compatibility to match uboot bsp generator.
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
In-Reply-To: <1199820909-32341-6-git-send-email-stephen.neuendorffer@xilinx.com>
Missed this one in the boot loader before.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
arch/powerpc/boot/serial.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c
index cafeece..b6c68ef 100644
--- a/arch/powerpc/boot/serial.c
+++ b/arch/powerpc/boot/serial.c
@@ -128,7 +128,8 @@ int serial_console_init(void)
rc = cpm_console_init(devp, &serial_cd);
else if (dt_is_compatible(devp, "mpc5200-psc-uart"))
rc = mpc5200_psc_console_init(devp, &serial_cd);
- else if (dt_is_compatible(devp, "xilinx,uartlite"))
+ else if (dt_is_compatible(devp, "xlnx,opb-uartlite-1.00.b") ||
+ dt_is_compatible(devp, "xlnx,xps-uartlite-1.00.a"))
rc = uartlite_console_init(devp, &serial_cd);
/* Add other serial console driver calls here */
--
1.5.3.4-dirty
^ permalink raw reply related
* [PATCH 0/7] [POWERPC] Xilinx: Device Tree updates for xilinx.
From: Stephen Neuendorffer @ 2008-01-08 19:35 UTC (permalink / raw)
To: grant.likely, linuxppc-dev, simekm2, jwilliams
These patches synchronize all the in-kernel drivers to use the compatible names generated by the UBoot BSP generator. (at git://git.xilinx.com/gen-mhs-devtree.git)
This set of patches should all be ready for 2.6.25: I've removed the ones that weren't and cleaned up the remainder. In particular, there was a nasty code/data section mismatch in the uartlite that showed up in the microblaze. I've also added a patch for the uartlite names in the boot serial that I missed the first time around and a patch that fixes some other section mismatch warnings in the uartlite.
For reference, below is the device tree for a Virtex2Pro design. Except for some small changes mentioned before, this is entirely automatically generated from the EDK design.
Steve
/ {
mem_size_cells: #address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,virtex";
model = "testing";
DDR_256MB_32MX64_rank1_row13_col10_cl2_5: memory@0 {
device_type = "memory";
reg = < 0 memsize:10000000 >;
} ;
chosen {
bootargs = "root=/dev/nfs nfsroot=172.19.221.221:/exports/xup/ydl41 ip=dhcp console=ttyUL0";
} ;
cpus {
#address-cells = <1>;
#cpus = <1>;
#size-cells = <0>;
PowerPC,405@0 {
clock-frequency = <11e1a300>;
d-cache-line-size = <20>;
d-cache-size = <4000>;
device_type = "cpu";
i-cache-line-size = <20>;
i-cache-size = <4000>;
reg = <0>;
timebase: timebase-frequency = <11e1a300>;
xlnx,dcr-resync = <0>;
xlnx,deterministic-mult = <0>;
xlnx,disable-operand-forwarding = <1>;
xlnx,mmu-enable = <1>;
} ;
} ;
plb_v34 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,plb-v34-1.02.a";
ranges ;
Ethernet_MAC: ethernet@80400000 {
compatible = "xlnx,plb-ethernet-1.01.a";
device_type = "network";
interrupt-parent = <&opb_intc_0>;
interrupts = < 2 0 >;
local-mac-address = [ 00 00 00 00 00 00 ];
reg = < 80400000 10000 >;
xlnx,dev-blk-id = <0>;
xlnx,dev-mir-enable = <1>;
xlnx,dma-intr-coalesce = <1>;
xlnx,dma-present = <1>;
xlnx,err-count-exist = <1>;
xlnx,fcs-insert-exist = <1>;
xlnx,half-duplex-exist = <1>;
xlnx,include-dev-pencoder = <1>;
xlnx,ipif-fifo-depth = <8000>;
xlnx,mac-fifo-depth = <40>;
xlnx,mii-exist = <1>;
xlnx,miim-clkdvd = <13>;
xlnx,pad-insert-exist = <1>;
xlnx,reset-present = <1>;
xlnx,source-addr-insert-exist = <1>;
} ;
opb_v20 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,opb-v20-1.10.c";
ranges ;
Audio_Codec: opb-ac97@7d400000 {
compatible = "xlnx,opb-ac97-2.00.a";
interrupt-parent = <&opb_intc_0>;
interrupts = < 1 0 >;
reg = < 7d400000 10000 >;
xlnx,intr-level = <1>;
xlnx,playback = <1>;
xlnx,record = <1>;
xlnx,use-bram = <1>;
} ;
DIPSWs_4Bit: opb-gpio@40020000 {
compatible = "xlnx,opb-gpio-3.01.b";
reg = < 40020000 10000 >;
xlnx,all-inputs = <1>;
xlnx,all-inputs-2 = <0>;
xlnx,dout-default = <0>;
xlnx,dout-default-2 = <0>;
xlnx,gpio-width = <4>;
xlnx,interrupt-present = <0>;
xlnx,is-bidir = <1>;
xlnx,is-bidir-2 = <1>;
xlnx,is-dual = <0>;
xlnx,tri-default = <ffffffff>;
xlnx,tri-default-2 = <ffffffff>;
xlnx,user-id-code = <3>;
} ;
LEDs_4Bit: opb-gpio@40000000 {
compatible = "xlnx,opb-gpio-3.01.b";
reg = < 40000000 10000 >;
xlnx,all-inputs = <0>;
xlnx,all-inputs-2 = <0>;
xlnx,dout-default = <0>;
xlnx,dout-default-2 = <0>;
xlnx,gpio-width = <4>;
xlnx,interrupt-present = <0>;
xlnx,is-bidir = <0>;
xlnx,is-bidir-2 = <1>;
xlnx,is-dual = <0>;
xlnx,tri-default = <ffffffff>;
xlnx,tri-default-2 = <ffffffff>;
xlnx,user-id-code = <3>;
} ;
PS2_Ports: opb-ps2-dual-ref@7a400000 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,compound";
ranges = < 0 7a400000 10000 >;
opb-ps2-dual-ref@0 {
compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
interrupt-parent = <&opb_intc_0>;
interrupts = < 6 0 >;
reg = < 0 40 >;
} ;
opb-ps2-dual-ref@1000 {
compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
interrupt-parent = <&opb_intc_0>;
interrupts = < 5 0 >;
reg = < 1000 40 >;
} ;
} ;
PushButtons_5Bit: opb-gpio@40040000 {
compatible = "xlnx,opb-gpio-3.01.b";
reg = < 40040000 10000 >;
xlnx,all-inputs = <1>;
xlnx,all-inputs-2 = <0>;
xlnx,dout-default = <0>;
xlnx,dout-default-2 = <0>;
xlnx,gpio-width = <5>;
xlnx,interrupt-present = <0>;
xlnx,is-bidir = <1>;
xlnx,is-bidir-2 = <1>;
xlnx,is-dual = <0>;
xlnx,tri-default = <ffffffff>;
xlnx,tri-default-2 = <ffffffff>;
xlnx,user-id-code = <3>;
} ;
RS232_Uart_1: serial@40400000 {
compatible = "xlnx,opb-uartlite-1.00.b";
device_type = "serial";
interrupt-parent = <&opb_intc_0>;
interrupts = < 4 0 >;
port-number = <0>;
reg = < 40400000 10000 >;
xlnx,baudrate = <2580>;
xlnx,clk-freq = <5f5e100>;
xlnx,data-bits = <8>;
xlnx,odd-parity = <0>;
xlnx,use-parity = <0>;
} ;
SysACE_CompactFlash: opb-sysace@41800000 {
compatible = "xlnx,opb-sysace-1.00.c";
interrupt-parent = <&opb_intc_0>;
interrupts = < 3 0 >;
reg = < 41800000 10000 >;
xlnx,mem-width = <10>;
} ;
dcr_v29 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,dcr-v29-1.00.a";
ranges = < 0 40700000 1000 >;
VGA_FrameBuffer: plb-tft-cntlr-ref@200 {
compatible = "xlnx,plb-tft-cntlr-ref-1.00.a";
reg = < 200 8 >;
xlnx,default-tft-base-addr = <7f>;
xlnx,dps-init = <1>;
xlnx,on-init = <1>;
xlnx,pixclk-is-busclk-divby4 = <1>;
} ;
} ;
onewire_0: opb-onewire@7a200000 {
compatible = "xlnx,opb-onewire-1.00.a";
reg = < 7a200000 10000 >;
xlnx,add-pullup = "true";
xlnx,checkcrc = "true";
xlnx,clk-div = <f>;
} ;
opb_hwicap_0: opb-hwicap@41300000 {
compatible = "xlnx,opb-hwicap-1.00.b";
reg = < 41300000 10000 >;
} ;
opb_intc_0: interrupt-controller@41200000 {
#interrupt-cells = <2>;
compatible = "xlnx,opb-intc-1.00.c";
interrupt-controller ;
reg = < 41200000 10000 >;
xlnx,num-intr-inputs = <7>;
} ;
opb_timer_0: opb-timer@40800000 {
compatible = "xlnx,opb-timer-1.00.b";
interrupt-parent = <&opb_intc_0>;
interrupts = < 0 0 >;
reg = < 40800000 100 >;
xlnx,count-width = <20>;
xlnx,gen0-assert = <1>;
xlnx,gen1-assert = <1>;
xlnx,one-timer-only = <0>;
xlnx,trig0-assert = <1>;
xlnx,trig1-assert = <1>;
} ;
} ;
} ;
} ;
^ permalink raw reply
* Re: [PATCH] Hwmon for Taco
From: Stefan Roese @ 2008-01-08 19:27 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Sean MacLennan
In-Reply-To: <20080108130251.7ae351c7@zod.rchland.ibm.com>
On Tuesday 08 January 2008, Josh Boyer wrote:
> On Tue, 08 Jan 2008 13:30:00 -0500
>
> Sean MacLennan <smaclennan@pikatech.com> wrote:
> > Ok, here is the ad7414 only. taco-dtm is no more!
>
> Cool. Couple more things.
>
> 1) This should go through the hwmon maintainer. Send it to him.
> (CC'ing this list is of course fine.)
>
> 2) You always need the Signed-off-by: for each patch you send
>
> 3) If you didn't author the code (this seems to come from Stefan), then
> you need the Signed-off-by from the original author.
Yes, please add my Signed-off-by on top of yours. That will make clear that I
originally wrote the code.
> You're getting there :) These are all "newbie" type mistakes so keep
> plugging away.
Right. Keep up the good work.
Thanks.
Ciao,
Stefan
^ permalink raw reply
* Re: [PATCH 3/7] Basic Freescale MPC512x support
From: Scott Wood @ 2008-01-08 19:25 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, John Rigby
In-Reply-To: <fa686aa40801080956n20f31a54xe02328a139ac3a3b@mail.gmail.com>
On Tue, Jan 08, 2008 at 10:56:41AM -0700, Grant Likely wrote:
> On 1/8/08, Scott Wood <scottwood@freescale.com> wrote:
> > On Tue, Jan 08, 2008 at 10:19:20AM -0700, Grant Likely wrote:
> > > > +config MPC5121_ADS
> > > > + bool "Freescale MPC5121E ADS"
> > > > + select DEFAULT_UIMAGE
> > > > + help
> > > > + This option enables support for the MPC5121E ADS board.
> > >
> > > Make this depend on PPC_MULTIPLATFORM and PPC32
> >
> > I don't think PPC_MULTIPLATFORM is appropriate here... it seems to be
> > OF-specific.
>
> 52xx is multiplatform.
"multiplatform" and "PPC_MULTIPLATFORM" are not the same. The config option
is misnamed.
> It works well on both OF and non-OF boards.
It may work, but it pulls in code like prom_init.c that is not needed on
non-OF boards. It's also quite confusing to have an embedded board's
checkbox only show up when you say yes to "Generic desktop/server/laptop".
-Scott
^ permalink raw reply
* Re: [PATCH] Miscellaneous for Taco
From: Stefan Roese @ 2008-01-08 19:23 UTC (permalink / raw)
To: Sean MacLennan; +Cc: linuxppc-dev
In-Reply-To: <4783C3E8.3090107@pikatech.com>
On Tuesday 08 January 2008, Sean MacLennan wrote:
> How about just 44x?
>
> Cheers,
> Sean
>
> diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
> index 7580aa5..682deae 100644
> --- a/drivers/usb/Kconfig
> +++ b/drivers/usb/Kconfig
> @@ -39,6 +39,7 @@ config USB_ARCH_HAS_OHCI
> # PPC:
> default y if STB03xxx
> default y if PPC_MPC52xx
> + default y if 44x
No. Not all 44x have OHCI built in. Currently 440EP, 440EPx and 405EZ have it.
But since your patch only touches 440EP, you should just enable OHCI for
exactly this platform.
Best regards,
Stefan
^ permalink raw reply
* [PATCH] [POWERPC] Add of_find_matching_node() helper function
From: Grant Likely @ 2008-01-08 19:20 UTC (permalink / raw)
To: linuxppc-dev
From: Grant Likely <grant.likely@secretlab.ca>
Similar to of_find_compatible_node(), of_find_matching_node() and
for_each_matching_node() allow you to iterate over the device tree
looking for specific nodes except that it accepts a of_device_id
table instead of strings.
This patch also moves of_match_node() from driver/of/device.c to
driver/of/base.c to colocate it with the of_find_matching_node which
depends on it.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/kernel/ibmebus.c | 1
arch/powerpc/kernel/of_platform.c | 1
arch/powerpc/platforms/celleb/io-workarounds.c | 1
arch/powerpc/platforms/celleb/pci.c | 1
drivers/net/ibm_newemac/core.c | 1
drivers/of/base.c | 58 ++++++++++++++++++++++++
drivers/of/device.c | 29 ------------
drivers/serial/mpc52xx_uart.c | 3 +
include/linux/of.h | 8 +++
include/linux/of_device.h | 2 -
10 files changed, 73 insertions(+), 32 deletions(-)
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c
index caae49f..3b70844 100644
--- a/arch/powerpc/kernel/ibmebus.c
+++ b/arch/powerpc/kernel/ibmebus.c
@@ -41,6 +41,7 @@
#include <linux/kobject.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
+#include <linux/of.h>
#include <linux/of_platform.h>
#include <asm/ibmebus.h>
#include <asm/abs_addr.h>
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index de36e23..7a3cafb 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -19,6 +19,7 @@
#include <linux/mod_devicetable.h>
#include <linux/slab.h>
#include <linux/pci.h>
+#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_platform.h>
diff --git a/arch/powerpc/platforms/celleb/io-workarounds.c b/arch/powerpc/platforms/celleb/io-workarounds.c
index b939c0e..423339b 100644
--- a/arch/powerpc/platforms/celleb/io-workarounds.c
+++ b/arch/powerpc/platforms/celleb/io-workarounds.c
@@ -22,6 +22,7 @@
#undef DEBUG
+#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/irq.h>
diff --git a/arch/powerpc/platforms/celleb/pci.c b/arch/powerpc/platforms/celleb/pci.c
index 5d399e0..51b390d 100644
--- a/arch/powerpc/platforms/celleb/pci.c
+++ b/arch/powerpc/platforms/celleb/pci.c
@@ -31,6 +31,7 @@
#include <linux/init.h>
#include <linux/bootmem.h>
#include <linux/pci_regs.h>
+#include <linux/of.h>
#include <linux/of_device.h>
#include <asm/io.h>
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
index cb06280..fced441 100644
--- a/drivers/net/ibm_newemac/core.c
+++ b/drivers/net/ibm_newemac/core.c
@@ -37,6 +37,7 @@
#include <linux/mii.h>
#include <linux/bitops.h>
#include <linux/workqueue.h>
+#include <linux/of.h>
#include <asm/processor.h>
#include <asm/io.h>
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 9377f3b..b306fef 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -273,3 +273,61 @@ struct device_node *of_find_compatible_node(struct device_node *from,
return np;
}
EXPORT_SYMBOL(of_find_compatible_node);
+
+/**
+ * of_match_node - Tell if an device_node has a matching of_match structure
+ * @matches: array of of device match structures to search in
+ * @node: the of device structure to match against
+ *
+ * Low level utility function used by device matching.
+ */
+const struct of_device_id *of_match_node(const struct of_device_id *matches,
+ const struct device_node *node)
+{
+ while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
+ int match = 1;
+ if (matches->name[0])
+ match &= node->name
+ && !strcmp(matches->name, node->name);
+ if (matches->type[0])
+ match &= node->type
+ && !strcmp(matches->type, node->type);
+ if (matches->compatible[0])
+ match &= of_device_is_compatible(node,
+ matches->compatible);
+ if (match)
+ return matches;
+ matches++;
+ }
+ return NULL;
+}
+EXPORT_SYMBOL(of_match_node);
+
+/**
+ * of_find_matching_node - Find a node based on an of_device_id match
+ * table.
+ * @from: The node to start searching from or NULL, the node
+ * you pass will not be searched, only the next one
+ * will; typically, you pass what the previous call
+ * returned. of_node_put() will be called on it
+ * @matches: array of of device match structures to search in
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_find_matching_node(struct device_node *from,
+ const struct of_device_id *matches)
+{
+ struct device_node *np;
+
+ read_lock(&devtree_lock);
+ np = from ? from->allnext : allnodes;
+ for (; np; np = np->allnext) {
+ if (of_match_node(matches, np) && of_node_get(np))
+ break;
+ }
+ of_node_put(from);
+ read_unlock(&devtree_lock);
+ return np;
+}
+EXPORT_SYMBOL(of_find_matching_node);
diff --git a/drivers/of/device.c b/drivers/of/device.c
index 6245f06..29681c4 100644
--- a/drivers/of/device.c
+++ b/drivers/of/device.c
@@ -10,35 +10,6 @@
#include <asm/errno.h>
/**
- * of_match_node - Tell if an device_node has a matching of_match structure
- * @ids: array of of device match structures to search in
- * @node: the of device structure to match against
- *
- * Low level utility function used by device matching.
- */
-const struct of_device_id *of_match_node(const struct of_device_id *matches,
- const struct device_node *node)
-{
- while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
- int match = 1;
- if (matches->name[0])
- match &= node->name
- && !strcmp(matches->name, node->name);
- if (matches->type[0])
- match &= node->type
- && !strcmp(matches->type, node->type);
- if (matches->compatible[0])
- match &= of_device_is_compatible(node,
- matches->compatible);
- if (match)
- return matches;
- matches++;
- }
- return NULL;
-}
-EXPORT_SYMBOL(of_match_node);
-
-/**
* of_match_device - Tell if an of_device structure has a matching
* of_match structure
* @ids: array of of device match structures to search in
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index ec36ad7..7e3ba8b 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -72,7 +72,8 @@
#include <asm/io.h>
#if defined(CONFIG_PPC_MERGE)
-#include <asm/of_platform.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
#else
#include <linux/platform_device.h>
#endif
diff --git a/include/linux/of.h b/include/linux/of.h
index c65af7b..b5f33ef 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -17,6 +17,7 @@
*/
#include <linux/types.h>
#include <linux/bitops.h>
+#include <linux/mod_devicetable.h>
#include <asm/prom.h>
@@ -41,6 +42,11 @@ extern struct device_node *of_find_compatible_node(struct device_node *from,
#define for_each_compatible_node(dn, type, compatible) \
for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
dn = of_find_compatible_node(dn, type, compatible))
+extern struct device_node *of_find_matching_node(struct device_node *from,
+ const struct of_device_id *matches);
+#define for_each_matching_node(dn, matches) \
+ for (dn = of_find_matching_node(NULL, matches); dn; \
+ dn = of_find_matching_node(dn, matches))
extern struct device_node *of_find_node_by_path(const char *path);
extern struct device_node *of_find_node_by_phandle(phandle handle);
extern struct device_node *of_get_parent(const struct device_node *node);
@@ -60,5 +66,7 @@ extern const void *of_get_property(const struct device_node *node,
int *lenp);
extern int of_n_addr_cells(struct device_node *np);
extern int of_n_size_cells(struct device_node *np);
+extern const struct of_device_id *of_match_node(
+ const struct of_device_id *matches, const struct device_node *node);
#endif /* _LINUX_OF_H */
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 212bffb..6dc1195 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -10,8 +10,6 @@
#define to_of_device(d) container_of(d, struct of_device, dev)
-extern const struct of_device_id *of_match_node(
- const struct of_device_id *matches, const struct device_node *node);
extern const struct of_device_id *of_match_device(
const struct of_device_id *matches, const struct of_device *dev);
^ permalink raw reply related
* Re: [PATCH 4/7] Device tree for MPC5121 ADS
From: Scott Wood @ 2008-01-08 19:22 UTC (permalink / raw)
To: John Rigby; +Cc: linuxppc-dev
In-Reply-To: <1199808093-15929-5-git-send-email-jrigby@freescale.com>
On Tue, Jan 08, 2008 at 09:01:30AM -0700, John Rigby wrote:
> + cpld@82000000 {
> + device_type = "board-control";
> + reg = <82000000 8000>;
> + };
Should be:
baord-control@82000000 {
compatible = "fsl,mpc5121ads-cpld";
reg = <82000000 8000>;
};
> + ref-frequency = <3ef1480>; // 66MHz ref
> + bus-frequency = <5e69ec0>; // 99MHz ips ref
Please specify these in decimal rather than hex (using the d# prefix, or
better yet /dts-v1/).
> + // IPIC
> + // interrupts cell = <intr #, sense>
> + // sense values match linux IORESOURCE_IRQ_* defines:
> + // sense == 8: Level, low assertion
> + // sense == 2: Edge, high-to-low change
> + //
> + ipic: pic@c00 {
> + interrupt-controller;
> + #address-cells = <0>;
> + #interrupt-cells = <2>;
> + reg = <c00 100>;
> + built-in;
> + device_type = "ipic";
> + };
Remove built-in.
-Scott
^ 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