TI中文支持网
TI专业的中文技术问题搜集分享网站

uart1 & uart5 full-modem mode could you tell me, am i right?

diff -uNr linux-3.2.7.3/arch/arm/mach-omap2/board-am335xevm.c linux-3.2.7.2/arch/arm/mach-omap2/board-am335xevm.c
— linux-3.2.7.3/arch/arm/mach-omap2/board-am335xevm.c 2013-09-18 13:34:51.471257199 +0800
+++ linux-3.2.7.2/arch/arm/mach-omap2/board-am335xevm.c 2013-09-11 10:27:15.149771882 +0800
@@ -307,34 +307,6 @@
  {NULL, 0},
 };
 
-/*zhaifang add uart1 pinmux*/
-static struct pinmux_config uart1_pin_mux[] = {
– {"mii1_txclk.uart1_dcd", OMAP_MUX_MODE5 | AM33XX_PIN_INPUT_PULLDOWN},
– {"mii1_rxclk.uart1_dsr", OMAP_MUX_MODE5 | AM33XX_PIN_INPUT_PULLDOWN},
– {"mii1_rxd3.uart1_dtr", OMAP_MUX_MODE5 | AM33XX_PIN_OUTPUT},
– {"uart1_ctsn.uart1_ctsn", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
– {"uart1_rtsn.uart1_rtsn", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT},
– {"uart1_rxd.uart1_rxd", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
– {"uart1_txd.uart1_txd", OMAP_MUX_MODE0 | AM33XX_PULL_ENBL},
– {NULL, 0}, 
-};

-static struct pinmux_config uart5_pin_mux[] = {
– {"lcd_data14.uart5_ctsn", OMAP_MUX_MODE4 | AM33XX_PIN_OUTPUT},
– {"lcd_data15.uart5_rtsn", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT},
– {"lcd_data9.uart5_rxd", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLUP},
– {"lcd_data8.uart5_txd", OMAP_MUX_MODE4 | AM33XX_PULL_ENBL},
– {NULL, 0}, 
-};

-static struct pinmux_config uart5_gpio_pin_mux[] = {
– {"lcd_data4.gpio2_10", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},   //dtr
– {"lcd_data0.gpio2_6", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLDOWN},  //dsr
– {"lcd_data1.gpio2_7", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLDOWN},  //cd
– {NULL, 0}, 
-};


 /*
 * @pin_mux – single module pin-mux structure which defines pin-mux
 *   details for all its pins.
@@ -656,19 +628,6 @@
  .tps65217_init_data = &tps65217_regulator_data[0],
  .status_off = true,
 };
-/* zhaifang add*/
-static void uart1_init(int evm_id, int profile)
-{
– setup_pin_mux(uart1_pin_mux);
– return;
-}

-static void uart5_init(int evm_id, int profile)
-{
– setup_pin_mux(uart5_pin_mux);
– setup_pin_mux(uart5_gpio_pin_mux);
– return;
-}
 
 static void mmc0_init(int evm_id, int profile)
 {
@@ -858,8 +817,6 @@
 // {usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
  {mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
  {spi0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
– {uart1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
– {uart5_init, DEV_ON_BASEBOARD, PROFILE_NONE},
  {NULL, 0, 0},
 };
 
diff -uNr linux-3.2.7.3/arch/arm/mach-omap2/mux33xx.c linux-3.2.7.2/arch/arm/mach-omap2/mux33xx.c
— linux-3.2.7.3/arch/arm/mach-omap2/mux33xx.c 2013-09-12 13:34:16.543044588 +0800
+++ linux-3.2.7.2/arch/arm/mach-omap2/mux33xx.c 2013-08-30 09:34:57.137878791 +0800
@@ -175,10 +175,10 @@
   NULL, NULL, NULL, "gpio2_13"),
  _AM33XX_MUXENTRY(LCD_DATA8, 0,
   "lcd_data8", "gpmc_a12", NULL, "mcasp0_aclkx",
–  "uart5_txd", NULL, "uart2_ctsn", "gpio2_14"),
+  NULL, NULL, "uart2_ctsn", "gpio2_14"),
  _AM33XX_MUXENTRY(LCD_DATA9, 0,
   "lcd_data9", "gpmc_a13", NULL, "mcasp0_fsx",
–  "uart5_rxd", NULL, "uart2_rtsn", "gpio2_15"),
+  NULL, NULL, "uart2_rtsn", "gpio2_15"),
  _AM33XX_MUXENTRY(LCD_DATA10, 0,
   "lcd_data10", "gpmc_a14", NULL, "mcasp0_axr0",
   NULL, NULL, NULL, "gpio2_16"),
@@ -193,10 +193,10 @@
   "mcasp0_axr3", NULL, NULL, "gpio0_9"),
  _AM33XX_MUXENTRY(LCD_DATA14, 0,
   "lcd_data14", "gpmc_a18", NULL, "mcasp0_axr1",
–  NULL, NULL, "uart5_ctsn", "gpio0_10"),
+  NULL, NULL, NULL, "gpio0_10"),
  _AM33XX_MUXENTRY(LCD_DATA15, 0,
   "lcd_data15", "gpmc_a19", NULL, "mcasp0_ahclkx",
–  "mcasp0_axr3", NULL, "uart5_rtsn", "gpio0_11"),
+  "mcasp0_axr3", NULL, NULL, "gpio0_11"),
  _AM33XX_MUXENTRY(LCD_VSYNC, 0,
   "lcd_vsync", NULL, NULL, NULL,
   NULL, NULL, NULL, "gpio2_22"),
@@ -256,13 +256,13 @@
   "mcasp1_aclkr", NULL, "mmc1_clk", "gpio0_28"),
  _AM33XX_MUXENTRY(MII1_TXCLK, 0,
   "mii1_txclk", NULL, "rgmii1_tclk", "mmc0_dat7",
–  "mmc1_dat0", "uart1_dcd", "mcasp0_aclkx", "gpio3_9"),
+  "mmc1_dat0", NULL, "mcasp0_aclkx", "gpio3_9"),
  _AM33XX_MUXENTRY(MII1_RXCLK, 0,
   "mii1_rxclk", NULL, "rgmii1_rclk", "mmc0_dat6",
–  "mmc1_dat1", "uart1_dsr", "mcasp0_fsx", "gpio3_10"),
+  "mmc1_dat1", NULL, "mcasp0_fsx", "gpio3_10"),
  _AM33XX_MUXENTRY(MII1_RXD3, 0,
   "mii1_rxd3", NULL, "rgmii1_rd3", "mmc0_dat5",
–  "mmc1_dat2", "uart1_dtr", "mcasp0_axr0", "gpio2_18"),
+  "mmc1_dat2", NULL, "mcasp0_axr0", "gpio2_18"),
  _AM33XX_MUXENTRY(MII1_RXD2, 0,
   "mii1_rxd2", NULL, "rgmii1_rd2", "mmc0_dat4",
   "mmc1_dat3", NULL, "mcasp0_axr1", "gpio2_19"),
diff -uNr linux-3.2.7.3/arch/arm/mach-omap2/serial.c linux-3.2.7.2/arch/arm/mach-omap2/serial.c
— linux-3.2.7.3/arch/arm/mach-omap2/serial.c 2013-09-18 15:37:42.531613936 +0800
+++ linux-3.2.7.2/arch/arm/mach-omap2/serial.c 2013-08-30 09:34:57.133878790 +0800
@@ -123,20 +123,6 @@
 
 #ifdef CONFIG_OMAP_MUX
 static struct omap_device_pad default_uart1_pads[] __initdata = {
– /* zhaifang add 2013.09.18 */
– {
–  .name  = "mii1_txclk.uart1_dcd",
–  .enable = OMAP_PIN_INPUT_PULLUP| OMAP_MUX_MODE5,
– },
– {
–  .name  = "mii1_rxclk.uart1_dsr",
–  .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE5,
– },
– {
–  .name  = "mii1_rxd3.uart1_dtr",
–  .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE5,
– },
– /* add end*/
  {
   .name = "uart1_cts.uart1_cts",
   .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
@@ -156,40 +142,7 @@
   .idle = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
  },
 };
-/* zhaifang add 2013.09.18 */
-static struct omap_device_pad default_uart5_pads[] __initdata = {
– {
–  .name  = "lcd_data1.gpio2_7",
–  .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE7, //dcd
– },
– {
–  .name  = "lcd_data0.gpio2_6",
–  .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE7,
– },
– {
–  .name  = "lcd_data4.gpio2_10",
–  .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE5,  //dtr
– },
– {
–  .name = "lcd_data14.uart5_ctsn",
–  .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE4,
– },
– {
–  .name = "lcd_data15.uart5_rtsn",
–  .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE4,
– },
– {
–  .name = "lcd_data8.uart5_tx",
–  .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE4,
– },
– {
–  .name = "lcd_data9.uart5_rx",
–  .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
–  .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE4,
–  .idle = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE4,
– },
-};
-/* end add */
+
 static struct omap_device_pad default_uart2_pads[] __initdata = {
  {
   .name = "uart2_cts.uart2_cts",
@@ -261,37 +214,31 @@
 static void omap_serial_fill_default_pads(struct omap_board_data *bdata)
 {
  switch (bdata->id) {
–  case 0:
–   bdata->pads = default_uart1_pads;
–   bdata->pads_cnt = ARRAY_SIZE(default_uart1_pads);
–   break;
–  case 1:
–   bdata->pads = default_uart2_pads;
–   bdata->pads_cnt = ARRAY_SIZE(default_uart2_pads);
–   break;
–  case 2:
–   bdata->pads = default_uart3_pads;
–   bdata->pads_cnt = ARRAY_SIZE(default_uart3_pads);
–   break;
–  case 3:
–   if (cpu_is_omap44xx()) {
–    bdata->pads = default_omap4_uart4_pads;
–    bdata->pads_cnt =
–     ARRAY_SIZE(default_omap4_uart4_pads);
–   } else if (cpu_is_omap3630()) {
–    bdata->pads = default_omap36xx_uart4_pads;
–    bdata->pads_cnt =
–     ARRAY_SIZE(default_omap36xx_uart4_pads);
–   }
–   break;
-/* zhaifang add */   
–  case 5:
–   bdata->pads = default_uart5_pads;
–   bdata->pads_cnt = ARRAY_SIZE(default_uart5_pads);
–   break;
-/* add end */
–  default:
–   break;
+ case 0:
+  bdata->pads = default_uart1_pads;
+  bdata->pads_cnt = ARRAY_SIZE(default_uart1_pads);
+  break;
+ case 1:
+  bdata->pads = default_uart2_pads;
+  bdata->pads_cnt = ARRAY_SIZE(default_uart2_pads);
+  break;
+ case 2:
+  bdata->pads = default_uart3_pads;
+  bdata->pads_cnt = ARRAY_SIZE(default_uart3_pads);
+  break;
+ case 3:
+  if (cpu_is_omap44xx()) {
+   bdata->pads = default_omap4_uart4_pads;
+   bdata->pads_cnt =
+    ARRAY_SIZE(default_omap4_uart4_pads);
+  } else if (cpu_is_omap3630()) {
+   bdata->pads = default_omap36xx_uart4_pads;
+   bdata->pads_cnt =
+    ARRAY_SIZE(default_omap36xx_uart4_pads);
+  }
+  break;
+ default:
+  break;
  }
 }
 #else

zai Jonathan:


so i see the serial infomation but uart1 is error, why i see RI not DSR ?

zai Jonathan:

回复 zai Jonathan:

因为Ri的值默认是1,而DSR的电平拉底了,所以不会显示。但是又有一个疑问,那就是我控制串口的信号,是否通过serial.c和board-am335x.c中的设定就可以?请问Ti的大牛们,你们是怎么设置的代码架构来控制串口信号的?

赞(0)
未经允许不得转载:TI中文支持网 » uart1 & uart5 full-modem mode could you tell me, am i right?
分享到: 更多 (0)