]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/freescale/mx6sabresd/mx6sabresd.c
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / board / freescale / mx6sabresd / mx6sabresd.c
index 12d8c5664ed7a102234059e11b7e473d8deeb263..3e314daec2f431d7cb2900a508b7264713e3dd23 100644 (file)
 #include <asm/gpio.h>
 #include <asm/imx-common/iomux-v3.h>
 #include <asm/imx-common/boot_mode.h>
+#include <asm/imx-common/video.h>
 #include <mmc.h>
 #include <fsl_esdhc.h>
 #include <miiphy.h>
 #include <netdev.h>
 #include <asm/arch/mxc_hdmi.h>
 #include <asm/arch/crm_regs.h>
-#include <linux/fb.h>
-#include <ipu_pixfmt.h>
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
 DECLARE_GLOBAL_DATA_PTR;
@@ -135,6 +134,16 @@ static void setup_spi(void)
        imx_iomux_v3_setup_multiple_pads(ecspi1_pads, ARRAY_SIZE(ecspi1_pads));
 }
 
+iomux_v3_cfg_t const pcie_pads[] = {
+       MX6_PAD_EIM_D19__GPIO3_IO19 | MUX_PAD_CTRL(NO_PAD_CTRL),        /* POWER */
+       MX6_PAD_GPIO_17__GPIO7_IO12 | MUX_PAD_CTRL(NO_PAD_CTRL),        /* RESET */
+};
+
+static void setup_pcie(void)
+{
+       imx_iomux_v3_setup_multiple_pads(pcie_pads, ARRAY_SIZE(pcie_pads));
+}
+
 iomux_v3_cfg_t const di0_pads[] = {
        MX6_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK,        /* DISP0_CLK */
        MX6_PAD_DI0_PIN2__IPU1_DI0_PIN02,               /* DISP0_HSYNC */
@@ -255,22 +264,6 @@ int board_phy_config(struct phy_device *phydev)
 }
 
 #if defined(CONFIG_VIDEO_IPUV3)
-struct display_info_t {
-       int     bus;
-       int     addr;
-       int     pixfmt;
-       int     (*detect)(struct display_info_t const *dev);
-       void    (*enable)(struct display_info_t const *dev);
-       struct  fb_videomode mode;
-};
-
-static int detect_hdmi(struct display_info_t const *dev)
-{
-       struct hdmi_regs *hdmi  = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;
-       return readb(&hdmi->phy_stat0) & HDMI_DVI_STAT;
-}
-
-
 static void disable_lvds(struct display_info_t const *dev)
 {
        struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
@@ -299,7 +292,7 @@ static void enable_lvds(struct display_info_t const *dev)
        writel(reg, &iomux->gpr[2]);
 }
 
-static struct display_info_t const displays[] = {{
+struct display_info_t const displays[] = {{
        .bus    = -1,
        .addr   = 0,
        .pixfmt = IPU_PIX_FMT_RGB666,
@@ -340,51 +333,7 @@ static struct display_info_t const displays[] = {{
                .sync           = FB_SYNC_EXT,
                .vmode          = FB_VMODE_NONINTERLACED
 } } };
-
-int board_video_skip(void)
-{
-       int i;
-       int ret;
-       char const *panel = getenv("panel");
-       if (!panel) {
-               for (i = 0; i < ARRAY_SIZE(displays); i++) {
-                       struct display_info_t const *dev = displays+i;
-                       if (dev->detect && dev->detect(dev)) {
-                               panel = dev->mode.name;
-                               printf("auto-detected panel %s\n", panel);
-                               break;
-                       }
-               }
-               if (!panel) {
-                       panel = displays[0].mode.name;
-                       printf("No panel detected: default to %s\n", panel);
-                       i = 0;
-               }
-       } else {
-               for (i = 0; i < ARRAY_SIZE(displays); i++) {
-                       if (!strcmp(panel, displays[i].mode.name))
-                               break;
-               }
-       }
-       if (i < ARRAY_SIZE(displays)) {
-               ret = ipuv3_fb_init(&displays[i].mode, 0,
-                                   displays[i].pixfmt);
-               if (!ret) {
-                       displays[i].enable(displays+i);
-                       printf("Display: %s (%ux%u)\n",
-                              displays[i].mode.name,
-                              displays[i].mode.xres,
-                              displays[i].mode.yres);
-               } else
-                       printf("LCD %s cannot be configured: %d\n",
-                              displays[i].mode.name, ret);
-       } else {
-               printf("unsupported panel %s\n", panel);
-               return -EINVAL;
-       }
-
-       return 0;
-}
+size_t display_count = ARRAY_SIZE(displays);
 
 static void setup_display(void)
 {
@@ -454,6 +403,7 @@ int overwrite_console(void)
 int board_eth_init(bd_t *bis)
 {
        setup_iomux_enet();
+       setup_pcie();
 
        return cpu_eth_init(bis);
 }