Re: ppc32: Weird process scheduling behaviour with 2.6.24-rc

2008-01-24 Thread Benjamin Herrenschmidt

On Wed, 2008-01-23 at 14:14 +0100, Michel Dänzer wrote:
  Does ppc32 (or your instance thereof) have a high resolution
  sched_clock()?
 
 I'm not sure (FWIW, we did get support for NO_HZ and HIGH_RES_TIMERS
 in
 2.6.24-rc as well, but playing with these config options and even
 reverting the code didn't seem to have any effect), can someone from
 the
 linuxppc-dev list answer this?

We do have a hires sched_clock() based on the processor internal
timebase and scaled to ns. Maybe we screwed something up there ? The
implementation is in arch/powerpc/kernel/timer.c

/*
 * Scheduler clock - returns current time in nanosec units.
 *
 * Note: mulhdu(a, b) (multiply high double unsigned) returns
 * the high 64 bits of a * b, i.e. (a * b)  64, where a and b
 * are 64-bit unsigned numbers.
 */
unsigned long long sched_clock(void)
{
if (__USE_RTC())
return get_rtc();
return mulhdu(get_tb() - boot_tb, tb_to_ns_scale)  tb_to_ns_shift;
}

(You can mostly ignore the RTC() case which is the native ns clock of
the old 601 processor.

Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: ppc32: Weird process scheduling behaviour with 2.6.24-rc

2008-01-24 Thread Benjamin Herrenschmidt
Could the fact that our sched_clock() returns utter crap if called
before time_init() explain the problem ? If yes, that's an easy fix.

Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] sysctl: Kill binary sysctl KERN_PPC_L2CR

2008-01-24 Thread Eric W. Biederman

 From: Stefan Roese [EMAIL PROTECTED]
 Subject: ppc: 4xx: sysctl table check failed: /kernel/l2cr .1.31 Missing 
 strategy

 I'm seeing this error message when booting an recent arch/ppc kernel on
 4xx platforms (tested on Ocotea and other 4xx platforms). Booting NFS
 rootfs still works fine, but this message kind of makes me nervous.
 This is not seen on 4xx arch/powerpc platforms. Here the bootlog:

Because the data field was never filled and a binary sysctl handler
was never written this sysctl has never been usable through the
sys_sysctl interface.  So just remove the binary sysctl number.
Making the kernel sanity checks happy.

Signed-off-by: Eric W. Biederman [EMAIL PROTECTED]
---
 arch/ppc/kernel/ppc_htab.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/ppc/kernel/ppc_htab.c b/arch/ppc/kernel/ppc_htab.c
index aa07b63..9ed36dd 100644
--- a/arch/ppc/kernel/ppc_htab.c
+++ b/arch/ppc/kernel/ppc_htab.c
@@ -436,7 +436,6 @@ int proc_dol2crvec(ctl_table *table, int write, struct file 
*filp,
  */
 static ctl_table htab_ctl_table[]={
{
-   .ctl_name   = KERN_PPC_L2CR,
.procname   = l2cr,
.mode   = 0644,
.proc_handler   = proc_dol2crvec,
-- 
1.5.3.rc6.17.g1911

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 0/7] Powerpc support for SBC8560 board

2008-01-24 Thread Kumar Gala

On Jan 7, 2008, at 8:25 AM, Paul Gortmaker wrote:


 This is a respin of the sbc8560 patches, incorporating the feedback  
 and
 suggested changes from everyone.  Changes include:

 -coding style and missing of_put (Stephen Rothwell)

 -minor dtc cleanups for gianfar, mdio, mpic etc. (David Gibson /  
 Kumar Gala)

 -use for_each macros in legacy_serial to improve readability, and as
 groundwork for next change (me)

 -convert dtc duart + device-type=soc thing to be an epld entry
 listed as compatible with localbus -- plus add localbus as an  
 acceptable
 parent in legacy_serial (David Gibson / Scott Wood)

 -rtc is now a child of the epld/localbus and does not use device_type
 in the dtc, nor in the platform detection code (David Gibson)

 -add CPM2 data to dts for FCC ports (on optional daughterboard) based
 on the MPC8560ADS dts (me)

 -add dts aliases, conversion to dts-v1 (Kumar)

 Patches are as follows:

 1  powerpc-use-for_each-in-legacy_serial.txt
 2  powerpc-allow-localbus-compatible-serial-ports-for-console- 
 device.txt
 3  sbc8560-add-support-for-Wind-River-SBC8560-in-arch-powerpc.txt
 4  sbc8560-Add-device-tree-source-for-Wind-River-SBC8560-board.txt
 5  sbc8560-Convert-WRS-SBC8560-device-tree-to-v1-format.txt
 6  CPM2-Make-support-for-the-CPM2-optional-on-8560-based-boards.txt
 7  sbc8560-Add-default-.config-file-for-Wind-River-SBC8560.txt

 Thanks again to all those who provided feedback.

Have we closed on these patches?

the sbc8560 is the last board that we need to close on for me to kill  
85xx in arch/ppc.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.

2008-01-24 Thread Poonam_Aggrwal-b10812
Thanks Stephen for your comments, incorporated them.
From: Poonam Aggrwal [EMAIL PROTECTED]

This patch makes necessary changes in the QE and UCC framework to support 
TDM. It also adds support to configure the BRG properly through device 
tree entries. Includes the device tree changes for UCC TDM driver as well.
It also includes device tree entries for UCC TDM driver.

Tested on MPC8323ERDB platform.

Signed-off-by: Poonam Aggrwal [EMAIL PROTECTED]
Signed-off-by: Ashish Kalra [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Signed-off-by: Michael Barkowski [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/mpc832x_rdb.dts |   58 +++
 arch/powerpc/sysdev/qe_lib/qe.c   |  184 +--
 arch/powerpc/sysdev/qe_lib/ucc.c  |  265 +
 arch/powerpc/sysdev/qe_lib/ucc_fast.c |   37 +
 include/asm-powerpc/qe.h  |8 +
 include/asm-powerpc/ucc.h |4 +
 include/asm-powerpc/ucc_fast.h|4 +
 7 files changed, 548 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts 
b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 388c8a7..c0e6283 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -105,6 +105,17 @@
device_type = par_io;
num-ports = 7;
 
+   ucc1pio:[EMAIL PROTECTED] {
+   pio-map = 
+   /* port  pin  dir  open_drain  assignment  has_irq */
+   0  e  2  0  1  0/* CLK11 */
+   3 16  1  0  2  0/* BRG9 */
+   3 1b  1  0  2  0/* BRG3 */
+   0  0  3  0  2  0/* TDMATxD0 */
+   0  4  3  0  2  0/* TDMARxD0 */
+   3 1b  2  0  1  0;  /* CLK1 */
+   };
+
ucc2pio:[EMAIL PROTECTED] {
pio-map = 
/* port  pin  dir  open_drain  assignment  has_irq */
@@ -169,6 +180,36 @@
};
};
 
+   clocks {
+   compatible = fsl,cpm-clocks;
+   /* clock freqs in Hz(for CLK1~CLK24).
+* CLK11 is 1024KHz,
+* all other clocks unused
+* #clock-cells define number of cells
+* used by the clock-frequency.
+* right now only #clock cells=1 is
+* implemented. Provision is there to
+* handle frequencies 4Gig
+*/
+   #clock-cells = 1;
+   clock-frequency = 0 0 0 0 0 0
+  0 0 0 0 d#1024000 0
+  0 0 0 0 0 0
+  0 0 0 0 0 0;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,cpm-brg;
+   /* input clock sources for all the 16 BRGs.
+* 1-24 for CLK1 to CLK24.
+* BRG9 uses CLK11,BRG1 and BRG2-8 use
+* the QE clock.
+*/
+   fsl,brg-sources = 0 0 0 0 0 0 0 0
+  b 0 0 0 0 0 0 0;
+   reg = 640 7f;
+   };
+
[EMAIL PROTECTED] {
device_type = spi;
compatible = fsl_spi;
@@ -187,6 +228,23 @@
mode = cpu;
};
 
+   [EMAIL PROTECTED] {
+   device_type = tdm;
+   compatible = fsl,ucc-tdm;
+   model = UCC;
+   device-id = 1;
+   fsl,tdm-num = 1;
+   fsl,si-num = 1;
+   fsl,tdm-tx-clk = CLK1;
+   fsl,tdm-rx-clk = CLK1;
+   fsl,tdm-tx-sync = BRG9;
+   fsl,tdm-rx-sync = BRG9;
+   reg = 2000 200;
+   interrupts = 20;
+   interrupt-parent = qeic;
+   pio-handle = ucc1pio;
+   };
+
[EMAIL PROTECTED] {
device_type = network;
compatible = ucc_geth;
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 1df3b4a..9b9971d 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -149,20 +149,170 @@ EXPORT_SYMBOL(qe_issue_cmd);
  */
 static unsigned int brg_clk = 0;
 
-unsigned int get_brg_clk(void)
+u32 get_brg_clk(enum qe_clock brgclk, enum 

[PATCH UCC TDM 2/3 ]Updated: UCC TDM driver for QE based MPC83xx platforms.

2008-01-24 Thread Poonam_Aggrwal-b10812
Incorporated Stephen's comments.

From: Poonam Agarwal-b10812 [EMAIL PROTECTED]

The UCC TDM driver basically multiplexes and demultiplexes data from
different channels. It can interface with for example SLIC kind of devices
to receive TDM data  demultiplex it and send to upper modules. At the
transmit end it receives data for different channels multiplexes it and
sends them on the TDM channel. It internally uses TSA( Time Slot Assigner)
which does multiplexing and demultiplexing, UCC to perform SDMA between
host buffers and the TSA, CMX to connect TSA to UCC.

It can be used by a kernel module which can call tdm_register_client to
get access to a TDM device.

The driver is right now a misc driver with no subsystem as such.
There can be a platform independent TDM layer which is planned to be
done after this. TDM bus sort of thing.

The dts file keeps a track of the TDM devices present on the board.
Depending on them the TDM driver initializes those many driver instances
while coming up.

The driver on the upper level can plug to more than one tdm clients
depending on the availablity of TDM devices. At every new request of a TDM
client to bind with a TDM device, a free driver instance is allocated to
the client.

The interface can be described as follows.

tdm_register_client(struct tdm_client *)
   This API returns a pointer to the structure tdm_client which is of
type
  struct tdm_client {
   u32 client_id;
   u32 (*tdm_read)(u32 client_id, short chn_id, short
*pcm_buffer, short len);
   u32 (*tdm_write)(u32 client_id, short chn_id, short
*pcm_buffer, short len);
   wait_queue_head_t *wakeup_event;
   }

It consists of:
  - client_id: It is basically to identify the particular TDM
device/driver instance.
  - tdm_read: It is a function pointer returned by the TDM driver to be
used to read TDM data from a particular TDM channel.
  - tdm_write: It is a function pointer returned by the TDM driver to be
used to write TDM data to a particular TDM channel.
  - wakeup_event: It is address of a wait_queue event on which the client
keeps on sleeping, and the TDM driver wakes it up periodically. The driver
is configured to
wake up the client after every 10ms.

Once the TDM client gets registered to a TDM driver instance and a TDM
device, it interfaces with the driver using tdm_read, tdm_write and
wakeup_event.

This driver will run on MPC8323E-RDB platforms.

Signed-off-by: Poonam Aggrwal [EMAIL PROTECTED]
Signed-off-by: Ashish Kalra [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Signed-off-by: Michael Barkowski [EMAIL PROTECTED]
---
 drivers/misc/Kconfig   |   14 +
 drivers/misc/Makefile  |1 +
 drivers/misc/ucc_tdm.c | 1017 
 drivers/misc/ucc_tdm.h |  221 +++
 4 files changed, 1253 insertions(+), 0 deletions(-)
 create mode 100644 drivers/misc/ucc_tdm.c
 create mode 100644 drivers/misc/ucc_tdm.h

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index b5e67c0..628b14b 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -232,4 +232,18 @@ config ATMEL_SSC
 
  If unsure, say N.
 
+config UCC_TDM
+   bool Freescale UCC  TDM Driver
+   depends on QUICC_ENGINE  UCC_FAST
+   default n
+   ---help---
+ The TDM driver is for UCC based TDM devices for example, TDM device on
+ MPC832x RDB. Select it to run PowerVoIP on MPC832x RDB board.
+ The TDM driver can interface with SLIC kind of devices to transmit
+ and receive TDM samples. The TDM driver receives Time Division
+ multiplexed samples(for different channels) from the SLIC device,
+ demutiplexes them and sends them to the upper layers. At the transmit
+ end the TDM drivers receives samples for different channels, it
+ multiplexes them and sends them to the SLIC device.
+
 endif # MISC_DEVICES
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 87f2685..6f0c49d 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -17,3 +17,4 @@ obj-$(CONFIG_SONY_LAPTOP) += sony-laptop.o
 obj-$(CONFIG_THINKPAD_ACPI)+= thinkpad_acpi.o
 obj-$(CONFIG_FUJITSU_LAPTOP)   += fujitsu-laptop.o
 obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o
+obj-$(CONFIG_UCC_TDM)  += ucc_tdm.o
diff --git a/drivers/misc/ucc_tdm.c b/drivers/misc/ucc_tdm.c
new file mode 100644
index 000..2181132
--- /dev/null
+++ b/drivers/misc/ucc_tdm.c
@@ -0,0 +1,1017 @@
+/*
+ * drivers/misc/ucc_tdm.c
+ *
+ * UCC Based Linux TDM Driver
+ * This driver is designed to support UCC based TDM for PowerPC processors.
+ * This driver can interface with SLIC device to run VOIP kind of
+ * applications.
+ *
+ * Author: Ashish Kalra  Poonam Aggrwal
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by 

Reboot at insmod of cf card driver

2008-01-24 Thread Lehmann, Hans (Ritter Elektronik)
Hi at all,

i have strange problems with my cf_card driver on our MPC5200b board. Because 
of our board schematic the cf card is mapped to memory space. 
The interrupt is routed to IRQ1. IRQ1 is rising edge sensitive.
First the driver was written for Kernel 2.6.14 with device_driver structure and 
run pretty. Now i have ported it to Kernel 2.6.23 with of_platform_driver 
structure to get indepent of ppc. 

Now my problem:

After I load my modul, the kernel start to reboot at command probe_hwif_init.
The failure occurs exatly in function actual_try_to_identify in ide-probe.c 
when kernel send the identify command to status/command register of ide device 
(hwif-outb(cmd, DIE_COMMAND_REG);.  
By accident I figured out that no reboot occurs when I change interrupt 
behauviour (level sensitive). But then several errors occured as followed:

[EMAIL PROTECTED]:/lib/modules insmod el392_cf_disk_drv.ko
[   72.306114] IDE: EL392 IDE/ATA driver
[   72.397169] Base address: d000, IO Size: 0002
[   72.413994] Memory remapped: 0xd000 - 0xc504
[   72.666923] cmd: 0x0ec , Adresse IDE_REG_COMMAND: 0xc5041006
[   72.804238] hda: ELITE PRO CF CARD 1GB, CFA DISK drive
[   73.126941] cmd: 0x0a1 , Adresse IDE_REG_COMMAND: 0xc5041006
[   73.313920] cmd: 0x0a1 , Adresse IDE_REG_COMMAND: 0xc5041006
[   73.503065] ide0 at 0xc5041008-0xc504100f,0xc504100f on irq 70
[   73.521193] [ cut here ]
[   73.530365] Badness at c0105298 [verbose debug info unavailable]
[   73.542244] NIP: c0105298 LR: c0104260 CTR: 
[   73.552071] REGS: c374dc30 TRAP: 0700   Not tainted  
(2.6.23.1-rt5-pcm030-1trunk)
[   73.566867] MSR: 00029032 EE,ME,IR,DR  CR: 84004484  XER: 
[   73.579487] TASK = c36d6000[231] 'insmod' THREAD: c374c000
[   73.589988] GPR00: 0001 c374dce0 c36d6000 c02c0ab0 c02396c4 c02bf9b4 
c02395ec 0242
[   73.606564] GPR08: c36d6000 0002 0001 c02c05dc 84004484 100decc4 
c50235a8 c3d0c280
[   73.623139] GPR16: c5022e6c c5022e94  0035 0124  
c5022ac4 c5022ebc
[   73.639713] GPR24: c0048214 c02c0544 0015 c028c49c c024 c020 
 c02c0a98
[   73.656636] NIP [c0105298] kref_get+0xc/0x24
[   73.665152] LR [c0104260] kobject_get+0x20/0x38
[   73.674125] Call Trace:
[   73.678955] [c374dce0] [c02c0428] 0xc02c0428 (unreliable)
[   73.689660] [c374dcf0] [c01280b4] get_device+0x20/0x38
[   73.699858] [c374dd00] [c0128f14] device_add+0x6c/0x518
[   73.710214] [c374dd40] [c0144130] probe_hwif_init_with_fixup+0x80/0xb0
[   73.723171] [c374dd60] [c5025304] el392_ata_probe+0x210/0x258 
[el392_cf_disk_drv]
[   73.738017] [c374dda0] [c015fc18] of_platform_device_probe+0x58/0x80
[   73.750632] [c374ddc0] [c012b9ac] driver_probe_device+0xb8/0x1ec
[   73.762543] [c374dde0] [c012bb64] __driver_attach+0x84/0x88
[   73.773584] [c374de00] [c012ac88] bus_for_each_dev+0x58/0x94
[   73.784798] [c374de30] [c012b7bc] driver_attach+0x24/0x34
[   73.795495] [c374de40] [c012b0e4] bus_add_driver+0x98/0x1d8
[   73.806536] [c374de60] [c012bd0c] driver_register+0x58/0xa0
[   73.817577] [c374de70] [c000a0e0] of_register_platform_driver+0x28/0x38
[   73.830709] [c374de80] [c5028024] el392_ata_init+0x24/0x78 
[el392_cf_disk_drv]
[   73.845022] [c374de90] [c0049550] sys_init_module+0x16c/0x14b0
[   73.856604] [c374df40] [c000f670] ret_from_syscall+0x0/0x38
[   73.867662] --- Exception: c01 at 0xff26d98
[   73.875941] LR = 0x1002ebdc
[   73.882143] Instruction dump:
[   73.888009] 409e0010 7c8903a6 4e800421 3801 7c030378 80010014 38210010 
7c0803a6
[   73.903381] 4e800020 8003 7c34 5400d97e 0f00 7d201828 31290001 
7d20192d
[   73.923415] Unable to handle kernel paging request for data at address 
0x0024
[   73.945442] Faulting instruction address: 0xc00b8d08
[   73.960258] stopped custom tracer.
[   73.970940] Oops: Kernel access of bad area, sig: 11 [#1]
[   73.981635] PREEMPT ritter_el392
[   73.988015] Modules linked in: el392_cf_disk_drv
[   73.997165] NIP: c00b8d08 LR: c00b8d04 CTR: 
[   74.006990] REGS: c374dbc0 TRAP: 0300   Not tainted  
(2.6.23.1-rt5-pcm030-1trunk)
[   74.021787] MSR: 9032 EE,ME,IR,DR  CR: 24004442  XER: 
[   74.034404] DAR: 0024, DSISR: 2000
[   74.042501] TASK = c36d6000[231] 'insmod' THREAD: c374c000
[   74.053003] GPR00: c00b8d04 c374dc70 c36d6000 c029b248 0004  
 0380
[   74.069578] GPR08: c36d6000 c02b   24004488 100decc4 
c50235a8 c3d0c280
[   74.086154] GPR16: c5022e6c c5022e94  0035 0124  
c5022ac4 c5022ebc
[   74.102730] GPR24: c0048214 c02c0544 c374dcc8 c374dc98 c02c04f0  
c029b248 c374dc98
[   74.119654] NIP [c00b8d08] sysfs_addrm_start+0x40/0xcc
[   74.129883] LR [c00b8d04] sysfs_addrm_start+0x3c/0xcc
[   74.139887] Call Trace:
[   74.144717] [c374dc70] [c00b8d04] sysfs_addrm_start+0x3c/0xcc (unreliable)
[   74.158347] [c374dc90] [c00b956c] create_dir+0x50/0xd8
[   74.168530] [c374dcc0] [c00b962c] 

Re: [PATCH] [POWERPC] MPC8360E-RDK: device tree, board file and defconfig

2008-01-24 Thread Anton Vorontsov
On Thu, Jan 24, 2008 at 01:22:01PM +1100, Stephen Rothwell wrote:
 On Wed, 23 Jan 2008 23:45:07 +0300 Anton Vorontsov [EMAIL PROTECTED] wrote:
 
  +++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
  +static int __init mpc836x_rdk_declare_of_platform_devices(void)
  +{
  +   const struct of_device_id mpc836x_rdk_ids[] = {
 
 Please change this to static, __initdata and not const, thanks. These
 arrays are usually defined outside a function, but that is not really a
 problem.

Pity... we don't need these _ids anywhere outside that function. But
looking into objdump output I see the problem now.

Will change this back, thanks.

  +static void __init mpc836x_rdk_setup_arch(void)
  +{
  +   struct device_node *np;
 
 !defined(CONFIG_PCI)  !defined(CONFIG_QUICC_ENGINE) will produce a
 warning here.

Good catch, thanks.

  +   if (ppc_md.progress)
  +   ppc_md.progress(mpc836x_rdk_setup_arch(), 0);
  +
  +#ifdef CONFIG_PCI
  +   for_each_compatible_node(np, pci, fsl,mpc8349-pci)
  +   mpc83xx_add_bridge(np);
  +#endif
  +
  +#ifdef CONFIG_QUICC_ENGINE
  +   qe_reset();
  +
  +   np = of_find_compatible_node(NULL, NULL, fsl,qe-pario);
  +   if (!np) {
  +   pr_warning(QE PIO not initialized!\n);
  +   return;
 
 You need an of_node_put(np) before the return.

Hm, really? I think I don't. But if you insist... :-)

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: mpc8568e-mds: pci-e is broken

2008-01-24 Thread Anton Vorontsov
On Wed, Jan 23, 2008 at 05:02:10PM -0600, Kumar Gala wrote:
 Anton,
 
 Can you try this patch and see if it resolves the issue for you.. (You'll
 still get the Apple FW messages)

Yup, that patch fixes it.

Thanks,

 - k
 
 diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
 index 4005739..bf13c21 100644
 --- a/arch/powerpc/sysdev/fsl_pci.c
 +++ b/arch/powerpc/sysdev/fsl_pci.c
 @@ -133,22 +133,23 @@ void fsl_pcibios_fixup_bus(struct pci_bus *bus)
   struct pci_controller *hose = (struct pci_controller *) bus-sysdata;
   int i;
 
 - /* deal with bogus pci_bus when we don't have anything connected on 
 PCIe */
 - if (hose-indirect_type  PPC_INDIRECT_TYPE_NO_PCIE_LINK) {
 - if (bus-parent) {
 - for (i = 0; i  4; ++i)
 - bus-resource[i] = bus-parent-resource[i];
 - }
 - }
 -
 - if (fsl_pcie_bus_fixup 
 - (bus-parent == hose-bus) 
 -  early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) {
 + if ((bus-parent == hose-bus) 
 + ((fsl_pcie_bus_fixup 
 +   early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) ||
 +  (hose-indirect_type  PPC_INDIRECT_TYPE_NO_PCIE_LINK)))
 + {
   for (i = 0; i  4; ++i) {
 - if (bus-resource[i]  bus-parent-resource[i]) {
 - bus-resource[i]-start = 
 bus-parent-resource[i]-start;
 - bus-resource[i]-end = 
 bus-parent-resource[i]-end;
 - bus-resource[i]-flags = 
 bus-parent-resource[i]-flags;
 + struct resource *res = bus-resource[i];
 + struct resource *par = bus-parent-resource[i];
 + if (res) {
 + res-start = 0;
 + res-end   = 0;
 + res-flags = 0;
 + }
 + if (res  par) {
 + res-start = par-start;
 + res-end   = par-end;
 + res-flags = par-flags;
   }
   }
   }
 

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 0/7] Powerpc support for SBC8560 board

2008-01-24 Thread Paul Gortmaker
Kumar Gala wrote:

 On Jan 7, 2008, at 8:25 AM, Paul Gortmaker wrote:


 This is a respin of the sbc8560 patches, incorporating the feedback and
 suggested changes from everyone. Changes include:

 -coding style and missing of_put (Stephen Rothwell)

 -minor dtc cleanups for gianfar, mdio, mpic etc. (David Gibson / 
 Kumar Gala)

 -use for_each macros in legacy_serial to improve readability, and as
 groundwork for next change (me)

 -convert dtc duart + device-type=soc thing to be an epld entry
 listed as compatible with localbus -- plus add localbus as an 
 acceptable
 parent in legacy_serial (David Gibson / Scott Wood)

 -rtc is now a child of the epld/localbus and does not use device_type
 in the dtc, nor in the platform detection code (David Gibson)

 -add CPM2 data to dts for FCC ports (on optional daughterboard) based
 on the MPC8560ADS dts (me)

 -add dts aliases, conversion to dts-v1 (Kumar)

 Patches are as follows:

 1 powerpc-use-for_each-in-legacy_serial.txt
 2 powerpc-allow-localbus-compatible-serial-ports-for-console-device.txt
 3 sbc8560-add-support-for-Wind-River-SBC8560-in-arch-powerpc.txt
 4 sbc8560-Add-device-tree-source-for-Wind-River-SBC8560-board.txt
 5 sbc8560-Convert-WRS-SBC8560-device-tree-to-v1-format.txt
 6 CPM2-Make-support-for-the-CPM2-optional-on-8560-based-boards.txt
 7 sbc8560-Add-default-.config-file-for-Wind-River-SBC8560.txt

 Thanks again to all those who provided feedback.

 Have we closed on these patches?

 the sbc8560 is the last board that we need to close on for me to kill 
 85xx in arch/ppc.

I think so. For the 8560, the last issue was David wanting
the dts to have the address cells =2 on localbus-like nodes
and I've not heard any negative feedback on how I did it (yet).

I'll resend the 8xxx patches as a lump today for the sake
of merge convenience, with the legacy_serial change and the
extra simplebus that Scott asked for factored out separate.

Thanks,
Paul.

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


how to handle TARGET_CPM in cuboot-85xx?

2008-01-24 Thread Kumar Gala
Scott,

I have to make this change for some board to cuboot-85xx.c:

diff --git a/arch/powerpc/boot/cuboot-85xx.c b/arch/powerpc/boot/ 
cuboot-85xx.c
index 6776a1a..e2616f2 100644
--- a/arch/powerpc/boot/cuboot-85xx.c
+++ b/arch/powerpc/boot/cuboot-85xx.c
@@ -15,6 +15,7 @@
  #include cuboot.h

  #define TARGET_85xx
+#define TARGET_CPM2
  #include ppcboot.h

  static bd_t bd;


--

however it varies which boards need this.  Should I just duplicate  
cuboot-85xx.c into cuboot-boardname.c as the way to handle this  
right now?

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 0/7] Powerpc support for SBC8560 board

2008-01-24 Thread Kumar Gala

On Jan 24, 2008, at 8:17 AM, Paul Gortmaker wrote:

 Kumar Gala wrote:

 On Jan 7, 2008, at 8:25 AM, Paul Gortmaker wrote:


 This is a respin of the sbc8560 patches, incorporating the  
 feedback and
 suggested changes from everyone. Changes include:

 -coding style and missing of_put (Stephen Rothwell)

 -minor dtc cleanups for gianfar, mdio, mpic etc. (David Gibson /  
 Kumar Gala)

 -use for_each macros in legacy_serial to improve readability, and as
 groundwork for next change (me)

 -convert dtc duart + device-type=soc thing to be an epld entry
 listed as compatible with localbus -- plus add localbus as an  
 acceptable
 parent in legacy_serial (David Gibson / Scott Wood)

 -rtc is now a child of the epld/localbus and does not use  
 device_type
 in the dtc, nor in the platform detection code (David Gibson)

 -add CPM2 data to dts for FCC ports (on optional daughterboard)  
 based
 on the MPC8560ADS dts (me)

 -add dts aliases, conversion to dts-v1 (Kumar)

 Patches are as follows:

 1 powerpc-use-for_each-in-legacy_serial.txt
 2 powerpc-allow-localbus-compatible-serial-ports-for-console- 
 device.txt
 3 sbc8560-add-support-for-Wind-River-SBC8560-in-arch-powerpc.txt
 4 sbc8560-Add-device-tree-source-for-Wind-River-SBC8560-board.txt
 5 sbc8560-Convert-WRS-SBC8560-device-tree-to-v1-format.txt
 6 CPM2-Make-support-for-the-CPM2-optional-on-8560-based-boards.txt
 7 sbc8560-Add-default-.config-file-for-Wind-River-SBC8560.txt

 Thanks again to all those who provided feedback.

 Have we closed on these patches?

 the sbc8560 is the last board that we need to close on for me to  
 kill 85xx in arch/ppc.

 I think so. For the 8560, the last issue was David wanting
 the dts to have the address cells =2 on localbus-like nodes
 and I've not heard any negative feedback on how I did it (yet).

 I'll resend the 8xxx patches as a lump today for the sake
 of merge convenience, with the legacy_serial change and the
 extra simplebus that Scott asked for factored out separate.

ok that would be great.  Will that include an updated sbc834x set?

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 0/7] Powerpc support for SBC8560 board

2008-01-24 Thread Paul Gortmaker
Kumar Gala wrote:

 On Jan 24, 2008, at 8:17 AM, Paul Gortmaker wrote:

 Kumar Gala wrote:

 Have we closed on these patches?

 the sbc8560 is the last board that we need to close on for me to 
 kill 85xx in arch/ppc.

 I think so. For the 8560, the last issue was David wanting
 the dts to have the address cells =2 on localbus-like nodes
 and I've not heard any negative feedback on how I did it (yet).

 I'll resend the 8xxx patches as a lump today for the sake
 of merge convenience, with the legacy_serial change and the
 extra simplebus that Scott asked for factored out separate.

 ok that would be great. Will that include an updated sbc834x set?

Yes, the sbc834x, sbc8548 and sbc8560.

Thanks,
Paul.


 - k

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/4 v4] POWERPC: Add initial iomega StorCenter board port.

2008-01-24 Thread Jon Loeliger
Stephen Rothwell wrote:
 Hi Jon,

 +
 +dnp = of_find_node_by_type(NULL, open-pic);
 +if (dnp == NULL)
 +return;
 +
 +prop = of_get_property(dnp, reg, size);
 +if (prop == NULL)
 +return;
 
 You need an of_node_put(dnp) before you return.

Damn your eyes!

Kumar, I'll send you a patch here...

jdl

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch v5 2/4] USB: add Cypress c67x00 OTG controller core driver

2008-01-24 Thread Peter Korsgaard
This patch add the core driver for the c67x00 USB OTG controller.  The core
driver is responsible for the platform bus binding and creating either
USB HCD or USB Gadget instances for each of the serial interface engines
on the chip.

This driver does not directly implement the HCD or gadget behaviours; it
just controls access to the chip.

Signed-off-by: Peter Korsgaard [EMAIL PROTECTED]
---
 MAINTAINERS |6 +
 drivers/usb/c67x00/c67x00-drv.c |  236 
 include/linux/usb/c67x00.h  |   48 
 3 files changed, 290 insertions(+)

Index: linux-2.6/drivers/usb/c67x00/c67x00-drv.c
===
--- /dev/null
+++ linux-2.6/drivers/usb/c67x00/c67x00-drv.c
@@ -0,0 +1,236 @@
+/*
+ * c67x00-drv.c: Cypress C67X00 USB Common infrastructure
+ *
+ * Copyright (C) 2006-2008 Barco N.V.
+ *Derived from the Cypress cy7c67200/300 ezusb linux driver and
+ *based on multiple host controller drivers inside the linux kernel.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301  USA.
+ */
+
+/*
+ * This file implements the common infrastructure for using the c67x00.
+ * It is both the link between the platform configuration and subdrivers and
+ * the link between the common hardware parts and the subdrivers (e.g.
+ * interrupt handling).
+ *
+ * The c67x00 has 2 SIE's (serial interface engine) wich can be configured
+ * to be host, device or OTG (with some limitations, E.G. only SIE1 can be 
OTG).
+ *
+ * Depending on the platform configuration, the SIE's are created and
+ * the corresponding subdriver is initialized (c67x00_probe_sie).
+ */
+
+#include linux/device.h
+#include linux/list.h
+#include linux/usb.h
+#include linux/usb/c67x00.h
+#include asm/io.h
+
+#include c67x00.h
+
+static void c67x00_probe_sie(struct c67x00_sie *sie,
+struct c67x00_device *dev, int sie_num)
+{
+   spin_lock_init(sie-lock);
+   sie-dev = dev;
+   sie-sie_num = sie_num;
+   sie-mode = c67x00_sie_config(dev-pdata-sie_config, sie_num);
+
+   switch (sie-mode) {
+   case C67X00_SIE_UNUSED:
+   dev_info(sie_dev(sie),
+Not using SIE %d as requested\n, sie-sie_num);
+   break;
+
+   default:
+   dev_err(sie_dev(sie),
+   Unsupported configuration: 0x%x for SIE %d\n,
+   sie-mode, sie-sie_num);
+   break;
+   }
+}
+
+static void c67x00_remove_sie(struct c67x00_sie *sie)
+{
+}
+
+
+static irqreturn_t c67x00_irq(int irq, void *__dev)
+{
+   struct c67x00_device *c67x00 = __dev;
+   struct c67x00_sie *sie;
+   u16 msg, int_status;
+   int i, count = 8;
+
+   int_status = c67x00_ll_hpi_status(c67x00);
+   if (!int_status)
+   return IRQ_NONE;
+
+   while (int_status != 0  (count-- = 0)) {
+   c67x00_ll_irq(c67x00, int_status);
+   for (i = 0; i  C67X00_SIES; i++) {
+   sie = c67x00-sie[i];
+   msg = 0;
+   if (int_status  SIEMSG_FLG(i)) {
+   msg = c67x00_ll_get_siemsg(sie);
+   /* clear register to allow next message */
+   c67x00_ll_set_siemsg(sie, 0);
+   }
+   if (sie-irq)
+   sie-irq(sie, int_status, msg);
+   }
+   int_status = c67x00_ll_hpi_status(c67x00);
+   }
+
+   if (int_status)
+   dev_warn(c67x00-pdev-dev, Not all interrupts handled! 
+status = 0x%04x\n, int_status);
+
+   return IRQ_HANDLED;
+}
+
+/* - */
+
+static int __devinit c67x00_drv_probe(struct platform_device *pdev)
+{
+   struct c67x00_device *c67x00;
+   struct c67x00_platform_data *pdata;
+   struct resource *res, *res2;
+   int ret, i;
+
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   if (!res)
+   return -ENODEV;
+
+   res2 = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+   if (!res2)
+   return -ENODEV;
+
+   pdata = 

[patch v5 1/4] USB: add Cypress c67x00 low level interface code

2008-01-24 Thread Peter Korsgaard
This patch adds the low level support code for the Cypress c67x00 family of
OTG controllers.  The low level code is responsible for register access and
implements the software protocol for communicating with the 16bit
microcontroller inside the c67x00 device.

Communication is done over the HPI interface (16bit SRAM-like parallel bus).

Signed-off-by: Peter Korsgaard [EMAIL PROTECTED]
---
 drivers/usb/c67x00/c67x00-ll-hpi.c |  409 +
 drivers/usb/c67x00/c67x00.h|  286 +
 2 files changed, 695 insertions(+)

Index: linux-2.6/drivers/usb/c67x00/c67x00.h
===
--- /dev/null
+++ linux-2.6/drivers/usb/c67x00/c67x00.h
@@ -0,0 +1,286 @@
+/*
+ * c67x00.h: Cypress C67X00 USB register and field definitions
+ *
+ * Copyright (C) 2006-2008 Barco N.V.
+ *Derived from the Cypress cy7c67200/300 ezusb linux driver and
+ *based on multiple host controller drivers inside the linux kernel.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301  USA.
+ */
+
+#ifndef _USB_C67X00_H
+#define _USB_C67X00_H
+
+#include linux/spinlock.h
+#include linux/platform_device.h
+#include linux/completion.h
+#include linux/mutex.h
+
+/* -
+ * Cypress C67x00 register definitions
+ */
+
+/* Hardware Revision Register */
+#define HW_REV_REG 0xC004
+
+/* General USB registers */
+/* = */
+
+/* USB Control Register */
+#define USB_CTL_REG(x) ((x) ? 0xC0AA : 0xC08A)
+
+#define LOW_SPEED_PORT(x)  ((x) ? 0x0800 : 0x0400)
+#define HOST_MODE  0x0200
+#define PORT_RES_EN(x) ((x) ? 0x0100 : 0x0080)
+#define SOF_EOP_EN(x)  ((x) ? 0x0002 : 0x0001)
+
+/* USB status register - Notice it has different content in hcd/udc mode */
+#define USB_STAT_REG(x)((x) ? 0xC0B0 : 0xC090)
+
+#define EP0_IRQ_FLG0x0001
+#define EP1_IRQ_FLG0x0002
+#define EP2_IRQ_FLG0x0004
+#define EP3_IRQ_FLG0x0008
+#define EP4_IRQ_FLG0x0010
+#define EP5_IRQ_FLG0x0020
+#define EP6_IRQ_FLG0x0040
+#define EP7_IRQ_FLG0x0080
+#define RESET_IRQ_FLG  0x0100
+#define SOF_EOP_IRQ_FLG0x0200
+#define ID_IRQ_FLG 0x4000
+#define VBUS_IRQ_FLG   0x8000
+
+/* USB Host only registers */
+/* === */
+
+/* Host n Control Register */
+#define HOST_CTL_REG(x)((x) ? 0xC0A0 : 0xC080)
+
+#define PREAMBLE_EN0x0080  /* Preamble enable */
+#define SEQ_SEL0x0040  /* Data Toggle Sequence Bit 
Select */
+#define ISO_EN 0x0010  /* Isochronous enable  */
+#define ARM_EN 0x0001  /* Arm operation */
+
+/* Host n Interrupt Enable Register */
+#define HOST_IRQ_EN_REG(x) ((x) ? 0xC0AC : 0xC08C)
+
+#define SOF_EOP_IRQ_EN 0x0200  /* SOF/EOP Interrupt Enable  */
+#define SOF_EOP_TMOUT_IRQ_EN   0x0800  /* SOF/EOP Timeout Interrupt Enable  */
+#define ID_IRQ_EN  0x4000  /* ID interrupt enable */
+#define VBUS_IRQ_EN0x8000  /* VBUS interrupt enable */
+#define DONE_IRQ_EN0x0001  /* Done Interrupt Enable  */
+
+/* USB status register */
+#define HOST_STAT_MASK 0x02FD
+#define PORT_CONNECT_CHANGE(x) ((x) ? 0x0020 : 0x0010)
+#define PORT_SE0_STATUS(x) ((x) ? 0x0008 : 0x0004)
+
+/* Host Frame Register */
+#define HOST_FRAME_REG(x)  ((x) ? 0xC0B6 : 0xC096)
+
+#define HOST_FRAME_MASK0x07FF
+
+/* USB Peripheral only registers */
+/* = */
+
+/* Device n Port Sel reg */
+#define DEVICE_N_PORT_SEL(x)   ((x) ? 0xC0A4 : 0xC084)
+
+/* Device n Interrupt Enable Register */
+#define DEVICE_N_IRQ_EN_REG(x) ((x) ? 0xC0AC : 0xC08C)
+
+#define DEVICE_N_ENDPOINT_N_CTL_REG(dev, ep)   ((dev)  \
+? (0x0280 + (ep  4)) \
+: (0x0200 + (ep  4)))
+#define DEVICE_N_ENDPOINT_N_STAT_REG(dev, ep)  ((dev)  \
+? (0x0286 + (ep  4)) \
+: (0x0206 

[patch v5 3/4] USB: add Cypress c67x00 OTG controller HCD driver

2008-01-24 Thread Peter Korsgaard
This patch adds HCD support for the Cypress c67x00 family of devices.

Signed-off-by: Peter Korsgaard [EMAIL PROTECTED]
---
 drivers/usb/Makefile   |2 
 drivers/usb/c67x00/Makefile|   11 
 drivers/usb/c67x00/c67x00-drv.c|   13 
 drivers/usb/c67x00/c67x00-hcd.c|  410 
 drivers/usb/c67x00/c67x00-hcd.h|  152 
 drivers/usb/c67x00/c67x00-ll-hpi.c |   75 ++
 drivers/usb/c67x00/c67x00-sched.c  | 1194 +
 drivers/usb/c67x00/c67x00.h|9 
 drivers/usb/host/Kconfig   |   12 
 9 files changed, 1878 insertions(+)

Index: linux-2.6/drivers/usb/c67x00/c67x00-hcd.c
===
--- /dev/null
+++ linux-2.6/drivers/usb/c67x00/c67x00-hcd.c
@@ -0,0 +1,410 @@
+/*
+ * c67x00-hcd.c: Cypress C67X00 USB Host Controller Driver
+ *
+ * Copyright (C) 2006-2008 Barco N.V.
+ *Derived from the Cypress cy7c67200/300 ezusb linux driver and
+ *based on multiple host controller drivers inside the linux kernel.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301  USA.
+ */
+
+#include linux/device.h
+#include linux/platform_device.h
+#include linux/usb.h
+
+#include c67x00.h
+#include c67x00-hcd.h
+
+/* --
+ * Root Hub Support
+ */
+
+static __u8 c67x00_hub_des[] = {
+   0x09,   /*  __u8  bLength; */
+   0x29,   /*  __u8  bDescriptorType; Hub-descriptor */
+   0x02,   /*  __u8  bNbrPorts; */
+   0x00,   /* __u16  wHubCharacteristics; */
+   0x00,   /*   (per-port OC, no power switching) */
+   0x32,   /*  __u8  bPwrOn2pwrGood; 2ms */
+   0x00,   /*  __u8  bHubContrCurrent; 0 mA */
+   0x00,   /*  __u8  DeviceRemovable; ** 7 Ports max ** */
+   0xff,   /*  __u8  PortPwrCtrlMask; ** 7 ports max ** */
+};
+
+static void c67x00_hub_reset_host_port(struct c67x00_sie *sie, int port)
+{
+   struct c67x00_hcd *c67x00 = sie-private_data;
+   unsigned long flags;
+
+   c67x00_ll_husb_reset(sie, port);
+
+   spin_lock_irqsave(c67x00-lock, flags);
+   c67x00_ll_husb_reset_port(sie, port);
+   spin_unlock_irqrestore(c67x00-lock, flags);
+
+   c67x00_ll_set_husb_eot(sie-dev, DEFAULT_EOT);
+}
+
+static int c67x00_hub_status_data(struct usb_hcd *hcd, char *buf)
+{
+   struct c67x00_hcd *c67x00 = hcd_to_c67x00_hcd(hcd);
+   struct c67x00_sie *sie = c67x00-sie;
+   u16 status;
+   int i;
+
+   *buf = 0;
+   status = c67x00_ll_usb_get_status(sie);
+   for (i = 0; i  C67X00_PORTS; i++)
+   if (status  PORT_CONNECT_CHANGE(i))
+   *buf |= (1  i);
+
+   /* bit 0 denotes hub change, b1..n port change */
+   *buf = 1;
+
+   return !!*buf;
+}
+
+static int c67x00_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
+ u16 wIndex, char *buf, u16 wLength)
+{
+   struct c67x00_hcd *c67x00 = hcd_to_c67x00_hcd(hcd);
+   struct c67x00_sie *sie = c67x00-sie;
+   u16 status, usb_status;
+   int len = 0;
+   unsigned int port = wIndex-1;
+   u16 wPortChange, wPortStatus;
+
+   switch (typeReq) {
+
+   case GetHubStatus:
+   *(__le32 *) buf = cpu_to_le32(0);
+   len = 4;/* hub power */
+   break;
+
+   case GetPortStatus:
+   if (wIndex  C67X00_PORTS)
+   return -EPIPE;
+
+   status = c67x00_ll_usb_get_status(sie);
+   usb_status = c67x00_ll_get_usb_ctl(sie);
+
+   wPortChange = 0;
+   if (status  PORT_CONNECT_CHANGE(port))
+   wPortChange |= USB_PORT_STAT_C_CONNECTION;
+
+   wPortStatus = USB_PORT_STAT_POWER;
+   if (!(status  PORT_SE0_STATUS(port)))
+   wPortStatus |= USB_PORT_STAT_CONNECTION;
+   if (usb_status  LOW_SPEED_PORT(port)) {
+   wPortStatus |= USB_PORT_STAT_LOW_SPEED;
+   c67x00-low_speed_ports |= (1  port);
+   } else
+   

[patch v5 4/4] USB: add Cypress c67x00 OTG controller gadget driver

2008-01-24 Thread Peter Korsgaard
This patch adds USB gadget support for the Cypress c67x00 family of devices.

This is work in progress and not ready to be committed yet. I'm posting this
to show how it fits with the rest of the driver and to collect feedback.

The driver works good enought to use g_serial, but there are still issues
to be solved. The biggest issue is that endpoint 0 is currently handled by
the BIOS inside the c67x00, so the gadget stack never sees the data.
The BIOS also has other deficiencies, E.G. see the patching done in
c67x00_ll_susb_init().
---
 drivers/usb/Kconfig|2 
 drivers/usb/Makefile   |2 
 drivers/usb/c67x00/Kconfig |   21 
 drivers/usb/c67x00/Makefile|7 
 drivers/usb/c67x00/c67x00-drv.c|   11 
 drivers/usb/c67x00/c67x00-ll-hpi.c |  201 
 drivers/usb/c67x00/c67x00-udc.c|  905 +
 drivers/usb/c67x00/c67x00-udc.h|   50 ++
 drivers/usb/c67x00/c67x00.h|   21 
 drivers/usb/gadget/Kconfig |7 
 drivers/usb/gadget/gadget_chips.h  |8 
 drivers/usb/host/Kconfig   |   12 
 12 files changed, 1232 insertions(+), 15 deletions(-)

Index: linux-2.6/drivers/usb/c67x00/c67x00-udc.c
===
--- /dev/null
+++ linux-2.6/drivers/usb/c67x00/c67x00-udc.c
@@ -0,0 +1,905 @@
+/*
+ * c67x00-udc.c: Cypress C67X00 USB device controller
+ *
+ * Copyright (C) 2006-2008 Barco N.V.
+ *Derived from the Cypress cy7c67200/300 ezusb linux driver and
+ *based on multiple device controller drivers inside the linux kernel.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301  USA.
+ */
+
+#include linux/device.h
+#include linux/usb.h
+#include linux/usb/c67x00.h
+#include linux/usb/gadget.h
+#include linux/usb/ch9.h
+
+#include c67x00.h
+#include c67x00-udc.h
+
+/* Defined in DEVICE n ENDPOINT STATUS REGISTERS */
+#define OVERFLOW_FLG   0x0800  /* Receive overflow */
+#define UNDERFLOW_FLG  0x0400  /* Receive underflow */
+#define OUT_EXCEPTION_FLG  0x0200  /* OUT received when armed for IN */
+#define IN_EXCEPTION_FLG   0x0100  /* IN received when armed for OUT */
+#define STALL_FLG  0x0080  /* Stall sent */
+#define NAK_FLG0x0040  /* NAK sent */
+#define LENGTH_EXCEPT_FLG  0x0020  /* Overflow or Underflow occured */
+#define SETUP_FLG  0x0010  /* SETUP packet received */
+#define SEQ_STAT   0x0008  /* Last Data Toggle Sequence bit sent
+   or received */
+#define TIMEOUT_FLG0x0004  /* Last transmission timed out */
+#define ERROR_FLG  0x0002  /* CRC Err detected in last
+   reception*/
+#define ACK_FLG0x0001  /* Last transaction ACK'D (sent
+   or received) */
+
+/* Defined in DEVICE n ENDPOINT CONTROL REGISTERS */
+#define DIR_SEL_IN 0x0004  /* Last transmission timed out */
+#define EP_ENABLE  0x0002  /* Enable Endpoint */
+
+
+
+struct c67x00_request {
+   struct usb_request req;
+   struct list_head queue;
+};
+
+
+
+struct c67x00_udc_ep {
+   struct usb_ep ep;
+   struct c67x00_udc *udc;
+
+   struct list_head queue;
+   int ep_num;
+   int is_ep_in;
+   int enable;
+   int stopped;
+   int start_io;
+};
+
+#define C67X00_MAX_NB_END_POINTS 8
+
+struct c67x00_udc {
+   spinlock_t lock;
+   struct c67x00_sie *sie;
+   struct usb_gadget gadget;
+   struct usb_gadget_driver *driver;
+   struct c67x00_udc_ep ep[C67X00_MAX_NB_END_POINTS];
+   struct work_struct io_work;
+   int config_nr;
+   /* The highest string descriptor entry
+  (used to retrieve descriptors from gadget driver) */
+   int top_str_id;
+   u16 string_desc_addr;
+};
+
+const static unsigned char get_descriptor_device[] = {
+   USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE,
+   USB_REQ_GET_DESCRIPTOR,
+   0x00,
+   USB_DT_DEVICE,
+   0x00,
+   0x00,
+   0x12,
+   0x00
+};
+
+const static unsigned char get_descriptor_config[] = {
+   USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE,
+   

Re: [PATCH 3/4 v4] POWERPC: Add initial iomega StorCenter board port.

2008-01-24 Thread Jon Loeliger
Kumar Gala wrote:
 On Jan 23, 2008, at 6:50 PM, Stephen Rothwell wrote:
 
 You need an of_node_put(dnp) before you return.
 
 Fixed up by your friendly maintainer.

Kumar,

I meant, I won't be sending you a patch.

Thank you!

jdl

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCHv3 0/7] [POWERPC] 8xx cleanups

2008-01-24 Thread Jochen Friedrich
Hi,

this is a series against paulus for-2.6.25 tree to clean up various 8xx related 
stuff.
The series can be pulled from git://git.bocc.de/dbox2.git cleanup.
Old patches 2+4 have been merged into Patch 2. Patch 4 has been modified to 
move the
prototypes into a new platforms/8xx/mpc8xx.h. Patch 5 leaves the PCMCIA bits in
asm-powerpc/mpc8xx.h as this driver needs to be fixed first (unfortunately, i 
don't
have an 8xx board with PCMCIA). I would suggest removing asm-powerpc/mpc8xx.h 
after
ARCH=ppc is gone to avoid adding #ifdefs to all shared drivers.

I also modified an option in Thunderbird so i hope whitespaces are OK now :-/

[POWERPC] Remove unused m8xx_cpm_hostalloc/free/dump()
[POWERPC] Rename m8xx_pic_init to mpc8xx_pics_init
[POWERPC] Remove unneeded and misspelled prototype m8xx_calibrate_decr
[POWERPC] Remove sysdev/commproc.h
[POWERPC] Get rid of conditional includes of board specific setup
[POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c
[POWERPC] Move definition of buffer descriptor to cpm.h

Thanks,
Jochen
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCHv3 1/7] [POWERPC] Remove unused m8xx_cpm_hostalloc/free/dump()

2008-01-24 Thread Jochen Friedrich
m8xx_cpm_hostalloc is still defined in commproc.c, but no users are left
in the kernel tree. m8xx_cpm_hostfree and m8xx_cpm_hostdump are only
defined in the headers. Remove this dead code.

Signed-off-by: Jochen Friedrich [EMAIL PROTECTED]
---
 arch/powerpc/sysdev/commproc.c |   37 -
 arch/ppc/8xx_io/commproc.c |   38 --
 include/asm-powerpc/commproc.h |4 
 include/asm-ppc/commproc.h |4 
 4 files changed, 0 insertions(+), 83 deletions(-)

diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index 621bc6c..818d4b0 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -48,8 +48,6 @@
 #ifndef CONFIG_PPC_CPM_NEW_BINDING
 static void m8xx_cpm_dpinit(void);
 #endif
-static uint host_buffer; /* One page of host buffer */
-static uint host_end;/* end + 1 */
 cpm8xx_t __iomem *cpmp;  /* Pointer to comm processor space */
 immap_t __iomem *mpc8xx_immr;
 static cpic8xx_t __iomem *cpic_reg;
@@ -268,41 +266,6 @@ out:
 }
 EXPORT_SYMBOL(cpm_command);
 
-/* We used to do this earlier, but have to postpone as long as possible
- * to ensure the kernel VM is now running.
- */
-static void
-alloc_host_memory(void)
-{
-   dma_addr_t  physaddr;
-
-   /* Set the host page for allocation.
-   */
-   host_buffer = (uint)dma_alloc_coherent(NULL, PAGE_SIZE, physaddr,
-   GFP_KERNEL);
-   host_end = host_buffer + PAGE_SIZE;
-}
-
-/* We also own one page of host buffer space for the allocation of
- * UART fifos and the like.
- */
-uint
-m8xx_cpm_hostalloc(uint size)
-{
-   uintretloc;
-
-   if (host_buffer == 0)
-   alloc_host_memory();
-
-   if ((host_buffer + size) = host_end)
-   return(0);
-
-   retloc = host_buffer;
-   host_buffer += size;
-
-   return(retloc);
-}
-
 /* Set a baud rate generator.  This needs lots of work.  There are
  * four BRGs, any of which can be wired to any channel.
  * The internal baud rate clock is the system clock divided by 16.
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index 9da880b..3f93af8 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -55,8 +55,6 @@
 })
 
 static void m8xx_cpm_dpinit(void);
-static uinthost_buffer;/* One page of host buffer */
-static uinthost_end;   /* end + 1 */
 cpm8xx_t   *cpmp;  /* Pointer to comm processor space */
 
 /* CPM interrupt vector functions.
@@ -68,7 +66,6 @@ structcpm_action {
 static struct  cpm_action cpm_vecs[CPMVEC_NR];
 static irqreturn_t cpm_interrupt(int irq, void * dev);
 static irqreturn_t cpm_error_interrupt(int irq, void *dev);
-static voidalloc_host_memory(void);
 /* Define a table of names to identify CPM interrupt handlers in
  * /proc/interrupts.
  */
@@ -158,21 +155,6 @@ m8xx_cpm_reset(void)
cpmp = (cpm8xx_t *)commproc;
 }
 
-/* We used to do this earlier, but have to postpone as long as possible
- * to ensure the kernel VM is now running.
- */
-static void
-alloc_host_memory(void)
-{
-   dma_addr_t  physaddr;
-
-   /* Set the host page for allocation.
-   */
-   host_buffer = (uint)dma_alloc_coherent(NULL, PAGE_SIZE, physaddr,
-   GFP_KERNEL);
-   host_end = host_buffer + PAGE_SIZE;
-}
-
 /* This is called during init_IRQ.  We used to do it above, but this
  * was too early since init_IRQ was not yet called.
  */
@@ -319,26 +301,6 @@ cpm_free_handler(int cpm_vec)
cpm_vecs[cpm_vec].dev_id = NULL;
 }
 
-/* We also own one page of host buffer space for the allocation of
- * UART fifos and the like.
- */
-uint
-m8xx_cpm_hostalloc(uint size)
-{
-   uintretloc;
-
-   if (host_buffer == 0)
-   alloc_host_memory();
-
-   if ((host_buffer + size) = host_end)
-   return(0);
-
-   retloc = host_buffer;
-   host_buffer += size;
-
-   return(retloc);
-}
-
 /* Set a baud rate generator.  This needs lots of work.  There are
  * four BRGs, any of which can be wired to any channel.
  * The internal baud rate clock is the system clock divided by 16.
diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h
index 9e3b864..9757521 100644
--- a/include/asm-powerpc/commproc.h
+++ b/include/asm-powerpc/commproc.h
@@ -87,10 +87,6 @@ extern uint cpm_dpram_phys(u8* addr);
 
 extern void cpm_setbrg(uint brg, uint rate);
 
-extern uint m8xx_cpm_hostalloc(uint size);
-extern int  m8xx_cpm_hostfree(uint start);
-extern void m8xx_cpm_hostdump(void);
-
 extern void cpm_load_patch(cpm8xx_t *cp);
 
 /* Buffer descriptors used by many of the CPM protocols.
diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h
index 462abb1..5418d6d 100644
--- a/include/asm-ppc/commproc.h
+++ b/include/asm-ppc/commproc.h
@@ -75,10 +75,6 @@ extern void *cpm_dpram_addr(unsigned long offset);
 extern uint 

[PATCHv3 2/7] [POWERPC] Rename m8xx_pic_init to mpc8xx_pics_init

2008-01-24 Thread Jochen Friedrich
m8xx_pic_init calls both mpc8xx_pic_init and cpm_pic_init. Renaming the
function to use the same name space as the rest of the mpc8xx
specific funtions and to be more meaningful.
m8xx_pic_init is declared in ppc8xx_pic.h but defined nowhere in the ppc
tree. Remove it.

Signed-off-by: Jochen Friedrich [EMAIL PROTECTED]
---
 arch/powerpc/platforms/8xx/ep88xc.c  |2 +-
 arch/powerpc/platforms/8xx/m8xx_setup.c  |4 ++--
 arch/powerpc/platforms/8xx/mpc86xads_setup.c |2 +-
 arch/powerpc/platforms/8xx/mpc885ads_setup.c |2 +-
 arch/powerpc/sysdev/commproc.h   |2 +-
 arch/ppc/syslib/ppc8xx_pic.h |1 -
 6 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/platforms/8xx/ep88xc.c 
b/arch/powerpc/platforms/8xx/ep88xc.c
index 88afa35..372b1e2 100644
--- a/arch/powerpc/platforms/8xx/ep88xc.c
+++ b/arch/powerpc/platforms/8xx/ep88xc.c
@@ -165,7 +165,7 @@ define_machine(ep88xc) {
.name = Embedded Planet EP88xC,
.probe = ep88xc_probe,
.setup_arch = ep88xc_setup_arch,
-   .init_IRQ = m8xx_pic_init,
+   .init_IRQ = mpc8xx_pics_init,
.get_irq= mpc8xx_get_irq,
.restart = mpc8xx_restart,
.calibrate_decr = mpc8xx_calibrate_decr,
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c 
b/arch/powerpc/platforms/8xx/m8xx_setup.c
index ba645c2..1337457 100644
--- a/arch/powerpc/platforms/8xx/m8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
@@ -237,13 +237,13 @@ static void cpm_cascade(unsigned int irq, struct irq_desc 
*desc)
desc-chip-eoi(irq);
 }
 
-/* Initialize the internal interrupt controller.  The number of
+/* Initialize the internal interrupt controllers.  The number of
  * interrupts supported can vary with the processor type, and the
  * 82xx family can have up to 64.
  * External interrupts can be either edge or level triggered, and
  * need to be initialized by the appropriate driver.
  */
-void __init m8xx_pic_init(void)
+void __init mpc8xx_pics_init(void)
 {
int irq;
 
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c 
b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index d7965f8..2a4a50f 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -138,7 +138,7 @@ define_machine(mpc86x_ads) {
.name   = MPC86x ADS,
.probe  = mpc86xads_probe,
.setup_arch = mpc86xads_setup_arch,
-   .init_IRQ   = m8xx_pic_init,
+   .init_IRQ   = mpc8xx_pics_init,
.get_irq= mpc8xx_get_irq,
.restart= mpc8xx_restart,
.calibrate_decr = mpc8xx_calibrate_decr,
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c 
b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 6ef8e9e..2931bae 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -274,7 +274,7 @@ define_machine(mpc885_ads) {
.name   = Freescale MPC885 ADS,
.probe  = mpc885ads_probe,
.setup_arch = mpc885ads_setup_arch,
-   .init_IRQ   = m8xx_pic_init,
+   .init_IRQ   = mpc8xx_pics_init,
.get_irq= mpc8xx_get_irq,
.restart= mpc8xx_restart,
.calibrate_decr = mpc8xx_calibrate_decr,
diff --git a/arch/powerpc/sysdev/commproc.h b/arch/powerpc/sysdev/commproc.h
index 9155ba4..f481adf 100644
--- a/arch/powerpc/sysdev/commproc.h
+++ b/arch/powerpc/sysdev/commproc.h
@@ -6,7 +6,7 @@ extern void mpc8xx_restart(char *cmd);
 extern void mpc8xx_calibrate_decr(void);
 extern int mpc8xx_set_rtc_time(struct rtc_time *tm);
 extern void mpc8xx_get_rtc_time(struct rtc_time *tm);
-extern void m8xx_pic_init(void);
+extern void mpc8xx_pics_init(void);
 extern unsigned int mpc8xx_get_irq(void);
 
 #endif
diff --git a/arch/ppc/syslib/ppc8xx_pic.h b/arch/ppc/syslib/ppc8xx_pic.h
index d7d9f65..53bcd97 100644
--- a/arch/ppc/syslib/ppc8xx_pic.h
+++ b/arch/ppc/syslib/ppc8xx_pic.h
@@ -6,7 +6,6 @@
 
 extern struct hw_interrupt_type ppc8xx_pic;
 
-void m8xx_pic_init(void);
 void m8xx_do_IRQ(struct pt_regs *regs,
  intcpu);
 int m8xx_get_irq(struct pt_regs *regs);
-- 
1.5.3.8


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCHv3 3/7] [POWERPC] Remove unneeded and misspelled prototype m8xx_calibrate_decr

2008-01-24 Thread Jochen Friedrich
m8xx_calibrate_decr seems to be a misspelled prototype for
mpc8xx_calibrate_decr. As it's not needed anyways, just remove it.

Signed-off-by: Jochen Friedrich [EMAIL PROTECTED]
---
 arch/powerpc/platforms/8xx/m8xx_setup.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c 
b/arch/powerpc/platforms/8xx/m8xx_setup.c
index 1337457..85abd61 100644
--- a/arch/powerpc/platforms/8xx/m8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
@@ -31,7 +31,6 @@
 struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
 #endif
 
-void m8xx_calibrate_decr(void);
 extern int cpm_pic_init(void);
 extern int cpm_get_irq(void);
 
-- 
1.5.3.8


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCHv3 4/7] [POWERPC] Remove sysdev/commproc.h

2008-01-24 Thread Jochen Friedrich
Move cpm1 specific prototypes to asm/commproc.h and mpc8xx specific
prototypes to asm/mpc8xx.h. Adjust includes accordingly. Remove now
unneeded sysdev/commproc.h.

Signed-off-by: Jochen Friedrich [EMAIL PROTECTED]
---
 arch/powerpc/platforms/8xx/ep88xc.c  |2 +-
 arch/powerpc/platforms/8xx/m8xx_setup.c  |3 ++-
 arch/powerpc/platforms/8xx/mpc86xads_setup.c |4 +---
 arch/powerpc/platforms/8xx/mpc885ads_setup.c |2 +-
 arch/powerpc/platforms/8xx/mpc8xx.h  |   21 +
 arch/powerpc/sysdev/commproc.c   |1 -
 arch/powerpc/sysdev/commproc.h   |   12 
 arch/powerpc/sysdev/mpc8xx_pic.c |1 -
 include/asm-powerpc/commproc.h   |2 ++
 9 files changed, 28 insertions(+), 20 deletions(-)
 create mode 100644 arch/powerpc/platforms/8xx/mpc8xx.h
 delete mode 100644 arch/powerpc/sysdev/commproc.h

diff --git a/arch/powerpc/platforms/8xx/ep88xc.c 
b/arch/powerpc/platforms/8xx/ep88xc.c
index 372b1e2..4897eda 100644
--- a/arch/powerpc/platforms/8xx/ep88xc.c
+++ b/arch/powerpc/platforms/8xx/ep88xc.c
@@ -17,7 +17,7 @@
 #include asm/udbg.h
 #include asm/commproc.h
 
-#include sysdev/commproc.h
+#include mpc8xx.h
 
 struct cpm_pin {
int port, pin, flags;
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c 
b/arch/powerpc/platforms/8xx/m8xx_setup.c
index 85abd61..1867a07 100644
--- a/arch/powerpc/platforms/8xx/m8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
@@ -25,7 +25,8 @@
 #include mm/mmu_decl.h
 
 #include sysdev/mpc8xx_pic.h
-#include sysdev/commproc.h
+
+#include mpc8xx.h
 
 #ifdef CONFIG_PCMCIA_M8XX
 struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c 
b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index 2a4a50f..c0dda53 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -21,15 +21,13 @@
 #include asm/machdep.h
 #include asm/system.h
 #include asm/time.h
-#include asm/mpc8xx.h
 #include asm/8xx_immap.h
 #include asm/commproc.h
 #include asm/fs_pd.h
 #include asm/udbg.h
 
-#include sysdev/commproc.h
-
 #include mpc86xads.h
+#include mpc8xx.h
 
 struct cpm_pin {
int port, pin, flags;
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c 
b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 2931bae..bdceb57 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -40,7 +40,7 @@
 #include asm/fs_pd.h
 #include asm/udbg.h
 
-#include sysdev/commproc.h
+#include mpc8xx.h
 
 static u32 __iomem *bcsr, *bcsr5;
 
diff --git a/arch/powerpc/platforms/8xx/mpc8xx.h 
b/arch/powerpc/platforms/8xx/mpc8xx.h
new file mode 100644
index 000..17fb528
--- /dev/null
+++ b/arch/powerpc/platforms/8xx/mpc8xx.h
@@ -0,0 +1,21 @@
+/*
+ * Prototypes, etc. for the Freescale MPC8xx embedded cpu chips
+ * May need to be cleaned as the port goes on ...
+ *
+ * Copyright (C) 2008 Jochen Friedrich [EMAIL PROTECTED]
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+#ifndef __MPC8xx_H
+#define __MPC8xx_H
+
+extern void mpc8xx_restart(char *cmd);
+extern void mpc8xx_calibrate_decr(void);
+extern int mpc8xx_set_rtc_time(struct rtc_time *tm);
+extern void mpc8xx_get_rtc_time(struct rtc_time *tm);
+extern void mpc8xx_pics_init(void);
+extern unsigned int mpc8xx_get_irq(void);
+ 
+#endif /* __MPC8xx_H */
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index 818d4b0..ef82587 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -30,7 +30,6 @@
 #include linux/interrupt.h
 #include linux/irq.h
 #include linux/module.h
-#include asm/mpc8xx.h
 #include asm/page.h
 #include asm/pgtable.h
 #include asm/8xx_immap.h
diff --git a/arch/powerpc/sysdev/commproc.h b/arch/powerpc/sysdev/commproc.h
deleted file mode 100644
index f481adf..000
--- a/arch/powerpc/sysdev/commproc.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _POWERPC_SYSDEV_COMMPROC_H
-#define _POWERPC_SYSDEV_COMMPROC_H
-
-extern void cpm_reset(void);
-extern void mpc8xx_restart(char *cmd);
-extern void mpc8xx_calibrate_decr(void);
-extern int mpc8xx_set_rtc_time(struct rtc_time *tm);
-extern void mpc8xx_get_rtc_time(struct rtc_time *tm);
-extern void mpc8xx_pics_init(void);
-extern unsigned int mpc8xx_get_irq(void);
-
-#endif
diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c
index 7aa4ff5..0e74a4b 100644
--- a/arch/powerpc/sysdev/mpc8xx_pic.c
+++ b/arch/powerpc/sysdev/mpc8xx_pic.c
@@ -10,7 +10,6 @@
 #include asm/irq.h
 #include asm/io.h
 #include asm/8xx_immap.h
-#include asm/mpc8xx.h
 
 #include mpc8xx_pic.h
 
diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h
index 9757521..ec87b8f 100644
--- a/include/asm-powerpc/commproc.h
+++ 

[PATCH v5 0/5] device_type/compatible cleanups

2008-01-24 Thread Anton Vorontsov
Hi all,

This is v5. It's tested on MPC8360E-RDK and MPC8568E-MDS.

Here is diffstat summary:

 Documentation/powerpc/booting-without-of.txt   |   26 +--
 arch/powerpc/boot/dts/mpc832x_mds.dts  |   11 -
 arch/powerpc/boot/dts/mpc832x_rdb.dts  |   11 -
 arch/powerpc/boot/dts/mpc836x_mds.dts  |   11 -
 arch/powerpc/boot/dts/mpc836x_rdk.dts  |   10 -
 arch/powerpc/boot/dts/mpc8568mds.dts   |   10 -
 arch/powerpc/sysdev/fsl_soc.c  |  191 +++--
 b/Documentation/powerpc/booting-without-of.txt |   11 -
 b/arch/powerpc/boot/dts/mpc8313erdb.dts|4
 b/arch/powerpc/boot/dts/mpc832x_mds.dts|9 -
 b/arch/powerpc/boot/dts/mpc832x_rdb.dts|   10 -
 b/arch/powerpc/boot/dts/mpc8349emitx.dts   |4
 b/arch/powerpc/boot/dts/mpc8349emitxgp.dts |4
 b/arch/powerpc/boot/dts/mpc834x_mds.dts|4
 b/arch/powerpc/boot/dts/mpc836x_mds.dts|   10 -
 b/arch/powerpc/boot/dts/mpc836x_rdk.dts|1
 b/arch/powerpc/boot/dts/mpc8568mds.dts |   10 -
 b/arch/powerpc/kernel/legacy_serial.c  |3
 b/arch/powerpc/platforms/83xx/mpc832x_mds.c|   11 -
 b/arch/powerpc/platforms/83xx/mpc832x_rdb.c|   11 -
 b/arch/powerpc/platforms/83xx/mpc836x_mds.c|   11 -
 b/arch/powerpc/platforms/85xx/mpc85xx_mds.c|   32 ++--
 b/arch/powerpc/sysdev/fsl_soc.c|5
 b/arch/powerpc/sysdev/qe_lib/qe.c  |   64 +---
 b/drivers/net/ucc_geth_mii.c   |4
 b/drivers/spi/spi_mpc83xx.c|   10 -
 26 files changed, 284 insertions(+), 204 deletions(-)


Changes since v4:
- Now I'm not removing device_type = qe, because I realized that there
  was a period of time (month or so?) where libfdt-enabled u-boots were
  searching for it;
- new patch that prepares the code for device_type = soc removal
  from the device trees. We can't remove it now, because of backward
  compatibility. Though, MPC8360E-RDK is exception here.

Changes since v3:
- Thanks to reviewers, few glitches found and fixed;
- New conversion: device_type = qeic to compatible = fsl,qe-ic;
- Documentation updated.

Changes since v2:
- SPI conversion fixed and actually tested on MPC8323E-RDB to not
  break anything;
- Few more users of device_type = qe converted to
  compatible = fsl,qe;
- Got Ack on SPI part from David Brownell.

Changes since v1:
- Device tree lookup changes should be backward compatible with
  older dtbs;
- Few of_put_node() cleanups;
- cell-index property added to spi nodes;
- cpm-muram{,-data} added as an addition to qe-muram{,-data}.


Thanks,

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCHv3 5/7] [POWERPC] Get rid of conditional includes of board specific setup

2008-01-24 Thread Jochen Friedrich
Directly include mpc885ads.h from mpc885ads_setup.c. Now we can get rid
of the arch dependent includes in mpc8xx.h.

Signed-off-by: Jochen Friedrich [EMAIL PROTECTED]
---
 arch/powerpc/platforms/8xx/m8xx_setup.c  |3 +--
 arch/powerpc/platforms/8xx/mpc885ads_setup.c |1 +
 include/asm-powerpc/mpc8xx.h |   20 
 3 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c 
b/arch/powerpc/platforms/8xx/m8xx_setup.c
index 1867a07..184f998 100644
--- a/arch/powerpc/platforms/8xx/m8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
@@ -16,6 +16,7 @@
 #include linux/init.h
 #include linux/time.h
 #include linux/rtc.h
+#include linux/fsl_devices.h
 
 #include asm/io.h
 #include asm/mpc8xx.h
@@ -28,9 +29,7 @@
 
 #include mpc8xx.h
 
-#ifdef CONFIG_PCMCIA_M8XX
 struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
-#endif
 
 extern int cpm_pic_init(void);
 extern int cpm_get_irq(void);
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c 
b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index bdceb57..3be115e 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -40,6 +40,7 @@
 #include asm/fs_pd.h
 #include asm/udbg.h
 
+#include mpc885ads.h
 #include mpc8xx.h
 
 static u32 __iomem *bcsr, *bcsr5;
diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/mpc8xx.h
index 2be014b..98f3c4f 100644
--- a/include/asm-powerpc/mpc8xx.h
+++ b/include/asm-powerpc/mpc8xx.h
@@ -4,29 +4,9 @@
  * file that has to include MPC8xx configuration, they all include
  * this one and the configuration switching is done here.
  */
-#ifdef __KERNEL__
 #ifndef __CONFIG_8xx_DEFS
 #define __CONFIG_8xx_DEFS
 
-
-#ifdef CONFIG_8xx
-
-#ifdef CONFIG_FADS
-#include platforms/fads.h
-#endif
-
-#if defined(CONFIG_MPC86XADS)
-#include platforms/8xx/mpc86xads.h
-#endif
-
-#if defined(CONFIG_MPC885ADS)
-#include platforms/8xx/mpc885ads.h
-#endif
-
-#ifdef CONFIG_PCMCIA_M8XX
 extern struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
-#endif
 
-#endif /* CONFIG_8xx */
 #endif /* __CONFIG_8xx_DEFS */
-#endif /* __KERNEL__ */
-- 
1.5.3.8


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCHv3 6/7] [POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c

2008-01-24 Thread Jochen Friedrich
Rename commproc.[ch] to cpm1.[ch] to be more consistent with cpm2. Also
rename cpm2_common.c to cpm2.c as suggested by Scott Wood. Adjust the
includes accordingly.

Signed-off-by: Jochen Friedrich [EMAIL PROTECTED]
---
 arch/powerpc/platforms/8xx/ep88xc.c   |1 +
 arch/powerpc/platforms/8xx/mpc86xads_setup.c  |2 +-
 arch/powerpc/platforms/8xx/mpc885ads_setup.c  |2 +-
 arch/powerpc/sysdev/Makefile  |4 ++--
 arch/powerpc/sysdev/{commproc.c = cpm1.c}|4 ++--
 arch/powerpc/sysdev/{cpm2_common.c = cpm2.c} |3 +--
 arch/powerpc/sysdev/micropatch.c  |2 +-
 arch/ppc/8260_io/enet.c   |2 +-
 arch/ppc/8xx_io/commproc.c|2 +-
 arch/ppc/8xx_io/enet.c|6 +++---
 arch/ppc/8xx_io/fec.c |2 +-
 arch/ppc/8xx_io/micropatch.c  |2 +-
 arch/ppc/boot/simple/iic.c|2 +-
 arch/ppc/boot/simple/m8xx_tty.c   |2 +-
 arch/ppc/kernel/ppc_ksyms.c   |2 +-
 arch/ppc/platforms/mpc866ads_setup.c  |2 +-
 arch/ppc/platforms/mpc885ads_setup.c  |2 +-
 arch/ppc/syslib/mpc8xx_devices.c  |2 +-
 arch/ppc/xmon/start_8xx.c |2 +-
 drivers/net/fec.c |8 
 drivers/net/fec.h |2 +-
 drivers/net/fec_8xx/fec_8xx-netta.c   |2 +-
 drivers/net/fec_8xx/fec_main.c|2 +-
 drivers/net/fec_8xx/fec_mii.c |2 +-
 drivers/net/fs_enet/fs_enet.h |2 +-
 drivers/net/fs_enet/mac-fec.c |2 +-
 drivers/net/fs_enet/mac-scc.c |2 +-
 drivers/serial/68360serial.c  |2 +-
 drivers/serial/cpm_uart/cpm_uart_cpm1.h   |2 +-
 include/asm-powerpc/{commproc.h = cpm1.h}|8 
 include/asm-ppc/{commproc.h = cpm1.h}|8 
 31 files changed, 40 insertions(+), 48 deletions(-)
 rename arch/powerpc/sysdev/{commproc.c = cpm1.c} (99%)
 rename arch/powerpc/sysdev/{cpm2_common.c = cpm2.c} (99%)
 rename include/asm-powerpc/{commproc.h = cpm1.h} (99%)
 rename include/asm-ppc/{commproc.h = cpm1.h} (99%)

diff --git a/arch/powerpc/platforms/8xx/ep88xc.c 
b/arch/powerpc/platforms/8xx/ep88xc.c
index 4897eda..a8dffa0 100644
--- a/arch/powerpc/platforms/8xx/ep88xc.c
+++ b/arch/powerpc/platforms/8xx/ep88xc.c
@@ -16,6 +16,7 @@
 #include asm/io.h
 #include asm/udbg.h
 #include asm/commproc.h
+#include asm/cpm1.h
 
 #include mpc8xx.h
 
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c 
b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index c0dda53..c028a5b 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -22,7 +22,7 @@
 #include asm/system.h
 #include asm/time.h
 #include asm/8xx_immap.h
-#include asm/commproc.h
+#include asm/cpm1.h
 #include asm/fs_pd.h
 #include asm/udbg.h
 
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c 
b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 3be115e..6e7ded0 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -36,7 +36,7 @@
 #include asm/time.h
 #include asm/mpc8xx.h
 #include asm/8xx_immap.h
-#include asm/commproc.h
+#include asm/cpm1.h
 #include asm/fs_pd.h
 #include asm/udbg.h
 
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index f17e7b8..928d75b 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -36,8 +36,8 @@ endif
 # Temporary hack until we have migrated to asm-powerpc
 ifeq ($(ARCH),powerpc)
 obj-$(CONFIG_CPM)  += cpm_common.o
-obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o
+obj-$(CONFIG_CPM2) += cpm2.o cpm2_pic.o
 obj-$(CONFIG_PPC_DCR)  += dcr.o
-obj-$(CONFIG_8xx)  += mpc8xx_pic.o commproc.o
+obj-$(CONFIG_8xx)  += mpc8xx_pic.o cpm1.o
 obj-$(CONFIG_UCODE_PATCH)  += micropatch.o
 endif
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/cpm1.c
similarity index 99%
rename from arch/powerpc/sysdev/commproc.c
rename to arch/powerpc/sysdev/cpm1.c
index ef82587..df8bd2b 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/cpm1.c
@@ -33,7 +33,7 @@
 #include asm/page.h
 #include asm/pgtable.h
 #include asm/8xx_immap.h
-#include asm/commproc.h
+#include asm/cpm1.h
 #include asm/io.h
 #include asm/tlbflush.h
 #include asm/rheap.h
@@ -290,7 +290,7 @@ cpm_setbrg(uint brg, uint rate)
out_be32(bp, (((BRG_UART_CLK / rate) - 1)  1) | CPM_BRG_EN);
else
out_be32(bp, (((BRG_UART_CLK_DIV16 / rate) - 1)  1) |
-CPM_BRG_EN | CPM_BRG_DIV16);
+ CPM_BRG_EN | CPM_BRG_DIV16);
 }
 
 #ifndef CONFIG_PPC_CPM_NEW_BINDING
diff --git a/arch/powerpc/sysdev/cpm2_common.c 

[PATCHv3 7/7] [POWERPC] Move definition of buffer descriptor to cpm.h

2008-01-24 Thread Jochen Friedrich
Buffer descriptors are used by both CPM1 and CPM2. Move the definitions
from the cpm dependent include file to common cpm.h

Signed-off-by: Jochen Friedrich [EMAIL PROTECTED]
---
 include/asm-powerpc/cpm.h  |   73 
 include/asm-powerpc/cpm1.h |   65 ---
 include/asm-powerpc/cpm2.h |   64 --
 3 files changed, 73 insertions(+), 129 deletions(-)

diff --git a/include/asm-powerpc/cpm.h b/include/asm-powerpc/cpm.h
index fae83b1..77e39da 100644
--- a/include/asm-powerpc/cpm.h
+++ b/include/asm-powerpc/cpm.h
@@ -4,6 +4,79 @@
 #include linux/compiler.h
 #include linux/types.h
 
+/* Buffer descriptors used by many of the CPM protocols. */
+typedef struct cpm_buf_desc {
+   ushort  cbd_sc; /* Status and Control */
+   ushort  cbd_datlen; /* Data length in buffer */
+   uintcbd_bufaddr;/* Buffer address in host memory */
+} cbd_t;
+
+/* Buffer descriptor control/status used by serial
+ */
+
+#define BD_SC_EMPTY(0x8000)/* Receive is empty */
+#define BD_SC_READY(0x8000)/* Transmit is ready */
+#define BD_SC_WRAP (0x2000)/* Last buffer descriptor */
+#define BD_SC_INTRPT   (0x1000)/* Interrupt on change */
+#define BD_SC_LAST (0x0800)/* Last buffer in frame */
+#define BD_SC_TC   (0x0400)/* Transmit CRC */
+#define BD_SC_CM   (0x0200)/* Continous mode */
+#define BD_SC_ID   (0x0100)/* Rec'd too many idles */
+#define BD_SC_P(0x0100)/* xmt preamble */
+#define BD_SC_BR   (0x0020)/* Break received */
+#define BD_SC_FR   (0x0010)/* Framing error */
+#define BD_SC_PR   (0x0008)/* Parity error */
+#define BD_SC_NAK  (0x0004)/* NAK - did not respond */
+#define BD_SC_OV   (0x0002)/* Overrun */
+#define BD_SC_UN   (0x0002)/* Underrun */
+#define BD_SC_CD   (0x0001)/* */
+#define BD_SC_CL   (0x0001)/* Collision */
+
+/* Buffer descriptor control/status used by Ethernet receive.
+ * Common to SCC and FCC.
+ */
+#define BD_ENET_RX_EMPTY   (0x8000)
+#define BD_ENET_RX_WRAP(0x2000)
+#define BD_ENET_RX_INTR(0x1000)
+#define BD_ENET_RX_LAST(0x0800)
+#define BD_ENET_RX_FIRST   (0x0400)
+#define BD_ENET_RX_MISS(0x0100)
+#define BD_ENET_RX_BC  (0x0080)/* FCC Only */
+#define BD_ENET_RX_MC  (0x0040)/* FCC Only */
+#define BD_ENET_RX_LG  (0x0020)
+#define BD_ENET_RX_NO  (0x0010)
+#define BD_ENET_RX_SH  (0x0008)
+#define BD_ENET_RX_CR  (0x0004)
+#define BD_ENET_RX_OV  (0x0002)
+#define BD_ENET_RX_CL  (0x0001)
+#define BD_ENET_RX_STATS   (0x01ff)/* All status bits */
+
+/* Buffer descriptor control/status used by Ethernet transmit.
+ * Common to SCC and FCC.
+ */
+#define BD_ENET_TX_READY   (0x8000)
+#define BD_ENET_TX_PAD (0x4000)
+#define BD_ENET_TX_WRAP(0x2000)
+#define BD_ENET_TX_INTR(0x1000)
+#define BD_ENET_TX_LAST(0x0800)
+#define BD_ENET_TX_TC  (0x0400)
+#define BD_ENET_TX_DEF (0x0200)
+#define BD_ENET_TX_HB  (0x0100)
+#define BD_ENET_TX_LC  (0x0080)
+#define BD_ENET_TX_RL  (0x0040)
+#define BD_ENET_TX_RCMASK  (0x003c)
+#define BD_ENET_TX_UN  (0x0002)
+#define BD_ENET_TX_CSL (0x0001)
+#define BD_ENET_TX_STATS   (0x03ff)/* All status bits */
+
+/* Buffer descriptor control/status used by Transparent mode SCC.
+ */
+#define BD_SCC_TX_LAST (0x0800)
+
+/* Buffer descriptor control/status used by I2C.
+ */
+#define BD_I2C_START   (0x0400)
+
 int cpm_muram_init(void);
 unsigned long cpm_muram_alloc(unsigned long size, unsigned long align);
 int cpm_muram_free(unsigned long offset);
diff --git a/include/asm-powerpc/cpm1.h b/include/asm-powerpc/cpm1.h
index 901a00b..b2ebd6a 100644
--- a/include/asm-powerpc/cpm1.h
+++ b/include/asm-powerpc/cpm1.h
@@ -91,32 +91,6 @@ extern void cpm_load_patch(cpm8xx_t *cp);
 
 extern void cpm_reset(void);
 
-/* Buffer descriptors used by many of the CPM protocols.
-*/
-typedef struct cpm_buf_desc {
-   ushort  cbd_sc; /* Status and Control */
-   ushort  cbd_datlen; /* Data length in buffer */
-   uintcbd_bufaddr;/* Buffer address in host memory */
-} cbd_t;
-
-#define BD_SC_EMPTY((ushort)0x8000)/* Receive is empty */
-#define BD_SC_READY((ushort)0x8000)/* Transmit is ready */
-#define BD_SC_WRAP ((ushort)0x2000)/* Last buffer descriptor */
-#define BD_SC_INTRPT   ((ushort)0x1000)/* Interrupt on change */
-#define BD_SC_LAST ((ushort)0x0800)/* Last buffer in frame */
-#define BD_SC_TC   ((ushort)0x0400)/* Transmit CRC */
-#define BD_SC_CM   

[PATCH 1/5] [POWERPC] qe_lib and users: get rid of most device_types and model

2008-01-24 Thread Anton Vorontsov
Now we're searching for fsl,qe, fsl,qe-muram, fsl,qe-muram-data
and fsl,qe-ic.

Unfortunately it's still impossible to remove device_type = qe
from the existing device trees (except for MPC8360E-RDK), because
older u-boots are looking for it.

Per http://ozlabs.org/pipermail/linuxppc-dev/2007-December/048388.html

Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
---
 Documentation/powerpc/booting-without-of.txt |   11 +++--
 arch/powerpc/boot/dts/mpc832x_mds.dts|9 ++--
 arch/powerpc/boot/dts/mpc832x_rdb.dts|   10 +++--
 arch/powerpc/boot/dts/mpc836x_mds.dts|   10 +++--
 arch/powerpc/boot/dts/mpc836x_rdk.dts|1 -
 arch/powerpc/boot/dts/mpc8568mds.dts |   10 +++--
 arch/powerpc/platforms/83xx/mpc832x_mds.c|   11 +++--
 arch/powerpc/platforms/83xx/mpc832x_rdb.c|   11 +++--
 arch/powerpc/platforms/83xx/mpc836x_mds.c|   11 +++--
 arch/powerpc/platforms/85xx/mpc85xx_mds.c|   32 -
 arch/powerpc/sysdev/fsl_soc.c|5 ++-
 arch/powerpc/sysdev/qe_lib/qe.c  |   63 ++
 12 files changed, 117 insertions(+), 67 deletions(-)

diff --git a/Documentation/powerpc/booting-without-of.txt 
b/Documentation/powerpc/booting-without-of.txt
index da98154..f9545b0 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1543,7 +1543,7 @@ platforms are moved over to use the flattened-device-tree 
model.
i) Root QE device
 
Required properties:
-   - device_type : should be qe;
+   - compatible : should be fsl,qe;
- model : precise model of the QE, Can be QE, CPM, or CPM2
- reg : offset and length of the device registers.
- bus-frequency : the clock frequency for QUICC Engine.
@@ -1557,8 +1557,7 @@ platforms are moved over to use the flattened-device-tree 
model.
#address-cells = 1;
#size-cells = 1;
#interrupt-cells = 2;
-   device_type = qe;
-   model = QE;
+   compatible = fsl,qe;
ranges = 0 e010 0010;
reg = e010 480;
brg-frequency = 0;
@@ -1781,7 +1780,7 @@ platforms are moved over to use the flattened-device-tree 
model.
vii) Multi-User RAM (MURAM)
 
Required properties:
-   - device_type : should be muram.
+   - compatible : should be fsl,qe-muram, fsl,cpm-muram.
- mode : the could be host or slave.
- ranges : Should be defined as specified in 1) to describe the
   translation of MURAM addresses.
@@ -1791,10 +1790,12 @@ platforms are moved over to use the 
flattened-device-tree model.
Example:
 
[EMAIL PROTECTED] {
-   device_type = muram;
+   compatible = fsl,qe-muram, fsl,cpm-muram;
ranges = 0 0001 c000;
 
[EMAIL PROTECTED]
+   compatible = fsl,qe-muram-data,
+fsl,cpm-muram-data;
reg = 0 c000;
};
};
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts 
b/arch/powerpc/boot/dts/mpc832x_mds.dts
index 6902524..e300df4 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -206,17 +206,18 @@
#size-cells = 1;
device_type = qe;
compatible = fsl,qe;
-   model = QE;
ranges = 0 e010 0010;
reg = e010 480;
brg-frequency = 0;
bus-frequency = BCD3D80;
 
[EMAIL PROTECTED] {
-   device_type = muram;
+   compatible = fsl,qe-muram, fsl,cpm-muram;
ranges = 0 0001 4000;
 
[EMAIL PROTECTED] {
+   compatible = fsl,qe-muram-data,
+fsl,cpm-muram-data;
reg = 0 4000;
};
};
@@ -320,9 +321,9 @@
};
};
 
-   qeic: [EMAIL PROTECTED] {
+   qeic: [EMAIL PROTECTED] {
interrupt-controller;
-   device_type = qeic;
+   compatible = fsl,qe-ic;
#address-cells = 0;
#interrupt-cells = 1;
reg = 80 80;
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts 
b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 10ff7aa..4d5cfd3 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -166,17 +166,19 @@
#address-cells = 1;
#size-cells = 1;
device_type = qe;
-   model = QE;
+   compatible = fsl,qe;
ranges = 0 e010 0010;
reg = e010 480;
brg-frequency = 0;
   

[PATCH 2/5] [POWERPC][NET] ucc_geth_mii and users: get rid of device_type

2008-01-24 Thread Anton Vorontsov
device_type property is bogus, thus use proper compatible.

Also change compatible property to fsl,ucc-mdio.

Per http://ozlabs.org/pipermail/linuxppc-dev/2007-December/048388.html

Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/mpc832x_mds.dts |3 +--
 arch/powerpc/boot/dts/mpc832x_rdb.dts |3 +--
 arch/powerpc/boot/dts/mpc836x_mds.dts |3 +--
 arch/powerpc/boot/dts/mpc836x_rdk.dts |3 +--
 arch/powerpc/boot/dts/mpc8568mds.dts  |2 +-
 drivers/net/ucc_geth_mii.c|3 +++
 6 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts 
b/arch/powerpc/boot/dts/mpc832x_mds.dts
index e300df4..1bb75ef 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -304,8 +304,7 @@
#address-cells = 1;
#size-cells = 0;
reg = 2320 18;
-   device_type = mdio;
-   compatible = ucc_geth_phy;
+   compatible = fsl,ucc-mdio;
 
phy3: [EMAIL PROTECTED] {
interrupt-parent =  ipic ;
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts 
b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 4d5cfd3..f6a8633 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -237,8 +237,7 @@
#address-cells = 1;
#size-cells = 0;
reg = 3120 18;
-   device_type = mdio;
-   compatible = ucc_geth_phy;
+   compatible = fsl,ucc-mdio;
 
phy00:[EMAIL PROTECTED] {
interrupt-parent = pic;
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts 
b/arch/powerpc/boot/dts/mpc836x_mds.dts
index 9a2581b..fa98bdf 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -288,8 +288,7 @@
#address-cells = 1;
#size-cells = 0;
reg = 2120 18;
-   device_type = mdio;
-   compatible = ucc_geth_phy;
+   compatible = fsl,ucc-mdio;
 
phy0: [EMAIL PROTECTED] {
interrupt-parent =  ipic ;
diff --git a/arch/powerpc/boot/dts/mpc836x_rdk.dts 
b/arch/powerpc/boot/dts/mpc836x_rdk.dts
index e244619..e299442 100644
--- a/arch/powerpc/boot/dts/mpc836x_rdk.dts
+++ b/arch/powerpc/boot/dts/mpc836x_rdk.dts
@@ -251,8 +251,7 @@
[EMAIL PROTECTED] {
#address-cells = 1;
#size-cells = 0;
-   device_type = mdio;
-   compatible = fsl,ucc-mdio, ucc_geth_phy;
+   compatible = fsl,ucc-mdio;
reg = 0x2120 0x18;
 
phy1: [EMAIL PROTECTED] {
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts 
b/arch/powerpc/boot/dts/mpc8568mds.dts
index 04f5c6f..692d5bd 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -357,7 +357,7 @@
#address-cells = 1;
#size-cells = 0;
reg = 2120 18;
-   compatible = ucc_geth_phy;
+   compatible = fsl,ucc-mdio;
 
/* These are the same PHYs as on
 * gianfar's MDIO bus */
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index df884f0..e3ba14a 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -256,6 +256,9 @@ static struct of_device_id uec_mdio_match[] = {
.type = mdio,
.compatible = ucc_geth_phy,
},
+   {
+   .compatible = fsl,ucc-mdio,
+   },
{},
 };
 
-- 
1.5.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 3/5] [POWERPC][SPI] use brg-frequency for SPI in QE

2008-01-24 Thread Anton Vorontsov
In case of QE we can use brg-frequency (which is qeclk/2).
Thus no need to divide sysclk in the spi_mpc83xx.

This patch also adds code to use get_brgfreq() on QE chips.

Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
Acked-by: David Brownell [EMAIL PROTECTED]
---
 arch/powerpc/sysdev/fsl_soc.c |   44 
 drivers/spi/spi_mpc83xx.c |6 +
 2 files changed, 32 insertions(+), 18 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 26f7d83..f4473ad 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -75,7 +75,7 @@ phys_addr_t get_immrbase(void)
 
 EXPORT_SYMBOL(get_immrbase);
 
-#if defined(CONFIG_CPM2) || defined(CONFIG_8xx)
+#if defined(CONFIG_CPM2) || defined(CONFIG_QUICC_ENGINE) || defined(CONFIG_8xx)
 
 static u32 brgfreq = -1;
 
@@ -100,11 +100,21 @@ u32 get_brgfreq(void)
 
/* Legacy device binding -- will go away when no users are left. */
node = of_find_node_by_type(NULL, cpm);
+   if (!node)
+   node = of_find_compatible_node(NULL, NULL, fsl,qe);
+   if (!node)
+   node = of_find_node_by_type(NULL, qe);
+
if (node) {
prop = of_get_property(node, brg-frequency, size);
if (prop  size == 4)
brgfreq = *prop;
 
+   if (brgfreq == -1 || brgfreq == 0) {
+   prop = of_get_property(node, bus-frequency, size);
+   if (prop  size == 4)
+   brgfreq = *prop / 2;
+   }
of_node_put(node);
}
 
@@ -1273,22 +1283,30 @@ int __init fsl_spi_init(struct spi_board_info 
*board_infos,
 {
struct device_node *np;
unsigned int i;
-   const u32 *sysclk;
+   u32 sysclk;
 
/* SPI controller is either clocked from QE or SoC clock */
-   np = of_find_compatible_node(NULL, NULL, fsl,qe);
-   if (!np)
-   np = of_find_node_by_type(NULL, qe);
+   sysclk = get_brgfreq();
+   if (sysclk == -1) {
+   const u32 *freq;
+   int size;
 
-   if (!np)
np = of_find_node_by_type(NULL, soc);
+   if (!np)
+   return -ENODEV;
+
+   freq = of_get_property(np, clock-frequency, size);
+   if (!freq || size != sizeof(*freq) || *freq == 0) {
+   freq = of_get_property(np, bus-frequency, size);
+   if (!freq || size != sizeof(*freq) || *freq == 0) {
+   of_node_put(np);
+   return -ENODEV;
+   }
+   }
 
-   if (!np)
-   return -ENODEV;
-
-   sysclk = of_get_property(np, bus-frequency, NULL);
-   if (!sysclk)
-   return -ENODEV;
+   sysclk = *freq;
+   of_node_put(np);
+   }
 
for (np = NULL, i = 1;
 (np = of_find_compatible_node(np, spi, fsl_spi)) != NULL;
@@ -1305,7 +1323,7 @@ int __init fsl_spi_init(struct spi_board_info 
*board_infos,
 
memset(res, 0, sizeof(res));
 
-   pdata.sysclk = *sysclk;
+   pdata.sysclk = sysclk;
 
prop = of_get_property(np, reg, NULL);
if (!prop)
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index 4580b9c..04f7cd9 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -436,11 +436,7 @@ static int __init mpc83xx_spi_probe(struct platform_device 
*dev)
mpc83xx_spi-qe_mode = pdata-qe_mode;
mpc83xx_spi-get_rx = mpc83xx_spi_rx_buf_u8;
mpc83xx_spi-get_tx = mpc83xx_spi_tx_buf_u8;
-
-   if (mpc83xx_spi-qe_mode)
-   mpc83xx_spi-spibrg = pdata-sysclk / 2;
-   else
-   mpc83xx_spi-spibrg = pdata-sysclk;
+   mpc83xx_spi-spibrg = pdata-sysclk;
 
mpc83xx_spi-rx_shift = 0;
mpc83xx_spi-tx_shift = 0;
-- 
1.5.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 4/5] [POWERPC] fsl_spi_init and users: stop using device_type = spi

2008-01-24 Thread Anton Vorontsov
Also:
- rename fsl_spi to fsl,spi;
- add and use cell-index property, if found;
- split probing code out of fsl_spi_init, thus we can call
  it for legacy device_type probing and new compatible probing.

Per http://ozlabs.org/pipermail/linuxppc-dev/2007-December/048388.html

Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
---
 Documentation/powerpc/booting-without-of.txt |8 +-
 arch/powerpc/boot/dts/mpc8313erdb.dts|4 +-
 arch/powerpc/boot/dts/mpc832x_mds.dts|8 +-
 arch/powerpc/boot/dts/mpc832x_rdb.dts|8 +-
 arch/powerpc/boot/dts/mpc8349emitx.dts   |4 +-
 arch/powerpc/boot/dts/mpc8349emitxgp.dts |4 +-
 arch/powerpc/boot/dts/mpc834x_mds.dts|4 +-
 arch/powerpc/boot/dts/mpc836x_mds.dts|8 +-
 arch/powerpc/boot/dts/mpc836x_rdk.dts|6 +-
 arch/powerpc/boot/dts/mpc8568mds.dts |8 +-
 arch/powerpc/sysdev/fsl_soc.c|   94 --
 11 files changed, 88 insertions(+), 68 deletions(-)

diff --git a/Documentation/powerpc/booting-without-of.txt 
b/Documentation/powerpc/booting-without-of.txt
index f9545b0..bedfdd0 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1568,8 +1568,8 @@ platforms are moved over to use the flattened-device-tree 
model.
ii) SPI (Serial Peripheral Interface)
 
Required properties:
-   - device_type : should be spi.
-   - compatible : should be fsl_spi.
+   - cell-index : SPI controller index.
+   - compatible : should be fsl,spi.
- mode : the SPI operation mode, it can be cpu or cpu-qe.
- reg : Offset and length of the register set for the device
- interrupts : a b where a is the interrupt number and b is a
@@ -1582,8 +1582,8 @@ platforms are moved over to use the flattened-device-tree 
model.
 
Example:
[EMAIL PROTECTED] {
-   device_type = spi;
-   compatible = fsl_spi;
+   cell-index = 0;
+   compatible = fsl,spi;
reg = 4c0 40;
interrupts = 82 0;
interrupt-parent = 700;
diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts 
b/arch/powerpc/boot/dts/mpc8313erdb.dts
index 9bcf2c9..20a03f5 100644
--- a/arch/powerpc/boot/dts/mpc8313erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
@@ -130,8 +130,8 @@
};
 
[EMAIL PROTECTED] {
-   device_type = spi;
-   compatible = fsl_spi;
+   cell-index = 0;
+   compatible = fsl,spi;
reg = 7000 1000;
interrupts = 10 8;
interrupt-parent =  ipic ;
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts 
b/arch/powerpc/boot/dts/mpc832x_mds.dts
index 1bb75ef..15bb345 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -223,8 +223,8 @@
};
 
[EMAIL PROTECTED] {
-   device_type = spi;
-   compatible = fsl_spi;
+   cell-index = 0;
+   compatible = fsl,spi;
reg = 4c0 40;
interrupts = 2;
interrupt-parent =  qeic ;
@@ -232,8 +232,8 @@
};
 
[EMAIL PROTECTED] {
-   device_type = spi;
-   compatible = fsl_spi;
+   cell-index = 1;
+   compatible = fsl,spi;
reg = 500 40;
interrupts = 1;
interrupt-parent =  qeic ;
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts 
b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index f6a8633..f086fac 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -184,8 +184,8 @@
};
 
[EMAIL PROTECTED] {
-   device_type = spi;
-   compatible = fsl_spi;
+   cell-index = 0;
+   compatible = fsl,spi;
reg = 4c0 40;
interrupts = 2;
interrupt-parent = qeic;
@@ -193,8 +193,8 @@
};
 
[EMAIL PROTECTED] {
-   device_type = spi;
-   compatible = fsl_spi;
+   cell-index = 1;
+   compatible = fsl,spi;
reg = 500 40;
interrupts = 1;
interrupt-parent = qeic;
diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts 
b/arch/powerpc/boot/dts/mpc8349emitx.dts
index 04b8da4..4a4ddea 100644
--- a/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -82,8 +82,8 @@
};
 
[EMAIL PROTECTED] {
-   

[PATCH 5/5] [POWERPC] fsl_soc, legacy_serial: add support for soc compatible matching

2008-01-24 Thread Anton Vorontsov
We'll match on soc compatible for generic code, and fsl,soc
for fsl specific code.

Unfortunately it's still impossible to remove device_type = soc
from the existing device tree, because older u-boots are looking for
it.

Neither we can remove model number from the soc name to heal
arch/powerpc/boot/cuboot-85xx.c, because then dts'es will be
incompatible with older u-boots again.

So, just one machine converted so far: MPC8360E-RDK. It's new machine
so we don't care about backward compatibility yet.

Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
---

I know, this patch will conflict with the legacy serial rework[1].
It's okay though, if [1] will hit galak/powerpc.git first, I'll
simply rebase that patch.

[1] http://ozlabs.org/pipermail/linuxppc-dev/2008-January/050096.html

 Documentation/powerpc/booting-without-of.txt |   18 --
 arch/powerpc/boot/dts/mpc836x_rdk.dts|1 -
 arch/powerpc/kernel/legacy_serial.c  |3 +-
 arch/powerpc/sysdev/fsl_soc.c|   51 +++---
 4 files changed, 39 insertions(+), 34 deletions(-)

diff --git a/Documentation/powerpc/booting-without-of.txt 
b/Documentation/powerpc/booting-without-of.txt
index bedfdd0..a3b6e2a 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -32,7 +32,7 @@ Table of Contents
   c) The /cpus/* nodes
   d) the /memory node(s)
   e) The /chosen node
-  f) the /socSOCname node
+  f) the /soc node
 
   IV - dtc, the device tree compiler
 
@@ -960,20 +960,16 @@ compatibility.
   under /chosen called interrupt-controller which had a phandle value
   that pointed to the main interrupt controller)
 
-  f) the /socSOCname node
+  f) the /soc node
 
   This node is used to represent a system-on-a-chip (SOC) and must be
   present if the processor is a SOC. The top-level soc node contains
-  information that is global to all devices on the SOC. The node name
-  should contain a unit address for the SOC, which is the base address
-  of the memory-mapped register set for the SOC. The name of an soc
-  node should start with soc, and the remainder of the name should
-  represent the part number for the soc.  For example, the MPC8540's
-  soc node would be called soc8540.
+  information that is global to all devices on the SOC. The name of an
+  soc node should be soc.
 
   Required properties:
 
-- device_type : Should be soc
+- compatible : Should be cpu-specific-soc, soc.
 - ranges : Should be defined as specified in 1) to describe the
   translation of SOC addresses for memory mapped SOC registers.
 - bus-frequency: Contains the bus frequency for the SOC node.
@@ -2713,11 +2709,11 @@ Note that the #address-cells and #size-cells for the 
SoC node
 in this example have been explicitly listed; these are likely
 not necessary as they are usually the same as the root node.
 
-   [EMAIL PROTECTED] {
+   [EMAIL PROTECTED] {
#address-cells = 1;
#size-cells = 1;
#interrupt-cells = 2;
-   device_type = soc;
+   compatible = fsl,mpc8540-soc, fsl,soc, soc;
ranges =  e000 0010
reg = e000 3000;
bus-frequency = 0;
diff --git a/arch/powerpc/boot/dts/mpc836x_rdk.dts 
b/arch/powerpc/boot/dts/mpc836x_rdk.dts
index 6efa5b7..ef739ee 100644
--- a/arch/powerpc/boot/dts/mpc836x_rdk.dts
+++ b/arch/powerpc/boot/dts/mpc836x_rdk.dts
@@ -58,7 +58,6 @@
[EMAIL PROTECTED] {
#address-cells = 1;
#size-cells = 1;
-   device_type = soc;
compatible = fsl,mpc8360-soc, fsl,soc, soc;
ranges = 0 0xe000 0x10;
reg = 0xe000 0x200;
diff --git a/arch/powerpc/kernel/legacy_serial.c 
b/arch/powerpc/kernel/legacy_serial.c
index 4bfff88..c99d0ae 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -309,7 +309,8 @@ void __init find_legacy_serial_ports(void)
/* First fill our array with SOC ports */
for_each_compatible_node(np, serial, ns16550) {
struct device_node *soc = of_get_parent(np);
-   if (soc  !strcmp(soc-type, soc)) {
+   if (soc  (!strcmp(soc-type, soc) ||
+   of_device_is_compatible(soc, soc))) {
index = add_legacy_soc_port(np, np);
if (index = 0  np == stdout)
legacy_serial_console = index;
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index e75fd44..96851ae 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -48,27 +48,31 @@ static phys_addr_t immrbase = -1;
 phys_addr_t get_immrbase(void)
 {
struct device_node *soc;
+   int size;
+   u32 naddr;
+   const u32 *prop;
 
if (immrbase != -1)

Re: [PATCH] UCC TDM driver for QE based MPC83xx platforms.

2008-01-24 Thread Timur Tabi
Stephen Rothwell wrote:

 +tdm_ctrl[device_num]-ut_info-uf_info.tdm_tx_clk =
 +(char *) of_get_property(np, fsl,tdm-tx-clk, NULL);
 ^
 We don't normall put spaces here.

Since when?

-- 
Timur Tabi
Linux kernel developer at Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.

2008-01-24 Thread Anton Vorontsov
Hello Poonam,

On Thu, Jan 24, 2008 at 04:00:06PM +0530, Poonam_Aggrwal-b10812 wrote:
 Thanks Stephen for your comments, incorporated them.
 From: Poonam Aggrwal [EMAIL PROTECTED]
 
 This patch makes necessary changes in the QE and UCC framework to support 
 TDM. It also adds support to configure the BRG properly through device 
 tree entries. Includes the device tree changes for UCC TDM driver as well.
 It also includes device tree entries for UCC TDM driver.
 
 Tested on MPC8323ERDB platform.
 
 Signed-off-by: Poonam Aggrwal [EMAIL PROTECTED]
 Signed-off-by: Ashish Kalra [EMAIL PROTECTED]
 Signed-off-by: Kim Phillips [EMAIL PROTECTED]
 Signed-off-by: Michael Barkowski [EMAIL PROTECTED]
 ---
  arch/powerpc/boot/dts/mpc832x_rdb.dts |   58 +++
  arch/powerpc/sysdev/qe_lib/qe.c   |  184 +--
  arch/powerpc/sysdev/qe_lib/ucc.c  |  265 
 +
  arch/powerpc/sysdev/qe_lib/ucc_fast.c |   37 +
  include/asm-powerpc/qe.h  |8 +
  include/asm-powerpc/ucc.h |4 +
  include/asm-powerpc/ucc_fast.h|4 +
  7 files changed, 548 insertions(+), 12 deletions(-)
 
 diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts 
 b/arch/powerpc/boot/dts/mpc832x_rdb.dts
 index 388c8a7..c0e6283 100644
 --- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
 +++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
 @@ -105,6 +105,17 @@
   device_type = par_io;
   num-ports = 7;
  
 + ucc1pio:[EMAIL PROTECTED] {
 + pio-map = 
 + /* port  pin  dir  open_drain  assignment  has_irq */
 + 0  e  2  0  1  0/* CLK11 */
 + 3 16  1  0  2  0/* BRG9 */
 + 3 1b  1  0  2  0/* BRG3 */
 + 0  0  3  0  2  0/* TDMATxD0 */
 + 0  4  3  0  2  0/* TDMARxD0 */
 + 3 1b  2  0  1  0;  /* CLK1 */
 + };
 +

Can we not introduce new pio-maps in the device trees? There
were debates regarding this, and if I understood everything
correctly, pio-maps considered as a bad taste. Better
do bunch of par_io_config_pin() in the board file. Better
yet fixup the firmware (u-boot) to set up dedicated pins
correctly.


Thanks,

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2/5] [POWERPC][NET] ucc_geth_mii and users: get rid of device_type

2008-01-24 Thread Kumar Gala

On Jan 24, 2008, at 9:40 AM, Anton Vorontsov wrote:

 device_type property is bogus, thus use proper compatible.

 Also change compatible property to fsl,ucc-mdio.

 Per http://ozlabs.org/pipermail/linuxppc-dev/2007-December/048388.html

 Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]

can we look at using fsl,gianfar-mdio ?  Meaning my understanding  
the programming model for the UCC mdio is identical to gianfar MDIO  
programming.

- k

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.

2008-01-24 Thread Timur Tabi
Anton Vorontsov wrote:

 Can we not introduce new pio-maps in the device trees? There
 were debates regarding this, and if I understood everything
 correctly, pio-maps considered as a bad taste. Better
 do bunch of par_io_config_pin() in the board file. Better
 yet fixup the firmware (u-boot) to set up dedicated pins
 correctly.

I'm on the fence with respect to pio-maps vs. par_io_config_pin() calls.  The 
problem is that the configuration of these pins is board-specific, but pins are 
used by devices.  A device driver can't call par_io_config_pin(), because the 
calls are different depending on which SoC and which UCC you're using.  The 
platform code can't call par_io_config_pin(), because that configuration 
depends 
on which drivers are loaded.

In other words, the pin configurations are dependent on the UCC configurations, 
and the UCC configurations are stored in the device tree.  So it makes sense to 
put the pin configurations in the device tree, too.

-- 
Timur Tabi
Linux kernel developer at Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2/5] [POWERPC][NET] ucc_geth_mii and users: get rid of device_type

2008-01-24 Thread Anton Vorontsov
On Thu, Jan 24, 2008 at 09:52:14AM -0600, Kumar Gala wrote:
 
 On Jan 24, 2008, at 9:40 AM, Anton Vorontsov wrote:
 
 device_type property is bogus, thus use proper compatible.
 
 Also change compatible property to fsl,ucc-mdio.
 
 Per http://ozlabs.org/pipermail/linuxppc-dev/2007-December/048388.html
 
 Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
 
 can we look at using fsl,gianfar-mdio ?  Meaning my understanding  
 the programming model for the UCC mdio is identical to gianfar MDIO  
 programming.

I didn't look much into gianfar mii driver, so I can't tell.

Would fsl,ucc-mdio, fsl,gianfar-mdio work for us? That way
we'll match on fsl,ucc-mdio today, and fsl,gianfar-mdio when/if
drivers are merged?

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] IB/ehca: Prevent sending UD packets to QP0

2008-01-24 Thread Joachim Fenkes
IB spec doesn't allow packets to QP0 sent on any other VL than VL15.
Hardware doesn't filter those packets on the send side, so we need to do
this in the driver and firmware.

As eHCA doesn't support QP0, we can just filter out all traffic going to
QP0, regardless of SL or VL.

Signed-off-by: Joachim Fenkes [EMAIL PROTECTED]
---
 drivers/infiniband/hw/ehca/ehca_reqs.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c 
b/drivers/infiniband/hw/ehca/ehca_reqs.c
index 3aacc8c..2ce8cff 100644
--- a/drivers/infiniband/hw/ehca/ehca_reqs.c
+++ b/drivers/infiniband/hw/ehca/ehca_reqs.c
@@ -209,6 +209,10 @@ static inline int ehca_write_swqe(struct ehca_qp *qp,
ehca_gen_err(wr.ud.ah is NULL. qp=%p, qp);
return -EINVAL;
}
+   if (unlikely(send_wr-wr.ud.remote_qpn == 0)) {
+   ehca_gen_err(dest QP# is 0. qp=%x, qp-real_qp_num);
+   return -EINVAL;
+   }
my_av = container_of(send_wr-wr.ud.ah, struct ehca_av, ib_ah);
wqe_p-u.ud_av.ud_av = my_av-av;
 
-- 
1.5.2


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] powerpc: reduce code duplication in legacy_serial, add UART parent types

2008-01-24 Thread Paul Gortmaker
The legacy_serial was treating each UART parent in a separate code block.
Rather than continue this trend for the new parent IDs, this condenses
all (soc, tsi, opb, plus two more new types) into one of_device_id array.
The new types are wrs,epld-localbus for the Wind River sbc8560, and a
more generic simple-bus as requested by Scott Wood.

Signed-off-by: Paul Gortmaker [EMAIL PROTECTED]
---
 arch/powerpc/kernel/legacy_serial.c |   45 +-
 1 files changed, 17 insertions(+), 28 deletions(-)

diff --git a/arch/powerpc/kernel/legacy_serial.c 
b/arch/powerpc/kernel/legacy_serial.c
index 4bfff88..523a9d4 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -4,6 +4,7 @@
 #include linux/serial_core.h
 #include linux/console.h
 #include linux/pci.h
+#include linux/of_device.h
 #include asm/io.h
 #include asm/mmu.h
 #include asm/prom.h
@@ -31,6 +32,15 @@ static struct legacy_serial_info {
int irq_check_parent;
phys_addr_t taddr;
 } legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS];
+
+static struct __init of_device_id parents[] = {
+   {.type = soc,},
+   {.type = tsi-bridge,},
+   {.type = opb, .compatible = ibm,opb,},
+   {.compatible = simple-bus,},
+   {.compatible = wrs,epld-localbus,},
+};
+
 static unsigned int legacy_serial_count;
 static int legacy_serial_console = -1;
 
@@ -306,18 +316,20 @@ void __init find_legacy_serial_ports(void)
DBG( no linux,stdout-path !\n);
}
 
-   /* First fill our array with SOC ports */
+   /* Iterate over all the 16550 ports, looking for known parents */
for_each_compatible_node(np, serial, ns16550) {
-   struct device_node *soc = of_get_parent(np);
-   if (soc  !strcmp(soc-type, soc)) {
+   struct device_node *parent = of_get_parent(np);
+   if (!parent)
+   continue;
+   if (of_match_node(parents, parent) != NULL) {
index = add_legacy_soc_port(np, np);
if (index = 0  np == stdout)
legacy_serial_console = index;
}
-   of_node_put(soc);
+   of_node_put(parent);
}
 
-   /* First fill our array with ISA ports */
+   /* Next, fill our array with ISA ports */
for_each_node_by_type(np, serial) {
struct device_node *isa = of_get_parent(np);
if (isa  !strcmp(isa-name, isa)) {
@@ -328,29 +340,6 @@ void __init find_legacy_serial_ports(void)
of_node_put(isa);
}
 
-   /* First fill our array with tsi-bridge ports */
-   for_each_compatible_node(np, serial, ns16550) {
-   struct device_node *tsi = of_get_parent(np);
-   if (tsi  !strcmp(tsi-type, tsi-bridge)) {
-   index = add_legacy_soc_port(np, np);
-   if (index = 0  np == stdout)
-   legacy_serial_console = index;
-   }
-   of_node_put(tsi);
-   }
-
-   /* First fill our array with opb bus ports */
-   for_each_compatible_node(np, serial, ns16550) {
-   struct device_node *opb = of_get_parent(np);
-   if (opb  (!strcmp(opb-type, opb) ||
-   of_device_is_compatible(opb, ibm,opb))) {
-   index = add_legacy_soc_port(np, np);
-   if (index = 0  np == stdout)
-   legacy_serial_console = index;
-   }
-   of_node_put(opb);
-   }
-
 #ifdef CONFIG_PCI
/* Next, try to locate PCI ports */
for (np = NULL; (np = of_find_all_nodes(np));) {
-- 
1.5.0.rc1.gf4b6c

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


DTC 1.1.0 Release!

2008-01-24 Thread Jon Loeliger
Folks,

I have tagged and released a DTC 1.1.0.

You may find it using git here:

git://www.jdl.com/software/dtc

A tarball snap-shot is also available here:

http://www.jdl.com/software/dtc-1.1.0.tgz

Please let me know if there are problems with it!

Thanks,
jdl
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.

2008-01-24 Thread Anton Vorontsov
On Thu, Jan 24, 2008 at 09:55:31AM -0600, Timur Tabi wrote:
 Anton Vorontsov wrote:
 
 Can we not introduce new pio-maps in the device trees? There
 were debates regarding this, and if I understood everything
 correctly, pio-maps considered as a bad taste. Better
 do bunch of par_io_config_pin() in the board file. Better
 yet fixup the firmware (u-boot) to set up dedicated pins
 correctly.
 
 I'm on the fence with respect to pio-maps vs. par_io_config_pin() calls.  
 The problem is that the configuration of these pins is board-specific, but 
 pins are used by devices.  A device driver can't call par_io_config_pin(), 
 because the calls are different depending on which SoC and which UCC you're 
 using.  The platform code can't call par_io_config_pin(), because that 
 configuration depends on which drivers are loaded.

Are you saying that TDM is sharing same pins with the other QE device,
and we can choose to use/not use some device depending on which driver
is loaded? I think this particular board and patch isn't that case.

Even if someday there will be the case when drivers are mutually
exclusive, i.e. presence of some driver should trigger pins
reconfiguration, then anyway this should be handled differently.

That is, we should not _register_ two mutually exclusive devices
in the first place, so drivers will not probe them. That's board
setup code authority, and pins configuration still should happen
there.

[ Irrelevant to UCCs and this particular case: lately I've
  encountered one interesting case of Par IO usage. FHCI USB needs
  switching between pin's dedicated functions and GPIO functions.
  So, firstly it is using pins as dedicated, and later (at the bus
  reset) driver turns them to act as GPIOs. This is still handled
  without pio-map though, via gpios =  property for that driver. ]

 In other words, the pin configurations are dependent on the UCC 
 configurations, and the UCC configurations are stored in the device tree.  
 So it makes sense to put the pin configurations in the device tree, too.

In that particular case UCC configuration is static, for every UCC.
So, we can set up all pins in the firmware/board file.

Please correct me if I'm wrong.

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.

2008-01-24 Thread Anton Vorontsov
On Thu, Jan 24, 2008 at 10:33:47AM -0600, Timur Tabi wrote:
 Anton Vorontsov wrote:
 
 Are you saying that TDM is sharing same pins with the other QE device,
 and we can choose to use/not use some device depending on which driver
 is loaded?
 
 No.  I'd have to closely examine the DTS, but I don't think that UCC 
 devices share pins at all.  But that isn't my point.
 
 In that particular case UCC configuration is static, for every UCC.
 So, we can set up all pins in the firmware/board file.
 
 Yes, but deciding what the UCC does might not be static.  At what point do 
 we declare, UCC5 is for eth0 and eth0 only?
 
 The advantage of putting the pin configurations in the device tree is that 
 they now become configurable.  I can envision a scenario where UCC5 could 
 be either an Ethernet or a UART, depending on the setting of some jumpers 
 on the board. That's what the QE was designed for: any UCC can do any task, 
 and you can even have a UCC change its purpose while the system is running. 
 So I don't want the pin configurations hard-coded into the kernel.  Having 
 them in the device tree gives me some flexibility.

If hardware configuration is selected at the bootup time, by jumpers
or switches, it's even easier to do it right. Without pio-map.

 For instance, I have a plan (that I keep postponing) to introduce a new 
 feature in U-Boot where U-Boot can determine the settings of some board 
 jumpers and modify the device tree accordingly. The instructions on how to 
 modify the device tree would be embedded in the tree itself.

Why you need to modify the device tree for that? Let the U-Boot simply
setup pins for the kernel. Regarding kernel overwriting pins
configuration...

 I can't 
 support this feature if the kernel calls par_io_config_pin() regardless of 
 what's in the device tree.

What I've understood from the previous debates, is that ideally kernel
should not touch pins' configuration. Today we're using pio-map solely
to fix up some old firmware misconfiguration. And we can do this in the
board file still. To determine if we need to fixup the firmware or not,
we can use some device tree property instead (firmware version?).

p.s.
I'm neither for pio-map nor against. I just want some consequence
regarding this. Last thread ended with consequence that pio-map is a
bad thing to use...

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.

2008-01-24 Thread Timur Tabi
Anton Vorontsov wrote:

 Are you saying that TDM is sharing same pins with the other QE device,
 and we can choose to use/not use some device depending on which driver
 is loaded?

No.  I'd have to closely examine the DTS, but I don't think that UCC devices 
share pins at all.  But that isn't my point.

 In that particular case UCC configuration is static, for every UCC.
 So, we can set up all pins in the firmware/board file.

Yes, but deciding what the UCC does might not be static.  At what point do we 
declare, UCC5 is for eth0 and eth0 only?

The advantage of putting the pin configurations in the device tree is that they 
now become configurable.  I can envision a scenario where UCC5 could be either 
an Ethernet or a UART, depending on the setting of some jumpers on the board. 
That's what the QE was designed for: any UCC can do any task, and you can even 
have a UCC change its purpose while the system is running.  So I don't want the 
pin configurations hard-coded into the kernel.  Having them in the device tree 
gives me some flexibility.

For instance, I have a plan (that I keep postponing) to introduce a new feature 
in U-Boot where U-Boot can determine the settings of some board jumpers and 
modify the device tree accordingly.  The instructions on how to modify the 
device tree would be embedded in the tree itself.  I can't support this feature 
if the kernel calls par_io_config_pin() regardless of what's in the device tree.

-- 
Timur Tabi
Linux kernel developer at Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v5 0/5] device_type/compatible cleanups

2008-01-24 Thread Anton Vorontsov
On Thu, Jan 24, 2008 at 06:18:50PM +0300, Anton Vorontsov wrote:
[..]
  Documentation/powerpc/booting-without-of.txt   |   26 +--
  arch/powerpc/boot/dts/mpc832x_mds.dts  |   11 -
  arch/powerpc/boot/dts/mpc832x_rdb.dts  |   11 -
  arch/powerpc/boot/dts/mpc836x_mds.dts  |   11 -
  arch/powerpc/boot/dts/mpc836x_rdk.dts  |   10 -
  arch/powerpc/boot/dts/mpc8568mds.dts   |   10 -
  arch/powerpc/sysdev/fsl_soc.c  |  191 
 +++--
  b/Documentation/powerpc/booting-without-of.txt |   11 -
  b/arch/powerpc/boot/dts/mpc8313erdb.dts|4
  b/arch/powerpc/boot/dts/mpc832x_mds.dts|9 -
  b/arch/powerpc/boot/dts/mpc832x_rdb.dts|   10 -
  b/arch/powerpc/boot/dts/mpc8349emitx.dts   |4
  b/arch/powerpc/boot/dts/mpc8349emitxgp.dts |4
  b/arch/powerpc/boot/dts/mpc834x_mds.dts|4
  b/arch/powerpc/boot/dts/mpc836x_mds.dts|   10 -
  b/arch/powerpc/boot/dts/mpc836x_rdk.dts|1
  b/arch/powerpc/boot/dts/mpc8568mds.dts |   10 -
  b/arch/powerpc/kernel/legacy_serial.c  |3
  b/arch/powerpc/platforms/83xx/mpc832x_mds.c|   11 -
  b/arch/powerpc/platforms/83xx/mpc832x_rdb.c|   11 -
  b/arch/powerpc/platforms/83xx/mpc836x_mds.c|   11 -
  b/arch/powerpc/platforms/85xx/mpc85xx_mds.c|   32 ++--
  b/arch/powerpc/sysdev/fsl_soc.c|5
  b/arch/powerpc/sysdev/qe_lib/qe.c  |   64 +---
  b/drivers/net/ucc_geth_mii.c   |4
  b/drivers/spi/spi_mpc83xx.c|   10 -
  26 files changed, 284 insertions(+), 204 deletions(-)

Heh. `git-format-patch --stdout -5 | diffstat` doesn't work correctly.
Once I've already stumbled against this, but obviously forgot.

Here is correct diffstat summary:

 Documentation/powerpc/booting-without-of.txt |   37 +++
 arch/powerpc/boot/dts/mpc8313erdb.dts|4
 arch/powerpc/boot/dts/mpc832x_mds.dts|   20 +--
 arch/powerpc/boot/dts/mpc832x_rdb.dts|   21 ++-
 arch/powerpc/boot/dts/mpc8349emitx.dts   |4
 arch/powerpc/boot/dts/mpc8349emitxgp.dts |4
 arch/powerpc/boot/dts/mpc834x_mds.dts|4
 arch/powerpc/boot/dts/mpc836x_mds.dts|   21 ++-
 arch/powerpc/boot/dts/mpc836x_rdk.dts|   11 --
 arch/powerpc/boot/dts/mpc8568mds.dts |   20 ++-
 arch/powerpc/kernel/legacy_serial.c  |3
 arch/powerpc/platforms/83xx/mpc832x_mds.c|   11 +-
 arch/powerpc/platforms/83xx/mpc832x_rdb.c|   11 +-
 arch/powerpc/platforms/83xx/mpc836x_mds.c|   11 +-
 arch/powerpc/platforms/85xx/mpc85xx_mds.c|   32 +++---
 arch/powerpc/sysdev/fsl_soc.c|  142 ++-
 arch/powerpc/sysdev/qe_lib/qe.c  |   63 ---
 drivers/net/ucc_geth_mii.c   |3
 drivers/spi/spi_mpc83xx.c|6 -
 19 files changed, 258 insertions(+), 170 deletions(-)

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v5 0/5] device_type/compatible cleanups

2008-01-24 Thread Jon Loeliger

 Heh. `git-format-patch --stdout -5 | diffstat` doesn't work correctly.
 Once I've already stumbled against this, but obviously forgot.

Might try:

git diff --stat HEAD~4

or such!

Enjoy,
jdl


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH UCC TDM 3/3 ] Modified Documentation to explain dts entries for TDM driver

2008-01-24 Thread Scott Wood
On Thu, Jan 24, 2008 at 10:24:13AM +0530, Poonam_Aggrwal-b10812 wrote:
 +  ix) Baud Rate Generator (BRG)
 +
 +  Required properties:
 +  - compatible : shpuld be fsl,cpm-brg
 +  - fsl,brg-sources : define the input clock for all 16 BRGs. The input
 +clock source could be 1 to 24 for CLK1 to CLK24. Zero means that the
 +particular BRG will be driven by QE clock(BRGCLK).

Should also have a clock-frequency property to specify what BRGCLK is.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] [POWERPC] 85xx: Port STX GP3 board over from arch/ppc

2008-01-24 Thread Scott Wood
On Thu, Jan 24, 2008 at 12:43:38AM -0600, Kumar Gala wrote:
 + d-cache-size = 0x8000;// L1, 32K
 + i-cache-size = 0x8000;// L1, 32K
 + timebase-frequency = 0x4ead9a0;
 + bus-frequency = 0x13ab6680;
 + clock-frequency = 0x312c8040;

Decimal, please.

 + [EMAIL PROTECTED] {
 + #address-cells = 1;
 + #size-cells = 1;
 + device_type = soc;
 + ranges = 0 0xfdf0 0x10;
 + reg = 0xfdf0 0x1000;

compatible = fsl,mpc8560-immr, simple-bus.
Also add simple-bus to the CPM node.

 + bus-frequency = 0x13ab6680;

Decimal, please -- if it needs to exist at all.

 @@ -49,7 +57,7 @@ config MPC8540
  config MPC8560
   bool
   select CPM2
 - default y if MPC8560_ADS
 + default y if MPC8560_ADS || STX_GP3

Can we select this from 8560 boards, instead of a default y list?

 +static struct of_device_id __initdata of_bus_ids[] = {
 + { .name = soc, },
 + { .type = soc, },
 + { .name = cpm, },
 + { .name = localbus, },
 + {},
 +};

compatible = simple-bus.

 +/*
 + * Called very early, device-tree isn't unflattened
 + */
 +static int __init stx_gp3_probe(void)
 +{
 +unsigned long root = of_get_flat_dt_root();
 +
 +return of_flat_dt_is_compatible(root, stx,gp3-8560);
 +}

Tabs, not spaces.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.

2008-01-24 Thread Scott Wood
On Thu, Jan 24, 2008 at 10:33:47AM -0600, Timur Tabi wrote: Yes, but
 deciding what the UCC does might not be static.  At what point do we
 declare, UCC5 is for eth0 and eth0 only?

When the board designer decides to hook eth0 up to UCC5.

If the board designer decides to hook multiple devices up to UCC5, we first
smack the board designer, and then set it up to whichever configuration has
been jumpered.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] [POWERPC] MPC8360E-RDK: device tree, board file and defconfig

2008-01-24 Thread Stephen Rothwell
Hi Anton,

On Thu, 24 Jan 2008 16:29:01 +0300 Anton Vorontsov [EMAIL PROTECTED] wrote:

 On Thu, Jan 24, 2008 at 01:22:01PM +1100, Stephen Rothwell wrote:
  On Wed, 23 Jan 2008 23:45:07 +0300 Anton Vorontsov [EMAIL PROTECTED] 
  wrote:
  
   +++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
   +static int __init mpc836x_rdk_declare_of_platform_devices(void)
   +{
   + const struct of_device_id mpc836x_rdk_ids[] = {
  
  Please change this to static, __initdata and not const, thanks. These
  arrays are usually defined outside a function, but that is not really a
  problem.
 
 Pity... we don't need these _ids anywhere outside that function. But
 looking into objdump output I see the problem now.
 
 Will change this back, thanks.
 
   +static void __init mpc836x_rdk_setup_arch(void)
   +{
   + struct device_node *np;
  
  !defined(CONFIG_PCI)  !defined(CONFIG_QUICC_ENGINE) will produce a
  warning here.
 
 Good catch, thanks.
 
   + if (ppc_md.progress)
   + ppc_md.progress(mpc836x_rdk_setup_arch(), 0);
   +
   +#ifdef CONFIG_PCI
   + for_each_compatible_node(np, pci, fsl,mpc8349-pci)
   + mpc83xx_add_bridge(np);
   +#endif
   +
   +#ifdef CONFIG_QUICC_ENGINE
   + qe_reset();
   +
   + np = of_find_compatible_node(NULL, NULL, fsl,qe-pario);
   + if (!np) {
   + pr_warning(QE PIO not initialized!\n);
   + return;
  
  You need an of_node_put(np) before the return.
 
 Hm, really? I think I don't. But if you insist... :-)

Sorry, I don't know what I was thinking - of course you don't need it.

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/


pgpQs6TYRZlOF.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [i2c] [PATCH] mpc i2c driver, compare to NO_IRQ instead of zero

2008-01-24 Thread Jon Smirl
Ben, do you approve of this? How should error be checked for, is
NO_IRQ right? The current code in the kernel looks to be broken
because of these checks, the ppc build is wrong and powerpc polled
mode doesn't work.

On 1/21/08, Jon Smirl [EMAIL PROTECTED] wrote:
 Alter the mpc i2c driver to use the NO_IRQ symbol instead of the constant 
 zero when checking for valid interrupts. NO_IRQ=-1 on ppc and NO_IRQ=0 on 
 powerpc so the checks against zero are not correct.

 Signed-off-by: Jon Smirl [EMAIL PROTECTED]
 ---

  drivers/i2c/busses/i2c-mpc.c |   10 +-
  1 files changed, 5 insertions(+), 5 deletions(-)


 diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
 index bbe787b..d20959d 100644
 --- a/drivers/i2c/busses/i2c-mpc.c
 +++ b/drivers/i2c/busses/i2c-mpc.c
 @@ -99,7 +99,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, 
 int writing)
 u32 x;
 int result = 0;

 -   if (i2c-irq == 0)
 +   if (i2c-irq == NO_IRQ)
 {
 while (!(readb(i2c-base + MPC_I2C_SR)  CSR_MIF)) {
 schedule();
 @@ -329,7 +329,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
 return -ENOMEM;

 i2c-irq = platform_get_irq(pdev, 0);
 -   if (i2c-irq  0) {
 +   if (i2c-irq  NO_IRQ) {
 result = -ENXIO;
 goto fail_get_irq;
 }
 @@ -344,7 +344,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
 goto fail_map;
 }

 -   if (i2c-irq != 0)
 +   if (i2c-irq != NO_IRQ)
 if ((result = request_irq(i2c-irq, mpc_i2c_isr,
   IRQF_SHARED, i2c-mpc, i2c))  0) {
 printk(KERN_ERR
 @@ -367,7 +367,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
 return result;

fail_add:
 -   if (i2c-irq != 0)
 +   if (i2c-irq != NO_IRQ)
 free_irq(i2c-irq, i2c);
fail_irq:
 iounmap(i2c-base);
 @@ -384,7 +384,7 @@ static int fsl_i2c_remove(struct platform_device *pdev)
 i2c_del_adapter(i2c-adap);
 platform_set_drvdata(pdev, NULL);

 -   if (i2c-irq != 0)
 +   if (i2c-irq != NO_IRQ)
 free_irq(i2c-irq, i2c);

 iounmap(i2c-base);


 ___
 i2c mailing list
 [EMAIL PROTECTED]
 http://lists.lm-sensors.org/mailman/listinfo/i2c



-- 
Jon Smirl
[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [i2c] [PATCH] mpc i2c driver, compare to NO_IRQ instead of zero

2008-01-24 Thread Benjamin Herrenschmidt

On Thu, 2008-01-24 at 17:32 -0500, Jon Smirl wrote:
 Ben, do you approve of this? How should error be checked for, is
 NO_IRQ right? The current code in the kernel looks to be broken
 because of these checks, the ppc build is wrong and powerpc polled
 mode doesn't work.

 == 0 should work on powerpc since NO_IRQ is defined to be 0 there no ?

Anyway, using the symbolic constant is always nicer I suppose.

Ben.

 On 1/21/08, Jon Smirl [EMAIL PROTECTED] wrote:
  Alter the mpc i2c driver to use the NO_IRQ symbol instead of the constant 
  zero when checking for valid interrupts. NO_IRQ=-1 on ppc and NO_IRQ=0 on 
  powerpc so the checks against zero are not correct.
 
  Signed-off-by: Jon Smirl [EMAIL PROTECTED]
  ---
 
   drivers/i2c/busses/i2c-mpc.c |   10 +-
   1 files changed, 5 insertions(+), 5 deletions(-)
 
 
  diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
  index bbe787b..d20959d 100644
  --- a/drivers/i2c/busses/i2c-mpc.c
  +++ b/drivers/i2c/busses/i2c-mpc.c
  @@ -99,7 +99,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned 
  timeout, int writing)
  u32 x;
  int result = 0;
 
  -   if (i2c-irq == 0)
  +   if (i2c-irq == NO_IRQ)
  {
  while (!(readb(i2c-base + MPC_I2C_SR)  CSR_MIF)) {
  schedule();
  @@ -329,7 +329,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
  return -ENOMEM;
 
  i2c-irq = platform_get_irq(pdev, 0);
  -   if (i2c-irq  0) {
  +   if (i2c-irq  NO_IRQ) {
  result = -ENXIO;
  goto fail_get_irq;
  }
  @@ -344,7 +344,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
  goto fail_map;
  }
 
  -   if (i2c-irq != 0)
  +   if (i2c-irq != NO_IRQ)
  if ((result = request_irq(i2c-irq, mpc_i2c_isr,
IRQF_SHARED, i2c-mpc, i2c))  
  0) {
  printk(KERN_ERR
  @@ -367,7 +367,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
  return result;
 
 fail_add:
  -   if (i2c-irq != 0)
  +   if (i2c-irq != NO_IRQ)
  free_irq(i2c-irq, i2c);
 fail_irq:
  iounmap(i2c-base);
  @@ -384,7 +384,7 @@ static int fsl_i2c_remove(struct platform_device *pdev)
  i2c_del_adapter(i2c-adap);
  platform_set_drvdata(pdev, NULL);
 
  -   if (i2c-irq != 0)
  +   if (i2c-irq != NO_IRQ)
  free_irq(i2c-irq, i2c);
 
  iounmap(i2c-base);
 
 
  ___
  i2c mailing list
  [EMAIL PROTECTED]
  http://lists.lm-sensors.org/mailman/listinfo/i2c
 
 
 

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: reduce code duplication in legacy_serial, add UART parent types

2008-01-24 Thread Paul Gortmaker
In message: [PATCH] powerpc: reduce code duplication in legacy_serial, add UART 
parent types
on 24/01/2008 Paul Gortmaker wrote:

 @@ -31,6 +32,15 @@ static struct legacy_serial_info {
   int irq_check_parent;
   phys_addr_t taddr;
  } legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS];
 +
 +static struct __init of_device_id parents[] = {

Oops, that should have been __initdata to be 100% correct...

P.

---


From: Paul Gortmaker [EMAIL PROTECTED]
Date: Thu, 24 Jan 2008 11:59:12 -0500
Subject: [PATCH] powerpc: reduce code duplication in legacy_serial, add UART 
parent types

The legacy_serial was treating each UART parent in a separate code block.
Rather than continue this trend for the new parent IDs, this condenses
all (soc, tsi, opb, plus two more new types) into one of_device_id array.
The new types are wrs,epld-localbus for the Wind River sbc8560, and a
more generic simple-bus as requested by Scott Wood.

Signed-off-by: Paul Gortmaker [EMAIL PROTECTED]
---
 arch/powerpc/kernel/legacy_serial.c |   45 +-
 1 files changed, 17 insertions(+), 28 deletions(-)

diff --git a/arch/powerpc/kernel/legacy_serial.c 
b/arch/powerpc/kernel/legacy_serial.c
index 4bfff88..76b862b 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -4,6 +4,7 @@
 #include linux/serial_core.h
 #include linux/console.h
 #include linux/pci.h
+#include linux/of_device.h
 #include asm/io.h
 #include asm/mmu.h
 #include asm/prom.h
@@ -31,6 +32,15 @@ static struct legacy_serial_info {
int irq_check_parent;
phys_addr_t taddr;
 } legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS];
+
+static struct __initdata of_device_id parents[] = {
+   {.type = soc,},
+   {.type = tsi-bridge,},
+   {.type = opb, .compatible = ibm,opb,},
+   {.compatible = simple-bus,},
+   {.compatible = wrs,epld-localbus,},
+};
+
 static unsigned int legacy_serial_count;
 static int legacy_serial_console = -1;
 
@@ -306,18 +316,20 @@ void __init find_legacy_serial_ports(void)
DBG( no linux,stdout-path !\n);
}
 
-   /* First fill our array with SOC ports */
+   /* Iterate over all the 16550 ports, looking for known parents */
for_each_compatible_node(np, serial, ns16550) {
-   struct device_node *soc = of_get_parent(np);
-   if (soc  !strcmp(soc-type, soc)) {
+   struct device_node *parent = of_get_parent(np);
+   if (!parent)
+   continue;
+   if (of_match_node(parents, parent) != NULL) {
index = add_legacy_soc_port(np, np);
if (index = 0  np == stdout)
legacy_serial_console = index;
}
-   of_node_put(soc);
+   of_node_put(parent);
}
 
-   /* First fill our array with ISA ports */
+   /* Next, fill our array with ISA ports */
for_each_node_by_type(np, serial) {
struct device_node *isa = of_get_parent(np);
if (isa  !strcmp(isa-name, isa)) {
@@ -328,29 +340,6 @@ void __init find_legacy_serial_ports(void)
of_node_put(isa);
}
 
-   /* First fill our array with tsi-bridge ports */
-   for_each_compatible_node(np, serial, ns16550) {
-   struct device_node *tsi = of_get_parent(np);
-   if (tsi  !strcmp(tsi-type, tsi-bridge)) {
-   index = add_legacy_soc_port(np, np);
-   if (index = 0  np == stdout)
-   legacy_serial_console = index;
-   }
-   of_node_put(tsi);
-   }
-
-   /* First fill our array with opb bus ports */
-   for_each_compatible_node(np, serial, ns16550) {
-   struct device_node *opb = of_get_parent(np);
-   if (opb  (!strcmp(opb-type, opb) ||
-   of_device_is_compatible(opb, ibm,opb))) {
-   index = add_legacy_soc_port(np, np);
-   if (index = 0  np == stdout)
-   legacy_serial_console = index;
-   }
-   of_node_put(opb);
-   }
-
 #ifdef CONFIG_PCI
/* Next, try to locate PCI ports */
for (np = NULL; (np = of_find_all_nodes(np));) {
-- 
1.5.0.rc1.gf4b6c




___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] [POWERPC] Add a cuboot wrapper for 85xx w/CPM2

2008-01-24 Thread Kumar Gala
The bd info struct changes if we have CPM2 enabled in u-boot.

---
 arch/powerpc/boot/Makefile   |6 +++-
 arch/powerpc/boot/cuboot-85xx-cpm2.c |   61 ++
 2 files changed, 66 insertions(+), 1 deletions(-)
 create mode 100644 arch/powerpc/boot/cuboot-85xx-cpm2.c

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 1e20aca..1a42970 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -62,7 +62,8 @@ src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c 
cuboot-85xx.c holly.c
ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c 
\
fixed-head.S ep88xc.c cuboot-hpc2.c ep405.c cuboot-taishan.c \
-   cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c
+   cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \
+   cuboot-85xx-cpm2.c
 src-boot := $(src-wlib) $(src-plat) empty.c

 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -200,6 +201,9 @@ image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx
 image-$(CONFIG_STORCENTER) += cuImage.824x
 image-$(CONFIG_PPC_83xx)   += cuImage.83xx
 image-$(CONFIG_PPC_85xx)   += cuImage.85xx
+ifeq ($(CONFIG_CPM2),y)
+image-$(CONFIG_PPC_85xx)   += cuImage.85xx-cpm2
+endif
 image-$(CONFIG_MPC7448HPC2)+= cuImage.hpc2
 image-$(CONFIG_EBONY)  += treeImage.ebony cuImage.ebony
 image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo
diff --git a/arch/powerpc/boot/cuboot-85xx-cpm2.c 
b/arch/powerpc/boot/cuboot-85xx-cpm2.c
new file mode 100644
index 000..e2616f2
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-85xx-cpm2.c
@@ -0,0 +1,61 @@
+/*
+ * Old U-boot compatibility for 85xx
+ *
+ * Author: Scott Wood [EMAIL PROTECTED]
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include ops.h
+#include stdio.h
+#include cuboot.h
+
+#define TARGET_85xx
+#define TARGET_CPM2
+#include ppcboot.h
+
+static bd_t bd;
+
+static void platform_fixups(void)
+{
+   void *soc;
+
+   dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
+   dt_fixup_mac_address_by_alias(ethernet0, bd.bi_enetaddr);
+   dt_fixup_mac_address_by_alias(ethernet1, bd.bi_enet1addr);
+   dt_fixup_mac_address_by_alias(ethernet2, bd.bi_enet2addr);
+   dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 8, bd.bi_busfreq);
+
+   /* Unfortunately, the specific model number is encoded in the
+* soc node name in existing dts files -- once that is fixed,
+* this can do a simple path lookup.
+*/
+   soc = find_node_by_devtype(NULL, soc);
+   if (soc) {
+   void *serial = NULL;
+
+   setprop(soc, bus-frequency, bd.bi_busfreq,
+   sizeof(bd.bi_busfreq));
+
+   while ((serial = find_node_by_devtype(serial, serial))) {
+   if (get_parent(serial) != soc)
+   continue;
+
+   setprop(serial, clock-frequency, bd.bi_busfreq,
+   sizeof(bd.bi_busfreq));
+   }
+   }
+}
+
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+   unsigned long r6, unsigned long r7)
+{
+   CUBOOT_INIT();
+   fdt_init(_dtb_start);
+   serial_console_init();
+   platform_ops.fixups = platform_fixups;
+}
-- 
1.5.3.7

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [i2c] [PATCH] mpc i2c driver, compare to NO_IRQ instead of zero

2008-01-24 Thread Jon Smirl
On 1/24/08, Benjamin Herrenschmidt [EMAIL PROTECTED] wrote:

 On Thu, 2008-01-24 at 17:32 -0500, Jon Smirl wrote:
  Ben, do you approve of this? How should error be checked for, is
  NO_IRQ right? The current code in the kernel looks to be broken
  because of these checks, the ppc build is wrong and powerpc polled
  mode doesn't work.

  == 0 should work on powerpc since NO_IRQ is defined to be 0 there no ?

The driver being patched is used in both the powerpc and ppc builds.


 Anyway, using the symbolic constant is always nicer I suppose.

 Ben.

  On 1/21/08, Jon Smirl [EMAIL PROTECTED] wrote:
   Alter the mpc i2c driver to use the NO_IRQ symbol instead of the constant 
   zero when checking for valid interrupts. NO_IRQ=-1 on ppc and NO_IRQ=0 on 
   powerpc so the checks against zero are not correct.
  
   Signed-off-by: Jon Smirl [EMAIL PROTECTED]
   ---
  
drivers/i2c/busses/i2c-mpc.c |   10 +-
1 files changed, 5 insertions(+), 5 deletions(-)
  
  
   diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
   index bbe787b..d20959d 100644
   --- a/drivers/i2c/busses/i2c-mpc.c
   +++ b/drivers/i2c/busses/i2c-mpc.c
   @@ -99,7 +99,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned 
   timeout, int writing)
   u32 x;
   int result = 0;
  
   -   if (i2c-irq == 0)
   +   if (i2c-irq == NO_IRQ)
   {
   while (!(readb(i2c-base + MPC_I2C_SR)  CSR_MIF)) {
   schedule();
   @@ -329,7 +329,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
   return -ENOMEM;
  
   i2c-irq = platform_get_irq(pdev, 0);
   -   if (i2c-irq  0) {
   +   if (i2c-irq  NO_IRQ) {
   result = -ENXIO;
   goto fail_get_irq;
   }
   @@ -344,7 +344,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
   goto fail_map;
   }
  
   -   if (i2c-irq != 0)
   +   if (i2c-irq != NO_IRQ)
   if ((result = request_irq(i2c-irq, mpc_i2c_isr,
 IRQF_SHARED, i2c-mpc, i2c))  
   0) {
   printk(KERN_ERR
   @@ -367,7 +367,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
   return result;
  
  fail_add:
   -   if (i2c-irq != 0)
   +   if (i2c-irq != NO_IRQ)
   free_irq(i2c-irq, i2c);
  fail_irq:
   iounmap(i2c-base);
   @@ -384,7 +384,7 @@ static int fsl_i2c_remove(struct platform_device 
   *pdev)
   i2c_del_adapter(i2c-adap);
   platform_set_drvdata(pdev, NULL);
  
   -   if (i2c-irq != 0)
   +   if (i2c-irq != NO_IRQ)
   free_irq(i2c-irq, i2c);
  
   iounmap(i2c-base);
  
  
   ___
   i2c mailing list
   [EMAIL PROTECTED]
   http://lists.lm-sensors.org/mailman/listinfo/i2c
  
 
 




-- 
Jon Smirl
[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 0/10] Support for SBC834x/8548/8560 Wind River Boards

2008-01-24 Thread Paul Gortmaker

This series contains the patches for the Wind River SBC834x, SBC8548 and
SBC8560, grouped together for merge convenience.

Changes since previous:

sbc834x:
- machine_device_initcall as per Kumar's recent commit 6392f184
- remove four device_type from dts that DavidG wanted gone.
- add of_node_put() and __initdata as per StephenR's suggestions.

sbc8548:
- fold the dts, and conversion to dts-v1, into a single commit

sbc8560:
- dts has localbus with 2 address cells (chipsel) and epld as child
- UART detection legacy_serial patch separated out from 8560 patches
- fold the dts, and conversion to dts-v1, into a single commit

I've boot tested these all on for-2.6.25 to make sure things are sane.
Thanks again to those who have suggested improvements and changes.

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/10] sbc8560: add support for Wind River SBC8560 in arch/powerpc

2008-01-24 Thread Paul Gortmaker
This adds support for the Wind River SBC8560 board, implemented as
powerpc.  It closely follows the implementation of the MPC8560ADS.

Signed-off-by: Paul Gortmaker [EMAIL PROTECTED]
---
 arch/powerpc/platforms/85xx/Kconfig   |   11 +-
 arch/powerpc/platforms/85xx/Makefile  |1 +
 arch/powerpc/platforms/85xx/sbc8560.c |  285 +
 3 files changed, 295 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/Kconfig 
b/arch/powerpc/platforms/85xx/Kconfig
index 7748a3a..0eb497b 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -38,6 +38,13 @@ config MPC85xx_DS
help
  This option enables support for the MPC85xx DS (MPC8544 DS) board
 
+config SBC8560
+   bool Wind River SBC8560
+   select DEFAULT_UIMAGE
+   select PPC_CPM_NEW_BINDING
+   help
+ This option enables support for the Wind River SBC8560 board
+
 endchoice
 
 config MPC8540
@@ -49,7 +56,7 @@ config MPC8540
 config MPC8560
bool
select CPM2
-   default y if MPC8560_ADS
+   default y if MPC8560_ADS || SBC8560
 
 config MPC85xx
bool
@@ -59,4 +66,4 @@ config MPC85xx
select FSL_PCI if PCI
select SERIAL_8250_SHARE_IRQ if SERIAL_8250
default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \
-   || MPC85xx_MDS || MPC85xx_DS
+   || MPC85xx_MDS || MPC85xx_DS || SBC8560
diff --git a/arch/powerpc/platforms/85xx/Makefile 
b/arch/powerpc/platforms/85xx/Makefile
index 5eca920..c3f4d01 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -6,3 +6,4 @@ obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
 obj-$(CONFIG_MPC85xx_DS)  += mpc85xx_ds.o
 obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o
+obj-$(CONFIG_SBC8560) += sbc8560.o
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c 
b/arch/powerpc/platforms/85xx/sbc8560.c
new file mode 100644
index 000..e2bc368
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/sbc8560.c
@@ -0,0 +1,285 @@
+/*
+ * Wind River SBC8560 setup and early boot code.
+ *
+ * Copyright 2007 Wind River Systems Inc.
+ *
+ * By Paul Gortmaker (see MAINTAINERS for contact information)
+ *
+ * Based largely on the MPC8560ADS support - Copyright 2005 Freescale Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include linux/stddef.h
+#include linux/kernel.h
+#include linux/pci.h
+#include linux/kdev_t.h
+#include linux/delay.h
+#include linux/seq_file.h
+#include linux/of_platform.h
+
+#include asm/system.h
+#include asm/time.h
+#include asm/machdep.h
+#include asm/pci-bridge.h
+#include asm/mpic.h
+#include mm/mmu_decl.h
+#include asm/udbg.h
+
+#include sysdev/fsl_soc.h
+#include sysdev/fsl_pci.h
+
+#ifdef CONFIG_CPM2
+#include asm/cpm2.h
+#include sysdev/cpm2_pic.h
+#endif
+
+#ifdef CONFIG_CPM2
+
+static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
+{
+   int cascade_irq;
+
+   while ((cascade_irq = cpm2_get_irq()) = 0)
+   generic_handle_irq(cascade_irq);
+
+   desc-chip-eoi(irq);
+}
+
+#endif /* CONFIG_CPM2 */
+
+static void __init sbc8560_pic_init(void)
+{
+   struct mpic *mpic;
+   struct resource r;
+   struct device_node *np = NULL;
+#ifdef CONFIG_CPM2
+   int irq;
+#endif
+
+   np = of_find_node_by_type(np, open-pic);
+   if (!np) {
+   printk(KERN_ERR Could not find open-pic node\n);
+   return;
+   }
+
+   if (of_address_to_resource(np, 0, r)) {
+   printk(KERN_ERR Could not map mpic register space\n);
+   of_node_put(np);
+   return;
+   }
+
+   mpic = mpic_alloc(np, r.start,
+   MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
+   0, 256,  OpenPIC  );
+   BUG_ON(mpic == NULL);
+   of_node_put(np);
+
+   mpic_init(mpic);
+
+#ifdef CONFIG_CPM2
+   /* Setup CPM2 PIC */
+   np = of_find_compatible_node(NULL, NULL, fsl,cpm2-pic);
+   if (np == NULL) {
+   printk(KERN_ERR PIC init: can not find fsl,cpm2-pic node\n);
+   return;
+   }
+   irq = irq_of_parse_and_map(np, 0);
+
+   cpm2_pic_init(np);
+   of_node_put(np);
+   set_irq_chained_handler(irq, cpm2_cascade);
+#endif
+}
+
+/*
+ * Setup the architecture
+ */
+#ifdef CONFIG_CPM2
+struct cpm_pin {
+   int port, pin, flags;
+};
+
+static const struct cpm_pin sbc8560_pins[] = {
+   /* SCC1 */
+   {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
+   {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
+   {3, 31, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
+
+   /* SCC2 */
+   {3, 26, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
+   {3, 27, 

[PATCH 2/10] sbc8560: Add v1 device tree source for Wind River SBC8560 board

2008-01-24 Thread Paul Gortmaker
This adds a v1 device tree source for the Wind River SBC8560 board.  The
biggest difference between this and the MPC8560ADS reference platform
dts is the use of an external 16550 compatible UART instead of the CPM2.

Signed-off-by: Paul Gortmaker [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/sbc8560.dts |  330 +
 1 files changed, 330 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/sbc8560.dts 
b/arch/powerpc/boot/dts/sbc8560.dts
new file mode 100644
index 000..0476802
--- /dev/null
+++ b/arch/powerpc/boot/dts/sbc8560.dts
@@ -0,0 +1,330 @@
+/*
+ * SBC8560 Device Tree Source
+ *
+ * Copyright 2007 Wind River Systems Inc.
+ *
+ * Paul Gortmaker (see MAINTAINERS for contact information)
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/dts-v1/;
+
+/ {
+   model = SBC8560;
+   compatible = SBC8560;
+   #address-cells = 1;
+   #size-cells = 1;
+
+   aliases {
+   ethernet0 = enet0;
+   ethernet1 = enet1;
+   ethernet2 = enet2;
+   ethernet3 = enet3;
+   serial0 = serial0;
+   serial1 = serial1;
+   pci0 = pci0;
+   };
+
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   PowerPC,[EMAIL PROTECTED] {
+   device_type = cpu;
+   reg = 0;
+   d-cache-line-size = 0x20; // 32 bytes
+   i-cache-line-size = 0x20; // 32 bytes
+   d-cache-size = 0x8000;// L1, 32K
+   i-cache-size = 0x8000;// L1, 32K
+   timebase-frequency = 0;   // From uboot
+   bus-frequency = 0;
+   clock-frequency = 0;
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0x 0x2000;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 1;
+   device_type = soc;
+   ranges = 0x0 0xff70 0x0010;
+   reg = 0xff70 0x0010;
+   clock-frequency = 0;
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,8560-memory-controller;
+   reg = 0x2000 0x1000;
+   interrupt-parent = mpic;
+   interrupts = 0x12 0x2;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,8560-l2-cache-controller;
+   reg = 0x2 0x1000;
+   cache-line-size = 0x20;   // 32 bytes
+   cache-size = 0x4; // L2, 256K
+   interrupt-parent = mpic;
+   interrupts = 0x10 0x2;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 0;
+   cell-index = 0;
+   compatible = fsl-i2c;
+   reg = 0x3000 0x100;
+   interrupts = 0x2b 0x2;
+   interrupt-parent = mpic;
+   dfsrr;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 0;
+   cell-index = 1;
+   compatible = fsl-i2c;
+   reg = 0x3100 0x100;
+   interrupts = 0x2b 0x2;
+   interrupt-parent = mpic;
+   dfsrr;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = fsl,gianfar-mdio;
+   reg = 0x24520 0x20;
+   phy0: [EMAIL PROTECTED] {
+   interrupt-parent = mpic;
+   interrupts = 0x6 0x1;
+   reg = 0x19;
+   device_type = ethernet-phy;
+   };
+   phy1: [EMAIL PROTECTED] {
+   interrupt-parent = mpic;
+   interrupts = 0x7 0x1;
+   reg = 0x1a;
+   device_type = ethernet-phy;
+   };
+   phy2: [EMAIL PROTECTED] {
+   interrupt-parent = mpic;
+   interrupts = 0x8 0x1;
+   reg = 0x1b;
+   device_type = ethernet-phy;
+ 

[PATCH 3/10] CPM2: Make support for the CPM2 optional on 8560 based boards

2008-01-24 Thread Paul Gortmaker
Currently there is no way to disable the CPM2 support.  Some boards,
like the SBC8560 have their own external UART and don't have any direct
dependencies on the CPM for a serial console or anything else.

Signed-off-by: Paul Gortmaker [EMAIL PROTECTED]
---
 arch/powerpc/platforms/85xx/Kconfig |4 ++--
 arch/powerpc/platforms/Kconfig  |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/Kconfig 
b/arch/powerpc/platforms/85xx/Kconfig
index 0eb497b..33d3bea 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -13,6 +13,7 @@ config MPC8560_ADS
bool Freescale MPC8560 ADS
select DEFAULT_UIMAGE
select PPC_CPM_NEW_BINDING
+   select CPM2
help
  This option enables support for the MPC 8560 ADS board
 
@@ -41,7 +42,7 @@ config MPC85xx_DS
 config SBC8560
bool Wind River SBC8560
select DEFAULT_UIMAGE
-   select PPC_CPM_NEW_BINDING
+   select PPC_CPM_NEW_BINDING if CPM2
help
  This option enables support for the Wind River SBC8560 board
 
@@ -55,7 +56,6 @@ config MPC8540
 
 config MPC8560
bool
-   select CPM2
default y if MPC8560_ADS || SBC8560
 
 config MPC85xx
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 2cec343..27b74e9 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -278,8 +278,8 @@ config QUICC_ENGINE
  for a machine with a QE coprocessor.
 
 config CPM2
-   bool
-   default n
+   bool Enable support for the CPM2 (Communications Processor Module)
+   depends on MPC8560 || 8260
select CPM
select PPC_LIB_RHEAP
help
-- 
1.5.0.rc1.gf4b6c

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 5/10] sbc8548: Add basic support for Wind River SBC8548 as powerpc

2008-01-24 Thread Paul Gortmaker
This adds the basic support for the Wind River SBC8548 board, implemented
as powerpc.  It closely follows the implementation of the MPC8548CDS.

Signed-off-by: Paul Gortmaker [EMAIL PROTECTED]
---
 arch/powerpc/platforms/85xx/Kconfig   |   10 ++-
 arch/powerpc/platforms/85xx/Makefile  |1 +
 arch/powerpc/platforms/85xx/sbc8548.c |  169 +
 3 files changed, 178 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/Kconfig 
b/arch/powerpc/platforms/85xx/Kconfig
index 33d3bea..8407f43 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -39,6 +39,12 @@ config MPC85xx_DS
help
  This option enables support for the MPC85xx DS (MPC8544 DS) board
 
+config SBC8548
+   bool Wind River SBC8548
+   select DEFAULT_UIMAGE
+   help
+ This option enables support for the Wind River SBC8548 board
+
 config SBC8560
bool Wind River SBC8560
select DEFAULT_UIMAGE
@@ -52,7 +58,7 @@ config MPC8540
bool
select PPC_UDBG_16550
select PPC_INDIRECT_PCI
-   default y if MPC8540_ADS || MPC85xx_CDS
+   default y if MPC8540_ADS || MPC85xx_CDS || SBC8548
 
 config MPC8560
bool
@@ -66,4 +72,4 @@ config MPC85xx
select FSL_PCI if PCI
select SERIAL_8250_SHARE_IRQ if SERIAL_8250
default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \
-   || MPC85xx_MDS || MPC85xx_DS || SBC8560
+   || MPC85xx_MDS || MPC85xx_DS || SBC8560 || SBC8548
diff --git a/arch/powerpc/platforms/85xx/Makefile 
b/arch/powerpc/platforms/85xx/Makefile
index c3f4d01..3a47b7a 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -6,4 +6,5 @@ obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
 obj-$(CONFIG_MPC85xx_DS)  += mpc85xx_ds.o
 obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o
+obj-$(CONFIG_SBC8548) += sbc8548.o
 obj-$(CONFIG_SBC8560) += sbc8560.o
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c 
b/arch/powerpc/platforms/85xx/sbc8548.c
new file mode 100644
index 000..de27b57
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -0,0 +1,169 @@
+/*
+ * Wind River SBC8548 setup and early boot code.
+ *
+ * Copyright 2007 Wind River Systems Inc.
+ *
+ * By Paul Gortmaker (see MAINTAINERS for contact information)
+ *
+ * Based largely on the MPC8548CDS support - Copyright 2005 Freescale Inc.
+ *
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include linux/stddef.h
+#include linux/kernel.h
+#include linux/init.h
+#include linux/errno.h
+#include linux/reboot.h
+#include linux/pci.h
+#include linux/kdev_t.h
+#include linux/major.h
+#include linux/console.h
+#include linux/delay.h
+#include linux/seq_file.h
+#include linux/initrd.h
+#include linux/module.h
+#include linux/interrupt.h
+#include linux/fsl_devices.h
+#include linux/of_platform.h
+
+#include asm/system.h
+#include asm/pgtable.h
+#include asm/page.h
+#include asm/atomic.h
+#include asm/time.h
+#include asm/io.h
+#include asm/machdep.h
+#include asm/ipic.h
+#include asm/pci-bridge.h
+#include asm/irq.h
+#include mm/mmu_decl.h
+#include asm/prom.h
+#include asm/udbg.h
+#include asm/mpic.h
+
+#include sysdev/fsl_soc.h
+#include sysdev/fsl_pci.h
+
+static void __init sbc8548_pic_init(void)
+{
+   struct mpic *mpic;
+   struct resource r;
+   struct device_node *np = NULL;
+
+   np = of_find_node_by_type(np, open-pic);
+
+   if (np == NULL) {
+   printk(KERN_ERR Could not find open-pic node\n);
+   return;
+   }
+
+   if (of_address_to_resource(np, 0, r)) {
+   printk(KERN_ERR Failed to map mpic register space\n);
+   of_node_put(np);
+   return;
+   }
+
+   mpic = mpic_alloc(np, r.start,
+   MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
+   0, 256,  OpenPIC  );
+   BUG_ON(mpic == NULL);
+
+   /* Return the mpic node */
+   of_node_put(np);
+
+   mpic_init(mpic);
+}
+
+/*
+ * Setup the architecture
+ */
+static void __init sbc8548_setup_arch(void)
+{
+#ifdef CONFIG_PCI
+   struct device_node *np;
+#endif
+
+   if (ppc_md.progress)
+   ppc_md.progress(sbc8548_setup_arch(), 0);
+
+#ifdef CONFIG_PCI
+   for_each_node_by_type(np, pci) {
+   if (of_device_is_compatible(np, fsl,mpc8540-pci) ||
+   of_device_is_compatible(np, fsl,mpc8548-pcie)) {
+   struct resource rsrc;
+   of_address_to_resource(np, 0, rsrc);
+   if ((rsrc.start  0xf) == 0x8000)
+   fsl_add_bridge(np, 1);
+  

[PATCH 4/10] sbc8560: Add default .config file for Wind River SBC8560

2008-01-24 Thread Paul Gortmaker
This is a suitable .config file for building the WRS SBC8560 kernel
to be used for NFS root via one of the TSEC interfaces and with
serial console via the 16550 compatible UART on the board.

Signed-off-by: Paul Gortmaker [EMAIL PROTECTED]
---
 arch/powerpc/configs/sbc8560_defconfig |  764 
 1 files changed, 764 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/configs/sbc8560_defconfig 
b/arch/powerpc/configs/sbc8560_defconfig
new file mode 100644
index 000..d89fce0
--- /dev/null
+++ b/arch/powerpc/configs/sbc8560_defconfig
@@ -0,0 +1,764 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.24-rc4
+# Wed Jan 23 14:59:20 2008
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+CONFIG_PPC_85xx=y
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_85xx=y
+CONFIG_E500=y
+CONFIG_BOOKE=y
+CONFIG_FSL_BOOKE=y
+# CONFIG_PHYS_64BIT is not set
+CONFIG_SPE=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+CONFIG_DEFAULT_UIMAGE=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_MODULES is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED=anticipatory
+
+#
+# Platform support
+#
+# CONFIG_PPC_MPC52xx is not set
+# CONFIG_PPC_MPC5200 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+# CONFIG_MPC8540_ADS is not set
+# CONFIG_MPC8560_ADS is not set
+# CONFIG_MPC85xx_CDS is not set
+# CONFIG_MPC85xx_MDS is not set
+# CONFIG_MPC85xx_DS is not set
+CONFIG_SBC8560=y
+CONFIG_MPC8560=y
+CONFIG_MPC85xx=y
+CONFIG_MPIC=y
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPM2 is not set
+# CONFIG_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=y
+# CONFIG_MATH_EMULATION is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y

[PATCH 8/10] sbc834x: Add support for Wind River SBC834x boards

2008-01-24 Thread Paul Gortmaker
This adds the basic support for the Wind River SBC834x boards.  The
SBC8349 is more common, although it should work on the SBC8347 board
as well.  Support is heavily based on the existing MPC834x_MDS code.

Signed-off-by: Paul Gortmaker [EMAIL PROTECTED]
---
 arch/powerpc/platforms/83xx/Kconfig   |9 ++-
 arch/powerpc/platforms/83xx/Makefile  |1 +
 arch/powerpc/platforms/83xx/sbc834x.c |  115 +
 3 files changed, 124 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/Kconfig 
b/arch/powerpc/platforms/83xx/Kconfig
index 2430ac8..782bff0 100644
--- a/arch/powerpc/platforms/83xx/Kconfig
+++ b/arch/powerpc/platforms/83xx/Kconfig
@@ -55,6 +55,13 @@ config MPC837x_MDS
select DEFAULT_UIMAGE
help
  This option enables support for the MPC837x MDS Processor Board.
+
+config SBC834x
+   bool Wind River SBC834x
+   select DEFAULT_UIMAGE
+   help
+ This option enables support for the Wind River SBC834x board.
+
 endchoice
 
 config PPC_MPC831x
@@ -73,7 +80,7 @@ config MPC834x
bool
select PPC_UDBG_16550
select PPC_INDIRECT_PCI
-   default y if MPC834x_MDS || MPC834x_ITX
+   default y if MPC834x_MDS || MPC834x_ITX || SBC834x
 
 config PPC_MPC836x
bool
diff --git a/arch/powerpc/platforms/83xx/Makefile 
b/arch/powerpc/platforms/83xx/Makefile
index df46629..3a35242 100644
--- a/arch/powerpc/platforms/83xx/Makefile
+++ b/arch/powerpc/platforms/83xx/Makefile
@@ -10,3 +10,4 @@ obj-$(CONFIG_MPC834x_ITX) += mpc834x_itx.o
 obj-$(CONFIG_MPC836x_MDS)  += mpc836x_mds.o
 obj-$(CONFIG_MPC832x_MDS)  += mpc832x_mds.o
 obj-$(CONFIG_MPC837x_MDS)  += mpc837x_mds.o
+obj-$(CONFIG_SBC834x)  += sbc834x.o
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c 
b/arch/powerpc/platforms/83xx/sbc834x.c
new file mode 100644
index 000..cf38247
--- /dev/null
+++ b/arch/powerpc/platforms/83xx/sbc834x.c
@@ -0,0 +1,115 @@
+/*
+ * arch/powerpc/platforms/83xx/sbc834x.c
+ *
+ * Wind River SBC834x board specific routines
+ *
+ * By Paul Gortmaker (see MAINTAINERS for contact information)
+ *
+ * Based largely on the mpc834x_mds.c support by Kumar Gala.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include linux/stddef.h
+#include linux/kernel.h
+#include linux/init.h
+#include linux/errno.h
+#include linux/reboot.h
+#include linux/pci.h
+#include linux/kdev_t.h
+#include linux/major.h
+#include linux/console.h
+#include linux/delay.h
+#include linux/seq_file.h
+#include linux/root_dev.h
+#include linux/of_platform.h
+
+#include asm/system.h
+#include asm/atomic.h
+#include asm/time.h
+#include asm/io.h
+#include asm/machdep.h
+#include asm/ipic.h
+#include asm/irq.h
+#include asm/prom.h
+#include asm/udbg.h
+#include sysdev/fsl_soc.h
+
+#include mpc83xx.h
+
+/* 
+ *
+ * Setup the architecture
+ *
+ */
+static void __init sbc834x_setup_arch(void)
+{
+#ifdef CONFIG_PCI
+   struct device_node *np;
+#endif
+
+   if (ppc_md.progress)
+   ppc_md.progress(sbc834x_setup_arch(), 0);
+
+#ifdef CONFIG_PCI
+   for_each_compatible_node(np, pci, fsl,mpc8349-pci)
+   mpc83xx_add_bridge(np);
+#endif
+
+}
+
+static void __init sbc834x_init_IRQ(void)
+{
+   struct device_node *np;
+
+   np = of_find_node_by_type(NULL, ipic);
+   if (!np)
+   return;
+
+   ipic_init(np, 0);
+
+   /* Initialize the default interrupt mapping priorities,
+* in case the boot rom changed something on us.
+*/
+   ipic_set_default_priority();
+
+   of_node_put(np);
+}
+
+static struct __initdata of_device_id sbc834x_ids[] = {
+   { .type = soc, },
+   { .compatible = soc, },
+   {},
+};
+
+static int __init sbc834x_declare_of_platform_devices(void)
+{
+   of_platform_bus_probe(NULL, sbc834x_ids, NULL);
+   return 0;
+}
+machine_device_initcall(sbc834x, sbc834x_declare_of_platform_devices);
+
+/*
+ * Called very early, MMU is off, device-tree isn't unflattened
+ */
+static int __init sbc834x_probe(void)
+{
+   unsigned long root = of_get_flat_dt_root();
+
+   return of_flat_dt_is_compatible(root, SBC834x);
+}
+
+define_machine(sbc834x) {
+   .name   = SBC834x,
+   .probe  = sbc834x_probe,
+   .setup_arch = sbc834x_setup_arch,
+   .init_IRQ   = sbc834x_init_IRQ,
+   .get_irq= ipic_get_irq,
+   .restart= mpc83xx_restart,
+   .time_init  = mpc83xx_time_init,
+   .calibrate_decr = generic_calibrate_decr,
+   .progress   = udbg_progress,
+};
-- 
1.5.0.rc1.gf4b6c


[PATCH 7/10] sbc8548: Add default .config file for Wind River SBC8548

2008-01-24 Thread Paul Gortmaker
This is a suitable .config file for building the WRS SBC8548 kernel
to be used for NFS root via one of the TSEC interfaces and with
serial console via the soc/16550 compatible UART.

Signed-off-by: Paul Gortmaker [EMAIL PROTECTED]
---
 arch/powerpc/configs/sbc8548_defconfig |  741 
 1 files changed, 741 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/configs/sbc8548_defconfig 
b/arch/powerpc/configs/sbc8548_defconfig
new file mode 100644
index 000..3b7fa53
--- /dev/null
+++ b/arch/powerpc/configs/sbc8548_defconfig
@@ -0,0 +1,741 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.24-rc8
+# Thu Jan 24 15:19:12 2008
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+CONFIG_PPC_85xx=y
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_85xx=y
+CONFIG_E500=y
+CONFIG_BOOKE=y
+CONFIG_FSL_BOOKE=y
+# CONFIG_PHYS_64BIT is not set
+CONFIG_SPE=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+CONFIG_DEFAULT_UIMAGE=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_MODULES is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED=anticipatory
+
+#
+# Platform support
+#
+# CONFIG_PPC_MPC52xx is not set
+# CONFIG_PPC_MPC5200 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+# CONFIG_MPC8540_ADS is not set
+# CONFIG_MPC8560_ADS is not set
+# CONFIG_MPC85xx_CDS is not set
+# CONFIG_MPC85xx_MDS is not set
+# CONFIG_MPC85xx_DS is not set
+CONFIG_SBC8548=y
+# CONFIG_SBC8560 is not set
+CONFIG_MPC8540=y
+CONFIG_MPC85xx=y
+# CONFIG_IPIC is not set
+CONFIG_MPIC=y
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=y
+CONFIG_MATH_EMULATION=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y

[PATCH 6/10] sbc8548: Add v1 device tree source for Wind River SBC8548 board

2008-01-24 Thread Paul Gortmaker
This adds a v1 device tree source for the Wind River SBC8548 board.
The biggest difference between this and the MPC8548CDS reference
platform is the absence of the CDS's Arcadia peripherals and physical
access to the PCI#2 bus.

Signed-off-by: Paul Gortmaker [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/sbc8548.dts |  244 +
 1 files changed, 244 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/sbc8548.dts 
b/arch/powerpc/boot/dts/sbc8548.dts
new file mode 100644
index 000..14be38a
--- /dev/null
+++ b/arch/powerpc/boot/dts/sbc8548.dts
@@ -0,0 +1,244 @@
+/*
+ * SBC8548 Device Tree Source
+ *
+ * Copyright 2007 Wind River Systems Inc.
+ *
+ * Paul Gortmaker (see MAINTAINERS for contact information)
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+
+/dts-v1/;
+
+/ {
+   model = SBC8548;
+   compatible = SBC8548;
+   #address-cells = 1;
+   #size-cells = 1;
+
+   aliases {
+   ethernet0 = enet0;
+   ethernet1 = enet1;
+   serial0 = serial0;
+   serial1 = serial1;
+   pci0 = pci0;
+   /* pci1 doesn't have a corresponding physical connector */
+   pci2 = pci2;
+   };
+
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   PowerPC,[EMAIL PROTECTED] {
+   device_type = cpu;
+   reg = 0;
+   d-cache-line-size = 0x20; // 32 bytes
+   i-cache-line-size = 0x20; // 32 bytes
+   d-cache-size = 0x8000;// L1, 32K
+   i-cache-size = 0x8000;// L1, 32K
+   timebase-frequency = 0;   // From uboot
+   bus-frequency = 0;
+   clock-frequency = 0;
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0x 0x1000;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 1;
+   device_type = soc;
+   ranges = 0x 0xe000 0x0010;
+   reg = 0xe000 0x1000;  // CCSRBAR
+   bus-frequency = 0;
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,8548-memory-controller;
+   reg = 0x2000 0x1000;
+   interrupt-parent = mpic;
+   interrupts = 0x12 0x2;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,8548-l2-cache-controller;
+   reg = 0x2 0x1000;
+   cache-line-size = 0x20;   // 32 bytes
+   cache-size = 0x8; // L2, 512K
+   interrupt-parent = mpic;
+   interrupts = 0x10 0x2;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 0;
+   cell-index = 0;
+   compatible = fsl-i2c;
+   reg = 0x3000 0x100;
+   interrupts = 0x2b 0x2;
+   interrupt-parent = mpic;
+   dfsrr;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 0;
+   cell-index = 1;
+   compatible = fsl-i2c;
+   reg = 0x3100 0x100;
+   interrupts = 0x2b 0x2;
+   interrupt-parent = mpic;
+   dfsrr;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = fsl,gianfar-mdio;
+   reg = 0x24520 0x20;
+
+   phy0: [EMAIL PROTECTED] {
+   interrupt-parent = mpic;
+   interrupts = 0x6 0x1;
+   reg = 0x19;
+   device_type = ethernet-phy;
+   };
+   phy1: [EMAIL PROTECTED] {
+   interrupt-parent = mpic;
+   interrupts = 0x7 0x1;
+   reg = 0x1a;
+   device_type = ethernet-phy;
+   };
+   };
+
+   enet0: [EMAIL PROTECTED] {
+   cell-index = 0;
+   device_type = network;
+   model = eTSEC;
+   

[PATCH 10/10] sbc834x: Add default config file for Wind River SBC8349 board

2008-01-24 Thread Paul Gortmaker
Default config file for SBC8349 board, suitable for use as with NFS as
a root file system and gianfar as the NFS root device.

Signed-off-by: Paul Gortmaker [EMAIL PROTECTED]
---
 arch/powerpc/configs/sbc834x_defconfig |  800 
 1 files changed, 800 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/configs/sbc834x_defconfig 
b/arch/powerpc/configs/sbc834x_defconfig
new file mode 100644
index 000..9245bcc
--- /dev/null
+++ b/arch/powerpc/configs/sbc834x_defconfig
@@ -0,0 +1,800 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.24-rc8
+# Thu Jan 24 15:54:27 2008
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+CONFIG_6xx=y
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_83xx=y
+CONFIG_PPC_FPU=y
+CONFIG_PPC_STD_MMU=y
+CONFIG_PPC_STD_MMU_32=y
+# CONFIG_PPC_MM_SLICES is not set
+# CONFIG_SMP is not set
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+CONFIG_DEFAULT_UIMAGE=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_KALLSYMS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+# CONFIG_EPOLL is not set
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_KMOD is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED=anticipatory
+
+#
+# Platform support
+#
+# CONFIG_PPC_MULTIPLATFORM is not set
+# CONFIG_PPC_82xx is not set
+CONFIG_PPC_83xx=y
+# CONFIG_PPC_86xx is not set
+# CONFIG_PPC_MPC52xx is not set
+# CONFIG_PPC_MPC5200 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+# CONFIG_MPC8313_RDB is not set
+# CONFIG_MPC832x_MDS is not set
+# CONFIG_MPC832x_RDB is not set
+# CONFIG_MPC834x_MDS is not set
+# CONFIG_MPC834x_ITX is not set
+# CONFIG_MPC836x_MDS is not set
+# CONFIG_MPC837x_MDS is not set
+CONFIG_SBC834x=y
+CONFIG_MPC834x=y
+CONFIG_IPIC=y
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set

[PATCH 9/10] sbc834x: Add device tree source for Wind River SBC834x board.

2008-01-24 Thread Paul Gortmaker
This adds the device tree source for the Wind River SBC834x board.
It is based on the MPC834x_MDS DTS, with the biggest difference being
the lack of BCSR and the PCI2 that the MDS gets via the PIB. That,
and this file is also dts-v1 format.

Signed-off-by: Paul Gortmaker [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/sbc8349.dts |  243 +
 1 files changed, 243 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/sbc8349.dts 
b/arch/powerpc/boot/dts/sbc8349.dts
new file mode 100644
index 000..9c13c1a
--- /dev/null
+++ b/arch/powerpc/boot/dts/sbc8349.dts
@@ -0,0 +1,243 @@
+/*
+ * SBC8349E Device Tree Source
+ *
+ * Copyright 2007 Wind River Inc.
+ *
+ * Paul Gortmaker (see MAINTAINERS for contact information)
+ *
+ * -based largely on the Freescale MPC834x_MDS dts.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/dts-v1/;
+
+/ {
+   model = SBC8349E;
+   compatible = SBC834xE;
+   #address-cells = 1;
+   #size-cells = 1;
+
+   aliases {
+   ethernet0 = enet0;
+   ethernet1 = enet1;
+   serial0 = serial0;
+   serial1 = serial1;
+   pci0 = pci0;
+   };
+
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   PowerPC,[EMAIL PROTECTED] {
+   device_type = cpu;
+   reg = 0;
+   d-cache-line-size = 0x20; // 32 bytes
+   i-cache-line-size = 0x20; // 32 bytes
+   d-cache-size = 0x8000;// L1, 32K
+   i-cache-size = 0x8000;// L1, 32K
+   timebase-frequency = 0;   // from bootloader
+   bus-frequency = 0;// from bootloader
+   clock-frequency = 0;  // from bootloader
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0x 0x1000;  // 256MB at 0
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 1;
+   device_type = soc;
+   ranges = 0x0 0xe000 0x0010;
+   reg = 0xe000 0x0200;
+   bus-frequency = 0;
+
+   [EMAIL PROTECTED] {
+   compatible = mpc83xx_wdt;
+   reg = 0x200 0x100;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 0;
+   cell-index = 0;
+   compatible = fsl-i2c;
+   reg = 0x3000 0x100;
+   interrupts = 0xe 0x8;
+   interrupt-parent = ipic;
+   dfsrr;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 0;
+   cell-index = 1;
+   compatible = fsl-i2c;
+   reg = 0x3100 0x100;
+   interrupts = 0xf 0x8;
+   interrupt-parent = ipic;
+   dfsrr;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl_spi;
+   reg = 0x7000 0x1000;
+   interrupts = 0x10 0x8;
+   interrupt-parent = ipic;
+   mode = cpu;
+   };
+
+   /* phy type (ULPI or SERIAL) are only types supported for MPH */
+   /* port = 0 or 1 */
+   [EMAIL PROTECTED] {
+   compatible = fsl-usb2-mph;
+   reg = 0x22000 0x1000;
+   #address-cells = 1;
+   #size-cells = 0;
+   interrupt-parent = ipic;
+   interrupts = 0x27 0x8;
+   phy_type = ulpi;
+   port1;
+   };
+   /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
+   [EMAIL PROTECTED] {
+   device_type = usb;
+   compatible = fsl-usb2-dr;
+   reg = 0x23000 0x1000;
+   #address-cells = 1;
+   #size-cells = 0;
+   interrupt-parent = ipic;
+   interrupts = 0x26 0x8;
+   dr_mode = otg;
+   phy_type = ulpi;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = 

Re: [PATCH 3/10] CPM2: Make support for the CPM2 optional on 8560 based boards

2008-01-24 Thread Paul Gortmaker
Scott Wood wrote:
 Paul Gortmaker wrote:
 @@ -41,7 +42,7 @@ config MPC85xx_DS
  config SBC8560
  bool Wind River SBC8560
  select DEFAULT_UIMAGE
 -select PPC_CPM_NEW_BINDING
 +select PPC_CPM_NEW_BINDING if CPM2
  help
This option enables support for the Wind River SBC8560 board

 Setting PPC_CPM_NEW_BINGING should be harmless if CPM2 isn't set.  
 Looks good otherwise.

 -Scott


Yes, it should be harmless;  I was just thinking of it
from the point of view of less chatter in the .config
file (yes, you could say that is a lost cause...)

P.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [i2c] [PATCH 3/3] Add device tree compatible aliases to i2c drivers

2008-01-24 Thread Olof Johansson
On Tue, Jan 22, 2008 at 09:09:16PM -0500, Jon Smirl wrote:
 PowerPC device trees use a different naming convention than the Linux
 kernel.  Provide alias names for i2c drivers in order to allow them to
 be loaded by device tree name. The OF_ID macro ensures that the aliases
 are only present in powerpc builds and separated into their own namespace.

Hmm. I just realized that there's yet another twist to the PPC device
bindings that's not yet considered:

Currently the device tree only contains one compatible field for most of
the devices. But it's perfectly legal (actually, recommended) to have more
than one compatible field -- they go from the specific to the generic.

For example, for an eeprom I might have: MCHP,24lc128est,
MCHP,24xx128, 24c128. The at24 driver (not in mainline yet :) would
likely match with 24c128, and it would normally not make sense to have
to list all specific vendors and models of the device type in question
in the driver.

I can't register a board_info for each of the compatible fields without
changing the way the i2c drivers are registered, since the creation of
the duplicate entries will start reporting errors. I also shouldn't
(reasonably) have to register every single possible first (i.e. most
specific) compatible-field -- that goes against the whole concept of
having more than one compatible string.

So it seems that the solution would be to make i2c_board_info take a
list of names for the device, and each of them has to be matched with
all drivers, taking the first match.

Sounds reasonable to everyone? I can provide a patch to go on top of
what's already proposed.


-Olof
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/10] CPM2: Make support for the CPM2 optional on 8560 based boards

2008-01-24 Thread Scott Wood
Paul Gortmaker wrote:
 @@ -41,7 +42,7 @@ config MPC85xx_DS
  config SBC8560
   bool Wind River SBC8560
   select DEFAULT_UIMAGE
 - select PPC_CPM_NEW_BINDING
 + select PPC_CPM_NEW_BINDING if CPM2
   help
 This option enables support for the Wind River SBC8560 board

Setting PPC_CPM_NEW_BINGING should be harmless if CPM2 isn't set.  Looks 
good otherwise.

-Scott

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [i2c] [PATCH 3/3] Add device tree compatible aliases to i2c drivers

2008-01-24 Thread Scott Wood
Olof Johansson wrote:
 For example, for an eeprom I might have: MCHP,24lc128est,
 MCHP,24xx128, 24c128. The at24 driver (not in mainline yet :) would
 likely match with 24c128, and it would normally not make sense to have
 to list all specific vendors and models of the device type in question
 in the driver.

It's not really about the vendors of the device, but the namespace it 
goes into.  If there's really no canonical vendor name, then a plain old 
24c148 might make sense, but that seems like it'd be fairly rare.

 I can't register a board_info for each of the compatible fields without
 changing the way the i2c drivers are registered, since the creation of
 the duplicate entries will start reporting errors.

Even with the current i2c changes that have been flying around the 
lists?  If so, it should be fixed...

 So it seems that the solution would be to make i2c_board_info take a
 list of names for the device, and each of them has to be matched with
 all drivers, taking the first match.

Agreed.

-Scott

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [i2c] [PATCH 3/3] Add device tree compatible aliases to i2c drivers

2008-01-24 Thread Jon Smirl
On 1/24/08, Scott Wood [EMAIL PROTECTED] wrote:
 Olof Johansson wrote:
  For example, for an eeprom I might have: MCHP,24lc128est,
  MCHP,24xx128, 24c128. The at24 driver (not in mainline yet :) would
  likely match with 24c128, and it would normally not make sense to have
  to list all specific vendors and models of the device type in question
  in the driver.

 It's not really about the vendors of the device, but the namespace it
 goes into.  If there's really no canonical vendor name, then a plain old
 24c148 might make sense, but that seems like it'd be fairly rare.

  I can't register a board_info for each of the compatible fields without
  changing the way the i2c drivers are registered, since the creation of
  the duplicate entries will start reporting errors.

 Even with the current i2c changes that have been flying around the
 lists?  If so, it should be fixed...

How to fix this needs some thought

Devices can register before their drivers are loaded. What name are
you going to use to register the device in this case?

Probably the right way to fix this is in drivers/base not in the i2c
code. PowerPC devices would register with their entire compatible
string. Then later when drivers are loaded they would be compared
against the device's compatible string.   When you register a device
the existing drivers will need to be looked for in the order of the
compatible string.

Another wrinkle is exhibited by the USB HID driver. The generic USB
HID driver will bind to every HID device it sees. Later if you want to
load a specific driver for the USB device you have to go into sysfs
and unbind the device from the generic HID driver and then rebind it
to the specific driver. Matching on the compatible list will have the
same problem.


  So it seems that the solution would be to make i2c_board_info take a
  list of names for the device, and each of them has to be matched with
  all drivers, taking the first match.

 Agreed.

 -Scott




-- 
Jon Smirl
[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [i2c] [PATCH 3/3] Add device tree compatible aliases to i2c drivers

2008-01-24 Thread Jon Smirl
On 1/24/08, Olof Johansson [EMAIL PROTECTED] wrote:
 On Tue, Jan 22, 2008 at 09:09:16PM -0500, Jon Smirl wrote:
  PowerPC device trees use a different naming convention than the Linux
  kernel.  Provide alias names for i2c drivers in order to allow them to
  be loaded by device tree name. The OF_ID macro ensures that the aliases
  are only present in powerpc builds and separated into their own namespace.

 Hmm. I just realized that there's yet another twist to the PPC device
 bindings that's not yet considered:

 Currently the device tree only contains one compatible field for most of
 the devices. But it's perfectly legal (actually, recommended) to have more
 than one compatible field -- they go from the specific to the generic.

 For example, for an eeprom I might have: MCHP,24lc128est,
 MCHP,24xx128, 24c128. The at24 driver (not in mainline yet :) would
 likely match with 24c128, and it would normally not make sense to have
 to list all specific vendors and models of the device type in question
 in the driver.

 I can't register a board_info for each of the compatible fields without
 changing the way the i2c drivers are registered, since the creation of
 the duplicate entries will start reporting errors. I also shouldn't
 (reasonably) have to register every single possible first (i.e. most
 specific) compatible-field -- that goes against the whole concept of
 having more than one compatible string.

 So it seems that the solution would be to make i2c_board_info take a
 list of names for the device, and each of them has to be matched with
 all drivers, taking the first match.

 Sounds reasonable to everyone? I can provide a patch to go on top of
 what's already proposed.

I was aware that this was missing but I'm having enough trouble
getting the base code in so I hadn't addressed this problem yet. A
patch would be fine, I haven't written any code.

Can you put the support somewhere in powerpc common code? When I get
my dynamically loadable audio codec patch ready it is going to have
the same problem.

Also note that all of this only works for new style i2c drivers, if
you want to dynamically load an old style one your will have to
convert it to new style first (not hard to do).

-- 
Jon Smirl
[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 9/9] powerpc: add the mpc837x rdb defconfig

2008-01-24 Thread Kim Phillips
Signed-off-by: Joe D'Abbraccio [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
---
 arch/powerpc/configs/mpc837x_rdb_defconfig |  887 
 1 files changed, 887 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/configs/mpc837x_rdb_defconfig

diff --git a/arch/powerpc/configs/mpc837x_rdb_defconfig 
b/arch/powerpc/configs/mpc837x_rdb_defconfig
new file mode 100644
index 000..91d291e
--- /dev/null
+++ b/arch/powerpc/configs/mpc837x_rdb_defconfig
@@ -0,0 +1,887 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.24-rc8
+# Thu Jan 24 20:04:39 2008
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+CONFIG_6xx=y
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_83xx=y
+CONFIG_PPC_FPU=y
+CONFIG_PPC_STD_MMU=y
+CONFIG_PPC_STD_MMU_32=y
+# CONFIG_PPC_MM_SLICES is not set
+# CONFIG_SMP is not set
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+CONFIG_DEFAULT_UIMAGE=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+# CONFIG_EPOLL is not set
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_KMOD is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED=anticipatory
+
+#
+# Platform support
+#
+# CONFIG_PPC_MULTIPLATFORM is not set
+# CONFIG_PPC_82xx is not set
+CONFIG_PPC_83xx=y
+# CONFIG_PPC_86xx is not set
+# CONFIG_PPC_MPC52xx is not set
+# CONFIG_PPC_MPC5200 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+# CONFIG_MPC831x_RDB is not set
+# CONFIG_MPC832x_MDS is not set
+# CONFIG_MPC832x_RDB is not set
+# CONFIG_MPC834x_MDS is not set
+# CONFIG_MPC834x_ITX is not set
+# CONFIG_MPC836x_MDS is not set
+# CONFIG_MPC837x_MDS is not set
+CONFIG_MPC837x_RDB=y
+CONFIG_PPC_MPC837x=y
+CONFIG_IPIC=y
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPM2 is not set
+# CONFIG_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# 

[PATCH 8/9] powerpc: add the mpc837[789]_rdb dts files

2008-01-24 Thread Kim Phillips
Add the dts files for the MPC838xE Reference Development Board (RDB).

The board is a mini-ITX reference board with 256M DDR2, 8M flash,
32M NAND, USB, PCI, gigabit ethernet, SATA, and serial.

the difference among the three files is the 8377 has two, the 8378
none, and the 8379 has four sata controllers.

partially based on the 8379 mds device trees.

Signed-off-by: Joe D'Abbraccio [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/mpc8377_rdb.dts |  296 +++
 arch/powerpc/boot/dts/mpc8378_rdb.dts |  282 ++
 arch/powerpc/boot/dts/mpc8379_rdb.dts |  310 +
 3 files changed, 888 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/mpc8377_rdb.dts
 create mode 100644 arch/powerpc/boot/dts/mpc8378_rdb.dts
 create mode 100644 arch/powerpc/boot/dts/mpc8379_rdb.dts

diff --git a/arch/powerpc/boot/dts/mpc8377_rdb.dts 
b/arch/powerpc/boot/dts/mpc8377_rdb.dts
new file mode 100644
index 000..6bd018d
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc8377_rdb.dts
@@ -0,0 +1,296 @@
+/*
+ * MPC8377E RDB Device Tree Source
+ *
+ * Copyright 2007, 2008 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/dts-v1/;
+
+/ {
+   compatible = fsl,mpc8377erdb;
+   #address-cells = 1;
+   #size-cells = 1;
+
+   aliases {
+   ethernet0 = enet0;
+   ethernet1 = enet1;
+   serial0 = serial0;
+   serial1 = serial1;
+   pci0 = pci0;
+   };
+
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   PowerPC,[EMAIL PROTECTED] {
+   device_type = cpu;
+   reg = 0;
+   d-cache-line-size = 32;
+   i-cache-line-size = 32;
+   d-cache-size = 32768;
+   i-cache-size = 32768;
+   timebase-frequency = 0;
+   bus-frequency = 0;
+   clock-frequency = 0;
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0x 0x1000;  // 256MB at 0
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 2;
+   #size-cells = 1;
+   compatible = fsl,mpc8377-elbc, fsl,elbc, simple-bus;
+   reg = 0xe0005000 0x1000;
+   interrupts = 77 8;
+   interrupt-parent = ipic;
+
+   // CS0 and CS1 are swapped when
+   // booting from nand, but the
+   // addresses are the same.
+   ranges = 0 0 0xfe00 0x0080
+ 1 0 0xe060 0x8000
+ 2 0 0xf000 0x0002
+ 3 0 0xfa00 0x8000;
+
+   [EMAIL PROTECTED],0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = cfi-flash;
+   reg = 0 0 0x80;
+   bank-width = 2;
+   device-width = 1;
+   };
+
+   [EMAIL PROTECTED],0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = fsl,mpc8377-fcm-nand,
+fsl,elbc-fcm-nand;
+   reg = 1 0 0x8000;
+
+   [EMAIL PROTECTED] {
+   reg = 0x0 0x10;
+   read-only;
+   };
+
+   [EMAIL PROTECTED] {
+   reg = 0x10 0x30;
+   };
+   [EMAIL PROTECTED] {
+   reg = 0x40 0x1c0;
+   };
+   };
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 1;
+   device_type = soc;
+   compatible = simple-bus;
+   ranges = 0 0xe000 0x0010;
+   reg = 0xe000 0x0200;
+   bus-frequency = 0;
+
+   [EMAIL PROTECTED] {
+   device_type = watchdog;
+   compatible = mpc83xx_wdt;
+   reg = 0x200 0x100;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 0;
+   cell-index = 0;
+   compatible = fsl-i2c;
+   reg = 0x3000 0x100;
+   interrupts = 14 8;
+

[PATCH 5/9] powerpc: ipic: add interrupt vector 94

2008-01-24 Thread Kim Phillips
this is used on the mpc8315 SoC for DMA error interrupts.

Signed-off-by: Jerry Huang [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
---
 arch/powerpc/sysdev/ipic.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index 4c016da..d7f6a70 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -497,6 +497,12 @@ static struct ipic_info ipic_info[] = {
.force  = IPIC_SIFCR_L,
.bit= 27,
},
+   [94] = {
+   .mask   = IPIC_SIMSR_L,
+   .prio   = 0,
+   .force  = IPIC_SIFCR_L,
+   .bit= 30,
+   },
 };
 
 static inline u32 ipic_read(volatile u32 __iomem *base, unsigned int reg)
-- 
1.5.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 4/9] enable FSL SATA driver config for Freescale SoCs

2008-01-24 Thread Kim Phillips
The mpc8315 shares the same SATA controller as the mpc837x,
and likelihood is that future SoCs from Freescale will also.

Signed-off-by: Jerry Huang [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
---
Kumar, let me know if you want me to post this to the ata list (I'm
assuming it's not necessary).

 drivers/ata/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 64b4964..75939dd 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -184,7 +184,7 @@ config PATA_ACPI
 
 config SATA_FSL
tristate Freescale 3.0Gbps SATA support
-   depends on PPC_MPC837x
+   depends on FSL_SOC
help
  This option enables support for Freescale 3.0Gbps SATA controller.
  It can be found on MPC837x and MPC8315.
-- 
1.5.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 3/9] powerpc: Add the MPC8315E RDB dts

2008-01-24 Thread Kim Phillips
Add the dts for the MPC8315E Reference Development Board (RDB).

The board is a mini-ITX reference board with 128M DDR2, 8M flash,
32M NAND, USB, PCI, gigabit ethernet, SATA, and serial.

Signed-off-by: Jerry Huang [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/mpc8315erdb.dts |  287 +
 1 files changed, 287 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/mpc8315erdb.dts

diff --git a/arch/powerpc/boot/dts/mpc8315erdb.dts 
b/arch/powerpc/boot/dts/mpc8315erdb.dts
new file mode 100644
index 000..05c972a
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc8315erdb.dts
@@ -0,0 +1,287 @@
+/*
+ * MPC8315E RDB Device Tree Source
+ *
+ * Copyright 2007 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/dts-v1/;
+
+/ {
+   compatible = fsl,mpc8315erdb;
+   #address-cells = 1;
+   #size-cells = 1;
+
+   aliases {
+   ethernet0 = enet0;
+   ethernet1 = enet1;
+   serial0 = serial0;
+   serial1 = serial1;
+   pci0 = pci0;
+   };
+
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   PowerPC,[EMAIL PROTECTED] {
+   device_type = cpu;
+   reg = 0;
+   d-cache-line-size = 32;
+   i-cache-line-size = 32;
+   d-cache-size = 16384;
+   i-cache-size = 16384;
+   timebase-frequency = 0;   // from bootloader
+   bus-frequency = 0;// from bootloader
+   clock-frequency = 0;  // from bootloader
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0x 0x0800;  // 128MB at 0
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 2;
+   #size-cells = 1;
+   compatible = fsl,mpc8315-elbc, fsl,elbc, simple-bus;
+   reg = 0xe0005000 0x1000;
+   interrupts = 77 8;
+   interrupt-parent = ipic;
+
+   // CS0 and CS1 are swapped when
+   // booting from nand, but the
+   // addresses are the same.
+   ranges = 0 0 0xfe00 0x0080
+ 1 0 0xe060 0x2000
+ 2 0 0xf000 0x0002
+ 3 0 0xfa00 0x8000;
+
+   [EMAIL PROTECTED],0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = cfi-flash;
+   reg = 0 0 0x80;
+   bank-width = 2;
+   device-width = 1;
+   };
+
+   [EMAIL PROTECTED],0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = fsl,mpc8315-fcm-nand,
+fsl,elbc-fcm-nand;
+   reg = 1 0 0x2000;
+
+   [EMAIL PROTECTED] {
+   reg = 0x0 0x10;
+   read-only;
+   };
+
+   [EMAIL PROTECTED] {
+   reg = 0x10 0x30;
+   };
+   [EMAIL PROTECTED] {
+   reg = 0x40 0x1c0;
+   };
+   };
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 1;
+   device_type = soc;
+   compatible = simple-bus;
+   ranges = 0 0xe000 0x0010;
+   reg = 0xe000 0x0200;
+   bus-frequency = 0;
+
+   [EMAIL PROTECTED] {
+   device_type = watchdog;
+   compatible = mpc83xx_wdt;
+   reg = 0x200 0x100;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 0;
+   cell-index = 0;
+   compatible = fsl-i2c;
+   reg = 0x3000 0x100;
+   interrupts = 14 8;
+   interrupt-parent =  ipic ;
+   dfsrr;
+   [EMAIL PROTECTED] {
+   device_type = rtc;
+   compatible = dallas,ds1339;
+   reg = 0x68;
+   };
+   };
+
+   [EMAIL PROTECTED] {
+

[PATCH 2/9] powerpc: add base platform support for the mpc8315 rdb board

2008-01-24 Thread Kim Phillips
mpc8315 identical to mpc8313 here, just check compatible.

Signed-off-by: Kim Phillips [EMAIL PROTECTED]
---
 arch/powerpc/platforms/83xx/Kconfig   |2 +-
 arch/powerpc/platforms/83xx/mpc831x_rdb.c |3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/Kconfig 
b/arch/powerpc/platforms/83xx/Kconfig
index faaa651..b478312 100644
--- a/arch/powerpc/platforms/83xx/Kconfig
+++ b/arch/powerpc/platforms/83xx/Kconfig
@@ -7,7 +7,7 @@ config MPC831x_RDB
bool Freescale MPC831x RDB
select DEFAULT_UIMAGE
help
- This option enables support for the MPC8313 RDB board.
+ This option enables support for the MPC8313 RDB and MPC8315 RDB 
boards.
 
 config MPC832x_MDS
bool Freescale MPC832x MDS
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c 
b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index b484b2b..c4db517 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -64,7 +64,8 @@ static int __init mpc831x_rdb_probe(void)
 {
unsigned long root = of_get_flat_dt_root();
 
-   return of_flat_dt_is_compatible(root, MPC8313ERDB);
+   return of_flat_dt_is_compatible(root, MPC8313ERDB) ||
+  of_flat_dt_is_compatible(root, fsl,mpc8315erdb);
 }
 
 static struct of_device_id __initdata of_bus_ids[] = {
-- 
1.5.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/9] powerpc: fold the mpc8313 platform into the mpc831x platform

2008-01-24 Thread Kim Phillips
prepare for adding support for the mpc8315 rdb,
since they are identical wrt platform code.

Signed-off-by: Kim Phillips [EMAIL PROTECTED]
---
Kumar, this set of patches is base support for two new boards - the
mpc8315e rdb and the mpc837xe rdb.  Please consider for 2.6.25.  Thanks.

 arch/powerpc/configs/mpc8313_rdb_defconfig |2 +-
 arch/powerpc/platforms/83xx/Kconfig|6 ++--
 arch/powerpc/platforms/83xx/Makefile   |2 +-
 .../83xx/{mpc8313_rdb.c = mpc831x_rdb.c}  |   35 +++
 4 files changed, 18 insertions(+), 27 deletions(-)
 rename arch/powerpc/platforms/83xx/{mpc8313_rdb.c = mpc831x_rdb.c} (70%)

diff --git a/arch/powerpc/configs/mpc8313_rdb_defconfig 
b/arch/powerpc/configs/mpc8313_rdb_defconfig
index db08e73..3b29ac5 100644
--- a/arch/powerpc/configs/mpc8313_rdb_defconfig
+++ b/arch/powerpc/configs/mpc8313_rdb_defconfig
@@ -138,7 +138,7 @@ CONFIG_PPC_83xx=y
 # CONFIG_PPC_CELL is not set
 # CONFIG_PPC_CELL_NATIVE is not set
 # CONFIG_PQ2ADS is not set
-CONFIG_MPC8313_RDB=y
+CONFIG_MPC831x_RDB=y
 # CONFIG_MPC832x_MDS is not set
 # CONFIG_MPC832x_RDB is not set
 # CONFIG_MPC834x_MDS is not set
diff --git a/arch/powerpc/platforms/83xx/Kconfig 
b/arch/powerpc/platforms/83xx/Kconfig
index 2430ac8..faaa651 100644
--- a/arch/powerpc/platforms/83xx/Kconfig
+++ b/arch/powerpc/platforms/83xx/Kconfig
@@ -3,8 +3,8 @@ choice
depends on PPC_83xx
default MPC834x_MDS
 
-config MPC8313_RDB
-   bool Freescale MPC8313 RDB
+config MPC831x_RDB
+   bool Freescale MPC831x RDB
select DEFAULT_UIMAGE
help
  This option enables support for the MPC8313 RDB board.
@@ -61,7 +61,7 @@ config PPC_MPC831x
bool
select PPC_UDBG_16550
select PPC_INDIRECT_PCI
-   default y if MPC8313_RDB
+   default y if MPC831x_RDB
 
 config PPC_MPC832x
bool
diff --git a/arch/powerpc/platforms/83xx/Makefile 
b/arch/powerpc/platforms/83xx/Makefile
index df46629..a50 100644
--- a/arch/powerpc/platforms/83xx/Makefile
+++ b/arch/powerpc/platforms/83xx/Makefile
@@ -3,7 +3,7 @@
 #
 obj-y  := misc.o usb.o
 obj-$(CONFIG_PCI)  += pci.o
-obj-$(CONFIG_MPC8313_RDB)  += mpc8313_rdb.o
+obj-$(CONFIG_MPC831x_RDB)  += mpc831x_rdb.o
 obj-$(CONFIG_MPC832x_RDB)  += mpc832x_rdb.o
 obj-$(CONFIG_MPC834x_MDS)  += mpc834x_mds.o
 obj-$(CONFIG_MPC834x_ITX)  += mpc834x_itx.o
diff --git a/arch/powerpc/platforms/83xx/mpc8313_rdb.c 
b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
similarity index 70%
rename from arch/powerpc/platforms/83xx/mpc8313_rdb.c
rename to arch/powerpc/platforms/83xx/mpc831x_rdb.c
index 4996b7d..b484b2b 100644
--- a/arch/powerpc/platforms/83xx/mpc8313_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -1,7 +1,7 @@
 /*
- * arch/powerpc/platforms/83xx/mpc8313_rdb.c
+ * arch/powerpc/platforms/83xx/mpc831x_rdb.c
  *
- * Description: MPC8313x RDB board specific routines.
+ * Description: MPC831x RDB board specific routines.
  * This file is based on mpc834x_sys.c
  * Author: Lo Wlison [EMAIL PROTECTED]
  *
@@ -22,26 +22,17 @@
 
 #include mpc83xx.h
 
-#undef DEBUG
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
-/* 
- *
+/*
  * Setup the architecture
- *
  */
-static void __init mpc8313_rdb_setup_arch(void)
+static void __init mpc831x_rdb_setup_arch(void)
 {
 #ifdef CONFIG_PCI
struct device_node *np;
 #endif
 
if (ppc_md.progress)
-   ppc_md.progress(mpc8313_rdb_setup_arch(), 0);
+   ppc_md.progress(mpc831x_rdb_setup_arch(), 0);
 
 #ifdef CONFIG_PCI
for_each_compatible_node(np, pci, fsl,mpc8349-pci)
@@ -50,7 +41,7 @@ static void __init mpc8313_rdb_setup_arch(void)
mpc831x_usb_cfg();
 }
 
-void __init mpc8313_rdb_init_IRQ(void)
+void __init mpc831x_rdb_init_IRQ(void)
 {
struct device_node *np;
 
@@ -69,7 +60,7 @@ void __init mpc8313_rdb_init_IRQ(void)
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
  */
-static int __init mpc8313_rdb_probe(void)
+static int __init mpc831x_rdb_probe(void)
 {
unsigned long root = of_get_flat_dt_root();
 
@@ -86,13 +77,13 @@ static int __init declare_of_platform_devices(void)
of_platform_bus_probe(NULL, of_bus_ids, NULL);
return 0;
 }
-machine_device_initcall(mpc8313_rdb, declare_of_platform_devices);
+machine_device_initcall(mpc831x_rdb, declare_of_platform_devices);
 
-define_machine(mpc8313_rdb) {
-   .name   = MPC8313 RDB,
-   .probe  = mpc8313_rdb_probe,
-   .setup_arch = mpc8313_rdb_setup_arch,
-   .init_IRQ   = mpc8313_rdb_init_IRQ,
+define_machine(mpc831x_rdb) {
+   .name   = MPC831x RDB,
+   .probe  = mpc831x_rdb_probe,
+   .setup_arch = mpc831x_rdb_setup_arch,
+  

[PATCH 6/9] add the mpc8315 rdb defconfig

2008-01-24 Thread Kim Phillips
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
---
 arch/powerpc/configs/mpc8315_rdb_defconfig | 1417 
 1 files changed, 1417 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/configs/mpc8315_rdb_defconfig

diff --git a/arch/powerpc/configs/mpc8315_rdb_defconfig 
b/arch/powerpc/configs/mpc8315_rdb_defconfig
new file mode 100644
index 000..9adf7f9
--- /dev/null
+++ b/arch/powerpc/configs/mpc8315_rdb_defconfig
@@ -0,0 +1,1417 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.24-rc8
+# Wed Jan 23 20:02:25 2008
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+CONFIG_6xx=y
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_83xx=y
+CONFIG_PPC_FPU=y
+CONFIG_PPC_STD_MMU=y
+CONFIG_PPC_STD_MMU_32=y
+# CONFIG_PPC_MM_SLICES is not set
+# CONFIG_SMP is not set
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+CONFIG_DEFAULT_UIMAGE=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_FAIR_GROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_KALLSYMS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+# CONFIG_EPOLL is not set
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_KMOD is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED=anticipatory
+
+#
+# Platform support
+#
+# CONFIG_PPC_MULTIPLATFORM is not set
+# CONFIG_PPC_82xx is not set
+CONFIG_PPC_83xx=y
+# CONFIG_PPC_86xx is not set
+# CONFIG_PPC_MPC52xx is not set
+# CONFIG_PPC_MPC5200 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+CONFIG_MPC831x_RDB=y
+# CONFIG_MPC832x_MDS is not set
+# CONFIG_MPC832x_RDB is not set
+# CONFIG_MPC834x_MDS is not set
+# CONFIG_MPC834x_ITX is not set
+# CONFIG_MPC836x_MDS is not set
+# CONFIG_MPC837x_MDS is not set
+CONFIG_PPC_MPC831x=y
+CONFIG_IPIC=y
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPM2 is not set
+# CONFIG_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_FLATMEM_ENABLE=y

[PATCH 7/9] powerpc: add MPC837x RDB platform support

2008-01-24 Thread Kim Phillips
primarily based on mpc837x mds code.

Signed-off-by: Joe D'Abbraccio [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
---
 arch/powerpc/platforms/83xx/Kconfig   |8 ++-
 arch/powerpc/platforms/83xx/Makefile  |1 +
 arch/powerpc/platforms/83xx/mpc837x_rdb.c |   99 +
 3 files changed, 107 insertions(+), 1 deletions(-)
 create mode 100644 arch/powerpc/platforms/83xx/mpc837x_rdb.c

diff --git a/arch/powerpc/platforms/83xx/Kconfig 
b/arch/powerpc/platforms/83xx/Kconfig
index b478312..bfdcf89 100644
--- a/arch/powerpc/platforms/83xx/Kconfig
+++ b/arch/powerpc/platforms/83xx/Kconfig
@@ -55,6 +55,12 @@ config MPC837x_MDS
select DEFAULT_UIMAGE
help
  This option enables support for the MPC837x MDS Processor Board.
+
+config MPC837x_RDB
+   bool Freescale MPC837x RDB
+   select DEFAULT_UIMAGE
+   help
+ This option enables support for the MPC837x RDB Board.
 endchoice
 
 config PPC_MPC831x
@@ -85,4 +91,4 @@ config PPC_MPC837x
bool
select PPC_UDBG_16550
select PPC_INDIRECT_PCI
-   default y if MPC837x_MDS
+   default y if MPC837x_MDS || MPC837x_RDB
diff --git a/arch/powerpc/platforms/83xx/Makefile 
b/arch/powerpc/platforms/83xx/Makefile
index a50..e5ba0fb 100644
--- a/arch/powerpc/platforms/83xx/Makefile
+++ b/arch/powerpc/platforms/83xx/Makefile
@@ -10,3 +10,4 @@ obj-$(CONFIG_MPC834x_ITX) += mpc834x_itx.o
 obj-$(CONFIG_MPC836x_MDS)  += mpc836x_mds.o
 obj-$(CONFIG_MPC832x_MDS)  += mpc832x_mds.o
 obj-$(CONFIG_MPC837x_MDS)  += mpc837x_mds.o
+obj-$(CONFIG_MPC837x_RDB)  += mpc837x_rdb.o
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c 
b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
new file mode 100644
index 000..2293ae5
--- /dev/null
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -0,0 +1,99 @@
+/*
+ * arch/powerpc/platforms/83xx/mpc837x_rdb.c
+ *
+ * Copyright (C) 2007 Freescale Semicondutor, Inc. All rights reserved.
+ *
+ * MPC837x RDB board specific routines
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include linux/pci.h
+#include linux/of_platform.h
+
+#include asm/time.h
+#include asm/ipic.h
+#include asm/udbg.h
+
+#include mpc83xx.h
+
+extern int mpc837x_usb_cfg(void);
+
+/* 
+ *
+ * Setup the architecture
+ *
+ */
+static void __init mpc837x_rdb_setup_arch(void)
+{
+#ifdef CONFIG_PCI
+   struct device_node *np;
+#endif
+
+   if (ppc_md.progress)
+   ppc_md.progress(mpc837x_rdb_setup_arch(), 0);
+
+#ifdef CONFIG_PCI
+   for_each_compatible_node(np, pci, fsl,mpc8349-pci)
+   mpc83xx_add_bridge(np);
+#endif
+   mpc837x_usb_cfg();
+}
+
+static struct of_device_id mpc837x_ids[] = {
+   { .type = soc, },
+   { .compatible = soc, },
+   {},
+};
+
+static int __init mpc837x_declare_of_platform_devices(void)
+{
+   /* Publish of_device */
+   of_platform_bus_probe(NULL, mpc837x_ids, NULL);
+
+   return 0;
+}
+machine_device_initcall(mpc837x_rdb, mpc837x_declare_of_platform_devices);
+
+static void __init mpc837x_rdb_init_IRQ(void)
+{
+   struct device_node *np;
+
+   np = of_find_compatible_node(NULL, NULL, fsl,ipic);
+   if (!np)
+   return;
+
+   ipic_init(np, 0);
+
+   /* Initialize the default interrupt mapping priorities,
+* in case the boot rom changed something on us.
+*/
+   ipic_set_default_priority();
+}
+
+/*
+ * Called very early, MMU is off, device-tree isn't unflattened
+ */
+static int __init mpc837x_rdb_probe(void)
+{
+   unsigned long root = of_get_flat_dt_root();
+
+   return of_flat_dt_is_compatible(root, fsl,mpc8377rdb) ||
+  of_flat_dt_is_compatible(root, fsl,mpc8378rdb) ||
+  of_flat_dt_is_compatible(root, fsl,mpc8379rdb);
+}
+
+define_machine(mpc837x_rdb) {
+   .name   = MPC837x RDB,
+   .probe  = mpc837x_rdb_probe,
+   .setup_arch = mpc837x_rdb_setup_arch,
+   .init_IRQ   = mpc837x_rdb_init_IRQ,
+   .get_irq= ipic_get_irq,
+   .restart= mpc83xx_restart,
+   .time_init  = mpc83xx_time_init,
+   .calibrate_decr = generic_calibrate_decr,
+   .progress   = udbg_progress,
+};
-- 
1.5.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] [POWERPC] 85xx: Port STX GP3 board over from arch/ppc

2008-01-24 Thread Kumar Gala
 @@ -49,7 +57,7 @@ config MPC8540
 config MPC8560
  bool
  select CPM2
 -default y if MPC8560_ADS
 +default y if MPC8560_ADS || STX_GP3

 Can we select this from 8560 boards, instead of a default y list?

I'll rework the whole Kconfig after all these board ports go in.


- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


RE: [PATCH UCC TDM 3/3 ] Modified Documentation to explain dtsentries for TDM driver

2008-01-24 Thread Aggrwal Poonam
Hi Scott

The device tree already has a brg-frequency  property in qe node which
is the value of BRGCLK. The function get_brg_clk uses this property to
find the value of BRGCLK.
In case this value is 0(some older u-boots populate bus-frequency
property of qe and not the brg-frequency), get_brg_clk  uses
bus-frequency/2 as BRGCLK.


With Regards
Poonam 
 
 

-Original Message-
From: Wood Scott 
Sent: Friday, January 25, 2008 1:42 AM
To: Aggrwal Poonam
Cc: Gala Kumar; [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]; linuxppc-dev@ozlabs.org;
Barkowski Michael; Cutler Richard; Tabi Timur; Kalra Ashish
Subject: Re: [PATCH UCC TDM 3/3 ] Modified Documentation to explain
dtsentries for TDM driver

On Thu, Jan 24, 2008 at 10:24:13AM +0530, Poonam_Aggrwal-b10812 wrote:
 +  ix) Baud Rate Generator (BRG)
 +
 +  Required properties:
 +  - compatible : shpuld be fsl,cpm-brg
 +  - fsl,brg-sources : define the input clock for all 16 BRGs. The
input
 +clock source could be 1 to 24 for CLK1 to CLK24. Zero means that
the
 +particular BRG will be driven by QE clock(BRGCLK).

Should also have a clock-frequency property to specify what BRGCLK is.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


RE: [PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.

2008-01-24 Thread Aggrwal Poonam
Hello Anton/Tabi

I am not sure which is the best place to configure the pins. Because
some drivers do it in one way and some in the other.
I actually tried to make the driver similar to ucc_geth because it is a
QE driver. The driver has no platform code in the platform files similar
to ucc_geth. It is probed along with all the QE devices thorugh
of_platform_bus_probe.
And the pins are configured for all the QE devices using  par_io_init.
I thought this to be the most consistent way at that time.

How should we close this point?
Can we go ahead with the pio-map?

Infact the discussion in this thread was very good and I got to know a
lot of rationales behind this.

Please suggest.

Thanks and Regards
Poonam

From: Anton Vorontsov [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 24, 2008 10:53 PM
To: Tabi Timur
Cc: Aggrwal Poonam; Gala Kumar; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]; linuxppc-dev@ozlabs.org; Barkowski Michael;
Cutler Richard; Kalra Ashish
Subject: Re: [PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM
driver for MPC8323eRDB. Also includes related QE changes and dts
entries.

On Thu, Jan 24, 2008 at 10:33:47AM -0600, Timur Tabi wrote:
 Anton Vorontsov wrote:
 
 Are you saying that TDM is sharing same pins with the other QE 
 device, and we can choose to use/not use some device depending on 
 which driver is loaded?
 
 No.  I'd have to closely examine the DTS, but I don't think that UCC 
 devices share pins at all.  But that isn't my point.
 
 In that particular case UCC configuration is static, for every UCC.
 So, we can set up all pins in the firmware/board file.
 
 Yes, but deciding what the UCC does might not be static.  At what 
 point do we declare, UCC5 is for eth0 and eth0 only?
 
 The advantage of putting the pin configurations in the device tree is 
 that they now become configurable.  I can envision a scenario where 
 UCC5 could be either an Ethernet or a UART, depending on the setting 
 of some jumpers on the board. That's what the QE was designed for: any

 UCC can do any task, and you can even have a UCC change its purpose
while the system is running.
 So I don't want the pin configurations hard-coded into the kernel.  
 Having them in the device tree gives me some flexibility.

If hardware configuration is selected at the bootup time, by jumpers or
switches, it's even easier to do it right. Without pio-map.

 For instance, I have a plan (that I keep postponing) to introduce a 
 new feature in U-Boot where U-Boot can determine the settings of some 
 board jumpers and modify the device tree accordingly. The instructions

 on how to modify the device tree would be embedded in the tree itself.

Why you need to modify the device tree for that? Let the U-Boot simply
setup pins for the kernel. Regarding kernel overwriting pins
configuration...

 I can't
 support this feature if the kernel calls par_io_config_pin() 
 regardless of what's in the device tree.

What I've understood from the previous debates, is that ideally kernel
should not touch pins' configuration. Today we're using pio-map solely
to fix up some old firmware misconfiguration. And we can do this in the
board file still. To determine if we need to fixup the firmware or not,
we can use some device tree property instead (firmware version?).

p.s.
I'm neither for pio-map nor against. I just want some consequence
regarding this. Last thread ended with consequence that pio-map is a bad
thing to use...

--
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] [POWERPC] bootwrapper: Add find_node_by_compatible

2008-01-24 Thread Kumar Gala
Add the ability to find a device node by just what its compatible with.
This is useful in cases that we don't have a prop to find the node with.

---
 arch/powerpc/boot/libfdt-wrapper.c |9 +
 arch/powerpc/boot/ops.h|   11 +++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/libfdt-wrapper.c 
b/arch/powerpc/boot/libfdt-wrapper.c
index 97af36c..59016be 100644
--- a/arch/powerpc/boot/libfdt-wrapper.c
+++ b/arch/powerpc/boot/libfdt-wrapper.c
@@ -133,6 +133,14 @@ static void *fdt_wrapper_find_node_by_prop_value(const 
void *prev,
return offset_devp(offset);
 }

+static void *fdt_wrapper_find_node_by_compatible(const void *prev,
+const char *val)
+{
+   int offset = fdt_node_offset_by_compatible(fdt, devp_offset_find(prev),
+  val);
+   return offset_devp(offset);
+}
+
 static char *fdt_wrapper_get_path(const void *devp, char *buf, int len)
 {
int rc;
@@ -164,6 +172,7 @@ void fdt_init(void *blob)
dt_ops.get_parent = fdt_wrapper_get_parent;
dt_ops.create_node = fdt_wrapper_create_node;
dt_ops.find_node_by_prop_value = fdt_wrapper_find_node_by_prop_value;
+   dt_ops.find_node_by_compatible = fdt_wrapper_find_node_by_compatible;
dt_ops.get_path = fdt_wrapper_get_path;
dt_ops.finalize = fdt_wrapper_finalize;

diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h
index 5872ef1..4b0544b 100644
--- a/arch/powerpc/boot/ops.h
+++ b/arch/powerpc/boot/ops.h
@@ -46,6 +46,8 @@ struct dt_ops {
void *(*find_node_by_prop_value)(const void *prev,
 const char *propname,
 const char *propval, int proplen);
+   void *(*find_node_by_compatible)(const void *prev,
+const char *compat);
unsigned long (*finalize)(void);
char *(*get_path)(const void *phandle, char *buf, int len);
 };
@@ -172,6 +174,15 @@ static inline void *find_node_by_alias(const char *alias)
return NULL;
 }

+static inline void *find_node_by_compatible(const void *prev,
+const char *compat)
+{
+   if (dt_ops.find_node_by_compatible)
+   return dt_ops.find_node_by_compatible(prev, compat);
+
+   return NULL;
+}
+
 void dt_fixup_memory(u64 start, u64 size);
 void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq);
 void dt_fixup_clock(const char *path, u32 freq);
-- 
1.5.3.7

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH v3] [POWERPC] Add a cuboot wrapper for 85xx with CPM2

2008-01-24 Thread Kumar Gala
The bd info struct changes if we have CPM2 enabled in u-boot.

---
 arch/powerpc/boot/Makefile   |6 +++-
 arch/powerpc/boot/cuboot-85xx-cpm2.c |   66 ++
 2 files changed, 71 insertions(+), 1 deletions(-)
 create mode 100644 arch/powerpc/boot/cuboot-85xx-cpm2.c

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 1e20aca..1a42970 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -62,7 +62,8 @@ src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c 
cuboot-85xx.c holly.c
ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c 
\
fixed-head.S ep88xc.c cuboot-hpc2.c ep405.c cuboot-taishan.c \
-   cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c
+   cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \
+   cuboot-85xx-cpm2.c
 src-boot := $(src-wlib) $(src-plat) empty.c

 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -200,6 +201,9 @@ image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx
 image-$(CONFIG_STORCENTER) += cuImage.824x
 image-$(CONFIG_PPC_83xx)   += cuImage.83xx
 image-$(CONFIG_PPC_85xx)   += cuImage.85xx
+ifeq ($(CONFIG_CPM2),y)
+image-$(CONFIG_PPC_85xx)   += cuImage.85xx-cpm2
+endif
 image-$(CONFIG_MPC7448HPC2)+= cuImage.hpc2
 image-$(CONFIG_EBONY)  += treeImage.ebony cuImage.ebony
 image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo
diff --git a/arch/powerpc/boot/cuboot-85xx-cpm2.c 
b/arch/powerpc/boot/cuboot-85xx-cpm2.c
new file mode 100644
index 000..723872d
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-85xx-cpm2.c
@@ -0,0 +1,66 @@
+/*
+ * Old U-boot compatibility for 85xx
+ *
+ * Author: Scott Wood [EMAIL PROTECTED]
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include ops.h
+#include stdio.h
+#include cuboot.h
+
+#define TARGET_85xx
+#define TARGET_CPM2
+#include ppcboot.h
+
+static bd_t bd;
+
+static void platform_fixups(void)
+{
+   void *devp;
+
+   dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
+   dt_fixup_mac_address_by_alias(ethernet0, bd.bi_enetaddr);
+   dt_fixup_mac_address_by_alias(ethernet1, bd.bi_enet1addr);
+   dt_fixup_mac_address_by_alias(ethernet2, bd.bi_enet2addr);
+   dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 8, bd.bi_busfreq);
+
+   /* Unfortunately, the specific model number is encoded in the
+* soc node name in existing dts files -- once that is fixed,
+* this can do a simple path lookup.
+*/
+   devp = find_node_by_devtype(NULL, soc);
+   if (devp) {
+   void *serial = NULL;
+
+   setprop(devp, bus-frequency, bd.bi_busfreq,
+   sizeof(bd.bi_busfreq));
+
+   while ((serial = find_node_by_devtype(serial, serial))) {
+   if (get_parent(serial) != devp)
+   continue;
+
+   setprop(serial, clock-frequency, bd.bi_busfreq,
+   sizeof(bd.bi_busfreq));
+   }
+   }
+
+   devp = find_node_by_compatible(NULL, fsl,cpm2-brg);
+   if (devp)
+   setprop(devp, clock-frequency, bd.bi_brgfreq,
+   sizeof(bd.bi_brgfreq));
+}
+
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+   unsigned long r6, unsigned long r7)
+{
+   CUBOOT_INIT();
+   fdt_init(_dtb_start);
+   serial_console_init();
+   platform_ops.fixups = platform_fixups;
+}
-- 
1.5.3.7

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH v2] [POWERPC] 85xx: Port STX GP3 board over from arch/ppc

2008-01-24 Thread Kumar Gala
---

Handled feedback from Scott and Stephen.

- k

 arch/powerpc/boot/dts/stx_gp3_8560.dts |  217 ++
 arch/powerpc/configs/stx_gp3_defconfig | 1183 
 arch/powerpc/platforms/85xx/Kconfig|   12 +-
 arch/powerpc/platforms/85xx/Makefile   |1 +
 arch/powerpc/platforms/85xx/stx_gp3.c  |  190 +
 5 files changed, 1601 insertions(+), 2 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/stx_gp3_8560.dts
 create mode 100644 arch/powerpc/configs/stx_gp3_defconfig
 create mode 100644 arch/powerpc/platforms/85xx/stx_gp3.c

diff --git a/arch/powerpc/boot/dts/stx_gp3_8560.dts 
b/arch/powerpc/boot/dts/stx_gp3_8560.dts
new file mode 100644
index 000..1cec826
--- /dev/null
+++ b/arch/powerpc/boot/dts/stx_gp3_8560.dts
@@ -0,0 +1,217 @@
+/*
+ * STX GP3 - 8560 ADS Device Tree Source
+ *
+ * Copyright 2008 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/dts-v1/;
+
+/ {
+   model = stx,gp3;
+   compatible = stx,gp3-8560, stx,gp3;
+   #address-cells = 1;
+   #size-cells = 1;
+
+   aliases {
+   ethernet0 = enet0;
+   ethernet1 = enet1;
+   serial0 = serial0;
+   pci0 = pci0;
+   };
+
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   PowerPC,[EMAIL PROTECTED] {
+   device_type = cpu;
+   reg = 0;
+   d-cache-line-size = 32;
+   i-cache-line-size = 32;
+   d-cache-size = 32768;
+   i-cache-size = 32768;
+   timebase-frequency = 0;
+   bus-frequency = 0;
+   clock-frequency = 0;
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0x 0x1000;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 1;
+   device_type = soc;
+   ranges = 0 0xfdf0 0x10;
+   reg = 0xfdf0 0x1000;
+   bus-frequency = 0;
+   compatible = fsl,mpc8560-immr, simple-bus;
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,8540-memory-controller;
+   reg = 0x2000 0x1000;
+   interrupt-parent = mpic;
+   interrupts = 18 2;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,8540-l2-cache-controller;
+   reg = 0x2 0x1000;
+   cache-line-size = 32;
+   cache-size = 0x4; // L2, 256K
+   interrupt-parent = mpic;
+   interrupts = 16 2;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = fsl,gianfar-mdio;
+   reg = 0x24520 0x20;
+
+   phy2: [EMAIL PROTECTED] {
+   interrupt-parent = mpic;
+   interrupts = 5 4;
+   reg = 2;
+   device_type = ethernet-phy;
+   };
+   phy4: [EMAIL PROTECTED] {
+   interrupt-parent = mpic;
+   interrupts = 5 4;
+   reg = 4;
+   device_type = ethernet-phy;
+   };
+   };
+
+   enet0: [EMAIL PROTECTED] {
+   cell-index = 0;
+   device_type = network;
+   model = TSEC;
+   compatible = gianfar;
+   reg = 0x24000 0x1000;
+   local-mac-address = [ 00 00 00 00 00 00 ];
+   interrupts = 29 2 30 2 34 2;
+   interrupt-parent = mpic;
+   phy-handle = phy2;
+   };
+
+   enet1: [EMAIL PROTECTED] {
+   cell-index = 1;
+   device_type = network;
+   model = TSEC;
+   compatible = gianfar;
+   reg = 0x25000 0x1000;
+   local-mac-address = [ 00 00 00 00 00 00 ];
+   interrupts = 35 2 36 2 40 2;
+   interrupt-parent = mpic;
+   phy-handle = phy4;
+   };
+
+   mpic: [EMAIL PROTECTED] {
+   interrupt-controller;
+   

[PATCH] [POWERPC] 82xx and embedded6xx: Use machine_*_initcall() hooks in platform code

2008-01-24 Thread Grant Likely
From: Grant Likely [EMAIL PROTECTED]

Signed-off-by: Grant Likely [EMAIL PROTECTED]
---

 arch/powerpc/platforms/82xx/mpc8272_ads.c|5 +
 arch/powerpc/platforms/82xx/pq2fads.c|5 +
 arch/powerpc/platforms/embedded6xx/ls_uart.c |5 +
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/platforms/82xx/mpc8272_ads.c 
b/arch/powerpc/platforms/82xx/mpc8272_ads.c
index fd83440..3fce6b3 100644
--- a/arch/powerpc/platforms/82xx/mpc8272_ads.c
+++ b/arch/powerpc/platforms/82xx/mpc8272_ads.c
@@ -165,14 +165,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
 
 static int __init declare_of_platform_devices(void)
 {
-   if (!machine_is(mpc8272_ads))
-   return 0;
-
/* Publish the QE devices */
of_platform_bus_probe(NULL, of_bus_ids, NULL);
return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(mpc8272_ads, declare_of_platform_devices);
 
 /*
  * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/82xx/pq2fads.c 
b/arch/powerpc/platforms/82xx/pq2fads.c
index 1be5005..68196e3 100644
--- a/arch/powerpc/platforms/82xx/pq2fads.c
+++ b/arch/powerpc/platforms/82xx/pq2fads.c
@@ -176,14 +176,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
 
 static int __init declare_of_platform_devices(void)
 {
-   if (!machine_is(pq2fads))
-   return 0;
-
/* Publish the QE devices */
of_platform_bus_probe(NULL, of_bus_ids, NULL);
return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(pq2fads, declare_of_platform_devices);
 
 define_machine(pq2fads)
 {
diff --git a/arch/powerpc/platforms/embedded6xx/ls_uart.c 
b/arch/powerpc/platforms/embedded6xx/ls_uart.c
index c99264c..9d891bd 100644
--- a/arch/powerpc/platforms/embedded6xx/ls_uart.c
+++ b/arch/powerpc/platforms/embedded6xx/ls_uart.c
@@ -117,9 +117,6 @@ static int __init ls_uarts_init(void)
phys_addr_t phys_addr;
int len;
 
-   if (!machine_is(linkstation))
-   return 0;
-
avr = of_find_node_by_path(/soc10x/[EMAIL PROTECTED]);
if (!avr)
return -EINVAL;
@@ -142,4 +139,4 @@ static int __init ls_uarts_init(void)
return 0;
 }
 
-late_initcall(ls_uarts_init);
+machine_late_initcall(linkstation, ls_uarts_init);

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 8/9] powerpc: add the mpc837[789]_rdb dts files

2008-01-24 Thread Grant Likely
On 1/24/08, Kim Phillips [EMAIL PROTECTED] wrote:
 Add the dts files for the MPC838xE Reference Development Board (RDB).

 The board is a mini-ITX reference board with 256M DDR2, 8M flash,
 32M NAND, USB, PCI, gigabit ethernet, SATA, and serial.

 the difference among the three files is the 8377 has two, the 8378
 none, and the 8379 has four sata controllers.

All who want to see macro support in dts please raise your hands

Now we just need to find someone with the time to code it.  :-)

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH/RFC] [POWERPC] Allow multiple images to be built when CONFIG_DEFAULT_UIMAGE set

2008-01-24 Thread Grant Likely
Anybody have comments/concerns on this one?

Cheers,
g.

On 1/18/08, Grant Likely [EMAIL PROTECTED] wrote:
 From: Grant Likely [EMAIL PROTECTED]

 Most of the embedded board ports select CONFIG_DEFAULT_UIMAGE so that
 uImage files get built by default.  However, the current code casues
 the arch/powerpc/boot/Makefile to be called with the 'uImage' target
 and adds 'uImage' to the 'image-y' make variable.  If CONFIG_DEFAULT_UIMAGE
 is not set, then the boot makefile is called with target 'zImage'.

 However, the zImage target already automatically causes all targets
 listed in 'image-y' to be built, which includes uImage.

 This patch makes the default build target alwasy call the boot makefile
 using the 'zImage' target, regardless of if CONFIG_DEFAULT_UIMAGE is set.
 Making this change allows multiple boot images to be built from a single
 kernel compile.  An example of where this is useful is with the Efika
 and lite5200 boards.  Both boards can use the same kernel image (vmlinux),
 but they use different boot image files (zImage.chrp vs. uImage).  By
 making this change, the boot makefile now builds both by default so a
 single defconfig can be used for testing both platforms.

 This patch also eliminates the BOOTIMAGE variable because it doesn't
 appear to be used anywhere.  (Someone please correct me if I'm wrong)

 Signed-off-by: Grant Likely [EMAIL PROTECTED]
 ---

  arch/powerpc/Makefile |7 ++-
  1 files changed, 2 insertions(+), 5 deletions(-)

 diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
 index f70df9b..6451c2f 100644
 --- a/arch/powerpc/Makefile
 +++ b/arch/powerpc/Makefile
 @@ -151,10 +151,7 @@ core-$(CONFIG_XMON)+= arch/powerpc/xmon/
  drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/

  # Default to zImage, override when needed
 -defaultimage-y := zImage
 -defaultimage-$(CONFIG_DEFAULT_UIMAGE) := uImage
 -KBUILD_IMAGE := $(defaultimage-y)
 -all: $(KBUILD_IMAGE)
 +all: zImage

  CPPFLAGS_vmlinux.lds   := -Upowerpc

 @@ -180,7 +177,7 @@ define archhelp
  endef

  install: vdso_install
 -   $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
 +   $(Q)$(MAKE) $(build)=$(boot) install

  vdso_install:
  ifeq ($(CONFIG_PPC64),y)




-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/4] Search for and publish cell OF platform devices earlier

2008-01-24 Thread Michael Ellerman
Currently cell publishes OF devices at device_initcall() time, which
means the earliest a driver can bind to a device is also device_initcall()
time. We have a driver we want to register before other devices, so
publish the devices at subsys_initcall() time.

This should not cause any behaviour change for existing drivers, as they
are still bound at device_initcall() time.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
---
 arch/powerpc/platforms/cell/setup.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/cell/setup.c 
b/arch/powerpc/platforms/cell/setup.c
index e6534b5..a7f609b 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -98,7 +98,7 @@ static int __init cell_publish_devices(void)
}
return 0;
 }
-machine_device_initcall(cell, cell_publish_devices);
+machine_subsys_initcall(cell, cell_publish_devices);
 
 static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc)
 {
-- 
1.5.2.rc1.1884.g59b20

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 2/4] Create and hook up of_platform_device_shutdown

2008-01-24 Thread Michael Ellerman
Although of_platform_device's can have a shutdown routine, at the moment
the bus code doesn't actually call it. So add the required glue to
hook the shutdown routine.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
---
 drivers/of/platform.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)


CC various folks who've written/touched of_platform_drivers which already
have shutdown routines. These routines have never been called so they're
about to get their first testing.

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index b47bb2d..ca09a63 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -85,6 +85,15 @@ static int of_platform_device_resume(struct device * dev)
return error;
 }
 
+static void of_platform_device_shutdown(struct device *dev)
+{
+   struct of_device *of_dev = to_of_device(dev);
+   struct of_platform_driver *drv = to_of_platform_driver(dev-driver);
+
+   if (dev-driver  drv-shutdown)
+   drv-shutdown(of_dev);
+}
+
 int of_bus_type_init(struct bus_type *bus, const char *name)
 {
bus-name = name;
@@ -93,6 +102,7 @@ int of_bus_type_init(struct bus_type *bus, const char *name)
bus-remove = of_platform_device_remove;
bus-suspend = of_platform_device_suspend;
bus-resume = of_platform_device_resume;
+   bus-shutdown = of_platform_device_shutdown;
return bus_register(bus);
 }
 
-- 
1.5.2.rc1.1884.g59b20

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 3/4] Convert axon_msi to an of_platform driver

2008-01-24 Thread Michael Ellerman
Now that we create of_platform devices earlier on cell, we can make the
axon_msi driver an of_platform driver. This makes the code cleaner in
several ways, and most importantly means we have a struct device.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
---
 arch/powerpc/platforms/cell/axon_msi.c |   76 ++-
 1 files changed, 34 insertions(+), 42 deletions(-)

diff --git a/arch/powerpc/platforms/cell/axon_msi.c 
b/arch/powerpc/platforms/cell/axon_msi.c
index 095988f..ea3dc8c 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -13,7 +13,7 @@
 #include linux/kernel.h
 #include linux/pci.h
 #include linux/msi.h
-#include linux/reboot.h
+#include linux/of_platform.h
 
 #include asm/dcr.h
 #include asm/machdep.h
@@ -67,12 +67,9 @@ struct axon_msic {
struct irq_host *irq_host;
__le32 *fifo;
dcr_host_t dcr_host;
-   struct list_head list;
u32 read_offset;
 };
 
-static LIST_HEAD(axon_msic_list);
-
 static void msic_dcr_write(struct axon_msic *msic, unsigned int dcr_n, u32 val)
 {
pr_debug(axon_msi: dcr_write(0x%x, 0x%x)\n, val, dcr_n);
@@ -292,30 +289,25 @@ static struct irq_host_ops msic_host_ops = {
.map= msic_host_map,
 };
 
-static int axon_msi_notify_reboot(struct notifier_block *nb,
- unsigned long code, void *data)
+static int axon_msi_shutdown(struct of_device *device)
 {
-   struct axon_msic *msic;
+   struct axon_msic *msic = device-dev.platform_data;
u32 tmp;
 
-   list_for_each_entry(msic, axon_msic_list, list) {
-   pr_debug(axon_msi: disabling %s\n,
- msic-irq_host-of_node-full_name);
-   tmp  = dcr_read(msic-dcr_host, MSIC_CTRL_REG);
-   tmp = ~MSIC_CTRL_ENABLE  ~MSIC_CTRL_IRQ_ENABLE;
-   msic_dcr_write(msic, MSIC_CTRL_REG, tmp);
-   }
+   pr_debug(axon_msi: disabling %s\n,
+ msic-irq_host-of_node-full_name);
+   tmp  = dcr_read(msic-dcr_host, MSIC_CTRL_REG);
+   tmp = ~MSIC_CTRL_ENABLE  ~MSIC_CTRL_IRQ_ENABLE;
+   msic_dcr_write(msic, MSIC_CTRL_REG, tmp);
 
return 0;
 }
 
-static struct notifier_block axon_msi_reboot_notifier = {
-   .notifier_call = axon_msi_notify_reboot
-};
-
-static int axon_msi_setup_one(struct device_node *dn)
+static int axon_msi_probe(struct of_device *device,
+ const struct of_device_id *device_id)
 {
struct page *page;
+   struct device_node *dn = device-node;
struct axon_msic *msic;
unsigned int virq;
int dcr_base, dcr_len;
@@ -385,7 +377,11 @@ static int axon_msi_setup_one(struct device_node *dn)
MSIC_CTRL_IRQ_ENABLE | MSIC_CTRL_ENABLE |
MSIC_CTRL_FIFO_SIZE);
 
-   list_add(msic-list, axon_msic_list);
+   device-dev.platform_data = msic;
+
+   ppc_md.setup_msi_irqs = axon_msi_setup_msi_irqs;
+   ppc_md.teardown_msi_irqs = axon_msi_teardown_msi_irqs;
+   ppc_md.msi_check_device = axon_msi_check_device;
 
printk(KERN_DEBUG axon_msi: setup MSIC on %s\n, dn-full_name);
 
@@ -402,28 +398,24 @@ out:
return -1;
 }
 
-static int axon_msi_init(void)
-{
-   struct device_node *dn;
-   int found = 0;
-
-   pr_debug(axon_msi: initialising ...\n);
-
-   for_each_compatible_node(dn, NULL, ibm,axon-msic) {
-   if (axon_msi_setup_one(dn) == 0)
-   found++;
-   }
-
-   if (found) {
-   ppc_md.setup_msi_irqs = axon_msi_setup_msi_irqs;
-   ppc_md.teardown_msi_irqs = axon_msi_teardown_msi_irqs;
-   ppc_md.msi_check_device = axon_msi_check_device;
-
-   register_reboot_notifier(axon_msi_reboot_notifier);
+static const struct of_device_id axon_msi_device_id[] = {
+   {
+   .compatible = ibm,axon-msic
+   },
+   {}
+};
 
-   pr_debug(axon_msi: registered callbacks!\n);
-   }
+static struct of_platform_driver axon_msi_driver = {
+   .match_table= axon_msi_device_id,
+   .probe  = axon_msi_probe,
+   .shutdown   = axon_msi_shutdown,
+   .driver = {
+   .name   = axon-msi
+   },
+};
 
-   return 0;
+static int __init axon_msi_init(void)
+{
+   return of_register_platform_driver(axon_msi_driver);
 }
-arch_initcall(axon_msi_init);
+subsys_initcall(axon_msi_init);
-- 
1.5.2.rc1.1884.g59b20

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 4/4] Avoid DMA exception when using axon_msi with IOMMU

2008-01-24 Thread Michael Ellerman
There's a brown-paper-bag bug in axon_msi, we pass the address of our
FIFO directly to the hardware, without DMA mapping it. This leads to
DMA exceptions if you enable MSI  the IOMMU.

The fix is to correctly DMA map the fifo, dma_alloc_coherent() does
what we want - and we need to track the virt  phys addresses.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
---
 arch/powerpc/platforms/cell/axon_msi.c |   21 ++---
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/platforms/cell/axon_msi.c 
b/arch/powerpc/platforms/cell/axon_msi.c
index ea3dc8c..b9a97c4 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -65,7 +65,8 @@
 
 struct axon_msic {
struct irq_host *irq_host;
-   __le32 *fifo;
+   __le32 *fifo_virt;
+   dma_addr_t fifo_phys;
dcr_host_t dcr_host;
u32 read_offset;
 };
@@ -91,7 +92,7 @@ static void axon_msi_cascade(unsigned int irq, struct 
irq_desc *desc)
 
while (msic-read_offset != write_offset) {
idx  = msic-read_offset / sizeof(__le32);
-   msi  = le32_to_cpu(msic-fifo[idx]);
+   msi  = le32_to_cpu(msic-fifo_virt[idx]);
msi = 0x;
 
pr_debug(axon_msi: woff %x roff %x msi %x\n,
@@ -306,7 +307,6 @@ static int axon_msi_shutdown(struct of_device *device)
 static int axon_msi_probe(struct of_device *device,
  const struct of_device_id *device_id)
 {
-   struct page *page;
struct device_node *dn = device-node;
struct axon_msic *msic;
unsigned int virq;
@@ -338,16 +338,14 @@ static int axon_msi_probe(struct of_device *device,
goto out_free_msic;
}
 
-   page = alloc_pages_node(of_node_to_nid(dn), GFP_KERNEL,
-   get_order(MSIC_FIFO_SIZE_BYTES));
-   if (!page) {
+   msic-fifo_virt = dma_alloc_coherent(device-dev, MSIC_FIFO_SIZE_BYTES,
+msic-fifo_phys, GFP_KERNEL);
+   if (!msic-fifo_virt) {
printk(KERN_ERR axon_msi: couldn't allocate fifo for %s\n,
   dn-full_name);
goto out_free_msic;
}
 
-   msic-fifo = page_address(page);
-
msic-irq_host = irq_alloc_host(of_node_get(dn), IRQ_HOST_MAP_NOMAP,
NR_IRQS, msic_host_ops, 0);
if (!msic-irq_host) {
@@ -370,9 +368,9 @@ static int axon_msi_probe(struct of_device *device,
pr_debug(axon_msi: irq 0x%x setup for axon_msi\n, virq);
 
/* Enable the MSIC hardware */
-   msic_dcr_write(msic, MSIC_BASE_ADDR_HI_REG, (u64)msic-fifo  32);
+   msic_dcr_write(msic, MSIC_BASE_ADDR_HI_REG, msic-fifo_phys  32);
msic_dcr_write(msic, MSIC_BASE_ADDR_LO_REG,
- (u64)msic-fifo  0x);
+ msic-fifo_phys  0x);
msic_dcr_write(msic, MSIC_CTRL_REG,
MSIC_CTRL_IRQ_ENABLE | MSIC_CTRL_ENABLE |
MSIC_CTRL_FIFO_SIZE);
@@ -390,7 +388,8 @@ static int axon_msi_probe(struct of_device *device,
 out_free_host:
kfree(msic-irq_host);
 out_free_fifo:
-   __free_pages(virt_to_page(msic-fifo), get_order(MSIC_FIFO_SIZE_BYTES));
+   dma_free_coherent(device-dev, MSIC_FIFO_SIZE_BYTES, msic-fifo_virt,
+ msic-fifo_phys);
 out_free_msic:
kfree(msic);
 out:
-- 
1.5.2.rc1.1884.g59b20

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: 2.6.24 Kernel oops will running kernbench regression from 2.6.24-rc8-mm1

2008-01-24 Thread Kamalesh Babulal
Paul Mackerras wrote:
 Kamalesh Babulal writes:
 
 NIP: 4570 LR: 0fc42dc0 CTR: 
 REGS: c0077b6bf8c0 TRAP: 0300   Not tainted  (2.6.24-rc8-mm1-autotest)
 MSR: 80001000 ME  CR: 28022422  XER: 
 DAR: c0077b6bfce0, DSISR: 0a00
 
 Actually, how much RAM does this machine have?  If it has less than
 32GB, then the problem is that the kernel stack pointer is bogus.
 (How it got to be bogus is the interesting question, of course. :)
 
 Paul.
 
Hi Paul,

This kernel oops in seen in 2.6.24-rc8-git(2,3,4,5,7,8) and the 2.6.24.

 Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=32 NUMA pSeries
Modules linked in:
NIP: 4570 LR: 1030e594 CTR: 1012ddd0
REGS: c00771f9f8c0 TRAP: 0300   Not tainted  (2.6.24-autotest)
MSR: 80001000 ME  CR: 28000482  XER: 2000
DAR: c00771f9fce0, DSISR: 0a00
TASK = c0077b9c6000[19197] 'cc1' THREAD: c00771f9c000 CPU: 2
GPR00: 0064 c00771f9fb40 f7fdb470  
GPR04: 0002  00782498 003ff3ff 
GPR08: aaab 4484 c00771f9fe30 998be2321500 
GPR12: 80003030 c05c5680 1003 1003 
GPR16: 105b 105b 1044 105b 
GPR20: 105b 105f  ffd00b44 
GPR24: 105b 105b 105b 105b 
GPR28: 105b 10604684 0100 105f75a8 
NIP [4570] 0x4570
LR [1030e594] 0x1030e594
Call Trace:
[c00771f9fb40] [c00771f9fcf0] 0xc00771f9fcf0 (unreliable)
Instruction dump:
4800    41820008    
4810    f92101a0    
---[ end trace a8c779b801674eed ]---
-- 0:conmux-control -- time-stamp -- Jan/24/08 16:40:29 --
-- 0:conmux-control -- time-stamp -- Jan/24/08 16:47:56 --
Unable to handle kernel paging request for data at address 0xc0077168f870
Faulting instruction address: 0x4570
Oops: Kernel access of bad area, sig: 11 [#2]
SMP NR_CPUS=32 NUMA pSeries
Modules linked in:
NIP: 4570 LR: c004a310 CTR: 
REGS: c0077168f450 TRAP: 0300   Tainted: G  D  (2.6.24-autotest)
MSR: 80001000 ME  CR: 28000242  XER: 
DAR: c0077168f870, DSISR: 0a00
TASK = c00771fdb170[24200] 'tbench' THREAD: c0077168c000 CPU: 1
GPR00:  c0077168f6d0 c068bc30 80009032 
GPR04: 80001030 025a 42000222 c000ee64 
GPR08: c0077168fae0 28000242 c0077168f9c0 998be2321500 
GPR12: 80001030 c05c5480   
GPR16: 100a 100a8b10 100a 1000 
GPR20: 5e84 c0008cd4 c0077168c000 c00771fdb390 
GPR24: 0001 ff9ce668 ff9cec5c c00771fdb170 
GPR28: 0001 c0077ca7cba0 c0615938  
NIP [4570] 0x4570
LR [c004a310] .finish_task_switch+0x54/0xe8
Call Trace:
[c0077168f6d0] [c0077168f790] 0xc0077168f790 (unreliable)
Instruction dump:
4800    41820008    
4810    f92101a0    

-- 
Thanks  Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: reduce code duplication in legacy_serial, add UART parent types

2008-01-24 Thread Arnd Bergmann
On Thursday 24 January 2008, Paul Gortmaker wrote:
 The legacy_serial was treating each UART parent in a separate code block.
 Rather than continue this trend for the new parent IDs, this condenses
 all (soc, tsi, opb, plus two more new types) into one of_device_id array.
 The new types are wrs,epld-localbus for the Wind River sbc8560, and a
 more generic simple-bus as requested by Scott Wood.
 
 Signed-off-by: Paul Gortmaker [EMAIL PROTECTED]

Looks good to me, thanks!
  
 -   /* First fill our array with SOC ports */
 +   /* Iterate over all the 16550 ports, looking for known parents */
 for_each_compatible_node(np, serial, ns16550) {
 -   struct device_node *soc = of_get_parent(np);
 -   if (soc  !strcmp(soc-type, soc)) {
 +   struct device_node *parent = of_get_parent(np);
 +   if (!parent)
 +   continue;
 +   if (of_match_node(parents, parent) != NULL) {

Personally, I prefer to write this as

if (of_match_node(parents, parent)) {

but that question of coding style is controversial enough that I
stopped insisting on that, so do whichever you like best.

Arnd 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] mpc834x_mds: Convert device tree source to dts-v1

2008-01-24 Thread Paul Gortmaker
Move mpc834x_mds device tree source forward to dts-v1 format.  Nothing
too complex in this one, so it boils down to just adding a bunch of 0x
in the right places and converting clock speeds to decimal.

Signed-off-by: Paul Gortmaker [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/mpc834x_mds.dts |  254 +
 1 files changed, 128 insertions(+), 126 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc834x_mds.dts 
b/arch/powerpc/boot/dts/mpc834x_mds.dts
index 4120e92..16345f2 100644
--- a/arch/powerpc/boot/dts/mpc834x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc834x_mds.dts
@@ -9,6 +9,8 @@
  * option) any later version.
  */
 
+/dts-v1/;
+
 / {
model = MPC8349EMDS;
compatible = MPC8349EMDS, MPC834xMDS, MPC83xxMDS;
@@ -31,10 +33,10 @@
PowerPC,[EMAIL PROTECTED] {
device_type = cpu;
reg = 0;
-   d-cache-line-size = 20;   // 32 bytes
-   i-cache-line-size = 20;   // 32 bytes
-   d-cache-size = 8000;  // L1, 32K
-   i-cache-size = 8000;  // L1, 32K
+   d-cache-line-size = 0x20; // 32 bytes
+   i-cache-line-size = 0x20; // 32 bytes
+   d-cache-size = 0x8000;// L1, 32K
+   i-cache-size = 0x8000;// L1, 32K
timebase-frequency = 0;   // from bootloader
bus-frequency = 0;// from bootloader
clock-frequency = 0;  // from bootloader
@@ -43,26 +45,26 @@
 
memory {
device_type = memory;
-   reg =  1000;  // 256MB at 0
+   reg = 0x 0x1000;  // 256MB at 0
};
 
[EMAIL PROTECTED] {
device_type = board-control;
-   reg = e240 8000;
+   reg = 0xe240 0x8000;
};
 
[EMAIL PROTECTED] {
#address-cells = 1;
#size-cells = 1;
device_type = soc;
-   ranges = 0 e000 0010;
-   reg = e000 0200;
+   ranges = 0x0 0xe000 0x0010;
+   reg = 0xe000 0x0200;
bus-frequency = 0;
 
[EMAIL PROTECTED] {
device_type = watchdog;
compatible = mpc83xx_wdt;
-   reg = 200 100;
+   reg = 0x200 0x100;
};
 
[EMAIL PROTECTED] {
@@ -70,14 +72,14 @@
#size-cells = 0;
cell-index = 0;
compatible = fsl-i2c;
-   reg = 3000 100;
-   interrupts = e 8;
-   interrupt-parent =  ipic ;
+   reg = 0x3000 0x100;
+   interrupts = 0xe 0x8;
+   interrupt-parent = ipic;
dfsrr;
 
[EMAIL PROTECTED] {
compatible = dallas,ds1374;
-   reg = 68;
+   reg = 0x68;
};
};
 
@@ -86,41 +88,41 @@
#size-cells = 0;
cell-index = 1;
compatible = fsl-i2c;
-   reg = 3100 100;
-   interrupts = f 8;
-   interrupt-parent =  ipic ;
+   reg = 0x3100 0x100;
+   interrupts = 0xf 0x8;
+   interrupt-parent = ipic;
dfsrr;
};
 
[EMAIL PROTECTED] {
device_type = spi;
compatible = fsl_spi;
-   reg = 7000 1000;
-   interrupts = 10 8;
-   interrupt-parent =  ipic ;
+   reg = 0x7000 0x1000;
+   interrupts = 0x10 0x8;
+   interrupt-parent = ipic;
mode = cpu;
};
 
-   /* phy type (ULPI or SERIAL) are only types supportted for MPH 
*/
+   /* phy type (ULPI or SERIAL) are only types supported for MPH */
/* port = 0 or 1 */
[EMAIL PROTECTED] {
compatible = fsl-usb2-mph;
-   reg = 22000 1000;
+   reg = 0x22000 0x1000;
#address-cells = 1;
#size-cells = 0;
-   interrupt-parent =  ipic ;
-   interrupts = 27 8;
+   interrupt-parent = ipic;
+   interrupts = 0x27 0x8;
phy_type = ulpi;
port1;

Re: ppc32: Weird process scheduling behaviour with 2.6.24-rc

2008-01-24 Thread Benjamin Herrenschmidt

On Wed, 2008-01-23 at 13:42 +0100, Peter Zijlstra wrote:
 Another question, do you have:
   CONFIG_FAIR_GROUP_SCHED=y
 
 if so, does flipping that off have any effect?

Yes.

Here, I do the test of running 4 times the repro-case provided by Michel
with nice 19 and a dd eating CPU with nice 0.

Without this option, I get the dd at 100% and the nice 19 shells down
below it with whatever is left of the CPUs.

With this option, dd gets about 50% of one CPU and the niced processes
still get most of the time.

Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: ppc32: Weird process scheduling behaviour with 2.6.24-rc

2008-01-24 Thread Benjamin Herrenschmidt

On Fri, 2008-01-25 at 17:54 +1100, Benjamin Herrenschmidt wrote:
 
 Here, I do the test of running 4 times the repro-case provided by Michel
 with nice 19 and a dd eating CPU with nice 0.
 
 Without this option, I get the dd at 100% and the nice 19 shells down
 below it with whatever is left of the CPUs.
 
 With this option, dd gets about 50% of one CPU and the niced processes
 still get most of the time.

FYI. This is a 4 way G5 (ppc64)

Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: ppc32: Weird process scheduling behaviour with 2.6.24-rc

2008-01-24 Thread Benjamin Herrenschmidt

On Fri, 2008-01-25 at 18:03 +1100, Benjamin Herrenschmidt wrote:
 On Fri, 2008-01-25 at 17:54 +1100, Benjamin Herrenschmidt wrote:
  
  Here, I do the test of running 4 times the repro-case provided by Michel
  with nice 19 and a dd eating CPU with nice 0.
  
  Without this option, I get the dd at 100% and the nice 19 shells down
  below it with whatever is left of the CPUs.
  
  With this option, dd gets about 50% of one CPU and the niced processes
  still get most of the time.
 
 FYI. This is a 4 way G5 (ppc64)

I also tested responsiveness of X running with or without that option
and with niced CPU eaters in the background (still 4 of them, one per
CPU), and I can confirm Michel observations, it gets very sluggish
(maybe not -as- bad as his but still pretty annoying) with the fair
group scheduler enabled.

Here, X is running with nice=0

Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


  1   2   >