From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Subject: Re: RFC: tegra2/tegra3 automotive part changes Date: Fri, 13 Jul 2018 10:53:43 -0600 Message-ID: References: <3916c0ea-964e-42ab-8bfd-8e8edc5110ee@codethink.co.uk> <4f215c76-6539-1130-6c1f-75f0a3df068a@codethink.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; Format="flowed" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: <4f215c76-6539-1130-6c1f-75f0a3df068a@codethink.co.uk> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Ben Dooks Cc: Terry Hu , Device Tree list , jorgesanjuan , Thomas Preston , linux-tegra , "linux-arm-kernel@lists.infradead.org" , Beth White List-Id: linux-tegra@vger.kernel.org T24gMDcvMTMvMjAxOCAwMzo0MSBBTSwgQmVuIERvb2tzIHdyb3RlOgo+IE9uIDEyLzA3LzE4IDE2 OjU2LCBTdGVwaGVuIFdhcnJlbiB3cm90ZToKPj4gT24gMDcvMTIvMjAxOCAwNzozNiBBTSwgQmVu IERvb2tzIHdyb3RlOgo+Pj4gSGVsbG8sIHdlIGFyZSBsb29raW5nIGF0IHVwLXN0cmVhbWluZyBz b21lIG9mIHRoZSB3b3JrIHdlIGhhdmUKPj4+IGRvbmUgb24gdGhlIHRlZ3JhMiBhbmQgdGVncmEz IGF1dG9tb3RpdmUgZGV2aWNlcy4gVGhlIGF1dG9tb3RpdmUKPj4+IGdyYWRlIGRldmljZXMgYXJl IGNsb3NlIHRoZSBjb21tZXJjaWFsIHBhcnRzIHNvIHdlIHdvdWxkIGxpa2UgdG8KPj4+IGRpc2N1 c3MgdGhlIGNvcmUgY2hhbmdlcyBiZWZvcmUgc3VibWl0dGluZy4KPj4+Cj4+PiBUaGUgY2hhbmdl cyBhcmUgbW9zdGx5IHdpdGggdGh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Bwcm9iYWJseSBhbHJlYWR5IGRvZXMpIGhhcmQtY29kZSB0aGUgCnBoeXNpY2Fs IGFkZHJlc3Mgb2YgdGhlIGZ1c2VzIHJhdGhlciB0aGFuIGJlaW5nIGNvbmZpZ3VyZWQgZnJvbSBE VCBmb3IgCnRoaXMuIEkgdGhpbmsgaWYgeW91IHJlYWQgdGhlIGNoaXAgIlNLVSIgdmFsdWUgZnJv bSBmdXNlcywgdGhhdCBzaG91bGQgCmluZGljYXRlIHdoaWNoIHNldHMgb2YgcmVzdHJpY3Rpb25z IG9uIGNsb2Nrcy8uLi4gYXJlIHJlcXVpcmVkLCBhbmQgCnRoZXJlIGFyZSBtYW55IG1vcmUgU0tV cyB0aGFuIGp1c3QgInJlZ3VsYXIiIGFuZCAiYXV0b21vdGl2ZSIsIGFsdGhvdWdoIAphbGwgdGhl IGRpZmZlcmVudCBTS1VzIG1heSBiZSBidWNrZXRlZCBpbnRvIGZld2VyIHNldHMgb2YgCnJlc3Ry aWN0aW9uL2NvbmZpZ3VyYXRpb24gZGF0YS4KCkJyaWVmbHkgbG9va2luZyBhdCBkcml2ZXJzL3Nv Yy90ZWdyYS9mdXNlL3NwZWVkby10ZWdyYTIwLmMsIHNvbWUgKGEgdmVyeSAKbGl0dGxlKSBvZiB0 aGlzIG1heSBhbHJlYWR5IGJlIHRoZXJlCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fXwpsaW51eC1hcm0ta2VybmVsIG1haWxpbmcgbGlzdApsaW51eC1hcm0t a2VybmVsQGxpc3RzLmluZnJhZGVhZC5vcmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFp bG1hbi9saXN0aW5mby9saW51eC1hcm0ta2VybmVsCg== From mboxrd@z Thu Jan 1 00:00:00 1970 From: swarren@wwwdotorg.org (Stephen Warren) Date: Fri, 13 Jul 2018 10:53:43 -0600 Subject: RFC: tegra2/tegra3 automotive part changes In-Reply-To: <4f215c76-6539-1130-6c1f-75f0a3df068a@codethink.co.uk> References: <3916c0ea-964e-42ab-8bfd-8e8edc5110ee@codethink.co.uk> <4f215c76-6539-1130-6c1f-75f0a3df068a@codethink.co.uk> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 07/13/2018 03:41 AM, Ben Dooks wrote: > On 12/07/18 16:56, Stephen Warren wrote: >> On 07/12/2018 07:36 AM, Ben Dooks wrote: >>> Hello, we are looking at up-streaming some of the work we have >>> done on the tegra2 and tegra3 automotive devices. The automotive >>> grade devices are close the commercial parts so we would like to >>> discuss the core changes before submitting. >>> >>> The changes are mostly with things like the clock setup and a >>> few peripheral quirks (IIRC these are mostly MMC). >>> >>> We are proposing to change the device-tree properties for the root >>> node and any other affected devices from "nvidia,tegraXX" to a new >>> "nvidia,tegraXXa". We would welcome discussion on whether to update >>> all the devices at the start >>> >>> An example of tegra30a.dtsi: >>> >>> #include "tegra30.dtsi" >>> >>> / { >>> ???????? compatible = "nvidia,tegra30a"; >>> >>> ???????? clock at 60006000 { >>> ???????????????? compatible = "nvidia,tegra30a-car"; >>> ???????? }; >>> } >> >> This doesn't sound right. Auto and commercial parts are identical >> AFAIK; it's just qualification differences. Hence at most you'd add an >> extra compatible value and not remove the old one. Better might be to >> detect this at run-time from the fuses. I think we already do some of >> that already; search for speedo related code in arch/arm/mach-tegra/. > > The nvidia pdk for the automotive didn't set the clocks up in the > same way and we where told that there are certain clock restrictions > for the automotive parts that the commercial ones do not have. Some of > this came from internal discussions with nvidia and NDA'd datasheets > so I don't know how much actual data I can share. I believe this just changes the *selection* of values to use (clock rates, clock sources), not *how* to program them (set of registers and fields, programming algorithm), which is what the DT compatible is mainly about. In other words, it's mainly a performance/configuration decision not different HW. > To get the 4.4 kernel to be similar enough to work with the tegra30a > we had to do some changes to the clock initialisation. For things > like the clock I am not sure if leaving a tegra30-car in there would > be a good idea, it may boot but probably won't be stable. > > For the fuses, is the fuse driver up early enough to allow the clock > driver could use this? otherwise I think the device-tree change would > be the only way. I'm not sure if I have the information to hand on > how to differentiate the tegra30 and tegra20. > > PS, we'll want to do the same for the tegra20. As Job mentioned, the fuse driver should/could be available early enough without issue. It may have to (and probably already does) hard-code the physical address of the fuses rather than being configured from DT for this. I think if you read the chip "SKU" value from fuses, that should indicate which sets of restrictions on clocks/... are required, and there are many more SKUs than just "regular" and "automotive", although all the different SKUs may be bucketed into fewer sets of restriction/configuration data. Briefly looking at drivers/soc/tegra/fuse/speedo-tegra20.c, some (a very little) of this may already be there