]> git.sur5r.net Git - u-boot/blobdiff - board/samsung/universal_c210/universal.c
Fix GCC format-security errors and convert sprintfs.
[u-boot] / board / samsung / universal_c210 / universal.c
index 47e7f538d65b7cd35943328d91ecb44385096961..426ae14af26db0e19da90e0a75201095d802f3b7 100644 (file)
 #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>
 #include <power/pmic.h>
 #include <usb.h>
-#include <usb/s3c_udc.h>
+#include <usb/dwc2_udc.h>
 #include <asm/arch/cpu.h>
 #include <power/max8998_pmic.h>
 #include <libtizen.h>
@@ -180,7 +179,7 @@ static int s5pc210_phy_control(int on)
        return 0;
 }
 
-struct s3c_plat_otg_data s5pc210_otg_data = {
+struct dwc2_plat_otg_data s5pc210_otg_data = {
        .phy_control = s5pc210_phy_control,
        .regs_phy = EXYNOS4_USBPHY_BASE,
        .regs_otg = EXYNOS4_USBOTG_BASE,
@@ -192,7 +191,7 @@ struct s3c_plat_otg_data s5pc210_otg_data = {
 int board_usb_init(int index, enum usb_init_type init)
 {
        debug("USB_udc_probe\n");
-       return s3c_udc_probe(&s5pc210_otg_data);
+       return dwc2_udc_probe(&s5pc210_otg_data);
 }
 
 int exynos_early_init_f(void)
@@ -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)
@@ -377,6 +328,8 @@ void exynos_enable_ldo(unsigned int onoff)
 
 int exynos_init(void)
 {
+       char buf[16];
+
        gd->bd->bi_arch_number = MACH_TYPE_UNIVERSAL_C210;
 
        switch (get_hwrev()) {
@@ -387,6 +340,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 +349,18 @@ 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
+       /* Request soft I2C gpios */
+       strcpy(buf, "soft_i2c_scl");
+       gpio_request(CONFIG_SOFT_I2C_GPIO_SCL, buf);
+
+       strcpy(buf, "soft_i2c_sda");
+       gpio_request(CONFIG_SOFT_I2C_GPIO_SDA, buf);
+
        check_hw_revision();
        printf("HW Revision:\t0x%x\n", board_rev);