MIPS: rework ns16550 debug_ll
v2 cover MIPS: rework ns16550 debug_ll
This patch series makes possible easely produce debug output via ns16550-like UART on very early pbl stage.
v2 patch series is based on the 'master' branch and it does not break bisectibility.
[PATCH v2 1/5] MIPS: rzx50: prepare for new debug_ll [PATCH v2 2/5] MIPS: malta: prepare for new debug_ll [PATCH v2 3/5] MIPS: unify ns16550 debug_ll support code [PATCH v2 4/5] MIPS: rzx50: pbl: use debug_ll
[PATCH v2 5/5] MIPS: rzx50_defconfig: use UART1 for low-level debug
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 1/5 MIPS: rzx50: prepare for new debug_ll
Set DEBUG_LL_UART_DIVISOR to use <asm/debug_ll_ns16550.h>.
The JZ4755 uses 24 MHz as the main reference frequency (EXCLK). The UART controller can work on full EXCLK or on EXCLK/2. Just now we use EXCLK/2 legacy clock setup made by U-Boot. So set UART controller base frequency to 12 MHz.
--- arch/mips/mach-xburst/include/mach/debug_ll_jz4750d.h | 4 ++++ 1 file changed, 4 insertions(+)
arch/mips/mach-xburst/include/mach/debug_ll_jz4750d.h +4 -0
@@ -34,4 +34,8 @@#define DEBUG_LL_UART_SHIFT 2 +#define DEBUG_LL_UART_CLK (12000000 / 16) +#define DEBUG_LL_UART_BPS CONFIG_BAUDRATE +#define DEBUG_LL_UART_DIVISOR (DEBUG_LL_UART_CLK / DEBUG_LL_UART_BPS) +#endif /* __INCLUDE_DEBUG_LL_JZ4750D_H__ */
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 2/5 MIPS: malta: prepare for new debug_ll
In reply to Antony PavlovSet fake DEBUG_LL_UART_DIVISOR to use <asm/debug_ll_ns16550.h>.
--- arch/mips/mach-malta/include/mach/hardware.h | 1 + 1 file changed, 1 insertion(+)
arch/mips/mach-malta/include/mach/hardware.h +1 -0
@@ -20,6 +20,7 @@#define DEBUG_LL_UART_ADDR 0xb00003f8#define DEBUG_LL_UART_SHIFT 0 +#define DEBUG_LL_UART_DIVISOR 1/* no matter for emulated port */ /* * Reset register.
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 3/5 MIPS: unify ns16550 debug_ll support code
In reply to Antony PavlovThis commit moves the C debug_ll code from
the MIPS <debug_ll_ns16550.h> header file to
the MIPS <asm/debug_ll_ns16550.h> header file,
so the C code and the asm code can use the same
register address macros.
--- arch/mips/include/asm/debug_ll_ns16550.h | 15 ++++++++++ arch/mips/include/debug_ll_ns16550.h | 37 ------------------------- arch/mips/mach-malta/include/mach/debug_ll.h | 2 +- arch/mips/mach-xburst/include/mach/debug_ll.h | 2 +- 4 files changed, 17 insertions(+), 39 deletions(-) delete mode 100644 arch/mips/include/debug_ll_ns16550.h
arch/mips/include/asm/debug_ll_ns16550.h +15 -0
@@ -48,6 +48,20 @@#define UART_LSR_THRE 0x20/* Xmit holding register empty */ +#ifndef __ASSEMBLY__ +/* +* C macros +*/ + +#include <asm/io.h> + +static __inline__void PUTC_LL (char ch) +{ +while (!(__raw_readb ((u8 *)DEBUG_LL_UART_ADDR +UART_LSR ) &UART_LSR_THRE )) + ; +__raw_writeb (ch, (u8 *)DEBUG_LL_UART_ADDR +UART_THR ); +} +#else /* __ASSEMBLY__ */ /* * Macros for use in assembly language code */
@@ -96,5 +110,6 @@ debug_ll_ns16550_outc '\n' #endif /* CONFIG_DEBUG_LL */ .endm +#endif /* __ASSEMBLY__ */ #endif /* __INCLUDE_MIPS_ASM_DEBUG_LL_NS16550_H__ */
arch/mips/include/debug_ll_ns16550.h deleted +0 -37
@@ -1,37 +0,0 @@ -/* -* Copyright (C) 2012 Antony Pavlov <[email protected]> -* -* This file is part of barebox. -* See file CREDITS for list of people who contributed to this project. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 -* as published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - -/** @file -* This file contains declaration for early output support -*/ -#ifndef __INCLUDE_ARCH_DEBUG_LL_NS16550_H__ -#define __INCLUDE_ARCH_DEBUG_LL_NS16550_H__ - -#include <asm/io.h> - -#define rbr (0 << DEBUG_LL_UART_SHIFT) -#define lsr (5 << DEBUG_LL_UART_SHIFT) - -#define LSR_THRE 0x20/* Xmit holding register empty */ - -static __inline__void PUTC_LL (char ch) -{ -while (!(__raw_readb ((u8 *)DEBUG_LL_UART_ADDR + lsr) &LSR_THRE )); -__raw_writeb (ch, (u8 *)DEBUG_LL_UART_ADDR + rbr); -} - -#endif /* __INCLUDE_ARCH_DEBUG_LL_NS16550_H__ */
arch/mips/mach-malta/include/mach/debug_ll.h +1 -1
@@ -23,6 +23,6 @@#include <mach/hardware.h> -#include <debug_ll_ns16550.h> +#include <asm/debug_ll_ns16550.h> #endif /* __INCLUDE_ARCH_DEBUG_LL_H__ */
arch/mips/mach-xburst/include/mach/debug_ll.h +1 -1
@@ -22,6 +22,6 @@* This File contains declaration for early output support */ #include <board/debug_ll.h> -#include <debug_ll_ns16550.h> +#include <asm/debug_ll_ns16550.h> #endif /* __MACH_XBURST_DEBUG_LL__ */
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 4/5 MIPS: rzx50: pbl: use debug_ll
In reply to Antony Pavlov--- arch/mips/boards/rzx50/include/board/board_pbl_start.h | 6 ++++++ 1 file changed, 6 insertions(+)
arch/mips/boards/rzx50/include/board/board_pbl_start.h +6 -0
@@ -18,6 +18,7 @@*/ #include <asm/pbl_macros.h> +#include <mach/debug_ll.h> .macro board_pbl_start .set push
@@ -28,6 +29,11 @@/* CPU/SoC specific setup ... */ /* ... absent */ +debug_ll_ns16550_init + + debug_ll_ns16550_outc '.' + debug_ll_ns16550_outnl +copy_to_link_location pbl_start .set pop
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 5/5 MIPS: rzx50_defconfig: use UART1 for low-level debug
In reply to Antony PavlovBy default CONFIG_JZ4750D_DEBUG_LL_UART0 is selected. This can confuse the Ritmix RZX50 user as the board has only UART1 connected.
--- arch/mips/configs/rzx50_defconfig | 1 + 1 file changed, 1 insertion(+)
arch/mips/configs/rzx50_defconfig +1 -0
@@ -1,4 +1,5 @@ CONFIG_MACH_MIPS_XBURST=y +CONFIG_JZ4750D_DEBUG_LL_UART1=y CONFIG_PBL_IMAGE=y CONFIG_BAUDRATE=57600 CONFIG_GLOB=y
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 5 lines · Antony Pavlov
This patch series makes possible easely produce debug output via ns16550-like UART on very early pbl stage.
v2 patch series is based on the 'master' branch and it does not break bisectibility.
Thanks for redoing this. Applied.
Sascha
Quoted 7 lines
[PATCH v2 1/5] MIPS: rzx50: prepare for new
debug_ll[PATCH v2 2/5] MIPS: malta: prepare for newdebug_ll[PATCH v2 3/5] MIPS: unify ns16550debug_llsupport code [PATCH v2 4/5] MIPS: rzx50: pbl: usedebug_ll
[PATCH v2 5/5] MIPS:rzx50_defconfig: use UART1 for low-level debug
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox