diff options
Diffstat (limited to 'roms/u-boot/board/sipeed/maix')
-rw-r--r-- | roms/u-boot/board/sipeed/maix/Kconfig | 74 | ||||
-rw-r--r-- | roms/u-boot/board/sipeed/maix/MAINTAINERS | 11 | ||||
-rw-r--r-- | roms/u-boot/board/sipeed/maix/Makefile | 5 | ||||
-rw-r--r-- | roms/u-boot/board/sipeed/maix/maix.c | 51 |
4 files changed, 141 insertions, 0 deletions
diff --git a/roms/u-boot/board/sipeed/maix/Kconfig b/roms/u-boot/board/sipeed/maix/Kconfig new file mode 100644 index 000000000..adf6abb57 --- /dev/null +++ b/roms/u-boot/board/sipeed/maix/Kconfig @@ -0,0 +1,74 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (C) 2019-20 Sean Anderson <seanga2@gmail.com> + +if TARGET_SIPEED_MAIX + +config SYS_BOARD + default "maix" + +config SYS_VENDOR + default "sipeed" + +config SYS_CPU + default "generic" + +config SYS_CONFIG_NAME + default "sipeed-maix" + +config SYS_TEXT_BASE + default 0x80000000 + +config DEFAULT_DEVICE_TREE + default "k210-maix-bit" + +config NR_CPUS + default 2 + +config NR_DRAM_BANKS + default 3 + +config BOARD_SPECIFIC_OPTIONS + def_bool y + select GENERIC_RISCV + select RISCV_PRIV_1_9 + imply SMP + imply DM_SERIAL + imply SIFIVE_SERIAL + imply SIFIVE_CLINT + imply POWER_DOMAIN + imply SIMPLE_PM_BUS + imply CLK_CCF + imply CLK_COMPOSITE_CCF + imply CLK_K210 + imply DM_RESET + imply RESET_SYSCON + imply SYSRESET + imply SYSRESET_SYSCON + imply PINCTRL + imply PINCONF + imply PINCTRL_K210 + imply DM_GPIO + imply DWAPB_GPIO + imply SIFIVE_GPIO + imply CMD_GPIO + imply LED + imply LED_GPIO + imply SPI + imply DESIGNWARE_SPI + imply SPI_FLASH_GIGADEVICE + imply SPI_FLASH_WINBOND + imply DM_MTD + imply SPI_FLASH_MTD + imply CMD_MTD + imply ENV_IS_IN_SPI_FLASH + imply MMC + imply MMC_BROKEN_CD + imply MMC_SPI + imply CMD_MMC + imply DOS_PARTITION + imply EFI_PARTITION + imply CMD_PART + imply CMD_FS_GENERIC + imply WDT + imply DESIGNWARE_WATCHDOG +endif diff --git a/roms/u-boot/board/sipeed/maix/MAINTAINERS b/roms/u-boot/board/sipeed/maix/MAINTAINERS new file mode 100644 index 000000000..0778af7a5 --- /dev/null +++ b/roms/u-boot/board/sipeed/maix/MAINTAINERS @@ -0,0 +1,11 @@ +Sipeed Maix BOARD +M: Sean Anderson <seanga2@gmail.com> +S: Maintained +F: arch/riscv/dts/k210.dtsi +F: arch/riscv/dts/k210-maix-bit.dts +F: board/sipeed/maix/ +F: configs/sipeed_maix*_defconfig +F: doc/board/sipeed/ +F: include/configs/sipeed-maix.h +F: include/dt-bindings/*/k210-sysctl.h +F: test/dm/k210_pll.c diff --git a/roms/u-boot/board/sipeed/maix/Makefile b/roms/u-boot/board/sipeed/maix/Makefile new file mode 100644 index 000000000..4acff5b31 --- /dev/null +++ b/roms/u-boot/board/sipeed/maix/Makefile @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (c) 2019 Western Digital Corporation or its affiliates. + +obj-y += maix.o diff --git a/roms/u-boot/board/sipeed/maix/maix.c b/roms/u-boot/board/sipeed/maix/maix.c new file mode 100644 index 000000000..52e4fee2f --- /dev/null +++ b/roms/u-boot/board/sipeed/maix/maix.c @@ -0,0 +1,51 @@ +// 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(), "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; +} + +int board_early_init_f(void) +{ + return sram_init(); +} + +int board_init(void) +{ + return 0; +} |