For those interested, here's my current patch set to get PPC405 support
working in arch/powerpc.
Patches 1, 2, 3, 4, and 5 are probably ready to merge whenever. The
patches specific to Walnut need some more work before I would consider
those remotely usable. However, you can use them to build a zImage that
correctly determines the clocking and has a working serial console.
As always, comments welcome.
josh
@@ -82,8 +69,6 @@ menu "AMCC 40x options"# help# This option enables support for the Xilinx ML300 evaluation board.-endmenu-# 40x specific CPU modules, selected based on the board above.configNP405Hbool
@@ -126,68 +111,6 @@ config IBM405_ERR77configIBM405_ERR51bool-menu"AMCC 44x options"-depends on44x--#config BAMBOO-# bool "Bamboo"-# depends on 44x-# default n-# select 440EP-# help-# This option enables support for the IBM PPC440EP evaluation board.--configEBONY-bool"Ebony"-depends on44x-defaulty-select440GP-help-ThisoptionenablessupportfortheIBMPPC440GPevaluationboard.--#config LUAN-# bool "Luan"-# depends on 44x-# default n-# select 440SP-# help-# This option enables support for the IBM PPC440SP evaluation board.--#config OCOTEA-# bool "Ocotea"-# depends on 44x-# default n-# select 440GX-# help-# This option enables support for the IBM PPC440GX evaluation board.--endmenu--# 44x specific CPU modules, selected based on the board above.-config440EP-bool-selectPPC_FPU-selectIBM440EP_ERR42--config440GP-bool-selectIBM_NEW_EMAC_ZMII--config440GX-bool--config440SP-bool--config440A-bool-depends on440GX-defaulty--# 44x errata/workaround config symbols, selected by the CPU models above-configIBM440EP_ERR42-bool-#config XILINX_OCP# bool# depends on XILINX_ML300---linux-2.6.orig/arch/powerpc/platforms/Kconfig.cputype+++linux-2.6/arch/powerpc/platforms/Kconfig.cputype
Rename the 44x.c wrapper file to 4xx.c and make the fixup_memsize function
common for all of 4xx. Also adds a common function to reset ethernet and a
40x reset function.
Signed-off-by: Josh Boyer <redacted>
---
arch/powerpc/boot/44x.c | 85 ----------------------------------
arch/powerpc/boot/44x.h | 4 -
arch/powerpc/boot/4xx.c | 111 +++++++++++++++++++++++++++++++++++++++++++++
arch/powerpc/boot/4xx.h | 20 ++++++++
arch/powerpc/boot/Makefile | 4 -
arch/powerpc/boot/dcr.h | 2
arch/powerpc/boot/ebony.c | 3 -
7 files changed, 137 insertions(+), 92 deletions(-)
@@ -0,0 +1,111 @@+/*+*Copyright2007DavidGibson,IBMCorporation.+*+*Basedonearliercode:+*MattPorter<mporter@kernel.crashing.org>+*Copyright2002-2005MontaVistaSoftwareInc.+*+*EugeneSurovegin<eugene.surovegin@zultys.com>or<ebs@ebshome.net>+*Copyright(c)2003,2004ZultysTechnologies+*+*Thisprogramisfreesoftware;youcanredistributeitand/or+*modifyitunderthetermsoftheGNUGeneralPublicLicense+*aspublishedbytheFreeSoftwareFoundation;eitherversion+*2oftheLicense,or(atyouroption)anylaterversion.+*/+#include<stddef.h>+#include"types.h"+#include"string.h"+#include"stdio.h"+#include"ops.h"+#include"reg.h"+#include"dcr.h"++/* Read the 4xx SDRAM controller to get size of system memory. */+voidibm4xx_fixup_memsize(void)+{+inti;+unsignedlongmemsize,bank_config;++memsize=0;+for(i=0;i<ARRAY_SIZE(sdram_bxcr);i++){+mtdcr(DCRN_SDRAM0_CFGADDR,sdram_bxcr[i]);+bank_config=mfdcr(DCRN_SDRAM0_CFGDATA);++if(bank_config&SDRAM_CONFIG_BANK_ENABLE)+memsize+=SDRAM_CONFIG_BANK_SIZE(bank_config);+}++dt_fixup_memory(0,memsize);+}++#define DBCR0_RST_SYSTEM 0x30000000++voidibm44x_dbcr_reset(void)+{+unsignedlongtmp;++/* DBCR0 on 44x is SPRN 0x134 */+asmvolatile(+"mfspr %0,%1\n"+"oris %0,%0,%2@h\n"+"mtspr %1,%0"+:"=&r"(tmp):"i"(0x134),"i"(DBCR0_RST_SYSTEM)+);++}++voidibm40x_dbcr_reset(void)+{+unsignedlongtmp;++/* DBCR0 on 4xx is SPRN 0x3F2 */+asmvolatile(+"mfspr %0,%1\n"+"oris %0,%0,%2@h\n"+"mtspr %1,%0"+:"=&r"(tmp):"i"(0x3F2),"i"(DBCR0_RST_SYSTEM)+);+}++#define EMAC_RESET 0x20000000+#define MAL_RESET 0x80000000+voidibm4xx_reset_eth(u32*emac0,u32*emac1)+{+/* Reset the MAL and EMAC(s) since PIBS/OpenBIOS don't do this for us */+if(emac0)+*emac0=EMAC_RESET;+if(emac1)+*emac1=EMAC_RESET;++mtdcr(DCRN_MAL0_CFG,MAL_RESET);+}++/* Read 4xx EBC bus bridge registers to get mappings of the peripheral+*banksintotheOPBaddressspace*/+voidibm4xx_fixup_ebc_ranges(constchar*ebc)+{+void*devp;+u32bxcr;+u32ranges[EBC_NUM_BANKS*4];+u32*p=ranges;+inti;++for(i=0;i<EBC_NUM_BANKS;i++){+mtdcr(DCRN_EBC0_CFGADDR,EBC_BXCR(i));+bxcr=mfdcr(DCRN_EBC0_CFGDATA);++if((bxcr&EBC_BXCR_BU)!=EBC_BXCR_BU_OFF){+*p++=i;+*p++=0;+*p++=bxcr&EBC_BXCR_BAS;+*p++=EBC_BXCR_BANK_SIZE(bxcr);+}+}++devp=finddevice(ebc);+if(!devp)+fatal("Couldn't locate EBC node %s\n\r",ebc);++setprop(devp,"ranges",ranges,(p-ranges)*sizeof(u32));+}---/dev/null+++linux-2.6/arch/powerpc/boot/4xx.h
@@ -1,85 +0,0 @@-/*-*Copyright2007DavidGibson,IBMCorporation.-*-*Basedonearliercode:-*MattPorter<mporter@kernel.crashing.org>-*Copyright2002-2005MontaVistaSoftwareInc.-*-*EugeneSurovegin<eugene.surovegin@zultys.com>or<ebs@ebshome.net>-*Copyright(c)2003,2004ZultysTechnologies-*-*Thisprogramisfreesoftware;youcanredistributeitand/or-*modifyitunderthetermsoftheGNUGeneralPublicLicense-*aspublishedbytheFreeSoftwareFoundation;eitherversion-*2oftheLicense,or(atyouroption)anylaterversion.-*/-#include<stddef.h>-#include"types.h"-#include"string.h"-#include"stdio.h"-#include"ops.h"-#include"reg.h"-#include"dcr.h"--/* Read the 44x memory controller to get size of system memory. */-voidibm44x_fixup_memsize(void)-{-inti;-unsignedlongmemsize,bank_config;--memsize=0;-for(i=0;i<ARRAY_SIZE(sdram_bxcr);i++){-mtdcr(DCRN_SDRAM0_CFGADDR,sdram_bxcr[i]);-bank_config=mfdcr(DCRN_SDRAM0_CFGDATA);--if(bank_config&SDRAM_CONFIG_BANK_ENABLE)-memsize+=SDRAM_CONFIG_BANK_SIZE(bank_config);-}--dt_fixup_memory(0,memsize);-}--#define SPRN_DBCR0 0x134-#define DBCR0_RST_SYSTEM 0x30000000--voidibm44x_dbcr_reset(void)-{-unsignedlongtmp;--asmvolatile(-"mfspr %0,%1\n"-"oris %0,%0,%2@h\n"-"mtspr %1,%0"-:"=&r"(tmp):"i"(SPRN_DBCR0),"i"(DBCR0_RST_SYSTEM)-);--}--/* Read 4xx EBC bus bridge registers to get mappings of the peripheral-*banksintotheOPBaddressspace*/-voidibm4xx_fixup_ebc_ranges(constchar*ebc)-{-void*devp;-u32bxcr;-u32ranges[EBC_NUM_BANKS*4];-u32*p=ranges;-inti;--for(i=0;i<EBC_NUM_BANKS;i++){-mtdcr(DCRN_EBC0_CFGADDR,EBC_BXCR(i));-bxcr=mfdcr(DCRN_EBC0_CFGDATA);--if((bxcr&EBC_BXCR_BU)!=EBC_BXCR_BU_OFF){-*p++=i;-*p++=0;-*p++=bxcr&EBC_BXCR_BAS;-*p++=EBC_BXCR_BANK_SIZE(bxcr);-}-}--devp=finddevice(ebc);-if(!devp)-fatal("Couldn't locate EBC node %s\n\r",ebc);--setprop(devp,"ranges",ranges,(p-ranges)*sizeof(u32));-}
If you call it mmu-4xx, shouldn't it be used
for 44x as well? I would think this either
should be
No. I was following the established convention that's been there for
years. Which sucks I suppose for people not familiar with 40x/44x.
That would be a lot of stuff to change though... e.g.:
arch/powerpc/platforms/4xx -> arch/powerpc/platforms/40x
arch/powerpc/kernel/head_4xx.S -> arch/powerpc/platforms/head_40x.S
etc. I'd need a git tree to do that cleanly. I've been toying with
creating one for powerpc4xx anyway so I might do that.
Is it actually feasible to get to a point where
you can build a kernel that boots on both
40x and 44x, or is it just too different?
I'm guessing its too different since 40x probably has a real mode and
44x doesnt.
However, I agree we should go ahead and rename 4xx to 40x at this
point in arch/powerpc.
- k
Allow generic_calibrate_decr to work for 40x platforms. Given that the hardware
behavior is identical, this also changes the set_dec function to reload the PIT
on 40x to match the behavior 44x currently has.
Signed-off-by: Josh Boyer <redacted>
---
arch/powerpc/kernel/time.c | 2 +-
include/asm-powerpc/time.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
@@ -866,7 +866,7 @@ void __init generic_calibrate_decr(void)"(not found)\n");}-#ifdef CONFIG_BOOKE+#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)/* Set the time base to zero */mtspr(SPRN_TBWL,0);mtspr(SPRN_TBWU,0);---linux-2.6.orig/include/asm-powerpc/time.h+++linux-2.6/include/asm-powerpc/time.h
@@ -174,7 +174,7 @@ static inline unsigned int get_dec(void)staticinlinevoidset_dec(intval){#if defined(CONFIG_40x)-return;/* Have to let it auto-reload */+mtspr(SPRN_PIT,val);#elif defined(CONFIG_8xx_CPU6)set_dec_cpu6(val);#else
@@ -0,0 +1,113 @@+/*+*DeviceTreeSourceforIBMWalnut+*+*Copyright2007IBMCorp.+*JoshBoyer<jwboyer@linux.vnet.ibm.com>+*+*FIXME:Draftonly!+*+*ThisfileislicensedunderthetermsoftheGNUGeneralPublic+*Licenseversion2.Thisprogramislicensed"as is"without+*anywarrantyofanykind,whetherexpressorimplied.+*+*Tobuild:+*dtc-Idts-Oasm-owalnut.S-b0walnut.dts+*dtc-Idts-Odtb-owalnut.dtb-b0walnut.dts+*/++/{+#address-cells=<1>;+#size-cells=<1>;+model="ibm,walnut";+compatible="ibm,walnut";+dcr-parent=<&/cpus/PowerPC,405GP@0>;++cpus{+#address-cells=<1>;+#size-cells=<0>;++PowerPC,405GP@0{+device_type="cpu";+reg=<0>;+clock-frequency=<bebc200>;/* Filled in by zImage */+timebase-frequency=<0>;/* Filled in by zImage */+i-cache-line-size=<20>;+d-cache-line-size=<20>;+i-cache-size=<8000>;+d-cache-size=<8000>;+dcr-controller;+dcr-access-method="native";+};+};++memory{+device_type="memory";+reg=<00>;/* Filled in by zImage */+};++UIC0:interrupt-controller0{+compatible="ibm,uic";+interrupt-controller;+cell-index=<0>;+dcr-reg=<0c09>;+#address-cells=<0>;+#size-cells=<0>;+#interrupt-cells=<2>;+};++plb{+compatible="ibm,plb";+#address-cells=<1>;+#size-cells=<1>;+ranges;+clock-frequency=<0>;/* Filled in by zImage */++SDRAM0:memory-controller{+compatible="ibm,sdram-405gp","ibm,sdram-440gp";+dcr-reg=<0102>;+};++POB0:opb{+compatible="ibm,opb";+#address-cells=<1>;+#size-cells=<1>;+ranges;+dcr-reg=<0a05>;+clock-frequency=<0>;/* Filled in by zImage */++UART0:serial@ef600300{+device_type="serial";+compatible="ns16550";+reg=<ef6003008>;+virtual-reg=<ef600300>;+clock-frequency=<0>;/* Filled in by zImage */+current-speed=<2580>;+interrupt-parent=<&UIC0>;+interrupts=<04>;+};++UART1:serial@ef600400{+device_type="serial";+compatible="ns16550";+reg=<ef6004008>;+virtual-reg=<ef600400>;+clock-frequency=<0>;/* Filled in by zImage */+current-speed=<2580>;+interrupt-parent=<&UIC0>;+interrupts=<14>;+};++EBC0:ebc{+compatible="ibm,ebc-405gp","ibm,ebc";+dcr-reg=<0122>;+#address-cells=<1>;+#size-cells=<1>;+clock-frequency=<0>;/* Filled in by zImage */+};+};+};++chosen{+linux,stdout-path="/plb/opb/serial@ef600300";+};+};
It's a bit weird to mention 440 here, since 405 is older.
Not a real problem, but if you still can change all relevant
OS code and device trees, I'd swap it around (make 440 trees
include the 405 "compatible" value). Can you still do that
or is there a too big installed base already?
On Wed, 2007-07-11 at 19:49 +0200, Segher Boessenkool wrote:
quoted
+ UIC0: interrupt-controller0 {
Why not just "interrupt-controller"?
Copy/paste error from Ebony DTS, which has multiple UICs. Will fix.
quoted
+ #address-cells = <0>;
+ #size-cells = <0>;
No need for these.
Ok.
quoted
+ plb {
+ ranges;
Please make the valid address ranges explicit here.
Meaning what exactly? I thought just specifying "ranges;" simply said
"the addresses from this node don't have any translation from the parent
node" (or something like that).
It's a bit weird to mention 440 here, since 405 is older.
Not a real problem, but if you still can change all relevant
OS code and device trees, I'd swap it around (make 440 trees
include the 405 "compatible" value). Can you still do that
or is there a too big installed base already?
The installed base for 440 exists of exactly 1 completely non-functional
board ;). I can change it.
Please make the valid address ranges explicit here.
Meaning what exactly? I thought just specifying "ranges;" simply said
"the addresses from this node don't have any translation from the
parent
node" (or something like that).
Just list the actual ranges that sit on the PLB bus. It is
good to be more explicit with these things (for example, the
kernel will have more information to work from when deciding
whether to apply a certain workaround for broken device trees
or not).
It's a bit weird to mention 440 here, since 405 is older.
Not a real problem, but if you still can change all relevant
OS code and device trees, I'd swap it around (make 440 trees
include the 405 "compatible" value). Can you still do that
or is there a too big installed base already?
The installed base for 440 exists of exactly 1 completely non-
functional
board ;). I can change it.
From: David Gibson <hidden> Date: 2007-07-23 00:47:04
On Wed, Jul 11, 2007 at 12:55:31PM -0500, Josh Boyer wrote:
On Wed, 2007-07-11 at 19:49 +0200, Segher Boessenkool wrote:
quoted
quoted
+ UIC0: interrupt-controller0 {
Why not just "interrupt-controller"?
Copy/paste error from Ebony DTS, which has multiple UICs. Will fix.
quoted
quoted
+ #address-cells = <0>;
+ #size-cells = <0>;
No need for these.
Ok.
quoted
quoted
+ plb {
+ ranges;
Please make the valid address ranges explicit here.
Meaning what exactly? I thought just specifying "ranges;" simply said
"the addresses from this node don't have any translation from the parent
node" (or something like that).
It's a bit weird to mention 440 here, since 405 is older.
Not a real problem, but if you still can change all relevant
OS code and device trees, I'd swap it around (make 440 trees
include the 405 "compatible" value). Can you still do that
or is there a too big installed base already?
The installed base for 440 exists of exactly 1 completely non-functional
board ;). I can change it.
And I don't think we even actually look at this compatible property in
practice.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
-----Original Message-----
From: linuxppc-dev-bounces+b08248=3Dfreescale.com@ozlabs.org=20
[mailto:linuxppc-dev-bounces+b08248=3Dfreescale.com@ozlabs.org]=20
On Behalf Of Segher Boessenkool
Sent: Wednesday, July 11, 2007 12:50 PM
To: Josh Boyer
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [RFC][PATCH 6/8] Walnut DTS
=20
quoted
+ UIC0: interrupt-controller0 {
=20
Why not just "interrupt-controller"?
=20
quoted
+ #address-cells =3D <0>;
+ #size-cells =3D <0>;
=20
No need for these.
Isn't a good practice to put #address-cells in interrupt controller
nodes?
If the device tree has an interrupt map defined the interrupt
parent 'unit interrupt specifier' has to be interpreted according
to the #address-cells of the interrupt parent. It seems like=20
typical practice in the current DTS files to explicitly define this
in the interrupt controller.
Of course this particular device tree doesn't have an interrupt
map...
#size-cells is not needed.
Stuart
Isn't a good practice to put #address-cells in interrupt controller
nodes?
It is not.
If the device tree has an interrupt map defined the interrupt
parent 'unit interrupt specifier' has to be interpreted according
to the #address-cells of the interrupt parent.
And "#address-cells" is defaulted to 0 if it is absent,
for the purpose of interrupt mapping (but not for its
other purposes). Typically, such interrupt controllers
don't have device tree children so it doesn't make sense
to give them an "#address-cells" anyway.
It seems like
typical practice in the current DTS files to explicitly define this
in the interrupt controller.
That "typical practice" is inspired by the need to explicitly
put #address-cells and #size-cells into the device tree if you
want Linux to properly parse the device tree, even if the default
values would work perfectly (if Linux would work correctly,
that is).
Of course this particular device tree doesn't have an interrupt
map...
#size-cells is not needed.
There are no child nodes, and no binding that says there can
be any; neither #address-cells not #size-cells should be there.
Segher
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2007-07-16 21:47:41
On Mon, 2007-07-16 at 16:34 +0200, Segher Boessenkool wrote:
quoted
quoted
quoted
+ #address-cells = <0>;
+ #size-cells = <0>;
No need for these.
Isn't a good practice to put #address-cells in interrupt controller
nodes?
It is not.
Well, that's debatable... but yes, a strict reading of the spec would
say that you should put neither #address-cells nor #size-cells in a leaf
interrupt controller.
quoted
If the device tree has an interrupt map defined the interrupt
parent 'unit interrupt specifier' has to be interpreted according
to the #address-cells of the interrupt parent.
And "#address-cells" is defaulted to 0 if it is absent,
for the purpose of interrupt mapping (but not for its
other purposes).
This is a bit confusing though, which is why I tend to prefer having it
explicitely in the interrupt controller node :-) I tend to dislike
"magic" defaults, we've had problems with them in the past and will have
in the future, I much prefer having things explicit whenever possible.
Typically, such interrupt controllers
don't have device tree children so it doesn't make sense
to give them an "#address-cells" anyway.
Somewhat...
quoted
It seems like
typical practice in the current DTS files to explicitly define this
in the interrupt controller.
That "typical practice" is inspired by the need to explicitly
put #address-cells and #size-cells into the device tree if you
want Linux to properly parse the device tree, even if the default
values would work perfectly (if Linux would work correctly,
that is).
Linux does handle default values in some areas. The problem with default
values is that they are badly defined and the spec contains gray areas
and contradictions as to what the default values should be in some
circumstances. As a general matter, I dislike default values because
they somewhat require background knowledge of what default values should
be in different contexts to "read" a device-tree. To be simple, I
believe default values are a bad idea.
There are no child nodes, and no binding that says there can
be any; neither #address-cells not #size-cells should be there.
You are being way too pedantic here. The interrupt-tree uses those two
properties, thus "there is no child node" is open to interpretation.
There is no child device node, but there are child interrupt nodes, and
since the interrupt-tree uses #address/size-cells, it does make some
sense to specify them.
Yes, there is a default value when absent, but the simple fact that the
default is different depending if you are doing a device walk or an
interrupt tree walk is very confusing. As I said above, the default
values are a source of more problem than anything else and I tend to
think they should be banned.
I would personally be inclined to define that whatever spec we come up
with always require #address-cells/#size-cells for any node that can
have either device children or interrupt children, and ban default
values alltogether.
Cheers,
Ben.
From: Scott Wood <hidden> Date: 2007-07-16 21:55:16
Benjamin Herrenschmidt wrote:
I would personally be inclined to define that whatever spec we come up
with always require #address-cells/#size-cells for any node that can
have either device children or interrupt children, and ban default
values alltogether.
When is #size-cells used in the interrupt tree at all?
And given the odd behavior of using an interrupt map in an interrupt
parent that is not the device parent (you're potentially using keys from
different domains that could clash, be a different sizes, etc), if we
make any changes in that regard, I'd forbid interrupt maps in interrupt
controllers with no device children, and thus #address-cells has no
meaning there.
-Scott
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2007-07-16 22:11:56
On Mon, 2007-07-16 at 16:55 -0500, Scott Wood wrote:
Benjamin Herrenschmidt wrote:
quoted
I would personally be inclined to define that whatever spec we come up
with always require #address-cells/#size-cells for any node that can
have either device children or interrupt children, and ban default
values alltogether.
When is #size-cells used in the interrupt tree at all?
It's not, sorry, my fingers typed a bit too fast :-)
And given the odd behavior of using an interrupt map in an interrupt
parent that is not the device parent (you're potentially using keys from
different domains that could clash, be a different sizes, etc), if we
make any changes in that regard, I'd forbid interrupt maps in interrupt
controllers with no device children, and thus #address-cells has no
meaning there.
No, interrupt maps are useful in devices with no children in some corner
cases. Remember that a map doesnt need to use the address part of the
source specifier, thus it can be used to do a pure domain->domain
conversion of the irq numbers, what sort of thing. The map has the added
advantage that today, it's the only mechanism that allows you to specify
different interrupt-parents through the same nexus, which is useful for
4xx.
Ben.
From: Scott Wood <hidden> Date: 2007-07-16 22:19:00
Benjamin Herrenschmidt wrote:
No, interrupt maps are useful in devices with no children in some corner
cases. Remember that a map doesnt need to use the address part of the
source specifier, thus it can be used to do a pure domain->domain
conversion of the irq numbers, what sort of thing. The map has the added
advantage that today, it's the only mechanism that allows you to specify
different interrupt-parents through the same nexus, which is useful for
4xx.
OK... but if you're doing a pure IRQ number conversion, the only useful
#address-cells would be zero, which makes it a reasonable default IMHO
(unlike the arbitrary 2 for regular traversal).
-Scott
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2007-07-16 22:34:14
On Mon, 2007-07-16 at 17:18 -0500, Scott Wood wrote:
OK... but if you're doing a pure IRQ number conversion, the only useful
#address-cells would be zero, which makes it a reasonable default IMHO
(unlike the arbitrary 2 for regular traversal).
It does make a reasonable default. The thing, as I exlained, is I
dislike the whole idea of "default" values in the first place.
Cheers,
Ben.
There is no child device node, but there are child interrupt=20
nodes, and
since the interrupt-tree uses #address/size-cells, it does make some
sense to specify them.
=20
Yes, there is a default value when absent, but the simple=20
fact that the
default is different depending if you are doing a device walk or an
interrupt tree walk is very confusing. As I said above, the default
values are a source of more problem than anything else and I tend to
think they should be banned.
=20
I would personally be inclined to define that whatever spec we come up
with always require #address-cells/#size-cells for any node that can
have either device children or interrupt children, and ban default
values alltogether.
Did you really mean #size-cells here? Shouldn't it be #interrupt-cells?
Stuart
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2007-07-16 22:12:21
quoted
I would personally be inclined to define that whatever spec we come up
with always require #address-cells/#size-cells for any node that can
have either device children or interrupt children, and ban default
values alltogether.
Did you really mean #size-cells here? Shouldn't it be #interrupt-cells?
Yup, as I said, my fingers got a bit too fast on the keyboard. I means
#interrupt-cells.
Ben.
On Tue, Jul 17, 2007 at 07:47:26AM +1000, Benjamin Herrenschmidt wrote:
quoted
That "typical practice" is inspired by the need to explicitly
put #address-cells and #size-cells into the device tree if you
want Linux to properly parse the device tree, even if the default
values would work perfectly (if Linux would work correctly,
that is).
Linux does handle default values in some areas. The problem with default
values is that they are badly defined and the spec contains gray areas
and contradictions as to what the default values should be in some
circumstances. As a general matter, I dislike default values because
they somewhat require background knowledge of what default values should
be in different contexts to "read" a device-tree. To be simple, I
believe default values are a bad idea.
Right. See, there are people like me that don't know what the default values
are/should be. Having them explicitly listed, even if it's redundant, serves
as a good learning aid.
Now, realistically I do know what the default is in this case. But I only
learned that recently. With hopefully more people starting to port things
over to arch/powerpc it might be a good idea to document them at least.
Otherwise, I fear we'd wind up repeating ourselves over and over.
Could we get a 'thou shalt not rely on defaults' added to
booting-without-of.txt? Or maybe something less draconian ;).
josh
Right. See, there are people like me that don't know what the
default values
are/should be. Having them explicitly listed, even if it's
redundant, serves
as a good learning aid.
_Only_ if it's redundant. Not if it has a meaning different
from having the property not there at all.
Now, realistically I do know what the default is in this case. But
I only
learned that recently. With hopefully more people starting to port
things
over to arch/powerpc it might be a good idea to document them at
least.
Definitely, we need more good examples, and maybe some
public stonings or something like that.
Otherwise, I fear we'd wind up repeating ourselves over and over.
Could we get a 'thou shalt not rely on defaults' added to
booting-without-of.txt? Or maybe something less draconian ;).
Such a statement is too vague to be meaningful. It would
be a good idea in separate cases; but _do_ describe it more
carefully than just talking about "defaults", and _do_ put
a comment at any such entry that this is different from how
Open Firmware defines this, so that people looking at the
Linux code won't get hopelessly confused.
Segher
Isn't a good practice to put #address-cells in interrupt controller
nodes?
It is not.
Well, that's debatable... but yes, a strict reading of the spec would
say that you should put neither #address-cells nor #size-cells in a =20=
leaf
interrupt controller.
Yes.
quoted
quoted
If the device tree has an interrupt map defined the interrupt
parent 'unit interrupt specifier' has to be interpreted according
to the #address-cells of the interrupt parent.
And "#address-cells" is defaulted to 0 if it is absent,
for the purpose of interrupt mapping (but not for its
other purposes).
This is a bit confusing though,
Yes, I shouldn't say "defaulted" -- a unit interrupt specifier
simply has no unit address part, in an interrupt domain that
doesn't correspond to a "normal" bus. But saying it like this
is a little bit inexact, and it uses more words.
which is why I tend to prefer having it
explicitely in the interrupt controller node :-)
Which is simply incorrect.
I tend to dislike
"magic" defaults, we've had problems with them in the past and will =20=
have
in the future, I much prefer having things explicit whenever possible.
You mean, the magic default values you used for #address-cells
and #size-cells? That was simply a bug, someone forgot to read
the documentation...
quoted
That "typical practice" is inspired by the need to explicitly
put #address-cells and #size-cells into the device tree if you
want Linux to properly parse the device tree, even if the default
values would work perfectly (if Linux would work correctly,
that is).
Linux does handle default values in some areas. The problem with =20
default
values is that they are badly defined
For this? No way:
[=46rom the base spec]:
=93#address-cells=94 S
Standard property name to define the package=92s address format.
prop-encoded-array: Integer, encoded with encode-int.
This property applies to packages that define a physical
address space, i.e., those packages with =93decode-unit=94
methods. The property value specifies the number of cells
that are used to encode a physical address within that
address space. The value of this property affects the other
functions, commands, and methods that deal with physical
addresses. In a package with a =93decode-unit=94 method, a =
missing
=93#address-cells=94 property signifies that the number of
address cells is two.
See? The flat device tree unfortunately has no decode-unit, but
it is still pretty clear which nodes "define a physical address
space" and which do not.
There is nothing badly defined here.
Nothing in the "interrupt mapping" spec redefines #address-cells
(OF isn't all that stupid you know); it simply says that a /unit
interrupt specifier/ has no /unit address/ part if there is no
#address-cells. The algorithm in paragraph 7 makes it super
clear how exactly this should work.
and the spec contains gray areas
and contradictions as to what the default values should be in some
circumstances.
In some areas, perhaps. And it would be nice to bring those
areas to the attention of the working group, instead of just
to complain.
There is no such issue in this area, anyway.
As a general matter, I dislike default values because
they somewhat require background knowledge of what default values =20
should
be in different contexts to "read" a device-tree.
Of course, you need way more than that knowledge to properly
parse or read a device tree *at all*.
To be simple, I
believe default values are a bad idea.
Linux will have to keep supporting them for "real OF", so
requiring an explicit #address-cells where its value is 2
doesn't really help much. I'm not opposed to this though,
for flat device trees at least (I think it's a good thing
for OF trees as well, but for different reasons; and that's
beside the point here).
On the other hand, requiring an #address-cells where it is
supposed to be absent, and you only want it so you can wrap
your head around the interrupt mapping recommended practice
in a more confusing and confused way, is simply WRONG.
quoted
There are no child nodes, and no binding that says there can
be any; neither #address-cells not #size-cells should be there.
You are being way too pedantic here.
No I'm not.
The interrupt-tree uses those two properties, thus "there is
no child node" is open to interpretation.
It isn't. Not a bus -> no child node in the device tree.
The interrupt tree is a completely separate thing.
There is no child device node, but there are child interrupt nodes, =20=
and
since the interrupt-tree uses #address/size-cells,
It doesn't.
it does make some sense to specify them.
If it would, the interrupt mapping spec would have had to say
how the semantics of #address-cells were changed (and they
weren't, and they shouldn't, and this is such a laughable idea
I wonder why anyone would suggest it did).
What the interrupt mapping spec defines is how to _use_ the
value of #address-cells, and how to interpret its absence;
what should be put in #address-cells for separate nodes is
defined elsewhere (namely, in the base spec, and in relevant
device bindings).
Yes, there is a default value when absent, but the simple fact that =20=
the
default is different depending if you are doing a device walk or an
interrupt tree walk is very confusing.
Yes, perhaps there shouldn't be a default value for #a
in the device structure; this is legacy compatibility
though, way way way too late to change this. You can do
this for the flat device tree though, since a) there are
no legacy trees around that you care about, and b) you
need to do something to get around the fact you don't have
decode-unit and encode-unit anyway, so little changes
around that area should be expected.
As I said above, the default
values are a source of more problem than anything else and I tend to
think they should be banned.
You cannot ban them in the Linux code. With that in mind,
what good would it do? There are thousands of cases where
absence of a property signifies something that you simply
*cannot* forbid, period. So why do it to this one?
I would personally be inclined to define that whatever spec we come up
with always require #address-cells/#size-cells for any node that can
have either device children
That is fine, for the flat device tree. Note that this would
be implicit in all separate device bindings, anyway.
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2007-07-17 21:26:11
Yes, I shouldn't say "defaulted" -- a unit interrupt specifier
simply has no unit address part, in an interrupt domain that
doesn't correspond to a "normal" bus. But saying it like this
is a little bit inexact, and it uses more words.
quoted
which is why I tend to prefer having it
explicitely in the interrupt controller node :-)
Which is simply incorrect.
It's absolutely not. Please, stop that moronic pin-head behaviour and
find me a single case where that would actually be a problem of any sort
or form.
You mean, the magic default values you used for #address-cells
and #size-cells? That was simply a bug, someone forgot to read
the documentation...
No, defaults are crap, period. This is a general thing. Besides, the
spec itself has issues about the default values (remember those blurbs
about PCI and ISA supposedly having different defaults ?) In any way,
defaults are a bad idea and I'm happy to say don't use them.
For this? No way:
[From the base spec]:
“#address-cells” S
Standard property name to define the package’s address format.
prop-encoded-array: Integer, encoded with encode-int.
This property applies to packages that define a physical
address space, i.e., those packages with “decode-unit”
methods. The property value specifies the number of cells
that are used to encode a physical address within that
address space. The value of this property affects the other
functions, commands, and methods that deal with physical
addresses. In a package with a “decode-unit” method, a missing
“#address-cells” property signifies that the number of
address cells is two.
And you omit the various bus bindings that have come up with different
defaults...
See? The flat device tree unfortunately has no decode-unit, but
it is still pretty clear which nodes "define a physical address
space" and which do not.
There is nothing badly defined here.
See above. Besides, as I said, default values are crap. And no, it's not
obvious which nodes define a physical address space or not, at least not
for a generic parser. Defaults are a bad idea, just get it and move on
and stop arguing just for the sake of arguing. Pointing out the letter
of the spec is not a constructive attitude here.
Nothing in the "interrupt mapping" spec redefines #address-cells
(OF isn't all that stupid you know); it simply says that a /unit
interrupt specifier/ has no /unit address/ part if there is no
#address-cells. The algorithm in paragraph 7 makes it super
clear how exactly this should work.
No, the algorithm provided isn't clear and is buggy. I have implemented
it so I know what I'm talking about. The fact that basically you end up
with "different" defaults for what is essentially the value
#address-cells depending on whether you are walking the device-tree for
address resolution or for interrupt resolution is stupid. Thus, the
solution is simple: don't do defaults. Explicit values are good.
quoted
and the spec contains gray areas
and contradictions as to what the default values should be in some
circumstances.
In some areas, perhaps. And it would be nice to bring those
areas to the attention of the working group, instead of just
to complain.
The working group is dead and some of the ex members of it expressed
their lack of interest in pursuing these matters.
Linux will have to keep supporting them for "real OF", so
requiring an explicit #address-cells where its value is 2
doesn't really help much. I'm not opposed to this though,
for flat device trees at least (I think it's a good thing
for OF trees as well, but for different reasons; and that's
beside the point here).
On the other hand, requiring an #address-cells where it is
supposed to be absent, and you only want it so you can wrap
your head around the interrupt mapping recommended practice
in a more confusing and confused way, is simply WRONG.
No, it's not, It's purely having an explicit representation of what was
a stupid default behaviour.
If it would, the interrupt mapping spec would have had to say
how the semantics of #address-cells were changed (and they
weren't, and they shouldn't, and this is such a laughable idea
I wonder why anyone would suggest it did).
That's bullshit. The semantics are exactly the same. You obviously
decided to be immune to any kind of common sense today.
What the interrupt mapping spec defines is how to _use_ the
value of #address-cells, and how to interpret its absence;
what should be put in #address-cells for separate nodes is
defined elsewhere (namely, in the base spec, and in relevant
device bindings).
There is no such crackpot interpretation. A unit interrupt specifier
contains ... an address. An address format/size is defined by a
#address-cells. Period. That's not an "interpretation", that's the
basic, primary semantic of #address-cells. The fact that the absence of
#address-cells will give a different "default" for the address size
depending on "how" you walk the tree is just a plain wrong bad idea. I
see no reason why it would be or cause or be in any way shape or form
wrong or against the "spirit" of the spec (if not the letter) to
explicitely specify in the case of leaf interrupt controllers, that
their #address-cells is 0 and be done with it.
Ben.
From: Scott Wood <hidden> Date: 2007-07-17 22:25:18
On Wed, Jul 18, 2007 at 07:25:57AM +1000, Benjamin Herrenschmidt wrote:
quoted
quoted
which is why I tend to prefer having it
explicitely in the interrupt controller node :-)
Which is simply incorrect.
It's absolutely not. Please, stop that moronic pin-head behaviour and
find me a single case where that would actually be a problem of any sort
or form.
It could lead someone to the erroneous conclusion that an #address-cells
other than zero in an interrupt controller that is not a device parent is
in any way a sane or supported thing to do.
It could lead people to write code that doesn't handle the absence of
#address-cells in such a node properly.
It could lead to flamewars. :-)
quoted
You mean, the magic default values you used for #address-cells
and #size-cells? That was simply a bug, someone forgot to read
the documentation...
No, defaults are crap, period.
If there's only one value that could possibly make sense, it *not* being
the default is crap.
See above. Besides, as I said, default values are crap. And no, it's not
obvious which nodes define a physical address space or not, at least not
for a generic parser.
The obvious way (which indeed isn't what the suggested algorithm does --
but the suggested algorithm doesn't do anything sensible) is that if you
got to the node via an interrupt-parent or interrupt-map, it doesn't use
#address-cells, and if you got to it by going to the regular device tree
parent, it does.
Pretty much any time you use the unit address in a context other than the
bus parent, things cease making sense.
quoted
In some areas, perhaps. And it would be nice to bring those
areas to the attention of the working group, instead of just
to complain.
The working group is dead and some of the ex members of it expressed
their lack of interest in pursuing these matters.
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2007-07-17 22:59:01
It could lead someone to the erroneous conclusion that an #address-cells
other than zero in an interrupt controller that is not a device parent is
in any way a sane or supported thing to do.
I fail why anyone would ever want to do it though :-)
It could lead people to write code that doesn't handle the absence of
#address-cells in such a node properly.
We just need to make mention that it can be absent in the spec, there
shouldn't be that many parsers out there.
It could lead to flamewars. :-)
Yeah well.
If there's only one value that could possibly make sense, it *not* being
the default is crap.
Only for leaf nodes. Other values do make sense for non-leaf nodes.
The obvious way (which indeed isn't what the suggested algorithm does --
but the suggested algorithm doesn't do anything sensible) is that if you
got to the node via an interrupt-parent or interrupt-map, it doesn't use
#address-cells, and if you got to it by going to the regular device tree
parent, it does.
Yeah well, that's also somewhat debatable too. You need a #address-cells
to be able to parse an interrupt-map. You can imagine cross-links and
special maps used to handle things like the multiple UICs as David did
in the past. I wouldn't get rid of that flexibility to handle corner
cases that aren't easily represented by the "standard" stuff.
Pretty much any time you use the unit address in a context other than the
bus parent, things cease making sense.
See above. Besides, as I said, default values are crap. And no,
it's not
obvious which nodes define a physical address space or not, at
least not
for a generic parser.
The obvious way (which indeed isn't what the suggested algorithm
does --
but the suggested algorithm doesn't do anything sensible) is that
if you
got to the node via an interrupt-parent or interrupt-map, it
doesn't use
#address-cells, and if you got to it by going to the regular device
tree
parent, it does.
Pretty much any time you use the unit address in a context other
than the
bus parent, things cease making sense.
Yes indeed. The problem with your suggested "obvious way"
is that you wouldn't get a unit address included if your
interrupt-map points (for some entry) at your device tree
parent, either. Not all that hypothetical.
Segher
From: Scott Wood <hidden> Date: 2007-07-18 16:47:54
Segher Boessenkool wrote:
Yes indeed. The problem with your suggested "obvious way"
I said it was obvious, not obviously correct. :-)
is that you wouldn't get a unit address included if your
interrupt-map points (for some entry) at your device tree
parent, either. Not all that hypothetical.
Ah, good point. My inclination would be to, rather than check how we
got to the node, check whether it's the device's parent. If not, then
the presence of #address-cells (other than zero for compatibility) is an
error. Otherwise, #address-cells is used, and defaults are handled the
same as with reg/ranges translation.
-Scott
Yes indeed. The problem with your suggested "obvious way"
I said it was obvious, not obviously correct. :-)
I know :-)
quoted
is that you wouldn't get a unit address included if your
interrupt-map points (for some entry) at your device tree
parent, either. Not all that hypothetical.
Ah, good point. My inclination would be to, rather than check how
we got to the node, check whether it's the device's parent. If
not, then the presence of #address-cells (other than zero for
compatibility) is an error. Otherwise, #address-cells is used, and
defaults are handled the same as with reg/ranges translation.
This might work; it is less flexible than the actual interrupt
mapping definition though (and such flexibility is good, as long
as you don't abuse it ;-) ). Anyway, we're stuck with the actual
current imap recommended practice. It might not be perfect but
it does work, is proven in the field, and is the standard.
Segher
Yes, I shouldn't say "defaulted" -- a unit interrupt specifier
simply has no unit address part, in an interrupt domain that
doesn't correspond to a "normal" bus. But saying it like this
is a little bit inexact, and it uses more words.
quoted
which is why I tend to prefer having it
explicitely in the interrupt controller node :-)
Which is simply incorrect.
It's absolutely not.
Of course it is. #address-cells is a property for
bus nodes, you don't go around putting it in unrelated
places, just like you don't put "slot-names" properties
where it has no business.
Oh, wait, you're going to say that is a stupid comparison.
Yeah it is, "slot-names" would be way more harmless, #a is
such a fundamental low-level building block of the OF device
tree that the imap people didn't dare change it semantics
(or, were simply smart enough to not try).
Please, stop that moronic pin-head behaviour and
find me a single case where that would actually be a problem of any =20=
sort
or form.
You want all DTS authors to put properties where they do
not belong, confusing them even further about what all this
stuff is. You want to make this a "requirement", although
it of course won't help anything anywhere, since *even you
_do_ have to follow the rules*, because the Linux code has
to support proper standards-compliant OF device trees, too.
quoted
You mean, the magic default values you used for #address-cells
and #size-cells? That was simply a bug, someone forgot to read
the documentation...
No, defaults are crap, period. This is a general thing.
I'm sorry if you feel that way, but there simply is no
way you can do anything about it; defaults exist, you
have to support them.
Besides, the
spec itself has issues about the default values (remember those blurbs
about PCI and ISA supposedly having different defaults ?)
I remember those very very vaguely. The conclusion was that
people have trouble understanding what they read, if I
remember it right.
Anyway, quit saying vague things about supposed bugs in the
OF documents without pointing them out; it is less than
helpful.
In any way,
defaults are a bad idea and I'm happy to say don't use them.
Sure, feel free to recommend people to explicitly write out
default values. Nothing wrong there, it's just one particular
coding style.
As I've explained enough times though, the issue at hand isn't
about writing out a default value though; you want to require
(not recommend) a completely bogus property where it doesn't
belong. And none of the code will benefit, either. I don't
see the point.
quoted
For this? No way:
[=46rom the base spec]:
=93#address-cells=94 S
Standard property name to define the package=92s address format.
prop-encoded-array: Integer, encoded with encode-int.
This property applies to packages that define a physical
address space, i.e., those packages with =93decode-unit=94
methods. The property value specifies the number of cells
that are used to encode a physical address within that
address space. The value of this property affects the other
functions, commands, and methods that deal with physical
addresses. In a package with a =93decode-unit=94 method, a =
missing
quoted
=93#address-cells=94 property signifies that the number of
address cells is two.
And you omit the various bus bindings that have come up with different
defaults...
a) Do you expect me to quote every OF document in every post?
That would easily exceed the message limits on this list,
sorry.
b) There are no such bindings. Stop confusing people. There
might be a bug in one such binding or so, but that would be
just that, a bug; or maybe it uses confusing language; or
maybe some people just don't know how to read [that would
include me, I'm not trying to escalate this, ahem, polite
conversation]. In any case, please point out the exact
spot where you say this happens.
quoted
See? The flat device tree unfortunately has no decode-unit, but
it is still pretty clear which nodes "define a physical address
space" and which do not.
There is nothing badly defined here.
See above. Besides, as I said, default values are crap.
Hey, maybe if you repeat it often enough, I might start to
believe it. Not that that will help your point, since it
is absolutely irrelevant.
And no, it's not
obvious which nodes define a physical address space or not, at =20
least not
for a generic parser.
"Everything which can have kids with an @ in your DTB full
name thingie". That includes everything with a #address-cells.
Defaults are a bad idea, just get it
I'm getting tired of repeating myself, I hope you do, too.
and move on and stop arguing just for the sake of arguing.
Would you please stop using that childish argument when
you've run out of real ones?
Pointing out the letter
of the spec is not a constructive attitude here.
Not just the letter, also the spirit, and the history.
And of course it _is_ constructive; you want to make a
useless, non-compatible change, are we peasants allowed
to quote the law that even you the mighty king must follow?
It's the only weapon we have you know. Oh, if you discount
the pitchforks ;-)
quoted
Nothing in the "interrupt mapping" spec redefines #address-cells
(OF isn't all that stupid you know); it simply says that a /unit
interrupt specifier/ has no /unit address/ part if there is no
#address-cells. The algorithm in paragraph 7 makes it super
clear how exactly this should work.
No, the algorithm provided isn't clear and is buggy.
Yes it is clear. No it isn't buggy (it _does_ state right
before the algo that some details are left out, maybe that
hurt you?)
I have implemented it so I know what I'm talking about.
Me too.
The fact that basically you end up
with "different" defaults for what is essentially the value
#address-cells depending on whether you are walking the device-tree =20=
for
address resolution or for interrupt resolution is stupid.
Until you realise #address-cells is missing in those two
cases for completely different reasons. In the first case,
#address-cells is missing for historic reasons; there didn't
use to be a #address-cells, everyone implicitly assumed it
was 2, it wasn't a default as such. After #a was introduced,
not specifying it if it was 2 had to be allowed, for compatibility
reasons. To this day, people routinely write trees with implicit
#address-cells =3D <2>, simply since they find it handy [<-- this
is the only thing you can fight with that "defaults are bad"
argument, btw, and you won't get far; most people feel passionately
about their own coding style].
In the interrupt "tree" case though, #address-cells is missing
in certain nodes ***because it simply doesn't belong there!***
The imap spec doesn't put any new rules on #address-cells [how
could it, without risking serious damage], it simply specifies
how to deal with the existing bus tree structure. And not every
node in the interrupt graph is a bus node, so it says how to
form a unit interrupt specifier when there is no #address-cells:
you simply leave out the unit part. Wow. Now that was hard.
And there is no "default" (in your sense) in sight.
Thus, the
solution is simple: don't do defaults. Explicit values are good.
Except where the decisive thing is whether there _is_ a value
at all.
quoted
quoted
and the spec contains gray areas
and contradictions as to what the default values should be in some
circumstances.
In some areas, perhaps. And it would be nice to bring those
areas to the attention of the working group, instead of just
to complain.
The working group is dead
"It's just resting".
and some of the ex members of it expressed
their lack of interest in pursuing these matters.
Some, yes. Even if the WG wouldn't help, there are some other
forums where you can discuss OF bugs; if all else fails, you
could try this mailing list even.
Point remains: it is a terribly bad argument to say "defaults
are bad, ooh I'm creating a rumour there are some vague defaults
in the OF standard right here, without pointing out anything,
ever".
[Here you cut out the part of our little chat where you
suggest the interrupt mapping spec should have said that
if there is no #address-cells in a node, just put something
there]
quoted
If it would, the interrupt mapping spec would have had to say
how the semantics of #address-cells were changed (and they
weren't, and they shouldn't, and this is such a laughable idea
I wonder why anyone would suggest it did).
That's bullshit. The semantics are exactly the same. You obviously
decided to be immune to any kind of common sense today.
Huh? Let me write more abstractly what I said:
"If you change A, A gets changed".
Hard to argue with that I would think, but hey.
quoted
What the interrupt mapping spec defines is how to _use_ the
value of #address-cells, and how to interpret its absence;
what should be put in #address-cells for separate nodes is
defined elsewhere (namely, in the base spec, and in relevant
device bindings).
There is no such crackpot interpretation.
Well please read it again, if that's what you think. Obviously
you didn't understand it on the first try. This is really basic
stuff; it's how standards work.
A unit interrupt specifier
contains ... an address. An address format/size is defined by a
#address-cells.
No. A unit address format is defined by its device binding.
Luckily, for (PCI) interrupt mapping, nothing more than the
unit address _size_ is needed since the imap spec doesn't
concern itself with the semantics of the unit addresses in
question; it just needs some way to get unique identifiers.
Period. That's not an "interpretation", that's the
basic, primary semantic of #address-cells.
Pretty much, yes...
The fact that the absence of
#address-cells will give a different "default" for the address size
depending on "how" you walk the tree is just a plain wrong bad idea.
...so I don't see how you made _this_ mental jump.
There _is_ no default, there is just a different way to
form unit interrupt specifiers for nodes with or without
#address-cells. They are treated differently, because
they _are_ different. Yes you can try to shoehorn them
into one mould by pretending #address-cells exists and
has the value 0; this might be okay for an interrupt tree
walker implementation [or it might not -- the writers of
the example algorithm that you so despise probably had
a reason for writing it out all three times, even though
they aren't all that careful in other places], maybe it
isn't too confusing there, but it certainly is if you put
it in a device tree.
I
see no reason why it would be or cause or be in any way shape or form
wrong or against the "spirit" of the spec (if not the letter) to
explicitely specify in the case of leaf interrupt controllers, that
their #address-cells is 0 and be done with it.
Maybe you don't see it. But the specs make abundantly
clear that _not_ putting an #address-cells here is perfectly
fine, which I thought would have prevented this particular
flame war from happening at all. Oh well.
Segher
@@ -0,0 +1,776 @@+#+# Automatically generated make config: don't edit+# Linux kernel version: 2.6.22-rc4+# Tue Jul 10 11:16:06 2007+#+# CONFIG_PPC64 is not set++#+# Processor support+#+# CONFIG_6xx is not set+# CONFIG_PPC_85xx is not set+# CONFIG_PPC_8xx is not set+CONFIG_40x=y+# CONFIG_44x is not set+# CONFIG_E200 is not set+CONFIG_4xx=y+# CONFIG_PPC_MM_SLICES is not set+CONFIG_NOT_COHERENT_CACHE=y+CONFIG_PPC32=y+CONFIG_PPC_MERGE=y+CONFIG_MMU=y+CONFIG_GENERIC_HARDIRQS=y+CONFIG_IRQ_PER_CPU=y+CONFIG_RWSEM_XCHGADD_ALGORITHM=y+CONFIG_ARCH_HAS_ILOG2_U32=y+CONFIG_GENERIC_HWEIGHT=y+CONFIG_GENERIC_CALIBRATE_DELAY=y+CONFIG_GENERIC_FIND_NEXT_BIT=y+CONFIG_PPC=y+CONFIG_EARLY_PRINTK=y+CONFIG_GENERIC_NVRAM=y+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y+CONFIG_ARCH_MAY_HAVE_PC_FDC=y+CONFIG_PPC_OF=y+# CONFIG_PPC_UDBG_16550 is not set+# CONFIG_GENERIC_TBSYNC is not set+CONFIG_AUDIT_ARCH=y+CONFIG_GENERIC_BUG=y+# CONFIG_DEFAULT_UIMAGE is not set+CONFIG_PPC_DCR_NATIVE=y+# CONFIG_PPC_DCR_MMIO is not set+CONFIG_PPC_DCR=y+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"++#+# Code maturity level options+#+CONFIG_EXPERIMENTAL=y+CONFIG_BROKEN_ON_SMP=y+CONFIG_INIT_ENV_ARG_LIMIT=32++#+# General setup+#+CONFIG_LOCALVERSION=""+CONFIG_LOCALVERSION_AUTO=y+CONFIG_SWAP=y+CONFIG_SYSVIPC=y+# CONFIG_IPC_NS is not set+CONFIG_SYSVIPC_SYSCTL=y+CONFIG_POSIX_MQUEUE=y+# CONFIG_BSD_PROCESS_ACCT is not set+# CONFIG_TASKSTATS is not set+# CONFIG_UTS_NS is not set+# CONFIG_AUDIT is not set+# CONFIG_IKCONFIG is not set+CONFIG_LOG_BUF_SHIFT=14+CONFIG_SYSFS_DEPRECATED=y+# CONFIG_RELAY is not set+CONFIG_BLK_DEV_INITRD=y+CONFIG_INITRAMFS_SOURCE=""+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set+CONFIG_SYSCTL=y+CONFIG_EMBEDDED=y+CONFIG_SYSCTL_SYSCALL=y+CONFIG_KALLSYMS=y+CONFIG_KALLSYMS_ALL=y+CONFIG_KALLSYMS_EXTRA_PASS=y+CONFIG_HOTPLUG=y+CONFIG_PRINTK=y+CONFIG_BUG=y+CONFIG_ELF_CORE=y+CONFIG_BASE_FULL=y+CONFIG_FUTEX=y+CONFIG_ANON_INODES=y+CONFIG_EPOLL=y+CONFIG_SIGNALFD=y+CONFIG_TIMERFD=y+CONFIG_EVENTFD=y+CONFIG_SHMEM=y+CONFIG_VM_EVENT_COUNTERS=y+CONFIG_SLAB=y+# CONFIG_SLUB is not set+# CONFIG_SLOB is not set+CONFIG_RT_MUTEXES=y+# CONFIG_TINY_SHMEM is not set+CONFIG_BASE_SMALL=0++#+# Loadable module support+#+CONFIG_MODULES=y+CONFIG_MODULE_UNLOAD=y+# CONFIG_MODULE_FORCE_UNLOAD is not set+# CONFIG_MODVERSIONS is not set+# CONFIG_MODULE_SRCVERSION_ALL is not set+CONFIG_KMOD=y++#+# Block layer+#+CONFIG_BLOCK=y+CONFIG_LBD=y+# CONFIG_BLK_DEV_IO_TRACE is not set+# CONFIG_LSF is not set++#+# IO Schedulers+#+CONFIG_IOSCHED_NOOP=y+CONFIG_IOSCHED_AS=y+CONFIG_IOSCHED_DEADLINE=y+CONFIG_IOSCHED_CFQ=y+CONFIG_DEFAULT_AS=y+# CONFIG_DEFAULT_DEADLINE is not set+# CONFIG_DEFAULT_CFQ is not set+# CONFIG_DEFAULT_NOOP is not set+CONFIG_DEFAULT_IOSCHED="anticipatory"++#+# Platform support+#+# CONFIG_PPC_MPC52xx is not set+# CONFIG_PPC_MPC5200 is not set+# CONFIG_PPC_CELL is not set+# CONFIG_PPC_CELL_NATIVE is not set+# CONFIG_PQ2ADS is not set+CONFIG_WALNUT=y+CONFIG_405GP=y+CONFIG_IBM405_ERR77=y+CONFIG_IBM405_ERR51=y+# CONFIG_MPIC is not set+# CONFIG_MPIC_WEIRD is not set+# CONFIG_PPC_I8259 is not set+# CONFIG_PPC_RTAS is not set+# CONFIG_MMIO_NVRAM is not set+# CONFIG_PPC_MPC106 is not set+# CONFIG_PPC_970_NAP is not set+# CONFIG_PPC_INDIRECT_IO is not set+# CONFIG_GENERIC_IOMAP is not set+# CONFIG_CPU_FREQ is not set+# CONFIG_CPM2 is not set++#+# Kernel options+#+# CONFIG_HIGHMEM is not set+# CONFIG_HZ_100 is not set+CONFIG_HZ_250=y+# CONFIG_HZ_300 is not set+# CONFIG_HZ_1000 is not set+CONFIG_HZ=250+CONFIG_PREEMPT_NONE=y+# CONFIG_PREEMPT_VOLUNTARY is not set+# CONFIG_PREEMPT is not set+CONFIG_BINFMT_ELF=y+# CONFIG_BINFMT_MISC is not set+# CONFIG_MATH_EMULATION is not set+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y+CONFIG_ARCH_FLATMEM_ENABLE=y+CONFIG_ARCH_POPULATES_NODE_MAP=y+CONFIG_SELECT_MEMORY_MODEL=y+CONFIG_FLATMEM_MANUAL=y+# CONFIG_DISCONTIGMEM_MANUAL is not set+# CONFIG_SPARSEMEM_MANUAL is not set+CONFIG_FLATMEM=y+CONFIG_FLAT_NODE_MEM_MAP=y+# CONFIG_SPARSEMEM_STATIC is not set+CONFIG_SPLIT_PTLOCK_CPUS=4+CONFIG_RESOURCES_64BIT=y+CONFIG_ZONE_DMA_FLAG=1+CONFIG_PROC_DEVICETREE=y+# CONFIG_CMDLINE_BOOL is not set+# CONFIG_PM is not set+CONFIG_SECCOMP=y+CONFIG_WANT_DEVICE_TREE=y+CONFIG_DEVICE_TREE="walnut.dts"+CONFIG_ISA_DMA_API=y++#+# Bus options+#+CONFIG_ZONE_DMA=y+# CONFIG_PCI is not set+# CONFIG_PCI_DOMAINS is not set+# CONFIG_ARCH_SUPPORTS_MSI is not set++#+# PCCARD (PCMCIA/CardBus) support+#+# CONFIG_PCCARD is not set++#+# Advanced setup+#+# CONFIG_ADVANCED_OPTIONS is not set++#+# Default settings for advanced configuration options are used+#+CONFIG_HIGHMEM_START=0xfe000000+CONFIG_LOWMEM_SIZE=0x30000000+CONFIG_KERNEL_START=0xc0000000+CONFIG_TASK_SIZE=0x80000000+CONFIG_CONSISTENT_START=0xff100000+CONFIG_CONSISTENT_SIZE=0x00200000+CONFIG_BOOT_LOAD=0x00400000++#+# Networking+#+CONFIG_NET=y++#+# Networking options+#+CONFIG_PACKET=y+# CONFIG_PACKET_MMAP is not set+CONFIG_UNIX=y+# CONFIG_NET_KEY is not set+CONFIG_INET=y+# CONFIG_IP_MULTICAST is not set+# CONFIG_IP_ADVANCED_ROUTER is not set+CONFIG_IP_FIB_HASH=y+CONFIG_IP_PNP=y+CONFIG_IP_PNP_DHCP=y+CONFIG_IP_PNP_BOOTP=y+# CONFIG_IP_PNP_RARP is not set+# CONFIG_NET_IPIP is not set+# CONFIG_NET_IPGRE is not set+# CONFIG_ARPD is not set+# CONFIG_SYN_COOKIES is not set+# CONFIG_INET_AH is not set+# CONFIG_INET_ESP is not set+# CONFIG_INET_IPCOMP is not set+# CONFIG_INET_XFRM_TUNNEL is not set+# CONFIG_INET_TUNNEL is not set+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set+# CONFIG_INET_XFRM_MODE_TUNNEL is not set+# CONFIG_INET_XFRM_MODE_BEET is not set+CONFIG_INET_DIAG=y+CONFIG_INET_TCP_DIAG=y+# CONFIG_TCP_CONG_ADVANCED is not set+CONFIG_TCP_CONG_CUBIC=y+CONFIG_DEFAULT_TCP_CONG="cubic"+# CONFIG_TCP_MD5SIG is not set+# CONFIG_IPV6 is not set+# CONFIG_INET6_XFRM_TUNNEL is not set+# CONFIG_INET6_TUNNEL is not set+# CONFIG_NETWORK_SECMARK is not set+# CONFIG_NETFILTER is not set+# CONFIG_IP_DCCP is not set+# CONFIG_IP_SCTP is not set+# CONFIG_TIPC is not set+# CONFIG_ATM is not set+# CONFIG_BRIDGE is not set+# CONFIG_VLAN_8021Q is not set+# CONFIG_DECNET is not set+# CONFIG_LLC2 is not set+# CONFIG_IPX is not set+# CONFIG_ATALK is not set+# CONFIG_X25 is not set+# CONFIG_LAPB is not set+# CONFIG_ECONET is not set+# CONFIG_WAN_ROUTER is not set++#+# QoS and/or fair queueing+#+# CONFIG_NET_SCHED is not set++#+# Network testing+#+# CONFIG_NET_PKTGEN is not set+# CONFIG_HAMRADIO is not set+# CONFIG_IRDA is not set+# CONFIG_BT is not set+# CONFIG_AF_RXRPC is not set++#+# Wireless+#+# CONFIG_CFG80211 is not set+# CONFIG_WIRELESS_EXT is not set+# CONFIG_MAC80211 is not set+# CONFIG_IEEE80211 is not set+# CONFIG_RFKILL is not set++#+# Device Drivers+#++#+# Generic Driver Options+#+CONFIG_STANDALONE=y+CONFIG_PREVENT_FIRMWARE_BUILD=y+CONFIG_FW_LOADER=y+# CONFIG_DEBUG_DRIVER is not set+# CONFIG_DEBUG_DEVRES is not set+# CONFIG_SYS_HYPERVISOR is not set++#+# Connector - unified userspace <-> kernelspace linker+#+CONFIG_CONNECTOR=y+CONFIG_PROC_EVENTS=y+# CONFIG_MTD is not set++#+# Parallel port support+#+# CONFIG_PARPORT is not set++#+# Plug and Play support+#+# CONFIG_PNPACPI is not set++#+# Block devices+#+# CONFIG_BLK_DEV_FD is not set+# CONFIG_BLK_DEV_COW_COMMON is not set+# CONFIG_BLK_DEV_LOOP is not set+# CONFIG_BLK_DEV_NBD is not set+CONFIG_BLK_DEV_RAM=y+CONFIG_BLK_DEV_RAM_COUNT=16+CONFIG_BLK_DEV_RAM_SIZE=35000+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024+# CONFIG_CDROM_PKTCDVD is not set+# CONFIG_ATA_OVER_ETH is not set++#+# Misc devices+#+# CONFIG_BLINK is not set+# CONFIG_IDE is not set++#+# SCSI device support+#+# CONFIG_RAID_ATTRS is not set+# CONFIG_SCSI is not set+# CONFIG_SCSI_NETLINK is not set+# CONFIG_ATA is not set++#+# Multi-device support (RAID and LVM)+#+# CONFIG_MD is not set+# CONFIG_MACINTOSH_DRIVERS is not set++#+# Network device support+#+CONFIG_NETDEVICES=y+# CONFIG_DUMMY is not set+# CONFIG_BONDING is not set+# CONFIG_EQUALIZER is not set+# CONFIG_TUN is not set++#+# Ethernet (10 or 100Mbit)+#+# CONFIG_NET_ETHERNET is not set+# CONFIG_IBM_EMAC is not set+CONFIG_NETDEV_1000=y+CONFIG_NETDEV_10000=y++#+# Wireless LAN+#+# CONFIG_WLAN_PRE80211 is not set+# CONFIG_WLAN_80211 is not set+# CONFIG_WAN is not set+# CONFIG_PPP is not set+# CONFIG_SLIP is not set+# CONFIG_SHAPER is not set+# CONFIG_NETCONSOLE is not set+# CONFIG_NETPOLL is not set+# CONFIG_NET_POLL_CONTROLLER is not set++#+# ISDN subsystem+#+# CONFIG_ISDN is not set++#+# Telephony Support+#+# CONFIG_PHONE is not set++#+# Input device support+#+# CONFIG_INPUT is not set++#+# Hardware I/O ports+#+# CONFIG_SERIO is not set+# CONFIG_GAMEPORT is not set++#+# Character devices+#+# CONFIG_VT is not set+# CONFIG_SERIAL_NONSTANDARD is not set++#+# Serial drivers+#+CONFIG_SERIAL_8250=y+CONFIG_SERIAL_8250_CONSOLE=y+CONFIG_SERIAL_8250_NR_UARTS=4+CONFIG_SERIAL_8250_RUNTIME_UARTS=4+CONFIG_SERIAL_8250_EXTENDED=y+# CONFIG_SERIAL_8250_MANY_PORTS is not set+CONFIG_SERIAL_8250_SHARE_IRQ=y+# CONFIG_SERIAL_8250_DETECT_IRQ is not set+# CONFIG_SERIAL_8250_RSA is not set++#+# Non-8250 serial port support+#+# CONFIG_SERIAL_UARTLITE is not set+CONFIG_SERIAL_CORE=y+CONFIG_SERIAL_CORE_CONSOLE=y+CONFIG_SERIAL_OF_PLATFORM=y+CONFIG_UNIX98_PTYS=y+CONFIG_LEGACY_PTYS=y+CONFIG_LEGACY_PTY_COUNT=256++#+# IPMI+#+# CONFIG_IPMI_HANDLER is not set+# CONFIG_WATCHDOG is not set+# CONFIG_HW_RANDOM is not set+# CONFIG_NVRAM is not set+# CONFIG_GEN_RTC is not set+# CONFIG_R3964 is not set+# CONFIG_RAW_DRIVER is not set++#+# TPM devices+#+# CONFIG_TCG_TPM is not set+# CONFIG_I2C is not set++#+# SPI support+#+# CONFIG_SPI is not set+# CONFIG_SPI_MASTER is not set++#+# Dallas's 1-wire bus+#+# CONFIG_W1 is not set+# CONFIG_HWMON is not set++#+# Multifunction device drivers+#+# CONFIG_MFD_SM501 is not set++#+# Multimedia devices+#+# CONFIG_VIDEO_DEV is not set+# CONFIG_DVB_CORE is not set+# CONFIG_DAB is not set++#+# Graphics support+#+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set++#+# Display device support+#+# CONFIG_DISPLAY_SUPPORT is not set+# CONFIG_VGASTATE is not set+# CONFIG_FB is not set+# CONFIG_FB_IBM_GXT4500 is not set++#+# Sound+#+# CONFIG_SOUND is not set++#+# USB support+#+# CONFIG_USB_ARCH_HAS_HCD is not set+# CONFIG_USB_ARCH_HAS_OHCI is not set+# CONFIG_USB_ARCH_HAS_EHCI is not set++#+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'+#++#+# USB Gadget Support+#+# CONFIG_USB_GADGET is not set+# CONFIG_MMC is not set++#+# LED devices+#+# CONFIG_NEW_LEDS is not set++#+# LED drivers+#++#+# LED Triggers+#++#+# InfiniBand support+#++#+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)+#++#+# Real Time Clock+#+# CONFIG_RTC_CLASS is not set++#+# DMA Engine support+#+# CONFIG_DMA_ENGINE is not set++#+# DMA Clients+#++#+# DMA Devices+#++#+# File systems+#+CONFIG_EXT2_FS=y+# CONFIG_EXT2_FS_XATTR is not set+# CONFIG_EXT2_FS_XIP is not set+# CONFIG_EXT3_FS is not set+# CONFIG_EXT4DEV_FS is not set+# CONFIG_REISERFS_FS is not set+# CONFIG_JFS_FS is not set+# CONFIG_FS_POSIX_ACL is not set+# CONFIG_XFS_FS is not set+# CONFIG_GFS2_FS is not set+# CONFIG_OCFS2_FS is not set+# CONFIG_MINIX_FS is not set+# CONFIG_ROMFS_FS is not set+CONFIG_INOTIFY=y+CONFIG_INOTIFY_USER=y+# CONFIG_QUOTA is not set+CONFIG_DNOTIFY=y+# CONFIG_AUTOFS_FS is not set+# CONFIG_AUTOFS4_FS is not set+# CONFIG_FUSE_FS is not set++#+# CD-ROM/DVD Filesystems+#+# CONFIG_ISO9660_FS is not set+# CONFIG_UDF_FS is not set++#+# DOS/FAT/NT Filesystems+#+# CONFIG_MSDOS_FS is not set+# CONFIG_VFAT_FS is not set+# CONFIG_NTFS_FS is not set++#+# Pseudo filesystems+#+CONFIG_PROC_FS=y+CONFIG_PROC_KCORE=y+CONFIG_PROC_SYSCTL=y+CONFIG_SYSFS=y+CONFIG_TMPFS=y+# CONFIG_TMPFS_POSIX_ACL is not set+# CONFIG_HUGETLB_PAGE is not set+CONFIG_RAMFS=y+# CONFIG_CONFIGFS_FS is not set++#+# Miscellaneous filesystems+#+# CONFIG_ADFS_FS is not set+# CONFIG_AFFS_FS is not set+# CONFIG_HFS_FS is not set+# CONFIG_HFSPLUS_FS is not set+# CONFIG_BEFS_FS is not set+# CONFIG_BFS_FS is not set+# CONFIG_EFS_FS is not set+CONFIG_CRAMFS=y+# CONFIG_VXFS_FS is not set+# CONFIG_HPFS_FS is not set+# CONFIG_QNX4FS_FS is not set+# CONFIG_SYSV_FS is not set+# CONFIG_UFS_FS is not set++#+# Network File Systems+#+CONFIG_NFS_FS=y+CONFIG_NFS_V3=y+# CONFIG_NFS_V3_ACL is not set+# CONFIG_NFS_V4 is not set+# CONFIG_NFS_DIRECTIO is not set+# CONFIG_NFSD is not set+CONFIG_ROOT_NFS=y+CONFIG_LOCKD=y+CONFIG_LOCKD_V4=y+CONFIG_NFS_COMMON=y+CONFIG_SUNRPC=y+# CONFIG_SUNRPC_BIND34 is not set+# CONFIG_RPCSEC_GSS_KRB5 is not set+# CONFIG_RPCSEC_GSS_SPKM3 is not set+# CONFIG_SMB_FS is not set+# CONFIG_CIFS is not set+# CONFIG_NCP_FS is not set+# CONFIG_CODA_FS is not set+# CONFIG_AFS_FS is not set+# CONFIG_9P_FS is not set++#+# Partition Types+#+# CONFIG_PARTITION_ADVANCED is not set+CONFIG_MSDOS_PARTITION=y++#+# Native Language Support+#+# CONFIG_NLS is not set++#+# Distributed Lock Manager+#+# CONFIG_DLM is not set+# CONFIG_UCC_SLOW is not set++#+# Library routines+#+CONFIG_BITREVERSE=y+# CONFIG_CRC_CCITT is not set+# CONFIG_CRC16 is not set+# CONFIG_CRC_ITU_T is not set+CONFIG_CRC32=y+# CONFIG_LIBCRC32C is not set+CONFIG_ZLIB_INFLATE=y+CONFIG_PLIST=y+CONFIG_HAS_IOMEM=y+CONFIG_HAS_IOPORT=y+CONFIG_HAS_DMA=y++#+# Instrumentation Support+#+# CONFIG_PROFILING is not set++#+# Kernel hacking+#+# CONFIG_PRINTK_TIME is not set+CONFIG_ENABLE_MUST_CHECK=y+CONFIG_MAGIC_SYSRQ=y+# CONFIG_UNUSED_SYMBOLS is not set+# CONFIG_DEBUG_FS is not set+# CONFIG_HEADERS_CHECK is not set+CONFIG_DEBUG_KERNEL=y+# CONFIG_DEBUG_SHIRQ is not set+CONFIG_DETECT_SOFTLOCKUP=y+# CONFIG_SCHEDSTATS is not set+# CONFIG_TIMER_STATS is not set+# CONFIG_DEBUG_SLAB is not set+# CONFIG_DEBUG_RT_MUTEXES is not set+# CONFIG_RT_MUTEX_TESTER is not set+# CONFIG_DEBUG_SPINLOCK is not set+# CONFIG_DEBUG_MUTEXES is not set+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set+# CONFIG_DEBUG_KOBJECT is not set+CONFIG_DEBUG_BUGVERBOSE=y+# CONFIG_DEBUG_INFO is not set+# CONFIG_DEBUG_VM is not set+# CONFIG_DEBUG_LIST is not set+CONFIG_FORCED_INLINING=y+# CONFIG_RCU_TORTURE_TEST is not set+# CONFIG_FAULT_INJECTION is not set+# CONFIG_DEBUG_STACKOVERFLOW is not set+# CONFIG_DEBUG_STACK_USAGE is not set+# CONFIG_DEBUG_PAGEALLOC is not set+# CONFIG_DEBUGGER is not set+# CONFIG_BDI_SWITCH is not set+# CONFIG_BOOTX_TEXT is not set+# CONFIG_PPC_EARLY_DEBUG is not set++#+# Security options+#+# CONFIG_KEYS is not set+# CONFIG_SECURITY is not set++#+# Cryptographic options+#+CONFIG_CRYPTO=y+CONFIG_CRYPTO_ALGAPI=y+CONFIG_CRYPTO_BLKCIPHER=y+CONFIG_CRYPTO_MANAGER=y+# CONFIG_CRYPTO_HMAC is not set+# CONFIG_CRYPTO_XCBC is not set+# CONFIG_CRYPTO_NULL is not set+# CONFIG_CRYPTO_MD4 is not set+CONFIG_CRYPTO_MD5=y+# CONFIG_CRYPTO_SHA1 is not set+# CONFIG_CRYPTO_SHA256 is not set+# CONFIG_CRYPTO_SHA512 is not set+# CONFIG_CRYPTO_WP512 is not set+# CONFIG_CRYPTO_TGR192 is not set+# CONFIG_CRYPTO_GF128MUL is not set+CONFIG_CRYPTO_ECB=y+CONFIG_CRYPTO_CBC=y+CONFIG_CRYPTO_PCBC=y+# CONFIG_CRYPTO_LRW is not set+# CONFIG_CRYPTO_CRYPTD is not set+CONFIG_CRYPTO_DES=y+# CONFIG_CRYPTO_FCRYPT is not set+# CONFIG_CRYPTO_BLOWFISH is not set+# CONFIG_CRYPTO_TWOFISH is not set+# CONFIG_CRYPTO_SERPENT is not set+# CONFIG_CRYPTO_AES is not set+# CONFIG_CRYPTO_CAST5 is not set+# CONFIG_CRYPTO_CAST6 is not set+# CONFIG_CRYPTO_TEA is not set+# CONFIG_CRYPTO_ARC4 is not set+# CONFIG_CRYPTO_KHAZAD is not set+# CONFIG_CRYPTO_ANUBIS is not set+# CONFIG_CRYPTO_DEFLATE is not set+# CONFIG_CRYPTO_MICHAEL_MIC is not set+# CONFIG_CRYPTO_CRC32C is not set+# CONFIG_CRYPTO_CAMELLIA is not set+# CONFIG_CRYPTO_TEST is not set++#+# Hardware crypto devices+#
@@ -142,6 +142,7 @@ ifneq ($(CONFIG_DEVICE_TREE),"")image-$(CONFIG_PPC_83xx)+=cuImage.83xximage-$(CONFIG_PPC_85xx)+=cuImage.85xximage-$(CONFIG_EBONY)+=treeImage.ebonycuImage.ebony+image-$(CONFIG_WALNUT)+=treeImage.walnutendif# For 32-bit powermacs, build the COFF and miboot images---/dev/null+++linux-2.6/arch/powerpc/boot/treeboot-walnut.c
@@ -0,0 +1,92 @@+/*+*OldU-bootcompatibilityforWalnut+*+*Author:JoshBoyer<jwboyer@linux.vnet.ibm.com>+*+*Copyright2007IBMCorporation+*Basedoncuboot-83xx.c,whichis:+*Copyright(c)2007FreescaleSemiconductor,Inc.+*+*Thisprogramisfreesoftware;youcanredistributeitand/ormodifyit+*underthetermsoftheGNUGeneralPublicLicenseversion2aspublished+*bytheFreeSoftwareFoundation.+*/++#include "ops.h"+#include "stdio.h"+#include "dcr.h"+#include "4xx.h"++externchar_end[];+externchar_dtb_start[];+externchar_dtb_end[];++BSS_STACK(4096);++voidibm405gp_fixup_clocks(unsignedintsysclk,unsignedintser_clk)+{+u32pllmr=mfdcr(0xb0);+u32cpc0_cr0=mfdcr(0xb1);+u32cpc0_cr1=mfdcr(0xb2);+u32cpu,plb,opb,ebc,tb,uart0,uart1,m;+u32fwdv,fbdv,cbdv,opdv,epdv,udiv;++fwdv=(8-((pllmr&0xe0000000)>>29));+fbdv=(pllmr&0x1e000000)>>25;+cbdv=((pllmr&0x00060000)>>17)+1;+opdv=((pllmr&0x00018000)>>15)+1;+epdv=((pllmr&0x00001800)>>13)+2;+udiv=((cpc0_cr0&0x3e)>>1)+1;++m=fwdv*fbdv*cbdv;++cpu=sysclk*m/fwdv;+plb=cpu/cbdv;+opb=plb/opdv;+ebc=plb/epdv;++ if (cpc0_cr0 & 0x80) {+/*uart0usestheexternalclock*/+uart0=ser_clk;+}else{+uart0=cpu/udiv;+}++ if (cpc0_cr0 & 0x40) {+/*uart1usestheexternalclock*/+uart1=ser_clk;+}else{+uart1=cpu/udiv;+}++/*setupthetimebaseclocktotickatthecpufrequency*/+cpc0_cr1=cpc0_cr1&~0x00800000;+mtdcr(0xb2,cpc0_cr1);+tb=cpu;++dt_fixup_cpu_clocks(cpu,tb,0);+dt_fixup_clock("/plb",plb);+dt_fixup_clock("/plb/opb",opb);+dt_fixup_clock("/plb/opb/ebc",ebc);+dt_fixup_clock("/plb/opb/serial@ef600300",uart0);+dt_fixup_clock("/plb/opb/serial@ef600400",uart1);+}++staticvoidwalnut_fixups(void)+{+ibm4xx_fixup_memsize();+ibm405gp_fixup_clocks(33330000,0xa8c000);+ibm4xx_reset_eth((u32*)0xef600800,NULL);+}++voidplatform_init(void)+{+unsignedlongend_of_ram=0x2000000;+unsignedlongavail_ram=end_of_ram-(unsignedlong)_end;++simple_alloc_init(_end,avail_ram,32,32);+platform_ops.fixups=walnut_fixups;+platform_ops.exit=ibm40x_dbcr_reset;+ft_init(_dtb_start,_dtb_end-_dtb_start,32);+serial_console_init();+}
@@ -0,0 +1,68 @@+/*+*Architecture-/platform-specificboot-timeinitializationcodefor+*IBMPowerPC4xxbasedboards.Adaptedfromoriginal+*codebyGaryThomas,CortDougan<cort@fsmlabs.com>,andDanMalek+*<dan@net4x.com>.+*+*Copyright(c)1999-2000GrantErickson<grant@lcse.umn.edu>+*+*Rewrittenandportedtothemergedpowerpctree:+*Copyright2007IBMCorporation+*JoshBoyer<jwboyer@linux.vnet.ibm.com>+*+*2002(c)MontaVista,Software,Inc.Thisfileislicensedunder+*thetermsoftheGNUGeneralPublicLicenseversion2.Thisprogram+*islicensed"as is"withoutanywarrantyofanykind,whetherexpress+*orimplied.+*/++#include<linux/init.h>+#include<asm/machdep.h>+#include<asm/prom.h>+#include<asm/udbg.h>+#include<asm/time.h>+#include<asm/uic.h>+#include<asm/of_platform.h>++staticstructof_device_idwalnut_of_bus[]={+{.compatible="ibm,plb",},+{.compatible="ibm,opb",},+{.compatible="ibm,ebc",},+{},+};++staticint__initwalnut_device_probe(void)+{+if(!machine_is(walnut))+return0;++/* FIXME: do bus probe here */+of_platform_bus_probe(NULL,walnut_of_bus,NULL);++return0;+}+device_initcall(walnut_device_probe);++staticint__initwalnut_probe(void)+{+unsignedlongroot=of_get_flat_dt_root();++if(!of_flat_dt_is_compatible(root,"ibm,walnut"))+return0;++return1;+}++staticvoid__initwalnut_setup_arch(void)+{+}++define_machine(walnut){+.name="Walnut",+.probe=walnut_probe,+.setup_arch=walnut_setup_arch,+.progress=udbg_progress,+.init_IRQ=uic_init_tree,+.get_irq=uic_get_irq,+.calibrate_decr=generic_calibrate_decr,+};---linux-2.6.orig/arch/powerpc/platforms/4xx/Kconfig+++linux-2.6/arch/powerpc/platforms/4xx/Kconfig
@@ -53,13 +53,13 @@# help# This option enables support for the IBM PPC405GPr evaluation board.-#config WALNUT-# bool "Walnut"-# depends on 40x-# default y-# select 405GP-# help-# This option enables support for the IBM PPC405GP evaluation board.+configWALNUT+bool"Walnut"+dependson40x+defaulty+select405GP+help+ThisoptionenablessupportfortheIBMPPC405GPevaluationboard.#config XILINX_ML300# bool "Xilinx-ML300"---linux-2.6.orig/arch/powerpc/platforms/Kconfig+++linux-2.6/arch/powerpc/platforms/Kconfig