]> git.sur5r.net Git - u-boot/blobdiff - board/intel/minnowmax/minnowmax.c
x86: kconfig: Select ARCH_EARLY_INIT_R in the platform Kconfig
[u-boot] / board / intel / minnowmax / minnowmax.c
index fd2070afb28660b31d0adb255169f56ec9a31b47..5bdb2fdbc7cb4282f9720860fb6bf51776ce26c0 100644 (file)
@@ -5,28 +5,57 @@
  */
 
 #include <common.h>
-#include <asm/ibmpc.h>
-#include <asm/pnp_def.h>
-#include <netdev.h>
-#include <smsc_lpc47m.h>
+#include <dm.h>
+#include <asm/gpio.h>
+#include <dm/device-internal.h>
+#include <dm/uclass-internal.h>
 
-#define SERIAL_DEV PNP_DEV(0x2e, 4)
+#define GPIO_BANKE_NAME                "gpioe"
 
-DECLARE_GLOBAL_DATA_PTR;
-
-int board_early_init_f(void)
+int misc_init_r(void)
 {
-       lpc47m_enable_serial(SERIAL_DEV, UART0_BASE, UART0_IRQ);
+       struct udevice *dev;
+       struct gpio_desc desc;
+       int ret;
 
-       return 0;
-}
+       /*
+        * Turn on USB VBUS for the two USB ports on the board.
+        * Each port's VBUS is controlled by a GPIO pin.
+        */
 
-void setup_pch_gpios(u16 gpiobase, const struct pch_gpio_map *gpio)
-{
-       return;
-}
+       ret = uclass_find_device_by_name(UCLASS_GPIO, GPIO_BANKE_NAME, &dev);
+       if (ret) {
+               debug("%s: GPIO %s device cannot be not found (ret=%d)\n",
+                     __func__, GPIO_BANKE_NAME, ret);
+               return ret;
+       }
 
-int board_eth_init(bd_t *bis)
-{
-       return pci_eth_init(bis);
+       ret = device_probe(dev);
+       if (ret) {
+               debug("%s: GPIO %s device probe failed (ret=%d)\n",
+                     __func__, GPIO_BANKE_NAME, ret);
+               return ret;
+       }
+
+       desc.dev = dev;
+       desc.flags = GPIOD_IS_OUT;
+
+       /* GPIO E8 controls the bottom port */
+       desc.offset = 8;
+
+       ret = dm_gpio_request(&desc, "usb_host_en0");
+       if (ret)
+               return ret;
+       dm_gpio_set_value(&desc, 1);
+
+       /* GPIO E9 controls the upper port */
+       desc.offset = 9;
+
+       ret = dm_gpio_request(&desc, "usb_host_en1");
+       if (ret)
+               return ret;
+
+       dm_gpio_set_value(&desc, 1);
+
+       return 0;
 }