From patchwork Thu May 9 20:11:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Goldschmidt X-Patchwork-Id: 1097660 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZzV3HPp0"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450Pdy1xy1z9s4Y for ; Fri, 10 May 2019 06:12:38 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D2240C21DA1; Thu, 9 May 2019 20:12:24 +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, 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 B1904C21CB1; Thu, 9 May 2019 20:12:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E64B9C21C4A; Thu, 9 May 2019 20:12:08 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by lists.denx.de (Postfix) with ESMTPS id 43BD9C21C4A for ; Thu, 9 May 2019 20:12:08 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id y5so4695233wma.2 for ; Thu, 09 May 2019 13:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TfpI/B11tRb0hE2BA2hllAWc7ghMUnkM2+ElKHeDewI=; b=ZzV3HPp0XZkDZjKHZxXHJyhNpY3G1YxmNnBR3KjV6SGQaPivunCNtgfmivETIENvQw 2Rl9gdbPDG6Dkqe0gwWEe918/dULFKy7+ngYNhZi+hXadmqgiQHR0vwx39WKTyPD+6QJ Sm5U2AvSF369Askovs4HFoXpCuB9QPx/jpNbY+WcHqhUcTaTD9UdiAGVLx4luwlQc4jm b41g3YCM9wGSlnuGgCNLWhpY0ySEA8vfp+J87AoqnHrMMqUfduJI9Y41ogeiQk2uRXIW uQ1f3L/jIqGEixDRFFo9ymW2Nm8LQ/ZX0xavwtRvv1g+g0i8uJ4Ue4decpRuhAIgpsZJ 4Slw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TfpI/B11tRb0hE2BA2hllAWc7ghMUnkM2+ElKHeDewI=; b=OsPMuugxFwMV5F9H0Ih93Lu9SdE+T3DZGCv2poC5XgKOglsNg5+alz8RR0KccIfAqK pVR+Y3BUkfo01jl05WueMCG5jcLcfGi8D35XzcV/qeZ/z+BtavHzwLNf+I5+n2BYS4yL gW7C8ZRPUCxeJs9Z9adT2knhm/s2gY0gKV55+RNI1fPu1UJX+dwIEsC2DoMUNSBuSEoU o9a7c6JX6GcW1Ci7l/KVopJimFSAR5O/0M65s11NSf1UxinqL5GghvKKa/faI/BfGRYb IWc6rSJYrxBWTR51pLkutdcFpSf+VOxoDFiLIjw78TDdRi/cDmz/lgMt1UBy3kD4t5Qa kfQg== X-Gm-Message-State: APjAAAVp/QxZXIxfeETr0JP78fcanyesQ5bHRGujQeTipZKdDIBk2fyI 1+oZIBc0e/wpPGojgZNXpLA= X-Google-Smtp-Source: APXvYqyo/QuXSbQiTuecl35HvdXV/bYOb4Lnv7vbvXbNfC/CvqZrC3B2wypCGQ4oQ5Hl6bIscuvpRQ== X-Received: by 2002:a1c:c1c8:: with SMTP id r191mr3252583wmf.99.1557432727992; Thu, 09 May 2019 13:12:07 -0700 (PDT) Received: from ubuntu.home ([2a02:8071:6a3:700:2df8:99ba:e50f:756b]) by smtp.gmail.com with ESMTPSA id a20sm8326402wrf.37.2019.05.09.13.12.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 13:12:07 -0700 (PDT) From: Simon Goldschmidt To: Marek Vasut Date: Thu, 9 May 2019 22:11:55 +0200 Message-Id: <20190509201200.10336-2-simon.k.r.goldschmidt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190509201200.10336-1-simon.k.r.goldschmidt@gmail.com> References: <20190509201200.10336-1-simon.k.r.goldschmidt@gmail.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/6] timer: dw-apb: remove unused DECLARE_GLOBAL_DATA_PTR 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" The dw-apb timer does not use 'gd', so remove its declaration. Signed-off-by: Simon Goldschmidt Reviewed-by: Simon Glass --- drivers/timer/dw-apb-timer.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/timer/dw-apb-timer.c b/drivers/timer/dw-apb-timer.c index cb48801af1..86312b8dc7 100644 --- a/drivers/timer/dw-apb-timer.c +++ b/drivers/timer/dw-apb-timer.c @@ -17,8 +17,6 @@ #define DW_APB_CURR_VAL 0x4 #define DW_APB_CTRL 0x8 -DECLARE_GLOBAL_DATA_PTR; - struct dw_apb_timer_priv { fdt_addr_t regs; }; From patchwork Thu May 9 20:11:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Goldschmidt X-Patchwork-Id: 1097663 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dI9zq6F0"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450PgL4nCyz9sB8 for ; Fri, 10 May 2019 06:13:50 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 6C795C21DF8; Thu, 9 May 2019 20:12:50 +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 04F74C21D9A; Thu, 9 May 2019 20:12:20 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4834AC21DA1; Thu, 9 May 2019 20:12:12 +0000 (UTC) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by lists.denx.de (Postfix) with ESMTPS id 30B46C21D9A for ; Thu, 9 May 2019 20:12:09 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id y17so3849950wmj.0 for ; Thu, 09 May 2019 13:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qa+kzLq51J8ae+C3SBMPTSCdmcNX/mT+yjcxGC2uZDc=; b=dI9zq6F0JsNQf2eEu9/mHHfqqahKS98SHGtv24CauGAMbyXggXT7k3vPjU6XuXAc2m Pv3X8L4xmXvLrdeHRLaYWY2nTR4lCCP6INmPyuj5tZHld5SGtZb8lcQVTHPUv7w/woSd zpA4soVu/Rdr8GfWUP4EFiRUoa1+kRDMBZd25GgRESASn9nMyzN209ekI/FfbEhH+4DH UdEtvrpchfbgrXz+Ppfk9NAOsfClbfo91lGU24vwjNK12qZHcBl415EG6v5NoNo+aymZ dw5i8c8XKdcMchZKiaoEcwY6bLDHtw73tJoFL0yBNBKS4NJ1YVvUThZu2kZvJyliYACQ kHGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Qa+kzLq51J8ae+C3SBMPTSCdmcNX/mT+yjcxGC2uZDc=; b=A8klywMPJUys5mw7n/E4ODQYnqZTi4hkCnaFDd1+Wn6cU0MSVWTx42Jhk7058eqK5M NJQb6qxqb0+LWq0z+hdgpXfqLqhueao3k62RbDpBaSda42xjVNtt3RFXncGsa66T9gMc YCy1jFertpSrRcz6W7tSrTD+XM0FOnKol89665R/0udnv2VXQt6x0mpWzJyPTEszeA2p oUrUE2rexQ61tR1JrJSq7I7RtdFR/r+ulHBkPjSj/djSmiVDyYw6b/Xe+0fmOJgZ+bT2 n5xocxeF03JLCNOy5HW+CJfkOUKGMcr9d63+WWqFH7aKxVUFjqIOvb1KssCktY+jkOAq Hlkw== X-Gm-Message-State: APjAAAUdDGsnZUsJ/9CurCXZ6K0zZyO0ekrC/zaNknyH3bFauIialN+c D8C47kMzJsf10ybNy5Ou1NO43l+l X-Google-Smtp-Source: APXvYqzmfnKVGfAfNric1JuUXhzk7KPZm/vW2ossQClvokYqacfXd5YytK1kMfZMoM/PW5ACOSkqXA== X-Received: by 2002:a1c:1902:: with SMTP id 2mr4117993wmz.153.1557432728860; Thu, 09 May 2019 13:12:08 -0700 (PDT) Received: from ubuntu.home ([2a02:8071:6a3:700:2df8:99ba:e50f:756b]) by smtp.gmail.com with ESMTPSA id a20sm8326402wrf.37.2019.05.09.13.12.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 13:12:08 -0700 (PDT) From: Simon Goldschmidt To: Marek Vasut Date: Thu, 9 May 2019 22:11:56 +0200 Message-Id: <20190509201200.10336-3-simon.k.r.goldschmidt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190509201200.10336-1-simon.k.r.goldschmidt@gmail.com> References: <20190509201200.10336-1-simon.k.r.goldschmidt@gmail.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 2/6] spi: cadence_qspi: convert to livetree 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" Convert 'cadence_spi_ofdata_to_platdata' to use dev_read_* functions to read driver parameters and 'dev_read_first_subnode'/'ofnode_read_*' to read flash (child node) parameters. Tested on socfpga_socrates (socfpga gen5). Signed-off-by: Simon Goldschmidt --- drivers/spi/cadence_qspi.c | 39 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c index 41c87004d8..e2e54cd277 100644 --- a/drivers/spi/cadence_qspi.c +++ b/drivers/spi/cadence_qspi.c @@ -18,8 +18,6 @@ #define CQSPI_INDIRECT_READ 2 #define CQSPI_INDIRECT_WRITE 3 -DECLARE_GLOBAL_DATA_PTR; - static int cadence_spi_write_speed(struct udevice *bus, uint hz) { struct cadence_spi_platdata *plat = bus->platdata; @@ -295,36 +293,37 @@ static int cadence_spi_xfer(struct udevice *dev, unsigned int bitlen, static int cadence_spi_ofdata_to_platdata(struct udevice *bus) { struct cadence_spi_platdata *plat = bus->platdata; - const void *blob = gd->fdt_blob; - int node = dev_of_offset(bus); - int subnode; + ofnode subnode; plat->regbase = (void *)devfdt_get_addr_index(bus, 0); plat->ahbbase = (void *)devfdt_get_addr_index(bus, 1); - plat->is_decoded_cs = fdtdec_get_bool(blob, node, "cdns,is-decoded-cs"); - plat->fifo_depth = fdtdec_get_uint(blob, node, "cdns,fifo-depth", 128); - plat->fifo_width = fdtdec_get_uint(blob, node, "cdns,fifo-width", 4); - plat->trigger_address = fdtdec_get_uint(blob, node, - "cdns,trigger-address", 0); + plat->is_decoded_cs = dev_read_bool(bus, "cdns,is-decoded-cs"); + plat->fifo_depth = dev_read_u32_default(bus, "cdns,fifo-depth", 128); + plat->fifo_width = dev_read_u32_default(bus, "cdns,fifo-width", 4); + plat->trigger_address = dev_read_u32_default(bus, + "cdns,trigger-address", + 0); /* All other paramters are embedded in the child node */ - subnode = fdt_first_subnode(blob, node); - if (subnode < 0) { + subnode = dev_read_first_subnode(bus); + if (!ofnode_valid(subnode)) { printf("Error: subnode with SPI flash config missing!\n"); return -ENODEV; } /* Use 500 KHz as a suitable default */ - plat->max_hz = fdtdec_get_uint(blob, subnode, "spi-max-frequency", - 500000); + plat->max_hz = ofnode_read_u32_default(subnode, "spi-max-frequency", + 500000); /* Read other parameters from DT */ - plat->page_size = fdtdec_get_uint(blob, subnode, "page-size", 256); - plat->block_size = fdtdec_get_uint(blob, subnode, "block-size", 16); - plat->tshsl_ns = fdtdec_get_uint(blob, subnode, "cdns,tshsl-ns", 200); - plat->tsd2d_ns = fdtdec_get_uint(blob, subnode, "cdns,tsd2d-ns", 255); - plat->tchsh_ns = fdtdec_get_uint(blob, subnode, "cdns,tchsh-ns", 20); - plat->tslch_ns = fdtdec_get_uint(blob, subnode, "cdns,tslch-ns", 20); + plat->page_size = ofnode_read_u32_default(subnode, "page-size", 256); + plat->block_size = ofnode_read_u32_default(subnode, "block-size", 16); + plat->tshsl_ns = ofnode_read_u32_default(subnode, "cdns,tshsl-ns", + 200); + plat->tsd2d_ns = ofnode_read_u32_default(subnode, "cdns,tsd2d-ns", + 255); + plat->tchsh_ns = ofnode_read_u32_default(subnode, "cdns,tchsh-ns", 20); + plat->tslch_ns = ofnode_read_u32_default(subnode, "cdns,tslch-ns", 20); debug("%s: regbase=%p ahbbase=%p max-frequency=%d page-size=%d\n", __func__, plat->regbase, plat->ahbbase, plat->max_hz, From patchwork Thu May 9 20:11:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Goldschmidt X-Patchwork-Id: 1097666 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="m20C/ZQj"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450PhR6HVjz9sBV for ; Fri, 10 May 2019 06:14:47 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 8279BC21CB6; Thu, 9 May 2019 20:13:18 +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, 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 2E730C21E1E; Thu, 9 May 2019 20:12:24 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E73ABC21C27; Thu, 9 May 2019 20:12:13 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by lists.denx.de (Postfix) with ESMTPS id 0F45FC21DD3 for ; Thu, 9 May 2019 20:12:10 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id y5so4695320wma.2 for ; Thu, 09 May 2019 13:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1SLMRzWczuNfUCUwN+RIUjLV8pc7CY/xg6Z2za+qU2c=; b=m20C/ZQjJda5cpGmgqFaeOn8+mVAQNICBDytsxlmW/2pOUOQbbXeIT4lN3ikPQpk4B kheFYmhw13xfCT+7KDXtBPJzpAxjADvH2FNnPWm0ArSHTwZTXfdy3THV8h2t+5HcEsgs DLV0DMKDK4VwAqWGMobJe/SWmQYPAUJnnMxyc05H/PhbdQq/k8e7brWMz5m4gtIe8RHF sdJbuvORIBTPkSBBwpkTyUakQDpinVi8sJo7SuI/cqq1ZTCiRR+cn8+hTSbBrNRsVNcF GTEE1/6f4jZ77zwZuo2DSRVnwScf4xFefBdhWm1CsK90GPWU4BguKnswIEINoSQpgeSk leCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1SLMRzWczuNfUCUwN+RIUjLV8pc7CY/xg6Z2za+qU2c=; b=ULQbXB6NsWRzZQLYr8pYEgEH3fSVDRcL1XGY95eP0DCEEF9MwsRfl6OJr/MpCisJMu 4lTY0TQh82SeQi3pUFIbD9z9X/LwOtmB0CcaJR/Ti0tQDQ9ORnlQ99ulvsNF+Ex2nu48 GvWfrJo56r4GdiijXokv2RlggURl5NpOZnZh0kmLO/7w0X9EafscqMw/xPidsZ7lIDxd YW+AGWj6DAjisTxM6heCyOtYGWSOiuaxCTXiCLrCoVSUrItQY8JigBGADE9KgpS37J8D 5+gS1ZcIQUe/IRNq4Fhp2UizVFasiCLb76PMnv+lA8ix1srfrccbtCeTGXj5vIWBvRRb iTqA== X-Gm-Message-State: APjAAAXIPlpJBxnivzhSokT0AOaU9kOitDt7JBb/+xogrwM1QXlhhm/K ep8RxNGTce/uaDCww19yGUs= X-Google-Smtp-Source: APXvYqzJVwJh1OBT3IBoGl3+JKXONpdZTYm5a0mD65yQIu2FrZtiPtu3tkUMO02XAfHAr0iABNi9FA== X-Received: by 2002:a1c:f504:: with SMTP id t4mr4145048wmh.121.1557432729788; Thu, 09 May 2019 13:12:09 -0700 (PDT) Received: from ubuntu.home ([2a02:8071:6a3:700:2df8:99ba:e50f:756b]) by smtp.gmail.com with ESMTPSA id a20sm8326402wrf.37.2019.05.09.13.12.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 13:12:09 -0700 (PDT) From: Simon Goldschmidt To: Marek Vasut Date: Thu, 9 May 2019 22:11:57 +0200 Message-Id: <20190509201200.10336-4-simon.k.r.goldschmidt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190509201200.10336-1-simon.k.r.goldschmidt@gmail.com> References: <20190509201200.10336-1-simon.k.r.goldschmidt@gmail.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 3/6] spi: designware: convert to livetree 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" Convert 'dw_spi_ofdata_to_platdata' to use 'dev_read_u32_default' instead of 'fdtdec_get_int' and get rid of DECLARE_GLOBAL_DATA_PTR. Signed-off-by: Simon Goldschmidt --- drivers/spi/designware_spi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c index dadb6fa18b..7d58cfae55 100644 --- a/drivers/spi/designware_spi.c +++ b/drivers/spi/designware_spi.c @@ -22,8 +22,6 @@ #include #include -DECLARE_GLOBAL_DATA_PTR; - /* Register offsets */ #define DW_SPI_CTRL0 0x00 #define DW_SPI_CTRL1 0x04 @@ -155,14 +153,12 @@ static int request_gpio_cs(struct udevice *bus) static int dw_spi_ofdata_to_platdata(struct udevice *bus) { struct dw_spi_platdata *plat = bus->platdata; - const void *blob = gd->fdt_blob; - int node = dev_of_offset(bus); plat->regs = (struct dw_spi *)devfdt_get_addr(bus); /* Use 500KHz as a suitable default */ - plat->frequency = fdtdec_get_int(blob, node, "spi-max-frequency", - 500000); + plat->frequency = dev_read_u32_default(bus, "spi-max-frequency", + 500000); debug("%s: regs=%p max-frequency=%d\n", __func__, plat->regs, plat->frequency); From patchwork Thu May 9 20:11:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Goldschmidt X-Patchwork-Id: 1097662 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="W2CJf/7d"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450Pg00Tr6z9sB8 for ; Fri, 10 May 2019 06:13:31 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A4C23C21C2C; Thu, 9 May 2019 20:12:38 +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 61C51C21DFD; Thu, 9 May 2019 20:12:19 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A0A0BC21E0F; Thu, 9 May 2019 20:12:14 +0000 (UTC) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by lists.denx.de (Postfix) with ESMTPS id 1A12CC21DFB for ; Thu, 9 May 2019 20:12:11 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id h11so4650144wmb.5 for ; Thu, 09 May 2019 13:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DmmZ1Z7rdj5OIH6ETG8GHpmhbwGO5pJYjUWp5rSLS6w=; b=W2CJf/7doV3t9ishZggQwuV1Z3FldQ/aple0Nler740yPtP92rFUJxy/emQDNa6BYn RJr+Bj+/fxkhzsf8oSjj4vjtpkCq4532piwU8a1szXpCGtWdTpjO5+FgKsBISflHbiw6 L7uA7DRj2xLZ+niDdsdpOltPkh96ZBi8VPhSUbPYxicHfHY+qei6HuLkl0CB8PRuAm9+ qvjqEsSFaRR+R9Bc1ecOnazt4t6QdpPxQaHNcsqJaQbVFo6kf7dOxPe2Jl0yzv4dvmSV qkYw3Ht7UtSEWUNTiako+IpTfeIe+S0MNzFuwXN9yDjhM/jx0Zt1B2XINh1ib6TKMUXI zTvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DmmZ1Z7rdj5OIH6ETG8GHpmhbwGO5pJYjUWp5rSLS6w=; b=Q76mOUTPdMjo6W4OKoIbgmZM/Pa/ssRotGoUKqEqJMAPXnypSePfYEe/CbOYeXcrMk 4X4069vj6zCondqoJqmRis9rOh45ET3smVagXZnySZBhaEcljSLp+1DB4SDXvgcyH79y hE9PjryjpL3FobDCBQe+xVFh/CDW+dLC4xKeUaG7k075qH+1UpCpbFHe4/DAXrw9Ymzm uZLK0ztywiY4p5aAdbWh8HPd/BPvi+W1CtzLeGVPxex96qe694ZZQlXwpw6czq+3iLn8 eiLXRQ8X5oevfyDCTGBPn79Cj7ulUjmpVkfzYH41rILEmk5MLLC/RAMyV3X+h4uJZUPs Vz2g== X-Gm-Message-State: APjAAAVBwrubo9WhXUpuFZrnu1PjYQ1OoxR1K+pDdA18Q96oQwgGSiA5 PwnKcmrQi1YUCM12+4R6kH4= X-Google-Smtp-Source: APXvYqx0+C0HbEwBXxrPW0ONz4VetavY+D92uiupNaVqAnfbuhryDT/7+V227gGaTvaw8FfiRycggw== X-Received: by 2002:a1c:2388:: with SMTP id j130mr3902362wmj.133.1557432730808; Thu, 09 May 2019 13:12:10 -0700 (PDT) Received: from ubuntu.home ([2a02:8071:6a3:700:2df8:99ba:e50f:756b]) by smtp.gmail.com with ESMTPSA id a20sm8326402wrf.37.2019.05.09.13.12.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 13:12:10 -0700 (PDT) From: Simon Goldschmidt To: Marek Vasut Date: Thu, 9 May 2019 22:11:58 +0200 Message-Id: <20190509201200.10336-5-simon.k.r.goldschmidt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190509201200.10336-1-simon.k.r.goldschmidt@gmail.com> References: <20190509201200.10336-1-simon.k.r.goldschmidt@gmail.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 4/6] serial: altera_uart: convert to livetree 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" Convert 'altera_uart_ofdata_to_platdata' to use 'dev_read_u32_default' instead of 'fdtdec_get_int' and get rid of DECLARE_GLOBAL_DATA_PTR. Signed-off-by: Simon Goldschmidt Reviewed-by: Simon Glass --- drivers/serial/altera_uart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/serial/altera_uart.c b/drivers/serial/altera_uart.c index 67d47199aa..436cf2331d 100644 --- a/drivers/serial/altera_uart.c +++ b/drivers/serial/altera_uart.c @@ -10,8 +10,6 @@ #include #include -DECLARE_GLOBAL_DATA_PTR; - /* status register */ #define ALTERA_UART_TMT BIT(5) /* tx empty */ #define ALTERA_UART_TRDY BIT(6) /* tx ready */ @@ -91,8 +89,7 @@ static int altera_uart_ofdata_to_platdata(struct udevice *dev) plat->regs = map_physmem(devfdt_get_addr(dev), sizeof(struct altera_uart_regs), MAP_NOCACHE); - plat->uartclk = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), - "clock-frequency", 0); + plat->uartclk = dev_read_u32_default(dev, "clock-frequency", 0); return 0; } From patchwork Thu May 9 20:11:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Goldschmidt X-Patchwork-Id: 1097667 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jLMWvePp"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450Phf4t80z9sBV for ; Fri, 10 May 2019 06:14:58 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 57DF8C21E2C; Thu, 9 May 2019 20:13:30 +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, 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 9AA37C21DFB; Thu, 9 May 2019 20:12:24 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D3053C21C51; Thu, 9 May 2019 20:12:15 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by lists.denx.de (Postfix) with ESMTPS id E83DDC21E16 for ; Thu, 9 May 2019 20:12:11 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id s15so4699910wra.12 for ; Thu, 09 May 2019 13:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4ezeuPMomRI3GjHdoIS18ZVM6Ut9p+8giTTLST54I/s=; b=jLMWvePpB8kJAJVBzwJ1Yg7VBWhfKFx2esnJzpgqHLuLdLazVey86sFy0YzJ+B7LCo j1EH/mKVXn2ZlJI8cpFRwFnIWXOgTqLQdVulS303XnYk4QA1RGMQwNY58Ufy/EGAqnW8 ByeDz+Zd/ILd9ZJqvsK9CcmNDUGjovlh0qCK7TdCAO0QtOahFIY5XmYmpjb1WBnFVrcG GzAPuHtXBooE3vJP2uZSg+YBNA/Bej/xQUtOAcHyItGCIPGRSghWZtmjr5km3yJCnM1T YGchcX1CgJ620ajSVWLEVIz1SwvPM8MiuEPhnt+m2mhtAJE1p6zx8lHfzXnp9i8mljgR 5ldA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4ezeuPMomRI3GjHdoIS18ZVM6Ut9p+8giTTLST54I/s=; b=BS5rQ8M+1zDz/nHopFmbSgmM83uze8Qx2POruJ3Lht8UIsfNM6NZU2lESAcqPyCm2k 3mrx0iJyYdPd2DDjPY5+UO9Tn9T3Z2uZwkn/PfH20626jaTbMZoCsluZBmZ8Wcyk+ukH p7AHeQmdoZmRyCxYLdwYdbN0gUTltqLVfFr271KWVJanGHeCWvthDfHYlsdz0I8bBB9H d/PZ7Hq3Q6c1wMNE7xkrSh50thmz9LKyhKhKigxtdyNG9vKlz7JP2SmYea/XXMNKnTjT kw2MN0REFrniJP9vz4lqpThGRpx/EPYwo+wncMPNwqa7hZB4rxw+PKTzwvY79qFCbHE7 7G9w== X-Gm-Message-State: APjAAAXS8IRWHRQIesqihmT1PnJhta36Z/rUFnB755srgzoOopKYblFJ gqtxN9oT/rJktrI2CyvLNYTYEKtk X-Google-Smtp-Source: APXvYqx+PcTV+BleiwRRA8BnxwMKu6A2Zrkco7ZeuBSDS09VD/kZSjs3FHwuH5WcSWQwxEJG+xeTZQ== X-Received: by 2002:adf:ce07:: with SMTP id p7mr4526092wrn.47.1557432731666; Thu, 09 May 2019 13:12:11 -0700 (PDT) Received: from ubuntu.home ([2a02:8071:6a3:700:2df8:99ba:e50f:756b]) by smtp.gmail.com with ESMTPSA id a20sm8326402wrf.37.2019.05.09.13.12.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 13:12:11 -0700 (PDT) From: Simon Goldschmidt To: Marek Vasut Date: Thu, 9 May 2019 22:11:59 +0200 Message-Id: <20190509201200.10336-6-simon.k.r.goldschmidt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190509201200.10336-1-simon.k.r.goldschmidt@gmail.com> References: <20190509201200.10336-1-simon.k.r.goldschmidt@gmail.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 5/6] reset: socfpga: convert to livetree 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" Convert 'socfpga_reset_probe' to use 'dev_read_u32_default' instead of 'fdtdec_get_int'. Signed-off-by: Simon Goldschmidt --- drivers/reset/reset-socfpga.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c index cb8312619f..ee4cbcb02f 100644 --- a/drivers/reset/reset-socfpga.c +++ b/drivers/reset/reset-socfpga.c @@ -107,14 +107,12 @@ static const struct reset_ops socfpga_reset_ops = { static int socfpga_reset_probe(struct udevice *dev) { struct socfpga_reset_data *data = dev_get_priv(dev); - const void *blob = gd->fdt_blob; - int node = dev_of_offset(dev); u32 modrst_offset; void __iomem *membase; membase = devfdt_get_addr_ptr(dev); - modrst_offset = fdtdec_get_int(blob, node, "altr,modrst-offset", 0x10); + modrst_offset = dev_read_u32_default(dev, "altr,modrst-offset", 0x10); data->modrst_base = membase + modrst_offset; return 0; From patchwork Thu May 9 20:12:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Goldschmidt X-Patchwork-Id: 1097665 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AttJ5bip"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450Ph34Xd4z9sBV for ; Fri, 10 May 2019 06:14:27 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4DC3FC21C2C; Thu, 9 May 2019 20:13:03 +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, 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 90678C21DFA; Thu, 9 May 2019 20:12:20 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B0091C21DA6; Thu, 9 May 2019 20:12:16 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by lists.denx.de (Postfix) with ESMTPS id CFB6FC21D65 for ; Thu, 9 May 2019 20:12:12 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id m20so4909112wmg.1 for ; Thu, 09 May 2019 13:12:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wzgBJvZYIvNaTCvNn5belWuYBO0HwCSqVwR28qWunUw=; b=AttJ5bipYNpPR55AhmpC5KiwGBcbmke36du5KQ/wWIQF6xUzADa1tnaLN6QhFXRhEc AzXnKPl7tLAs2hep6p/g08EeS5xKMA1vlOpmW6ULR2jIuZsT5mdeXPOBRpJIKXU0Uwqb 66b9ZZ6hwXxVPq/kXLU8B9yv8Mgd5cMQoNZcs61rfd+y/4y7uEc/qHWQVUGFDjU5xrez 4SBRDJYWi1ZoniccCSyuh6+iuHA4tqOJUS6qh/SNX7pba+xkHvrtEm6CZ+hnzUePcgGJ f41y4TOLpCEIcHlIS24CWEQ+0hDdrpcXNGZQJ+gChVJeY59njcJQU9tnOKA4T1V8ICgE Rmig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wzgBJvZYIvNaTCvNn5belWuYBO0HwCSqVwR28qWunUw=; b=S24HM+d9WtNnrbaCCpqap99/ChP2TfrHfNSraYqFEeD/4P4Xwa9etOWbfGP6D54p+u AO6SswJxUCayErrIpWqX7j3/+kRpC5cwnSWKyALRzzpZNvO6VzPJ+P+rMIEudqXFaft2 57NsKrnRxXF5cMBE6X1fILLRzj9Er27ZumMIrG6iBi96vazE/aBNgmlTAKy35C+WS/69 RE+7upSqrxoqcsTStOlD2L/B/R5a083fY3M4Ja3eE59hlbXuP3mx0x2gsR32zpgIZnr4 tVlUyYbFGrv6qEAfyT3L6YT8YDEpGylBXIhLGwunky59zlJOXMDS6DWflXcUMfrK/HVB BC5w== X-Gm-Message-State: APjAAAVUf9FuUvLGE9m7OuTO7zqMzbwL5y1qm6TkIuoZiFqvLcgS/Msk 12dJhwU/zm6WA2rIv9UND60= X-Google-Smtp-Source: APXvYqxNMGpdNo12VoxpFkg6AEZ/XHcKnQ2By74j6o38ulhaAWmou0XCAM+E5tnL6uYUlvDySaeqQw== X-Received: by 2002:a1c:ac07:: with SMTP id v7mr4071983wme.49.1557432732536; Thu, 09 May 2019 13:12:12 -0700 (PDT) Received: from ubuntu.home ([2a02:8071:6a3:700:2df8:99ba:e50f:756b]) by smtp.gmail.com with ESMTPSA id a20sm8326402wrf.37.2019.05.09.13.12.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 13:12:12 -0700 (PDT) From: Simon Goldschmidt To: Marek Vasut Date: Thu, 9 May 2019 22:12:00 +0200 Message-Id: <20190509201200.10336-7-simon.k.r.goldschmidt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190509201200.10336-1-simon.k.r.goldschmidt@gmail.com> References: <20190509201200.10336-1-simon.k.r.goldschmidt@gmail.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de, Chin Liang See Subject: [U-Boot] [PATCH 6/6] gpio: dwapb_gpio: convert to livetree 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" Convert 'gpio_dwapb_bind' to iterate over subnodes using livetree functions (inspired from mt7621_gpio.c). Signed-off-by: Simon Goldschmidt --- drivers/gpio/dwapb_gpio.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c index e55fb4ac73..04a2381acd 100644 --- a/drivers/gpio/dwapb_gpio.c +++ b/drivers/gpio/dwapb_gpio.c @@ -17,8 +17,6 @@ #include #include -DECLARE_GLOBAL_DATA_PTR; - #define GPIO_SWPORT_DR(p) (0x00 + (p) * 0xc) #define GPIO_SWPORT_DDR(p) (0x04 + (p) * 0xc) #define GPIO_INTEN 0x30 @@ -150,10 +148,10 @@ static int gpio_dwapb_probe(struct udevice *dev) static int gpio_dwapb_bind(struct udevice *dev) { struct gpio_dwapb_platdata *plat = dev_get_platdata(dev); - const void *blob = gd->fdt_blob; struct udevice *subdev; fdt_addr_t base; - int ret, node, bank = 0; + int ret, bank = 0; + ofnode node; /* If this is a child device, there is nothing to do here */ if (plat) @@ -165,10 +163,9 @@ static int gpio_dwapb_bind(struct udevice *dev) return -ENXIO; } - for (node = fdt_first_subnode(blob, dev_of_offset(dev)); - node > 0; - node = fdt_next_subnode(blob, node)) { - if (!fdtdec_get_bool(blob, node, "gpio-controller")) + for (node = dev_read_first_subnode(dev); ofnode_valid(node); + node = dev_read_next_subnode(node)) { + if (!ofnode_read_bool(node, "gpio-controller")) continue; plat = devm_kcalloc(dev, 1, sizeof(*plat), GFP_KERNEL); @@ -177,15 +174,15 @@ static int gpio_dwapb_bind(struct udevice *dev) plat->base = base; plat->bank = bank; - plat->pins = fdtdec_get_int(blob, node, "snps,nr-gpios", 0); - plat->name = fdt_stringlist_get(blob, node, "bank-name", 0, - NULL); - if (!plat->name) { + plat->pins = ofnode_read_u32_default(node, "snps,nr-gpios", 0); + + if (ofnode_read_string_index(node, "bank-name", 0, + &plat->name)) { /* * Fall back to node name. This means accessing pins * via bank name won't work. */ - plat->name = fdt_get_name(blob, node, NULL); + plat->name = ofnode_get_name(node); } ret = device_bind(dev, dev->driver, plat->name, @@ -193,7 +190,7 @@ static int gpio_dwapb_bind(struct udevice *dev) if (ret) return ret; - dev_set_of_offset(subdev, node); + dev->node = node; bank++; }