]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/samsung/universal_c210/universal.c
arm:goni:mmc: Add sd card detection and initialization.
[karo-tx-uboot.git] / board / samsung / universal_c210 / universal.c
index 1e67dea2ae248037b67b1d61be6e7a80e5f1a445..2e1dba6a48d6eba0e311cd9da5d8857e9806430d 100644 (file)
@@ -3,23 +3,7 @@
  *  Minkyu Kang <mk7.kang@samsung.com>
  *  Kyungmin Park <kyungmin.park@samsung.com>
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/pinmux.h>
-#include <pmic.h>
-#include <usb/s3c_udc.h>
-#include <asm/arch/cpu.h>
-#include <max8998_pmic.h>
 #include <asm/arch/watchdog.h>
 #include <libtizen.h>
 #include <ld9040.h>
@@ -59,21 +39,7 @@ static int get_hwrev(void)
        return board_rev & 0xFF;
 }
 
-static void check_hw_revision(void);
-
-int board_init(void)
-{
-       gpio1 = (struct exynos4_gpio_part1 *) EXYNOS4_GPIO_PART1_BASE;
-       gpio2 = (struct exynos4_gpio_part2 *) EXYNOS4_GPIO_PART2_BASE;
-
-       gd->bd->bi_arch_number = MACH_TYPE_UNIVERSAL_C210;
-       gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
-
-       check_hw_revision();
-       printf("HW Revision:\t0x%x\n", board_rev);
-
-       return 0;
-}
+static void init_pmic_lcd(void);
 
 int power_init_board(void)
 {
@@ -83,6 +49,8 @@ int power_init_board(void)
        if (ret)
                return ret;
 
+       init_pmic_lcd();
+
        return 0;
 }
 
@@ -357,7 +325,10 @@ static void init_pmic_lcd(void)
        unsigned char val;
        int ret = 0;
 
-       struct pmic *p = get_pmic();
+       struct pmic *p = pmic_get("MAX8998_PMIC");
+
+       if (!p)
+               return;
 
        if (pmic_probe(p))
                return;
@@ -397,7 +368,7 @@ static void init_pmic_lcd(void)
                puts("LCD pmic initialisation error!\n");
 }
 
-static void lcd_cfg_gpio(void)
+void exynos_cfg_lcd_gpio(void)
 {
        unsigned int i, f3_end = 4;
 
@@ -436,7 +407,7 @@ static void lcd_cfg_gpio(void)
        spi_init();
 }
 
-static void reset_lcd(void)
+void exynos_reset_lcd(void)
 {
        s5p_gpio_set_value(&gpio2->y4, 5, 1);
        udelay(10000);
@@ -446,9 +417,12 @@ static void reset_lcd(void)
        udelay(100);
 }
 
-static void lcd_power_on(void)
+void exynos_lcd_power_on(void)
 {
-       struct pmic *p = get_pmic();
+       struct pmic *p = pmic_get("MAX8998_PMIC");
+
+       if (!p)
+               return;
 
        if (pmic_probe(p))
                return;
@@ -481,10 +455,6 @@ vidinfo_t panel_info = {
        .vl_cmd_allow_len = 0xf,
 
        .win_id         = 0,
-       .cfg_gpio       = lcd_cfg_gpio,
-       .backlight_on   = NULL,
-       .lcd_power_on   = lcd_power_on,
-       .reset_lcd      = reset_lcd,
        .dual_lcd_enabled = 0,
 
        .init_delay     = 0,
@@ -494,6 +464,16 @@ vidinfo_t panel_info = {
        .mipi_enabled   = 0,
 };
 
+void exynos_cfg_ldo(void)
+{
+       ld9040_cfg_ldo();
+}
+
+void exynos_enable_ldo(unsigned int onoff)
+{
+       ld9040_enable_ldo(onoff);
+}
+
 void init_panel_info(vidinfo_t *vid)
 {
        vid->logo_on    = 1;
@@ -508,9 +488,6 @@ void init_panel_info(vidinfo_t *vid)
        vid->pclk_name = 1;     /* MPLL */
        vid->sclk_div = 1;
 
-       vid->cfg_ldo = ld9040_cfg_ldo;
-       vid->enable_ldo = ld9040_enable_ldo;
-
        setenv("lcdinfo", "lcd=ld9040");
 }
 
@@ -522,10 +499,6 @@ int board_init(void)
        gd->bd->bi_arch_number = MACH_TYPE_UNIVERSAL_C210;
        gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
 
-#if defined(CONFIG_PMIC)
-       pmic_init();
-       init_pmic_lcd();
-#endif
 #ifdef CONFIG_SOFT_SPI
        soft_spi_init();
 #endif