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 AB6D1C433FE for ; Thu, 3 Nov 2022 06:40:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 765298514D; Thu, 3 Nov 2022 07:38:56 +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="HeHgELXi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A1E8B85153; Thu, 3 Nov 2022 07:38:54 +0100 (CET) Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) (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 2449D850DC for ; Thu, 3 Nov 2022 07:38:52 +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-pf1-x42c.google.com with SMTP id b185so780965pfb.9 for ; Wed, 02 Nov 2022 23:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=edgeble-ai.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=i+iwjjXQLiBrJSbdP2Yqaecwk1MCo2dhej+T8eVml6s=; b=HeHgELXiLnHeNBywvRCIF6IqkNNcrtCNQCg/QUSx7ptAECpp2zH33+aP98Sg67RJqG jToGeOfKA1/nXS1ZjitSqzOTy1G/nxB/QOjh2RNyCIIO73nKiinXcRRqVdsqMp/x6KdI bfMIfnEf6+hsvI7AVVaAONaZ/iHDnmb3JT8Ypis7+m7kES5JSdUi6TyAqlIzl4J3W2sV kuO5mY+D3DcpavtWKg1blgBCRdrH0KBuIz9tncwlx0MYVOe5cVv+4jOnya/0TvME4BEr tuzHVOxXbeiUp0X/r6m6Tb5Qdb+8TY7Ly2HdUxqq/LwzZtpqVks77H2kToCZnOzai+Uy u44A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=i+iwjjXQLiBrJSbdP2Yqaecwk1MCo2dhej+T8eVml6s=; b=fciySDx2PCPTrN/Ftjh7EXp0+rFFFKW/YF8lrgED4pD/C5oil83u9FkaGDywwTrFfM Ro7stbTAw8fxtt73FdTX8n24J0AwAqePJG0Je28xCVQ2R6teHSewXoJPpyL9i55YKFxy 562XXLPN7QVDSG1iisp4ihD9kmay7UZjrA5BqDd9sbX6ain31qPuCbQOxp5pmdNVnHb6 Kiv+GJm3d8OHMDTWTX7ZN+/cyCvdNYcrUcY+EwGZ3JpgTCWTslsN3dDUL1w46Ygku0z9 Tt2/j840jvoCxyH3iDPd0CrISZljAnLKCODNhNxbYYrNw/+opyFjaTQ/LY1jKWLINITc qfeg== X-Gm-Message-State: ACrzQf0CVYLQP7pWgOtsuJqaV36Xw8FRTXej/0bVJSpH1Qa4DDyXyoSV HILeNbjxkxh4ZwPYlgSIucDkug== X-Google-Smtp-Source: AMsMyM7dM87jfYf3QuQB55XUqTiDD5p1kx2xXmiCzBfuGgQqBYZ1Crx2JlHHe/RO6ohr4/BLMn5ysg== X-Received: by 2002:a63:6a87:0:b0:46f:8fcc:de1a with SMTP id f129-20020a636a87000000b0046f8fccde1amr21365570pgc.429.1667457530416; Wed, 02 Nov 2022 23:38:50 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a809:3a79:b5a5:9718:3f91]) by smtp.gmail.com with ESMTPSA id a4-20020a1709027d8400b00186fd3951f7sm9380692plm.211.2022.11.02.23.38.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 23:38:50 -0700 (PDT) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Cc: u-boot@lists.denx.de, Jagan Teki , Jason Zhu Subject: [PATCH v3 20/25] arm: rockchip: rv1126: Set dram area unsecure for SPL Date: Thu, 3 Nov 2022 12:08:37 +0530 Message-Id: <20221103063842.854825-1-jagan@edgeble.ai> X-Mailer: git-send-email 2.25.1 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 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