From patchwork Tue Jan 9 09:12:28 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: 123932 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3977832qgn; Tue, 9 Jan 2018 04:46:14 -0800 (PST) X-Google-Smtp-Source: ACJfBot0l1gHxEyUHQpna+nKMbtm12y57gNlinz4jGYvjaTE1o8DACzyKPUxrdWnaODmii9OyjhW X-Received: by 10.80.184.103 with SMTP id k36mr20982022ede.102.1515501974639; Tue, 09 Jan 2018 04:46:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515501974; cv=none; d=google.com; s=arc-20160816; b=zaXhlzh9ygyNoCYr/zeRK5Yc1i/FsFGderHfOcGWTBJYRiWeyIf5NVHeQjVMy5L6aE sTIlBou1mQELu8ZKL+aqBxhlnzXZztokjtq8pkIyNeIbYexlI5GtOSI2sERjXd0KUmD8 Ry768Ytpp0N2cllU2AkMWj2NVevpb7zSaCQgRZl03yEGRuMRdm1m+kEufgguQikbtTpM saALthMSsttUq+0TRneFgit7xTZmFUfruk6h/f4H1ZRcSkah5+228WsAP/31k1oU436a iJOTUzp2XyvYedHRssHrnbQS7CL6kF1UozksvZA8omw1mLw6HxbNxokgqcVcVVyADs/H gACA== 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=mR5lu+OxtZwAoolb31+JJzvymHEoQ3W1R11iRxG1x1PimqnsqehLpPZ+Vq3AqniElH ATq3vQyQAOX2ic+/0ZjfN+wEIKIcUPUsVNA8JR4Cw4QJOQQEW1Uz9Uhi5NrksDWeoHH9 sSv+gH8hrK1bs2TdgtSX0GW998QGrZpRiyTGine36M/Y49FIDKlar5jIuYMIeKh/B4O8 g0mPwWmJTWvRopDxP7rkB9jv0iG3OI66ykzA/M9o4cGCzU2rkY0/RUFuvD5ayXOTF8Tf yEjcSbLdopx7tgwpOVXW4dMzX5gv02Af1QAkZqy+SbbSBjnzKcDSYJhs3NM/WKLRmuy7 Kjqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Us8oCcRc; 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 b53si2705365edd.373.2018.01.09.04.46.14; Tue, 09 Jan 2018 04:46:14 -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=Us8oCcRc; 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 2F5F3C21F90; Tue, 9 Jan 2018 12:39:02 +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 A0A87C2203B; Tue, 9 Jan 2018 12:34:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6AA41C2203C; Tue, 9 Jan 2018 09:12:39 +0000 (UTC) Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by lists.denx.de (Postfix) with ESMTPS id 17C42C21F98 for ; Tue, 9 Jan 2018 09:12:39 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id f8so13408967wre.4 for ; Tue, 09 Jan 2018 01:12:39 -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=Us8oCcRcnD+cCksIc930ib7k90Na/n5RRazmXqA2YNA+YZan0rXuOZ7rCjfJfb6k6/ AwMSxouzNBYLiigK/D1PySWomNxCWymQz3Irg8BuZ09/odyUgfTRD1iksLiDVTju0AaK /3ZLwTc1IMEKUbZ4K84J89v5zl4R7syLcAehz/8kgiWF+It9q2k2+BOa5a23Ydda+GGE JLzPh91hDv6YjX4H+y6vv7MyJ37ljRN76T9z+PcDEkAz0RrfQY+WFrbL3Qx2OnRMQUDn IOc+UcuuMu3186b+awDOd/Jg8hb1aAWSKq1/r9mIvApVCpskDIcvBiUFmOu9P9FEX53O UvWA== 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=VzGQJBTCZafJm2FM7YNCBzLqfid1AxDQ12cWfhJaeOhhCApP9lkj7Xx7x1JqnnW966 4AZnHdtfYxSkO7/PUV0hSKPIgADKNq0IqoiPRn65NgjvTMURsEfhotlIC1TJLrZDsWuZ SCVE16xyd1KEjr/KiTgzm3IRc4MW11qXqGr++WA3NlwtkUa/VhOxq3PHc1fcCanDK2wz kXok2h5YODtEX7z+kn+7+hrPXNXNdGxsJ7HhgQP6REUk5kchkqfWFmWF+RZVCNCt5XD2 TWBCcq+xz9fUmpHpSPpU8+mhccOVQrJSfoXBRUcQbWHh3QE999XzIIgBFdMLkQKU/YSW TE6g== X-Gm-Message-State: AKwxytdRl8qg3krB9baHYCg0A0LFhLw2qAYSoAnM9r3jpZp32xvUDAKd vzroCDtUgUTHZmiigPh6ySEUKw== X-Received: by 10.223.176.79 with SMTP id g15mr798608wra.34.1515489158863; Tue, 09 Jan 2018 01:12:38 -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 b8sm18496598wma.2.2018.01.09.01.12.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jan 2018 01:12:38 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez.ortiz@gmail.com, pbrobinson@gmail.com, u-boot@lists.denx.de Date: Tue, 9 Jan 2018 10:12:28 +0100 Message-Id: <1515489154-6946-1-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailer: git-send-email 2.7.4 X-Mailman-Approved-At: Tue, 09 Jan 2018 12:34:32 +0000 Subject: [U-Boot] [PATCH 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 Tue Jan 9 09:12:29 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: 123926 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3974906qgn; Tue, 9 Jan 2018 04:43:09 -0800 (PST) X-Google-Smtp-Source: ACJfBotTgTe10LnMhoPPESocJi41xKNI/IAUvmzG4PHPfPBVGjLJSBfjDlsQgBjrFrghxlfgAJ/a X-Received: by 10.80.158.79 with SMTP id z73mr20686274ede.134.1515501789855; Tue, 09 Jan 2018 04:43:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515501789; cv=none; d=google.com; s=arc-20160816; b=rtLM73mZac9R5DfspzBzyDjOSCOhP8JJNJHxOGUrr3/aQxjYWGQ08NiELUJ9nZmxRi cgcMTVxinyKPPoJUzhEx9+M3+/j8SVybtje/5WbwUvGDVZsxRQOX3ck486no1jwtxks/ QDa4Nb4hQuSfRIPcrq7+penOQJfjJEDXM2Z3Jfmq/bgFlwG6F10274kNmgb7SYa1Mord fwRwUnxM1lGKQSPNvSK70wNEYGw5ABo0jS6fhWgu3bLJX5FsfBsAiepyO222EjM+zJON a7ckJEX4dxiN7H2BBTpYdurnGTwpusH0bfT517UiDHucZtCvepg1yZSHtF8XGm3gLTLw O6Ew== 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=YTOu3jS9MJn9A94RsywX//6MWcvhCAXQqPqrlOKR8rBC/RLzO0G0ADjl83ZJtaPsj1 4f2AO5Prkz94Yz8HPEoGkPFYL1o/Dd5P8lUPp8jJOflmVihILUqGBgRT6tX2ubyJtND6 inl27QbsSGXsClKFpFJoWnv7RUQzK/c1nCpJDOOPG1WAngHpDktamxh7NqFx1xousZxD YOjRbS8dhFdLlP6LKbSOLAoivWN/Ryl0mgXyDwciezglvgjdzEcrF/uInA2PDxXttGe5 UBcBh1MtFvBKO9xtP1f1zFqgDcI/JZ2aU3eDrVskOt+SC0tR3nbsJg9QDfSAcYdj6ss2 0J6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=YM061Wgc; 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 m7si818932eda.508.2018.01.09.04.43.09; Tue, 09 Jan 2018 04:43:09 -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=YM061Wgc; 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 7674DC22018; Tue, 9 Jan 2018 12:39:21 +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 C0DEFC21F90; Tue, 9 Jan 2018 12:34:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B42BCC2203C; Tue, 9 Jan 2018 09:12:40 +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 60AE8C21F98 for ; Tue, 9 Jan 2018 09:12:40 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id 16so907977wry.12 for ; Tue, 09 Jan 2018 01:12:40 -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=YM061Wgcm1sgIgPBDcZ+fPhLhngKz0DXKP40O2/AOv/S/Oe6xSUOKs8Rh8yOK7STWq UT7qEKvb0OmDxs+VFPgkMR3GKqBLWt8zM1tvB9uoqD23fGDT+vrf15aanvlcihsPCWjC BPw7VPZshOhIzJ41lpr3FD8tU3i0Vke1Nh7BkSxvotkCkefQq+GYVcKT9FCW9Fok85uo FE/Yxul+Ert2UkMsejxCY6D1o46dfFs7w56IduSdBmiRoHSaijkZBFDVyFsIWGefy0Y4 OfdfwM5+93biUQx+buyQuoQX3uvZHAfuCTHLk2M1+xStHQwTcpvrJAYWed9AmPQAzOC1 faxA== 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=P2Mstfr8P7IkclYuaeeDcAwPfmeRuMoATx740YLyXSiS2vvcluondw6nI14IBjYif2 2AFiIHIt9oJvX9Dw7+GY9UJNa/V2HgBTE19MZ+SRnMpHy2EpOxXYMkWpOHZ7V+VA4aFS HeexyMrlQEuV8pl3ggxsdcgzNnfY8qyYgDxlA/HhyupfsdXN9ETHjJYPR6gXajxBC/k4 Ipm3cImkrcXvJQXMj4vmewFUS/0JCT5mMqnt/czYQXkzU8BV5IGbXbaP0ZvTHGjmtacT nVwmvUtRjtWY+FpTqaIzzcaoZZIuBlstj5mQWMSLksbCWDL9VzqJNXXsjfRti9wO31V0 gMvQ== X-Gm-Message-State: AKwxytdARe6tkihLQYaO5IOXzfBv6MzV5VBggy0XAJej1msVLd7FqhbR VuT9ER0od8gi47Sh8bqbXjE= X-Received: by 10.223.152.103 with SMTP id v94mr3182451wrb.233.1515489160021; Tue, 09 Jan 2018 01:12:40 -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 b8sm18496598wma.2.2018.01.09.01.12.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jan 2018 01:12:39 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez.ortiz@gmail.com, pbrobinson@gmail.com, u-boot@lists.denx.de Date: Tue, 9 Jan 2018 10:12:29 +0100 Message-Id: <1515489154-6946-2-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515489154-6946-1-git-send-email-jorge.ramirez.ortiz@gmail.com> References: <1515489154-6946-1-git-send-email-jorge.ramirez.ortiz@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 09 Jan 2018 12:34:32 +0000 Subject: [U-Boot] [PATCH 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 Tue Jan 9 09:12:30 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: 123925 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3974202qgn; Tue, 9 Jan 2018 04:42:23 -0800 (PST) X-Google-Smtp-Source: ACJfBoudH4lD09jIde7sFFvK500Gki693hVmjYhlTLSCpMr6TWuyAfLaswwiYoel+gz3ltGMCRpj X-Received: by 10.80.217.76 with SMTP id u12mr20881755edj.171.1515501743666; Tue, 09 Jan 2018 04:42:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515501743; cv=none; d=google.com; s=arc-20160816; b=bT6kmf6Mafwl6z7eWWipvGNVbdrJoZ+wpdGFInonZkrqHes4MpKTpzsMn8zboYJEfE whIQrgkb5CuEPh8yfW9rfptil4u1fCRkWCzdNZ13Cxorp5rGHQ6jw0H29/JLqRD05izh 60wd0jjBFwiUsmIooh3sHS5vXsBabI3lRtS6aPSZNZbBEBWOfrPe2fb2em5DshWD9jkO S5A3UzDgqcWktUDjVOLY9zxHALoEhjsOkPfzPaLj/ZSFb7jZcMyLseXHfyu1+DN7w3GO Zh27sZ07boD3UEX3ppFgqJiBDiPjyrJWTBBkhOAo4tBU8OYbJdIonIiR38zfFymIOW3I xYIA== 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=j0X5uCvh9Qm+xY8SqhmAYOV/IQqzz6QxTnVGhFMTGzDdR4ZXPdgyEIDg1wzdIRfTWd OIKQc5Xp7jl+NQk9k1XYuz31vw7Mj/lUWbfA/v3WpzVzwM6GlF0MqTVTjB0GcYqrU8OE aywMUmBryZvpJj9oyzjyI13OdUXBIiix00gBqz2PZG3YGW9fx1Mc/SIkRSvPsUOxDT02 d30udP21uw2mBb9b92FQVjksUHrmbnDdCyDOtVWkPbKFGO3EhDzDJjaOmi6oMV/OaL9Z NsosFxwcxSzgBZCH+cjLOFRvmfaHfgWtUUJ4RyVfWzCRPfTgxTEMhbFAuD6Gn8+qe7+K fiGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=YaEQhEM0; 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 c20si1209350edn.174.2018.01.09.04.42.23; Tue, 09 Jan 2018 04:42:23 -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=YaEQhEM0; 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 3F546C21FF6; Tue, 9 Jan 2018 12:39: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_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 4D47AC21FD9; Tue, 9 Jan 2018 12:34:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E0114C22072; Tue, 9 Jan 2018 09:12:41 +0000 (UTC) Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by lists.denx.de (Postfix) with ESMTPS id 7CB86C21F98 for ; Tue, 9 Jan 2018 09:12:41 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id n9so3528245wrg.2 for ; Tue, 09 Jan 2018 01:12:41 -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=YaEQhEM0XIfe8Ci3Ewfbwrsf/zcgzzD3bq55GqOjpIreWkm0x1yau+wsvtRT6oNxmA 7ILJgpzilYYrfwcl/38HuasbBcKCkBghvASfdNmD5dGfOZX/LIqaHWG5rP34vfs9IE3R 9R69uynieKdrjAejbK8Rcpa46r+azXuOm5S3DY9bd/gkSMShdFainvbXAxGqK8I2Wanh NWrvRQy5+jPlm27ixZWRSxUc6C3TafjodzN5bHtLDgUItBXmuESzkz+28QgAXuXzTtbu Bj89aQ6dbIIDXcFyxCYM4TM51r9HCf6T4aMxBT9HfJic2hD/i7tI65PCXnTkKtucro1G RrVQ== 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=bFvJao4CgDcLDWxSVUnTzCAGW0ECUbxE1XnY8TnZudDm98ZPELIsr4XzjZMXBworWk imC11CLYYgP2hn6uKgvVaGM2wec2ZB4MDdEgB4LrT7L+qN37JSXr1yFJhzQlCYygipO8 8YGfetA46jiIJ4WLX9aTkNzHzX34w+BtW4LOSc+ecrKYxThXCidV7qwPwWpvn8fHWZWI prkpKiqGz4rbw8Rj2y5+6K7qpt4KOd4/dSzT6ayW22c2G/z1EmdrgWrxyGJinqIWAFNo WJaq58R9SKYEaZbEmX5U782YE1fzpclDMf/t6Tl9efpMnV+dhagC7AbpT0KmwHlhcpwn s3UQ== X-Gm-Message-State: AKGB3mLBMgTgup7YLP6zkxVcfs29EMCSOSNVH7ujOUm4824C353V48Jt T6pEVSWY+EI5Q19zPoZaZjg= X-Received: by 10.223.188.75 with SMTP id a11mr13680438wrh.184.1515489161182; Tue, 09 Jan 2018 01:12:41 -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 b8sm18496598wma.2.2018.01.09.01.12.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jan 2018 01:12:40 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez.ortiz@gmail.com, pbrobinson@gmail.com, u-boot@lists.denx.de Date: Tue, 9 Jan 2018 10:12:30 +0100 Message-Id: <1515489154-6946-3-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515489154-6946-1-git-send-email-jorge.ramirez.ortiz@gmail.com> References: <1515489154-6946-1-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailman-Approved-At: Tue, 09 Jan 2018 12:34:32 +0000 Subject: [U-Boot] [PATCH 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 Tue Jan 9 09:12:32 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: 123931 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3977373qgn; Tue, 9 Jan 2018 04:45:46 -0800 (PST) X-Google-Smtp-Source: ACJfBotbSn5WQvcym09VaWUKnMNrp7kPmiDON2Y5ebl27PCGbQL5NpJCgtF7KkhX9e6ppsQyzdU1 X-Received: by 10.80.231.13 with SMTP id a13mr21224923edn.264.1515501946040; Tue, 09 Jan 2018 04:45:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515501946; cv=none; d=google.com; s=arc-20160816; b=BmiUbSx2Q3MAXsePA87XpdT4TdQ9C9zsxCRMIjS3LY4RS49wUpS00xpnDAZjPpe5R6 gryT+mydMxdkUXJqEuUrg9X4TcRoDX6vlSvCQZRJ9EDqBXvvMQDDMxaTs33qN/mqZ/Fd adaMxC81iYc/DAtNPjAxT2H7SvpbFiRfekYPhGSTUncrcFWL7m/Bl9NbIzy/KX6pWoG2 VS2DWp60jhzIxkgt/XaTGOTDxIV3pwvQZRE+xAtYa+1vPMmzmQd1YUj9argC5J0PCcko xvRlm2DDJ9Kt5UvRNkiokmoevoHde/xSW5pP84zGLutPWp0Wb34kThfBdTmc2z9ADv6K Bu+A== 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=VAMrSdRozlviajhBg9TY19ZFz0O2qlzCzblyDAfQqj6pPqjh5HPUWlnJo9YcBIZXTV o2988+Z7I+Nm8vuu4YkwWYDqx+4LsZ9HAmK0O18AW81n6k03k0rRKmZAgI04CLtc3Rkb CfLHrQwlSBNrfTFqrWh/qVUN6NYFcM7KCZy7UJHL1y4G5DAHvZdNzc+ANMtsbdoxnttY 8/9OzROcSe7iktB4Rr47/2iHberH214mD1SjRbbhChloUNl6+27iL50kvBzCMCV3H+l1 eX+VCo0p9DjIeM62f0BWOMWapRQqf23KwaQ9np1x88jQEC3GQNLP/0Z55Fom2ni/8BMi izGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=GkrfOMqQ; 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 34si9541293edi.265.2018.01.09.04.45.45; Tue, 09 Jan 2018 04:45:46 -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=GkrfOMqQ; 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 9B50FC21FB8; Tue, 9 Jan 2018 12:40:14 +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 D7684C22051; Tue, 9 Jan 2018 12:34:53 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2CB31C21F98; Tue, 9 Jan 2018 09:12:44 +0000 (UTC) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by lists.denx.de (Postfix) with ESMTPS id CADEBC22072 for ; Tue, 9 Jan 2018 09:12:43 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id b76so19240457wmg.1 for ; Tue, 09 Jan 2018 01:12:43 -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=GkrfOMqQnNhNHLA6Z2rI/0Dga2Q1I0le05fPYd1Smv0kRwkuB8jp4H8lMC6zTy3Zt1 8xE2HVZCSmaiD0IMxcXnZy8g1KNAkuMLU3oQZHszjso3T4DOmJS3B6+cXZ5pgXelUkdt bfuuRO6k19Dc+sS5Ea1j6hL91CLXd6EkehrfiG91F7S7VWPunsuAOW6cOgSXSwLR8PtZ n4daP/QUFbQslBNI44RhXpg5OyFChQClXCe5CczhLMX9DR4lXsHDRiy4huP2CxcwWDr9 nUc6lmE/B9W5MyIe8n5F1ACxLMJlKuHiXSoxp3hiTlCc0ByXwhSpJ0/6Y796evz6jvtP 5IJA== 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=NMasb/eWjFYdAM5eQspRdhND8b5bPMXlqc1LhgRXLXztAziFNexeqpK+GiQmGnqDbp 6G/mfDdEStNQ30tNIZDq9KUStGXwiIgKZ/ScVUhQkCREwWHLudkcvTf7dnP2Hcuv5PiX NfNATXe/3cFzGJGNppRyqDWFAbWt27VQCYFaqabcsr2W/rX6MIxbbEqg1nVcaUqRfNuh XMYn2udHvDqJWjnnDIYcMZcbycE1asw9orN++0PI8SJTDouztrWfKGCA69yf22lVekmG JB4u8vwvwsycrZUIdQG3R1fPgLp7b2MzzYtLpXVxPBR1gUqQSfGuU5XjN0s5h9QpncY2 7dGQ== X-Gm-Message-State: AKGB3mKD9bPP317xBnMPxgPKugNP4SbEAwV8sCKCRWUAYHONGS6GObN3 02jW23orCQEjw0gM7oB3dfw= X-Received: by 10.28.1.196 with SMTP id 187mr12409006wmb.154.1515489163542; Tue, 09 Jan 2018 01:12:43 -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 b8sm18496598wma.2.2018.01.09.01.12.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jan 2018 01:12:42 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez.ortiz@gmail.com, pbrobinson@gmail.com, u-boot@lists.denx.de Date: Tue, 9 Jan 2018 10:12:32 +0100 Message-Id: <1515489154-6946-5-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515489154-6946-1-git-send-email-jorge.ramirez.ortiz@gmail.com> References: <1515489154-6946-1-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailman-Approved-At: Tue, 09 Jan 2018 12:34:33 +0000 Subject: [U-Boot] [PATCH 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