全志A33 printascii bug

/*
 * arch/arm/include/asm/hardware/debug-8250.S
 *
 *  Copyright (C) 1994-1999 Russell King
 *
 * 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.
 */
#include <linux/serial_reg.h>
#include <mach/platform.h>


#define UART_SHIFT 2


.macro senduart,rd,rx
strb \rd, [\rx, #UART_TX << UART_SHIFT]
.endm


.macro busyuart,rd,rx
//#ifndef CONFIG_ARCH_SUNXI 原来的
#ifdef CONFIG_ARCH_SUNXI
1002: ldrb \rd, [\rx, #UART_LSR << UART_SHIFT]
and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
bne 1002b
#endif
        
.endm


.macro waituart,rd,rx
#ifdef CONFIG_ARCH_SUNXI
1008: ldrb \rd, [\rx, #SUNXI_UART_USR]
tst \rd, #0x2
beq 1008b
#else
#ifdef FLOW_CONTROL
1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT]
tst \rd, #UART_MSR_CTS
beq 1001b
#endif
#endif

.endm




 CONFIG_ARCH_SUNXI 原来的  

竟然是没有打开的,打开就好了


故障现象:


void sunxi_pm_dbg(const char *fmt, ...)
{
    va_list va;
    char buff[256];
    unsigned long flags;
    


spin_lock(&g_spinlock);
local_irq_save(flags);
    va_start(va, fmt);
    vsprintf(buff, fmt, va);
    va_end(va);
    printascii(buff);
    local_irq_restore(flags);
spin_unlock(&g_spinlock);
}


sunxi_pm_dbg( "00000in sunxi_uart_init\n" );
sunxi_pm_dbg( "11111in sunxi_uart_init\n" );
sunxi_pm_dbg( "22222in sunxi_uart_init\n" );
sunxi_pm_dbg( "33333in sunxi_uart_init\n" );
sunxi_pm_dbg( "44444in sunxi_uart_init\n" );
sunxi_pm_dbg( "55555in sunxi_uart_init\n" );


Uncompressing Linux... done, booting the kernel.
00000in sunxi_uart_init
11111in sunxi_uart_init
22222in sunxi_uart_init
33333in sunxi_uart_init
44444in sunxi_uart_init
55555in sunxi_uart_init
Booting Linux on physical CPU 0
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Linux version 3.4.39 (root@ubuntu) (gcc version 4.6.3 20120201 (prerelease) (crosstool-NG linaro-1.13.1-2012.02-20120222 - Linaro GCC 2012.02) ) #1537 SMP PREEMPT Tue Jul 26 11:04:50 CST 2016
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing


不打开的话,由于没有等待发送完成,即发送fifo是否为空,在sunxi_pm_dbg( "33333in sunxi_uart_init\n" );
sunxi_pm_dbg( "44444in sunxi_uart_init\n" );
sunxi_pm_dbg( "55555in sunxi_uart_init\n" );后期会出现乱码。




评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值