[POWERPC] cpm_uart: Allocate DPRAM memory for SMC ports on CPM2-based platforms.
This patch allocates parameter RAM for SMC serial ports without relying on previous initialisation by a boot loader or a wrapper layer. SMC parameter RAM on CPM2-based platforms can be allocated anywhere in the general-purpose areas of the dual-port RAM. The current code relies on the boot loader to allocate a section of general-purpose CPM RAM and gets the section address from the device tree. 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. Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com> Acked-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
committed by
Kumar Gala
parent
1028d4f162
commit
d464df2667
@ -45,6 +45,8 @@
|
||||
#include <linux/serial_core.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
#include <linux/of.h>
|
||||
|
||||
#include "cpm_uart.h"
|
||||
|
||||
/**************************************************************/
|
||||
@ -54,6 +56,18 @@ void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
|
||||
{
|
||||
cpm_command(port->command, cmd);
|
||||
}
|
||||
|
||||
void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port,
|
||||
struct device_node *np)
|
||||
{
|
||||
return of_iomap(np, 1);
|
||||
}
|
||||
|
||||
void cpm_uart_unmap_pram(struct uart_cpm_port *port, void __iomem *pram)
|
||||
{
|
||||
iounmap(pram);
|
||||
}
|
||||
|
||||
#else
|
||||
void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
|
||||
{
|
||||
|
Reference in New Issue
Block a user