Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4168675ooa; Tue, 14 Aug 2018 02:02:11 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx6ii9Ld+5KO6m5YVvdBOsqV4CQkTijqmxATnnGNl3UET8q1eXTcwJqLQAxH2dPOtRY6Ghb X-Received: by 2002:a62:1f8c:: with SMTP id l12-v6mr22705746pfj.143.1534237331809; Tue, 14 Aug 2018 02:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534237331; cv=none; d=google.com; s=arc-20160816; b=xmNZOqbF9kxUCFQXMhW52VPcPQGu3Fc2hImi3V5Dzzg+7SOFQUwATV2CPkeBJJ8odK 3q3auwcZ4hYMEsMujaZZ4fdWw4MI7VkQkLauEwOB/8zNZsHmx5GBdNtJjCV+i9QX4DlS 5N2SceGazQYgsN8EfraQsF/MTqK19R5EDNyba8POiG3V94koX6EOlfmRH9yc60ZnJp3P sH0ztFMD0lkfybNM0iyRfgK/B+VgN4dcFPsq2JH/kzOcv5aa8pABSm4y4IHu8Lz5oiHR If4yd2VZpQ+NFqfpXD+DsOdApWewuJvilflumTTcHb1Z2nMMPa52gs/qkq/woUSVHDa8 P8fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:openpgp:from:references:cc:to :subject:reply-to:dkim-signature:arc-authentication-results; bh=MUoUXkLoxG3Jdnq2uGs3WBOyIj1y0DyOD4T+3VKxyaU=; b=jfYGBrH9+6DNIGw+W+onPLyYBtXQ/zq5AOydbPT8BwrHG5NzpeDTtIjHGOMHBNW6HL g8XSfKN9Y6uvfJHfOp5xCHxe/0kSmgfZduhA+Z5EQ0b9vD8HcaI67uBkN1qBj2KrnrTb apWaX7gD7qjGOR0z+SMj7nFL7w+jp6wT9FlBo2/8G67L4zEl4DFAbi3TvlZcm0Q/CD31 Tr+NmaBzID4ByPYIBIGCUhLb8FYhZfXB6y/UlvCswVWhABTIRyBxE4dElP7abvTBBfV1 ts101+4SUAov18vBI/cIKlUCcUk3X5L+qLciPYcqhOHhPinSI3FcrGmxg071u9jK43Sr itXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=rkjDHlk9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f62-v6si22599448pfb.218.2018.08.14.02.01.57; Tue, 14 Aug 2018 02:02:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=rkjDHlk9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731999AbeHNLq1 (ORCPT + 99 others); Tue, 14 Aug 2018 07:46:27 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:50904 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730119AbeHNLq1 (ORCPT ); Tue, 14 Aug 2018 07:46:27 -0400 Received: from [192.168.0.67] (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 32E01CE; Tue, 14 Aug 2018 11:00:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1534237210; bh=wrweXNCwdGLxGHuJHfCipEUPZM3orge6HMlEqudbt/o=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=rkjDHlk95+u2H5Zsk2pIsEjrNMYZ5WeTcxpQE6H1h0qnFNRaSaHNb/+6Pd5ZsqcsD REXnXLfNvMrQ4cawn9AthmC/eXoMZLt/dtlYC0Elo406Fe+fxcNSuxeOU6D6ZF0L1X kXmPZUvZ9HaJ4zJV9cS0NFXNfaCA8hDDFmo76EuQ= Reply-To: kieran.bingham@ideasonboard.com Subject: Re: [PATCH v3] dt-bindings: media: adv748x: Document re-mappable addresses To: Rob Herring Cc: Laurent Pinchart , Mauro Carvalho Chehab , Mark Rutland , Hans Verkuil , Linux Media Mailing List , "open list:MEDIA DRIVERS FOR RENESAS - FCP" , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" References: <20180809192944.7371-1-kieran.bingham@ideasonboard.com> <20180813174544.GA11379@rob-hp-laptop> From: Kieran Bingham Openpgp: preference=signencrypt Autocrypt: addr=kieran.bingham@ideasonboard.com; keydata= xsFNBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat V/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC rRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C potzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ cSAZRxqE49RTBq2+EQsbrQpIc8XiffAB8qexh5/QPzCmR4kJgCGeHIXBtgRj+nIkCJPZvZtf Kr2EAbc6tgg6DkAEHJb+1okosV09+0+TXywYvtEop/WUOWQ+zo+Y/OBd+8Ptgt1pDRyOBzL8 RXa8ZqRf0Mwg75D+dKntZeJHzPRJyrlfQokngAAs4PaFt6UfS+ypMAF37T6CeDArQC41V3ko lPn1yMsVD0p+6i3DPvA/GPIksDC4owjnzVX9kM8Zc5Cx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sz+ +OD8xPNCsMTqeUkAKfbD8xW4LCay3r/dD2ckoxRxtMD9eOAyu5wYzo/ydIPTh1QEj9SYyvp8 O0g6CpxEwyHUQtF5oh15O018z3ZLztFJKR3RD42VKVsrnNDKnoY0f4U0z7eJv2NeF8xHMuiU RCIzqxX1GVYaNkKTnb/Qja8hnYnkUzY1Lc+OtwiGmXTwYsPZjjAaDX35J/RSKAoy5wGo/YFA JxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q sbsRB8KNNvVXBOVNwko86rQqF9drZuw= Organization: Ideas on Board Message-ID: Date: Tue, 14 Aug 2018 10:00:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, On 13/08/18 23:48, Rob Herring wrote: > On Mon, Aug 13, 2018 at 1:17 PM Kieran Bingham > wrote: >> >> On 13/08/18 18:45, Rob Herring wrote: >>> On Thu, Aug 09, 2018 at 08:29:44PM +0100, Kieran Bingham wrote: >>>> The ADV748x supports configurable slave addresses for its I2C pages. >>>> Document the page names, and provide an example for setting each of the >>>> pages explicitly. >>> >>> It would be good to say why you need this. >> >> In fact - I should probably have added a fixes tag here, which would >> have added more context: >> >> Fixes: 67537fe960e5 ("media: i2c: adv748x: Add support for >> i2c_new_secondary_device") > > That doesn't really explain things from a DT perspective. > >> Should I repost with this fixes tag? >> Or can it be collected with the RB tag? > > I'll leave that to Hans. > >>> The only use I can think of >>> is if there are other devices on the bus and you need to make sure the >>> addresses don't conflict. >> >> Yes, precisely. This driver has 'slave pages' which are created and >> mapped by the driver. The device has default addresses which are used by >> the driver - but it's very easy for these to conflict with other devices >> on the same I2C bus. >> >> Because the mappings are simply a software construct, we have a means to >> specify the desired mappings through DT at the board level - which >> allows the boards to ensure that conflicts do not appear. >> >> >>> Arguably, that information could be figured out without this in DT. >> >> How so ? >> >> Scanning the bus is error prone, and dependant upon driver state (and >> presence), and we have no means currently of requesting 'free/unused' >> addresses from the I2C core framework. > > True. But assuming all devices are in DT, then you just need to scan > the child nodes of the bus and get a map of the used addresses. Though > if you had 2 or more devices like this, then you'd need to maintain > s/w allocated addresses too. It could all be maintained with a bitmap > which you initialize with addresses in DT. We do indeed have cases with platforms which use the same device populated twice: See 1d26a5217187 ("ARM: dts: wheat: Fix ADV7513 address usage") In that instance, a hardware bug means that if one of the two instances of the ADV7513 goes into standby, it will respond to it's default hardware slave map addresses. So because of this we must map *both* instances to be non defaults. (and ideally, we'd want to mark the actual defaults as unused - but - unusable; alas we don't have a means to do that yet) In the instance of this device (the adv748x) it has a default mapping at address 0x30 for the CBUS page. We have an expansion board, which adds GMSL cameras to the same board - of which reside on the same I2C bus - and are fixed to use 0x30 as the base address for one of the components. (Which even that then gets re-mapped - but it must be available to perform the remap in the first place) So we even have this concept of an address which is 'mostly' unused, but must be available for use at certain stages of the probe sequences. (There are 8 cameras attached, all with that same 0x30 address) The GMSL expansion is an 'overlay' (it's actually just an include file currently, but it /should/ be a DTO), and so I use this functionality to remap the ADV748x maps to a 'free' block of address space. Adding that patch [0] ([PATCH] arm64: dts: renesas: salvator-common: adv748x: Override secondary addresses) was what led me to notice that I had not updated the DT documentation for the feature, leading to this patch :) [0] https://www.spinics.net/lists/linux-renesas-soc/msg31194.html -- Regards -- Kieran