S3C2440 UART2被配置為CTS問題解決

來源:互聯網
上載者:User

    Linux核心預設把uart2的功能設定為nRTS1、nTCTS1,沒有作為正常串口使用,如果我們想要將uart2作為串口,需要做以下修改:linux2.6核心將GPHCON寄存器的值置為0x16faaa就是說GPH6被設定為nRTS1,GPH7被設定為nCTS1,此時,串口2是無法收發資料的。

1、修改arch/arm/mach-s3c2440/mach-smdk2440.c中的uart2的配置,修改後如下:
static struct s3c2410_uartcfg smdk2440_uartcfgs[] __initdata = {
        [0] = {
                .hwport           = 0,
                .flags            = 0,
                .ucon             = 0x3c5,
                .ulcon            = 0x03,
                .ufcon            = 0x51,
        },
        [1] = {
                .hwport           = 1,
                .flags            = 0,
                .ucon             = 0x3c5,
                .ulcon            = 0x03,
                .ufcon            = 0x51,
        },

        /* IR port */

        [2] = {
                .hwport             = 2,
                .flags             = 0,
                .ucon             = 0x3c5,
                .ulcon             = 0x03,/*old0x43*/
                .ufcon             = 0x51,
        }

};


2、vi drivers/serial/samsung.c 
//增加以下標頭檔
#include <linux/gpio.h> 
#include <mach/regs-gpio.h> 
在static int s3c24xx_serial_startup(struct uart_port *port)函數最後,添加
                s3c2410_gpio_cfgpin(S3C2410_GPH(6), S3C2410_GPH6_TXD2); 
                s3c2410_gpio_pullup(S3C2410_GPH(6), 1); 
                s3c2410_gpio_cfgpin(S3C2410_GPH(7), S3C2410_GPH7_RXD2); 

                s3c2410_gpio_pullup(S3C2410_GPH(7), 1); 

3、重新編譯zImage下載進開發板即可

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.