]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
omap4: panda: convert to device model
authorTero Kristo <t-kristo@ti.com>
Tue, 16 Jun 2020 08:03:06 +0000 (11:03 +0300)
committerLokesh Vutla <lokeshvutla@ti.com>
Tue, 16 Jun 2020 11:30:12 +0000 (17:00 +0530)
Convert omap4 panda to device model.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
arch/arm/dts/Makefile
arch/arm/dts/omap4-u-boot.dtsi [new file with mode: 0644]
board/ti/panda/panda.c
configs/omap4_panda_defconfig

index 9900b44274122537d7427022b079c1bebd195d49..fd2e7787ec0521160bd07afd9873391443bd002d 100644 (file)
@@ -848,6 +848,10 @@ dtb-$(CONFIG_TARGET_OMAP3_BEAGLE) += \
 dtb-$(CONFIG_TARGET_OMAP3_IGEP00X0) += \
        omap3-igep0020.dtb
 
+dtb-$(CONFIG_TARGET_OMAP4_PANDA) += \
+       omap4-panda.dtb \
+       omap4-panda-es.dtb
+
 dtb-$(CONFIG_TARGET_SAMA5D2_PTC_EK) += \
        at91-sama5d2_ptc_ek.dtb
 
diff --git a/arch/arm/dts/omap4-u-boot.dtsi b/arch/arm/dts/omap4-u-boot.dtsi
new file mode 100644 (file)
index 0000000..4a6bafd
--- /dev/null
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * (C) Copyright 2020 Tero Kristo <t-kristo@ti.com>
+ */
+
+&l4_cfg {
+       segment@0 {
+               /* SCM Core */
+               target-module@2000 {
+                       compatible = "simple-bus";
+               };
+
+               /* USB HS */
+               target-module@64000 {
+                       compatible = "simple-bus";
+               };
+       };
+};
+
+&l4_per {
+       segment@0 {
+               /* UART3 */
+               target-module@20000 {
+                       compatible = "simple-bus";
+               };
+
+               /* I2C1 */
+               target-module@70000 {
+                       compatible = "simple-bus";
+               };
+
+               /* MMC1 */
+               target-module@9c000 {
+                       compatible = "simple-bus";
+               };
+       };
+};
index 9ebecfdbf581a6b259b01d52bc586099039e1287..232d999a29b0752be77e99f9c248c9fa886c8262 100644 (file)
@@ -8,6 +8,7 @@
 #include <init.h>
 #include <log.h>
 #include <net.h>
+#include <serial.h>
 #include <asm/mach-types.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mmc_host_def.h>
 
 #include "panda_mux_data.h"
 
-#ifdef CONFIG_USB_EHCI_HCD
-#include <usb.h>
-#include <asm/arch/ehci.h>
-#include <asm/ehci-omap.h>
-#endif
-
 #define PANDA_ULPI_PHY_TYPE_GPIO       182
 #define PANDA_BOARD_ID_1_GPIO          101
 #define PANDA_ES_BOARD_ID_1_GPIO        48
@@ -55,6 +50,17 @@ int board_init(void)
        return 0;
 }
 
+#if defined(CONFIG_SPL_OS_BOOT)
+int spl_start_uboot(void)
+{
+       /* break into full u-boot on 'c' */
+       if (serial_tstc() && serial_getc() == 'c')
+               return 1;
+
+       return 0;
+}
+#endif /* CONFIG_SPL_OS_BOOT */
+
 int board_eth_init(bd_t *bis)
 {
        return 0;
@@ -305,38 +311,6 @@ void board_mmc_power_init(void)
 #endif
 #endif
 
-#ifdef CONFIG_USB_EHCI_HCD
-
-static struct omap_usbhs_board_data usbhs_bdata = {
-       .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
-       .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
-       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-};
-
-int ehci_hcd_init(int index, enum usb_init_type init,
-               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
-{
-       int ret;
-       unsigned int utmi_clk;
-
-       /* Now we can enable our port clocks */
-       utmi_clk = readl((void *)CM_L3INIT_HSUSBHOST_CLKCTRL);
-       utmi_clk |= HSUSBHOST_CLKCTRL_CLKSEL_UTMI_P1_MASK;
-       setbits_le32((void *)CM_L3INIT_HSUSBHOST_CLKCTRL, utmi_clk);
-
-       ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
-       if (ret < 0)
-               return ret;
-
-       return 0;
-}
-
-int ehci_hcd_stop(int index)
-{
-       return omap_ehci_hcd_stop();
-}
-#endif
-
 /*
  * get_board_rev() - get board revision
  */
index 3ac6319d2d73a9030b855212c5117f15159e1ce1..f8d37f472857f05b4877f373c70b5f194fc66b31 100644 (file)
@@ -2,12 +2,14 @@ CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_OMAP44XX=y
 CONFIG_TARGET_OMAP4_PANDA=y
+CONFIG_DEFAULT_DEVICE_TREE="omap4-panda"
 CONFIG_SPL=y
 CONFIG_SPL_TEXT_BASE=0x40300000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd"
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_DEFAULT_FDT_FILE="omap4-panda.dtb"
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_SPL_FS_EXT4 is not set
 # CONFIG_SPL_I2C_SUPPORT is not set
@@ -18,21 +20,23 @@ CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_EXT4_WRITE=y
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_FAT=y
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_DM=y
+CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_CONS_INDEX=3
 CONFIG_SYS_NS16550=y
-CONFIG_SPI=y
-CONFIG_OMAP3_SPI=y
+# CONFIG_SPI is not set
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_UDC=y
 CONFIG_USB_OMAP3=y
@@ -40,3 +44,5 @@ CONFIG_USB_GADGET=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_OF_LIBFDT=y
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_DM_ETH=y