LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* regarding lspci
From: rahul @ 2006-07-11  9:29 UTC (permalink / raw)
  To: linuxppc-embedded list, ilugc

Hi All

My target system is  powerpc , linux-2.6.11.
when i give the lspci in my target system , it says "can't find the 
command".
I have seen in the ramdisk directory, i could not see the lspci utility 
or pci utilities. Even in the busybox i could not find the utility.
In linux i have enabled the pci support.

How to get the utility to busybox. I have searched in the net but could 
not succeed.
Can anyone please help me in this regard. plz correct me if i am missing 
some basic configuration .

Thanks & Regards
Rahul

^ permalink raw reply

* Re: regarding lspci
From: Claus Gindhart @ 2006-07-11  9:47 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: ilugc
In-Reply-To: <44B36F85.3010703@gmail.com>

Rahul,

you need to download the pciutils (e.g. 2.1.11) tarball, and cross compile it 
for PPC.

However, i had to patch the configure script to make it cross-compilable. Here 
is the patch

---------------------------8-<-----------------------------------------------
diff -Nurd pciutils-2.1.11.ori/lib/configure pciutils-2.1.11/lib/configure
--- pciutils-2.1.11.ori/lib/configure   2003-01-04 13:29:23.000000000 +0100
+++ pciutils-2.1.11/lib/configure       2006-05-29 11:08:00.000000000 +0200
@@ -12,17 +12,20 @@
 echo_n "Configuring libpci for your system..."
 sharedir=${1:-/usr/share}
 version=${2:-0.0}
-sys=`uname -s`
-rel=`uname -r`
-if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
-then
-       rel=`/usr/bin/oslevel`
-       proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
-       cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
-else
-       cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
-fi
-echo " $sys/$cpu $rel"
+sys=Linux
+rel=2.6.13
+cpu=ppc
+#sys=`uname -s`
+#rel=`uname -r`
+#if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
+#then
+#      rel=`/usr/bin/oslevel`
+#      proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
+#      cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
+#else
+#      cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
+#fi
+#echo " $sys/$cpu $rel"
 
 c=config.h
 echo >$c "#define ARCH_`echo $cpu | tr 'a-z' 'A-Z'`"
---------------------------8-<-----------------------------------------------

For the build, i called
export CROSS=$(CROSS_COMPILE)
make HOST=$(ARCH)

However, depending on your environment, it might by slightly different in your 
case.


On Tuesday 11 July 2006 11:29, rahul wrote:
> Hi All
> 
> My target system is  powerpc , linux-2.6.11.
> when i give the lspci in my target system , it says "can't find the 
> command".
> I have seen in the ramdisk directory, i could not see the lspci utility 
> or pci utilities. Even in the busybox i could not find the utility.
> In linux i have enabled the pci support.
> 
> How to get the utility to busybox. I have searched in the net but could 
> not succeed.
> Can anyone please help me in this regard. plz correct me if i am missing 
> some basic configuration .
> 
> Thanks & Regards
> Rahul
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 

-- 
Mit freundlichen Gruessen / Best regards

Claus Gindhart
SW R&D
Kontron Modular Computers
phone :++49 (0)8341-803-374
ailto:claus.gindhart@kontron-modular.com
http://www.kontron.com

-----BEGIN GEEK CODE BLOCK-----
  Version: 3.1
  GU d- s++:>++:+ a+ C++$ !U !P L++>$ E-- W+(-) N- o?
  K? w !O !M V !PS PE- Y+ PGP+ t 5? X R* tv- b+ DI+++
  D-- G e++> h--- !r x+++
------END GEEK CODE BLOCK------

^ permalink raw reply

* openIPMI for PPC
From: salvatore cusenza @ 2006-07-11 10:38 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 179 bytes --]

Hi,
I have not been able to get OpneIPMI library to compile
with ELDK.
I have not found so far suggestions about building
and configuring OpenIPMI for ppc.
Could anybody help me?

[-- Attachment #2: Type: text/html, Size: 224 bytes --]

^ permalink raw reply

* Re: regarding lspci
From: rahul @ 2006-07-11 10:47 UTC (permalink / raw)
  To: Claus Gindhart; +Cc: ilugc, linuxppc-embedded
In-Reply-To: <200607111147.21820.claus.gindhart@kontron-modular.com>

[-- Attachment #1: Type: text/plain, Size: 3253 bytes --]

Hi Claus.Gindhart

I am facing some problem in applying the patch.

I have copied the pacth to a file "patch-pciutils"

[root@localhost pciutils-2.1.11]# file patch-pciutils
patch-pciutils: 'diff' output text
[root@localhost pciutils-2.1.11]#
when i gave the command :
[root@localhost pciutils-2.1.11]# patch -p1 patch-pciutils
.
.
Nothing happens even after 3/4 minutes...so i am stopping it by ctrl+c.
None of the files are edited.

In the patch u sent , let me know wether it is complete one or configure 
file is left as it is after the lines
c=config.h
echo >$c "#define ARCH_`echo $cpu | tr 'a-z' 'A-Z'`"

Thanks & Regards
Rahul

 




Claus Gindhart wrote:

>Rahul,
>
>you need to download the pciutils (e.g. 2.1.11) tarball, and cross compile it 
>for PPC.
>
>However, i had to patch the configure script to make it cross-compilable. Here 
>is the patch
>
>---------------------------8-<-----------------------------------------------
>diff -Nurd pciutils-2.1.11.ori/lib/configure pciutils-2.1.11/lib/configure
>--- pciutils-2.1.11.ori/lib/configure   2003-01-04 13:29:23.000000000 +0100
>+++ pciutils-2.1.11/lib/configure       2006-05-29 11:08:00.000000000 +0200
>@@ -12,17 +12,20 @@
> echo_n "Configuring libpci for your system..."
> sharedir=${1:-/usr/share}
> version=${2:-0.0}
>-sys=`uname -s`
>-rel=`uname -r`
>-if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
>-then
>-       rel=`/usr/bin/oslevel`
>-       proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
>-       cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
>-else
>-       cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
>-fi
>-echo " $sys/$cpu $rel"
>+sys=Linux
>+rel=2.6.13
>+cpu=ppc
>+#sys=`uname -s`
>+#rel=`uname -r`
>+#if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
>+#then
>+#      rel=`/usr/bin/oslevel`
>+#      proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
>+#      cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
>+#else
>+#      cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
>+#fi
>+#echo " $sys/$cpu $rel"
> 
> c=config.h
> echo >$c "#define ARCH_`echo $cpu | tr 'a-z' 'A-Z'`"
>---------------------------8-<-----------------------------------------------
>
>For the build, i called
>export CROSS=$(CROSS_COMPILE)
>make HOST=$(ARCH)
>
>However, depending on your environment, it might by slightly different in your 
>case.
>
>
>On Tuesday 11 July 2006 11:29, rahul wrote:
>  
>
>>Hi All
>>
>>My target system is  powerpc , linux-2.6.11.
>>when i give the lspci in my target system , it says "can't find the 
>>command".
>>I have seen in the ramdisk directory, i could not see the lspci utility 
>>or pci utilities. Even in the busybox i could not find the utility.
>>In linux i have enabled the pci support.
>>
>>How to get the utility to busybox. I have searched in the net but could 
>>not succeed.
>>Can anyone please help me in this regard. plz correct me if i am missing 
>>some basic configuration .
>>
>>Thanks & Regards
>>Rahul
>>_______________________________________________
>>Linuxppc-embedded mailing list
>>Linuxppc-embedded@ozlabs.org
>>https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>>
>>    
>>
>
>  
>


[-- Attachment #2: Type: text/html, Size: 3918 bytes --]

^ permalink raw reply

* Re: regarding lspci
From: Mark Zhan @ 2006-07-11  9:42 UTC (permalink / raw)
  To: rahul; +Cc: ilugc, linuxppc-embedded list
In-Reply-To: <44B36F85.3010703@gmail.com>

It seems that busybox doesn't support lspci command.

rahul 写道:
> Hi All
> 
> My target system is  powerpc , linux-2.6.11.
> when i give the lspci in my target system , it says "can't find the 
> command".
> I have seen in the ramdisk directory, i could not see the lspci utility 
> or pci utilities. Even in the busybox i could not find the utility.
> In linux i have enabled the pci support.
> 
> How to get the utility to busybox. I have searched in the net but could 
> not succeed.
> Can anyone please help me in this regard. plz correct me if i am missing 
> some basic configuration .
> 
> Thanks & Regards
> Rahul
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply

* Re: regarding lspci
From: Claus Gindhart @ 2006-07-11 12:04 UTC (permalink / raw)
  To: rahul; +Cc: ilugc, linuxppc-embedded
In-Reply-To: <44B381B7.1030500@gmail.com>

Hi Rahul,

Maybe, its better, if you do the modification by hand. This has the advantage, 
that you know, what happens.

Just, search for the following lines
--------------8-<----------------------
sys=`uname -s`
rel=`uname -r`
if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
then
      rel=`/usr/bin/oslevel`
      proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
      cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
else
      cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
fi
echo " $sys/$cpu $rel"
--------------8-<----------------------

Comment them out; they can not work, when cross compiling, because they try to 
detect Kernel version and architecture by using host tools

Then, add the following lines

--------------8-<----------------------
sys=Linux
rel=2.6.13 (or whatever Kernel version you have)
cpu=ppc
--------------8-<----------------------



-- 
Mit freundlichen Gruessen / Best regards

Claus Gindhart
SW R&D
Kontron Modular Computers
phone :++49 (0)8341-803-374
mailto:claus.gindhart@kontron-modular.com
http://www.kontron.com

-----BEGIN GEEK CODE BLOCK-----
  Version: 3.1
  GU d- s++:>++:+ a+ C++$ !U !P L++>$ E-- W+(-) N- o?
  K? w !O !M V !PS PE- Y+ PGP+ t 5? X R* tv- b+ DI+++
  D-- G e++> h--- !r x+++
------END GEEK CODE BLOCK------

^ permalink raw reply

* Re: regarding lspci
From: Sergei Shtylyov @ 2006-07-11 11:59 UTC (permalink / raw)
  To: rahul; +Cc: linuxppc-embedded
In-Reply-To: <44B381B7.1030500@gmail.com>

Hello.

rahul wrote:

> I am facing some problem in applying the patch.

> I have copied the pacth to a file "patch-pciutils"

> [root@localhost pciutils-2.1.11]# file patch-pciutils
> patch-pciutils: 'diff' output text
> [root@localhost pciutils-2.1.11]#
> when i gave the command :
> [root@localhost pciutils-2.1.11]# patch -p1 patch-pciutils
> .
> .
> Nothing happens even after 3/4 minutes...so i am stopping it by ctrl+c.
> None of the files are edited.

    No wonder, patch(1) expects the patch to be fed thru stdin, so you should 
have typed:

patch -p1 < patch-pciutils

> Thanks & Regards
> Rahul

WBR, Sergei

^ permalink raw reply

* Maple platform - adding graphics to IBM PIBS firmware
From: jf simon @ 2006-07-11 13:28 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1152567817.1576.114.camel@localhost.localdomain>

Hi,
We have designed a VME CPU card based on IBM Maple platform.
We've had problems making it work with a PCI/PMC graphic card we've also 
designed based around the ATI Radeon 7000 (RV100 QY). To solve this we 
have linux consultants helping us in emulating the ATI video BIOS at the 
linux kernel level.
But we would like to modify  the PIBs firmware with simple routines 
(scroll,..)  to use the graphic screen attached to the ATI as a text 
(alphanumeric) console. The keyboard would be USB.
Is this possible even if the video BIOs didn't previously  initialize 
the ATI graphic chip?
I realize this question doesn't really belong here...but not sure where 
to ask, sorry about that.
Thanks a lot
-jf simon






	

	
		
___________________________________________________________________________ 
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com

^ permalink raw reply

* No init found
From: morelli.gab @ 2006-07-11 15:34 UTC (permalink / raw)
  To: linuxppc-embedded

help!!

i not understand, because when load the Kernel-2.6 in my board the system=
 block on following message  

"Kernel panic - not syncing: No init found.  Try passing init=3D option t=
o kernel"
 
my filesystem contain the process init into folder sbin i build it whit a=
 busybox-1.1.3

...
mtdblock_open
ok
mtdblock: read on "cramfs" at 0x400, size 0x200
mtdblock: read on "cramfs" at 0x600, size 0x200
mtdblock_release
ok
mtdblock_open
ok
mtdblock: read on "cramfs" at 0x0, size 0x200
mtdblock: read on "cramfs" at 0x200, size 0x200
mtdblock: read on "cramfs" at 0x400, size 0x200
kernel panic........

thanks to all

^ permalink raw reply

* Re: Linux v2.6.18-rc1
From: Steve Fox @ 2006-07-11 17:00 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <1152566236.1576.100.camel@localhost.localdomain>

On Tue, 2006-07-11 at 07:17 +1000, Benjamin Herrenschmidt wrote:

> it's most certainly an irq problem as I just rewrote the irq logic of
> powerpc :) There have been some issues and I've just sent some new
> patches fixing them, let's see if that's enough. I'll give a js20 a try
> today at work.

FWIW, I tried applying the 3 non-Apple-specific patches posted on 7/10
but this didn't help.

-- 

Steve Fox
IBM Linux Technology Center

^ permalink raw reply

* some problems on the SystemACE driver.
From: Ming Liu @ 2006-07-11 19:47 UTC (permalink / raw)
  To: ammubhai; +Cc: linuxppc-embedded

Dear Ameet,
Sorry to bother you again but I am totally confused on the systemACE 
driver. First let me show you the problem.

1. I downloaded the linux kernel of 2.6.17.1, also the patch for SystemACE 
driver. Applied the patch to the kernel. Replaced the xparameters_ml403.h 
with the generated file xparameters_ml300.h from Xilinx EDK. Make 
menuconfig, make dep and make zImage. Then the error shows like this:

drivers/block/xilinx_sysace/xsysace.c:120:6: warning: 
"XPAR_XSYSACE_MEM_WIDTH" is not defined
drivers/block/xilinx_sysace/xsysace.c: In function `XSysAce_LookupConfig':
drivers/block/xilinx_sysace/xsysace.c:366: error: 
`XPAR_XSYSACE_NUM_INSTANCES' undeclared (first use in this function)
drivers/block/xilinx_sysace/xsysace.c:366: error: (Each undeclared 
identifier is reported only once
drivers/block/xilinx_sysace/xsysace.c:366: error: for each function it 
appears in.)
make[3]: *** [drivers/block/xilinx_sysace/xsysace.o] Error 1
make[2]: *** [drivers/block/xilinx_sysace] Error 2
make[1]: *** [drivers/block] Error 2
make: *** [drivers] Error 2

I think this is because of the no inclusion of the xparameters header file. 
So I change #include "xparameters.h" into  #include " 
/home/mingliu/linux-2.6.17.1/arch/ppc/platforms/4xx/xparameters/xparameters.h" 
in the files of xsysace.c and xsysace_g.c, using the full address to 
specify the header file. In fact, this is not a serious problem and it 
often happens. But, after the modification, another problem happened: 

  GEN     .version
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
drivers/built-in.o(.text+0x2234a): In function `XSysAce_GetCfgAddr':
: undefined reference to `XAssertStatus'
drivers/built-in.o(.text+0x2235e): In function `XSysAce_GetCfgAddr':
: undefined reference to `XAssertStatus'
drivers/built-in.o(.text+0x22364): In function `XSysAce_GetCfgAddr':
: undefined reference to `XAssert'
drivers/built-in.o(.text+0x22372): In function `XSysAce_GetCfgAddr':
: undefined reference to `XAssertStatus'
drivers/built-in.o(.text+0x2237a): In function `XSysAce_GetCfgAddr':
: undefined reference to `XAssertStatus'
drivers/built-in.o(.text+0x22394): In function `XSysAce_GetCfgAddr':
: undefined reference to `XAssert'
drivers/built-in.o(.text+0x223a2): In function `XSysAce_GetCfgAddr':
: undefined reference to `XAssertStatus'
drivers/built-in.o(.text+0x223aa): In function `XSysAce_GetCfgAddr':
: undefined reference to `XAssertStatus'
drivers/built-in.o(.text+0x22cd6): In function `XSysAce_Initialize':
: undefined reference to `XAssertStatus'
drivers/built-in.o(.text+0x22cdc): In function `XSysAce_Initialize':
: undefined reference to `XAssert'
drivers/built-in.o(.text+0x22cea): In function `XSysAce_Initialize':
: undefined reference to `XAssertStatus'

......( a long information to say that undefined reference to the XAssert 
things.)

Also, I tried this in the kernel 2.6.16-rc5. (In fact I prefer this version 
because the temac driver is for this version. ) The same problem happened. 
I checked the source code. The problem happened in the file 
driver/block/xilinx_sysace/adapter.c, etc. Also, the XAssert things are 
defined in the file arch/ppc/platforms/4xx/xilinx_ocp/xbasic_types.c. (In 
2.6.16 kernel, it is also defined in driver/xilinx_edk/xbasic_types.c. 
There are two copies of this file. ) I think the problem is, the systemACE 
files cannot link together with the xbasic_types.c file. 

I heard that you have tested this driver. Have you got this problem? Why 
there are so many strange problems for me while you have tested without 
problem? Without the CF card, I cannot try the Temac driver and my work is 
totally blocked. So I have to ask for your suggestion. Really anxious for 
your useful guidance. Thanks a lot!!!!!!

Regards
Ming

_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  

^ permalink raw reply

* [PATCH] PMAC_APM_EMU should depend on ADB_PMU
From: Daniel Drake @ 2006-07-11 21:25 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev, kugelfang

From: Danny van Dyk <kugelfang@gentoo.org>

This patch fixes undefined refereneces to pmu_ symbols on 2.6.17.

Signed-Off-By: Danny van Dyk <kugelfang@gentoo.org>
Signed-off-by: Daniel Drake <dsd@gentoo.org>

Index: linux/drivers/macintosh/Kconfig
===================================================================
--- linux.orig/drivers/macintosh/Kconfig
+++ linux/drivers/macintosh/Kconfig
@@ -100,7 +100,7 @@ config PMAC_SMU
 
 config PMAC_APM_EMU
 	tristate "APM emulation"
-	depends on PPC_PMAC && PPC32 && PM
+	depends on PPC_PMAC && PPC32 && PM && ADB_PMU
 
 config PMAC_MEDIABAY
 	bool "Support PowerBook hotswap media bay"

^ permalink raw reply

* RE: MPC8548 PCIe / PCI support with BSP MPC8548CDS 02/24/2006
From: Ho Jeffrey-r26191 @ 2006-07-11 22:49 UTC (permalink / raw)
  To: 'Florian Boelstler', linuxppc-embedded

Hi Florian,

I have done the PCI config cycle under u-boot. This is very simple and able to find the PEX EP attached to the MPC8548.
In this log, it is reading a pair of MPC8548E connected together using PEX.
Please see the log below:

U-Boot 1.1.4 (Apr 12 2006 - 11:40:53)

CPU:   8548_E, Version: 1.1, (0x80390011)
Core:  e500v2, Version: 1.0, (0x80210010)
Clock Configuration:
       CPU:1333 MHz, CCB: 533 MHz,
       DDR: 266 MHz, LBC:  33 MHz
L1:    D-cache 32 kB enabled
       I-cache 32 kB enabled

Board: MPC85xx Processor Card Rev. A.
       -- Boot Flash is U30

SRIO:  X4 2.5Gbps
PEX :  X4 2.5Gbps
PCI1:  32 bit, async
PCI2:  disabled
I2C:   ready
DRAM:  Initializing
DDR:   256 MB
FLASH: 16 MB
L2 cache 512KB: enabled
In:    serial
Out:   serial
Err:   serial
Net:   eTSEC0: PHY is Marvell 88E1111S (1410cc1)
eTSEC1: PHY is Realtek RTL821x (1cc912)
eTSEC2: PHY is Marvell 88E1111S (1410cc1)
eTSEC3: PHY id ffffffff is not supported!
eTSEC0, eTSEC1, eTSEC2 [PRIME], eTSEC3
eTSEC0 & eTSEC1 in Reduce mode
eTSEC2 & eTSEC3 in Reduce mode
Hit any key to stop autoboot:  0
MPC8548E_Rev1.1=> mm e000a000      	<-setup command register
e000a000: 8000f800 ? 80000004		   Bus master, SERR, Memory space
e000a004: 02001000 ? 06011000
e000a008: 00000000 ? .
MPC8548E_Rev1.1=> mm e000a000	<-Set secondary bus num = 1	
e000a000: 80000004 ? 80000018		  Subordinate bus num = 3
e000a004: 00000000 ? 00010300
e000a008: 00000000 ? .
MPC8548E_Rev1.1=> mm e000a000	<-Check PEX agent ID
e000a000: 80000018 ? 80010000
e000a004: 57191200 ? .
MPC8548E_Rev1.1=> mm e000a000	<-Set PEX agent BAR0 (PEXCSRBAR) 
e000a000: 80010010 ? 80010010		  PEXCSRBAR = 0x80000000
e000a004: 00000000 ? 00000080		  This is the PCI address space
e000a008: 00000000 ? .
MPC8548E_Rev1.1=> mm e000a000	<-Set PEX agent command register
e000a000: 80010014 ? 80010004		   Bus master, SERR, Memory space
e000a004: 00001000 ? 06011000
e000a008: 00000000 ? .
MPC8548E_Rev1.1=> 
mw e000ac20 00080000;		<-Set TAR = 0x80000000 (PCI address space)
mw e000ac24 0;				<-Set 32:64bit TAR = 0x0 (PCI address space)
mw e000ac28 000a0000;		<-Set WBA = 0xa0000000 (ECM, e500 address space) 
mw e000ac30 8004401A			<-Set normal R/W, enable Outbound window
MPC8548E_Rev1.1=>
MPC8548E_Rev1.1=>
MPC8548E_Rev1.1=> mm e000a000	<-check PEX agent BAR0 if written
e000a000: 80010010 ?
e000a004: 00000080 ? .
MPC8548E_Rev1.1=> md a0000000	<-read PEX agent CCSRBAR address use 0xa0000000
a0000000: 000ff700 00000000 00000000 00000000    ................
a0000010: 00000000 00000000 00000000 00000000    ................
a0000020: 00000000 00000000 00000000 00000000    ................
a0000030: 00000000 00000000 00000000 00000000    ................
a0000040: 00000000 00000000 00000000 00000000    ................
a0000050: 00000000 00000000 00000000 00000000    ................
a0000060: 00000000 00000000 00000000 00000000    ................
a0000070: 00000000 00000000 00000000 00000000    ................
a0000080: 00000000 00000000 00000000 00000000    ................
a0000090: 00000000 00000000 00000000 00000000    ................
a00000a0: 00000000 00000000 00000000 00000000    ................
a00000b0: 00000000 00000000 00000000 00000000    ................
a00000c0: 00000000 00000000 00000000 00000000    ................
a00000d0: 00000000 00000000 00000000 00000000    ................
a00000e0: 00000000 00000000 00000000 00000000    ................
a00000f0: 00000000 00000000 00000000 00000000    ................ 

Regards,
Jeffrey Ho
Freescale Semiconductor HK Ltd
Tel: 852-26668050
 

> -----Original Message-----
> From: 
> linuxppc-embedded-bounces+r26191=freescale.com@ozlabs.org 
> [mailto:linuxppc-embedded-bounces+r26191=freescale.com@ozlabs.
> org] On Behalf Of Florian Boelstler
> Sent: Monday, June 26, 2006 6:48 PM
> To: linuxppc-embedded@ozlabs.org
> Subject: MPC8548 PCIe / PCI support with BSP MPC8548CDS 02/24/2006
> 
> Hi,
> 
> I am currently working on a MPC8548-based development system.
> Linux kernel version is 2.6.11 with patches delivered from 
> Freescale (BSP MPC8548CDS 02/24/2006).
> 
> Kernel configuration contains a warning message for CONFIG_PEX:
> "This requires hardware modification to work correctly if 
> your CPU version < 2.0 and will break the PCI bus. [...]"
> 
> I was wondering whether enabling PCIe makes PCI bus 
> functionality unusable at all (including kernel functionality 
> for detecting devices behind a transparent PCI-to-PCI bridge).
> 
> Our setup connects a transparent PLX8516 PCI-to-PCI bridge to 
> the PCIe port of the MPC8548 daughter board. Behind that 
> bridge is another PCIe capable device.
> MPC8548 is configured to run as PCIe host mode.
> 
> When trying to lookup the PCIe devices using lspci I can only 
> see the PPC itself and the bridge.
> However I cannot see the device(s) behind the bridge.
> 
> Is there another method for detecting PCI(e) devices?
> Is "BSP MPC8548CDS 02/24/2006" the latest version 
> corresponding to that hardware?
> 
> Thanks in advance,
> 
>    Florian
> 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 

^ permalink raw reply

* Re: Maple platform - adding graphics to IBM PIBS firmware
From: Benjamin Herrenschmidt @ 2006-07-11 23:02 UTC (permalink / raw)
  To: jf simon; +Cc: linuxppc-dev
In-Reply-To: <44B3A772.3000101@yahoo.fr>

On Tue, 2006-07-11 at 15:28 +0200, jf simon wrote:
> Hi,
> We have designed a VME CPU card based on IBM Maple platform.
> We've had problems making it work with a PCI/PMC graphic card we've also 
> designed based around the ATI Radeon 7000 (RV100 QY). To solve this we 
> have linux consultants helping us in emulating the ATI video BIOS at the 
> linux kernel level.
> But we would like to modify  the PIBs firmware with simple routines 
> (scroll,..)  to use the graphic screen attached to the ATI as a text 
> (alphanumeric) console. The keyboard would be USB.
> Is this possible even if the video BIOs didn't previously  initialize 
> the ATI graphic chip?

If the BIOS hasn't initialized the chip, you are pretty much out of
luck... The good news is that soft-booting an rv100 with the BIOS works
fine, at least from my previous experiemnts with it.

> I realize this question doesn't re
> ally belong here...but not sure where 
> to ask, sorry about that.
> Thanks a lot
> -jf simon
> 
> 
> 
> 
> 
> 
> 	
> 
> 	
> 		
> ___________________________________________________________________________ 
> Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
> http://fr.mail.yahoo.com
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply

* "Bad trap at PC: 3000xxxx, SR: xxxx, vector=xxx Not tainted"
From: chao yu @ 2006-07-11 23:18 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 323 bytes --]

I port the linux 2.4 kernel to our mpc8541 board, but when it executes the
run_init_process("/sbin/init") in the init function, it will disaplay "Bad
trap at PC: 3000xxxx, SR: xxxx, vector=xxx    Not tainted" continually. The
ramdisk is from ELDK 4.0 package for 85xx which is pre-built. Who can tell
me what was happened?

[-- Attachment #2: Type: text/html, Size: 359 bytes --]

^ permalink raw reply

* Re: "Bad trap at PC: 3000xxxx, SR: xxxx, vector=xxx Not tainted"
From: Wolfgang Denk @ 2006-07-11 23:38 UTC (permalink / raw)
  To: chao yu; +Cc: linuxppc-embedded
In-Reply-To: <56c993430607111618q2cd0cfach4abb4d15ea25d05@mail.gmail.com>

In message <56c993430607111618q2cd0cfach4abb4d15ea25d05@mail.gmail.com> you wrote:
> 
> I port the linux 2.4 kernel to our mpc8541 board, but when it executes the
> run_init_process("/sbin/init") in the init function, it will disaplay "Bad
> trap at PC: 3000xxxx, SR: xxxx, vector=xxx    Not tainted" continually. The
> ramdisk is from ELDK 4.0 package for 85xx which is pre-built. Who can tell
> me what was happened?

Well, for one thing ELDK 4.0 is based on a 2.6 kernel...

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Nothing ever becomes real till it is experienced -- even a proverb is
no proverb to you till your life has illustrated it.     - John Keats

^ permalink raw reply

* [PATCH] powerpc: Add tsi108/9 and new hardware interface to mpic
From: Zang Roy-r61911 @ 2006-07-12  3:28 UTC (permalink / raw)
  To: Paul Mackerras, Benjamin Herrenschmidt
  Cc: linuxppc-dev list, Yang Xin-Xin-r48390, Alexandre.Bounine
In-Reply-To: <9FCDBA58F226D911B202000BDBAD4673069C3F3F@zch01exm40.ap.freescale.net>

The patch add new hardware information table for mpic. This enables mpic
code=20
to deal with OpenPIC controller with hardware behavior difference.
Add TSI108/109 PIC hardware information table.  The Tsi108/109 PIC looks
like=20
standard OpenPIC but, in fact, is different in registers mapping and
behavior.
  =20
Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
Signed-off-by: Roy Zang	<tie-fei.zang@freescale.com>=20

---

diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 6e0281a..b8d4423 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -54,6 +54,82 @@ #define distribute_irqs	(0)
 #endif
 #endif
=20
+static struct mpic_info mpic_infos[] =3D {
+	[0] =3D {	/* Original OpenPIC compatible MPIC */
+	.greg_base	=3D MPIC_GREG_BASE,
+	.greg_frr0	=3D MPIC_GREG_FEATURE_0,
+	.greg_config0	=3D MPIC_GREG_GLOBAL_CONF_0,
+	.greg_vendor_id	=3D MPIC_GREG_VENDOR_ID,
+	.greg_ipi_vp0	=3D MPIC_GREG_IPI_VECTOR_PRI_0,
+	.greg_ipi_stride	=3D MPIC_GREG_IPI_STRIDE,
+	.greg_spurious	=3D MPIC_GREG_SPURIOUS,
+	.greg_tfrr	=3D MPIC_GREG_TIMER_FREQ,
+
+	.timer_base	=3D MPIC_TIMER_BASE,
+	.timer_stride	=3D MPIC_TIMER_STRIDE,
+	.timer_ccr	=3D MPIC_TIMER_CURRENT_CNT,
+	.timer_bcr	=3D MPIC_TIMER_BASE_CNT,
+	.timer_vpr	=3D MPIC_TIMER_VECTOR_PRI,
+	.timer_dest	=3D MPIC_TIMER_DESTINATION,
+
+	.cpu_base	=3D MPIC_CPU_BASE,
+	.cpu_stride	=3D MPIC_CPU_STRIDE,
+	.cpu_ipi_disp0	=3D MPIC_CPU_IPI_DISPATCH_0,
+	.cpu_ipi_disp_stride	=3D MPIC_CPU_IPI_DISPATCH_STRIDE,
+	.cpu_task_pri	=3D MPIC_CPU_CURRENT_TASK_PRI,
+	.cpu_whoami	=3D MPIC_CPU_WHOAMI,
+	.cpu_intack	=3D MPIC_CPU_INTACK,
+	.cpu_eoi	=3D MPIC_CPU_EOI,
+
+	.irq_base	=3D MPIC_IRQ_BASE,
+	.irq_stride	=3D MPIC_IRQ_STRIDE,
+	.irq_vpr	=3D MPIC_IRQ_VECTOR_PRI,
+	.irq_vpr_vector	=3D MPIC_VECPRI_VECTOR_MASK,
+	.irq_vpr_polpos	=3D MPIC_VECPRI_POLARITY_POSITIVE,
+	.irq_vpr_polneg =3D MPIC_VECPRI_POLARITY_NEGATIVE,
+	.irq_vpr_senlvl	=3D MPIC_VECPRI_SENSE_LEVEL,
+	.irq_vpr_senedg =3D MPIC_VECPRI_SENSE_EDGE,
+	.irq_dest	=3D MPIC_IRQ_DESTINATION,
+	},
+
+	[1] =3D {	/* Tsi108/109 PIC */
+	.greg_base	=3D TSI108_GREG_BASE,
+	.greg_frr0	=3D TSI108_GREG_FEATURE_0,
+	.greg_config0	=3D TSI108_GREG_GLOBAL_CONF_0,
+	.greg_vendor_id	=3D TSI108_GREG_VENDOR_ID,
+	.greg_ipi_vp0	=3D TSI108_GREG_IPI_VECTOR_PRI_0,
+	.greg_ipi_stride	=3D TSI108_GREG_IPI_STRIDE,
+	.greg_spurious	=3D TSI108_GREG_SPURIOUS,
+	.greg_tfrr	=3D TSI108_GREG_TIMER_FREQ,
+
+	.timer_base	=3D TSI108_TIMER_BASE,
+	.timer_stride	=3D TSI108_TIMER_STRIDE,
+	.timer_ccr	=3D TSI108_TIMER_CURRENT_CNT,
+	.timer_bcr	=3D TSI108_TIMER_BASE_CNT,
+	.timer_vpr	=3D TSI108_TIMER_VECTOR_PRI,
+	.timer_dest	=3D TSI108_TIMER_DESTINATION,
+
+	.cpu_base	=3D TSI108_CPU_BASE,
+	.cpu_stride	=3D TSI108_CPU_STRIDE,
+	.cpu_ipi_disp0	=3D TSI108_CPU_IPI_DISPATCH_0,
+	.cpu_ipi_disp_stride	=3D TSI108_CPU_IPI_DISPATCH_STRIDE,
+	.cpu_task_pri	=3D TSI108_CPU_CURRENT_TASK_PRI,
+	.cpu_whoami	=3D 0xFFFFFFFF,
+	.cpu_intack	=3D TSI108_CPU_INTACK,
+	.cpu_eoi	=3D TSI108_CPU_EOI,
+
+	.irq_base	=3D TSI108_IRQ_REG_BASE,
+	.irq_stride	=3D TSI108_IRQ_STRIDE,
+	.irq_vpr	=3D TSI108_IRQ_VECTOR_PRI,
+	.irq_vpr_vector =3D TSI108_VECPRI_VECTOR_MASK,
+	.irq_vpr_polpos =3D TSI108_VECPRI_POLARITY_POSITIVE,
+	.irq_vpr_polneg =3D TSI108_VECPRI_POLARITY_NEGATIVE,
+	.irq_vpr_senlvl =3D TSI108_VECPRI_SENSE_LEVEL,
+	.irq_vpr_senedg =3D TSI108_VECPRI_SENSE_EDGE,
+	.irq_dest	=3D TSI108_IRQ_DESTINATION,
+	},
+};
+
 /*
  * Register accessor functions
  */
@@ -80,7 +156,8 @@ static inline void _mpic_write(unsigned=20
 static inline u32 _mpic_ipi_read(struct mpic *mpic, unsigned int ipi)
 {
 	unsigned int be =3D (mpic->flags & MPIC_BIG_ENDIAN) !=3D 0;
-	unsigned int offset =3D MPIC_GREG_IPI_VECTOR_PRI_0 + (ipi * 0x10);
+	unsigned int offset =3D mpic->hw_set->greg_ipi_vp0 +
+			      (ipi * mpic->hw_set->greg_ipi_stride);
=20
 	if (mpic->flags & MPIC_BROKEN_IPI)
 		be =3D !be;
@@ -89,7 +166,8 @@ static inline u32 _mpic_ipi_read(struct=20
=20
 static inline void _mpic_ipi_write(struct mpic *mpic, unsigned int ipi,
u32 value)
 {
-	unsigned int offset =3D MPIC_GREG_IPI_VECTOR_PRI_0 + (ipi * 0x10);
+	unsigned int offset =3D mpic->hw_set->greg_ipi_vp0 +
+			      (ipi * mpic->hw_set->greg_ipi_stride);
=20
 	_mpic_write(mpic->flags & MPIC_BIG_ENDIAN, mpic->gregs, offset,
value);
 }
@@ -120,7 +198,7 @@ static inline u32 _mpic_irq_read(struct=20
 	unsigned int	idx =3D src_no & mpic->isu_mask;
=20
 	return _mpic_read(mpic->flags & MPIC_BIG_ENDIAN,
mpic->isus[isu],
-			  reg + (idx * MPIC_IRQ_STRIDE));
+			  reg + (idx * mpic->hw_set->irq_stride));
 }
=20
 static inline void _mpic_irq_write(struct mpic *mpic, unsigned int
src_no,
@@ -130,7 +208,7 @@ static inline void _mpic_irq_write(struc
 	unsigned int	idx =3D src_no & mpic->isu_mask;
=20
 	_mpic_write(mpic->flags & MPIC_BIG_ENDIAN, mpic->isus[isu],
-		    reg + (idx * MPIC_IRQ_STRIDE), value);
+		    reg + (idx * mpic->hw_set->irq_stride), value);
 }
=20
 #define mpic_read(b,r)		_mpic_read(mpic->flags &
MPIC_BIG_ENDIAN,(b),(r))
@@ -156,8 +234,8 @@ static void __init mpic_test_broken_ipi(
 {
 	u32 r;
=20
-	mpic_write(mpic->gregs, MPIC_GREG_IPI_VECTOR_PRI_0,
MPIC_VECPRI_MASK);
-	r =3D mpic_read(mpic->gregs, MPIC_GREG_IPI_VECTOR_PRI_0);
+	mpic_write(mpic->gregs, mpic->hw_set->greg_ipi_vp0,
MPIC_VECPRI_MASK);
+	r =3D mpic_read(mpic->gregs, mpic->hw_set->greg_ipi_vp0);
=20
 	if (r =3D=3D le32_to_cpu(MPIC_VECPRI_MASK)) {
 		printk(KERN_INFO "mpic: Detected reversed IPI
registers\n");
@@ -394,8 +472,8 @@ static inline struct mpic * mpic_from_ir
 /* Send an EOI */
 static inline void mpic_eoi(struct mpic *mpic)
 {
-	mpic_cpu_write(MPIC_CPU_EOI, 0);
-	(void)mpic_cpu_read(MPIC_CPU_WHOAMI);
+	mpic_cpu_write(mpic->hw_set->cpu_eoi, 0);
+	(void)mpic_cpu_read(mpic->hw_set->cpu_task_pri);
 }
=20
 #ifdef CONFIG_SMP
@@ -419,8 +497,8 @@ static void mpic_unmask_irq(unsigned int
=20
 	DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq,
src);
=20
-	mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI,
-		       mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) &
+	mpic_irq_write(src, mpic->hw_set->irq_vpr,
+		       mpic_irq_read(src, mpic->hw_set->irq_vpr) &
 		       ~MPIC_VECPRI_MASK);
 	/* make sure mask gets to controller before we return to user */
 	do {
@@ -428,7 +506,7 @@ static void mpic_unmask_irq(unsigned int
 			printk(KERN_ERR "mpic_enable_irq timeout\n");
 			break;
 		}
-	} while(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) &
MPIC_VECPRI_MASK);
+	} while(mpic_irq_read(src, mpic->hw_set->irq_vpr) &
MPIC_VECPRI_MASK);=09
 }
=20
 static void mpic_mask_irq(unsigned int irq)
@@ -439,8 +517,8 @@ static void mpic_mask_irq(unsigned int i
=20
 	DBG("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src);
=20
-	mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI,
-		       mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) |
+	mpic_irq_write(src, mpic->hw_set->irq_vpr,
+		       mpic_irq_read(src, mpic->hw_set->irq_vpr) |
 		       MPIC_VECPRI_MASK);
=20
 	/* make sure mask gets to controller before we return to user */
@@ -449,7 +527,7 @@ static void mpic_mask_irq(unsigned int i
 			printk(KERN_ERR "mpic_enable_irq timeout\n");
 			break;
 		}
-	} while(!(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) &
MPIC_VECPRI_MASK));
+	} while(!(mpic_irq_read(src, mpic->hw_set->irq_vpr) &
MPIC_VECPRI_MASK));
 }
=20
 static void mpic_end_irq(unsigned int irq)
@@ -560,24 +638,28 @@ static void mpic_set_affinity(unsigned i
=20
 	cpus_and(tmp, cpumask, cpu_online_map);
=20
-	mpic_irq_write(src, MPIC_IRQ_DESTINATION,
+	mpic_irq_write(src, mpic->hw_set->irq_dest,
 		       mpic_physmask(cpus_addr(tmp)[0]));=09
 }
=20
-static unsigned int mpic_type_to_vecpri(unsigned int type)
+static unsigned int mpic_type_to_vecpri(struct mpic *mpic, unsigned int
type)
 {
 	/* Now convert sense value */
 	switch(type & IRQ_TYPE_SENSE_MASK) {
 	case IRQ_TYPE_EDGE_RISING:
-		return MPIC_VECPRI_SENSE_EDGE |
MPIC_VECPRI_POLARITY_POSITIVE;
+		return mpic->hw_set->irq_vpr_senedg |
+			mpic->hw_set->irq_vpr_polpos;
 	case IRQ_TYPE_EDGE_FALLING:
 	case IRQ_TYPE_EDGE_BOTH:
-		return MPIC_VECPRI_SENSE_EDGE |
MPIC_VECPRI_POLARITY_NEGATIVE;
+		return mpic->hw_set->irq_vpr_senedg |
+			mpic->hw_set->irq_vpr_polneg;
 	case IRQ_TYPE_LEVEL_HIGH:
-		return MPIC_VECPRI_SENSE_LEVEL |
MPIC_VECPRI_POLARITY_POSITIVE;
+		return mpic->hw_set->irq_vpr_senlvl |
+			mpic->hw_set->irq_vpr_polpos;
 	case IRQ_TYPE_LEVEL_LOW:
 	default:
-		return MPIC_VECPRI_SENSE_LEVEL |
MPIC_VECPRI_POLARITY_NEGATIVE;
+		return mpic->hw_set->irq_vpr_senlvl |
+			mpic->hw_set->irq_vpr_polneg;
 	}
 }
=20
@@ -609,13 +691,13 @@ static int mpic_set_irq_type(unsigned in
 		vecpri =3D MPIC_VECPRI_POLARITY_POSITIVE |
 			MPIC_VECPRI_SENSE_EDGE;
 	else
-		vecpri =3D mpic_type_to_vecpri(flow_type);
+		vecpri =3D mpic_type_to_vecpri(mpic, flow_type);
=20
-	vold =3D mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI);
+	vold =3D mpic_irq_read(src, mpic->hw_set->irq_vpr);
 	vnew =3D vold & ~(MPIC_VECPRI_POLARITY_MASK |
MPIC_VECPRI_SENSE_MASK);
 	vnew |=3D vecpri;
 	if (vold !=3D vnew)
-		mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, vnew);
+		mpic_irq_write(src, mpic->hw_set->irq_vpr, vnew);
=20
 	return 0;
 }
@@ -797,18 +879,20 @@ #endif /* CONFIG_SMP */
 	mpic->isu_size =3D isu_size;
 	mpic->irq_count =3D irq_count;
 	mpic->num_sources =3D 0; /* so far */
+	mpic->hw_set =3D &mpic_infos[MPIC_GET_MOD_ID(flags)];
=20
 	/* Map the global registers */
-	mpic->gregs =3D ioremap(phys_addr + MPIC_GREG_BASE, 0x1000);
-	mpic->tmregs =3D mpic->gregs + ((MPIC_TIMER_BASE - MPIC_GREG_BASE)
>> 2);
+	mpic->gregs =3D ioremap(phys_addr + mpic->hw_set->greg_base,
0x1000);
+	mpic->tmregs =3D mpic->gregs +
+		       ((mpic->hw_set->timer_base -
mpic->hw_set->greg_base) >> 2);
 	BUG_ON(mpic->gregs =3D=3D NULL);
=20
 	/* Reset */
 	if (flags & MPIC_WANTS_RESET) {
-		mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_0,
-			   mpic_read(mpic->gregs,
MPIC_GREG_GLOBAL_CONF_0)
+		mpic_write(mpic->gregs, mpic->hw_set->greg_config0,
+			   mpic_read(mpic->gregs,
mpic->hw_set->greg_config0)
 			   | MPIC_GREG_GCONF_RESET);
-		while( mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_0)
+		while( mpic_read(mpic->gregs,
mpic->hw_set->greg_config0)
 		       & MPIC_GREG_GCONF_RESET)
 			mb();
 	}
@@ -817,7 +901,7 @@ #endif /* CONFIG_SMP */
 	 * MPICs, num sources as well. On ISU MPICs, sources are counted
 	 * as ISUs are added
 	 */
-	reg =3D mpic_read(mpic->gregs, MPIC_GREG_FEATURE_0);
+	reg =3D mpic_read(mpic->gregs, mpic->hw_set->greg_frr0);
 	mpic->num_cpus =3D ((reg & MPIC_GREG_FEATURE_LAST_CPU_MASK)
 			  >> MPIC_GREG_FEATURE_LAST_CPU_SHIFT) + 1;
 	if (isu_size =3D=3D 0)
@@ -826,16 +910,16 @@ #endif /* CONFIG_SMP */
=20
 	/* Map the per-CPU registers */
 	for (i =3D 0; i < mpic->num_cpus; i++) {
-		mpic->cpuregs[i] =3D ioremap(phys_addr + MPIC_CPU_BASE +
-					   i * MPIC_CPU_STRIDE, 0x1000);
+		mpic->cpuregs[i] =3D ioremap(phys_addr +
mpic->hw_set->cpu_base +
+					   i * mpic->hw_set->cpu_stride,
0x1000);
 		BUG_ON(mpic->cpuregs[i] =3D=3D NULL);
 	}
=20
 	/* Initialize main ISU if none provided */
 	if (mpic->isu_size =3D=3D 0) {
 		mpic->isu_size =3D mpic->num_sources;
-		mpic->isus[0] =3D ioremap(phys_addr + MPIC_IRQ_BASE,
-					MPIC_IRQ_STRIDE *
mpic->isu_size);
+		mpic->isus[0] =3D ioremap(phys_addr +
mpic->hw_set->irq_base,
+					mpic->hw_set->irq_stride *
mpic->isu_size);
 		BUG_ON(mpic->isus[0] =3D=3D NULL);
 	}
 	mpic->isu_shift =3D 1 + __ilog2(mpic->isu_size - 1);
@@ -879,7 +963,8 @@ void __init mpic_assign_isu(struct mpic=20
=20
 	BUG_ON(isu_num >=3D MPIC_MAX_ISU);
=20
-	mpic->isus[isu_num] =3D ioremap(phys_addr, MPIC_IRQ_STRIDE *
mpic->isu_size);
+	mpic->isus[isu_num] =3D ioremap(phys_addr,
+				      mpic->hw_set->irq_stride *
mpic->isu_size);
 	if ((isu_first + mpic->isu_size) > mpic->num_sources)
 		mpic->num_sources =3D isu_first + mpic->isu_size;
 }
@@ -904,14 +989,15 @@ void __init mpic_init(struct mpic *mpic)
 	printk(KERN_INFO "mpic: Initializing for %d sources\n",
mpic->num_sources);
=20
 	/* Set current processor priority to max */
-	mpic_cpu_write(MPIC_CPU_CURRENT_TASK_PRI, 0xf);
+	mpic_cpu_write(mpic->hw_set->cpu_task_pri, 0xf);
=20
 	/* Initialize timers: just disable them all */
 	for (i =3D 0; i < 4; i++) {
 		mpic_write(mpic->tmregs,
-			   i * MPIC_TIMER_STRIDE +
MPIC_TIMER_DESTINATION, 0);
+			   i * mpic->hw_set->timer_stride +
+			   mpic->hw_set->timer_dest, 0);
 		mpic_write(mpic->tmregs,
-			   i * MPIC_TIMER_STRIDE +
MPIC_TIMER_VECTOR_PRI,
+			   i * mpic->hw_set->timer_stride +
mpic->hw_set->timer_vpr,
 			   MPIC_VECPRI_MASK |
 			   (MPIC_VEC_TIMER_0 + i));
 	}
@@ -940,21 +1026,22 @@ void __init mpic_init(struct mpic *mpic)
 			(8 << MPIC_VECPRI_PRIORITY_SHIFT);
 	=09
 		/* init hw */
-		mpic_irq_write(i, MPIC_IRQ_VECTOR_PRI, vecpri);
-		mpic_irq_write(i, MPIC_IRQ_DESTINATION,
+		mpic_irq_write(i, mpic->hw_set->irq_vpr, vecpri);
+		mpic_irq_write(i, mpic->hw_set->irq_dest,
 			       1 << hard_smp_processor_id());
 	}
 =09
 	/* Init spurrious vector */
-	mpic_write(mpic->gregs, MPIC_GREG_SPURIOUS, MPIC_VEC_SPURRIOUS);
+	mpic_write(mpic->gregs, mpic->hw_set->greg_spurious,
MPIC_VEC_SPURRIOUS);
=20
-	/* Disable 8259 passthrough */
-	mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_0,
-		   mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_0)
-		   | MPIC_GREG_GCONF_8259_PTHROU_DIS);
+	/* Disable 8259 passthrough, if supported */
+	if (MPIC_GET_MOD_ID(mpic->flags) !=3D MPIC_ID_TSI108)
+		mpic_write(mpic->gregs, mpic->hw_set->greg_config0,
+			   mpic_read(mpic->gregs,
mpic->hw_set->greg_config0)
+			   | MPIC_GREG_GCONF_8259_PTHROU_DIS);
=20
 	/* Set current processor priority to 0 */
-	mpic_cpu_write(MPIC_CPU_CURRENT_TASK_PRI, 0);
+	mpic_cpu_write(mpic->hw_set->cpu_task_pri, 0);
 }
=20
 void __init mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio)
@@ -997,9 +1084,9 @@ void mpic_irq_set_priority(unsigned int=20
 		mpic_ipi_write(src - MPIC_VEC_IPI_0,
 			       reg | (pri <<
MPIC_VECPRI_PRIORITY_SHIFT));
 	} else {
-		reg =3D mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI)
+		reg =3D mpic_irq_read(src, mpic->hw_set->irq_vpr)
 			& ~MPIC_VECPRI_PRIORITY_MASK;
-		mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI,
+		mpic_irq_write(src, mpic->hw_set->irq_vpr,
 			       reg | (pri <<
MPIC_VECPRI_PRIORITY_SHIFT));
 	}
 	spin_unlock_irqrestore(&mpic_lock, flags);
@@ -1017,7 +1104,7 @@ unsigned int mpic_irq_get_priority(unsig
 	if (is_ipi)
 		reg =3D mpic_ipi_read(src =3D MPIC_VEC_IPI_0);
 	else
-		reg =3D mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI);
+		reg =3D mpic_irq_read(src, mpic->hw_set->irq_vpr);
 	spin_unlock_irqrestore(&mpic_lock, flags);
 	return (reg & MPIC_VECPRI_PRIORITY_MASK) >>
MPIC_VECPRI_PRIORITY_SHIFT;
 }
@@ -1043,12 +1130,12 @@ #ifdef CONFIG_SMP
  	 */
 	if (distribute_irqs) {
 	 	for (i =3D 0; i < mpic->num_sources ; i++)
-			mpic_irq_write(i, MPIC_IRQ_DESTINATION,
-				mpic_irq_read(i, MPIC_IRQ_DESTINATION) |
msk);
+			mpic_irq_write(i, mpic->hw_set->irq_dest,
+				mpic_irq_read(i, mpic->hw_set->irq_dest)
| msk);
 	}
=20
 	/* Set current processor priority to 0 */
-	mpic_cpu_write(MPIC_CPU_CURRENT_TASK_PRI, 0);
+	mpic_cpu_write(mpic->hw_set->cpu_task_pri, 0);
=20
 	spin_unlock_irqrestore(&mpic_lock, flags);
 #endif /* CONFIG_SMP */
@@ -1058,7 +1145,7 @@ int mpic_cpu_get_priority(void)
 {
 	struct mpic *mpic =3D mpic_primary;
=20
-	return mpic_cpu_read(MPIC_CPU_CURRENT_TASK_PRI);
+	return mpic_cpu_read(mpic->hw_set->cpu_task_pri);
 }
=20
 void mpic_cpu_set_priority(int prio)
@@ -1066,7 +1153,7 @@ void mpic_cpu_set_priority(int prio)
 	struct mpic *mpic =3D mpic_primary;
=20
 	prio &=3D MPIC_CPU_TASKPRI_MASK;
-	mpic_cpu_write(MPIC_CPU_CURRENT_TASK_PRI, prio);
+	mpic_cpu_write(mpic->hw_set->cpu_task_pri, prio);
 }
=20
 /*
@@ -1088,11 +1175,11 @@ void mpic_teardown_this_cpu(int secondar
=20
 	/* let the mpic know we don't want intrs.  */
 	for (i =3D 0; i < mpic->num_sources ; i++)
-		mpic_irq_write(i, MPIC_IRQ_DESTINATION,
-			mpic_irq_read(i, MPIC_IRQ_DESTINATION) & ~msk);
+		mpic_irq_write(i, mpic->hw_set->irq_dest,
+			mpic_irq_read(i, mpic->hw_set->irq_dest) &
~msk);
=20
 	/* Set current processor priority to max */
-	mpic_cpu_write(MPIC_CPU_CURRENT_TASK_PRI, 0xf);
+	mpic_cpu_write(mpic->hw_set->cpu_task_pri, 0xf);
=20
 	spin_unlock_irqrestore(&mpic_lock, flags);
 }
@@ -1108,7 +1195,8 @@ #ifdef DEBUG_IPI
 	DBG("%s: send_ipi(ipi_no: %d)\n", mpic->name, ipi_no);
 #endif
=20
-	mpic_cpu_write(MPIC_CPU_IPI_DISPATCH_0 + ipi_no * 0x10,
+	mpic_cpu_write(mpic->hw_set->cpu_ipi_disp0 +
+		       ipi_no * mpic->hw_set->cpu_ipi_disp_stride,
 		       mpic_physmask(cpu_mask &
cpus_addr(cpu_online_map)[0]));
 }
=20
@@ -1116,7 +1204,7 @@ unsigned int mpic_get_one_irq(struct mpi
 {
 	u32 src;
=20
-	src =3D mpic_cpu_read(MPIC_CPU_INTACK) & MPIC_VECPRI_VECTOR_MASK;
+	src =3D mpic_cpu_read(mpic->hw_set->cpu_intack) &
mpic->hw_set->irq_vpr_vector;
 #ifdef DEBUG_LOW
 	DBG("%s: get_one_irq(): %d\n", mpic->name, src);
 #endif

diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
index eb241c9..073dabc 100644
--- a/include/asm-powerpc/mpic.h
+++ b/include/asm-powerpc/mpic.h
@@ -41,6 +41,7 @@ #define MPIC_GREG_IPI_VECTOR_PRI_0	0x000
 #define MPIC_GREG_IPI_VECTOR_PRI_1	0x000b0
 #define MPIC_GREG_IPI_VECTOR_PRI_2	0x000c0
 #define MPIC_GREG_IPI_VECTOR_PRI_3	0x000d0
+#define MPIC_GREG_IPI_STRIDE		0x10
 #define MPIC_GREG_SPURIOUS		0x000e0
 #define MPIC_GREG_TIMER_FREQ		0x000f0
=20
@@ -68,6 +69,7 @@ #define MPIC_CPU_IPI_DISPATCH_0		0x00040
 #define MPIC_CPU_IPI_DISPATCH_1		0x00050
 #define MPIC_CPU_IPI_DISPATCH_2		0x00060
 #define MPIC_CPU_IPI_DISPATCH_3		0x00070
+#define MPIC_CPU_IPI_DISPATCH_STRIDE	0x00010
 #define MPIC_CPU_CURRENT_TASK_PRI	0x00080
 #define 	MPIC_CPU_TASKPRI_MASK			0x0000000f
 #define MPIC_CPU_WHOAMI			0x00090
@@ -95,6 +97,57 @@ #define 	MPIC_VECPRI_SENSE_EDGE
0x0000
 #define 	MPIC_VECPRI_SENSE_MASK			0x00400000
 #define MPIC_IRQ_DESTINATION		0x00010
=20
+/**********************************************************************
********
+ * Tsi108 implementation of MPIC has many differences form the original
one
+ */
+
+/*
+ * Global registers
+ */
+
+#define TSI108_GREG_BASE		0x00000
+#define TSI108_GREG_FEATURE_0		0x00000
+#define TSI108_GREG_GLOBAL_CONF_0	0x00004
+#define TSI108_GREG_VENDOR_ID		0x0000c
+#define TSI108_GREG_IPI_VECTOR_PRI_0	0x00204		/* Doorbell 0 */
+#define TSI108_GREG_IPI_STRIDE		0x0c
+#define TSI108_GREG_SPURIOUS		0x00010
+#define TSI108_GREG_TIMER_FREQ		0x00014
+
+/*
+ * Timer registers
+ */
+#define TSI108_TIMER_BASE		0x0030
+#define TSI108_TIMER_STRIDE		0x10
+#define TSI108_TIMER_CURRENT_CNT	0x00000
+#define TSI108_TIMER_BASE_CNT		0x00004
+#define TSI108_TIMER_VECTOR_PRI		0x00008
+#define TSI108_TIMER_DESTINATION	0x0000c
+
+/*
+ * Per-Processor registers
+ */
+#define TSI108_CPU_BASE			0x00300
+#define TSI108_CPU_STRIDE		0x00040
+#define TSI108_CPU_IPI_DISPATCH_0	0x00200
+#define TSI108_CPU_IPI_DISPATCH_STRIDE	0x00000
+#define TSI108_CPU_CURRENT_TASK_PRI	0x00000
+#define TSI108_CPU_INTACK		0x00004
+#define TSI108_CPU_EOI			0x00008
+
+/*
+ * Per-source registers
+ */
+#define TSI108_IRQ_REG_BASE		0x00100
+#define TSI108_IRQ_STRIDE		0x00008
+#define TSI108_IRQ_VECTOR_PRI		0x00000
+#define TSI108_VECPRI_VECTOR_MASK	0x000000ff
+#define TSI108_VECPRI_POLARITY_POSITIVE	0x01000000
+#define TSI108_VECPRI_POLARITY_NEGATIVE	0x00000000
+#define TSI108_VECPRI_SENSE_LEVEL	0x02000000
+#define TSI108_VECPRI_SENSE_EDGE	0x00000000
+#define TSI108_IRQ_DESTINATION		0x00004
+
 #define MPIC_MAX_IRQ_SOURCES	2048
 #define MPIC_MAX_CPUS		32
 #define MPIC_MAX_ISU		32
@@ -125,6 +178,42 @@ struct mpic_irq_fixup
 };
 #endif /* CONFIG_MPIC_BROKEN_U3 */
=20
+struct mpic_info {
+	u32	greg_base;	/* offset of global registers from MPIC
base */
+	u32	greg_frr0;	/* FRR0 offset from base */
+	u32	greg_config0;	/* Global Config register offset from
base */
+	u32	greg_vendor_id;	/* VID register offset from base */
+	u32	greg_ipi_vp0;	/* IPI Vector/Priority Registers */
+	u32	greg_ipi_stride; /* IPI Vector/Priority Registers
spacing */
+	u32	greg_spurious;	/* Spurious Vector Register */
+	u32	greg_tfrr;	/* Global Timer Frequency Reporting
Register */
+
+	u32	timer_base;	/* Global Timer Registers base */
+	u32	timer_stride;	/* Global Timer Registers spacing */
+	u32	timer_ccr;	/* Global Timer Current Count Register
*/
+	u32	timer_bcr;	/* Global Timer Base Count Register */
+	u32	timer_vpr;	/* Global Timer Vector/Priority Register
*/
+	u32	timer_dest;	/* Global Timer Destination Register */
+
+	u32	cpu_base;	/* Global Timer Destination Register */
+	u32	cpu_stride;	/* Global Timer Destination Register */
+	u32	cpu_ipi_disp0;	/* IPI 0 Dispatch Command Register */
+	u32	cpu_ipi_disp_stride;	/* IPI Dispatch spacing */
+	u32	cpu_task_pri;	/* Processor Current Task Priority
Register */
+	u32	cpu_whoami;	/* Who Am I Register */
+	u32	cpu_intack;	/* Interrupt Acknowledge Register */
+	u32	cpu_eoi;	/* End of Interrupt Register */
+
+	u32	irq_base;	/* Interrupt registers base */
+	u32	irq_stride;	/* Interrupt registers spacing */
+	u32	irq_vpr;	/* Interrupt Vector/Priority Register */
+	u32	irq_vpr_vector;	/* Interrupt Vector Mask */
+	u32	irq_vpr_polpos;	/* Interrupt Positive Polarity bit */
+	u32	irq_vpr_polneg;	/* Interrupt Negative Polarity bit */
+	u32	irq_vpr_senlvl;	/* Interrupt Level Sense bit */
+	u32	irq_vpr_senedg;	/* Interrupt edge Sense bit */
+	u32	irq_dest;	/* Interrupt Destination Register */
+};
=20
 /* The instance data of a given MPIC */
 struct mpic
@@ -170,6 +259,8 @@ #endif
 	volatile u32 __iomem	*tmregs;
 	volatile u32 __iomem	*cpuregs[MPIC_MAX_CPUS];
 	volatile u32 __iomem	*isus[MPIC_MAX_ISU];
+	/* Pointer to HW info structure */
+	struct mpic_info	*hw_set;
=20
 	/* link */
 	struct mpic		*next;
@@ -188,6 +279,14 @@ #define MPIC_BROKEN_U3
0x00000004
 #define MPIC_BROKEN_IPI			0x00000008
 /* MPIC wants a reset */
 #define MPIC_WANTS_RESET		0x00000010
+/* Spurious vector requires EOI */
+#define MPIC_SPV_EOI			0x00000020
+/* MPIC HW modification ID */
+#define MPIC_MOD_ID_MASK		0x00000f00
+#define MPIC_MOD_ID(val)		(((val) << 8) &
MPIC_MOD_ID_MASK)
+#define MPIC_GET_MOD_ID(flags)		(((flags) & MPIC_MOD_ID_MASK) >>
8)
+#define	MPIC_ID_MPIC		0	/* Original MPIC */
+#define	MPIC_ID_TSI108		1	/* Tsi108/109 PIC */
=20
 /* Allocate the controller structure and setup the linux irq descs
  * for the range if interrupts passed in. No HW initialization is

^ permalink raw reply related

* [PATCH] Mark platform device data as const
From: Jeremy Kerr @ 2006-07-12  3:56 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: greg
In-Reply-To: <17581.40865.169428.154793@cargo.ozlabs.ibm.com>

platform_device_add_data()'s data argument can be qualified as const -
the function just copies it to another buffer.

This neatens-up storing other const-ed data there.

Built for powerpc and i386

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---
resend: Include the platform_device.h change this time.

 drivers/base/platform.c         |    3 ++-
 include/linux/platform_device.h |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Index: linux-2.6/drivers/base/platform.c
===================================================================
--- linux-2.6.orig/drivers/base/platform.c
+++ linux-2.6/drivers/base/platform.c
@@ -212,7 +212,8 @@ EXPORT_SYMBOL_GPL(platform_device_add_re
  *	pointer.  The memory associated with the platform data will be freed
  *	when the platform device is released.
  */
-int platform_device_add_data(struct platform_device *pdev, void *data, size_t size)
+int platform_device_add_data(struct platform_device *pdev, const void *data,
+		size_t size)
 {
 	void *d;
 
Index: linux-2.6/include/linux/platform_device.h
===================================================================
--- linux-2.6.orig/include/linux/platform_device.h
+++ linux-2.6/include/linux/platform_device.h
@@ -39,7 +39,8 @@ extern struct platform_device *platform_
 
 extern struct platform_device *platform_device_alloc(const char *name, unsigned int id);
 extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num);
-extern int platform_device_add_data(struct platform_device *pdev, void *data, size_t size);
+extern int platform_device_add_data(struct platform_device *pdev,
+		const void *data, size_t size);
 extern int platform_device_add(struct platform_device *pdev);
 extern void platform_device_del(struct platform_device *pdev);
 extern void platform_device_put(struct platform_device *pdev);

^ permalink raw reply

* weird behavior for jffs2 on PQ2FADS-VR board
From: Lei Sun @ 2006-07-12  4:23 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all:
    I brought up linux-2.4.30 on PQ2FADS-VR board, everything was fine
untill i try to mount the jffs2.  My mtd partition looks like this:

dev:    size   erasesize  name
mtd0: 00800000 00040000 "Flash SIMM"
mtd1: 00080000 00040000 "u-boot"
mtd2: 00100000 00040000 "Kernel"
mtd3: 00580000 00040000 "Rootfs"
mtd4: 00080000 00040000 "u-boot env"
mtd5: 00080000 00040000 "unused"

Basically, I tried
"eraseall /dev/mtd3", and then
"mount -t jffs2 /dev/mtdblock3 /mnt", it showed as mounted, then I
issued "echo "hello,world" > test.txt" to create a file,
a warning was printed out
"Node totlen on flash (0x44000000) != totlen in node ref (0x00000044)"
, but subsequent
"cat test.txt " still showed the correct string from that newly created file".
However, after I umount the  file and remount it again, it give me
lots of errors"
Magic bitmask 0x1985 not found at 0x00240004: 0x0c00 instead"
Then the moutn operation failed.
    I am suspecting it is mtd driver problem (the board use
LH28F016SCT-L95 from sharp). But don't know how to proceed , e.g. how
to verify the content was written into flash in a mounted jffs2 file
system?
    Has anybody experienced similar issue? Any suggestion?
    Forgive me if this is wrong list to post, and very appreciate if
anybody can direct me to the right place.

Thanks!
lei

^ permalink raw reply

* RE: weird behavior for jffs2 on PQ2FADS-VR board
From: Liu Dave-r63238 @ 2006-07-12  4:56 UTC (permalink / raw)
  To: Lei Sun, linuxppc-embedded
In-Reply-To: <f9a7e7a80607112123t7e93221fx37d83245622d4368@mail.gmail.com>

Sun,

You are using SIMM LH28F016SCT-L95, that is an old chipset,
the driver for this is under drivers/mtd/chips/sharp.c.  Maybe
this is endian issue, you need to remove the cpu_to_le32(datum) swap in
the driver  of line 360
And with map->write32(map, datum, adr) instead.

Best Regards,
Dave

> -----Original Message-----
> From:=20
> linuxppc-embedded-bounces+daveliu=3Dfreescale.com@ozlabs.org=20
> [mailto:linuxppc-embedded-bounces+daveliu=3Dfreescale.com@ozlabs
> .org] On Behalf Of Lei Sun
> Sent: Wednesday, July 12, 2006 12:23 PM
> To: linuxppc-embedded@ozlabs.org
> Subject: weird behavior for jffs2 on PQ2FADS-VR board
>=20
>=20
> Hi all:
>     I brought up linux-2.4.30 on PQ2FADS-VR board, everything=20
> was fine untill i try to mount the jffs2.  My mtd partition=20
> looks like this:
>=20
> dev:    size   erasesize  name
> mtd0: 00800000 00040000 "Flash SIMM"
> mtd1: 00080000 00040000 "u-boot"
> mtd2: 00100000 00040000 "Kernel"
> mtd3: 00580000 00040000 "Rootfs"
> mtd4: 00080000 00040000 "u-boot env"
> mtd5: 00080000 00040000 "unused"
>=20
> Basically, I tried
> "eraseall /dev/mtd3", and then
> "mount -t jffs2 /dev/mtdblock3 /mnt", it showed as mounted,=20
> then I issued "echo "hello,world" > test.txt" to create a=20
> file, a warning was printed out "Node totlen on flash=20
> (0x44000000) !=3D totlen in node ref (0x00000044)" , but=20
> subsequent "cat test.txt " still showed the correct string=20
> from that newly created file". However, after I umount the =20
> file and remount it again, it give me lots of errors" Magic=20
> bitmask 0x1985 not found at 0x00240004: 0x0c00 instead" Then=20
> the moutn operation failed.
>     I am suspecting it is mtd driver problem (the board use=20
> LH28F016SCT-L95 from sharp). But don't know how to proceed ,=20
> e.g. how to verify the content was written into flash in a=20
> mounted jffs2 file system?
>     Has anybody experienced similar issue? Any suggestion?
>     Forgive me if this is wrong list to post, and very=20
> appreciate if anybody can direct me to the right place.
>=20
> Thanks!
> lei
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org=20
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>=20

^ permalink raw reply

* SMI501 chip help required !!!!
From: Yousuf @ 2006-07-12  4:50 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 2198 bytes --]

Hi,
    I am doing a driver development project for the display chip SMI501. I saw some postings on this chip on this mailing group so thought you pepole can help me. 

BCKGND: The 501 chip is connected on the intel XScale PXA 255 (ARM v5) processor. Our requirement is to enable the additional hardware layers within the 501 chip and give a fb device for each layer. Code is available for enabling single layer.I have modified the code to register the video layer and alpha layer part by setting the registers. The three layers are working fine and the alpha transparency etc are working fine. Now the problem is of flicker :(   

FIXME: When i enable all the three layers (Panel + Video + Alpha) the image flickers to the right end. And usually this happens in the intersecting area of alpha and video layer. The image seems to be overdrawn fastly with correct data ( data supposed to come on that part of the display) and a shifted pixel data from some what 3/4th of the screen. i.e if we are seeing a tux in the fb console, with the rest of the display part along the tux as black, the intersection region will be seen as the tux shifted to the right with black lines and the tux image redrawing one on top of the other fastly. 

TRIES:     We have 8Mb of video memory and I tried changing the buffer offsets of the layer, but it didnt work. One more thing is that when i changed the resolution of the panel graphics to 1024x768, enabling even a single layer ended up with flicker. Also when i changed resolution to 640x480, enabling the layers didnt cause any problem. But our requirement is of 800x600 resolution. I suspect this as a monitor timing issue.  I tried chainging the monitor refresh rate to 75Hz (800x600 res). Even then the problem is there but the redraw is too fast.

HELP: I think that the hardware draws each line seperatley for each layer one after the other or else how can the correct data and the incorrect date be redrawn on the same location. Please correct me if am wrong and help me in this situation. Thanks in advance :))

Regards
Yousuf A

Thanks,
Yousuf
 		
---------------------------------
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail Beta.

[-- Attachment #2: Type: text/html, Size: 2372 bytes --]

^ permalink raw reply

* [PATCH 01/16] [powerpc core] Constify & voidify get_property()
From: Jeremy Kerr @ 2006-07-12  5:35 UTC (permalink / raw)
  To: linuxppc-dev

Now that get_property() returns a void *, there's no need to cast its
return value. Also, treat the return value as const, so we can
constify get_property later.

powerpc core changes.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---

 resend: rebase after benh's IRQ changes

 arch/powerpc/kernel/btext.c            |   24 +++++------
 arch/powerpc/kernel/ibmebus.c          |    6 +-
 arch/powerpc/kernel/legacy_serial.c    |   35 ++++++++--------
 arch/powerpc/kernel/lparcfg.c          |   11 ++---
 arch/powerpc/kernel/machine_kexec_64.c |   10 +---
 arch/powerpc/kernel/pci_32.c           |   39 ++++++++++--------
 arch/powerpc/kernel/pci_64.c           |   28 +++++++------
 arch/powerpc/kernel/pci_dn.c           |   13 +++---
 arch/powerpc/kernel/prom.c             |   23 +++++------
 arch/powerpc/kernel/prom_parse.c       |   68 ++++++++++++++++-----------------
 arch/powerpc/kernel/rtas-proc.c        |   25 ++++++------
 arch/powerpc/kernel/rtas.c             |   28 +++++++------
 arch/powerpc/kernel/rtas_pci.c         |   22 +++++-----
 arch/powerpc/kernel/setup-common.c     |   19 +++------
 arch/powerpc/kernel/setup_64.c         |   14 +++---
 arch/powerpc/kernel/sysfs.c            |    5 --
 arch/powerpc/kernel/time.c             |    4 -
 arch/powerpc/kernel/vio.c              |   16 +++----
 arch/powerpc/mm/numa.c                 |   31 ++++++---------
 arch/powerpc/sysdev/fsl_soc.c          |   30 +++++++-------
 arch/powerpc/sysdev/mmio_nvram.c       |    4 -
 include/asm-powerpc/ibmebus.h          |    2 
 include/asm-powerpc/prom.h             |   16 +++----
 include/asm-powerpc/vio.h              |    4 -
 24 files changed, 239 insertions(+), 238 deletions(-)

Index: linux-2.6/arch/powerpc/kernel/prom.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/prom.c
+++ linux-2.6/arch/powerpc/kernel/prom.c
@@ -942,11 +942,11 @@ void __init early_init_devtree(void *par
 int
 prom_n_addr_cells(struct device_node* np)
 {
-	int* ip;
+	const int *ip;
 	do {
 		if (np->parent)
 			np = np->parent;
-		ip = (int *) get_property(np, "#address-cells", NULL);
+		ip = get_property(np, "#address-cells", NULL);
 		if (ip != NULL)
 			return *ip;
 	} while (np->parent);
@@ -958,11 +958,11 @@ EXPORT_SYMBOL(prom_n_addr_cells);
 int
 prom_n_size_cells(struct device_node* np)
 {
-	int* ip;
+	const int* ip;
 	do {
 		if (np->parent)
 			np = np->parent;
-		ip = (int *) get_property(np, "#size-cells", NULL);
+		ip = get_property(np, "#size-cells", NULL);
 		if (ip != NULL)
 			return *ip;
 	} while (np->parent);
@@ -1034,7 +1034,7 @@ int device_is_compatible(struct device_n
 	const char* cp;
 	int cplen, l;
 
-	cp = (char *) get_property(device, "compatible", &cplen);
+	cp = get_property(device, "compatible", &cplen);
 	if (cp == NULL)
 		return 0;
 	while (cplen > 0) {
@@ -1449,7 +1449,7 @@ static int of_finish_dynamic_node(struct
 {
 	struct device_node *parent = of_get_parent(node);
 	int err = 0;
-	phandle *ibm_phandle;
+	const phandle *ibm_phandle;
 
 	node->name = get_property(node, "name", NULL);
 	node->type = get_property(node, "device_type", NULL);
@@ -1466,8 +1466,7 @@ static int of_finish_dynamic_node(struct
 		return -ENODEV;
 
 	/* fix up new node's linux_phandle field */
-	if ((ibm_phandle = (unsigned int *)get_property(node,
-							"ibm,phandle", NULL)))
+	if ((ibm_phandle = get_property(node, "ibm,phandle", NULL)))
 		node->linux_phandle = *ibm_phandle;
 
 out:
@@ -1658,16 +1657,16 @@ struct device_node *of_get_cpu_node(int 
 	hardid = get_hard_smp_processor_id(cpu);
 
 	for_each_node_by_type(np, "cpu") {
-		u32 *intserv;
+		const u32 *intserv;
 		unsigned int plen, t;
 
 		/* Check for ibm,ppc-interrupt-server#s. If it doesn't exist
 		 * fallback to "reg" property and assume no threads
 		 */
-		intserv = (u32 *)get_property(np, "ibm,ppc-interrupt-server#s",
-					      &plen);
+		intserv = get_property(np, "ibm,ppc-interrupt-server#s",
+				&plen);
 		if (intserv == NULL) {
-			u32 *reg = (u32 *)get_property(np, "reg", NULL);
+			const u32 *reg = get_property(np, "reg", NULL);
 			if (reg == NULL)
 				continue;
 			if (*reg == hardid) {
Index: linux-2.6/arch/powerpc/kernel/btext.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/btext.c
+++ linux-2.6/arch/powerpc/kernel/btext.c
@@ -158,35 +158,35 @@ int btext_initialize(struct device_node 
 {
 	unsigned int width, height, depth, pitch;
 	unsigned long address = 0;
-	u32 *prop;
+	const u32 *prop;
 
-	prop = (u32 *)get_property(np, "linux,bootx-width", NULL);
+	prop = get_property(np, "linux,bootx-width", NULL);
 	if (prop == NULL)
-		prop = (u32 *)get_property(np, "width", NULL);
+		prop = get_property(np, "width", NULL);
 	if (prop == NULL)
 		return -EINVAL;
 	width = *prop;
-	prop = (u32 *)get_property(np, "linux,bootx-height", NULL);
+	prop = get_property(np, "linux,bootx-height", NULL);
 	if (prop == NULL)
-		prop = (u32 *)get_property(np, "height", NULL);
+		prop = get_property(np, "height", NULL);
 	if (prop == NULL)
 		return -EINVAL;
 	height = *prop;
-	prop = (u32 *)get_property(np, "linux,bootx-depth", NULL);
+	prop = get_property(np, "linux,bootx-depth", NULL);
 	if (prop == NULL)
-		prop = (u32 *)get_property(np, "depth", NULL);
+		prop = get_property(np, "depth", NULL);
 	if (prop == NULL)
 		return -EINVAL;
 	depth = *prop;
 	pitch = width * ((depth + 7) / 8);
-	prop = (u32 *)get_property(np, "linux,bootx-linebytes", NULL);
+	prop = get_property(np, "linux,bootx-linebytes", NULL);
 	if (prop == NULL)
-		prop = (u32 *)get_property(np, "linebytes", NULL);
+		prop = get_property(np, "linebytes", NULL);
 	if (prop)
 		pitch = *prop;
 	if (pitch == 1)
 		pitch = 0x1000;
-	prop = (u32 *)get_property(np, "address", NULL);
+	prop = get_property(np, "address", NULL);
 	if (prop)
 		address = *prop;
 
@@ -214,11 +214,11 @@ int btext_initialize(struct device_node 
 
 int __init btext_find_display(int allow_nonstdout)
 {
-	char *name;
+	const char *name;
 	struct device_node *np = NULL; 
 	int rc = -ENODEV;
 
-	name = (char *)get_property(of_chosen, "linux,stdout-path", NULL);
+	name = get_property(of_chosen, "linux,stdout-path", NULL);
 	if (name != NULL) {
 		np = of_find_node_by_path(name);
 		if (np != NULL) {
Index: linux-2.6/arch/powerpc/kernel/ibmebus.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/ibmebus.c
+++ linux-2.6/arch/powerpc/kernel/ibmebus.c
@@ -167,7 +167,7 @@ static DEVICE_ATTR(name, S_IRUSR | S_IRG
 		   NULL);
 
 static struct ibmebus_dev* __devinit ibmebus_register_device_common(
-	struct ibmebus_dev *dev, char *name)
+	struct ibmebus_dev *dev, const char *name)
 {
 	int err = 0;
 
@@ -194,10 +194,10 @@ static struct ibmebus_dev* __devinit ibm
 	struct device_node *dn)
 {
 	struct ibmebus_dev *dev;
-	char *loc_code;
+	const char *loc_code;
 	int length;
 
-	loc_code = (char *)get_property(dn, "ibm,loc-code", NULL);
+	loc_code = get_property(dn, "ibm,loc-code", NULL);
 	if (!loc_code) {
                 printk(KERN_WARNING "%s: node %s missing 'ibm,loc-code'\n",
 		       __FUNCTION__, dn->name ? dn->name : "<unknown>");
Index: linux-2.6/arch/powerpc/kernel/legacy_serial.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/legacy_serial.c
+++ linux-2.6/arch/powerpc/kernel/legacy_serial.c
@@ -39,16 +39,17 @@ static int __init add_legacy_port(struct
 				  phys_addr_t taddr, unsigned long irq,
 				  upf_t flags, int irq_check_parent)
 {
-	u32 *clk, *spd, clock = BASE_BAUD * 16;
+	const u32 *clk, *spd;
+	u32 clock = BASE_BAUD * 16;
 	int index;
 
 	/* get clock freq. if present */
-	clk = (u32 *)get_property(np, "clock-frequency", NULL);
+	clk = get_property(np, "clock-frequency", NULL);
 	if (clk && *clk)
 		clock = *clk;
 
 	/* get default speed if present */
-	spd = (u32 *)get_property(np, "current-speed", NULL);
+	spd = get_property(np, "current-speed", NULL);
 
 	/* If we have a location index, then try to use it */
 	if (want_index >= 0 && want_index < MAX_LEGACY_SERIAL_PORTS)
@@ -113,7 +114,7 @@ static int __init add_legacy_soc_port(st
 				      struct device_node *soc_dev)
 {
 	u64 addr;
-	u32 *addrp;
+	const u32 *addrp;
 	upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
 
 	/* We only support ports that have a clock frequency properly
@@ -140,15 +141,15 @@ static int __init add_legacy_soc_port(st
 static int __init add_legacy_isa_port(struct device_node *np,
 				      struct device_node *isa_brg)
 {
-	u32 *reg;
-	char *typep;
+	const u32 *reg;
+	const char *typep;
 	int index = -1;
 	u64 taddr;
 
 	DBG(" -> add_legacy_isa_port(%s)\n", np->full_name);
 
 	/* Get the ISA port number */
-	reg = (u32 *)get_property(np, "reg", NULL);
+	reg = get_property(np, "reg", NULL);
 	if (reg == NULL)
 		return -1;
 
@@ -159,7 +160,7 @@ static int __init add_legacy_isa_port(st
 	/* Now look for an "ibm,aix-loc" property that gives us ordering
 	 * if any...
 	 */
-	typep = (char *)get_property(np, "ibm,aix-loc", NULL);
+	typep = get_property(np, "ibm,aix-loc", NULL);
 
 	/* If we have a location index, then use it */
 	if (typep && *typep == 'S')
@@ -184,7 +185,7 @@ static int __init add_legacy_pci_port(st
 				      struct device_node *pci_dev)
 {
 	u64 addr, base;
-	u32 *addrp;
+	const u32 *addrp;
 	unsigned int flags;
 	int iotype, index = -1, lindex = 0;
 
@@ -223,7 +224,7 @@ static int __init add_legacy_pci_port(st
 	 * we get to their "reg" property
 	 */
 	if (np != pci_dev) {
-		u32 *reg = (u32 *)get_property(np, "reg", NULL);
+		const u32 *reg = get_property(np, "reg", NULL);
 		if (reg && (*reg < 4))
 			index = lindex = *reg;
 	}
@@ -281,13 +282,13 @@ static void __init setup_legacy_serial_c
 void __init find_legacy_serial_ports(void)
 {
 	struct device_node *np, *stdout = NULL;
-	char *path;
+	const char *path;
 	int index;
 
 	DBG(" -> find_legacy_serial_port()\n");
 
 	/* Now find out if one of these is out firmware console */
-	path = (char *)get_property(of_chosen, "linux,stdout-path", NULL);
+	path = get_property(of_chosen, "linux,stdout-path", NULL);
 	if (path != NULL) {
 		stdout = of_find_node_by_path(path);
 		if (stdout)
@@ -487,8 +488,8 @@ static int __init check_legacy_serial_co
 {
 	struct device_node *prom_stdout = NULL;
 	int speed = 0, offset = 0;
-	char *name;
-	u32 *spd;
+	const char *name;
+	const u32 *spd;
 
 	DBG(" -> check_legacy_serial_console()\n");
 
@@ -509,7 +510,7 @@ static int __init check_legacy_serial_co
 	}
 	/* We are getting a weird phandle from OF ... */
 	/* ... So use the full path instead */
-	name = (char *)get_property(of_chosen, "linux,stdout-path", NULL);
+	name = get_property(of_chosen, "linux,stdout-path", NULL);
 	if (name == NULL) {
 		DBG(" no linux,stdout-path !\n");
 		return -ENODEV;
@@ -521,12 +522,12 @@ static int __init check_legacy_serial_co
 	}
 	DBG("stdout is %s\n", prom_stdout->full_name);
 
-	name = (char *)get_property(prom_stdout, "name", NULL);
+	name = get_property(prom_stdout, "name", NULL);
 	if (!name) {
 		DBG(" stdout package has no name !\n");
 		goto not_found;
 	}
-	spd = (u32 *)get_property(prom_stdout, "current-speed", NULL);
+	spd = get_property(prom_stdout, "current-speed", NULL);
 	if (spd)
 		speed = *spd;
 
Index: linux-2.6/arch/powerpc/kernel/lparcfg.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/lparcfg.c
+++ linux-2.6/arch/powerpc/kernel/lparcfg.c
@@ -310,12 +310,11 @@ static int pseries_lparcfg_data(struct s
 	int partition_potential_processors;
 	int partition_active_processors;
 	struct device_node *rtas_node;
-	int *lrdrp = NULL;
+	const int *lrdrp = NULL;
 
 	rtas_node = find_path_device("/rtas");
 	if (rtas_node)
-		lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity",
-		                            NULL);
+		lrdrp = get_property(rtas_node, "ibm,lrdr-capacity", NULL);
 
 	if (lrdrp == NULL) {
 		partition_potential_processors = vdso_data->processorCount;
@@ -520,7 +519,8 @@ static int lparcfg_data(struct seq_file 
 	const char *model = "";
 	const char *system_id = "";
 	const char *tmp;
-	unsigned int *lp_index_ptr, lp_index = 0;
+	const unsigned int *lp_index_ptr;
+	unsigned int lp_index = 0;
 
 	seq_printf(m, "%s %s \n", MODULE_NAME, MODULE_VERS);
 
@@ -540,8 +540,7 @@ static int lparcfg_data(struct seq_file 
 			if (firmware_has_feature(FW_FEATURE_ISERIES))
 				system_id += 4;
 		}
-		lp_index_ptr = (unsigned int *)
-			get_property(rootdn, "ibm,partition-no", NULL);
+		lp_index_ptr = get_property(rootdn, "ibm,partition-no", NULL);
 		if (lp_index_ptr)
 			lp_index = *lp_index_ptr;
 	}
Index: linux-2.6/arch/powerpc/kernel/machine_kexec_64.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/machine_kexec_64.c
+++ linux-2.6/arch/powerpc/kernel/machine_kexec_64.c
@@ -33,8 +33,8 @@ int default_machine_kexec_prepare(struct
 	unsigned long begin, end;	/* limits of segment */
 	unsigned long low, high;	/* limits of blocked memory range */
 	struct device_node *node;
-	unsigned long *basep;
-	unsigned int *sizep;
+	const unsigned long *basep;
+	const unsigned int *sizep;
 
 	if (!ppc_md.hpte_clear_all)
 		return -ENOENT;
@@ -74,10 +74,8 @@ int default_machine_kexec_prepare(struct
 	/* We also should not overwrite the tce tables */
 	for (node = of_find_node_by_type(NULL, "pci"); node != NULL;
 			node = of_find_node_by_type(node, "pci")) {
-		basep = (unsigned long *)get_property(node, "linux,tce-base",
-							NULL);
-		sizep = (unsigned int *)get_property(node, "linux,tce-size",
-							NULL);
+		basep = get_property(node, "linux,tce-base", NULL);
+		sizep = get_property(node, "linux,tce-size", NULL);
 		if (basep == NULL || sizep == NULL)
 			continue;
 
Index: linux-2.6/arch/powerpc/kernel/pci_64.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/pci_64.c
+++ linux-2.6/arch/powerpc/kernel/pci_64.c
@@ -246,10 +246,10 @@ static void __init pcibios_claim_of_setu
 #ifdef CONFIG_PPC_MULTIPLATFORM
 static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
 {
-	u32 *prop;
+	const u32 *prop;
 	int len;
 
-	prop = (u32 *) get_property(np, name, &len);
+	prop = get_property(np, name, &len);
 	if (prop && len >= 4)
 		return *prop;
 	return def;
@@ -278,10 +278,11 @@ static void pci_parse_of_addrs(struct de
 	u64 base, size;
 	unsigned int flags;
 	struct resource *res;
-	u32 *addrs, i;
+	const u32 *addrs;
+	u32 i;
 	int proplen;
 
-	addrs = (u32 *) get_property(node, "assigned-addresses", &proplen);
+	addrs = get_property(node, "assigned-addresses", &proplen);
 	if (!addrs)
 		return;
 	DBG("    parse addresses (%d bytes) @ %p\n", proplen, addrs);
@@ -381,7 +382,7 @@ void __devinit of_scan_bus(struct device
 				  struct pci_bus *bus)
 {
 	struct device_node *child = NULL;
-	u32 *reg;
+	const u32 *reg;
 	int reglen, devfn;
 	struct pci_dev *dev;
 
@@ -389,7 +390,7 @@ void __devinit of_scan_bus(struct device
 
 	while ((child = of_get_next_child(node, child)) != NULL) {
 		DBG("  * %s\n", child->full_name);
-		reg = (u32 *) get_property(child, "reg", &reglen);
+		reg = get_property(child, "reg", &reglen);
 		if (reg == NULL || reglen < 20)
 			continue;
 		devfn = (reg[0] >> 8) & 0xff;
@@ -413,7 +414,7 @@ void __devinit of_scan_pci_bridge(struct
 			 	struct pci_dev *dev)
 {
 	struct pci_bus *bus;
-	u32 *busrange, *ranges;
+	const u32 *busrange, *ranges;
 	int len, i, mode;
 	struct resource *res;
 	unsigned int flags;
@@ -422,13 +423,13 @@ void __devinit of_scan_pci_bridge(struct
 	DBG("of_scan_pci_bridge(%s)\n", node->full_name);
 
 	/* parse bus-range property */
-	busrange = (u32 *) get_property(node, "bus-range", &len);
+	busrange = get_property(node, "bus-range", &len);
 	if (busrange == NULL || len != 8) {
 		printk(KERN_DEBUG "Can't get bus-range for PCI-PCI bridge %s\n",
 		       node->full_name);
 		return;
 	}
-	ranges = (u32 *) get_property(node, "ranges", &len);
+	ranges = get_property(node, "ranges", &len);
 	if (ranges == NULL) {
 		printk(KERN_DEBUG "Can't get ranges for PCI-PCI bridge %s\n",
 		       node->full_name);
@@ -892,13 +893,13 @@ static void __devinit pci_process_ISA_OF
 		unsigned int size;
 	};
 
-	struct isa_range *range;
+	const struct isa_range *range;
 	unsigned long pci_addr;
 	unsigned int isa_addr;
 	unsigned int size;
 	int rlen = 0;
 
-	range = (struct isa_range *) get_property(isa_node, "ranges", &rlen);
+	range = get_property(isa_node, "ranges", &rlen);
 	if (range == NULL || (rlen < sizeof(struct isa_range))) {
 		printk(KERN_ERR "no ISA ranges or unexpected isa range size,"
 		       "mapping 64k\n");
@@ -939,7 +940,8 @@ static void __devinit pci_process_ISA_OF
 void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
 					    struct device_node *dev, int prim)
 {
-	unsigned int *ranges, pci_space;
+	const unsigned int *ranges;
+	unsigned int pci_space;
 	unsigned long size;
 	int rlen = 0;
 	int memno = 0;
@@ -957,7 +959,7 @@ void __devinit pci_process_bridge_OF_ran
 	 *			(size depending on dev->n_addr_cells)
 	 *   cells 4+5 or 5+6:	the size of the range
 	 */
-	ranges = (unsigned int *) get_property(dev, "ranges", &rlen);
+	ranges = get_property(dev, "ranges", &rlen);
 	if (ranges == NULL)
 		return;
 	hose->io_base_phys = 0;
Index: linux-2.6/arch/powerpc/kernel/pci_dn.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/pci_dn.c
+++ linux-2.6/arch/powerpc/kernel/pci_dn.c
@@ -40,8 +40,8 @@
 static void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
 {
 	struct pci_controller *phb = data;
-	int *type = (int *)get_property(dn, "ibm,pci-config-space-type", NULL);
-	u32 *regs;
+	const int *type = get_property(dn, "ibm,pci-config-space-type", NULL);
+	const u32 *regs;
 	struct pci_dn *pdn;
 
 	if (mem_init_done)
@@ -54,14 +54,14 @@ static void * __devinit update_dn_pci_in
 	dn->data = pdn;
 	pdn->node = dn;
 	pdn->phb = phb;
-	regs = (u32 *)get_property(dn, "reg", NULL);
+	regs = get_property(dn, "reg", NULL);
 	if (regs) {
 		/* First register entry is addr (00BBSS00)  */
 		pdn->busno = (regs[0] >> 16) & 0xff;
 		pdn->devfn = (regs[0] >> 8) & 0xff;
 	}
 	if (firmware_has_feature(FW_FEATURE_ISERIES)) {
-		u32 *busp = (u32 *)get_property(dn, "linux,subbus", NULL);
+		const u32 *busp = get_property(dn, "linux,subbus", NULL);
 		if (busp)
 			pdn->bussubno = *busp;
 	}
@@ -96,10 +96,11 @@ void *traverse_pci_devices(struct device
 
 	/* We started with a phb, iterate all childs */
 	for (dn = start->child; dn; dn = nextdn) {
-		u32 *classp, class;
+		const u32 *classp;
+		u32 class;
 
 		nextdn = NULL;
-		classp = (u32 *)get_property(dn, "class-code", NULL);
+		classp = get_property(dn, "class-code", NULL);
 		class = classp ? *classp : 0;
 
 		if (pre && ((ret = pre(dn, data)) != NULL))
Index: linux-2.6/arch/powerpc/kernel/prom_parse.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/prom_parse.c
+++ linux-2.6/arch/powerpc/kernel/prom_parse.c
@@ -270,7 +270,7 @@ static int of_translate_one(struct devic
 			    struct of_bus *pbus, u32 *addr,
 			    int na, int ns, int pna)
 {
-	u32 *ranges;
+	const u32 *ranges;
 	unsigned int rlen;
 	int rone;
 	u64 offset = OF_BAD_ADDR;
@@ -287,7 +287,7 @@ static int of_translate_one(struct devic
 	 * to translate addresses that aren't supposed to be translated in
 	 * the first place. --BenH.
 	 */
-	ranges = (u32 *)get_property(parent, "ranges", &rlen);
+	ranges = get_property(parent, "ranges", &rlen);
 	if (ranges == NULL || rlen == 0) {
 		offset = of_read_number(addr, na);
 		memset(addr, 0, pna * 4);
@@ -330,7 +330,7 @@ static int of_translate_one(struct devic
  * that can be mapped to a cpu physical address). This is not really specified
  * that way, but this is traditionally the way IBM at least do things
  */
-u64 of_translate_address(struct device_node *dev, u32 *in_addr)
+u64 of_translate_address(struct device_node *dev, const u32 *in_addr)
 {
 	struct device_node *parent = NULL;
 	struct of_bus *bus, *pbus;
@@ -407,10 +407,10 @@ u64 of_translate_address(struct device_n
 }
 EXPORT_SYMBOL(of_translate_address);
 
-u32 *of_get_address(struct device_node *dev, int index, u64 *size,
+const u32 *of_get_address(struct device_node *dev, int index, u64 *size,
 		    unsigned int *flags)
 {
-	u32 *prop;
+	const u32 *prop;
 	unsigned int psize;
 	struct device_node *parent;
 	struct of_bus *bus;
@@ -427,7 +427,7 @@ u32 *of_get_address(struct device_node *
 		return NULL;
 
 	/* Get "reg" or "assigned-addresses" property */
-	prop = (u32 *)get_property(dev, bus->addresses, &psize);
+	prop = get_property(dev, bus->addresses, &psize);
 	if (prop == NULL)
 		return NULL;
 	psize /= 4;
@@ -445,10 +445,10 @@ u32 *of_get_address(struct device_node *
 }
 EXPORT_SYMBOL(of_get_address);
 
-u32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size,
+const u32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size,
 			unsigned int *flags)
 {
-	u32 *prop;
+	const u32 *prop;
 	unsigned int psize;
 	struct device_node *parent;
 	struct of_bus *bus;
@@ -469,7 +469,7 @@ u32 *of_get_pci_address(struct device_no
 		return NULL;
 
 	/* Get "reg" or "assigned-addresses" property */
-	prop = (u32 *)get_property(dev, bus->addresses, &psize);
+	prop = get_property(dev, bus->addresses, &psize);
 	if (prop == NULL)
 		return NULL;
 	psize /= 4;
@@ -487,7 +487,7 @@ u32 *of_get_pci_address(struct device_no
 }
 EXPORT_SYMBOL(of_get_pci_address);
 
-static int __of_address_to_resource(struct device_node *dev, u32 *addrp,
+static int __of_address_to_resource(struct device_node *dev, const u32 *addrp,
 				    u64 size, unsigned int flags,
 				    struct resource *r)
 {
@@ -518,7 +518,7 @@ static int __of_address_to_resource(stru
 int of_address_to_resource(struct device_node *dev, int index,
 			   struct resource *r)
 {
-	u32		*addrp;
+	const u32	*addrp;
 	u64		size;
 	unsigned int	flags;
 
@@ -532,7 +532,7 @@ EXPORT_SYMBOL_GPL(of_address_to_resource
 int of_pci_address_to_resource(struct device_node *dev, int bar,
 			       struct resource *r)
 {
-	u32		*addrp;
+	const u32	*addrp;
 	u64		size;
 	unsigned int	flags;
 
@@ -543,13 +543,14 @@ int of_pci_address_to_resource(struct de
 }
 EXPORT_SYMBOL_GPL(of_pci_address_to_resource);
 
-void of_parse_dma_window(struct device_node *dn, unsigned char *dma_window_prop,
+void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
 		unsigned long *busno, unsigned long *phys, unsigned long *size)
 {
-	u32 *dma_window, cells;
-	unsigned char *prop;
+	const u32 *dma_window;
+	u32 cells;
+	const unsigned char *prop;
 
-	dma_window = (u32 *)dma_window_prop;
+	dma_window = dma_window_prop;
 
 	/* busno is always one cell */
 	*busno = *(dma_window++);
@@ -578,13 +579,13 @@ static struct device_node *of_irq_dflt_p
 static struct device_node *of_irq_find_parent(struct device_node *child)
 {
 	struct device_node *p;
-	phandle *parp;
+	const phandle *parp;
 
 	if (!of_node_get(child))
 		return NULL;
 
 	do {
-		parp = (phandle *)get_property(child, "interrupt-parent", NULL);
+		parp = get_property(child, "interrupt-parent", NULL);
 		if (parp == NULL)
 			p = of_get_parent(child);
 		else {
@@ -646,11 +647,11 @@ void of_irq_map_init(unsigned int flags)
 
 }
 
-int of_irq_map_raw(struct device_node *parent, u32 *intspec, u32 *addr,
-		   struct of_irq *out_irq)
+int of_irq_map_raw(struct device_node *parent, const u32 *intspec,
+		const u32 *addr, struct of_irq *out_irq)
 {
 	struct device_node *ipar, *tnode, *old = NULL, *newpar = NULL;
-	u32 *tmp, *imap, *imask;
+	const u32 *tmp, *imap, *imask;
 	u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0;
 	int imaplen, match, i;
 
@@ -661,7 +662,7 @@ int of_irq_map_raw(struct device_node *p
 	 * is none, we are nice and just walk up the tree
 	 */
 	do {
-		tmp = (u32 *)get_property(ipar, "#interrupt-cells", NULL);
+		tmp = get_property(ipar, "#interrupt-cells", NULL);
 		if (tmp != NULL) {
 			intsize = *tmp;
 			break;
@@ -682,7 +683,7 @@ int of_irq_map_raw(struct device_node *p
 	 */
 	old = of_node_get(ipar);
 	do {
-		tmp = (u32 *)get_property(old, "#address-cells", NULL);
+		tmp = get_property(old, "#address-cells", NULL);
 		tnode = of_get_parent(old);
 		of_node_put(old);
 		old = tnode;
@@ -709,7 +710,7 @@ int of_irq_map_raw(struct device_node *p
 		}
 
 		/* Now look for an interrupt-map */
-		imap = (u32 *)get_property(ipar, "interrupt-map", &imaplen);
+		imap = get_property(ipar, "interrupt-map", &imaplen);
 		/* No interrupt map, check for an interrupt parent */
 		if (imap == NULL) {
 			DBG(" -> no map, getting parent\n");
@@ -719,7 +720,7 @@ int of_irq_map_raw(struct device_node *p
 		imaplen /= sizeof(u32);
 
 		/* Look for a mask */
-		imask = (u32 *)get_property(ipar, "interrupt-map-mask", NULL);
+		imask = get_property(ipar, "interrupt-map-mask", NULL);
 
 		/* If we were passed no "reg" property and we attempt to parse
 		 * an interrupt-map, then #address-cells must be 0.
@@ -766,14 +767,14 @@ int of_irq_map_raw(struct device_node *p
 			/* Get #interrupt-cells and #address-cells of new
 			 * parent
 			 */
-			tmp = (u32 *)get_property(newpar, "#interrupt-cells",
+			tmp = get_property(newpar, "#interrupt-cells",
 						  NULL);
 			if (tmp == NULL) {
 				DBG(" -> parent lacks #interrupt-cells !\n");
 				goto fail;
 			}
 			newintsize = *tmp;
-			tmp = (u32 *)get_property(newpar, "#address-cells",
+			tmp = get_property(newpar, "#address-cells",
 						  NULL);
 			newaddrsize = (tmp == NULL) ? 0 : *tmp;
 
@@ -819,14 +820,14 @@ EXPORT_SYMBOL_GPL(of_irq_map_raw);
 static int of_irq_map_oldworld(struct device_node *device, int index,
 			       struct of_irq *out_irq)
 {
-	u32 *ints;
+	const u32 *ints;
 	int intlen;
 
 	/*
 	 * Old machines just have a list of interrupt numbers
 	 * and no interrupt-controller nodes.
 	 */
-	ints = (u32 *) get_property(device, "AAPL,interrupts", &intlen);
+	ints = get_property(device, "AAPL,interrupts", &intlen);
 	if (ints == NULL)
 		return -EINVAL;
 	intlen /= sizeof(u32);
@@ -851,7 +852,8 @@ static int of_irq_map_oldworld(struct de
 int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq)
 {
 	struct device_node *p;
-	u32 *intspec, *tmp, intsize, intlen, *addr;
+	const u32 *intspec, *tmp, *addr;
+	u32 intsize, intlen;
 	int res;
 
 	DBG("of_irq_map_one: dev=%s, index=%d\n", device->full_name, index);
@@ -861,13 +863,13 @@ int of_irq_map_one(struct device_node *d
 		return of_irq_map_oldworld(device, index, out_irq);
 
 	/* Get the interrupts property */
-	intspec = (u32 *)get_property(device, "interrupts", &intlen);
+	intspec = get_property(device, "interrupts", &intlen);
 	if (intspec == NULL)
 		return -EINVAL;
 	intlen /= sizeof(u32);
 
 	/* Get the reg property (if any) */
-	addr = (u32 *)get_property(device, "reg", NULL);
+	addr = get_property(device, "reg", NULL);
 
 	/* Look for the interrupt parent. */
 	p = of_irq_find_parent(device);
@@ -875,7 +877,7 @@ int of_irq_map_one(struct device_node *d
 		return -EINVAL;
 
 	/* Get size of interrupt specifier */
-	tmp = (u32 *)get_property(p, "#interrupt-cells", NULL);
+	tmp = get_property(p, "#interrupt-cells", NULL);
 	if (tmp == NULL) {
 		of_node_put(p);
 		return -EINVAL;
Index: linux-2.6/arch/powerpc/kernel/rtas-proc.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/rtas-proc.c
+++ linux-2.6/arch/powerpc/kernel/rtas-proc.c
@@ -246,12 +246,12 @@ struct file_operations ppc_rtas_rmo_buf_
 
 static int ppc_rtas_find_all_sensors(void);
 static void ppc_rtas_process_sensor(struct seq_file *m,
-	struct individual_sensor *s, int state, int error, char *loc);
+	struct individual_sensor *s, int state, int error, const char *loc);
 static char *ppc_rtas_process_error(int error);
 static void get_location_code(struct seq_file *m,
-	struct individual_sensor *s, char *loc);
-static void check_location_string(struct seq_file *m, char *c);
-static void check_location(struct seq_file *m, char *c);
+	struct individual_sensor *s, const char *loc);
+static void check_location_string(struct seq_file *m, const char *c);
+static void check_location(struct seq_file *m, const char *c);
 
 static int __init proc_rtas_init(void)
 {
@@ -446,11 +446,11 @@ static int ppc_rtas_sensors_show(struct 
 	for (i=0; i<sensors.quant; i++) {
 		struct individual_sensor *p = &sensors.sensor[i];
 		char rstr[64];
-		char *loc;
+		const char *loc;
 		int llen, offs;
 
 		sprintf (rstr, SENSOR_PREFIX"%04d", p->token);
-		loc = (char *) get_property(rtas_node, rstr, &llen);
+		loc = get_property(rtas_node, rstr, &llen);
 
 		/* A sensor may have multiple instances */
 		for (j = 0, offs = 0; j <= p->quant; j++) {
@@ -474,10 +474,10 @@ static int ppc_rtas_sensors_show(struct 
 
 static int ppc_rtas_find_all_sensors(void)
 {
-	unsigned int *utmp;
+	const unsigned int *utmp;
 	int len, i;
 
-	utmp = (unsigned int *) get_property(rtas_node, "rtas-sensors", &len);
+	utmp = get_property(rtas_node, "rtas-sensors", &len);
 	if (utmp == NULL) {
 		printk (KERN_ERR "error: could not get rtas-sensors\n");
 		return 1;
@@ -530,7 +530,7 @@ static char *ppc_rtas_process_error(int 
  */
 
 static void ppc_rtas_process_sensor(struct seq_file *m,
-	struct individual_sensor *s, int state, int error, char *loc)
+	struct individual_sensor *s, int state, int error, const char *loc)
 {
 	/* Defined return vales */
 	const char * key_switch[]        = { "Off\t", "Normal\t", "Secure\t", 
@@ -682,7 +682,7 @@ static void ppc_rtas_process_sensor(stru
 
 /* ****************************************************************** */
 
-static void check_location(struct seq_file *m, char *c)
+static void check_location(struct seq_file *m, const char *c)
 {
 	switch (c[0]) {
 		case LOC_PLANAR:
@@ -719,7 +719,7 @@ static void check_location(struct seq_fi
  * ${LETTER}${NUMBER}[[-/]${LETTER}${NUMBER} [ ... ] ]
  * the '.' may be an abbrevation
  */
-static void check_location_string(struct seq_file *m, char *c)
+static void check_location_string(struct seq_file *m, const char *c)
 {
 	while (*c) {
 		if (isalpha(*c) || *c == '.')
@@ -733,7 +733,8 @@ static void check_location_string(struct
 
 /* ****************************************************************** */
 
-static void get_location_code(struct seq_file *m, struct individual_sensor *s, char *loc)
+static void get_location_code(struct seq_file *m, struct individual_sensor *s,
+		const char *loc)
 {
 	if (!loc || !*loc) {
 		seq_printf(m, "---");/* does not have a location */
Index: linux-2.6/arch/powerpc/kernel/rtas_pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/rtas_pci.c
+++ linux-2.6/arch/powerpc/kernel/rtas_pci.c
@@ -57,7 +57,7 @@ static inline int config_access_valid(st
 
 static int of_device_available(struct device_node * dn)
 {
-        char * status;
+        const char *status;
 
         status = get_property(dn, "status", NULL);
 
@@ -178,7 +178,7 @@ struct pci_ops rtas_pci_ops = {
 
 int is_python(struct device_node *dev)
 {
-	char *model = (char *)get_property(dev, "model", NULL);
+	const char *model = get_property(dev, "model", NULL);
 
 	if (model && strstr(model, "Python"))
 		return 1;
@@ -234,7 +234,7 @@ void __init init_pci_config_tokens (void
 unsigned long __devinit get_phb_buid (struct device_node *phb)
 {
 	int addr_cells;
-	unsigned int *buid_vals;
+	const unsigned int *buid_vals;
 	unsigned int len;
 	unsigned long buid;
 
@@ -247,7 +247,7 @@ unsigned long __devinit get_phb_buid (st
 	if (phb->parent->parent)
 		return 0;
 
-	buid_vals = (unsigned int *) get_property(phb, "reg", &len);
+	buid_vals = get_property(phb, "reg", &len);
 	if (buid_vals == NULL)
 		return 0;
 
@@ -264,10 +264,10 @@ unsigned long __devinit get_phb_buid (st
 static int phb_set_bus_ranges(struct device_node *dev,
 			      struct pci_controller *phb)
 {
-	int *bus_range;
+	const int *bus_range;
 	unsigned int len;
 
-	bus_range = (int *) get_property(dev, "bus-range", &len);
+	bus_range = get_property(dev, "bus-range", &len);
 	if (bus_range == NULL || len < 2 * sizeof(int)) {
 		return 1;
  	}
@@ -325,15 +325,15 @@ unsigned long __init find_and_init_phbs(
 	 * in chosen.
 	 */
 	if (of_chosen) {
-		int *prop;
+		const int *prop;
 
-		prop = (int *)get_property(of_chosen, "linux,pci-probe-only",
-					   NULL);
+		prop = get_property(of_chosen,
+				"linux,pci-probe-only", NULL);
 		if (prop)
 			pci_probe_only = *prop;
 
-		prop = (int *)get_property(of_chosen,
-					   "linux,pci-assign-all-buses", NULL);
+		prop = get_property(of_chosen,
+				"linux,pci-assign-all-buses", NULL);
 		if (prop)
 			pci_assign_all_buses = *prop;
 	}
Index: linux-2.6/arch/powerpc/kernel/setup-common.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/setup-common.c
+++ linux-2.6/arch/powerpc/kernel/setup-common.c
@@ -304,16 +304,15 @@ struct seq_operations cpuinfo_op = {
 void __init check_for_initrd(void)
 {
 #ifdef CONFIG_BLK_DEV_INITRD
-	unsigned long *prop;
+	const unsigned long *prop;
 
 	DBG(" -> check_for_initrd()\n");
 
 	if (of_chosen) {
-		prop = (unsigned long *)get_property(of_chosen,
-				"linux,initrd-start", NULL);
+		prop = get_property(of_chosen, "linux,initrd-start", NULL);
 		if (prop != NULL) {
 			initrd_start = (unsigned long)__va(*prop);
-			prop = (unsigned long *)get_property(of_chosen,
+			prop = get_property(of_chosen,
 					"linux,initrd-end", NULL);
 			if (prop != NULL) {
 				initrd_end = (unsigned long)__va(*prop);
@@ -366,15 +365,14 @@ void __init smp_setup_cpu_maps(void)
 	int cpu = 0;
 
 	while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) {
-		int *intserv;
+		const int *intserv;
 		int j, len = sizeof(u32), nthreads = 1;
 
-		intserv = (int *)get_property(dn, "ibm,ppc-interrupt-server#s",
-					      &len);
+		intserv = get_property(dn, "ibm,ppc-interrupt-server#s", &len);
 		if (intserv)
 			nthreads = len / sizeof(int);
 		else {
-			intserv = (int *) get_property(dn, "reg", NULL);
+			intserv = get_property(dn, "reg", NULL);
 			if (!intserv)
 				intserv = &cpu;	/* assume logical == phys */
 		}
@@ -395,13 +393,12 @@ void __init smp_setup_cpu_maps(void)
 	if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) &&
 	    (dn = of_find_node_by_path("/rtas"))) {
 		int num_addr_cell, num_size_cell, maxcpus;
-		unsigned int *ireg;
+		const unsigned int *ireg;
 
 		num_addr_cell = prom_n_addr_cells(dn);
 		num_size_cell = prom_n_size_cells(dn);
 
-		ireg = (unsigned int *)
-			get_property(dn, "ibm,lrdr-capacity", NULL);
+		ireg = get_property(dn, "ibm,lrdr-capacity", NULL);
 
 		if (!ireg)
 			goto out;
Index: linux-2.6/arch/powerpc/kernel/time.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/time.c
+++ linux-2.6/arch/powerpc/kernel/time.c
@@ -859,14 +859,14 @@ EXPORT_SYMBOL(do_settimeofday);
 static int __init get_freq(char *name, int cells, unsigned long *val)
 {
 	struct device_node *cpu;
-	unsigned int *fp;
+	const unsigned int *fp;
 	int found = 0;
 
 	/* The cpu node should have timebase and clock frequency properties */
 	cpu = of_find_node_by_type(NULL, "cpu");
 
 	if (cpu) {
-		fp = (unsigned int *)get_property(cpu, name, NULL);
+		fp = get_property(cpu, name, NULL);
 		if (fp) {
 			found = 1;
 			*val = 0;
Index: linux-2.6/arch/powerpc/kernel/vio.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/vio.c
+++ linux-2.6/arch/powerpc/kernel/vio.c
@@ -77,7 +77,7 @@ static struct iommu_table *vio_build_iom
 	} else
 #endif
 	{
-		unsigned char *dma_window;
+		const unsigned char *dma_window;
 		struct iommu_table *tbl;
 		unsigned long offset, size;
 
@@ -217,7 +217,7 @@ static void __devinit vio_dev_release(st
 struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
 {
 	struct vio_dev *viodev;
-	unsigned int *unit_address;
+	const unsigned int *unit_address;
 
 	/* we need the 'device_type' property, in order to match with drivers */
 	if (of_node->type == NULL) {
@@ -227,7 +227,7 @@ struct vio_dev * __devinit vio_register_
 		return NULL;
 	}
 
-	unit_address = (unsigned int *)get_property(of_node, "reg", NULL);
+	unit_address = get_property(of_node, "reg", NULL);
 	if (unit_address == NULL) {
 		printk(KERN_WARNING "%s: node %s missing 'reg'\n",
 				__FUNCTION__,
@@ -249,7 +249,7 @@ struct vio_dev * __devinit vio_register_
 	viodev->type = of_node->type;
 	viodev->unit_address = *unit_address;
 	if (firmware_has_feature(FW_FEATURE_ISERIES)) {
-		unit_address = (unsigned int *)get_property(of_node,
+		unit_address = get_property(of_node,
 				"linux,unit_address", NULL);
 		if (unit_address != NULL)
 			viodev->unit_address = *unit_address;
@@ -423,7 +423,7 @@ static int vio_hotplug(struct device *de
 {
 	const struct vio_dev *vio_dev = to_vio_dev(dev);
 	struct device_node *dn = dev->platform_data;
-	char *cp;
+	const char *cp;
 	int length;
 
 	if (!num_envp)
@@ -431,7 +431,7 @@ static int vio_hotplug(struct device *de
 
 	if (!dn)
 		return -ENODEV;
-	cp = (char *)get_property(dn, "compatible", &length);
+	cp = get_property(dn, "compatible", &length);
 	if (!cp)
 		return -ENODEV;
 
@@ -493,11 +493,11 @@ static struct vio_dev *vio_find_name(con
  */
 struct vio_dev *vio_find_node(struct device_node *vnode)
 {
-	uint32_t *unit_address;
+	const uint32_t *unit_address;
 	char kobj_name[BUS_ID_SIZE];
 
 	/* construct the kobject name from the device node */
-	unit_address = (uint32_t *)get_property(vnode, "reg", NULL);
+	unit_address = get_property(vnode, "reg", NULL);
 	if (!unit_address)
 		return NULL;
 	snprintf(kobj_name, BUS_ID_SIZE, "%x", *unit_address);
Index: linux-2.6/arch/powerpc/sysdev/fsl_soc.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/fsl_soc.c
+++ linux-2.6/arch/powerpc/sysdev/fsl_soc.c
@@ -41,7 +41,7 @@ phys_addr_t get_immrbase(void)
 	soc = of_find_node_by_type(NULL, "soc");
 	if (soc) {
 		unsigned int size;
-		void *prop = get_property(soc, "reg", &size);
+		const void *prop = get_property(soc, "reg", &size);
 		immrbase = of_translate_address(soc, prop);
 		of_node_put(soc);
 	};
@@ -86,8 +86,8 @@ static int __init gfar_mdio_of_init(void
 
 		while ((child = of_get_next_child(np, child)) != NULL) {
 			if (child->n_intrs) {
-				u32 *id =
-				    (u32 *) get_property(child, "reg", NULL);
+				const u32 *id =
+					get_property(child, "reg", NULL);
 				mdio_data.irq[*id] = child->intrs[0].line;
 			}
 		}
@@ -127,10 +127,10 @@ static int __init gfar_of_init(void)
 		struct resource r[4];
 		struct device_node *phy, *mdio;
 		struct gianfar_platform_data gfar_data;
-		unsigned int *id;
-		char *model;
-		void *mac_addr;
-		phandle *ph;
+		const unsigned int *id;
+		const char *model;
+		const void *mac_addr;
+		const phandle *ph;
 
 		memset(r, 0, sizeof(r));
 		memset(&gfar_data, 0, sizeof(gfar_data));
@@ -188,7 +188,7 @@ static int __init gfar_of_init(void)
 			    FSL_GIANFAR_DEV_HAS_VLAN |
 			    FSL_GIANFAR_DEV_HAS_EXTENDED_HASH;
 
-		ph = (phandle *) get_property(np, "phy-handle", NULL);
+		ph = get_property(np, "phy-handle", NULL);
 		phy = of_find_node_by_phandle(*ph);
 
 		if (phy == NULL) {
@@ -198,7 +198,7 @@ static int __init gfar_of_init(void)
 
 		mdio = of_get_parent(phy);
 
-		id = (u32 *) get_property(phy, "reg", NULL);
+		id = get_property(phy, "reg", NULL);
 		ret = of_address_to_resource(mdio, 0, &res);
 		if (ret) {
 			of_node_put(phy);
@@ -242,7 +242,7 @@ static int __init fsl_i2c_of_init(void)
 	     i++) {
 		struct resource r[2];
 		struct fsl_i2c_platform_data i2c_data;
-		unsigned char *flags = NULL;
+		const unsigned char *flags = NULL;
 
 		memset(&r, 0, sizeof(r));
 		memset(&i2c_data, 0, sizeof(i2c_data));
@@ -294,7 +294,7 @@ static int __init mpc83xx_wdt_init(void)
 	struct resource r;
 	struct device_node *soc, *np;
 	struct platform_device *dev;
-	unsigned int *freq;
+	const unsigned int *freq;
 	int ret;
 
 	np = of_find_compatible_node(NULL, "watchdog", "mpc83xx_wdt");
@@ -311,7 +311,7 @@ static int __init mpc83xx_wdt_init(void)
 		goto nosoc;
 	}
 
-	freq = (unsigned int *)get_property(soc, "bus-frequency", NULL);
+	freq = get_property(soc, "bus-frequency", NULL);
 	if (!freq) {
 		ret = -ENODEV;
 		goto err;
@@ -351,7 +351,7 @@ nodev:
 arch_initcall(mpc83xx_wdt_init);
 #endif
 
-static enum fsl_usb2_phy_modes determine_usb_phy(char * phy_type)
+static enum fsl_usb2_phy_modes determine_usb_phy(const char *phy_type)
 {
 	if (!phy_type)
 		return FSL_USB2_PHY_NONE;
@@ -379,7 +379,7 @@ static int __init fsl_usb_of_init(void)
 	     i++) {
 		struct resource r[2];
 		struct fsl_usb2_platform_data usb_data;
-		unsigned char *prop = NULL;
+		const unsigned char *prop = NULL;
 
 		memset(&r, 0, sizeof(r));
 		memset(&usb_data, 0, sizeof(usb_data));
@@ -428,7 +428,7 @@ static int __init fsl_usb_of_init(void)
 	     i++) {
 		struct resource r[2];
 		struct fsl_usb2_platform_data usb_data;
-		unsigned char *prop = NULL;
+		const unsigned char *prop = NULL;
 
 		memset(&r, 0, sizeof(r));
 		memset(&usb_data, 0, sizeof(usb_data));
Index: linux-2.6/arch/powerpc/sysdev/mmio_nvram.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/mmio_nvram.c
+++ linux-2.6/arch/powerpc/sysdev/mmio_nvram.c
@@ -80,7 +80,7 @@ static ssize_t mmio_nvram_get_size(void)
 int __init mmio_nvram_init(void)
 {
 	struct device_node *nvram_node;
-	unsigned long *buffer;
+	const unsigned long *buffer;
 	int proplen;
 	unsigned long nvram_addr;
 	int ret;
@@ -91,7 +91,7 @@ int __init mmio_nvram_init(void)
 		goto out;
 
 	ret = -EIO;
-	buffer = (unsigned long *)get_property(nvram_node, "reg", &proplen);
+	buffer = get_property(nvram_node, "reg", &proplen);
 	if (proplen != 2*sizeof(unsigned long))
 		goto out;
 
Index: linux-2.6/arch/powerpc/kernel/rtas.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/rtas.c
+++ linux-2.6/arch/powerpc/kernel/rtas.c
@@ -177,10 +177,12 @@ void __init udbg_init_rtas_console(void)
 void rtas_progress(char *s, unsigned short hex)
 {
 	struct device_node *root;
-	int width, *p;
+	int width;
+	const int *p;
 	char *os;
 	static int display_character, set_indicator;
-	static int display_width, display_lines, *row_width, form_feed;
+	static int display_width, display_lines, form_feed;
+	const static int *row_width;
 	static DEFINE_SPINLOCK(progress_lock);
 	static int current_line;
 	static int pending_newline = 0;  /* did last write end with unprinted newline? */
@@ -191,16 +193,16 @@ void rtas_progress(char *s, unsigned sho
 	if (display_width == 0) {
 		display_width = 0x10;
 		if ((root = find_path_device("/rtas"))) {
-			if ((p = (unsigned int *)get_property(root,
+			if ((p = get_property(root,
 					"ibm,display-line-length", NULL)))
 				display_width = *p;
-			if ((p = (unsigned int *)get_property(root,
+			if ((p = get_property(root,
 					"ibm,form-feed", NULL)))
 				form_feed = *p;
-			if ((p = (unsigned int *)get_property(root,
+			if ((p = get_property(root,
 					"ibm,display-number-of-lines", NULL)))
 				display_lines = *p;
-			row_width = (unsigned int *)get_property(root,
+			row_width = get_property(root,
 					"ibm,display-truncation-length", NULL);
 		}
 		display_character = rtas_token("display-character");
@@ -293,10 +295,10 @@ EXPORT_SYMBOL(rtas_progress);		/* needed
 
 int rtas_token(const char *service)
 {
-	int *tokp;
+	const int *tokp;
 	if (rtas.dev == NULL)
 		return RTAS_UNKNOWN_SERVICE;
-	tokp = (int *) get_property(rtas.dev, service, NULL);
+	tokp = get_property(rtas.dev, service, NULL);
 	return tokp ? *tokp : RTAS_UNKNOWN_SERVICE;
 }
 EXPORT_SYMBOL(rtas_token);
@@ -824,15 +826,15 @@ void __init rtas_initialize(void)
 	 */
 	rtas.dev = of_find_node_by_name(NULL, "rtas");
 	if (rtas.dev) {
-		u32 *basep, *entryp;
-		u32 *sizep;
+		const u32 *basep, *entryp, *sizep;
 
-		basep = (u32 *)get_property(rtas.dev, "linux,rtas-base", NULL);
-		sizep = (u32 *)get_property(rtas.dev, "rtas-size", NULL);
+		basep = get_property(rtas.dev, "linux,rtas-base", NULL);
+		sizep = get_property(rtas.dev, "rtas-size", NULL);
 		if (basep != NULL && sizep != NULL) {
 			rtas.base = *basep;
 			rtas.size = *sizep;
-			entryp = (u32 *)get_property(rtas.dev, "linux,rtas-entry", NULL);
+			entryp = get_property(rtas.dev,
+					"linux,rtas-entry", NULL);
 			if (entryp == NULL) /* Ugh */
 				rtas.entry = rtas.base;
 			else
Index: linux-2.6/arch/powerpc/kernel/setup_64.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/setup_64.c
+++ linux-2.6/arch/powerpc/kernel/setup_64.c
@@ -107,7 +107,7 @@ static int smt_enabled_cmdline;
 static void check_smt_enabled(void)
 {
 	struct device_node *dn;
-	char *smt_option;
+	const char *smt_option;
 
 	/* Allow the command line to overrule the OF option */
 	if (smt_enabled_cmdline)
@@ -116,7 +116,7 @@ static void check_smt_enabled(void)
 	dn = of_find_node_by_path("/options");
 
 	if (dn) {
-		smt_option = (char *)get_property(dn, "ibm,smt-enabled", NULL);
+		smt_option = get_property(dn, "ibm,smt-enabled", NULL);
 
                 if (smt_option) {
 			if (!strcmp(smt_option, "on"))
@@ -293,7 +293,7 @@ static void __init initialize_cache_info
 		 */
 
 		if ( num_cpus == 1 ) {
-			u32 *sizep, *lsizep;
+			const u32 *sizep, *lsizep;
 			u32 size, lsize;
 			const char *dc, *ic;
 
@@ -308,10 +308,10 @@ static void __init initialize_cache_info
 
 			size = 0;
 			lsize = cur_cpu_spec->dcache_bsize;
-			sizep = (u32 *)get_property(np, "d-cache-size", NULL);
+			sizep = get_property(np, "d-cache-size", NULL);
 			if (sizep != NULL)
 				size = *sizep;
-			lsizep = (u32 *) get_property(np, dc, NULL);
+			lsizep = get_property(np, dc, NULL);
 			if (lsizep != NULL)
 				lsize = *lsizep;
 			if (sizep == 0 || lsizep == 0)
@@ -325,10 +325,10 @@ static void __init initialize_cache_info
 
 			size = 0;
 			lsize = cur_cpu_spec->icache_bsize;
-			sizep = (u32 *)get_property(np, "i-cache-size", NULL);
+			sizep = get_property(np, "i-cache-size", NULL);
 			if (sizep != NULL)
 				size = *sizep;
-			lsizep = (u32 *)get_property(np, ic, NULL);
+			lsizep = get_property(np, ic, NULL);
 			if (lsizep != NULL)
 				lsize = *lsizep;
 			if (sizep == 0 || lsizep == 0)
Index: linux-2.6/include/asm-powerpc/prom.h
===================================================================
--- linux-2.6.orig/include/asm-powerpc/prom.h
+++ linux-2.6/include/asm-powerpc/prom.h
@@ -72,8 +72,8 @@ struct property {
 };
 
 struct device_node {
-	char	*name;
-	char	*type;
+	const char *name;
+	const char *type;
 	phandle	node;
 	phandle linux_phandle;
 	char	*full_name;
@@ -209,15 +209,15 @@ static inline u64 of_read_number(const u
 /* Translate an OF address block into a CPU physical address
  */
 #define OF_BAD_ADDR	((u64)-1)
-extern u64 of_translate_address(struct device_node *np, u32 *addr);
+extern u64 of_translate_address(struct device_node *np, const u32 *addr);
 
 /* Extract an address from a device, returns the region size and
  * the address space flags too. The PCI version uses a BAR number
  * instead of an absolute index
  */
-extern u32 *of_get_address(struct device_node *dev, int index,
+extern const u32 *of_get_address(struct device_node *dev, int index,
 			   u64 *size, unsigned int *flags);
-extern u32 *of_get_pci_address(struct device_node *dev, int bar_no,
+extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no,
 			       u64 *size, unsigned int *flags);
 
 /* Get an address as a resource. Note that if your address is
@@ -234,7 +234,7 @@ extern int of_pci_address_to_resource(st
 /* Parse the ibm,dma-window property of an OF node into the busno, phys and
  * size parameters.
  */
-void of_parse_dma_window(struct device_node *dn, unsigned char *dma_window_prop,
+void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
 		unsigned long *busno, unsigned long *phys, unsigned long *size);
 
 extern void kdump_move_device_tree(void);
@@ -288,8 +288,8 @@ extern void of_irq_map_init(unsigned int
  *
  */
 
-extern int of_irq_map_raw(struct device_node *parent, u32 *intspec, u32 *addr,
-			  struct of_irq *out_irq);
+extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec,
+			  const u32 *addr, struct of_irq *out_irq);
 
 
 /***
Index: linux-2.6/arch/powerpc/kernel/pci_32.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/pci_32.c
+++ linux-2.6/arch/powerpc/kernel/pci_32.c
@@ -633,12 +633,12 @@ pcibios_alloc_controller(void)
 static void
 make_one_node_map(struct device_node* node, u8 pci_bus)
 {
-	int *bus_range;
+	const int *bus_range;
 	int len;
 
 	if (pci_bus >= pci_bus_count)
 		return;
-	bus_range = (int *) get_property(node, "bus-range", &len);
+	bus_range = get_property(node, "bus-range", &len);
 	if (bus_range == NULL || len < 2 * sizeof(int)) {
 		printk(KERN_WARNING "Can't get bus-range for %s, "
 		       "assuming it starts at 0\n", node->full_name);
@@ -648,13 +648,13 @@ make_one_node_map(struct device_node* no
 
 	for (node=node->child; node != 0;node = node->sibling) {
 		struct pci_dev* dev;
-		unsigned int *class_code, *reg;
+		const unsigned int *class_code, *reg;
 	
-		class_code = (unsigned int *) get_property(node, "class-code", NULL);
+		class_code = get_property(node, "class-code", NULL);
 		if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
 			(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
 			continue;
-		reg = (unsigned int *)get_property(node, "reg", NULL);
+		reg = get_property(node, "reg", NULL);
 		if (!reg)
 			continue;
 		dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff));
@@ -669,7 +669,7 @@ pcibios_make_OF_bus_map(void)
 {
 	int i;
 	struct pci_controller* hose;
-	u8* of_prop_map;
+	struct property *map_prop;
 
 	pci_to_OF_bus_map = (u8*)kmalloc(pci_bus_count, GFP_KERNEL);
 	if (!pci_to_OF_bus_map) {
@@ -691,9 +691,12 @@ pcibios_make_OF_bus_map(void)
 			continue;
 		make_one_node_map(node, hose->first_busno);
 	}
-	of_prop_map = get_property(find_path_device("/"), "pci-OF-bus-map", NULL);
-	if (of_prop_map)
-		memcpy(of_prop_map, pci_to_OF_bus_map, pci_bus_count);
+	map_prop = of_find_property(find_path_device("/"),
+			"pci-OF-bus-map", NULL);
+	if (map_prop) {
+		BUG_ON(pci_bus_count > map_prop->length);
+		memcpy(map_prop->value, pci_to_OF_bus_map, pci_bus_count);
+	}
 #ifdef DEBUG
 	printk("PCI->OF bus map:\n");
 	for (i=0; i<pci_bus_count; i++) {
@@ -712,7 +715,7 @@ scan_OF_pci_childs(struct device_node* n
 	struct device_node* sub_node;
 
 	for (; node != 0;node = node->sibling) {
-		unsigned int *class_code;
+		const unsigned int *class_code;
 	
 		if (filter(node, data))
 			return node;
@@ -722,7 +725,7 @@ scan_OF_pci_childs(struct device_node* n
 		 * a fake root for all functions of a multi-function device,
 		 * we go down them as well.
 		 */
-		class_code = (unsigned int *) get_property(node, "class-code", NULL);
+		class_code = get_property(node, "class-code", NULL);
 		if ((!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
 			(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) &&
 			strcmp(node->name, "multifunc-device"))
@@ -737,10 +740,10 @@ scan_OF_pci_childs(struct device_node* n
 static int
 scan_OF_pci_childs_iterator(struct device_node* node, void* data)
 {
-	unsigned int *reg;
+	const unsigned int *reg;
 	u8* fdata = (u8*)data;
 	
-	reg = (unsigned int *) get_property(node, "reg", NULL);
+	reg = get_property(node, "reg", NULL);
 	if (reg && ((reg[0] >> 8) & 0xff) == fdata[1]
 		&& ((reg[0] >> 16) & 0xff) == fdata[0])
 		return 1;
@@ -841,7 +844,7 @@ find_OF_pci_device_filter(struct device_
 int
 pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
 {
-	unsigned int *reg;
+	const unsigned int *reg;
 	struct pci_controller* hose;
 	struct pci_dev* dev = NULL;
 	
@@ -854,7 +857,7 @@ pci_device_from_OF_node(struct device_no
 	if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child,
 			find_OF_pci_device_filter, (void *)node))
 		return -ENODEV;
-	reg = (unsigned int *) get_property(node, "reg", NULL);
+	reg = get_property(node, "reg", NULL);
 	if (!reg)
 		return -ENODEV;
 	*bus = (reg[0] >> 16) & 0xff;
@@ -885,8 +888,8 @@ pci_process_bridge_OF_ranges(struct pci_
 			   struct device_node *dev, int primary)
 {
 	static unsigned int static_lc_ranges[256] __initdata;
-	unsigned int *dt_ranges, *lc_ranges, *ranges, *prev;
-	unsigned int size;
+	const unsigned int *dt_ranges;
+	unsigned int *lc_ranges, *ranges, *prev, size;
 	int rlen = 0, orig_rlen;
 	int memno = 0;
 	struct resource *res;
@@ -897,7 +900,7 @@ pci_process_bridge_OF_ranges(struct pci_
 	 * that can have more than 3 ranges, fortunately using contiguous
 	 * addresses -- BenH
 	 */
-	dt_ranges = (unsigned int *) get_property(dev, "ranges", &rlen);
+	dt_ranges = get_property(dev, "ranges", &rlen);
 	if (!dt_ranges)
 		return;
 	/* Sanity check, though hopefully that never happens */
Index: linux-2.6/include/asm-powerpc/ibmebus.h
===================================================================
--- linux-2.6.orig/include/asm-powerpc/ibmebus.h
+++ linux-2.6/include/asm-powerpc/ibmebus.h
@@ -48,7 +48,7 @@ extern struct dma_mapping_ops ibmebus_dm
 extern struct bus_type ibmebus_bus_type;
 
 struct ibmebus_dev {	
-	char *name;
+	const char *name;
 	struct of_device ofdev;
 };
 
Index: linux-2.6/arch/powerpc/kernel/sysfs.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/sysfs.c
+++ linux-2.6/arch/powerpc/kernel/sysfs.c
@@ -60,7 +60,7 @@ static int smt_snooze_cmdline;
 static int __init smt_setup(void)
 {
 	struct device_node *options;
-	unsigned int *val;
+	const unsigned int *val;
 	unsigned int cpu;
 
 	if (!cpu_has_feature(CPU_FTR_SMT))
@@ -70,8 +70,7 @@ static int __init smt_setup(void)
 	if (!options)
 		return -ENODEV;
 
-	val = (unsigned int *)get_property(options, "ibm,smt-snooze-delay",
-					   NULL);
+	val = get_property(options, "ibm,smt-snooze-delay", NULL);
 	if (!smt_snooze_cmdline && val) {
 		for_each_possible_cpu(cpu)
 			per_cpu(smt_snooze_delay, cpu) = *val;
Index: linux-2.6/include/asm-powerpc/vio.h
===================================================================
--- linux-2.6.orig/include/asm-powerpc/vio.h
+++ linux-2.6/include/asm-powerpc/vio.h
@@ -46,8 +46,8 @@ struct iommu_table;
  */
 struct vio_dev {
 	struct iommu_table *iommu_table;     /* vio_map_* uses this */
-	char *name;
-	char *type;
+	const char *name;
+	const char *type;
 	uint32_t unit_address;
 	unsigned int irq;
 	struct device dev;
Index: linux-2.6/arch/powerpc/mm/numa.c
===================================================================
--- linux-2.6.orig/arch/powerpc/mm/numa.c
+++ linux-2.6/arch/powerpc/mm/numa.c
@@ -159,12 +159,12 @@ static struct device_node * __cpuinit fi
 {
 	unsigned int hw_cpuid = get_hard_smp_processor_id(cpu);
 	struct device_node *cpu_node = NULL;
-	unsigned int *interrupt_server, *reg;
+	const unsigned int *interrupt_server, *reg;
 	int len;
 
 	while ((cpu_node = of_find_node_by_type(cpu_node, "cpu")) != NULL) {
 		/* Try interrupt server first */
-		interrupt_server = (unsigned int *)get_property(cpu_node,
+		interrupt_server = get_property(cpu_node,
 					"ibm,ppc-interrupt-server#s", &len);
 
 		len = len / sizeof(u32);
@@ -175,8 +175,7 @@ static struct device_node * __cpuinit fi
 					return cpu_node;
 			}
 		} else {
-			reg = (unsigned int *)get_property(cpu_node,
-							   "reg", &len);
+			reg = get_property(cpu_node, "reg", &len);
 			if (reg && (len > 0) && (reg[0] == hw_cpuid))
 				return cpu_node;
 		}
@@ -186,9 +185,9 @@ static struct device_node * __cpuinit fi
 }
 
 /* must hold reference to node during call */
-static int *of_get_associativity(struct device_node *dev)
+static const int *of_get_associativity(struct device_node *dev)
 {
-	return (unsigned int *)get_property(dev, "ibm,associativity", NULL);
+	return get_property(dev, "ibm,associativity", NULL);
 }
 
 /* Returns nid in the range [0..MAX_NUMNODES-1], or -1 if no useful numa
@@ -197,7 +196,7 @@ static int *of_get_associativity(struct 
 static int of_node_to_nid_single(struct device_node *device)
 {
 	int nid = -1;
-	unsigned int *tmp;
+	const unsigned int *tmp;
 
 	if (min_common_depth == -1)
 		goto out;
@@ -255,7 +254,7 @@ EXPORT_SYMBOL_GPL(of_node_to_nid);
 static int __init find_min_common_depth(void)
 {
 	int depth;
-	unsigned int *ref_points;
+	const unsigned int *ref_points;
 	struct device_node *rtas_root;
 	unsigned int len;
 
@@ -270,7 +269,7 @@ static int __init find_min_common_depth(
 	 * configuration (should be all 0's) and the second is for a normal
 	 * NUMA configuration.
 	 */
-	ref_points = (unsigned int *)get_property(rtas_root,
+	ref_points = get_property(rtas_root,
 			"ibm,associativity-reference-points", &len);
 
 	if ((len >= 1) && ref_points) {
@@ -297,7 +296,7 @@ static void __init get_n_mem_cells(int *
 	of_node_put(memory);
 }
 
-static unsigned long __devinit read_n_cells(int n, unsigned int **buf)
+static unsigned long __devinit read_n_cells(int n, const unsigned int **buf)
 {
 	unsigned long result = 0;
 
@@ -435,15 +434,13 @@ static int __init parse_numa_properties(
 		unsigned long size;
 		int nid;
 		int ranges;
-		unsigned int *memcell_buf;
+		const unsigned int *memcell_buf;
 		unsigned int len;
 
-		memcell_buf = (unsigned int *)get_property(memory,
+		memcell_buf = get_property(memory,
 			"linux,usable-memory", &len);
 		if (!memcell_buf || len <= 0)
-			memcell_buf =
-				(unsigned int *)get_property(memory, "reg",
-					&len);
+			memcell_buf = get_property(memory, "reg", &len);
 		if (!memcell_buf || len <= 0)
 			continue;
 
@@ -787,10 +784,10 @@ int hot_add_scn_to_nid(unsigned long scn
 	while ((memory = of_find_node_by_type(memory, "memory")) != NULL) {
 		unsigned long start, size;
 		int ranges;
-		unsigned int *memcell_buf;
+		const unsigned int *memcell_buf;
 		unsigned int len;
 
-		memcell_buf = (unsigned int *)get_property(memory, "reg", &len);
+		memcell_buf = get_property(memory, "reg", &len);
 		if (!memcell_buf || len <= 0)
 			continue;
 

^ permalink raw reply

* RE: weird behavior for jffs2 on PQ2FADS-VR board
From: Li Yang-r58472 @ 2006-07-12  5:41 UTC (permalink / raw)
  To: Lei Sun, linuxppc-embedded
In-Reply-To: <f9a7e7a80607112123t7e93221fx37d83245622d4368@mail.gmail.com>

Here is the kernel config we used, you can have a try.


# Memory Technology Devices (MTD)
#
CONFIG_MTD=3Dy
# CONFIG_MTD_DEBUG is not set
CONFIG_MTD_PARTITIONS=3Dy
# CONFIG_MTD_CONCAT is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_CMDLINE_PARTS is not set

#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=3Dy
CONFIG_MTD_BLOCK=3Dy
# CONFIG_FTL is not set
# CONFIG_NFTL is not set

#
# RAM/ROM/Flash chip drivers
#
# CONFIG_MTD_CFI is not set
CONFIG_MTD_JEDECPROBE=3Dy
CONFIG_MTD_GEN_PROBE=3Dy
CONFIG_MTD_CFI_ADV_OPTIONS=3Dy
# CONFIG_MTD_CFI_NOSWAP is not set
# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
CONFIG_MTD_CFI_LE_BYTE_SWAP=3Dy
# CONFIG_MTD_CFI_GEOMETRY is not set
CONFIG_MTD_CFI_INTELEXT=3Dy
# CONFIG_MTD_CFI_AMDSTD is not set
# CONFIG_MTD_CFI_STAA is not set
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# CONFIG_MTD_OBSOLETE_CHIPS is not set
# CONFIG_MTD_AMDSTD is not set
# CONFIG_MTD_SHARP is not set
# CONFIG_MTD_JEDEC is not set

Best Regards,
Leo
> -----Original Message-----
> From: linuxppc-embedded-bounces+leoli=3Dfreescale.com@ozlabs.org
> [mailto:linuxppc-embedded-bounces+leoli=3Dfreescale.com@ozlabs.org] On
Behalf
> Of Lei Sun
> Sent: Wednesday, July 12, 2006 12:23 PM
> To: linuxppc-embedded@ozlabs.org
> Subject: weird behavior for jffs2 on PQ2FADS-VR board
>=20
> Hi all:
>     I brought up linux-2.4.30 on PQ2FADS-VR board, everything was fine
> untill i try to mount the jffs2.  My mtd partition looks like this:
>=20
> dev:    size   erasesize  name
> mtd0: 00800000 00040000 "Flash SIMM"
> mtd1: 00080000 00040000 "u-boot"
> mtd2: 00100000 00040000 "Kernel"
> mtd3: 00580000 00040000 "Rootfs"
> mtd4: 00080000 00040000 "u-boot env"
> mtd5: 00080000 00040000 "unused"
>=20
> Basically, I tried
> "eraseall /dev/mtd3", and then
> "mount -t jffs2 /dev/mtdblock3 /mnt", it showed as mounted, then I
> issued "echo "hello,world" > test.txt" to create a file,
> a warning was printed out
> "Node totlen on flash (0x44000000) !=3D totlen in node ref =
(0x00000044)"
> , but subsequent
> "cat test.txt " still showed the correct string from that newly
created file".
> However, after I umount the  file and remount it again, it give me
> lots of errors"
> Magic bitmask 0x1985 not found at 0x00240004: 0x0c00 instead"
> Then the moutn operation failed.
>     I am suspecting it is mtd driver problem (the board use
> LH28F016SCT-L95 from sharp). But don't know how to proceed , e.g. how
> to verify the content was written into flash in a mounted jffs2 file
> system?
>     Has anybody experienced similar issue? Any suggestion?
>     Forgive me if this is wrong list to post, and very appreciate if
> anybody can direct me to the right place.
>=20
> Thanks!
> lei
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply

* [PATCH 04/16] [powerpc,mpc] Constify & voidify get_property()
From: Jeremy Kerr @ 2006-07-12  5:39 UTC (permalink / raw)
  To: linuxppc-dev

Now that get_property() returns a void *, there's no need to cast its
return value. Also, treat the return value as const, so we can
constify get_property later.

mpc* platform changes.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---

 resend: rebase after benh's IRQ changes

 83xx/mpc834x_itx.c         |    4 ++--
 83xx/mpc834x_sys.c         |    4 ++--
 83xx/pci.c                 |    4 ++--
 85xx/mpc85xx_ads.c         |    4 ++--
 85xx/mpc85xx_cds.c         |    4 ++--
 85xx/pci.c                 |    4 ++--
 86xx/mpc86xx_hpcn.c        |    4 ++--
 86xx/pci.c                 |    4 ++--
 embedded6xx/mpc7448_hpc2.c |    8 ++++----
 9 files changed, 20 insertions(+), 20 deletions(-)

Index: linux-2.6/arch/powerpc/platforms/83xx/mpc834x_sys.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/83xx/mpc834x_sys.c
+++ linux-2.6/arch/powerpc/platforms/83xx/mpc834x_sys.c
@@ -84,8 +84,8 @@ static void __init mpc834x_sys_setup_arc
 
 	np = of_find_node_by_type(NULL, "cpu");
 	if (np != 0) {
-		unsigned int *fp =
-		    (int *)get_property(np, "clock-frequency", NULL);
+		const unsigned int *fp =
+			get_property(np, "clock-frequency", NULL);
 		if (fp != 0)
 			loops_per_jiffy = *fp / HZ;
 		else
Index: linux-2.6/arch/powerpc/platforms/83xx/pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/83xx/pci.c
+++ linux-2.6/arch/powerpc/platforms/83xx/pci.c
@@ -50,7 +50,7 @@ int __init add_bridge(struct device_node
 	int len;
 	struct pci_controller *hose;
 	struct resource rsrc;
-	int *bus_range;
+	const int *bus_range;
 	int primary = 1, has_address = 0;
 	phys_addr_t immr = get_immrbase();
 
@@ -60,7 +60,7 @@ int __init add_bridge(struct device_node
 	has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
 
 	/* Get bus range if any */
-	bus_range = (int *)get_property(dev, "bus-range", &len);
+	bus_range = get_property(dev, "bus-range", &len);
 	if (bus_range == NULL || len < 2 * sizeof(int)) {
 		printk(KERN_WARNING "Can't get bus-range for %s, assume"
 		       " bus 0\n", dev->full_name);
Index: linux-2.6/arch/powerpc/platforms/85xx/mpc85xx_ads.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ linux-2.6/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -172,9 +172,9 @@ static void __init mpc85xx_ads_setup_arc
 
 	cpu = of_find_node_by_type(NULL, "cpu");
 	if (cpu != 0) {
-		unsigned int *fp;
+		const unsigned int *fp;
 
-		fp = (int *)get_property(cpu, "clock-frequency", NULL);
+		fp = get_property(cpu, "clock-frequency", NULL);
 		if (fp != 0)
 			loops_per_jiffy = *fp / HZ;
 		else
Index: linux-2.6/arch/powerpc/platforms/85xx/mpc85xx_cds.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ linux-2.6/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -273,9 +273,9 @@ mpc85xx_cds_setup_arch(void)
 
 	cpu = of_find_node_by_type(NULL, "cpu");
 	if (cpu != 0) {
-		unsigned int *fp;
+		const unsigned int *fp;
 
-		fp = (int *)get_property(cpu, "clock-frequency", NULL);
+		fp = get_property(cpu, "clock-frequency", NULL);
 		if (fp != 0)
 			loops_per_jiffy = *fp / HZ;
 		else
Index: linux-2.6/arch/powerpc/platforms/86xx/pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/86xx/pci.c
+++ linux-2.6/arch/powerpc/platforms/86xx/pci.c
@@ -153,7 +153,7 @@ int __init add_bridge(struct device_node
 	int len;
 	struct pci_controller *hose;
 	struct resource rsrc;
-	int *bus_range;
+	const int *bus_range;
 	int has_address = 0;
 	int primary = 0;
 
@@ -163,7 +163,7 @@ int __init add_bridge(struct device_node
 	has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
 
 	/* Get bus range if any */
-	bus_range = (int *) get_property(dev, "bus-range", &len);
+	bus_range = get_property(dev, "bus-range", &len);
 	if (bus_range == NULL || len < 2 * sizeof(int))
 		printk(KERN_WARNING "Can't get bus-range for %s, assume"
 		       " bus 0\n", dev->full_name);
Index: linux-2.6/arch/powerpc/platforms/85xx/pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/85xx/pci.c
+++ linux-2.6/arch/powerpc/platforms/85xx/pci.c
@@ -41,7 +41,7 @@ int __init add_bridge(struct device_node
 	int len;
 	struct pci_controller *hose;
 	struct resource rsrc;
-	int *bus_range;
+	const int *bus_range;
 	int primary = 1, has_address = 0;
 	phys_addr_t immr = get_immrbase();
 
@@ -51,7 +51,7 @@ int __init add_bridge(struct device_node
 	has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
 
 	/* Get bus range if any */
-	bus_range = (int *) get_property(dev, "bus-range", &len);
+	bus_range = get_property(dev, "bus-range", &len);
 	if (bus_range == NULL || len < 2 * sizeof(int)) {
 		printk(KERN_WARNING "Can't get bus-range for %s, assume"
 		       " bus 0\n", dev->full_name);
Index: linux-2.6/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ linux-2.6/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -323,9 +323,9 @@ mpc86xx_hpcn_setup_arch(void)
 
 	np = of_find_node_by_type(NULL, "cpu");
 	if (np != 0) {
-		unsigned int *fp;
+		const unsigned int *fp;
 
-		fp = (int *)get_property(np, "clock-frequency", NULL);
+		fp = get_property(np, "clock-frequency", NULL);
 		if (fp != 0)
 			loops_per_jiffy = *fp / HZ;
 		else
Index: linux-2.6/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ linux-2.6/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -130,7 +130,7 @@ void mpc7448_hpc2_fixup_irq(struct pci_d
 {
 	struct pci_controller *hose;
 	struct device_node *node;
-	unsigned int *interrupt;
+	const unsigned int *interrupt;
 	int busnr;
 	int len;
 	u8 slot;
@@ -147,7 +147,7 @@ void mpc7448_hpc2_fixup_irq(struct pci_d
 	if (!node)
 		printk(KERN_ERR "No pci node found\n");
 
-	interrupt = (unsigned int *) get_property(node, "interrupt-map", &len);
+	interrupt = get_property(node, "interrupt-map", &len);
 	slot = find_slot_by_devfn(interrupt, dev->devfn);
 	pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
 	if (pin == 0 || pin > 4)
@@ -176,9 +176,9 @@ static void __init mpc7448_hpc2_setup_ar
 
 	cpu = of_find_node_by_type(NULL, "cpu");
 	if (cpu != 0) {
-		unsigned int *fp;
+		const unsigned int *fp;
 
-		fp = (int *)get_property(cpu, "clock-frequency", NULL);
+		fp = get_property(cpu, "clock-frequency", NULL);
 		if (fp != 0)
 			loops_per_jiffy = *fp / HZ;
 		else
Index: linux-2.6/arch/powerpc/platforms/83xx/mpc834x_itx.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ linux-2.6/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -80,8 +80,8 @@ static void __init mpc834x_itx_setup_arc
 
 	np = of_find_node_by_type(NULL, "cpu");
 	if (np != 0) {
-		unsigned int *fp =
-		    (int *)get_property(np, "clock-frequency", NULL);
+		const unsigned int *fp =
+			get_property(np, "clock-frequency", NULL);
 		if (fp != 0)
 			loops_per_jiffy = *fp / HZ;
 		else

^ permalink raw reply

* [PATCH 03/16] [powerpc,iseries] Constify & voidify get_property()
From: Jeremy Kerr @ 2006-07-12  5:39 UTC (permalink / raw)
  To: linuxppc-dev

Now that get_property() returns a void *, there's no need to cast its
return value. Also, treat the return value as const, so we can
constify get_property later.

iseries platform changes.

Built for iseries_defconfig

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---

 resend: rebase after benh's IRQ changes

 iommu.c |    2 +-
 pci.c   |    9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

Index: linux-2.6/arch/powerpc/platforms/iseries/iommu.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/iseries/iommu.c
+++ linux-2.6/arch/powerpc/platforms/iseries/iommu.c
@@ -162,7 +162,7 @@ void iommu_devnode_init_iSeries(struct d
 {
 	struct iommu_table *tbl;
 	struct pci_dn *pdn = PCI_DN(dn);
-	u32 *lsn = (u32 *)get_property(dn, "linux,logical-slot-number", NULL);
+	const u32 *lsn = get_property(dn, "linux,logical-slot-number", NULL);
 
 	BUG_ON(lsn == NULL);
 
Index: linux-2.6/arch/powerpc/platforms/iseries/pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/iseries/pci.c
+++ linux-2.6/arch/powerpc/platforms/iseries/pci.c
@@ -176,12 +176,12 @@ void iSeries_pcibios_init(void)
 	}
 	while ((node = of_get_next_child(root, node)) != NULL) {
 		HvBusNumber bus;
-		u32 *busp;
+		const u32 *busp;
 
 		if ((node->type == NULL) || (strcmp(node->type, "pci") != 0))
 			continue;
 
-		busp = (u32 *)get_property(node, "bus-range", NULL);
+		busp = get_property(node, "bus-range", NULL);
 		if (busp == NULL)
 			continue;
 		bus = *busp;
@@ -221,10 +221,9 @@ void __init iSeries_pci_final_fixup(void
 
 		if (node != NULL) {
 			struct pci_dn *pdn = PCI_DN(node);
-			u32 *agent;
+			const u32 *agent;
 
-			agent = (u32 *)get_property(node, "linux,agent-id",
-					NULL);
+			agent = get_property(node, "linux,agent-id", NULL);
 			if ((pdn != NULL) && (agent != NULL)) {
 				u8 irq = iSeries_allocate_IRQ(pdn->busno, 0,
 						pdn->bussubno);

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox