From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH 09/10] riscv: Enable AI ram on K210
Date: Tue, 29 Sep 2020 10:18:34 -0400 [thread overview]
Message-ID: <20200929141835.38435-10-seanga2@gmail.com> (raw)
In-Reply-To: <20200929141835.38435-1-seanga2@gmail.com>
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 <seanga2@gmail.com>
---
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 <fdt_support.h>
#include <asm/io.h>
-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
--
2.28.0
next prev parent reply other threads:[~2020-09-29 14:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-29 14:18 [PATCH 00/10] riscv: k210: Enable use of AI ram bank Sean Anderson
2020-09-29 14:18 ` [PATCH 01/10] clk: k210: Fix PLLs not being enabled Sean Anderson
2020-09-29 14:18 ` [PATCH 02/10] clk: Add support for the k210 clock driver pre-relocation Sean Anderson
2020-09-29 14:18 ` [PATCH 03/10] riscv: Enable some devices pre-relocation Sean Anderson
2020-09-29 14:18 ` [PATCH 04/10] lib: fdt: Add fdtdec_setup_mem_size_base_highest Sean Anderson
2020-10-12 3:34 ` Simon Glass
2020-09-29 14:18 ` [PATCH 05/10] test: Add a test for fdtdec_setup_mem_size_base et al Sean Anderson
2020-10-12 3:34 ` Simon Glass
2020-09-29 14:18 ` [PATCH 06/10] ram: Add driver for K210 SRAM Sean Anderson
2020-10-07 13:26 ` Simon Glass
2020-09-29 14:18 ` [PATCH 07/10] ram: sifive: Default to y only if compiling for fu540 Sean Anderson
2020-09-30 4:08 ` Pragnesh Patel
2020-09-29 14:18 ` [PATCH 08/10] riscv: Probe ram in dram_init Sean Anderson
2020-09-29 14:18 ` Sean Anderson [this message]
2020-09-29 14:18 ` [PATCH 10/10] riscv: Don't reserve AI ram in k210 dts Sean Anderson
2020-09-29 15:03 ` Heinrich Schuchardt
2020-09-29 15:07 ` Sean Anderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200929141835.38435-10-seanga2@gmail.com \
--to=seanga2@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox