Skip to content

Commit

Permalink
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Browse files Browse the repository at this point in the history
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
  • Loading branch information
torvalds committed Oct 20, 2020
2 parents b32649b + adc5f70 commit 709ebe6
Show file tree
Hide file tree
Showing 34 changed files with 263 additions and 112 deletions.
16 changes: 11 additions & 5 deletions arch/arm/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -1546,6 +1546,17 @@ config DEBUG_SIRFSOC_UART
bool
depends on ARCH_SIRF

config DEBUG_UART_FLOW_CONTROL
bool "Enable flow control (CTS) for the debug UART"
depends on DEBUG_LL
default y if ARCH_EBSA110 || DEBUG_FOOTBRIDGE_COM1 || DEBUG_GEMINI || ARCH_RPC
help
Some UART ports are connected to terminals that will use modem
control signals to indicate whether they are ready to receive text.
In practice this means that the terminal is asserting the special
control signal CTS (Clear To Send). If your debug UART supports
this and your debug terminal will require it, enable this option.

config DEBUG_LL_INCLUDE
string
default "debug/sa1100.S" if DEBUG_SA1100
Expand Down Expand Up @@ -1893,11 +1904,6 @@ config DEBUG_UART_8250_PALMCHIP
except for having a different register layout. Say Y here if
the debug UART is of this type.

config DEBUG_UART_8250_FLOW_CONTROL
bool "Enable flow control for 8250 UART"
depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250
default y if ARCH_EBSA110 || DEBUG_FOOTBRIDGE_COM1 || DEBUG_GEMINI || ARCH_RPC

config DEBUG_UNCOMPRESS
bool "Enable decompressor debugging via DEBUG_LL output"
depends on ARCH_MULTIPLATFORM || PLAT_SAMSUNG || ARM_SINGLE_ARMV7M
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ head-y := arch/arm/kernel/head$(MMUEXT).o

# Text offset. This list is sorted numerically by address in order to
# provide a means to avoid/resolve conflicts in multi-arch kernels.
# Note: the 32kB below this value is reserved for use by the kernel
# during boot, and this offset is critical to the functioning of
# kexec-tools.
textofs-y := 0x00008000
# We don't want the htc bootloader to corrupt kernel during resume
textofs-$(CONFIG_PM_H1940) := 0x00108000
Expand Down
7 changes: 6 additions & 1 deletion arch/arm/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

OBJS =

AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
HEAD = head.o
OBJS += misc.o decompress.o
ifeq ($(CONFIG_DEBUG_UNCOMPRESS),y)
OBJS += debug.o
AFLAGS_head.o += -DDEBUG
endif
FONTC = $(srctree)/lib/fonts/font_acorn_8x8.c

Expand Down Expand Up @@ -68,7 +68,12 @@ ZTEXTADDR := 0
ZBSSADDR := ALIGN(8)
endif

MALLOC_SIZE := 65536

AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET) -DMALLOC_SIZE=$(MALLOC_SIZE)
CPPFLAGS_vmlinux.lds := -DTEXT_START="$(ZTEXTADDR)" -DBSS_START="$(ZBSSADDR)"
CPPFLAGS_vmlinux.lds += -DTEXT_OFFSET="$(TEXT_OFFSET)"
CPPFLAGS_vmlinux.lds += -DMALLOC_SIZE="$(MALLOC_SIZE)"

compress-$(CONFIG_KERNEL_GZIP) = gzip
compress-$(CONFIG_KERNEL_LZO) = lzo
Expand Down
5 changes: 4 additions & 1 deletion arch/arm/boot/compressed/debug.S
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

ENTRY(putc)
addruart r1, r2, r3
waituart r3, r1
#ifdef CONFIG_DEBUG_UART_FLOW_CONTROL
waituartcts r3, r1
#endif
waituarttxrdy r3, r1
senduart r0, r1
busyuart r3, r1
mov pc, lr
Expand Down
74 changes: 35 additions & 39 deletions arch/arm/boot/compressed/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
.macro loadsp, rb, tmp1, tmp2
.endm
.macro writeb, ch, rb
.macro writeb, ch, rb, tmp
mcr p14, 0, \ch, c0, c5, 0
.endm
#elif defined(CONFIG_CPU_XSCALE)
.macro loadsp, rb, tmp1, tmp2
.endm
.macro writeb, ch, rb
.macro writeb, ch, rb, tmp
mcr p14, 0, \ch, c8, c0, 0
.endm
#else
.macro loadsp, rb, tmp1, tmp2
.endm
.macro writeb, ch, rb
.macro writeb, ch, rb, tmp
mcr p14, 0, \ch, c1, c0, 0
.endm
#endif
Expand All @@ -49,8 +49,13 @@

#include CONFIG_DEBUG_LL_INCLUDE

.macro writeb, ch, rb
.macro writeb, ch, rb, tmp
#ifdef CONFIG_DEBUG_UART_FLOW_CONTROL
waituartcts \tmp, \rb
#endif
waituarttxrdy \tmp, \rb
senduart \ch, \rb
busyuart \tmp, \rb
.endm

#if defined(CONFIG_ARCH_SA1100)
Expand Down Expand Up @@ -81,42 +86,11 @@
bl phex
.endm

.macro debug_reloc_start
#ifdef DEBUG
kputc #'\n'
kphex r6, 8 /* processor id */
kputc #':'
kphex r7, 8 /* architecture id */
#ifdef CONFIG_CPU_CP15
kputc #':'
mrc p15, 0, r0, c1, c0
kphex r0, 8 /* control reg */
#endif
kputc #'\n'
kphex r5, 8 /* decompressed kernel start */
kputc #'-'
kphex r9, 8 /* decompressed kernel end */
kputc #'>'
kphex r4, 8 /* kernel execution address */
kputc #'\n'
#endif
.endm

.macro debug_reloc_end
#ifdef DEBUG
kphex r5, 8 /* end of kernel */
kputc #'\n'
mov r0, r4
bl memdump /* dump 256 bytes at start of kernel */
#endif
.endm

/*
* Debug kernel copy by printing the memory addresses involved
*/
.macro dbgkc, begin, end, cbegin, cend
#ifdef DEBUG
kputc #'\n'
kputc #'C'
kputc #':'
kputc #'0'
Expand All @@ -136,7 +110,28 @@
kputc #'x'
kphex \cend, 8 /* End of kernel copy */
kputc #'\n'
kputc #'\r'
#endif
.endm

/*
* Debug print of the final appended DTB location
*/
.macro dbgadtb, begin, end
#ifdef DEBUG
kputc #'D'
kputc #'T'
kputc #'B'
kputc #':'
kputc #'0'
kputc #'x'
kphex \begin, 8 /* Start of appended DTB */
kputc #' '
kputc #'('
kputc #'0'
kputc #'x'
kphex \end, 8 /* End of appended DTB */
kputc #')'
kputc #'\n'
#endif
.endm

Expand Down Expand Up @@ -303,7 +298,7 @@ restart: adr r0, LC1

#ifndef CONFIG_ZBOOT_ROM
/* malloc space is above the relocated stack (64k max) */
add r10, sp, #0x10000
add r10, sp, #MALLOC_SIZE
#else
/*
* With ZBOOT_ROM the bss/stack is non relocatable,
Expand Down Expand Up @@ -357,6 +352,7 @@ restart: adr r0, LC1
mov r5, r5, ror #8
eor r5, r5, r1, lsr #8
#endif
dbgadtb r6, r5
/* 50% DTB growth should be good enough */
add r5, r5, r5, lsr #1
/* preserve 64-bit alignment */
Expand Down Expand Up @@ -614,7 +610,7 @@ not_relocated: mov r0, #0
*/
mov r0, r4
mov r1, sp @ malloc space above stack
add r2, sp, #0x10000 @ 64k max
add r2, sp, #MALLOC_SIZE @ 64k max
mov r3, r7
bl decompress_kernel

Expand Down Expand Up @@ -1356,7 +1352,7 @@ puts: loadsp r3, r2, r1
1: ldrb r2, [r0], #1
teq r2, #0
moveq pc, lr
2: writeb r2, r3
2: writeb r2, r3, r1
mov r1, #0x00020000
3: subs r1, r1, #1
bne 3b
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/boot/compressed/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ SECTIONS
}
.table : ALIGN(4) {
_table_start = .;
LONG(ZIMAGE_MAGIC(4))
LONG(ZIMAGE_MAGIC(6))
LONG(ZIMAGE_MAGIC(0x5a534c4b))
LONG(ZIMAGE_MAGIC(__piggy_size_addr - _start))
LONG(ZIMAGE_MAGIC(_kernel_bss_size))
LONG(ZIMAGE_MAGIC(TEXT_OFFSET))
LONG(ZIMAGE_MAGIC(MALLOC_SIZE))
LONG(0)
_table_end = .;
}
Expand Down
7 changes: 4 additions & 3 deletions arch/arm/include/debug/8250.S
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@
bne 1002b
.endm

.macro waituart,rd,rx
#ifdef CONFIG_DEBUG_UART_8250_FLOW_CONTROL
.macro waituarttxrdy,rd,rx
.endm

.macro waituartcts,rd,rx
1001: load \rd, [\rx, #UART_MSR << UART_SHIFT]
tst \rd, #UART_MSR_CTS
beq 1001b
#endif
.endm
5 changes: 4 additions & 1 deletion arch/arm/include/debug/asm9260.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
ldr \rv, = CONFIG_DEBUG_UART_VIRT
.endm

.macro waituart,rd,rx
.macro waituarttxrdy,rd,rx
.endm

.macro waituartcts,rd,rx
.endm

.macro senduart,rd,rx
Expand Down
5 changes: 4 additions & 1 deletion arch/arm/include/debug/at91.S
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@
strb \rd, [\rx, #(AT91_DBGU_THR)] @ Write to Transmitter Holding Register
.endm

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

.macro waituartcts,rd,rx
.endm

.macro busyuart,rd,rx
1001: ldr \rd, [\rx, #(AT91_DBGU_SR)] @ Read Status Register
tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete
Expand Down
5 changes: 4 additions & 1 deletion arch/arm/include/debug/bcm63xx.S
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
strb \rd, [\rx, #UART_FIFO_REG]
.endm

.macro waituart, rd, rx
.macro waituarttxrdy, rd, rx
1001: ldr \rd, [\rx, #UART_IR_REG]
tst \rd, #(1 << UART_IR_TXEMPTY)
beq 1001b
.endm

.macro waituartcts, rd, rx
.endm

.macro busyuart, rd, rx
1002: ldr \rd, [\rx, #UART_IR_REG]
tst \rd, #(1 << UART_IR_TXTRESH)
Expand Down
5 changes: 4 additions & 1 deletion arch/arm/include/debug/brcmstb.S
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ ARM_BE8( rev \rd, \rd )
bne 1002b
.endm

.macro waituart,rd,rx
.macro waituarttxrdy,rd,rx
.endm

.macro waituartcts,rd,rx
.endm

/*
Expand Down
5 changes: 4 additions & 1 deletion arch/arm/include/debug/clps711x.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
ldr \rp, =CLPS711X_UART_PADDR
.endm

.macro waituart,rd,rx
.macro waituartcts,rd,rx
.endm

.macro waituarttxrdy,rd,rx
.endm

.macro senduart,rd,rx
Expand Down
5 changes: 4 additions & 1 deletion arch/arm/include/debug/dc21285.S
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
bne 1001b
.endm

.macro waituart,rd,rx
.macro waituartcts,rd,rx
.endm

.macro waituarttxrdy,rd,rx
.endm
5 changes: 4 additions & 1 deletion arch/arm/include/debug/digicolor.S
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
strb \rd, [\rx, #UA0_EMI_REC]
.endm

.macro waituart,rd,rx
.macro waituartcts,rd,rx
.endm

.macro waituarttxrdy,rd,rx
.endm

.macro busyuart,rd,rx
Expand Down
5 changes: 4 additions & 1 deletion arch/arm/include/debug/efm32.S
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
strb \rd, [\rx, #UARTn_TXDATA]
.endm

.macro waituart,rd,rx
.macro waituartcts,rd,rx
.endm

.macro waituarttxrdy,rd,rx
1001: ldr \rd, [\rx, #UARTn_STATUS]
tst \rd, #UARTn_STATUS_TXBL
beq 1001b
Expand Down
15 changes: 12 additions & 3 deletions arch/arm/include/debug/icedcc.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
beq 1001b
.endm

.macro waituart, rd, rx
.macro waituartcts, rd, rx
.endm

.macro waituarttxrdy, rd, rx
mov \rd, #0x2000000
1001:
subs \rd, \rd, #1
Expand All @@ -47,7 +50,10 @@
beq 1001b
.endm

.macro waituart, rd, rx
.macro waituartcts, rd, rx
.endm

.macro waituarttxrdy, rd, rx
mov \rd, #0x10000000
1001:
subs \rd, \rd, #1
Expand All @@ -72,7 +78,10 @@

.endm

.macro waituart, rd, rx
.macro waituartcts, rd, rx
.endm

.macro waituarttxrdy, rd, rx
mov \rd, #0x2000000
1001:
subs \rd, \rd, #1
Expand Down
Loading

0 comments on commit 709ebe6

Please sign in to comment.