From patchwork Tue Jun 2 11:19:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 1302342 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=DNmzM4Gl; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49bqM208FMz9sSc for ; Tue, 2 Jun 2020 21:19:41 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6456981260; Tue, 2 Jun 2020 13:19:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="DNmzM4Gl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D8FE2808E0; Tue, 2 Jun 2020 13:19:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D75D780670 for ; Tue, 2 Jun 2020 13:19:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=t-kristo@ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 052BJJfJ065778; Tue, 2 Jun 2020 06:19:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1591096759; bh=tZogIzp1Jq05rRiZtdzldVKZDizs3nIrcAupqkcsb/A=; h=From:To:Subject:Date:In-Reply-To:References; b=DNmzM4GlVCb3R7cUwLydz7/QR4sVqxyFbZnE9B0QD2EEKFT3OGrj043K4h7E35x/0 dmdl6ozqGcevEgHECX8IDTP8lN398z0AKlnHyIt0ZQDvYH5vKS725oKxBaRnIRXFkl ssLxV/UTNVjUEWMfQCRWRgZrwMvleNUXC1jwqfUI= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 052BJJ5E113498 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 2 Jun 2020 06:19:19 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 2 Jun 2020 06:19:18 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Tue, 2 Jun 2020 06:19:18 -0500 Received: from sokoban.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 052BJE9A086663; Tue, 2 Jun 2020 06:19:17 -0500 From: Tero Kristo To: , , Subject: [PATCH 2/2] omap4: panda: convert to device model Date: Tue, 2 Jun 2020 14:19:09 +0300 Message-ID: <20200602111909.29772-3-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200602111909.29772-1-t-kristo@ti.com> References: <20200602111909.29772-1-t-kristo@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Convert omap4 panda to device model. Signed-off-by: Tero Kristo Reviewed-by: Jagan Teki --- arch/arm/dts/Makefile | 4 ++++ arch/arm/dts/omap4-u-boot.dtsi | 39 ++++++++++++++++++++++++++++++++++ board/ti/panda/panda.c | 12 +++++++++++ configs/omap4_panda_defconfig | 8 +++++++ 4 files changed, 63 insertions(+) create mode 100644 arch/arm/dts/omap4-u-boot.dtsi diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 12ec6c71dc..dd574f57fa 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -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 index 0000000000..4a6bafd6ed --- /dev/null +++ b/arch/arm/dts/omap4-u-boot.dtsi @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * U-Boot additions + * + * (C) Copyright 2020 Tero Kristo + */ + +&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"; + }; + }; +}; diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index 9ebecfdbf5..3cc6e78dfc 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +56,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; diff --git a/configs/omap4_panda_defconfig b/configs/omap4_panda_defconfig index 3ac6319d2d..bf5f71c7a7 100644 --- a/configs/omap4_panda_defconfig +++ b/configs/omap4_panda_defconfig @@ -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 @@ -23,16 +25,20 @@ 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_USB=y +CONFIG_DM_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_UDC=y CONFIG_USB_OMAP3=y @@ -40,3 +46,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