summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
Diffstat (limited to 'board')
-rw-r--r--board/buffalo/lsxl/lsxl.c3
-rw-r--r--board/compulab/cm_fx6/cm_fx6.c183
-rw-r--r--board/nvidia/common/board.c3
-rw-r--r--board/raspberrypi/rpi_b/rpi_b.c11
-rw-r--r--board/renesas/sh7752evb/sh7752evb.c1
-rw-r--r--board/renesas/sh7753evb/sh7753evb.c1
-rw-r--r--board/renesas/sh7757lcr/sh7757lcr.c1
-rw-r--r--board/samsung/arndale/arndale.c4
-rw-r--r--board/samsung/common/board.c5
-rw-r--r--board/samsung/common/misc.c3
-rw-r--r--board/samsung/goni/goni.c14
-rw-r--r--board/samsung/origen/origen.c2
-rw-r--r--board/samsung/smdk5250/exynos5-dt.c7
-rw-r--r--board/samsung/smdk5420/smdk5420.c6
-rw-r--r--board/samsung/smdkc100/smdkc100.c2
-rw-r--r--board/samsung/smdkv310/smdkv310.c2
-rw-r--r--board/samsung/trats/trats.c17
-rw-r--r--board/samsung/trats2/trats2.c27
-rw-r--r--board/samsung/universal_c210/universal.c56
19 files changed, 227 insertions, 121 deletions
diff --git a/board/buffalo/lsxl/lsxl.c b/board/buffalo/lsxl/lsxl.c
index 659a124b22..c1cb07b278 100644
--- a/board/buffalo/lsxl/lsxl.c
+++ b/board/buffalo/lsxl/lsxl.c
@@ -13,11 +13,12 @@
#include <malloc.h>
#include <netdev.h>
#include <miiphy.h>
+#include <spi.h>
+#include <spi_flash.h>
#include <asm/arch/kirkwood.h>
#include <asm/arch/cpu.h>
#include <asm/arch/mpp.h>
#include <asm/arch/gpio.h>
-#include <spi_flash.h>
#include "lsxl.h"
diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
index fdb8ebf9e7..f77ff48a1c 100644
--- a/board/compulab/cm_fx6/cm_fx6.c
+++ b/board/compulab/cm_fx6/cm_fx6.c
@@ -9,11 +9,13 @@
*/
#include <common.h>
+#include <dm.h>
#include <fsl_esdhc.h>
#include <miiphy.h>
#include <netdev.h>
#include <fdt_support.h>
#include <sata.h>
+#include <serial_mxc.h>
#include <asm/arch/crm_regs.h>
#include <asm/arch/sys_proto.h>
#include <asm/arch/iomux.h>
@@ -69,16 +71,23 @@ static iomux_v3_cfg_t const sata_pads[] = {
IOMUX_PADS(PAD_EIM_BCLK__GPIO6_IO31 | MUX_PAD_CTRL(NO_PAD_CTRL)),
};
-static void cm_fx6_setup_issd(void)
+static int cm_fx6_setup_issd(void)
{
+ int ret, i;
+
SETUP_IOMUX_PADS(sata_pads);
- /* Make sure this gpio has logical 0 value */
- gpio_direction_output(CM_FX6_SATA_PWLOSS_INT, 0);
- udelay(100);
- cm_fx6_sata_power(0);
- mdelay(250);
- cm_fx6_sata_power(1);
+ for (i = 0; i < ARRAY_SIZE(cm_fx6_issd_gpios); i++) {
+ ret = gpio_request(cm_fx6_issd_gpios[i], "sata");
+ if (ret)
+ return ret;
+ }
+
+ ret = gpio_request(CM_FX6_SATA_PWLOSS_INT, "sata_pwloss_int");
+ if (ret)
+ return ret;
+
+ return 0;
}
#define CM_FX6_SATA_INIT_RETRIES 10
@@ -86,7 +95,14 @@ int sata_initialize(void)
{
int err, i;
- cm_fx6_setup_issd();
+ /* Make sure this gpio has logical 0 value */
+ gpio_direction_output(CM_FX6_SATA_PWLOSS_INT, 0);
+ udelay(100);
+
+ cm_fx6_sata_power(0);
+ mdelay(250);
+ cm_fx6_sata_power(1);
+
for (i = 0; i < CM_FX6_SATA_INIT_RETRIES; i++) {
err = setup_sata();
if (err) {
@@ -109,6 +125,8 @@ int sata_initialize(void)
return err;
}
+#else
+static int cm_fx6_setup_issd(void) { return 0; }
#endif
#ifdef CONFIG_SYS_I2C_MXC
@@ -141,49 +159,68 @@ I2C_PADS(i2c2_pads,
IMX_GPIO_NR(1, 6));
-static void cm_fx6_setup_i2c(void)
+static int cm_fx6_setup_one_i2c(int busnum, struct i2c_pads_info *pads)
+{
+ int ret;
+
+ ret = setup_i2c(busnum, CONFIG_SYS_I2C_SPEED, 0x7f, pads);
+ if (ret)
+ printf("Warning: I2C%d setup failed: %d\n", busnum, ret);
+
+ return ret;
+}
+
+static int cm_fx6_setup_i2c(void)
{
- setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, I2C_PADS_INFO(i2c0_pads));
- setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, I2C_PADS_INFO(i2c1_pads));
- setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, I2C_PADS_INFO(i2c2_pads));
+ int ret = 0, err;
+
+ /* i2c<x>_pads are wierd macro variables; we can't use an array */
+ err = cm_fx6_setup_one_i2c(0, I2C_PADS_INFO(i2c0_pads));
+ if (err)
+ ret = err;
+ err = cm_fx6_setup_one_i2c(1, I2C_PADS_INFO(i2c1_pads));
+ if (err)
+ ret = err;
+ err = cm_fx6_setup_one_i2c(2, I2C_PADS_INFO(i2c2_pads));
+ if (err)
+ ret = err;
+
+ return ret;
}
#else
-static void cm_fx6_setup_i2c(void) { }
+static int cm_fx6_setup_i2c(void) { return 0; }
#endif
#ifdef CONFIG_USB_EHCI_MX6
#define WEAK_PULLDOWN (PAD_CTL_PUS_100K_DOWN | \
PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \
PAD_CTL_HYS | PAD_CTL_SRE_SLOW)
+#define MX6_USBNC_BASEADDR 0x2184800
+#define USBNC_USB_H1_PWR_POL (1 << 9)
-static int cm_fx6_usb_hub_reset(void)
+static int cm_fx6_setup_usb_host(void)
{
int err;
err = gpio_request(CM_FX6_USB_HUB_RST, "usb hub rst");
- if (err) {
- printf("USB hub rst gpio request failed: %d\n", err);
- return -1;
- }
+ if (err)
+ return err;
+ SETUP_IOMUX_PAD(PAD_GPIO_0__USB_H1_PWR | MUX_PAD_CTRL(NO_PAD_CTRL));
SETUP_IOMUX_PAD(PAD_SD3_RST__GPIO7_IO08 | MUX_PAD_CTRL(NO_PAD_CTRL));
- gpio_direction_output(CM_FX6_USB_HUB_RST, 0);
- udelay(10);
- gpio_direction_output(CM_FX6_USB_HUB_RST, 1);
- mdelay(1);
return 0;
}
-static int cm_fx6_init_usb_otg(void)
+static int cm_fx6_setup_usb_otg(void)
{
- int ret;
+ int err;
struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
- ret = gpio_request(SB_FX6_USB_OTG_PWR, "usb-pwr");
- if (ret) {
- printf("USB OTG pwr gpio request failed: %d\n", ret);
- return ret;
+ err = gpio_request(SB_FX6_USB_OTG_PWR, "usb-pwr");
+ if (err) {
+ printf("USB OTG pwr gpio request failed: %d\n", err);
+ return err;
}
SETUP_IOMUX_PAD(PAD_EIM_D22__GPIO3_IO22 | MUX_PAD_CTRL(NO_PAD_CTRL));
@@ -194,25 +231,27 @@ static int cm_fx6_init_usb_otg(void)
return gpio_direction_output(SB_FX6_USB_OTG_PWR, 0);
}
-#define MX6_USBNC_BASEADDR 0x2184800
-#define USBNC_USB_H1_PWR_POL (1 << 9)
int board_ehci_hcd_init(int port)
{
+ int ret;
u32 *usbnc_usb_uh1_ctrl = (u32 *)(MX6_USBNC_BASEADDR + 4);
- switch (port) {
- case 0:
- return cm_fx6_init_usb_otg();
- case 1:
- SETUP_IOMUX_PAD(PAD_GPIO_0__USB_H1_PWR |
- MUX_PAD_CTRL(NO_PAD_CTRL));
+ /* Only 1 host controller in use. port 0 is OTG & needs no attention */
+ if (port != 1)
+ return 0;
- /* Set PWR polarity to match power switch's enable polarity */
- setbits_le32(usbnc_usb_uh1_ctrl, USBNC_USB_H1_PWR_POL);
- return cm_fx6_usb_hub_reset();
- default:
- break;
- }
+ /* Set PWR polarity to match power switch's enable polarity */
+ setbits_le32(usbnc_usb_uh1_ctrl, USBNC_USB_H1_PWR_POL);
+ ret = gpio_direction_output(CM_FX6_USB_HUB_RST, 0);
+ if (ret)
+ return ret;
+
+ udelay(10);
+ ret = gpio_direction_output(CM_FX6_USB_HUB_RST, 1);
+ if (ret)
+ return ret;
+
+ mdelay(1);
return 0;
}
@@ -224,6 +263,9 @@ int board_ehci_power(int port, int on)
return 0;
}
+#else
+static int cm_fx6_setup_usb_otg(void) { return 0; }
+static int cm_fx6_setup_usb_host(void) { return 0; }
#endif
#ifdef CONFIG_FEC_MXC
@@ -318,12 +360,17 @@ static int handle_mac_address(void)
int board_eth_init(bd_t *bis)
{
- int res = handle_mac_address();
- if (res)
+ int err;
+
+ err = handle_mac_address();
+ if (err)
puts("No MAC address found\n");
SETUP_IOMUX_PADS(enet_pads);
/* phy reset */
+ err = gpio_request(CM_FX6_ENET_NRST, "enet_nrst");
+ if (err)
+ printf("Etnernet NRST gpio request failed: %d\n", err);
gpio_direction_output(CM_FX6_ENET_NRST, 0);
udelay(500);
gpio_set_value(CM_FX6_ENET_NRST, 1);
@@ -394,6 +441,16 @@ int board_mmc_init(bd_t *bis)
}
#endif
+#ifdef CONFIG_MXC_SPI
+int cm_fx6_setup_ecspi(void)
+{
+ cm_fx6_set_ecspi_iomux();
+ return gpio_request(CM_FX6_ECSPI_BUS0_CS0, "ecspi_bus0_cs0");
+}
+#else
+int cm_fx6_setup_ecspi(void) { return 0; }
+#endif
+
#ifdef CONFIG_OF_BOARD_SETUP
void ft_board_setup(void *blob, bd_t *bd)
{
@@ -409,9 +466,37 @@ void ft_board_setup(void *blob, bd_t *bd)
int board_init(void)
{
+ int ret;
+
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
cm_fx6_setup_gpmi_nand();
- cm_fx6_setup_i2c();
+
+ ret = cm_fx6_setup_ecspi();
+ if (ret)
+ printf("Warning: ECSPI setup failed: %d\n", ret);
+
+ ret = cm_fx6_setup_usb_otg();
+ if (ret)
+ printf("Warning: USB OTG setup failed: %d\n", ret);
+
+ ret = cm_fx6_setup_usb_host();
+ if (ret)
+ printf("Warning: USB host setup failed: %d\n", ret);
+
+ /*
+ * cm-fx6 may have iSSD not assembled and in this case it has
+ * bypasses for a (m)SATA socket on the baseboard. The socketed
+ * device is not controlled by those GPIOs. So just print a warning
+ * if the setup fails.
+ */
+ ret = cm_fx6_setup_issd();
+ if (ret)
+ printf("Warning: iSSD setup failed: %d\n", ret);
+
+ /* Warn on failure but do not abort boot */
+ ret = cm_fx6_setup_i2c();
+ if (ret)
+ printf("Warning: I2C setup failed: %d\n", ret);
return 0;
}
@@ -481,3 +566,11 @@ u32 get_board_rev(void)
return cl_eeprom_get_board_rev();
}
+static struct mxc_serial_platdata cm_fx6_mxc_serial_plat = {
+ .reg = (struct mxc_uart *)UART4_BASE,
+};
+
+U_BOOT_DEVICE(cm_fx6_serial) = {
+ .name = "serial_mxc",
+ .platdata = &cm_fx6_mxc_serial_plat,
+};
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index d01abcee13..03f055dad2 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -114,9 +114,8 @@ int board_init(void)
clock_init();
clock_verify();
-#ifdef CONFIG_FDT_SPI
+#ifdef CONFIG_TEGRA_SPI
pin_mux_spi();
- spi_init();
#endif
#ifdef CONFIG_PWM_TEGRA
diff --git a/board/raspberrypi/rpi_b/rpi_b.c b/board/raspberrypi/rpi_b/rpi_b.c
index 220bb90dc1..447c940f63 100644
--- a/board/raspberrypi/rpi_b/rpi_b.c
+++ b/board/raspberrypi/rpi_b/rpi_b.c
@@ -16,15 +16,26 @@
#include <common.h>
#include <config.h>
+#include <dm.h>
#include <fdt_support.h>
#include <lcd.h>
#include <mmc.h>
+#include <asm/gpio.h>
#include <asm/arch/mbox.h>
#include <asm/arch/sdhci.h>
#include <asm/global_data.h>
DECLARE_GLOBAL_DATA_PTR;
+static const struct bcm2835_gpio_platdata gpio_platdata = {
+ .base = BCM2835_GPIO_BASE,
+};
+
+U_BOOT_DEVICE(bcm2835_gpios) = {
+ .name = "gpio_bcm2835",
+ .platdata = &gpio_platdata,
+};
+
struct msg_get_arm_mem {
struct bcm2835_mbox_hdr hdr;
struct bcm2835_mbox_tag_get_arm_mem get_arm_mem;
diff --git a/board/renesas/sh7752evb/sh7752evb.c b/board/renesas/sh7752evb/sh7752evb.c
index 5eedbf8ce6..3aad532367 100644
--- a/board/renesas/sh7752evb/sh7752evb.c
+++ b/board/renesas/sh7752evb/sh7752evb.c
@@ -9,6 +9,7 @@
#include <asm/processor.h>
#include <asm/io.h>
#include <asm/mmc.h>
+#include <spi.h>
#include <spi_flash.h>
int checkboard(void)
diff --git a/board/renesas/sh7753evb/sh7753evb.c b/board/renesas/sh7753evb/sh7753evb.c
index 42b920fb33..9f6494561c 100644
--- a/board/renesas/sh7753evb/sh7753evb.c
+++ b/board/renesas/sh7753evb/sh7753evb.c
@@ -9,6 +9,7 @@
#include <asm/processor.h>
#include <asm/io.h>
#include <asm/mmc.h>
+#include <spi.h>
#include <spi_flash.h>
int checkboard(void)
diff --git a/board/renesas/sh7757lcr/sh7757lcr.c b/board/renesas/sh7757lcr/sh7757lcr.c
index 1464f48b43..ddcf275f6e 100644
--- a/board/renesas/sh7757lcr/sh7757lcr.c
+++ b/board/renesas/sh7757lcr/sh7757lcr.c
@@ -9,6 +9,7 @@
#include <asm/processor.h>
#include <asm/io.h>
#include <asm/mmc.h>
+#include <spi.h>
#include <spi_flash.h>
int checkboard(void)
diff --git a/board/samsung/arndale/arndale.c b/board/samsung/arndale/arndale.c
index 83fd3bd754..881d080522 100644
--- a/board/samsung/arndale/arndale.c
+++ b/board/samsung/arndale/arndale.c
@@ -6,9 +6,9 @@
#include <common.h>
#include <usb.h>
+#include <asm/gpio.h>
#include <asm/arch/pinmux.h>
#include <asm/arch/dwmmc.h>
-#include <asm/arch/gpio.h>
#include <asm/arch/power.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -19,6 +19,8 @@ int board_usb_init(int index, enum usb_init_type init)
/* Configure gpios for usb 3503 hub:
* disconnect, toggle reset and connect
*/
+ gpio_request(EXYNOS5_GPIO_D17, "usb_connect");
+ gpio_request(EXYNOS5_GPIO_X35, "usb_reset");
gpio_direction_output(EXYNOS5_GPIO_D17, 0);
gpio_direction_output(EXYNOS5_GPIO_X35, 0);
diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 5c3c5bb925..e1fc123fcc 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -13,10 +13,10 @@
#include <tmu.h>
#include <netdev.h>
#include <asm/io.h>
+#include <asm/gpio.h>
#include <asm/arch/board.h>
#include <asm/arch/cpu.h>
#include <asm/arch/dwmmc.h>
-#include <asm/arch/gpio.h>
#include <asm/arch/mmc.h>
#include <asm/arch/pinmux.h>
#include <asm/arch/power.h>
@@ -87,9 +87,6 @@ int board_init(void)
boot_temp_check();
#endif
-#ifdef CONFIG_EXYNOS_SPI
- spi_init();
-#endif
return exynos_init();
}
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index 8766f0ca06..4538ac7f2a 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -14,7 +14,6 @@
#include <malloc.h>
#include <linux/sizes.h>
#include <asm/arch/cpu.h>
-#include <asm/arch/gpio.h>
#include <asm/gpio.h>
#include <linux/input.h>
#include <power/pmic.h>
@@ -412,6 +411,8 @@ void check_boot_mode(void)
void keys_init(void)
{
/* Set direction to input */
+ gpio_request(KEY_VOL_UP_GPIO, "volume-up");
+ gpio_request(KEY_VOL_DOWN_GPIO, "volume-down");
gpio_direction_input(KEY_VOL_UP_GPIO);
gpio_direction_input(KEY_VOL_DOWN_GPIO);
}
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index eb0f9bffae..58cf96eaa8 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -7,7 +7,7 @@
*/
#include <common.h>
-#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
#include <asm/arch/mmc.h>
#include <power/pmic.h>
#include <usb/s3c_udc.h>
@@ -33,6 +33,16 @@ int board_init(void)
return 0;
}
+#ifdef CONFIG_SYS_I2C_INIT_BOARD
+void i2c_init_board(void)
+{
+ gpio_request(S5PC110_GPIO_J43, "i2c_clk");
+ gpio_request(S5PC110_GPIO_J40, "i2c_data");
+ gpio_direction_output(S5PC110_GPIO_J43, 1);
+ gpio_direction_output(S5PC110_GPIO_J40, 1);
+}
+#endif
+
int power_init_board(void)
{
int ret;
@@ -80,6 +90,7 @@ int board_mmc_init(bd_t *bis)
int i, ret, ret_sd = 0;
/* MASSMEMORY_EN: XMSMDATA7: GPJ2[7] output high */
+ gpio_request(S5PC110_GPIO_J27, "massmemory_en");
gpio_direction_output(S5PC110_GPIO_J27, 1);
/*
@@ -108,6 +119,7 @@ int board_mmc_init(bd_t *bis)
* SD card (T_FLASH) detect and init
* T_FLASH_DETECT: EINT28: GPH3[4] input mode
*/
+ gpio_request(S5PC110_GPIO_H34, "t_flash_detect");
gpio_cfg_pin(S5PC110_GPIO_H34, S5P_GPIO_INPUT);
gpio_set_pull(S5PC110_GPIO_H34, S5P_GPIO_PULL_UP);
diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c
index a539267a1c..99a2facd1e 100644
--- a/board/samsung/origen/origen.c
+++ b/board/samsung/origen/origen.c
@@ -6,8 +6,8 @@
#include <common.h>
#include <asm/io.h>
+#include <asm/gpio.h>
#include <asm/arch/cpu.h>
-#include <asm/arch/gpio.h>
#include <asm/arch/mmc.h>
#include <asm/arch/periph.h>
#include <asm/arch/pinmux.h>
diff --git a/board/samsung/smdk5250/exynos5-dt.c b/board/samsung/smdk5250/exynos5-dt.c
index d6ce1337b9..53ff7061d7 100644
--- a/board/samsung/smdk5250/exynos5-dt.c
+++ b/board/samsung/smdk5250/exynos5-dt.c
@@ -29,6 +29,7 @@ DECLARE_GLOBAL_DATA_PTR;
static void board_enable_audio_codec(void)
{
/* Enable MAX98095 Codec */
+ gpio_request(EXYNOS5_GPIO_X17, "max98095_enable");
gpio_direction_output(EXYNOS5_GPIO_X17, 1);
gpio_set_pull(EXYNOS5_GPIO_X17, S5P_GPIO_PULL_NONE);
}
@@ -199,16 +200,19 @@ static int board_dp_bridge_setup(void)
/* Setup the GPIOs */
/* PD is ACTIVE_LOW, and initially de-asserted */
+ gpio_request(EXYNOS5_GPIO_Y25, "dp_bridge_pd");
gpio_set_pull(EXYNOS5_GPIO_Y25, S5P_GPIO_PULL_NONE);
gpio_direction_output(EXYNOS5_GPIO_Y25, 1);
/* Reset is ACTIVE_LOW */
+ gpio_request(EXYNOS5_GPIO_X15, "dp_bridge_reset");
gpio_set_pull(EXYNOS5_GPIO_X15, S5P_GPIO_PULL_NONE);
gpio_direction_output(EXYNOS5_GPIO_X15, 0);
udelay(10);
gpio_set_value(EXYNOS5_GPIO_X15, 1);
+ gpio_request(EXYNOS5_GPIO_X07, "dp_bridge_hpd");
gpio_direction_input(EXYNOS5_GPIO_X07);
/*
@@ -236,10 +240,12 @@ static int board_dp_bridge_setup(void)
void exynos_cfg_lcd_gpio(void)
{
/* For Backlight */
+ gpio_request(EXYNOS5_GPIO_B20, "lcd_backlight");
gpio_cfg_pin(EXYNOS5_GPIO_B20, S5P_GPIO_OUTPUT);
gpio_set_value(EXYNOS5_GPIO_B20, 1);
/* LCD power on */
+ gpio_request(EXYNOS5_GPIO_X15, "lcd_power");
gpio_cfg_pin(EXYNOS5_GPIO_X15, S5P_GPIO_OUTPUT);
gpio_set_value(EXYNOS5_GPIO_X15, 1);
@@ -276,6 +282,7 @@ void exynos_backlight_on(unsigned int on)
mdelay(10);
/* board_dp_backlight_en */
+ gpio_request(EXYNOS5_GPIO_X30, "board_dp_backlight_en");
gpio_direction_output(EXYNOS5_GPIO_X30, 1);
#endif
}
diff --git a/board/samsung/smdk5420/smdk5420.c b/board/samsung/smdk5420/smdk5420.c
index 270ee834e6..a691222b8b 100644
--- a/board/samsung/smdk5420/smdk5420.c
+++ b/board/samsung/smdk5420/smdk5420.c
@@ -11,9 +11,9 @@
#include <lcd.h>
#include <spi.h>
#include <errno.h>
+#include <asm/gpio.h>
#include <asm/arch/board.h>
#include <asm/arch/cpu.h>
-#include <asm/arch/gpio.h>
#include <asm/arch/pinmux.h>
#include <asm/arch/system.h>
#include <asm/arch/dp_info.h>
@@ -74,9 +74,12 @@ void exynos_lcd_power_on(void)
mdelay(5);
/* TODO(ajaykumar.rs@samsung.com): Use device tree */
+ gpio_request(EXYNOS5420_GPIO_X35, "edp_slp#");
gpio_direction_output(EXYNOS5420_GPIO_X35, 1); /* EDP_SLP# */
mdelay(10);
+ gpio_request(EXYNOS5420_GPIO_Y77, "edp_rst#");
gpio_direction_output(EXYNOS5420_GPIO_Y77, 1); /* EDP_RST# */
+ gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
gpio_direction_input(EXYNOS5420_GPIO_X26); /* EDP_HPD */
gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
@@ -88,6 +91,7 @@ void exynos_lcd_power_on(void)
void exynos_backlight_on(unsigned int onoff)
{
/* For PWM */
+ gpio_request(EXYNOS5420_GPIO_B20, "backlight_on");
gpio_cfg_pin(EXYNOS5420_GPIO_B20, S5P_GPIO_FUNC(0x1));
gpio_set_value(EXYNOS5420_GPIO_B20, 1);
diff --git a/board/samsung/smdkc100/smdkc100.c b/board/samsung/smdkc100/smdkc100.c
index e009564a59..66b6a9801f 100644
--- a/board/samsung/smdkc100/smdkc100.c
+++ b/board/samsung/smdkc100/smdkc100.c
@@ -7,9 +7,9 @@
*/
#include <common.h>
+#include <asm/gpio.h>
#include <asm/io.h>
#include <asm/arch/sromc.h>
-#include <asm/arch/gpio.h>
#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/samsung/smdkv310/smdkv310.c b/board/samsung/smdkv310/smdkv310.c
index 8eca358981..cb7f9b0ac8 100644
--- a/board/samsung/smdkv310/smdkv310.c
+++ b/board/samsung/smdkv310/smdkv310.c
@@ -5,10 +5,10 @@
*/
#include <common.h>
+#include <asm/gpio.h>
#include <asm/io.h>
#include <netdev.h>
#include <asm/arch/cpu.h>
-#include <asm/arch/gpio.h>
#include <asm/arch/mmc.h>
#include <asm/arch/periph.h>
#include <asm/arch/pinmux.h>
diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index 3dd340b7d8..e163e45a58 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -10,8 +10,8 @@
#include <common.h>
#include <lcd.h>
#include <asm/io.h>
+#include <asm/gpio.h>
#include <asm/arch/cpu.h>
-#include <asm/arch/gpio.h>
#include <asm/arch/pinmux.h>
#include <asm/arch/clock.h>
#include <asm/arch/mipi_dsim.h>
@@ -63,6 +63,8 @@ void i2c_init_board(void)
}
/* I2C_8 -> FG */
+ gpio_request(EXYNOS4_GPIO_Y40, "i2c_clk");
+ gpio_request(EXYNOS4_GPIO_Y41, "i2c_data");
gpio_direction_output(EXYNOS4_GPIO_Y40, 1);
gpio_direction_output(EXYNOS4_GPIO_Y41, 1);
}
@@ -346,12 +348,17 @@ int exynos_power_init(void)
static unsigned int get_hw_revision(void)
{
int hwrev = 0;
+ char str[10];
int i;
/* hw_rev[3:0] == GPE1[3:0] */
- for (i = EXYNOS4_GPIO_E10; i < EXYNOS4_GPIO_E14; i++) {
- gpio_cfg_pin(i, S5P_GPIO_INPUT);
- gpio_set_pull(i, S5P_GPIO_PULL_NONE);
+ for (i = 0; i < 4; i++) {
+ int pin = i + EXYNOS4_GPIO_E10;
+
+ sprintf(str, "hw_rev%d", i);
+ gpio_request(pin, str);
+ gpio_cfg_pin(pin, S5P_GPIO_INPUT);
+ gpio_set_pull(pin, S5P_GPIO_PULL_NONE);
}
udelay(1);
@@ -517,6 +524,7 @@ static void board_power_init(void)
static void exynos_uart_init(void)
{
/* UART_SEL GPY4[7] (part2) at EXYNOS4 */
+ gpio_request(EXYNOS4_GPIO_Y47, "uart_sel");
gpio_set_pull(EXYNOS4_GPIO_Y47, S5P_GPIO_PULL_UP);
gpio_direction_output(EXYNOS4_GPIO_Y47, 1);
}
@@ -534,6 +542,7 @@ int exynos_early_init_f(void)
void exynos_reset_lcd(void)
{
+ gpio_request(EXYNOS4_GPIO_Y45, "lcd_reset");
gpio_direction_output(EXYNOS4_GPIO_Y45, 1);
udelay(10000);
gpio_direction_output(EXYNOS4_GPIO_Y45, 0);
diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c
index fa26e61244..a7377497e5 100644
--- a/board/samsung/trats2/trats2.c
+++ b/board/samsung/trats2/trats2.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <lcd.h>
+#include <asm/gpio.h>
#include <asm/arch/pinmux.h>
#include <asm/arch/power.h>
#include <asm/arch/mipi_dsim.h>
@@ -32,6 +33,7 @@ static inline u32 get_model_rev(void);
static void check_hw_revision(void)
{
int modelrev = 0;
+ char str[12];
int i;
/*
@@ -40,13 +42,22 @@ static void check_hw_revision(void)
* TRM say that it may cause unexcepted state and leakage current.
* and pull-none is only for output function.
*/
- for (i = EXYNOS4X12_GPIO_M10; i < EXYNOS4X12_GPIO_M12; i++)
- gpio_cfg_pin(i, S5P_GPIO_INPUT);
+ for (i = 0; i < 2; i++) {
+ int pin = i + EXYNOS4X12_GPIO_M10;
+
+ sprintf(str, "model_rev%d", i);
+ gpio_request(pin, str);
+ gpio_cfg_pin(pin, S5P_GPIO_INPUT);
+ }
/* GPM1[5:2]: HW_REV[3:0] */
- for (i = EXYNOS4X12_GPIO_M12; i < EXYNOS4X12_GPIO_M16; i++) {
- gpio_cfg_pin(i, S5P_GPIO_INPUT);
- gpio_set_pull(i, S5P_GPIO_PULL_NONE);
+ for (i = 0; i < 4; i++) {
+ int pin = i + EXYNOS4X12_GPIO_M12;
+
+ sprintf(str, "hw_rev%d", i);
+ gpio_request(pin, str);
+ gpio_cfg_pin(pin, S5P_GPIO_INPUT);
+ gpio_set_pull(pin, S5P_GPIO_PULL_NONE);
}
/* GPM1[1:0]: MODEL_REV[1:0] */
@@ -102,10 +113,14 @@ static void board_init_i2c(void)
}
/* I2C_8 */
+ gpio_request(EXYNOS4X12_GPIO_F14, "i2c8_clk");
+ gpio_request(EXYNOS4X12_GPIO_F15, "i2c8_data");
gpio_direction_output(EXYNOS4X12_GPIO_F14, 1);
gpio_direction_output(EXYNOS4X12_GPIO_F15, 1);
/* I2C_9 */
+ gpio_request(EXYNOS4X12_GPIO_M21, "i2c9_clk");
+ gpio_request(EXYNOS4X12_GPIO_M20, "i2c9_data");
gpio_direction_output(EXYNOS4X12_GPIO_M21, 1);
gpio_direction_output(EXYNOS4X12_GPIO_M20, 1);
}
@@ -387,6 +402,7 @@ void exynos_lcd_power_on(void)
struct pmic *p = pmic_get("MAX77686_PMIC");
/* LCD_2.2V_EN: GPC0[1] */
+ gpio_request(EXYNOS4X12_GPIO_C01, "lcd_2v2_en");
gpio_set_pull(EXYNOS4X12_GPIO_C01, S5P_GPIO_PULL_UP);
gpio_direction_output(EXYNOS4X12_GPIO_C01, 1);
@@ -399,6 +415,7 @@ void exynos_lcd_power_on(void)
void exynos_reset_lcd(void)
{
/* reset lcd */
+ gpio_request(EXYNOS4X12_GPIO_F21, "lcd_reset");
gpio_direction_output(EXYNOS4X12_GPIO_F21, 0);
udelay(10);
gpio_set_value(EXYNOS4X12_GPIO_F21, 1);
diff --git a/board/samsung/universal_c210/universal.c b/board/samsung/universal_c210/universal.c
index 47e7f538d6..22b08497cb 100644
--- a/board/samsung/universal_c210/universal.c
+++ b/board/samsung/universal_c210/universal.c
@@ -12,7 +12,6 @@
#include <asm/io.h>
#include <asm/gpio.h>
#include <asm/arch/adc.h>
-#include <asm/arch/gpio.h>
#include <asm/arch/pinmux.h>
#include <asm/arch/watchdog.h>
#include <ld9040.h>
@@ -202,53 +201,6 @@ int exynos_early_init_f(void)
return 0;
}
-#ifdef CONFIG_SOFT_SPI
-static void soft_spi_init(void)
-{
- gpio_direction_output(CONFIG_SOFT_SPI_GPIO_SCLK,
- CONFIG_SOFT_SPI_MODE & SPI_CPOL);
- gpio_direction_output(CONFIG_SOFT_SPI_GPIO_MOSI, 1);
- gpio_direction_input(CONFIG_SOFT_SPI_GPIO_MISO);
- gpio_direction_output(CONFIG_SOFT_SPI_GPIO_CS,
- !(CONFIG_SOFT_SPI_MODE & SPI_CS_HIGH));
-}
-
-void spi_cs_activate(struct spi_slave *slave)
-{
- gpio_set_value(CONFIG_SOFT_SPI_GPIO_CS,
- !(CONFIG_SOFT_SPI_MODE & SPI_CS_HIGH));
- SPI_SCL(1);
- gpio_set_value(CONFIG_SOFT_SPI_GPIO_CS,
- CONFIG_SOFT_SPI_MODE & SPI_CS_HIGH);
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
- gpio_set_value(CONFIG_SOFT_SPI_GPIO_CS,
- !(CONFIG_SOFT_SPI_MODE & SPI_CS_HIGH));
-}
-
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
- return bus == 0 && cs == 0;
-}
-
-void universal_spi_scl(int bit)
-{
- gpio_set_value(CONFIG_SOFT_SPI_GPIO_SCLK, bit);
-}
-
-void universal_spi_sda(int bit)
-{
- gpio_set_value(CONFIG_SOFT_SPI_GPIO_MOSI, bit);
-}
-
-int universal_spi_read(void)
-{
- return gpio_get_value(CONFIG_SOFT_SPI_GPIO_MISO);
-}
-#endif
-
static void init_pmic_lcd(void)
{
unsigned char val;
@@ -331,9 +283,8 @@ void exynos_cfg_lcd_gpio(void)
}
/* gpio pad configuration for LCD reset. */
+ gpio_request(EXYNOS4_GPIO_Y45, "lcd_reset");
gpio_cfg_pin(EXYNOS4_GPIO_Y45, S5P_GPIO_OUTPUT);
-
- spi_init();
}
int mipi_power(void)
@@ -387,6 +338,7 @@ int exynos_init(void)
* you should set it HIGH since it removes the inverter
*/
/* MASSMEMORY_EN: XMDMDATA_6: GPE3[6] */
+ gpio_request(EXYNOS4_GPIO_E36, "ldo_en");
gpio_direction_output(EXYNOS4_GPIO_E36, 0);
break;
default:
@@ -395,13 +347,11 @@ int exynos_init(void)
* But set it as HIGH to ensure
*/
/* MASSMEMORY_EN: XMDMADDR_3: GPE1[3] */
+ gpio_request(EXYNOS4_GPIO_E13, "massmemory_en");
gpio_direction_output(EXYNOS4_GPIO_E13, 1);
break;
}
-#ifdef CONFIG_SOFT_SPI
- soft_spi_init();
-#endif
check_hw_revision();
printf("HW Revision:\t0x%x\n", board_rev);