Allow using machine ID for DEBUG_LL macros
Subsystems (20)
Tony Lindgren
maintainercover Allow using machine ID for DEBUG_LL macros
Hi all,
Here are two patches that allow using machine ID for DEBUG_LL macros by adding a new macro inituart.
Will post the related omap changes separately.
Regards,
Tony
---
Tony Lindgren (2):
ARM: Add inituart macro to initialize DEBUG_LL serial port based on the machine ID
ARM: Add empty inituart macros
arch/arm/kernel/head-common.S | 7 +++++++ arch/arm/kernel/head.S | 5 +++++ arch/arm/mach-aaec2000/include/mach/debug-macro.S | 4 ++++ arch/arm/mach-at91/include/mach/debug-macro.S | 3 +++ arch/arm/mach-clps711x/include/mach/debug-macro.S | 3 +++ arch/arm/mach-cns3xxx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-davinci/include/mach/debug-macro.S | 3 +++ arch/arm/mach-dove/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ebsa110/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ep93xx/include/mach/debug-macro.S | 3 +++ .../arm/mach-footbridge/include/mach/debug-macro.S | 4 ++++ arch/arm/mach-gemini/include/mach/debug-macro.S | 3 +++ .../arm/mach-integrator/include/mach/debug-macro.S | 3 +++ arch/arm/mach-iop13xx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-iop32x/include/mach/debug-macro.S | 3 +++ arch/arm/mach-iop33x/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ixp23xx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-kirkwood/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ks8695/include/mach/debug-macro.S | 3 +++ arch/arm/mach-l7200/include/mach/debug-macro.S | 3 +++ arch/arm/mach-loki/include/mach/debug-macro.S | 3 +++ arch/arm/mach-lpc32xx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-mmp/include/mach/debug-macro.S | 3 +++ arch/arm/mach-msm/include/mach/debug-macro.S | 4 ++++ arch/arm/mach-mv78xx0/include/mach/debug-macro.S | 3 +++ arch/arm/mach-mxs/include/mach/debug-macro.S | 3 +++ arch/arm/mach-netx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-nomadik/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ns9xxx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-omap1/include/mach/debug-macro.S | 3 +++ arch/arm/mach-omap2/include/mach/debug-macro.S | 3 +++ arch/arm/mach-pnx4008/include/mach/debug-macro.S | 3 +++ arch/arm/mach-pxa/include/mach/debug-macro.S | 3 +++ arch/arm/mach-realview/include/mach/debug-macro.S | 3 +++ arch/arm/mach-rpc/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s3c2410/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s3c24a0/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s3c64xx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5p6442/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5p64x0/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5pc100/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5pv210/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5pv310/include/mach/debug-macro.S | 3 +++ arch/arm/mach-sa1100/include/mach/debug-macro.S | 3 +++ arch/arm/mach-shark/include/mach/debug-macro.S | 3 +++ arch/arm/mach-u300/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ux500/include/mach/debug-macro.S | 3 +++ arch/arm/mach-versatile/include/mach/debug-macro.S | 3 +++ arch/arm/mach-vexpress/include/mach/debug-macro.S | 3 +++ arch/arm/plat-mxc/include/mach/debug-macro.S | 3 +++ arch/arm/plat-spear/include/plat/debug-macro.S | 3 +++ arch/arm/plat-stmp3xxx/include/mach/debug-macro.S | 3 +++ arch/arm/plat-tcc/include/mach/debug-macro.S | 3 +++ 53 files changed, 168 insertions(+), 0 deletions(-)
Signature · 1 line
Signature
Tony Lindgren
maintainerPATCH 1/2 ARM: Add inituart macro to initialize DEBUG_LL serial port based on the machine ID
Allow machine specific init of the DEBUG_LL serial port. This is needed to debug kernels built with support for multiple machines compiled in without recompiling the kernel.
As some SoCs need to use variables to store the port address and LSR register configuration, we must call inituart again after clearing the BSS.
If variables are being used for for inituart and addruart, this setup won't work properly for debugging the uncompress code without patching arch/arm/boot/compressed/head.S for the machine in question.
For adding DEBUG_LL support for new machines, only two lines are needed in debug-macro.S:
.macro inituart, id, a, v ... ldr \v, =MACH_TYPE_SOMETHING1 cmp \id, \v ldrne \v, =MACH_TYPE_SOMETHING2 cmpne \id, \v ldrne \v, =MACH_TYPE_SOMETHING3 cmpne \id, \v ... .endm
Note that this patch depends on a patch to add empty inituart macro for each debug-macro.S file.
--- arch/arm/kernel/head-common.S | 7 +++++++ arch/arm/kernel/head.S | 5 +++++ 2 files changed, 12 insertions(+), 0 deletions(-)
arch/arm/kernel/head-common.S +7 -0
@@ -63,6 +63,9 @@ ENDPROC(__vet_atags) * r1 = machine ID * r2 = atags pointer * r9 = processor ID + * + * Note that if the machine uses BSS to store the debug UART configuration, + * debug_ll code will not work after clear BSS until inituart is called again. */ __INIT __mmap_switched:
@@ -80,6 +83,10 @@ __mmap_switched: strcc fp, [r6],#4 bcc 1b +#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC) + inituart r1, r4, r5 +#endif + ARM( ldmia r3, {r4, r5, r6, r7, sp}) THUMB( ldmia r3, {r4, r5, r6, r7} ) THUMB( ldr sp, [r3, #16] )
arch/arm/kernel/head.S +5 -0
@@ -75,6 +75,11 @@ ENTRY(stext) setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode @ and irqs disabled + +#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC) + inituart r1, r3, r4 +#endif + mrc p15, 0, r9, c0, c0 @ get processor id bl __lookup_processor_type @ r5=procinfo r9=cpuid movs r10, r5 @ invalid processor (r5=0)?
PATCH 1/2 ARM: Add inituart macro to initialize DEBUG_LL serial port based on the machine ID
Quoted 40 lines · Tony Lindgren
Allow machine specific init of the
DEBUG_LLserial port. This is needed to debug kernels built with support for multiple machines compiled in without recompiling the kernel.As some SoCs need to use variables to store the port address and LSR register configuration, we must call inituart again after clearing the BSS.
If variables are being used for for inituart and addruart, this setup won't work properly for debugging the uncompress code without patching
arch/arm/boot/compressed/head.Sfor the machine in question.For adding
DEBUG_LLsupport for new machines, only two lines are needed indebug-macro.S:.macro inituart, id, a, v ... ldr \v, =MACH_TYPE_SOMETHING1 cmp \id, \v ldrne \v, =MACH_TYPE_SOMETHING2 cmpne \id, \v ldrne \v, =MACH_TYPE_SOMETHING3 cmpne \id, \v ... .endmNote that this patch depends on a patch to add empty inituart macro for each
debug-macro.Sfile.Signed-off-by Tony Lindgren <[email protected]>--- arch/arm/kernel/head-common.S | 7 +++++++ arch/arm/kernel/head.S | 5 +++++ 2 files changed, 12 insertions(+), 0 deletions(-)arch/arm/kernel/head-common.S +0
-0
arch/arm/kernel/head-common.S ENDPROC(__vet_atags) · line 69
Quoted 7 lines
arch/arm/kernel/head-common.S +3
-0@@ -63,6 +63,9 @@ ENDPROC(__vet_atags) * r1 = machine ID * r2 = atags pointer * r9 = processor ID + * + * Note that if the machine uses BSS to store the debug UART configuration, + * debug_ll code will not work after clear BSS until inituart is called again. */
Please make sure that inituart always uses .data to store its needed configuration instead.
Quoted 18 lines
arch/arm/kernel/head-common.S +4
-0__INIT __mmap_switched:@@ -80,6 +83,10 @@ __mmap_switched: strcc fp, [r6],#4 bcc 1b +#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC) + inituart r1, r4, r5 +#endif + ARM( ldmia r3, {r4, r5, r6, r7, sp}) THUMB( ldmia r3, {r4, r5, r6, r7} ) THUMB( ldr sp, [r3, #16] )arch/arm/kernel/head.S +0
-0
arch/arm/kernel/head.S line 82
Quoted 8 lines
arch/arm/kernel/head.S +5
-0@@ -75,6 +75,11 @@ ENTRY(stext) setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode @ and irqs disabled + +#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC) + inituart r1, r3, r4 +#endif +
Here you have two calls, one which is performed when the MMU is off, and the other one (after .bss is cleared) when the MMU is on. Did you consider the implications of accessing that .bss variable in those two circumstances? This is also true for when printascii is called.
Ensuring that .data is used instead of .bss would eliminate one of those calls which is a good thing to do. But extra cleverness is needed to retrieve the config data in a position independent way.
Nicolas
PATCH 1/2 ARM: Add inituart macro to initialize DEBUG_LL serial port based on the machine ID
In reply to Tony LindgrenQuoted 11 lines · Tony Lindgren
Allow machine specific init of the
DEBUG_LLserial port. This is needed to debug kernels built with support for multiple machines compiled in without recompiling the kernel.As some SoCs need to use variables to store the port address and LSR register configuration, we must call inituart again after clearing the BSS.
If variables are being used for for inituart and addruart, this setup won't work properly for debugging the uncompress code without patching
arch/arm/boot/compressed/head.Sfor the machine in question.
Can't we just hard-configure the virtual/physical address at build time and be done with it?
I've given up with the current state of affairs which tries to use the platform ID to select the UART to use as it never seems to work, and I have a couple of patches which hard-code the address at compile time - one for the SDP4430 board and one for the LDP3430 board.
If it's complicated, then it probably won't work. Keep it simple. That's especially true for debugging code, otherwise you need extra debugging code to debug why the debugging code doesn't work.
PATCH 1/2 ARM: Add inituart macro to initialize DEBUG_LL serial port based on the machine ID
Quoted 11 lines · Russell King - ARM Linux
Can't we just hard-configure the virtual/physical address at build time and be done with it?
I've given up with the current state of affairs which tries to use the platform ID to select the UART to use as it never seems to work, and I have a couple of patches which hard-code the address at compile time - one for the SDP4430 board and one for the LDP3430 board.
If it's complicated, then it probably won't work. Keep it simple. That's especially true for debugging code, otherwise you need extra debugging code to debug why the debugging code doesn't work.
There's another good reason to hard-configure the UART port rather than select it by ID.
The common usage scenario: you're bringing up a new board. You know you're going to have your console connected to UART2. So, no matter what you want your debug messages to come out of UART2 even if the machine ID is wrong.
By detecting the UART port from the machine number, you immediately lose that ability, and therefore the confidence, that "if I build the kernel for X with LL debug enabled, and monitor port Y, I will get messages out of port Y, and not some other random port Z which I'd to solder wires to to monitor."
In other words, no messages on the monitored port changes from "we didn't get into the kernel, or something early in the kernel boot before the C code went wrong" to "... or maybe the debugging code failed to get the right port too."
It is invaluable to know that the debugging code will always talk to the same UART which you're monitoring.
Tony Lindgren
maintainerPATCH 1/2 ARM: Add inituart macro to initialize DEBUG_LL serial port based on the machine ID
Quoted 13 lines · Russell King - ARM Linux
Quoted 11 lines · Russell King - ARM Linux
Can't we just hard-configure the virtual/physical address at build time and be done with it?
I've given up with the current state of affairs which tries to use the platform ID to select the UART to use as it never seems to work, and I have a couple of patches which hard-code the address at compile time - one for the SDP4430 board and one for the LDP3430 board.
If it's complicated, then it probably won't work. Keep it simple. That's especially true for debugging code, otherwise you need extra debugging code to debug why the debugging code doesn't work.
Quoted 7 lines
There's another good reason to hard-configure the UART port rather than select it by ID.
The common usage scenario: you're bringing up a new board. You know you're going to have your console connected to UART2. So, no matter what you want your debug messages to come out of UART2 even if the machine ID is wrong.
Yes that's an important debugging case too. Another common use case is "this kernel boots on machines a and b, but fails to boot on c and d".
Quoted 5 lines
By detecting the UART port from the machine number, you immediately lose that ability, and therefore the confidence, that "if I build the kernel for X with LL debug enabled, and monitor port Y, I will get messages out of port Y, and not some other random port Z which I'd to solder wires to to monitor."
True, but that easily also leads to confusion on why some kernel only boots on one machine. So maybe we can do something that can easily be selected in Kconfig for forcing certain port?
Quoted 7 lines
In other words, no messages on the monitored port changes from "we didn't get into the kernel, or something early in the kernel boot before the C code went wrong" to "... or maybe the debugging code failed to get the right port too."
It is invaluable to know that the debugging code will always talk to the same UART which you're monitoring.
I'll take a look how we can allow forcing the uart easily.
Regards,
Tony
Tony Lindgren
maintainerPATCH 2/2 ARM: Add empty inituart macros
In reply to Tony LindgrenAdd empty inituart macros. These can be used to initialize the debug serial port based on the machine ID.
--- arch/arm/mach-aaec2000/include/mach/debug-macro.S | 4 ++++ arch/arm/mach-at91/include/mach/debug-macro.S | 3 +++ arch/arm/mach-clps711x/include/mach/debug-macro.S | 3 +++ arch/arm/mach-cns3xxx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-davinci/include/mach/debug-macro.S | 3 +++ arch/arm/mach-dove/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ebsa110/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ep93xx/include/mach/debug-macro.S | 3 +++ .../arm/mach-footbridge/include/mach/debug-macro.S | 4 ++++ arch/arm/mach-gemini/include/mach/debug-macro.S | 3 +++ .../arm/mach-integrator/include/mach/debug-macro.S | 3 +++ arch/arm/mach-iop13xx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-iop32x/include/mach/debug-macro.S | 3 +++ arch/arm/mach-iop33x/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ixp23xx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-kirkwood/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ks8695/include/mach/debug-macro.S | 3 +++ arch/arm/mach-l7200/include/mach/debug-macro.S | 3 +++ arch/arm/mach-loki/include/mach/debug-macro.S | 3 +++ arch/arm/mach-lpc32xx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-mmp/include/mach/debug-macro.S | 3 +++ arch/arm/mach-msm/include/mach/debug-macro.S | 4 ++++ arch/arm/mach-mv78xx0/include/mach/debug-macro.S | 3 +++ arch/arm/mach-mxs/include/mach/debug-macro.S | 3 +++ arch/arm/mach-netx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-nomadik/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ns9xxx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-omap1/include/mach/debug-macro.S | 3 +++ arch/arm/mach-omap2/include/mach/debug-macro.S | 3 +++ arch/arm/mach-pnx4008/include/mach/debug-macro.S | 3 +++ arch/arm/mach-pxa/include/mach/debug-macro.S | 3 +++ arch/arm/mach-realview/include/mach/debug-macro.S | 3 +++ arch/arm/mach-rpc/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s3c2410/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s3c24a0/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s3c64xx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5p6442/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5p64x0/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5pc100/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5pv210/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5pv310/include/mach/debug-macro.S | 3 +++ arch/arm/mach-sa1100/include/mach/debug-macro.S | 3 +++ arch/arm/mach-shark/include/mach/debug-macro.S | 3 +++ arch/arm/mach-u300/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ux500/include/mach/debug-macro.S | 3 +++ arch/arm/mach-versatile/include/mach/debug-macro.S | 3 +++ arch/arm/mach-vexpress/include/mach/debug-macro.S | 3 +++ arch/arm/plat-mxc/include/mach/debug-macro.S | 3 +++ arch/arm/plat-spear/include/plat/debug-macro.S | 3 +++ arch/arm/plat-stmp3xxx/include/mach/debug-macro.S | 3 +++ arch/arm/plat-tcc/include/mach/debug-macro.S | 3 +++ 51 files changed, 156 insertions(+), 0 deletions(-)
arch/arm/mach-aaec2000/include/mach/debug-macro.S +4 -0
@@ -10,6 +10,10 @@ */ #include "hardware.h" + + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, 0x00000800 orr \rv, \rp, #io_p2v(0x80000000) @ virtual
arch/arm/mach-at91/include/mach/debug-macro.S +3 -0
@@ -14,6 +14,9 @@ #include <mach/hardware.h> #include <mach/at91_dbgu.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =(AT91_BASE_SYS + AT91_DBGU) @ System peripherals (phys address) ldr \rv, =(AT91_VA_BASE_SYS + AT91_DBGU) @ System peripherals (virt address)
arch/arm/mach-clps711x/include/mach/debug-macro.S +3 -0
@@ -14,6 +14,9 @@ #include <mach/hardware.h> #include <asm/hardware/clps7111.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv #ifndef CONFIG_DEBUG_CLPS711X_UART2 mov \rp, #0x0000 @ UART1
arch/arm/mach-cns3xxx/include/mach/debug-macro.S +3 -0
@@ -10,6 +10,9 @@ * published by the Free Software Foundation. */ + .macro inituart, id, a, v + .endm + .macro addruart,rp,rv mov \rp, #0x00009000 orr \rv, \rp, #0xf0000000 @ virtual base
arch/arm/mach-davinci/include/mach/debug-macro.S +3 -0
@@ -29,6 +29,9 @@ davinci_uart_phys: .word 0 davinci_uart_virt: .word 0 .popsection + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv /* Use davinci_uart_phys/virt if already configured */
arch/arm/mach-dove/include/mach/debug-macro.S +3 -0
@@ -8,6 +8,9 @@ #include <mach/bridge-regs.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =DOVE_SB_REGS_PHYS_BASE ldr \rv, =DOVE_SB_REGS_VIRT_BASE
arch/arm/mach-ebsa110/include/mach/debug-macro.S +3 -0
@@ -11,6 +11,9 @@ * **/ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0xf0000000 orr \rp, \rp, #0x00000be0
arch/arm/mach-ep93xx/include/mach/debug-macro.S +3 -0
@@ -11,6 +11,9 @@ */ #include <mach/ep93xx-regs.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =EP93XX_APB_PHYS_BASE @ Physical base ldr \rv, =EP93XX_APB_VIRT_BASE @ virtual base
arch/arm/mach-footbridge/include/mach/debug-macro.S +4 -0
@@ -15,6 +15,10 @@ #ifndef CONFIG_DEBUG_DC21285_PORT /* For NetWinder debugging */ + + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0x000003f8 orr \rv, \rp, #0xff000000 @ virtual
arch/arm/mach-gemini/include/mach/debug-macro.S +3 -0
@@ -11,6 +11,9 @@ */ #include <mach/hardware.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =GEMINI_UART_BASE @ physical ldr \rv, =IO_ADDRESS(GEMINI_UART_BASE) @ virtual
arch/arm/mach-integrator/include/mach/debug-macro.S +3 -0
@@ -11,6 +11,9 @@ * */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0x16000000 @ physical base address mov \rv, #0xf0000000 @ virtual base
arch/arm/mach-iop13xx/include/mach/debug-macro.S +3 -0
@@ -11,6 +11,9 @@ * published by the Free Software Foundation. */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0x00002300 orr \rp, \rp, #0x00000040
arch/arm/mach-iop32x/include/mach/debug-macro.S +3 -0
@@ -11,6 +11,9 @@ * published by the Free Software Foundation. */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0xfe000000 @ physical as well as virtual orr \rp, \rp, #0x00800000 @ location of the UART
arch/arm/mach-iop33x/include/mach/debug-macro.S +3 -0
@@ -11,6 +11,9 @@ * published by the Free Software Foundation. */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0x00ff0000 orr \rp, \rp, #0x0000f700
arch/arm/mach-ixp23xx/include/mach/debug-macro.S +3 -0
@@ -12,6 +12,9 @@ */ #include <mach/ixp23xx.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =IXP23XX_PERIPHERAL_PHYS @ physical ldr \rv, =IXP23XX_PERIPHERAL_VIRT @ virtual
arch/arm/mach-kirkwood/include/mach/debug-macro.S +3 -0
@@ -8,6 +8,9 @@ #include <mach/bridge-regs.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =KIRKWOOD_REGS_PHYS_BASE ldr \rv, =KIRKWOOD_REGS_VIRT_BASE
arch/arm/mach-ks8695/include/mach/debug-macro.S +3 -0
@@ -14,6 +14,9 @@ #include <mach/hardware.h> #include <mach/regs-uart.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =KS8695_UART_PA @ physical base address ldr \rv, =KS8695_UART_VA @ virtual base address
arch/arm/mach-l7200/include/mach/debug-macro.S +3 -0
@@ -14,6 +14,9 @@ .equ io_virt, IO_BASE .equ io_phys, IO_START + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0x00044000 @ UART1 @ mov \rp, #0x00045000 @ UART2
arch/arm/mach-loki/include/mach/debug-macro.S +3 -0
@@ -8,6 +8,9 @@ #include <mach/loki.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =LOKI_REGS_PHYS_BASE ldr \rv, =LOKI_REGS_VIRT_BASE
arch/arm/mach-lpc32xx/include/mach/debug-macro.S +3 -0
@@ -20,6 +20,9 @@ * Debug output is hardcoded to standard UART 5 */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldreq \rp, =0x40090000 ldrne \rv, =0xF4090000
arch/arm/mach-mmp/include/mach/debug-macro.S +3 -0
@@ -11,6 +11,9 @@ #include <mach/addr-map.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =APB_PHYS_BASE @ physical ldr \rv, =APB_VIRT_BASE @ virtual
arch/arm/mach-msm/include/mach/debug-macro.S +4 -0
@@ -20,6 +20,10 @@ #include <mach/msm_iomap.h> #if defined(CONFIG_HAS_MSM_DEBUG_UART_PHYS) && !defined(CONFIG_MSM_DEBUG_UART_NONE) + + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =MSM_DEBUG_UART_PHYS ldr \rv, =MSM_DEBUG_UART_BASE
arch/arm/mach-mv78xx0/include/mach/debug-macro.S +3 -0
@@ -8,6 +8,9 @@ #include <mach/mv78xx0.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =MV78XX0_REGS_PHYS_BASE ldr \rv, =MV78XX0_REGS_VIRT_BASE
arch/arm/mach-mxs/include/mach/debug-macro.S +3 -0
@@ -30,6 +30,9 @@ #define UART_VADDR MXS_IO_ADDRESS(UART_PADDR) + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =UART_PADDR @ physical ldr \rv, =UART_VADDR @ virtual
arch/arm/mach-netx/include/mach/debug-macro.S +3 -0
@@ -13,6 +13,9 @@ #include "hardware.h" + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0x00000a00 orr \rv, \rp, #io_p2v(0x00100000) @ virtual
arch/arm/mach-nomadik/include/mach/debug-macro.S +3 -0
@@ -10,6 +10,9 @@ * */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0x00100000 add \rp, \rp, #0x000fb000
arch/arm/mach-ns9xxx/include/mach/debug-macro.S +3 -0
@@ -12,6 +12,9 @@ #include <mach/regs-board-a9m9750dev.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =NS9XXX_CSxSTAT_PHYS(0) ldr \rv, =io_p2v(NS9XXX_CSxSTAT_PHYS(0))
arch/arm/mach-omap1/include/mach/debug-macro.S +3 -0
@@ -25,6 +25,9 @@ omap_uart_phys: .word 0x0 omap_uart_virt: .word 0x0 .popsection + .macro inituart, id, a, v + .endm + /* * Note that this code won't work if the bootloader passes * a wrong machine ID number in r1. To debug, just hardcode
arch/arm/mach-omap2/include/mach/debug-macro.S +3 -0
@@ -28,6 +28,9 @@ omap_uart_virt: .word 0 omap_uart_lsr: .word 0 .popsection + .macro inituart, id, a, v + .endm + /* * Note that this code won't work if the bootloader passes * a wrong machine ID number in r1. To debug, just hardcode
arch/arm/mach-pnx4008/include/mach/debug-macro.S +3 -0
@@ -11,6 +11,9 @@ * */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0x00090000 add \rv, \rp, #0xf4000000 @ virtual
arch/arm/mach-pxa/include/mach/debug-macro.S +3 -0
@@ -13,6 +13,9 @@ #include "hardware.h" + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0x00100000 orr \rv, \rp, #io_p2v(0x40000000) @ virtual
arch/arm/mach-realview/include/mach/debug-macro.S +3 -0
@@ -33,6 +33,9 @@ #error "Unknown RealView platform" #endif + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #DEBUG_LL_UART_OFFSET orr \rv, \rp, #0xfb000000 @ virtual base
arch/arm/mach-rpc/include/mach/debug-macro.S +3 -0
@@ -11,6 +11,9 @@ * */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0x00010000 orr \rp, \rp, #0x00000fe0
arch/arm/mach-s3c2410/include/mach/debug-macro.S +3 -0
@@ -19,6 +19,9 @@ #define S3C2410_UART1_OFF (0x4000) #define SHIFT_2440TXF (14-9) + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, = S3C24XX_PA_UART ldr \rv, = S3C24XX_VA_UART
arch/arm/mach-s3c24a0/include/mach/debug-macro.S +3 -0
@@ -10,6 +10,9 @@ #include <mach/map.h> #include <plat/regs-serial.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, = S3C24XX_PA_UART ldr \rv, = S3C24XX_VA_UART
arch/arm/mach-s3c64xx/include/mach/debug-macro.S +3 -0
@@ -21,6 +21,9 @@ * aligned and add in the offset when we load the value here. */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, = S3C_PA_UART ldr \rv, = (S3C_VA_UART + S3C_PA_UART & 0xfffff)
arch/arm/mach-s5p6442/include/mach/debug-macro.S +3 -0
@@ -15,6 +15,9 @@ #include <mach/map.h> #include <plat/regs-serial.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, = S3C_PA_UART ldr \rv, = S3C_VA_UART
arch/arm/mach-s5p64x0/include/mach/debug-macro.S +3 -0
@@ -15,6 +15,9 @@ #include <plat/regs-serial.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0xE0000000 orr \rp, \rp, #0x00100000
arch/arm/mach-s5pc100/include/mach/debug-macro.S +3 -0
@@ -22,6 +22,9 @@ * aligned and add in the offset when we load the value here. */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, = S3C_PA_UART ldr \rv, = S3C_VA_UART
arch/arm/mach-s5pv210/include/mach/debug-macro.S +3 -0
@@ -21,6 +21,9 @@ * aligned and add in the offset when we load the value here. */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, = S3C_PA_UART ldr \rv, = S3C_VA_UART
arch/arm/mach-s5pv310/include/mach/debug-macro.S +3 -0
@@ -20,6 +20,9 @@ * aligned and add in the offset when we load the value here. */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldreq \rp, = S3C_PA_UART ldrne \rv, = S3C_VA_UART
arch/arm/mach-sa1100/include/mach/debug-macro.S +3 -0
@@ -12,6 +12,9 @@ */ #include <mach/hardware.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mrc p15, 0, \rp, c1, c0 tst \rp, #1 @ MMU enabled?
arch/arm/mach-shark/include/mach/debug-macro.S +3 -0
@@ -11,6 +11,9 @@ * */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0xe0000000 orr \rp, \rp, #0x000003f8
arch/arm/mach-u300/include/mach/debug-macro.S +3 -0
@@ -10,6 +10,9 @@ */ #include <mach/hardware.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv /* If we move the address using MMU, use this. */ ldr \rp, = U300_SLOW_PER_PHYS_BASE @ MMU off, physical address
arch/arm/mach-ux500/include/mach/debug-macro.S +3 -0
@@ -35,6 +35,9 @@ #define UX500_UART(n) __UX500_UART(n) #define UART_BASE UX500_UART(CONFIG_UX500_DEBUG_UART) + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =UART_BASE @ no, physical address ldr \rv, =IO_ADDRESS(UART_BASE) @ yes, virtual address
arch/arm/mach-versatile/include/mach/debug-macro.S +3 -0
@@ -11,6 +11,9 @@ * */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0x001F0000 orr \rp, \rp, #0x00001000
arch/arm/mach-vexpress/include/mach/debug-macro.S +3 -0
@@ -12,6 +12,9 @@ #define DEBUG_LL_UART_OFFSET 0x00009000 + .macro inituart, id, a, v + .endm + .macro addruart,rp,rv mov \rp, #DEBUG_LL_UART_OFFSET orr \rv, \rp, #0xf8000000 @ virtual base
arch/arm/plat-mxc/include/mach/debug-macro.S +3 -0
@@ -53,6 +53,9 @@ #define UART_VADDR IMX_IO_ADDRESS(UART_PADDR) + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv ldr \rp, =UART_PADDR @ physical ldr \rv, =UART_VADDR @ virtual
arch/arm/plat-spear/include/plat/debug-macro.S +3 -0
@@ -14,6 +14,9 @@ #include <linux/amba/serial.h> #include <mach/spear.h> + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #SPEAR_DBG_UART_BASE @ Physical base mov \rv, #VA_SPEAR_DBG_UART_BASE @ Virtual base
arch/arm/plat-stmp3xxx/include/mach/debug-macro.S +3 -0
@@ -16,6 +16,9 @@ * http://www.gnu.org/copyleft/gpl.html */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv mov \rp, #0x00070000 add \rv, \rp, #0xf0000000 @ virtual base
arch/arm/plat-tcc/include/mach/debug-macro.S +3 -0
@@ -9,6 +9,9 @@ * */ + .macro inituart, id, a, v + .endm + .macro addruart, rp, rv moveq \rp, #0x90000000 @ physical base address movne \rv, #0xF1000000 @ virtual base
PATCH 2/2 ARM: Add empty inituart macros
Quoted 49 lines · Tony Lindgren
Add empty inituart macros. These can be used to initialize the debug serial port based on the machine ID.
Signed-off-by Tony Lindgren <[email protected]>--- arch/arm/mach-aaec2000/include/mach/debug-macro.S | 4 ++++ arch/arm/mach-at91/include/mach/debug-macro.S | 3 +++ arch/arm/mach-clps711x/include/mach/debug-macro.S | 3 +++ arch/arm/mach-cns3xxx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-davinci/include/mach/debug-macro.S | 3 +++ arch/arm/mach-dove/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ebsa110/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ep93xx/include/mach/debug-macro.S | 3 +++ .../arm/mach-footbridge/include/mach/debug-macro.S | 4 ++++ arch/arm/mach-gemini/include/mach/debug-macro.S | 3 +++ .../arm/mach-integrator/include/mach/debug-macro.S | 3 +++ arch/arm/mach-iop13xx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-iop32x/include/mach/debug-macro.S | 3 +++ arch/arm/mach-iop33x/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ixp23xx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-kirkwood/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ks8695/include/mach/debug-macro.S | 3 +++ arch/arm/mach-l7200/include/mach/debug-macro.S | 3 +++ arch/arm/mach-loki/include/mach/debug-macro.S | 3 +++ arch/arm/mach-lpc32xx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-mmp/include/mach/debug-macro.S | 3 +++ arch/arm/mach-msm/include/mach/debug-macro.S | 4 ++++ arch/arm/mach-mv78xx0/include/mach/debug-macro.S | 3 +++ arch/arm/mach-mxs/include/mach/debug-macro.S | 3 +++ arch/arm/mach-netx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-nomadik/include/mach/debug-macro.S | 3 +++ arch/arm/mach-ns9xxx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-omap1/include/mach/debug-macro.S | 3 +++ arch/arm/mach-omap2/include/mach/debug-macro.S | 3 +++ arch/arm/mach-pnx4008/include/mach/debug-macro.S | 3 +++ arch/arm/mach-pxa/include/mach/debug-macro.S | 3 +++ arch/arm/mach-realview/include/mach/debug-macro.S | 3 +++ arch/arm/mach-rpc/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s3c2410/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s3c24a0/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s3c64xx/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5p6442/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5p64x0/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5pc100/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5pv210/include/mach/debug-macro.S | 3 +++ arch/arm/mach-s5pv310/include/mach/debug-macro.S | 3 +++ arch/arm/mach-sa1100/include/mach/debug-macro.S | 3 +++ arch/arm/mach-shark/include/mach/debug-macro.S | 3 +++ arch/arm/mach-u300/include/mach/debug-macro.S | 3 +++
Quoted 8 lines
arch/arm/mach-ux500/include/mach/debug-macro.S | 3 +++ arch/arm/mach-versatile/include/mach/debug-macro.S | 3 +++ arch/arm/mach-vexpress/include/mach/debug-macro.S | 3 +++ arch/arm/plat-mxc/include/mach/debug-macro.S | 3 +++ arch/arm/plat-spear/include/plat/debug-macro.S | 3 +++ arch/arm/plat-stmp3xxx/include/mach/debug-macro.S | 3 +++ arch/arm/plat-tcc/include/mach/debug-macro.S | 3 +++ 51 files changed, 156 insertions(+), 0 deletions(-)
A better way would be to define the empty inituart macro in a common place, and use the following in the machine specific header file:
.purgem inituart .macro inituart ... ... .endm
This way you won't need to add empty inituart all over the place.
Nicolas
Tony Lindgren
maintainerPATCH 2/2 ARM: Add empty inituart macros
Quoted 4 lines · Nicolas Pitre
Quoted 2 lines · Tony Lindgren
Add empty inituart macros. These can be used to initialize the debug serial port based on the machine ID.
...
Quoted 9 lines
A better way would be to define the empty inituart macro in a common place, and use the following in the machine specific header file:
.purgem inituart .macro inituart ... ... .endmThis way you won't need to add empty inituart all over the place.
Thanks for the tip, will try that out.
Tony
cover Allow using machine ID for DEBUG_LL macros
In reply to Tony LindgrenQuoted 4 lines · Tony Lindgren
Hi all,
Here are two patches that allow using machine ID for
DEBUG_LLmacros by adding a new macro inituart.
This won't work with the device tree support as the machine ID is then replaced with a catch-it-all-with-dt-support machine ID.
Nicolas
Tony Lindgren
maintainercover Allow using machine ID for DEBUG_LL macros
Quoted 9 lines · Nicolas Pitre
Quoted 4 lines · Tony Lindgren
Hi all,
Here are two patches that allow using machine ID for
DEBUG_LLmacros by adding a new macro inituart.This won't work with the device tree support as the machine ID is then replaced with a catch-it-all-with-dt-support machine ID.
Hmm, maybe for device tree we could only have it initialized later on by setting up custom early_printk in early_printk.c based on the device tree data or machine ID?
It won't work very early then though.. If we want it to work early we could allocate some fixed memory chunk for addruart etc functions for which the bootloader just passes addresses.
Tony
cover Allow using machine ID for DEBUG_LL macros
Quoted 11 lines · Tony Lindgren
Quoted 9 lines · Nicolas Pitre
Quoted 4 lines · Tony Lindgren
Hi all,
Here are two patches that allow using machine ID for
DEBUG_LLmacros by adding a new macro inituart.This won't work with the device tree support as the machine ID is then replaced with a catch-it-all-with-dt-support machine ID.
Quoted 7 lines
Hmm, maybe for device tree we could only have it initialized later on by setting up custom
early_printkinearly_printk.cbased on the device tree data or machine ID?It won't work very early then though.. If we want it to work early we could allocate some fixed memory chunk for addruart etc functions for which the bootloader just passes addresses.
Nah... Let's keep relationship between the kernel and bootloaders to a strict minimum. If necessary we'll find a way to extract that info from the dtb in assembly. I'd suggest just continuing this excellent cleanup for the time being.
Nicolas