Skip to content

Commit 709ebe6

Browse files
committed
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM updates from Russell King: - handle inexact watchpoint addresses (Douglas Anderson) - decompressor serial debug cleanups (Linus Walleij) - update L2 cache prefetch bits (Guillaume Tucker) - add text offset and malloc size to the decompressor kexec data * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: add malloc size to decompressor kexec size structure ARM: add TEXT_OFFSET to decompressor kexec image structure ARM: 9007/1: l2c: fix prefetch bits init in L2X0_AUX_CTRL using DT values ARM: 9010/1: uncompress: Print the location of appended DTB ARM: 9009/1: uncompress: Enable debug in head.S ARM: 9008/1: uncompress: Drop excess whitespace print ARM: 9006/1: uncompress: Wait for ready and busy in debug prints ARM: 9005/1: debug: Select flow control for all debug UARTs ARM: 9004/1: debug: Split waituart to CTS and TXRDY ARM: 9003/1: uncompress: Delete unused debug macros ARM: 8997/2: hw_breakpoint: Handle inexact watchpoint addresses
2 parents b32649b + adc5f70 commit 709ebe6

34 files changed

Lines changed: 263 additions & 112 deletions

‎arch/arm/Kconfig.debug‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,6 +1546,17 @@ config DEBUG_SIRFSOC_UART
15461546
bool
15471547
depends on ARCH_SIRF
15481548

1549+
config DEBUG_UART_FLOW_CONTROL
1550+
bool "Enable flow control (CTS) for the debug UART"
1551+
depends on DEBUG_LL
1552+
default y if ARCH_EBSA110 || DEBUG_FOOTBRIDGE_COM1 || DEBUG_GEMINI || ARCH_RPC
1553+
help
1554+
Some UART ports are connected to terminals that will use modem
1555+
control signals to indicate whether they are ready to receive text.
1556+
In practice this means that the terminal is asserting the special
1557+
control signal CTS (Clear To Send). If your debug UART supports
1558+
this and your debug terminal will require it, enable this option.
1559+
15491560
config DEBUG_LL_INCLUDE
15501561
string
15511562
default "debug/sa1100.S" if DEBUG_SA1100
@@ -1893,11 +1904,6 @@ config DEBUG_UART_8250_PALMCHIP
18931904
except for having a different register layout. Say Y here if
18941905
the debug UART is of this type.
18951906

1896-
config DEBUG_UART_8250_FLOW_CONTROL
1897-
bool "Enable flow control for 8250 UART"
1898-
depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250
1899-
default y if ARCH_EBSA110 || DEBUG_FOOTBRIDGE_COM1 || DEBUG_GEMINI || ARCH_RPC
1900-
19011907
config DEBUG_UNCOMPRESS
19021908
bool "Enable decompressor debugging via DEBUG_LL output"
19031909
depends on ARCH_MULTIPLATFORM || PLAT_SAMSUNG || ARM_SINGLE_ARMV7M

‎arch/arm/Makefile‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ head-y := arch/arm/kernel/head$(MMUEXT).o
143143

144144
# Text offset. This list is sorted numerically by address in order to
145145
# provide a means to avoid/resolve conflicts in multi-arch kernels.
146+
# Note: the 32kB below this value is reserved for use by the kernel
147+
# during boot, and this offset is critical to the functioning of
148+
# kexec-tools.
146149
textofs-y := 0x00008000
147150
# We don't want the htc bootloader to corrupt kernel during resume
148151
textofs-$(CONFIG_PM_H1940) := 0x00108000

‎arch/arm/boot/compressed/Makefile‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
OBJS =
99

10-
AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
1110
HEAD = head.o
1211
OBJS += misc.o decompress.o
1312
ifeq ($(CONFIG_DEBUG_UNCOMPRESS),y)
1413
OBJS += debug.o
14+
AFLAGS_head.o += -DDEBUG
1515
endif
1616
FONTC = $(srctree)/lib/fonts/font_acorn_8x8.c
1717

@@ -68,7 +68,12 @@ ZTEXTADDR := 0
6868
ZBSSADDR := ALIGN(8)
6969
endif
7070

71+
MALLOC_SIZE := 65536
72+
73+
AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET) -DMALLOC_SIZE=$(MALLOC_SIZE)
7174
CPPFLAGS_vmlinux.lds := -DTEXT_START="$(ZTEXTADDR)" -DBSS_START="$(ZBSSADDR)"
75+
CPPFLAGS_vmlinux.lds += -DTEXT_OFFSET="$(TEXT_OFFSET)"
76+
CPPFLAGS_vmlinux.lds += -DMALLOC_SIZE="$(MALLOC_SIZE)"
7277

7378
compress-$(CONFIG_KERNEL_GZIP) = gzip
7479
compress-$(CONFIG_KERNEL_LZO) = lzo

‎arch/arm/boot/compressed/debug.S‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99
ENTRY(putc)
1010
addruart r1, r2, r3
11-
waituart r3, r1
11+
#ifdef CONFIG_DEBUG_UART_FLOW_CONTROL
12+
waituartcts r3, r1
13+
#endif
14+
waituarttxrdy r3, r1
1215
senduart r0, r1
1316
busyuart r3, r1
1417
mov pc, lr

‎arch/arm/boot/compressed/head.S‎

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@
2828
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
2929
.macro loadsp, rb, tmp1, tmp2
3030
.endm
31-
.macro writeb, ch, rb
31+
.macro writeb, ch, rb, tmp
3232
mcr p14, 0, \ch, c0, c5, 0
3333
.endm
3434
#elif defined(CONFIG_CPU_XSCALE)
3535
.macro loadsp, rb, tmp1, tmp2
3636
.endm
37-
.macro writeb, ch, rb
37+
.macro writeb, ch, rb, tmp
3838
mcr p14, 0, \ch, c8, c0, 0
3939
.endm
4040
#else
4141
.macro loadsp, rb, tmp1, tmp2
4242
.endm
43-
.macro writeb, ch, rb
43+
.macro writeb, ch, rb, tmp
4444
mcr p14, 0, \ch, c1, c0, 0
4545
.endm
4646
#endif
@@ -49,8 +49,13 @@
4949

5050
#include CONFIG_DEBUG_LL_INCLUDE
5151

52-
.macro writeb, ch, rb
52+
.macro writeb, ch, rb, tmp
53+
#ifdef CONFIG_DEBUG_UART_FLOW_CONTROL
54+
waituartcts \tmp, \rb
55+
#endif
56+
waituarttxrdy \tmp, \rb
5357
senduart \ch, \rb
58+
busyuart \tmp, \rb
5459
.endm
5560

5661
#if defined(CONFIG_ARCH_SA1100)
@@ -81,42 +86,11 @@
8186
bl phex
8287
.endm
8388

84-
.macro debug_reloc_start
85-
#ifdef DEBUG
86-
kputc #'\n'
87-
kphex r6, 8 /* processor id */
88-
kputc #':'
89-
kphex r7, 8 /* architecture id */
90-
#ifdef CONFIG_CPU_CP15
91-
kputc #':'
92-
mrc p15, 0, r0, c1, c0
93-
kphex r0, 8 /* control reg */
94-
#endif
95-
kputc #'\n'
96-
kphex r5, 8 /* decompressed kernel start */
97-
kputc #'-'
98-
kphex r9, 8 /* decompressed kernel end */
99-
kputc #'>'
100-
kphex r4, 8 /* kernel execution address */
101-
kputc #'\n'
102-
#endif
103-
.endm
104-
105-
.macro debug_reloc_end
106-
#ifdef DEBUG
107-
kphex r5, 8 /* end of kernel */
108-
kputc #'\n'
109-
mov r0, r4
110-
bl memdump /* dump 256 bytes at start of kernel */
111-
#endif
112-
.endm
113-
11489
/*
11590
* Debug kernel copy by printing the memory addresses involved
11691
*/
11792
.macro dbgkc, begin, end, cbegin, cend
11893
#ifdef DEBUG
119-
kputc #'\n'
12094
kputc #'C'
12195
kputc #':'
12296
kputc #'0'
@@ -136,7 +110,28 @@
136110
kputc #'x'
137111
kphex \cend, 8 /* End of kernel copy */
138112
kputc #'\n'
139-
kputc #'\r'
113+
#endif
114+
.endm
115+
116+
/*
117+
* Debug print of the final appended DTB location
118+
*/
119+
.macro dbgadtb, begin, end
120+
#ifdef DEBUG
121+
kputc #'D'
122+
kputc #'T'
123+
kputc #'B'
124+
kputc #':'
125+
kputc #'0'
126+
kputc #'x'
127+
kphex \begin, 8 /* Start of appended DTB */
128+
kputc #' '
129+
kputc #'('
130+
kputc #'0'
131+
kputc #'x'
132+
kphex \end, 8 /* End of appended DTB */
133+
kputc #')'
134+
kputc #'\n'
140135
#endif
141136
.endm
142137

@@ -303,7 +298,7 @@ restart: adr r0, LC1
303298

304299
#ifndef CONFIG_ZBOOT_ROM
305300
/* malloc space is above the relocated stack (64k max) */
306-
add r10, sp, #0x10000
301+
add r10, sp, #MALLOC_SIZE
307302
#else
308303
/*
309304
* With ZBOOT_ROM the bss/stack is non relocatable,
@@ -357,6 +352,7 @@ restart: adr r0, LC1
357352
mov r5, r5, ror #8
358353
eor r5, r5, r1, lsr #8
359354
#endif
355+
dbgadtb r6, r5
360356
/* 50% DTB growth should be good enough */
361357
add r5, r5, r5, lsr #1
362358
/* preserve 64-bit alignment */
@@ -614,7 +610,7 @@ not_relocated: mov r0, #0
614610
*/
615611
mov r0, r4
616612
mov r1, sp @ malloc space above stack
617-
add r2, sp, #0x10000 @ 64k max
613+
add r2, sp, #MALLOC_SIZE @ 64k max
618614
mov r3, r7
619615
bl decompress_kernel
620616

@@ -1356,7 +1352,7 @@ puts: loadsp r3, r2, r1
13561352
1: ldrb r2, [r0], #1
13571353
teq r2, #0
13581354
moveq pc, lr
1359-
2: writeb r2, r3
1355+
2: writeb r2, r3, r1
13601356
mov r1, #0x00020000
13611357
3: subs r1, r1, #1
13621358
bne 3b

‎arch/arm/boot/compressed/vmlinux.lds.S‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ SECTIONS
4444
}
4545
.table : ALIGN(4) {
4646
_table_start = .;
47-
LONG(ZIMAGE_MAGIC(4))
47+
LONG(ZIMAGE_MAGIC(6))
4848
LONG(ZIMAGE_MAGIC(0x5a534c4b))
4949
LONG(ZIMAGE_MAGIC(__piggy_size_addr - _start))
5050
LONG(ZIMAGE_MAGIC(_kernel_bss_size))
51+
LONG(ZIMAGE_MAGIC(TEXT_OFFSET))
52+
LONG(ZIMAGE_MAGIC(MALLOC_SIZE))
5153
LONG(0)
5254
_table_end = .;
5355
}

‎arch/arm/include/debug/8250.S‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@
4545
bne 1002b
4646
.endm
4747

48-
.macro waituart,rd,rx
49-
#ifdef CONFIG_DEBUG_UART_8250_FLOW_CONTROL
48+
.macro waituarttxrdy,rd,rx
49+
.endm
50+
51+
.macro waituartcts,rd,rx
5052
1001: load \rd, [\rx, #UART_MSR << UART_SHIFT]
5153
tst \rd, #UART_MSR_CTS
5254
beq 1001b
53-
#endif
5455
.endm

‎arch/arm/include/debug/asm9260.S‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
ldr \rv, = CONFIG_DEBUG_UART_VIRT
1212
.endm
1313

14-
.macro waituart,rd,rx
14+
.macro waituarttxrdy,rd,rx
15+
.endm
16+
17+
.macro waituartcts,rd,rx
1518
.endm
1619

1720
.macro senduart,rd,rx

‎arch/arm/include/debug/at91.S‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@
1919
strb \rd, [\rx, #(AT91_DBGU_THR)] @ Write to Transmitter Holding Register
2020
.endm
2121

22-
.macro waituart,rd,rx
22+
.macro waituarttxrdy,rd,rx
2323
1001: ldr \rd, [\rx, #(AT91_DBGU_SR)] @ Read Status Register
2424
tst \rd, #AT91_DBGU_TXRDY @ DBGU_TXRDY = 1 when ready to transmit
2525
beq 1001b
2626
.endm
2727

28+
.macro waituartcts,rd,rx
29+
.endm
30+
2831
.macro busyuart,rd,rx
2932
1001: ldr \rd, [\rx, #(AT91_DBGU_SR)] @ Read Status Register
3033
tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete

‎arch/arm/include/debug/bcm63xx.S‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@
1717
strb \rd, [\rx, #UART_FIFO_REG]
1818
.endm
1919

20-
.macro waituart, rd, rx
20+
.macro waituarttxrdy, rd, rx
2121
1001: ldr \rd, [\rx, #UART_IR_REG]
2222
tst \rd, #(1 << UART_IR_TXEMPTY)
2323
beq 1001b
2424
.endm
2525

26+
.macro waituartcts, rd, rx
27+
.endm
28+
2629
.macro busyuart, rd, rx
2730
1002: ldr \rd, [\rx, #UART_IR_REG]
2831
tst \rd, #(1 << UART_IR_TXTRESH)

0 commit comments

Comments
 (0)