linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurentp@cse-semaphore.com>
To: Scott Wood <scottwood@freescale.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] cpm_uart: Allocate DPRAM memory for SMC ports on CPM2-based platforms.
Date: Tue, 25 Mar 2008 16:34:46 +0100	[thread overview]
Message-ID: <200803251634.50253.laurentp@cse-semaphore.com> (raw)
In-Reply-To: <20080325145841.GG13187@ld0162-tx32.am.freescale.net>

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

On Tuesday 25 March 2008 15:58, Scott Wood wrote:
> On Tue, Mar 25, 2008 at 12:24:40PM +0100, Laurent Pinchart wrote:
> > I was concerned this would break udbg, but udbg doesn't seem to be 
supported
> > on PQ2-based platforms.
> 
> Yes, it is (see arch/powerpc/sysdev/cpm_common.c).

I thought that was for CPM1 only. My bad.
 
> > This patch modifies the device tree address usage to reference the SMC
> > parameter RAM base pointer instead of a pre-allocated RAM section and
> > allocates memory from the CPM dual-port RAM when initialising the SMC 
port.
> > CPM1-based platforms are not affected.
> 
> Please maintain backward compatibility with older device trees (by
> checking the length of the second reg resource).  At the very least,
> update the device trees that are affected.

I haven't seen any CPM2-based board using SMC ports in the device trees 
available in arch/powerpc/boot/dts.

Should I still maintain compatibility with older device trees ? Is there any 
out-of-tree PQ2 boards using udbg and SMC ? What about printing a warning if 
the second reg resource has the wrong size ?

> > +	offset = cpm_dpalloc(PROFF_SMC_SIZE, 64);
> > +	out_be16(pram, offset);
> 
> Up to this point, if we don't reset the CPM prior to any dpalloc calls
> (and if we do, udbg printk breaks), the SMC could be running and
> clobbering some other bit of dpram, which could have been allocated to
> something else.

If udbg uses the parameter RAM allocated by the boot loader, that section of 
DPRAM should be removed from the muram node in the device tree. Otherwise the 
SMC DPRAM will eventually be allocated to something else and the system will 
break.

It should thus be safe to reset the CPM if udbg isn't used, and the device 
tree should explicitely exclude the pre-allocated parameter RAM from the 
muram node when udbg is used.

> After this point, even if you don't reset the CPM, udbg printk is broken
> because you moved pram.  The udbg disabling will have to be moved before
> this.

Moving the SMC pram doesn't break udbg printk in itself. What will break it is 
moving the TX BDs, but the end result is the same, moving pram will result in 
udbg being broken.

The cpm_uart driver disable udbg before allocating the new BDs. What about 
moving that right before moving the parameter RAM ? cpm_uart_request_port(), 
which is called in between, already disables RX and TX on the port, so we 
won't loose any debug message.

Best regards,

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussée de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-03-25 15:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-25 11:24 [PATCH] cpm_uart: Allocate DPRAM memory for SMC ports on CPM2-based platforms Laurent Pinchart
2008-03-25 14:58 ` Scott Wood
2008-03-25 15:34   ` Laurent Pinchart [this message]
2008-03-25 16:03     ` Scott Wood
2008-03-25 16:20       ` Laurent Pinchart
2008-03-25 16:27         ` [PATCH] cpm_uart: Allocate DPRAM memory for SMC ports onCPM2-based platforms Rune Torgersen
2008-03-25 16:32           ` Laurent Pinchart
2008-03-25 16:41             ` Rune Torgersen
2008-03-26  8:31             ` Sergej Stepanov
2008-03-26 12:34               ` Laurent Pinchart
2008-03-25 16:44         ` [PATCH] cpm_uart: Allocate DPRAM memory for SMC ports on CPM2-based platforms Scott Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200803251634.50253.laurentp@cse-semaphore.com \
    --to=laurentp@cse-semaphore.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=scottwood@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).