From patchwork Mon Oct 12 18:13:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1381083 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=mNiEbbGZ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C96Nc5rPcz9sT6 for ; Tue, 13 Oct 2020 05:17:52 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 965F98258C; Mon, 12 Oct 2020 20:15:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="mNiEbbGZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 811A782555; Mon, 12 Oct 2020 20:15:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) (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 F269082555 for ; Mon, 12 Oct 2020 20:15:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qt1-x843.google.com with SMTP id r8so14170216qtp.13 for ; Mon, 12 Oct 2020 11:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+cBuGEWmg7+5gYmBK9QyVubZzZUs3wch+vMWZfI+gGk=; b=mNiEbbGZvhlGTGv/vINQyh8ox2uk8jJdkpzVsJKGnF/caM02ozeX7kuEnfEvqa4CmZ /s8jF7DB9jl/QjoX8LJk3S6wHonR0gOc4nyFZ3uOmVXfbGOv6HNMkqkIiMhLGTg/K3pA uF9RWvAD9OzDUwOvOTNdwO7MicT+LEaixOTG26xJMhuyMRScwLW/1sq10fQYBIjyD4ii AUkaGq4GOP19pKT+ex4nRrP+4iqEtVzH+H1VEgQdxWbzV4CwlvUIovMek/nQS6PkGdq5 WEhla2aVVcoXe3agfmmwLNRA458lJT5igdW+/B51eAXf1BSPwhwnfxZPUOj5cAsciGGp x3XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+cBuGEWmg7+5gYmBK9QyVubZzZUs3wch+vMWZfI+gGk=; b=mwBFnfZjOP85zdt3k16M/a1D7RI9nMzbBkvMHRB4OxfPy9UIOpEwKBUJxHG84E50ku 3J9D5Vy/yEers4qo09EiKZbEbAIAndxYmcDsuPuN43FWgYmrMt5sw9sK/TGbZK+U3NyF 7wdbeJ0BvxlU0hsGKRVifw+FRIB4khE3VOrGak1EjUpONLVOXKWLOVKamMufIyTkioi8 YpL4OyfHma0NXossMlJISA4hNrOzSN4MV8arhjBE93XWlT0PN4y6Qvl/JRxEPNUtcd8M SdiXVuijKIY60ZkIRdSs05i5i2ifs98JBGc/Z91Y1x0VkuhCiw+vAZS0AsDyUv/rGfK4 ynhQ== X-Gm-Message-State: AOAM5333kNxteeVmmtU13KaedFfU7KNTmxNPPitHaEwHcTDXtICCapj2 mrfe/OyPCYqhHbhzzWOzde2M35i02ORO2w== X-Google-Smtp-Source: ABdhPJwhJ6ffXaScHKGoS0ZGwBQ8mmeGFRZH2QJAVlcIUrehaL2azVzVGPBkpwTJIvwZc6hYEr8Pgg== X-Received: by 2002:ac8:7cad:: with SMTP id z13mr11590787qtv.366.1602526520746; Mon, 12 Oct 2020 11:15:20 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id t3sm12968651qtq.24.2020.10.12.11.15.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 11:15:20 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Rick Chen , Bin Meng , Sean Anderson Subject: [PATCH v2 13/16] riscv: Enable AI ram on K210 Date: Mon, 12 Oct 2020 14:13:42 -0400 Message-Id: <20201012181345.338661-14-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012181345.338661-1-seanga2@gmail.com> References: <20201012181345.338661-1-seanga2@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean CONFIG_SYS_SDRAM_{BASE,SIZE} are no longer necessary. The default get_effective_memsize will also work. The clock driver creates a bunch of devices, so we need to increase the pre-reloc malloc arena. Signed-off-by: Sean Anderson Reviewed-by: Rick Chen --- (no changes since v1) board/sipeed/maix/Kconfig | 2 ++ board/sipeed/maix/maix.c | 26 -------------------------- configs/sipeed_maix_bitm_defconfig | 1 + include/configs/sipeed-maix.h | 4 ---- 4 files changed, 3 insertions(+), 30 deletions(-) diff --git a/board/sipeed/maix/Kconfig b/board/sipeed/maix/Kconfig index 4c42dd2087..ba61810079 100644 --- a/board/sipeed/maix/Kconfig +++ b/board/sipeed/maix/Kconfig @@ -42,6 +42,8 @@ config BOARD_SPECIFIC_OPTIONS imply CLK_K210 imply DM_RESET imply RESET_SYSCON + imply RAM + imply K210_SRAM imply SYSRESET imply SYSRESET_SYSCON imply PINCTRL diff --git a/board/sipeed/maix/maix.c b/board/sipeed/maix/maix.c index cbcb23cf5c..1b6f8a5115 100644 --- a/board/sipeed/maix/maix.c +++ b/board/sipeed/maix/maix.c @@ -9,33 +9,7 @@ #include #include -phys_size_t get_effective_memsize(void) -{ - return CONFIG_SYS_SDRAM_SIZE; -} - int board_init(void) { - int ret, i; - const char * const banks[] = { "sram0", "sram1", "airam" }; - ofnode memory; - struct clk clk; - - /* Enable RAM clocks */ - memory = ofnode_by_compatible(ofnode_null(), "kendryte,k210-sram"); - if (ofnode_equal(memory, ofnode_null())) - return -ENOENT; - - for (i = 0; i < ARRAY_SIZE(banks); i++) { - ret = clk_get_by_name_nodev(memory, banks[i], &clk); - if (ret) - continue; - - ret = clk_enable(&clk); - clk_free(&clk); - if (ret) - return ret; - } - return 0; } diff --git a/configs/sipeed_maix_bitm_defconfig b/configs/sipeed_maix_bitm_defconfig index 459bf0d530..d0100ad9e9 100644 --- a/configs/sipeed_maix_bitm_defconfig +++ b/configs/sipeed_maix_bitm_defconfig @@ -1,4 +1,5 @@ CONFIG_RISCV=y +CONFIG_SYS_MALLOC_F_LEN=0x10000 CONFIG_TARGET_SIPEED_MAIX=y CONFIG_ARCH_RV64I=y CONFIG_STACK_SIZE=0x100000 diff --git a/include/configs/sipeed-maix.h b/include/configs/sipeed-maix.h index 36ff522e4b..81956cccfd 100644 --- a/include/configs/sipeed-maix.h +++ b/include/configs/sipeed-maix.h @@ -14,10 +14,6 @@ #define CONFIG_SYS_MALLOC_LEN SZ_128K #define CONFIG_SYS_CACHELINE_SIZE 64 -#define CONFIG_SYS_SDRAM_BASE 0x80000000 -/* Don't relocate into AI ram since it isn't set up yet */ -#define CONFIG_SYS_SDRAM_SIZE (SZ_4M + SZ_2M) - /* For early init */ #define K210_SYSCTL_BASE 0x50440000