From patchwork Wed Jan 10 10:34:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jorge Ramirez-Ortiz, Gmail" X-Patchwork-Id: 124041 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp1490300edr; Wed, 10 Jan 2018 02:39:19 -0800 (PST) X-Google-Smtp-Source: ACJfBouaz2DRLaktgRzTzPOpTQLTpuMgsbucTvNUmX4Irz7UXAsDL6uaGsF+h/FN4+ox5ascvgIp X-Received: by 10.80.185.69 with SMTP id m63mr25001665ede.197.1515580759756; Wed, 10 Jan 2018 02:39:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515580759; cv=none; d=google.com; s=arc-20160816; b=qcPOzTD827YRSMf+7/XCHTvLCbhRBELher7/wtYUuPCjco0lnik5YKyBbsO4PhfS+n eEaGC8BGx3z8cM0BpYpdq9iit24PL6Mx2KIxM0Yq9S9QFa7V3LwGW5QISuvI7+8BCbMe mmmlsVFWqRvB391WWWnBR1mRrP+ZFllGzLHVM8cgV1bl2pRVs+BBVENmpAd0/FsjMEDl v4YYb6JR0xEGazvJyfRZigaUe3Uy/3HGrWH+y97nmt5Pq2Tak8eYKHm8FhSaPeglWEcm SacPu5SLpRtIcTYhTPClp4zRuHCDb95a+7Ddf6AdkYhsWv8vyFYkKOIsW3DE3nKzQFDN DRsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :arc-authentication-results; bh=lKUkfPjwxIuDAo4uF8oKyp7328He6mq+HgFyK0hMAKA=; b=rA4JjRKwcBhsblTGNWldkuBJzozlWX/Xq00f3kBBSHOo4uAgb1/Vgz/FFYY0Z48fdf EHp7KIIm4d809tGkChVVOY8GxHESIG/+OUpwSE2OV09auM4bCUPikiTrTsVA09E9+euK 1PgrnDRyx9HkqmoMj6c+KjR9wnKJ4kkfHHJR7kDe8fv6LcsgDqqI0PJSSgTb5JmQBY6M NpQnpEYShhssVozaOgLhH9vCYwcbXjP+Y0+H/+1plUUzdn9eEjSs8DbdVqfD/KLqKtlq xcmCCi6Vbf2j5/Pvoqz/ZHfcwcWBJq26dfAvkXe3zwvUrlXxieR6KoEwsU9HB7V5RIaE N15g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=dBQUR9/l; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id a6si11250556ede.158.2018.01.10.02.39.19; Wed, 10 Jan 2018 02:39:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=dBQUR9/l; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: by lists.denx.de (Postfix, from userid 105) id 481FDC22167; Wed, 10 Jan 2018 10:38:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9EDF6C21DDF; Wed, 10 Jan 2018 10:35:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 38B73C22135; Wed, 10 Jan 2018 10:34:56 +0000 (UTC) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by lists.denx.de (Postfix) with ESMTPS id 3FE5DC220BD for ; Wed, 10 Jan 2018 10:34:49 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id 100so916781wrb.7 for ; Wed, 10 Jan 2018 02:34:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=hK3bQwDQbUOdxoahpfQAjghG/4QSnfpigGAXq68FCBE=; b=dBQUR9/lnbMVc/yYq11d2UuZaGaKTEaigI8SyDE7PfByxAzgAt6OCSataSjghWntWM Wtc3RKQfojEyGY3+ZExxdHz9jt3B6tReEdV6f4OK6SR1VUtSxEQkR4niZdcdRGrXVv0L h33w28xRPJLsgGmUkEGpptXOy+8rpk196iwwvLTC94n+HNHhye0zpYLOM1wBdQ4Q6anj 8vtqb4npLwJPX6SSBduYP9/SJ+zzhCb42KNrzqeX6LOZuKdBv5rcV8uE6Aan3NR3eN71 y7HrI2jtHEXEgeLP6XlpbIB53jKAOZyavrUGzjJntTsUCIgpRg077ulKgYgBpQ+iHkI0 t9LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=hK3bQwDQbUOdxoahpfQAjghG/4QSnfpigGAXq68FCBE=; b=dJHnYO/9mAfwt41WlhrGA9iXD6IL1pHD4CPJMQ6C7/8r8D6QuIdwlpUBUAmxy+xSlX JNkgv+ddTtUHTNnb7l00JmiDuyIBEvYL9YXSgnx77E7nkvT7YuvK8A8Yu1OQQruA7exf nKPA8FAXVU90blPKPhIS1Sf0th9EOV3aoG7Ey76AlO3/avrR/Q8jEKGdoQdEpn2TBr6j F+ipxOpuCqhhjyDySDcNROB1CWN95lkIgXvElKE/U3M1YcomJwBNZr0YqVh5XFehGaV/ yTgrB9z4ClPwpcLIQGCt7JBeVv3xmmlSo/katceDlQgIKpSiwm+Tk7WVFmltd06N7h3N XEqw== X-Gm-Message-State: AKwxytdWm5qO191EJt0v5OXoHxmlWqQjVtkEGn2PLyoMul/yUxQOqXjH fEG4Lp+itNP+m8Kufl7BqOhBww== X-Received: by 10.223.164.206 with SMTP id h14mr5042379wrb.229.1515580488694; Wed, 10 Jan 2018 02:34:48 -0800 (PST) Received: from igloo.80.58.61.254 (141.pool85-51-114.dynamic.orange.es. [85.51.114.141]) by smtp.gmail.com with ESMTPSA id i33sm21484737wri.90.2018.01.10.02.34.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Jan 2018 02:34:48 -0800 (PST) From: Jorge Ramirez-Ortiz To: u-boot@lists.denx.de Date: Wed, 10 Jan 2018 11:34:34 +0100 Message-Id: <1515580480-26075-1-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [U-Boot] [PATCH v1 01/07] db410c: configs: increase gunzip buffer size for the kernel X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" From: Jorge Ramirez-Ortiz the kernel fails to boot when it goes over the limit. Signed-off-by: Jorge Ramirez-Ortiz --- include/configs/dragonboard410c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/configs/dragonboard410c.h b/include/configs/dragonboard410c.h index d2447b2..3c5bb8a 100644 --- a/include/configs/dragonboard410c.h +++ b/include/configs/dragonboard410c.h @@ -23,7 +23,7 @@ #define CONFIG_SYS_TEXT_BASE 0x80080000 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x7fff0) #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x80000) -#define CONFIG_SYS_BOOTM_LEN 0x1000000 /* 16MB max kernel size */ +#define CONFIG_SYS_BOOTM_LEN SZ_64M /* UART */ From patchwork Wed Jan 10 10:34:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Jorge Ramirez-Ortiz, Gmail" X-Patchwork-Id: 124043 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp1493357edr; Wed, 10 Jan 2018 02:42:58 -0800 (PST) X-Google-Smtp-Source: ACJfBotN4IxcAgdNd+Nc0nlPTJ2Be9M+h+MRtJkQi62fd4Cm2CHgqghZfBTWKaNRkskf5q5ALLCZ X-Received: by 10.80.149.246 with SMTP id x51mr25467826eda.74.1515580978051; Wed, 10 Jan 2018 02:42:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515580978; cv=none; d=google.com; s=arc-20160816; b=meWTnOLAmVAkazqaWMN0otKtS/LGn9/IqlSCSZ0RTFrnxwgziP4TmPr2t21lIiarFA 5fAtZk+RsMEgK0j2+qytWANdr0k56lpF+bJ+ImkIPzSCu2q5epqa3zJE3+1OAk5/PJce 7WUYI/vrNcB1L3T5xnf+M1JuRYdAL0jkxW03C4ltuFtmiLqKpx8dIu7Gzmt80Rt6dibn U0b1/+V4Glw3em9m2S/IzUC4qOk0Q3KZNHEQWYrhsMGCnYyS9u0G9u50A1ftazEtDRlm u7Bx5gtsEBaxqkJ4+IsFDYQ0rmJrEI/C8AdAyp28/jrk69kiUgYdKB3Zlb7XVJRpHprP Ubyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=snVE2K6v7Rq4JZiSNZljGifKRtFup3YGF27L8A8AqYw=; b=ILwu9O3OZXvGhuHIFkiIPH31vLajfzKVmkT/lHxkw4L9Bxu9eH5yOVc0jn5wpcnQPs 39UlFZeyIlqMMZPNxi2ZTMATm4JAzNEYbYXzAGAg71KNXNVmhbsjXKvu1rfYAkD3TYN0 jDDGq+MoU24i1V+o/gbBeL4wLfTexM1qB4s7tm/gBZpwcmIqC4idJW2uB0nZ3jYKbO7/ tuea5cLJELg+18ZbSiOvEDzKnRx4MH65198n+Ttv+aG5B29gZeJHXNGDlKZ7ZHKfMhFV 7sxEOUhBu6wUE3SmLomgEZfhl2Atu2pi6Ru6sxpyhC4poOJK592l3lADJjO0dMpePzZL t30A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=a1TPtFMR; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id m13si2528501edi.403.2018.01.10.02.42.57; Wed, 10 Jan 2018 02:42:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=a1TPtFMR; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: by lists.denx.de (Postfix, from userid 105) id 9D0DAC22131; Wed, 10 Jan 2018 10:41:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id EF39AC22180; Wed, 10 Jan 2018 10:36:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6999EC2214F; Wed, 10 Jan 2018 10:34:57 +0000 (UTC) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by lists.denx.de (Postfix) with ESMTPS id A76E3C2211E for ; Wed, 10 Jan 2018 10:34:50 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id 123so4730922wme.0 for ; Wed, 10 Jan 2018 02:34:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=2rJmnEp+Dw7SDcd3SVoooiF72aa9i5MVlX23Oo6J+3U=; b=a1TPtFMRNSjcBGitqnILSPv2oC3orBH3T0XPbAwK3VIwTPTN0svDQ5HsJjSd7uOAPT 8PbPb82Ob3wdRncyz3cecwtu2dKkexan8gZy7xOmeCvrmX4FGLxNINCqrJsNT/hq8ZFv MYRf+9BF+SdHp71xBT5AhgHiHfiSUxYtBCwDclOhBidYj5cUF6OctZIijnlAjSLlwELj DobV6WA6mHOh6UpHx+O3JoybEBb9JrhL3HZHLcHFac4X7xNotbSyIRjBuHhO5z3PFqrd OP4EqGzTBMQDrngem3S3b76QYE9+YnMBjt9F7ckAl4pLikXLPbticFIoZ0imDGBlTqaj aA3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2rJmnEp+Dw7SDcd3SVoooiF72aa9i5MVlX23Oo6J+3U=; b=PLlVwpKbphMmezFT6Ho6zEolITApJEMVsUNpOPnS+N+yDwH7hPhJpI+1IX4vXFY5Fg 5cYi7rNoWQvi3LgO7LUtjmjboHTwSNvWzLjqyEfQM9udxh/iyuhLZoJIFhZcTeqDtAxa /ZSi85SMwpQbQhHOdpIpE5WkMzOPtvDKeWXbZ6l5aBn+lnDbgVC2aPsZGNR9JKtdXQSa cmtNYnVVSAQGEryYuEjwYsUhDp2C7pHb77njswtYFcgpfr+YH2pKE5rAw7REuzWE5cjD /UH0WSDtX5dQ4ZgU0H6lanymwc9ShvU2BxIhwa9smaz7IMPRnJqZGc++UlgwLXBXzOej N+Ng== X-Gm-Message-State: AKGB3mIHtHJKLniHArg31a/5tDQOPhVG7zhqSFNLQjrURjx1bUmCSxKQ PICYYuIymvulu5CbFIaRiHKnuQ== X-Received: by 10.28.159.209 with SMTP id i200mr14542299wme.101.1515580489987; Wed, 10 Jan 2018 02:34:49 -0800 (PST) Received: from igloo.80.58.61.254 (141.pool85-51-114.dynamic.orange.es. [85.51.114.141]) by smtp.gmail.com with ESMTPSA id i33sm21484737wri.90.2018.01.10.02.34.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Jan 2018 02:34:49 -0800 (PST) From: Jorge Ramirez-Ortiz To: u-boot@lists.denx.de Date: Wed, 10 Jan 2018 11:34:35 +0100 Message-Id: <1515580480-26075-2-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515580480-26075-1-git-send-email-jorge.ramirez.ortiz@gmail.com> References: <1515580480-26075-1-git-send-email-jorge.ramirez.ortiz@gmail.com> MIME-Version: 1.0 Subject: [U-Boot] [PATCH v1 02/07] db410c: update wlan and bt mac addresses from firmware X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" From: Jorge Ramirez-Ortiz The firmware that runs before u-boot modifies u-boot's device tree adding the local-mac-address and local-bd-address properties for the compatibles "qcom,wcnss-bt" and "qcom,wcnss-wlan". This commit reads that firmware, retrieves the properties and fixups the device tree that is passed to the kernel before booting. Signed-off-by: Jorge Ramirez-Ortiz --- arch/arm/dts/dragonboard410c.dts | 10 +++++ board/qualcomm/dragonboard410c/Makefile | 1 + board/qualcomm/dragonboard410c/dragonboard410c.c | 49 +++++++++++++++++++++--- board/qualcomm/dragonboard410c/lowlevel_init.S | 28 ++++++++++++++ configs/dragonboard410c_defconfig | 3 ++ 5 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 board/qualcomm/dragonboard410c/lowlevel_init.S diff --git a/arch/arm/dts/dragonboard410c.dts b/arch/arm/dts/dragonboard410c.dts index 7746622..25aeac4 100644 --- a/arch/arm/dts/dragonboard410c.dts +++ b/arch/arm/dts/dragonboard410c.dts @@ -86,6 +86,16 @@ clock-frequency = <200000000>; }; + wcnss { + bt { + compatible="qcom,wcnss-bt"; + }; + + wifi { + compatible="qcom,wcnss-wlan"; + }; + }; + spmi@200f000 { compatible = "qcom,spmi-pmic-arb"; reg = <0x200f800 0x200 0x2400000 0x400000 0x2c00000 0x400000>; diff --git a/board/qualcomm/dragonboard410c/Makefile b/board/qualcomm/dragonboard410c/Makefile index cd67808..5082383 100644 --- a/board/qualcomm/dragonboard410c/Makefile +++ b/board/qualcomm/dragonboard410c/Makefile @@ -5,4 +5,5 @@ # obj-y := dragonboard410c.o +obj-y += lowlevel_init.o extra-y += head.o diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c index 848e278..99fc91b 100644 --- a/board/qualcomm/dragonboard410c/dragonboard410c.c +++ b/board/qualcomm/dragonboard410c/dragonboard410c.c @@ -10,9 +10,16 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; +/* pointer to the device tree ammended by the firmware */ +extern const void *fw_dtb; + +static char wlan_mac[ARP_HLEN]; +static char bt_mac[ARP_HLEN]; + int dram_init(void) { gd->ram_size = PHYS_SDRAM_1_SIZE; @@ -27,7 +34,6 @@ int dram_init_banksize(void) return 0; } - int board_prepare_usb(enum usb_init_type type) { static struct udevice *pmic_gpio; @@ -96,11 +102,6 @@ int board_prepare_usb(enum usb_init_type type) return 0; } -int board_init(void) -{ - return 0; -} - /* Check for vol- button - if pressed - stop autoboot */ int misc_init_r(void) { @@ -134,3 +135,39 @@ int misc_init_r(void) return 0; } + +int board_init(void) +{ + int offset, len; + const char *mac; + + /* take a copy of the firmware information (the user could unknownly + overwrite that DDR via tftp or other means) */ + + offset = fdt_node_offset_by_compatible(fw_dtb, -1, "qcom,wcnss-wlan"); + if (offset >= 0) { + mac = fdt_getprop(fw_dtb, offset, "local-mac-address", &len); + if (mac) + memcpy(wlan_mac, mac, ARP_HLEN); + } + + offset = fdt_node_offset_by_compatible(fw_dtb, -1, "qcom,wcnss-bt"); + if (offset >= 0) { + mac = fdt_getprop(fw_dtb, offset, "local-bd-address", &len); + if (mac) + memcpy(bt_mac, mac, ARP_HLEN); + } + + return 0; +} + +int ft_board_setup(void *blob, bd_t *bd) +{ + do_fixup_by_compat(blob, "qcom,wcnss-wlan", "local-mac-address", + wlan_mac, ARP_HLEN, 1); + + do_fixup_by_compat(blob, "qcom,wcnss-bt", "local-bd-address", + bt_mac, ARP_HLEN, 1); + + return 0; +} diff --git a/board/qualcomm/dragonboard410c/lowlevel_init.S b/board/qualcomm/dragonboard410c/lowlevel_init.S new file mode 100644 index 0000000..15b2d0c --- /dev/null +++ b/board/qualcomm/dragonboard410c/lowlevel_init.S @@ -0,0 +1,28 @@ +/* + * (C) Copyright 2016 + * Cédric Schieli + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include + +.align 8 +.global fw_dtb +fw_dtb: + .dword 0x0 + +/* + * Routine: save_boot_params (called after reset from start.S) + * Description: save ATAG/FDT address provided by the firmware at boot time + */ + +.global save_boot_params +save_boot_params: + + /* The firmware provided ATAG/FDT address can be found in r2/x0 */ + adr x8, fw_dtb + str x0, [x8] + + /* Returns */ + b save_boot_params_ret diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig index b71bff7..cfe9be9 100644 --- a/configs/dragonboard410c_defconfig +++ b/configs/dragonboard410c_defconfig @@ -44,3 +44,6 @@ CONFIG_USB_ETHER_ASIX88179=y CONFIG_USB_ETHER_MCS7830=y CONFIG_USB_ETHER_SMSC95XX=y CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_OF_CONTROL=y +CONFIG_ENV_IS_IN_MMC=y +CONFIG_OF_BOARD_SETUP=y From patchwork Wed Jan 10 10:34:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jorge Ramirez-Ortiz, Gmail" X-Patchwork-Id: 124042 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp1491946edr; Wed, 10 Jan 2018 02:41:22 -0800 (PST) X-Google-Smtp-Source: ACJfBosLTlazmPT1cXqGTL6hgu5YtJItStbn1VoxR8CmunuiC39lu/9+zDe5aYgD6ljUiz+iYEbo X-Received: by 10.80.165.21 with SMTP id y21mr1002110edb.148.1515580882425; Wed, 10 Jan 2018 02:41:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515580882; cv=none; d=google.com; s=arc-20160816; b=Nu9ABXs7ps/YBZP1RR4dXLZLzrrSzrsKWn3aWZ/h3BmSmDM7+UjcsXFW7UmC5FeTbe BP7jl7PVevvdPQ1wYLIi7lM/tZV0zEjMTtDDV5bmbU4RYu3uiSXToy4+RT9qubyueiH6 pPnNpGqGD3LiiwtX9ufaZ4EYeGrRNJ/GpIrzF/Xnva52lxoZdO63Lf7jjKoLLpsI2CAl 3qnnrrPTMqhFGw/NseDGvYiirSGPGk1wjWraKxMRr/eZ7yCpO97UY1efJeN8Y0mgWH8R 6C/36ztZ3JJtSfiBoYIVMsYsLDuaO+D/WYdQUv8j+Gur//hePfP5Rq5Ipgtc5jOi3H0T l5OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:arc-authentication-results; bh=z7zcce7DfkfN7hJ5uwwa/VvowkMbgIsOG91lkHD7HFI=; b=MCKuVSG88D6N7QSbRiZVMiZcS1vvAaZwVSsSiTH4z/+6hyvSY5m9zBfJoMO6Knc4I7 EApb79h3eecQlehO8NCnDyAfxEJvYpwpKhatwGXTziDnL6XMyB6oKYGtB7YyxypO47vM x1W6bSwKE5rdqIfNyIqHAWLMbLJgEGuIKRTJCTFitmXYlngGPzSJpX8bIouG7PCm6vtF jF58d/yfd2OSAonhJVgTmKcrVGb4Lh0Y+V5wMxzYPOUWd6L6OVPwhGu3HtxdVcjm5+iB VRtQ8dzPXWcORrZMVCZcnynI7uLDYq6Nbbx7ixuLRwPyOLEVwqwZYvfhhBcBhLT5PHc2 VnUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=ClspthgT; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id k26si6571891edf.191.2018.01.10.02.41.22; Wed, 10 Jan 2018 02:41:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=ClspthgT; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: by lists.denx.de (Postfix, from userid 105) id EAE8CC22174; Wed, 10 Jan 2018 10:41:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id AE55CC21E0F; Wed, 10 Jan 2018 10:36:18 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6433FC2217D; Wed, 10 Jan 2018 10:34:58 +0000 (UTC) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by lists.denx.de (Postfix) with ESMTPS id BA481C22143 for ; Wed, 10 Jan 2018 10:34:51 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id z48so11154909wrz.6 for ; Wed, 10 Jan 2018 02:34:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=monA3jbxXyj6wNoGgwanLr0xEIFPtxZFmbzD32Sg2Gc=; b=ClspthgTz0t+7ILMuykoiOAzeJJGq4iTZdrVSLjrupSfICc+lz7TtRj0KPSf/gnqi/ FZWlhGCSOcR8/68QFcflmGdi3NltWMa9egtiC96HcydmP4xDisaS1qZenr8FiRpo0Vdk b75wv6xlgLtogPS223hwxm1uuY4ZX8aNRwxS87dkqjBOVQHkdjjTDZcBR2uTaB0gbEBA RVmEu1T+eI8/SvI2N3sdHkA1VfHamPdU87TRKAzRWT05aaByX0FxMPl+kM5rSwY1w5Ag dB91cU8oK7QDd/ev1BxfFIG5q/5hI9j56IDm4ijZNIB6foGwCfT/SZg2Q9/TV+yBWmwj ii5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=monA3jbxXyj6wNoGgwanLr0xEIFPtxZFmbzD32Sg2Gc=; b=WBjhxwhYkQ2KbKbKj5qJ98c0MYEuSAOw7xC58BU6EQThQRtIWuTidb/CgImfH60ZeX /1qR/zVZ4xZHicoEN5zl0rwlUrUuQ2PHalbdWyKYLi+CgqSxfE6BfzBUQLS75Gw92I+y MLzNQIGnJZ2Up6Bnu/EqQOJJIaSBp7ndYLJVt323Myig+dJjAr2NdXVx5DKBumYpm3U+ Cw0oIxoNQQmRWri626m8mqrPMNrdU7zqJHMHJ0TOxJz+nL+EpqkUWHkCsWTfpEKvBz8/ ERO9QvAyfZ5yexUuHFqdxEPqkC+67HnVC81VSA7arijCEASDwsNsXb6DcgYIrw5P3DOm nl9Q== X-Gm-Message-State: AKGB3mL1s9ue4c5WIb/AF1rVDTm8dBourqqfJi4bqKSMYpt/ac7v5Jbe 1bp8XVbMOXbAWBvKFaLUJVxRFw== X-Received: by 10.223.198.20 with SMTP id n20mr16086064wrg.191.1515580491233; Wed, 10 Jan 2018 02:34:51 -0800 (PST) Received: from igloo.80.58.61.254 (141.pool85-51-114.dynamic.orange.es. [85.51.114.141]) by smtp.gmail.com with ESMTPSA id i33sm21484737wri.90.2018.01.10.02.34.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Jan 2018 02:34:50 -0800 (PST) From: Jorge Ramirez-Ortiz To: u-boot@lists.denx.de Date: Wed, 10 Jan 2018 11:34:36 +0100 Message-Id: <1515580480-26075-3-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515580480-26075-1-git-send-email-jorge.ramirez.ortiz@gmail.com> References: <1515580480-26075-1-git-send-email-jorge.ramirez.ortiz@gmail.com> Subject: [U-Boot] [PATCH v1 03/07] db410c: replace reset driver with psci X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" From: Jorge Ramirez-Ortiz this should be the norm for armv8 platforms. Signed-off-by: Jorge Ramirez-Ortiz --- arch/arm/dts/dragonboard410c.dts | 5 --- board/qualcomm/dragonboard410c/dragonboard410c.c | 5 +++ configs/dragonboard410c_defconfig | 2 +- drivers/sysreset/Makefile | 2 -- drivers/sysreset/sysreset_snapdragon.c | 40 ------------------------ 5 files changed, 6 insertions(+), 48 deletions(-) delete mode 100644 drivers/sysreset/sysreset_snapdragon.c diff --git a/arch/arm/dts/dragonboard410c.dts b/arch/arm/dts/dragonboard410c.dts index 25aeac4..b67e588 100644 --- a/arch/arm/dts/dragonboard410c.dts +++ b/arch/arm/dts/dragonboard410c.dts @@ -48,11 +48,6 @@ clock = <&clkc 4>; }; - restart@4ab000 { - compatible = "qcom,pshold"; - reg = <0x4ab000 0x4>; - }; - soc_gpios: pinctrl@1000000 { compatible = "qcom,apq8016-pinctrl"; reg = <0x1000000 0x300000>; diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c index 99fc91b..8ef4338 100644 --- a/board/qualcomm/dragonboard410c/dragonboard410c.c +++ b/board/qualcomm/dragonboard410c/dragonboard410c.c @@ -171,3 +171,8 @@ int ft_board_setup(void *blob, bd_t *bd) return 0; } + +void reset_cpu(ulong addr) +{ + psci_system_reset(); +} diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig index cfe9be9..de923ad 100644 --- a/configs/dragonboard410c_defconfig +++ b/configs/dragonboard410c_defconfig @@ -30,7 +30,6 @@ CONFIG_DM_PMIC=y CONFIG_PMIC_PM8916=y CONFIG_MSM_SERIAL=y CONFIG_SPMI_MSM=y -CONFIG_SYSRESET=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_USB_EHCI_HCD=y @@ -47,3 +46,4 @@ CONFIG_OF_LIBFDT_OVERLAY=y CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_MMC=y CONFIG_OF_BOARD_SETUP=y +CONFIG_PSCI_RESET=y diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile index 2e9598e..000c288 100644 --- a/drivers/sysreset/Makefile +++ b/drivers/sysreset/Makefile @@ -8,10 +8,8 @@ obj-$(CONFIG_SYSRESET) += sysreset-uclass.o obj-$(CONFIG_SYSRESET_PSCI) += sysreset_psci.o obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o obj-$(CONFIG_SYSRESET_WATCHDOG) += sysreset_watchdog.o - obj-$(CONFIG_ARCH_ROCKCHIP) += sysreset_rockchip.o obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o -obj-$(CONFIG_ARCH_SNAPDRAGON) += sysreset_snapdragon.o obj-$(CONFIG_ARCH_STI) += sysreset_sti.o obj-$(CONFIG_TARGET_XTFPGA) += sysreset_xtfpga.o obj-$(CONFIG_ARCH_ASPEED) += sysreset_ast.o diff --git a/drivers/sysreset/sysreset_snapdragon.c b/drivers/sysreset/sysreset_snapdragon.c deleted file mode 100644 index 9869813..0000000 --- a/drivers/sysreset/sysreset_snapdragon.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Qualcomm APQ8016 reset controller driver - * - * (C) Copyright 2015 Mateusz Kulikowski - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include -#include -#include -#include - -DECLARE_GLOBAL_DATA_PTR; - -static int msm_sysreset_request(struct udevice *dev, enum sysreset_t type) -{ - phys_addr_t addr = devfdt_get_addr(dev); - if (!addr) - return -EINVAL; - writel(0, addr); - return -EINPROGRESS; -} - -static struct sysreset_ops msm_sysreset_ops = { - .request = msm_sysreset_request, -}; - -static const struct udevice_id msm_sysreset_ids[] = { - { .compatible = "qcom,pshold" }, - { } -}; - -U_BOOT_DRIVER(msm_reset) = { - .name = "msm_sysreset", - .id = UCLASS_SYSRESET, - .of_match = msm_sysreset_ids, - .ops = &msm_sysreset_ops, -}; From patchwork Wed Jan 10 10:34:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jorge Ramirez-Ortiz, Gmail" X-Patchwork-Id: 124044 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp1493892edr; Wed, 10 Jan 2018 02:43:40 -0800 (PST) X-Google-Smtp-Source: ACJfBosqpZS6Zpn2vVdK9ct5Byfuf3vpnDP4zMDvAOj6KQ2/fnZUU0eOTtvKnQ/yPnFOKJ+auhc5 X-Received: by 10.80.182.203 with SMTP id f11mr2387710ede.157.1515581020259; Wed, 10 Jan 2018 02:43:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515581020; cv=none; d=google.com; s=arc-20160816; b=bxkhpVEpnW21q6sg9PdkOxCLS+rb+RGuMJCsBv3aYYjVw50DXbPy98JSahb0EKW+zj PQHFK+hvIe//nQ9duDixI6CFC5A3ByN2tp0gDEfwZCqi/hPTnX6aa8yST89+elXo5Gvu ormA+4m9V8Dm95rskBfzjZLJpsr0hCcYrVsQ9NSVJB77rvi+xQpVH6/2+u5F8njVScEA OzQ6dRLnF59zl0FnhYizhDZ6F1I/bN/njFA/pkYxr1HmMQTeUsH8DOgr5AhmNAgQDLzO BKLXriVTdwGYy2YVOMuo35331dpdFex9IdSdc3N2USEjt7jH1zSX9rmQTKms8/2BOBlX t5ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:arc-authentication-results; bh=hvlQFVgbiED3rtKw8y4zwjSQUG2Xo1yw4bNjpvkWwCs=; b=NNmpMtBWaiYU9SVIGSuXJsxL0WyR6vVan6c/pRh2hvKXlaPNK/85SR/8W1VTU5pdBa lHgeJEX7uOQ5sT3EKyf2OHMx9ULW0noDdLFl4xNXS/7LuSx1wxwgA0sGzWt/QmxlavrE OLdJJNvPoxFvQbuV/fnJCLgNi3QsgznUJYE0nkNHsRui4zmHXkXiPFVU+mxw9d1ks75C 7gt/5dU7WgrNK4pgBjJ1VKwGASGhhGn+c9pz5mt2KZ6P9J7N0payCvwrzpDl5IaCD6jv guhglutRezuOOnh+gkAIgzQ4qc9GzZ9rCo63sKR767k8GWWjXEIfT2J3tv3CsuS8ZDxr BJag== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=RHTcOgdb; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id x65si2027566ede.301.2018.01.10.02.43.39; Wed, 10 Jan 2018 02:43:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=RHTcOgdb; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: by lists.denx.de (Postfix, from userid 105) id 994E9C2214A; Wed, 10 Jan 2018 10:42:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id EC5E9C2215A; Wed, 10 Jan 2018 10:36:55 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 83E38C22192; Wed, 10 Jan 2018 10:35:02 +0000 (UTC) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by lists.denx.de (Postfix) with ESMTPS id 426CFC21E08 for ; Wed, 10 Jan 2018 10:34:54 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id w107so16875947wrb.9 for ; Wed, 10 Jan 2018 02:34:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=DGa8NPaKlVxCJ0cRoxqtwgwkC8YEprG7ZNL6mGwjjpk=; b=RHTcOgdbuaa89gXI4g37Hkoo8H4QFa8FORsdV2B32+R235zJC/LJj+TplzGK+9DndH FzGzBTv4ayOkM1cVGz16mi8JPXAoLn6e0pWq09UV2fPUhBwt8pBSUp6MwWNpWSdRRsks 3h8IdKs9/ogkuQ2d0v01WmnKTz+9t7ofGhaKUhX9VjTAwjlTtG9Jcz8VIrbYiA5hEOv2 JVcaDNLW9cvdOsD+bTPEuBP7dInwgtc9Aeet8HpED9ARtJ39r9Z8IKbaSLbFCtGRrQQq /MxaDZHwy2oM+bVgU3L0niobOX17eUUWEImQHC6AHt2nV7May8TQrCpsnASACbK96iY8 kWsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=DGa8NPaKlVxCJ0cRoxqtwgwkC8YEprG7ZNL6mGwjjpk=; b=oWyXGyi+2tHugoJt2aeYoZPpPtWP4lbOxuATvBihcGdObLsRSfZ8yVWoY/csf7D87F kUyuzSqn3NpF3HeC8ORObuk9GXHjLrsBzzvJKVHFaMW7fIhayVXNPYH6QoJ238kCzNQl dy7VsJkwNWZ6kxtpkRA0Raole76f93ZEZOqOr+OQ/dQvI3ZQ+qOV5cqjkL0UNehEvwIT bld6ALZvUWSYRq2Js80+3uNUE7ZJgRrx3ZQ35IWmFbLaf9s77azhLVmzRG38ciaNCjeN DXaU0PCy9LW65cYSJEpT1Mk2CVXq2Dj8/B5nV/DRs1fjM1fZhDB+AvnIa/6j4F1PLV+1 wd/g== X-Gm-Message-State: AKwxytcZLD0buGNvKGlXMG2Pgq9Thh6yn2RqGlaMHREEfmVwgSlu7cyL K6byF1l/iHIWkcOnWg8awC6mOg== X-Received: by 10.223.134.227 with SMTP id 32mr97017wry.176.1515580493746; Wed, 10 Jan 2018 02:34:53 -0800 (PST) Received: from igloo.80.58.61.254 (141.pool85-51-114.dynamic.orange.es. [85.51.114.141]) by smtp.gmail.com with ESMTPSA id i33sm21484737wri.90.2018.01.10.02.34.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Jan 2018 02:34:53 -0800 (PST) From: Jorge Ramirez-Ortiz To: u-boot@lists.denx.de Date: Wed, 10 Jan 2018 11:34:38 +0100 Message-Id: <1515580480-26075-5-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515580480-26075-1-git-send-email-jorge.ramirez.ortiz@gmail.com> References: <1515580480-26075-1-git-send-email-jorge.ramirez.ortiz@gmail.com> Subject: [U-Boot] [PATCH v1 05/07] db410c: use the device tree parsed by the lk loader. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" From: Jorge Ramirez-Ortiz We dont need to keep copies of the properties that we are going to fixup since we will be using the dtb provided by the firmware. Signed-off-by: Jorge Ramirez-Ortiz --- board/qualcomm/dragonboard410c/dragonboard410c.c | 71 ++++++++++++++---------- configs/dragonboard410c_defconfig | 1 + 2 files changed, 44 insertions(+), 28 deletions(-) diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c index 8ef4338..236160a 100644 --- a/board/qualcomm/dragonboard410c/dragonboard410c.c +++ b/board/qualcomm/dragonboard410c/dragonboard410c.c @@ -15,14 +15,22 @@ DECLARE_GLOBAL_DATA_PTR; /* pointer to the device tree ammended by the firmware */ -extern const void *fw_dtb; +extern void *fw_dtb; -static char wlan_mac[ARP_HLEN]; -static char bt_mac[ARP_HLEN]; +void *board_fdt_blob_setup(void) +{ + if (fdt_magic(fw_dtb) != FDT_MAGIC) { + printf("Firmware provided invalid dtb!\n"); + return NULL; + } + + return fw_dtb; +} int dram_init(void) { gd->ram_size = PHYS_SDRAM_1_SIZE; + return 0; } @@ -138,36 +146,43 @@ int misc_init_r(void) int board_init(void) { - int offset, len; - const char *mac; - - /* take a copy of the firmware information (the user could unknownly - overwrite that DDR via tftp or other means) */ - - offset = fdt_node_offset_by_compatible(fw_dtb, -1, "qcom,wcnss-wlan"); - if (offset >= 0) { - mac = fdt_getprop(fw_dtb, offset, "local-mac-address", &len); - if (mac) - memcpy(wlan_mac, mac, ARP_HLEN); - } - - offset = fdt_node_offset_by_compatible(fw_dtb, -1, "qcom,wcnss-bt"); - if (offset >= 0) { - mac = fdt_getprop(fw_dtb, offset, "local-bd-address", &len); - if (mac) - memcpy(bt_mac, mac, ARP_HLEN); - } - return 0; } int ft_board_setup(void *blob, bd_t *bd) { - do_fixup_by_compat(blob, "qcom,wcnss-wlan", "local-mac-address", - wlan_mac, ARP_HLEN, 1); - - do_fixup_by_compat(blob, "qcom,wcnss-bt", "local-bd-address", - bt_mac, ARP_HLEN, 1); + int offset, len, i; + const char *mac; + struct { + const char *compatible; + const char *property; + } fix[] = { + [0] = { + /* update the kernel's dtb with wlan mac */ + .compatible = "qcom,wcnss-wlan", + .property = "local-mac-address", + }, + [1] = { + /* update the kernel's dtb with bt mac */ + .compatible = "qcom,wcnss-bt", + .property = "local-bd-address", + }, + }; + + for ( i = 0; i < sizeof(fix)/sizeof(fix[0]); i++) { + + offset = fdt_node_offset_by_compatible(gd->fdt_blob, -1, + fix[i].compatible); + if (offset < 0) + continue; + + mac = fdt_getprop(gd->fdt_blob, offset, fix[i].property, &len); + if (mac) + do_fixup_by_compat(blob, + fix[i].compatible, + fix[i].property, + mac, ARP_HLEN, 1); + } return 0; } diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig index de923ad..4389f52 100644 --- a/configs/dragonboard410c_defconfig +++ b/configs/dragonboard410c_defconfig @@ -47,3 +47,4 @@ CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_MMC=y CONFIG_OF_BOARD_SETUP=y CONFIG_PSCI_RESET=y +CONFIG_OF_SEPARATE=y