[PATCH] cpm_uart: Allocate DPRAM memory for SMC ports on CPM2-based platforms.

Scott Wood scottwood at freescale.com
Wed Mar 26 01:58:41 EST 2008


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).

> 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.

> +	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.

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.

-Scott



More information about the Linuxppc-dev mailing list