From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kever Yang Date: Tue, 4 Jun 2019 11:07:09 +0800 Subject: [U-Boot] [PATCH 3/3] rk3399: Add restriction for DMA-able addresses. In-Reply-To: <20190507090531.50670-3-christoph.muellner@theobroma-systems.com> References: <20190507090531.50670-1-christoph.muellner@theobroma-systems.com> <20190507090531.50670-3-christoph.muellner@theobroma-systems.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Christoph, On 05/07/2019 05:05 PM, Christoph Muellner wrote: > Patches on the U-Boot mailing list from Rockchip engineers > indicate, that the RK3399's DMA engines are not able to use > addresses in high-memory (above 0xf8000000). > > This patch models this restriction in an RK3399 specific > mach_addr_is_dmaable() function. > > Signed-off-by: Christoph Muellner > --- > > arch/arm/mach-rockchip/rk3399/rk3399.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c > index a7ccd4f3ed..15b03726eb 100644 > --- a/arch/arm/mach-rockchip/rk3399/rk3399.c > +++ b/arch/arm/mach-rockchip/rk3399/rk3399.c > @@ -109,3 +109,14 @@ void board_debug_uart_init(void) > #endif > } > #endif > + > +int mach_addr_is_dmaable(unsigned long addr) > +{ > + /* > + * The RK3399 cannot cope with high-memory DMA target/sources. > + */ > + if (addr < 0xf8000000UL) You'd better use SDRAM_MAX_SIZE instead of hard code, and this can re-used on all Rockchip platform. Thanks, - Kever > + return 1; > + > + return 0; > +}