From patchwork Tue Sep 29 14:18:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1373477 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=fsJjiMGv; 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 4C11lC5hzFz9ryj for ; Wed, 30 Sep 2020 00:20:55 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D6ECC82394; Tue, 29 Sep 2020 16:19:22 +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="fsJjiMGv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CEF568233D; Tue, 29 Sep 2020 16:19:00 +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-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (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 8F29281996 for ; Tue, 29 Sep 2020 16:18:57 +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-x841.google.com with SMTP id y11so3638926qtn.9 for ; Tue, 29 Sep 2020 07:18:57 -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=vxUR1MfbKAYIcmQJNIWQ5JvDpkOsmSf7Kqd1J1/1r20=; b=fsJjiMGv/hqwu2BiCR+Xf4A7HfMNzEv88zcMfpmj1IycVR7VZnMKo2ja3H6ytJQw4G 5cRRV1wPM4huHzqEicI+NaU48z2cF3QUVfYIzb354JqkkNFFnmj2sFEqoPNpckZ04+oS fIj2NChv3xAksw8x1wwvYag4EWQCNgYYgpfcJ9KGJerMM6U2gYAsan2PenU5c+QC1wgx /D2GJAkdJCXUQDRkP+Sur+qAXY3KQWLJB6CwMOtwGYaM6Bl9KtNWk1hex64mA43Ga+ee dV9N0ivFO39/pxdIzp+lCK8Wswj3mzgvZYSMJNMgT7VcKClTl7YrorQ5WXGfXktXcjSf fOqg== 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=vxUR1MfbKAYIcmQJNIWQ5JvDpkOsmSf7Kqd1J1/1r20=; b=ilFTTUY73ZRal5GqamjHM4E3CkbmhD82McN+ssiBZneKCNYE1nB/iqr4qyxZ1z9Qeo GV49VA8iAfhwszseAGCbH9vahg+2mFBzdJ935OxXOROhItWRmV3p9HuVnefSxIzLM/j6 TuBhKYcHVkNpYxcUISdkFpHTFflZKxCiCv8pZNNP+1/hWl9MwkQZZogrNK8ChRBmSaxQ 0v0V+8B+2PEVTrn/pkC89tWO6FDbJywfflsH7Ug5pWwBC/wFTUO48FG7f8c0twomfwEe NphBh3CybJe3+j27o/VV8/E11kS62lFPOHnoPrqpGpGL2r5xavEgV9RG4056f0NAuw1G pcKg== X-Gm-Message-State: AOAM533gp29cHEhbIveBUvY6mEv7c3sFusrI+HWJ+5vPJI4EoHGKJCUM r3/N+IWVCu6zOKM0x8dNWBKG0lcEwsuYnw== X-Google-Smtp-Source: ABdhPJyaueqqjLJS1PP/pOVSvU2LYtqd2wYtFLcUZaE0XderjlcztfkNo0whun0SwkDKDZzLZFo2Qw== X-Received: by 2002:ac8:674d:: with SMTP id n13mr3426798qtp.171.1601389136225; Tue, 29 Sep 2020 07:18:56 -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 l6sm117535qkb.56.2020.09.29.07.18.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 07:18:55 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Bin Meng , Rick Chen , Heinrich Schuchardt , Sean Anderson Subject: [PATCH 09/10] riscv: Enable AI ram on K210 Date: Tue, 29 Sep 2020 10:18:34 -0400 Message-Id: <20200929141835.38435-10-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929141835.38435-1-seanga2@gmail.com> References: <20200929141835.38435-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 --- 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 0cdcd32adc..e456a6396d 100644 --- a/board/sipeed/maix/Kconfig +++ b/board/sipeed/maix/Kconfig @@ -44,4 +44,6 @@ config BOARD_SPECIFIC_OPTIONS imply RESET_SYSCON imply SYSRESET imply SYSRESET_SYSCON + imply RAM + imply K210_SRAM endif 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