2011-01-24 06:33:50 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 Samsung Electronics
|
|
|
|
* Minkyu Kang <mk7.kang@samsung.com>
|
|
|
|
* Kyungmin Park <kyungmin.park@samsung.com>
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2011-01-24 06:33:50 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2012-10-19 05:34:03 +00:00
|
|
|
#include <spi.h>
|
2012-10-19 05:34:07 +00:00
|
|
|
#include <lcd.h>
|
2011-01-24 06:33:50 +00:00
|
|
|
#include <asm/io.h>
|
2012-10-19 05:34:03 +00:00
|
|
|
#include <asm/gpio.h>
|
2011-01-24 06:33:50 +00:00
|
|
|
#include <asm/arch/adc.h>
|
2012-09-20 00:19:59 +00:00
|
|
|
#include <asm/arch/pinmux.h>
|
2012-09-20 00:20:00 +00:00
|
|
|
#include <asm/arch/watchdog.h>
|
2012-10-19 05:34:07 +00:00
|
|
|
#include <ld9040.h>
|
2012-11-13 03:21:55 +00:00
|
|
|
#include <power/pmic.h>
|
2014-03-07 13:59:47 +00:00
|
|
|
#include <usb.h>
|
2015-12-04 01:51:20 +00:00
|
|
|
#include <usb/dwc2_udc.h>
|
2011-12-15 09:32:12 +00:00
|
|
|
#include <asm/arch/cpu.h>
|
2012-11-13 03:21:55 +00:00
|
|
|
#include <power/max8998_pmic.h>
|
2014-03-07 13:59:47 +00:00
|
|
|
#include <libtizen.h>
|
2014-01-22 10:24:20 +00:00
|
|
|
#include <samsung/misc.h>
|
2014-03-07 13:59:47 +00:00
|
|
|
#include <usb_mass_storage.h>
|
2011-01-24 06:33:50 +00:00
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
|
|
|
unsigned int board_rev;
|
2017-01-09 05:47:50 +00:00
|
|
|
static int init_pmic_lcd(void);
|
2011-01-24 06:33:50 +00:00
|
|
|
|
|
|
|
u32 get_board_rev(void)
|
|
|
|
{
|
|
|
|
return board_rev;
|
|
|
|
}
|
|
|
|
|
2017-01-09 05:47:50 +00:00
|
|
|
int exynos_power_init(void)
|
2011-01-24 06:33:50 +00:00
|
|
|
{
|
2017-01-09 05:47:50 +00:00
|
|
|
return init_pmic_lcd();
|
2011-01-24 06:33:50 +00:00
|
|
|
}
|
|
|
|
|
2017-01-09 05:47:50 +00:00
|
|
|
static int get_hwrev(void)
|
2012-11-13 03:22:17 +00:00
|
|
|
{
|
2017-01-09 05:47:50 +00:00
|
|
|
return board_rev & 0xFF;
|
2012-11-13 03:22:17 +00:00
|
|
|
}
|
2011-01-24 06:33:50 +00:00
|
|
|
|
|
|
|
static unsigned short get_adc_value(int channel)
|
|
|
|
{
|
|
|
|
struct s5p_adc *adc = (struct s5p_adc *)samsung_get_base_adc();
|
|
|
|
unsigned short ret = 0;
|
|
|
|
unsigned int reg;
|
|
|
|
unsigned int loop = 0;
|
|
|
|
|
|
|
|
writel(channel & 0xF, &adc->adcmux);
|
|
|
|
writel((1 << 14) | (49 << 6), &adc->adccon);
|
|
|
|
writel(1000 & 0xffff, &adc->adcdly);
|
|
|
|
writel(readl(&adc->adccon) | (1 << 16), &adc->adccon); /* 12 bit */
|
|
|
|
udelay(10);
|
|
|
|
writel(readl(&adc->adccon) | (1 << 0), &adc->adccon); /* Enable */
|
|
|
|
udelay(10);
|
|
|
|
|
|
|
|
do {
|
|
|
|
udelay(1);
|
|
|
|
reg = readl(&adc->adccon);
|
|
|
|
} while (!(reg & (1 << 15)) && (loop++ < 1000));
|
|
|
|
|
|
|
|
ret = readl(&adc->adcdat0) & 0xFFF;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2012-03-26 21:53:48 +00:00
|
|
|
static int adc_power_control(int on)
|
|
|
|
{
|
2017-01-09 05:47:50 +00:00
|
|
|
struct udevice *dev;
|
2012-03-26 21:53:48 +00:00
|
|
|
int ret;
|
2017-01-09 05:47:50 +00:00
|
|
|
u8 reg;
|
2012-03-26 21:53:48 +00:00
|
|
|
|
2017-01-09 05:47:50 +00:00
|
|
|
ret = pmic_get("max8998-pmic", &dev);
|
|
|
|
if (ret) {
|
|
|
|
puts("Failed to get MAX8998!\n");
|
|
|
|
return ret;
|
|
|
|
}
|
2012-03-26 21:53:48 +00:00
|
|
|
|
2017-01-09 05:47:50 +00:00
|
|
|
reg = pmic_reg_read(dev, MAX8998_REG_ONOFF1);
|
|
|
|
if (on)
|
|
|
|
reg |= MAX8998_LDO4;
|
|
|
|
else
|
|
|
|
reg &= ~MAX8998_LDO4;
|
|
|
|
|
|
|
|
ret = pmic_reg_write(dev, MAX8998_REG_ONOFF1, reg);
|
|
|
|
if (ret) {
|
|
|
|
puts("MAX8998 LDO setting error\n");
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
2012-03-26 21:53:48 +00:00
|
|
|
|
2016-11-23 13:34:40 +00:00
|
|
|
return 0;
|
2012-03-26 21:53:48 +00:00
|
|
|
}
|
|
|
|
|
2011-01-24 06:33:50 +00:00
|
|
|
static unsigned int get_hw_revision(void)
|
|
|
|
{
|
|
|
|
int hwrev, mode0, mode1;
|
|
|
|
|
2012-03-26 21:53:48 +00:00
|
|
|
adc_power_control(1);
|
|
|
|
|
2011-01-24 06:33:50 +00:00
|
|
|
mode0 = get_adc_value(1); /* HWREV_MODE0 */
|
|
|
|
mode1 = get_adc_value(2); /* HWREV_MODE1 */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XXX Always set the default hwrev as the latest board
|
|
|
|
* ADC = (voltage) / 3.3 * 4096
|
|
|
|
*/
|
|
|
|
hwrev = 3;
|
|
|
|
|
|
|
|
#define IS_RANGE(x, min, max) ((x) > (min) && (x) < (max))
|
|
|
|
if (IS_RANGE(mode0, 80, 200) && IS_RANGE(mode1, 80, 200))
|
|
|
|
hwrev = 0x0; /* 0.01V 0.01V */
|
|
|
|
if (IS_RANGE(mode0, 750, 1000) && IS_RANGE(mode1, 80, 200))
|
|
|
|
hwrev = 0x1; /* 610mV 0.01V */
|
|
|
|
if (IS_RANGE(mode0, 1300, 1700) && IS_RANGE(mode1, 80, 200))
|
|
|
|
hwrev = 0x2; /* 1.16V 0.01V */
|
|
|
|
if (IS_RANGE(mode0, 2000, 2400) && IS_RANGE(mode1, 80, 200))
|
|
|
|
hwrev = 0x3; /* 1.79V 0.01V */
|
|
|
|
#undef IS_RANGE
|
|
|
|
|
|
|
|
debug("mode0: %d, mode1: %d, hwrev 0x%x\n", mode0, mode1, hwrev);
|
|
|
|
|
2012-03-26 21:53:48 +00:00
|
|
|
adc_power_control(0);
|
|
|
|
|
2011-01-24 06:33:50 +00:00
|
|
|
return hwrev;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void check_hw_revision(void)
|
|
|
|
{
|
|
|
|
int hwrev;
|
|
|
|
|
|
|
|
hwrev = get_hw_revision();
|
|
|
|
|
|
|
|
board_rev |= hwrev;
|
|
|
|
}
|
|
|
|
|
2011-12-15 09:32:12 +00:00
|
|
|
#ifdef CONFIG_USB_GADGET
|
|
|
|
static int s5pc210_phy_control(int on)
|
|
|
|
{
|
2017-01-09 05:47:50 +00:00
|
|
|
struct udevice *dev;
|
|
|
|
int ret;
|
|
|
|
u8 reg;
|
2011-12-15 09:32:12 +00:00
|
|
|
|
2017-01-09 05:47:50 +00:00
|
|
|
ret = pmic_get("max8998-pmic", &dev);
|
|
|
|
if (ret) {
|
|
|
|
puts("Failed to get MAX8998!\n");
|
|
|
|
return ret;
|
|
|
|
}
|
2011-12-15 09:32:12 +00:00
|
|
|
|
|
|
|
if (on) {
|
2017-01-09 05:47:50 +00:00
|
|
|
reg = pmic_reg_read(dev, MAX8998_REG_BUCK_ACTIVE_DISCHARGE3);
|
|
|
|
reg |= MAX8998_SAFEOUT1;
|
|
|
|
ret |= pmic_reg_write(dev,
|
|
|
|
MAX8998_REG_BUCK_ACTIVE_DISCHARGE3, reg);
|
|
|
|
|
|
|
|
reg = pmic_reg_read(dev, MAX8998_REG_ONOFF1);
|
|
|
|
reg |= MAX8998_LDO3;
|
|
|
|
ret |= pmic_reg_write(dev, MAX8998_REG_ONOFF1, reg);
|
|
|
|
|
|
|
|
reg = pmic_reg_read(dev, MAX8998_REG_ONOFF2);
|
|
|
|
reg |= MAX8998_LDO8;
|
|
|
|
ret |= pmic_reg_write(dev, MAX8998_REG_ONOFF2, reg);
|
2011-12-15 09:32:12 +00:00
|
|
|
|
|
|
|
} else {
|
2017-01-09 05:47:50 +00:00
|
|
|
reg = pmic_reg_read(dev, MAX8998_REG_ONOFF2);
|
|
|
|
reg &= ~MAX8998_LDO8;
|
|
|
|
ret |= pmic_reg_write(dev, MAX8998_REG_ONOFF2, reg);
|
|
|
|
|
|
|
|
reg = pmic_reg_read(dev, MAX8998_REG_ONOFF1);
|
|
|
|
reg &= ~MAX8998_LDO3;
|
|
|
|
ret |= pmic_reg_write(dev, MAX8998_REG_ONOFF1, reg);
|
|
|
|
|
|
|
|
reg = pmic_reg_read(dev, MAX8998_REG_BUCK_ACTIVE_DISCHARGE3);
|
|
|
|
reg &= ~MAX8998_SAFEOUT1;
|
|
|
|
ret |= pmic_reg_write(dev,
|
|
|
|
MAX8998_REG_BUCK_ACTIVE_DISCHARGE3, reg);
|
2011-12-15 09:32:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ret) {
|
|
|
|
puts("MAX8998 LDO setting error!\n");
|
2017-01-09 05:47:50 +00:00
|
|
|
return -EINVAL;
|
2011-12-15 09:32:12 +00:00
|
|
|
}
|
2017-01-09 05:47:50 +00:00
|
|
|
|
2011-12-15 09:32:12 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-12-04 01:23:29 +00:00
|
|
|
struct dwc2_plat_otg_data s5pc210_otg_data = {
|
2011-12-15 09:32:12 +00:00
|
|
|
.phy_control = s5pc210_phy_control,
|
|
|
|
.regs_phy = EXYNOS4_USBPHY_BASE,
|
|
|
|
.regs_otg = EXYNOS4_USBOTG_BASE,
|
|
|
|
.usb_phy_ctrl = EXYNOS4_USBPHY_CONTROL,
|
|
|
|
.usb_flags = PHY0_SLEEP,
|
|
|
|
};
|
|
|
|
#endif
|
2012-09-20 00:20:00 +00:00
|
|
|
|
2014-03-07 13:59:47 +00:00
|
|
|
int board_usb_init(int index, enum usb_init_type init)
|
|
|
|
{
|
|
|
|
debug("USB_udc_probe\n");
|
2015-12-04 01:26:33 +00:00
|
|
|
return dwc2_udc_probe(&s5pc210_otg_data);
|
2014-03-07 13:59:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int exynos_early_init_f(void)
|
2012-09-20 00:20:00 +00:00
|
|
|
{
|
|
|
|
wdt_stop();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2012-10-19 05:34:03 +00:00
|
|
|
|
2017-01-09 05:47:50 +00:00
|
|
|
static int init_pmic_lcd(void)
|
2012-10-19 05:34:07 +00:00
|
|
|
{
|
2017-01-09 05:47:50 +00:00
|
|
|
struct udevice *dev;
|
2012-10-19 05:34:07 +00:00
|
|
|
unsigned char val;
|
|
|
|
int ret = 0;
|
|
|
|
|
2017-01-09 05:47:50 +00:00
|
|
|
ret = pmic_get("max8998-pmic", &dev);
|
|
|
|
if (ret) {
|
|
|
|
puts("Failed to get MAX8998 for init_pmic_lcd()!\n");
|
|
|
|
return ret;
|
|
|
|
}
|
2012-10-19 05:34:07 +00:00
|
|
|
|
|
|
|
/* LDO7 1.8V */
|
|
|
|
val = 0x02; /* (1800 - 1600) / 100; */
|
2017-01-09 05:47:50 +00:00
|
|
|
ret |= pmic_reg_write(dev, MAX8998_REG_LDO7, val);
|
2012-10-19 05:34:07 +00:00
|
|
|
|
|
|
|
/* LDO17 3.0V */
|
|
|
|
val = 0xe; /* (3000 - 1600) / 100; */
|
2017-01-09 05:47:50 +00:00
|
|
|
ret |= pmic_reg_write(dev, MAX8998_REG_LDO17, val);
|
2012-10-19 05:34:07 +00:00
|
|
|
|
|
|
|
/* Disable unneeded regulators */
|
|
|
|
/*
|
|
|
|
* ONOFF1
|
|
|
|
* Buck1 ON, Buck2 OFF, Buck3 ON, Buck4 ON
|
|
|
|
* LDO2 ON, LDO3 OFF, LDO4 OFF, LDO5 ON
|
|
|
|
*/
|
|
|
|
val = 0xB9;
|
2017-01-09 05:47:50 +00:00
|
|
|
ret |= pmic_reg_write(dev, MAX8998_REG_ONOFF1, val);
|
2012-10-19 05:34:07 +00:00
|
|
|
|
|
|
|
/* ONOFF2
|
|
|
|
* LDO6 OFF, LDO7 ON, LDO8 OFF, LDO9 ON,
|
|
|
|
* LDO10 OFF, LDO11 OFF, LDO12 OFF, LDO13 OFF
|
|
|
|
*/
|
|
|
|
val = 0x50;
|
2017-01-09 05:47:50 +00:00
|
|
|
ret |= pmic_reg_write(dev, MAX8998_REG_ONOFF2, val);
|
2012-10-19 05:34:07 +00:00
|
|
|
|
|
|
|
/* ONOFF3
|
|
|
|
* LDO14 OFF, LDO15 OFF, LGO16 OFF, LDO17 OFF
|
|
|
|
* EPWRHOLD OFF, EBATTMON OFF, ELBCNFG2 OFF, ELBCNFG1 OFF
|
|
|
|
*/
|
|
|
|
val = 0x00;
|
2017-01-09 05:47:50 +00:00
|
|
|
ret |= pmic_reg_write(dev, MAX8998_REG_ONOFF3, val);
|
2012-10-19 05:34:07 +00:00
|
|
|
|
2017-01-09 05:47:50 +00:00
|
|
|
if (ret) {
|
2012-10-19 05:34:07 +00:00
|
|
|
puts("LCD pmic initialisation error!\n");
|
2017-01-09 05:47:50 +00:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2012-10-19 05:34:07 +00:00
|
|
|
}
|
|
|
|
|
2013-02-21 23:52:57 +00:00
|
|
|
void exynos_cfg_lcd_gpio(void)
|
2012-10-19 05:34:07 +00:00
|
|
|
{
|
|
|
|
unsigned int i, f3_end = 4;
|
|
|
|
|
|
|
|
for (i = 0; i < 8; i++) {
|
|
|
|
/* set GPF0,1,2[0:7] for RGB Interface and Data lines (32bit) */
|
2014-05-13 05:00:14 +00:00
|
|
|
gpio_cfg_pin(EXYNOS4_GPIO_F00 + i, S5P_GPIO_FUNC(2));
|
|
|
|
gpio_cfg_pin(EXYNOS4_GPIO_F10 + i, S5P_GPIO_FUNC(2));
|
|
|
|
gpio_cfg_pin(EXYNOS4_GPIO_F20 + i, S5P_GPIO_FUNC(2));
|
2012-10-19 05:34:07 +00:00
|
|
|
/* pull-up/down disable */
|
2014-05-13 05:00:14 +00:00
|
|
|
gpio_set_pull(EXYNOS4_GPIO_F00 + i, S5P_GPIO_PULL_NONE);
|
|
|
|
gpio_set_pull(EXYNOS4_GPIO_F10 + i, S5P_GPIO_PULL_NONE);
|
|
|
|
gpio_set_pull(EXYNOS4_GPIO_F20 + i, S5P_GPIO_PULL_NONE);
|
2012-10-19 05:34:07 +00:00
|
|
|
|
|
|
|
/* drive strength to max (24bit) */
|
2014-05-13 05:00:14 +00:00
|
|
|
gpio_set_drv(EXYNOS4_GPIO_F00 + i, S5P_GPIO_DRV_4X);
|
|
|
|
gpio_set_rate(EXYNOS4_GPIO_F00 + i, S5P_GPIO_DRV_SLOW);
|
|
|
|
gpio_set_drv(EXYNOS4_GPIO_F10 + i, S5P_GPIO_DRV_4X);
|
|
|
|
gpio_set_rate(EXYNOS4_GPIO_F10 + i, S5P_GPIO_DRV_SLOW);
|
|
|
|
gpio_set_drv(EXYNOS4_GPIO_F20 + i, S5P_GPIO_DRV_4X);
|
|
|
|
gpio_set_rate(EXYNOS4_GPIO_F00 + i, S5P_GPIO_DRV_SLOW);
|
2012-10-19 05:34:07 +00:00
|
|
|
}
|
|
|
|
|
2014-05-13 05:00:14 +00:00
|
|
|
for (i = EXYNOS4_GPIO_F30; i < (EXYNOS4_GPIO_F30 + f3_end); i++) {
|
2012-10-19 05:34:07 +00:00
|
|
|
/* set GPF3[0:3] for RGB Interface and Data lines (32bit) */
|
2014-05-13 05:00:14 +00:00
|
|
|
gpio_cfg_pin(i, S5P_GPIO_FUNC(2));
|
2012-10-19 05:34:07 +00:00
|
|
|
/* pull-up/down disable */
|
2014-05-13 05:00:14 +00:00
|
|
|
gpio_set_pull(i, S5P_GPIO_PULL_NONE);
|
2012-10-19 05:34:07 +00:00
|
|
|
/* drive strength to max (24bit) */
|
2014-05-13 05:00:14 +00:00
|
|
|
gpio_set_drv(i, S5P_GPIO_DRV_4X);
|
|
|
|
gpio_set_rate(i, S5P_GPIO_DRV_SLOW);
|
2012-10-19 05:34:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* gpio pad configuration for LCD reset. */
|
2014-10-21 01:48:39 +00:00
|
|
|
gpio_request(EXYNOS4_GPIO_Y45, "lcd_reset");
|
2014-05-13 05:00:14 +00:00
|
|
|
gpio_cfg_pin(EXYNOS4_GPIO_Y45, S5P_GPIO_OUTPUT);
|
2012-10-19 05:34:07 +00:00
|
|
|
}
|
|
|
|
|
2014-03-07 13:59:47 +00:00
|
|
|
int mipi_power(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-02-21 23:52:57 +00:00
|
|
|
void exynos_reset_lcd(void)
|
2012-10-19 05:34:07 +00:00
|
|
|
{
|
2014-05-13 05:00:14 +00:00
|
|
|
gpio_set_value(EXYNOS4_GPIO_Y45, 1);
|
2012-10-19 05:34:07 +00:00
|
|
|
udelay(10000);
|
2014-05-13 05:00:14 +00:00
|
|
|
gpio_set_value(EXYNOS4_GPIO_Y45, 0);
|
2012-10-19 05:34:07 +00:00
|
|
|
udelay(10000);
|
2014-05-13 05:00:14 +00:00
|
|
|
gpio_set_value(EXYNOS4_GPIO_Y45, 1);
|
2012-10-19 05:34:07 +00:00
|
|
|
udelay(100);
|
|
|
|
}
|
|
|
|
|
2013-02-21 23:52:57 +00:00
|
|
|
void exynos_lcd_power_on(void)
|
2012-10-19 05:34:07 +00:00
|
|
|
{
|
2017-01-09 05:47:50 +00:00
|
|
|
struct udevice *dev;
|
|
|
|
int ret;
|
|
|
|
u8 reg;
|
2012-10-19 05:34:07 +00:00
|
|
|
|
2017-01-09 05:47:50 +00:00
|
|
|
ret = pmic_get("max8998-pmic", &dev);
|
|
|
|
if (ret) {
|
|
|
|
puts("Failed to get MAX8998!\n");
|
2012-12-10 13:43:57 +00:00
|
|
|
return;
|
2017-01-09 05:47:50 +00:00
|
|
|
}
|
2012-12-10 13:43:57 +00:00
|
|
|
|
2017-01-09 05:47:50 +00:00
|
|
|
reg = pmic_reg_read(dev, MAX8998_REG_ONOFF3);
|
|
|
|
reg |= MAX8998_LDO17;
|
|
|
|
ret = pmic_reg_write(dev, MAX8998_REG_ONOFF3, reg);
|
|
|
|
if (ret) {
|
|
|
|
puts("MAX8998 LDO setting error\n");
|
2012-10-19 05:34:07 +00:00
|
|
|
return;
|
2017-01-09 05:47:50 +00:00
|
|
|
}
|
2012-10-19 05:34:07 +00:00
|
|
|
|
2017-01-09 05:47:50 +00:00
|
|
|
reg = pmic_reg_read(dev, MAX8998_REG_ONOFF2);
|
|
|
|
reg |= MAX8998_LDO7;
|
|
|
|
ret = pmic_reg_write(dev, MAX8998_REG_ONOFF2, reg);
|
|
|
|
if (ret) {
|
|
|
|
puts("MAX8998 LDO setting error\n");
|
|
|
|
return;
|
|
|
|
}
|
2012-10-19 05:34:07 +00:00
|
|
|
}
|
|
|
|
|
2013-02-21 23:52:57 +00:00
|
|
|
void exynos_cfg_ldo(void)
|
|
|
|
{
|
|
|
|
ld9040_cfg_ldo();
|
|
|
|
}
|
|
|
|
|
|
|
|
void exynos_enable_ldo(unsigned int onoff)
|
|
|
|
{
|
|
|
|
ld9040_enable_ldo(onoff);
|
|
|
|
}
|
|
|
|
|
2014-03-07 13:59:47 +00:00
|
|
|
int exynos_init(void)
|
2012-10-19 05:34:03 +00:00
|
|
|
{
|
|
|
|
gd->bd->bi_arch_number = MACH_TYPE_UNIVERSAL_C210;
|
2014-03-07 13:59:47 +00:00
|
|
|
|
|
|
|
switch (get_hwrev()) {
|
|
|
|
case 0:
|
|
|
|
/*
|
|
|
|
* Set the low to enable LDO_EN
|
|
|
|
* But when you use the test board for eMMC booting
|
|
|
|
* you should set it HIGH since it removes the inverter
|
|
|
|
*/
|
|
|
|
/* MASSMEMORY_EN: XMDMDATA_6: GPE3[6] */
|
2014-10-21 01:48:39 +00:00
|
|
|
gpio_request(EXYNOS4_GPIO_E36, "ldo_en");
|
2014-05-13 05:00:14 +00:00
|
|
|
gpio_direction_output(EXYNOS4_GPIO_E36, 0);
|
2014-03-07 13:59:47 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/*
|
|
|
|
* Default reset state is High and there's no inverter
|
|
|
|
* But set it as HIGH to ensure
|
|
|
|
*/
|
|
|
|
/* MASSMEMORY_EN: XMDMADDR_3: GPE1[3] */
|
2014-10-21 01:48:39 +00:00
|
|
|
gpio_request(EXYNOS4_GPIO_E13, "massmemory_en");
|
2014-05-13 05:00:14 +00:00
|
|
|
gpio_direction_output(EXYNOS4_GPIO_E13, 1);
|
2014-03-07 13:59:47 +00:00
|
|
|
break;
|
|
|
|
}
|
2012-10-19 05:34:03 +00:00
|
|
|
|
|
|
|
check_hw_revision();
|
|
|
|
printf("HW Revision:\t0x%x\n", board_rev);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2014-01-22 10:24:12 +00:00
|
|
|
|
2016-02-22 04:08:54 +00:00
|
|
|
#ifdef CONFIG_LCD
|
2014-03-07 13:59:47 +00:00
|
|
|
void exynos_lcd_misc_init(vidinfo_t *vid)
|
2014-01-22 10:24:12 +00:00
|
|
|
{
|
2014-03-07 13:59:47 +00:00
|
|
|
#ifdef CONFIG_TIZEN
|
|
|
|
get_tizen_logo_info(vid);
|
2014-01-22 10:24:12 +00:00
|
|
|
#endif
|
2014-03-07 13:59:47 +00:00
|
|
|
|
|
|
|
/* for LD9040. */
|
|
|
|
vid->pclk_name = 1; /* MPLL */
|
|
|
|
vid->sclk_div = 1;
|
|
|
|
|
|
|
|
setenv("lcdinfo", "lcd=ld9040");
|
2014-01-22 10:24:12 +00:00
|
|
|
}
|
2016-02-22 04:08:54 +00:00
|
|
|
#endif
|