]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/pdm360ng/pdm360ng.c
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / board / pdm360ng / pdm360ng.c
index e8714e3a796063dc0d093bc5e82845c31f659d41..3048acd117678635c952d27df86078917db99353 100644 (file)
@@ -44,63 +44,6 @@ DECLARE_GLOBAL_DATA_PTR;
 extern flash_info_t flash_info[];
 ulong flash_get_size (phys_addr_t base, int banknum);
 
-/* Clocks in use */
-#define SCCR1_CLOCKS_EN        (CLOCK_SCCR1_CFG_EN |                           \
-                        CLOCK_SCCR1_LPC_EN |                           \
-                        CLOCK_SCCR1_NFC_EN |                           \
-                        CLOCK_SCCR1_PSC_EN(CONFIG_PSC_CONSOLE) |       \
-                        CLOCK_SCCR1_PSCFIFO_EN |                       \
-                        CLOCK_SCCR1_DDR_EN |                           \
-                        CLOCK_SCCR1_FEC_EN |                           \
-                        CLOCK_SCCR1_TPR_EN)
-
-#define SCCR2_CLOCKS_EN        (CLOCK_SCCR2_MEM_EN |           \
-                        CLOCK_SCCR2_SPDIF_EN |         \
-                        CLOCK_SCCR2_DIU_EN |           \
-                        CLOCK_SCCR2_I2C_EN)
-
-int board_early_init_f(void)
-{
-       volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
-
-       /*
-        * Initialize Local Window for FLASH-Bank1 access (CS1)
-        */
-       out_be32(&im->sysconf.lpcs1aw,
-               CSAW_START(CONFIG_SYS_FLASH1_BASE) |
-               CSAW_STOP(CONFIG_SYS_FLASH1_BASE, CONFIG_SYS_FLASH_SIZE)
-       );
-       out_be32(&im->lpc.cs_cfg[1], CONFIG_SYS_CS1_CFG);
-
-       /*
-        * Local Window for MRAM access (CS2)
-        */
-       out_be32(&im->sysconf.lpcs2aw,
-               CSAW_START(CONFIG_SYS_MRAM_BASE) |
-               CSAW_STOP(CONFIG_SYS_MRAM_BASE, CONFIG_SYS_MRAM_SIZE)
-       );
-       out_be32(&im->lpc.cs_cfg[2], CONFIG_SYS_CS2_CFG);
-
-       sync_law(&im->sysconf.lpcs2aw);
-
-       /*
-        * Configure Flash Speed
-        */
-       out_be32(&im->lpc.cs_cfg[0], CONFIG_SYS_CS0_CFG);
-       out_be32(&im->lpc.altr, CONFIG_SYS_CS_ALETIMING);
-
-       /*
-        * Enable clocks
-        */
-       out_be32(&im->clk.sccr[0], SCCR1_CLOCKS_EN);
-       out_be32(&im->clk.sccr[1], SCCR2_CLOCKS_EN);
-#if defined(CONFIG_IIM) || defined(CONFIG_CMD_FUSE)
-       setbits_be32(&im->clk.sccr[1], CLOCK_SCCR2_IIM_EN);
-#endif
-
-       return 0;
-}
-
 sdram_conf_t mddrc_config[] = {
        {
                (512 << 20),    /* 512 MB RAM configuration */
@@ -172,9 +115,7 @@ phys_size_t initdram (int board_type)
        return msize;
 }
 
-#if defined(CONFIG_SERIAL_MULTI)
 static int set_lcd_brightness(char *);
-#endif
 
 int misc_init_r(void)
 {
@@ -237,9 +178,7 @@ int misc_init_r(void)
 #endif
 
 #ifdef CONFIG_FSL_DIU_FB
-#if defined(CONFIG_SERIAL_MULTI)
        set_lcd_brightness(0);
-#endif
        /* Switch LCD-Backlight and LVDS-Interface on */
        setbits_be32(&im->gpio.gpdir, 0x01040000);
        clrsetbits_be32(&im->gpio.gpdat, 0x01000000, 0x00040000);
@@ -515,16 +454,58 @@ struct node_info nodes[] = {
 };
 #endif
 
+#if defined(CONFIG_VIDEO)
+/*
+ * EDID block has been generated using Phoenix EDID Designer 1.3.
+ * This tool creates a text file containing:
+ *
+ * EDID BYTES:
+ * 0x   00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
+ *     ------------------------------------------------
+ * 00 | 00 FF FF FF FF FF FF 00 42 C9 34 12 01 00 00 00
+ * 10 | 0A 0C 01 03 80 98 5B 78 CA 7E 50 A0 58 4E 96 25
+ * 20 | 1E 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
+ * 30 | 01 01 01 01 01 01 80 0C 20 00 31 E0 2D 10 2A 80
+ * 40 | 12 08 30 E4 10 00 00 18 00 00 00 FD 00 38 3C 1F
+ * 50 | 3C 04 0A 20 20 20 20 20 20 20 00 00 00 FF 00 50
+ * 60 | 4D 30 37 30 57 4C 33 0A 0A 0A 0A 0A 00 00 00 FF
+ * 70 | 00 41 30 30 30 30 30 30 30 30 30 30 30 31 00 D4
+ *
+ * Then this data has been manually converted to the char
+ * array below.
+ */
+static unsigned char edid_buf[128] = {
+       0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
+       0x42, 0xC9, 0x34, 0x12, 0x01, 0x00, 0x00, 0x00,
+       0x0A, 0x0C, 0x01, 0x03, 0x80, 0x98, 0x5B, 0x78,
+       0xCA, 0x7E, 0x50, 0xA0, 0x58, 0x4E, 0x96, 0x25,
+       0x1E, 0x50, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01,
+       0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+       0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x0C,
+       0x20, 0x00, 0x31, 0xE0, 0x2D, 0x10, 0x2A, 0x80,
+       0x12, 0x08, 0x30, 0xE4, 0x10, 0x00, 0x00, 0x18,
+       0x00, 0x00, 0x00, 0xFD, 0x00, 0x38, 0x3C, 0x1F,
+       0x3C, 0x04, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20,
+       0x20, 0x20, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x50,
+       0x4D, 0x30, 0x37, 0x30, 0x57, 0x4C, 0x33, 0x0A,
+       0x0A, 0x0A, 0x0A, 0x0A, 0x00, 0x00, 0x00, 0xFF,
+       0x00, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
+       0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x00, 0xD4,
+};
+#endif
+
 void ft_board_setup(void *blob, bd_t *bd)
 {
        u32 val[8];
        int rc, i = 0;
 
        ft_cpu_setup(blob, bd);
-       fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
 #ifdef CONFIG_FDT_FIXUP_PARTITIONS
        fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
 #endif
+#if defined(CONFIG_VIDEO)
+       fdt_add_edid(blob, "fsl,mpc5121-diu", edid_buf);
+#endif
 
        /* Fixup NOR FLASH mapping */
        val[i++] = 0;                           /* chip select number */
@@ -565,7 +546,6 @@ void ft_board_setup(void *blob, bd_t *bd)
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
-#if defined(CONFIG_SERIAL_MULTI)
 /*
  * If argument is NULL, set the LCD brightness to the
  * value from "brightness" environment variable. Set
@@ -642,4 +622,3 @@ U_BOOT_CMD(lcdbr, 2, 1, cmd_lcd_brightness,
        "set LCD brightness",
        "<brightness> - set LCD backlight level to <brightness>.\n"
 );
-#endif /* CONFIG_SERIAL_MULTI */