Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753151AbcDORYG (ORCPT ); Fri, 15 Apr 2016 13:24:06 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:60180 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753030AbcDORYB (ORCPT ); Fri, 15 Apr 2016 13:24:01 -0400 Subject: Re: [PATCH 1/2] [v4] net: emac: emac gigabit ethernet controller driver To: Rob Herring Cc: Vikram Sethi , Florian Fainelli , netdev , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , linux-arm-msm , Sagar Dharia , Shanker Donthineni , Greg Kroah-Hartman , Christopher Covington , Gilad Avidov , Andrew Lunn , Bjorn Andersson , Mark Langsdorf , Jon Masters , Andy Gross , "David S. Miller" References: <1460570393-19838-1-git-send-email-timur@codeaurora.org> <570EC541.6080603@gmail.com> <570FFB6B.5060305@codeaurora.org> <57100962.40404@gmail.com> <571012E6.6050303@codeaurora.org> <57102920.7000104@codeaurora.org> <57110C70.9090007@codeaurora.org> From: Timur Tabi Message-ID: <571123AA.2070000@codeaurora.org> Date: Fri, 15 Apr 2016 12:23:54 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1678 Lines: 66 Rob Herring wrote: > You may only care about the size, but the binding has to handle the > more complex case. Here's an example > > <0x0 0x2 0x0 0x1 0x0> > > dma address 0 (cell 0) maps to cpu (parent) address 0x2_00000000 (cell > 1-2) and the range/size is 4G (cell 3-4). > > If you have the same base address, then use the same address. The core > will calculate the mask based on the size. IIRC, we also handle ~0 as > a special case to support 4G for #size-cell=1. So the first thing I noticed is that Gilad had this: reg = <0xfeb20000 0x10000>, <0xfeb36000 0x1000>, <0xfeb3c000 0x4000>, <0xfeb38000 0x400>; #address-cells = <0>; Shouldn't address-cells have been 1 instead? Ok, let me see if I get this right: 32-bit: soc { #address-cells = <1>; #size-cells = <1>; emac0: qcom,emac@feb20000 { compatible = "qcom,fsm9900-emac"; #address-cells = <1>; #size-cells = <1>; reg-names = "base", "csr", "ptp", "sgmii"; reg = <0xfeb20000 0x10000>, <0xfeb36000 0x1000>, <0xfeb3c000 0x4000>, <0xfeb38000 0x400>; dma-ranges = <0 0 0xffffffff>; interrupt-parent = <&emac0>; 64-bit soc { #address-cells = <2>; #size-cells = <2>; emac0: qcom,emac@feb20000 { compatible = "qcom,fsm9900-emac"; #address-cells = <2>; #size-cells = <2>; reg-names = "base", "csr", "ptp", "sgmii"; reg = <0 0xfeb20000 0 0x10000>, <0 0xfeb36000 0 0x1000>, <0 0xfeb3c000 0 0x4000>, <0 0xfeb38000 0 0x400>; dma-ranges = <0 0 0 0 0xffffffff 0xffffffff>; This seems inelegant, though. -- Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation collaborative project.