diff options
author | Laurent Pinchart <laurentp@cse-semaphore.com> | 2008-04-10 11:01:27 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-04-17 02:01:36 -0400 |
commit | d464df2667cf181419604e656773f80996cf0470 (patch) | |
tree | fedca2185763550331f0a73450c1d82f0c146ad6 /drivers/serial/cpm_uart/cpm_uart_cpm1.c | |
parent | 1028d4f162796a99b87565b6b40b5fec79c242d0 (diff) |
[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>
Diffstat (limited to 'drivers/serial/cpm_uart/cpm_uart_cpm1.c')
-rw-r--r-- | drivers/serial/cpm_uart/cpm_uart_cpm1.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c index 6ea0366e26a..74f1432bb24 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c | |||
@@ -45,6 +45,8 @@ | |||
45 | #include <linux/serial_core.h> | 45 | #include <linux/serial_core.h> |
46 | #include <linux/kernel.h> | 46 | #include <linux/kernel.h> |
47 | 47 | ||
48 | #include <linux/of.h> | ||
49 | |||
48 | #include "cpm_uart.h" | 50 | #include "cpm_uart.h" |
49 | 51 | ||
50 | /**************************************************************/ | 52 | /**************************************************************/ |
@@ -54,6 +56,18 @@ void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd) | |||
54 | { | 56 | { |
55 | cpm_command(port->command, cmd); | 57 | cpm_command(port->command, cmd); |
56 | } | 58 | } |
59 | |||
60 | void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port, | ||
61 | struct device_node *np) | ||
62 | { | ||
63 | return of_iomap(np, 1); | ||
64 | } | ||
65 | |||
66 | void cpm_uart_unmap_pram(struct uart_cpm_port *port, void __iomem *pram) | ||
67 | { | ||
68 | iounmap(pram); | ||
69 | } | ||
70 | |||
57 | #else | 71 | #else |
58 | void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd) | 72 | void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd) |
59 | { | 73 | { |