在linux-2.6.33.5核心中添加對s3c2410串口2的配置

來源:互聯網
上載者:User

這幾天,突然發現移植好的s3c2410的串口2在linux系統下竟然不能用,趕緊查了很多資料,發現,若要在linux系統下是用s3c23410的串口2 ,需要修改核心,把s3c2410的串口2配置成普通的串口。

    1.修改arch/arm/mach-s3c2440/mach-smdk2440.c中的uart2的配置,修改後如下:     static struct s3c2410_uartcfg smdk2410_uartcfgs[] __initdata = {
        [0] = {
                .hwport             = 0,
                .flags             = 0,
                .ucon             = UCON,
                .ulcon             = ULCON,
                .ufcon             = UFCON,
        },
        [1] = {
                .hwport             = 1,
                .flags             = 0,
                .ucon             = UCON,
                .ulcon             = ULCON,
                .ufcon             = UFCON,
        },
        /* IR port */
        [2] = {
                .hwport             = 2,
                .flags             = 0,
                .ucon             = 0x3c5,
                .ulcon             = 0x03,                .ufcon             = 0x51,
        }
2. 在drivers/serial/samsung.c中添加對uart2控制器的配置,配置為普通串口。   添加標頭檔:#include <linux/gpio.h>
             #include <mach/regs-gpio.h>    在static int s3c24xx_serial_startup(struct uart_port *port)函數中,添加            if (port->line == 2) {
                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.編譯核心,下載進板子後,進行測試,串口2終於可以正常工作了。 參考:http://bbs.witech.com.cn/archiver/?tid-468-page-1.html開貼詳述linux-2.6.33核心的移植
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.