diff options
author | TekkamanV <tekkamanv@starfivetech.com> | 2021-08-16 15:20:01 +0300 |
---|---|---|
committer | Tekkaman Ninja <tekkamanninja@163.com> | 2021-09-29 09:51:21 +0300 |
commit | c3f9ce08df88cc808e39cadce6897c4911ce86c0 (patch) | |
tree | 1a0a2807051fd5551386792487b92b14ef931bfa /include/configs | |
parent | 4f70f1998558aa4b7ea0a985ca442be0ca780bd5 (diff) | |
download | u-boot-c3f9ce08df88cc808e39cadce6897c4911ce86c0.tar.xz |
starfive: Add JH7100 support
This patch adds StarFive JH7100 main support, including Starlight and EVB
support, ported from StarFive HiFive_U-Boot REPO.
The original authors are
bo.li <bo.li@starfivetech.com>
Chenjieqin <Jessica.Chen@starfivetech.com>
Huan.Feng <huan.feng@starfivetech.com>
jack.zhu <jack.zhu@starfivetech.com>
Jianlong Huang <jianlong.huang@starfivetech.com>
ke.zhu <ke.zhu@starfivetech.com>
Micheal Zhu <michael.zhu@starfivetech.com>
Samin Guo <samin.guo@starfivetech.com>
yanhong.wang <yanhong.wang@starfivetech.com>
yiming.li <yiming.li@starfivetech.com>
Note:
1, disable BTRFS(will trigger a link error with *some* RV64 GCC)
But RV64 GCC on Fedora works well with enabling BTRFS.
BTRFS will select ZSTD which will trigger a link error with
*some* RV64 GCC:
---
riscv64-unknown-linux-gnu-ld.bfd: /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/libgcc.a(_clzsi2.o): can't link double-float modules with soft-float modules
riscv64-unknown-linux-gnu-ld.bfd: failed to merge target specific data of file /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/libgcc.a(_clzsi2.o)
riscv64-unknown-linux-gnu-ld.bfd: /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/libgcc.a(_clz.o): can't link double-float modules with soft-float modules
riscv64-unknown-linux-gnu-ld.bfd: failed to merge target specific data of file /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/libgcc.a(_clz.o)
make: *** [Makefile:1787: u-boot] Error 1
---
2, enable OF_SEPARATE:
This is required so that openSBI can add itself to /reserved-memory, and
let EFI know about it.
By Andreas Schwab <schwab@suse.de>
3, Set default fdtfile name
By Andreas Schwab <schwab@suse.de>
Diffstat (limited to 'include/configs')
-rw-r--r-- | include/configs/starfive-jh7100.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/include/configs/starfive-jh7100.h b/include/configs/starfive-jh7100.h new file mode 100644 index 0000000000..590e7b6db4 --- /dev/null +++ b/include/configs/starfive-jh7100.h @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2021 Shanghai StarFive Technology Co., Ltd. + * TekkamanV <tekkamanv@starfivetech.com> + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#include <version.h> +#include <linux/sizes.h> + +#define CONFIG_SYS_CACHELINE_SIZE 64 + +/* + * Miscellaneous configurable options + */ +#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ +#define CONFIG_SYS_BOOTM_LEN (64 << 20) /* 64MB */ + +/* + * Print Buffer Size + */ +#define CONFIG_SYS_PBSIZE \ + (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +/* + * Boot Argument Buffer Size + */ +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE + +/* + * max number of command args + */ +#define CONFIG_SYS_MAXARGS 16 + +#define CONFIG_SYS_SDRAM_BASE 0x80000000 +/* Init Stack Pointer */ +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M) +#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M) +#define CONFIG_STANDALONE_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M) + +/*mac addr offset in otp*/ +#define STARFIVE_OTP_MAC_OFFSET 0x28 + +/* + * Ethernet + */ +#if CONFIG_IS_ENABLED(CMD_NET) +#define CONFIG_DW_ALTDESCRIPTOR +#define CONFIG_ARP_TIMEOUT 0x5000 +#endif + +/* HACK these should have '#if defined (stuff) around them like zynqp*/ +#define BOOT_TARGET_DEVICES(func) func(DHCP, dhcp, na) \ + func(MMC, mmc, 0) + +#include <config_distro_bootcmd.h> + +#include <environment/distro/sf.h> + +#define STARLIGHT_FEDORA_BOOTENV \ + "bootdir=/boot\0" \ + "bootenv=uEnv.txt\0" \ + "mmcdev=0\0" \ + "mmcpart=3\0" + +#define CONFIG_EXTRA_ENV_SETTINGS \ + STARLIGHT_FEDORA_BOOTENV \ + "loadaddr=0xa0000000\0" \ + "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ + "ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \ + "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \ + "env import -t ${loadaddr} ${filesize}\0" \ + "mmcbootenv=setenv bootpart ${mmcdev}:${mmcpart}; " \ + "mmc dev ${mmcdev}; " \ + "if mmc rescan; then " \ + "run loadbootenv && run importbootenv; " \ + "run ext4bootenv && run importbootenv; " \ + "if test -n $uenvcmd; then " \ + "echo Running uenvcmd ...; " \ + "run uenvcmd; " \ + "fi; " \ + "fi\0" \ + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ + BOOTENV \ + BOOTENV_SF + +#define CONFIG_SYS_MAX_FLASH_SECT 0 +#define CONFIG_SYS_MAX_FLASH_BANKS 0 +#define __io + +/* + * QSPI support + */ +#ifdef CONFIG_OF_CONTROL /* QSPI is controlled via DT */ +#define CONFIG_CQSPI_REF_CLK (250000000) +#endif + +#endif /* __CONFIG_H */ |