From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762819AbdJQO0L (ORCPT ); Tue, 17 Oct 2017 10:26:11 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:41665 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761926AbdJQO0K (ORCPT ); Tue, 17 Oct 2017 10:26:10 -0400 Date: Tue, 17 Oct 2017 16:26:08 +0200 From: Maxime Ripard To: Chen-Yu Tsai Cc: David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [PATCH v2 5/7] drm/sun4i: backend: Offset layer buffer address by DRAM starting address Message-ID: <20171017142608.lycfvzydn5xvnazh@flea.lan> References: <20171017042349.31743-1-wens@csie.org> <20171017042349.31743-6-wens@csie.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fmiyb2gp6y4wk2p3" Content-Disposition: inline In-Reply-To: <20171017042349.31743-6-wens@csie.org> User-Agent: NeoMutt/20171013 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --fmiyb2gp6y4wk2p3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 17, 2017 at 12:23:47PM +0800, Chen-Yu Tsai wrote: > The display backend, as well as other peripherals that have a DRAM > clock gate and access DRAM directly, bypassing the system bus, > address the DRAM starting from 0x0, while physical addresses the > system uses starts from 0x40000000 (or 0x20000000 in A80's case). >=20 > This issue was witnessed on the Cubietruck, which has 2GB of RAM. >=20 > Devices with less RAM function normally due to the DRAM address > wrapping around. CMA seems to always allocate its buffer at a > very high address, close to the end of DRAM. >=20 > On a 1GB RAM device, the physical address would be something like > 0x78000000. The DRAM address 0x78000000 would access the same DRAM > region as 0x38000000 on a system, as the DRAM address would only > span 0x0 ~ 0x3fffffff. The bit 0x40000000 is non-functional in this > case. >=20 > However on the Cubietruck, the DRAM is 2GB. The physical address > is 0x40000000 ~ 0xbfffffff. The buffer would be something like > 0xb8000000. But the DRAM address span 0x0 ~ 0x7fffffff, meaning > the buffer address wraps around to 0x38000000, which is wrong. > The correct DRAM address for it should be 0x78000000. >=20 > Correct the address configured into the backend layer registers > by PHYS_OFFSET to account for this. >=20 > Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support") > Signed-off-by: Chen-Yu Tsai Applied, thanks! Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --fmiyb2gp6y4wk2p3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJZ5hMAAAoJEBx+YmzsjxAgd04QAJrRSJv8vSOpjIMDXP1Andn7 MEGcDaKBrkNn0UClO7u25sFDYVrvirTlPn0gwckzubEn1uche33tKlFDlWNdgxJ6 Bu5zoYr+aMO+bi0jnMaAuv0nLMSso0TILFCQz99HxHPHZzEeVtR/ICOc3EFpzEC/ kWQ9c5OcNf3Ex7yf3YpmNQbL/XClaWGAd1UDPHEx9GoRQnOGcKA+816O/e9QqwaJ ftSbGEUC2o92H1bPvUsHkRRwa7SORlItHPi/KWXlIaLkrlL48Vg/BhEzn0tVWLUe N/h5eX7EdqcMcadQk5kKPtcvIabvqPuNvSgSz0tGm4+4i9d0ULUKAC5I2h4fuXTa 4G/VVASjRpIKi63lH2j60WnkJW85L1D64mDY3Ycz3HvQ6VbI/Xl+E+7+Aj9kA+rX MYP5OF2seNE3qrW2YRfWuQvmNlkxXMU1E7UL51AOmfK8OSv8/8zNOyqKxO+BkBu9 f9qPtx3P/ztBXVuc0vV674JJFoJ8KhVEgX9qlb/cDBYay6JWZpGy0FNtmFNr+BlJ mVDpnZLvGF01orwZVPiIp9v/a+cx0OOCKOBhxI1Np0n7N8/OiJ1BaPLm08B1ROXa GMqfm2UzDg3Mc+/avghFcg89mzAGYadnL0W/UdG/Nbc2oyCvt9sBUdJp31TU4ivi C3/r4fHvuWAx5cJ+ANur =pYZz -----END PGP SIGNATURE----- --fmiyb2gp6y4wk2p3--