]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'debug-ll' into omap-for-linus
authorTony Lindgren <tony@atomide.com>
Mon, 15 Feb 2010 17:26:07 +0000 (09:26 -0800)
committerTony Lindgren <tony@atomide.com>
Mon, 15 Feb 2010 17:26:07 +0000 (09:26 -0800)
58 files changed:
arch/arm/boot/compressed/head.S
arch/arm/kernel/debug.S
arch/arm/mach-aaec2000/include/mach/debug-macro.S
arch/arm/mach-at91/include/mach/debug-macro.S
arch/arm/mach-clps711x/include/mach/debug-macro.S
arch/arm/mach-davinci/include/mach/debug-macro.S
arch/arm/mach-dove/include/mach/debug-macro.S
arch/arm/mach-ebsa110/include/mach/debug-macro.S
arch/arm/mach-ep93xx/include/mach/debug-macro.S
arch/arm/mach-footbridge/include/mach/debug-macro.S
arch/arm/mach-gemini/include/mach/debug-macro.S
arch/arm/mach-h720x/include/mach/debug-macro.S
arch/arm/mach-integrator/include/mach/debug-macro.S
arch/arm/mach-iop13xx/include/mach/debug-macro.S
arch/arm/mach-iop32x/include/mach/debug-macro.S
arch/arm/mach-iop33x/include/mach/debug-macro.S
arch/arm/mach-ixp2000/include/mach/debug-macro.S
arch/arm/mach-ixp23xx/include/mach/debug-macro.S
arch/arm/mach-ixp4xx/include/mach/debug-macro.S
arch/arm/mach-kirkwood/include/mach/debug-macro.S
arch/arm/mach-ks8695/include/mach/debug-macro.S
arch/arm/mach-l7200/include/mach/debug-macro.S
arch/arm/mach-lh7a40x/include/mach/debug-macro.S
arch/arm/mach-loki/include/mach/debug-macro.S
arch/arm/mach-mmp/include/mach/debug-macro.S
arch/arm/mach-msm/include/mach/debug-macro.S
arch/arm/mach-mv78xx0/include/mach/debug-macro.S
arch/arm/mach-netx/include/mach/debug-macro.S
arch/arm/mach-nomadik/include/mach/debug-macro.S
arch/arm/mach-ns9xxx/include/mach/debug-macro.S
arch/arm/mach-omap1/include/mach/debug-macro.S
arch/arm/mach-omap1/serial.c
arch/arm/mach-omap2/board-3630sdp.c
arch/arm/mach-omap2/board-zoom3.c
arch/arm/mach-omap2/include/mach/debug-macro.S
arch/arm/mach-omap2/serial.c
arch/arm/mach-orion5x/include/mach/debug-macro.S
arch/arm/mach-pnx4008/include/mach/debug-macro.S
arch/arm/mach-pxa/include/mach/debug-macro.S
arch/arm/mach-realview/include/mach/debug-macro.S
arch/arm/mach-rpc/include/mach/debug-macro.S
arch/arm/mach-s3c2410/include/mach/debug-macro.S
arch/arm/mach-s3c24a0/include/mach/debug-macro.S
arch/arm/mach-s3c6400/include/mach/debug-macro.S
arch/arm/mach-s5pc100/include/mach/debug-macro.S
arch/arm/mach-sa1100/include/mach/debug-macro.S
arch/arm/mach-shark/include/mach/debug-macro.S
arch/arm/mach-u300/include/mach/debug-macro.S
arch/arm/mach-ux500/include/mach/debug-macro.S
arch/arm/mach-versatile/include/mach/debug-macro.S
arch/arm/plat-mxc/include/mach/debug-macro.S
arch/arm/plat-omap/Kconfig
arch/arm/plat-omap/common.c
arch/arm/plat-omap/include/plat/common.h
arch/arm/plat-omap/include/plat/omap16xx.h
arch/arm/plat-omap/include/plat/serial.h
arch/arm/plat-omap/include/plat/uncompress.h
arch/arm/plat-stmp3xxx/include/mach/debug-macro.S

index 4fddc509e78ed3e25a8d708521f6d20cd2282e96..99b75aa1c2ec734ffa438b0aeada6d8266adb0e0 100644 (file)
 #if defined(CONFIG_DEBUG_ICEDCC)
 
 #ifdef CONFIG_CPU_V6
-               .macro  loadsp, rb
+               .macro  loadsp, rb, tmp
                .endm
                .macro  writeb, ch, rb
                mcr     p14, 0, \ch, c0, c5, 0
                .endm
 #elif defined(CONFIG_CPU_V7)
-               .macro  loadsp, rb
+               .macro  loadsp, rb, tmp
                .endm
                .macro  writeb, ch, rb
 wait:          mrc     p14, 0, pc, c0, c1, 0
@@ -36,13 +36,13 @@ wait:               mrc     p14, 0, pc, c0, c1, 0
                mcr     p14, 0, \ch, c0, c5, 0
                .endm
 #elif defined(CONFIG_CPU_XSCALE)
-               .macro  loadsp, rb
+               .macro  loadsp, rb, tmp
                .endm
                .macro  writeb, ch, rb
                mcr     p14, 0, \ch, c8, c0, 0
                .endm
 #else
-               .macro  loadsp, rb
+               .macro  loadsp, rb, tmp
                .endm
                .macro  writeb, ch, rb
                mcr     p14, 0, \ch, c1, c0, 0
@@ -58,7 +58,7 @@ wait:         mrc     p14, 0, pc, c0, c1, 0
                .endm
 
 #if defined(CONFIG_ARCH_SA1100)
-               .macro  loadsp, rb
+               .macro  loadsp, rb, tmp
                mov     \rb, #0x80000000        @ physical base address
 #ifdef CONFIG_DEBUG_LL_SER3
                add     \rb, \rb, #0x00050000   @ Ser3
@@ -67,13 +67,13 @@ wait:               mrc     p14, 0, pc, c0, c1, 0
 #endif
                .endm
 #elif defined(CONFIG_ARCH_S3C2410)
-               .macro loadsp, rb
+               .macro loadsp, rb, tmp
                mov     \rb, #0x50000000
                add     \rb, \rb, #0x4000 * CONFIG_S3C_LOWLEVEL_UART_PORT
                .endm
 #else
-               .macro  loadsp, rb
-               addruart \rb
+               .macro  loadsp, rb, tmp
+               addruart \rb, \tmp
                .endm
 #endif
 #endif
@@ -1025,7 +1025,7 @@ phex:             adr     r3, phexbuf
                strb    r2, [r3, r1]
                b       1b
 
-puts:          loadsp  r3
+puts:          loadsp  r3, r1
 1:             ldrb    r2, [r0], #1
                teq     r2, #0
                moveq   pc, lr
@@ -1042,7 +1042,7 @@ puts:             loadsp  r3
 putc:
                mov     r2, r0
                mov     r0, #0
-               loadsp  r3
+               loadsp  r3, r1
                b       2b
 
 memdump:       mov     r12, r0
index 5c91addcaebcb2d8d207a4deb920e3cb7ea48729..a38b4879441d1715b42c4e7994f9f4d8e67b7fe4 100644 (file)
@@ -24,7 +24,7 @@
 
 #if defined(CONFIG_CPU_V6)
 
-               .macro  addruart, rx
+               .macro  addruart, rx, tmp
                .endm
 
                .macro  senduart, rd, rx
@@ -51,7 +51,7 @@
 
 #elif defined(CONFIG_CPU_V7)
 
-               .macro  addruart, rx
+               .macro  addruart, rx, tmp
                .endm
 
                .macro  senduart, rd, rx
@@ -71,7 +71,7 @@ wait:         mrc     p14, 0, pc, c0, c1, 0
 
 #elif defined(CONFIG_CPU_XSCALE)
 
-               .macro  addruart, rx
+               .macro  addruart, rx, tmp
                .endm
 
                .macro  senduart, rd, rx
@@ -98,7 +98,7 @@ wait:         mrc     p14, 0, pc, c0, c1, 0
 
 #else
 
-               .macro  addruart, rx
+               .macro  addruart, rx, tmp
                .endm
 
                .macro  senduart, rd, rx
@@ -164,7 +164,7 @@ ENDPROC(printhex2)
                .ltorg
 
 ENTRY(printascii)
-               addruart r3
+               addruart r3, r1
                b       2f
 1:             waituart r2, r3
                senduart r1, r3
@@ -180,7 +180,7 @@ ENTRY(printascii)
 ENDPROC(printascii)
 
 ENTRY(printch)
-               addruart r3
+               addruart r3, r1
                mov     r1, r0
                mov     r0, #0
                b       1b
index 0b6351d7c38973e7431c601e291afab173d54551..a9cac368bfe69f184c85ce7058ec29cfe10c83a2 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #include "hardware.h"
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #0x80000000                @ physical
index 29052ba66adac42eb0ee585ecd8bc64e09d9da59..9e750a1c1b5a80fbab076f70314f8ffd7f5a1bd2 100644 (file)
@@ -14,7 +14,7 @@
 #include <mach/hardware.h>
 #include <mach/at91_dbgu.h>
 
-       .macro  addruart,rx
+       .macro  addruart, rx, tmp
        mrc     p15, 0, \rx, c1, c0
        tst     \rx, #1                                         @ MMU enabled?
        ldreq   \rx, =(AT91_BASE_SYS + AT91_DBGU)               @ System peripherals (phys address)
index 64baf9f874087c8df7f7fc47e83c4c189f592978..fedd8076a689a3555a986b5e96bc9348cf4ae77f 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <asm/hardware/clps7111.h>
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #CLPS7111_PHYS_BASE
index 17ab5236da6618af1a9ee2ebd32968692b050252..3cd93a801d9b94ba84689147d48c26e12df4ccfd 100644 (file)
@@ -19,7 +19,7 @@
 #include <linux/serial_reg.h>
 #define UART_SHIFT     2
 
-               .macro addruart, rx
+               .macro addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #0x01000000        @ physical base address
index 9b89ec7d3040fe272c1a1c5e7ab9b9b8e889d932..1521d13f1d14928a12a1a8b79ad4fd4d5037e3c1 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <mach/bridge-regs.h>
 
-       .macro  addruart,rx
+       .macro  addruart, rx, tmp
        mrc     p15, 0, \rx, c1, c0
        tst     \rx, #1                                 @ MMU enabled?
        ldreq   \rx, =DOVE_SB_REGS_PHYS_BASE
index 1dde8227f3a274d33d32f28a4b9d89cf9b56ac9f..ebbd89f0e6c0e8967171396e4113e82c6826d266 100644 (file)
@@ -11,7 +11,7 @@
  *
 **/
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mov     \rx, #0xf0000000
                orr     \rx, \rx, #0x00000be0
                .endm
index 802858bc80958b90358aec6ac399d509efe73193..5cd22444e2236ae8fb73e59641e8dd82347f0fdf 100644 (file)
@@ -11,7 +11,7 @@
  */
 #include <mach/ep93xx-regs.h>
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                         @ MMU enabled?
                ldreq   \rx, =EP93XX_APB_PHYS_BASE      @ Physical base
index 4329b81235708637cb6bc003638f7c3090a5c9f2..60dda1318f2285785829c46c399889d5da495c89 100644 (file)
@@ -15,7 +15,7 @@
 
 #ifndef CONFIG_DEBUG_DC21285_PORT
        /* For NetWinder debugging */
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #0x7c000000        @ physical
@@ -32,7 +32,7 @@
                .equ    dc21285_high, ARMCSR_BASE & 0xff000000
                .equ    dc21285_low,  ARMCSR_BASE & 0x00ffffff
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #0x42000000
index d04a6eaeae14ad8e0545585c15b1a397c1e3a668..ad477047069ddc9188e33657f3ad0b5338b83e11 100644 (file)
@@ -11,7 +11,7 @@
  */
 #include <mach/hardware.h>
 
-       .macro  addruart,rx
+       .macro  addruart, rx, tmp
        mrc     p15, 0, \rx, c1, c0
        tst     \rx, #1                                 @ MMU enabled?
        ldreq   \rx, =GEMINI_UART_BASE                  @ physical
index 6294a1344dda80f81d89a1191f4a733ef4095f0f..a9ee8f0d48b7f6792ea5004844649c3acb3a5bd0 100644 (file)
@@ -14,7 +14,7 @@
                .equ    io_virt, IO_BASE
                .equ    io_phys, IO_START
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                @ MMU enabled?
                moveq   \rx, #io_phys          @ physical base address
index d347d659ea308c74edc6aa5870aae9b05e5f85d2..87a6888ae011ba71e3764f02ab97a1b74260e839 100644 (file)
@@ -11,7 +11,7 @@
  *
 */
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #0x16000000        @ physical base address
index 9037d2e8557cbb163a07d2b47cbe967f959cf4fb..c9d6ba46963da99c4f5c8ede984a27f470238024 100644 (file)
@@ -11,7 +11,7 @@
  * published by the Free Software Foundation.
  */
 
-       .macro  addruart, rx
+       .macro  addruart, rx, tmp
        mrc     p15, 0, \rx, c1, c0
        tst     \rx, #1                 @ mmu enabled?
        moveq   \rx, #0xff000000        @ physical
index 58b01664ffba5edc93f81e002bc79259f418b374..736afe1edd1f668c4f84850b1604a3fc98a699b2 100644 (file)
@@ -11,7 +11,7 @@
  * published by the Free Software Foundation.
  */
 
-               .macro  addruart, rx
+               .macro  addruart, rx, tmp
                mov     \rx, #0xfe000000        @ physical as well as virtual
                orr     \rx, \rx, #0x00800000   @ location of the UART
                .endm
index a60c9ef05cc3cf16d3097ec94f1789b9e3097f7f..addb2da78422b0ff58df52a64dce48fe57bdd169 100644 (file)
@@ -11,7 +11,7 @@
  * published by the Free Software Foundation.
  */
 
-               .macro  addruart, rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ mmu enabled?
                moveq   \rx, #0xff000000        @ physical
index 904ff56d2246e9c91671b09dfdcee60598504f58..6a827681680fe20b833c07bc1990c488d1c20dae 100644 (file)
@@ -11,7 +11,7 @@
  *
 */
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #0xc0000000        @ Physical base
index 905db3188724372ea1ff0ed0e5983050d1263fbf..a82e375465e283651c4f8e96ea7913c4a77f4b35 100644 (file)
@@ -12,7 +12,7 @@
  */
 #include <mach/ixp23xx.h>
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                         @ mmu enabled?
                ldreq   \rx, =IXP23XX_PERIPHERAL_PHYS   @ physical
index 7c6a6912acdeef809e1e1296b187cf905c4d637a..893873eb2a0d9b584da49485af9819bdeac68ae9 100644 (file)
@@ -10,7 +10,7 @@
  * published by the Free Software Foundation.
 */
 
-                .macro  addruart,rx
+                .macro  addruart, rx, tmp
                 mrc     p15, 0, \rx, c1, c0
                 tst     \rx, #1                 @ MMU enabled?
                 moveq   \rx, #0xc8000000
index a4a55c199d77638d92f8b48b62a8e9e39cbfa8c3..d0606774dea7de3baa03e4291dd016b0825dde07 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <mach/bridge-regs.h>
 
-       .macro  addruart,rx
+       .macro  addruart, rx, tmp
        mrc     p15, 0, \rx, c1, c0
        tst     \rx, #1                                 @ MMU enabled?
        ldreq   \rx, =KIRKWOOD_REGS_PHYS_BASE
index 3782c3559497e52464d0aca8ba56a917b8198078..cf2095da2372cddfb0e3105f1ab04ac4fc4fc61c 100644 (file)
@@ -14,7 +14,7 @@
 #include <mach/hardware.h>
 #include <mach/regs-uart.h>
 
-       .macro  addruart, rx
+       .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                         @ MMU enabled?
                ldreq   \rx, =KS8695_UART_PA            @ physical base address
index 34eed2a63e69951eda7db9f8ea291dd04ba5be1b..b69ed344c7c981a4c6b94e2564a16be411849401 100644 (file)
@@ -14,7 +14,7 @@
                .equ    io_virt, IO_BASE
                .equ    io_phys, IO_START
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #io_phys           @ physical base address
index 85141ed5383d1c355af041622099d545c5c1dfef..c0dcbbba22ba6f7eeb0af9893579f7aedc870879 100644 (file)
@@ -14,7 +14,7 @@
        @ It is not known if this will be appropriate for every 40x
        @ board.
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                mov     \rx, #0x00000700        @ offset from base
index a8c20bd2f9514d87ca5acef76b0ce75ddf250d05..3136c913a92c2c4886cbcd232f145f9aac2572f2 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <mach/loki.h>
 
-       .macro  addruart,rx
+       .macro  addruart, rx, tmp
        mrc     p15, 0, \rx, c1, c0
        tst     \rx, #1                                 @ MMU enabled?
        ldreq   \rx, =LOKI_REGS_PHYS_BASE
index a850f87de51d90c68030f5dd5e256a33d69382af..76deff238e1c5f394505a0a413d3fb98577d0645 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <mach/addr-map.h>
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                         @ MMU enabled?
                ldreq   \rx, =APB_PHYS_BASE             @ physical
index d48747ebcd3dc64be6df5bbd0409a5e6705f43bf..528750f307e9428433c97101153be1933d495ba8 100644 (file)
@@ -20,7 +20,7 @@
 #include <mach/msm_iomap.h>
 
 #ifdef CONFIG_MSM_DEBUG_UART
-       .macro  addruart,rx
+       .macro  addruart, rx, tmp
        @ see if the MMU is enabled and select appropriate base address
        mrc     p15, 0, \rx, c1, c0
        tst     \rx, #1
@@ -40,7 +40,7 @@
        beq     1001b
        .endm
 #else
-       .macro  addruart,rx
+       .macro  addruart, rx, tmp
        .endm
 
        .macro  senduart,rd,rx
index a06442fbd3415b9bd935daf71b809685cc36e75c..cd81689c4621dad5bfa9b08d2b1a35bed5049b8a 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <mach/mv78xx0.h>
 
-       .macro  addruart,rx
+       .macro  addruart, rx, tmp
        mrc     p15, 0, \rx, c1, c0
        tst     \rx, #1                                 @ MMU enabled?
        ldreq   \rx, =MV78XX0_REGS_PHYS_BASE
index 11b9d5b46390daf54a2294c1925a832d3ecfb330..e96339e71d88fec6cbf56e72f08ba9d0dd4d9008 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "hardware.h"
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #0x00100000                @ physical
index e876990e156971def6d5e7304cc2d6914b1ba2cd..4f92acfba9545aaf5f9043925b51d8fcd1334ac0 100644 (file)
@@ -10,7 +10,7 @@
  *
 */
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #0x10000000        @ physical base address
index c9530fba00aa54866ffdba2372a1324bcd8bea4b..0859336a8e6d1be71a8090c1e8ef53b1640c87bc 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <mach/regs-board-a9m9750dev.h>
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1
                ldreq   \rx, =NS9XXX_CSxSTAT_PHYS(0)
index aedb746fc33c950c0e4d5579681f52018c86675c..b6d9584544b4a92ab213d500553fabd3571a2850 100644 (file)
  *
 */
 
-               .macro  addruart,rx
+#include <linux/serial_reg.h>
+
+#include <plat/serial.h>
+
+               .pushsection .data
+omap_uart_phys:        .word   0x0
+omap_uart_virt:        .word   0x0
+               .popsection
+
+               /*
+                * Note that this code won't work if the bootloader passes
+                * a wrong machine ID number in r1. To debug, just hardcode
+                * the desired UART phys and virt addresses temporarily into
+                * the omap_uart_phys and omap_uart_virt above.
+                */
+               .macro  addruart, rx, tmp
+
+               /* Use omap_uart_phys/virt if already configured */
+9:             mrc     p15, 0, \rx, c1, c0
+               tst     \rx, #1                 @ MMU enabled?
+               ldreq   \rx, =omap_uart_phys    @ physical base address
+               ldrne   \rx, =omap_uart_virt    @ virtual base
+               ldr     \rx, [\rx, #0]
+               cmp     \rx, #0                 @ is port configured?
+               bne     99f                     @ already configured
+
+               /* Check 7XX UART1 scratchpad register for uart to use */
+               mrc     p15, 0, \rx, c1, c0
+               tst     \rx, #1                 @ MMU enabled?
+               moveq   \rx, #0xff000000        @ physical base address
+               movne   \rx, #0xfe000000        @ virtual base
+               orr     \rx, \rx, #0x00fb0000   @ OMAP1UART1
+               ldrb    \rx, [\rx, #(UART_SCR << OMAP7XX_PORT_SHIFT)]
+               cmp     \rx, #0                 @ anything in 7XX scratchpad?
+               bne     10f                     @ found 7XX uart
+
+               /* Check 15xx/16xx UART1 scratchpad register for uart to use */
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #0xff000000        @ physical base address
                movne   \rx, #0xfe000000        @ virtual base
-               orr     \rx, \rx, #0x00fb0000
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-               orr     \rx, \rx, #0x00009000   @ UART 3
-#endif
-#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
-               orr     \rx, \rx, #0x00000800   @ UART 2 & 3
-#endif
+               orr     \rx, \rx, #0x00fb0000   @ OMAP1UART1
+               ldrb    \rx, [\rx, #(UART_SCR << OMAP_PORT_SHIFT)]
+
+               /* Select the UART to use based on the UART1 scratchpad value */
+10:            cmp     \rx, #0                 @ no port configured?
+               beq     11f                     @ if none, try to use UART1
+               cmp     \rx, #OMAP1UART1
+               beq     11f                     @ configure OMAP1UART1
+               cmp     \rx, #OMAP1UART2
+               beq     12f                     @ configure OMAP1UART2
+               cmp     \rx, #OMAP1UART3
+               beq     13f                     @ configure OMAP2UART3
+
+               /* Configure the UART offset from the phys/virt base */
+11:            mov     \rx, #0x00fb0000        @ OMAP1UART1
+               b       98f
+12:            mov     \rx, #0x00fb0000        @ OMAP1UART1
+               orr     \rx, \rx, #0x00000800   @ OMAP1UART2
+               b       98f
+13:            mov     \rx, #0x00fb0000        @ OMAP1UART1
+               orr     \rx, \rx, #0x00000800   @ OMAP1UART2
+               orr     \rx, \rx, #0x00009000   @ OMAP1UART3
+
+               /* Store both phys and virt address for the uart */
+98:            add     \rx, \rx, #0xff000000   @ phys base
+               ldr     \tmp, =omap_uart_phys
+               str     \rx, [\tmp, #0]
+               sub     \rx, \rx, #0xff000000   @ phys base
+               add     \rx, \rx, #0xfe000000   @ virt base
+               ldr     \tmp, =omap_uart_virt
+               str     \rx, [\tmp, #0]
+               b       9b
+99:
                .endm
 
                .macro  senduart,rd,rx
                .endm
 
                .macro  busyuart,rd,rx
-1001:          ldrb    \rd, [\rx, #(0x5 << 2)] @ OMAP-1510 and friends
-               and     \rd, \rd, #0x60
-               teq     \rd, #0x60
+1001:          ldrb    \rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]
+               and     \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
+               teq     \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
                beq     1002f
-               ldrb    \rd, [\rx, #(0x5 << 0)] @ OMAP-730 only
-               and     \rd, \rd, #0x60
-               teq     \rd, #0x60
+               ldrb    \rd, [\rx, #(UART_LSR << OMAP7XX_PORT_SHIFT)]
+               and     \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
+               teq     \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
                bne     1001b
 1002:
                .endm
index 6e5207c81cf4b1e8558838ffbaf87103a9cdcd34..349de90194e30cc05bd654d19c8e3c935b6a7c95 100644 (file)
@@ -64,7 +64,7 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p)
 
 static struct plat_serial8250_port serial_platform_data[] = {
        {
-               .mapbase        = OMAP_UART1_BASE,
+               .mapbase        = OMAP1_UART1_BASE,
                .irq            = INT_UART1,
                .flags          = UPF_BOOT_AUTOCONF,
                .iotype         = UPIO_MEM,
@@ -72,7 +72,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
                .uartclk        = OMAP16XX_BASE_BAUD * 16,
        },
        {
-               .mapbase        = OMAP_UART2_BASE,
+               .mapbase        = OMAP1_UART2_BASE,
                .irq            = INT_UART2,
                .flags          = UPF_BOOT_AUTOCONF,
                .iotype         = UPIO_MEM,
@@ -80,7 +80,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
                .uartclk        = OMAP16XX_BASE_BAUD * 16,
        },
        {
-               .mapbase        = OMAP_UART3_BASE,
+               .mapbase        = OMAP1_UART3_BASE,
                .irq            = INT_UART3,
                .flags          = UPF_BOOT_AUTOCONF,
                .iotype         = UPIO_MEM,
index 7390596328116b2972c1e3ceb6c232c283003d1f..c178e68472f842d227ce4381c5c80b5beb5a5047 100755 (executable)
@@ -68,7 +68,7 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 
 static void __init omap_sdp_map_io(void)
 {
-       omap2_set_globals_343x();
+       omap2_set_globals_36xx();
        omap2_map_common_io();
 }
 
index a9fe9181b01089ad06fa53682189c1620059c31e..456b69072679ea87dd9952c01c1700f55455a8d4 100644 (file)
@@ -26,7 +26,7 @@
 
 static void __init omap_zoom_map_io(void)
 {
-       omap2_set_globals_343x();
+       omap2_set_globals_36xx();
        omap2_map_common_io();
 }
 
index e9f255df9163b827c6a9fc300b0b65345e79d329..4a63a2ea484dd58681a3f403f926a64861e023a9 100644 (file)
  *
 */
 
-               .macro  addruart,rx
+#include <linux/serial_reg.h>
+
+#include <plat/serial.h>
+
+#define UART_OFFSET(addr)      ((addr) & 0x00ffffff)
+
+               .pushsection .data
+omap_uart_phys:        .word   0
+omap_uart_virt:        .word   0
+omap_uart_lsr: .word   0
+               .popsection
+
+               /*
+                * Note that this code won't work if the bootloader passes
+                * a wrong machine ID number in r1. To debug, just hardcode
+                * the desired UART phys and virt addresses temporarily into
+                * the omap_uart_phys and omap_uart_virt above.
+                */
+               .macro  addruart, rx, tmp
+
+               /* Use omap_uart_phys/virt if already configured */
+10:            mrc     p15, 0, \rx, c1, c0
+               tst     \rx, #1                 @ MMU enabled?
+               ldreq   \rx, =omap_uart_phys    @ physical base address
+               ldrne   \rx, =omap_uart_virt    @ virtual base address
+               ldr     \rx, [\rx, #0]
+               cmp     \rx, #0                 @ is port configured?
+               bne     99f                     @ already configured
+
+               /* Check UART1 scratchpad register for uart to use */
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
-#ifdef  CONFIG_ARCH_OMAP2
                moveq   \rx, #0x48000000        @ physical base address
                movne   \rx, #0xfa000000        @ virtual base
-               orr     \rx, \rx, #0x0006a000
-#ifdef CONFIG_OMAP_LL_DEBUG_UART2
-               add     \rx, \rx, #0x00002000   @ UART 2
-#endif
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-               add     \rx, \rx, #0x00004000   @ UART 3
-#endif
-
-#elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
-               moveq   \rx, #0x48000000        @ physical base address
-               movne   \rx, #0xfa000000        @ virtual base
-               orr     \rx, \rx, #0x0006a000
-#ifdef CONFIG_OMAP_LL_DEBUG_UART2
-               add     \rx, \rx, #0x00002000   @ UART 2
-#endif
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-               add     \rx, \rx, #0x00fb0000   @ UART 3
-               add     \rx, \rx, #0x00006000
-#endif
-#endif
+               orr     \rx, \rx, #0x0006a000   @ uart1 on omap2/3/4
+               ldrb    \rx, [\rx, #(UART_SCR << OMAP_PORT_SHIFT)] @ scratchpad
+
+               /* Select the UART to use based on the UART1 scratchpad value */
+               cmp     \rx, #0                 @ no port configured?
+               beq     21f                     @ if none, try to use UART1
+               cmp     \rx, #OMAP2UART1        @ OMAP2/3/4UART1
+               beq     21f                     @ configure OMAP2/3/4UART1
+               cmp     \rx, #OMAP2UART2        @ OMAP2/3/4UART2
+               beq     22f                     @ configure OMAP2/3/4UART2
+               cmp     \rx, #OMAP2UART3        @ only on 24xx
+               beq     23f                     @ configure OMAP2UART3
+               cmp     \rx, #OMAP3UART3        @ only on 34xx
+               beq     33f                     @ configure OMAP3UART3
+               cmp     \rx, #OMAP4UART3        @ only on 44xx
+               beq     43f                     @ configure OMAP4UART3
+               cmp     \rx, #OMAP3UART4        @ only on 36xx
+               beq     34f                     @ configure OMAP3UART4
+               cmp     \rx, #OMAP4UART4        @ only on 44xx
+               beq     44f                     @ configure OMAP4UART4
+               cmp     \rx, #ZOOM_UART         @ only on zoom2/3
+               beq     95f                     @ configure ZOOM_UART
+
+               /* Configure the UART offset from the phys/virt base */
+21:            mov     \rx, #UART_OFFSET(OMAP2_UART1_BASE)     @ omap2/3/4
+               b       98f
+22:            mov     \rx, #UART_OFFSET(OMAP2_UART2_BASE)     @ omap2/3/4
+               b       98f
+23:            mov     \rx, #UART_OFFSET(OMAP2_UART3_BASE)
+               b       98f
+33:            mov     \rx, #UART_OFFSET(OMAP3_UART1_BASE)
+               add     \rx, \rx, #0x00fb0000
+               add     \rx, \rx, #0x00006000           @ OMAP3_UART3_BASE
+               b       98f
+34:            mov     \rx, #UART_OFFSET(OMAP3_UART1_BASE)
+               add     \rx, \rx, #0x00fb0000
+               add     \rx, \rx, #0x00028000           @ OMAP3_UART4_BASE
+               b       98f
+43:            mov     \rx, #UART_OFFSET(OMAP4_UART3_BASE)
+               b       98f
+44:            mov     \rx, #UART_OFFSET(OMAP4_UART4_BASE)
+               b       98f
+95:            mov     \rx, #ZOOM_UART_BASE
+               ldr     \tmp, =omap_uart_phys
+               str     \rx, [\tmp, #0]
+               mov     \rx, #ZOOM_UART_VIRT
+               ldr     \tmp, =omap_uart_virt
+               str     \rx, [\tmp, #0]
+               mov     \rx, #(UART_LSR << ZOOM_PORT_SHIFT)
+               ldr     \tmp, =omap_uart_lsr
+               str     \rx, [\tmp, #0]
+               b       10b
+
+               /* Store both phys and virt address for the uart */
+98:            add     \rx, \rx, #0x48000000   @ phys base
+               ldr     \tmp, =omap_uart_phys
+               str     \rx, [\tmp, #0]
+               sub     \rx, \rx, #0x48000000   @ phys base
+               add     \rx, \rx, #0xfa000000   @ virt base
+               ldr     \tmp, =omap_uart_virt
+               str     \rx, [\tmp, #0]
+               mov     \rx, #(UART_LSR << OMAP_PORT_SHIFT)
+               ldr     \tmp, =omap_uart_lsr
+               str     \rx, [\tmp, #0]
+
+               b       10b
+99:
                .endm
 
                .macro  senduart,rd,rx
                .endm
 
                .macro  busyuart,rd,rx
-1001:          ldrb    \rd, [\rx, #(0x5 << 2)] @ OMAP-1510 and friends
-               and     \rd, \rd, #0x60
-               teq     \rd, #0x60
-               beq     1002f
-               ldrb    \rd, [\rx, #(0x5 << 0)] @ OMAP-730 only
-               and     \rd, \rd, #0x60
-               teq     \rd, #0x60
+1001:          ldr     \rd, =omap_uart_lsr
+               ldr     \rd, [\rd, #0]
+               ldrb    \rd, [\rx, \rd]
+               and     \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
+               teq     \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
                bne     1001b
-1002:
                .endm
 
                .macro  waituart,rd,rx
index e10a02df6e1d957d4d7bae0c986a164d938b2c0e..e657674d549036cbdeb2b394101dd33b07707a1e 100644 (file)
@@ -80,7 +80,6 @@ static LIST_HEAD(uart_list);
 
 static struct plat_serial8250_port serial_platform_data0[] = {
        {
-               .mapbase        = OMAP_UART1_BASE,
                .irq            = 72,
                .flags          = UPF_BOOT_AUTOCONF,
                .iotype         = UPIO_MEM,
@@ -93,7 +92,6 @@ static struct plat_serial8250_port serial_platform_data0[] = {
 
 static struct plat_serial8250_port serial_platform_data1[] = {
        {
-               .mapbase        = OMAP_UART2_BASE,
                .irq            = 73,
                .flags          = UPF_BOOT_AUTOCONF,
                .iotype         = UPIO_MEM,
@@ -106,7 +104,6 @@ static struct plat_serial8250_port serial_platform_data1[] = {
 
 static struct plat_serial8250_port serial_platform_data2[] = {
        {
-               .mapbase        = OMAP_UART3_BASE,
                .irq            = 74,
                .flags          = UPF_BOOT_AUTOCONF,
                .iotype         = UPIO_MEM,
@@ -120,7 +117,6 @@ static struct plat_serial8250_port serial_platform_data2[] = {
 #ifdef CONFIG_ARCH_OMAP4
 static struct plat_serial8250_port serial_platform_data3[] = {
        {
-               .mapbase        = OMAP_UART4_BASE,
                .irq            = 70,
                .flags          = UPF_BOOT_AUTOCONF,
                .iotype         = UPIO_MEM,
@@ -131,6 +127,17 @@ static struct plat_serial8250_port serial_platform_data3[] = {
        }
 };
 #endif
+
+void __init omap2_set_globals_uart(struct omap_globals *omap2_globals)
+{
+       serial_platform_data0[0].mapbase = omap2_globals->uart1_phys;
+       serial_platform_data1[0].mapbase = omap2_globals->uart2_phys;
+       serial_platform_data2[0].mapbase = omap2_globals->uart3_phys;
+#ifdef CONFIG_ARCH_OMAP4
+       serial_platform_data3[0].mapbase = omap2_globals->uart4_phys;
+#endif
+}
+
 static inline unsigned int __serial_read_reg(struct uart_port *up,
                                           int offset)
 {
index c7f808bfe272fa1caa477182e91cb566ff9b2c4a..91e0e39bb23f1602a98068234c28268f262e455c 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <mach/orion5x.h>
 
-       .macro  addruart,rx
+       .macro  addruart, rx, tmp
        mrc     p15, 0, \rx, c1, c0
        tst     \rx, #1                                 @ MMU enabled?
        ldreq   \rx, =ORION5X_REGS_PHYS_BASE
index 6d1407f319f8281fc780f34e64037e42cb5ea09c..6ca8bd30bf46f32dd0e55c9284b0962242596dff 100644 (file)
@@ -11,7 +11,7 @@
  *
 */
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                mov     \rx, #0x00090000
index 55d6a175ab19074a2851e57ceeb958dd5c08eda0..01cf81393fe2d5e25787ea87b375aa510e754f2c 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "hardware.h"
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #0x40000000                @ physical
index 932d8af180624a7415bdb5a09aafcb4b3235adb0..86622289b74e97950cabe4817bfaa5fc1f378e12 100644 (file)
@@ -33,7 +33,7 @@
 #error "Unknown RealView platform"
 #endif
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx,      #0x10000000
index b2a939ffdcdeed21a9f63e5199eade9e15d7f351..6fc8d66395dc373d48935ec26c7364da1561ca90 100644 (file)
@@ -11,7 +11,7 @@
  *
 */
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #0x03000000
index 4c29a89ad0770566b4969a84354af3d2e4f76b14..0eef78b4a6ed6fa24cddf346dfe55afeaf28a2e8 100644 (file)
@@ -19,7 +19,7 @@
 #define S3C2410_UART1_OFF (0x4000)
 #define SHIFT_2440TXF (14-9)
 
-       .macro addruart, rx
+       .macro addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1
                ldreq   \rx, = S3C24XX_PA_UART
index f0ef0ab475f68bb9c7e6f5c8aea515e1001cf196..239476b81f3b4fd643410401fad18c1b646739ef 100644 (file)
@@ -10,7 +10,7 @@
 #include <mach/map.h>
 #include <plat/regs-serial.h>
 
-       .macro addruart, rx
+       .macro addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1
                ldreq   \rx, = S3C24XX_PA_UART
index b18ac5266dfc333d9196a564a565341bb4168cb9..5c88875d6a3f57054f29ec6a91e4f9ade5d8e385 100644 (file)
@@ -21,7 +21,7 @@
         * aligned and add in the offset when we load the value here.
         */
 
-       .macro addruart, rx
+       .macro addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1
                ldreq   \rx, = S3C_PA_UART
index 9d142ccf654bbab3fa046b0d9576b4982025eb78..e181f5789482fcd7943777b1343d99eb86654ff1 100644 (file)
@@ -22,7 +22,7 @@
         * aligned and add in the offset when we load the value here.
         */
 
-       .macro addruart, rx
+       .macro addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1
                ldreq   \rx, = S3C_PA_UART
index 1f0634d92702a29c3540d59356d5cc5afd841e85..336adccea54232ef50f7b43367f824c26bc20163 100644 (file)
@@ -12,7 +12,7 @@
 */
 #include <mach/hardware.h>
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #0x80000000        @ physical base address
index f97a7626bd587d39884e160e0877be571382e5f2..50f071c5bf4d603656a01a9c8c2865bf07ee2eb9 100644 (file)
@@ -11,7 +11,7 @@
  *
 */
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mov     \rx, #0xe0000000
                orr     \rx, \rx, #0x000003f8
                .endm
index f3a1cbbeeab3876a91ec8da8411bcb09d2d78901..ca4a028c26613097811977bf2f2d14be592aee18 100644 (file)
@@ -10,7 +10,7 @@
  */
 #include <mach/hardware.h>
 
-       .macro  addruart,rx
+       .macro  addruart, rx, tmp
        /* If we move the adress using MMU, use this. */
        mrc     p15, 0, \rx, c1, c0
        tst     \rx, #1                 @ MMU enabled?
index 8f21b6a95dce5b13f6fc9becfe4c4606145366ee..494408b9678501325e96d9c7db410c35a96efea6 100644 (file)
@@ -8,7 +8,7 @@
  * published by the Free Software Foundation.
  *
  */
-       .macro  addruart,rx
+       .macro  addruart, rx, tmp
        mrc     p15, 0, \rx, c1, c0
        tst     \rx, #1                 @MMU enabled?
        moveq   \rx, #0x80000000        @MMU off, Physical address
index b4ac00eacf6876fa69719f47537f9a1899b8ff93..6fea7199c626742d4e39afcaadecd5e32ad39e99 100644 (file)
@@ -11,7 +11,7 @@
  *
 */
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx,      #0x10000000
index 15b2b148a105c02fa74ba392c33f4eb0de1fc1a8..5a6ae1b9e1e8abe4533e6d61de682042c33820df 100644 (file)
@@ -52,7 +52,7 @@
 #define UART_PADDR     MXC91231_UART2_BASE_ADDR
 #define UART_VADDR     MXC91231_AIPS1_IO_ADDRESS(MXC91231_UART2_BASE_ADDR)
 #endif
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                ldreq   \rx, =UART_PADDR        @ physical
index e2ea04a4c8a1b06b2c8d477b631fe38251fe9018..484d6a91524ffbcb626592c366b8bb9d6210b6c8 100644 (file)
@@ -141,25 +141,6 @@ config OMAP_DM_TIMER
        help
         Select this option if you want to use OMAP Dual-Mode timers.
 
-choice
-       prompt "Low-level debug console UART"
-       depends on ARCH_OMAP
-       default OMAP_LL_DEBUG_NONE
-
-config OMAP_LL_DEBUG_UART1
-       bool "UART1"
-
-config OMAP_LL_DEBUG_UART2
-       bool "UART2"
-
-config OMAP_LL_DEBUG_UART3
-       bool "UART3"
-
-config OMAP_LL_DEBUG_NONE
-       bool "None"
-
-endchoice
-
 config OMAP_SERIAL_WAKE
        bool "Enable wake-up events for serial ports"
        depends on ARCH_OMAP1 && OMAP_MUX
index dddc0273bc8bc4157248c6677925bc3de3cc4446..7cbc0a214aab754db49821a710b4b7e347e884e4 100644 (file)
@@ -34,6 +34,7 @@
 #include <plat/control.h>
 #include <plat/mux.h>
 #include <plat/fpga.h>
+#include <plat/serial.h>
 
 #include <plat/clock.h>
 
@@ -245,6 +246,7 @@ static void __init __omap2_set_globals(struct omap_globals *omap2_globals)
        omap2_set_globals_sdrc(omap2_globals);
        omap2_set_globals_control(omap2_globals);
        omap2_set_globals_prcm(omap2_globals);
+       omap2_set_globals_uart(omap2_globals);
 }
 
 #endif
@@ -259,6 +261,9 @@ static struct omap_globals omap242x_globals = {
        .ctrl   = OMAP2_L4_IO_ADDRESS(OMAP2420_CTRL_BASE),
        .prm    = OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE),
        .cm     = OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE),
+       .uart1_phys     = OMAP2_UART1_BASE,
+       .uart2_phys     = OMAP2_UART2_BASE,
+       .uart3_phys     = OMAP2_UART3_BASE,
 };
 
 void __init omap2_set_globals_242x(void)
@@ -277,6 +282,9 @@ static struct omap_globals omap243x_globals = {
        .ctrl   = OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE),
        .prm    = OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE),
        .cm     = OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE),
+       .uart1_phys     = OMAP2_UART1_BASE,
+       .uart2_phys     = OMAP2_UART2_BASE,
+       .uart3_phys     = OMAP2_UART3_BASE,
 };
 
 void __init omap2_set_globals_243x(void)
@@ -285,9 +293,9 @@ void __init omap2_set_globals_243x(void)
 }
 #endif
 
-#if defined(CONFIG_ARCH_OMAP3430)
+#if defined(CONFIG_ARCH_OMAP3)
 
-static struct omap_globals omap343x_globals = {
+static struct omap_globals omap3_globals = {
        .class  = OMAP343X_CLASS,
        .tap    = OMAP2_L4_IO_ADDRESS(0x4830A000),
        .sdrc   = OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE),
@@ -295,11 +303,21 @@ static struct omap_globals omap343x_globals = {
        .ctrl   = OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
        .prm    = OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE),
        .cm     = OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),
+       .uart1_phys     = OMAP3_UART1_BASE,
+       .uart2_phys     = OMAP3_UART2_BASE,
+       .uart3_phys     = OMAP3_UART3_BASE,
 };
 
 void __init omap2_set_globals_343x(void)
 {
-       __omap2_set_globals(&omap343x_globals);
+       __omap2_set_globals(&omap3_globals);
+}
+
+void __init omap2_set_globals_36xx(void)
+{
+       omap3_globals.uart4_phys = OMAP3_UART4_BASE;
+
+       __omap2_set_globals(&omap3_globals);
 }
 #endif
 
@@ -311,6 +329,10 @@ static struct omap_globals omap4_globals = {
        .prm    = OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE),
        .cm     = OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
        .cm2    = OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE),
+       .uart1_phys     = OMAP4_UART1_BASE,
+       .uart2_phys     = OMAP4_UART2_BASE,
+       .uart3_phys     = OMAP4_UART3_BASE,
+       .uart4_phys     = OMAP4_UART4_BASE,
 };
 
 void __init omap2_set_globals_443x(void)
@@ -318,6 +340,7 @@ void __init omap2_set_globals_443x(void)
        omap2_set_globals_tap(&omap4_globals);
        omap2_set_globals_control(&omap4_globals);
        omap2_set_globals_prcm(&omap4_globals);
+       omap2_set_globals_uart(&omap4_globals);
 }
 #endif
 
index 32c22272425d7582a285872d5a5f2cd0b36e7841..e04a58ec53a2b9c3e4514991d5b819bb6c65668d 100644 (file)
@@ -47,11 +47,16 @@ struct omap_globals {
        void __iomem    *prm;           /* Power and Reset Management */
        void __iomem    *cm;            /* Clock Management */
        void __iomem    *cm2;
+       unsigned long   uart1_phys;
+       unsigned long   uart2_phys;
+       unsigned long   uart3_phys;
+       unsigned long   uart4_phys;
 };
 
 void omap2_set_globals_242x(void);
 void omap2_set_globals_243x(void);
 void omap2_set_globals_343x(void);
+void omap2_set_globals_36xx(void);
 void omap2_set_globals_443x(void);
 
 /* These get called from omap2_set_globals_xxxx(), do not call these */
@@ -59,6 +64,7 @@ void omap2_set_globals_tap(struct omap_globals *);
 void omap2_set_globals_sdrc(struct omap_globals *);
 void omap2_set_globals_control(struct omap_globals *);
 void omap2_set_globals_prcm(struct omap_globals *);
+void omap2_set_globals_uart(struct omap_globals *);
 
 /**
  * omap_test_timeout - busy-loop, testing a condition
index 7560b4d583a314a1c7f20b0e223dc0812abe6a06..e69e1d857b45dbfca155e01c78b525287376f289 100644 (file)
 #define OMAP16XX_MMCSD2_SSW_MPU_CONF   (TIPB_SWITCH_BASE + 0x160)
 
 /* UART3 Registers Mapping through MPU bus */
-#define UART3_RHR               (OMAP_UART3_BASE + 0)
-#define UART3_THR               (OMAP_UART3_BASE + 0)
-#define UART3_DLL               (OMAP_UART3_BASE + 0)
-#define UART3_IER               (OMAP_UART3_BASE + 4)
-#define UART3_DLH               (OMAP_UART3_BASE + 4)
-#define UART3_IIR               (OMAP_UART3_BASE + 8)
-#define UART3_FCR               (OMAP_UART3_BASE + 8)
-#define UART3_EFR               (OMAP_UART3_BASE + 8)
-#define UART3_LCR               (OMAP_UART3_BASE + 0x0C)
-#define UART3_MCR               (OMAP_UART3_BASE + 0x10)
-#define UART3_XON1_ADDR1        (OMAP_UART3_BASE + 0x10)
-#define UART3_XON2_ADDR2        (OMAP_UART3_BASE + 0x14)
-#define UART3_LSR               (OMAP_UART3_BASE + 0x14)
-#define UART3_TCR               (OMAP_UART3_BASE + 0x18)
-#define UART3_MSR               (OMAP_UART3_BASE + 0x18)
-#define UART3_XOFF1             (OMAP_UART3_BASE + 0x18)
-#define UART3_XOFF2             (OMAP_UART3_BASE + 0x1C)
-#define UART3_SPR               (OMAP_UART3_BASE + 0x1C)
-#define UART3_TLR               (OMAP_UART3_BASE + 0x1C)
-#define UART3_MDR1              (OMAP_UART3_BASE + 0x20)
-#define UART3_MDR2              (OMAP_UART3_BASE + 0x24)
-#define UART3_SFLSR             (OMAP_UART3_BASE + 0x28)
-#define UART3_TXFLL             (OMAP_UART3_BASE + 0x28)
-#define UART3_RESUME            (OMAP_UART3_BASE + 0x2C)
-#define UART3_TXFLH             (OMAP_UART3_BASE + 0x2C)
-#define UART3_SFREGL            (OMAP_UART3_BASE + 0x30)
-#define UART3_RXFLL             (OMAP_UART3_BASE + 0x30)
-#define UART3_SFREGH            (OMAP_UART3_BASE + 0x34)
-#define UART3_RXFLH             (OMAP_UART3_BASE + 0x34)
-#define UART3_BLR               (OMAP_UART3_BASE + 0x38)
-#define UART3_ACREG             (OMAP_UART3_BASE + 0x3C)
-#define UART3_DIV16             (OMAP_UART3_BASE + 0x3C)
-#define UART3_SCR               (OMAP_UART3_BASE + 0x40)
-#define UART3_SSR               (OMAP_UART3_BASE + 0x44)
-#define UART3_EBLR              (OMAP_UART3_BASE + 0x48)
-#define UART3_OSC_12M_SEL       (OMAP_UART3_BASE + 0x4C)
-#define UART3_MVR               (OMAP_UART3_BASE + 0x50)
+#define UART3_RHR               (OMAP1_UART3_BASE + 0)
+#define UART3_THR               (OMAP1_UART3_BASE + 0)
+#define UART3_DLL               (OMAP1_UART3_BASE + 0)
+#define UART3_IER               (OMAP1_UART3_BASE + 4)
+#define UART3_DLH               (OMAP1_UART3_BASE + 4)
+#define UART3_IIR               (OMAP1_UART3_BASE + 8)
+#define UART3_FCR               (OMAP1_UART3_BASE + 8)
+#define UART3_EFR               (OMAP1_UART3_BASE + 8)
+#define UART3_LCR               (OMAP1_UART3_BASE + 0x0C)
+#define UART3_MCR               (OMAP1_UART3_BASE + 0x10)
+#define UART3_XON1_ADDR1        (OMAP1_UART3_BASE + 0x10)
+#define UART3_XON2_ADDR2        (OMAP1_UART3_BASE + 0x14)
+#define UART3_LSR               (OMAP1_UART3_BASE + 0x14)
+#define UART3_TCR               (OMAP1_UART3_BASE + 0x18)
+#define UART3_MSR               (OMAP1_UART3_BASE + 0x18)
+#define UART3_XOFF1             (OMAP1_UART3_BASE + 0x18)
+#define UART3_XOFF2             (OMAP1_UART3_BASE + 0x1C)
+#define UART3_SPR               (OMAP1_UART3_BASE + 0x1C)
+#define UART3_TLR               (OMAP1_UART3_BASE + 0x1C)
+#define UART3_MDR1              (OMAP1_UART3_BASE + 0x20)
+#define UART3_MDR2              (OMAP1_UART3_BASE + 0x24)
+#define UART3_SFLSR             (OMAP1_UART3_BASE + 0x28)
+#define UART3_TXFLL             (OMAP1_UART3_BASE + 0x28)
+#define UART3_RESUME            (OMAP1_UART3_BASE + 0x2C)
+#define UART3_TXFLH             (OMAP1_UART3_BASE + 0x2C)
+#define UART3_SFREGL            (OMAP1_UART3_BASE + 0x30)
+#define UART3_RXFLL             (OMAP1_UART3_BASE + 0x30)
+#define UART3_SFREGH            (OMAP1_UART3_BASE + 0x34)
+#define UART3_RXFLH             (OMAP1_UART3_BASE + 0x34)
+#define UART3_BLR               (OMAP1_UART3_BASE + 0x38)
+#define UART3_ACREG             (OMAP1_UART3_BASE + 0x3C)
+#define UART3_DIV16             (OMAP1_UART3_BASE + 0x3C)
+#define UART3_SCR               (OMAP1_UART3_BASE + 0x40)
+#define UART3_SSR               (OMAP1_UART3_BASE + 0x44)
+#define UART3_EBLR              (OMAP1_UART3_BASE + 0x48)
+#define UART3_OSC_12M_SEL       (OMAP1_UART3_BASE + 0x4C)
+#define UART3_MVR               (OMAP1_UART3_BASE + 0x50)
 
 /*
  * ---------------------------------------------------------------------------
index f5a4a92393ef2f0c34261ee4eb606b362bcb4c53..83dce4c4f7e62108da364e8c500a0af6238d9211 100644 (file)
 
 #include <linux/init.h>
 
-#if defined(CONFIG_ARCH_OMAP1)
 /* OMAP1 serial ports */
-#define OMAP_UART1_BASE                0xfffb0000
-#define OMAP_UART2_BASE                0xfffb0800
-#define OMAP_UART3_BASE                0xfffb9800
-#elif defined(CONFIG_ARCH_OMAP2)
+#define OMAP1_UART1_BASE       0xfffb0000
+#define OMAP1_UART2_BASE       0xfffb0800
+#define OMAP1_UART3_BASE       0xfffb9800
+
 /* OMAP2 serial ports */
-#define OMAP_UART1_BASE                0x4806a000
-#define OMAP_UART2_BASE                0x4806c000
-#define OMAP_UART3_BASE                0x4806e000
-#elif defined(CONFIG_ARCH_OMAP3)
+#define OMAP2_UART1_BASE       0x4806a000
+#define OMAP2_UART2_BASE       0x4806c000
+#define OMAP2_UART3_BASE       0x4806e000
+
 /* OMAP3 serial ports */
-#define OMAP_UART1_BASE                0x4806a000
-#define OMAP_UART2_BASE                0x4806c000
-#define OMAP_UART3_BASE                0x49020000
-#elif defined(CONFIG_ARCH_OMAP4)
+#define OMAP3_UART1_BASE       OMAP2_UART1_BASE
+#define OMAP3_UART2_BASE       OMAP2_UART2_BASE
+#define OMAP3_UART3_BASE       0x49020000
+#define OMAP3_UART4_BASE       0x49042000      /* Only on 36xx */
+
 /* OMAP4 serial ports */
-#define OMAP_UART1_BASE                0x4806a000
-#define OMAP_UART2_BASE                0x4806c000
-#define OMAP_UART3_BASE                0x48020000
-#define OMAP_UART4_BASE                0x4806e000
-#endif
+#define OMAP4_UART1_BASE       OMAP2_UART1_BASE
+#define OMAP4_UART2_BASE       OMAP2_UART2_BASE
+#define OMAP4_UART3_BASE       0x48020000
+#define OMAP4_UART4_BASE       0x4806e000
+
+/* External port on Zoom2/3 */
+#define ZOOM_UART_BASE         0x10000000
+#define ZOOM_UART_VIRT         0xfb000000
+
+#define OMAP_PORT_SHIFT                2
+#define OMAP7XX_PORT_SHIFT     0
+#define ZOOM_PORT_SHIFT                1
 
 #define OMAP1510_BASE_BAUD     (12000000/16)
 #define OMAP16XX_BASE_BAUD     (48000000/16)
 #define OMAP24XX_BASE_BAUD     (48000000/16)
 
+/*
+ * DEBUG_LL port encoding stored into the UART1 scratchpad register by
+ * decomp_setup in uncompress.h
+ */
+#define OMAP1UART1             11
+#define OMAP1UART2             12
+#define OMAP1UART3             13
+#define OMAP2UART1             21
+#define OMAP2UART2             22
+#define OMAP2UART3             23
+#define OMAP3UART1             OMAP2UART1
+#define OMAP3UART2             OMAP2UART2
+#define OMAP3UART3             33
+#define OMAP3UART4             34              /* Only on 36xx */
+#define OMAP4UART1             OMAP2UART1
+#define OMAP4UART2             OMAP2UART2
+#define OMAP4UART3             43
+#define OMAP4UART4             44
+#define ZOOM_UART              95              /* Only on zoom2/3 */
+
+/* This is only used by 8250.c for omap1510 */
 #define is_omap_port(pt)       ({int __ret = 0;                        \
-                       if ((pt)->port.mapbase == OMAP_UART1_BASE ||    \
-                           (pt)->port.mapbase == OMAP_UART2_BASE ||    \
-                           (pt)->port.mapbase == OMAP_UART3_BASE)      \
+                       if ((pt)->port.mapbase == OMAP1_UART1_BASE ||   \
+                           (pt)->port.mapbase == OMAP1_UART2_BASE ||   \
+                           (pt)->port.mapbase == OMAP1_UART3_BASE)     \
                                __ret = 1;                              \
                        __ret;                                          \
                        })
index 13c305d621273dba594f5c9e0830492a5c90de60..81d9ec540fcf5c3ee3e6b49ba0fa7ab9e356c1ec 100644 (file)
 
 #include <linux/types.h>
 #include <linux/serial_reg.h>
+
+#include <asm/mach-types.h>
+
 #include <plat/serial.h>
 
-unsigned int system_rev;
+static volatile u8 *uart1_base;
+static int uart1_shift;
 
-#define UART_OMAP_MDR1         0x08    /* mode definition register */
-#define OMAP_ID_730            0x355F
-#define OMAP_ID_850            0x362C
-#define ID_MASK                        0x7fff
-#define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0)
-#define omap_get_id() ((*(volatile unsigned int *)(0xfffed404)) >> 12) & ID_MASK
+static volatile u8 *uart_base;
+static int uart_shift;
 
-static void putc(int c)
+/*
+ * Store the DEBUG_LL uart number into UART1 scratchpad register.
+ * See also debug-macro.S, and serial.c for related code.
+ *
+ * Please note that we currently assume that:
+ * - UART1 clocks are enabled for register access
+ * - UART1 scratchpad register can be used
+ */
+static void set_uart1_scratchpad(unsigned char port)
 {
-       volatile u8 * uart = 0;
-       int shift = 2;
-
-#ifdef CONFIG_MACH_OMAP_PALMTE
-       return;
-#endif
-
-#ifdef CONFIG_ARCH_OMAP
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-       uart = (volatile u8 *)(OMAP_UART3_BASE);
-#elif defined(CONFIG_OMAP_LL_DEBUG_UART2)
-       uart = (volatile u8 *)(OMAP_UART2_BASE);
-#elif defined(CONFIG_OMAP_LL_DEBUG_UART1)
-       uart = (volatile u8 *)(OMAP_UART1_BASE);
-#elif defined(CONFIG_OMAP_LL_DEBUG_NONE)
-       return;
-#else
-       return;
-#endif
-
-#ifdef CONFIG_ARCH_OMAP1
-       /* Determine which serial port to use */
-       do {
-               /* MMU is not on, so cpu_is_omapXXXX() won't work here */
-               unsigned int omap_id = omap_get_id();
-
-               if (omap_id == OMAP_ID_730 || omap_id == OMAP_ID_850)
-                       shift = 0;
+       uart1_base[UART_SCR << uart1_shift] = port;
+}
 
-               if (check_port(uart, shift))
-                       break;
-               /* Silent boot if no serial ports are enabled. */
+static void putc(int c)
+{
+       if (!uart_base)
                return;
-       } while (0);
-#endif /* CONFIG_ARCH_OMAP1 */
-#endif
 
-       /*
-        * Now, xmit each character
-        */
-       while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
+       while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
                barrier();
-       uart[UART_TX << shift] = c;
+       uart_base[UART_TX << uart_shift] = c;
 }
 
 static inline void flush(void)
 {
 }
 
+/*
+ * Macros to configure UART1 and debug UART
+ */
+#define _DEBUG_LL_ENTRY(mach, uart1_phys, uart1_shft,                  \
+                       dbg_uart, dbg_shft, dbg_id)                     \
+       if (machine_is_##mach()) {                                      \
+               uart1_base = (volatile u8 *)(uart1_phys);               \
+               uart1_shift = (uart1_shft);                             \
+               uart_base = (volatile u8 *)(dbg_uart);                  \
+               uart_shift = (dbg_shft);                                \
+               port = (dbg_id);                                        \
+               set_uart1_scratchpad(port);                             \
+               break;                                                  \
+       }
+
+#define DEBUG_LL_OMAP7XX(p, mach)                                      \
+       _DEBUG_LL_ENTRY(mach, OMAP1_UART1_BASE, OMAP7XX_PORT_SHIFT,     \
+               OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, OMAP1UART##p)
+
+#define DEBUG_LL_OMAP1(p, mach)                                                \
+       _DEBUG_LL_ENTRY(mach, OMAP1_UART1_BASE, OMAP_PORT_SHIFT,        \
+               OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT, OMAP1UART##p)
+
+#define DEBUG_LL_OMAP2(p, mach)                                                \
+       _DEBUG_LL_ENTRY(mach, OMAP2_UART1_BASE, OMAP_PORT_SHIFT,        \
+               OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT, OMAP2UART##p)
+
+#define DEBUG_LL_OMAP3(p, mach)                                                \
+       _DEBUG_LL_ENTRY(mach, OMAP3_UART1_BASE, OMAP_PORT_SHIFT,        \
+               OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT, OMAP3UART##p)
+
+#define DEBUG_LL_OMAP4(p, mach)                                                \
+       _DEBUG_LL_ENTRY(mach, OMAP4_UART1_BASE, OMAP_PORT_SHIFT,        \
+               OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT, OMAP4UART##p)
+
+/* Zoom2/3 shift is different for UART1 and external port */
+#define DEBUG_LL_ZOOM(mach)                                            \
+       _DEBUG_LL_ENTRY(mach, OMAP2_UART1_BASE, OMAP_PORT_SHIFT,        \
+               ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
+
+static inline void __arch_decomp_setup(unsigned long arch_id)
+{
+       int port = 0;
+
+       /*
+        * Initialize the port based on the machine ID from the bootloader.
+        * Note that we're using macros here instead of switch statement
+        * as machine_is functions are optimized out for the boards that
+        * are not selected.
+        */
+       do {
+               /* omap7xx/8xx based boards using UART1 with shift 0 */
+               DEBUG_LL_OMAP7XX(1, herald);
+               DEBUG_LL_OMAP7XX(1, omap_perseus2);
+
+               /* omap15xx/16xx based boards using UART1 */
+               DEBUG_LL_OMAP1(1, ams_delta);
+               DEBUG_LL_OMAP1(1, nokia770);
+               DEBUG_LL_OMAP1(1, omap_h2);
+               DEBUG_LL_OMAP1(1, omap_h3);
+               DEBUG_LL_OMAP1(1, omap_innovator);
+               DEBUG_LL_OMAP1(1, omap_osk);
+               DEBUG_LL_OMAP1(1, omap_palmte);
+               DEBUG_LL_OMAP1(1, omap_palmz71);
+
+               /* omap15xx/16xx based boards using UART2 */
+               DEBUG_LL_OMAP1(2, omap_palmtt);
+
+               /* omap15xx/16xx based boards using UART3 */
+               DEBUG_LL_OMAP1(3, sx1);
+
+               /* omap2 based boards using UART1 */
+               DEBUG_LL_OMAP2(1, omap2evm);
+               DEBUG_LL_OMAP2(1, omap_2430sdp);
+               DEBUG_LL_OMAP2(1, omap_apollon);
+               DEBUG_LL_OMAP2(1, omap_h4);
+
+               /* omap2 based boards using UART3 */
+               DEBUG_LL_OMAP2(3, nokia_n800);
+               DEBUG_LL_OMAP2(3, nokia_n810);
+               DEBUG_LL_OMAP2(3, nokia_n810_wimax);
+
+               /* omap3 based boards using UART1 */
+               DEBUG_LL_OMAP2(1, omap3evm);
+               DEBUG_LL_OMAP3(1, omap_3430sdp);
+               DEBUG_LL_OMAP3(1, omap_3630sdp);
+
+               /* omap3 based boards using UART3 */
+               DEBUG_LL_OMAP3(3, cm_t35);
+               DEBUG_LL_OMAP3(3, igep0020);
+               DEBUG_LL_OMAP3(3, nokia_rx51);
+               DEBUG_LL_OMAP3(3, omap3517evm);
+               DEBUG_LL_OMAP3(3, omap3_beagle);
+               DEBUG_LL_OMAP3(3, omap3_pandora);
+               DEBUG_LL_OMAP3(3, omap_ldp);
+               DEBUG_LL_OMAP3(3, overo);
+               DEBUG_LL_OMAP3(3, touchbook);
+
+               /* omap4 based boards using UART3 */
+               DEBUG_LL_OMAP4(3, omap_4430sdp);
+
+               /* zoom2/3 external uart */
+               DEBUG_LL_ZOOM(omap_zoom2);
+               DEBUG_LL_ZOOM(omap_zoom3);
+
+       } while (0);
+}
+
+#define arch_decomp_setup()    __arch_decomp_setup(arch_id)
+
 /*
  * nothing to do
  */
-#define arch_decomp_setup()
 #define arch_decomp_wdog()
index fb3b969bf0a24fc4de8a9ba87e1936a5fe9c75a5..1b9348bf0e4926b542bea6d1bfcc4a9cd2e29440 100644 (file)
@@ -16,7 +16,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-               .macro  addruart,rx
+               .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx, #0x80000000        @ physical base address