关闭

应用dts在am335x上移植LCD(三)

552人阅读 评论(0) 收藏 举报
分类:

AM335x开发板

  红色为注释了的

  蓝色为添加上的

  PATH 表示当前修改文件的路径

  line 表示要修改的代码在当前文件的开始行

  在原来的开发板上

  修改 LCD 的分辨率:

  ti-sdk-am335x-evm/board-support/linux-3.2-psp04.06.00.07.sdk/drivers/video/da8xx-fb.c

  //@line 275

  [3] = {

  .name = "HANSTAR_HSD070IDW1_A",

  //@@ .width = 800,

  //@@ .height = 480,

  .width = 800, //@@

  .height = 600, //@@

  .hfp = 210,

  .hbp = 46,

  .hsw = 40,

  .vfp = 12,

  .vbp = 23,

  .vsw = 20,

  .pxl_clk = 40000000,

  .invert_pxl_clk = 0,

  },

  /* add end */

  修改 LCD 显示ide颜色位,从24色 变为 16色

  1)、先修改 bpp 的取值范围

  ti-sdk-am335x-evm/board-support/linux-3.2-psp04.06.00.07.sdk/arch/arm/mach-omap2

  /board-am335xevm.c

  //@line 127

  static const struct display_panel disp_panel = {

  WVGA,

  //@@ 32,

  32, //@@max_bpp

  //@@ 32,

  8, //@@min_bpp

  COLOR_ACTIVE,

  };

  2)、再修改当前 LCD 配置的 bpp 大小

  ti-sdk-am335x-evm/board-support/linux-3.2-psp04.06.00.07.sdk/arch/arm/mach-omap2

  /board-am335xevm.c

  //@line 154

  static struct lcd_ctrl_config lcd_cfg = {

  &disp_panel,

  .ac_bias = 255,

  .ac_bias_intrpt = 0,

  .dma_burst_sz = 16,

  //@@ .bpp = 32,

  .bpp = 16, //@@

  .fdd = 0x80,

  .tft_alt_mode = 0,

  .stn_565_mode = 0,

  .mono_8bit_mode = 0,

  .invert_line_clock = 1,

  .invert_frm_clock = 1,

  .sync_edge = 0,

  .sync_ctrl = 1,

  .raster_order = 0,

  };

  使能 uart2。

  需要修改 uart2 rxd,txd 的 pin 属性

  硬件上修改

  焊接 R486,R487

  软件上修改

  uart2 的 pin 配置

  PATH: linux-3.2-psp04.06.07.sdk/arch/arm/mach-omap2/board-am335xevm.c

  //line 668

  /* Module pin mux for uart2 */

  static struct pinmux_config uart2_pin_mux[] = {

  /*@@

  {"spi0_sclk.uart2_rxd", OMAP_MUX_MODE1 | AM33XX_SLEWCTRL_SLOW |

  AM33XX_PIN_INPUT_PULLUP},

  {"spi0_d0.uart2_txd", OMAP_MUX_MODE1 | AM33XX_PULL_UP |

  AM33XX_PULL_DISA |

  AM33XX_SLEWCTRL_SLOW},

  @@*/

  {"spi0_sclk.uart2_rxd", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},

  {"spi0_d0.uart2_txd",OMAP_MUX_MODE1 | AM33XX_PULL_UP | AM33XX_PULL_ENBL},

  {NULL, 0},

  };

  失能 spi0

  PATH: linux-3.2-psp04.06.07.sdk/arch/arm/mach-omap2/board-am335xevm.c

  //line 1795 @@

  //@@ {spi0_init, DEV_ON_DGHTR_BRD, PROFILE_2}; //uart2_rxd/txd_mux3

  修改当前 uart2 使用的板子类型

  PATH: linux-3.2-psp04.06.07.sdk/arch/arm/mach-omap2/board-am335xevm.c

  // line 1802

  //@@ {uart2_init, DEV_ON_DGHTR_BRD, PROFILE_3},

  {uart2_init, DEV_ON_BASEBOARD, PROFILE_ALL}, //@@

  使能 uart4

  硬件上的修改:

  焊接上 R362,使 uart4 txd 端可以发送数据;

  断开 R364 的连接(这是 U18 的 ROUT2 端,uart4 通过该端口接收数据),

  断开 R61 的连接(U4 的 pin 45 连接着 AM335X_UART0_CTSn,这会使 uart4 无法接收数据),把(R364与 MCU 的连接端)与 (J52 的 pin 5)相连接,使 uart4 rxd端可以通过 UART0_CTSn 接收数据;

  软件上的修改:

  在 UART0_CTSN pin 上添加 uart4 rxd

  在 UART0_RTSN pin 上添加 uart4 txd

  PATH:linux-3.2-psp04.06.00.07.sdk/arch/arm/mach-omap2

  //line 302 @@

  /*@@

  _AM33XX_MUXENTRY(UART0_CTSN, 0,

  "uart0_ctsn", NULL, "d_can1_tx", "i2c1_sda",

  "spi1_d0", NULL, NULL, "gpio1_8"),

  _AM33XX_MUXENTRY(UART0_RTSN, 0,

  "uart0_rtsn", NULL, "d_can1_rx", "i2c1_scl",

  "spi1_d1", "spi1_cs0", NULL, "gpio1_9"),

  @@*/

  //@@

  _AM33XX_MUXENTRY(UART0_CTSN, 0,

  "uart0_ctsn", "uart4_rxd", "d_can1_tx", "i2c1_sda",

  "spi1_d0", NULL, NULL, "gpio1_8"),

  _AM33XX_MUXENTRY(UART0_RTSN, 0,

  "uart0_rtsn", "uart4_txd", "d_can1_rx", "i2c1_scl",

  "spi1_d1", "spi1_cs0", NULL, "gpio1_9"),

  //@@

  添加 uart4 的配置等

  PATH: linux-3.2-psp04.06.07.sdk/arch/arm/mach-omap2/board-am335xevm.c

  添加 uart4 的配置

  //line 683 @@

  /*@@ uart4*/

  static struct pinmux_config uart4_pin_mux[] = {

  {"uart0_ctsn.uart4_rxd",OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},

  {"uart0_rtsn.uart4_txd",OMAP_MUX_MODE1 | AM33XX_PULL_ENBL},

  {NULL, 0},

  };

  添加 uart4 的初始化

  //line 1073 @@

  /*@@ setup uart4 */

  static void uart4_init(int evm_id, int profile)

  {

  setup_pin_mux(uart4_pin_mux);

  return;

  }

  把 uart4 的初始化添加到开机启动中

  //line 1086 @@

  {uart4_init, DEV_ON_BASEBOARD, PROFILE_ALL}, //@@

  失能 d_can_init,其会影响 uart4 的 收发

  //line 1800

  //@@ {d_can_init, DEV_ON_DGHTR_BRD, PROFILE_1}, //uart4_rxd/txd_mux1

  使能 uart3

  硬件上修改;

  焊接 J51 上的 R495,使 ECAP0_IN_PWM0_OUT 管脚可以复用为 UART3_TXD。

  断开 J4 (MMC0) 上的 R380,使 AM335x_SPI0_CS1 管脚可以复用为 UART_RXD。把(R380中连接MMC0 卡套端)与(TP69(AM335X_MCASP0_ACLKX))相连接,使能MMC0,使系统可以从 SD卡启动

  软件上修改

  PATH: linux-3.2-psp04.06.07.sdk/arch/arm/mach-omap2/board-am335xevm.c

  重新配置 MMC0

  //line 607 @@

  /* Module pin mux for mmc0 */

  /* Module pin mux for mmc0 */

  static struct pinmux_config mmc0_pin_mux[] = {

  {"mmc0_dat3.mmc0_dat3", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},

  {"mmc0_dat2.mmc0_dat2", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},

  {"mmc0_dat1.mmc0_dat1", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},

  {"mmc0_dat0.mmc0_dat0", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},

  {"mmc0_clk.mmc0_clk", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},

  {"mmc0_cmd.mmc0_cmd", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},

  {"mcasp0_aclkr.mmc0_sdwp",OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},

  //@@注释 {"spi0_cs1.mmc0_sdcd", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},

  {"mcasp0_aclkx.mmc0_sdcd", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},//@@添加

  {NULL, 0},

  };

  把 uart3 的初始化添加到开机启动中

  //line 1805

  {uart3_init, DEV_ON_BASEBOARD, PROFILE_ALL}, //@@

  /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;}

  TQ335X开发板:http://www.embedsky.com/index.php?s=/Product/show/id/49.html

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:8079次
    • 积分:112
    • 等级:
    • 排名:千里之外
    • 原创:0篇
    • 转载:21篇
    • 译文:0篇
    • 评论:0条
    文章分类
    文章存档