Re: hvc_iseries not working
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] USB_DR host support for FSL MPC831x
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
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
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
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
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] remove awacs dmasound
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
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 linux/list.h - -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_USERLAND 55
Re: [PATCH] remove awacs dmasound
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
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 2/3] 82xx: Parse SMC serial device node in DTS
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
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
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
+ #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 they shouldn't, and this is such a laughable idea I wonder why anyone would suggest it did). What the interrupt mapping
[PATCH] Add StorCenter DTS first draft.
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 = d# 2; /* Hz */ + timebase-frequency = d# ; /* 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 = ff80 0080; + 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 = fdf03000 1000; + interrupts = 5 2; + interrupt-parent = mpic; + }; + + [EMAIL PROTECTED] { + device_type = serial; + compatible = ns16550; + reg = fdf04500 8; + clock-frequency = d# 1; /* Hz */ + current-speed = d# 115200; + interrupts = 9 2; + interrupt-parent = mpic; + }; + + [EMAIL PROTECTED] { + device_type = serial; + compatible = ns16550; + reg = fdf04600 8; + clock-frequency = d# 1; /* Hz */ + current-speed = d# 19200; + interrupts = a 2; + interrupt-parent = mpic; + }; + + mpic: [EMAIL PROTECTED] { + #interrupt-cells = 2; + #address-cells = 0; + device_type = open-pic; + compatible = chrp,open-pic; + interrupt-controller; + reg = fdf4 4; + built-in; + }; + +
Re: [RFC][PATCH 6/8] Walnut DTS
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
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
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 2/3] 82xx: Parse SMC serial device node in DTS
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
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 linux/mm.h #include linux/ethtool.h #include linux/proc_fs.h +#include linux/in.h +#include linux/ip.h #include asm/semaphore.h #include asm/hvcall.h #include asm/atomic.h @@ -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
[PATCH 3/4] ibmveth: Add ethtool TSO handlers
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.
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
Re: [PATCH] Change the pci express controller node name from pci to pcie
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
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.
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
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
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
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] Allow exec on 32-bit from readable, non-exec pages, with a warning.
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
+ 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
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] Add StorCenter DTS first draft.
+ [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
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
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
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
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
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
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
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
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
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 06/14] 40x decrementer fixes
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
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 linux/init.h +#include asm/machdep.h +#include asm/prom.h +#include asm/udbg.h +#include asm/time.h +#include asm/uic.h +#include asm/of_platform.h + +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 12/14] Bamboo DTS
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 = /*TXEOB*/ 0 UIC0 a 4 + /*RXEOB*/ 1 UIC0 b 4 + /*SERR*/ 2 UIC1 0 4 + /*TXDE*/ 3 UIC1 1 4 + /*RXDE*/ 4 UIC1 3 4; + }; + + 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; + }; + +
[patch 08/14] Walnut DTS
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 = bebc200; /* 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 = a 4 b 4 c 4 d 4 e 4; + }; + + 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 = ef600300; + 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 = ef600400; + 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-parent = UIC0; + interrupts = 9 4 f 4; + reg
[patch 13/14] Bamboo board support
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_API=y + +# +#
[patch 04/14] 4xx bootwrapper reworks
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 stddef.h +#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 unsigned long sdram_bxcr[] #define DCRN_CPC0_MIRQ1
[patch 11/14] Walnut zImage wrapper
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
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 options are
Re: [PATCH] POWERPC: Added RTC support for mpc8313RDB and utilize clock-frequency
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
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 linux/init.h +#include linux/pm.h +#include asm/io.h +#include asm/time.h +#include asm/mpc52xx.h +#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
Re: [PATCH v2] Allow exec on 32-bit from readable, non-exec pages, with a warning.
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
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
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 stdlib.h #include stdio.h #include sys/types.h #include sys/ipc.h #include sys/shm.h #include sys/mman.h #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 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [RFC][PATCH 6/8] Walnut DTS
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 fact that the absence of #address-cells will give a different default for the
Re: [PATCH 01/10] IB/ehca: Support for multiple event queues
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.
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.
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()
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 linux/i2c.h +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.
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.
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
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.
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 = d# 1; /* 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.
Top Posting Carnac A: They haven't been posted yet. Q: How do we know Segher has new patches? /Top Posting Carnac 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.
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
- add-missing-data_data-in-powerpc.patch removed from -mm tree
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: linuxppc-dev@ozlabs.org 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 02/61] mpc8272ads.dts: Whitespace cleanup
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 = f820 f824; - 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 = f820 f824; + 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 = f000 1; - - [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 = f000 1; + + [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; - bitbang = [ 12 12 13 02 02 01 ]; - reg = 3; -
[PATCH 03/61] Only include linux/ide.h if CONFIG_BLOCK is defined.
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 linux/irq.h #include linux/pci.h #include linux/delay.h +#ifdef CONFIG_BLOCK #include linux/ide.h +#endif #include linux/bitops.h #include asm/page.h 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 linux/reboot.h #include linux/delay.h #include linux/initrd.h -#include linux/ide.h #include linux/tty.h #include linux/bootmem.h #include linux/seq_file.h @@ -51,7 +50,10 @@ extern void bootx_init(unsigned long r4, unsigned long phys); +#ifdef COFNIG_BLOCK +#include linux/ide.h 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.
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.*
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.
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.
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
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().
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 *finddevice(const char *name) {
[PATCH 10/61] bootwrapper: flatdevtree fixes
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.
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 13/61] bootwrapper: Search the entire compatible list for serial devices.
The serial code previously did a simple strcmp on the compatible node; this fails when the match string is not the first compatible listed. Use dt_is_compatible() instead. Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/boot/serial.c |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c index eaa0d3a..c551bac 100644 --- a/arch/powerpc/boot/serial.c +++ b/arch/powerpc/boot/serial.c @@ -114,18 +114,14 @@ int serial_console_init(void) { void *devp; int rc = -1; - char compat[MAX_PROP_LEN]; devp = serial_get_stdout_devp(); if (devp == NULL) goto err_out; - if (getprop(devp, compatible, compat, sizeof(compat)) 0) - goto err_out; - - if (!strcmp(compat, ns16550)) + if (dt_is_compatible(devp, ns16550)) rc = ns16550_console_init(devp, serial_cd); - else if (!strcmp(compat, marvell,mpsc)) + else if (dt_is_compatible(devp, marvell,mpsc)) rc = mpsc_console_init(devp, serial_cd); /* Add other serial console driver calls here */ -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 15/61] Declare udelay() in ops.h, and remove declarations in various users.
Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/boot/mpsc.c|1 - arch/powerpc/boot/mv64x60_i2c.c |2 -- arch/powerpc/boot/ops.h |2 ++ arch/powerpc/boot/prpmc2800.c |2 -- arch/powerpc/boot/serial.c |2 -- 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/boot/mpsc.c b/arch/powerpc/boot/mpsc.c index f1c0e96..802ea53 100644 --- a/arch/powerpc/boot/mpsc.c +++ b/arch/powerpc/boot/mpsc.c @@ -17,7 +17,6 @@ #include io.h #include ops.h -extern void udelay(long delay); #define MPSC_CHR_1 0x000c diff --git a/arch/powerpc/boot/mv64x60_i2c.c b/arch/powerpc/boot/mv64x60_i2c.c index 435fe85..d085377 100644 --- a/arch/powerpc/boot/mv64x60_i2c.c +++ b/arch/powerpc/boot/mv64x60_i2c.c @@ -21,8 +21,6 @@ #include ops.h #include mv64x60.h -extern void udelay(long); - /* Register defines */ #define MV64x60_I2C_REG_SLAVE_ADDR 0x00 #define MV64x60_I2C_REG_DATA 0x04 diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h index 9a88a80..c48e8ed 100644 --- a/arch/powerpc/boot/ops.h +++ b/arch/powerpc/boot/ops.h @@ -192,4 +192,6 @@ static inline void exit(void) static char _bss_stack[size]; \ void *_platform_stack_top = _bss_stack + sizeof(_bss_stack); +void udelay(long delay); + #endif /* _PPC_BOOT_OPS_H_ */ diff --git a/arch/powerpc/boot/prpmc2800.c b/arch/powerpc/boot/prpmc2800.c index f428bac..5c6cd36 100644 --- a/arch/powerpc/boot/prpmc2800.c +++ b/arch/powerpc/boot/prpmc2800.c @@ -25,8 +25,6 @@ extern char _end[]; extern char _vmlinux_start[], _vmlinux_end[]; extern char _dtb_start[], _dtb_end[]; -extern void udelay(long delay); - #define KB 1024U #define MB (KB*KB) #define GB (KB*MB) diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c index 1c27110..441151f 100644 --- a/arch/powerpc/boot/serial.c +++ b/arch/powerpc/boot/serial.c @@ -19,8 +19,6 @@ #include io.h #include ops.h -extern void udelay(long delay); - static int serial_open(void) { struct serial_console_data *scdp = console_ops.data; -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 16/61] bootwrapper: Add CPM serial driver.
Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/boot/Makefile |3 +- arch/powerpc/boot/cpm-serial.c | 247 arch/powerpc/boot/ops.h|1 + arch/powerpc/boot/serial.c |2 + 4 files changed, 252 insertions(+), 1 deletions(-) create mode 100644 arch/powerpc/boot/cpm-serial.c diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 61a6f34..997980f 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -44,7 +44,8 @@ $(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \ 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 \ - 44x.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c + 44x.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c \ + cpm-serial.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 diff --git a/arch/powerpc/boot/cpm-serial.c b/arch/powerpc/boot/cpm-serial.c new file mode 100644 index 000..2794d1c --- /dev/null +++ b/arch/powerpc/boot/cpm-serial.c @@ -0,0 +1,247 @@ +/* + * CPM serial console support. + * + * Copyright 2007 Freescale Semiconductor, Inc. + * Author: Scott Wood [EMAIL PROTECTED] + * + * It is assumed that the firmware (or the platform file) has already set + * up the port. + */ + +#include types.h +#include io.h +#include ops.h + +struct cpm_scc { + u32 gsmrl; + u32 gsmrh; + u16 psmr; + u8 res1[2]; + u16 todr; + u16 dsr; + u16 scce; + u8 res2[2]; + u16 sccm; + u8 res3; + u8 sccs; + u8 res4[8]; +}; + +struct cpm_smc { + u8 res1[2]; + u16 smcmr; + u8 res2[2]; + u8 smce; + u8 res3[3]; + u8 smcm; + u8 res4[5]; +}; + +struct cpm_param { + u16 rbase; + u16 tbase; + u8 rfcr; + u8 tfcr; +}; + +struct cpm_bd { + u16 sc; /* Status and Control */ + u16 len; /* Data length in buffer */ + u8 *addr; /* Buffer address in host memory */ +}; + +static void *cpcr; +static struct cpm_param *param; +static struct cpm_smc *smc; +static struct cpm_scc *scc; +struct cpm_bd *tbdf, *rbdf; +static u32 cpm_cmd; +static u8 *dpram_start; +int is_cpm2; + +void cpm1_cmd(int op) +{ + while (in_be16(cpcr) 1) + ; + + out_be16(cpcr, (op 8) | cpm_cmd | 1); + + while (in_be16(cpcr) 1) + ; +} + +void cpm2_cmd(int op) +{ + while (in_be32(cpcr) 0x1) + ; + + out_be32(cpcr, op | cpm_cmd | 0x1); + + while (in_be32(cpcr) 0x1) + ; +} + +void do_cmd(int op) +{ + if (is_cpm2) + cpm2_cmd(op); + else + cpm1_cmd(op); +} + +void disable_port(void) +{ + do_cmd(4); /* STOP TX */ + + if (smc) + out_be16(smc-smcmr, in_be16(smc-smcmr) ~3); + else + out_be32(scc-gsmrl, in_be32(scc-gsmrl) ~0x30); +} + +void enable_port(void) +{ + if (smc) + out_be16(smc-smcmr, in_be16(smc-smcmr) | 3); + else + out_be32(scc-gsmrl, in_be32(scc-gsmrl) | 0x30); + + do_cmd(6); /* RESTART TX */ +} + +static int serial_open(void) +{ + int dpaddr = 0x800; + disable_port(); + + out_8(param-rfcr, 0x10); + out_8(param-tfcr, 0x10); + + rbdf = (struct cpm_bd *)(dpram_start + dpaddr); + rbdf-addr = (u8 *)(rbdf + 2); + rbdf-sc = 0xa000; + rbdf-len = 1; + + tbdf = rbdf + 1; + tbdf-addr = (u8 *)(rbdf + 2) + 1; + tbdf-sc = 0x2000; + tbdf-len = 1; + + asm volatile(sync : : : memory); + out_be16(param-rbase, dpaddr); + out_be16(param-tbase, dpaddr + sizeof(struct cpm_bd)); + + do_cmd(0); /* INIT RX AND TX PARAMS */ + + enable_port(); + return 0; +} + +void serial_close(void) +{ + /* Disable RX, but leave TX on for early console output. */ + + if (smc) + out_be16(smc-smcmr, in_be16(smc-smcmr) ~1); + else + out_be32(scc-gsmrl, in_be32(scc-gsmrl) ~0x20); +} + +void serial_putc(unsigned char c) +{ + while (tbdf-sc 0x8000) + asm volatile( : : : memory); + + asm volatile(sync : : : memory); + + tbdf-addr[0] = c; + asm volatile(eieio : : : memory); + tbdf-sc |= 0x8000; +} + +unsigned char serial_tstc(void) +{ + asm volatile( : : : memory); + return !(rbdf-sc 0x8000); +} + +unsigned char serial_getc(void) +{ + unsigned char c; + + while (!serial_tstc()) + ; + + asm volatile(sync : : : memory); + c = rbdf-addr[0]; + asm volatile(eieio : : : memory); + rbdf-sc |= 0x8000; + +
[PATCH 17/61] bootwrapper: Add 8xx support.
Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/boot/Makefile |3 +- arch/powerpc/boot/cuboot-8xx.c | 47 arch/powerpc/platforms/Kconfig.cputype |1 + 3 files changed, 50 insertions(+), 1 deletions(-) create mode 100644 arch/powerpc/boot/cuboot-8xx.c diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 997980f..e75c92b 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -48,7 +48,7 @@ src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ cpm-serial.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 cuboot-8xx.c src-boot := $(src-wlib) $(src-plat) empty.c src-boot := $(addprefix $(obj)/, $(src-boot)) @@ -140,6 +140,7 @@ image-$(CONFIG_PPC_ISERIES) += zImage.iseries image-$(CONFIG_DEFAULT_UIMAGE) += uImage ifneq ($(CONFIG_DEVICE_TREE),) +image-$(CONFIG_PPC_8xx)+= cuImage.8xx image-$(CONFIG_PPC_83xx) += cuImage.83xx image-$(CONFIG_PPC_85xx) += cuImage.85xx image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony diff --git a/arch/powerpc/boot/cuboot-8xx.c b/arch/powerpc/boot/cuboot-8xx.c new file mode 100644 index 000..35476a0 --- /dev/null +++ b/arch/powerpc/boot/cuboot-8xx.c @@ -0,0 +1,47 @@ +/* + * Old U-boot compatibility for 8xx + * + * Author: Scott Wood [EMAIL PROTECTED] + * + * Copyright (c) 2007 Freescale Semiconductor, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include ops.h +#include stdio.h +#include cuboot.h + +#define TARGET_8xx +#define TARGET_HAS_ETH1 +#include ppcboot.h + +static bd_t bd; +extern char _end[]; +extern char _dtb_start[], _dtb_end[]; + +static void platform_fixups(void) +{ + void *node; + + dt_fixup_memory(bd.bi_memstart, bd.bi_memsize); + dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr); + dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 16, bd.bi_busfreq); + + node = finddevice(/soc/cpm); + if (node) { + setprop(node, clock-frequency, bd.bi_busfreq, 4); + setprop(node, fsl,brg-frequency, bd.bi_busfreq, 4); + } +} + +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, + unsigned long r6, unsigned long r7) +{ + CUBOOT_INIT(); + ft_init(_dtb_start, _dtb_end - _dtb_start, 32); + serial_console_init(); + platform_ops.fixups = platform_fixups; +} diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index b8b5fde..0e865b8 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype @@ -36,6 +36,7 @@ config PPC_8xx bool Freescale 8xx select FSL_SOC select 8xx + select WANT_DEVICE_TREE config 40x bool AMCC 40x -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 18/61] bootwrapper: Add PowerQUICC II (82xx with CPM) support
Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/boot/Makefile |3 +- arch/powerpc/boot/cuboot-pq2.c | 217 arch/powerpc/platforms/Kconfig |1 + 3 files changed, 220 insertions(+), 1 deletions(-) create mode 100644 arch/powerpc/boot/cuboot-pq2.c diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index e75c92b..4ab5f75 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -48,7 +48,7 @@ src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ cpm-serial.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 cuboot-8xx.c + ps3-head.S ps3-hvcall.S ps3.c cuboot-8xx.c cuboot-pq2.c src-boot := $(src-wlib) $(src-plat) empty.c src-boot := $(addprefix $(obj)/, $(src-boot)) @@ -141,6 +141,7 @@ image-$(CONFIG_DEFAULT_UIMAGE) += uImage ifneq ($(CONFIG_DEVICE_TREE),) image-$(CONFIG_PPC_8xx)+= cuImage.8xx +image-$(CONFIG_8260) += cuImage.pq2 image-$(CONFIG_PPC_83xx) += cuImage.83xx image-$(CONFIG_PPC_85xx) += cuImage.85xx image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony diff --git a/arch/powerpc/boot/cuboot-pq2.c b/arch/powerpc/boot/cuboot-pq2.c new file mode 100644 index 000..74f793b --- /dev/null +++ b/arch/powerpc/boot/cuboot-pq2.c @@ -0,0 +1,217 @@ +/* + * Old U-boot compatibility for PowerQUICC II + * (a.k.a. 82xx with CPM, not the 8240 family of chips) + * + * Author: Scott Wood [EMAIL PROTECTED] + * + * Copyright (c) 2007 Freescale Semiconductor, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include ops.h +#include stdio.h +#include cuboot.h +#include io.h + +#define TARGET_CPM2 +#define TARGET_HAS_ETH1 +#include ppcboot.h + +static bd_t bd; +extern char _end[]; +extern char _dtb_start[], _dtb_end[]; + +struct cs_range { + u32 csnum; + u32 base; /* must be zero */ + u32 addr; + u32 size; +}; + +struct pci_range { + u32 flags; + u32 pci_addr[2]; + u32 phys_addr; + u32 size[2]; +}; + +struct cs_range cs_ranges_buf[MAX_PROP_LEN / sizeof(struct cs_range)]; +struct pci_range pci_ranges_buf[MAX_PROP_LEN / sizeof(struct pci_range)]; + +/* Different versions of u-boot put the BCSR in different places, + * so we check the BRx registers and update the ranges property + * appropriately. + * + * #address/#size must be 2/1 for chipselect bus, 1/1 for parent bus. + * Ranges must be for whole chip selects. */ +static void update_cs_ranges(void) +{ + u32 ctrl_ph; + void *ctrl_node, *bus_node; + u32 *ctrl_addr; + unsigned long ctrl_size; + int len; + int i; + + bus_node = finddevice(/chipselect); + if (!bus_node || !dt_is_compatible(bus_node, fsl,pq2-chipselect)) + return; + + len = getprop(bus_node, fsl,ctrl, ctrl_ph, 4); + if (len != 4) + return; + + ctrl_node = find_node_by_prop_value(NULL, linux,phandle, + (char *)ctrl_ph, 4); + if (!ctrl_node) + return; + + if (!dt_is_compatible(ctrl_node, fsl,pq2-chipselect-ctrl)) + return; + + if (!dt_xlate_reg(ctrl_node, 0, (unsigned long *)ctrl_addr, + ctrl_size)) + return; + + len = getprop(bus_node, ranges, cs_ranges_buf, sizeof(cs_ranges_buf)); + + for (i = 0; i len / sizeof(struct cs_range); i++) { + u32 base, option; + int cs = cs_ranges_buf[i].csnum; + if (cs = ctrl_size / 8) + continue; + + base = in_be32(ctrl_addr[cs * 2]); + + /* If CS is already valid, use the existing flags. +* Otherwise, guess a sane default. +*/ + if (base 1) { + base = 0x7fff; + option = in_be32(ctrl_addr[cs * 2 + 1]); + } else { + base = 0x1801; + option = 0x10; + } + + out_be32(ctrl_addr[cs * 2], 0); + out_be32(ctrl_addr[cs * 2 + 1], +option | ~(cs_ranges_buf[i].size - 1)); + out_be32(ctrl_addr[cs * 2], base | cs_ranges_buf[i].addr); + } +} + +/* Older u-boots don't set PCI up properly. Update the hardware + * to match the device tree. The prefetch mem region and non-prefetch + * mem region must be contiguous in the host bus. PCI #addr/#size must + * be 3/2. Parent #address-cells must be 1. All addresses and sizes + * must fit in 32 bits. + */ +static void
[PATCH 21/61] Minor whitespace (space-tab) fixup in irq.c.
Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/kernel/irq.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 2fc8786..cb1b6c0 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -272,7 +272,7 @@ void do_IRQ(struct pt_regs *regs) struct thread_info *curtp, *irqtp; #endif -irq_enter(); + irq_enter(); #ifdef CONFIG_DEBUG_STACKOVERFLOW /* Debugging check for stack overflow: is there less than 2KB free? */ @@ -321,7 +321,7 @@ void do_IRQ(struct pt_regs *regs) /* That's not SMP safe ... but who cares ? */ ppc_spurious_interrupts++; -irq_exit(); + irq_exit(); set_irq_regs(old_regs); #ifdef CONFIG_PPC_ISERIES -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 23/61] Rename mpc82xx_ads_show_cpuinfo to m82xx_show_cpuinfo.
Vendor and machine are removed; any such information should go in ppc_md.name. Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/platforms/82xx/mpc8272ads.c |4 ++-- arch/powerpc/platforms/82xx/mpc82xx.c|4 +--- arch/powerpc/platforms/82xx/pq2ads.h |2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/82xx/mpc8272ads.c b/arch/powerpc/platforms/82xx/mpc8272ads.c index da20832..1945522 100644 --- a/arch/powerpc/platforms/82xx/mpc8272ads.c +++ b/arch/powerpc/platforms/82xx/mpc8272ads.c @@ -629,11 +629,11 @@ static void m82xx_halt(void) define_machine(mpc82xx_ads) { - .name = MPC82xx ADS, + .name = Freescale MPC8272ADS, .probe = mpc82xx_ads_probe, .setup_arch =mpc82xx_ads_setup_arch, .init_IRQ =mpc82xx_ads_pic_init, - .show_cpuinfo =mpc82xx_ads_show_cpuinfo, + .show_cpuinfo =m82xx_show_cpuinfo, .get_irq =cpm2_get_irq, .calibrate_decr =m82xx_calibrate_decr, .restart = m82xx_restart,.halt = m82xx_halt, diff --git a/arch/powerpc/platforms/82xx/mpc82xx.c b/arch/powerpc/platforms/82xx/mpc82xx.c index cc9900d..a2a9c8d 100644 --- a/arch/powerpc/platforms/82xx/mpc82xx.c +++ b/arch/powerpc/platforms/82xx/mpc82xx.c @@ -88,7 +88,7 @@ void __init m82xx_calibrate_decr(void) (not found)\n); } -void mpc82xx_ads_show_cpuinfo(struct seq_file *m) +void m82xx_show_cpuinfo(struct seq_file *m) { uint pvid, svid, phid1; uint memsize = total_memory; @@ -96,8 +96,6 @@ void mpc82xx_ads_show_cpuinfo(struct seq_file *m) pvid = mfspr(SPRN_PVR); svid = mfspr(SPRN_SVR); - seq_printf(m, Vendor\t\t: Freescale Semiconductor\n); - seq_printf(m, Machine\t\t: %s\n, CPUINFO_MACHINE); seq_printf(m, PVR\t\t: 0x%x\n, pvid); seq_printf(m, SVR\t\t: 0x%x\n, svid); diff --git a/arch/powerpc/platforms/82xx/pq2ads.h b/arch/powerpc/platforms/82xx/pq2ads.h index 5b5cca6..4802292 100644 --- a/arch/powerpc/platforms/82xx/pq2ads.h +++ b/arch/powerpc/platforms/82xx/pq2ads.h @@ -59,7 +59,7 @@ #define SIU_INT_SCC4 ((uint)0x2b+CPM_IRQ_OFFSET) void m82xx_pci_init_irq(void); -void mpc82xx_ads_show_cpuinfo(struct seq_file*); +void m82xx_show_cpuinfo(struct seq_file *); void m82xx_calibrate_decr(void); #endif /* __MACH_ADS8260_DEFS */ -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 25/61] Fix off-by-one error in CPM2 setbrg().
The hardware adds one to the BRG value to get the divider, so it must be subtracted by software. Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/sysdev/cpm2_common.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c index 9244129..daf7497 100644 --- a/arch/powerpc/sysdev/cpm2_common.c +++ b/arch/powerpc/sysdev/cpm2_common.c @@ -102,7 +102,7 @@ cpm_setbrg(uint brg, uint rate) brg -= 4; } bp += brg; - *bp = ((BRG_UART_CLK / rate) 1) | CPM_BRG_EN; + *bp = (((BRG_UART_CLK / rate) - 1) 1) | CPM_BRG_EN; cpm2_unmap(bp); } -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 22/61] Rename mpc82xx_ads to mpc8272ads.
Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/platforms/82xx/Kconfig |6 +- arch/powerpc/platforms/82xx/Makefile |2 +- arch/powerpc/platforms/82xx/mpc8272ads.c | 640 + arch/powerpc/platforms/82xx/mpc82xx_ads.c | 640 - 4 files changed, 644 insertions(+), 644 deletions(-) create mode 100644 arch/powerpc/platforms/82xx/mpc8272ads.c delete mode 100644 arch/powerpc/platforms/82xx/mpc82xx_ads.c diff --git a/arch/powerpc/platforms/82xx/Kconfig b/arch/powerpc/platforms/82xx/Kconfig index 89fde43..b4af8c2 100644 --- a/arch/powerpc/platforms/82xx/Kconfig +++ b/arch/powerpc/platforms/82xx/Kconfig @@ -1,10 +1,10 @@ choice prompt 82xx Board Type depends on PPC_82xx - default MPC82xx_ADS + default MPC8272ADS -config MPC82xx_ADS - bool Freescale MPC82xx ADS +config MPC8272ADS + bool Freescale MPC8272ADS select DEFAULT_UIMAGE select PQ2ADS select 8272 diff --git a/arch/powerpc/platforms/82xx/Makefile b/arch/powerpc/platforms/82xx/Makefile index d9fd4c8..881a3f6 100644 --- a/arch/powerpc/platforms/82xx/Makefile +++ b/arch/powerpc/platforms/82xx/Makefile @@ -2,4 +2,4 @@ # Makefile for the PowerPC 82xx linux kernel. # obj-$(CONFIG_PPC_82xx) += mpc82xx.o -obj-$(CONFIG_MPC82xx_ADS) += mpc82xx_ads.o +obj-$(CONFIG_MPC8272ADS) += mpc8272ads.o diff --git a/arch/powerpc/platforms/82xx/mpc8272ads.c b/arch/powerpc/platforms/82xx/mpc8272ads.c new file mode 100644 index 000..da20832 --- /dev/null +++ b/arch/powerpc/platforms/82xx/mpc8272ads.c @@ -0,0 +1,640 @@ +/* + * MPC82xx_ads setup and early boot code plus other random bits. + * + * Author: Vitaly Bordug [EMAIL PROTECTED] + * m82xx_restart fix by Wade Farnsworth [EMAIL PROTECTED] + * + * Copyright (c) 2006 MontaVista Software, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include linux/stddef.h +#include linux/kernel.h +#include linux/init.h +#include linux/errno.h +#include linux/reboot.h +#include linux/pci.h +#include linux/interrupt.h +#include linux/kdev_t.h +#include linux/major.h +#include linux/console.h +#include linux/delay.h +#include linux/seq_file.h +#include linux/root_dev.h +#include linux/initrd.h +#include linux/module.h +#include linux/fsl_devices.h +#include linux/fs_uart_pd.h + +#include asm/system.h +#include asm/pgtable.h +#include asm/page.h +#include asm/atomic.h +#include asm/time.h +#include asm/io.h +#include asm/machdep.h +#include asm/bootinfo.h +#include asm/pci-bridge.h +#include asm/mpc8260.h +#include asm/irq.h +#include mm/mmu_decl.h +#include asm/prom.h +#include asm/cpm2.h +#include asm/udbg.h +#include asm/i8259.h +#include linux/fs_enet_pd.h + +#include sysdev/fsl_soc.h +#include sysdev/cpm2_pic.h + +#include pq2ads.h + +#ifdef CONFIG_PCI +static uint pci_clk_frq; +static struct { + unsigned long *pci_int_stat_reg; + unsigned long *pci_int_mask_reg; +} pci_regs; + +static unsigned long pci_int_base; +static struct irq_host *pci_pic_host; +static struct device_node *pci_pic_node; +#endif + +static void __init mpc82xx_ads_pic_init(void) +{ + struct device_node *np = of_find_compatible_node(NULL, cpm-pic, CPM2); + struct resource r; + cpm2_map_t *cpm_reg; + + if (np == NULL) { + printk(KERN_ERR PIC init: can not find cpm-pic node\n); + return; + } + if (of_address_to_resource(np, 0, r)) { + printk(KERN_ERR PIC init: invalid resource\n); + of_node_put(np); + return; + } + cpm2_pic_init(np); + of_node_put(np); + + /* Initialize the default interrupt mapping priorities, +* in case the boot rom changed something on us. +*/ + cpm_reg = (cpm2_map_t *) ioremap(get_immrbase(), sizeof(cpm2_map_t)); + cpm_reg-im_intctl.ic_siprr = 0x05309770; + iounmap(cpm_reg); +#ifdef CONFIG_PCI + /* Initialize stuff for the 82xx CPLD IC and install demux */ + m82xx_pci_init_irq(); +#endif +} + +static void init_fcc1_ioports(struct fs_platform_info *fpi) +{ + struct io_port *io; + u32 tempval; + cpm2_map_t *immap = ioremap(get_immrbase(), sizeof(cpm2_map_t)); + struct device_node *np; + struct resource r; + u32 *bcsr; + + np = of_find_node_by_type(NULL, memory); + if (!np) { + printk(KERN_INFO No memory node in device tree\n); + return; + } + if (of_address_to_resource(np, 1, r)) { + printk(KERN_INFO No memory reg property [1] in devicetree\n); + return; + } + of_node_put(np); + bcsr = ioremap(r.start + 4, sizeof(u32)); + io = immap-im_ioport; +
[PATCH 26/61] cpm2: Add SCCs to cpm2_clk_setup().
Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/sysdev/cpm2_common.c | 42 1 files changed, 37 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c index daf7497..4e840bd 100644 --- a/arch/powerpc/sysdev/cpm2_common.c +++ b/arch/powerpc/sysdev/cpm2_common.c @@ -138,7 +138,7 @@ int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode) cpmux_t *im_cpmux; u32 *reg; u32 mask = 7; - u8 clk_map [24][3] = { + u8 clk_map[][3] = { {CPM_CLK_FCC1, CPM_BRG5, 0}, {CPM_CLK_FCC1, CPM_BRG6, 1}, {CPM_CLK_FCC1, CPM_BRG7, 2}, @@ -162,8 +162,40 @@ int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode) {CPM_CLK_FCC3, CPM_CLK13, 4}, {CPM_CLK_FCC3, CPM_CLK14, 5}, {CPM_CLK_FCC3, CPM_CLK15, 6}, - {CPM_CLK_FCC3, CPM_CLK16, 7} - }; + {CPM_CLK_FCC3, CPM_CLK16, 7}, + {CPM_CLK_SCC1, CPM_BRG1, 0}, + {CPM_CLK_SCC1, CPM_BRG2, 1}, + {CPM_CLK_SCC1, CPM_BRG3, 2}, + {CPM_CLK_SCC1, CPM_BRG4, 3}, + {CPM_CLK_SCC1, CPM_CLK11, 4}, + {CPM_CLK_SCC1, CPM_CLK12, 5}, + {CPM_CLK_SCC1, CPM_CLK3, 6}, + {CPM_CLK_SCC1, CPM_CLK4, 7}, + {CPM_CLK_SCC2, CPM_BRG1, 0}, + {CPM_CLK_SCC2, CPM_BRG2, 1}, + {CPM_CLK_SCC2, CPM_BRG3, 2}, + {CPM_CLK_SCC2, CPM_BRG4, 3}, + {CPM_CLK_SCC2, CPM_CLK11, 4}, + {CPM_CLK_SCC2, CPM_CLK12, 5}, + {CPM_CLK_SCC2, CPM_CLK3, 6}, + {CPM_CLK_SCC2, CPM_CLK4, 7}, + {CPM_CLK_SCC3, CPM_BRG1, 0}, + {CPM_CLK_SCC3, CPM_BRG2, 1}, + {CPM_CLK_SCC3, CPM_BRG3, 2}, + {CPM_CLK_SCC3, CPM_BRG4, 3}, + {CPM_CLK_SCC3, CPM_CLK5, 4}, + {CPM_CLK_SCC3, CPM_CLK6, 5}, + {CPM_CLK_SCC3, CPM_CLK7, 6}, + {CPM_CLK_SCC3, CPM_CLK8, 7}, + {CPM_CLK_SCC4, CPM_BRG1, 0}, + {CPM_CLK_SCC4, CPM_BRG2, 1}, + {CPM_CLK_SCC4, CPM_BRG3, 2}, + {CPM_CLK_SCC4, CPM_BRG4, 3}, + {CPM_CLK_SCC4, CPM_CLK5, 4}, + {CPM_CLK_SCC4, CPM_CLK6, 5}, + {CPM_CLK_SCC4, CPM_CLK7, 6}, + {CPM_CLK_SCC4, CPM_CLK8, 7}, + }; im_cpmux = cpm2_map(im_cpmux); @@ -203,13 +235,13 @@ int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode) if (mode == CPM_CLK_RX) shift +=3; - for (i=0; i24; i++) { + for (i = 0; i ARRAY_SIZE(clk_map); i++) { if (clk_map[i][0] == target clk_map[i][1] == clock) { bits = clk_map[i][2]; break; } } - if (i == sizeof(clk_map)/3) + if (i == ARRAY_SIZE(clk_map)) ret = -EINVAL; bits = shift; -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 27/61] cpm2: Fix whitespace in cpm2_clk_setup().
Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/sysdev/cpm2_common.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c index 4e840bd..7e3a983 100644 --- a/arch/powerpc/sysdev/cpm2_common.c +++ b/arch/powerpc/sysdev/cpm2_common.c @@ -233,7 +233,7 @@ int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode) } if (mode == CPM_CLK_RX) - shift +=3; + shift += 3; for (i = 0; i ARRAY_SIZE(clk_map); i++) { if (clk_map[i][0] == target clk_map[i][1] == clock) { -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 28/61] Add cpm2_set_pin().
This provides a generic way for board code to set up CPM pins, rather than directly poking magic values into registers. Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/sysdev/cpm2_common.c | 28 include/asm-ppc/cpm2.h|8 2 files changed, 36 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c index 7e3a983..0a62df7 100644 --- a/arch/powerpc/sysdev/cpm2_common.c +++ b/arch/powerpc/sysdev/cpm2_common.c @@ -338,3 +338,31 @@ void *cpm_dpram_addr(unsigned long offset) return (void *)(im_dprambase + offset); } EXPORT_SYMBOL(cpm_dpram_addr); + +struct cpm2_ioports { + u32 dir, par, sor, odr, dat; + u32 res[3]; +}; + +void cpm2_set_pin(int port, int pin, int flags) +{ + struct cpm2_ioports __iomem *iop = + (struct cpm_ioports __iomem *)cpm2_immr-im_ioport; + + pin = 1 (31 - pin); + + if (flags CPM_PIN_OUTPUT) + setbits32(iop[port].dir, pin); + else + clrbits32(iop[port].dir, pin); + + if (!(flags CPM_PIN_GPIO)) + setbits32(iop[port].par, pin); + else + clrbits32(iop[port].par, pin); + + if (flags CPM_PIN_SECONDARY) + setbits32(iop[port].sor, pin); + else + clrbits32(iop[port].sor, pin); +} diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h index 12a2860..0e7ffb6 100644 --- a/include/asm-ppc/cpm2.h +++ b/include/asm-ppc/cpm2.h @@ -1244,5 +1244,13 @@ enum cpm_clk { extern int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode); +#define CPM_PIN_INPUT 0 +#define CPM_PIN_OUTPUT1 +#define CPM_PIN_PRIMARY 0 +#define CPM_PIN_SECONDARY 2 +#define CPM_PIN_GPIO 4 + +void cpm2_set_pin(int port, int pin, int flags); + #endif /* __CPM2__ */ #endif /* __KERNEL__ */ -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 29/61] fsl_soc: Fix get_immrbase() to use ranges, rather than reg.
It is not always the case that the SoC's first reg property points to the beginning of the entire SoC block. Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/sysdev/fsl_soc.c | 15 --- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index c0ddc80..a837742 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c @@ -52,10 +52,19 @@ phys_addr_t get_immrbase(void) soc = of_find_node_by_type(NULL, soc); if (soc) { unsigned int size; - const void *prop = of_get_property(soc, reg, size); + u32 naddr; + const u32 *prop = of_get_property(soc, #address-cells, size); + + if (prop size == 4) + naddr = *prop; + else + naddr = 2; + + prop = of_get_property(soc, ranges, size); + + if (prop size = 12) + immrbase = of_translate_address(soc, prop + naddr); - if (prop) - immrbase = of_translate_address(soc, prop); of_node_put(soc); }; -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 30/61] fsl_soc: Update the way get_brgfreq() finds things in the device tree.
It now uses names that are less namespace polluting. Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/boot/dts/mpc8272ads.dts |5 ++--- arch/powerpc/boot/dts/mpc8560ads.dts |5 ++--- arch/powerpc/boot/dts/mpc866ads.dts |5 ++--- arch/powerpc/boot/dts/mpc885ads.dts |5 ++--- arch/powerpc/sysdev/fsl_soc.c| 10 +- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts index 4d09dca..16a77f4 100644 --- a/arch/powerpc/boot/dts/mpc8272ads.dts +++ b/arch/powerpc/boot/dts/mpc8272ads.dts @@ -119,12 +119,11 @@ #address-cells = 1; #size-cells = 1; #interrupt-cells = 2; - device_type = cpm; - model = CPM2; + compatible = fsl,mpc8272-cpm, fsl,cpm2, fsl,cpm; ranges = 2; reg = 0 2; command-proc = 119c0; - brg-frequency = 17D7840; + fsl,brg-frequency = d#2500; cpm_clk = BEBC200; [EMAIL PROTECTED] { diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts index 21ccaaa..1626587 100644 --- a/arch/powerpc/boot/dts/mpc8560ads.dts +++ b/arch/powerpc/boot/dts/mpc8560ads.dts @@ -235,12 +235,11 @@ #address-cells = 1; #size-cells = 1; #interrupt-cells = 2; - device_type = cpm; - model = CPM2; + compatible = fsl,mpc8560-cpm, fsl,cpm2, fsl,cpm; ranges = 0 0 c; reg = 8 4; command-proc = 919c0; - brg-frequency = 9d5b340; + fsl,brg-frequency = d#16500; cpmpic: [EMAIL PROTECTED] { interrupt-controller; diff --git a/arch/powerpc/boot/dts/mpc866ads.dts b/arch/powerpc/boot/dts/mpc866ads.dts index e5e7726..b3dbfe8 100644 --- a/arch/powerpc/boot/dts/mpc866ads.dts +++ b/arch/powerpc/boot/dts/mpc866ads.dts @@ -87,12 +87,11 @@ #address-cells = 1; #size-cells = 1; #interrupt-cells = 2; - device_type = cpm; - model = CPM; + compatible = fsl,mpc866-cpm, fsl,cpm1, fsl,cpm; ranges = 0 0 4000; reg = 860 f0; command-proc = 9c0; - brg-frequency = 0; + fsl,brg-frequency = 0; interrupts = 0 2; // cpm error interrupt interrupt-parent = Cpm_pic; diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts index dc7ab9c..8372469 100644 --- a/arch/powerpc/boot/dts/mpc885ads.dts +++ b/arch/powerpc/boot/dts/mpc885ads.dts @@ -118,12 +118,11 @@ #address-cells = 1; #size-cells = 1; #interrupt-cells = 2; - device_type = cpm; - model = CPM; + compatible = fsl,mpc885-cpm, fsl,cpm1, fsl,cpm; ranges = 0 0 4000; reg = 860 f0; command-proc = 9c0; - brg-frequency = 0; + fsl,brg-frequency = 0; interrupts = 0 2; // cpm error interrupt interrupt-parent = Cpm_pic; diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index a837742..ff70d62 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c @@ -84,16 +84,16 @@ u32 get_brgfreq(void) if (brgfreq != -1) return brgfreq; - node = of_find_node_by_type(NULL, cpm); + node = of_find_compatible_node(NULL, NULL, fsl,cpm); if (node) { unsigned int size; - const unsigned int *prop = of_get_property(node, - brg-frequency, size); + const unsigned int *prop = + of_get_property(node, fsl,brg-frequency, size); - if (prop) + if (prop size == 4) brgfreq = *prop; of_node_put(node); - }; + } return brgfreq; } -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 31/61] mpc8272ads: Check the board in the probe function.
Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/boot/dts/mpc8272ads.dts |2 +- arch/powerpc/platforms/82xx/mpc8272ads.c |7 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts index 16a77f4..8c69cd0 100644 --- a/arch/powerpc/boot/dts/mpc8272ads.dts +++ b/arch/powerpc/boot/dts/mpc8272ads.dts @@ -11,7 +11,7 @@ / { model = MPC8272ADS; - compatible = MPC8260ADS; + compatible = fsl,mpc8272ads; #address-cells = 1; #size-cells = 1; diff --git a/arch/powerpc/platforms/82xx/mpc8272ads.c b/arch/powerpc/platforms/82xx/mpc8272ads.c index 29c2932..fbf9c67 100644 --- a/arch/powerpc/platforms/82xx/mpc8272ads.c +++ b/arch/powerpc/platforms/82xx/mpc8272ads.c @@ -599,11 +599,8 @@ static void __init mpc8272ads_setup_arch(void) */ static int __init mpc8272ads_probe(void) { - /* We always match for now, eventually we should look at -* the flat dev tree to ensure this is the board we are -* supposed to run on -*/ - return 1; + unsigned long root = of_get_flat_dt_root(); + return of_flat_dt_is_compatible(root, fsl,mpc8272ads); } #define RMR_CSRE 0x0001 -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 32/61] mpc82xx: Move PQ2 restart and halt functions out of mpc8272-specific code.
I renamed it from m82xx to pq2 because it won't work on the Integrated Host Processor line of 82xx chips (i.e. 8240, 8245, and such). Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/platforms/82xx/Makefile |1 + arch/powerpc/platforms/82xx/mpc8272ads.c | 27 ++ arch/powerpc/platforms/82xx/pq2.c| 44 ++ arch/powerpc/platforms/82xx/pq2.h|7 + include/asm-ppc/immap_cpm2.h |2 + 5 files changed, 57 insertions(+), 24 deletions(-) create mode 100644 arch/powerpc/platforms/82xx/pq2.c create mode 100644 arch/powerpc/platforms/82xx/pq2.h diff --git a/arch/powerpc/platforms/82xx/Makefile b/arch/powerpc/platforms/82xx/Makefile index 881a3f6..6049640 100644 --- a/arch/powerpc/platforms/82xx/Makefile +++ b/arch/powerpc/platforms/82xx/Makefile @@ -3,3 +3,4 @@ # obj-$(CONFIG_PPC_82xx) += mpc82xx.o obj-$(CONFIG_MPC8272ADS) += mpc8272ads.o +obj-$(CONFIG_CPM2) += pq2.o diff --git a/arch/powerpc/platforms/82xx/mpc8272ads.c b/arch/powerpc/platforms/82xx/mpc8272ads.c index fbf9c67..cd14a48 100644 --- a/arch/powerpc/platforms/82xx/mpc8272ads.c +++ b/arch/powerpc/platforms/82xx/mpc8272ads.c @@ -2,7 +2,6 @@ * MPC8272ADS setup and early boot code plus other random bits. * * Author: Vitaly Bordug [EMAIL PROTECTED] - * m82xx_restart fix by Wade Farnsworth [EMAIL PROTECTED] * * Copyright (c) 2006 MontaVista Software, Inc. * @@ -42,6 +41,7 @@ #include asm/mpc8260.h #include asm/irq.h #include mm/mmu_decl.h +#include platforms/82xx/pq2.h #include asm/prom.h #include asm/cpm2.h #include asm/udbg.h @@ -603,27 +603,6 @@ static int __init mpc8272ads_probe(void) return of_flat_dt_is_compatible(root, fsl,mpc8272ads); } -#define RMR_CSRE 0x0001 -static void m82xx_restart(char *cmd) -{ - __volatile__ unsigned char dummy; - - local_irq_disable(); - ((cpm2_map_t *) cpm2_immr)-im_clkrst.car_rmr |= RMR_CSRE; - - /* Clear the ME,EE,IR DR bits in MSR to cause checkstop */ - mtmsr(mfmsr() ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR)); - dummy = ((cpm2_map_t *) cpm2_immr)-im_clkrst.res[0]; - printk(Restart failed\n); - while (1) ; -} - -static void m82xx_halt(void) -{ - local_irq_disable(); - while (1) ; -} - define_machine(mpc8272ads) { .name = Freescale MPC8272ADS, @@ -633,6 +612,6 @@ define_machine(mpc8272ads) .show_cpuinfo = m82xx_show_cpuinfo, .get_irq = cpm2_get_irq, .calibrate_decr = m82xx_calibrate_decr, - .restart = m82xx_restart, - .halt = m82xx_halt, + .restart = pq2_restart, + .halt = pq2_halt, }; diff --git a/arch/powerpc/platforms/82xx/pq2.c b/arch/powerpc/platforms/82xx/pq2.c new file mode 100644 index 000..e58980d --- /dev/null +++ b/arch/powerpc/platforms/82xx/pq2.c @@ -0,0 +1,44 @@ +/* + * Common PowerQUICC II code. + * + * Author: Scott Wood [EMAIL PROTECTED] + * Copyright (c) 2007 Freescale Semiconductor + * + * Based on code by Vitaly Bordug [EMAIL PROTECTED] + * pq2_restart fix by Wade Farnsworth [EMAIL PROTECTED] + * Copyright (c) 2006 MontaVista Software, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include asm/cpm2.h +#include asm/io.h +#include asm/system.h + +#include platforms/82xx/pq2.h + +#define RMR_CSRE 0x0001 + +void pq2_restart(char *cmd) +{ + local_irq_disable(); + cpm2_immr-im_clkrst.car_rmr |= RMR_CSRE; + + /* Clear the ME,EE,IR DR bits in MSR to cause checkstop */ + mtmsr(mfmsr() ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR)); + in_8(cpm2_immr-im_clkrst.res[0]); + + printk(Restart failed\n); + while (1) + ; +} + +void pq2_halt(void) +{ + local_irq_disable(); + while (1) + ; +} diff --git a/arch/powerpc/platforms/82xx/pq2.h b/arch/powerpc/platforms/82xx/pq2.h new file mode 100644 index 000..3c9620f --- /dev/null +++ b/arch/powerpc/platforms/82xx/pq2.h @@ -0,0 +1,7 @@ +#ifndef _PQ2_H +#define _PQ2_H + +void pq2_restart(char *cmd); +void pq2_halt(void); + +#endif diff --git a/include/asm-ppc/immap_cpm2.h b/include/asm-ppc/immap_cpm2.h index 3c23d9c..8795bcc 100644 --- a/include/asm-ppc/immap_cpm2.h +++ b/include/asm-ppc/immap_cpm2.h @@ -10,6 +10,8 @@ #ifndef __IMMAP_CPM2__ #define __IMMAP_CPM2__ +#include linux/types.h + /* System configuration registers. */ typedefstruct sys_82xx_conf { -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 33/61] mpc82xx: Remove a bunch of cruft that duplicates generic functionality.
Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/platforms/82xx/mpc8272ads.c | 37 ++ arch/powerpc/platforms/82xx/mpc82xx.c| 76 +- arch/powerpc/platforms/82xx/pq2ads.h |5 -- 3 files changed, 7 insertions(+), 111 deletions(-) diff --git a/arch/powerpc/platforms/82xx/mpc8272ads.c b/arch/powerpc/platforms/82xx/mpc8272ads.c index cd14a48..b23fa73 100644 --- a/arch/powerpc/platforms/82xx/mpc8272ads.c +++ b/arch/powerpc/platforms/82xx/mpc8272ads.c @@ -11,42 +11,21 @@ * option) any later version. */ -#include linux/stddef.h -#include linux/kernel.h #include linux/init.h -#include linux/errno.h -#include linux/reboot.h -#include linux/pci.h #include linux/interrupt.h -#include linux/kdev_t.h -#include linux/major.h -#include linux/console.h -#include linux/delay.h -#include linux/seq_file.h -#include linux/root_dev.h -#include linux/initrd.h -#include linux/module.h #include linux/fsl_devices.h #include linux/fs_uart_pd.h +#include linux/fs_enet_pd.h -#include asm/system.h -#include asm/pgtable.h -#include asm/page.h -#include asm/atomic.h -#include asm/time.h #include asm/io.h -#include asm/machdep.h -#include asm/bootinfo.h #include asm/pci-bridge.h #include asm/mpc8260.h -#include asm/irq.h -#include mm/mmu_decl.h -#include platforms/82xx/pq2.h -#include asm/prom.h #include asm/cpm2.h #include asm/udbg.h #include asm/i8259.h -#include linux/fs_enet_pd.h +#include asm/time.h + +#include platforms/82xx/pq2.h #include sysdev/fsl_soc.h #include sysdev/cpm2_pic.h @@ -584,12 +563,6 @@ static void __init mpc8272ads_setup_arch(void) of_node_put(np); #endif -#ifdef CONFIG_ROOT_NFS - ROOT_DEV = Root_NFS; -#else - ROOT_DEV = Root_HDA1; -#endif - if (ppc_md.progress) ppc_md.progress(mpc8272ads_setup_arch(), finish, 0); } @@ -611,7 +584,7 @@ define_machine(mpc8272ads) .init_IRQ = mpc8272ads_pic_init, .show_cpuinfo = m82xx_show_cpuinfo, .get_irq = cpm2_get_irq, - .calibrate_decr = m82xx_calibrate_decr, + .calibrate_decr = generic_calibrate_decr, .restart = pq2_restart, .halt = pq2_halt, }; diff --git a/arch/powerpc/platforms/82xx/mpc82xx.c b/arch/powerpc/platforms/82xx/mpc82xx.c index a2a9c8d..1d3d0e9 100644 --- a/arch/powerpc/platforms/82xx/mpc82xx.c +++ b/arch/powerpc/platforms/82xx/mpc82xx.c @@ -11,82 +11,10 @@ * option) any later version. */ -#include linux/stddef.h -#include linux/kernel.h -#include linux/init.h -#include linux/errno.h -#include linux/reboot.h -#include linux/pci.h -#include linux/interrupt.h -#include linux/kdev_t.h -#include linux/major.h -#include linux/console.h -#include linux/delay.h #include linux/seq_file.h -#include linux/root_dev.h -#include linux/initrd.h -#include linux/module.h -#include linux/fsl_devices.h -#include linux/fs_uart_pd.h - -#include asm/system.h -#include asm/pgtable.h -#include asm/page.h -#include asm/atomic.h -#include asm/time.h -#include asm/io.h -#include asm/machdep.h -#include asm/bootinfo.h -#include asm/pci-bridge.h -#include asm/mpc8260.h -#include asm/irq.h #include mm/mmu_decl.h -#include asm/prom.h -#include asm/cpm2.h -#include asm/udbg.h -#include asm/i8259.h -#include linux/fs_enet_pd.h - -#include sysdev/fsl_soc.h -#include sysdev/cpm2_pic.h - -#include pq2ads.h - -static int __init get_freq(char *name, unsigned long *val) -{ - struct device_node *cpu; - const unsigned int *fp; - int found = 0; - - /* The cpu node should have timebase and clock frequency properties */ - cpu = of_find_node_by_type(NULL, cpu); - - if (cpu) { - fp = of_get_property(cpu, name, NULL); - if (fp) { - found = 1; - *val = *fp; - } - - of_node_put(cpu); - } - - return found; -} - -void __init m82xx_calibrate_decr(void) -{ - ppc_tb_freq = 12500; - if (!get_freq(bus-frequency, ppc_tb_freq)) { - printk(KERN_ERR WARNING: Estimating decrementer frequency - (not found)\n); - } - ppc_tb_freq /= 4; - ppc_proc_freq = 10; - if (!get_freq(clock-frequency, ppc_proc_freq)) - printk(KERN_ERR WARNING: Estimating processor frequency - (not found)\n); -} +#include asm/machdep.h +#include asm/system.h void m82xx_show_cpuinfo(struct seq_file *m) { diff --git a/arch/powerpc/platforms/82xx/pq2ads.h b/arch/powerpc/platforms/82xx/pq2ads.h index 4802292..4546ce6 100644 --- a/arch/powerpc/platforms/82xx/pq2ads.h +++ b/arch/powerpc/platforms/82xx/pq2ads.h @@ -25,10 +25,6 @@ #include linux/seq_file.h #include asm/ppcboot.h -/* For our show_cpuinfo hooks. */ -#define CPUINFO_VENDOR Freescale Semiconductor -#define CPUINFO_MACHINEPQ2 ADS PowerPC - /* Backword-compatibility stuff for the drivers */
[PATCH 34/61] cpm2: Use the global cpm2_immr rather than ioremapping() all over the place.
Signed-off-by: Scott Wood [EMAIL PROTECTED] --- include/asm-powerpc/fs_pd.h | 19 +++ 1 files changed, 3 insertions(+), 16 deletions(-) diff --git a/include/asm-powerpc/fs_pd.h b/include/asm-powerpc/fs_pd.h index c624915..2179a5a 100644 --- a/include/asm-powerpc/fs_pd.h +++ b/include/asm-powerpc/fs_pd.h @@ -23,22 +23,9 @@ #include asm/mpc85xx.h #endif -#define cpm2_map(member) \ -({ \ - u32 offset = offsetof(cpm2_map_t, member); \ - void *addr = ioremap (CPM_MAP_ADDR + offset,\ - sizeof( ((cpm2_map_t*)0)-member)); \ - addr; \ -}) - -#define cpm2_map_size(member, size)\ -({ \ - u32 offset = offsetof(cpm2_map_t, member); \ - void *addr = ioremap (CPM_MAP_ADDR + offset, size); \ - addr; \ -}) - -#define cpm2_unmap(addr) iounmap(addr) +#define cpm2_map(member) (cpm2_immr-member) +#define cpm2_map_size(member, size) (cpm2_immr-member) +#define cpm2_unmap(addr) do {} while(0) #endif #ifdef CONFIG_8xx -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 36/61] mpc82xx: Factor PCI init out of mpc8272ads.
Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/boot/dts/mpc8272ads.dts |3 +- arch/powerpc/boot/dts/mpc8560ads.dts |2 +- arch/powerpc/platforms/82xx/mpc8272ads.c | 86 ++--- arch/powerpc/platforms/82xx/pq2.c| 44 +++ arch/powerpc/platforms/82xx/pq2.h|7 +++ arch/powerpc/platforms/82xx/pq2ads.h |1 - 6 files changed, 59 insertions(+), 84 deletions(-) diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts index 8c69cd0..ae52ada 100644 --- a/arch/powerpc/boot/dts/mpc8272ads.dts +++ b/arch/powerpc/boot/dts/mpc8272ads.dts @@ -161,8 +161,7 @@ interrupt-controller; reg = 10c00 80; built-in; - device_type = cpm-pic; - compatible = CPM2; + compatible = fsl,pq2-pic; }; [EMAIL PROTECTED] { diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts index 1626587..847a095 100644 --- a/arch/powerpc/boot/dts/mpc8560ads.dts +++ b/arch/powerpc/boot/dts/mpc8560ads.dts @@ -249,7 +249,7 @@ interrupt-parent = mpic; reg = 90c00 80; built-in; - device_type = cpm-pic; + compatible = fsl,pq2-pic; }; [EMAIL PROTECTED] { diff --git a/arch/powerpc/platforms/82xx/mpc8272ads.c b/arch/powerpc/platforms/82xx/mpc8272ads.c index e5b7a0f..388b090 100644 --- a/arch/powerpc/platforms/82xx/mpc8272ads.c +++ b/arch/powerpc/platforms/82xx/mpc8272ads.c @@ -18,11 +18,12 @@ #include linux/fs_enet_pd.h #include asm/io.h -#include asm/pci-bridge.h #include asm/mpc8260.h #include asm/cpm2.h #include asm/udbg.h #include asm/i8259.h +#include asm/prom.h +#include asm/machdep.h #include asm/time.h #include platforms/82xx/pq2.h @@ -35,29 +36,15 @@ static void __init mpc8272ads_pic_init(void) { - struct device_node *np = of_find_compatible_node(NULL, cpm-pic, CPM2); - struct resource r; - cpm2_map_t *cpm_reg; - - if (np == NULL) { + struct device_node *np = of_find_compatible_node(NULL, NULL, fsl,pq2-pic); + if (!np) { printk(KERN_ERR PIC init: can not find cpm-pic node\n); return; } - if (of_address_to_resource(np, 0, r)) { - printk(KERN_ERR PIC init: invalid resource\n); - of_node_put(np); - return; - } + cpm2_pic_init(np); of_node_put(np); - /* Initialize the default interrupt mapping priorities, -* in case the boot rom changed something on us. -*/ - cpm_reg = (cpm2_map_t *) ioremap(get_immrbase(), sizeof(cpm2_map_t)); - cpm_reg-im_intctl.ic_siprr = 0x05309770; - iounmap(cpm_reg); - /* Initialize stuff for the 82xx CPLD IC and install demux */ pq2ads_pci_init_irq(); } @@ -302,67 +289,12 @@ void __init mpc8272ads_board_setup(void) iounmap(immap); } -#ifdef CONFIG_PCI -static int m82xx_pci_exclude_device(struct pci_controller *hose, - u_char bus, u_char devfn) -{ - if (bus == 0 PCI_SLOT(devfn) == 0) - return PCIBIOS_DEVICE_NOT_FOUND; - else - return PCIBIOS_SUCCESSFUL; -} - -static void __init mpc82xx_add_bridge(struct device_node *np) -{ - int len; - struct pci_controller *hose; - struct resource r; - const int *bus_range; - const uint *ptr; - - memset(r, 0, sizeof(r)); - if (of_address_to_resource(np, 0, r)) { - printk(KERN_INFO No PCI reg property in device tree\n); - return; - } - if (!(ptr = of_get_property(np, clock-frequency, NULL))) { - printk(KERN_INFO No clock-frequency property in PCI node); - return; - } - of_node_put(np); - bus_range = of_get_property(np, bus-range, len); - if (bus_range == NULL || len 2 * sizeof(int)) { - printk(KERN_WARNING Can't get bus-range for %s, assume - bus 0\n, np-full_name); - } - - pci_assign_all_buses = 1; - - hose = pcibios_alloc_controller(np); - - if (!hose) - return; - - hose-first_busno = bus_range ? bus_range[0] : 0; - hose-last_busno = bus_range ? bus_range[1] : 0xff; - - setup_indirect_pci(hose, - r.start + offsetof(pci_cpm2_t, pci_cfg_addr), - r.start + offsetof(pci_cpm2_t, pci_cfg_data)); - - pci_process_bridge_OF_ranges(hose, np, 1); -} -#endif /* * Setup the architecture */ static void __init mpc8272ads_setup_arch(void) { -#ifdef CONFIG_PCI - struct device_node *np;
[PATCH 38/61] cpm2: Update device trees.
The mpc8272ads device tree is thoroughly reworked, including new CPM2 bindings. The mpc8560ads tree has the CPM portions updated. Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/boot/dts/mpc8272ads.dts | 295 +++--- arch/powerpc/boot/dts/mpc8560ads.dts | 70 + 2 files changed, 206 insertions(+), 159 deletions(-) diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts index ae52ada..708736b 100644 --- a/arch/powerpc/boot/dts/mpc8272ads.dts +++ b/arch/powerpc/boot/dts/mpc8272ads.dts @@ -22,179 +22,213 @@ 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 + d-cache-line-size = d#32; + i-cache-line-size = d#32; + d-cache-size = d#16384; + i-cache-size = d#16384; timebase-frequency = 0; bus-frequency = 0; clock-frequency = 0; - 32-bit; }; }; - pci_pic: [EMAIL PROTECTED] { - #address-cells = 0; - #interrupt-cells = 2; - interrupt-controller; - reg = f820 f824; - built-in; - device_type = pci-pic; + CS: chipselect { + compatible = fsl,mpc8272ads-chipselect, +fsl,mpc8272-chipselect, +fsl,pq2-chipselect; + #address-cells = 2; + #size-cells = 1; + fsl,ctrl = CSCTRL; + + ranges = 0 0 fe00 0200 + 1 0 f450 8000 + 3 0 f820 8000; + + [EMAIL PROTECTED] { + device_type = rom; + compatible = direct-mapped; + reg = 0 0 200; + probe-type = CFI; + bank-width = 4; + }; + + [EMAIL PROTECTED] { + reg = 1 0 20; + compatible = fsl,mpc8272ads-bcsr; + }; + + PCI_PIC: [EMAIL PROTECTED] { + compatible = fsl,mpc8272ads-pci-pic, +fsl,pq2ads-pci-pic; + #interrupt-cells = 1; + interrupt-controller; + reg = 3 0 8; + interrupt-parent = PIC; + interrupts = 14 8; + }; }; memory { device_type = memory; - reg = 400 f450 0020; + reg = 0 0; }; - chosen { - name = chosen; - linux,platform = 0; - interrupt-controller = Cpm_pic; - }; - - [EMAIL PROTECTED] { + [EMAIL PROTECTED] { #address-cells = 1; #size-cells = 1; - #interrupt-cells = 2; device_type = soc; + compatible = fsl,mpc8272, fsl,pq2-soc; ranges = f000 00053000; reg = f000 1; - [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; - }; - - phy1:[EMAIL PROTECTED] { - interrupt-parent = Cpm_pic; - interrupts = 17 4; - bitbang = [ 12 12 13 02 02 01 ]; - reg = 3; - device_type = ethernet-phy; - }; + CSCTRL: [EMAIL PROTECTED] { + compatible = fsl,mpc8272-chipset-ctrl, +fsl,pq2-chipselect-ctrl; + reg = 10100 40; + fsl,bus = CS; }; - [EMAIL PROTECTED] { - #address-cells = 1; - #size-cells = 0; - device_type = network; - device-id = 1; -
[PATCH 39/61] mpc885ads: Whitespace cleanup (space-tab)
Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/platforms/8xx/m8xx_setup.c | 72 +++--- 1 files changed, 36 insertions(+), 36 deletions(-) diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index f169355..601b389 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c @@ -89,24 +89,24 @@ init_internal_rtc(void) static int __init get_freq(char *name, unsigned long *val) { -struct device_node *cpu; -const unsigned int *fp; -int found = 0; + struct device_node *cpu; + const unsigned int *fp; + int found = 0; -/* The cpu node should have timebase and clock frequency properties */ -cpu = of_find_node_by_type(NULL, cpu); + /* The cpu node should have timebase and clock frequency properties */ + cpu = of_find_node_by_type(NULL, cpu); -if (cpu) { -fp = of_get_property(cpu, name, NULL); -if (fp) { -found = 1; -*val = *fp; -} + if (cpu) { + fp = of_get_property(cpu, name, NULL); + if (fp) { + found = 1; + *val = *fp; + } -of_node_put(cpu); -} + of_node_put(cpu); + } -return found; + return found; } /* The decrementer counts at the system (internal) clock frequency divided by @@ -122,7 +122,7 @@ void __init mpc8xx_calibrate_decr(void) sit8xx_t *sys_tmr2; int irq, virq; -clk_r1 = (cark8xx_t *) immr_map(im_clkrstk); + clk_r1 = (cark8xx_t *) immr_map(im_clkrstk); /* Unlock the SCCR. */ out_be32(clk_r1-cark_sccrk, ~KAPWR_KEY); @@ -130,24 +130,24 @@ void __init mpc8xx_calibrate_decr(void) immr_unmap(clk_r1); /* Force all 8xx processors to use divide by 16 processor clock. */ -clk_r2 = (car8xx_t *) immr_map(im_clkrst); + clk_r2 = (car8xx_t *) immr_map(im_clkrst); setbits32(clk_r2-car_sccr, 0x0200); immr_unmap(clk_r2); /* Processor frequency is MHz. */ -ppc_tb_freq = 5000; -if (!get_freq(bus-frequency, ppc_tb_freq)) { -printk(KERN_ERR WARNING: Estimating decrementer frequency -(not found)\n); -} -ppc_tb_freq /= 16; -ppc_proc_freq = 5000; -if (!get_freq(clock-frequency, ppc_proc_freq)) -printk(KERN_ERR WARNING: Estimating processor frequency -(not found)\n); - -printk(Decrementer Frequency = 0x%lx\n, ppc_tb_freq); + ppc_tb_freq = 5000; + if (!get_freq(bus-frequency, ppc_tb_freq)) { + printk(KERN_ERR WARNING: Estimating decrementer frequency + (not found)\n); + } + ppc_tb_freq /= 16; + ppc_proc_freq = 5000; + if (!get_freq(clock-frequency, ppc_proc_freq)) + printk(KERN_ERR WARNING: Estimating processor frequency + (not found)\n); + + printk(Decrementer Frequency = 0x%lx\n, ppc_tb_freq); /* Perform some more timer/timebase initialization. This used * to be done elsewhere, but other changes caused it to get @@ -164,7 +164,7 @@ void __init mpc8xx_calibrate_decr(void) * we guarantee the registers are locked, then we unlock them * for our use. */ -sys_tmr1 = (sitk8xx_t *) immr_map(im_sitk); + sys_tmr1 = (sitk8xx_t *) immr_map(im_sitk); out_be32(sys_tmr1-sitk_tbscrk, ~KAPWR_KEY); out_be32(sys_tmr1-sitk_rtcsck, ~KAPWR_KEY); out_be32(sys_tmr1-sitk_tbk, ~KAPWR_KEY); @@ -180,8 +180,8 @@ void __init mpc8xx_calibrate_decr(void) * we have to enable the timebase). The decrementer interrupt * is wired into the vector table, nothing to do here for that. */ -cpu = of_find_node_by_type(NULL, cpu); -virq= irq_of_parse_and_map(cpu, 0); + cpu = of_find_node_by_type(NULL, cpu); + virq= irq_of_parse_and_map(cpu, 0); irq = irq_map[virq].hwirq; sys_tmr2 = (sit8xx_t *) immr_map(im_sit); @@ -211,10 +211,10 @@ int mpc8xx_set_rtc_time(struct rtc_time *tm) sit8xx_t *sys_tmr2; int time; -sys_tmr1 = (sitk8xx_t *) immr_map(im_sitk); + sys_tmr1 = (sitk8xx_t *) immr_map(im_sitk); sys_tmr2 = (sit8xx_t *) immr_map(im_sit); time = mktime(tm-tm_year+1900, tm-tm_mon+1, tm-tm_mday, - tm-tm_hour, tm-tm_min, tm-tm_sec); + tm-tm_hour, tm-tm_min, tm-tm_sec); out_be32(sys_tmr1-sitk_rtck, KAPWR_KEY); out_be32(sys_tmr2-sit_rtc, time); @@ -233,8 +233,8 @@ void mpc8xx_get_rtc_time(struct rtc_time *tm) /* Get time from the RTC. */
[PATCH 40/61] 8xx: Whitespace cleanup in commproc.c
Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/sysdev/commproc.c | 20 ++-- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index 4f67b89..e8e79f8 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c @@ -45,10 +45,10 @@ #define CPM_MAP_SIZE(0x4000) static void m8xx_cpm_dpinit(void); -static uinthost_buffer;/* One page of host buffer */ -static uinthost_end; /* end + 1 */ -cpm8xx_t *cpmp; /* Pointer to comm processor space */ -cpic8xx_t *cpic_reg; +static uint host_buffer; /* One page of host buffer */ +static uint host_end;/* end + 1 */ +cpm8xx_t *cpmp; /* Pointer to comm processor space */ +cpic8xx_t *cpic_reg; static struct device_node *cpm_pic_node; static struct irq_host *cpm_pic_host; @@ -115,7 +115,7 @@ static int cpm_pic_host_map(struct irq_host *h, unsigned int virq, * and return. This is a no-op function so we don't need any special * tests in the interrupt handler. */ -static irqreturn_t cpm_error_interrupt(int irq, void *dev) +static irqreturn_t cpm_error_interrupt(int irq, void *dev) { return IRQ_HANDLED; } @@ -181,7 +181,7 @@ unsigned int cpm_pic_init(void) printk(KERN_ERR CPM PIC init: can not find cpm node\n); goto end; } - eirq= irq_of_parse_and_map(np, 0); + eirq = irq_of_parse_and_map(np, 0); if (eirq == NO_IRQ) goto end; @@ -197,15 +197,15 @@ end: void cpm_reset(void) { - cpm8xx_t*commproc; - sysconf8xx_t*siu_conf; + cpm8xx_t *commproc; + sysconf8xx_t *siu_conf; commproc = (cpm8xx_t *)ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE); #ifdef CONFIG_UCODE_PATCH /* Perform a reset. */ - out_be16(commproc-cp_cpcr, CPM_CR_RST | CPM_CR_FLG); + out_be16(commproc-cp_cpcr, CPM_CR_RST | CPM_CR_FLG); /* Wait for it. */ @@ -307,7 +307,7 @@ static rh_block_t cpm_boot_dpmem_rh_block[16]; static rh_info_t cpm_dpmem_info; #define CPM_DPMEM_ALIGNMENT8 -static u8* dpram_vbase; +static u8 *dpram_vbase; static uint dpram_pbase; void m8xx_cpm_dpinit(void) -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 43/61] 8xx: Always reset CPM if not using early console.
Some CPM devices conflict with each other, and the bootloader may have initialized a conflicting device. Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/sysdev/commproc.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index b0a58fd..eb791ea 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c @@ -208,7 +208,7 @@ void cpm_reset(void) cpmp = mpc8xx_immr-im_cpm; -#ifdef CONFIG_UCODE_PATCH +#ifndef CONFIG_PPC_EARLY_DEBUG /* Perform a reset. */ out_be16(cpmp-cp_cpcr, CPM_CR_RST | CPM_CR_FLG); @@ -216,7 +216,9 @@ void cpm_reset(void) /* Wait for it. */ while (in_be16(cpmp-cp_cpcr) CPM_CR_FLG); +#endif +#ifdef CONFIG_UCODE_PATCH cpm_load_patch(cpmp); #endif -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 45/61] 8xx: Add pin and clock setting functions.
These let board code set up pins and clocks without having to put magic numbers directly into the registers. Signed-off-by: Scott Wood [EMAIL PROTECTED] --- arch/powerpc/sysdev/commproc.c | 196 include/asm-ppc/commproc.h | 40 2 files changed, 236 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index 699bbd2..cf27a09 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c @@ -400,3 +400,199 @@ uint cpm_dpram_phys(u8* addr) return (dpram_pbase + (uint)(addr - dpram_vbase)); } EXPORT_SYMBOL(cpm_dpram_addr); + +struct cpm_ioport16 { + u16 dir, par, sor, dat, intr; + u16 res[3]; +}; + +struct cpm_ioport32 { + u32 dir, par, sor; +}; + +void cpm1_set_pin32(int port, int pin, int flags) +{ + struct cpm_ioport32 __iomem *iop; + pin = 1 (31 - pin); + + if (port == 1) + iop = (struct cpm_ioport32 __iomem *) + mpc8xx_immr-im_cpm.cp_pbdir; + else + iop = (struct cpm_ioport32 __iomem *) + mpc8xx_immr-im_cpm.cp_pedir; + + if (flags CPM_PIN_OUTPUT) + setbits32(iop-dir, pin); + else + clrbits32(iop-dir, pin); + + if (!(flags CPM_PIN_GPIO)) + setbits32(iop-par, pin); + else + clrbits32(iop-par, pin); + + if (port == 4) { + if (flags CPM_PIN_SECONDARY) + setbits32(iop-sor, pin); + else + clrbits32(iop-sor, pin); + } +} + +void cpm1_set_pin16(int port, int pin, int flags) +{ + struct cpm_ioport16 __iomem *iop = + (struct cpm_ioport16 __iomem *)mpc8xx_immr-im_ioport; + + pin = 1 (15 - pin); + + if (port != 0) + iop += port - 1; + + if (flags CPM_PIN_OUTPUT) + setbits16(iop-dir, pin); + else + clrbits16(iop-dir, pin); + + if (!(flags CPM_PIN_GPIO)) + setbits16(iop-par, pin); + else + clrbits16(iop-par, pin); + + if (port == 2) { + if (flags CPM_PIN_SECONDARY) + setbits16(iop-sor, pin); + else + clrbits16(iop-sor, pin); + } +} + +void cpm1_set_pin(int port, int pin, int flags) +{ + if (port == 1 || port == 4) + cpm1_set_pin32(port, pin, flags); + else + cpm1_set_pin16(port, pin, flags); +} + +int cpm1_clk_setup(enum cpm_clk_target target, int clock, int mode) +{ + int shift; + int i, bits = 0; + u32 *reg; + u32 mask = 7; + + u8 clk_map[][3] = { + {CPM_CLK_SCC1, CPM_BRG1, 0}, + {CPM_CLK_SCC1, CPM_BRG2, 1}, + {CPM_CLK_SCC1, CPM_BRG3, 2}, + {CPM_CLK_SCC1, CPM_BRG4, 3}, + {CPM_CLK_SCC1, CPM_CLK1, 4}, + {CPM_CLK_SCC1, CPM_CLK2, 5}, + {CPM_CLK_SCC1, CPM_CLK3, 6}, + {CPM_CLK_SCC1, CPM_CLK4, 7}, + + {CPM_CLK_SCC2, CPM_BRG1, 0}, + {CPM_CLK_SCC2, CPM_BRG2, 1}, + {CPM_CLK_SCC2, CPM_BRG3, 2}, + {CPM_CLK_SCC2, CPM_BRG4, 3}, + {CPM_CLK_SCC2, CPM_CLK1, 4}, + {CPM_CLK_SCC2, CPM_CLK2, 5}, + {CPM_CLK_SCC2, CPM_CLK3, 6}, + {CPM_CLK_SCC2, CPM_CLK4, 7}, + + {CPM_CLK_SCC3, CPM_BRG1, 0}, + {CPM_CLK_SCC3, CPM_BRG2, 1}, + {CPM_CLK_SCC3, CPM_BRG3, 2}, + {CPM_CLK_SCC3, CPM_BRG4, 3}, + {CPM_CLK_SCC3, CPM_CLK5, 4}, + {CPM_CLK_SCC3, CPM_CLK6, 5}, + {CPM_CLK_SCC3, CPM_CLK7, 6}, + {CPM_CLK_SCC3, CPM_CLK8, 7}, + + {CPM_CLK_SCC4, CPM_BRG1, 0}, + {CPM_CLK_SCC4, CPM_BRG2, 1}, + {CPM_CLK_SCC4, CPM_BRG3, 2}, + {CPM_CLK_SCC4, CPM_BRG4, 3}, + {CPM_CLK_SCC4, CPM_CLK5, 4}, + {CPM_CLK_SCC4, CPM_CLK6, 5}, + {CPM_CLK_SCC4, CPM_CLK7, 6}, + {CPM_CLK_SCC4, CPM_CLK8, 7}, + + {CPM_CLK_SMC1, CPM_BRG1, 0}, + {CPM_CLK_SMC1, CPM_BRG2, 1}, + {CPM_CLK_SMC1, CPM_BRG3, 2}, + {CPM_CLK_SMC1, CPM_BRG4, 3}, + {CPM_CLK_SMC1, CPM_CLK1, 4}, + {CPM_CLK_SMC1, CPM_CLK2, 5}, + {CPM_CLK_SMC1, CPM_CLK3, 6}, + {CPM_CLK_SMC1, CPM_CLK4, 7}, + + {CPM_CLK_SMC2, CPM_BRG1, 0}, + {CPM_CLK_SMC2, CPM_BRG2, 1}, + {CPM_CLK_SMC2, CPM_BRG3, 2}, + {CPM_CLK_SMC2, CPM_BRG4, 3}, + {CPM_CLK_SMC2, CPM_CLK5, 4}, + {CPM_CLK_SMC2, CPM_CLK6, 5}, + {CPM_CLK_SMC2, CPM_CLK7, 6}, + {CPM_CLK_SMC2, CPM_CLK8, 7}, + }; + + switch (target) { + case