Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
57 lines
1.0 KiB
ArmAsm
57 lines
1.0 KiB
ArmAsm
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Renesas SCIF(A) debugging macro include header
|
|
*
|
|
* Based on r8a7790.S
|
|
*
|
|
* Copyright (C) 2012-2013 Renesas Electronics Corporation
|
|
* Copyright (C) 1994-1999 Russell King
|
|
*/
|
|
|
|
#define SCIF_PHYS CONFIG_DEBUG_UART_PHYS
|
|
#define SCIF_VIRT ((SCIF_PHYS & 0x00ffffff) | 0xfd000000)
|
|
|
|
#if defined(CONFIG_DEBUG_R7S9210_SCIF2) || defined(CONFIG_DEBUG_R7S9210_SCIF4)
|
|
/* RZ/A2 SCIFA */
|
|
#define FTDR 0x06
|
|
#define FSR 0x08
|
|
#elif CONFIG_DEBUG_UART_PHYS < 0xe6e00000
|
|
/* SCIFA */
|
|
#define FTDR 0x20
|
|
#define FSR 0x14
|
|
#else
|
|
/* SCIF */
|
|
#define FTDR 0x0c
|
|
#define FSR 0x10
|
|
#endif
|
|
|
|
#define TDFE (1 << 5)
|
|
#define TEND (1 << 6)
|
|
|
|
.macro addruart, rp, rv, tmp
|
|
ldr \rp, =SCIF_PHYS
|
|
ldr \rv, =SCIF_VIRT
|
|
.endm
|
|
|
|
.macro waituartcts,rd,rx
|
|
.endm
|
|
|
|
.macro waituarttxrdy, rd, rx
|
|
1001: ldrh \rd, [\rx, #FSR]
|
|
tst \rd, #TDFE
|
|
beq 1001b
|
|
.endm
|
|
|
|
.macro senduart, rd, rx
|
|
strb \rd, [\rx, #FTDR]
|
|
ldrh \rd, [\rx, #FSR]
|
|
bic \rd, \rd, #TEND
|
|
strh \rd, [\rx, #FSR]
|
|
.endm
|
|
|
|
.macro busyuart, rd, rx
|
|
1001: ldrh \rd, [\rx, #FSR]
|
|
tst \rd, #TEND
|
|
beq 1001b
|
|
.endm
|