mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-04 18:41:03 +00:00
fd426b3106
"kendryte" is the marketing name for the K210 RISC-V SoC produced by Canaan Inc. Rather than "kendryte,k210", use the usual "canaan,k210" vendor,SoC compatibility string format in the device tree files and use the SoC name for file names. With these changes, the device tree files are more in sync with the Linux kernel DTS and drivers, making uboot device tree usable by the kernel. Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
51 lines
872 B
C
51 lines
872 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (C) 2019-20 Sean Anderson <seanga2@gmail.com>
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <clk.h>
|
|
#include <dm.h>
|
|
#include <fdt_support.h>
|
|
#include <asm/io.h>
|
|
|
|
phys_size_t get_effective_memsize(void)
|
|
{
|
|
return CONFIG_SYS_SDRAM_SIZE;
|
|
}
|
|
|
|
static int sram_init(void)
|
|
{
|
|
int ret, i;
|
|
const char * const banks[] = { "sram0", "sram1", "aisram" };
|
|
ofnode memory;
|
|
struct clk clk;
|
|
|
|
/* Enable RAM clocks */
|
|
memory = ofnode_by_compatible(ofnode_null(), "canaan,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;
|
|
}
|
|
|
|
int board_early_init_f(void)
|
|
{
|
|
return sram_init();
|
|
}
|
|
|
|
int board_init(void)
|
|
{
|
|
return 0;
|
|
}
|