Re: PATCH 2/5] Platform code
Here is the complete warp.c. It is probably easier to read this then the patch. Cheers, Sean /* * PIKA Warp(tm) board specific routines * * Copyright (c) 2008 PIKA Technologies * Sean MacLennan * * 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 #include #include #include #include #include #include #include #include #include #include "44x.h" static __initdata struct of_device_id warp_of_bus[] = { { .compatible = "ibm,plb4", }, { .compatible = "ibm,opb", }, { .compatible = "ibm,ebc", }, {}, }; static __initdata struct i2c_board_info warp_i2c_info[] = { { I2C_BOARD_INFO("ad7414", 0x4a) } }; static int __init warp_arch_init(void) { /* This should go away once support is moved to the dts. */ i2c_register_board_info(0, warp_i2c_info, ARRAY_SIZE(warp_i2c_info)); return 0; } machine_arch_initcall(warp, warp_arch_init); static int __init warp_device_probe(void) { of_platform_bus_probe(NULL, warp_of_bus, NULL); return 0; } machine_device_initcall(warp, warp_device_probe); static int __init warp_probe(void) { unsigned long root = of_get_flat_dt_root(); return of_flat_dt_is_compatible(root, "pika,warp"); } define_machine(warp) { .name = "Warp", .probe = warp_probe, .progress = udbg_progress, .init_IRQ = uic_init_tree, .get_irq= uic_get_irq, .restart= ppc44x_reset_system, .calibrate_decr = generic_calibrate_decr, }; /* I am not sure this is the best place for this... */ static int __init warp_post_info(void) { struct device_node *np; void __iomem *fpga; u32 post1, post2; /* Sig... POST information is in the sd area. */ np = of_find_compatible_node(NULL, NULL, "pika,fpga-sd"); if (np == NULL) return -ENOENT; fpga = of_iomap(np, 0); of_node_put(np); if (fpga == NULL) return -ENOENT; post1 = in_be32(fpga + 0x40); post2 = in_be32(fpga + 0x44); iounmap(fpga); if (post1 || post2) printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2); else printk(KERN_INFO "Warp POST OK\n"); return 0; } machine_late_initcall(warp, warp_post_info); #ifdef CONFIG_SENSORS_AD7414 static LIST_HEAD(dtm_shutdown_list); static void __iomem *dtm_fpga; struct dtm_shutdown { struct list_head list; void (*func)(void *arg); void *arg; }; int dtm_register_shutdown(void (*func)(void *arg), void *arg) { struct dtm_shutdown *shutdown; shutdown = kmalloc(sizeof(struct dtm_shutdown), GFP_KERNEL); if (shutdown == NULL) return -ENOMEM; shutdown->func = func; shutdown->arg = arg; list_add(&shutdown->list, &dtm_shutdown_list); return 0; } EXPORT_SYMBOL(dtm_register_shutdown); int dtm_unregister_shutdown(void (*func)(void *arg), void *arg) { struct dtm_shutdown *shutdown; list_for_each_entry(shutdown, &dtm_shutdown_list, list) if (shutdown->func == func && shutdown->arg == arg) { list_del(&shutdown->list); kfree(shutdown); return 0; } return -EINVAL; } EXPORT_SYMBOL(dtm_unregister_shutdown); static long wdt_keepalive(long time) { if (dtm_fpga) { unsigned reset = in_be32(dtm_fpga + 0x14); out_be32(dtm_fpga + 0x14, reset); } return 0; } static irqreturn_t temp_isr(int irq, void *context) { struct dtm_shutdown *shutdown; /* Run through the shutdown list. */ list_for_each_entry(shutdown, &dtm_shutdown_list, list) shutdown->func(shutdown->arg); panic_timeout = 1800; panic_blink = wdt_keepalive; panic("Critical Temperature Shutdown"); return IRQ_HANDLED; } static void pika_setup_critical_temp(struct i2c_client *client) { struct device_node *np; int irq, rc; /* These registers are in 1 degree increments. */ i2c_smbus_write_byte_data(client, 2, 55); /* Thigh */ i2c_smbus_write_byte_data(client, 3, 50); /* Tlow */ np = of_find_compatible_node(NULL, NULL, "adi,ad7414"); if (np == NULL) { printk(KERN_ERR __FILE__ ": Unable to find ad7414\n"); return; } irq = irq_of_parse_and_map(np, 0); of_node_put(np); if (irq == NO_IRQ) { printk(KERN_ERR __FILE__ ": Unable to get ad7414 irq\n"); return; } rc
Re: Warp patches for 2.6.26
In article <[EMAIL PROTECTED]> you write: > > > A changelog of "updates a bunch of stuff" is pretty much irrelevant in > > all situations I can think of. > > Ok, I hope I got everything: > > Changes to match new FPGA/HW functionality. > * Switched from 64M NOR/64M NAND to 4M NOR/256M NAND. > * Moved/resized partitions to match the flash changes. > * Fixup code added for Rev A boards to handle flash changes. > * Added DTM critical temperature. > * Added DTM fan error - currently disable in FPGA. > * Added POST information. > * Removed LED function, moved to new LED driver. > * Moved ad7414 to new style I2C initialization. Each patch needs to be standalone. you need to add a header describing what the patch is intended to accomplish. Being more descriptive is better than less. Also, as Stephen said, make sure that the subject of each email containing a patch is descriptive and reasonably unique within the entire kernel. For example, instead of "WDT driver", as a minimum something like: "[POWERPC] warp: Add WDT driver". -Dale ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Warp patches for 2.6.26
Sean MacLennan writes: > I was going to hold off until the warp was officially released, but we > might miss the merge window. So here they are. A lot of work has been > done since 2.6.25 and I haven't been submitting patches to keep down on > the churn. Your patches don't have any description at all. If they are to go in they need a decent description of what they do and why they do it they way they do. Putting stuff in a patch 0/5 doesn't really help since that doesn't go into the git repository. Paul. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Warp patches for 2.6.26
> A changelog of "updates a bunch of stuff" is pretty much irrelevant in > all situations I can think of. Ok, I hope I got everything: Changes to match new FPGA/HW functionality. * Switched from 64M NOR/64M NAND to 4M NOR/256M NAND. * Moved/resized partitions to match the flash changes. * Fixup code added for Rev A boards to handle flash changes. * Added DTM critical temperature. * Added DTM fan error - currently disable in FPGA. * Added POST information. * Removed LED function, moved to new LED driver. * Moved ad7414 to new style I2C initialization. Cheers, Sean ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Warp patches for 2.6.26
On Sat, 2008-04-12 at 13:48 -0400, Sean MacLennan wrote: > I was going to hold off until the warp was officially released, but we > might miss the merge window. So here they are. A lot of work has been > done since 2.6.25 and I haven't been submitting patches to keep down on > the churn. That's fair enough. And from what I can tell, your patches are fairly localized to your platform. So once they get some initial review and fixing, I don't foresee having too much trouble getting them merged. One thing to keep in mind though, is that the closer we get to the merge window, the tighter I get on what new stuff I'll bring in for the next release. This may seem counter-intuitive, but I like to have the merge window really be for testing out and fixing any issues that pop up during the merge of all the various subsystem trees. You'll also want to add in some lead time for patch review, etc. That's a long winded way of saying "release early, release often" I suppose :). josh ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Warp patches for 2.6.26
On Sat, Apr 12, 2008 at 7:55 PM, Sean MacLennan <[EMAIL PROTECTED]> wrote: > On Sun, 13 Apr 2008 10:44:30 +1000 > "Stephen Rothwell" <[EMAIL PROTECTED]> wrote: > > > Hi Sean, > > > > First comment is that you need reasonable changelogs i.e. explain why > > you are making changes as well as what they do. Also the first line > > of each changelog (which becomes the subject of any mail generated > > from git) should be a useful and relatively unique summary. > > > > These patches are an amalgamation of a lot of commits. For > example, warp.c was changed 15 times since I last sent a patch to > linuxppc-dev. warp-nand.c was probably changed even more as we kept > shifting the design. > > One of the advantages of an FPGA based design is you can work around a > lot of hardware problems. A disadvantage is that it is easy to change, > so it changes a lot. And the HW guys push the specs out to after they > actually get the feature going. There is no SW input into the FPGA > design. > > So these patches are basically following the changes to the FPGA and > changes to the hardware. As new functionality was added, I updated the > code. > > Is there a particular way I should word this to make it a changelog? You can still describe what the code changes; either by itemizing all the changes; or if it now appears to be a whole new thing, but describing what it does /now/. :-) A changelog of "updates a bunch of stuff" is pretty much irrelevant in all situations I can think of. Cheers, g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 1/5] Boot code
On Sat, 12 Apr 2008 19:49:43 -0500 Josh Boyer <[EMAIL PROTECTED]> wrote: > On Sat, 2008-04-12 at 14:01 -0400, Sean MacLennan wrote: > > Signed-off-by: Sean MacLennan <[EMAIL PROTECTED]> > > > > This patch is word wrapped. Yes, sorry about that. I have been trying out a new mail client and I pasted the text wrong :( I caught it in the other patches though, so they should be good. > > + char name[40]; > > + u32 v[2]; > > + > > + sprintf(name, "/plb/opb/ebc/[EMAIL PROTECTED],0/[EMAIL PROTECTED]", > > from); > > Unless I can't count (which could very well be the case), you have a > buffer overflow here. The fixed string is 37 characters, and the > values you are passing in for "from" will extend the string past the > 40 bytes you have allocated for "name". No, you are right. Good catch. I will update that. Cheers, Sean ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Warp patches for 2.6.26
On Sun, 13 Apr 2008 10:44:30 +1000 "Stephen Rothwell" <[EMAIL PROTECTED]> wrote: > Hi Sean, > > First comment is that you need reasonable changelogs i.e. explain why > you are making changes as well as what they do. Also the first line > of each changelog (which becomes the subject of any mail generated > from git) should be a useful and relatively unique summary. > These patches are an amalgamation of a lot of commits. For example, warp.c was changed 15 times since I last sent a patch to linuxppc-dev. warp-nand.c was probably changed even more as we kept shifting the design. One of the advantages of an FPGA based design is you can work around a lot of hardware problems. A disadvantage is that it is easy to change, so it changes a lot. And the HW guys push the specs out to after they actually get the feature going. There is no SW input into the FPGA design. So these patches are basically following the changes to the FPGA and changes to the hardware. As new functionality was added, I updated the code. Is there a particular way I should word this to make it a changelog? Cheers, Sean ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] tg3: fix MMIO for PPC 44x platforms
From: Sergei Shtylyov <[EMAIL PROTECTED]> Date: Sat, 12 Apr 2008 21:01:22 +0400 > The driver stores the PCI resource addresses into 'unsigned long' variable > before calling ioremap_nocache() on them. This warrants kernel oops when the > registers are accessed on PPC 44x platforms which (being 32-bit) have PCI > memory space mapped beyond 4 GB. > > The arch/ppc/ kernel has a fixup in ioremap() that creates an illusion that > the PCI memory resource is mapped below 4 GB, but arch/powerpc/ code got rid > of this trick, having instead CONFIG_RESOURCES_64BIT enabled. > > Signed-off-by: Sergei Shtylyov <[EMAIL PROTECTED]> Applied, thanks. I added a bump of the driver version and release date for the changeset. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Warp patches for 2.6.26
On Sun, 2008-04-13 at 10:44 +1000, Stephen Rothwell wrote: > Hi Sean, > > First comment is that you need reasonable changelogs i.e. explain why you > are making changes as well as what they do. Also the first line of each > changelog (which becomes the subject of any mail generated from git) > should be a useful and relatively unique summary. Yes, what Stephen said. josh ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 1/5] Boot code
On Sat, 2008-04-12 at 14:01 -0400, Sean MacLennan wrote: > Signed-off-by: Sean MacLennan <[EMAIL PROTECTED]> > This patch is word wrapped. > diff --git a/arch/powerpc/boot/cuboot-warp.c > b/arch/powerpc/boot/cuboot-warp.c index eb108a8..43d7ad9 100644 > --- a/arch/powerpc/boot/cuboot-warp.c > +++ b/arch/powerpc/boot/cuboot-warp.c > @@ -10,6 +10,7 @@ > #include "ops.h" > #include "4xx.h" > #include "cuboot.h" > +#include "stdio.h" > > #define TARGET_4xx > #define TARGET_44x > @@ -17,14 +18,54 @@ > > static bd_t bd; > > -static void warp_fixups(void) > +static void warp_fixup_one_nor(u32 from, u32 to) > { > - unsigned long sysclk = 6600; > + void *devp; > + char name[40]; > + u32 v[2]; > + > + sprintf(name, "/plb/opb/ebc/[EMAIL PROTECTED],0/[EMAIL PROTECTED]", > from); Unless I can't count (which could very well be the case), you have a buffer overflow here. The fixed string is 37 characters, and the values you are passing in for "from" will extend the string past the 40 bytes you have allocated for "name". josh ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Warp patches for 2.6.26
Hi Sean, First comment is that you need reasonable changelogs i.e. explain why you are making changes as well as what they do. Also the first line of each changelog (which becomes the subject of any mail generated from git) should be a useful and relatively unique summary. -- Cheers, Stephen Rothwell[EMAIL PROTECTED] http://www.canb.auug.org.au/~sfr/ pgpOUGcaUk6Nz.pgp Description: PGP signature ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 4/5] LED driver
On Sat, 2008-04-12 at 14:10 -0400, Sean MacLennan wrote: > Signed-off-by: Sean MacLennan <[EMAIL PROTECTED]> This should be sent to Richard Purdie. josh > > diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig > index 859814f..31e1746 100644 > --- a/drivers/leds/Kconfig > +++ b/drivers/leds/Kconfig > @@ -145,6 +145,12 @@ config LEDS_CLEVO_MAIL > To compile this driver as a module, choose M here: the > module will be called leds-clevo-mail. > > +config LEDS_WARP > + tristate "LED Support for the PIKA Warp LEDs" > + depends on LEDS_CLASS && WARP > + help > + This option enables support for the PIKA Warp LEDs. > + > comment "LED Triggers" > > config LEDS_TRIGGERS > diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile > index 84ced3b..eb60fb1 100644 > --- a/drivers/leds/Makefile > +++ b/drivers/leds/Makefile > @@ -21,6 +21,7 @@ obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o > obj-$(CONFIG_LEDS_CM_X270) += leds-cm-x270.o > obj-$(CONFIG_LEDS_CLEVO_MAIL)+= leds-clevo-mail.o > obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o > +obj-$(CONFIG_LEDS_WARP) += leds-warp.o > > # LED Triggers > obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o > diff --git a/drivers/leds/leds-warp.c b/drivers/leds/leds-warp.c > new file mode 100644 > index 000..0fbe0b7 > --- /dev/null > +++ b/drivers/leds/leds-warp.c > @@ -0,0 +1,148 @@ > +/* > + * Copyright (c) 2008 PIKA Technologies > + * Sean MacLennan > + * > + * This is just a temporary driver until the GPIO/GPIO_OF_LEDS drivers > + * get sorted out. > + */ > +#include > +#include > +#include > +#include > + > + > +#define LED_GREEN (0x8000 >> 0) > +#define LED_RED (0x8000 >> 1) > + > +static void __iomem *gpio_base; > + > + > +static void warp_green_set(struct led_classdev *led_cdev, > +enum led_brightness brightness) > +{ > + unsigned leds = in_be32(gpio_base); > + > + if (brightness) > + leds |= LED_GREEN; > + else > + leds &= ~LED_GREEN; > + > + out_be32(gpio_base, leds); > +} > + > +static void warp_red_set(struct led_classdev *led_cdev, > + enum led_brightness brightness) > +{ > + unsigned leds = in_be32(gpio_base); > + > + if (brightness) > + leds |= LED_RED; > + else > + leds &= ~LED_RED; > + > + out_be32(gpio_base, leds); > +} > + > +static struct led_classdev warp_green_led = { > + .name = "warp-green", > + .brightness_set = warp_green_set, > +}; > + > +static struct led_classdev warp_red_led = { > + .name = "warp-red", > + .brightness_set = warp_red_set, > +}; > + > +static int __devinit warp_led_probe(struct platform_device *pdev) > +{ > + struct device_node *np; > + int rc; > + > + /* Power LEDS are on the second GPIO controller */ > + np = of_find_compatible_node(NULL, NULL, "ibm,gpio-440EP"); > + if (np) > + np = of_find_compatible_node(np, NULL, "ibm,gpio-440EP"); > + if (np == NULL) { > + printk(KERN_ERR __FILE__ ": Unable to find gpio\n"); > + return -ENOENT; > + } > + > + gpio_base = of_iomap(np, 0); > + of_node_put(np); > + if (gpio_base == NULL) { > + printk(KERN_ERR __FILE__ ": Unable to map gpio"); > + return -ENOMEM; > + } > + > + rc = led_classdev_register(&pdev->dev, &warp_green_led); > + if (rc) { > + iounmap(gpio_base); > + return rc; > + } > + > + rc = led_classdev_register(&pdev->dev, &warp_red_led); > + if (rc) { > + led_classdev_unregister(&warp_green_led); > + iounmap(gpio_base); > + return rc; > + } > + > + return 0; > +} > + > +static int __devexit warp_led_remove(struct platform_device *pdev) > +{ > + led_classdev_unregister(&warp_green_led); > + led_classdev_unregister(&warp_red_led); > + > + iounmap(gpio_base); > + > + return 0; > +} > + > +/* We *must* have a release. */ > +static void warp_led_release(struct device *dev) {} > + > +static struct platform_driver warp_led_driver = { > + .probe = warp_led_probe, > + .remove = __devexit_p(warp_led_remove), > + .driver = { > + .name = "warp-led", > + }, > +}; > + > +static struct platform_device warp_led_device = { > + .name = "warp-led", > + .id = 0, > + .dev = { > + .release = warp_led_release, > + }, > +}; > + > +static int __init warp_led_init(void) > +{ > + int rc; > + > + rc = platform_device_register(&warp_led_device); > + if (rc) > + return rc; > + rc = platform_driver_register(&warp_led_driver); > + if (rc) { > + platform_device_unregister(&warp_led_device); > + return rc; > + } > + > + return 0; > +} > + > +static void __exit warp_led_exit(void) > +{ > + platform
Re: [PATCH 5/5] WDT driver
On Sat, 2008-04-12 at 14:11 -0400, Sean MacLennan wrote: > Signed-off-by: Sean MacLennan <[EMAIL PROTECTED]> This should be sent to Wim as he maintains the watchdog drivers tree. josh > > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig > index 254d115..e73a3ea 100644 > --- a/drivers/watchdog/Kconfig > +++ b/drivers/watchdog/Kconfig > @@ -697,6 +697,14 @@ config BOOKE_WDT > Please see Documentation/watchdog/watchdog-api.txt for > more information. > > +config PIKA_WDT > + tristate "PIKA FPGA Watchdog" > + depends on WARP > + default y > + help > + This enables the watchdog in the PIKA FPGA. Currently used on > + the Warp platform. > + > # PPC64 Architecture > > config WATCHDOG_RTAS > diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile > index f3fb170..09758c5 100644 > --- a/drivers/watchdog/Makefile > +++ b/drivers/watchdog/Makefile > @@ -105,6 +105,7 @@ obj-$(CONFIG_MPC5200_WDT) += mpc5200_wdt.o > obj-$(CONFIG_83xx_WDT) += mpc83xx_wdt.o > obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o > obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o > +obj-$(CONFIG_PIKA_WDT) += pika_wdt.o > > # PPC64 Architecture > obj-$(CONFIG_WATCHDOG_RTAS) += wdrtas.o > diff --git a/drivers/watchdog/pika_wdt.c b/drivers/watchdog/pika_wdt.c > new file mode 100644 > index 000..b84ac07 > --- /dev/null > +++ b/drivers/watchdog/pika_wdt.c > @@ -0,0 +1,113 @@ > +/* > + * PIKA FPGA based Watchdog Timer > + * > + * Copyright (c) 2008 PIKA Technologies > + * Sean MacLennan > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > + > +static void __iomem *pikawdt_fpga; > + > + > +static inline void pikawdt_ping(void) > +{ > + unsigned reset = in_be32(pikawdt_fpga + 0x14); > + reset |= 0xf80; /* enable with max timeout - 15 seconds */ > + out_be32(pikawdt_fpga + 0x14, reset); > +} > + > +static int pikawdt_open(struct inode *inode, struct file *file) > +{ > + printk(KERN_INFO "PIKA WDT started...\n"); > + > + pikawdt_ping(); > + > + return 0; > +} > + > +static int pikawdt_release(struct inode *inode, struct file *file) > +{ > + pikawdt_ping(); /* one last time */ > + return 0; > +} > + > +static ssize_t pikawdt_write(struct file *file, const char __user *buf, > + size_t count, loff_t *ppos) > +{ > + pikawdt_ping(); > + return count; > +} > + > +/* We support the bare minimum to be conformant. */ > +static int pikawdt_ioctl(struct inode *inode, struct file *file, > + unsigned int cmd, unsigned long arg) > +{ > + if (cmd == WDIOC_KEEPALIVE) { > + pikawdt_ping(); > + return 0; > + } else > + return -EINVAL; > +} > + > +static const struct file_operations pikawdt_fops = { > + .owner = THIS_MODULE, > + .open = pikawdt_open, > + .release= pikawdt_release, > + .write = pikawdt_write, > + .ioctl = pikawdt_ioctl, > +}; > + > +static struct miscdevice pikawdt_miscdev = { > + .minor = WATCHDOG_MINOR, > + .name = "watchdog", > + .fops = &pikawdt_fops, > +}; > + > +static int __init pikawdt_init(void) > +{ > + struct device_node *np; > + int ret; > + > + np = of_find_compatible_node(NULL, NULL, "pika,fpga"); > + if (np == NULL) { > + printk(KERN_ERR "pikawdt: Unable to find fpga.\n"); > + return -ENOENT; > + } > + > + pikawdt_fpga = of_iomap(np, 0); > + > + of_node_put(np); > + > + if (pikawdt_fpga == NULL) { > + printk(KERN_ERR "pikawdt: Unable to map fpga.\n"); > + return -ENOENT; > + } > + > + ret = misc_register(&pikawdt_miscdev); > + if (ret) { > + iounmap(pikawdt_fpga); > + printk(KERN_ERR "pikawdt: Unable to register miscdev.\n"); > + return ret; > + } > + > + return 0; > +} > +module_init(pikawdt_init); > + > + > +static void __exit pikawdt_exit(void) > +{ > + misc_deregister(&pikawdt_miscdev); > + > + iounmap(pikawdt_fpga); > +} > +module_exit(pikawdt_exit); > ___ > 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 1/2] ibm_newemac: PowerPC 440GX EMAC PHY clock workaround
Josh Boyer wrote: On Sat, 2008-04-12 at 16:28 -0400, Jeff Garzik wrote: I had queried the status of these patches, and didn't receive any reply initially from my query... Erm... you did. http://ozlabs.org/pipermail/linuxppc-dev/2008-March/053737.html No worries though. I lose email all the time. Whoops, sorry about that! Jeff ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 1/2] ibm_newemac: PowerPC 440GX EMAC PHY clock workaround
On Sat, 2008-04-12 at 16:28 -0400, Jeff Garzik wrote: > Josh Boyer wrote: > > On Fri, 28 Mar 2008 22:18:25 -0400 > > Jeff Garzik <[EMAIL PROTECTED]> wrote: > > > >> Valentine Barshak wrote: > >>> The PowerPC 440GX Taishan board fails to reset EMAC3 (reset timeout error) > >>> if there's no link. Because of that it fails to find PHY chip. The older > >>> ibm_emac > >>> driver had a workaround for that: the EMAC_CLK_INTERNAL/EMAC_CLK_EXTERNAL > >>> macros, > >>> which toggle the Ethernet Clock Select bit in the SDR0_MFR register. This > >>> patch > >>> does the same for "ibm,emac-440gx" compatible chips. The workaround forces > >>> clock on -all- EMACs, so we select clock under global emac_phy_map_lock. > >>> > >>> Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]> > >>> --- > >>> drivers/net/ibm_newemac/core.c | 16 +++- > >>> drivers/net/ibm_newemac/core.h |8 ++-- > >>> 2 files changed, 21 insertions(+), 3 deletions(-) > >> is this for 2.6.25-rc? > > > > Jeff, can I get an ack from you on this patch, and patch 2 in this > > set? They depend on a patch in my tree and I'd like to include them in > > my next push to Paul for 2.6.26. > > ACK Many thanks. > I had queried the status of these patches, and didn't receive any reply > initially from my query... Erm... you did. http://ozlabs.org/pipermail/linuxppc-dev/2008-March/053737.html No worries though. I lose email all the time. josh ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 1/2] ibm_newemac: PowerPC 440GX EMAC PHY clock workaround
Josh Boyer wrote: On Fri, 28 Mar 2008 22:18:25 -0400 Jeff Garzik <[EMAIL PROTECTED]> wrote: Valentine Barshak wrote: The PowerPC 440GX Taishan board fails to reset EMAC3 (reset timeout error) if there's no link. Because of that it fails to find PHY chip. The older ibm_emac driver had a workaround for that: the EMAC_CLK_INTERNAL/EMAC_CLK_EXTERNAL macros, which toggle the Ethernet Clock Select bit in the SDR0_MFR register. This patch does the same for "ibm,emac-440gx" compatible chips. The workaround forces clock on -all- EMACs, so we select clock under global emac_phy_map_lock. Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]> --- drivers/net/ibm_newemac/core.c | 16 +++- drivers/net/ibm_newemac/core.h |8 ++-- 2 files changed, 21 insertions(+), 3 deletions(-) is this for 2.6.25-rc? Jeff, can I get an ack from you on this patch, and patch 2 in this set? They depend on a patch in my tree and I'd like to include them in my next push to Paul for 2.6.26. ACK I had queried the status of these patches, and didn't receive any reply initially from my query... ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 5/5] WDT driver
Signed-off-by: Sean MacLennan <[EMAIL PROTECTED]> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 254d115..e73a3ea 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -697,6 +697,14 @@ config BOOKE_WDT Please see Documentation/watchdog/watchdog-api.txt for more information. +config PIKA_WDT + tristate "PIKA FPGA Watchdog" + depends on WARP + default y + help +This enables the watchdog in the PIKA FPGA. Currently used on +the Warp platform. + # PPC64 Architecture config WATCHDOG_RTAS diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index f3fb170..09758c5 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile @@ -105,6 +105,7 @@ obj-$(CONFIG_MPC5200_WDT) += mpc5200_wdt.o obj-$(CONFIG_83xx_WDT) += mpc83xx_wdt.o obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o +obj-$(CONFIG_PIKA_WDT) += pika_wdt.o # PPC64 Architecture obj-$(CONFIG_WATCHDOG_RTAS) += wdrtas.o diff --git a/drivers/watchdog/pika_wdt.c b/drivers/watchdog/pika_wdt.c new file mode 100644 index 000..b84ac07 --- /dev/null +++ b/drivers/watchdog/pika_wdt.c @@ -0,0 +1,113 @@ +/* + * PIKA FPGA based Watchdog Timer + * + * Copyright (c) 2008 PIKA Technologies + * Sean MacLennan + */ + +#include +#include +#include +#include +#include +#include +#include +#include + + +static void __iomem *pikawdt_fpga; + + +static inline void pikawdt_ping(void) +{ + unsigned reset = in_be32(pikawdt_fpga + 0x14); + reset |= 0xf80; /* enable with max timeout - 15 seconds */ + out_be32(pikawdt_fpga + 0x14, reset); +} + +static int pikawdt_open(struct inode *inode, struct file *file) +{ + printk(KERN_INFO "PIKA WDT started...\n"); + + pikawdt_ping(); + + return 0; +} + +static int pikawdt_release(struct inode *inode, struct file *file) +{ + pikawdt_ping(); /* one last time */ + return 0; +} + +static ssize_t pikawdt_write(struct file *file, const char __user *buf, +size_t count, loff_t *ppos) +{ + pikawdt_ping(); + return count; +} + +/* We support the bare minimum to be conformant. */ +static int pikawdt_ioctl(struct inode *inode, struct file *file, +unsigned int cmd, unsigned long arg) +{ + if (cmd == WDIOC_KEEPALIVE) { + pikawdt_ping(); + return 0; + } else + return -EINVAL; +} + +static const struct file_operations pikawdt_fops = { + .owner = THIS_MODULE, + .open = pikawdt_open, + .release= pikawdt_release, + .write = pikawdt_write, + .ioctl = pikawdt_ioctl, +}; + +static struct miscdevice pikawdt_miscdev = { + .minor = WATCHDOG_MINOR, + .name = "watchdog", + .fops = &pikawdt_fops, +}; + +static int __init pikawdt_init(void) +{ + struct device_node *np; + int ret; + + np = of_find_compatible_node(NULL, NULL, "pika,fpga"); + if (np == NULL) { + printk(KERN_ERR "pikawdt: Unable to find fpga.\n"); + return -ENOENT; + } + + pikawdt_fpga = of_iomap(np, 0); + + of_node_put(np); + + if (pikawdt_fpga == NULL) { + printk(KERN_ERR "pikawdt: Unable to map fpga.\n"); + return -ENOENT; + } + + ret = misc_register(&pikawdt_miscdev); + if (ret) { + iounmap(pikawdt_fpga); + printk(KERN_ERR "pikawdt: Unable to register miscdev.\n"); + return ret; + } + + return 0; +} +module_init(pikawdt_init); + + +static void __exit pikawdt_exit(void) +{ + misc_deregister(&pikawdt_miscdev); + + iounmap(pikawdt_fpga); +} +module_exit(pikawdt_exit); ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 4/5] LED driver
Signed-off-by: Sean MacLennan <[EMAIL PROTECTED]> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 859814f..31e1746 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -145,6 +145,12 @@ config LEDS_CLEVO_MAIL To compile this driver as a module, choose M here: the module will be called leds-clevo-mail. +config LEDS_WARP + tristate "LED Support for the PIKA Warp LEDs" + depends on LEDS_CLASS && WARP + help + This option enables support for the PIKA Warp LEDs. + comment "LED Triggers" config LEDS_TRIGGERS diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index 84ced3b..eb60fb1 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile @@ -21,6 +21,7 @@ obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o obj-$(CONFIG_LEDS_CM_X270) += leds-cm-x270.o obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o +obj-$(CONFIG_LEDS_WARP)+= leds-warp.o # LED Triggers obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o diff --git a/drivers/leds/leds-warp.c b/drivers/leds/leds-warp.c new file mode 100644 index 000..0fbe0b7 --- /dev/null +++ b/drivers/leds/leds-warp.c @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2008 PIKA Technologies + * Sean MacLennan + * + * This is just a temporary driver until the GPIO/GPIO_OF_LEDS drivers + * get sorted out. + */ +#include +#include +#include +#include + + +#define LED_GREEN (0x8000 >> 0) +#define LED_RED (0x8000 >> 1) + +static void __iomem *gpio_base; + + +static void warp_green_set(struct led_classdev *led_cdev, + enum led_brightness brightness) +{ + unsigned leds = in_be32(gpio_base); + + if (brightness) + leds |= LED_GREEN; + else + leds &= ~LED_GREEN; + + out_be32(gpio_base, leds); +} + +static void warp_red_set(struct led_classdev *led_cdev, +enum led_brightness brightness) +{ + unsigned leds = in_be32(gpio_base); + + if (brightness) + leds |= LED_RED; + else + leds &= ~LED_RED; + + out_be32(gpio_base, leds); +} + +static struct led_classdev warp_green_led = { + .name = "warp-green", + .brightness_set = warp_green_set, +}; + +static struct led_classdev warp_red_led = { + .name = "warp-red", + .brightness_set = warp_red_set, +}; + +static int __devinit warp_led_probe(struct platform_device *pdev) +{ + struct device_node *np; + int rc; + + /* Power LEDS are on the second GPIO controller */ + np = of_find_compatible_node(NULL, NULL, "ibm,gpio-440EP"); + if (np) + np = of_find_compatible_node(np, NULL, "ibm,gpio-440EP"); + if (np == NULL) { + printk(KERN_ERR __FILE__ ": Unable to find gpio\n"); + return -ENOENT; + } + + gpio_base = of_iomap(np, 0); + of_node_put(np); + if (gpio_base == NULL) { + printk(KERN_ERR __FILE__ ": Unable to map gpio"); + return -ENOMEM; + } + + rc = led_classdev_register(&pdev->dev, &warp_green_led); + if (rc) { + iounmap(gpio_base); + return rc; + } + + rc = led_classdev_register(&pdev->dev, &warp_red_led); + if (rc) { + led_classdev_unregister(&warp_green_led); + iounmap(gpio_base); + return rc; + } + + return 0; +} + +static int __devexit warp_led_remove(struct platform_device *pdev) +{ + led_classdev_unregister(&warp_green_led); + led_classdev_unregister(&warp_red_led); + + iounmap(gpio_base); + + return 0; +} + +/* We *must* have a release. */ +static void warp_led_release(struct device *dev) {} + +static struct platform_driver warp_led_driver = { + .probe = warp_led_probe, + .remove = __devexit_p(warp_led_remove), + .driver = { + .name = "warp-led", + }, +}; + +static struct platform_device warp_led_device = { + .name = "warp-led", + .id = 0, + .dev = { + .release = warp_led_release, + }, +}; + +static int __init warp_led_init(void) +{ + int rc; + + rc = platform_device_register(&warp_led_device); + if (rc) + return rc; + rc = platform_driver_register(&warp_led_driver); + if (rc) { + platform_device_unregister(&warp_led_device); + return rc; + } + + return 0; +} + +static void __exit warp_led_exit(void) +{ + platform_driver_unregister(&warp_led_driver); + platform_device_unregister(&warp_led_device); +} + +module_init(warp_led_init); +module_exit(warp_led_exit); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Sean MacLennan <[EMAIL PROTECTED]>"); ___ Linuxppc-dev maili
[PATCH 3/5] Defconfig
Signed-off-by: Sean MacLennan <[EMAIL PROTECTED]> diff --git a/arch/powerpc/configs/warp_defconfig b/arch/powerpc/configs/warp_defconfig index 2313c3e..91b9fb1 100644 --- a/arch/powerpc/configs/warp_defconfig +++ b/arch/powerpc/configs/warp_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.25-rc2 -# Fri Feb 15 21:54:43 2008 +# Linux kernel version: 2.6.25-rc6 +# Tue Apr 8 02:27:53 2008 # # CONFIG_PPC64 is not set @@ -79,6 +79,7 @@ CONFIG_FAIR_GROUP_SCHED=y CONFIG_USER_SCHED=y # CONFIG_CGROUP_SCHED is not set CONFIG_SYSFS_DEPRECATED=y +CONFIG_SYSFS_DEPRECATED_V2=y # CONFIG_RELAY is not set # CONFIG_NAMESPACES is not set CONFIG_BLK_DEV_INITRD=y @@ -112,6 +113,7 @@ CONFIG_SLAB=y CONFIG_HAVE_OPROFILE=y # CONFIG_KPROBES is not set CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y CONFIG_PROC_PAGE_MONITOR=y CONFIG_SLABINFO=y CONFIG_RT_MUTEXES=y @@ -142,7 +144,6 @@ CONFIG_DEFAULT_AS=y # CONFIG_DEFAULT_NOOP is not set CONFIG_DEFAULT_IOSCHED="anticipatory" CONFIG_CLASSIC_RCU=y -# CONFIG_PREEMPT_RCU is not set # # Platform support @@ -159,6 +160,8 @@ CONFIG_CLASSIC_RCU=y # CONFIG_KATMAI is not set # CONFIG_RAINIER is not set CONFIG_WARP=y +# CONFIG_CANYONLANDS is not set +# CONFIG_YOSEMITE is not set CONFIG_440EP=y CONFIG_IBM440EP_ERR42=y # CONFIG_IPIC is not set @@ -191,7 +194,6 @@ CONFIG_HZ=1000 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -CONFIG_RCU_TRACE=y CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set # CONFIG_MATH_EMULATION is not set @@ -224,6 +226,7 @@ CONFIG_ISA_DMA_API=y # Bus options # CONFIG_ZONE_DMA=y +CONFIG_4xx_SOC=y # CONFIG_PCI is not set # CONFIG_PCI_DOMAINS is not set # CONFIG_PCI_SYSCALL is not set @@ -380,7 +383,7 @@ CONFIG_MTD_BLOCK=y # CONFIG_INFTL is not set # CONFIG_RFD_FTL is not set # CONFIG_SSFDC is not set -CONFIG_MTD_OOPS=m +# CONFIG_MTD_OOPS is not set # # RAM/ROM/Flash chip drivers @@ -434,6 +437,7 @@ CONFIG_MTD_NAND=y CONFIG_MTD_NAND_ECC_SMC=y # CONFIG_MTD_NAND_MUSEUM_IDS is not set CONFIG_MTD_NAND_IDS=y +CONFIG_MTD_NAND_NDFC=y # CONFIG_MTD_NAND_DISKONCHIP is not set # CONFIG_MTD_NAND_NANDSIM is not set # CONFIG_MTD_NAND_PLATFORM is not set @@ -493,7 +497,7 @@ CONFIG_BLK_DEV_SD=y # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set # CONFIG_SCSI_SCAN_ASYNC is not set -CONFIG_SCSI_WAIT_SCAN=m +# CONFIG_SCSI_WAIT_SCAN is not set # # SCSI Transports @@ -617,6 +621,7 @@ CONFIG_I2C_BOARDINFO=y # # I2C Hardware Bus support # +CONFIG_I2C_IBM_IIC=y # CONFIG_I2C_MPC is not set # CONFIG_I2C_OCORES is not set # CONFIG_I2C_PARPORT_LIGHT is not set @@ -650,6 +655,7 @@ CONFIG_SENSORS_EEPROM=y # CONFIG_POWER_SUPPLY is not set CONFIG_HWMON=y # CONFIG_HWMON_VID is not set +CONFIG_SENSORS_AD7414=y # CONFIG_SENSORS_AD7418 is not set # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set @@ -658,6 +664,7 @@ CONFIG_HWMON=y # CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ADM9240 is not set # CONFIG_SENSORS_ADT7470 is not set +# CONFIG_SENSORS_ADT7473 is not set # CONFIG_SENSORS_ATXP1 is not set # CONFIG_SENSORS_DS1621 is not set # CONFIG_SENSORS_F71805F is not set @@ -698,7 +705,20 @@ CONFIG_HWMON=y # CONFIG_SENSORS_W83627EHF is not set # CONFIG_HWMON_DEBUG_CHIP is not set CONFIG_THERMAL=y -# CONFIG_WATCHDOG is not set +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set + +# +# Watchdog Device Drivers +# +# CONFIG_SOFT_WATCHDOG is not set +# CONFIG_BOOKE_WDT is not set +CONFIG_PIKA_WDT=y + +# +# USB-based Watchdog Cards +# +# CONFIG_USBPCWATCHDOG is not set # # Sonics Silicon Backplane @@ -826,14 +846,14 @@ CONFIG_USB_MON=y # CONFIG_USB_TRANCEVIBRATOR is not set # CONFIG_USB_IOWARRIOR is not set # CONFIG_USB_GADGET is not set -CONFIG_MMC=m +CONFIG_MMC=y # CONFIG_MMC_DEBUG is not set # CONFIG_MMC_UNSAFE_RESUME is not set # # MMC/SD Card Drivers # -CONFIG_MMC_BLOCK=m +CONFIG_MMC_BLOCK=y CONFIG_MMC_BLOCK_BOUNCE=y # CONFIG_SDIO_UART is not set @@ -841,10 +861,23 @@ CONFIG_MMC_BLOCK_BOUNCE=y # MMC/SD Host Controller Drivers # # CONFIG_MMC_WBSD is not set +CONFIG_MMC_PIKASD=y # CONFIG_MEMSTICK is not set -# CONFIG_NEW_LEDS is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y + +# +# LED drivers +# +CONFIG_LEDS_WARP=y + +# +# LED Triggers +# +# CONFIG_LEDS_TRIGGERS is not set # CONFIG_EDAC is not set # CONFIG_RTC_CLASS is not set +# CONFIG_DMADEVICES is not set # # Userspace I/O @@ -896,7 +929,8 @@ CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_PROC_SYSCTL=y CONFIG_SYSFS=y -# CONFIG_TMPFS is not set +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set # CONFIG_HUGETLB_PAGE is not set # CONFIG_CONFIGFS_FS is not set @@ -1013,6 +1047,7 @@ CONFIG_PLIST=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT=y CONFIG_HAS_DMA=y +CONFIG_HAVE_LMB=y # # Kernel hacking @@ -1022,7 +1057,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y CONFIG_ENABLE_MUST_CHECK=y CONFIG_MAGIC_SYSRQ=y
PATCH 2/5] Platform code
Signed-off-by: Sean MacLennan <[EMAIL PROTECTED]> diff --git a/arch/powerpc/platforms/44x/warp-nand.c b/arch/powerpc/platforms/44x/warp-nand.c index 9150318..f70019d 100644 --- a/arch/powerpc/platforms/44x/warp-nand.c +++ b/arch/powerpc/platforms/44x/warp-nand.c @@ -2,7 +2,7 @@ * PIKA Warp(tm) NAND flash specific routines * * Copyright (c) 2008 PIKA Technologies - * Sean MacLennan <[EMAIL PROTECTED]> + * Sean MacLennan */ #include @@ -11,8 +11,10 @@ #include #include #include +#include #include + #ifdef CONFIG_MTD_NAND_NDFC #define CS_NAND_0 1 /* use chip select 1 for NAND device 0 */ @@ -35,13 +37,23 @@ static struct mtd_partition nand_parts[] = { { .name = "root", .offset = 0x020, - .size = 0x340 + .size = 0x3E0 + }, + { + .name = "persistent", + .offset = 0x400, + .size = 0x400 }, { - .name = "user", - .offset = 0x360, - .size = 0x0A0 + .name = "persistent1", + .offset = 0x800, + .size = 0x400 }, + { + .name = "persistent2", + .offset = 0xC00, + .size = 0x400 + } }; struct ndfc_controller_settings warp_ndfc_settings = { @@ -67,19 +79,15 @@ static struct platform_device warp_ndfc_device = { .resource = &warp_ndfc, }; -static struct nand_ecclayout nand_oob_16 = { - .eccbytes = 3, - .eccpos = { 0, 1, 2, 3, 6, 7 }, - .oobfree = { {.offset = 8, .length = 16} } -}; - +/* Do NOT set the ecclayout: let it default so it is correct for both + * 64M and 256M flash chips. + */ static struct platform_nand_chip warp_nand_chip0 = { .nr_chips = 1, .chip_offset = CS_NAND_0, .nr_partitions = ARRAY_SIZE(nand_parts), .partitions = nand_parts, - .chip_delay = 50, - .ecclayout = &nand_oob_16, + .chip_delay = 20, .priv = &warp_chip0_settings, }; @@ -96,6 +104,23 @@ static struct platform_device warp_nand_device = { static int warp_setup_nand_flash(void) { + struct device_node *np; + + /* Try to detect a rev A based on NOR size. */ + np = of_find_compatible_node(NULL, NULL, "cfi-flash"); + if (np) { + struct property *pp; + + pp = of_find_property(np, "reg", NULL); + if (pp && (pp->length == 12)) { + u32 *v = pp->value; + if (v[2] == 0x400) + /* Rev A = 64M NAND */ + warp_nand_chip0.nr_partitions = 2; + } + of_node_put(np); + } + platform_device_register(&warp_ndfc_device); platform_device_register(&warp_nand_device); diff --git a/arch/powerpc/platforms/44x/warp.c b/arch/powerpc/platforms/44x/warp.c index 39cf615..6deffad 100644 --- a/arch/powerpc/platforms/44x/warp.c +++ b/arch/powerpc/platforms/44x/warp.c @@ -2,7 +2,7 @@ * PIKA Warp(tm) board specific routines * * Copyright (c) 2008 PIKA Technologies - * Sean MacLennan <[EMAIL PROTECTED]> + * Sean MacLennan * * 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 @@ -12,6 +12,9 @@ #include #include #include +#include +#include +#include #include #include @@ -27,6 +30,18 @@ static __initdata struct of_device_id warp_of_bus[] = { {}, }; +static __initdata struct i2c_board_info warp_i2c_info[] = { + { I2C_BOARD_INFO("ad7414", 0x4a) } +}; + +static int __init warp_arch_init(void) +{ + /* This should go away once support is moved to the dts. */ + i2c_register_board_info(0, warp_i2c_info, ARRAY_SIZE(warp_i2c_info)); + return 0; +} +machine_arch_initcall(warp, warp_arch_init); + static int __init warp_device_probe(void) { of_platform_bus_probe(NULL, warp_of_bus, NULL); @@ -52,61 +67,183 @@ define_machine(warp) { }; -#define LED_GREEN (0x8000 >> 0) -#define LED_RED (0x8000 >> 1) +/* I am not sure this is the best place for this... */ +static int __init warp_post_info(void) +{ + struct device_node *np; + void __iomem *fpga; + u32 post1, post2; + + /* Sig... POST information is in the sd area. */ + np = of_find_compatible_node(NULL, NULL, "pika,fpga-sd"); + if (np == NULL) + return -ENOENT; + + fpga = of_iomap(np, 0); + of_node_put(np); + if (fpga == NULL) + return -ENOENT; + + post1 = in_be32(fpga + 0x40); + post2 = in_be32(fpga + 0x44); + + iounmap(fpga); + + if (post1 || post2) + printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2); + else + print
[PATCH 1/5] Boot code
Signed-off-by: Sean MacLennan <[EMAIL PROTECTED]> diff --git a/arch/powerpc/boot/cuboot-warp.c b/arch/powerpc/boot/cuboot-warp.c index eb108a8..43d7ad9 100644 --- a/arch/powerpc/boot/cuboot-warp.c +++ b/arch/powerpc/boot/cuboot-warp.c @@ -10,6 +10,7 @@ #include "ops.h" #include "4xx.h" #include "cuboot.h" +#include "stdio.h" #define TARGET_4xx #define TARGET_44x @@ -17,14 +18,54 @@ static bd_t bd; -static void warp_fixups(void) +static void warp_fixup_one_nor(u32 from, u32 to) { - unsigned long sysclk = 6600; + void *devp; + char name[40]; + u32 v[2]; + + sprintf(name, "/plb/opb/ebc/[EMAIL PROTECTED],0/[EMAIL PROTECTED]", from); + + devp = finddevice(name); + if (!devp) + return; + + if (getprop(devp, "reg", v, sizeof(v)) == sizeof(v)) { + v[0] = to; + setprop(devp, "reg", v, sizeof(v)); + + printf("NOR 64M fixup %x -> %x\r\n", from, to); + } +} + - ibm440ep_fixup_clocks(sysclk, 11059200, 5000); +static void warp_fixups(void) +{ + ibm440ep_fixup_clocks(6600, 11059200, 5000); ibm4xx_sdram_fixup_memsize(); ibm4xx_fixup_ebc_ranges("/plb/opb/ebc"); dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr); + + /* Fixup for 64M flash on Rev A boards. */ + if (bd.bi_flashsize == 0x400) { + void *devp; + u32 v[3]; + + devp = finddevice("/plb/opb/ebc/[EMAIL PROTECTED],0"); + if (!devp) + return; + + /* Fixup the size */ + if (getprop(devp, "reg", v, sizeof(v)) == sizeof(v)) { + v[2] = bd.bi_flashsize; + setprop(devp, "reg", v, sizeof(v)); + } + + /* Fixup parition offsets */ + warp_fixup_one_nor(0x30, 0x3f0); + warp_fixup_one_nor(0x34, 0x3f4); + warp_fixup_one_nor(0x38, 0x3f8); + } } diff --git a/arch/powerpc/boot/dts/warp.dts b/arch/powerpc/boot/dts/warp.dts index b04a52e..fa070b0 100644 --- a/arch/powerpc/boot/dts/warp.dts +++ b/arch/powerpc/boot/dts/warp.dts @@ -132,40 +132,33 @@ [EMAIL PROTECTED],0 { compatible = "pika,fpga"; - reg = <2 0 2200>; + reg = <2 0 1000>; interrupts = <18 8>; interrupt-parent = <&UIC0>; }; + [EMAIL PROTECTED],4000 { + compatible = "pika,fpga-sd"; + reg = <2 4000 A00>; + }; + [EMAIL PROTECTED],0 { - compatible = "amd,s29gl512n", "cfi-flash"; + compatible = "amd,s29gl032a", "cfi-flash"; bank-width = <2>; - reg = <0 0 400>; + reg = <0 0 40>; #address-cells = <1>; #size-cells = <1>; - [EMAIL PROTECTED] { - label = "kernel"; - reg = <0 18>; - }; - [EMAIL PROTECTED] { - label = "root"; - reg = <18 348>; - }; - [EMAIL PROTECTED] { - label = "user"; - reg = <360 90>; - }; - [EMAIL PROTECTED] { + [EMAIL PROTECTED] { label = "fpga"; - reg = <3f0 4>; + reg = <30 4>; }; - [EMAIL PROTECTED] { + [EMAIL PROTECTED] { label = "env"; - reg = <3f4 4>; + reg = <34 4>; }; - [EMAIL PROTECTED] { + [EMAIL PROTECTED] { label = "u-boot"; -
Warp patches for 2.6.26
I was going to hold off until the warp was officially released, but we might miss the merge window. So here they are. A lot of work has been done since 2.6.25 and I haven't been submitting patches to keep down on the churn. We standardized on a 4M NOR flash and a 256M NAND flash. But there is still support for the original Rev A boards which where 64M NOR and 64M NAND. You will see fixups for the Rev A. The Rev A is considered obsolete and the fixups are only there for me to use good ol' Tigger. ftp://ftp.seanm.ca/stuff/tigger.jpg Here is the full list of files that need to be patched for a warp, basically git diff --name-only origin/for-2.6.26: arch/powerpc/boot/cuboot-warp.c arch/powerpc/boot/dts/warp.dts arch/powerpc/configs/warp_defconfig arch/powerpc/platforms/44x/warp-nand.c arch/powerpc/platforms/44x/warp.c drivers/hwmon/Kconfig drivers/hwmon/Makefile drivers/hwmon/ad7414.c drivers/i2c/busses/Kconfig drivers/i2c/busses/i2c-ibm_iic.c drivers/leds/Kconfig drivers/leds/Makefile drivers/leds/leds-warp.c drivers/mmc/core/sd.c drivers/mmc/host/Kconfig drivers/mmc/host/Makefile drivers/mmc/host/pikasd.c drivers/mtd/nand/Kconfig drivers/mtd/nand/ndfc.c drivers/net/ibm_newemac/mal.c drivers/net/ibm_newemac/zmii.c drivers/scsi/Kconfig drivers/watchdog/Kconfig drivers/watchdog/Makefile drivers/watchdog/pika_wdt.c include/linux/mmc/host.h include/linux/pika.h I will not include patches for all of them since many haven't changed and/or are waiting for submission to the kernel. So I have broken it up into five patches. I will submit any other patches people are interested in. Cheers, Sean ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] tg3: fix MMIO for PPC 44x platforms
The driver stores the PCI resource addresses into 'unsigned long' variable before calling ioremap_nocache() on them. This warrants kernel oops when the registers are accessed on PPC 44x platforms which (being 32-bit) have PCI memory space mapped beyond 4 GB. The arch/ppc/ kernel has a fixup in ioremap() that creates an illusion that the PCI memory resource is mapped below 4 GB, but arch/powerpc/ code got rid of this trick, having instead CONFIG_RESOURCES_64BIT enabled. Signed-off-by: Sergei Shtylyov <[EMAIL PROTECTED]> --- Reposting the patch with the log and summary corrected. This is the same issue as the one that has been recently addressed by commits 3c34ac36ac1084e571ef9b6fb1d6a5b10ccc1fd0 (e1000: Fix for 32 bits platforms with 64 bits resources) and c976816b6e901341ec3c4653147316c15549a1c4 (siimage: fix kernel oops on PPC 44x). The patch has only been compile tested though... drivers/net/tg3.c |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: linux-2.6/drivers/net/tg3.c === --- linux-2.6.orig/drivers/net/tg3.c +++ linux-2.6/drivers/net/tg3.c @@ -12578,7 +12578,8 @@ static int __devinit tg3_init_one(struct const struct pci_device_id *ent) { static int tg3_version_printed = 0; - unsigned long tg3reg_base, tg3reg_len; + resource_size_t tg3reg_base; + unsigned long tg3reg_len; struct net_device *dev; struct tg3 *tp; int err, pm_cap; ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] natsemi: fix MMIO for PPC 44x platforms
The driver stores the PCI resource address into 'unsigned long' variable before calling ioremap() on it. This warrants a kernel oops when the registers are accessed on PPC 44x platforms which (being 32-bit) have PCI memory space mapped beyond 4 GB. The arch/ppc/ kernel has a fixup in ioremap() that creates an illusion of the PCI memory resources are mapped below 4 GB, but arch/powerpc/ code got rid of this trick, having instead CONFIG_RESOURCES_64BIT enabled. Signed-off-by: Sergei Shtylyov <[EMAIL PROTECTED]> --- Reposting the patch with the typecast, log, and summary corrected. This is the same issue as the one that has been recently addressed by commits 3c34ac36ac1084e571ef9b6fb1d6a5b10ccc1fd0 (e1000: Fix for 32 bits platforms with 64 bits resources) and c976816b6e901341ec3c4653147316c15549a1c4 (siimage: fix kernel oops on PPC 44x). The patch has only been compile tested though... drivers/net/natsemi.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) Index: linux-2.6/drivers/net/natsemi.c === --- linux-2.6.orig/drivers/net/natsemi.c +++ linux-2.6/drivers/net/natsemi.c @@ -786,7 +786,8 @@ static int __devinit natsemi_probe1 (str struct netdev_private *np; int i, option, irq, chip_idx = ent->driver_data; static int find_cnt = -1; - unsigned long iostart, iosize; + resource_size_t iostart; + unsigned long iosize; void __iomem *ioaddr; const int pcibar = 1; /* PCI base address register */ int prev_eedata; @@ -946,10 +947,11 @@ static int __devinit natsemi_probe1 (str goto err_create_file; if (netif_msg_drv(np)) { - printk(KERN_INFO "natsemi %s: %s at %#08lx " + printk(KERN_INFO "natsemi %s: %s at %#08llx " "(%s), %s, IRQ %d", - dev->name, natsemi_pci_info[chip_idx].name, iostart, - pci_name(np->pci_dev), print_mac(mac, dev->dev_addr), irq); + dev->name, natsemi_pci_info[chip_idx].name, + (unsigned long long)iostart, pci_name(np->pci_dev), + print_mac(mac, dev->dev_addr), irq); if (dev->if_port == PORT_TP) printk(", port TP.\n"); else if (np->ignore_phy) ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [LMB][1/2] Fix some whitespace and other formatting issues, use pr_debug
On Sat, Apr 12, 2008 at 03:20:59PM +1000, Paul Mackerras wrote: > + pr_debug("\nreserved.cnt = 0x%lx\n", lmb.reserved.cnt); This will only output an empty line at KERN_DEBUG level and the rest will be at default_message_loglevel. Problem is fixed my my patch in msg <[EMAIL PROTECTED]> However, is a blank line in the log necessary? Nick. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Flash on LocalBus @ MPC8343
Scott, thanks , but ... can't find "of_bus_ids[]" entry. I'm obviously out of sync. My last git-pull from denx is 3 days old, now - need to update on monday. It seems hard for "normal" people to keep up these days ! Cheers, André Scott Wood wrote: André Schwarz wrote: Scott, thanks for your help ... but Scott Wood wrote: On Fri, Apr 11, 2008 at 05:13:47PM +0200, Andre Schwarz wrote: To me it looks like there's a problem regarding the local bus in general. Am I missing a "compatible" or anything else ? "reg" or "ranges" ? Do you have an of_bus_ids[] entry that covers the localbus? what's this ? Where do I need to define this ? In dts or platform code ? Platform code. Can you give an example ? mpc8313erdb. simple-bus is listed as a compatible for the localbus in the dts, and it is listed of_bus_ids[] in the platform file. -Scott MATRIX VISION GmbH, Talstra�e 16, DE-71570 Oppenweiler - Registergericht: Amtsgericht Stuttgart, HRB 271090 Gesch�ftsf�hrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] ehea: Fix DLPAR memory add support
Thomas Klein wrote: This patch fixes two weaknesses in send/receive packet handling which may lead to kernel panics during DLPAR memory add operations. Signed-off-by: Thomas Klein <[EMAIL PROTECTED]> applied ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] natsemi: fix for PPC 44x platforms
Sergei Shtylyov wrote: The driver stores the the PCI resource address into 'unsigned long' variable before calling ioremap() on it. This warrants kernel oops when the registers are accessed on PPC 44x platforms which (being 32-bit) have PCI memory space mapped beyond 4 GB. The arch/ppc/ kernel has a fixup in ioremap() that creates an illusion of the PCI I/O and memory resources are mapped below 4 GB, but arch/powerpc/ code got rid of this trick, having instead CONFIG_RESOURCES_64BIT enabled. Signed-off-by: Sergei Shtylyov <[EMAIL PROTECTED]> --- This is the same issue as the one that has been recently addressed by commits 3c34ac36ac1084e571ef9b6fb1d6a5b10ccc1fd0 (e1000: Fix for 32 bits platforms with 64 bits resources) and c976816b6e901341ec3c4653147316c15549a1c4 (siimage: fix kernel oops on PPC 44x). The patch has only been compile tested though... drivers/net/natsemi.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) Index: linux-2.6/drivers/net/natsemi.c === --- linux-2.6.orig/drivers/net/natsemi.c +++ linux-2.6/drivers/net/natsemi.c @@ -786,7 +786,8 @@ static int __devinit natsemi_probe1 (str struct netdev_private *np; int i, option, irq, chip_idx = ent->driver_data; static int find_cnt = -1; - unsigned long iostart, iosize; + resource_size_t iostart; + unsigned long iosize; void __iomem *ioaddr; const int pcibar = 1; /* PCI base address register */ int prev_eedata; @@ -946,9 +947,9 @@ static int __devinit natsemi_probe1 (str goto err_create_file; if (netif_msg_drv(np)) { - printk(KERN_INFO "natsemi %s: %s at %#08lx " + printk(KERN_INFO "natsemi %s: %s at %#08llx " "(%s), %s, IRQ %d", - dev->name, natsemi_pci_info[chip_idx].name, iostart, + dev->name, natsemi_pci_info[chip_idx].name, (u64)iostart, pci_name(np->pci_dev), print_mac(mac, dev->dev_addr), irq); if (dev->if_port == PORT_TP) ACK, with the cast fixed (to long long) ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev