LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [patch 1/3] fsl_soc: Fix trivial printk typo.
From: Peter Korsgaard @ 2007-09-20 10:42 UTC (permalink / raw)
  To: linuxppc-dev, galak; +Cc: G. Liakhovetski
In-Reply-To: <20070920104211.896143373@sunsite.dk>

Fix a trivial printk typo in fsl_soc.

Cc: G. Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
 arch/powerpc/sysdev/fsl_soc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/arch/powerpc/sysdev/fsl_soc.c
===================================================================
--- linux.orig/arch/powerpc/sysdev/fsl_soc.c
+++ linux/arch/powerpc/sysdev/fsl_soc.c
@@ -346,7 +346,7 @@
 
 		addr = of_get_property(node, "reg", &len);
 		if (!addr || len < sizeof(int) || *addr > (1 << 10) - 1) {
-			printk(KERN_WARNING "fsl_ioc.c: invalid i2c device entry\n");
+			printk(KERN_WARNING "fsl_soc.c: invalid i2c device entry\n");
 			continue;
 		}
 

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* [patch 3/3] mpc8349emitx.dts: Add ds1339 RTC
From: Peter Korsgaard @ 2007-09-20 10:42 UTC (permalink / raw)
  To: linuxppc-dev, galak; +Cc: Timur Tabi
In-Reply-To: <20070920104211.896143373@sunsite.dk>

Add ds1339 I2C RTC chip as child of 2nd I2C controller.

Cc: Timur Tabi <timur@freescale.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
 arch/powerpc/boot/dts/mpc8349emitx.dts |    7 +++++++
 1 file changed, 7 insertions(+)

Index: linux/arch/powerpc/boot/dts/mpc8349emitx.dts
===================================================================
--- linux.orig/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ linux/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -68,6 +68,13 @@
 			interrupts = <f 8>;
 			interrupt-parent = < &ipic >;
 			dfsrr;
+
+			rtc@68 {
+				device_type = "rtc";
+				compatible = "dallas,ds1339";
+				reg = <68 4>;
+			};
+
 		};
 
 		spi@7000 {

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* [patch 2/3] fsl_soc: rtc-ds1307 support
From: Peter Korsgaard @ 2007-09-20 10:42 UTC (permalink / raw)
  To: linuxppc-dev, galak; +Cc: G. Liakhovetski
In-Reply-To: <20070920104211.896143373@sunsite.dk>

Add support for the I2C devices handled by the rtc-ds1307 driver to
of_register_i2c_devices.

Cc: G. Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
 arch/powerpc/sysdev/fsl_soc.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux/arch/powerpc/sysdev/fsl_soc.c
===================================================================
--- linux.orig/arch/powerpc/sysdev/fsl_soc.c
+++ linux/arch/powerpc/sysdev/fsl_soc.c
@@ -319,6 +319,12 @@
 	{"ricoh,rs5c372b", "rtc-rs5c372", "rs5c372b",},
 	{"ricoh,rv5c386",  "rtc-rs5c372", "rv5c386",},
 	{"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",},
+	{"dallas,ds1307",  "rtc-ds1307",  "ds1307",},
+	{"dallas,ds1337",  "rtc-ds1307",  "ds1337",},
+	{"dallas,ds1338",  "rtc-ds1307",  "ds1338",},
+	{"dallas,ds1339",  "rtc-ds1307",  "ds1339",},
+	{"dallas,ds1340",  "rtc-ds1307",  "ds1340",},
+	{"stm,m41t00",     "rtc-ds1307",  "m41t00"},
 };
 
 static int __init of_find_i2c_driver(struct device_node *node, struct i2c_board_info *info)

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* [patch 0/3] fsl_soc / mpc8349emitx patches
From: Peter Korsgaard @ 2007-09-20 10:42 UTC (permalink / raw)
  To: linuxppc-dev, galak

Various small fsl_soc / mpc8349emitx patches.

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* (no subject)
From: - Reyneke @ 2007-09-20 10:04 UTC (permalink / raw)
  To: jwboyer, jeynergilcaga; +Cc: linuxppc-embedded

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


>>Where did you get your kernel from?  2.6.19 doesn't have any 440EPx support in it

Linux kernel is from DENX, and yes it has full 440EPx support.

>> In you statement, initialise correctly (i.e. receive and transmit), did you use like ping or ftp to do it?
>> What do you mean by the word initialise?


 I think the best response will be to provide a short example via u-boot output.



The board has just booted up. Eth1 is connected and has a 1Gb link (as per PHY and connected switch LEDS). Eth0 is NOT cabled.





...

ver=U-Boot 1.2.0 (Sep 18 2007 - 15:51:19)



=> setenv netdev eth1

=> setenv ethact ppc_4xx_eth1

=> ping 10.1.12.90

Waiting for PHY auto negotiation to complete... done

ENET Speed is 1000 Mbps - FULL duplex connection

Using ppc_4xx_eth1 device

ping failed; host 10.1.12.90 is not alive



<At this point, we plug in a Ethernet cable into eth0 and wait for link status>



=> ping 10.1.12.90

ENET Speed is 1000 Mbps - FULL duplex connection

Using ppc_4xx_eth1 device

host 10.1.12.90 is alive

=> 





At this point, the Eth0 link can be removed. Eth1 will from now send and receive as expected.



So, it looks like some kind of initialisation issue. What we would like to know is whether anyone else have come across a similar problem.



Other interesting point is that we tried the same test on a AMCC Sequoia (same type of board, different PHYs). And it worked fine. So it suggest that it is ether something we are doing wrong in our board initialisation, or it's the EMAC - PHY combination.





On Wed, 19 Sep 2007 13:54:35 +0000
"- Reyneke" <reynekejunk@hotmail.com> wrote:
 
> HI,
> 
> We've run into a bit of an odd problem and we are not sure where to go and 
> look for the cause.
> 
> We have some 440EPx based hardware with two GIG-Ethernet ports using RGMII 
> and 2x ET1011C PHY's. Problem is that eth1 will only initialise correctly 
> (i.e. receive and transmit) if eth0 has a link. Eth0 always work OK, 
> regardless of eth1 status. Eth1 will work OK if eth0 has a link (i.e. 
> initialised) at time of setup. Once initialised, eth0 status is irrelevant. 
> All this is during Linux boot process.
> 
> Any ideas?





_________________________________________________________________
Feel like a local wherever you go.
http://www.backofmyhand.com

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

^ permalink raw reply

* The  ds1337 chip on fsl_mp8313E RDB REVA 3 doesn't  work properly
From: Andrew Liu @ 2007-09-20  9:09 UTC (permalink / raw)
  To: linuxppc-embedded

Hello All,
The same u-boot/kernel/rootfs on fsl_mp8313E RDB REVA 2, DS1337  RTC
chip can work,
but on sl_mp8313E RDB REVA 3, it doesn't work, its time don't change.

This RTC chip  specific bad behavior on sl_mp8313E RDB REVA 3  as follows:
(1) On U-Boot (from Freescale), run command:
=> i2c md 0x68 0x0
0000: 32 33 10 04 20 89 08 84 00 20 53 00 42 16 18 80    23.. .... S.B...
after a while
=> i2c md 0x68 0x0
0000: 32 33 10 04 20 89 08 84 00 20 53 00 42 16 18 80    23.. .... S.B...

The first value(second value) is unchanged always, but on  fsl_mp8313E
RDB REVA 2, it changes.
meanwhile, we can change this value through i2c nm 0x68  0xX on 
fsl_mp8313E RDB REVA 3.

SO the core of this problem is the time always keeps same.

(2) during Linux kernel bootup, we can see:
 oing write 0 bytes to 0x68 - 1 of 1 messages
i2c_adapter i2c-0: master_xfer[0] W, addr=0x68, len=1
i2c_adapter i2c-0: master_xfer[1] R, addr=0x68, len=8
Doing write 1 bytes to 0x68 - 1 of 2 messages
Doing read 8 bytes to 0x68 - 2 of 2 messages
i2c_adapter i2c-0: client [ds1307] registered with bus id 0-0068
ds1307 0-0068: rtc intf: sysfs
ds1307 0-0068: rtc intf: proc
ds1307 0-0068: rtc intf: dev (254:0)
ds1307 0-0068: rtc core: registered ds1307 as rtc0
i2c_adapter i2c-1: found normal entry for adapter 1, addr 0x68
i2c_adapter i2c-1: master_xfer[0] W, addr=0x68, len=0
Doing write 0 bytes to 0x68 - 1 of 1 messages
I2C: No RXAK
..............................
i2c_adapter i2c-0: master_xfer[0] W, addr=0x68, len=1
i2c_adapter i2c-0: master_xfer[1] R, addr=0x68, len=7
Doing write 1 bytes to 0x68 - 1 of 2 messages
Doing read 7 bytes to 0x68 - 2 of 2 messages
ds1307 0-0068: read: 32 33 10 04 20 89 08
ds1307 0-0068: read secs=32, mins=33, hours=10, mday=20, mon=8,
year=108, wday=3
ds1307 0-0068: setting the system clock to 2008-09-20 10:33:32 (1221906812)

it indicates can  read and write RTC chip through I2C. but after system
boot up,  we can see the time always same.

After  adjusting these configurations on  U-Boot environment according
to fsl_mp8313E RDB REVA 2, it still doesn't work.

Who can give me some advice or suggestion ?  currently I doubt this
hardware, but  what a shame I have only one fsl_mp8313E RDB REVA 3 board,
can't  do comparison experiment.
 
Thanks in advance.
Andrew Liu

^ permalink raw reply

* Re: 8270 & Watchdog - early start
From: Laurent Pinchart @ 2007-09-20  8:54 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <AEA1A32F001C6B4F98614B5B80D7647D02D73DEB@esealmw115.eemea.ericsson.se>

Hi Matias,

On Thursday 20 September 2007 10:19, Matias Sundman wrote:
> Hi,
> I have a custom MPC8270 board running Linux and u-boot.
> Now, I enabled the watchdog on the 8270 and need to kick it regularly by
> writing ;
>
> 0x556c
> 0xaa39
>
> To the internal register @ 0x0x1000e.
>
> When I am coming out from head.S to start_kernel I was thinking of
> kicking it a couple times "manually" before a timer interrupt is inserted
> which will take care of it until a "superdaemon" is taking over.
>
> I tried to serve the register as follows;
>
> *((volatile unsigned int*)(0xf001000e))=3D0x556c;
> *((volatile unsigned int*)(0xf001000e))=3D0xaa39;
>
> But it does not take effect. I thought that since u-boot had set up the
> IMMR to 0xf000'0000 I could directly write to the register as above.
>
> Any clues why this does not work?

The Software Service Register (SWSR) is 16-bit wide. Unsigned int on the 82=
70=20
is 32-bit wide.

You must not reference physical addresses directly after the MMU has been=20
turned on. Use ioremap/iounmap to map/unmaap the CPM registers. If you're=20
using ARCH=3Dppc, you can also use the global CPM mapping cpm2_immr.

Use the out_* macros/functions to write to I/O space.

out_be16(&cpm2_immr->im_siu_conf.siu_82xx.sc_swsr, 0x556c);
out_be16(&cpm2_immr->im_siu_conf.siu_82xx.sc_swsr, 0xaa39);

Best regards,

=2D-=20
Laurent Pinchart
CSE Semaphore Belgium

Chauss=C3=A9e de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
=46 +32 (2) 387 42 75

^ permalink raw reply

* 8270 & Watchdog - early start
From: Matias Sundman @ 2007-09-20  8:19 UTC (permalink / raw)
  To: linuxppc-embedded

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


Hi,
I have a custom MPC8270 board running Linux and u-boot.
Now, I enabled the watchdog on the 8270 and need to kick it regularly by
writing ;

0x556c
0xaa39

To the internal register @ 0x0x1000e.

When I am coming out from head.S to start_kernel I was thinking of
kicking
it a couple times "manually"
before a timer interrupt is inserted which will take care of it until a
"superdaemon" is taking over.

I tried to serve the register as follows;


*((volatile unsigned int*)(0xf001000e))=0x556c;
*((volatile unsigned int*)(0xf001000e))=0xaa39;

But it does not take effect. I thought that since u-boot had set up the
IMMR
to 0xf000'0000 I could
directly write to the register as above.


Any clues why this does not work?


Thx // Matias


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

^ permalink raw reply

* Re: Configuration-Problem ext-interrupt on mpc52xx
From: S. Fricke @ 2007-09-20  8:37 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <20070919234016.GA14404@localhost.localdomain>

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

Hello,

> > I have read it! But another driver on Boot-time pulled my interrupt
> 
> Erm.. if the interrupt is shared with something else which expects a
> different trigger/polarity, you're kind of stuffed....

YEEeess! An incomplete documentation is suboptimal! In german, we would
say: "[...] Das es die Sau krausst [...]"

I have now used an another Interrupt and it works.

Mit freundlichen Gruessen
Silvio Fricke

-- 
-- S. Fricke ----------------------------- MAILTO:silvio.fricke@gmail.com --
   Diplom-Informatiker (FH)                   TEL:       (+49)8330-911278
   Linux-Entwicklung                       JABBER:      fricke@jabber.org
-- Steinbacher Strasse 18, D-87764 Legau -----------------------------------


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* [PATCH] [POWERPC] Create and use CONFIG_WORD_SIZE
From: Stephen Rothwell @ 2007-09-20  8:08 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev

Linus made this suggestion for the x86 merge and this starts the process
for powerpc. We assume that CONFIG_PPC64 implies CONFIG_PPC_MERGE and
CONFIG_PPC_STD_MMU_32 implies CONFIG_PPC_STD_MMU.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/Kconfig         |    5 +++++
 arch/powerpc/Makefile        |   15 ++++++---------
 arch/powerpc/kernel/Makefile |   30 +++++++++++++-----------------
 arch/powerpc/lib/Makefile    |    7 ++++---
 arch/powerpc/mm/Makefile     |   13 ++++++++-----
 arch/ppc/Kconfig             |    4 ++++
 6 files changed, 40 insertions(+), 34 deletions(-)

Built for ARCH=powerpc all defconfigs and ARCH=ppc all defconfigs (most
of which failed for (I am pretty sure) reasons unrelated to this patch).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 66a3295..de886ec 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -14,6 +14,11 @@ config 64BIT
 	bool
 	default y if PPC64
 
+config WORD_SIZE
+	int
+	default 64 if PPC64
+	default 32 if !PPC64
+
 config PPC_MERGE
 	def_bool y
 
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 6015a92..9de1833 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -39,7 +39,6 @@ KBUILD_DEFCONFIG := $(shell uname -m)_defconfig
 
 ifeq ($(CONFIG_PPC64),y)
 OLDARCH	:= ppc64
-SZ	:= 64
 
 new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
 
@@ -49,16 +48,15 @@ endif
 
 else
 OLDARCH	:= ppc
-SZ	:= 32
 endif
 
 UTS_MACHINE := $(OLDARCH)
 
 ifeq ($(HAS_BIARCH),y)
-override AS	+= -a$(SZ)
-override LD	+= -m elf$(SZ)ppc
-override CC	+= -m$(SZ)
-override AR	:= GNUTARGET=elf$(SZ)-powerpc $(AR)
+override AS	+= -a$(CONFIG_WORD_SIZE)
+override LD	+= -m elf$(CONFIG_WORD_SIZE)ppc
+override CC	+= -m$(CONFIG_WORD_SIZE)
+override AR	:= GNUTARGET=elf$(CONFIG_WORD_SIZE)-powerpc $(AR)
 endif
 
 LDFLAGS_vmlinux	:= -Bstatic
@@ -72,7 +70,7 @@ AFLAGS		+= $(AFLAGS-y)
 CFLAGS		+= -msoft-float -pipe $(CFLAGS-y)
 CPP		= $(CC) -E $(CFLAGS)
 
-CHECKFLAGS	+= -m$(SZ) -D__powerpc__ -D__powerpc$(SZ)__
+CHECKFLAGS	+= -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
 
 ifeq ($(CONFIG_PPC64),y)
 GCC_BROKEN_VEC	:= $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi)
@@ -116,8 +114,7 @@ cpu-as-$(CONFIG_E200)		+= -Wa,-me200
 AFLAGS += $(cpu-as-y)
 CFLAGS += $(cpu-as-y)
 
-head-y				:= arch/powerpc/kernel/head_32.o
-head-$(CONFIG_PPC64)		:= arch/powerpc/kernel/head_64.o
+head-y				:= arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o
 head-$(CONFIG_8xx)		:= arch/powerpc/kernel/head_8xx.o
 head-$(CONFIG_40x)		:= arch/powerpc/kernel/head_40x.o
 head-$(CONFIG_44x)		:= arch/powerpc/kernel/head_44x.o
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 967afc5..ef3633f 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -37,10 +37,10 @@ obj-$(CONFIG_GENERIC_TBSYNC)	+= smp-tbsync.o
 obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
 obj-$(CONFIG_6xx)		+= idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
 obj-$(CONFIG_TAU)		+= tau_6xx.o
-obj-$(CONFIG_HIBERNATION)	+= swsusp.o suspend.o
-obj32-$(CONFIG_HIBERNATION) += swsusp_32.o
-obj64-$(CONFIG_HIBERNATION) += swsusp_64.o swsusp_asm64.o
-obj32-$(CONFIG_MODULES)		+= module_32.o
+obj-$(CONFIG_HIBERNATION)	+= swsusp.o suspend.o \
+				   swsusp_$(CONFIG_WORD_SIZE).o
+obj64-$(CONFIG_HIBERNATION)	+= swsusp_asm64.o
+obj-$(CONFIG_MODULES)		+= module_$(CONFIG_WORD_SIZE).o
 
 ifeq ($(CONFIG_PPC_MERGE),y)
 
@@ -53,9 +53,10 @@ extra-$(CONFIG_8xx)		:= head_8xx.o
 extra-y				+= vmlinux.lds
 
 obj-y				+= time.o prom.o traps.o setup-common.o \
-				   udbg.o misc.o io.o
-obj-$(CONFIG_PPC32)		+= entry_32.o setup_32.o misc_32.o
-obj-$(CONFIG_PPC64)		+= misc_64.o dma_64.o iommu.o
+				   udbg.o misc.o io.o \
+				   misc_$(CONFIG_WORD_SIZE).o
+obj-$(CONFIG_PPC32)		+= entry_32.o setup_32.o
+obj-$(CONFIG_PPC64)		+= dma_64.o iommu.o
 obj-$(CONFIG_PPC_MULTIPLATFORM)	+= prom_init.o
 obj-$(CONFIG_MODULES)		+= ppc_ksyms.o
 obj-$(CONFIG_BOOTX_TEXT)	+= btext.o
@@ -63,16 +64,12 @@ obj-$(CONFIG_SMP)		+= smp.o
 obj-$(CONFIG_KPROBES)		+= kprobes.o
 obj-$(CONFIG_PPC_UDBG_16550)	+= legacy_serial.o udbg_16550.o
 
-module-$(CONFIG_PPC64)		+= module_64.o
-obj-$(CONFIG_MODULES)		+= $(module-y)
-
-pci64-$(CONFIG_PPC64)		+= pci_64.o pci_dn.o isa-bridge.o
-pci32-$(CONFIG_PPC32)		:= pci_32.o
-obj-$(CONFIG_PCI)		+= $(pci64-y) $(pci32-y) pci-common.o
+pci64-$(CONFIG_PPC64)		+= pci_dn.o isa-bridge.o
+obj-$(CONFIG_PCI)		+= pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \
+				   pci-common.o
 obj-$(CONFIG_PCI_MSI)		+= msi.o
-kexec-$(CONFIG_PPC64)		:= machine_kexec_64.o
-kexec-$(CONFIG_PPC32)		:= machine_kexec_32.o
-obj-$(CONFIG_KEXEC)		+= machine_kexec.o crash.o $(kexec-y)
+obj-$(CONFIG_KEXEC)		+= machine_kexec.o crash.o \
+				   machine_kexec_$(CONFIG_WORD_SIZE).o
 obj-$(CONFIG_AUDIT)		+= audit.o
 obj64-$(CONFIG_AUDIT)		+= compat_audit.o
 
@@ -86,7 +83,6 @@ smpobj-$(CONFIG_SMP)		+= smp.o
 
 endif
 
-obj-$(CONFIG_PPC32)		+= $(obj32-y)
 obj-$(CONFIG_PPC64)		+= $(obj64-y)
 
 extra-$(CONFIG_PPC_FPU)		+= fpu.o
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 23bbb1e..65d492e 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -7,11 +7,12 @@ EXTRA_CFLAGS		+= -mno-minimal-toc
 endif
 
 ifeq ($(CONFIG_PPC_MERGE),y)
-obj-y			:= string.o alloc.o
-obj-$(CONFIG_PPC32)	+= div64.o copy_32.o checksum_32.o
+obj-y			:= string.o alloc.o \
+			   checksum_$(CONFIG_WORD_SIZE).o
+obj-$(CONFIG_PPC32)	+= div64.o copy_32.o
 endif
 
-obj-$(CONFIG_PPC64)	+= checksum_64.o copypage_64.o copyuser_64.o \
+obj-$(CONFIG_PPC64)	+= copypage_64.o copyuser_64.o \
 			   memcpy_64.o usercopy_64.o mem_64.o string.o
 obj-$(CONFIG_QUICC_ENGINE) += rheap.o
 obj-$(CONFIG_XMON)	+= sstep.o
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index bf20fa6..20629ae 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -6,13 +6,16 @@ ifeq ($(CONFIG_PPC64),y)
 EXTRA_CFLAGS	+= -mno-minimal-toc
 endif
 
-obj-y				:= fault.o mem.o lmb.o
-obj-$(CONFIG_PPC32)		+= init_32.o pgtable_32.o mmu_context_32.o
+obj-y				:= fault.o mem.o lmb.o \
+				   init_$(CONFIG_WORD_SIZE).o \
+				   pgtable_$(CONFIG_WORD_SIZE).o \
+				   mmu_context_$(CONFIG_WORD_SIZE).o
 hash-$(CONFIG_PPC_NATIVE)	:= hash_native_64.o
-obj-$(CONFIG_PPC64)		+= init_64.o pgtable_64.o mmu_context_64.o \
-				   hash_utils_64.o hash_low_64.o tlb_64.o \
+obj-$(CONFIG_PPC64)		+= hash_utils_64.o \
 				   slb_low.o slb.o stab.o mmap.o $(hash-y)
-obj-$(CONFIG_PPC_STD_MMU_32)	+= ppc_mmu_32.o hash_low_32.o tlb_32.o
+obj-$(CONFIG_PPC_STD_MMU_32)	+= ppc_mmu_32.o
+obj-$(CONFIG_PPC_STD_MMU)	+= hash_low_$(CONFIG_WORD_SIZE).o \
+				   tlb_$(CONFIG_WORD_SIZE).o
 obj-$(CONFIG_40x)		+= 40x_mmu.o
 obj-$(CONFIG_44x)		+= 44x_mmu.o
 obj-$(CONFIG_FSL_BOOKE)		+= fsl_booke_mmu.o
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index c1b34eb..c2087f6 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -4,6 +4,10 @@
 
 mainmenu "Linux/PowerPC Kernel Configuration"
 
+config WORD_SIZE
+	int
+	default 32
+
 config MMU
 	bool
 	default y
-- 
1.5.3.1

^ permalink raw reply related

* Re: [PATCH] powerpc: Avoid pointless WARN_ON(irqs_disabled()) from panic codepath
From: Kamalesh Babulal @ 2007-09-20  8:25 UTC (permalink / raw)
  To: Satyam Sharma; +Cc: linuxppc-dev, Paul Mackerras, Linux Kernel Mailing List
In-Reply-To: <alpine.LFD.0.999.0709180511070.8863@enigma.security.iitk.ac.in>

Satyam Sharma wrote:
>> ------------[ cut here ]------------
>> Badness at arch/powerpc/kernel/smp.c:202
>>     
>
> comes when smp_call_function_map() has been called with irqs disabled,
> which is illegal. However, there is a special case, the panic() codepath,
> when we do not want to warn about this -- warning at that time is pointless
> anyway, and only serves to scroll away the *real* cause of the panic and
> distracts from the real bug.
>
> * So let's extract the WARN_ON() from smp_call_function_map() into all its
>   callers -- smp_call_function() and smp_call_function_single()
>
> * Also, introduce another caller of smp_call_function_map(), namely
>   __smp_call_function() (and make smp_call_function() a wrapper over this)
>   which does *not* warn about disabled irqs
>
> * Use this __smp_call_function() from the panic codepath's smp_send_stop()
>
> We also end having to move code of smp_send_stop() below the definition
> of __smp_call_function().
>
> Signed-off-by: Satyam Sharma <satyam@infradead.org>
>
> ---
>
> Untested (not even compile-tested) patch.
> Could someone point me to ppc32/64 cross-compilers for i386?
>
>  arch/powerpc/kernel/smp.c |   27 ++++++++++++++++++---------
>  1 files changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index 1ea4316..b24dcba 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -152,11 +152,6 @@ static void stop_this_cpu(void *dummy)
>  		;
>  }
>
> -void smp_send_stop(void)
> -{
> -	smp_call_function(stop_this_cpu, NULL, 1, 0);
> -}
> -
>  /*
>   * Structure and data for smp_call_function(). This is designed to minimise
>   * static memory requirements. It also looks cleaner.
> @@ -198,9 +193,6 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
>  	int cpu;
>  	u64 timeout;
>
> -	/* Can deadlock when called with interrupts disabled */
> -	WARN_ON(irqs_disabled());
> -
>  	if (unlikely(smp_ops == NULL))
>  		return ret;
>
> @@ -270,10 +262,19 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
>  	return ret;
>  }
>
> +static int __smp_call_function(void (*func)(void *info), void *info,
> +			       int nonatomic, int wait)
> +{
> +	return smp_call_function_map(func,info,nonatomic,wait,cpu_online_map);
> +}
> +
>  int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
>  			int wait)
>  {
> -	return smp_call_function_map(func,info,nonatomic,wait,cpu_online_map);
> +	/* Can deadlock when called with interrupts disabled */
> +	WARN_ON(irqs_disabled());
> +
> +	return __smp_call_function(func, info, nonatomic, wait);
>  }
>  EXPORT_SYMBOL(smp_call_function);
>
> @@ -283,6 +284,9 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int
>  	cpumask_t map = CPU_MASK_NONE;
>  	int ret = 0;
>
> +	/* Can deadlock when called with interrupts disabled */
> +	WARN_ON(irqs_disabled());
> +
>  	if (!cpu_online(cpu))
>  		return -EINVAL;
>
> @@ -299,6 +303,11 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int
>  }
>  EXPORT_SYMBOL(smp_call_function_single);
>
> +void smp_send_stop(void)
> +{
> +	__smp_call_function(stop_this_cpu, NULL, 1, 0);
> +}
> +
>  void smp_call_function_interrupt(void)
>  {
>  	void (*func) (void *info);
>   
Hi,

This patch solves the badness oops we get on the powerpc.

-- 
Thanks & Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.

^ permalink raw reply

* [PATCH 4/4] Inline u3msi_compose_msi_msg()
From: Michael Ellerman @ 2007-09-20  6:36 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <3034ec8fd939bd5cfcdb7ac65206ae2771dc9b2c.1190270165.git.michael@ellerman.id.au>

In the MPIC U3 MSI code, we call u3msi_compose_msi_msg() once for each MSI.
This is overkill, as the address is per pci device, not per MSI. So setup
the address once, and just set the data per MSI.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/sysdev/mpic_u3msi.c |   24 +++++++++---------------
 1 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/arch/powerpc/sysdev/mpic_u3msi.c b/arch/powerpc/sysdev/mpic_u3msi.c
index 4e50d1c..027fe01 100644
--- a/arch/powerpc/sysdev/mpic_u3msi.c
+++ b/arch/powerpc/sysdev/mpic_u3msi.c
@@ -107,26 +107,17 @@ static void u3msi_teardown_msi_irqs(struct pci_dev *pdev)
 	return;
 }
 
-static void u3msi_compose_msi_msg(struct pci_dev *pdev, int virq,
-				  struct msi_msg *msg)
-{
-	u64 addr;
-
-	addr = find_ht_magic_addr(pdev);
-	msg->address_lo = addr & 0xFFFFFFFF;
-	msg->address_hi = addr >> 32;
-	msg->data = virq_to_hw(virq);
-
-	pr_debug("u3msi: allocated virq 0x%x (hw 0x%lx) at address 0x%lx\n",
-		 virq, virq_to_hw(virq), addr);
-}
-
 static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 {
 	irq_hw_number_t hwirq;
 	unsigned int virq;
 	struct msi_desc *entry;
 	struct msi_msg msg;
+	u64 addr;
+
+	addr = find_ht_magic_addr(pdev);
+	msg.address_lo = addr & 0xFFFFFFFF;
+	msg.address_hi = addr >> 32;
 
 	list_for_each_entry(entry, &pdev->msi_list, list) {
 		hwirq = mpic_msi_alloc_hwirqs(msi_mpic, 1);
@@ -146,7 +137,10 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 		set_irq_chip(virq, &mpic_u3msi_chip);
 		set_irq_type(virq, IRQ_TYPE_EDGE_RISING);
 
-		u3msi_compose_msi_msg(pdev, virq, &msg);
+		pr_debug("u3msi: allocated virq 0x%x (hw 0x%lx) addr 0x%lx\n",
+			  virq, hwirq, addr);
+
+		msg.data = hwirq;
 		write_msi_msg(virq, &msg);
 
 		hwirq++;
-- 
1.5.1.3.g7a33b

^ permalink raw reply related

* [PATCH 3/4] Simplify rtas_change_msi() error semantics
From: Michael Ellerman @ 2007-09-20  6:36 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <3034ec8fd939bd5cfcdb7ac65206ae2771dc9b2c.1190270165.git.michael@ellerman.id.au>

Currently rtas_change_msi() returns either the error code from RTAS, or if
the RTAS call succeeded the number of irqs that were configured by RTAS.
This makes checking the return value more complicated than it needs to be.

Instead, have rtas_change_msi() check that the number of irqs configured by
RTAS is equal to what we requested - and return an error otherwise. This makes
the return semantics match the usual 0 for success, something else for error.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/platforms/pseries/msi.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
index 9c3bcfe..2793a1b 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -70,11 +70,15 @@ static int rtas_change_msi(struct pci_dn *pdn, u32 func, u32 num_irqs)
 		seq_num = rtas_ret[1];
 	} while (rtas_busy_delay(rc));
 
-	if (rc == 0) /* Success */
-		rc = rtas_ret[0];
+	/*
+	 * If the RTAS call succeeded, check the number of irqs is actually
+	 * what we asked for. If not, return an error.
+	 */
+	if (rc == 0 && rtas_ret[0] != num_irqs)
+		rc = -ENOSPC;
 
-	pr_debug("rtas_msi: ibm,change_msi(func=%d,num=%d) = (%d)\n",
-		 func, num_irqs, rc);
+	pr_debug("rtas_msi: ibm,change_msi(func=%d,num=%d), got %d rc = %d\n",
+		 func, num_irqs, rtas_ret[0], rc);
 
 	return rc;
 }
@@ -87,7 +91,7 @@ static void rtas_disable_msi(struct pci_dev *pdev)
 	if (!pdn)
 		return;
 
-	if (rtas_change_msi(pdn, RTAS_CHANGE_FN, 0) != 0)
+	if (rtas_change_msi(pdn, RTAS_CHANGE_FN, 0))
 		pr_debug("rtas_msi: Setting MSIs to 0 failed!\n");
 }
 
@@ -180,14 +184,14 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 	if (type == PCI_CAP_ID_MSI) {
 		rc = rtas_change_msi(pdn, RTAS_CHANGE_MSI_FN, nvec);
 
-		if (rc != nvec) {
+		if (rc) {
 			pr_debug("rtas_msi: trying the old firmware call.\n");
 			rc = rtas_change_msi(pdn, RTAS_CHANGE_FN, nvec);
 		}
 	} else
 		rc = rtas_change_msi(pdn, RTAS_CHANGE_MSIX_FN, nvec);
 
-	if (rc != nvec) {
+	if (rc) {
 		pr_debug("rtas_msi: rtas_change_msi() failed\n");
 		return rc;
 	}
-- 
1.5.1.3.g7a33b

^ permalink raw reply related

* [PATCH 2/4] Simplify error logic in rtas_setup_msi_irqs()
From: Michael Ellerman @ 2007-09-20  6:36 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <3034ec8fd939bd5cfcdb7ac65206ae2771dc9b2c.1190270165.git.michael@ellerman.id.au>

rtas_setup_msi_irqs() doesn't need to call teardown() itself,
the generic code will do this for us as long as we return a non
zero value.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/platforms/pseries/msi.c |   17 +++--------------
 1 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
index 6063ea2..9c3bcfe 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -189,29 +189,22 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 
 	if (rc != nvec) {
 		pr_debug("rtas_msi: rtas_change_msi() failed\n");
-
-		/*
-		 * In case of an error it's not clear whether the device is
-		 * left with MSI enabled or not, so we explicitly disable.
-		 */
-		goto out_free;
+		return rc;
 	}
 
 	i = 0;
 	list_for_each_entry(entry, &pdev->msi_list, list) {
 		hwirq = rtas_query_irq_number(pdn, i);
 		if (hwirq < 0) {
-			rc = hwirq;
 			pr_debug("rtas_msi: error (%d) getting hwirq\n", rc);
-			goto out_free;
+			return hwirq;
 		}
 
 		virq = irq_create_mapping(NULL, hwirq);
 
 		if (virq == NO_IRQ) {
 			pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq);
-			rc = -ENOSPC;
-			goto out_free;
+			return -ENOSPC;
 		}
 
 		dev_dbg(&pdev->dev, "rtas_msi: allocated virq %d\n", virq);
@@ -220,10 +213,6 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 	}
 
 	return 0;
-
- out_free:
-	rtas_teardown_msi_irqs(pdev);
-	return rc;
 }
 
 static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev)
-- 
1.5.1.3.g7a33b

^ permalink raw reply related

* [PATCH 1/4] Simplify error logic in u3msi_setup_msi_irqs()
From: Michael Ellerman @ 2007-09-20  6:36 UTC (permalink / raw)
  To: linuxppc-dev

u3msi_setup_msi_irqs() doesn't need to call teardown() itself,
the generic code will do this for us as long as we return a non
zero value.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/sysdev/mpic_u3msi.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/sysdev/mpic_u3msi.c b/arch/powerpc/sysdev/mpic_u3msi.c
index 305b864..4e50d1c 100644
--- a/arch/powerpc/sysdev/mpic_u3msi.c
+++ b/arch/powerpc/sysdev/mpic_u3msi.c
@@ -124,7 +124,6 @@ static void u3msi_compose_msi_msg(struct pci_dev *pdev, int virq,
 static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 {
 	irq_hw_number_t hwirq;
-	int rc;
 	unsigned int virq;
 	struct msi_desc *entry;
 	struct msi_msg msg;
@@ -132,17 +131,15 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 	list_for_each_entry(entry, &pdev->msi_list, list) {
 		hwirq = mpic_msi_alloc_hwirqs(msi_mpic, 1);
 		if (hwirq < 0) {
-			rc = hwirq;
 			pr_debug("u3msi: failed allocating hwirq\n");
-			goto out_free;
+			return hwirq;
 		}
 
 		virq = irq_create_mapping(msi_mpic->irqhost, hwirq);
 		if (virq == NO_IRQ) {
 			pr_debug("u3msi: failed mapping hwirq 0x%lx\n", hwirq);
 			mpic_msi_free_hwirqs(msi_mpic, hwirq, 1);
-			rc = -ENOSPC;
-			goto out_free;
+			return -ENOSPC;
 		}
 
 		set_irq_msi(virq, entry);
@@ -156,10 +153,6 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 	}
 
 	return 0;
-
- out_free:
-	u3msi_teardown_msi_irqs(pdev);
-	return rc;
 }
 
 int mpic_u3msi_init(struct mpic *mpic)
-- 
1.5.1.3.g7a33b

^ permalink raw reply related

* Re: [PATCH] phy: export phy_mii_ioctl
From: Jeff Garzik @ 2007-09-20  6:36 UTC (permalink / raw)
  To: Domen Puncer; +Cc: netdev, linuxppc-embedded
In-Reply-To: <20070917202140.GB2642@nd47.coderock.org>

Domen Puncer wrote:
> Export phy_mii_ioctl, so network drivers can use it when built
> as modules too.
> 
> Signed-off-by: Domen Puncer <domen@coderock.org>

applied

^ permalink raw reply

* Re: [PATCH] [POWERPC] Support setting affinity for U3/U4 MSI sources
From: Michael Ellerman @ 2007-09-20  6:36 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, paulus
In-Reply-To: <20070917201229.GA17302@lixom.net>

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

On Mon, 2007-09-17 at 15:12 -0500, Olof Johansson wrote:
> Hook up affinity-setting for U3/U4 MSI interrupt sources.
> 
> Tested on Quad G5 with myri10ge.

And a JS21 blade:

# echo 1 > /proc/irq/21/smp_affinity 
# cat /proc/interrupts 
           CPU0       CPU1       
 21:        126        375  MPIC-U3MSI Edge      eth1
# ping -c 1000 -f cradle
1000 packets transmitted, 1000 received, 0% packet loss, time 135ms
# cat /proc/interrupts 
           CPU0       CPU1       
 21:       2153        375  MPIC-U3MSI Edge      eth1
# echo 2 > /proc/irq/21/smp_affinity 
# cat /proc/interrupts 
           CPU0       CPU1       
 21:       2174        379  MPIC-U3MSI Edge      eth1
# ping -c 1000 -f cradle
1000 packets transmitted, 1000 received, 0% packet loss, time 138ms
# cat /proc/interrupts 
           CPU0       CPU1       
 21:       2174       2389  MPIC-U3MSI Edge      eth1


Acked-by: Michael Ellerman <michael@ellerman.id.au>

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* a problem of scsi(lsi 53c1020) driver
From: yuan tian @ 2007-09-20  5:51 UTC (permalink / raw)
  To: linuxppc-embedded

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

hi:
  Now there is a scsi controller(LSI 53c1020) on the pci slot of
ocotea(ppc440gx).
  I don't know if there is a driver of LSI53c1020 in Linux kernel(2.6.21).

 In kernel configuration ,my options are:
 Device Drivers  --->
         Fusion MPT device support  --->
          <*> Fusion MPT ScsiHost drivers for SPI

 Device Drivers  --->
         SCSI device support  --->
        <*> SCSI device support
        <*> SCSI disk support
 When the kernel was executed, some error information come from the console.

 copyright (c) 1999-2007 LSI Logic Corporation
 Fusion MPT SPI Host driver 3.04.04
 mptbase: Initiating ioc0 bringup
 ioc0: 53C1030: Capabilities={Initiator}
 scsi0 : ioc0: LSI53C1030, FwRev=01000300h, Ports=1, MaxQ=255, IRQ=25
 mptbase: ioc0: LogInfo(0x11010100): F/W: bug! MID not found
 mptbase: ioc0: LogInfo(0x11010100): F/W: bug! MID not found

 I don't know if there is something wrong in my kernel configuration .
 Any help will be appreciated!

 Regards,
 Tom

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

^ permalink raw reply

* Re: [PATCH 1/3] powerpc clk.h interface for platforms
From: Paul Mackerras @ 2007-09-20  5:07 UTC (permalink / raw)
  To: Domen Puncer; +Cc: David Brownell, linuxppc-dev, Sylvain Munaut
In-Reply-To: <20070919051157.GH32628@nd47.coderock.org>

Domen Puncer writes:

> 52xx
> Reason for adding it to all was that EXPORT_SYMBOL's would clash if
> one were to add clk support for another platform.

What I meant was, why aren't you using a config symbol so that we
don't build it on platforms that don't need any "clk" support at all?

Paul.

^ permalink raw reply

* Re: [PATCH 1/2] [FS_ENET] TX stuff should use fep->tx_lock, instead of fep->lock.
From: Jeff Garzik @ 2007-09-20  4:18 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-dev, linux-kernel, netdev
In-Reply-To: <20070918160527.13525.80935.stgit@localhost.localdomain>

Vitaly Bordug wrote:
> Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
> 
> ---
> 
>  drivers/net/fs_enet/fs_enet-main.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)

applied 1-2, after hand-editing the subject line to remove brackets from 
around "[FS_ENET]"

everything within [ and ] is removed, before copying to changelog, so 
please be careful

See http://linux.yyz.us/patch-format.html for more info.

	Jeff

^ permalink raw reply

* Re: [PATCH 2/5] Implement generic time of day clocksource for powerpc machines.
From: Daniel Walker @ 2007-09-20  3:38 UTC (permalink / raw)
  To: David Gibson
  Cc: linuxppc-dev, Thomas Gleixner, Paul Mackerras, Realtime Kernel,
	johnstul
In-Reply-To: <20070920032935.GC18991@localhost.localdomain>

On Thu, 2007-09-20 at 13:29 +1000, David Gibson wrote:

> > Maybe say "It a constant" up front .. The value that is output from the
> > clocksource read is converted to nanoseconds .. This clocksource is only
> > designed to work with the timebase, so it doesn't make sense to output
> > an rtc value.
> 
> I believe "rtc" in a 601 context means something different to "rtc" in
> a general context...

What's a 601 context?

Daniel

^ permalink raw reply

* Re: [PATCH 2/5] Implement generic time of day clocksource for powerpc machines.
From: David Gibson @ 2007-09-20  3:29 UTC (permalink / raw)
  To: Daniel Walker
  Cc: linuxppc-dev, Thomas Gleixner, Paul Mackerras, Realtime Kernel,
	johnstul
In-Reply-To: <1190253281.11899.74.camel@imap.mvista.com>

On Wed, Sep 19, 2007 at 06:54:41PM -0700, Daniel Walker wrote:
> On Thu, 2007-09-20 at 11:46 +1000, Paul Mackerras wrote:
> > Daniel Walker writes:
> > 
> > > On Thu, 2007-09-20 at 10:52 +1000, Paul Mackerras wrote:
> > > > Daniel Walker writes:
> > > > 
> > > > > If you switch to the rtc do the shift and mult need to change?
> > > > 
> > > > You can't switch; any given CPU chip will have either the RTC or the
> > > > timebase but not both.
> > > 
> > > The code is switching between to clock read functions .. If they are
> > 
> > What part of "you can't switch" wasn't clear?  __USE_RTC() is a
> > constant on any given machine.
> 
> Maybe say "It a constant" up front .. The value that is output from the
> clocksource read is converted to nanoseconds .. This clocksource is only
> designed to work with the timebase, so it doesn't make sense to output
> an rtc value.

I believe "rtc" in a 601 context means something different to "rtc" in
a general context...

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* Re: Patches added to powerpc.git for-2.6.24 branch
From: Jeremy Kerr @ 2007-09-20  2:52 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras
In-Reply-To: <18161.53259.540174.870980@cargo.ozlabs.ibm.com>


A couple more, if these are acceptable:

[PATCH 1/2] cell: don't cast the result of of_get_property()
[PATCH 2/2] fsl/embedded6xx: don't cast the result of of_get_property

Cheers,


Jeremy

^ permalink raw reply

* [PATCH v3] [POWERPC] Fix build errors when BLOCK=n
From: Emil Medve @ 2007-09-20  2:25 UTC (permalink / raw)
  To: paulus, kumar.gala, linuxppc-dev, linuxppc-embedded, bzolnier,
	linux-ide
  Cc: Emil Medve

These are the symptom error messages:

  CC      arch/powerpc/kernel/setup_32.o
In file included from include/linux/blkdev.h:17,
                 from include/linux/ide.h:13,
                 from arch/powerpc/kernel/setup_32.c:13:
include/linux/bsg.h:67: warning: 'struct request_queue' declared inside parameter list
include/linux/bsg.h:67: warning: its scope is only this definition or declaration, which is probably not what you want
include/linux/bsg.h:71: warning: 'struct request_queue' declared inside parameter list
In file included from arch/powerpc/kernel/setup_32.c:13:
include/linux/ide.h:857: error: field 'wrq' has incomplete type

  CC      arch/powerpc/kernel/ppc_ksyms.o
In file included from include/linux/blkdev.h:17,
                 from include/linux/ide.h:13,
                 from arch/powerpc/kernel/ppc_ksyms.c:15:
include/linux/bsg.h:67: warning: 'struct request_queue' declared inside parameter list
include/linux/bsg.h:67: warning: its scope is only this definition or declaration, which is probably not what you want
include/linux/bsg.h:71: warning: 'struct request_queue' declared inside parameter list
In file included from arch/powerpc/kernel/ppc_ksyms.c:15:
include/linux/ide.h:857: error: field 'wrq' has incomplete type

The fix tries to use the smallest scope CONFIG_* symbols that will fix the build
problem. In this case <linux/ide.h> needs to be included only if IDE=y or
IDE=m were selected. Also, ppc_ide_md is needed only if BLK_DEV_IDE=y or
BLK_DEV_IDE=m

Moved the EXPORT_SYMBOL(ppc_ide_md) from ppc_ksysms.c next to its declaration
in setup_32.c which made <linux/ide.h> not needed. With <linux/ide.h> gone from
ppc_ksyms.c, <asm/cacheflush.h> is needed to address the following warnings and
errors:

  CC      arch/powerpc/kernel/ppc_ksyms.o
arch/powerpc/kernel/ppc_ksyms.c:122: error: '__flush_icache_range' undeclared here (not in a function)
arch/powerpc/kernel/ppc_ksyms.c:122: warning: type defaults to 'int' in declaration of '__flush_icache_range'
arch/powerpc/kernel/ppc_ksyms.c:123: error: 'flush_dcache_range' undeclared here (not in a function)
arch/powerpc/kernel/ppc_ksyms.c:123: warning: type defaults to 'int' in declaration of 'flush_dcache_range'

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---

I tested that the code builds with this patch in various combinations of
configuration options: all the combinations involving BLOCK, IDE and BLK_DEV_IDE

A patch for the warnings above has been already commited here: http://git.kernel.org/?p=linux/kernel/git/jejb/scsi-misc-2.6.git;a=commitdiff;h=49892223f7d3a2333ef9e6cbdd526676e1fc517a

This patch is against Paul's tree (75cdff9242c4e048cb830d359920719d29b9ee7c)

powerpc> scripts/checkpatch.pl 0001-POWERPC-Fix-build-errors-when-BLOCK-n.patch
Your patch has no obvious style problems and is ready for submission.

 arch/powerpc/kernel/ppc_ksyms.c |    6 +-----
 arch/powerpc/kernel/setup_32.c  |    5 +++++
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 430c502..c6b1aa3 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -12,12 +12,12 @@
 #include <linux/irq.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
-#include <linux/ide.h>
 #include <linux/bitops.h>
 
 #include <asm/page.h>
 #include <asm/semaphore.h>
 #include <asm/processor.h>
+#include <asm/cacheflush.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/atomic.h>
@@ -95,10 +95,6 @@ EXPORT_SYMBOL(__strnlen_user);
 EXPORT_SYMBOL(copy_4K_page);
 #endif
 
-#if defined(CONFIG_PPC32) && (defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE))
-EXPORT_SYMBOL(ppc_ide_md);
-#endif
-
 #if defined(CONFIG_PCI) && defined(CONFIG_PPC32)
 EXPORT_SYMBOL(isa_io_base);
 EXPORT_SYMBOL(isa_mem_base);
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index a288a5f..7474502 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -10,7 +10,9 @@
 #include <linux/reboot.h>
 #include <linux/delay.h>
 #include <linux/initrd.h>
+#if defined(CONFIG_IDE) || defined(CONFIG_IDE_MODULE)
 #include <linux/ide.h>
+#endif
 #include <linux/tty.h>
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
@@ -49,7 +51,10 @@
 
 extern void bootx_init(unsigned long r4, unsigned long phys);
 
+#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
 struct ide_machdep_calls ppc_ide_md;
+EXPORT_SYMBOL(ppc_ide_md);
+#endif
 
 int boot_cpuid;
 EXPORT_SYMBOL_GPL(boot_cpuid);
-- 
1.5.3.GIT

^ permalink raw reply related

* Re: [PATCH 2/5] Implement generic time of day clocksource for powerpc machines.
From: Daniel Walker @ 2007-09-20  1:54 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Thomas Gleixner, johnstul, Realtime Kernel
In-Reply-To: <18161.53509.342082.588911@cargo.ozlabs.ibm.com>

On Thu, 2007-09-20 at 11:46 +1000, Paul Mackerras wrote:
> Daniel Walker writes:
> 
> > On Thu, 2007-09-20 at 10:52 +1000, Paul Mackerras wrote:
> > > Daniel Walker writes:
> > > 
> > > > If you switch to the rtc do the shift and mult need to change?
> > > 
> > > You can't switch; any given CPU chip will have either the RTC or the
> > > timebase but not both.
> > 
> > The code is switching between to clock read functions .. If they are
> 
> What part of "you can't switch" wasn't clear?  __USE_RTC() is a
> constant on any given machine.

Maybe say "It a constant" up front .. The value that is output from the
clocksource read is converted to nanoseconds .. This clocksource is only
designed to work with the timebase, so it doesn't make sense to output
an rtc value.

Daniel

^ 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