]> git.sur5r.net Git - u-boot/blobdiff - board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
Merge branch 'master' of git://git.denx.de/u-boot-nand-flash
[u-boot] / board / freescale / mpc8610hpcd / mpc8610hpcd_diu.c
index b70637f940280aa1803de45dec230e793113195f..2b2d5d7ec2733b12a9b3812af2e5c0f796fc4121 100644 (file)
@@ -41,6 +41,26 @@ extern unsigned int FSL_Logo_BMP[];
 
 static int xres, yres;
 
+void diu_set_pixel_clock(unsigned int pixclock)
+{
+       volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR;
+       volatile ccsr_gur_t *gur = &immap->im_gur;
+       volatile unsigned int *guts_clkdvdr = &gur->clkdvdr;
+       unsigned long speed_ccb, temp, pixval;
+
+       speed_ccb = get_bus_freq(0);
+       temp = 1000000000/pixclock;
+       temp *= 1000;
+       pixval = speed_ccb / temp;
+       debug("DIU pixval = %lu\n", pixval);
+
+       /* Modify PXCLK in GUTS CLKDVDR */
+       debug("DIU: Current value of CLKDVDR = 0x%08x\n", *guts_clkdvdr);
+       temp = *guts_clkdvdr & 0x2000FFFF;
+       *guts_clkdvdr = temp;                           /* turn off clock */
+       *guts_clkdvdr = temp | 0x80000000 | ((pixval & 0x1F) << 16);
+       debug("DIU: Modified value of CLKDVDR = 0x%08x\n", *guts_clkdvdr);
+}
 
 void mpc8610hpcd_diu_init(void)
 {
@@ -96,7 +116,7 @@ int mpc8610diu_init_show_bmp(cmd_tbl_t *cmdtp,
        unsigned int addr;
 
        if (argc < 2) {
-               printf ("Usage:\n%s\n", cmdtp->usage);
+               cmd_usage(cmdtp);
                return 1;
        }
 
@@ -117,8 +137,8 @@ int mpc8610diu_init_show_bmp(cmd_tbl_t *cmdtp,
 }
 
 U_BOOT_CMD(
-       diufb, CFG_MAXARGS, 1, mpc8610diu_init_show_bmp,
-       "diufb init | addr - Init or Display BMP file\n",
+       diufb, CONFIG_SYS_MAXARGS, 1, mpc8610diu_init_show_bmp,
+       "Init or Display BMP file",
        "init\n    - initialize DIU\n"
        "addr\n    - display bmp at address 'addr'\n"
        );