Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38980C4332F for ; Wed, 14 Dec 2022 17:55:26 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 926A8854CA; Wed, 14 Dec 2022 18:52:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=edgeble.ai Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=edgeble-ai.20210112.gappssmtp.com header.i=@edgeble-ai.20210112.gappssmtp.com header.b="rzRqJbNN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A11EB85497; Wed, 14 Dec 2022 18:52:26 +0100 (CET) Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6111185496 for ; Wed, 14 Dec 2022 18:52:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=edgeble.ai Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=jagan@edgeble.ai Received: by mail-pl1-x62e.google.com with SMTP id d7so4105811pll.9 for ; Wed, 14 Dec 2022 09:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=edgeble-ai.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H4JTplklBDC2Nn6pwUQaMP7Xp2Uiybfjl+YLS2pTNwQ=; b=rzRqJbNNMUDZEWQBe+m9CpH+FiqJbycMe3N/FaCiLDoKmhiXgYhQOBWsCEclwhI6+t /YFvpD5zpc02N/8wDz6KEA1PKyQIdqyS0iTFBC61T3wY1XPfpA4RkRrwJYLpxZBDWKZp KL6Mtm6RpVi+pKBt2O5z7Ml0CKwGmrK4AR0Z/K8YyzrKdZpWOp2O1dizPIuS8zkP9QBr jUd6qMC3bA1FFR2ps//KNp3g5K4k31sl8eqOnW4ZE0DfUh8if87h4sFYNDleeZjBp7up oyXyjhKEoNGLNRnjrvjKc/Q9MBwPF9s1IH5TEUtBjzTVbq4T3k+CeTOg1GITwrU5J5qv r2jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H4JTplklBDC2Nn6pwUQaMP7Xp2Uiybfjl+YLS2pTNwQ=; b=sFNr7KSRXblApWyB8fWy2+4peA/DwPVmjGZQdHAHIOUpUDcOENYcj00x//LloIt5V/ S6ZhB8aWdbhScaIm69AqcAmUmNeqRZtWRNbUfjtoXl/G3AdQQXzUmZRUmR1ifpqqey7o x4PpdvTNE4eENcrKCNns3JIjM02ZOIqsDiN3IrSR4AwzIdjxQ78l0fslAYDXgVtFo5dZ i9GAb2GQQVMPuvMFsEfcqxOGAgYjY3/TchyAindSIg0npolHPO4Nidw2ChLyZiOr9Jto tMVJV/uibePtHAelw6GaM7cadF4COwWdLLczoIsY9FnMDTWn0c3H6qG2XiFnmm9gPQ85 wyqQ== X-Gm-Message-State: ANoB5pkT69lml27A1116RrpqmyjZu+NEPOy1ePlUb8YOcnujhAlspA8N ALMaqO1lGUH2+WNHmK+0FrwL1w== X-Google-Smtp-Source: AA0mqf7Nywh1NvPICTKCFd6humEY86ZzWzX+4NdScMlh5BJhP+PBkoAxGsflHVa5XYvQFobtA3iCDw== X-Received: by 2002:a17:903:248c:b0:189:c7e3:275f with SMTP id p12-20020a170903248c00b00189c7e3275fmr24744677plw.38.1671040341837; Wed, 14 Dec 2022 09:52:21 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id c8-20020a170903234800b00186748fe6ccsm2149442plh.214.2022.12.14.09.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 09:52:21 -0800 (PST) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Cc: u-boot@lists.denx.de, Jagan Teki , Jason Zhu Subject: [PATCH v4 20/25] arm: rockchip: rv1126: Set dram area unsecure for SPL Date: Wed, 14 Dec 2022 23:21:06 +0530 Message-Id: <20221214175111.477134-21-jagan@edgeble.ai> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214175111.477134-1-jagan@edgeble.ai> References: <20221214175111.477134-1-jagan@edgeble.ai> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Unsecure the dram area so that MMC, USB, and SFC controllers can able to read data from dram. Signed-off-by: Jason Zhu Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- Changes for v4: - none Changes for v3: - collect Kever r-b Changes for v2: - none arch/arm/mach-rockchip/rv1126/rv1126.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/mach-rockchip/rv1126/rv1126.c b/arch/arm/mach-rockchip/rv1126/rv1126.c index 91554c98b6..b9b898756f 100644 --- a/arch/arm/mach-rockchip/rv1126/rv1126.c +++ b/arch/arm/mach-rockchip/rv1126/rv1126.c @@ -10,6 +10,8 @@ #include #include +#define FIREWALL_APB_BASE 0xffa60000 +#define FW_DDR_CON_REG 0x80 #define GRF_BASE 0xFE000000 const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = { @@ -58,6 +60,16 @@ void board_debug_uart_init(void) #ifndef CONFIG_TPL_BUILD int arch_cpu_init(void) { + /** + * Set dram area unsecure in spl + * + * usb & mmc & sfc controllers can read data to dram + * since they are unsecure. + * (Note: only secure-world can access this register) + */ + if (IS_ENABLED(CONFIG_SPL_BUILD)) + writel(0, FIREWALL_APB_BASE + FW_DDR_CON_REG); + return 0; } #endif -- 2.25.1