LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: libfdt: Abolish _typed() variants, add _cell() variants
From: Jon Loeliger @ 2007-11-20 15:06 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20071120023546.GA4356@localhost.localdomain>

So, like, the other day David Gibson mumbled:
> In a number of places through libfdt and its tests, we have *_typed()
> macro variants on functions which use gcc's typeof and statement
> expression extensions to allow passing literals where the underlying
> function takes a buffer and size.
> 
> These seemed like a good idea at the time, but in fact they have some
> problems.  They use typeof and statement expressions, extensions I'd
> prefer to avoid for portability.  Plus, they have potential gotchas -
> although they'll deal with the size of the thing passed, they won't
> deal with other representation issues (like endianness) and results
> could be very strange if the type of the expression passed isn't what
> you think it is.
> 
> In fact, the only users of these _typed() macros were when the value
> passed is a single cell (32-bit integer).  Therefore, this patch
> removes all these _typed() macros and replaces them with explicit
> _cell() variants which handle a single 32-bit integer, and which also
> perform endian convesions as appropriate.
> 
> With this in place, it now becomes easy to use standardized big-endian
> representation for integer valued properties in the testcases,
> regardless of the platform we're running on.  We therefore do that,
> which has the additional advantage that all the example trees created
> during a test run are now byte-for-byte identical regardless of
> platform.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Applied.

jdl

^ permalink raw reply

* Re: dtc: Add testcases for tree checks
From: Jon Loeliger @ 2007-11-20 15:09 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20071120052423.GC4356@localhost.localdomain>

So, like, the other day David Gibson mumbled:
> This patch adds a group of testcases to check that dtc correctly
> rejects trees with various structural errors.
> 
> To make things easier to test, we change dtc so that failing checks
> (as opposed to other errors) result in exit code 2.
> 
> This patch also fixes an embarrasing bug uncovered by these new tests:
> check_phandles() worked out if the tree's phandles were valid, then
> throws that information away and returns success always.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> 
> NOTE! jdl, you'll need to chmod +x tests/dtc-checkfails.sh before you
> git commit this - it's a new shell script and patch can't encode the
> permissions info.
> 
> Index: dtc/tests/dup-nodename.dts
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ dtc/tests/dup-nodename.dts	2007-11-20 16:02:22.000000000 +1100


Actually, this is the official third time now that it would have
been significantly nicer had you been using git for patches as
it does correctly handle excute permissions properly in patches.

And, it allows for side-band commentary such as your NOTE!, above,
to be included in the patch mail, but not in the patch log itself
such that it too doesn't have to be "git commit --amend"'ed out
as well.

In any event, Applied and Adjusted.

jdl

^ permalink raw reply

* Re: dtc: Don't use env(1) in testsuite
From: Jon Loeliger @ 2007-11-20 15:09 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20071120111412.GA13156@localhost.localdomain>

So, like, the other day David Gibson mumbled:
> The run_tests.sh script currently invokes the testcase binaries via
> env(1).  This behaviour is inherited from the libhugetlbfs testsuite
> which uses this approach to easily set various configuration
> environment variables in testcases.
> 
> We don't use that for dtc, and are unlikely to ever want to.
> Therefore this patch removes that technique, which substantially
> speeds up the testsuite.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Applied.

jdl

^ permalink raw reply

* ML403 USB driver
From: Lorenz Kolb @ 2007-11-20 15:21 UTC (permalink / raw)
  To: linuxppc-embedded


Hi,

we just tried the USB driver (from Peter Korsgaard) from Grant's virtex
tree.

Nevertheless we could not get the peripheral ports work as gadgets.
Has anyone tried (and probably fixed) that before?

Anyway, only one of the two peripheral ports seems to be active.

We use kernel 2.6.22 (as some usb related stuff has recently changed and the
driver would have to be changed), usb host works (usb-storage, cdc_ether,
some more stuff we tested)

Regards,

Lorenz Kolb
-- 
View this message in context: http://www.nabble.com/ML403-USB-driver-tf4844098.html#a13858912
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* Re: [PATCH 0/5] fixups for mpc8360 rev. 2.1 erratum #2 (RGMII Timing)
From: Kumar Gala @ 2007-11-20 15:27 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, paulus, Li Yang, linuxppc-dev
In-Reply-To: <4742389E.5080700@pobox.com>


On Nov 19, 2007, at 7:30 PM, Jeff Garzik wrote:

> Kim Phillips wrote:
>> On Mon, 5 Nov 2007 12:15:30 -0600
>> Kim Phillips <kim.phillips@freescale.com> wrote:
>>> Hello all,
>>>
>>> the following patches fix RGMII timing for rev. 2.1 of the mpc8360,
>>> according to erratum #2 (erratum text included below).  Basically  
>>> the
>>> most intrusive part is the addition of two new RGMII Internal Delay
>>> modes; one for TX delay only, and the other for RX delay only  
>>> (i.e, not
>>> both at the same time).
>>>
>>> Please review, and since this affects both netdev and powerpc trees,
>>> one maintainer should ack them for the other to push upstream (i.e,
>>> Kumar acks them, and Leo picks them up to go through netdev or the
>>> other way around; either way is fine with me).  I'm hoping they're
>>> trivial enough to go in 2.6.24.
>>>
>> Kumar, Leo, re-ping due to (a) it's been 2 weeks and (b) Anton  
>> Vorontsov has since
>> issued his Tested-by.
>> Might I suggest Kumar ack the powerpc patches, and Leo/Jeff apply 5/5
>> to go through netdev?
>
> FWIW I just got back from vacation...  I'm grabbing what DaveM has  
> collected into davem/netdev-2.6.git, and then going from there...

Jeff,

I've pulled and pushed the arch/powepc bits of these fixes.  I leave  
the PHYY and driver bits to you.

- k

^ permalink raw reply

* Re: ML403 USB driver
From: Grant Likely @ 2007-11-20 15:31 UTC (permalink / raw)
  To: Lorenz Kolb; +Cc: linuxppc-embedded
In-Reply-To: <13858912.post@talk.nabble.com>

On 11/20/07, Lorenz Kolb <linuxppcemb@lkmail.de> wrote:
>
> Hi,
>
> we just tried the USB driver (from Peter Korsgaard) from Grant's virtex
> tree.
>
> Nevertheless we could not get the peripheral ports work as gadgets.
> Has anyone tried (and probably fixed) that before?

That driver does not work for gadget ports.

>
> Anyway, only one of the two peripheral ports seems to be active.

Yes, I've got that problem here too.  I haven't yet solved it.  Any
help would be appreciated.

> We use kernel 2.6.22 (as some usb related stuff has recently changed and the
> driver would have to be changed), usb host works (usb-storage, cdc_ether,
> some more stuff we tested)

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: Please pull from 'for-2.6.24' branch
From: Kim Phillips @ 2007-11-20 15:52 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <Pine.LNX.4.64.0711192355460.1265@blarg.am.freescale.net>

On Mon, 19 Nov 2007 23:56:23 -0600 (CST)
Kumar Gala <galak@kernel.crashing.org> wrote:

> Kim Phillips (4):
>       [POWERPC] 83xx: mpc832x mds: Fix board PHY reset code
>       [POWERPC] 83xx: Fix 2nd UCC entry in mpc832x_mds.dts
>       [POWERPC] Document rgmii-rxid and rgmii-txid phy-connection-types
>       [POWERPC] 83xx: Handle mpc8360 rev. 2.1 RGMII timing erratum
>

Hi Kumar,

thanks for applying these, here's one you missed:

http://patchwork.ozlabs.org/linuxppc/patch?id=14651

Kim

^ permalink raw reply

* [PATCH try2] powerpc: Add support for PORTA and PORTB odr registers
From: Jochen Friedrich @ 2007-11-20 17:17 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: paulus, linux-kernel

PORTA and PORTB have odr registers, as well. However, the PORTB odr
register is only 16bit.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
 arch/powerpc/sysdev/commproc.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index d5a0dcf..c0d00c2 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -411,7 +411,7 @@ EXPORT_SYMBOL(cpm_dpram_phys);
 #endif /* !CONFIG_PPC_CPM_NEW_BINDING */

 struct cpm_ioport16 {
-	__be16 dir, par, sor, dat, intr;
+	__be16 dir, par, odr_sor, dat, intr;
 	__be16 res[3];
 };

@@ -441,6 +441,13 @@ static void cpm1_set_pin32(int port, int pin, int flags)
 	else
 		clrbits32(&iop->par, pin);

+	if (port == CPM_PORTB) {
+		if (flags & CPM_PIN_OPENDRAIN)
+			setbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin);
+		else
+			clrbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin);
+	}
+
 	if (port == CPM_PORTE) {
 		if (flags & CPM_PIN_SECONDARY)
 			setbits32(&iop->sor, pin);
@@ -474,11 +481,17 @@ static void cpm1_set_pin16(int port, int pin, int flags)
 	else
 		clrbits16(&iop->par, pin);

+	if (port == CPM_PORTA) {
+		if (flags & CPM_PIN_OPENDRAIN)
+			setbits16(&iop->odr_sor, pin);
+		else
+			clrbits16(&iop->odr_sor, pin);
+	}
 	if (port == CPM_PORTC) {
 		if (flags & CPM_PIN_SECONDARY)
-			setbits16(&iop->sor, pin);
+			setbits16(&iop->odr_sor, pin);
 		else
-			clrbits16(&iop->sor, pin);
+			clrbits16(&iop->odr_sor, pin);
 	}
 }

-- 
1.5.3.4

^ permalink raw reply related

* [PATCH] powerpc: Change _tlbie arguments to reflect new API
From: Jochen Friedrich @ 2007-11-20 17:21 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: paulus, linux-kernel

A new pid argument has been added to _tlbie for 4xx platforms.
Add this argument to the 8xx path in mem.c, as well. As 8xx
does not need th epid information, this argument can always be 0.

Signed-off-by: Jochen Friedrich <jochen@scram.de>

  CC      arch/powerpc/mm/mem.o
arch/powerpc/mm/mem.c: In function 'update_mmu_cache':
arch/powerpc/mm/mem.c:467: error: too few arguments to function '_tlbie'
make[1]: *** [arch/powerpc/mm/mem.o] Error 1
make: *** [arch/powerpc/mm] Error 2
---
 arch/powerpc/mm/mem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 81eb96e..e07852e 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -464,7 +464,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
 		 * we invalidate the TLB here, thus avoiding dcbst
 		 * misbehaviour.
 		 */
-		_tlbie(address);
+		_tlbie(address, 0);
 #endif
 		if (!PageReserved(page)
 		    && !test_bit(PG_arch_1, &page->flags)) {
-- 
1.5.3.4

^ permalink raw reply related

* Re: [PATCH] powerpc: Change _tlbie arguments to reflect new API
From: Josh Boyer @ 2007-11-20 18:14 UTC (permalink / raw)
  To: Jochen Friedrich; +Cc: paulus, linux-kernel, linuxppc-embedded
In-Reply-To: <47431799.6010802@scram.de>

On Tue, 20 Nov 2007 18:21:29 +0100
Jochen Friedrich <jochen@scram.de> wrote:

> A new pid argument has been added to _tlbie for 4xx platforms.
> Add this argument to the 8xx path in mem.c, as well. As 8xx
> does not need th epid information, this argument can always be 0.

This is already fixed in Paul's tree.

josh

^ permalink raw reply

* Re: 2.6 kernel hangs after loading device tree
From: charanya venkatraman @ 2007-11-20 18:59 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,
      I got a solution to this.The problem was with the current speed
parameter in the DTS,as stated.You need to explicity specify the
speed.It doesnot get filled in from U-boot.You can also probabaly
check the kernel log buf to see what values are set for these
parameters.Anyways,changing the current speed made it work me and my
2.6 kernel is now up.

Thanks.
Charanya.



> Date: Mon, 19 Nov 2007 16:08:03 -0800 (PST)
> From: abhi_linux <seema.pm@gmail.com>
> Subject: Re: 2.6 kernel hangs after loading device tree
> To: linuxppc-embedded@ozlabs.org
> Message-ID: <13848328.post@talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hello
> Did u get a solution to this? I have similar issues. How do u enable
> debugging in UBoot?
> Thanks
>
> charanya venkatraman wrote:
> >
> > Hi all
> >        Sorry about the previous mail.Got sent  by mistake.
> >
> > Iam using the 2.6.22.5 kernel on MPC 8560 and MPC8540 on my custom
> > board.Mykernel hangs after loading the device tree in both the
> > processors .There is
> > no output on the serial port after loading the device tree.Am using U-boot
> > 1.2.0 as the bootloader.After enabling debug in u-boot i could see that
> > the
> > control is getting transferred to the kernel after which it hangs.Earlier
> > i
> > tried using 2.6.21 which also hangs at the same point.The config files
> > used
> > were MPC8540ADS_defconfig and MPC8560ADS_defconfig under powerpc
> > directory.
> > The changes that were made to the device tree are:
> > 1.The reg and ranges properties of the soc node have been changed to
> > account
> > for the change in CCSRBAR of my board.
> > 2.Removed the PCI,mdio nodes and ethernet nodes since i dont need support
> > for these as of now.
> >
> > I have tried the following console arguments:
> > MPC8540: bootargs root=/dev/ram rw console=ttyS0,115200
> > MPC8560:bootargs root=/dev/ram rw console=ttyCPM0,115200
> >
> > Any help on this issue??
> >
> > Thanks.
> > Charanya.

^ permalink raw reply

* Re: [PATCH] [POWERPC] Emulate isel (Integer Select) instruction
From: Scott Wood @ 2007-11-20 17:54 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0711192135460.24923@blarg.am.freescale.net>

On Mon, Nov 19, 2007 at 09:36:57PM -0600, Kumar Gala wrote:
> isel (Integer Select) is a new user space instruction in the
> PowerISA 2.04 spec.  Not all processors implement it so lets emulate
> to ensure code built with isel will run everywhere.

Given that the instruction is meant to be a performance enhancement,
we should probably warn the first few times it's emulated, so the user
knows they should change their toolchain setup if possible.

-Scott

^ permalink raw reply

* Xilinx EDK BSP generation of device trees for microblaze and PowerPC
From: Stephen Neuendorffer @ 2007-11-20 19:44 UTC (permalink / raw)
  To: microblaze-uclinux, linuxppc-dev, Grant Likely, Michal Simek

=09
I've updated some code from Michel Simek to generate Flat Device Trees
from Xilinx EDK projects.  This code is now hosted at:
git://git.xilinx.com/gen-mhs-devtree.git

This has one major advantage over the gen-mhs-devtree.py approach:
default IP core parameters that are not specified in the mhs file can
now be generated, since EDK pulls these in from the core .mpd file.
I've also managed to incorporate a few more improvements from the
previous review, so the BSP generator should include at least as much
information as gen-mhs-devtree.py

The next major order of business is to represent the DMA engines in the
MPMC and locallink connections to the lltemac.

Steve

^ permalink raw reply

* USB failure on mpc8347 based board
From: Grant Likely @ 2007-11-20 20:26 UTC (permalink / raw)
  To: linuxppc-dev, Kim Phillips

I'm seeing the following error on an MPC8347 based board.  The
physical board is wired up with the fsl-usb2-dr controller setup as a
USB device using port0 and fsl-usb2-mph as a USB host using port1.
The EHCI driver fails with the following error when initializing the
fsl-usb2-mph controller:

In particular I'm wondering if anyone knows the cause of "HC died; cleaning up".

The board has a hard wired USB hub connected to port1, and the host
controller seems to be dying while probing that device.

Cheers,
g.

[    0.754259] usbmon: debugfs is not available
[    0.758862] fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
[    0.765948] fsl-ehci fsl-ehci.0: new USB bus registered, assigned
bus number 1
[    0.795863] fsl-ehci fsl-ehci.0: irq 39, io base 0xe0022000
[    0.801475] fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00, driver
10 Dec 2004
[    0.809948] usb usb1: configuration #1 chosen from 1 choice
[    0.815971] hub 1-0:1.0: USB hub found
[    0.819778] hub 1-0:1.0: 2 ports detected
[    0.928972] USB Universal Host Controller Interface driver v3.0
[    0.935257] Initializing USB Mass Storage driver...
[    1.167836] usb 1-1: new high speed USB device using fsl-ehci and address 2
[    1.175150] fsl-ehci fsl-ehci.0: fatal error
[    1.179467] fsl-ehci fsl-ehci.0: HC died; cleaning up
[    1.184585] hub 1-0:1.0: cannot reset port 1 (err = -19)
[    1.189934] hub 1-0:1.0: cannot disable port 1 (err = -19)
[    1.195465] hub 1-0:1.0: cannot reset port 1 (err = -19)
[    1.200809] hub 1-0:1.0: cannot disable port 1 (err = -19)
[    1.206327] hub 1-0:1.0: cannot reset port 1 (err = -19)
[    1.211666] hub 1-0:1.0: cannot disable port 1 (err = -19)
[    1.217189] hub 1-0:1.0: cannot reset port 1 (err = -19)
[    1.222527] hub 1-0:1.0: cannot disable port 1 (err = -19)
[    1.228044] hub 1-0:1.0: cannot disable port 1 (err = -19)
[    1.233558] hub 1-0:1.0: hub_port_status failed (err = -19)
[    1.239246] usbcore: registered new interface driver usb-storage


-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* linux2.6.19.2-> mpc8xx_wdt.c: timeout extended to reach several seconds... but I have a problem
From: DI BACCO ANTONIO - technolabs @ 2007-11-20 20:26 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 6398 bytes --]


Till yesterday I thought I was able to code a simple driver but now I'm facing a problem that is puzzling me.

I added a kernel timer (triggering every 500 ms) to reset the watchdog of mpc8xx. This timer starts when the driver is opened. The timer is rearmed till a counter reaches a zero value. A process can use the write method of the driver to set the counter to a preferred value. If the application misses to set the counter, it will decrease to zero and then the board will restart.

Unfortunately as soon as my application "calls" the write method the kernel freezes. If the watchdog is enabled the board restarts otherwise the kernel remains blocked forever without any indication. Even if I empty the write method leaving only the get_user the board freezes. Below you can find the code, if anyone has an hint I would really appreciate his advice:

___________________________________________________________________________________
/*
 * mpc8xx_wdt.c - MPC8xx watchdog userspace interface
 *
 * Author: Florian Schirmer <jolt@tuxbox.org>
 *
 * 2002 (c) Florian Schirmer <jolt@tuxbox.org> 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/fs.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/watchdog.h>
#include <asm/8xx_immap.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <syslib/m8xx_wdt.h>

#define KTIMER_TIMEOUT  (HZ/2)

static struct timer_list wd_timer;	/* structure for timer administration		*/
static unsigned long mpc8xx_wdt_dummy;
static int timer_count = 600;
static unsigned long wdt_opened;
static int wdt_status;
static spinlock_t counter_spinlock;

static void mpc8xx_wdt_handler_disable(void)
{
	volatile ushort __iomem *piscr;
	piscr = (ushort *)&((immap_t*)IMAP_ADDR)->im_sit.sit_piscr;

	if (!m8xx_has_internal_rtc)
		m8xx_wdt_stop_timer();
	else
		out_be16(piscr, in_be16(piscr) & ~(PISCR_PIE | PISCR_PTE));

	printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler deactivated\n");
}

static void mpc8xx_wdt_handler_enable(void)
{
	volatile ushort __iomem *piscr;
	piscr = (ushort *)&((immap_t*)IMAP_ADDR)->im_sit.sit_piscr;

	if (!m8xx_has_internal_rtc)
		m8xx_wdt_install_timer();
	else
		out_be16(piscr, in_be16(piscr) | PISCR_PIE | PISCR_PTE);

	printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler activated\n");
}



static int mpc8xx_wdt_open(struct inode *inode, struct file *file)
{
	if (test_and_set_bit(0, &wdt_opened))
		return -EBUSY;

	m8xx_wdt_reset();

        wd_timer.expires = jiffies + KTIMER_TIMEOUT;   
        add_timer (&wd_timer);	/* ...re-activate timer */ 
    
	mpc8xx_wdt_handler_disable();

	return 0;
}

static int mpc8xx_wdt_release(struct inode *inode, struct file *file)
{
	m8xx_wdt_reset();

#if !defined(CONFIG_WATCHDOG_NOWAYOUT)
	mpc8xx_wdt_handler_enable();
#endif

	clear_bit(0, &wdt_opened);

	return 0;
}

static void mpc8xx_wdt_ktimer_handler(unsigned long data)
{
    int counter;
    
    spin_lock(&counter_spinlock);
    counter = timer_count--;
    spin_unlock(&counter_spinlock);
    
    
    printk("Counter %d\n", counter);
    
    if (counter > 0)
    {
      wd_timer.expires = jiffies + KTIMER_TIMEOUT;   
      add_timer (&wd_timer);	/* ...re-activate timer */ 
      m8xx_wdt_reset();
    }
    else
    {
      printk(KERN_NOTICE "mpc8xx_wdt: Watchdog expired ... restarting\n");
    }
}


static ssize_t mpc8xx_wdt_write(struct file *file, const char *data, size_t len, loff_t * ppos)
{
        unsigned long flags;
	int new_count;


	if (len != sizeof(new_count)) 
        {
		return -EINVAL;
	}

	/* copy count value into kernel space */
	get_user(new_count, (int *) data);
        printk("new_count %d\n", new_count);

        /* Removing the following three lines doesn't prevent 
           the kernel freeze */
        spin_lock_irqsave(&counter_spinlock, flags);
	timer_count = (HZ*new_count)/KTIMER_TIMEOUT;
        spin_unlock_irqrestore(&counter_spinlock, flags);
        
	return (sizeof(new_count));
}

static int mpc8xx_wdt_ioctl(struct inode *inode, struct file *file,
			    unsigned int cmd, unsigned long arg)
{
	int timeout;
	static struct watchdog_info info = {
		.options = WDIOF_KEEPALIVEPING,
		.firmware_version = 0,
		.identity = "MPC8xx watchdog",
	};

	switch (cmd) {
	case WDIOC_GETSUPPORT:
		if (copy_to_user((void *)arg, &info, sizeof(info)))
			return -EFAULT;
		break;

	case WDIOC_GETSTATUS:
	case WDIOC_GETBOOTSTATUS:
		if (put_user(wdt_status, (int *)arg))
			return -EFAULT;
		wdt_status &= ~WDIOF_KEEPALIVEPING;
		break;

	case WDIOC_GETTEMP:
		return -EOPNOTSUPP;

	case WDIOC_SETOPTIONS:
		return -EOPNOTSUPP;

	case WDIOC_KEEPALIVE:
		m8xx_wdt_reset();
		wdt_status |= WDIOF_KEEPALIVEPING;
		break;

	case WDIOC_SETTIMEOUT:
		return -EOPNOTSUPP;

	case WDIOC_GETTIMEOUT:
		timeout = m8xx_wdt_get_timeout();
		if (put_user(timeout, (int *)arg))
			return -EFAULT;
		break;

	default:
		return -ENOTTY;
	}

	return 0;
}

static const struct file_operations mpc8xx_wdt_fops = {
	.owner = THIS_MODULE,
	.llseek = no_llseek,
	.write = mpc8xx_wdt_write,
	.ioctl = mpc8xx_wdt_ioctl,
	.open = mpc8xx_wdt_open,
	.release = mpc8xx_wdt_release,
};

static struct miscdevice mpc8xx_wdt_miscdev = {
	.minor = WATCHDOG_MINOR,
	.name = "watchdog",
	.fops = &mpc8xx_wdt_fops,
};


static int __init mpc8xx_wdt_init(void)
{
	init_timer (&wd_timer);			/* initialize timer-structure... */
	wd_timer.function = mpc8xx_wdt_ktimer_handler;
	wd_timer.data = (unsigned long) &mpc8xx_wdt_dummy;
        spin_lock_init(&counter_spinlock);
	return misc_register(&mpc8xx_wdt_miscdev);
}

static void __exit mpc8xx_wdt_exit(void)
{
	misc_deregister(&mpc8xx_wdt_miscdev);

	m8xx_wdt_reset();
	mpc8xx_wdt_handler_enable();
}

module_init(mpc8xx_wdt_init);
module_exit(mpc8xx_wdt_exit);

MODULE_AUTHOR("Florian Schirmer <jolt@tuxbox.org>");
MODULE_DESCRIPTION("MPC8xx watchdog driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
____________________________________________________________________________


[-- Attachment #2: Type: text/html, Size: 13939 bytes --]

^ permalink raw reply

* Debugging with gdbserver slow
From: khollan @ 2007-11-20 20:59 UTC (permalink / raw)
  To: linuxppc-embedded


Hi everyone,

Im using gdbserver to debug Linux apps on my embedded board, but it takes
like 3-6 sec to step one line of code.  Its about the same to go from
breakpoint to breakpont.  Im using TCP to connect the host to the target. 
Is this typical or is there some setting wrong or was it built wrong.  Its a
PPC405 in a Xilinx FPGA.

Thanks

khollan
-- 
View this message in context: http://www.nabble.com/Debugging-with-gdbserver-slow-tf4846374.html#a13865715
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* Re: [PATCH] [POWERPC] Emulate isel (Integer Select) instruction
From: Kumar Gala @ 2007-11-20 21:01 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20071120175416.GA4389@loki.buserror.net>


On Nov 20, 2007, at 11:54 AM, Scott Wood wrote:

> On Mon, Nov 19, 2007 at 09:36:57PM -0600, Kumar Gala wrote:
>> isel (Integer Select) is a new user space instruction in the
>> PowerISA 2.04 spec.  Not all processors implement it so lets emulate
>> to ensure code built with isel will run everywhere.
>
> Given that the instruction is meant to be a performance enhancement,
> we should probably warn the first few times it's emulated, so the user
> knows they should change their toolchain setup if possible.

The same is true of mcrxr, popcntb, and possibly string ld/st.

Feel free to submit a patch that warns about their usage.

- k

^ permalink raw reply

* Re: [PATCH] commit e8f605cd71aa09a8f8b73f410a15d2a46022a60e
From: Kumar Gala @ 2007-11-20 21:35 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20071017234100.7729.85901.stgit@trillian.cg.shawcable.net>

On Wed, 17 Oct 2007, Grant Likely wrote:

> From: Grant Likely <grant.likely@secretlab.ca>
>
> mpc8349emitx(gp): add UHCI and USB storage support
>
>     USB support for the 8349itx got added a while back; but the defconfig
>     never got updated.  This patch adds the appropriate USB config options
>     to defconfig
>
>     Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
>     CC: Scott Wood <scottwood@freescale.com>
>     CC: Kumar Gala <galak@kernel.crashing.org>
>     CC: Timur Tabi <timur@freescale.com>
> ---
>
>  arch/powerpc/configs/mpc834x_itx_defconfig   |    2 -
>  arch/powerpc/configs/mpc834x_itxgp_defconfig |   88 ++++++++++++++++++++++++++
>  2 files changed, 88 insertions(+), 2 deletions(-)

applied.

- k

^ permalink raw reply

* Re: [PATCH] powerpc: mpc8xxx MDS board RTC fixes
From: Kumar Gala @ 2007-11-20 21:35 UTC (permalink / raw)
  To: Kim Phillips; +Cc: linuxppc-dev
In-Reply-To: <20071108133706.961af8d2.kim.phillips@freescale.com>

On Thu, 8 Nov 2007, Kim Phillips wrote:

> Now the rtc class ds1374 driver has been added,
> remove the old rtc driver hookup code, add rtc node
> to device trees, and turn on the new driver in the defconfigs.
>
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> ---
>  arch/powerpc/boot/dts/mpc832x_mds.dts      |    7 ++++
>  arch/powerpc/boot/dts/mpc834x_mds.dts      |    9 +++++
>  arch/powerpc/boot/dts/mpc836x_mds.dts      |    9 +++++
>  arch/powerpc/configs/mpc832x_mds_defconfig |   48 +++++++++++++++++++++++++++-
>  arch/powerpc/configs/mpc834x_mds_defconfig |   48 +++++++++++++++++++++++++++-
>  arch/powerpc/configs/mpc836x_mds_defconfig |   48 +++++++++++++++++++++++++++-
>  arch/powerpc/configs/mpc8568mds_defconfig  |   48 +++++++++++++++++++++++++++-
>  arch/powerpc/platforms/83xx/mpc832x_mds.c  |   24 --------------
>  arch/powerpc/platforms/83xx/mpc834x_mds.c  |   24 --------------
>  arch/powerpc/platforms/83xx/mpc836x_mds.c  |   24 --------------
>  10 files changed, 213 insertions(+), 76 deletions(-)

applied.

- k

^ permalink raw reply

* Re: [PATCH 1/3] [POWERPC] mpc832x_rdb: remove spidev stub, use mmc_spi
From: Kumar Gala @ 2007-11-20 21:35 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linuxppc-dev
In-Reply-To: <20071113170011.GA23979@localhost.localdomain>

On Tue, 13 Nov 2007, Anton Vorontsov wrote:

> mmc_spi has hit the mainline, so we can start using it.
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
>  arch/powerpc/platforms/83xx/mpc832x_rdb.c |   14 +++++++++-----
>  1 files changed, 9 insertions(+), 5 deletions(-)
>

applied.

- k

^ permalink raw reply

* Re: [PATCH 3/3] [POWERPC] mpc832x_rdb_defconfig: enable SPI_MPC83xx and MMC-over-SPI
From: Kumar Gala @ 2007-11-20 21:36 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linuxppc-dev
In-Reply-To: <20071113170043.GC23979@localhost.localdomain>

On Tue, 13 Nov 2007, Anton Vorontsov wrote:

> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
>  arch/powerpc/configs/mpc832x_rdb_defconfig |   43 ++++++++++++++++++++++++----
>  1 files changed, 37 insertions(+), 6 deletions(-)
>

applied.

- k

^ permalink raw reply

* Re: dtc: Add testcases for tree checks
From: David Gibson @ 2007-11-20 22:03 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev
In-Reply-To: <E1IuUiz-00022Y-E1@jdl.com>

On Tue, Nov 20, 2007 at 09:09:17AM -0600, Jon Loeliger wrote:
> So, like, the other day David Gibson mumbled:
> > This patch adds a group of testcases to check that dtc correctly
> > rejects trees with various structural errors.
> > 
> > To make things easier to test, we change dtc so that failing checks
> > (as opposed to other errors) result in exit code 2.
> > 
> > This patch also fixes an embarrasing bug uncovered by these new tests:
> > check_phandles() worked out if the tree's phandles were valid, then
> > throws that information away and returns success always.
> > 
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > 
> > NOTE! jdl, you'll need to chmod +x tests/dtc-checkfails.sh before you
> > git commit this - it's a new shell script and patch can't encode the
> > permissions info.
> > 
> > Index: dtc/tests/dup-nodename.dts
> > ===================================================================
> > --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> > +++ dtc/tests/dup-nodename.dts	2007-11-20 16:02:22.000000000 +1100
> 
> 
> Actually, this is the official third time now that it would have
> been significantly nicer had you been using git for patches as
> it does correctly handle excute permissions properly in patches.

Well, yes.  But, IMO, every time anyone other that you or I has
commented on one of these patches as it goes past counts as an
occasion when it's better that I've been using patches, rather than
pushing to you direct with git.

> And, it allows for side-band commentary such as your NOTE!, above,
> to be included in the patch mail, but not in the patch log itself
> such that it too doesn't have to be "git commit --amend"'ed out
> as well.

Actually, that should be possible with mails too, it's just that I
forgot the --- line.

> In any event, Applied and Adjusted.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* mmap on PPC removes file refcount?
From: Dave Jiang @ 2007-11-20 21:35 UTC (permalink / raw)
  To: linuxppc-dev

It seems the mmap() userland call on PPC causes the kernel to lose the ref
count for the mount point. This is what I did on a prpmc2800 board (74xx) with
latest powerpc.git tree (but also seem to happen on 8548 as well).

I mounted an IDE partition. The userland test app opens a file on the mounted
partition and sits in a sleep loop while holding the file open. I call umount
on the partition and I get "device is busy" which is suppose to happen.
However, after the test app calls mmap on the file id for the opened file, I
can successfully umount even though it should still say "device is busy".  This
does not happen on x86 so I'm assuming something is going on with just PPC.

So using lsof I can list the opened files on a particular partition. When the
file is opened, it lists 1 entry. When mmaped, on x86 it would list 2 entries,
but on ppc it lists nothing. Not only did the mmaped entry not show up, the
entry caused by open disappeared as well. Also, I put a printk in do_umount()
to see what the refcount is. On x86, it would be 3 and thus causes device busy.
On PPC it is 3 when the file is openend, however if mmap is called, the
refcount becomes 2 and thus umount proceeds. It's almost as if the mmap call
wiped out the opened file entry and decremented the mount count as well.


-- 

------------------------------------------------------
Dave Jiang
Software Engineer
MontaVista Software, Inc.
http://www.mvista.com
------------------------------------------------------

^ permalink raw reply

* Re: dtc: Add testcases for tree checks
From: Jon Loeliger @ 2007-11-20 22:22 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev@ozlabs.org, Jon Loeliger
In-Reply-To: <20071120220309.GB13156@localhost.localdomain>

On Tue, 2007-11-20 at 16:03, David Gibson wrote:

> Well, yes.  But, IMO, every time anyone other that you or I has
> commented on one of these patches as it goes past counts as an
> occasion when it's better that I've been using patches, rather than
> pushing to you direct with git.

I am not asking you to stop sending patches.
I'm asking you to generate your patches with git.
Git's patch format, send through mail, handles
the execute permissions.


> Actually, that should be possible with mails too, it's just that I
> forgot the --- line.

Right.  I'm just asking for it to be used. :-)

jdl

^ permalink raw reply

* Re: dtc: Add testcases for tree checks
From: Scott Wood @ 2007-11-20 22:23 UTC (permalink / raw)
  To: Jon Loeliger, linuxppc-dev
In-Reply-To: <20071120220309.GB13156@localhost.localdomain>

David Gibson wrote:
> On Tue, Nov 20, 2007 at 09:09:17AM -0600, Jon Loeliger wrote:
>> Actually, this is the official third time now that it would have
>> been significantly nicer had you been using git for patches as
>> it does correctly handle excute permissions properly in patches.
> 
> Well, yes.  But, IMO, every time anyone other that you or I has
> commented on one of these patches as it goes past counts as an
> occasion when it's better that I've been using patches, rather than
> pushing to you direct with git.

Generating patches with "git-format-patch -M" isn't the same as pushing 
directly...

-Scot

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox