diff options
| author | Tom Rini <[email protected]> | 2019-02-27 13:32:09 -0500 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2019-02-27 13:32:09 -0500 |
| commit | 783e66816d101f970b185083377846059d4d577d (patch) | |
| tree | 31ca1a69df593a7b4ae14dad2def1a48fcc9d91b /arch | |
| parent | b3820ba997f004a376efc5446683101ff42b05af (diff) | |
| parent | 98a66ffa3aafd20d38f357d624e470e20fbb1839 (diff) | |
Merge git://git.denx.de/u-boot-riscv
- SiFive FU540 Support
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/Kconfig | 1 | ||||
| -rw-r--r-- | arch/riscv/Kconfig | 6 | ||||
| -rw-r--r-- | arch/riscv/cpu/generic/Kconfig (renamed from arch/riscv/cpu/qemu/Kconfig) | 2 | ||||
| -rw-r--r-- | arch/riscv/cpu/generic/Makefile (renamed from arch/riscv/cpu/qemu/Makefile) | 0 | ||||
| -rw-r--r-- | arch/riscv/cpu/generic/cpu.c (renamed from arch/riscv/cpu/qemu/cpu.c) | 0 | ||||
| -rw-r--r-- | arch/riscv/cpu/generic/dram.c | 37 | ||||
| -rw-r--r-- | arch/riscv/cpu/qemu/dram.c | 17 | ||||
| -rw-r--r-- | arch/riscv/include/asm/arch-generic/clk.h | 14 | ||||
| -rw-r--r-- | arch/riscv/include/asm/config.h | 1 | ||||
| -rw-r--r-- | arch/riscv/include/asm/dma-mapping.h | 38 | ||||
| -rw-r--r-- | arch/sandbox/dts/test.dts | 8 |
11 files changed, 105 insertions, 19 deletions
diff --git a/arch/Kconfig b/arch/Kconfig index d9afe269f20..2f3d07c13a1 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -61,6 +61,7 @@ config PPC config RISCV bool "RISC-V architecture" + select CREATE_ARCH_SYMLINK select SUPPORT_OF_CONTROL select OF_CONTROL select DM diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index c45e4d73a8c..36512a89950 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -14,15 +14,19 @@ config TARGET_AX25_AE350 config TARGET_QEMU_VIRT bool "Support QEMU Virt Board" +config TARGET_SIFIVE_FU540 + bool "Support SiFive FU540 Board" + endchoice # board-specific options below source "board/AndesTech/ax25-ae350/Kconfig" source "board/emulation/qemu-riscv/Kconfig" +source "board/sifive/fu540/Kconfig" # platform-specific options below source "arch/riscv/cpu/ax25/Kconfig" -source "arch/riscv/cpu/qemu/Kconfig" +source "arch/riscv/cpu/generic/Kconfig" # architecture-specific options below diff --git a/arch/riscv/cpu/qemu/Kconfig b/arch/riscv/cpu/generic/Kconfig index f48751e6de7..1d6ab5032da 100644 --- a/arch/riscv/cpu/qemu/Kconfig +++ b/arch/riscv/cpu/generic/Kconfig @@ -2,7 +2,7 @@ # # Copyright (C) 2018, Bin Meng <[email protected]> -config QEMU_RISCV +config GENERIC_RISCV bool select ARCH_EARLY_INIT_R imply CPU diff --git a/arch/riscv/cpu/qemu/Makefile b/arch/riscv/cpu/generic/Makefile index 258e4620dd4..258e4620dd4 100644 --- a/arch/riscv/cpu/qemu/Makefile +++ b/arch/riscv/cpu/generic/Makefile diff --git a/arch/riscv/cpu/qemu/cpu.c b/arch/riscv/cpu/generic/cpu.c index ad2950ce40a..ad2950ce40a 100644 --- a/arch/riscv/cpu/qemu/cpu.c +++ b/arch/riscv/cpu/generic/cpu.c diff --git a/arch/riscv/cpu/generic/dram.c b/arch/riscv/cpu/generic/dram.c new file mode 100644 index 00000000000..b7b12072351 --- /dev/null +++ b/arch/riscv/cpu/generic/dram.c @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2018, Bin Meng <[email protected]> + */ + +#include <common.h> +#include <fdtdec.h> +#include <linux/sizes.h> + +DECLARE_GLOBAL_DATA_PTR; + +int dram_init(void) +{ + return fdtdec_setup_mem_size_base(); +} + +int dram_init_banksize(void) +{ + return fdtdec_setup_memory_banksize(); +} + +ulong board_get_usable_ram_top(ulong total_size) +{ +#ifdef CONFIG_64BIT + /* + * Ensure that we run from first 4GB so that all + * addresses used by U-Boot are 32bit addresses. + * + * This in-turn ensures that 32bit DMA capable + * devices work fine because DMA mapping APIs will + * provide 32bit DMA addresses only. + */ + if (gd->ram_top > SZ_4G) + return SZ_4G; +#endif + return gd->ram_top; +} diff --git a/arch/riscv/cpu/qemu/dram.c b/arch/riscv/cpu/qemu/dram.c deleted file mode 100644 index 84d87d2a7f6..00000000000 --- a/arch/riscv/cpu/qemu/dram.c +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Copyright (C) 2018, Bin Meng <[email protected]> - */ - -#include <common.h> -#include <fdtdec.h> - -int dram_init(void) -{ - return fdtdec_setup_mem_size_base(); -} - -int dram_init_banksize(void) -{ - return fdtdec_setup_memory_banksize(); -} diff --git a/arch/riscv/include/asm/arch-generic/clk.h b/arch/riscv/include/asm/arch-generic/clk.h new file mode 100644 index 00000000000..1631f5f0bd0 --- /dev/null +++ b/arch/riscv/include/asm/arch-generic/clk.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2019 Western Digital Corporation or its affiliates. + * + * Authors: + * Anup Patel <[email protected]> + */ + +#ifndef __ASM_RISCV_ARCH_CLK_H +#define __ASM_RISCV_ARCH_CLK_H + +/* Note: This is a placeholder header for driver compilation. */ + +#endif diff --git a/arch/riscv/include/asm/config.h b/arch/riscv/include/asm/config.h index 81bc975d2e8..156cb94dc04 100644 --- a/arch/riscv/include/asm/config.h +++ b/arch/riscv/include/asm/config.h @@ -8,5 +8,6 @@ #define _ASM_CONFIG_H_ #define CONFIG_LMB +#define CONFIG_SYS_BOOT_RAMDISK_HIGH #endif diff --git a/arch/riscv/include/asm/dma-mapping.h b/arch/riscv/include/asm/dma-mapping.h new file mode 100644 index 00000000000..3d930c90ece --- /dev/null +++ b/arch/riscv/include/asm/dma-mapping.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2018 Western Digital Corporation or its affiliates. + * + * Authors: + * Anup Patel <[email protected]> + */ + +#ifndef __ASM_RISCV_DMA_MAPPING_H +#define __ASM_RISCV_DMA_MAPPING_H + +#include <linux/dma-direction.h> + +#define dma_mapping_error(x, y) 0 + +static inline void *dma_alloc_coherent(size_t len, unsigned long *handle) +{ + *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len); + return (void *)*handle; +} + +static inline void dma_free_coherent(void *addr) +{ + free(addr); +} + +static inline unsigned long dma_map_single(volatile void *vaddr, size_t len, + enum dma_data_direction dir) +{ + return (unsigned long)vaddr; +} + +static inline void dma_unmap_single(volatile void *vaddr, size_t len, + unsigned long paddr) +{ +} + +#endif /* __ASM_RISCV_DMA_MAPPING_H */ diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index d4c708c79e8..87d8e5bcc98 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -203,6 +203,14 @@ #clock-cells = <0>; clock-frequency = <1234>; }; + + clk_fixed_factor: clk-fixed-factor { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clock-div = <3>; + clock-mult = <2>; + clocks = <&clk_fixed>; + }; }; clk_sandbox: clk-sbox { |
