Re: ndfc ecc byte order
On Wednesday 30 January 2008, Stefan Roese wrote: On Wednesday 30 January 2008, Sean MacLennan wrote: There seems to be a byte order conflict between the u-boot and Linux ndfc drivers. u-boot has the following: /* The NDFC uses Smart Media (SMC) bytes order*/ ecc_code[0] = p[2]; ecc_code[1] = p[1]; ecc_code[2] = p[3]; the kernel has: ecc_code[0] = p[1]; ecc_code[1] = p[2]; ecc_code[2] = p[3]; I think u-boot has it right since u-boot and kernel software calculated ECCs agree. Anybody know a reason *not* to switch to the SMC byte order? Please take a look at Kconfig config MTD_NAND_NDFC tristate NDFC NanD Flash Controller depends on 4xx !PPC_MERGE select MTD_NAND_ECC_SMC So the SMC byte ordering is selected and it should match the version used in U-Boot. In Linux the swapping is done in nand_ecc.c. Seems that I was incorrect here. Tests showed that writing from Linux and then reading back from U-Boot results in ECC errors. My comment above is bogus, since nand_calculate_ecc() from nand_ecc.c is not used with HW-ECC generation enabled. I'll send a patch to fix this in a short while. Best regards, Stefan ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: ndfc ecc byte order
On Friday 01 February 2008, Stefan Roese wrote: So the SMC byte ordering is selected and it should match the version used in U-Boot. In Linux the swapping is done in nand_ecc.c. Seems that I was incorrect here. Tests showed that writing from Linux and then reading back from U-Boot results in ECC errors. My comment above is bogus, since nand_calculate_ecc() from nand_ecc.c is not used with HW-ECC generation enabled. And after another coffee I noticed that the current Linux implementation is correct. The U-Boot implementation needs to get fixed. Brown paper bag time for me. Best regards, Stefan ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 2/4 v4] POWERPC: Add StorCenter DTS first draft.
So, like, the other day David Gibson mumbled: +/ { + model = StorCenter; + compatible = storcenter; This really needs a vendor prefix. Hey Grant! Here's how dumb I am: You were thinking Something's wrong here... and kept saying Needs a model name!, and I kept saying That _is_ the model name! And finally Dave comes along and with the ever-obvious Needs a vendor prefix! I'm like, D'oh! + chosen { + linux,stdout-path = /soc/[EMAIL PROTECTED]; You can now use a path reference here. Ah, good point. I'll get around to an update patch! Thanks! jdl ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
PCI configuration with multiple PCI controllers
Hello, I have a MPC8641 based board. I try to use the two PCIe controllers. My firmware configures (physically) the PCI buses as follow: --+ MPC8641 PCIe 1 | bus 1 +--+ | -- | PCI device 0 | BUS 0 | +--+ - - - - - - - - - + MPC8641 PCIe 2 | bus 3 +--+ | -- | PCI device 1 | BUS 2 | +--+ --+ I launch the Linux image (2.6.23.9). During the Kernel PCI configuration, buses behind the 2nd MPC8641 PCIe are skipped because its primary bus don't start at bus number 0. The kernel reconfigure the primary bus number of the MPC8641 PCIe 2 controller from 2 to 0. I can patch the kernel to work with my firmware but I don't know if my PCI configuration is the good one. What is the common way to configure the PCI for Linux when a new controller is found: start the bus number to 0 or to the last bus number + 1? Regards Laurent ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH v4] [POWERPC] MPC8360E-RDK: device tree, board file and defconfig
This is new board made by Freescale Semiconductor Inc. and Logic Product Development. Currently supported: 1. UEC{1,2,7,4}; 2. I2C; 3. SPI; 4. NS16550 serial; 5. PCI and miniPCI; 6. Intel NOR StrataFlash X16 64Mbit PC28F640P30T85; 7. Graphics controller, Fujitsu MB86277. Not supported so far: 1. StMICRO NAND512W3A2BN6E, 512 Mbit (supported with FSL UPM patches); 2. QE Serial UCCs (tested to not work with ucc_uart driver, reason unknown, yet); 3. ADC AD7843 (tested to work, but support via device tree depends on major SPI rework, GPIO API, etc); 4. FHCI USB (will send RFC patches soon). Signed-off-by: Anton Vorontsov [EMAIL PROTECTED] --- Hello Kumar, It would be great if we can get this into the 2.6.25. Changes since v3: - rebased against recent tree; - compatible = fsl,mpc8360-immr, fsl,immr, simple-bus; - now qe node is the child of the soc node; - proper #{address,size}-cells for the muram node; - unused par_io node removed (in favour of upcoming GPIO support). Thanks, arch/powerpc/boot/dts/mpc836x_rdk.dts | 368 ++ arch/powerpc/configs/mpc836x_rdk_defconfig | 1053 arch/powerpc/platforms/83xx/Kconfig|8 + arch/powerpc/platforms/83xx/Makefile |1 + arch/powerpc/platforms/83xx/mpc836x_rdk.c | 105 +++ 5 files changed, 1535 insertions(+), 0 deletions(-) create mode 100644 arch/powerpc/boot/dts/mpc836x_rdk.dts create mode 100644 arch/powerpc/configs/mpc836x_rdk_defconfig create mode 100644 arch/powerpc/platforms/83xx/mpc836x_rdk.c diff --git a/arch/powerpc/boot/dts/mpc836x_rdk.dts b/arch/powerpc/boot/dts/mpc836x_rdk.dts new file mode 100644 index 000..b062f9b --- /dev/null +++ b/arch/powerpc/boot/dts/mpc836x_rdk.dts @@ -0,0 +1,368 @@ +/* + * MPC8360E RDK Device Tree Source + * + * Copyright 2006 Freescale Semiconductor Inc. + * Copyright 2007 MontaVista Software, Inc. + * Anton Vorontsov [EMAIL PROTECTED] + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +/dts-v1/; + +/ { + #address-cells = 1; + #size-cells = 1; + compatible = fsl,mpc8360erdk; + + aliases { + serial0 = serial0; + serial1 = serial1; + serial2 = serial2; + serial3 = serial3; + ethernet0 = enet0; + ethernet1 = enet1; + ethernet2 = enet2; + ethernet3 = enet3; + pci0 = pci0; + }; + + cpus { + #address-cells = 1; + #size-cells = 0; + + PowerPC,[EMAIL PROTECTED] { + device_type = cpu; + reg = 0; + d-cache-line-size = 32; + i-cache-line-size = 32; + d-cache-size = 32768; + i-cache-size = 32768; + /* filled by u-boot */ + timebase-frequency = 0; + bus-frequency = 0; + clock-frequency = 0; + }; + }; + + memory { + device_type = memory; + /* filled by u-boot */ + reg = 0 0; + }; + + [EMAIL PROTECTED] { + #address-cells = 1; + #size-cells = 1; + device_type = soc; + compatible = fsl,mpc8360-immr, fsl,immr, simple-bus; + ranges = 0 0xe000 0x20; + reg = 0xe000 0x200; + /* filled by u-boot */ + bus-frequency = 0; + + [EMAIL PROTECTED] { + compatible = mpc83xx_wdt; + reg = 0x200 0x100; + }; + + [EMAIL PROTECTED] { + #address-cells = 1; + #size-cells = 0; + cell-index = 0; + compatible = fsl-i2c; + reg = 0x3000 0x100; + interrupts = 14 8; + interrupt-parent = ipic; + dfsrr; + }; + + [EMAIL PROTECTED] { + #address-cells = 1; + #size-cells = 0; + cell-index = 1; + compatible = fsl-i2c; + reg = 0x3100 0x100; + interrupts = 16 8; + interrupt-parent = ipic; + dfsrr; + }; + + serial0: [EMAIL PROTECTED] { + device_type = serial; + compatible = ns16550; + reg = 0x4500 0x100; + interrupts = 9 8; + interrupt-parent = ipic; +
Re: Reminder: removal of arch/ppc
On Thu, 31 Jan 2008 15:54:46 -0700 Mark A. Greer [EMAIL PROTECTED] wrote: On Fri, Jan 25, 2008 at 10:55:25AM -0600, Kumar Gala wrote: Just a reminder that the plan is to remove arch/ppc this summer (June 2008). The following boards still existing over in arch/ppc. Some of them have been ported over to arch/powerpc. If you care about one of these boards and its not ported speak up (it helps if you have access to the board). Also, if you know a given board is free to die of bitrot let us know so we know not to worry about it: I guess I'm just not a nice guy but I say let them die. No need to worry. The code really isn't going anywhere -- git-checkout v2.6.pick your favorite version and its back. You're a nice guy. You just aren't as much of a masochist as the rest of us I guess. ;) josh ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] fix comment for ppc_md enable/disable irq hooks
When committing the patch Implement arch disable/enable irq hooks in commit 7ac5dde99eb9fefdb526973c600075b7c5703a86 you changed the code to always call the generic decrementer/interrupt enabling/disabling but forgot to update the comment, this fixes that. Signed-off-by: Johannes Berg [EMAIL PROTECTED] --- include/asm/machdep.h |9 + 1 file changed, 5 insertions(+), 4 deletions(-) --- linux-2.6-git.orig/include/asm/machdep.h2008-01-31 18:02:54.113774156 +0100 +++ linux-2.6-git/include/asm/machdep.h 2008-01-31 18:04:18.125023706 +0100 @@ -253,10 +253,11 @@ struct machdep_calls { #endif /* CONFIG_KEXEC */ #ifdef CONFIG_SUSPEND - /* These are called to disable and enable, respectively, IRQs when -* entering a suspend state. If NULL, then the generic versions -* will be called. The generic versions disable/enable the -* decrementer along with interrupts. + /* +* These are called before disabling and after enabling, respectively, +* IRQs when entering a suspend state. The generic code will always +* make sure local interrupts and the decrementer are disabled/enabled +* properly. */ void (*suspend_disable_irqs)(void); void (*suspend_enable_irqs)(void); ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
pthread / TQM5200 problem
Hi, Here's some additional information I forgot when originally posting my question today morning: I'm using the DENX ELDK 3.1.1 and a kernel version 2.4.25. Regards, Sebastian -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Sebastian Theiss Gesendet: Freitag, 1. Februar 2008 13:48 An: linuxppc-dev@ozlabs.org Betreff: pthread / TQM5200 problem Hi all. I've been having some headache using the pthread library with a TB5200 box (based on a TQM5200 board with a Freescale MPC5200 PowerPC-CPU). I created a small program to pin down the problem and it runs fine on all my Unix- and Linux-machines but fails on the embedded box: The program contains a class CSignal that provides thread-synchronisation based on the pthread_cond_signal and pthread_cond_wait calls and takes care of the spurious wakeup and lost signal problems. The program runs 159 additional threads (that seems to be some internal limit), each of them continuously increments a field variable and afterwards sleeps until the main thread wakes it up again. The main thread monitors the whole field of variables that are incremented by the 159 other threads and continuously wakes them up. When running in the desired way, the program should show a table with 160 entries and each entry (except for the last) should continuously increase. However, on the box the threads 31 to 64 never wake up, once they call pthread_cond_wait. The code below lacks some error checking to keep it short, but besides that I don't see what's going wrong. And, the code runs fine on my real Linux machines. Any ideas of what the problem might be and how to fix it? Your I help would be greatly appreciated as I'm rather despaired right now. Regards, Sebastian #include stdio.h #include pthread.h class CSignal { public: CSignal() { m_bFlag = false; pthread_mutex_init(m_Mutex, NULL); pthread_cond_init(m_Condition, NULL); } ~CSignal() { pthread_mutex_destroy(m_Mutex); pthread_cond_destroy(m_Condition); } public: void Set(bool bValue = true) { pthread_mutex_lock(m_Mutex); if( m_bFlag = bValue ) pthread_cond_broadcast(m_Condition); pthread_mutex_unlock(m_Mutex); } void Wait() { pthread_mutex_lock(m_Mutex); while( !m_bFlag ) pthread_cond_wait(m_Condition,m_Mutex); pthread_mutex_unlock(m_Mutex); } protected: volatile bool m_bFlag; pthread_mutex_t m_Mutex; pthread_cond_t m_Condition; }; #define THREAD_COUNT 160 unsigned char state[THREAD_COUNT]; CSignal signal[THREAD_COUNT]; void* threadproc(void* pParam) { int index = (int)pParam; while( true ) { state[index]++; // wait for the signal beeing set signal[index].Wait(); // reset signal, so that next Wait() will actually case the thread to sleep again signal[index].Set(false); } } int main() { // clear state field for( int i = 0; i THREAD_COUNT; i++ ) { state[i] = 0; } // run 160 threads (creation of the last thread throws EAGAIN, so 159 (+ the main thread) // seems to be some kind of limit, but that's not the point here) for( int i = 0; i THREAD_COUNT; i++ ) { pthread_t id; printf(create thread %i: %i\n, i, pthread_create(id, NULL, threadproc, (void*)i)); } for(;;) { // wake all threads for( int i = 0; i THREAD_COUNT; i++ ) { signal[i].Set(); } // print state of each thread printf(\033[H); int thread = 0; for( int i = 0; i 16; i++ ) { for( int j = 0; j 10; j++, thread++ ) { printf(%03i/%03i , thread, state[thread]); } printf(\n); } } return 0; } _ Technische Universität Dresden Fakultät Informatik Institut für Angewandte Informatik Lehrstuhl für Technische Informationssysteme D-01062 Dresden Besucheradresse: Nöthnitzer Str. 46, Zi. 1079 Telefon +49 351 463-38399 Telefax +49 351 463-38460 [EMAIL PROTECTED] _ ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org
Re: PCI configuration with multiple PCI controllers
Hello. Laurent Lagrange wrote: I have a MPC8641 based board. I try to use the two PCIe controllers. My firmware configures (physically) the PCI buses as follow: --+ MPC8641 PCIe 1| bus 1 +--+ | -- | PCI device 0 | BUS 0 | +--+ - - - - - - - - - + MPC8641 PCIe 2| bus 3 +--+ | -- | PCI device 1 | BUS 2 | +--+ --+ I launch the Linux image (2.6.23.9). During the Kernel PCI configuration, buses behind the 2nd MPC8641 PCIe are skipped because its primary bus don't start at bus number 0. The kernel reconfigure the primary bus number of the MPC8641 PCIe 2 controller from 2 to 0. Hm... I can patch the kernel to work with my firmware but I don't know if my PCI configuration is the good one. What is the common way to configure the PCI for Linux when a new controller is found: start the bus number to 0 or to the last bus number + 1? The latter. Otherwise it just won't work. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: pthread / TQM5200 problem
On 2/1/08, Sebastian Theiss [EMAIL PROTECTED] wrote: Hi, Here's some additional information I forgot when originally posting my question today morning: I'm using the DENX ELDK 3.1.1 and a kernel version 2.4.25. Ugh. You might have trouble getting support on this list. Almost everyone here is firmly focused on the 2.6 kernel. Can you upgrade to a recent kernel version. 2.6.24 is looking really good for mpc5200 work. Cheers, g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH for 2.6.25 1/2] [NET] ucc_geth: fix module removal
- uccf should be set to NULL to not double-free memory on subsequent calls; - ind_hash_q and group_hash_q lists should be initialized in the probe() function, instead of struct_init() (called by open()), otherwise there will be an oops if ucc_geth_driver removed prior 'ifconfig ethX up'; - add unregister_netdev(); - reorder geth_remove() steps. Signed-off-by: Anton Vorontsov [EMAIL PROTECTED] --- Hi Li, You kinda promised that these two patches would hit 2.6.25... ;-) I've rebased the patches so they apply cleanly on the current tree. Thanks, drivers/net/ucc_geth.c | 17 ++--- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 4ffd873..e41da46 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c @@ -2084,8 +2084,10 @@ static void ucc_geth_memclean(struct ucc_geth_private *ugeth) if (!ugeth) return; - if (ugeth-uccf) + if (ugeth-uccf) { ucc_fast_free(ugeth-uccf); + ugeth-uccf = NULL; + } if (ugeth-p_thread_data_tx) { qe_muram_free(ugeth-thread_dat_tx_offset); @@ -2305,10 +2307,6 @@ static int ucc_struct_init(struct ucc_geth_private *ugeth) ug_info = ugeth-ug_info; uf_info = ug_info-uf_info; - /* Create CQs for hash tables */ - INIT_LIST_HEAD(ugeth-group_hash_q); - INIT_LIST_HEAD(ugeth-ind_hash_q); - if (!((uf_info-bd_mem_part == MEM_PART_SYSTEM) || (uf_info-bd_mem_part == MEM_PART_MURAM))) { if (netif_msg_probe(ugeth)) @@ -3990,6 +3988,10 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma ugeth = netdev_priv(dev); spin_lock_init(ugeth-lock); + /* Create CQs for hash tables */ + INIT_LIST_HEAD(ugeth-group_hash_q); + INIT_LIST_HEAD(ugeth-ind_hash_q); + dev_set_drvdata(device, dev); /* Set the dev-base_addr to the gfar reg region */ @@ -4040,9 +4042,10 @@ static int ucc_geth_remove(struct of_device* ofdev) struct net_device *dev = dev_get_drvdata(device); struct ucc_geth_private *ugeth = netdev_priv(dev); - dev_set_drvdata(device, NULL); - ucc_geth_memclean(ugeth); + unregister_netdev(dev); free_netdev(dev); + ucc_geth_memclean(ugeth); + dev_set_drvdata(device, NULL); return 0; } -- 1.5.2.2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH for 2.6.25 2/2] [NET] ucc_geth: add support for netpoll
This patch adds netpoll support for the QE UCC Gigabit Ethernet driver. Tested using netconsole and KGDBoE. Signed-off-by: Anton Vorontsov [EMAIL PROTECTED] --- Just resending this. drivers/net/ucc_geth.c | 20 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index e41da46..fba0811 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c @@ -3666,6 +3666,23 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info) return IRQ_HANDLED; } +#ifdef CONFIG_NET_POLL_CONTROLLER +/* + * Polling 'interrupt' - used by things like netconsole to send skbs + * without having to re-enable interrupts. It's not called while + * the interrupt routine is executing. + */ +static void ucc_netpoll(struct net_device *dev) +{ + struct ucc_geth_private *ugeth = netdev_priv(dev); + int irq = ugeth-ug_info-uf_info.irq; + + disable_irq(irq); + ucc_geth_irq_handler(irq, dev); + enable_irq(irq); +} +#endif /* CONFIG_NET_POLL_CONTROLLER */ + /* Called when something needs to use the ethernet device */ /* Returns 0 for success. */ static int ucc_geth_open(struct net_device *dev) @@ -4008,6 +4025,9 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma #ifdef CONFIG_UGETH_NAPI netif_napi_add(dev, ugeth-napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT); #endif /* CONFIG_UGETH_NAPI */ +#ifdef CONFIG_NET_POLL_CONTROLLER + dev-poll_controller = ucc_netpoll; +#endif dev-stop = ucc_geth_close; //dev-change_mtu = ucc_geth_change_mtu; dev-mtu = 1500; -- 1.5.2.2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] [POWERPC] get rid of `model = UCC' in the ucc nodes
On Feb 1, 2008, at 9:01 AM, Anton Vorontsov wrote: It isn't used anywhere, so remove it. If we'll ever need something like this, we'll use compatible property instead. Signed-off-by: Anton Vorontsov [EMAIL PROTECTED] --- Rebased on top of recent tree. Documentation/powerpc/booting-without-of.txt |1 - arch/powerpc/boot/dts/mpc832x_mds.dts|3 --- arch/powerpc/boot/dts/mpc832x_rdb.dts|2 -- arch/powerpc/boot/dts/mpc836x_mds.dts|2 -- arch/powerpc/boot/dts/mpc8568mds.dts |2 -- 5 files changed, 0 insertions(+), 10 deletions(-) diff --git a/Documentation/powerpc/booting-without-of.txt b/ Documentation/powerpc/booting-without-of.txt index 410c847..dcf9758 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt @@ -1675,7 +1675,6 @@ platforms are moved over to use the flattened- device-tree model. [EMAIL PROTECTED] { device_type = network; compatible = ucc_geth; - model = UCC; device-id = 1; can we change device-id to cell-index? - k ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] ehea: fix sysfs link compile problem
Due to changes in the struct device_driver there is no direct access to its kobj any longer. The kobj was used to create sysfs links between eHEA ethernet devices and the driver. This patch removes the affected sysfs links to resolve the build problems. Signed-off-by: Jan-Bernd Themann [EMAIL PROTECTED] --- drivers/net/ehea/ehea_main.c | 37 - 1 files changed, 0 insertions(+), 37 deletions(-) diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 869e160..9a3fd81 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c @@ -2804,34 +2804,6 @@ static void __devinit logical_port_release(struct device *dev) of_node_put(port-ofdev.node); } -static int ehea_driver_sysfs_add(struct device *dev, -struct device_driver *driver) -{ - int ret; - - ret = sysfs_create_link(driver-kobj, dev-kobj, - kobject_name(dev-kobj)); - if (ret == 0) { - ret = sysfs_create_link(dev-kobj, driver-kobj, - driver); - if (ret) - sysfs_remove_link(driver-kobj, - kobject_name(dev-kobj)); - } - return ret; -} - -static void ehea_driver_sysfs_remove(struct device *dev, -struct device_driver *driver) -{ - struct device_driver *drv = driver; - - if (drv) { - sysfs_remove_link(drv-kobj, kobject_name(dev-kobj)); - sysfs_remove_link(dev-kobj, driver); - } -} - static struct device *ehea_register_port(struct ehea_port *port, struct device_node *dn) { @@ -2856,16 +2828,8 @@ static struct device *ehea_register_port(struct ehea_port *port, goto out_unreg_of_dev; } - ret = ehea_driver_sysfs_add(port-ofdev.dev, ehea_driver.driver); - if (ret) { - ehea_error(failed to register sysfs driver link); - goto out_rem_dev_file; - } - return port-ofdev.dev; -out_rem_dev_file: - device_remove_file(port-ofdev.dev, dev_attr_log_port_id); out_unreg_of_dev: of_device_unregister(port-ofdev); out: @@ -2874,7 +2838,6 @@ out: static void ehea_unregister_port(struct ehea_port *port) { - ehea_driver_sysfs_remove(port-ofdev.dev, ehea_driver.driver); device_remove_file(port-ofdev.dev, dev_attr_log_port_id); of_device_unregister(port-ofdev); } -- 1.5.2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] [POWERPC] get rid of `model = UCC' in the ucc nodes
It isn't used anywhere, so remove it. If we'll ever need something like this, we'll use compatible property instead. Signed-off-by: Anton Vorontsov [EMAIL PROTECTED] --- Rebased on top of recent tree. Documentation/powerpc/booting-without-of.txt |1 - arch/powerpc/boot/dts/mpc832x_mds.dts|3 --- arch/powerpc/boot/dts/mpc832x_rdb.dts|2 -- arch/powerpc/boot/dts/mpc836x_mds.dts|2 -- arch/powerpc/boot/dts/mpc8568mds.dts |2 -- 5 files changed, 0 insertions(+), 10 deletions(-) diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index 410c847..dcf9758 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt @@ -1675,7 +1675,6 @@ platforms are moved over to use the flattened-device-tree model. [EMAIL PROTECTED] { device_type = network; compatible = ucc_geth; - model = UCC; device-id = 1; reg = 2000 200; interrupts = a0 0; diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts index 9bb4083..f8b4a37 100644 --- a/arch/powerpc/boot/dts/mpc832x_mds.dts +++ b/arch/powerpc/boot/dts/mpc832x_mds.dts @@ -255,7 +255,6 @@ enet0: [EMAIL PROTECTED] { device_type = network; compatible = ucc_geth; - model = UCC; cell-index = 3; device-id = 3; reg = 0x2200 0x200; @@ -271,7 +270,6 @@ enet1: [EMAIL PROTECTED] { device_type = network; compatible = ucc_geth; - model = UCC; cell-index = 4; device-id = 4; reg = 0x3200 0x200; @@ -287,7 +285,6 @@ [EMAIL PROTECTED] { device_type = serial; compatible = ucc_uart; - model = UCC; device-id = 5;/* The UCC number, 1-7*/ port-number = 0; /* Which ttyQEx device */ soft-uart; /* We need Soft-UART */ diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts index 94f93d2..ea7fcbf 100644 --- a/arch/powerpc/boot/dts/mpc832x_rdb.dts +++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts @@ -208,7 +208,6 @@ enet0: [EMAIL PROTECTED] { device_type = network; compatible = ucc_geth; - model = UCC; cell-index = 2; device-id = 2; reg = 0x3000 0x200; @@ -224,7 +223,6 @@ enet1: [EMAIL PROTECTED] { device_type = network; compatible = ucc_geth; - model = UCC; cell-index = 3; device-id = 3; reg = 0x2200 0x200; diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts index 55f03e8..525423c 100644 --- a/arch/powerpc/boot/dts/mpc836x_mds.dts +++ b/arch/powerpc/boot/dts/mpc836x_mds.dts @@ -257,7 +257,6 @@ enet0: [EMAIL PROTECTED] { device_type = network; compatible = ucc_geth; - model = UCC; cell-index = 1; device-id = 1; reg = 0x2000 0x200; @@ -274,7 +273,6 @@ enet1: [EMAIL PROTECTED] { device_type = network; compatible = ucc_geth; - model = UCC; cell-index = 2; device-id = 2; reg = 0x3000 0x200; diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts index 97bc048..66087d5 100644 --- a/arch/powerpc/boot/dts/mpc8568mds.dts +++ b/arch/powerpc/boot/dts/mpc8568mds.dts @@ -324,7 +324,6 @@ enet2: [EMAIL PROTECTED] { device_type = network; compatible = ucc_geth; - model = UCC; cell-index = 1; device-id = 1; reg = 2000 200; @@ -341,7 +340,6 @@ enet3: [EMAIL PROTECTED] { device_type = network; compatible = ucc_geth; - model = UCC; cell-index = 2; device-id = 2; reg = 3000 200; -- 1.5.2.2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org
Re: [PATCH] [POWERPC] get rid of `model = UCC' in the ucc nodes
On 2/1/08, Kumar Gala [EMAIL PROTECTED] wrote: --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt @@ -1675,7 +1675,6 @@ platforms are moved over to use the flattened- device-tree model. [EMAIL PROTECTED] { device_type = network; compatible = ucc_geth; - model = UCC; device-id = 1; can we change device-id to cell-index? aside Here's a thought; do we really need a cell-index at all? (and I'm talking in general; not just this specific case). I'm starting to think we should migrate away from using it. cell-index has been useful for things like clock controllers to know what offset into a shared clock control register or something like that and a driver would pass the cell-index value to the shared reg driver when requesting service. However, I think the information encoded in cell-index is already encoded in the device tree in a different manor. Typically, shared registers and the like are all chip specific and the behaviour of the shared register drivers usually needs to be tweaked for different SoCs. Each ip core on an SoC is already uniquely indexed via the reg property. True, 'reg' is sparse (0x2000, 0x2200, 0x2300, ...) whereas cell-index is tight (0,1,2,3,...), but I don't think that introduces any additional difficulty. So, instead of a driver passing it's cell-index value to the shared reg driver, it would pass it's reg base instead. The shared register driver could then choose an internal representation that makes sense for it instead of whatever layout was chosen by the device tree. Dropping cell-index would mean one less property to keep in sync when tailoring device trees. (== less complexity for board porters). Besides, the purpose of cell-index is often misunderstood already by people trying to use it to describe port numbers (ttyS0, ttyS1, etc). Thoughts? /aside Cheers, g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] [POWERPC][NET][SERIAL] UCCs: replace device-id with cell-index (was: Re: [PATCH] [POWERPC] get rid of `model = UCC' in the ucc nodes)
On Fri, Feb 01, 2008 at 09:32:38AM -0600, Kumar Gala wrote: On Feb 1, 2008, at 9:01 AM, Anton Vorontsov wrote: It isn't used anywhere, so remove it. If we'll ever need something like this, we'll use compatible property instead. Signed-off-by: Anton Vorontsov [EMAIL PROTECTED] --- Rebased on top of recent tree. Documentation/powerpc/booting-without-of.txt |1 - arch/powerpc/boot/dts/mpc832x_mds.dts|3 --- arch/powerpc/boot/dts/mpc832x_rdb.dts|2 -- arch/powerpc/boot/dts/mpc836x_mds.dts|2 -- arch/powerpc/boot/dts/mpc8568mds.dts |2 -- 5 files changed, 0 insertions(+), 10 deletions(-) diff --git a/Documentation/powerpc/booting-without-of.txt b/ Documentation/powerpc/booting-without-of.txt index 410c847..dcf9758 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt @@ -1675,7 +1675,6 @@ platforms are moved over to use the flattened- device-tree model. [EMAIL PROTECTED] { device_type = network; compatible = ucc_geth; -model = UCC; device-id = 1; can we change device-id to cell-index? Sure. But let's do this in the separate patch? Because this change actually touches the code in the two subsystems: net and serial. I hope everybody will agree to pass it through powerpc tree..? - - - - From: Anton Vorontsov [EMAIL PROTECTED] Subject: [POWERPC][NET][SERIAL] UCCs: replace device-id with cell-index device-id is worse than cell-index. Probably cell-index isn't good either, but device-id is worse anyway. Drivers are modified for backward compatibility's sake. Signed-off-by: Anton Vorontsov [EMAIL PROTECTED] --- Documentation/powerpc/booting-without-of.txt |4 ++-- arch/powerpc/boot/dts/mpc832x_mds.dts|4 +--- arch/powerpc/boot/dts/mpc832x_rdb.dts|2 -- arch/powerpc/boot/dts/mpc836x_mds.dts|2 -- arch/powerpc/boot/dts/mpc836x_rdk.dts| 12 ++-- arch/powerpc/boot/dts/mpc8568mds.dts |2 -- drivers/net/ucc_geth.c |8 +++- drivers/net/ucc_geth_mii.c | 11 --- drivers/serial/ucc_uart.c| 16 9 files changed, 36 insertions(+), 25 deletions(-) diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index dcf9758..7b30798 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt @@ -1618,7 +1618,7 @@ platforms are moved over to use the flattened-device-tree model. bisync, atm, or serial. - compatible : could be ucc_geth or fsl_atm and so on. - model : should be UCC. - - device-id : the ucc number(1-8), corresponding to UCCx in UM. + - cell-index : the ucc number(1-8), corresponding to UCCx in UM. - reg : Offset and length of the register set for the device - interrupts : a b where a is the interrupt number and b is a field that represents an encoding of the sense and level @@ -1675,7 +1675,7 @@ platforms are moved over to use the flattened-device-tree model. [EMAIL PROTECTED] { device_type = network; compatible = ucc_geth; - device-id = 1; + cell-index = 1; reg = 2000 200; interrupts = a0 0; interrupt-parent = 700; diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts index f8b4a37..539e02f 100644 --- a/arch/powerpc/boot/dts/mpc832x_mds.dts +++ b/arch/powerpc/boot/dts/mpc832x_mds.dts @@ -256,7 +256,6 @@ device_type = network; compatible = ucc_geth; cell-index = 3; - device-id = 3; reg = 0x2200 0x200; interrupts = 34; interrupt-parent = qeic; @@ -271,7 +270,6 @@ device_type = network; compatible = ucc_geth; cell-index = 4; - device-id = 4; reg = 0x3200 0x200; interrupts = 35; interrupt-parent = qeic; @@ -285,7 +283,7 @@ [EMAIL PROTECTED] { device_type = serial; compatible = ucc_uart; - device-id = 5;/* The UCC number, 1-7*/ + cell-index = 5; /* The UCC number, 1-7*/ port-number = 0; /* Which ttyQEx device */ soft-uart; /* We need Soft-UART */ reg = 0x2400 0x200; diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts index ea7fcbf..179c81c 100644 --- a/arch/powerpc/boot/dts/mpc832x_rdb.dts +++
Re: Kernel oops while duming user core.
On Thu, Jan 31, 2008 at 10:15:27AM -0600, Nathan Lynch wrote: Rune Torgersen wrote: Hi I get the following kernel core while a user program I have is dumping core. Any DIeas at what to look for? (this is runnign 2.6.24, arch/powerpc on a 8280) When runnign the program on 2.6.18 arch/ppc, the program gets a sig 11 and dumps core. On 2.6.24, I ghet the kernel oops, and then the program hangs sround forever and is unkillable. Hmm, this is the second report of 2.6.24 crashing in __flush_dcache_icache during a core dump; see: http://ozlabs.org/pipermail/linuxppc-dev/2007-December/048662.html Is this easily recreatable? Yes, this program does it reliably: #include pthread.h #include stdio.h #include unistd.h #include signal.h void *threadfn(void *arg) { fprintf(stderr, threadfn\n); fflush(stderr); sleep(1); *(char *)0=0; return NULL; } int main(void) { pthread_t thread[4]; int i; for (i = 0; i 4; i++) pthread_create(thread[0], NULL, threadfn, NULL); for (;;); } ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] [POWERPC][NET][SERIAL] UCCs: replace device-id with cell-index
Anton Vorontsov wrote: On Fri, Feb 01, 2008 at 09:32:38AM -0600, Kumar Gala wrote: On Feb 1, 2008, at 9:01 AM, Anton Vorontsov wrote: It isn't used anywhere, so remove it. If we'll ever need something like this, we'll use compatible property instead. Signed-off-by: Anton Vorontsov [EMAIL PROTECTED] --- Rebased on top of recent tree. Documentation/powerpc/booting-without-of.txt |1 - arch/powerpc/boot/dts/mpc832x_mds.dts|3 --- arch/powerpc/boot/dts/mpc832x_rdb.dts|2 -- arch/powerpc/boot/dts/mpc836x_mds.dts|2 -- arch/powerpc/boot/dts/mpc8568mds.dts |2 -- 5 files changed, 0 insertions(+), 10 deletions(-) diff --git a/Documentation/powerpc/booting-without-of.txt b/ Documentation/powerpc/booting-without-of.txt index 410c847..dcf9758 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt @@ -1675,7 +1675,6 @@ platforms are moved over to use the flattened- device-tree model. [EMAIL PROTECTED] { device_type = network; compatible = ucc_geth; - model = UCC; device-id = 1; can we change device-id to cell-index? Sure. But let's do this in the separate patch? Because this change actually touches the code in the two subsystems: net and serial. I hope everybody will agree to pass it through powerpc tree..? - - - - From: Anton Vorontsov [EMAIL PROTECTED] Subject: [POWERPC][NET][SERIAL] UCCs: replace device-id with cell-index device-id is worse than cell-index. Probably cell-index isn't good either, but device-id is worse anyway. Drivers are modified for backward compatibility's sake. Signed-off-by: Anton Vorontsov [EMAIL PROTECTED] --- Documentation/powerpc/booting-without-of.txt |4 ++-- arch/powerpc/boot/dts/mpc832x_mds.dts|4 +--- arch/powerpc/boot/dts/mpc832x_rdb.dts|2 -- arch/powerpc/boot/dts/mpc836x_mds.dts|2 -- arch/powerpc/boot/dts/mpc836x_rdk.dts| 12 ++-- arch/powerpc/boot/dts/mpc8568mds.dts |2 -- drivers/net/ucc_geth.c |8 +++- drivers/net/ucc_geth_mii.c | 11 --- drivers/serial/ucc_uart.c| 16 9 files changed, 36 insertions(+), 25 deletions(-) ACK drivers/net ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH for 2.6.25 1/2] [NET] ucc_geth: fix module removal
Anton Vorontsov wrote: - uccf should be set to NULL to not double-free memory on subsequent calls; - ind_hash_q and group_hash_q lists should be initialized in the probe() function, instead of struct_init() (called by open()), otherwise there will be an oops if ucc_geth_driver removed prior 'ifconfig ethX up'; - add unregister_netdev(); - reorder geth_remove() steps. Signed-off-by: Anton Vorontsov [EMAIL PROTECTED] --- Hi Li, You kinda promised that these two patches would hit 2.6.25... ;-) I've rebased the patches so they apply cleanly on the current tree. Thanks, drivers/net/ucc_geth.c | 17 ++--- 1 files changed, 10 insertions(+), 7 deletions(-) applied 1-2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] [POWERPC] Xilinx: hwicap driver
On 2/1/08, Stephen Neuendorffer [EMAIL PROTECTED] wrote: diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c new file mode 100644 index 000..83f2d0b --- /dev/null +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c +static int hwicap_open(struct inode *inode, struct file *file) +{ + struct hwicap_drvdata *drvdata; + int status; + + drvdata = container_of(inode-i_cdev, struct hwicap_drvdata, cdev); + + if (down_interruptible(drvdata-sem)) + return -ERESTARTSYS; + + drvdata-is_open = 1; It doesn't look like this flag is used anywhere anymore. + + status = hwicap_initialize_hwicap(drvdata); + if (status) { + dev_err(drvdata-dev, Failed to open file); + return status; returning without up() + } + + file-private_data = drvdata; + drvdata-write_buffer_in_use = 0; + drvdata-read_buffer_in_use = 0; + + up(drvdata-sem); + + return 0; +} + -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 1/5] ehea: fix ehea.h checkpatch complaints
Doug Maxey wrote: Cc: Jan-Bernd Themann [EMAIL PROTECTED] Signed-off-by: Doug Maxey [EMAIL PROTECTED] --- drivers/net/ehea/ehea.h|3 +++ drivers/net/ehea/ehea_hw.h |8 2 files changed, 7 insertions(+), 4 deletions(-) applied 1-5 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] ehea: fix sysfs link compile problem
Jan-Bernd Themann wrote: Due to changes in the struct device_driver there is no direct access to its kobj any longer. The kobj was used to create sysfs links between eHEA ethernet devices and the driver. This patch removes the affected sysfs links to resolve the build problems. Signed-off-by: Jan-Bernd Themann [EMAIL PROTECTED] --- drivers/net/ehea/ehea_main.c | 37 - 1 files changed, 0 insertions(+), 37 deletions(-) applied ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 4/5] ehea: fix phyp checkpatch complaints
On Thu, Jan 31, 2008 at 08:20:50PM -0600, Doug Maxey wrote: /* input param R5 */ -#define H_ALL_RES_QP_EQPO EHEA_BMASK_IBM(9, 11) -#define H_ALL_RES_QP_QPP EHEA_BMASK_IBM(12, 12) -#define H_ALL_RES_QP_RQR EHEA_BMASK_IBM(13, 15) -#define H_ALL_RES_QP_EQEG EHEA_BMASK_IBM(16, 16) -#define H_ALL_RES_QP_LL_QPEHEA_BMASK_IBM(17, 17) -#define H_ALL_RES_QP_DMA128 EHEA_BMASK_IBM(19, 19) -#define H_ALL_RES_QP_HSM EHEA_BMASK_IBM(20, 21) -#define H_ALL_RES_QP_SIGT EHEA_BMASK_IBM(22, 23) -#define H_ALL_RES_QP_TENURE EHEA_BMASK_IBM(48, 55) -#define H_ALL_RES_QP_RES_TYP EHEA_BMASK_IBM(56, 63) +#define H_ALL_RES_QP_EQPO EHEA_BMASK_IBM(9, 11) +#define H_ALL_RES_QP_QPP EHEA_BMASK_IBM(12, 12) +#define H_ALL_RES_QP_RQR EHEA_BMASK_IBM(13, 15) +#define H_ALL_RES_QP_EQEG EHEA_BMASK_IBM(16, 16) +#define H_ALL_RES_QP_LL_QP EHEA_BMASK_IBM(17, 17) +#define H_ALL_RES_QP_DMA128EHEA_BMASK_IBM(19, 19) +#define H_ALL_RES_QP_HSM EHEA_BMASK_IBM(20, 21) +#define H_ALL_RES_QP_SIGT EHEA_BMASK_IBM(22, 23) +#define H_ALL_RES_QP_TENUREEHEA_BMASK_IBM(48, 55) +#define H_ALL_RES_QP_RES_TYP EHEA_BMASK_IBM(56, 63) This was better the way it was (before, it was readable at any tab setting); checkpatch is overeager to complain on tab/space issues (it's a bit hard to distinguish indentation from alignment with a regex). -Scott ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [RFC/PATCH v2] [POWERPC] bootwrapper: build multiple cuImages
On 2/1/08, Stephen Neuendorffer [EMAIL PROTECTED] wrote: What if it was something like: image-$(CONFIG_MPC832x_MDS) += cuImage.mpc832x_mds image-$(CONFIG_MPC832x_RDB) += cuImage.mpc832x_rdb image-$(CONFIG_MPC834x_ITX) += cuImage.mpc8349emitx \ cuImage.mpc8349emitxgp platform-$(CONFIG_MPC83xx) += cuboot-83xx.o $(obj)/cuImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits) $(platform-y) $(call if_changed,wrap,$(platform-y),(dtstree)/$*.dts) Which would eliminate making all the unnecessary bits of platform code and enabling the smart bits to be factored out of the wrapper? It would also make the dependency between the board and the platform code specific.It would also prevent building more than one platform at a time, but I don't think that's really possibly anyway? It *is* possible, which is the goal of this patch. :-D There are only a few bits of non-multiplatform stuff left for 6xx compatible platforms and those won't take too long to clear out. The biggest part of the problem is the overloading of the cuImage.% target. If the wrapper was encoded in the target then the problem would go away. For example: image-$(CONFIG_LITE5200) += cuImage-52xx.lite5200b image-$(CONFIG_MPC832x_MDS) += cuImage-83xx.mpc832x_mds image-$(CONFIG_MPC832x_RDB) += cuImage-83xx.mpc832x_rdb image-$(CONFIG_MPC834x_ITX) += cuImage-83xx.mpc8349emitx \ cuImage-83xx.mpc8349emitxgp And then have targets for each of the cuImage-platform.%, like so: $(obj)/cuImage-52xx-%: vmlinux $(dtstree)/%.dts $(wrapperbits) $(call if_changed,wrap,cuboot-52xx,(dtstree)/$*.dts) $(obj)/cuImage-83xx-%: vmlinux $(dtstree)/%.dts $(wrapperbits) $(call if_changed,wrap,cuboot-83xx,(dtstree)/$*.dts) Cheers, g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
RE: [RFC/PATCH v2] [POWERPC] bootwrapper: build multiple cuImages
What if it was something like: image-$(CONFIG_MPC832x_MDS) += cuImage.mpc832x_mds image-$(CONFIG_MPC832x_RDB) += cuImage.mpc832x_rdb image-$(CONFIG_MPC834x_ITX) += cuImage.mpc8349emitx \ cuImage.mpc8349emitxgp platform-$(CONFIG_MPC83xx) += cuboot-83xx.o $(obj)/cuImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits) $(platform-y) $(call if_changed,wrap,$(platform-y),(dtstree)/$*.dts) Which would eliminate making all the unnecessary bits of platform code and enabling the smart bits to be factored out of the wrapper? It would also make the dependency between the board and the platform code specific.It would also prevent building more than one platform at a time, but I don't think that's really possibly anyway? Steve ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[RFC/PATCH] powerpc: Add irqtrace support to 32-bit powerpc
This adds the low level irq tracing hooks for 32-bit powerpc. This patch applies on top of Benjamin Herrenschmidt's patch that provides similar support for 64-bit powerpc. See http://ozlabs.org/pipermail/linuxppc-dev/2007-October/044361.html It seems to work on my prpmc2800 board with a ppc7447. Dale Farnsworth [EMAIL PROTECTED] --- arch/powerpc/Kconfig |1 - arch/powerpc/kernel/entry_32.S | 80 - arch/powerpc/kernel/setup_32.c |2 + include/asm-powerpc/hw_irq.h | 20 include/asm-powerpc/system.h |3 +- 5 files changed, 90 insertions(+), 16 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index c313e68..933e98b 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -52,7 +52,6 @@ config STACKTRACE_SUPPORT config TRACE_IRQFLAGS_SUPPORT bool - depends on PPC64 default y config LOCKDEP_SUPPORT diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 69a91bd..f7d2c75 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S @@ -144,6 +144,37 @@ transfer_to_handler: .globl transfer_to_handler_cont transfer_to_handler_cont: 3: +#ifdef CONFIG_TRACE_IRQFLAGS + lis r11,[EMAIL PROTECTED] + ori r11,r11,[EMAIL PROTECTED] + mtspr SPRN_SRR0,r11 + mtspr SPRN_SRR1,r10 + SYNC + RFI +reenable_mmu: /* re-enable mmu so we can */ + mflrr9 /* call C code, if necessary */ + mfmsr r10 + lwz r11,_MSR(r1) + xor r10,r10,r11 + andi. r10,r10,MSR_EE + beq 1f + stwur1,-16(r1) + stw r9,20(r1) + stw r3,12(r1) + bl trace_hardirqs_off + lwz r3,12(r1) + lwz r9,20(r1) + addir1,r1,16 + REST_GPR(4,r1) + REST_4GPRS(5,r1) +1: + tovirt(r9,r9) + lwz r11,0(r9) /* virtual address of handler */ + lwz r9,4(r9)/* where to go when done */ + mtctr r11 + mtlrr9 + bctr/* jump to handler */ +#else /* CONFIG_TRACE_IRQFLAGS */ mflrr9 lwz r11,0(r9) /* virtual address of handler */ lwz r9,4(r9)/* where to go when done */ @@ -152,6 +183,7 @@ transfer_to_handler_cont: mtlrr9 SYNC RFI /* jump to handler, enable MMU */ +#endif /* CONFIG_TRACE_IRQFLAGS */ #ifdef CONFIG_6xx 4: rlwinm r12,r12,0,~_TLF_NAPPING @@ -220,12 +252,20 @@ ret_from_syscall: #ifdef SHOW_SYSCALLS bl do_show_syscall_exit #endif - mr r6,r3 rlwinm r12,r1,0,0,(31-THREAD_SHIFT)/* current_thread_info() */ /* disable interrupts so current_thread_info()-flags can't change */ LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */ SYNC MTMSRD(r10) +#ifdef CONFIG_TRACE_IRQFLAGS + stwur1,-16(r1) + stw r3,12(r1) + bl trace_hardirqs_off + lwz r3,12(r1) + addir1,r1,16 + LOAD_MSR_KERNEL(r10,MSR_KERNEL) +#endif + mr r6,r3 lwz r9,TI_FLAGS(r12) li r8,-_LAST_ERRNO andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK) @@ -237,6 +277,13 @@ ret_from_syscall: orisr11,r11,0x1000 /* Set SO bit in CR */ stw r11,_CCR(r1) syscall_exit_cont: +#ifdef CONFIG_TRACE_IRQFLAGS + stwur1,-16(r1) + stw r3,12(r1) + bl trace_hardirqs_on + lwz r3,12(r1) + addir1,r1,16 +#endif #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) /* If the process has its own DBCR0 value, load it up. The single step bit tells us that dbcr0 should be loaded. */ @@ -337,7 +384,10 @@ syscall_exit_work: 4: /* Anything which requires enabling interrupts? */ andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP) beq ret_from_except - +#ifdef CONFIG_TRACE_IRQFLAGS + bl trace_hardirqs_on + LOAD_MSR_KERNEL(r10,MSR_KERNEL) +#endif /* Re-enable interrupts */ ori r10,r10,MSR_EE SYNC @@ -646,13 +696,22 @@ ret_from_except_full: .globl ret_from_except ret_from_except: +#ifdef CONFIG_TRACE_IRQFLAGS + mfmsr r3 +#endif /* Hard-disable interrupts so that current_thread_info()-flags * can't change between when we test it and when we return * from the interrupt. */ LOAD_MSR_KERNEL(r10,MSR_KERNEL) SYNC/* Some chip revs have problems here... */ MTMSRD(r10) /* disable interrupts */ - +#ifdef CONFIG_TRACE_IRQFLAGS + andi. r3,r3,MSR_EE + beq 1f /* verified */ + bl trace_hardirqs_off +
Re: [PATCH] [POWERPC] Xilinx: hwicap driver
On 2/1/08, Stephen Neuendorffer [EMAIL PROTECTED] wrote: This includes code for new fifo-based xps_hwicap in addition to the older opb_hwicap, which has a significantly different interface. The common code between the two drivers is largely shared. Significant differences exists between this driver and what is supported in the EDK drivers. In particular, most of the architecture-specific code for reconfiguring individual FPGA resources has been removed. This functionality is likely better provided in a user-space support library. In addition, read and write access is supported. In addition, although the xps_hwicap cores support interrupt-driver mode, this driver only supports polled operation, in order to make the code simpler, and since the interrupt processing overhead is likely to slow down the throughput under Linux. Signed-off-by: Stephen Neuendorffer [EMAIL PROTECTED] Fixed to add mutexes, and a few style issues. Inconsistent indentation (tabs vs. spaces) in some places. Otherwise: Acked-by: Grant Likely [EMAIL PROTECTED] g. +static int __devexit hwicap_remove(struct device *dev) +{ + struct hwicap_drvdata *drvdata; + + drvdata = (struct hwicap_drvdata *)dev_get_drvdata(dev); + + if (!drvdata) +return 0; + +class_device_destroy(icap_class, drvdata-devt); +cdev_del(drvdata-cdev); +iounmap(drvdata-base_address); +release_mem_region(drvdata-mem_start, drvdata-mem_size); +kfree(drvdata); +dev_set_drvdata(dev, NULL); +probed_devices[MINOR(dev-devt)-xhwicap_minor] = 0; + + return 0; /* success */ +} Here in particular -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [RFC/PATCH] powerpc: Add irqtrace support to 32-bit powerpc
On Fri, 2008-02-01 at 12:50 -0700, Dale Farnsworth wrote: This adds the low level irq tracing hooks for 32-bit powerpc. This patch applies on top of Benjamin Herrenschmidt's patch that provides similar support for 64-bit powerpc. See http://ozlabs.org/pipermail/linuxppc-dev/2007-October/044361.html Cool. Except that Ben's patch doesn't work for me on my quad G5 and I still haven't had time to figure out why... We should try to get this up for .26 now that we obviously missed .25. Anybody else have a quad G5 to test on? I can test this patch on my powerbook too. johannes signature.asc Description: This is a digitally signed message part ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH v2] 82xx: MGCOGE support
Heiko Schocher wrote: Hello, The following patch adds support for the mpc8247 based board MGCOGE from keymile. changes to the previous patchset: - Added the suggestions from Scott Wood: http://ozlabs.org/pipermail/linuxppc-dev/2008-January/050957.html - The patch http://ozlabs.org/pipermail/linuxppc-dev/2008-January/050931.html is no longer needed. Signed-off-by: Heiko Schocher [EMAIL PROTECTED] Acked-by: Scott Wood [EMAIL PROTECTED] -Scott ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 2/7] [POWERPC] Xilinx: clear data caches.
On 12/13/07, Stephen Neuendorffer [EMAIL PROTECTED] wrote: Unfortunately, I think your right... The asm code seems so clean at the moment, I don't really want be the one to start tarnishing it with a bunch of little fixups.. :) No problem, we can use a little shim that executes this stuff before going into crt0.S. I'm working on this right now. g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] Remove old definition of setup_per_cpu_areas
Remove old definition of setup_per_cpu_areas. The definition is done depending on the new config variable HAVE_SETUP_PER_CPU_AREA. Signed-off-by: Bastian Blank [EMAIL PROTECTED] diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h index cc1cbf6..f309d34 100644 --- a/include/asm-powerpc/percpu.h +++ b/include/asm-powerpc/percpu.h @@ -30,8 +30,6 @@ do { \ (src), (size)); \ } while (0) -extern void setup_per_cpu_areas(void); - #else /* ! SMP */ #define per_cpu(var, cpu) (*((void)(cpu), per_cpu__##var)) ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] Fix ext4 bitops
Fix ext4 bitops. Signed-off-by: Bastian Blank [EMAIL PROTECTED] diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h index 220d9a7..d0980df 100644 --- a/include/asm-powerpc/bitops.h +++ b/include/asm-powerpc/bitops.h @@ -363,6 +363,8 @@ unsigned long generic_find_next_le_bit(const unsigned long *addr, unsigned long size, unsigned long offset); /* Bitmap functions for the ext2 filesystem */ +#include asm-generic/bitops/le.h + #define ext2_set_bit(nr,addr) \ __test_and_set_le_bit((nr), (unsigned long*)addr) #define ext2_clear_bit(nr, addr) \ ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] Remove old definition of setup_per_cpu_areas
On Fri, Feb 01, 2008 at 09:16:15PM +0100, Bastian Blank wrote: Remove old definition of setup_per_cpu_areas. This was completely wrong. Lets try it again. Adopt x86 percpu changes for powerpc and ia64. dd5af90a7f3d79e04b7eace9a98644dbf2038f4d replaced the config variable ARCH_SETS_UP_PER_CPU_AREA with HAVE_SETUP_PER_CPU_AREA and moved percpu_modcopy into kernel/module.c. Do the same for ia64 and powerpc. | init/main.c:376: error: static declaration of ‘setup_per_cpu_areas’ follows non-static declaration | include/asm/percpu.h:33: error: previous declaration of ‘setup_per_cpu_areas’ was here Signed-off-by: Bastian Blank [EMAIL PROTECTED] diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 5a41e75..c9307c9 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -80,7 +80,7 @@ config GENERIC_TIME_VSYSCALL bool default y -config ARCH_SETS_UP_PER_CPU_AREA +config HAVE_SETUP_PER_CPU_AREA def_bool y config DMI diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c index e699eb6..bbcdcfd 100644 --- a/arch/ia64/kernel/module.c +++ b/arch/ia64/kernel/module.c @@ -941,13 +941,3 @@ module_arch_cleanup (struct module *mod) unw_remove_unwind_table(mod-arch.core_unw_table); } -#ifdef CONFIG_SMP -void -percpu_modcopy (void *pcpudst, const void *src, unsigned long size) -{ - unsigned int i; - for_each_possible_cpu(i) { - memcpy(pcpudst + per_cpu_offset(i), src, size); - } -} -#endif /* CONFIG_SMP */ diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index fb85f6b..bb16443 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -42,7 +42,7 @@ config GENERIC_HARDIRQS bool default y -config ARCH_SETS_UP_PER_CPU_AREA +config HAVE_SETUP_PER_CPU_AREA def_bool PPC64 config IRQ_PER_CPU diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig index 26f5791..73fc05d 100644 --- a/arch/sparc64/Kconfig +++ b/arch/sparc64/Kconfig @@ -66,7 +66,7 @@ config AUDIT_ARCH bool default y -config ARCH_SETS_UP_PER_CPU_AREA +config HAVE_SETUP_PER_CPU_AREA def_bool y config ARCH_NO_VIRT_TO_BUS diff --git a/include/asm-ia64/percpu.h b/include/asm-ia64/percpu.h index 0095bcf..a4af49f 100644 --- a/include/asm-ia64/percpu.h +++ b/include/asm-ia64/percpu.h @@ -38,8 +38,9 @@ DECLARE_PER_CPU(unsigned long, local_per_cpu_offset); #define __get_cpu_var(var) (*RELOC_HIDE(per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset))) #define __raw_get_cpu_var(var) (*RELOC_HIDE(per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset))) -extern void percpu_modcopy(void *pcpudst, const void *src, unsigned long size); +#ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA extern void setup_per_cpu_areas (void); +#endif extern void *per_cpu_init(void); #else /* ! SMP */ diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h index cc1cbf6..ea8cbb7 100644 --- a/include/asm-powerpc/percpu.h +++ b/include/asm-powerpc/percpu.h @@ -21,16 +21,9 @@ #define __get_cpu_var(var) (*RELOC_HIDE(per_cpu__##var, __my_cpu_offset())) #define __raw_get_cpu_var(var) (*RELOC_HIDE(per_cpu__##var, local_paca-data_offset)) -/* A macro to avoid #include hell... */ -#define percpu_modcopy(pcpudst, src, size) \ -do { \ - unsigned int __i; \ - for_each_possible_cpu(__i) \ - memcpy((pcpudst)+__per_cpu_offset(__i), \ - (src), (size)); \ -} while (0) - +#ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA extern void setup_per_cpu_areas(void); +#endif #else /* ! SMP */ ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [patch v6 1/4] USB: add Cypress c67x00 low level interface code
On Tuesday 29 January 2008, Peter Korsgaard wrote: This patch adds the low level support code for the Cypress c67x00 family of OTG controllers. The low level code is responsible for register access and implements the software protocol for communicating with the 16bit microcontroller inside the c67x00 device. Communication is done over the HPI interface (16bit SRAM-like parallel bus). Signed-off-by: Peter Korsgaard [EMAIL PROTECTED] If you fix the issues I note below: Acked-by: David Brownell [EMAIL PROTECTED] +/** + * struct c67x00_sie - Common data associated with a SIE + * @lock: lock to protect this struct and the associated chip registers + * @private_data: subdriver dependent data + * @irq: subdriver dependent irq handler, set NULL when not used + * @dev: link to common driver structure + * @sie_num: SIE number on chip, starting from 0 + * @mode: SIE mode (host/peripheral/otg/not used) + */ +struct c67x00_sie { + /* Entries to be used by the subdrivers */ + spinlock_t lock;/* protect this structure */ + void *private_data; + void (*irq) (struct c67x00_sie *sie, u16 int_status, u16 msg); + + /* Read only: */ + struct c67x00_device *dev; + int sie_num; + int mode; +}; In the C file: +static inline u16 hpi_read_word(struct c67x00_device *dev, u16 reg) +{ + u16 value; + unsigned long flags; + + spin_lock_irqsave(dev-hpi.lock, flags); + value = hpi_read_word_nolock(dev, reg); + spin_unlock_irqrestore(dev-hpi.lock, flags); + + return value; +} + +static inline void hpi_write_word_nolock(struct c67x00_device *dev, u16 reg, + u16 value) +{ + hpi_write_reg(dev, HPI_ADDR, reg); + hpi_write_reg(dev, HPI_DATA, value); +} + +static inline void hpi_write_word(struct c67x00_device *dev, u16 reg, u16 value) +{ + unsigned long flags; + + spin_lock_irqsave(dev-hpi.lock, flags); + hpi_write_word_nolock(dev, reg, value); + spin_unlock_irqrestore(dev-hpi.lock, flags); +} + +/* + * Only data is little endian, addr has cpu endianess + */ +static inline void hpi_write_words_le16(struct c67x00_device *dev, u16 addr, + u16 *data, u16 count) +{ + unsigned long flags; + int i; + + spin_lock_irqsave(dev-hpi.lock, flags); + + hpi_write_reg(dev, HPI_ADDR, addr); + for (i = 0; i count; i++) + hpi_write_reg(dev, HPI_DATA, cpu_to_le16(*data++)); + + spin_unlock_irqrestore(dev-hpi.lock, flags); +} + +/* + * Only data is little endian, addr has cpu endianess + */ +static inline void hpi_read_words_le16(struct c67x00_device *dev, u16 addr, +u16 *data, u16 count) +{ + unsigned long flags; + int i; + spin_lock_irqsave(dev-hpi.lock, flags); + hpi_write_reg(dev, HPI_ADDR, addr); + for (i = 0; i count; i++) + *data++ = le16_to_cpu(hpi_read_reg(dev, HPI_DATA)); + + spin_unlock_irqrestore(dev-hpi.lock, flags); +} + +static inline void hpi_set_bits(struct c67x00_device *dev, u16 reg, u16 mask) +{ + u16 value; + unsigned long flags; + + spin_lock_irqsave(dev-hpi.lock, flags); + value = hpi_read_word_nolock(dev, reg); + hpi_write_word_nolock(dev, reg, value | mask); + spin_unlock_irqrestore(dev-hpi.lock, flags); +} + +static inline void hpi_clear_bits(struct c67x00_device *dev, u16 reg, u16 mask) +{ + u16 value; + unsigned long flags; + + spin_lock_irqsave(dev-hpi.lock, flags); + value = hpi_read_word_nolock(dev, reg); + hpi_write_word_nolock(dev, reg, value ~mask); + spin_unlock_irqrestore(dev-hpi.lock, flags); +} + +static inline u16 hpi_recv_mbox(struct c67x00_device *dev) +{ + u16 value; + unsigned long flags; + + spin_lock_irqsave(dev-hpi.lock, flags); + value = hpi_read_reg(dev, HPI_MAILBOX); + spin_unlock_irqrestore(dev-hpi.lock, flags); + + return value; +} + +static inline u16 hpi_send_mbox(struct c67x00_device *dev, u16 value) +{ + unsigned long flags; + + spin_lock_irqsave(dev-hpi.lock, flags); + hpi_write_reg(dev, HPI_MAILBOX, value); + spin_unlock_irqrestore(dev-hpi.lock, flags); + + return value; +} Strike the inline from all the above, and let the compiler decide if the space savings are worthwhile. (I'd guess: mostly not.) Given icache, time savings are likely negligible. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [patch v6 2/4] USB: add Cypress c67x00 OTG controller core driver
On Tuesday 29 January 2008, Peter Korsgaard wrote: This patch add the core driver for the c67x00 USB OTG controller. The core driver is responsible for the platform bus binding and creating either USB HCD or USB Gadget instances for each of the serial interface engines on the chip. This driver does not directly implement the HCD or gadget behaviours; it just controls access to the chip. Signed-off-by: Peter Korsgaard [EMAIL PROTECTED] Acked-by: David Brownell [EMAIL PROTECTED] --- MAINTAINERS |6 + drivers/usb/c67x00/c67x00-drv.c | 232 include/linux/usb/c67x00.h | 48 3 files changed, 286 insertions(+) Index: linux-2.6/drivers/usb/c67x00/c67x00-drv.c === --- /dev/null +++ linux-2.6/drivers/usb/c67x00/c67x00-drv.c @@ -0,0 +1,232 @@ +/* + * c67x00-drv.c: Cypress C67X00 USB Common infrastructure + * + * Copyright (C) 2006-2008 Barco N.V. + *Derived from the Cypress cy7c67200/300 ezusb linux driver and + *based on multiple host controller drivers inside the linux kernel. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA. + */ + +/* + * This file implements the common infrastructure for using the c67x00. + * It is both the link between the platform configuration and subdrivers and + * the link between the common hardware parts and the subdrivers (e.g. + * interrupt handling). + * + * The c67x00 has 2 SIE's (serial interface engine) wich can be configured + * to be host, device or OTG (with some limitations, E.G. only SIE1 can be OTG). + * + * Depending on the platform configuration, the SIE's are created and + * the corresponding subdriver is initialized (c67x00_probe_sie). + */ + +#include linux/device.h +#include linux/list.h +#include linux/usb.h +#include linux/usb/c67x00.h +#include asm/io.h + +#include c67x00.h + +static void c67x00_probe_sie(struct c67x00_sie *sie, + struct c67x00_device *dev, int sie_num) +{ + spin_lock_init(sie-lock); + sie-dev = dev; + sie-sie_num = sie_num; + sie-mode = c67x00_sie_config(dev-pdata-sie_config, sie_num); + + switch (sie-mode) { + case C67X00_SIE_UNUSED: + dev_info(sie_dev(sie), + Not using SIE %d as requested\n, sie-sie_num); + break; + + default: + dev_err(sie_dev(sie), + Unsupported configuration: 0x%x for SIE %d\n, + sie-mode, sie-sie_num); + break; + } +} + +static void c67x00_remove_sie(struct c67x00_sie *sie) +{ +} + +static irqreturn_t c67x00_irq(int irq, void *__dev) +{ + struct c67x00_device *c67x00 = __dev; + struct c67x00_sie *sie; + u16 msg, int_status; + int i, count = 8; + + int_status = c67x00_ll_hpi_status(c67x00); + if (!int_status) + return IRQ_NONE; + + while (int_status != 0 (count-- = 0)) { + c67x00_ll_irq(c67x00, int_status); + for (i = 0; i C67X00_SIES; i++) { + sie = c67x00-sie[i]; + msg = 0; + if (int_status SIEMSG_FLG(i)) + msg = c67x00_ll_fetch_siemsg(c67x00, i); + if (sie-irq) + sie-irq(sie, int_status, msg); + } + int_status = c67x00_ll_hpi_status(c67x00); + } + + if (int_status) + dev_warn(c67x00-pdev-dev, Not all interrupts handled! + status = 0x%04x\n, int_status); + + return IRQ_HANDLED; +} + +/* - */ + +static int __devinit c67x00_drv_probe(struct platform_device *pdev) +{ + struct c67x00_device *c67x00; + struct c67x00_platform_data *pdata; + struct resource *res, *res2; + int ret, i; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return -ENODEV; + + res2 = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + if (!res2) + return -ENODEV; + + pdata =
Re: [PATCH] [POWERPC] fsl_soc: add support for fsl, immr compatible matching
On Fri, Feb 01, 2008 at 03:16:57PM -0600, Scott Wood wrote: Anton Vorontsov wrote: - [EMAIL PROTECTED] { + [EMAIL PROTECTED] { #address-cells = 1; #size-cells = 1; #interrupt-cells = 2; - device_type = soc; + compatible = fsl,mpc8540-immr, fsl,immr, simple-bus; ranges = e000 0010 reg = e000 3000; bus-frequency = 0; It's called CCSR rather than IMMR on 85xx. ^^ Theory. $ grep ccsr -r arch/powerpc/boot/dts/ $ $ grep immr -r arch/powerpc/boot/dts/ | grep 85 | cut -d: -f1 arch/powerpc/boot/dts/tqm8540.dts arch/powerpc/boot/dts/tqm8541.dts arch/powerpc/boot/dts/mpc8572ds.dts arch/powerpc/boot/dts/tqm8555.dts arch/powerpc/boot/dts/stx_gp3_8560.dts arch/powerpc/boot/dts/mpc885ads.dts arch/powerpc/boot/dts/tqm8560.dts ^^ Practice. :-) Maybe fsl,soc, finally? :-) I think soc, ccsr or immr doesn't really matter, what really matters is consistency. cpu-specific part of the -ccsr/-immr should be sufficient to distinct whether we're on 85xx or 83xx... -- Anton Vorontsov email: [EMAIL PROTECTED] backup email: [EMAIL PROTECTED] irc://irc.freenode.net/bd2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 1/3] powerpc: mpc832x_rdb: fix compiler warning
arch/powerpc/platforms/83xx/mpc832x_rdb.c: In function ‘mpc832x_rdb_setup_arch’: arch/powerpc/platforms/83xx/mpc832x_rdb.c:104: warning: ‘np’ is used uninitialized in this function Signed-off-by: Kim Phillips [EMAIL PROTECTED] --- arch/powerpc/platforms/83xx/mpc832x_rdb.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c index 9f0fd88..e7f706b 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c @@ -101,7 +101,7 @@ static void __init mpc832x_rdb_setup_arch(void) #ifdef CONFIG_QUICC_ENGINE qe_reset(); - if ((np = of_find_node_by_name(np, par_io)) != NULL) { + if ((np = of_find_node_by_name(NULL, par_io)) != NULL) { par_io_init(np); of_node_put(np); -- 1.5.2.2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 3/3] powerpc: mpc83xx_defconfig: enable math emulation and ucc_geth
and some PHYs mpc83xx boards use. Signed-off-by: Kim Phillips [EMAIL PROTECTED] --- arch/powerpc/configs/mpc83xx_defconfig | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/configs/mpc83xx_defconfig b/arch/powerpc/configs/mpc83xx_defconfig index 31bdbf3..a9807f0 100644 --- a/arch/powerpc/configs/mpc83xx_defconfig +++ b/arch/powerpc/configs/mpc83xx_defconfig @@ -186,7 +186,7 @@ CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT is not set CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set -# CONFIG_MATH_EMULATION is not set +CONFIG_MATH_EMULATION=y CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_ARCH_POPULATES_NODE_MAP=y @@ -416,14 +416,14 @@ CONFIG_PHYLIB=y # MII PHY device drivers # CONFIG_MARVELL_PHY=y -# CONFIG_DAVICOM_PHY is not set +CONFIG_DAVICOM_PHY=y # CONFIG_QSEMI_PHY is not set # CONFIG_LXT_PHY is not set # CONFIG_CICADA_PHY is not set -# CONFIG_VITESSE_PHY is not set +CONFIG_VITESSE_PHY=y # CONFIG_SMSC_PHY is not set # CONFIG_BROADCOM_PHY is not set -# CONFIG_ICPLUS_PHY is not set +CONFIG_ICPLUS_PHY=y # CONFIG_FIXED_PHY is not set # CONFIG_MDIO_BITBANG is not set CONFIG_NET_ETHERNET=y @@ -436,7 +436,7 @@ CONFIG_MII=y CONFIG_NETDEV_1000=y CONFIG_GIANFAR=y # CONFIG_GFAR_NAPI is not set -# CONFIG_UCC_GETH is not set +CONFIG_UCC_GETH=y CONFIG_NETDEV_1=y # -- 1.5.2.2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[RFC][POWERPC] bootwrapper: Add a firmware-independent simpleboot target.
From: Grant Likely [EMAIL PROTECTED] This target produces a flat binary rather than an ELF file, fixes the entry point at the beginning of the image, and takes a complete device tree with no fixups needed. Based on 'raw' target written by Scott Wood. Signed-off-by: Grant Likely [EMAIL PROTECTED] --- arch/powerpc/boot/Makefile |9 +++- arch/powerpc/boot/io.h |7 +++ arch/powerpc/boot/simpleboot.c | 88 arch/powerpc/boot/virtex405-head.S | 30 arch/powerpc/boot/wrapper |4 ++ 5 files changed, 137 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 836234b..c4156ea 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -40,6 +40,7 @@ $(obj)/ebony.o: BOOTCFLAGS += -mcpu=440 $(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=440 $(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=440 $(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405 +$(obj)/virtex405-head.o: BOOTCFLAGS += -mcpu=405 zlib := inffast.c inflate.c inftrees.c @@ -64,7 +65,7 @@ src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c cuboot-bamboo.c cuboot-mpc7448hpc2.c cuboot-taishan.c \ fixed-head.S ep88xc.c ep405.c \ cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \ - cuboot-warp.c cuboot-85xx-cpm2.c + cuboot-warp.c cuboot-85xx-cpm2.c simpleboot.c virtex405-head.S src-boot := $(src-wlib) $(src-plat) empty.c src-boot := $(addprefix $(obj)/, $(src-boot)) @@ -306,6 +307,12 @@ $(obj)/uImage: vmlinux $(wrapperbits) $(obj)/cuImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits) $(call if_changed,wrap,cuboot-$*,$(dtstree)/$*.dts) +$(obj)/simpleImage.initrd.%: vmlinux $(dtstree)/%.dts $(wrapperbits) + $(call if_changed,wrap,simpleboot-$*,$(dtstree)/$*.dts,,$(obj)/ramdisk.image.gz) + +$(obj)/simpleImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits) + $(call if_changed,wrap,simpleboot-$*,$(dtstree)/$*.dts) + $(obj)/treeImage.initrd.%: vmlinux $(dtstree)/%.dts $(wrapperbits) $(call if_changed,wrap,treeboot-$*,$(dtstree)/$*.dts,,$(obj)/ramdisk.image.gz) diff --git a/arch/powerpc/boot/io.h b/arch/powerpc/boot/io.h index ccaedae..ec57ec9 100644 --- a/arch/powerpc/boot/io.h +++ b/arch/powerpc/boot/io.h @@ -99,4 +99,11 @@ static inline void barrier(void) asm volatile( : : : memory); } +static inline void disable_irq(void) +{ + int dummy; + asm volatile(mfmsr %0; rlwinm %0, %0, 0, ~(115); mtmsr %0 : +=r (dummy) : : memory); +} + #endif /* _IO_H */ diff --git a/arch/powerpc/boot/simpleboot.c b/arch/powerpc/boot/simpleboot.c new file mode 100644 index 000..8c2440d --- /dev/null +++ b/arch/powerpc/boot/simpleboot.c @@ -0,0 +1,88 @@ +/* + * The simple platform -- for booting when firmware doesn't supply a device + *tree or any platform configuration information. + *All data is extracted from an embedded device tree + *blob. + * + * Authors: Scott Wood [EMAIL PROTECTED] + * Grant Likely [EMAIL PROTECTED] + * + * Copyright (c) 2007 Freescale Semiconductor, Inc. + * Copyright (c) 2008 Secret Lab Technologies Ltd. + * + * 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 types.h +#include io.h +#include stdio.h +#include libfdt/libfdt.h + +BSS_STACK(16*1024); +static char initial_heap[8*1024]; + +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, + unsigned long r6, unsigned long r7) +{ + const u32 *na, *ns, *reg, *timebase; + u64 memsize64; + int node, size, i; + + /* Allocate initial heap for probing the tree */ + simple_alloc_init(initial_heap, sizeof(initial_heap), 32, 64); + + /* Make sure FDT blob is sane */ + if (fdt_check_header(_dtb_start) != 0) + fatal(Invalid device tree blob\n); + + /* Find the #address-cells and #size-cells properties */ + node = fdt_path_offset(_dtb_start, /); + if (node 0) + fatal(Cannot find root node\n); + na = fdt_getprop(_dtb_start, node, #address-cells, size); + if (!na || (size != 4)) + fatal(Cannot find #address-cells property); + ns = fdt_getprop(_dtb_start, node, #size-cells, size); + if (!ns || (size != 4)) + fatal(Cannot find #size-cells property); + + /* Find the memory range */ + node = fdt_node_offset_by_prop_value(_dtb_start, -1, device_type, +memory, sizeof(memory)); + if (node 0) + fatal(Cannot find memory node\n); + reg = fdt_getprop(_dtb_start, node, reg,
[PATCH 1/1] [PPC] 8xx swap bug-fix
Hello, Here is the patch which makes Linux-2.6 swap routines operate correctly on the ppc-8xx-based machines. Signed-off-by: Yuri Tikhonov [EMAIL PROTECTED] -- diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S index eb8d26f..321bda2 100644 --- a/arch/ppc/kernel/head_8xx.S +++ b/arch/ppc/kernel/head_8xx.S @@ -329,8 +329,18 @@ InstructionTLBMiss: mfspr r11, SPRN_MD_TWC/* and get the pte address */ lwz r10, 0(r11) /* Get the pte */ +#ifdef CONFIG_SWAP + /* do not set the _PAGE_ACCESSED bit of a non-present page */ + andi. r11, r10, _PAGE_PRESENT + beq 4f + ori r10, r10, _PAGE_ACCESSED + mfspr r11, SPRN_MD_TWC/* get the pte address again */ + stw r10, 0(r11) +4: +#else ori r10, r10, _PAGE_ACCESSED stw r10, 0(r11) +#endif /* The Linux PTE won't go exactly into the MMU TLB. * Software indicator bits 21, 22 and 28 must be clear. @@ -395,8 +405,17 @@ DataStoreTLBMiss: DO_8xx_CPU6(0x3b80, r3) mtspr SPRN_MD_TWC, r11 - mfspr r11, SPRN_MD_TWC/* get the pte address again */ +#ifdef CONFIG_SWAP + /* do not set the _PAGE_ACCESSED bit of a non-present page */ + andi. r11, r10, _PAGE_PRESENT + beq 4f + ori r10, r10, _PAGE_ACCESSED +4: + /* and update pte in table */ +#else ori r10, r10, _PAGE_ACCESSED +#endif + mfspr r11, SPRN_MD_TWC/* get the pte address again */ stw r10, 0(r11) /* The Linux PTE won't go exactly into the MMU TLB. @@ -575,7 +594,16 @@ DataTLBError: /* Update 'changed', among others. */ +#ifdef CONFIG_SWAP + ori r10, r10, _PAGE_DIRTY|_PAGE_HWWRITE + /* do not set the _PAGE_ACCESSED bit of a non-present page */ + andi. r11, r10, _PAGE_PRESENT + beq 4f + ori r10, r10, _PAGE_ACCESSED +4: +#else ori r10, r10, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE +#endif mfspr r11, SPRN_MD_TWC/* Get pte address again */ stw r10, 0(r11) /* and update pte in table */ diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index c159315..76717ff 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h @@ -341,14 +341,6 @@ extern unsigned long ioremap_bot, ioremap_base; #define _PMD_PAGE_MASK 0x000c #define _PMD_PAGE_8M 0x000c -/* - * The 8xx TLB miss handler allegedly sets _PAGE_ACCESSED in the PTE - * for an address even if _PAGE_PRESENT is not set, as a performance - * optimization. This is a bug if you ever want to use swap unless - * _PAGE_ACCESSED is 2, which it isn't, or unless you have 8xx-specific - * definitions for __swp_entry etc. below, which would be gross. - * -- paulus - */ #define _PTE_NONE_MASK _PAGE_ACCESSED #else /* CONFIG_6xx */ -- Yuri Tikhonov, Senior Software Engineer Emcraft Systems, www.emcraft.com ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev