foss-for-synopsys-dwc-arc-processors/toolchain

Cannot run Linux kernel using nSIM or QEMU for HS58

kolerov opened this issue · 2 comments

Sample of used toolchain for Crosstool-NG:

CT_CONFIG_VERSION="3"
CT_EXPERIMENTAL=y
CT_DEBUG_CT=y
CT_DEBUG_CT_SAVE_STEPS=y
CT_ARCH_ARC=y
CT_ARCH_ARC_ISA_V3=y
CT_TARGET_CFLAGS="-O2 -ffunction-sections -fdata-sections"
CT_TARGET_VENDOR="snps"
CT_TARGET_ALIAS_SED_EXPR="s/${CT_TARGET_VENDOR}-//"
CT_TARGET_ALIAS="arc32-linux"
CT_KERNEL_LINUX=y
CT_LINUX_SRC_DEVEL=y
CT_LINUX_DEVEL_URL="https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git"
CT_LINUX_DEVEL_BRANCH="arc64"
CT_BINUTILS_SRC_DEVEL=y
CT_BINUTILS_DEVEL_URL="https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb.git"
CT_BINUTILS_DEVEL_BRANCH="arc-2023.03"
CT_LIBC_UCLIBC_NG=y
CT_UCLIBC_NG_SRC_DEVEL=y
CT_UCLIBC_NG_DEVEL_URL="https://github.com/foss-for-synopsys-dwc-arc-processors/uClibc.git"
CT_UCLIBC_NG_DEVEL_BRANCH="upstream"
CT_LIBC_UCLIBC_LOCALES=y
CT_GCC_SRC_DEVEL=y
CT_GCC_DEVEL_URL="https://github.com/foss-for-synopsys-dwc-arc-processors/gcc.git"
CT_GCC_DEVEL_BRANCH="arc-2023.03"
CT_CC_GCC_EXTRA_CONFIG_ARRAY="--with-gnu-as --with-gnu-ld"
# CT_CC_GCC_USE_GRAPHITE is not set
# CT_CC_GCC_ENABLE_TARGET_OPTSPACE is not set
CT_CC_LANG_CXX=y
CT_DEBUG_GDB=y
CT_GDB_SRC_DEVEL=y
CT_GDB_DEVEL_URL="https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb.git"
CT_GDB_DEVEL_BRANCH="arc-2023.03"
# CT_GDB_CROSS_PYTHON is not set

defconfig for Buildroot:

BR2_arcle=y
BR2_arc32=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_PATH="/toolchains/arc32-linux-uclibc"
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="$(ARCH)-linux-uclibc"
BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_16=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC=y
BR2_TOOLCHAIN_EXTERNAL_INET_RPC=n
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
BR2_TOOLCHAIN_EXTERNAL_HAS_SSP=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_GIT=y
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="arc64"
BR2_LINUX_KERNEL_DEFCONFIG="haps_hs5x"
BR2_LINUX_KERNEL_VMLINUX=y
BR2_TARGET_GENERIC_HOSTNAME="hs58"
BR2_TARGET_ROOTFS_INITRAMFS=y
BR2_PACKAGE_NFS_UTILS=y
BR2_PACKAGE_NCURSES=y
BR2_PACKAGE_NCURSES_WCHAR=y
BR2_PACKAGE_HAVEGED=y
BR2_PACKAGE_MAKE=y
BR2_PACKAGE_EXPAT=y

Command line for nSIM:

nsimdrv -propsfile hs58.props images/vmlinux

Contents of hs58.props:

nsim_isa_family=av3hs
nsim_isa_dc_hw_prefetch=1
nsim_isa_dual_issue_option=1
nsim_isa_atomic_option=2
nsim_isa_m128_option=0
nsim_isa_ll64_option=1
nsim_isa_mpy_option=9
nsim_isa_div_rem_option=2
nsim_isa_enable_timer_0=1
nsim_isa_enable_timer_1=1
nsim_isa_rtc_option=1
icache=16384,64,4
dcache=16384,64,2
mmu_version=16
mmu_pagesize=4096
mmu_address_space=32
nsim_mem-dev=uart0,kind=dwuart,base=0xf0000000,irq=24
nsim_isa_number_of_interrupts=32
nsim_isa_number_of_external_interrupts=32
nsim_isa_has_fp=1
nsim_isa_fp_dds_option=1
nsim_isa_fp_div_option=1
nsim_isa_fp_dp_option=1
nsim_isa_fp_hp_option=1
nsim_isa_fp_vec_option=1
nsim_isa_fp_wide_option=1

Command line for QEMU:

qemu-system-arc -M virt -cpu hs5x -display none -nographic -monitor none -m 1G -kernel images/vmlinux

Nothing happens after running simulators.

I've updated documentation for building Linux kernel and created a corresponding PR: #539. Property files and defconfig files for ARCv3 which are presented in the documentation are currently outdated. Waiting for merging to arc-dev branch.

@kolerov the documentation part is now merged in arc-dev.