From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965539AbcAUQUu (ORCPT ); Thu, 21 Jan 2016 11:20:50 -0500 Received: from hqemgate14.nvidia.com ([216.228.121.143]:3456 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965207AbcAUQUr (ORCPT ); Thu, 21 Jan 2016 11:20:47 -0500 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Thu, 21 Jan 2016 08:22:03 -0800 Date: Thu, 21 Jan 2016 17:20:37 +0100 From: Thierry Reding To: Arnd Bergmann CC: , Andy Yan , , , , , , , , , , , , , , , Subject: Re: [PATCH v3 3/5] soc: rockchip: add reboot notifier driver Message-ID: <20160121162035.GG647@ulmo.nvidia.com> References: <1447840044-19689-1-git-send-email-andy.yan@rock-chips.com> <15127971.1juVbocOjP@wuerfel> <20151228092054.GA29195@ulmo.nvidia.com> <2250962.OgUpqMgY4k@wuerfel> MIME-Version: 1.0 In-Reply-To: <2250962.OgUpqMgY4k@wuerfel> X-NVConfidentiality: public User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.2.68.189] X-ClientProxiedBy: UKMAIL102.nvidia.com (10.26.138.15) To UKMAIL102.nvidia.com (10.26.138.15) Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ulDeV4rPMk/y39in" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ulDeV4rPMk/y39in Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 28, 2015 at 04:35:46PM +0100, Arnd Bergmann wrote: > On Monday 28 December 2015 10:20:56 Thierry Reding wrote: > > > > > HTC apparently uses a separate RAM area to pass the reboot reason, > > > > > and they have a driver to store that, which is separate from the > > > > > driver that they use for actually rebooting the machine. > > > >=20 > > > > I wasn't very clear, but the PMC_SCRATCH0 register is used to store= the > > > > reset reason. It supports the recovery mode, which I think is reall= y an > > > > Android thing, "bootloader" will typically cause the bootloader not= to > > > > boot anything, and "forced-recovery" will go into a recovery mode t= hat > > > > is used to bootstrap the device (usually by uploading a "miniloader" > > > > that initializes RAM, downloads a bootloader for booting or flashin= g an > > > > operating system, ...). > > > >=20 > > > > The write that resets the SoC is to a different register. > > >=20 > > > So is this scratch register interpreted by some maskrom code, or by c= ode that > > > can be provided by the OEM? > >=20 > > My understanding is that its interpreted both by what's called BootROM > > on Tegra (I guess that's what you call "maskrom code") and the system's > > bootloader. The BootROM cannot typically be replaced by the OEM, but it > > is quite typical for the bootloader to differ between devices. >=20 > Ok, so not maskrom (which would not be OEM specific, but hardcoded for > the chip) but rather some form of PROM. This means we can only guess > that all OEMs use the same protocol but in theory someone could have > implemented an incompatible BootROM, but it's also possible that HTC > just ignore the register entirely and implement the same thing separately. I wasn't being clear, the BootROM is hardcoded for the chip, I'm not aware of a way to replace it once the chip's taped out. Thierry --ulDeV4rPMk/y39in Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJWoQVTAAoJEN0jrNd/PrOhrTUQAJ6jgKk7HnaFcXXrFjxoSrUA Oswvi3LQav1rsFNVKp3vC/NUkdgZJVcl2Qr8AluGtJFvCqZxI0AQfCbuNbEtB/dq Fa/wPTenfl0eWJkSyUdxkW6OWkSqMobxZ4pXkJ+saW3ixjLs0/2mArsh1/RjPC3b lgIfII5j8rxRIZi8RdSiPzPIWc1+w+3bZhkhW52qpmd9q4o7yrhbzRofNDevDg39 ELkTPUmm1FyEwTYDbQ9rc7YY/1Nx3rBOTEct0Y76sU0OdRbeykNkJYlNZkL47/E3 omR2V+9LEMUVIOuEyG0iOzaKmBU0VtO5v5LSqbduRirwX196pSlSBR9A9xqnaa1q 5ha3aKIbVaeRKSSE0xCAoJJyyXKuclOgEvvla10HsgBuI0V3zzFbJJFCjN+o146c eos5VvmakQrbam+kwVyARuME8RCIS/1C6Xbq/wYACFHAtYA0oleLUe/7W2ZgTEoE bojfEI8saWOTgML6IQq+lpHQQZSKBodv7EJN5YkGkn4L9kn5je7NXUp2YRtWp6ow gjNL7qhqgfc66wOqHuXJmsiUwZ1eZM1RgHTzmgAFrksH/9xbVLI5cpuhxVhNNX8N pB9JqSEuzqC0idU0hwhVebxnIfWYT5J2FWOkfFcYhz8V1uv+bT+4xUkkw8Ys73ww qoLvb0VT53+agu6EIYD1 =GaH6 -----END PGP SIGNATURE----- --ulDeV4rPMk/y39in--