regarding cpm_uart and platform_bus_type

2007-07-17 Thread Alexandros Kostopoulos
Hi all,

I was wondering, since arch/powerpc is now based on device trees,  
shouldn't the cpm_uart driver (or at least a branch of it for  
arch/powerpc) be changed to use of_platform_bus_type instead of  
platform_bus_type? In my opinion, cpm_uart driver should take all its  
configuration (uart address base, ints etc) from dts (via the of_platform  
code) without any intervention from board specific code. In any case,  
given the current situation, how can I pass cpm_uart the address/irq of  
the uarts? by hardcoding it in my board specific code? mpc82xx_ads.c  
doesn't seem to have such code, and I was wondering how SCC uarts work in  
this platform? Who initializes them?

thank you

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


Re: hvc_iseries not working

2007-07-17 Thread Olaf Hering
On Mon, Jul 16, Will Schmidt wrote:

> On Fri, 2007-07-13 at 19:05 +0200, Olaf Hering wrote:
> > 2.6.21 arch/powerpc/configs/iseries_defconfig works on an i825 with v5r4
> > 2.6.22 arch/powerpc/configs/iseries_defconfig does not. But it works on
> > a i820 with v5r3.
> > 2.6.22 boots ok with CONFIG_VIOCONS
> 
> When it works, do you have more than one processor assigned to the
> partition?   

The partition does not change, only the kernel (And iseries_defconfig) changes.
The partition has a single cpu assigned, 0.8 %
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/4] Add DMA sector to Documentation/powerpc/booting-without-of.txt file.

2007-07-17 Thread Paul Mackerras
Segher Boessenkool writes:

> The device tree describes _all_ hardware in the system,
> not just the things that are somewhat harder to probe
> for.

Actually, for embedded systems, the device tree is really only
required to describe the things that it's useful for the Linux kernel
to know.

The point of the device tree for embedded systems is to provide
configuration information, not to be able to claim compliance with
some set of legalistic requirements. :)

I think in some cases we have gone a little over the top in trying to
put everything in the device tree, in fact.  Ultimately I think it has
to be up to the more experienced embedded developers to say how much
detail in the device tree is actually helpful and how much is dead
weight.

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


Re: regarding cpm_uart and platform_bus_type

2007-07-17 Thread Alexandros Kostopoulos
Hm, it seems that, after all, cpm_uart works fine without any board  
specific code whatsoever. Sorry about the fuss. My mistake

Regards

Alex


On Tue, 17 Jul 2007 14:55:30 +0300, Alexandros Kostopoulos  
<[EMAIL PROTECTED]> wrote:

> Hi all,
>
> I was wondering, since arch/powerpc is now based on device trees,  
> shouldn't the cpm_uart driver (or at least a branch of it for  
> arch/powerpc) be changed to use of_platform_bus_type instead of  
> platform_bus_type? In my opinion, cpm_uart driver should take all its  
> configuration (uart address base, ints etc) from dts (via the  
> of_platform code) without any intervention from board specific code. In  
> any case, given the current situation, how can I pass cpm_uart the  
> address/irq of the uarts? by hardcoding it in my board specific code?  
> mpc82xx_ads.c doesn't seem to have such code, and I was wondering how  
> SCC uarts work in this platform? Who initializes them?
>
> thank you
>
> Alex


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


RE: [PATCH] USB_DR host support for FSL MPC831x

2007-07-17 Thread Li Yang-r58472
Hi Vitaly,

I believe that your patch is addresses by my patch in 2.6.23 queue:
http://www.kernel.org/pub/linux/kernel/people/gregkh/usb/2.6/2.6.22/usb-
ehci_fsl-update-for-mpc831x-support.patch

- Leo

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] 
> On Behalf Of Vitaly Bordug
> Sent: Tuesday, July 17, 2007 8:59 AM
> To: Greg KH
> Cc: linuxppc-dev@ozlabs.org
> Subject: [PATCH] USB_DR host support for FSL MPC831x
> 
> 
> Modifies fsl_ehci code so that to get USB host working on 
> mpc831x platform. Verified with MPC8313RDB reference board.
> 
> Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>
> 
> ---
> 
>  arch/powerpc/boot/dts/mpc8313erdb.dts |1 +
>  drivers/usb/host/ehci-fsl.c   |4 +++-
>  drivers/usb/host/ehci-hcd.c   |2 +-
>  3 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts 
> b/arch/powerpc/boot/dts/mpc8313erdb.dts
> index 1b351dc..c330e79 100644
> --- a/arch/powerpc/boot/dts/mpc8313erdb.dts
> +++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
> @@ -90,6 +90,7 @@
>   interrupt-parent = < &ipic >;
>   interrupts = <26 8>;
>   phy_type = "utmi_wide";
> + control_init  = <0280>; // UTMI ext 
> 48 MHz clk
>   };
>  
>   [EMAIL PROTECTED] {
> diff --git a/drivers/usb/host/ehci-fsl.c 
> b/drivers/usb/host/ehci-fsl.c index c7a7c59..3e3187b 100644
> --- a/drivers/usb/host/ehci-fsl.c
> +++ b/drivers/usb/host/ehci-fsl.c
> @@ -185,12 +185,14 @@ static void mpc83xx_usb_setup(struct 
> usb_hcd *hcd)
>   struct ehci_hcd *ehci = hcd_to_ehci(hcd);
>   struct fsl_usb2_platform_data *pdata;
>   void __iomem *non_ehci = hcd->regs;
> + u32 temp;
>  
>   pdata =
>   (struct fsl_usb2_platform_data *)hcd->self.controller->
>   platform_data;
>   /* Enable PHY interface in the control reg. */
> - out_be32(non_ehci + FSL_SOC_USB_CTRL, 0x0004);
> + temp = in_be32(non_ehci + FSL_SOC_USB_CTRL);
> + out_be32(non_ehci + FSL_SOC_USB_CTRL, temp | 0x0004);
>   out_be32(non_ehci + FSL_SOC_USB_SNOOP1, 0x001b);
>  
>  #if defined(CONFIG_PPC32) && !defined(CONFIG_NOT_COHERENT_CACHE)
> diff --git a/drivers/usb/host/ehci-hcd.c 
> b/drivers/usb/host/ehci-hcd.c index 099aff6..994a127 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -925,7 +925,7 @@ MODULE_LICENSE ("GPL");
>  #define  PCI_DRIVER  ehci_pci_driver
>  #endif
>  
> -#ifdef CONFIG_MPC834x
> +#if defined(CONFIG_MPC834x) || defined(CONFIG_PPC_MPC831x)
>  #include "ehci-fsl.c"
>  #define  PLATFORM_DRIVER ehci_fsl_driver
>  #endif
> 
> ___
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
> 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


RE: [PATCH] USB_DR device support for FSL MPC831x

2007-07-17 Thread Li Yang-r58472
Hi Vitaly,

The max_ep_nr will be read from DCCPARAMS register with my patch in
2.6.23 queue:
http://www.kernel.org/pub/linux/kernel/people/gregkh/usb/2.6/2.6.22/usb-
fsl_usb2_udc-get-max-ep-number-from-dccparams-register.patch

- Leo

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] 
> On Behalf Of Vitaly Bordug
> Sent: Tuesday, July 17, 2007 8:59 AM
> To: Greg KH
> Cc: linuxppc-dev@ozlabs.org
> Subject: [PATCH] USB_DR device support for FSL MPC831x
> 
> 
> This adds support for USB device mode on mpc831x series. 
> Devicetree node modification is required to make it work - 
> 
> dr_mode ="peripheral";
> 
> which should be commented out if host mode is desired onboot.
> 
> Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>
> 
> ---
> 
>  arch/powerpc/sysdev/fsl_soc.c |1 +
>  include/linux/fsl_devices.h   |1 +
>  2 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/sysdev/fsl_soc.c 
> b/arch/powerpc/sysdev/fsl_soc.c index c0ddc80..27a1510 100644
> --- a/arch/powerpc/sysdev/fsl_soc.c
> +++ b/arch/powerpc/sysdev/fsl_soc.c
> @@ -514,6 +514,7 @@ static int __init fsl_usb_of_init(void)
>   }
>   } else if (prop && !strcmp(prop, "peripheral")) {
>   usb_data.operating_mode = FSL_USB2_DR_DEVICE;
> + usb_data.max_ep_nr = *(unsigned 
> int*)of_get_property(np, 
> +"max_ep_nr",NULL);
>   usb_dev_dr_client = 
> platform_device_register_simple(
>   "fsl-usb2-udc", i, r, 2);
>   if (IS_ERR(usb_dev_dr_client)) {
> diff --git a/include/linux/fsl_devices.h 
> b/include/linux/fsl_devices.h index 12e631f..a3feb34 100644
> --- a/include/linux/fsl_devices.h
> +++ b/include/linux/fsl_devices.h
> @@ -103,6 +103,7 @@ struct fsl_usb2_platform_data {
>   enum fsl_usb2_operating_modes   operating_mode;
>   enum fsl_usb2_phy_modes phy_mode;
>   unsigned intport_enables;
> + unsigned intmax_ep_nr;
>  };
>  
>  /* Flags in fsl_usb2_mph_platform_data */
> 
> ___
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
> 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2/3] 82xx: Parse SMC serial device node in DTS

2007-07-17 Thread Arnd Bergmann
On Tuesday 17 July 2007, Mark Zhan wrote:
> On Tue, 2007-07-17 at 03:02 +0200, Arnd Bergmann wrote:
> > On Monday 16 July 2007, Mark Zhan wrote:
> > > -               cpm_uart_data.uart_clk = ppc_proc_freq;
> > > +               if (strstr(model, "SMC")) {
> > > +                       cpm_uart_dev = 
> > > platform_device_register_simple("fsl-cpm-smc:uart",
> > > +                                                       i, &r[0], 3);
> > > +               } else if (strstr(model, "SCC")) {
> > > +                       cpm_uart_dev = 
> > > platform_device_register_simple("fsl-cpm-scc:uart",
> > > +                                                       i, &r[0], 3);
> > > +               }
> >
> > You should probably use of_device_is_compatible() to check
> > if a given device can be used by a particular driver.
>
> I think, the function of_find_compatible_node(), which is called in the
> for loop, has already done that. So definitely, no need to call
> of_device_is_compatible() any more.

It's a little more complicated than that. The "compatible" property should
indicate the exact interface of that device, so the "model" does not really
matter here. I don't know the difference between smc and scc, but if you
need to register them as different pplatform devices, they should
normally also have different names in "compatible", possibly in addition
to the existing one.

If the compatible property contains "fsl,cpm-smc\0cpm_uart", you can scan for
either of them. The loop will iterate over all cpm_uart compatible devices,
while the later test will look for an fsl,cpm-smc compatible device.

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


Re: [PATCH] POWERPC: add support of the GiGE switch for mpc8313RDB via fixed PHY

2007-07-17 Thread Segher Boessenkool
> This utilises pretend phy, making access to it via device tree.  
> GiGE switch
> is connected to TSEC1 with fixed gigE link, so we need to emulate it
> via artificial PHY to make it work.

Even if "pretend phy" in the device tree would be a good
idea (and it's not)...

>   #size-cells = <0>;
>   phy1: [EMAIL PROTECTED] {
>   interrupt-parent = < &ipic >;
> + compatible = "fixed";

...you cannot seriously believe you are allowed to claim
the name "fixed" for it.

NAK.


Segher

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


Re: [PATCH 3/3] 82xx: SBCPQ2 board platform support

2007-07-17 Thread Arnd Bergmann
On Tuesday 17 July 2007, Mark Zhan wrote:
> Hi Arnd,
> 

> > > +/*
> > > + * For SBCPQ2 board, the interrupt of M48T59 RTC chip
> > > + * will generate a machine check exception. We use a
> > > + * fake irq to give the platform machine_check_exception() hook
> > > + * a chance to call the driver ISR. If IRQ_HANDLED is returned,
> > > + * then we will survive from the machine check exception.
> > > + */
> > > +static int sbcpq2_mach_check(struct pt_regs *regs)
> > > +{
> > > + int recover = 0;
> > > + struct irq_desc *desc = irq_desc + SBCPQ2_M48T59_IRQ;
> > > +
> > > + struct irqaction *action = desc->action;
> > > +
> > > + while (action && (action->dev_id != &m48t59_rtc))
> > > + action = action->next;
> > > +
> > > + /* Try to call m48t59 RTC driver ISR */
> > > + if (action && action->handler)
> > > + recover = action->handler(SBCPQ2_M48T59_IRQ, &m48t59_rtc);
> > > +
> > > + return recover;
> > > +}
> > 
> > What you do here looks really scary, but maybe I'm just misunderstanding
> > it completely. Why don't you just register your rtc handler function
> > as the machine check handler instead of going through various indirections?
> > 
> 
> The rtc M48T59 driver is not specific to my board, it is probably used
> by other board. So I can't register the rtc intr handler as the mcheck
> exception handler. And in the other side, there are also other machine
> check sources, right?
> 
> So here I add a platform mcheck hook for rtc intr handler. Yeah, it is
> really scary and confusing:-)

I think it would really be easier to just make the m48t59 irq handler
a global function, and keep it out of the regular interrupt logic.

Then your sbcpq2_mach_check() basically becomes trivial like

static int sbcpq2_mach_check(struct pt_regs *regs)
{
return m48t59_irq(NO_IRQ, NULL);
}

This has the advantage that you don't need to wait for the
m48t59 driver to be initialized first, instead you will just
get a link failure it that driver is not already built into the
kernel.

> > > +static void __init sbcpq2_init_IRQ(void)
> > > +{
> > > + struct device_node *np;
> > > + struct resource res;
> > > +
> > > + np = of_find_compatible_node(NULL, "cpm-pic", "CPM2");
> > > + if (np == NULL) {
> > > + printk(KERN_ERR "PIC init: can not find cpm-pic node\n");
> > > + return;
> > > + }
> > 
> > This looks like your device tree is wrong. Shouldn't the interrupt
> > controller have device_type="interrupt-controller" and a specific
> > compatible property instead of having the name in the device_type?
> > 
> 
> Here, I just copy the codes from mpc82xx_ads, is there anything wrong?

I just checked the Recommended Practice document for interrupt mapping
and it seems that it's ok. The interrupt controller needs to have
an property named "interrupt-controller", but does not need a specific
device_type. So it appears to be correct here.

> > > + /* Boot Flash is the on-board flash */
> > > + mc->memc_br0 = (SBCPQ2_BOOT_FLASH_BASE & 0x8000) | 0x0801;
> > > + mc->memc_or0 = 0xFFE00896;
> > 
> > consequently, this needs to use out_be32 or similar.
> > Where does SBCPQ2_BOOT_FLASH_BASE come from? Shouldn't that be set
> > up by the boot loader to match the device tree?
> 
> Fixed. out_be32 is used.

btw, it would be good if you can run your code through the 'sparse'
checker. It will warn about this type of problem. I think I saw all
that you have added here, but I may have missed some, and sparse
can also find other problems.  Just install the tool as it comes
with your distro and build the kernel with the 'C=1' make option.

> The reason why they are needed is because some 
> legacy u-boot for this board probably was setting up the wrong memory
> map.

Hmm, will those legacy u-boot version be able to even boot this kernel?
The device tree looks like it needs to have some variables set by u-boot,
so I'd guess you don't need to worry about old versions that don't
set those either.

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


[PATCH] adb: replace sleep notifier with platform driver suspend/resume hooks

2007-07-17 Thread Johannes Berg
This patch replaces the pmu sleep notifier that adb had with
suspend/resume hooks in a new platform driver/device.

Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]>

---
 drivers/macintosh/adb.c |   96 
 1 file changed, 57 insertions(+), 39 deletions(-)

--- wireless-dev.orig/drivers/macintosh/adb.c   2007-07-17 14:01:59.660964463 
+0200
+++ wireless-dev/drivers/macintosh/adb.c2007-07-17 14:05:20.650964463 
+0200
@@ -89,14 +89,6 @@ static int sleepy_trackpad;
 static int autopoll_devs;
 int __adb_probe_sync;
 
-#ifdef CONFIG_PM
-static void adb_notify_sleep(struct pmu_sleep_notifier *self, int when);
-static struct pmu_sleep_notifier adb_sleep_notifier = {
-   adb_notify_sleep,
-   SLEEP_LEVEL_ADB,
-};
-#endif
-
 static int adb_scan_bus(void);
 static int do_adb_reset_bus(void);
 static void adbdev_init(void);
@@ -281,6 +273,36 @@ adb_reset_bus(void)
return 0;
 }
 
+#ifdef CONFIG_PM
+/*
+ * notify clients before sleep
+ */
+static int adb_suspend(struct platform_device *dev, pm_message_t state)
+{
+   adb_got_sleep = 1;
+   /* We need to get a lock on the probe thread */
+   down(&adb_probe_mutex);
+   /* Stop autopoll */
+   if (adb_controller->autopoll)
+   adb_controller->autopoll(0);
+   blocking_notifier_call_chain(&adb_client_list, ADB_MSG_POWERDOWN, NULL);
+
+   return 0;
+}
+
+/*
+ * reset bus after sleep
+ */
+static int adb_resume(struct platform_device *dev)
+{
+   adb_got_sleep = 0;
+   up(&adb_probe_mutex);
+   adb_reset_bus();
+
+   return 0;
+}
+#endif /* CONFIG_PM */
+
 int __init adb_init(void)
 {
struct adb_driver *driver;
@@ -313,14 +335,12 @@ int __init adb_init(void)
printk(KERN_WARNING "Warning: no ADB interface detected\n");
adb_controller = NULL;
} else {
-#ifdef CONFIG_PM
-   pmu_register_sleep_notifier(&adb_sleep_notifier);
-#endif /* CONFIG_PM */
 #ifdef CONFIG_PPC
if (machine_is_compatible("AAPL,PowerBook1998") ||
machine_is_compatible("PowerBook1,1"))
sleepy_trackpad = 1;
 #endif /* CONFIG_PPC */
+
init_completion(&adb_probe_task_comp);
adbdev_init();
adb_reset_bus();
@@ -330,33 +350,6 @@ int __init adb_init(void)
 
 __initcall(adb_init);
 
-#ifdef CONFIG_PM
-/*
- * notify clients before sleep and reset bus afterwards
- */
-void
-adb_notify_sleep(struct pmu_sleep_notifier *self, int when)
-{
-   switch (when) {
-   case PBOOK_SLEEP_REQUEST:
-   adb_got_sleep = 1;
-   /* We need to get a lock on the probe thread */
-   down(&adb_probe_mutex);
-   /* Stop autopoll */
-   if (adb_controller->autopoll)
-   adb_controller->autopoll(0);
-   blocking_notifier_call_chain(&adb_client_list,
-   ADB_MSG_POWERDOWN, NULL);
-   break;
-   case PBOOK_WAKE:
-   adb_got_sleep = 0;
-   up(&adb_probe_mutex);
-   adb_reset_bus();
-   break;
-   }
-}
-#endif /* CONFIG_PM */
-
 static int
 do_adb_reset_bus(void)
 {
@@ -864,7 +857,29 @@ static const struct file_operations adb_
.release= adb_release,
 };
 
-static void
+static struct platform_driver adb_pfdrv = {
+   .driver = {
+   .name = "adb",
+   },
+#ifdef CONFIG_PM
+   .suspend = adb_suspend,
+   .resume = adb_resume,
+#endif
+};
+
+static struct platform_device adb_pfdev = {
+   .name = "adb",
+};
+
+static int __init
+adb_dummy_probe(struct platform_device *dev)
+{
+   if (dev == &adb_pfdev)
+   return 0;
+   return -ENODEV;
+}
+
+static void __init
 adbdev_init(void)
 {
if (register_chrdev(ADB_MAJOR, "adb", &adb_fops)) {
@@ -876,4 +891,7 @@ adbdev_init(void)
if (IS_ERR(adb_dev_class))
return;
class_device_create(adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, 
"adb");
+
+   platform_device_register(&adb_pfdev);
+   platform_driver_probe(&adb_pfdrv, adb_dummy_probe);
 }


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


[PATCH] remove awacs dmasound

2007-07-17 Thread Johannes Berg
This patch kills the obsolete awacs dmasound because it is in
the way of doing power management improvements since it uses
ancient API.

Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Cc: Adrian Bunk <[EMAIL PROTECTED]>

---
This patch contains only the patch for the first two files here, please
remove the other ones manually:

git rm -- sound/oss/dmasound/awacs_defs.h
git rm -- sound/oss/dmasound/dac3550a.c
git rm -- sound/oss/dmasound/dmasound_awacs.c
git rm -- sound/oss/dmasound/tas3001c.c
git rm -- sound/oss/dmasound/tas3001c.h
git rm -- sound/oss/dmasound/tas3001c_tables.c
git rm -- sound/oss/dmasound/tas3004.c
git rm -- sound/oss/dmasound/tas3004.h
git rm -- sound/oss/dmasound/tas3004_tables.c
git rm -- sound/oss/dmasound/tas_common.c
git rm -- sound/oss/dmasound/tas_common.h
git rm -- sound/oss/dmasound/tas_eq_prefs.h
git rm -- sound/oss/dmasound/tas_ioctl.h
git rm -- sound/oss/dmasound/trans_16.c

 sound/oss/dmasound/Kconfig   |   14 
 sound/oss/dmasound/Makefile  |6 
 sound/oss/dmasound/awacs_defs.h  |  251 --
 sound/oss/dmasound/dac3550a.c|  209 --
 sound/oss/dmasound/dmasound_awacs.c  | 3215 ---
 sound/oss/dmasound/tas3001c.c|  849 -
 sound/oss/dmasound/tas3001c.h|   64 
 sound/oss/dmasound/tas3001c_tables.c |  375 
 sound/oss/dmasound/tas3004.c | 1138 
 sound/oss/dmasound/tas3004.h |   77 
 sound/oss/dmasound/tas3004_tables.c  |  301 ---
 sound/oss/dmasound/tas_common.c  |  214 --
 sound/oss/dmasound/tas_common.h  |  284 ---
 sound/oss/dmasound/tas_eq_prefs.h|   24 
 sound/oss/dmasound/tas_ioctl.h   |   24 
 sound/oss/dmasound/trans_16.c|  898 -
 16 files changed, 7943 deletions(-)


--- wireless-dev.orig/sound/oss/dmasound/Makefile   2007-05-01 
11:35:44.664734191 +0200
+++ wireless-dev/sound/oss/dmasound/Makefile2007-05-01 11:36:26.054734191 
+0200
@@ -2,12 +2,6 @@
 # Makefile for the DMA sound driver
 #
 
-dmasound_pmac-y+= dmasound_awacs.o \
-  trans_16.o dac3550a.o tas_common.o \
-  tas3001c.o tas3001c_tables.o \
-  tas3004.o tas3004_tables.o
-
 obj-$(CONFIG_DMASOUND_ATARI)   += dmasound_core.o dmasound_atari.o
-obj-$(CONFIG_DMASOUND_PMAC)+= dmasound_core.o dmasound_pmac.o
 obj-$(CONFIG_DMASOUND_PAULA)   += dmasound_core.o dmasound_paula.o
 obj-$(CONFIG_DMASOUND_Q40) += dmasound_core.o dmasound_q40.o


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


[PATCH] via-pmu: kill sleep notifiers completely

2007-07-17 Thread Johannes Berg
This patch kills off the remnants of the ancient sleep notifiers.

Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]>

---
 drivers/macintosh/via-pmu.c |   71 
 include/linux/pmu.h |   36 --
 2 files changed, 107 deletions(-)

--- wireless-dev.orig/drivers/macintosh/via-pmu.c   2007-07-17 
14:01:58.990964463 +0200
+++ wireless-dev/drivers/macintosh/via-pmu.c2007-07-17 14:05:22.150964463 
+0200
@@ -177,7 +177,6 @@ static struct proc_dir_entry *proc_pmu_b
 
 int __fake_sleep;
 int asleep;
-BLOCKING_NOTIFIER_HEAD(sleep_notifier_list);
 
 #ifdef CONFIG_ADB
 static int adb_dev_map;
@@ -1738,67 +1737,7 @@ pmu_present(void)
return via != 0;
 }
 
-#ifdef CONFIG_PM
-
-static LIST_HEAD(sleep_notifiers);
-
-int
-pmu_register_sleep_notifier(struct pmu_sleep_notifier *n)
-{
-   struct list_head *list;
-   struct pmu_sleep_notifier *notifier;
-
-   for (list = sleep_notifiers.next; list != &sleep_notifiers;
-list = list->next) {
-   notifier = list_entry(list, struct pmu_sleep_notifier, list);
-   if (n->priority > notifier->priority)
-   break;
-   }
-   __list_add(&n->list, list->prev, list);
-   return 0;
-}
-EXPORT_SYMBOL(pmu_register_sleep_notifier);
-
-int
-pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* n)
-{
-   if (n->list.next == 0)
-   return -ENOENT;
-   list_del(&n->list);
-   n->list.next = NULL;
-   return 0;
-}
-EXPORT_SYMBOL(pmu_unregister_sleep_notifier);
-#endif /* CONFIG_PM */
-
 #if defined(CONFIG_PM) && defined(CONFIG_PPC32)
-
-/* Sleep is broadcast last-to-first */
-static void broadcast_sleep(int when)
-{
-   struct list_head *list;
-   struct pmu_sleep_notifier *notifier;
-
-   for (list = sleep_notifiers.prev; list != &sleep_notifiers;
-list = list->prev) {
-   notifier = list_entry(list, struct pmu_sleep_notifier, list);
-   notifier->notifier_call(notifier, when);
-   }
-}
-
-/* Wake is broadcast first-to-last */
-static void broadcast_wake(void)
-{
-   struct list_head *list;
-   struct pmu_sleep_notifier *notifier;
-
-   for (list = sleep_notifiers.next; list != &sleep_notifiers;
-list = list->next) {
-   notifier = list_entry(list, struct pmu_sleep_notifier, list);
-   notifier->notifier_call(notifier, PBOOK_WAKE);
-   }
-}
-
 /*
  * This struct is used to store config register values for
  * PCI devices which may get powered off when we sleep.
@@ -2003,9 +1942,6 @@ pmac_suspend_devices(void)
 
pm_prepare_console();

-   /* Notify old-style device drivers */
-   broadcast_sleep(PBOOK_SLEEP_REQUEST);
-
/* Sync the disks. */
/* XXX It would be nice to have some way to ensure that
 * nobody is dirtying any new buffers while we wait. That
@@ -2014,12 +1950,9 @@ pmac_suspend_devices(void)
 */
sys_sync();
 
-   broadcast_sleep(PBOOK_SLEEP_NOW);
-
/* Send suspend call to devices, hold the device core's dpm_sem */
ret = device_suspend(PMSG_SUSPEND);
if (ret) {
-   broadcast_wake();
printk(KERN_ERR "Driver sleep failed\n");
return -EBUSY;
}
@@ -2060,7 +1993,6 @@ pmac_suspend_devices(void)
local_irq_enable();
preempt_enable();
device_resume();
-   broadcast_wake();
printk(KERN_ERR "Driver powerdown failed\n");
return -EBUSY;
}
@@ -2114,9 +2046,6 @@ pmac_wakeup_devices(void)
/* Resume devices */
device_resume();
 
-   /* Notify old style drivers */
-   broadcast_wake();
-
pm_restore_console();
 
return 0;
--- wireless-dev.orig/include/linux/pmu.h   2007-07-17 14:01:59.030964463 
+0200
+++ wireless-dev/include/linux/pmu.h2007-07-17 14:05:22.150964463 +0200
@@ -159,42 +159,6 @@ extern void pmu_unlock(void);
 extern int pmu_present(void);
 extern int pmu_get_model(void);
 
-#ifdef CONFIG_PM
-/*
- * Stuff for putting the powerbook to sleep and waking it again.
- *
- */
-#include 
-
-struct pmu_sleep_notifier
-{
-   void (*notifier_call)(struct pmu_sleep_notifier *self, int when);
-   int priority;
-   struct list_head list;
-};
-
-/* Code values for calling sleep/wakeup handlers
- */
-#define PBOOK_SLEEP_REQUEST1
-#define PBOOK_SLEEP_NOW2
-#define PBOOK_WAKE 3
-
-/* priority levels in notifiers */
-#define SLEEP_LEVEL_VIDEO  100 /* Video driver (first wake) */
-#define SLEEP_LEVEL_MEDIABAY   90  /* Media bay driver */
-#define SLEEP_LEVEL_BLOCK  80  /* IDE, SCSI */
-#define SLEEP_LEVEL_NET70  /* bmac, gmac */
-#define SLEEP_LEVEL_MISC   60  /* Anything else */
-#define SLEEP_LEVEL

Re: [PATCH] remove awacs dmasound

2007-07-17 Thread Adrian Bunk
On Tue, Jul 17, 2007 at 03:28:31PM +0200, Johannes Berg wrote:
> This patch kills the obsolete awacs dmasound because it is in
> the way of doing power management improvements since it uses
> ancient API.
> 
> Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
> Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
> Cc: Adrian Bunk <[EMAIL PROTECTED]>
> 
> ---
> This patch contains only the patch for the first two files here, please
> remove the other ones manually:
> 
> git rm -- sound/oss/dmasound/awacs_defs.h
> git rm -- sound/oss/dmasound/dac3550a.c
> git rm -- sound/oss/dmasound/dmasound_awacs.c
> git rm -- sound/oss/dmasound/tas3001c.c
> git rm -- sound/oss/dmasound/tas3001c.h
> git rm -- sound/oss/dmasound/tas3001c_tables.c
> git rm -- sound/oss/dmasound/tas3004.c
> git rm -- sound/oss/dmasound/tas3004.h
> git rm -- sound/oss/dmasound/tas3004_tables.c
> git rm -- sound/oss/dmasound/tas_common.c
> git rm -- sound/oss/dmasound/tas_common.h
> git rm -- sound/oss/dmasound/tas_eq_prefs.h
> git rm -- sound/oss/dmasound/tas_ioctl.h
> git rm -- sound/oss/dmasound/trans_16.c
> 
>  sound/oss/dmasound/Kconfig   |   14 

That's not in your patch, most likely because it's already removed as 
scheduled.

>  sound/oss/dmasound/Makefile  |6 
>  sound/oss/dmasound/awacs_defs.h  |  251 --
>  sound/oss/dmasound/dac3550a.c|  209 --
>  sound/oss/dmasound/dmasound_awacs.c  | 3215 
> ---
>  sound/oss/dmasound/tas3001c.c|  849 -
>  sound/oss/dmasound/tas3001c.h|   64 
>  sound/oss/dmasound/tas3001c_tables.c |  375 
>  sound/oss/dmasound/tas3004.c | 1138 
>  sound/oss/dmasound/tas3004.h |   77 
>  sound/oss/dmasound/tas3004_tables.c  |  301 ---
>  sound/oss/dmasound/tas_common.c  |  214 --
>  sound/oss/dmasound/tas_common.h  |  284 ---
>  sound/oss/dmasound/tas_eq_prefs.h|   24 
>  sound/oss/dmasound/tas_ioctl.h   |   24 
>  sound/oss/dmasound/trans_16.c|  898 -
>  16 files changed, 7943 deletions(-)
>...

The option is already removed from the Kconfig file, and the code 
removal is scheduled for 2.6.24. I'll take care of this (I'll send
a patch through Andrew).

cu
Adrian

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed

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


Re: [PATCH 3/3] 82xx: SBCPQ2 board platform support

2007-07-17 Thread Mark Zhan
> > The rtc M48T59 driver is not specific to my board, it is probably used
> > by other board. So I can't register the rtc intr handler as the mcheck
> > exception handler. And in the other side, there are also other machine
> > check sources, right?
> > 
> > So here I add a platform mcheck hook for rtc intr handler. Yeah, it is
> > really scary and confusing:-)
> 
> I think it would really be easier to just make the m48t59 irq handler
> a global function, and keep it out of the regular interrupt logic.
> 
> Then your sbcpq2_mach_check() basically becomes trivial like
> 
> static int sbcpq2_mach_check(struct pt_regs *regs)
> {
>   return m48t59_irq(NO_IRQ, NULL);
> }
> 
> This has the advantage that you don't need to wait for the
> m48t59 driver to be initialized first, instead you will just
> get a link failure it that driver is not already built into the
> kernel.
> 

Since the rtc m48t59 driver has already gone into the -mm source tree,
and I think, it is an ugly way to make the irq handler a global
function:-)

If the driver is not built-in, and I still get the mach check exception,
it will turn out that other factors are causing mach check exception,
then just like my original codes, the kernel will not survive this
machine check, right?

> > > > +static void __init sbcpq2_init_IRQ(void)
> > > > +{
> > > > +   struct device_node *np;
> > > > +   struct resource res;
> > > > +
> > > > +   np = of_find_compatible_node(NULL, "cpm-pic", "CPM2");
> > > > +   if (np == NULL) {
> > > > +   printk(KERN_ERR "PIC init: can not find cpm-pic 
> > > > node\n");
> > > > +   return;
> > > > +   }
> > > 
> > > This looks like your device tree is wrong. Shouldn't the interrupt
> > > controller have device_type="interrupt-controller" and a specific
> > > compatible property instead of having the name in the device_type?
> > > 
> > 
> > Here, I just copy the codes from mpc82xx_ads, is there anything wrong?
> 
> I just checked the Recommended Practice document for interrupt mapping
> and it seems that it's ok. The interrupt controller needs to have
> an property named "interrupt-controller", but does not need a specific
> device_type. So it appears to be correct here.
> 

Thanks a lot for your good adivce, I will try.


> > > > +   /* Boot Flash is the on-board flash */
> > > > +   mc->memc_br0 = (SBCPQ2_BOOT_FLASH_BASE & 0x8000) | 0x0801;
> > > > +   mc->memc_or0 = 0xFFE00896;
> > > 
> > > consequently, this needs to use out_be32 or similar.
> > > Where does SBCPQ2_BOOT_FLASH_BASE come from? Shouldn't that be set
> > > up by the boot loader to match the device tree?
> > 
> > Fixed. out_be32 is used.
> 
> btw, it would be good if you can run your code through the 'sparse'
> checker. It will warn about this type of problem. I think I saw all
> that you have added here, but I may have missed some, and sparse
> can also find other problems.  Just install the tool as it comes
> with your distro and build the kernel with the 'C=1' make option.
> 
> > The reason why they are needed is because some 
> > legacy u-boot for this board probably was setting up the wrong memory
> > map.
> 
> Hmm, will those legacy u-boot version be able to even boot this kernel?
> The device tree looks like it needs to have some variables set by u-boot,
> so I'd guess you don't need to worry about old versions that don't
> set those either.

Actually, the current u-boot 1.2.0 for this board is ported from that
legacy one, and I don't check the details to assure that u-boot's setup
is all right. So here I just want to double assure everything goes
correct.

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


Re: [PATCH] remove awacs dmasound

2007-07-17 Thread Johannes Berg
On Tue, 2007-07-17 at 15:37 +0200, Adrian Bunk wrote:

> >  sound/oss/dmasound/Kconfig   |   14 
> 
> That's not in your patch, most likely because it's already removed as 
> scheduled.

Ah, good point, I just removed it manually from the patch knowing that
it was gone from the config.

> The option is already removed from the Kconfig file, and the code 
> removal is scheduled for 2.6.24. I'll take care of this (I'll send
> a patch through Andrew).

Alright. It uses the sleep notifiers I wanted to remove so I didn't want
to leave it even if it's not selectable.

johannes


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH 2/3] 82xx: Parse SMC serial device node in DTS

2007-07-17 Thread Mark Zhan
On Tue, 2007-07-17 at 14:06 +0200, Arnd Bergmann wrote:
> On Tuesday 17 July 2007, Mark Zhan wrote:
> > On Tue, 2007-07-17 at 03:02 +0200, Arnd Bergmann wrote:
> > > On Monday 16 July 2007, Mark Zhan wrote:
> > > > -   cpm_uart_data.uart_clk = ppc_proc_freq;
> > > > +   if (strstr(model, "SMC")) {
> > > > +   cpm_uart_dev = 
> > > > platform_device_register_simple("fsl-cpm-smc:uart",
> > > > +   i, &r[0], 3);
> > > > +   } else if (strstr(model, "SCC")) {
> > > > +   cpm_uart_dev = 
> > > > platform_device_register_simple("fsl-cpm-scc:uart",
> > > > +   i, &r[0], 3);
> > > > +   }
> > >
> > > You should probably use of_device_is_compatible() to check
> > > if a given device can be used by a particular driver.
> >
> > I think, the function of_find_compatible_node(), which is called in the
> > for loop, has already done that. So definitely, no need to call
> > of_device_is_compatible() any more.
> 
> It's a little more complicated than that. The "compatible" property should
> indicate the exact interface of that device, so the "model" does not really
> matter here. I don't know the difference between smc and scc, but if you
> need to register them as different pplatform devices, they should
> normally also have different names in "compatible", possibly in addition
> to the existing one.
> 
> If the compatible property contains "fsl,cpm-smc\0cpm_uart", you can scan for
> either of them. The loop will iterate over all cpm_uart compatible devices,
> while the later test will look for an fsl,cpm-smc compatible device.

Arnd,

Yes, basically I agree what you say. That should be the right way. 

but, the current situation is that: in all DTS files that are using smc
or scc as uart device, all device node definitions have the same
"compatible" property -- "cpm_uart"

So what I do here is just following the upstream source tree.

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


Re: [PATCH 2/3] 82xx: Parse SMC serial device node in DTS

2007-07-17 Thread Arnd Bergmann
On Tuesday 17 July 2007, Mark Zhan wrote:
> Yes, basically I agree what you say. That should be the right way. 
> 
> but, the current situation is that: in all DTS files that are using smc
> or scc as uart device, all device node definitions have the same
> "compatible" property -- "cpm_uart"
> 
> So what I do here is just following the upstream source tree.
> 

Well, AFAICS, all of them currently use scc. The 8xx platforms don't
even build correctly in the mainline kernel, so I guess it would
be good to change them to also list fsl,cpm-smc in the compatible
property.

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


Re: [PATCH 3/3] 82xx: SBCPQ2 board platform support

2007-07-17 Thread Arnd Bergmann
On Tuesday 17 July 2007, Mark Zhan wrote:
> 
> Since the rtc m48t59 driver has already gone into the -mm source tree,
> and I think, it is an ugly way to make the irq handler a global
> function:-)
> 
> If the driver is not built-in, and I still get the mach check exception,
> it will turn out that other factors are causing mach check exception,
> then just like my original codes, the kernel will not survive this
> machine check, right?

Ok, I missed the point that you also have real machine check events
to care about.

One issue remains though: you still need to have a virtual irq number,
not just make up a IRQ, as there is nothing that guarantees this to work.

Since you already create your own irq_host, you can probably just
give the fake irq the number '1' here, which is local to that host.
Then you call irq_create_mapping() to create the virtual interrupt
number that you pass to the platform_device.

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


Re: [RFC][PATCH 6/8] Walnut DTS

2007-07-17 Thread Segher Boessenkool
> + #address-cells = <0>;
> + #size-cells = <0>;

 No need for these.
>>>
>>> Isn't a good practice to put #address-cells in interrupt controller
>>> nodes?
>>
>> It is not.
>
> Well, that's debatable... but yes, a strict reading of the spec would
> say that you should put neither #address-cells nor #size-cells in a  
> leaf
> interrupt controller.

Yes.

>>> If the device tree has an interrupt map defined the interrupt
>>> parent 'unit interrupt specifier' has to be interpreted according
>>> to the #address-cells of the interrupt parent.
>>
>> And "#address-cells" is defaulted to 0 if it is absent,
>> for the purpose of interrupt mapping (but not for its
>> other purposes).
>
> This is a bit confusing though,

Yes, I shouldn't say "defaulted" -- a unit interrupt specifier
simply has no unit address part, in an interrupt domain that
doesn't correspond to a "normal" bus.  But saying it like this
is a little bit inexact, and it uses more words.

> which is why I tend to prefer having it
> explicitely in the interrupt controller node :-)

Which is simply incorrect.

> I tend to dislike
> "magic" defaults, we've had problems with them in the past and will  
> have
> in the future, I much prefer having things explicit whenever possible.

You mean, the magic default values you used for #address-cells
and #size-cells?  That was simply a bug, someone forgot to read
the documentation...

>> That "typical practice" is inspired by the need to explicitly
>> put #address-cells and #size-cells into the device tree if you
>> want Linux to properly parse the device tree, even if the default
>> values would work perfectly (if Linux would work correctly,
>> that is).
>
> Linux does handle default values in some areas. The problem with  
> default
> values is that they are badly defined

For this?  No way:

[From the base spec]:

“#address-cells” S
Standard property name to define the package’s address format.
prop-encoded-array: Integer, encoded with encode-int.

This property applies to packages that define a physical
address space, i.e., those packages with “decode-unit”
methods. The property value specifies the number of cells
that are used to encode a physical address within that
address space. The value of this property affects the other
functions, commands, and methods that deal with physical
addresses. In a package with a “decode-unit” method, a missing
“#address-cells” property signifies that the number of
address cells is two.

See?  The flat device tree unfortunately has no decode-unit, but
it is still pretty clear which nodes "define a physical address
space" and which do not.

There is nothing badly defined here.

Nothing in the "interrupt mapping" spec redefines #address-cells
(OF isn't all that stupid you know); it simply says that a /unit
interrupt specifier/ has no /unit address/ part if there is no
#address-cells.  The algorithm in paragraph 7 makes it super
clear how exactly this should work.

> and the spec contains gray areas
> and contradictions as to what the default values should be in some
> circumstances.

In some areas, perhaps.  And it would be nice to bring those
areas to the attention of the working group, instead of just
to complain.

There is no such issue in this area, anyway.

> As a general matter, I dislike default values because
> they somewhat require background knowledge of what default values  
> should
> be in different contexts to "read" a device-tree.

Of course, you need way more than that knowledge to properly
parse or read a device tree *at all*.

> To be simple, I
> believe default values are a bad idea.

Linux will have to keep supporting them for "real OF", so
requiring an explicit #address-cells where its value is 2
doesn't really help much.  I'm not opposed to this though,
for flat device trees at least (I think it's a good thing
for OF trees as well, but for different reasons; and that's
beside the point here).

On the other hand, requiring an #address-cells where it is
supposed to be absent, and you only want it so you can wrap
your head around the interrupt mapping recommended practice
in a more confusing and confused way, is simply WRONG.

>> There are no child nodes, and no binding that says there can
>> be any; neither #address-cells not #size-cells should be there.
>
> You are being way too pedantic here.

No I'm not.

> The interrupt-tree uses those two properties, thus "there is
> no child node" is open to interpretation.

It isn't.  Not a bus -> no child node in the device tree.
The interrupt tree is a completely separate thing.

> There is no child device node, but there are child interrupt nodes,  
> and
> since the interrupt-tree uses #address/size-cells,

It doesn't.

> it does make some sense to specify them.

If it would, the interrupt mapping spec would have had to say
how the semantics of #address-cells were changed (and they
weren't, and 

[PATCH] Add StorCenter DTS first draft.

2007-07-17 Thread Jon Loeliger
Based on the Kurobox DTS files.

Signed-off-by: Oyvind Repvik <[EMAIL PROTECTED]>
Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>
---

Comments welcome, of course.


 arch/powerpc/boot/dts/storcenter.dts |  142 ++
 1 files changed, 142 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/storcenter.dts

diff --git a/arch/powerpc/boot/dts/storcenter.dts 
b/arch/powerpc/boot/dts/storcenter.dts
new file mode 100644
index 000..87193fa
--- /dev/null
+++ b/arch/powerpc/boot/dts/storcenter.dts
@@ -0,0 +1,142 @@
+/*
+ * Device Tree Source for IOMEGA StorCenter
+ *
+ * Copyright 2007 Oyvind Repvik, Jon Loeliger
+ *
+ * Based on the Kurobox DTS by G. Liakhovetski <[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.
+ *
+ * build using:
+ *dtc -f -b 0 -I dts -O dtb -o storcenter.dtb storcenter.dts
+ */
+
+/ {
+   model = "StorCenter";
+   compatible = "storcenter";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   PowerPC,603e {  /* Really 8241 */
+   device_type = "cpu";
+   reg = <0>;
+   clock-frequency = ;   /* Hz */
+   timebase-frequency = ; /* Hz */
+   bus-frequency = <0>;
+   /* Following required by dtc but not used */
+   i-cache-line-size = <0>;
+   d-cache-line-size = <0>;
+   i-cache-size = <4000>;
+   d-cache-size = <4000>;
+   };
+   };
+
+   memory {
+   device_type = "memory";
+   reg = < 0400>;  /* 64MB @ 0x0 */
+   };
+
+   [EMAIL PROTECTED] {
+   device_type = "rom";
+   compatible = "direct-mapped";
+   probe-type = "CFI";
+   reg = ;
+   bank-width = <1>;
+   partitions = <
+    E000
+   E000 2000
+   0001 0004
+   0005 0020
+   0025 004B
+   0070 0002
+   0072 0001
+   0073 0001
+   0074 000B
+   >;
+   partition-names = "uboot2env", "dtb", "uboot2",
+ "emkernel", "emfs", "uboot1",
+ "empty", "uboot1-env", "SysConf";
+   };
+
+
+   soc10x {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   #interrupt-cells = <2>;
+   device_type = "soc";
+   compatible = "mpc10x";
+   store-gathering = <0>; /* 0 == off, !0 == on */
+   reg = <8000 0010>;
+   ranges = <8000 8000 7000/* pci mem space */
+ fdf0 fdf0 0010/* EUMB */
+ fe00 fe00 00c0/* pci i/o space */
+ fec0 fec0 0030/* pci cfg regs */
+ fef0 fef0 0010>;  /* pci iack */
+
+   [EMAIL PROTECTED] {
+   device_type = "i2c";
+   compatible = "fsl-i2c";
+   reg = ;
+   interrupts = <5 2>;
+   interrupt-parent = <&mpic>;
+   };
+
+   [EMAIL PROTECTED] {
+   device_type = "serial";
+   compatible = "ns16550";
+   reg = ;
+   clock-frequency = ; /* Hz */
+   current-speed = ;
+   interrupts = <9 2>;
+   interrupt-parent = <&mpic>;
+   };
+
+   [EMAIL PROTECTED] {
+   device_type = "serial";
+   compatible = "ns16550";
+   reg = ;
+   clock-frequency = ; /* Hz */
+   current-speed = ;
+   interrupts = ;
+   interrupt-parent = <&mpic>;
+   };
+
+   mpic: [EMAIL PROTECTED] {
+   #interrupt-cells = <2>;
+   #address-cells = <0>;
+   device_type = "open-pic";
+   compatible = "chrp,open-pic";
+   interrupt-controller;
+   reg = ;
+   built-in;
+   };
+
+   [EMAIL

Re: [RFC][PATCH 6/8] Walnut DTS

2007-07-17 Thread Segher Boessenkool
> Right.  See, there are people like me that don't know what the  
> default values
> are/should be.  Having them explicitly listed, even if it's  
> redundant, serves
> as a good learning aid.

_Only_ if it's redundant.  Not if it has a meaning different
from having the property not there at all.

> Now, realistically I do know what the default is in this case.  But  
> I only
> learned that recently.  With hopefully more people starting to port  
> things
> over to arch/powerpc it might be a good idea to document them at  
> least.

Definitely, we need more good examples, and maybe some
public stonings or something like that.

> Otherwise, I fear we'd wind up repeating ourselves over and over.
>
> Could we get a 'thou shalt not rely on defaults' added to
> booting-without-of.txt?  Or maybe something less draconian ;).

Such a statement is too vague to be meaningful.  It would
be a good idea in separate cases; but _do_ describe it more
carefully than just talking about "defaults", and _do_ put
a comment at any such entry that this is different from how
Open Firmware defines this, so that people looking at the
Linux code won't get hopelessly confused.


Segher

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


Re: [PATCH 2/3] 82xx: Parse SMC serial device node in DTS

2007-07-17 Thread Mark Zhan
On Tue, 2007-07-17 at 15:06 +0200, Arnd Bergmann wrote:
> On Tuesday 17 July 2007, Mark Zhan wrote:
> > Yes, basically I agree what you say. That should be the right way. 
> > 
> > but, the current situation is that: in all DTS files that are using smc
> > or scc as uart device, all device node definitions have the same
> > "compatible" property -- "cpm_uart"
> > 
> > So what I do here is just following the upstream source tree.
> > 
> 
> Well, AFAICS, all of them currently use scc. The 8xx platforms don't
> even build correctly in the mainline kernel, so I guess it would
> be good to change them to also list fsl,cpm-smc in the compatible
> property.

That probably could be done by another series of patches, and I really
don't want to introduce those kinds of patches in my BSP patches. I
don't know if the 8xx/82xx series patches from Scott Wood will cover
this issue or not. We can wait for them to see where thing will go.

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


Re: [PATCH] USB_DR host support for FSL MPC831x

2007-07-17 Thread Vitaly Bordug
On Tue, 17 Jul 2007 20:18:35 +0800
"Li Yang-r58472" <[EMAIL PROTECTED]> wrote:

> Hi Vitaly,
> 
> I believe that your patch is addresses by my patch in 2.6.23 queue:
> http://www.kernel.org/pub/linux/kernel/people/gregkh/usb/2.6/2.6.22/usb-
> ehci_fsl-update-for-mpc831x-support.patch
> 
okay, nm then. I'll revalidate with these 2 patches 
and come up with something ontop if it won't work.


> - Leo
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] 
> > [mailto:[EMAIL PROTECTED] 
> > On Behalf Of Vitaly Bordug
> > Sent: Tuesday, July 17, 2007 8:59 AM
> > To: Greg KH
> > Cc: linuxppc-dev@ozlabs.org
> > Subject: [PATCH] USB_DR host support for FSL MPC831x
> > 
> > 
> > Modifies fsl_ehci code so that to get USB host working on 
> > mpc831x platform. Verified with MPC8313RDB reference board.
> > 
> > Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>
> > 
> > ---
> > 
> >  arch/powerpc/boot/dts/mpc8313erdb.dts |1 +
> >  drivers/usb/host/ehci-fsl.c   |4 +++-
> >  drivers/usb/host/ehci-hcd.c   |2 +-
> >  3 files changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts 
> > b/arch/powerpc/boot/dts/mpc8313erdb.dts
> > index 1b351dc..c330e79 100644
> > --- a/arch/powerpc/boot/dts/mpc8313erdb.dts
> > +++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
> > @@ -90,6 +90,7 @@
> > interrupt-parent = < &ipic >;
> > interrupts = <26 8>;
> > phy_type = "utmi_wide";
> > +   control_init  = <0280>; // UTMI ext 
> > 48 MHz clk
> > };
> >  
> > [EMAIL PROTECTED] {
> > diff --git a/drivers/usb/host/ehci-fsl.c 
> > b/drivers/usb/host/ehci-fsl.c index c7a7c59..3e3187b 100644
> > --- a/drivers/usb/host/ehci-fsl.c
> > +++ b/drivers/usb/host/ehci-fsl.c
> > @@ -185,12 +185,14 @@ static void mpc83xx_usb_setup(struct 
> > usb_hcd *hcd)
> > struct ehci_hcd *ehci = hcd_to_ehci(hcd);
> > struct fsl_usb2_platform_data *pdata;
> > void __iomem *non_ehci = hcd->regs;
> > +   u32 temp;
> >  
> > pdata =
> > (struct fsl_usb2_platform_data *)hcd->self.controller->
> > platform_data;
> > /* Enable PHY interface in the control reg. */
> > -   out_be32(non_ehci + FSL_SOC_USB_CTRL, 0x0004);
> > +   temp = in_be32(non_ehci + FSL_SOC_USB_CTRL);
> > +   out_be32(non_ehci + FSL_SOC_USB_CTRL, temp | 0x0004);
> > out_be32(non_ehci + FSL_SOC_USB_SNOOP1, 0x001b);
> >  
> >  #if defined(CONFIG_PPC32) && !defined(CONFIG_NOT_COHERENT_CACHE)
> > diff --git a/drivers/usb/host/ehci-hcd.c 
> > b/drivers/usb/host/ehci-hcd.c index 099aff6..994a127 100644
> > --- a/drivers/usb/host/ehci-hcd.c
> > +++ b/drivers/usb/host/ehci-hcd.c
> > @@ -925,7 +925,7 @@ MODULE_LICENSE ("GPL");
> >  #definePCI_DRIVER  ehci_pci_driver
> >  #endif
> >  
> > -#ifdef CONFIG_MPC834x
> > +#if defined(CONFIG_MPC834x) || defined(CONFIG_PPC_MPC831x)
> >  #include "ehci-fsl.c"
> >  #definePLATFORM_DRIVER ehci_fsl_driver
> >  #endif
> > 
> > ___
> > Linuxppc-dev mailing list
> > Linuxppc-dev@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-dev
> > 


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


Re: [PATCH] Add StorCenter DTS first draft.

2007-07-17 Thread Segher Boessenkool
> Comments welcome, of course.

Well you asked for it :-)

> +/ {
> + model = "StorCenter";

If you can find a real model number, put it in here,
instead.

> + compatible = "storcenter";

Needs a manufacturer name in there.

> + PowerPC,603e {  /* Really 8241 */

So say "PowerPC,[EMAIL PROTECTED]", or "PowerPC,[EMAIL PROTECTED]" (or whatever
the CPU core in there is), or simply "[EMAIL PROTECTED]", following
the generic naming recommended practice.

> + bus-frequency = <0>;

Is this filled in anywhere?  Please document that, if so.

> + /* Following required by dtc but not used */
> + i-cache-line-size = <0>;
> + d-cache-line-size = <0>;
> + i-cache-size = <4000>;
> + d-cache-size = <4000>;

Not used _by the Linux kernel_, it's required by the
PowerPC binding.  Perhaps that should be modified
for flat device tree use, there are many more required
properties that no flat tree has anyway.

> + [EMAIL PROTECTED] {
> + device_type = "rom";

I'm sure you know I find this "rom" binding to be crap.
However, I didn't yet write up the "cfi" binding, so I
can't complain ;-)

> + partitions = <
> +  E000
> + E000 2000
> + 0001 0004
> + 0005 0020
> + 0025 004B
> + 0070 0002
> + 0072 0001
> + 0073 0001
> + 0074 000B
> + >;

Nothing from 7f to 7f?

> + soc10x {

Bad name.  Where is the binding for this?  I don't think
I saw it before.

> + compatible = "mpc10x";

"manufacturer,106-host" or similar.  But this isn't an 10x
at all, is it?

> + store-gathering = <0>; /* 0 == off, !0 == on */

Don't define this as "!0", but as "1".

> + [EMAIL PROTECTED] {
> + device_type = "i2c";

No device_type, there is no I2C binding.

> + compatible = "fsl-i2c";

Needs to be more specific.

> + mpic: [EMAIL PROTECTED] {

[EMAIL PROTECTED]

> + #interrupt-cells = <2>;
> + #address-cells = <0>;

No #address-cells here.

> + device_type = "open-pic";

device_type = "interrupt-controller" I believe, unless
the mpic binding does something weird.

> + [EMAIL PROTECTED] {
> + clock-frequency = ; /* Hz */

100MHz PCI?  Interesting.

> + interrupt-map = <
> + /* IDSEL 0x15 - ETH */
> + 7800 0 0 1 &mpic 0 1

7800 isn't device 0x15.  I think you meant 15.


Segher

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


Re: [PATCH 2/3] 82xx: Parse SMC serial device node in DTS

2007-07-17 Thread Segher Boessenkool
 +   if (strstr(model, "SMC")) {
 +   cpm_uart_dev =  
 platform_device_register_simple("fsl-cpm-smc:uart",
 +   i, &r 
 [0], 3);
 +   } else if (strstr(model, "SCC")) {

>>> You should probably use of_device_is_compatible() to check
>>> if a given device can be used by a particular driver.
>>
>> I think, the function of_find_compatible_node(), which is called  
>> in the
>> for loop, has already done that. So definitely, no need to call
>> of_device_is_compatible() any more.
>
> It's a little more complicated than that. The "compatible" property  
> should
> indicate the exact interface of that device, so the "model" does  
> not really
> matter here.

"model" is meant to be an exact manufacturer model number.
This can be used for workaround code or such if the "compatible"
entry isn't specific enough.  You should try to make sure your
"compatible" entries are, though.

Oh, and strstr() is asking for trouble.  Just do a full
compare.

> I don't know the difference between smc and scc, but if you
> need to register them as different pplatform devices, they should
> normally also have different names in "compatible", possibly in  
> addition
> to the existing one.

Either that, or if they are identical device, just used in
different ways / connected differently, show that via some
other properties or such.

> If the compatible property contains "fsl,cpm-smc\0cpm_uart", you  
> can scan for
> either of them. The loop will iterate over all cpm_uart compatible  
> devices,
> while the later test will look for an fsl,cpm-smc compatible device.

Well, "fsl,cpm-uart" (note the two differences), but yes.


Segher

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


Re: [PATCH 2/3] 82xx: Parse SMC serial device node in DTS

2007-07-17 Thread Arnd Bergmann
On Tuesday 17 July 2007, Mark Zhan wrote:
> 
> > Well, AFAICS, all of them currently use scc. The 8xx platforms don't
> > even build correctly in the mainline kernel, so I guess it would
> > be good to change them to also list fsl,cpm-smc in the compatible
> > property.
> 
> That probably could be done by another series of patches, and I really
> don't want to introduce those kinds of patches in my BSP patches. I
> don't know if the 8xx/82xx series patches from Scott Wood will cover
> this issue or not.

I guess he can best answer that himself. Scott, what are your plans
to deal with the different types of cpm ports?

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


Re: [PATCH 2/3] 82xx: Parse SMC serial device node in DTS

2007-07-17 Thread Segher Boessenkool
> but, the current situation is that: in all DTS files that are using  
> smc
> or scc as uart device, all device node definitions have the same
> "compatible" property -- "cpm_uart"
>
> So what I do here is just following the upstream source tree.

True enough.  OTOH, it doesn't help to continue supporting
the "bad old stuff", esp. if new extra workarounds are
needed for it.


Segher

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


Re: [PATCH 2/3] 82xx: Parse SMC serial device node in DTS

2007-07-17 Thread Arnd Bergmann
On Tuesday 17 July 2007, Segher Boessenkool wrote:
> > If the compatible property contains "fsl,cpm-smc\0cpm_uart", you  
> > can scan for
> > either of them. The loop will iterate over all cpm_uart compatible  
> > devices,
> > while the later test will look for an fsl,cpm-smc compatible device.
> 
> Well, "fsl,cpm-uart" (note the two differences), but yes.

My point was about the 'smc' part that needs to be added, so I guess
if we want to have that in there, it should be "fsl,cpm-smc-uart"
really, and "fsl,cpm-scc-uart", respectively.

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


[PATCH 1/4] ibmveth: Enable TCP checksum offload

2007-07-17 Thread Brian King

This patchset enables TCP checksum offload support for IPV4
on ibmveth. This completely eliminates the generation and checking of
the checksum for packets that are completely virtual and never
touch a physical network. A simple TCP_STREAM netperf run on
a virtual network with maximum mtu set yielded a ~30% increase
in throughput. This feature is enabled by default on systems that
support it, but can be disabled with a module option.

Signed-off-by: Brian King <[EMAIL PROTECTED]>
---

 linux-2.6-bjking1/drivers/net/ibmveth.c |   58 
 linux-2.6-bjking1/drivers/net/ibmveth.h |   41 +-
 2 files changed, 97 insertions(+), 2 deletions(-)

diff -puN drivers/net/ibmveth.c~ibmveth_csum_offload drivers/net/ibmveth.c
--- linux-2.6/drivers/net/ibmveth.c~ibmveth_csum_offload2007-07-12 
08:27:47.0 -0500
+++ linux-2.6-bjking1/drivers/net/ibmveth.c 2007-07-12 09:35:55.0 
-0500
@@ -47,6 +47,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -103,12 +105,15 @@ static struct proc_dir_entry *ibmveth_pr
 
 static const char ibmveth_driver_name[] = "ibmveth";
 static const char ibmveth_driver_string[] = "IBM i/pSeries Virtual Ethernet 
Driver";
+static unsigned int ibmveth_csum_offload = 1;
 #define ibmveth_driver_version "1.03"
 
 MODULE_AUTHOR("Santiago Leon <[EMAIL PROTECTED]>");
 MODULE_DESCRIPTION("IBM i/pSeries Virtual Ethernet Driver");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(ibmveth_driver_version);
+module_param_named(csum_offload, ibmveth_csum_offload, uint, 0);
+MODULE_PARM_DESC(csum_offload, "Checksum offload (0/1). Default: 1");
 
 /* simple methods of getting data from the current rxq entry */
 static inline int ibmveth_rxq_pending_buffer(struct ibmveth_adapter *adapter)
@@ -131,6 +136,11 @@ static inline int ibmveth_rxq_frame_leng
return (adapter->rx_queue.queue_addr[adapter->rx_queue.index].length);
 }
 
+static inline int ibmveth_rxq_csum_good(struct ibmveth_adapter *adapter)
+{
+   return 
(adapter->rx_queue.queue_addr[adapter->rx_queue.index].csum_good);
+}
+
 /* setup the initial settings for a buffer pool */
 static void ibmveth_init_buffer_pool(struct ibmveth_buff_pool *pool, u32 
pool_index, u32 pool_size, u32 buff_size, u32 pool_active)
 {
@@ -684,6 +694,24 @@ static int ibmveth_start_xmit(struct sk_
desc[0].fields.length, DMA_TO_DEVICE);
desc[0].fields.valid   = 1;
 
+   if (skb->ip_summed == CHECKSUM_PARTIAL &&
+   ip_hdr(skb)->protocol != IPPROTO_TCP && skb_checksum_help(skb)) {
+   ibmveth_error_printk("tx: failed to checksum packet\n");
+   tx_dropped++;
+   goto out;
+   }
+
+   if (skb->ip_summed == CHECKSUM_PARTIAL) {
+   unsigned char *buf = skb_transport_header(skb) + 
skb->csum_offset;
+
+   desc[0].fields.no_csum = 1;
+   desc[0].fields.csum_good = 1;
+
+   /* Need to zero out the checksum */
+   buf[0] = 0;
+   buf[1] = 0;
+   }
+
if(dma_mapping_error(desc[0].fields.address)) {
ibmveth_error_printk("tx: unable to map initial fragment\n");
tx_map_failed++;
@@ -702,6 +730,10 @@ static int ibmveth_start_xmit(struct sk_
frag->size, DMA_TO_DEVICE);
desc[curfrag+1].fields.length = frag->size;
desc[curfrag+1].fields.valid  = 1;
+   if (skb->ip_summed == CHECKSUM_PARTIAL) {
+   desc[curfrag+1].fields.no_csum = 1;
+   desc[curfrag+1].fields.csum_good = 1;
+   }
 
if(dma_mapping_error(desc[curfrag+1].fields.address)) {
ibmveth_error_printk("tx: unable to map fragment %d\n", 
curfrag);
@@ -792,7 +824,11 @@ static int ibmveth_poll(struct net_devic
} else {
int length = ibmveth_rxq_frame_length(adapter);
int offset = ibmveth_rxq_frame_offset(adapter);
+   int csum_good = ibmveth_rxq_csum_good(adapter);
+
skb = ibmveth_rxq_get_buffer(adapter);
+   if (csum_good)
+   skb->ip_summed = CHECKSUM_UNNECESSARY;
 
ibmveth_rxq_harvest_buffer(adapter);
 
@@ -962,8 +998,10 @@ static void ibmveth_poll_controller(stru
 static int __devinit ibmveth_probe(struct vio_dev *dev, const struct 
vio_device_id *id)
 {
int rc, i;
+   long ret;
struct net_device *netdev;
struct ibmveth_adapter *adapter = NULL;
+   union ibmveth_illan_attributes set_attr, ret_attr;
 
unsigned char *mac_addr_p;
unsigned int *mcastFilterSize_p;
@@ -1058,6 +1096,26 @@ static int __devinit ibmveth_probe(struc
 
ibmveth_debug_printk("registe

[PATCH 2/4] ibmveth: Implement ethtool hooks to enable/disable checksum offload

2007-07-17 Thread Brian King

This patch adds the appropriate ethtool hooks to allow for enabling/disabling
of hypervisor assisted checksum offload for TCP.

Signed-off-by: Brian King <[EMAIL PROTECTED]>
---

 linux-2.6-bjking1/drivers/net/ibmveth.c |  120 +++-
 linux-2.6-bjking1/drivers/net/ibmveth.h |1 
 2 files changed, 119 insertions(+), 2 deletions(-)

diff -puN drivers/net/ibmveth.c~ibmveth_csum_offload_ethtool 
drivers/net/ibmveth.c
--- linux-2.6/drivers/net/ibmveth.c~ibmveth_csum_offload_ethtool
2007-07-12 09:36:01.0 -0500
+++ linux-2.6-bjking1/drivers/net/ibmveth.c 2007-07-12 09:41:15.0 
-0500
@@ -644,12 +644,127 @@ static u32 netdev_get_link(struct net_de
return 1;
 }
 
+static void ibmveth_set_rx_csum_flags(struct net_device *dev, u32 data)
+{
+   struct ibmveth_adapter *adapter = dev->priv;
+
+   if (data)
+   adapter->rx_csum = 1;
+   else {
+   adapter->rx_csum = 0;
+   dev->features &= ~NETIF_F_IP_CSUM;
+   }
+}
+
+static void ibmveth_set_tx_csum_flags(struct net_device *dev, u32 data)
+{
+   struct ibmveth_adapter *adapter = dev->priv;
+
+   if (data) {
+   dev->features |= NETIF_F_IP_CSUM;
+   adapter->rx_csum = 1;
+   } else
+   dev->features &= ~NETIF_F_IP_CSUM;
+}
+
+static int ibmveth_set_csum_offload(struct net_device *dev, u32 data,
+   void (*done) (struct net_device *, u32))
+{
+   struct ibmveth_adapter *adapter = dev->priv;
+   union ibmveth_illan_attributes set_attr, clr_attr, ret_attr;
+   long ret;
+   int rc1 = 0, rc2 = 0;
+   int restart = 0;
+
+   if (netif_running(dev)) {
+   restart = 1;
+   adapter->pool_config = 1;
+   ibmveth_close(dev);
+   adapter->pool_config = 0;
+   }
+
+   set_attr.desc = 0;
+   clr_attr.desc = 0;
+
+   if (data)
+   set_attr.fields.tcp_csum_offload_ipv4 = 1;
+   else
+   clr_attr.fields.tcp_csum_offload_ipv4 = 1;
+
+   ret = h_illan_attributes(adapter->vdev->unit_address, 0, 0, 
&ret_attr.desc);
+
+   if (ret == H_SUCCESS && !ret_attr.fields.active_trunk &&
+   !ret_attr.fields.trunk_priority &&
+   ret_attr.fields.csum_offload_padded_pkt_support) {
+   ret = h_illan_attributes(adapter->vdev->unit_address, 
clr_attr.desc,
+set_attr.desc, &ret_attr.desc);
+
+   if (ret != H_SUCCESS) {
+   rc1 = -EIO;
+   ibmveth_error_printk("unable to change checksum offload 
settings."
+" %d rc=%ld\n", data, ret);
+
+   ret = h_illan_attributes(adapter->vdev->unit_address,
+set_attr.desc, clr_attr.desc, 
&ret_attr.desc);
+   } else
+   done(dev, data);
+   } else {
+   rc1 = -EIO;
+   ibmveth_error_printk("unable to change checksum offload 
settings."
+" %d rc=%ld ret_attr=%lx\n", data, ret, 
ret_attr.desc);
+   }
+
+   if (restart)
+   rc2 = ibmveth_open(dev);
+
+   return rc1 ? rc1 : rc2;
+}
+
+static int ibmveth_set_rx_csum(struct net_device *dev, u32 data)
+{
+   struct ibmveth_adapter *adapter = dev->priv;
+
+   if (data && adapter->rx_csum)
+   return 0;
+   if (!data && !adapter->rx_csum)
+   return 0;
+
+   return ibmveth_set_csum_offload(dev, data, ibmveth_set_rx_csum_flags);
+}
+
+static int ibmveth_set_tx_csum(struct net_device *dev, u32 data)
+{
+   struct ibmveth_adapter *adapter = dev->priv;
+   int rc = 0;
+
+   if (data && (dev->features & NETIF_F_IP_CSUM))
+   return 0;
+   if (!data && !(dev->features & NETIF_F_IP_CSUM))
+   return 0;
+
+   if (data && !adapter->rx_csum)
+   rc = ibmveth_set_csum_offload(dev, data, 
ibmveth_set_tx_csum_flags);
+   else
+   ibmveth_set_tx_csum_flags(dev, data);
+
+   return rc;
+}
+
+static u32 ibmveth_get_rx_csum(struct net_device *dev)
+{
+   struct ibmveth_adapter *adapter = dev->priv;
+   return adapter->rx_csum;
+}
+
 static const struct ethtool_ops netdev_ethtool_ops = {
.get_drvinfo= netdev_get_drvinfo,
.get_settings   = netdev_get_settings,
.get_link   = netdev_get_link,
.get_sg = ethtool_op_get_sg,
.get_tx_csum= ethtool_op_get_tx_csum,
+   .set_tx_csum= ibmveth_set_tx_csum,
+   .get_rx_csum= ibmveth_get_rx_csum,
+   .set_rx_csum= ibmveth_set_rx_csum
 };
 
 static int ibmveth_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
@@ -1108,9 +1223,10 @@ static int __devinit ibmveth_probe(struc
  

[PATCH 3/4] ibmveth: Add ethtool TSO handlers

2007-07-17 Thread Brian King

Add handlers for get_tso and get_ufo to prevent errors being printed
by ethtool.

Signed-off-by: Brian King <[EMAIL PROTECTED]>
---

 linux-2.6-bjking1/drivers/net/ibmveth.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff -puN drivers/net/ibmveth.c~ibmveth_ethtool_get_tso drivers/net/ibmveth.c
--- linux-2.6/drivers/net/ibmveth.c~ibmveth_ethtool_get_tso 2007-07-12 
09:39:20.0 -0500
+++ linux-2.6-bjking1/drivers/net/ibmveth.c 2007-07-12 09:39:20.0 
-0500
@@ -764,7 +764,9 @@ static const struct ethtool_ops netdev_e
.get_tx_csum= ethtool_op_get_tx_csum,
.set_tx_csum= ibmveth_set_tx_csum,
.get_rx_csum= ibmveth_get_rx_csum,
-   .set_rx_csum= ibmveth_set_rx_csum
+   .set_rx_csum= ibmveth_set_rx_csum,
+   .get_tso= ethtool_op_get_tso,
+   .get_ufo= ethtool_op_get_ufo
 };
 
 static int ibmveth_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] Allow exec on 32-bit from readable, non-exec pages, with a warning.

2007-07-17 Thread Segher Boessenkool
 Yeah.  Giving the warning is a good thing though.
>>>
>>> No, it isn't; it's just noise, if we're not ever going to do  
>>> anything
>>> to prevent the behaviour - and we can't.
>>
>> The same userland code will not run correctly on PPC64 or BookE
>> systems.  Is that not a reason to warn?
>
> Way back when, I distinctly recall aborting my plans to implement
> per-page exec on 40x, precisely because of executables like this.

I noticed some comments to that effect in the BookE code,
yes.  It seems userland has been fixed enough that you
could think about enabling it again FWIW.


Segher

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


[PATCH 4/4] ibmveth: Add ethtool driver stats hooks

2007-07-17 Thread Brian King

Add ethtool hooks to ibmveth to retrieve driver statistics.

Signed-off-by: Brian King <[EMAIL PROTECTED]>
---

 linux-2.6-bjking1/drivers/net/ibmveth.c |   53 +++-
 1 file changed, 52 insertions(+), 1 deletion(-)

diff -puN drivers/net/ibmveth.c~ibmveth_ethtool_driver_stats 
drivers/net/ibmveth.c
--- linux-2.6/drivers/net/ibmveth.c~ibmveth_ethtool_driver_stats
2007-07-12 09:39:23.0 -0500
+++ linux-2.6-bjking1/drivers/net/ibmveth.c 2007-07-12 09:39:23.0 
-0500
@@ -115,6 +115,28 @@ MODULE_VERSION(ibmveth_driver_version);
 module_param_named(csum_offload, ibmveth_csum_offload, uint, 0);
 MODULE_PARM_DESC(csum_offload, "Checksum offload (0/1). Default: 1");
 
+struct ibmveth_stat {
+   char name[ETH_GSTRING_LEN];
+   int offset;
+};
+
+#define IBMVETH_STAT_OFF(stat) offsetof(struct ibmveth_adapter, stat)
+#define IBMVETH_GET_STAT(a, off) *((u64 *)(((unsigned long)(a)) + off))
+
+struct ibmveth_stat ibmveth_stats[] = {
+   { "replenish_task_cycles", IBMVETH_STAT_OFF(replenish_task_cycles) },
+   { "replenish_no_mem", IBMVETH_STAT_OFF(replenish_no_mem) },
+   { "replenish_add_buff_failure", 
IBMVETH_STAT_OFF(replenish_add_buff_failure) },
+   { "replenish_add_buff_success", 
IBMVETH_STAT_OFF(replenish_add_buff_success) },
+   { "rx_invalid_buffer", IBMVETH_STAT_OFF(rx_invalid_buffer) },
+   { "rx_no_buffer", IBMVETH_STAT_OFF(rx_no_buffer) },
+   { "tx_multidesc_send", IBMVETH_STAT_OFF(tx_multidesc_send) },
+   { "tx_linearized", IBMVETH_STAT_OFF(tx_linearized) },
+   { "tx_linearize_failed", IBMVETH_STAT_OFF(tx_linearize_failed) },
+   { "tx_map_failed", IBMVETH_STAT_OFF(tx_map_failed) },
+   { "tx_send_failed", IBMVETH_STAT_OFF(tx_send_failed) }
+};
+
 /* simple methods of getting data from the current rxq entry */
 static inline int ibmveth_rxq_pending_buffer(struct ibmveth_adapter *adapter)
 {
@@ -756,6 +778,32 @@ static u32 ibmveth_get_rx_csum(struct ne
return adapter->rx_csum;
 }
 
+static void ibmveth_get_strings(struct net_device *dev, u32 stringset, u8 
*data)
+{
+   int i;
+
+   if (stringset != ETH_SS_STATS)
+   return;
+
+   for (i = 0; i < ARRAY_SIZE(ibmveth_stats); i++, data += ETH_GSTRING_LEN)
+   memcpy(data, ibmveth_stats[i].name, ETH_GSTRING_LEN);
+}
+
+static int ibmveth_get_stats_count(struct net_device *dev)
+{
+   return ARRAY_SIZE(ibmveth_stats);
+}
+
+static void ibmveth_get_ethtool_stats(struct net_device *dev,
+ struct ethtool_stats *stats, u64 *data)
+{
+   int i;
+   struct ibmveth_adapter *adapter = dev->priv;
+
+   for (i = 0; i < ARRAY_SIZE(ibmveth_stats); i++)
+   data[i] = IBMVETH_GET_STAT(adapter, ibmveth_stats[i].offset);
+}
+
 static const struct ethtool_ops netdev_ethtool_ops = {
.get_drvinfo= netdev_get_drvinfo,
.get_settings   = netdev_get_settings,
@@ -766,7 +814,10 @@ static const struct ethtool_ops netdev_e
.get_rx_csum= ibmveth_get_rx_csum,
.set_rx_csum= ibmveth_set_rx_csum,
.get_tso= ethtool_op_get_tso,
-   .get_ufo= ethtool_op_get_ufo
+   .get_ufo= ethtool_op_get_ufo,
+   .get_strings= ibmveth_get_strings,
+   .get_stats_count= ibmveth_get_stats_count,
+   .get_ethtool_stats  = ibmveth_get_ethtool_stats
 };
 
 static int ibmveth_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
diff -puN drivers/net/ibmveth.h~ibmveth_ethtool_driver_stats 
drivers/net/ibmveth.h
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] Change the pci express controller node name from pci to pcie

2007-07-17 Thread Segher Boessenkool
> From: Roy Zang <[EMAIL PROTECTED]>
>
> Change the pci express controller node name from pci
> to pcie in device tree.
>
> Signed-off-by: Roy Zang <[EMAIL PROTECTED]>

Looks good, thanks!


Segher

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


Re: [PATCH] USB_DR host support for FSL MPC831x

2007-07-17 Thread Kumar Gala

On Jul 17, 2007, at 9:52 AM, Vitaly Bordug wrote:

> On Tue, 17 Jul 2007 20:18:35 +0800
> "Li Yang-r58472" <[EMAIL PROTECTED]> wrote:
>
>> Hi Vitaly,
>>
>> I believe that your patch is addresses by my patch in 2.6.23 queue:
>> http://www.kernel.org/pub/linux/kernel/people/gregkh/usb/ 
>> 2.6/2.6.22/usb-
>> ehci_fsl-update-for-mpc831x-support.patch
>>
> okay, nm then. I'll revalidate with these 2 patches
> and come up with something ontop if it won't work.
>

FYI, Leo's patches are now in Linus's tree.

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


Re: [PATCH 1/4] Add DMA sector to Documentation/powerpc/booting-without-of.txt file.

2007-07-17 Thread Segher Boessenkool
>> The device tree describes _all_ hardware in the system,
>> not just the things that are somewhat harder to probe
>> for.
>
> Actually, for embedded systems, the device tree is really only
> required to describe the things that it's useful for the Linux kernel
> to know.

Sure, for example it could provide a "SoC" node with only
an address range, and not describe all the devices on that
SoC separately.  It still describes all of the hardware,
not in quite so much detail though.  It also won't get all
the benefits of using the OF device tree, but that is a
trade off, for each group to decide on their own.

> The point of the device tree for embedded systems is to provide
> configuration information, not to be able to claim compliance with
> some set of legalistic requirements. :)

Well, if you use some certain binding, you better use it
correctly, no?  Ill-defined and ill-used interfaces aren't
the nicest thing to deal with.

> I think in some cases we have gone a little over the top in trying to
> put everything in the device tree, in fact.  Ultimately I think it has
> to be up to the more experienced embedded developers to say how much
> detail in the device tree is actually helpful and how much is dead
> weight.

Yes, more complex device bindings need a lot of time to get
right, and need a lot of input from all parties using it.
In general, it is better to leave out things from a binding
until it is very clear it is needed and is the right thing
to do.


Segher

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


Re: [PATCH 2/3] 82xx: Parse SMC serial device node in DTS

2007-07-17 Thread Scott Wood
Arnd Bergmann wrote:
> On Tuesday 17 July 2007, Mark Zhan wrote:
> 
>>>Well, AFAICS, all of them currently use scc. The 8xx platforms don't
>>>even build correctly in the mainline kernel, so I guess it would
>>>be good to change them to also list fsl,cpm-smc in the compatible
>>>property.
>>
>>That probably could be done by another series of patches, and I really
>>don't want to introduce those kinds of patches in my BSP patches. I
>>don't know if the 8xx/82xx series patches from Scott Wood will cover
>>this issue or not.
> 
> 
> I guess he can best answer that himself. Scott, what are your plans
> to deal with the different types of cpm ports?

My patchset converts the CPM enet and serial drivers to of platform 
devices when CONFIG_PPC_MERGE is defined, and signficantly overhauls the 
device tree binding.  A 885 CPM UART would have a compatible like this:

compatible = "fsl,mpc885-smc-uart", "fsl,cpm1-smc-uart",
  "fsl,cpm1-uart", "fsl,cpm-smc-uart", "fsl,cpm-uart";

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


[PATCH] iommu virtual merge no longer experimental

2007-07-17 Thread Linas Vepstas

Per conversations with BenH, iommu virtual merging should no longer
be considered to be an "experimental" feature. In particular, 
CONFIG_VMERGE has been set to "y" in te defconfigs for quite a while.

Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]>


 arch/powerpc/Kconfig |   11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

Index: linux-2.6.22-git2/arch/powerpc/Kconfig
===
--- linux-2.6.22-git2.orig/arch/powerpc/Kconfig 2007-07-08 18:32:17.0 
-0500
+++ linux-2.6.22-git2/arch/powerpc/Kconfig  2007-07-17 11:08:18.0 
-0500
@@ -430,16 +430,17 @@ config MATH_EMULATION
  instructions to run.
 
 config IOMMU_VMERGE
-   bool "Enable IOMMU virtual merging (EXPERIMENTAL)"
-   depends on EXPERIMENTAL && PPC64
-   default n
+   bool "Enable IOMMU virtual merging"
+   depends on PPC64
+   default y
help
  Cause IO segments sent to a device for DMA to be merged virtually
  by the IOMMU when they happen to have been allocated contiguously.
  This doesn't add pressure to the IOMMU allocator. However, some
  drivers don't support getting large merged segments coming back
- from *_map_sg(). Say Y if you know the drivers you are using are
- properly handling this case.
+ from *_map_sg().
+
+ Most drivers don't have this problem; it is safe to say Y here.
 
 config HOTPLUG_CPU
bool "Support for enabling/disabling CPUs"
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/3] 82xx: some 82xx platform hook functions can be shared by different boards

2007-07-17 Thread Scott Wood
On Tue, Jul 17, 2007 at 02:59:46AM +0200, Arnd Bergmann wrote:
> This is a step in the wrong direction. CPUINFO_{VENDOR,MACHINE}
> comes from a platform specific header file, so you can not
> use these definitions in platform independent code without
> breaking multiplatform kernels.

My patchset just drops the vendor field, and uses ppc_md.name for the
machine name.  The vendor name can be included in the latter.

> I know you're just moving that code, but it looks horribly wrong
> nonetheless. cpm2_immr is an __iomem variable, so you must not
> dereference it but instead should use the in_8() macro to
> access it.
> 
> Once you get that right, you don't need the volatile variable
> any more.

My patchset addresses this.

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


Re: [PATCH] Add StorCenter DTS first draft.

2007-07-17 Thread Josh Boyer
On Tue, 2007-07-17 at 16:57 +0200, Segher Boessenkool wrote:
> 
> > +   [EMAIL PROTECTED] {
> > +   device_type = "rom";
> 
> I'm sure you know I find this "rom" binding to be crap.
> However, I didn't yet write up the "cfi" binding, so I
> can't complain ;-)

Not all chips are CFI compliant.  Be sure to write up the "jedec" and
"nand" bindings while you're at it ;)

josh

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


Re: [PATCH] Allow exec on 32-bit from readable, non-exec pages, with a warning.

2007-07-17 Thread Kumar Gala

On Jul 17, 2007, at 10:18 AM, Segher Boessenkool wrote:

> Yeah.  Giving the warning is a good thing though.

 No, it isn't; it's just noise, if we're not ever going to do
 anything
 to prevent the behaviour - and we can't.
>>>
>>> The same userland code will not run correctly on PPC64 or BookE
>>> systems.  Is that not a reason to warn?
>>
>> Way back when, I distinctly recall aborting my plans to implement
>> per-page exec on 40x, precisely because of executables like this.
>
> I noticed some comments to that effect in the BookE code,
> yes.  It seems userland has been fixed enough that you
> could think about enabling it again FWIW.

Did I miss the posting of the patch with the fix?

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


Re: [PATCH 3/3] 82xx: SBCPQ2 board platform support

2007-07-17 Thread Segher Boessenkool
> + np = of_find_compatible_node(NULL, "cpm-pic", "CPM2");
> + if (np == NULL) {
> + printk(KERN_ERR "PIC init: can not find cpm-pic node\n");
> + return;
> + }

 This looks like your device tree is wrong. Shouldn't the interrupt
 controller have device_type="interrupt-controller" and a specific
 compatible property instead of having the name in the device_type?

So, I looked it up :-)

The device_type should specify the specific interrupt
controller programming model, because a real OF typically
needs to know the meaning of the interrupt specifiers;
also, when the interrupt binding recommended practice
isn't used, it is needed to know the #interrupt-cells
(which is implicit from the device_type in that case).

If there is no defined binding for your interrupt
controller, just don't put a device_type in your tree at
all, for flat device trees.

>>> Here, I just copy the codes from mpc82xx_ads, is there anything  
>>> wrong?
>>
>> I just checked the Recommended Practice document for interrupt  
>> mapping
>> and it seems that it's ok. The interrupt controller needs to have
>> an property named "interrupt-controller", but does not need a  
>> specific
>> device_type. So it appears to be correct here.

Please also look at the base specifications, not just
the imap thing.  But you reached the correct conclusion.


Segher

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


Re: [PATCH] POWERPC: Added RTC support for mpc8313RDB and utilize "clock-frequency"

2007-07-17 Thread Scott Wood
On Tue, Jul 17, 2007 at 04:49:13AM +0400, Vitaly Bordug wrote:
> + np = of_find_node_by_type(NULL, "cpu");
> + if (np != 0) {
> + const unsigned int *fp =
> + get_property(np, "clock-frequency", NULL);
> + if (fp != 0)
> + loops_per_jiffy = *fp / HZ;
> + else
> + loops_per_jiffy = 5000 / HZ;
> + of_node_put(np);
> + }

This is not necessary.  It's only used for /proc/cpuinfo (delays are done
using tb_ticks_per_usec), and it'll be overwritten by the generic
calibrate_delay() anyway.

We should be removing this from board files that have it, not adding it
to ones that don't.

> +#if defined (CONFIG_SENSORS_DS1337) && defined (CONFIG_I2C)
> +
> +extern int ds1337_do_command(int id, int cmd, void *arg);
> +extern spinlock_t rtc_lock;
> +#define DS1337_GET_DATE  0
> +#define DS1337_SET_DATE  1
> +
> +static void mpc8313rdb_get_rtc_time(struct rtc_time *tm)
> +{
> + int result;
> +
> + result = ds1337_do_command(0, DS1337_GET_DATE, tm);
> +
> + if (result == 0)
> + result = mktime(tm->tm_year, tm->tm_mon, tm->tm_mday, 
> tm->tm_hour, tm->tm_min, tm->tm_sec);
> +}
> +
> +static int mpc8313rdb_set_rtc_time(struct rtc_time *tm)
> +{
> + int result;
> +
> + result = ds1337_do_command(0, DS1337_SET_DATE, tm);
> +
> + return result;
> +}
> +
> +static int __init rtc_hookup(void)
> +{
> + ppc_md.get_rtc_time = mpc8313rdb_get_rtc_time;
> + ppc_md.set_rtc_time = mpc8313rdb_set_rtc_time;
> + return 0;
> +}
> +late_initcall(rtc_hookup);
> +#endif

Please don't do this; drivers/i2c/chips/ds1337.c is deprecated.  You
should be using the RTC-class driver in drivers/rtc/rtc-ds1307.c, which
has a non-device-specific API that can be used.

The ppc_md RTC functions should really just go away, though -- setting
the clock on bootup can be done by generic code, and periodically
updating the RTC when using NTP can be done from userspace.

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


Re: [PATCH] Allow exec on 32-bit from readable, non-exec pages, with a warning.

2007-07-17 Thread Segher Boessenkool
>>> Way back when, I distinctly recall aborting my plans to implement
>>> per-page exec on 40x, precisely because of executables like this.
>>
>> I noticed some comments to that effect in the BookE code,
>> yes.  It seems userland has been fixed enough that you
>> could think about enabling it again FWIW.
>
> Did I miss the posting of the patch with the fix?

glibc-2.2 seems to be the last "bad" one.  We are at
glibc-2.6 or so nowadays...


Segher

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


Re: [PATCH] Add StorCenter DTS first draft.

2007-07-17 Thread Segher Boessenkool
>>> +   [EMAIL PROTECTED] {
>>> +   device_type = "rom";
>>
>> I'm sure you know I find this "rom" binding to be crap.
>> However, I didn't yet write up the "cfi" binding, so I
>> can't complain ;-)
>
> Not all chips are CFI compliant.

I know :-)

> Be sure to write up the "jedec"

It's in the pipeline, it's quite a bit more complicated
than CFI though.

> and "nand" bindings while you're at it ;)

NAND is pure hell :-(


Segher

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


Re: PS3 Storage Driver O_DIRECT issue

2007-07-17 Thread Geoff Levand
Geert Uytterhoeven wrote:
> On Fri, 13 Jul 2007, Olaf Hering wrote:
>> This driver (or the generic PS3 code) has appearently problems with
>> O_DIRECT. 
>> glibc aborts parted because the malloc metadata get corrupted. While it
>> is reproducible, the place where it crashes changes with every version
>> of the debug attempt.
>> I dont have a handle right now, all I know is that the metadata after a
>> malloc area get overwritten with zeros.
>> 
>> 
>> Can you have a look at this? 
>> parted /dev/ps3da
>> print (a few times)
> 
> I can't seem to reproduce this with parted 1.7.1-5.1 (from Debian
> etch/lenny/sid) and kernel 2.6.22-g77320894.

Hi.

I found this happens on Fedora 7:

[EMAIL PROTECTED] ~]# uname -a
Linux ps3-nfs 2.6.22-ps3-linux-dev-g4d898766-dirty #1 SMP Wed Jul 11 13:29:46 
PDT 2007 ppc64 ppc64 ppc64 GNU/Linux
[EMAIL PROTECTED] ~]# parted --version
parted (GNU parted) 1.8.6

Here is the error message from parted:

Command History:
print

Error: SEGV_MAPERR (Address not mapped to object)
Backtrace has 20 calls on stack:
  20: /usr/lib/libparted-1.8.so.6(ped_assert+0xb0) [0xfb7ea50]
  19: parted [0x1000c6dc]
  18: [0x100350]
  17: [(nil)]
  16: /lib/libc.so.6 [0xfdcfe64]
  15: /lib/libc.so.6 [0xfdd0b34]
  14: /lib/libc.so.6(__libc_memalign+0xec) [0xfdd1e1c]
  13: /lib/libc.so.6(posix_memalign+0xbc) [0xfdd207c]
  12: /usr/lib/libparted-1.8.so.6 [0xfb8f42c]
  11: /usr/lib/libparted-1.8.so.6(ped_device_read+0x164) [0xfb7f5f4]
  10: /usr/lib/libparted-1.8.so.6(ped_geometry_read+0x16c) [0xfb89a5c]
  9: /usr/lib/libparted-1.8.so.6 [0xfba739c]
  8: /usr/lib/libparted-1.8.so.6(ped_file_system_probe_specific+0x104) 
[0xfb80d04]
  7: /usr/lib/libparted-1.8.so.6(ped_file_system_probe+0xec) [0xfb8134c]
  6: /usr/lib/libparted-1.8.so.6 [0xfbbcc38]
  5: /usr/lib/libparted-1.8.so.6 [0xfbbcfb4]
  4: /usr/lib/libparted-1.8.so.6(ped_disk_new+0xc0) [0xfb88bf0]
  3: parted [0x10006e00]
  2: parted(command_run+0x1c) [0x10004d8c]
  1: parted(interactive_mode+0x134) [0x1000e4b4]
Aborted


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


Re: [PATCH] POWERPC: add support of the GiGE switch for mpc8313RDB via fixed PHY

2007-07-17 Thread Scott Wood
This just comments on code style, not semantics...  I agree with Segher
that this isn't the way to do it.

On Tue, Jul 17, 2007 at 04:49:37AM +0400, Vitaly Bordug wrote:
> +#if defined(CONFIG_FIXED_MII_1000_FDX)
> +
> +static int fixed_set_link (void)
> +{
> + struct fixed_info *phyinfo = fixed_mdio_get_phydev(0);  /* only one 
> fixed phy on this platform */

Line length.

> + for (np = NULL, i = 0;
> +  (np = of_find_compatible_node(np, "mdio", "gianfar")) != NULL;
> +  i++) {

Can't we just initialize np and i above, and use a while loop?

> + memset(&res, 0, sizeof(res));

Not necessary.

> + ret = of_address_to_resource(np, 0, &res);
> + if (ret)
> + return ret;
> + child = of_find_compatible_node(np, "ethernet-phy","fixed");

Space after comma.

> + if (!child)
> + return -ENXIO;
> + id = (u32*)of_get_property(child, "reg", NULL);

Cast not required.

> + if (!id)
> + return -ENXIO;
> + break;

Why are you using a loop at all if there's a break at the end and no
continue?

> + }
> + snprintf(phydev->dev.bus_id, BUS_ID_SIZE, PHY_ID_FMT,  res.start, *id);

Only one space before res.start.

> + memset(phyinfo->regs,0xff,sizeof(phyinfo->regs[0])*phyinfo->regs_num);

Spaces after commas.

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


Re: [PATCH] USB_DR host support for FSL MPC831x

2007-07-17 Thread Scott Wood
On Tue, Jul 17, 2007 at 04:58:32AM +0400, Vitaly Bordug wrote:
> diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts 
> b/arch/powerpc/boot/dts/mpc8313erdb.dts
> index 1b351dc..c330e79 100644
> --- a/arch/powerpc/boot/dts/mpc8313erdb.dts
> +++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
> @@ -90,6 +90,7 @@
>   interrupt-parent = < &ipic >;
>   interrupts = <26 8>;
>   phy_type = "utmi_wide";
> + control_init  = <0280>; // UTMI ext 48 MHz clk

fsl,usb-control-init, please.

> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index 099aff6..994a127 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -925,7 +925,7 @@ MODULE_LICENSE ("GPL");
>  #define  PCI_DRIVER  ehci_pci_driver
>  #endif
>  
> -#ifdef CONFIG_MPC834x
> +#if defined(CONFIG_MPC834x) || defined(CONFIG_PPC_MPC831x)
>  #include "ehci-fsl.c"
>  #define  PLATFORM_DRIVER ehci_fsl_driver
>  #endif

It'd be better to define a CONFIG_FSL_EHCI and have the 834x and 831x
configs enable it.

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


Re: regarding cpm_uart and platform_bus_type

2007-07-17 Thread Scott Wood
On Tue, Jul 17, 2007 at 02:55:30PM +0300, Alexandros Kostopoulos wrote:
> I was wondering, since arch/powerpc is now based on device trees,  
> shouldn't the cpm_uart driver (or at least a branch of it for  
> arch/powerpc) be changed to use of_platform_bus_type instead of  
> platform_bus_type?

Yes.  The patch is on the way Really Soon Now(tm).

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


Re: [PATCH] POWERPC: Added RTC support for mpc8313RDB and utilize "clock-frequency"

2007-07-17 Thread Vitaly Bordug
On Tue, 17 Jul 2007 11:36:45 -0500
Scott Wood <[EMAIL PROTECTED]> wrote:

> On Tue, Jul 17, 2007 at 04:49:13AM +0400, Vitaly Bordug wrote:
> > +   np = of_find_node_by_type(NULL, "cpu");
> > +   if (np != 0) {
> > +   const unsigned int *fp =
> > +   get_property(np, "clock-frequency", NULL);
> > +   if (fp != 0)
> > +   loops_per_jiffy = *fp / HZ;
> > +   else
> > +   loops_per_jiffy = 5000 / HZ;
> > +   of_node_put(np);
> > +   }
> 
> This is not necessary.  It's only used for /proc/cpuinfo (delays are done
> using tb_ticks_per_usec), and it'll be overwritten by the generic
> calibrate_delay() anyway.
> 
> We should be removing this from board files that have it, not adding it
> to ones that don't.
> 
Yet many boards still have this stuff (like pretty recent 86xx) - should
we at least add some comments or clean that up?

> > +#if defined (CONFIG_SENSORS_DS1337) && defined (CONFIG_I2C)
> > +
> > +extern int ds1337_do_command(int id, int cmd, void *arg);
> > +extern spinlock_t rtc_lock;
> > +#define DS1337_GET_DATE0
> > +#define DS1337_SET_DATE1
> > +
> > +static void mpc8313rdb_get_rtc_time(struct rtc_time *tm)
> > +{
> > +   int result;
> > +
> > +   result = ds1337_do_command(0, DS1337_GET_DATE, tm);
> > +
> > +   if (result == 0)
> > +   result = mktime(tm->tm_year, tm->tm_mon, tm->tm_mday, 
> > tm->tm_hour, tm->tm_min, tm->tm_sec);
> > +}
> > +
> > +static int mpc8313rdb_set_rtc_time(struct rtc_time *tm)
> > +{
> > +   int result;
> > +
> > +   result = ds1337_do_command(0, DS1337_SET_DATE, tm);
> > +
> > +   return result;
> > +}
> > +
> > +static int __init rtc_hookup(void)
> > +{
> > +   ppc_md.get_rtc_time = mpc8313rdb_get_rtc_time;
> > +   ppc_md.set_rtc_time = mpc8313rdb_set_rtc_time;
> > +   return 0;
> > +}
> > +late_initcall(rtc_hookup);
> > +#endif
> 
> Please don't do this; drivers/i2c/chips/ds1337.c is deprecated.  You
> should be using the RTC-class driver in drivers/rtc/rtc-ds1307.c, which
> has a non-device-specific API that can be used.
> 
> The ppc_md RTC functions should really just go away, though -- setting
> the clock on bootup can be done by generic code, and periodically
> updating the RTC when using NTP can be done from userspace.
> 

If those ppc_md hookups would be declared deprecated, there's no much sense in 
the upper,
apparently. But I am not sure they will be... I'm inclined to let this patch 
floating since
interacting with rtc class from within BSP code just does not worth it.

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


Re: [PATCH] POWERPC: add support of the GiGE switch for mpc8313RDB via fixed PHY

2007-07-17 Thread Vitaly Bordug
On Tue, 17 Jul 2007 11:43:31 -0500
Scott Wood <[EMAIL PROTECTED]> wrote:

> This just comments on code style, not semantics...  I agree with Segher
> that this isn't the way to do it.

That's nm, I'll rather include specific field into mac node,
so the function below will be rewritten.

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


Re: [PATCH 01/10] IB/ehca: Support for multiple event queues

2007-07-17 Thread Roland Dreier
 > Here's some anecdotal evidence :)
 > http://lists.openfabrics.org/pipermail/general/2007-May/035758.html

Right, but then we went on to say that we probably want to use
multiple vectors to separate out multiple HCA ports rather than
send/sreceive on the same port.  And the current IPoIB implementation
of having that second CQ seems suboptimal anyway, since it seems to
leave us susceptible to the interrupt overload that NAPI was supposed
to solve.

At a higher level, I'm left wondering why nobody talked about multiple
EQs during the last months of the 2.6.22 process and now all of a
sudden it becomes urgent in the last few days of the 2.6.23 merge
window.  That's not really how I like to merge features

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


Re: [PATCH] POWERPC: Added RTC support for mpc8313RDB and utilize "clock-frequency"

2007-07-17 Thread Scott Wood
Vitaly Bordug wrote:
> On Tue, 17 Jul 2007 11:36:45 -0500
> Scott Wood <[EMAIL PROTECTED]> wrote:
>>We should be removing this from board files that have it, not adding it
>>to ones that don't.
> 
> Yet many boards still have this stuff (like pretty recent 86xx) - should
> we at least add some comments or clean that up?

See above. :-)

AFAICT, it's just copied from board to board without thought.  It should 
be removed.

>>The ppc_md RTC functions should really just go away, though -- setting
>>the clock on bootup can be done by generic code, and periodically
>>updating the RTC when using NTP can be done from userspace.
> 
> If those ppc_md hookups would be declared deprecated, there's no much sense 
> in the upper,
> apparently. But I am not sure they will be... I'm inclined to let this patch 
> floating since
> interacting with rtc class from within BSP code just does not worth it.

I'm not sure they will either; I just wish they would be. :-)

In the meantime, some sort of workqueue-based hookup to the RTC class 
API should be used.  I believe there have been patches along those lines 
posted in the past.

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


Re: [PATCH] POWERPC: Added RTC support for mpc8313RDB and utilize "clock-frequency"

2007-07-17 Thread Jon Loeliger
On Tue, 2007-07-17 at 12:48, Vitaly Bordug wrote:
> 't.
> > 
> Yet many boards still have this stuff (like pretty recent 86xx) - should
> we at least add some comments or clean that up?

Hrm.  Alright.  I'm on deck for a patch here, I see... :-)

But you might notice that the most recent board port
that I added, mpc8544_ds.c, does NOT have it:

static void __init mpc8544_ds_setup_arch(void)
{
if (ppc_md.progress)
ppc_md.progress("mpc8544_ds_setup_arch()", 0);
 
printk("MPC8544 DS board from Freescale Semiconductor\n");
}

Thanks,
jdl


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


[patch 00/14] Current 4xx patch series

2007-07-17 Thread Josh Boyer
For those interested, here's my current 4xx patch series.  There are a few
cleanups as a pre-requisite for 40x support, some minimal Walnut support, and
another round of Bamboo patches.  These are all based off of Paul's current
tree.

Patches 1 through 7 are likely ready to be merged if there are no large
objections.  The Walnut stuff likely needs another round or two.  The Bamboo
patches can likely go in, but there is no rush there.

Ethernet for 4xx in general is still provided by the out-of-tree emac rewrite
that Ben and David have poked at.  If it doesn't get merged soon, I'll take
a look at getting it working again.

As an aside, I'll likely be setting up a git tree for 4xx soon.  Hopefully
that will help with some of the larger-ish patches.

josh
-- 

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


[patch 05/14] 40x MMU

2007-07-17 Thread Josh Boyer
Add MMU definitions for 40x platforms.  Also fixes two warnings in 40x_mmu.c.

Signed-off-by: Josh Boyer <[EMAIL PROTECTED]>

---
 arch/powerpc/mm/40x_mmu.c |4 +-
 include/asm-powerpc/mmu-40x.h |   65 ++
 include/asm-powerpc/mmu.h |3 +
 3 files changed, 70 insertions(+), 2 deletions(-)

--- /dev/null
+++ linux-2.6/include/asm-powerpc/mmu-40x.h
@@ -0,0 +1,65 @@
+#ifndef _ASM_POWERPC_MMU_40X_H_
+#define _ASM_POWERPC_MMU_40X_H_
+
+/*
+ * PPC40x support
+ */
+
+#define PPC4XX_TLB_SIZE 64
+
+/*
+ * TLB entries are defined by a "high" tag portion and a "low" data
+ * portion.  On all architectures, the data portion is 32-bits.
+ *
+ * TLB entries are managed entirely under software control by reading,
+ * writing, and searchoing using the 4xx-specific tlbre, tlbwr, and tlbsx
+ * instructions.
+ */
+
+#defineTLB_LO  1
+#defineTLB_HI  0
+
+#defineTLB_DATATLB_LO
+#defineTLB_TAG TLB_HI
+
+/* Tag portion */
+
+#define TLB_EPN_MASK0xFC00  /* Effective Page Number */
+#define TLB_PAGESZ_MASK 0x0380
+#define TLB_PAGESZ(x)   (((x) & 0x7) << 7)
+#define   PAGESZ_1K0
+#define   PAGESZ_4K 1
+#define   PAGESZ_16K2
+#define   PAGESZ_64K3
+#define   PAGESZ_256K   4
+#define   PAGESZ_1M 5
+#define   PAGESZ_4M 6
+#define   PAGESZ_16M7
+#define TLB_VALID   0x0040  /* Entry is valid */
+
+/* Data portion */
+
+#define TLB_RPN_MASK0xFC00  /* Real Page Number */
+#define TLB_PERM_MASK   0x0300
+#define TLB_EX  0x0200  /* Instruction execution allowed */
+#define TLB_WR  0x0100  /* Writes permitted */
+#define TLB_ZSEL_MASK   0x00F0
+#define TLB_ZSEL(x) (((x) & 0xF) << 4)
+#define TLB_ATTR_MASK   0x000F
+#define TLB_W   0x0008  /* Caching is write-through */
+#define TLB_I   0x0004  /* Caching is inhibited */
+#define TLB_M   0x0002  /* Memory is coherent */
+#define TLB_G   0x0001  /* Memory is guarded from prefetch */
+
+#ifndef __ASSEMBLY__
+
+typedef unsigned long phys_addr_t;
+
+typedef struct {
+   unsigned long id;
+   unsigned long vdso_base;
+} mm_context_t;
+
+#endif /* !__ASSEMBLY__ */
+
+#endif /* _ASM_POWERPC_MMU_40X_H_ */
--- linux-2.6.orig/include/asm-powerpc/mmu.h
+++ linux-2.6/include/asm-powerpc/mmu.h
@@ -8,6 +8,9 @@
 #elif defined(CONFIG_PPC_STD_MMU)
 /* 32-bit classic hash table MMU */
 #  include 
+#elif defined(CONFIG_40x)
+/* 40x-style software loaded TLB */
+#  include 
 #elif defined(CONFIG_44x)
 /* 44x-style software loaded TLB */
 #  include 
--- linux-2.6.orig/arch/powerpc/mm/40x_mmu.c
+++ linux-2.6/arch/powerpc/mm/40x_mmu.c
@@ -108,7 +108,7 @@ unsigned long __init mmu_mapin_ram(void)
pmd_t *pmdp;
unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | 
_PAGE_HWWRITE;
 
-   pmdp = pmd_offset(pgd_offset_k(v), v);
+   pmdp = pmd_offset(pud_offset(pgd_offset_k(v), v), v);
pmd_val(*pmdp++) = val;
pmd_val(*pmdp++) = val;
pmd_val(*pmdp++) = val;
@@ -123,7 +123,7 @@ unsigned long __init mmu_mapin_ram(void)
pmd_t *pmdp;
unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | 
_PAGE_HWWRITE;
 
-   pmdp = pmd_offset(pgd_offset_k(v), v);
+   pmdp = pmd_offset(pud_offset(pgd_offset_k(v), v), v);
pmd_val(*pmdp) = val;
 
v += LARGE_PAGE_SIZE_4M;

-- 

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


[patch 01/14] Use resource_size_t for serial port IO addresses

2007-07-17 Thread Josh Boyer
At present, various parts of the serial code use unsigned long to
define resource addresses.  This is a problem, because some 32-bit
platforms have physical addresses larger than 32-bits, and have mmio
serial uarts located above the 4GB point.

This patch changes the type of mapbase in both struct uart_port and
struct plat_serial8250_port to resource_size_t, which can be
configured to be 64 bits on such platforms.  The mapbase in
serial_struct can't safely be changed, because that structure is user
visible.

Signed-off-by: David Gibson <[EMAIL PROTECTED]>
Signed-off-by: Josh Boyer <[EMAIL PROTECTED]>

---
 drivers/serial/8250.c|5 +++--
 drivers/serial/8250_early.c  |   16 +---
 drivers/serial/serial_core.c |9 +
 include/linux/serial_8250.h  |2 +-
 include/linux/serial_core.h  |2 +-
 5 files changed, 19 insertions(+), 15 deletions(-)

--- linux-2.6.orig/include/linux/serial_core.h
+++ linux-2.6/include/linux/serial_core.h
@@ -284,7 +284,7 @@ struct uart_port {
const struct uart_ops   *ops;
unsigned intcustom_divisor;
unsigned intline;   /* port index */
-   unsigned long   mapbase;/* for ioremap */
+   resource_size_t mapbase;/* for ioremap */
struct device   *dev;   /* parent device */
unsigned char   hub6;   /* this should be in 
the 8250 driver */
unsigned char   unused[3];
--- linux-2.6.orig/drivers/serial/serial_core.c
+++ linux-2.6/drivers/serial/serial_core.c
@@ -626,7 +626,7 @@ static int uart_get_info(struct uart_sta
tmp.hub6= port->hub6;
tmp.io_type = port->iotype;
tmp.iomem_reg_shift = port->regshift;
-   tmp.iomem_base  = (void *)port->mapbase;
+   tmp.iomem_base  = (void *)(unsigned long)port->mapbase;
 
if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
return -EFAULT;
@@ -1666,10 +1666,11 @@ static int uart_line_info(char *buf, str
return 0;
 
mmio = port->iotype >= UPIO_MEM;
-   ret = sprintf(buf, "%d: uart:%s %s%08lX irq:%d",
+   ret = sprintf(buf, "%d: uart:%s %s%08llX irq:%d",
port->line, uart_type(port),
mmio ? "mmio:0x" : "port:",
-   mmio ? port->mapbase : (unsigned long) port->iobase,
+   mmio ? (unsigned long long)port->mapbase
+: (unsigned long long) port->iobase,
port->irq);
 
if (port->type == PORT_UNKNOWN) {
@@ -2063,7 +2064,7 @@ uart_report_port(struct uart_driver *drv
case UPIO_TSI:
case UPIO_DWAPB:
snprintf(address, sizeof(address),
-"MMIO 0x%lx", port->mapbase);
+"MMIO 0x%llx", (unsigned long long)port->mapbase);
break;
default:
strlcpy(address, "*unknown*", sizeof(address));
--- linux-2.6.orig/drivers/serial/8250_early.c
+++ linux-2.6/drivers/serial/8250_early.c
@@ -145,8 +145,9 @@ static int __init parse_options(struct e
port->mapbase = simple_strtoul(options + 5, &options, 0);
port->membase = ioremap(port->mapbase, mapsize);
if (!port->membase) {
-   printk(KERN_ERR "%s: Couldn't ioremap 0x%lx\n",
-   __FUNCTION__, port->mapbase);
+   printk(KERN_ERR "%s: Couldn't ioremap 0x%llx\n",
+   __FUNCTION__,
+  (unsigned long long)port->mapbase);
return -ENOMEM;
}
mmio = 1;
@@ -168,9 +169,10 @@ static int __init parse_options(struct e
device->baud);
}
 
-   printk(KERN_INFO "Early serial console at %s 0x%lx (options '%s')\n",
+   printk(KERN_INFO "Early serial console at %s 0x%llx (options '%s')\n",
mmio ? "MMIO" : "I/O port",
-   mmio ? port->mapbase : (unsigned long) port->iobase,
+   mmio ? (unsigned long long) port->mapbase
+: (unsigned long long) port->iobase,
device->options);
return 0;
 }
@@ -236,10 +238,10 @@ static int __init early_uart_console_swi
mmio = (port->iotype == UPIO_MEM);
line = serial8250_start_console(port, device->options);
if (line < 0)
-   printk("No ttyS device at %s 0x%lx for console\n",
+   printk("No ttyS device at %s 0x%llx for console\n",
mmio ? "MMIO" : "I/O port",
-   mmio ? port->mapbase :
-   (unsigned long) port->iobase);
+   mmio ? (unsigned long long) port->mapbase
+: (unsigned long long) port->iobase);
 
unregist

[patch 06/14] 40x decrementer fixes

2007-07-17 Thread Josh Boyer
Allow generic_calibrate_decr to work for 40x platforms.  Given that the hardware
behavior is identical, this also changes the set_dec function to reload the PIT
on 40x to match the behavior 44x currently has.

Signed-off-by: Josh Boyer <[EMAIL PROTECTED]>

---
 arch/powerpc/kernel/time.c |2 +-
 include/asm-powerpc/time.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.orig/arch/powerpc/kernel/time.c
+++ linux-2.6/arch/powerpc/kernel/time.c
@@ -866,7 +866,7 @@ void __init generic_calibrate_decr(void)
"(not found)\n");
}
 
-#ifdef CONFIG_BOOKE
+#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
/* Set the time base to zero */
mtspr(SPRN_TBWL, 0);
mtspr(SPRN_TBWU, 0);
--- linux-2.6.orig/include/asm-powerpc/time.h
+++ linux-2.6/include/asm-powerpc/time.h
@@ -174,7 +174,7 @@ static inline unsigned int get_dec(void)
 static inline void set_dec(int val)
 {
 #if defined(CONFIG_40x)
-   return; /* Have to let it auto-reload */
+   mtspr(SPRN_PIT, val);
 #elif defined(CONFIG_8xx_CPU6)
set_dec_cpu6(val);
 #else

-- 

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


[patch 10/14] Walnut board support

2007-07-17 Thread Josh Boyer
Board support for the PPC405 Walnut evaluation board

Signed-off-by: Josh Boyer <[EMAIL PROTECTED]>

---
 arch/powerpc/platforms/40x/Kconfig  |   14 +++
 arch/powerpc/platforms/40x/Makefile |2 -
 arch/powerpc/platforms/40x/walnut.c |   68 
 arch/powerpc/platforms/Kconfig  |2 -
 arch/powerpc/platforms/Makefile |2 -
 5 files changed, 78 insertions(+), 10 deletions(-)

--- linux-2.6.orig/arch/powerpc/platforms/40x/Makefile
+++ linux-2.6/arch/powerpc/platforms/40x/Makefile
@@ -1 +1 @@
-# empty makefile so make clean works
\ No newline at end of file
+obj-$(CONFIG_WALNUT) += walnut.o
--- /dev/null
+++ linux-2.6/arch/powerpc/platforms/40x/walnut.c
@@ -0,0 +1,68 @@
+/*
+ * Architecture- / platform-specific boot-time initialization code for
+ * IBM PowerPC 4xx based boards. Adapted from original
+ * code by Gary Thomas, Cort Dougan <[EMAIL PROTECTED]>, and Dan Malek
+ * <[EMAIL PROTECTED]>.
+ *
+ * Copyright(c) 1999-2000 Grant Erickson <[EMAIL PROTECTED]>
+ *
+ * Rewritten and ported to the merged powerpc tree:
+ * Copyright 2007 IBM Corporation
+ * Josh Boyer <[EMAIL PROTECTED]>
+ *
+ * 2002 (c) MontaVista, Software, Inc.  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.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static struct of_device_id walnut_of_bus[] = {
+   { .compatible = "ibm,plb", },
+   { .compatible = "ibm,opb", },
+   { .compatible = "ibm,ebc", },
+   {},
+};
+
+static int __init walnut_device_probe(void)
+{
+   if (!machine_is(walnut))
+   return 0;
+
+   /* FIXME: do bus probe here */
+   of_platform_bus_probe(NULL, walnut_of_bus, NULL);
+
+   return 0;
+}
+device_initcall(walnut_device_probe);
+
+static int __init walnut_probe(void)
+{
+   unsigned long root = of_get_flat_dt_root();
+
+   if (!of_flat_dt_is_compatible(root, "ibm,walnut"))
+   return 0;
+
+   return 1;
+}
+
+static void __init walnut_setup_arch(void)
+{
+}
+
+define_machine(walnut) {
+   .name   = "Walnut",
+   .probe  = walnut_probe,
+   .setup_arch = walnut_setup_arch,
+   .progress   = udbg_progress,
+   .init_IRQ   = uic_init_tree,
+   .get_irq= uic_get_irq,
+   .calibrate_decr = generic_calibrate_decr,
+};
--- linux-2.6.orig/arch/powerpc/platforms/40x/Kconfig
+++ linux-2.6/arch/powerpc/platforms/40x/Kconfig
@@ -53,13 +53,13 @@
 #  help
 #This option enables support for the IBM PPC405GPr evaluation board.
 
-#config WALNUT
-#  bool "Walnut"
-#  depends on 40x
-#  default y
-#  select 405GP
-#  help
-#This option enables support for the IBM PPC405GP evaluation board.
+config WALNUT
+   bool "Walnut"
+   depends on 40x
+   default y
+   select 405GP
+   help
+ This option enables support for the IBM PPC405GP evaluation board.
 
 #config XILINX_ML300
 #  bool "Xilinx-ML300"
--- linux-2.6.orig/arch/powerpc/platforms/Kconfig
+++ linux-2.6/arch/powerpc/platforms/Kconfig
@@ -58,7 +58,7 @@ source "arch/powerpc/platforms/85xx/Kcon
 source "arch/powerpc/platforms/86xx/Kconfig"
 source "arch/powerpc/platforms/embedded6xx/Kconfig"
 source "arch/powerpc/platforms/44x/Kconfig"
-#source "arch/powerpc/platforms/4xx/Kconfig
+source "arch/powerpc/platforms/40x/Kconfig"
 
 config PPC_NATIVE
bool
--- linux-2.6.orig/arch/powerpc/platforms/Makefile
+++ linux-2.6/arch/powerpc/platforms/Makefile
@@ -6,7 +6,7 @@ obj-$(CONFIG_PPC_PMAC)  += powermac/
 endif
 endif
 obj-$(CONFIG_PPC_CHRP) += chrp/
-#obj-$(CONFIG_4xx) += 4xx/
+obj-$(CONFIG_40x)  += 40x/
 obj-$(CONFIG_44x)  += 44x/
 obj-$(CONFIG_PPC_MPC52xx)  += 52xx/
 obj-$(CONFIG_PPC_8xx)  += 8xx/

-- 

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


[patch 03/14] 4xx Kconfig cleanup

2007-07-17 Thread Josh Boyer
Remove some leftover cruft in the 40x Kconfig file.  Also make sure we
select WANT_DEVICE_TREE for 40x.

Signed-off-by: Josh Boyer <[EMAIL PROTECTED]>

---
 arch/powerpc/platforms/40x/Kconfig |   77 -
 arch/powerpc/platforms/Kconfig.cputype |1 
 2 files changed, 1 insertion(+), 77 deletions(-)

--- linux-2.6.orig/arch/powerpc/platforms/40x/Kconfig
+++ linux-2.6/arch/powerpc/platforms/40x/Kconfig
@@ -1,16 +1,3 @@
-config 4xx
-   bool
-   depends on 40x || 44x
-   default y
-
-config BOOKE
-   bool
-   depends on 44x
-   default y
-
-menu "AMCC 40x options"
-   depends on 40x
-
 #config BUBINGA
 #  bool "Bubinga"
 #  depends on 40x
@@ -82,8 +69,6 @@ menu "AMCC 40x options"
 #  help
 #This option enables support for the Xilinx ML300 evaluation board.
 
-endmenu
-
 # 40x specific CPU modules, selected based on the board above.
 config NP405H
bool
@@ -126,68 +111,6 @@ config IBM405_ERR77
 config IBM405_ERR51
bool
 
-menu "AMCC 44x options"
-   depends on 44x
-
-#config BAMBOO
-#  bool "Bamboo"
-#  depends on 44x
-#  default n
-#  select 440EP
-#  help
-#This option enables support for the IBM PPC440EP evaluation board.
-
-config EBONY
-   bool "Ebony"
-   depends on 44x
-   default y
-   select 440GP
-   help
- This option enables support for the IBM PPC440GP evaluation board.
-
-#config LUAN
-#  bool "Luan"
-#  depends on 44x
-#  default n
-#  select 440SP
-#  help
-#This option enables support for the IBM PPC440SP evaluation board.
-
-#config OCOTEA
-#  bool "Ocotea"
-#  depends on 44x
-#  default n
-#  select 440GX
-#  help
-#This option enables support for the IBM PPC440GX evaluation board.
-
-endmenu
-
-# 44x specific CPU modules, selected based on the board above.
-config 440EP
-   bool
-   select PPC_FPU
-   select IBM440EP_ERR42
-
-config 440GP
-   bool
-   select IBM_NEW_EMAC_ZMII
-
-config 440GX
-   bool
-
-config 440SP
-   bool
-
-config 440A
-   bool
-   depends on 440GX
-   default y
-
-# 44x errata/workaround config symbols, selected by the CPU models above
-config IBM440EP_ERR42
-   bool
-
 #config XILINX_OCP
 #  bool
 #  depends on XILINX_ML300
--- linux-2.6.orig/arch/powerpc/platforms/Kconfig.cputype
+++ linux-2.6/arch/powerpc/platforms/Kconfig.cputype
@@ -40,6 +40,7 @@ config PPC_8xx
 config 40x
bool "AMCC 40x"
select PPC_DCR_NATIVE
+   select WANT_DEVICE_TREE
 
 config 44x
bool "AMCC 44x"

-- 

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


[patch 12/14] Bamboo DTS

2007-07-17 Thread Josh Boyer
AMCC Bamboo board DTS

Signed-off-by: Josh Boyer <[EMAIL PROTECTED]>

---
 arch/powerpc/boot/dts/bamboo.dts |  248 +++
 1 file changed, 248 insertions(+)

--- /dev/null
+++ linux-2.6/arch/powerpc/boot/dts/bamboo.dts
@@ -0,0 +1,248 @@
+/*
+ * Device Tree Source for AMCC Bamboo
+ *
+ * Copyright (c) 2006, 2007 IBM Corp.
+ * Josh Boyer <[EMAIL PROTECTED]>
+ *
+ * FIXME: Draft only!
+ *
+ * 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.
+ *
+ * To build:
+ *   dtc -I dts -O asm -o bamboo.S -b 0 bamboo.dts
+ *   dtc -I dts -O dtb -o bamboo.dtb -b 0 bamboo.dts
+ */
+
+/ {
+   #address-cells = <2>;
+   #size-cells = <1>;
+   model = "amcc,bamboo";
+   compatible = "amcc,bamboo";
+   dcr-parent = <&/cpus/PowerPC,[EMAIL PROTECTED]>;
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   PowerPC,[EMAIL PROTECTED] {
+   device_type = "cpu";
+   reg = <0>;
+   clock-frequency = <0>; /* Filled in by zImage */
+   timebase-frequency = <0>; /* Filled in by zImage */
+   i-cache-line-size = <20>;
+   d-cache-line-size = <20>;
+   i-cache-size = <8000>;
+   d-cache-size = <8000>;
+   dcr-controller;
+   dcr-access-method = "native";
+   };
+   };
+
+   memory {
+   device_type = "memory";
+   reg = <0 0 0>; /* Filled in by zImage */
+   };
+
+   UIC0: interrupt-controller0 {
+   compatible = "ibm,uic-440gp","ibm,uic";
+   interrupt-controller;
+   cell-index = <0>;
+   dcr-reg = <0c0 009>;
+   #address-cells = <0>;
+   #size-cells = <0>;
+   #interrupt-cells = <2>;
+   };
+
+   UIC1: interrupt-controller1 {
+   compatible = "ibm,uic-440gp","ibm,uic";
+   interrupt-controller;
+   cell-index = <1>;
+   dcr-reg = <0d0 009>;
+   #address-cells = <0>;
+   #size-cells = <0>;
+   #interrupt-cells = <2>;
+   interrupts = <1e 4 1f 4>; /* cascade */
+   interrupt-parent = <&UIC0>;
+   };
+
+   SDR0: sdr {
+   compatible = "ibm,sdr-440ep";
+   dcr-reg = <00e 002>;
+   };
+
+   CPR0: cpr {
+   compatible = "ibm,cpr-440ep";
+   dcr-reg = <00c 002>;
+   };
+
+   plb {
+   compatible = "ibm,plb-440gp", "ibm,plb4";
+   #address-cells = <2>;
+   #size-cells = <1>;
+   ranges;
+   clock-frequency = <0>; /* Filled in by zImage */
+
+   SDRAM0: sdram {
+   compatible = "ibm,sdram-405gp";
+   dcr-reg = <010 2>;
+   };
+
+   DMA0: dma {
+   compatible = "ibm,dma-440gp";
+   dcr-reg = <100 027>;
+   };
+
+   MAL0: mcmal {
+   compatible = "ibm,mcmal-440gp", "ibm,mcmal";
+   dcr-reg = <180 62>;
+   num-tx-chans = <4>;
+   num-rx-chans = <4>;
+   interrupt-parent = <&MAL0>;
+   interrupts = <0 1 2 3 4>;
+   #interrupt-cells = <1>;
+   interrupt-map = ;
+   };
+
+   POB0: opb {
+   compatible = "ibm,opb-440gp", "ibm,opb";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   /* Bamboo is oddball in the 44x world and doesn't use 
the ERPN
+* bits.
+*/
+   ranges = < 0  8000
+ 8000 0 8000 8000>;
+   interrupt-parent = <&UIC1>;
+   interrupts = <7 4>;
+   clock-frequency = <0>; /* Filled in by zImage */
+
+   EBC0: ebc {
+   compatible = "ibm,ebc-440gp", "ibm,ebc";
+   dcr-reg = <012 2>;
+   #address-cells = <2>;
+   #size-cells = <1>;
+   clock-frequency = <0>; /* Filled in by zImage */
+   ranges;
+   interrupts = <5 1>;
+   interrupt-parent = <&UIC1>;
+   };
+
+   UART0: [EMAIL PROTECTED] {
+   device_type = "serial";
+  

[patch 07/14] Fix 40x build

2007-07-17 Thread Josh Boyer
Remove inclusion of __res on 40x.  We don't need it in arch/powerpc

Signed-off-by: Josh Boyer <[EMAIL PROTECTED]>

---
 arch/powerpc/kernel/head_40x.S  |1 -
 arch/powerpc/kernel/ppc_ksyms.c |2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

--- linux-2.6.orig/arch/powerpc/kernel/ppc_ksyms.c
+++ linux-2.6/arch/powerpc/kernel/ppc_ksyms.c
@@ -180,7 +180,7 @@ EXPORT_SYMBOL(cacheable_memcpy);
 EXPORT_SYMBOL(cpm_install_handler);
 EXPORT_SYMBOL(cpm_free_handler);
 #endif /* CONFIG_8xx */
-#if defined(CONFIG_8xx) || defined(CONFIG_40x)
+#if defined(CONFIG_8xx)
 EXPORT_SYMBOL(__res);
 #endif
 
--- linux-2.6.orig/arch/powerpc/kernel/head_40x.S
+++ linux-2.6/arch/powerpc/kernel/head_40x.S
@@ -35,7 +35,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

-- 

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


[patch 08/14] Walnut DTS

2007-07-17 Thread Josh Boyer
Device tree source file for the PPC405 Walnut evaluation board.

Signed-off-by: Josh Boyer <[EMAIL PROTECTED]>

---
 arch/powerpc/boot/dts/walnut.dts |  153 +++
 1 file changed, 153 insertions(+)

--- /dev/null
+++ linux-2.6/arch/powerpc/boot/dts/walnut.dts
@@ -0,0 +1,153 @@
+/*
+ * Device Tree Source for IBM Walnut
+ *
+ * Copyright 2007 IBM Corp.
+ * Josh Boyer <[EMAIL PROTECTED]>
+ *
+ * FIXME: Draft only!
+ *
+ * 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.
+ *
+ * To build:
+ *   dtc -I dts -O asm -o walnut.S -b 0 walnut.dts
+ *   dtc -I dts -O dtb -o walnut.dtb -b 0 walnut.dts
+ */
+
+/ {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   model = "ibm,walnut";
+   compatible = "ibm,walnut";
+   dcr-parent = <&/cpus/PowerPC,[EMAIL PROTECTED]>;
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   PowerPC,[EMAIL PROTECTED] {
+   device_type = "cpu";
+   reg = <0>;
+   clock-frequency = ; /* Filled in by zImage */
+   timebase-frequency = <0>; /* Filled in by zImage */
+   i-cache-line-size = <20>;
+   d-cache-line-size = <20>;
+   i-cache-size = <4000>;
+   d-cache-size = <4000>;
+   dcr-controller;
+   dcr-access-method = "native";
+   };
+   };
+
+   memory {
+   device_type = "memory";
+   reg = <0 0>; /* Filled in by zImage */
+   };
+
+   UIC0: interrupt-controller {
+   compatible = "ibm,uic";
+   interrupt-controller;
+   cell-index = <0>;
+   dcr-reg = <0c0 9>;
+   #address-cells = <0>;
+   #size-cells = <0>;
+   #interrupt-cells = <2>;
+   };
+
+   plb {
+   compatible = "ibm,plb3";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges;
+   clock-frequency = <0>; /* Filled in by zImage */
+
+   SDRAM0: memory-controller {
+   compatible = "ibm,sdram-405gp";
+   dcr-reg = <010 2>;
+   };
+
+   MAL: mcmal {
+   compatible = "ibm,mcmal-405gp", "ibm,mcmal";
+   dcr-reg = <180 62>;
+   num-tx-chans = <2>;
+   num-rx-chans = <1>;
+   interrupt-parent = <&UIC0>;
+   interrupts = ;
+   };
+
+   POB0: opb {
+   compatible = "ibm,opb";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges = <0 ef60 a0>;
+   dcr-reg = <0a0 5>;
+   clock-frequency = <0>; /* Filled in by zImage */
+
+   UART0: [EMAIL PROTECTED] {
+   device_type = "serial";
+   compatible = "ns16550";
+   reg = <300 8>;
+   virtual-reg = ;
+   clock-frequency = <0>; /* Filled in by zImage */
+   current-speed = <2580>;
+   interrupt-parent = <&UIC0>;
+   interrupts = <0 4>;
+   };
+
+   UART1: [EMAIL PROTECTED] {
+   device_type = "serial";
+   compatible = "ns16550";
+   reg = <400 8>;
+   virtual-reg = ;
+   clock-frequency = <0>; /* Filled in by zImage */
+   current-speed = <2580>;
+   interrupt-parent = <&UIC0>;
+   interrupts = <1 4>;
+   };
+
+   IIC: [EMAIL PROTECTED] {
+   compatible = "ibm,iic-405gp", "ibm,iic";
+   reg = <500 11>;
+   interrupt-parent = <&UIC0>;
+   interrupts = <2 4>;
+   };
+
+   GPIO: [EMAIL PROTECTED] {
+   compatible = "ibm,gpio-405gp";
+   reg = <700 20>;
+   };
+
+   EMAC: [EMAIL PROTECTED] {
+   linux,network-index = <0>;
+   device_type = "network";
+   compatible = "ibm,emac-405gp", "ibm,emac";
+   interrupt-paren

[patch 13/14] Bamboo board support

2007-07-17 Thread Josh Boyer
Add support for the AMCC Bamboo board

Signed-off-by: Josh Boyer <[EMAIL PROTECTED]>

---
 arch/powerpc/configs/bamboo_defconfig |  906 ++
 arch/powerpc/platforms/44x/Kconfig|   15 
 arch/powerpc/platforms/44x/Makefile   |1 
 arch/powerpc/platforms/44x/bamboo.c   |   66 ++
 4 files changed, 981 insertions(+), 7 deletions(-)

--- /dev/null
+++ linux-2.6/arch/powerpc/configs/bamboo_defconfig
@@ -0,0 +1,906 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.21
+# Mon May 14 07:25:36 2007
+#
+# CONFIG_PPC64 is not set
+CONFIG_PPC32=y
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+# CONFIG_DEFAULT_UIMAGE is not set
+
+#
+# Processor support
+#
+# CONFIG_CLASSIC32 is not set
+# CONFIG_PPC_82xx is not set
+# CONFIG_PPC_83xx is not set
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_86xx is not set
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+CONFIG_44x=y
+# CONFIG_E200 is not set
+CONFIG_PPC_FPU=y
+CONFIG_PPC_DCR_NATIVE=y
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_PPC_DCR=y
+CONFIG_4xx=y
+CONFIG_BOOKE=y
+CONFIG_PTE_64BIT=y
+CONFIG_PHYS_64BIT=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_NOT_COHERENT_CACHE=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL 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_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
+#
+# Platform support
+#
+# CONFIG_PPC_MPC52xx is not set
+# CONFIG_PPC_MPC5200 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+CONFIG_BAMBOO=y
+# CONFIG_EBONY is not set
+CONFIG_440EP=y
+CONFIG_IBM440EP_ERR42=y
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPM2 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+CONFIG_MATH_EMULATION=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_PROC_DEVICETREE=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE=""
+CONFIG_SECCOMP=y
+CONFIG_WANT_DEVICE_TREE=y
+CONFIG_DEVICE_TREE="bamboo.dts"
+CONFIG_ISA_DMA_A

[patch 04/14] 4xx bootwrapper reworks

2007-07-17 Thread Josh Boyer
Rename the 44x.c wrapper file to 4xx.c and make the fixup_memsize function
common for all of 4xx.  Also adds a common function to reset ethernet and a
40x reset function.

Signed-off-by: Josh Boyer <[EMAIL PROTECTED]>

---
 arch/powerpc/boot/44x.c|   85 --
 arch/powerpc/boot/44x.h|4 -
 arch/powerpc/boot/4xx.c|  111 +
 arch/powerpc/boot/4xx.h|   20 
 arch/powerpc/boot/Makefile |4 -
 arch/powerpc/boot/dcr.h|2 
 arch/powerpc/boot/ebony.c  |3 -
 7 files changed, 137 insertions(+), 92 deletions(-)

--- linux-2.6.orig/arch/powerpc/boot/44x.h
+++ linux-2.6/arch/powerpc/boot/44x.h
@@ -10,10 +10,6 @@
 #ifndef _PPC_BOOT_44X_H_
 #define _PPC_BOOT_44X_H_
 
-void ibm44x_fixup_memsize(void);
-void ibm4xx_fixup_ebc_ranges(const char *ebc);
-
-void ibm44x_dbcr_reset(void);
 void ebony_init(void *mac0, void *mac1);
 
 #endif /* _PPC_BOOT_44X_H_ */
--- /dev/null
+++ linux-2.6/arch/powerpc/boot/4xx.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2007 David Gibson, IBM Corporation.
+ *
+ * Based on earlier code:
+ *   Matt Porter <[EMAIL PROTECTED]>
+ *   Copyright 2002-2005 MontaVista Software Inc.
+ *
+ *   Eugene Surovegin <[EMAIL PROTECTED]> or <[EMAIL PROTECTED]>
+ *   Copyright (c) 2003, 2004 Zultys Technologies
+ *
+ * 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 
+#include "types.h"
+#include "string.h"
+#include "stdio.h"
+#include "ops.h"
+#include "reg.h"
+#include "dcr.h"
+
+/* Read the 4xx SDRAM controller to get size of system memory. */
+void ibm4xx_fixup_memsize(void)
+{
+   int i;
+   unsigned long memsize, bank_config;
+
+   memsize = 0;
+   for (i = 0; i < ARRAY_SIZE(sdram_bxcr); i++) {
+   mtdcr(DCRN_SDRAM0_CFGADDR, sdram_bxcr[i]);
+   bank_config = mfdcr(DCRN_SDRAM0_CFGDATA);
+
+   if (bank_config & SDRAM_CONFIG_BANK_ENABLE)
+   memsize += SDRAM_CONFIG_BANK_SIZE(bank_config);
+   }
+
+   dt_fixup_memory(0, memsize);
+}
+
+#define DBCR0_RST_SYSTEM 0x3000
+
+void ibm44x_dbcr_reset(void)
+{
+   unsigned long tmp;
+
+   /* DBCR0 on 44x is SPRN 0x134 */
+   asm volatile (
+   "mfspr  %0,%1\n"
+   "oris   %0,%0,[EMAIL PROTECTED]"
+   "mtspr  %1,%0"
+   : "=&r"(tmp) : "i"(0x134), "i"(DBCR0_RST_SYSTEM)
+   );
+
+}
+
+void ibm40x_dbcr_reset(void)
+{
+   unsigned long tmp;
+
+   /* DBCR0 on 4xx is SPRN 0x3F2 */
+   asm volatile (
+   "mfspr  %0,%1\n"
+   "oris   %0,%0,[EMAIL PROTECTED]"
+   "mtspr  %1,%0"
+   : "=&r"(tmp) : "i"(0x3F2), "i"(DBCR0_RST_SYSTEM)
+   );
+}
+
+#define EMAC_RESET 0x2000
+#define MAL_RESET 0x8000
+void ibm4xx_reset_eth(u32 *emac0, u32 *emac1)
+{
+   /* Reset the MAL and EMAC(s) since PIBS/OpenBIOS don't do this for us */
+   if (emac0)
+   *emac0 = EMAC_RESET;
+   if (emac1)
+   *emac1 = EMAC_RESET;
+
+   mtdcr(DCRN_MAL0_CFG, MAL_RESET);
+}
+
+/* Read 4xx EBC bus bridge registers to get mappings of the peripheral
+ * banks into the OPB address space */
+void ibm4xx_fixup_ebc_ranges(const char *ebc)
+{
+   void *devp;
+   u32 bxcr;
+   u32 ranges[EBC_NUM_BANKS*4];
+   u32 *p = ranges;
+   int i;
+
+   for (i = 0; i < EBC_NUM_BANKS; i++) {
+   mtdcr(DCRN_EBC0_CFGADDR, EBC_BXCR(i));
+   bxcr = mfdcr(DCRN_EBC0_CFGDATA);
+
+   if ((bxcr & EBC_BXCR_BU) != EBC_BXCR_BU_OFF) {
+   *p++ = i;
+   *p++ = 0;
+   *p++ = bxcr & EBC_BXCR_BAS;
+   *p++ = EBC_BXCR_BANK_SIZE(bxcr);
+   }
+   }
+
+   devp = finddevice(ebc);
+   if (! devp)
+   fatal("Couldn't locate EBC node %s\n\r", ebc);
+
+   setprop(devp, "ranges", ranges, (p - ranges) * sizeof(u32));
+}
--- /dev/null
+++ linux-2.6/arch/powerpc/boot/4xx.h
@@ -0,0 +1,20 @@
+/*
+ * PowerPC 4xx related functions
+ *
+ * Copyright 2007 IBM Corporation.
+ * Josh Boyer <[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 _POWERPC_BOOT_4XX_H_
+#define _POWERPC_BOOT_4XX_H_
+
+void ibm4xx_fixup_memsize(void);
+void ibm44x_dbcr_reset(void);
+void ibm40x_dbcr_reset(void);
+void ibm4xx_reset_eth(u32 *emac0, u32 *emac1);
+void ibm4xx_fixup_ebc_ranges(const char *ebc);
+
+#endif /* _POWERPC_BOOT_4XX_H_ */
--- linux-2.6.orig/arch/powerpc/boot/dcr.h
+++ linux-2.6/arch/powerpc/boot/dcr.h
@@ -121,4 +121,6 @@ static const unsigne

[patch 11/14] Walnut zImage wrapper

2007-07-17 Thread Josh Boyer
Add zImage wrapper for walnut board

Signed-off-by: Josh Boyer <[EMAIL PROTECTED]>

---
 arch/powerpc/boot/Makefile  |3 -
 arch/powerpc/boot/treeboot-walnut.c |   92 
 2 files changed, 94 insertions(+), 1 deletion(-)

--- linux-2.6.orig/arch/powerpc/boot/Makefile
+++ linux-2.6/arch/powerpc/boot/Makefile
@@ -47,7 +47,7 @@ src-wlib := string.S crt0.S stdio.c main
4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c
 src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \
cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
-   ps3-head.S ps3-hvcall.S ps3.c
+   ps3-head.S ps3-hvcall.S ps3.c treeboot-walnut.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -142,6 +142,7 @@ ifneq ($(CONFIG_DEVICE_TREE),"")
 image-$(CONFIG_PPC_83xx)   += cuImage.83xx
 image-$(CONFIG_PPC_85xx)   += cuImage.85xx
 image-$(CONFIG_EBONY)  += treeImage.ebony cuImage.ebony
+image-$(CONFIG_WALNUT) += treeImage.walnut
 endif
 
 # For 32-bit powermacs, build the COFF and miboot images
--- /dev/null
+++ linux-2.6/arch/powerpc/boot/treeboot-walnut.c
@@ -0,0 +1,92 @@
+/*
+ * Old U-boot compatibility for Walnut
+ *
+ * Author: Josh Boyer <[EMAIL PROTECTED]>
+ *
+ * Copyright 2007 IBM Corporation
+ *   Based on cuboot-83xx.c, which is:
+ * 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 "dcr.h"
+#include "4xx.h"
+
+extern char _end[];
+extern char _dtb_start[];
+extern char _dtb_end[];
+
+BSS_STACK(4096);
+
+void ibm405gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
+{
+   u32 pllmr = mfdcr(0xb0);
+   u32 cpc0_cr0 = mfdcr(0xb1);
+   u32 cpc0_cr1 = mfdcr(0xb2);
+   u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
+   u32 fwdv, fbdv, cbdv, opdv, epdv, udiv;
+
+   fwdv = (8 - ((pllmr & 0xe000) >> 29));
+   fbdv = (pllmr & 0x1e00) >> 25;
+   cbdv = ((pllmr & 0x0006) >> 17) + 1;
+   opdv = ((pllmr & 0x00018000) >> 15) + 1;
+   epdv = ((pllmr & 0x1800) >> 13) + 2;
+   udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
+
+   m = fwdv * fbdv * cbdv;
+
+   cpu = sysclk * m / fwdv;
+   plb = cpu / cbdv;
+   opb = plb / opdv;
+   ebc = plb / epdv;
+
+   if (cpc0_cr0 & 0x80) {
+   /* uart0 uses the external clock */
+   uart0 = ser_clk;
+   } else {
+   uart0 = cpu / udiv;
+   }
+
+   if (cpc0_cr0 & 0x40) {
+   /* uart1 uses the external clock */
+   uart1 = ser_clk;
+   } else {
+   uart1 = cpu / udiv;
+   }
+
+   /* setup the timebase clock to tick at the cpu frequency */
+   cpc0_cr1 = cpc0_cr1 & ~ 0x0080;
+   mtdcr(0xb2, cpc0_cr1);
+   tb = cpu;
+
+   dt_fixup_cpu_clocks(cpu, tb, 0);
+   dt_fixup_clock("/plb", plb);
+   dt_fixup_clock("/plb/opb", opb);
+   dt_fixup_clock("/plb/ebc", ebc);
+   dt_fixup_clock("/plb/opb/[EMAIL PROTECTED]", uart0);
+   dt_fixup_clock("/plb/opb/[EMAIL PROTECTED]", uart1);
+}
+
+static void walnut_fixups(void)
+{
+   ibm4xx_fixup_memsize();
+   ibm405gp_fixup_clocks(, 0xa8c000);
+   ibm4xx_reset_eth((u32 *)0xef600800, NULL);
+}
+
+void platform_init(void)
+{
+   unsigned long end_of_ram = 0x200;
+   unsigned long avail_ram = end_of_ram - (unsigned long) _end;
+
+   simple_alloc_init(_end, avail_ram, 32, 32);
+   platform_ops.fixups = walnut_fixups;
+   platform_ops.exit = ibm40x_dbcr_reset;
+   ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
+   serial_console_init();
+}

-- 

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


[patch 09/14] Walnut defconfig

2007-07-17 Thread Josh Boyer
Walnut board defconfig

Signed-off-by: Josh Boyer <[EMAIL PROTECTED]>

---
 arch/powerpc/configs/walnut_defconfig |  776 ++
 1 file changed, 776 insertions(+)

--- /dev/null
+++ linux-2.6/arch/powerpc/configs/walnut_defconfig
@@ -0,0 +1,776 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.22-rc4
+# Tue Jul 10 11:16:06 2007
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+CONFIG_40x=y
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_4xx=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_NOT_COHERENT_CACHE=y
+CONFIG_PPC32=y
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+# CONFIG_PPC_UDBG_16550 is not set
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+# CONFIG_DEFAULT_UIMAGE is not set
+CONFIG_PPC_DCR_NATIVE=y
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_PPC_DCR=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
+#
+# Platform support
+#
+# CONFIG_PPC_MPC52xx is not set
+# CONFIG_PPC_MPC5200 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+CONFIG_WALNUT=y
+CONFIG_405GP=y
+CONFIG_IBM405_ERR77=y
+CONFIG_IBM405_ERR51=y
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPM2 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_MATH_EMULATION is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+CONFIG_SECCOMP=y
+CONFIG_WANT_DEVICE_TREE=y
+CONFIG_DEVICE_TREE="walnut.dts"
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_ZONE_DMA=y
+# CONFIG_PCI is not set
+# CONFIG_PCI_DOMAINS is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration o

[patch 14/14] Bamboo zImage wrapper

2007-07-17 Thread Josh Boyer
Add a bootwrapper for Bamboo

Signed-off-by: Josh Boyer <[EMAIL PROTECTED]>

---
 arch/powerpc/boot/44x.h |1 
 arch/powerpc/boot/Makefile  |5 -
 arch/powerpc/boot/bamboo.c  |  126 
 arch/powerpc/boot/dcr.h |   11 +++
 arch/powerpc/boot/treeboot-bamboo.c |   27 +++
 5 files changed, 168 insertions(+), 2 deletions(-)

--- linux-2.6.orig/arch/powerpc/boot/Makefile
+++ linux-2.6/arch/powerpc/boot/Makefile
@@ -44,10 +44,10 @@ $(addprefix $(obj)/,$(zlib) gunzip_util.
 src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
ns16550.c serial.c simple_alloc.c div64.S util.S \
gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \
-   4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c
+   4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c
 src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \
cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
-   ps3-head.S ps3-hvcall.S ps3.c treeboot-walnut.c
+   ps3-head.S ps3-hvcall.S ps3.c treeboot-walnut.c 
treeboot-bamboo.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -143,6 +143,7 @@ image-$(CONFIG_PPC_83xx)+= cuImage.83x
 image-$(CONFIG_PPC_85xx)   += cuImage.85xx
 image-$(CONFIG_EBONY)  += treeImage.ebony cuImage.ebony
 image-$(CONFIG_WALNUT) += treeImage.walnut
+image-$(CONFIG_BAMBOO) += treeImage.bamboo
 endif
 
 # For 32-bit powermacs, build the COFF and miboot images
--- /dev/null
+++ linux-2.6/arch/powerpc/boot/bamboo.c
@@ -0,0 +1,126 @@
+/*
+ * Copyright IBM Corporation, 2007
+ * Josh Boyer <[EMAIL PROTECTED]>
+ *
+ * Based on ebony wrapper:
+ * Copyright 2007 David Gibson, IBM Corporation.
+ *
+ * Clocking code based on code by:
+ * Stefan Roese <[EMAIL PROTECTED]>
+ *
+ * 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; version 2 of the License
+ */
+#include 
+#include 
+#include "types.h"
+#include "elf.h"
+#include "string.h"
+#include "stdio.h"
+#include "page.h"
+#include "ops.h"
+#include "dcr.h"
+#include "4xx.h"
+#include "44x.h"
+
+extern char _dtb_start[];
+extern char _dtb_end[];
+
+#define SPRN_CCR1 0x378
+void ibm440ep_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
+{
+   u32 cpu, plb, opb, ebc, tb, uart0, m, vco;
+   u32 reg;
+   u32 fwdva, fwdvb, fbdv, lfbdv, opbdv0, perdv0, spcid0, prbdv0, tmp;
+
+   mtdcr(DCRN_CPR0_ADDR, CPR0_PLLD0);
+   reg = mfdcr(DCRN_CPR0_DATA);
+   tmp = (reg & 0x000F) >> 16;
+   fwdva = tmp ? tmp : 16;
+   tmp = (reg & 0x0700) >> 8;
+   fwdvb = tmp ? tmp : 8;
+   tmp = (reg & 0x1F00) >> 24;
+   fbdv = tmp ? tmp : 32;
+   lfbdv = (reg & 0x007F);
+
+   mtdcr(DCRN_CPR0_ADDR, CPR0_OPBD0);
+   reg = mfdcr(DCRN_CPR0_DATA);
+   tmp = (reg & 0x0300) >> 24;
+   opbdv0 = tmp ? tmp : 4;
+
+   mtdcr(DCRN_CPR0_ADDR, CPR0_PERD0);
+   reg = mfdcr(DCRN_CPR0_DATA);
+   tmp = (reg & 0x0700) >> 24;
+   perdv0 = tmp ? tmp : 8;
+
+   mtdcr(DCRN_CPR0_ADDR, CPR0_PRIMBD0);
+   reg = mfdcr(DCRN_CPR0_DATA);
+   tmp = (reg & 0x0700) >> 24;
+   prbdv0 = tmp ? tmp : 8;
+
+   mtdcr(DCRN_CPR0_ADDR, CPR0_SCPID);
+   reg = mfdcr(DCRN_CPR0_DATA);
+   tmp = (reg & 0x0300) >> 24;
+   spcid0 = tmp ? tmp : 4;
+
+   /* Calculate M */
+   mtdcr(DCRN_CPR0_ADDR, CPR0_PLLC0);
+   reg = mfdcr(DCRN_CPR0_DATA);
+   tmp = (reg & 0x0300) >> 24;
+   if (tmp == 0) { /* PLL output */
+   tmp = (reg & 0x2000) >> 29;
+   if (!tmp) /* PLLOUTA */
+   m = fbdv * lfbdv * fwdva;
+   else
+   m = fbdv * lfbdv * fwdvb;
+   }
+   else if (tmp == 1) /* CPU output */
+   m = fbdv * fwdva;
+   else
+   m = perdv0 * opbdv0 * fwdvb;
+
+   vco = (m * sysclk) + (m >> 1);
+   cpu = vco / fwdva;
+   plb = vco / fwdvb / prbdv0;
+   opb = plb / opbdv0;
+   ebc = plb / perdv0;
+
+   /* FIXME */
+   uart0 = ser_clk;
+
+   /* Figure out timebase.  Either CPU or default TmrClk */
+   asm volatile (
+   "mfspr  %0,%1\n"
+   :
+   "=&r"(reg) : "i"(SPRN_CCR1));
+   if (reg & 0x0080)
+   tb = 2500; /* TmrClk is 25MHz */
+   else
+   tb = cpu;
+
+   dt_fixup_cpu_clocks(cpu, tb, 0);
+   dt_fixup_clock("/plb", plb);
+   dt_fixup_clock("/plb/opb", opb);
+   dt_fixup_clock("/plb/opb/ebc", ebc);
+   dt_fixup_clock("/plb/opb/[EMAIL PROTECTED]", uart0);
+   dt_fixup_clock("/plb/opb/[EMAIL PROTECTED]", ua

Re: [PATCH] POWERPC: Added RTC support for mpc8313RDB and utilize "clock-frequency"

2007-07-17 Thread Guennadi Liakhovetski
On Tue, 17 Jul 2007, Vitaly Bordug wrote:

> > Please don't do this; drivers/i2c/chips/ds1337.c is deprecated.  You
> > should be using the RTC-class driver in drivers/rtc/rtc-ds1307.c, which
> > has a non-device-specific API that can be used.
> > 
> > The ppc_md RTC functions should really just go away, though -- setting
> > the clock on bootup can be done by generic code, and periodically
> > updating the RTC when using NTP can be done from userspace.
> 
> If those ppc_md hookups would be declared deprecated, there's no much sense 
> in the upper,
> apparently. But I am not sure they will be... I'm inclined to let this patch 
> floating since
> interacting with rtc class from within BSP code just does not worth it.

Exactly! Don't interact with it. Just leave it alone. No need to re-write 
[sg]et_rtc_time, bother with setting system time on bootup... Just let the 
rtc driver and framework do it for you.

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


[PATCH] powerpc: mpc5200 low power mode

2007-07-17 Thread Sylvain Munaut
From: Domen Puncer <[EMAIL PROTECTED]>

Low-power mode implementation for Lite5200b.
Some I/O registers are also saved here.

A recent U-Boot that supports this (lite5200b_PM_config) is needed.

Signed-off-by: Domen Puncer <[EMAIL PROTECTED]>
Signed-off-by: Sylvain Munaut <[EMAIL PROTECTED]>
---
Hi Paulus,

Could you push this with you next merge ? It's the support for lite5200 low 
power
mode, posted on -embedded a few days ago.


Sylvain

---
 arch/powerpc/platforms/52xx/Makefile |3 +
 arch/powerpc/platforms/52xx/lite5200.c   |   14 +-
 arch/powerpc/platforms/52xx/lite5200_pm.c|  213 +
 arch/powerpc/platforms/52xx/lite5200_sleep.S |  413 ++
 include/asm-powerpc/mpc52xx.h|   10 +
 5 files changed, 648 insertions(+), 5 deletions(-)
 create mode 100644 arch/powerpc/platforms/52xx/lite5200_pm.c
 create mode 100644 arch/powerpc/platforms/52xx/lite5200_sleep.S

diff --git a/arch/powerpc/platforms/52xx/Makefile 
b/arch/powerpc/platforms/52xx/Makefile
index b91e39c..307dbc1 100644
--- a/arch/powerpc/platforms/52xx/Makefile
+++ b/arch/powerpc/platforms/52xx/Makefile
@@ -10,3 +10,6 @@ obj-$(CONFIG_PPC_EFIKA)   += efika.o
 obj-$(CONFIG_PPC_LITE5200) += lite5200.o
 
 obj-$(CONFIG_PM)   += mpc52xx_sleep.o mpc52xx_pm.o
+ifeq ($(CONFIG_PPC_LITE5200),y)
+   obj-$(CONFIG_PM)+= lite5200_sleep.o lite5200_pm.o
+endif
diff --git a/arch/powerpc/platforms/52xx/lite5200.c 
b/arch/powerpc/platforms/52xx/lite5200.c
index 5c46e89..16eb5ad 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -86,7 +86,6 @@ error:
 }
 
 #ifdef CONFIG_PM
-static u32 descr_a;
 static void lite5200_suspend_prepare(void __iomem *mbar)
 {
u8 pin = 1; /* GPIO_WKUP_1 (GPIO_PSC2_4) */
@@ -97,13 +96,18 @@ static void lite5200_suspend_prepare(void __iomem *mbar)
 * power down usb port
 * this needs to be called before of-ohci suspend code
 */
-   descr_a = in_be32(mbar + 0x1048);
-   out_be32(mbar + 0x1048, (descr_a & ~0x200) | 0x100);
+
+   /* set ports to "power switched" and "powered at the same time"
+* USB Rh descriptor A: NPS = 0, PSM = 0 */
+   out_be32(mbar + 0x1048, in_be32(mbar + 0x1048) & ~0x300);
+   /* USB Rh status: LPS = 1 - turn off power */
+   out_be32(mbar + 0x1050, 0x0001);
 }
 
 static void lite5200_resume_finish(void __iomem *mbar)
 {
-   out_be32(mbar + 0x1048, descr_a);
+   /* USB Rh status: LPSC = 1 - turn on power */
+   out_be32(mbar + 0x1050, 0x0001);
 }
 #endif
 
@@ -132,7 +136,7 @@ static void __init lite5200_setup_arch(void)
 #ifdef CONFIG_PM
mpc52xx_suspend.board_suspend_prepare = lite5200_suspend_prepare;
mpc52xx_suspend.board_resume_finish = lite5200_resume_finish;
-   mpc52xx_pm_init();
+   lite5200_pm_init();
 #endif
 
 #ifdef CONFIG_PCI
diff --git a/arch/powerpc/platforms/52xx/lite5200_pm.c 
b/arch/powerpc/platforms/52xx/lite5200_pm.c
new file mode 100644
index 000..f26afcd
--- /dev/null
+++ b/arch/powerpc/platforms/52xx/lite5200_pm.c
@@ -0,0 +1,213 @@
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "mpc52xx_pic.h"
+
+/* defined in lite5200_sleep.S and only used here */
+extern void lite5200_low_power(void __iomem *sram, void __iomem *mbar);
+
+static struct mpc52xx_cdm __iomem *cdm;
+static struct mpc52xx_intr __iomem *pic;
+static struct mpc52xx_sdma __iomem *bes;
+static struct mpc52xx_xlb __iomem *xlb;
+static struct mpc52xx_gpio __iomem *gps;
+static struct mpc52xx_gpio_wkup __iomem *gpw;
+static void __iomem *sram;
+static const int sram_size = 0x4000;   /* 16 kBytes */
+static void __iomem *mbar;
+
+static int lite5200_pm_valid(suspend_state_t state)
+{
+   switch (state) {
+   case PM_SUSPEND_STANDBY:
+   case PM_SUSPEND_MEM:
+   return 1;
+   default:
+   return 0;
+   }
+}
+
+static int lite5200_pm_prepare(suspend_state_t state)
+{
+   /* deep sleep? let mpc52xx code handle that */
+   if (state == PM_SUSPEND_STANDBY)
+   return mpc52xx_pm_prepare(state);
+
+   if (state != PM_SUSPEND_MEM)
+   return -EINVAL;
+
+   /* map registers */
+   mbar = mpc52xx_find_and_map("mpc5200");
+   if (!mbar) {
+   printk(KERN_ERR "%s:%i Error mapping registers\n", __func__, 
__LINE__);
+   return -ENOSYS;
+   }
+
+   cdm = mbar + 0x200;
+   pic = mbar + 0x500;
+   gps = mbar + 0xb00;
+   gpw = mbar + 0xc00;
+   bes = mbar + 0x1200;
+   xlb = mbar + 0x1f00;
+   sram = mbar + 0x8000;
+
+   return 0;
+}
+
+/* save and restore registers not bound to any real devices */
+static struct mpc52xx_cdm scdm;
+static struct mpc52xx_intr spic;
+static struct mpc52xx_sdma sbes;
+static struct mpc52xx_xlb sxlb;
+static struct mpc52xx_gpio sgps;
+static struct mpc52xx_gpio_wkup sgpw;
+
+static void li

Re: [PATCH v2] Allow exec on 32-bit from readable, non-exec pages, with a warning.

2007-07-17 Thread Jon Loeliger
On Mon, 2007-07-09 at 16:48, Scott Wood wrote:
> In older versions of glibc (through 2.3), the dynamic linker executes a
> small amount of code from the data segment, which is not marked as
> executable.  A recent change (commit 9ba4ace39fdfe22268daca9f28c5df384ae462cf)
> stops this from working; there should be a deprecation period before
> older glibc versions stop working.
> 
> The problem has been observed on glibc 2.2.  While glibc 2.3 has the same
> code, I did not see the problem; it may be that it accesses the page in
> question as data before executing from it, and thus it is already mapped.
> 
> Note that this only applies to the classic 32-bit PowerPC MMU and the
> MPC8xx MMU, not Book E, 64-bit, etc.  These MMUs do not support per-page
> no-exec, and thus this patch isn't taking away any effective protection
> enforcement.  Currently, such accesses will fail only if the page in
> question has not already been faulted on (and thus mapped).
> 
> Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
> ---

Well now.  I've spent a good chunk of today with Our Friend, git-bisect,
verifying that, in fact, the commit 9ba4ace39fdfe22268daca9f28c5df384ae462cf
breaks the 8641 HPCN port.  init doesn't run off an old NFS'ed root FS
worth a Steven J Hill of beans.

But luckily, this gave me the opportunity to then realize that
we should give a great big...

Amen-brother-by: Jon Loeliger <[EMAIL PROTECTED]>

to this patch from Scott.

So, an official plea to Paul to apply this to his tree.

jdl


> v2: Added to the changelog to explain why this change isn't harmful.
> 
>  arch/powerpc/mm/fault.c |   22 +-
>  1 files changed, 21 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
> index 0ece513..2445512 100644
> --- a/arch/powerpc/mm/fault.c
> +++ b/arch/powerpc/mm/fault.c
> @@ -125,6 +125,18 @@ static void do_dabr(struct pt_regs *regs, unsigned long 
> address,
>  }
>  #endif /* !(CONFIG_4xx || CONFIG_BOOKE)*/
>  
> +#ifdef CONFIG_PPC32
> +static void warn_exec_from_noexec(void)
> +{
> + if (printk_ratelimit())
> + printk(KERN_WARNING "Process %s (%d) attempted to execute from "
> + "a non-executable page.\n"
> +KERN_WARNING "This may stop working in future kernels.  "
> + "Please upgrade your libc.\n",
> +current->comm, current->pid);
> +}
> +#endif
> +
>  /*
>   * For 600- and 800-family processors, the error_code parameter is DSISR
>   * for a data fault, SRR1 for an instruction fault. For 400-family processors
> @@ -283,8 +295,16 @@ good_area:
>   /* protection fault */
>   if (error_code & DSISR_PROTFAULT)
>   goto bad_area;
> - if (!(vma->vm_flags & VM_EXEC))
> + if (!(vma->vm_flags & VM_EXEC)) {
> +#ifdef CONFIG_PPC32
> + if (vma->vm_flags & VM_READ)
> + warn_exec_from_noexec();
> + else
> + goto bad_area;
> +#else
>   goto bad_area;
> +#endif
> + }
>  #else
>   pte_t *ptep;
>   pmd_t *pmdp;

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


Re: [PATCH] iommu virtual merge no longer experimental

2007-07-17 Thread Benjamin Herrenschmidt
On Tue, 2007-07-17 at 11:09 -0500, Linas Vepstas wrote:
> Per conversations with BenH, iommu virtual merging should no longer
> be considered to be an "experimental" feature. In particular, 
> CONFIG_VMERGE has been set to "y" in te defconfigs for quite a while.
> 
> Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]>

Acked-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>

> 
>  arch/powerpc/Kconfig |   11 ++-
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> Index: linux-2.6.22-git2/arch/powerpc/Kconfig
> ===
> --- linux-2.6.22-git2.orig/arch/powerpc/Kconfig   2007-07-08 
> 18:32:17.0 -0500
> +++ linux-2.6.22-git2/arch/powerpc/Kconfig2007-07-17 11:08:18.0 
> -0500
> @@ -430,16 +430,17 @@ config MATH_EMULATION
> instructions to run.
>  
>  config IOMMU_VMERGE
> - bool "Enable IOMMU virtual merging (EXPERIMENTAL)"
> - depends on EXPERIMENTAL && PPC64
> - default n
> + bool "Enable IOMMU virtual merging"
> + depends on PPC64
> + default y
>   help
> Cause IO segments sent to a device for DMA to be merged virtually
> by the IOMMU when they happen to have been allocated contiguously.
> This doesn't add pressure to the IOMMU allocator. However, some
> drivers don't support getting large merged segments coming back
> -   from *_map_sg(). Say Y if you know the drivers you are using are
> -   properly handling this case.
> +   from *_map_sg().
> +
> +   Most drivers don't have this problem; it is safe to say Y here.
>  
>  config HOTPLUG_CPU
>   bool "Support for enabling/disabling CPUs"

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


Re: hugetlbfs for ppc440 - kernel BUG -- follow up

2007-07-17 Thread Satya
hello,

Upon investigating the below issue further, I found that
pte_alloc_map() calls kmap_atomic. The allocated pte page must be
unmapped before invoking any function that might_sleep.

In this case clear_huge_page() is being called without invoking
pte_unmap(). The 'normal' counterpart of hugetlb_no_page (which is
do_no_page() in mm/memory.c) does call pte_unmap() before calling
alloc_page() (which might sleep).

So, I believe pte_unmap() must be invoked first in hugetlb_no_page().
But the problem here is, we do not have a reference to the pmd to map
the pte again (using pte_offset_map()). The do_no_page() function does
have a pmd_t* parameter, so it can remap the pte when required.

For now, I resolved the problem by expanding the pte_alloc_map() macro
by hand and replacing kmap_atomic with kmap(), although I think it is
not the right thing to do.

Let me know if my analysis is helping you figure out the problem here. Thanks!

--satya.

On 7/10/07, Satya <[EMAIL PROTECTED]> wrote:
> hello,
> I am trying to implement hugetlbfs on the IBM Bluegene/L IO node
> (ppc440) and I have a big problem as well as a few questions to ask
> the group. I patched a 2.6.21.6 linux kernel (manually) with Edi
> Shmueli's hugetlbfs implementation (found here:
> http://patchwork.ozlabs.org/linuxppc/patch?id=8427) for this. I did
> have to make slight changes (described at the end) to make it work.
> My test program is a shortened version of a sys v shared memory
> example described in Documentation/vm/hugetlbpage.txt
>
> I get the following kernel BUG when a page fault occurs on a huge page 
> address:
> BUG: scheduling while atomic: shmtest2/0x1001/1291
> Call Trace:
> [CFF0BCE0] [C00084F4] show_stack+0x4c/0x194 (unreliable)
>  [CFF0BD20] [C01A53C4] schedule+0x664/0x668
> [CFF0BD60] [C00175F8] __cond_resched+0x24/0x50
> [CFF0BD80] [C01A5A6C] cond_resched+0x50/0x58
> [CFF0BD90] [C005A31C] clear_huge_page+0x28/0x174
> [CFF0BDC0] [C005B360] hugetlb_no_page+0xb4/0x220
> [CFF0BE00] [C005B5BC] hugetlb_fault+0xf0/0xf4
> [CFF0BE30] [C0052AC0] __handle_mm_fault+0x3a8/0x3ac
> [CFF0BE70] [C00094A0] do_page_fault+0x118/0x428
> [CFF0BF40] [C0002360] handle_page_fault+0xc/0x80
> BUG: scheduling while atomic: shmtest2/0x1001/1291
>
> Now for my questions:
>
> 1. Can the kernel really reschedule in a page fault handler context ?
>
> 2. Just to test where this "scheduling while atomic" bug is arising, i
> put schedule() calls at various places in the path of the stack trace
> shown above.
> I found that a call to pte_alloc_map() puts the kernel in a context
> where it cannot reschedule without throwing up. Here is a trace of
> what's going on:
>
> __handle_mm_fault -> hugetlb_fault -> huge_pte_alloc() -> pte_alloc_map()
>
> Any call to schedule() before pte_alloc_map() does not throw this
> error. Well, this might be a flawed experiment, I am no expert kernel
> hacker. Does this throw any light on the problem?
>
> Here are the modifications I made to Edi's patch:
>
> arch/ppc/mm/hugetlbpage.c
> struct page *
> follow_huge_addr(struct mm_struct *mm, unsigned long address, int write)
> {
>   pte_t *pte;
>   struct page *page;
> +  struct vm_area_struct *vma;
> +
> +  vma = find_vma(mm, address);
> + if (!vma || !is_vm_hugetlb_page(vma))
> +return ERR_PTR(-EINVAL);
>
>   pte = huge_pte_offset(mm, address);
>   page = pte_page(*pte);
>   return page;
> }
>
> +int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep)
> +{
> +return 0;
> +}
>
> Here is my test program:
>
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
>
> #ifndef SHM_HUGETLB
> #define SHM_HUGETLB 04000
> #endif
>
> #define LENGTH (16UL*1024*1024)
>
> #define dprintf(x)  printf(x)
>
> #define ADDR (void *)(0x0UL)
> #define SHMAT_FLAGS (0)
>
>
> int main(void)
> {
> int shmid;
> unsigned long i;
> char *shmaddr;
>
> if ((shmid = shmget(2, LENGTH,
> SHM_HUGETLB | IPC_CREAT | SHM_R | SHM_W)) < 0) {
> perror("shmget");
> exit(1);
> }
> printf("shmid: 0x%x\n", shmid);
>
> shmaddr = shmat(shmid, ADDR, SHMAT_FLAGS);
> if (shmaddr == (char *)-1) {
> perror("Shared memory attach failure");
> shmctl(shmid, IPC_RMID, NULL);
> exit(2);
> }
> printf("shmaddr: %p\n", shmaddr);
> printf("touching a huge page..\n");
>
> shmaddr[0]='a';
> shmaddr[1]='b';
>
> if (shmdt((const void *)shmaddr) != 0) {
> perror("Detach failure");
> shmctl(shmid, IPC_RMID, NULL);
> exit(3);
> }
>
> shmctl(shmid, IPC_RMID, NULL);
>
> return 0;
> }
>
> thanks!
> Satya.
>


-- 
...what's remarkable, is that atoms have assembled into entities which
are somehow able to ponder their origins.
--
http://cs.uic.edu/~spopuri
___
Linuxpp

Re: [RFC][PATCH 6/8] Walnut DTS

2007-07-17 Thread Benjamin Herrenschmidt

> Yes, I shouldn't say "defaulted" -- a unit interrupt specifier
> simply has no unit address part, in an interrupt domain that
> doesn't correspond to a "normal" bus.  But saying it like this
> is a little bit inexact, and it uses more words.
> 
> > which is why I tend to prefer having it
> > explicitely in the interrupt controller node :-)
> 
> Which is simply incorrect.

It's absolutely not. Please, stop that moronic pin-head behaviour and
find me a single case where that would actually be a problem of any sort
or form.

> You mean, the magic default values you used for #address-cells
> and #size-cells?  That was simply a bug, someone forgot to read
> the documentation...

No, defaults are crap, period. This is a general thing. Besides, the
spec itself has issues about the default values (remember those blurbs
about PCI and ISA supposedly having different defaults ?) In any way,
defaults are a bad idea and I'm happy to say don't use them.

> For this?  No way:
> 
> [From the base spec]:
> 
> “#address-cells” S
>   Standard property name to define the package’s address format.
>   prop-encoded-array: Integer, encoded with encode-int.
> 
>   This property applies to packages that define a physical
>   address space, i.e., those packages with “decode-unit”
>   methods. The property value specifies the number of cells
>   that are used to encode a physical address within that
>   address space. The value of this property affects the other
>   functions, commands, and methods that deal with physical
>   addresses. In a package with a “decode-unit” method, a missing
>   “#address-cells” property signifies that the number of
>   address cells is two.

And you omit the various bus bindings that have come up with different
defaults...

> See?  The flat device tree unfortunately has no decode-unit, but
> it is still pretty clear which nodes "define a physical address
> space" and which do not.
> 
> There is nothing badly defined here.

See above. Besides, as I said, default values are crap. And no, it's not
obvious which nodes define a physical address space or not, at least not
for a generic parser. Defaults are a bad idea, just get it and move on
and stop arguing just for the sake of arguing. Pointing out the letter
of the spec is not a constructive attitude here.

> Nothing in the "interrupt mapping" spec redefines #address-cells
> (OF isn't all that stupid you know); it simply says that a /unit
> interrupt specifier/ has no /unit address/ part if there is no
> #address-cells.  The algorithm in paragraph 7 makes it super
> clear how exactly this should work.

No, the algorithm provided isn't clear and is buggy. I have implemented
it so I know what I'm talking about. The fact that basically you end up
with "different" defaults for what is essentially the value
#address-cells depending on whether you are walking the device-tree for
address resolution or for interrupt resolution is stupid. Thus, the
solution is simple: don't do defaults. Explicit values are good.

> > and the spec contains gray areas
> > and contradictions as to what the default values should be in some
> > circumstances.
> 
> In some areas, perhaps.  And it would be nice to bring those
> areas to the attention of the working group, instead of just
> to complain.

The working group is dead and some of the ex members of it expressed
their lack of interest in pursuing these matters.

> Linux will have to keep supporting them for "real OF", so
> requiring an explicit #address-cells where its value is 2
> doesn't really help much.  I'm not opposed to this though,
> for flat device trees at least (I think it's a good thing
> for OF trees as well, but for different reasons; and that's
> beside the point here).
> 
> On the other hand, requiring an #address-cells where it is
> supposed to be absent, and you only want it so you can wrap
> your head around the interrupt mapping recommended practice
> in a more confusing and confused way, is simply WRONG.

No, it's not, It's purely having an explicit representation of what was
a stupid default behaviour.

> If it would, the interrupt mapping spec would have had to say
> how the semantics of #address-cells were changed (and they
> weren't, and they shouldn't, and this is such a laughable idea
> I wonder why anyone would suggest it did).

That's bullshit. The semantics are exactly the same. You obviously
decided to be immune to any kind of common sense today.

> What the interrupt mapping spec defines is how to _use_ the
> value of #address-cells, and how to interpret its absence;
> what should be put in #address-cells for separate nodes is
> defined elsewhere (namely, in the base spec, and in relevant
> device bindings).

There is no such crackpot interpretation. A unit interrupt specifier
contains ... an address. An address format/size is defined by a
#address-cells. Period. That's not an "interpretation", that's the
basic, primary semantic of #address-cells. The

Re: [PATCH 01/10] IB/ehca: Support for multiple event queues

2007-07-17 Thread Michael S. Tsirkin
> Quoting Roland Dreier <[EMAIL PROTECTED]>:
> Subject: Re: [PATCH 01/10] IB/ehca: Support for multiple event queues
> 
>  > Here's some anecdotal evidence :)
>  > http://lists.openfabrics.org/pipermail/general/2007-May/035758.html
> 
> Right, but then we went on to say that we probably want to use
> multiple vectors to separate out multiple HCA ports rather than
> send/sreceive on the same port.  And the current IPoIB implementation
> of having that second CQ seems suboptimal anyway, since it seems to
> leave us susceptible to the interrupt overload that NAPI was supposed
> to solve.

Sure, the ipoib patch is just a proof of concept anyway.
And I'm actually working on merging send/recv CQs now,
to address the livelocks.

> At a higher level, I'm left wondering why nobody talked about multiple
> EQs during the last months of the 2.6.22 process and now all of a
> sudden it becomes urgent in the last few days of the 2.6.23 merge
> window.

I don't see any emergency in merging the IPoIB hack either.

I just hoped that once we merge the core changes people will start
experimenting with multiple vectors. This did not seem to have happened.
Could this be because there's no low level driver support upstream yet?

So I wonder whether merging the mthca patch [that was patch 2 of the series]
in 2.6.23 will finally get the
ball rolling, get people to experiment with multiple vectors
in userspace, and that will hopefully teach us something.

> That's not really how I like to merge features

If you look just at the mthca patch in isolation,
do you still see a problem?

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


Re: [PATCH] POWERPC: Correct misspelled config variable in arch/powerpc/Kconfig.

2007-07-17 Thread Paul Mackerras
Robert P. J. Day writes:

> -config CONFIG_CHECK_CACHE_COHERENCY
> +config CHECK_CACHE_COHERENCY

Please also fix the occurrence in
arch/powerpc/platforms/embedded6xx/Kconfig.

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


Re: [PATCH v2] Allow exec on 32-bit from readable, non-exec pages, with a warning.

2007-07-17 Thread Scott Wood
Jon Loeliger wrote:
> But luckily, this gave me the opportunity to then realize that
> we should give a great big...
> 
> Amen-brother-by: Jon Loeliger <[EMAIL PROTECTED]>
> 
> to this patch from Scott.
> 
> So, an official plea to Paul to apply this to his tree.

Segher has a newer patch that supersedes this one.  I don't know if he's 
posted it to the list yet, though.

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


Re: [PATCH] powerpc: Add of_register_i2c_devices()

2007-07-17 Thread Guennadi Liakhovetski
On Wed, 4 Jul 2007, Segher Boessenkool wrote:

> Your device is an rs5c372b.  So, that's what you put in
> your device tree.  Simple so far, right?
> 
> Now some OF I2C code goes looking for IIC devices in the
> device tree.  It finds this thing, and from a table or
> something it derives that it has to tell the kernel I2C
> layer this is an "rtc-rs5c372".  [It would be nicer if it
> could just instantiate the correct driver directly, but
> if that's how the Linux I2C layer works, so be it].
> 
> No change in the I2C "core" needed, just an OF "compatible"
> matching thing like is needed *everywhere else* too.

How about the patch below?

Thanks
Guennadi
---
Guennadi Liakhovetski

Scan the device tree for i2c devices, check their "compatible" property 
against a hard-coded table, and, if found, register with i2c boardinfo.

Signed-off-by: G. Liakhovetski <[EMAIL PROTECTED]>

diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 9588b60..c3c7eba 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -296,6 +296,62 @@ err:
 
 arch_initcall(gfar_of_init);
 
+#ifdef CONFIG_I2C_BOARDINFO
+#include 
+struct i2c_driver_device {
+   char*of_device;
+   char*i2c_driver;
+   char*i2c_type;
+};
+
+static struct i2c_driver_device i2c_devices[] = {
+   {"rs5c372a", "rtc-rs5c372", "rs5c372a",},
+   {"rs5c372b", "rtc-rs5c372", "rs5c372b",},
+   {"rv5c386",  "rtc-rs5c372", "rv5c386",},
+   {"rv5c387a", "rtc-rs5c372", "rv5c387a",},
+};
+
+static int of_find_i2c_driver(struct device_node *node, struct i2c_board_info 
*info)
+{
+   int i;
+
+   for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) {
+   if (!of_device_is_compatible(node, i2c_devices[i].of_device))
+   continue;
+   strncpy(info->driver_name, i2c_devices[i].i2c_driver, 
KOBJ_NAME_LEN);
+   strncpy(info->type, i2c_devices[i].i2c_type, I2C_NAME_SIZE);
+   return 0;
+   }
+   return -ENODEV;
+}
+
+static void of_register_i2c_devices(struct device_node *adap_node, int bus_num)
+{
+   struct device_node *node = NULL;
+
+   while ((node = of_get_next_child(adap_node, node))) {
+   struct i2c_board_info info;
+   const u32 *addr;
+   int len;
+
+   addr = of_get_property(node, "reg", &len);
+   if (!addr || len < sizeof(int) || *addr > 0x)
+   continue;
+
+   info.irq = irq_of_parse_and_map(node, 0);
+   if (info.irq == NO_IRQ)
+   info.irq = -1;
+
+   if (of_find_i2c_driver(node, &info) < 0)
+   continue;
+
+   info.platform_data = NULL;
+   info.addr = *addr;
+
+   i2c_register_board_info(bus_num, &info, 1);
+   }
+}
+
 static int __init fsl_i2c_of_init(void)
 {
struct device_node *np;
@@ -340,6 +396,8 @@ static int __init fsl_i2c_of_init(void)
fsl_i2c_platform_data));
if (ret)
goto unreg;
+
+   of_register_i2c_devices(np, i);
}
 
return 0;
@@ -351,6 +409,7 @@ err:
 }
 
 arch_initcall(fsl_i2c_of_init);
+#endif
 
 #ifdef CONFIG_PPC_83xx
 static int __init mpc83xx_wdt_init(void)
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] POWERPC: Correct misspelled config variable in arch/powerpc/Kconfig.

2007-07-17 Thread Robert P. J. Day
On Tue, 17 Jul 2007, Paul Mackerras wrote:

> Robert P. J. Day writes:
>
> > -config CONFIG_CHECK_CACHE_COHERENCY
> > +config CHECK_CACHE_COHERENCY
>
> Please also fix the occurrence in
> arch/powerpc/platforms/embedded6xx/Kconfig.

ah, i completely missed that one.  i'll resubmit the patch shortly.

rday
-- 

Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page

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


[PATCH] POWERPC: Fix misspelled "CONFIG_CHECK_CACHE_COHERENCY" Kconfig option.

2007-07-17 Thread Robert P. J. Day

Signed-off-by: Robert P. J. Day <[EMAIL PROTECTED]>

---

 arch/powerpc/configs/prpmc2800_defconfig   |2 +-
 arch/powerpc/platforms/Kconfig.cputype |2 +-
 arch/powerpc/platforms/embedded6xx/Kconfig |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/configs/prpmc2800_defconfig 
b/arch/powerpc/configs/prpmc2800_defconfig
index fb504a7..858f865 100644
--- a/arch/powerpc/configs/prpmc2800_defconfig
+++ b/arch/powerpc/configs/prpmc2800_defconfig
@@ -48,7 +48,7 @@ CONFIG_PPC_STD_MMU_32=y
 # CONFIG_PPC_MM_SLICES is not set
 # CONFIG_SMP is not set
 CONFIG_NOT_COHERENT_CACHE=y
-CONFIG_CONFIG_CHECK_CACHE_COHERENCY=y
+CONFIG_CHECK_CACHE_COHERENCY=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"

 #
diff --git a/arch/powerpc/platforms/Kconfig.cputype 
b/arch/powerpc/platforms/Kconfig.cputype
index b8b5fde..e4b2aee 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -215,7 +215,7 @@ config NOT_COHERENT_CACHE
depends on 4xx || 8xx || E200
default y

-config CONFIG_CHECK_CACHE_COHERENCY
+config CHECK_CACHE_COHERENCY
bool

 endmenu
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig 
b/arch/powerpc/platforms/embedded6xx/Kconfig
index bec7726..2d12f77 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -59,7 +59,7 @@ config MPC10X_BRIDGE
 config MV64X60
bool
select PPC_INDIRECT_PCI
-   select CONFIG_CHECK_CACHE_COHERENCY
+   select CHECK_CACHE_COHERENCY

 config MPC10X_OPENPIC
bool
-- 

Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page

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


Re: [RFC][PATCH 6/8] Walnut DTS

2007-07-17 Thread Scott Wood
On Wed, Jul 18, 2007 at 07:25:57AM +1000, Benjamin Herrenschmidt wrote:
> > > which is why I tend to prefer having it
> > > explicitely in the interrupt controller node :-)
> > 
> > Which is simply incorrect.
> 
> It's absolutely not. Please, stop that moronic pin-head behaviour and
> find me a single case where that would actually be a problem of any sort
> or form.

It could lead someone to the erroneous conclusion that an #address-cells
other than zero in an interrupt controller that is not a device parent is
in any way a sane or supported thing to do.

It could lead people to write code that doesn't handle the absence of
#address-cells in such a node properly.

It could lead to flamewars. :-)

> > You mean, the magic default values you used for #address-cells
> > and #size-cells?  That was simply a bug, someone forgot to read
> > the documentation...
> 
> No, defaults are crap, period.

If there's only one value that could possibly make sense, it *not* being
the default is crap.

> See above. Besides, as I said, default values are crap. And no, it's not
> obvious which nodes define a physical address space or not, at least not
> for a generic parser.

The obvious way (which indeed isn't what the suggested algorithm does --
but the suggested algorithm doesn't do anything sensible) is that if you
got to the node via an interrupt-parent or interrupt-map, it doesn't use
#address-cells, and if you got to it by going to the regular device tree
parent, it does.

Pretty much any time you use the unit address in a context other than the
bus parent, things cease making sense.

> > In some areas, perhaps.  And it would be nice to bring those
> > areas to the attention of the working group, instead of just
> > to complain.
> 
> The working group is dead and some of the ex members of it expressed
> their lack of interest in pursuing these matters.

There is the ePAPR working group, though.

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


Re: [PATCH] Add StorCenter DTS first draft.

2007-07-17 Thread Scott Wood
Jon Loeliger wrote:
> How about "[EMAIL PROTECTED]" instead?
> 
> That would be similar to:
> [EMAIL PROTECTED] {
> and
>[EMAIL PROTECTED] {

How about just "[EMAIL PROTECTED]"?  Those model numbers in the names are a 
PITA to find from limited functionality environments such as the 
bootwrapper, require things like stdout-path to be different on every 
soc, and don't comply with the generic names recommendation.

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


Re: [PATCH] Add StorCenter DTS first draft.

2007-07-17 Thread Jon Loeliger
So, like, the other day Segher Boessenkool mumbled:
> > +/ {
> > +   model = "StorCenter";
> 
> If you can find a real model number, put it in here, instead.

Yep, "StorCenter" is it.  No model numer/name beyond that.

> > +   compatible = "storcenter";
> 
> Needs a manufacturer name in there.

Right.  Will use:
compatible = "iomega,storcenter"

> > +   PowerPC,603e {  /* Really 8241 */
> 
> So say "PowerPC,[EMAIL PROTECTED]", or "PowerPC,[EMAIL PROTECTED]" (or 
> whatever
> the CPU core in there is), or simply "[EMAIL PROTECTED]", following
> the generic naming recommended practice.

Well, its the 8241 SoC with a 603e core...  (This is
the same phrase currently being used on the Kurobox.)
I'll use:

PowerPC,[EMAIL PROTECTED] }


> > +   bus-frequency = <0>;
> 
> Is this filled in anywhere?  Please document that, if so.

Right.  boot{loader,wrapper}

> > +   soc10x {
> 
> Bad name.  Where is the binding for this?  I don't think
> I saw it before.

It's what is being used, again, by the Kurobox.  I understand
that doesn't make it "right", just precedented by now.

How about "[EMAIL PROTECTED]" instead?

That would be similar to:
[EMAIL PROTECTED] {
and
   [EMAIL PROTECTED] {

> > +   store-gathering = <0>; /* 0 == off, !0 == on */
> 
> Don't define this as "!0", but as "1".

OK.

> > +   [EMAIL PROTECTED] {
> > +   device_type = "i2c";
> 
> No device_type, there is no I2C binding.

Right.

> > +   compatible = "fsl-i2c";
> 
> Needs to be more specific.

Hmmm...  Not sure what to use here then.  There are many
existing examples using "fsl-i2c" already.  Granted, we've
established that they could be wrong...  Should this be
more like this?:

compatible = "fsl,mpc8241-i2c", "fsl-i2c";

> > +   mpic: [EMAIL PROTECTED] {
> 
> [EMAIL PROTECTED]

OK.

> > +   [EMAIL PROTECTED] {
> > +   clock-frequency = ; /* Hz */
> 
> 100MHz PCI?  Interesting.

Good point.  seems more likely...


Thanks for the review and help here!

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


Re: [PATCH v2] Allow exec on 32-bit from readable, non-exec pages, with a warning.

2007-07-17 Thread Jon Loeliger


A:  They haven't been posted yet.

Q:  How do we know Segher has new patches?



So, like, the other day Scott Wood mumbled:
> Jon Loeliger wrote:
> > But luckily, this gave me the opportunity to then realize that
> > we should give a great big...
> > 
> > Amen-brother-by: Jon Loeliger <[EMAIL PROTECTED]>
> > 
> > to this patch from Scott.
> > 
> > So, an official plea to Paul to apply this to his tree.
> 
> Segher has a newer patch that supersedes this one.  I don't know if he's 
> posted it to the list yet, though.
> 
> -Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v2] Allow exec on 32-bit from readable, non-exec pages, with a warning.

2007-07-17 Thread Scott Wood
Jon Loeliger wrote:
> A:  They haven't been posted yet.
> 
> Q:  How do we know Segher has new patches?

He sent it to me to test, and I told him it worked...

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


Re: [PATCH] Add StorCenter DTS first draft.

2007-07-17 Thread Jon Loeliger
So, like, the other day Scott Wood mumbled:
> Jon Loeliger wrote:
> > How about "[EMAIL PROTECTED]" instead?
> 
> How about just "[EMAIL PROTECTED]"?  Those model numbers in the names are a 
> PITA to find from limited functionality environments such as the 
> bootwrapper, require things like stdout-path to be different on every 
> soc, and don't comply with the generic names recommendation.

Oh!  Right.  No problem.

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


Re: [RFC][PATCH 6/8] Walnut DTS

2007-07-17 Thread Benjamin Herrenschmidt

> It could lead someone to the erroneous conclusion that an #address-cells
> other than zero in an interrupt controller that is not a device parent is
> in any way a sane or supported thing to do.

I fail why anyone would ever want to do it though :-)

> It could lead people to write code that doesn't handle the absence of
> #address-cells in such a node properly.

We just need to make mention that it can be absent in the spec, there
shouldn't be that many parsers out there.

> It could lead to flamewars. :-)

Yeah well.

> If there's only one value that could possibly make sense, it *not* being
> the default is crap.

Only for leaf nodes. Other values do make sense for non-leaf nodes.

> The obvious way (which indeed isn't what the suggested algorithm does --
> but the suggested algorithm doesn't do anything sensible) is that if you
> got to the node via an interrupt-parent or interrupt-map, it doesn't use
> #address-cells, and if you got to it by going to the regular device tree
> parent, it does.

Yeah well, that's also somewhat debatable too. You need a #address-cells
to be able to parse an interrupt-map. You can imagine cross-links and
special maps used to handle things like the multiple UICs as David did
in the past. I wouldn't get rid of that flexibility to handle corner
cases that aren't easily represented by the "standard" stuff.

> Pretty much any time you use the unit address in a context other than the
> bus parent, things cease making sense.

I tend to agree.

> There is the ePAPR working group, though.

Yup, true.

Ben.


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


- add-missing-data_data-in-powerpc.patch removed from -mm tree

2007-07-17 Thread akpm

The patch titled
 powerpc: add missing DATA_DATA
has been removed from the -mm tree.  Its filename was
 add-missing-data_data-in-powerpc.patch

This patch was dropped because it was merged into mainline or a subsystem tree

--
Subject: powerpc: add missing DATA_DATA
From: Mathieu Desnoyers <[EMAIL PROTECTED]>

Signed-off-by: Mathieu Desnoyers <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Cc: 
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 arch/powerpc/kernel/vmlinux.lds.S |4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -puN arch/powerpc/kernel/vmlinux.lds.S~add-missing-data_data-in-powerpc 
arch/powerpc/kernel/vmlinux.lds.S
--- a/arch/powerpc/kernel/vmlinux.lds.S~add-missing-data_data-in-powerpc
+++ a/arch/powerpc/kernel/vmlinux.lds.S
@@ -174,7 +174,9 @@ SECTIONS
}
 #else
.data : {
-   *(.data .data.rel* .toc1)
+   DATA_DATA
+   *(.data.rel*)
+   *(.toc1)
*(.branch_lt)
}
 
_

Patches currently in -mm which might be from [EMAIL PROTECTED] are

origin.patch
git-kbuild.patch

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


[PATCH 01/61] Use strcasecmp() rather than strncasecmp() when determining device node compatibility.

2007-07-17 Thread Scott Wood
The current code assumes "foo-bar" must always be compatible with a node
compatible with "foo", which breaks device trees where this is not so.

The "case" part is also wrong according to Open Firmware, but it's more
likely to have drivers and/or device trees depending on it, and thus
needs to be handled more carefully.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/prom.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 37ff99b..0b136a5 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -218,7 +218,7 @@ int __init of_flat_dt_is_compatible(unsigned long node, 
const char *compat)
if (cp == NULL)
return 0;
while (cplen > 0) {
-   if (strncasecmp(cp, compat, strlen(compat)) == 0)
+   if (strcasecmp(cp, compat) == 0)
return 1;
l = strlen(cp) + 1;
cp += l;
@@ -1099,7 +1099,7 @@ int of_device_is_compatible(const struct device_node 
*device,
if (cp == NULL)
return 0;
while (cplen > 0) {
-   if (strncasecmp(cp, compat, strlen(compat)) == 0)
+   if (strcasecmp(cp, compat) == 0)
return 1;
l = strlen(cp) + 1;
cp += l;
-- 
1.5.0.3

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


[PATCH 02/61] mpc8272ads.dts: Whitespace cleanup

2007-07-17 Thread Scott Wood
Convert spaces to tabs, and add a few newlines where appropriate.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/dts/mpc8272ads.dts |  376 +-
 1 files changed, 189 insertions(+), 187 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts 
b/arch/powerpc/boot/dts/mpc8272ads.dts
index 1934b80..4d09dca 100644
--- a/arch/powerpc/boot/dts/mpc8272ads.dts
+++ b/arch/powerpc/boot/dts/mpc8272ads.dts
@@ -10,207 +10,209 @@
  */
 
 / {
-   model = "MPC8272ADS";
-   compatible = "MPC8260ADS";
-   #address-cells = <1>;
-   #size-cells = <1>;
-
-   cpus {
-   #address-cells = <1>;
-   #size-cells = <0>;
-
-   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 = <4000>;  // L1, 16K
-   i-cache-size = <4000>;  // L1, 16K
-   timebase-frequency = <0>;
-   bus-frequency = <0>;
-   clock-frequency = <0>;
-   32-bit;
-   };
-   };
-
-   pci_pic: [EMAIL PROTECTED] {
-   #address-cells = <0>;
-   #interrupt-cells = <2>;
-   interrupt-controller;
-   reg = ;
-   built-in;
-   device_type = "pci-pic";
-   };
-   memory {
-   device_type = "memory";
-   reg = < 400 f450 0020>;
-   };
-
-   chosen {
-   name = "chosen";
-   linux,platform = <0>;
+   model = "MPC8272ADS";
+   compatible = "MPC8260ADS";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   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 = <4000>;  // L1, 16K
+   i-cache-size = <4000>;  // L1, 16K
+   timebase-frequency = <0>;
+   bus-frequency = <0>;
+   clock-frequency = <0>;
+   32-bit;
+   };
+   };
+
+   pci_pic: [EMAIL PROTECTED] {
+   #address-cells = <0>;
+   #interrupt-cells = <2>;
+   interrupt-controller;
+   reg = ;
+   built-in;
+   device_type = "pci-pic";
+   };
+
+   memory {
+   device_type = "memory";
+   reg = < 400 f450 0020>;
+   };
+
+   chosen {
+   name = "chosen";
+   linux,platform = <0>;
interrupt-controller = <&Cpm_pic>;
-   };
-
-   [EMAIL PROTECTED] {
-   #address-cells = <1>;
-   #size-cells = <1>;
-   #interrupt-cells = <2>;
-   device_type = "soc";
-   ranges = < f000 00053000>;
-   reg = ;
-
-   [EMAIL PROTECTED] {
-   device_type = "mdio";
-   compatible = "fs_enet";
-   reg = <0 0>;
-   #address-cells = <1>;
-   #size-cells = <0>;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   #interrupt-cells = <2>;
+   device_type = "soc";
+   ranges = < f000 00053000>;
+   reg = ;
+
+   [EMAIL PROTECTED] {
+   device_type = "mdio";
+   compatible = "fs_enet";
+   reg = <0 0>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+
phy0:[EMAIL PROTECTED] {
interrupt-parent = <&Cpm_pic>;
-   interrupts = <17 4>;
-   reg = <0>;
-   bitbang = [ 12 12 13 02 02 01 ];
-   device_type = "ethernet-phy";
-   };
+   interrupts = <17 4>;
+   reg = <0>;
+   bitbang = [ 12 12 13 02 02 01 ];
+   device_type = "ethernet-phy";
+   };
+
phy1:[EMAIL PROTECTED] {
interrupt-parent = <&Cpm_pic>;
-   interrupts = <17 4>;
-   bit

[PATCH 03/61] Only include linux/ide.h if CONFIG_BLOCK is defined.

2007-07-17 Thread Scott Wood
The IDE header file uses type definitions that are undefined if the
CONFIG_BLOCK is deselected.  This causes a compilation failure in
setup_32.c.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/ppc_ksyms.c |2 ++
 arch/powerpc/kernel/setup_32.c  |4 +++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index a20f195..bc54493 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -12,7 +12,9 @@
 #include 
 #include 
 #include 
+#ifdef CONFIG_BLOCK
 #include 
+#endif
 #include 
 
 #include 
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 7ec6ba5..ae5d60e 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -51,7 +50,10 @@
 
 extern void bootx_init(unsigned long r4, unsigned long phys);
 
+#ifdef COFNIG_BLOCK
+#include 
 struct ide_machdep_calls ppc_ide_md;
+#endif
 
 int boot_cpuid;
 EXPORT_SYMBOL_GPL(boot_cpuid);
-- 
1.5.0.3

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


[PATCH 04/61] 8xx: Work around CPU15 erratum.

2007-07-17 Thread Scott Wood
The CPU15 erratum on MPC8xx chips can cause incorrect code execution
under certain circumstances, where there is a conditional or indirect
branch in the last word of a page, with a target in the last cache line
of the next page.  This patch implements one of the suggested
workarounds, by forcing a TLB miss whenever execution crosses a page
boundary.  This is done by invalidating the pages before and after the
one being loaded into the TLB in the ITLB miss handler.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/head_8xx.S |6 ++
 arch/powerpc/platforms/8xx/Kconfig |   16 
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 901be47..7488f30 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -301,6 +301,12 @@ InstructionTLBMiss:
stw r10, 0(r0)
stw r11, 4(r0)
mfspr   r10, SPRN_SRR0  /* Get effective address of fault */
+#ifdef CONFIG_8xx_CPU15
+   addir11, r10, 0x1000
+   tlbie   r11
+   addir11, r10, -0x1000
+   tlbie   r11
+#endif
DO_8xx_CPU6(0x3780, r3)
mtspr   SPRN_MD_EPN, r10/* Have to use MD_EPN for walk, MI_EPN 
can't */
mfspr   r10, SPRN_M_TWB /* Get level 1 table entry address */
diff --git a/arch/powerpc/platforms/8xx/Kconfig 
b/arch/powerpc/platforms/8xx/Kconfig
index 39bb8c5..b8dd515 100644
--- a/arch/powerpc/platforms/8xx/Kconfig
+++ b/arch/powerpc/platforms/8xx/Kconfig
@@ -99,6 +99,22 @@ config 8xx_CPU6
 
  If in doubt, say N here.
 
+config 8xx_CPU15
+   bool "CPU15 Silicon Errata"
+   default y
+   help
+ This enables a workaround for erratum CPU15 on MPC8xx chips.
+ This bug can cause incorrect code execution under certain
+ circumstances.  This workaround adds some overhead (a TLB miss
+ every time execution crosses a page boundary), and you may wish
+ to disable it if you have worked around the bug in the compiler
+ (by not placing conditional branches or branches to LR or CTR
+ in the last word of a page, with a target of the last cache
+ line in the next page), or if you have used some other
+ workaround.
+
+ If in doubt, say Y here.
+
 choice
prompt "Microcode patch selection"
default NO_UCODE_PATCH
-- 
1.5.0.3

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


[PATCH 05/61] bootwrapper: Change cuImage .gitignore entry to cuImage.*

2007-07-17 Thread Scott Wood
Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/.gitignore |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/boot/.gitignore b/arch/powerpc/boot/.gitignore
index eec7af7..3270335 100644
--- a/arch/powerpc/boot/.gitignore
+++ b/arch/powerpc/boot/.gitignore
@@ -18,9 +18,7 @@ kernel-vmlinux.strip.c
 kernel-vmlinux.strip.gz
 mktree
 uImage
-cuImage
-cuImage.bin.gz
-cuImage.elf
+cuImage.*
 zImage
 zImage.chrp
 zImage.coff
-- 
1.5.0.3

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


[PATCH 06/61] 8xx: Don't call non-existent Soft_emulate_8xx from SoftwareEmulation.

2007-07-17 Thread Scott Wood
On arch/ppc, Soft_emulate_8xx was used when full math emulation was
turned off to emulate a minimal subset of floating point load/store
instructions, to avoid needing a soft-float toolchain.  This function
is called, but not present, on arch/powerpc, causing a build error
if floating point emulation is turned off.

As soft-float toolchains are now common, I'm deleting the call rather
than moving Soft_emulate_8xx over to arch/powerpc.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/traps.c |   16 +++-
 1 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index bf6445a..312fb67 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -912,9 +912,10 @@ void performance_monitor_exception(struct pt_regs *regs)
 #ifdef CONFIG_8xx
 void SoftwareEmulation(struct pt_regs *regs)
 {
+#ifdef CONFIG_MATH_EMULATION
extern int do_mathemu(struct pt_regs *);
-   extern int Soft_emulate_8xx(struct pt_regs *);
int errcode;
+#endif
 
CHECK_FULL_REGS(regs);
 
@@ -945,18 +946,7 @@ void SoftwareEmulation(struct pt_regs *regs)
}
 
 #else
-   errcode = Soft_emulate_8xx(regs);
-   switch (errcode) {
-   case 0:
-   emulate_single_step(regs);
-   return;
-   case 1:
-   _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
-   return;
-   case -EFAULT:
-   _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
-   return;
-   }
+   _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
 #endif
 }
 #endif /* CONFIG_8xx */
-- 
1.5.0.3

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


[PATCH 07/61] bootwrapper: Set timebase_period_ns from dt_fixup_cpu_clocks.

2007-07-17 Thread Scott Wood
This lets udelay() work properly on platforms which use dt_fixup_cpu_clocks.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/devtree.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
index c995155..3465d3f 100644
--- a/arch/powerpc/boot/devtree.c
+++ b/arch/powerpc/boot/devtree.c
@@ -61,6 +61,7 @@ void dt_fixup_memory(u64 start, u64 size)
 
 void dt_fixup_cpu_clocks(u32 cpu, u32 tb, u32 bus)
 {
+   extern unsigned long timebase_period_ns;
void *devp = NULL;
 
printf("CPU clock-frequency <- 0x%x (%dMHz)\n\r", cpu, MHZ(cpu));
@@ -74,6 +75,8 @@ void dt_fixup_cpu_clocks(u32 cpu, u32 tb, u32 bus)
if (bus > 0)
setprop_val(devp, "bus-frequency", bus);
}
+
+   timebase_period_ns = 10 / tb;
 }
 
 void dt_fixup_clock(const char *path, u32 freq)
-- 
1.5.0.3

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


[PATCH 08/61] bootwrapper: dt_xlate_range() bugfixes

2007-07-17 Thread Scott Wood
1. The check whether ranges fits in the buffer was using elements rather
than bytes.
2. Empty ranges were not properly treated as transparent, and missing
ranges were treated as transparent.
3. The loop terminated when translating from the root rather than to.  Once
bug #2 was fixed, it failed due to a missing ranges in the root node.
4. In decoding the ranges property, the #size-cells used was that of
the parent, not the child.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/devtree.c |   20 +---
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
index 3465d3f..f33c00b 100644
--- a/arch/powerpc/boot/devtree.c
+++ b/arch/powerpc/boot/devtree.c
@@ -219,7 +219,7 @@ static int dt_xlate(void *node, int res, int reglen, 
unsigned long *addr,
u32 this_addr[MAX_ADDR_CELLS];
void *parent;
u64 ret_addr, ret_size;
-   u32 naddr, nsize, prev_naddr;
+   u32 naddr, nsize, prev_naddr, prev_nsize;
int buflen, offset;
 
parent = get_parent(node);
@@ -234,7 +234,7 @@ static int dt_xlate(void *node, int res, int reglen, 
unsigned long *addr,
offset = (naddr + nsize) * res;
 
if (reglen < offset + naddr + nsize ||
-   sizeof(dt_xlate_buf) < offset + naddr + nsize)
+   sizeof(dt_xlate_buf) < (offset + naddr + nsize) * 4)
return 0;
 
copy_val(last_addr, dt_xlate_buf + offset, naddr);
@@ -245,20 +245,26 @@ static int dt_xlate(void *node, int res, int reglen, 
unsigned long *addr,
ret_size |= dt_xlate_buf[offset + naddr + 1];
}
 
-   while ((node = get_parent(node))) {
+   for (;;) {
prev_naddr = naddr;
+   prev_nsize = nsize;
+   node = parent;
 
-   get_reg_format(node, &naddr, &nsize);
+   parent = get_parent(node);
+   if (!parent)
+   break;
+
+   get_reg_format(parent, &naddr, &nsize);
 
buflen = getprop(node, "ranges", dt_xlate_buf,
sizeof(dt_xlate_buf));
-   if (buflen < 0)
+   if (buflen == 0)
continue;
-   if (buflen > sizeof(dt_xlate_buf))
+   if (buflen < 0 || buflen > sizeof(dt_xlate_buf))
return 0;
 
offset = find_range(last_addr, dt_xlate_buf, prev_naddr,
-   naddr, nsize, buflen / 4);
+   naddr, prev_nsize, buflen / 4);
 
if (offset < 0)
return 0;
-- 
1.5.0.3

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


[PATCH 09/61] bootwrapper: Add dt_is_compatible().

2007-07-17 Thread Scott Wood
This can be used rather than doing a simple strcmp, which will fail to
handle multiple compatible entries.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/devtree.c |   50 ++-
 arch/powerpc/boot/ops.h |1 +
 2 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
index f33c00b..455e146 100644
--- a/arch/powerpc/boot/devtree.c
+++ b/arch/powerpc/boot/devtree.c
@@ -114,7 +114,6 @@ void __dt_fixup_mac_addresses(u32 startindex, ...)
 }
 
 #define MAX_ADDR_CELLS 4
-#define MAX_RANGES 8
 
 static void get_reg_format(void *node, u32 *naddr, u32 *nsize)
 {
@@ -210,7 +209,7 @@ static int find_range(u32 *reg, u32 *ranges, int nregaddr,
  * In particular, PCI is not supported.  Also, only the beginning of the
  * reg block is tracked; size is ignored except in ranges.
  */
-static u32 dt_xlate_buf[MAX_ADDR_CELLS * MAX_RANGES * 3];
+static u32 prop_buf[MAX_PROP_LEN / 4];
 
 static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
unsigned long *size)
@@ -234,15 +233,15 @@ static int dt_xlate(void *node, int res, int reglen, 
unsigned long *addr,
offset = (naddr + nsize) * res;
 
if (reglen < offset + naddr + nsize ||
-   sizeof(dt_xlate_buf) < (offset + naddr + nsize) * 4)
+   MAX_PROP_LEN < (offset + naddr + nsize) * 4)
return 0;
 
-   copy_val(last_addr, dt_xlate_buf + offset, naddr);
+   copy_val(last_addr, prop_buf + offset, naddr);
 
-   ret_size = dt_xlate_buf[offset + naddr];
+   ret_size = prop_buf[offset + naddr];
if (nsize == 2) {
ret_size <<= 32;
-   ret_size |= dt_xlate_buf[offset + naddr + 1];
+   ret_size |= prop_buf[offset + naddr + 1];
}
 
for (;;) {
@@ -256,25 +255,25 @@ static int dt_xlate(void *node, int res, int reglen, 
unsigned long *addr,
 
get_reg_format(parent, &naddr, &nsize);
 
-   buflen = getprop(node, "ranges", dt_xlate_buf,
-   sizeof(dt_xlate_buf));
+   buflen = getprop(node, "ranges", prop_buf,
+   sizeof(prop_buf));
if (buflen == 0)
continue;
-   if (buflen < 0 || buflen > sizeof(dt_xlate_buf))
+   if (buflen < 0 || buflen > sizeof(prop_buf))
return 0;
 
-   offset = find_range(last_addr, dt_xlate_buf, prev_naddr,
+   offset = find_range(last_addr, prop_buf, prev_naddr,
naddr, prev_nsize, buflen / 4);
 
if (offset < 0)
return 0;
 
-   copy_val(this_addr, dt_xlate_buf + offset, prev_naddr);
+   copy_val(this_addr, prop_buf + offset, prev_naddr);
 
if (!sub_reg(last_addr, this_addr))
return 0;
 
-   copy_val(this_addr, dt_xlate_buf + offset + prev_naddr, naddr);
+   copy_val(this_addr, prop_buf + offset + prev_naddr, naddr);
 
if (!add_reg(last_addr, this_addr, naddr))
return 0;
@@ -301,16 +300,37 @@ int dt_xlate_reg(void *node, int res, unsigned long 
*addr, unsigned long *size)
 {
int reglen;
 
-   reglen = getprop(node, "reg", dt_xlate_buf, sizeof(dt_xlate_buf)) / 4;
+   reglen = getprop(node, "reg", prop_buf, sizeof(prop_buf)) / 4;
return dt_xlate(node, res, reglen, addr, size);
 }
 
 int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr)
 {
 
-   if (buflen > sizeof(dt_xlate_buf))
+   if (buflen > sizeof(prop_buf))
return 0;
 
-   memcpy(dt_xlate_buf, buf, buflen);
+   memcpy(prop_buf, buf, buflen);
return dt_xlate(node, 0, buflen / 4, xlated_addr, NULL);
 }
+
+int dt_is_compatible(void *node, const char *compat)
+{
+   char *buf = (char *)prop_buf;
+   int compat_len = strlen(compat);
+   int len, pos;
+
+   len = getprop(node, "compatible", buf, MAX_PROP_LEN);
+   if (len < 0)
+   return 0;
+
+   for (pos = 0; pos + compat_len < len; pos++) {
+   if (!strcmp(buf + pos, compat))
+   return 1;
+
+   while (buf[pos] && pos + compat_len < len)
+   pos++;
+   }
+
+   return 0;
+}
diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h
index 8607706..9a88a80 100644
--- a/arch/powerpc/boot/ops.h
+++ b/arch/powerpc/boot/ops.h
@@ -87,6 +87,7 @@ void *simple_alloc_init(char *base, unsigned long heap_size,
 extern void flush_cache(void *, unsigned long);
 int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long 
*size);
 int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long 
*xlated_addr);
+int dt_is_compatible(void *node, const char *compat);
 
 static inline void *f

[PATCH 10/61] bootwrapper: flatdevtree fixes

2007-07-17 Thread Scott Wood
1. ft_create_node was returning the internal pointer rather than a phandle.
2. ft_find_device_rel was treating lookups relative to root as an error.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/flatdevtree.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/boot/flatdevtree.c b/arch/powerpc/boot/flatdevtree.c
index b732644..5b69aeb 100644
--- a/arch/powerpc/boot/flatdevtree.c
+++ b/arch/powerpc/boot/flatdevtree.c
@@ -659,9 +659,13 @@ void *ft_find_device_rel(struct ft_cxt *cxt, const void 
*top,
 {
char *node;
 
-   node = ft_node_ph2node(cxt, top);
-   if (node == NULL)
-   return NULL;
+   if (top) {
+   node = ft_node_ph2node(cxt, top);
+   if (node == NULL)
+   return NULL;
+   } else {
+   node = ft_root_node(cxt);
+   }
 
node = ft_find_descendent(cxt, node, srch_path);
return ft_get_phandle(cxt, node);
@@ -990,7 +994,7 @@ void *ft_create_node(struct ft_cxt *cxt, const void 
*parent, const char *name)
cxt->p = p;
ft_begin_node(cxt, name);
ft_end_node(cxt);
-   return p;
+   return ft_find_device_rel(cxt, parent, name);
}
p = next;
}
-- 
1.5.0.3

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


[PATCH 11/61] bootwrapper: Add 16-bit I/O.

2007-07-17 Thread Scott Wood
Also, include types.h from io.h, so callers don't have to.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/io.h |   34 ++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/io.h b/arch/powerpc/boot/io.h
index 32974ed..ff3aa19 100644
--- a/arch/powerpc/boot/io.h
+++ b/arch/powerpc/boot/io.h
@@ -1,5 +1,8 @@
 #ifndef _IO_H
 #define __IO_H
+
+#include "types.h"
+
 /*
  * Low-level I/O routines.
  *
@@ -20,6 +23,37 @@ static inline void out_8(volatile unsigned char *addr, int 
val)
 : "=m" (*addr) : "r" (val));
 }
 
+static inline unsigned in_le16(const volatile u16 *addr)
+{
+   unsigned ret;
+
+   __asm__ __volatile__("lhbrx %0,0,%1; twi 0,%0,0; isync"
+: "=r" (ret) : "r" (addr), "m" (*addr));
+
+   return ret;
+}
+
+static inline unsigned in_be16(const volatile u16 *addr)
+{
+   unsigned ret;
+
+   __asm__ __volatile__("lhz%U1%X1 %0,%1; twi 0,%0,0; isync"
+: "=r" (ret) : "m" (*addr));
+   return ret;
+}
+
+static inline void out_le16(volatile u16 *addr, int val)
+{
+   __asm__ __volatile__("sthbrx %1,0,%2; sync" : "=m" (*addr)
+: "r" (val), "r" (addr));
+}
+
+static inline void out_be16(volatile u16 *addr, int val)
+{
+   __asm__ __volatile__("sth%U0%X0 %1,%0; sync"
+: "=m" (*addr) : "r" (val));
+}
+
 static inline unsigned in_le32(const volatile unsigned *addr)
 {
unsigned ret;
-- 
1.5.0.3

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


[PATCH 12/61] bootwrapper: Add TARGET_HAS_ETHn tests to ppcboot.h.

2007-07-17 Thread Scott Wood
U-boots more recent than when ppcboot.h was forked allow the board config
file to enable additional ethernet ports explicitly, rather than
using a hardcoded list of targets.  This allows bootwrapper platform
files to do the same.

Fortunately, nothing after the ethernet addresses is of interest to
cuboot platforms, so the inevitable mismatches won't be too catastrophic.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/ppcboot.h |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/boot/ppcboot.h b/arch/powerpc/boot/ppcboot.h
index 5290ff2..6ae6f90 100644
--- a/arch/powerpc/boot/ppcboot.h
+++ b/arch/powerpc/boot/ppcboot.h
@@ -78,17 +78,18 @@ typedef struct bd_info {
hymod_conf_tbi_hymod_conf;  /* hymod configuration information */
 #endif
 #if defined(TARGET_EVB64260) || defined(TARGET_405EP) || defined(TARGET_44x) 
|| \
-   defined(TARGET_85xx) || defined(TARGET_83xx)
+   defined(TARGET_85xx) || defined(TARGET_83xx) || defined(TARGET_HAS_ETH1)
/* second onboard ethernet port */
unsigned char   bi_enet1addr[6];
 #define HAVE_ENET1ADDR
 #endif
-#if defined(TARGET_EVB64260) || defined(TARGET_440GX) || defined(TARGET_85xx)
+#if defined(TARGET_EVB64260) || defined(TARGET_440GX) || \
+defined(TARGET_85xx) || defined(TARGET_HAS_ETH2)
/* third onboard ethernet ports */
unsigned char   bi_enet2addr[6];
 #define HAVE_ENET2ADDR
 #endif
-#if defined(TARGET_440GX)
+#if defined(TARGET_440GX) || defined(TARGET_HAS_ETH3)
/* fourth onboard ethernet ports */
unsigned char   bi_enet3addr[6];
 #define HAVE_ENET3ADDR
-- 
1.5.0.3

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


  1   2   >