mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-07 07:08:07 +00:00
ARM: plat-omap: make OMAP_UART_INFO into a relative offset
This is the first step to remove PLAT_PHYS_OFFSET usage from the debug UART code. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> Tested-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Kevin Hilman <khilman@ti.com>
This commit is contained in:
parent
639da5ee37
commit
dd185456ef
4 changed files with 17 additions and 14 deletions
|
@ -46,11 +46,9 @@ omap_uart_virt: .word 0x0
|
||||||
bne 99f @ already configured
|
bne 99f @ already configured
|
||||||
|
|
||||||
/* Check the debug UART configuration set in uncompress.h */
|
/* Check the debug UART configuration set in uncompress.h */
|
||||||
mrc p15, 0, \rp, c1, c0
|
and \rp, pc, #0xff000000
|
||||||
tst \rp, #1 @ MMU enabled?
|
ldr \rv, =OMAP_UART_INFO_OFS
|
||||||
ldreq \rp, =OMAP_UART_INFO @ MMU not enabled
|
ldr \rp, [\rp, \rv]
|
||||||
ldrne \rp, =omap_uart_p2v(OMAP_UART_INFO) @ MMU enabled
|
|
||||||
ldr \rp, [\rp, #0]
|
|
||||||
|
|
||||||
/* Select the UART to use based on the UART1 scratchpad value */
|
/* Select the UART to use based on the UART1 scratchpad value */
|
||||||
10: cmp \rp, #0 @ no port configured?
|
10: cmp \rp, #0 @ no port configured?
|
||||||
|
|
|
@ -49,11 +49,10 @@ omap_uart_lsr: .word 0
|
||||||
bne 99f @ already configured
|
bne 99f @ already configured
|
||||||
|
|
||||||
/* Check the debug UART configuration set in uncompress.h */
|
/* Check the debug UART configuration set in uncompress.h */
|
||||||
mrc p15, 0, \rp, c1, c0
|
mov \rp, pc
|
||||||
tst \rp, #1 @ MMU enabled?
|
ldr \rv, =OMAP_UART_INFO_OFS
|
||||||
ldreq \rp, =OMAP_UART_INFO @ MMU not enabled
|
and \rp, \rp, #0xff000000
|
||||||
ldrne \rp, =omap_uart_p2v(OMAP_UART_INFO) @ MMU enabled
|
ldr \rp, [\rp, \rv]
|
||||||
ldr \rp, [\rp, #0]
|
|
||||||
|
|
||||||
/* Select the UART to use based on the UART1 scratchpad value */
|
/* Select the UART to use based on the UART1 scratchpad value */
|
||||||
cmp \rp, #0 @ no port configured?
|
cmp \rp, #0 @ no port configured?
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Memory entry used for the DEBUG_LL UART configuration. See also
|
* Memory entry used for the DEBUG_LL UART configuration, relative to
|
||||||
* uncompress.h and debug-macro.S.
|
* start of RAM. See also uncompress.h and debug-macro.S.
|
||||||
*
|
*
|
||||||
* Note that using a memory location for storing the UART configuration
|
* Note that using a memory location for storing the UART configuration
|
||||||
* has at least two limitations:
|
* has at least two limitations:
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
* 2. We assume printascii is called at least once before paging_init,
|
* 2. We assume printascii is called at least once before paging_init,
|
||||||
* and addruart has a chance to read OMAP_UART_INFO
|
* and addruart has a chance to read OMAP_UART_INFO
|
||||||
*/
|
*/
|
||||||
#define OMAP_UART_INFO (PLAT_PHYS_OFFSET + 0x3ffc)
|
#define OMAP_UART_INFO_OFS 0x3ffc
|
||||||
|
|
||||||
/* OMAP1 serial ports */
|
/* OMAP1 serial ports */
|
||||||
#define OMAP1_UART1_BASE 0xfffb0000
|
#define OMAP1_UART1_BASE 0xfffb0000
|
||||||
|
|
|
@ -36,7 +36,13 @@ int uart_shift;
|
||||||
*/
|
*/
|
||||||
static void set_omap_uart_info(unsigned char port)
|
static void set_omap_uart_info(unsigned char port)
|
||||||
{
|
{
|
||||||
*(volatile u32 *)OMAP_UART_INFO = port;
|
/*
|
||||||
|
* Get address of some.bss variable and round it down
|
||||||
|
* a la CONFIG_AUTO_ZRELADDR.
|
||||||
|
*/
|
||||||
|
u32 ram_start = (u32)&uart_shift & 0xf8000000;
|
||||||
|
u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS);
|
||||||
|
*uart_info = port;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void putc(int c)
|
static void putc(int c)
|
||||||
|
|
Loading…
Add table
Reference in a new issue