From patchwork Sat Feb 28 05:06:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 444788 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B05B81400D5 for ; Mon, 2 Mar 2015 07:11:30 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C19584B5D2; Sun, 1 Mar 2015 21:11:12 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b5uP2Uqfc3fV; Sun, 1 Mar 2015 21:11:12 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 59ED24B652; Sun, 1 Mar 2015 21:11:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A67994A056 for ; Sat, 28 Feb 2015 06:36:10 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wlBekneHU3yX for ; Sat, 28 Feb 2015 06:36:10 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ob0-f202.google.com (mail-ob0-f202.google.com [209.85.214.202]) by theia.denx.de (Postfix) with ESMTPS id 4107D4A046 for ; Sat, 28 Feb 2015 06:36:07 +0100 (CET) Received: by mail-ob0-f202.google.com with SMTP id nt9so6527689obb.1 for ; Fri, 27 Feb 2015 21:36:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=U8lwVcpOLEeVMhKfZoo/NwSByEH22jMUiDecZ7UT2/I=; b=DsywcZLmwLaHMSK4Rylc4fxYTTaH9L6w1GWMWfOdfEEnwCWqkx88Xw/jTd0XaBiglL ozXxwwE/R9zo/H3Q6FBhmFYur//H5EppDCKdcMNG5E2jcIJomtHuOeE9NaATn8wIsgMP un0Xg6Ps59vkKRYCTMZ0Q6435/eiQOjA84N447TxxKhMZAlggahzjBg/I8LqdXh9pSlu AyZ+Tzopb/zx/OkVhzWAtUmUW5dOp/2ANqkGPv+A6HgK09nLmYq2aHNvac15swtUjttB Fiiu5S8CMVw6Hw6M+N93nImPnEFFGVpBkzRXS14eWNOnXZAKRCXQqhMImCg4cnTgnkYa jlrQ== X-Gm-Message-State: ALoCoQksHW5Zl7AZr6dJPwYhZVsODKplVJxIcSru6OvorgVobC0XXk13/66A2JaoybzPbiMjz4Lo X-Received: by 10.42.209.12 with SMTP id ge12mr17203796icb.16.1425100052701; Fri, 27 Feb 2015 21:07:32 -0800 (PST) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id u27si239482yhu.4.2015.02.27.21.07.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Feb 2015 21:07:32 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id SjVh5VWE.1; Fri, 27 Feb 2015 21:07:32 -0800 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id EB401220EC4; Fri, 27 Feb 2015 22:07:31 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Fri, 27 Feb 2015 22:06:30 -0700 Message-Id: <1425100013-4796-7-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1425100013-4796-1-git-send-email-sjg@chromium.org> References: <1425100013-4796-1-git-send-email-sjg@chromium.org> Subject: [U-Boot] [PATCH 06/29] dm: core: Allow sequence alias support to be removed for SPL X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" In many cases SPL only uses a single serial port and there is no need for alias sequence support. We will just use the serial port pointed to by stdout-path in the /chosen node. Signed-off-by: Simon Glass --- drivers/core/Kconfig | 9 +++++++++ drivers/core/device.c | 28 +++++++++++++++------------- include/config_uncmd_spl.h | 1 + 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index 75d182d..2861b43 100644 --- a/drivers/core/Kconfig +++ b/drivers/core/Kconfig @@ -46,3 +46,12 @@ config DM_STDIO Normally serial drivers register with stdio so that they can be used as normal output devices. In SPL we don't normally use stdio, so we can omit this feature. + +config DM_SEQ_ALIAS + bool "Support numbered aliases in device tree" + depends on DM + default y + help + Most boards will have a '/aliases' node containing the path to + numbered devices (e.g. serial0 = &serial0). This feature can be + disabled if it is not required, to save code space in SPL. diff --git a/drivers/core/device.c b/drivers/core/device.c index 73c3e07..78c9525 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -55,21 +55,23 @@ int device_bind(struct udevice *parent, struct driver *drv, const char *name, dev->seq = -1; dev->req_seq = -1; -#ifdef CONFIG_OF_CONTROL - /* - * Some devices, such as a SPI bus, I2C bus and serial ports are - * numbered using aliases. - * - * This is just a 'requested' sequence, and will be - * resolved (and ->seq updated) when the device is probed. - */ - if (uc->uc_drv->flags & DM_UC_FLAG_SEQ_ALIAS) { - if (uc->uc_drv->name && of_offset != -1) { - fdtdec_get_alias_seq(gd->fdt_blob, uc->uc_drv->name, - of_offset, &dev->req_seq); + if (IS_ENABLED(CONFIG_OF_CONTROL) && IS_ENABLED(CONFIG_DM_SEQ_ALIAS)) { + /* + * Some devices, such as a SPI bus, I2C bus and serial ports + * are numbered using aliases. + * + * This is just a 'requested' sequence, and will be + * resolved (and ->seq updated) when the device is probed. + */ + if (uc->uc_drv->flags & DM_UC_FLAG_SEQ_ALIAS) { + if (uc->uc_drv->name && of_offset != -1) { + fdtdec_get_alias_seq(gd->fdt_blob, + uc->uc_drv->name, of_offset, + &dev->req_seq); + } } } -#endif + if (!dev->platdata && drv->platdata_auto_alloc_size) { dev->flags |= DM_FLAG_ALLOC_PDATA; dev->platdata = calloc(1, drv->platdata_auto_alloc_size); diff --git a/include/config_uncmd_spl.h b/include/config_uncmd_spl.h index a9106f4..38cb0e8 100644 --- a/include/config_uncmd_spl.h +++ b/include/config_uncmd_spl.h @@ -31,6 +31,7 @@ #undef CONFIG_DM_WARN #undef CONFIG_DM_DEVICE_REMOVE +#undef CONFIG_DM_SEQ_ALIAS #undef CONFIG_DM_STDIO #endif /* CONFIG_SPL_BUILD */