{"id":22097432,"url":"https://github.com/nuclei-software/nuclei-linux-sdk","last_synced_at":"2025-07-24T22:33:03.873Z","repository":{"id":43024132,"uuid":"274333409","full_name":"Nuclei-Software/nuclei-linux-sdk","owner":"Nuclei-Software","description":"Nuclei RISC-V Linux Software Development Kit","archived":false,"fork":false,"pushed_at":"2024-08-17T03:00:37.000Z","size":2940,"stargazers_count":38,"open_issues_count":17,"forks_count":9,"subscribers_count":7,"default_branch":"dev_nuclei_5.10_v2","last_synced_at":"2024-08-18T03:45:38.330Z","etag":null,"topics":["buildroot","embedded","linux","nuclei","riscv","riscv64","sdk"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nuclei-Software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-23T07:03:39.000Z","updated_at":"2024-08-18T03:45:38.331Z","dependencies_parsed_at":"2023-12-22T12:04:03.032Z","dependency_job_id":"6d32c81a-aa1e-4b15-aff4-fcc52f41a5e7","html_url":"https://github.com/Nuclei-Software/nuclei-linux-sdk","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nuclei-Software%2Fnuclei-linux-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nuclei-Software%2Fnuclei-linux-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nuclei-Software%2Fnuclei-linux-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nuclei-Software%2Fnuclei-linux-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nuclei-Software","download_url":"https://codeload.github.com/Nuclei-Software/nuclei-linux-sdk/tar.gz/refs/heads/dev_nuclei_5.10_v2","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227482406,"owners_count":17779968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["buildroot","embedded","linux","nuclei","riscv","riscv64","sdk"],"created_at":"2024-12-01T04:15:33.254Z","updated_at":"2025-07-24T22:33:03.852Z","avatar_url":"https://github.com/Nuclei-Software.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nuclei Linux SDK\n\n[![Build and Test Linux SDK](https://github.com/Nuclei-Software/nuclei-linux-sdk/actions/workflows/build.yml/badge.svg?branch=dev_nuclei_5.10_v2)](https://github.com/Nuclei-Software/nuclei-linux-sdk/actions/workflows/build.yml)\n\n[![Build Linux SDK Docker Image](https://github.com/Nuclei-Software/nuclei-linux-sdk/actions/workflows/docker.yml/badge.svg?branch=dev_nuclei_5.10_v2)](https://github.com/Nuclei-Software/nuclei-linux-sdk/actions/workflows/docker.yml)\n\nPlease check [about each branch feature](https://github.com/Nuclei-Software/nuclei-linux-sdk/issues/2) to learn which branch you should choose.\n\n## Tested Configurations\n\n### Docker\n\nIf you want to use it in docker image, please follow steps below:\n\n\u003e Not tested for upload freeloader, need USB connection.\n\nSee [How to evaluate Nuclei Linux SDK in docker](https://github.com/Nuclei-Software/nuclei-linux-sdk/issues/8)\n\n### Ubuntu 20.04 x86_64 host\n\n- Status: Working\n- Build dependencies\n  - packages: see [apt.txt](.github/apt.txt)\n  - python pip packages: [pipreq.txt](.github/pipreq.txt)\n- Get prebuilt qemu and openocd 2025.02 from [Nuclei Development Tools](https://nucleisys.com/download.php#tools)\n- Setup qemu and openocd and add it into **PATH**\n- mtools version \u003e= 4.0.24\n\n## Build Instructions\n\n### Install Dependencies\n\nInstall the software dependencies required by this SDK using command:\n\n~~~shell\nsudo xargs apt-get install -y \u003c .github/apt.txt\nsudo pip3 install -r .github/pipreq.txt\n~~~\n\n### Install Nuclei Tools\n\nDownload prebuilt 64bit `openocd` tool and `qemu` from [Nuclei Development Tools](https://nucleisys.com/download.php#tools),\nand extract it into your PC, and then setup **PATH** using this command:\n\n\u003e \\\u003e= 2023.10 release is required. You can install Nuclei Studio, which contains prebuilt openocd/qemu\n\n~~~shell\n# Make sure you changed /path/to/openocd/bin and /path/to/qemu/bin to the real path of your PC\nexport PATH=/path/to/openocd/bin:/path/to/qemu/bin:$PATH\n# Check path is set correctly\nwhich openocd qemu-system-riscv64\n~~~\n\n### Fix nuclei riscv gdb run issue\n\nYou may meet with this issue: `error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory`\n\n~~~\n# see issue https://github.com/Nuclei-Software/nuclei-linux-sdk/issues/5\nsudo ln -s /lib/x86_64-linux-gnu/libgmp.so /lib/x86_64-linux-gnu/libgmp.so.3\n~~~\n\nIf you met other strange issues not documented in this doc,\nplease check [Linux SDK Issues](https://github.com/Nuclei-Software/nuclei-linux-sdk/issues), if the\nexisting issues not address your problem, please [create a new issue](https://github.com/Nuclei-Software/nuclei-linux-sdk/issues/new)\n\n### Clone Repo\n\n\u003e **Gitee Mirror not longer work**, since linux mirror repo is blocked by gitee, see https://github.com/Nuclei-Software/nuclei-linux-sdk/issues/10#issuecomment-1728920670\n\n* Checkout this repository using `git`.\n\n\u003e Change the below `dev_nuclei_5.10_v2` to your desired branch.\n\n  - If you have good network access to github, you can clone this repo using command\n    `git clone -b dev_nuclei_5.10_v2 https://github.com/Nuclei-Software/nuclei-linux-sdk`\n  - Otherwise, you can try methods provided https://github.com/Nuclei-Software/nuclei-linux-sdk/issues/10\n  - If https is not stable, you can try ssh, please search about git clone ssh/https difference\n\n* Then you will need to checkout all of the linked submodules using:\n\n  ~~~shell\n  cd nuclei-linux-sdk\n  # the following command might fail due to network connection issue\n  # you can clone less code with --depth=1\n  # you can also try some github mirror tech, search in baidu/google\n  # if still not working, you can try our prepared source code(maybe out of date), see https://github.com/Nuclei-Software/nuclei-linux-sdk/issues/4\n  git submodule update --recursive --init\n  # if you want to clone less source code to speed up or make clone stable, please add extra --depth=1\n  # --depth=1 is used to do shallow clone, see https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt---depth\n  # git submodule update --init --depth=1\n  ~~~\n\n* To make sure you have checked out clean source code, you need to run `git status` command,\n  and get expected output as below:\n\n  ~~~\n  On branch dev_nuclei_5.10_v2\n  Your branch is up to date with 'origin/dev_nuclei_5.10_v2'.\n\n  nothing to commit, working tree clean\n  ~~~\n\n* If you have trouble in get clean working tree, you can try command\n  `git submodule update --recursive --init --depth=1` again, you might need to\n  retry several times depending on your network access speed.\n* If you still have issues, please check FAQ sections at the bottom of this README.md\n\nThis will take some time and require around 2GB of disk space. Some modules may\nfail because certain dependencies don't have the best git hosting. The only\nsolution is to wait and try again later (or ask someone for a copy of that\nsource repository).\n\n### Update source code\n\nUpdate source code if there are new commits in this repo.\n\nAssume currently you are in `dev_nuclei_5.10_v2` branch, and the working tree is clean.\n\nThen you run the following command to update this repo:\n\n~~~shell\n# Pull lastest source code and rebase your local commits onto it\ngit pull --rebase origin dev_nuclei_5.10_v2\n# Update git submodules\ngit submodule update\n# Check workspace status to see whether it is clean\ngit status\n~~~\n\n### Switch branch\n\nSee https://github.com/Nuclei-Software/nuclei-linux-sdk/issues/10\n\n## Show Help\n\nYou can run `make help` to show help message about how to use this Nuclei Linux SDK.\n\nBut if you want to change and adapt for your SoC, you need to understand the build system in Makefile.\n\n## Nuclei Linux SDK Integration\n\nHere are the version numbers of sub projects used in Nuclei Linux SDK.\n\n* Linux 5.10.y\n* Uboot v2021.01\n* OpenSBI v0.9\n* Buildroot 2020.11.2\n\nOur changes to support Nuclei Eval SoC are adapted based on above version.\n\n## Modify Build Configuration\n\nYou can choose different core configuration by modify the `CORE ?= ux900fd` line in `Makefile`.\n\nWe support four configurations for **CORE**, choose the right core according to your configuration:\n\n* `ux600` or `ux900`: rv64imac RISC-V CORE configuration without FPU.\n* `ux600fd` or `ux900fd`: rv64imafdc RISC-V CORE configuration with FPU.\n* `u900` or `u900fd`: rv32imac/rv32imafdc RISC-V CORE configuration.\n\nYou can choose different SoC by modify `SOC ?= evalsoc` line in `Makefile`.\n\n* `demosoc`: **Deprecated**, the demostration SoC from nuclei.\n* `evalsoc`: The next generation of the `demosoc`, we call it `evalsoc`, when your cpu has `iregion` feature, please use this one\n* you can add your SoC support by adding configuration in `conf/$SOC` folder refer to `conf/evalsoc`\n\n\u003e You can check the dts difference for evalsoc and demosoc, for more details, need to check the Nuclei RISC-V CPU ISA spec.\n\n\u003e - Now evalsoc default cpu/peripheral frequency change from 100MHz to 50MHz from 2023.06\n\u003e - Now evalsoc ddr base address changed from 0xA0000000 to 0x80000000 from 2023.06, so previous bitstream will not work\n\nYou can choose different boot mode by modify the `BOOT_MODE ?= sd` line in `Makefile`.\n\n* `sd`: boot from flash + sdcard, extra SDCard is required(kernel, rootfs, dtb placed in it)\n* `flash`: boot from flash only, flash will contain images placed in sdcard of sd boot mode, at least 8M flash is required, current onboard mcu-flash of DDR200T is only 4M, so this feature is not ready for it.\n\nPlease modify the `Makefile` to your correct core configuration before build any source code.\n\nFor each SoC, in `conf/$SOC/`, it contains a `build.mk` you can specify qemu, timer/cpu/peripheral hz.\n\n* **TIMER_HZ**: implementation dependent, you can change timer frequency to different value to overwrite the one in dts.\n* **CPU_HZ**: implementation dependent, you can change cpu frequency to different value to overwrite the one in dts.\n* **PERIPH_HZ**: implementation dependent, you can change peripheral frequency to different value to overwrite the one in dts.\n* **SIMULATION**: implementation dependent, if SIMULATION=1, only the peripherals can be simulated in rtl will be present in dts, for demosoc/evalsoc, only uart will be present, qspi will not.\n\n\u003e `TIMER_HZ/CPU_HZ/PERIPH_HZ` are all implementation dependent, it required your SoC dts implement this feature, currently\n\u003e demosoc/evalsoc all support this.\n\nFor each SoC, in `conf/$SOC`, it also contains a `freeloader.mk`, it is used to configure freeloader feature to set cpu configuration when bring up, such as configure cache, tlb, smp feature, for details, please refer to freeloader source code.\n\n* **Deprecated**: If you want to compile and run using simulator *xl-spike*, please\n  check steps mentioned in [Booting Linux on Nuclei xl-spike](#Booting-Linux-on-Nuclei-xl-spike)\n* If you want to compile and run using FPGA evaluation board, please\n  check steps mentioned in [Booting Linux on Nuclei FPGA Evaluation Board](#Booting-Linux-on-Nuclei-FPGA-Evaluation-Board)\n\n## Booting Linux on Nuclei xl-spike\n\n**Note**: `xl_spike` tool should be installed and added into **PATH** in advance.\nContact with our sales via email **contact@nucleisys.com** to get `xl_spike` tools.\n\n\u003e This feature is **deprecated** now, please use Nuclei Qemu.\n\n### Run on xl_spike\n\nIf you have run `make bootimages` command before, please make sure you run `make presim` to prepare\nbuild environment for running linux in simulation.\n\nWhen toolchain steps are finished, then, you can build buildroot, linux and opensbi,\nand run opensbi with linux payload on xlspike by running `make sim`.\n\nHere is sample output running in xl_spike:\n\n\u003e Log is not up to date, and may not working.\n\n~~~\nxl_spike --isa=rv64imac /home/hqfang/workspace/software/nuclei-linux-sdk/work/demosoc/opensbi/platform/nuclei/demosoc/firmware/fw_payload.elf\nrv64 file\ncall xl_spike_t construct function\nwarning: tohost and fromhost symbols not in ELF; can't communicate with target\nUART: \nUART: OpenSBI v0.9\nUART:    ____                    _____ ____ _____\nUART:   / __ \\                  / ____|  _ \\_   _|\nUART:  | |  | |_ __   ___ _ __ | (___ | |_) || |\nUART:  | |  | | '_ \\ / _ \\ '_ \\ \\___ \\|  _ \u003c | |\nUART:  | |__| | |_) |  __/ | | |____) | |_) || |_\nUART:   \\____/| .__/ \\___|_| |_|_____/|____/_____|\nUART:         | |\nUART:         |_|\nUART: \nUART: Platform Name             : Nuclei Demo SoC\nUART: Platform Features         : timer,mfdeleg\nUART: Platform HART Count       : 1\nUART: Firmware Base             : 0xa0000000\nUART: Firmware Size             : 84 KB\nUART: Runtime SBI Version       : 0.2\nUART: \nUART: Domain0 Name              : root\nUART: Domain0 Boot HART         : 0\nUART: Domain0 HARTs             : 0*\nUART: Domain0 Region00          : 0x00000000a0000000-0x00000000a001ffff ()\nUART: Domain0 Region01          : 0x0000000000000000-0xffffffffffffffff (R,W,X)\nUART: Domain0 Next Address      : 0x00000000a0400000\nUART: Domain0 Next Arg1         : 0x00000000a8000000\nUART: Domain0 Next Mode         : S-mode\nUART: Domain0 SysReset          : yes\nUART: \nUART: Boot HART ID              : 0\nUART: Boot HART Domain          : root\nUART: Boot HART ISA             : rv64imacsu\nUART: Boot HART Features        : scounteren,mcounteren,time\nUART: Boot HART PMP Count       : 16\nUART: Boot HART PMP Granularity : 4\nUART: Boot HART PMP Address Bits: 54\nUART: Boot HART MHPM Count      : 0\nUART: Boot HART MHPM Count      : 0\nUART: Boot HART MIDELEG         : 0x0000000000000222\nUART: Boot HART MEDELEG         : 0x000000000000b109\nUART: [    0.000000] Linux version 5.10.0+ (hqfang@softserver) (riscv-nuclei-linux-gnu-gcc (GCC) 9.2.0, GNU ld (GNU Binutils) 2.32) #1 Fri Mar 19 14:47:22 CST 2021\nUART: [    0.000000] OF: fdt: Ignoring memory range 0xa0000000 - 0xa0400000\nUART: [    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')\nUART: [    0.000000] printk: bootconsole [sbi0] enabled\nUART: [    0.000000] efi: UEFI not found.\nUART: [    0.000000] Zone ranges:\nUART: [    0.000000]   DMA32    [mem 0x00000000a0400000-0x00000000afffffff]\nUART: [    0.000000]   Normal   empty\nUART: [    0.000000] Movable zone start for each node\nUART: [    0.000000] Early memory node ranges\nUART: [    0.000000]   node   0: [mem 0x00000000a0400000-0x00000000afffffff]\nUART: [    0.000000] Initmem setup node 0 [mem 0x00000000a0400000-0x00000000afffffff]\nUART: [    0.000000] software IO TLB: mapped [mem 0x00000000abc8b000-0x00000000afc8b000] (64MB)\nUART: [    0.000000] SBI specification v0.2 detected\nUART: [    0.000000] SBI implementation ID=0x1 Version=0x9\nUART: [    0.000000] SBI v0.2 TIME extension detected\nUART: [    0.000000] SBI v0.2 IPI extension detected\nUART: [    0.000000] SBI v0.2 RFENCE extension detected\nUART: [    0.000000] riscv: ISA extensions acim\nUART: [    0.000000] riscv: ELF capabilities acim\nUART: [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 63630\nUART: [    0.000000] Kernel command line: earlycon=sbi\nUART: [    0.000000] Dentry cache hash table entries: 32768 (order: 6, 262144 bytes, linear)\nUART: [    0.000000] Inode-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)\nUART: [    0.000000] Sorting __ex_table...\nUART: [    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off\nUART: [    0.000000] Memory: 172900K/258048K available (2696K kernel code, 2811K rwdata, 2048K rodata, 128K init, 280K bss, 85148K reserved, 0K cma-reserved)\nUART: [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1\nUART: [    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0\nUART: [    0.000000] riscv-intc: 64 local interrupts mapped\nUART: [    0.000000] plic: interrupt-controller@8000000: mapped 53 interrupts with 1 handlers for 2 contexts.\nUART: [    0.000000] random: get_random_bytes called from 0xffffffe000002910 with crng_init=0\nUART: [    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]\nUART: [    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x179dd7f66, max_idle_ns: 28210892933900 ns\nUART: [    0.001760] sched_clock: 64 bits at 100kHz, resolution 10000ns, wraps every 35184372085000ns\nUART: [    0.022800] printk: console [hvc0] enabled\nUART: [    0.022800] printk: console [hvc0] enabled\nUART: [    0.041290] printk: bootconsole [sbi0] disabled\nUART: [    0.041290] printk: bootconsole [sbi0] disabled\nUART: [    0.065580] Calibrating delay loop (skipped), value calculated using timer frequency.. 0.20 BogoMIPS (lpj=1000)\nUART: [    0.089740] pid_max: default: 32768 minimum: 301\nUART: [    0.132740] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)\nUART: [    0.152020] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)\nUART: [    0.324900] EFI services will not be available.\nUART: [    0.359550] devtmpfs: initialized\nUART: [    0.519290] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns\nUART: [    0.543440] futex hash table entries: 256 (order: 0, 6144 bytes, linear)\nUART: [    0.566050] pinctrl core: initialized pinctrl subsystem\nUART: [    0.620770] NET: Registered protocol family 16\nUART: [    1.452200] clocksource: Switched to clocksource riscv_clocksource\nUART: [    1.624680] NET: Registered protocol family 2\nUART: [    1.795650] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)\nUART: [    1.818280] TCP established hash table entries: 2048 (order: 2, 16384 bytes, linear)\nUART: [    1.849690] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)\nUART: [    1.877280] TCP: Hash tables configured (established 2048 bind 2048)\nUART: [    1.904640] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)\nUART: [    1.925370] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)\nUART: [    1.970120] NET: Registered protocol family 1\nUART: [    2.043020] RPC: Registered named UNIX socket transport module.\nUART: [    2.057540] RPC: Registered udp transport module.\nUART: [    2.069730] RPC: Registered tcp transport module.\nUART: [    2.082040] RPC: Registered tcp NFSv4.1 backchannel transport module.\nUART: [    9.297610] workingset: timestamp_bits=62 max_order=16 bucket_order=0\nUART: [   10.637960] io scheduler mq-deadline registered\nUART: [   10.649850] io scheduler kyber registered\nUART: [   18.585530] brd: module loaded\nUART: [   19.555270] loop: module loaded\nUART: [   19.697090] NET: Registered protocol family 17\nUART: [   19.780090] Freeing unused kernel memory: 128K\nUART: [   19.799080] Run /init as init process\nUART: Starting syslogd: OK\nUART: Starting klogd: OK\nUART: Running sysctl: OK\nUART: Starting mdev... OK\nUART: modprobe: can't change directory to '/lib/modules': No such file or directory\nUART: Saving random seed: [  130.621540] random: dd: uninitialized urandom read (512 bytes read)\nUART: OK\nUART: \nUART: Welcome to Nuclei System Techology\nnucleisys login: root\nroot\nUART: Password: nuclei\n\nUART: # cat /proc/cpuinfo\ncat /proc/cpuinfo\nUART: processor\t: 0\nUART: hart\t\t: 0\nUART: isa\t\t: rv64imac\nUART: mmu\t\t: sv39\nUART: \nUART: # uname -a\nuname -a\nUART: Linux nucleisys 5.10.0+ #1 Fri Mar 19 14:47:22 CST 2021 riscv64 GNU/Linux\nUART: # ls /\nls /\nUART: bin      init     linuxrc  opt      run      tmp\nUART: dev      lib      media    proc     sbin     usr\nUART: etc      lib64    mnt      root     sys      var\nUART: # \n~~~\n\nIf you want to remove the login, and directly enter to bash, please check [**Known issues and FAQ**](#Known-issues-and-FAQs).\n\n## Booting Linux on Nuclei QEMU\n\n\u003e From 2023.06, this branch will no longer work with Nuclei QEMU 2022.12 release, please take a try with Nuclei Qemu 2023.10 release.\n\n**Note**: `qemu-system-riscv64` tool should be installed and added into **PATH** in advance.\n\nWhen the required changes has been done, then you can run `make run_qemu` to run riscv linux on Nuclei QEMU, here are the sample output.\n\n\u003e You can check latest output in github action https://github.com/Nuclei-Software/nuclei-linux-sdk/actions/workflows/build.yml?query=branch%3Adev_nuclei_5.10_v2\n\n\u003e The output may be out of date, take care.\n\n~~~\nRun on qemu for simulation\nqemu-system-riscv64 -M nuclei_evalsoc,download=flashxip -smp 8 -m 2G -cpu nuclei-ux900fd,ext= -bios /Local/hqfang/workspace/software/nuclei-linux-sdk/work/evalsoc/freeloader/freeloader.elf -nographic -drive file=/Local/hqfang/workspace/software/nuclei-linux-sdk/work/evalsoc/disk.img,if=sd,format=raw\n\nOpenSBI v0.9\n   ____                    _____ ____ _____\n  / __ \\                  / ____|  _ \\_   _|\n | |  | |_ __   ___ _ __ | (___ | |_) || |\n | |  | | '_ \\ / _ \\ '_ \\ \\___ \\|  _ \u003c | |\n | |__| | |_) |  __/ | | |____) | |_) || |_\n  \\____/| .__/ \\___|_| |_|_____/|____/_____|\n        | |\n        |_|\n\nPlatform Name             : Nuclei Evaluation SoC\nPlatform Features         : timer,mfdeleg\nPlatform HART Count       : 8\nFirmware Base             : 0x80000000\nFirmware Size             : 156 KB\nRuntime SBI Version       : 0.2\n\nDomain0 Name              : root\nDomain0 Boot HART         : 6\nDomain0 HARTs             : 0*,1*,2*,3*,4*,5*,6*,7*\nDomain0 Region00          : 0x0000000080000000-0x000000008003ffff ()\nDomain0 Region01          : 0x0000000000000000-0xffffffffffffffff (R,W,X)\nDomain0 Next Address      : 0x0000000080200000\nDomain0 Next Arg1         : 0x0000000088000000\nDomain0 Next Mode         : S-mode\nDomain0 SysReset          : yes\n\nBoot HART ID              : 6\nBoot HART Domain          : root\nBoot HART ISA             : rv64imafdcsu\nBoot HART Features        : scounteren,mcounteren,time\nBoot HART PMP Count       : 16\nBoot HART PMP Granularity : 4\nBoot HART PMP Address Bits: 54\nBoot HART MHPM Count      : 0\nBoot HART MHPM Count      : 0\nBoot HART MIDELEG         : 0x0000000000000222\nBoot HART MEDELEG         : 0x000000000000b109\n\n\nU-Boot 2021.01-00021-g7e7c388fc6 (Nov 16 2023 - 16:06:13 +0800)\n\nCPU:   rv64imafdc\nModel: nuclei,evalsoc\nDRAM:  2 GiB\nBoard: Initialized\nMMC:   Nuclei SPI version 0x0\nspi@10034000:mmc@0: 0\nIn:    serial@10013000\nOut:   serial@10013000\nErr:   serial@10013000\nNet:   No ethernet found.\nHit any key to stop autoboot:  0\nswitch to partitions #0, OK\nmmc0 is current device\nScanning mmc 0:1...\nFound U-Boot script /boot.scr\n725 bytes read in 22 ms (31.3 KiB/s)\n## Executing script at 80200000\nBoot images located in .\nLoading kernel: ./uImage.lz4\n4035022 bytes read in 9962 ms (395.5 KiB/s)\nLoading ramdisk: ./uInitrd.lz4\n6260962 bytes read in 15372 ms (397.5 KiB/s)\nLoading dtb: ./kernel.dtb\n4677 bytes read in 36 ms (126 KiB/s)\nStarts booting from SD\n## Booting kernel from Legacy Image at 83000000 ...\n   Image Name:   Linux\n   Image Type:   RISC-V Linux Kernel Image (lz4 compressed)\n   Data Size:    4034958 Bytes = 3.8 MiB\n   Load Address: 80400000\n   Entry Point:  80400000\n   Verifying Checksum ... OK\n## Loading init Ramdisk from Legacy Image at 88300000 ...\n   Image Name:   Initrd\n   Image Type:   RISC-V Linux RAMDisk Image (lz4 compressed)\n   Data Size:    6260898 Bytes = 6 MiB\n   Load Address: 00000000\n   Entry Point:  00000000\n   Verifying Checksum ... OK\n## Flattened Device Tree blob at 88000000\n   Booting using the fdt blob at 0x88000000\n   Uncompressing Kernel Image\n   Using Device Tree in place at 0000000088000000, end 0000000088004244\n\nStarting kernel ...\n\n[    0.000000] Linux version 5.10.196+ (hqfang@whss5.corp.nucleisys.com) (riscv-nuclei-linux-gnu-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP Thu Nov 16 15:59:29 CST 2023\n[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80400000\n[    0.000000] Machine model: nuclei,evalsoc\n[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')\n[    0.000000] printk: bootconsole [sbi0] enabled\n[    0.000000] efi: UEFI not found.\n[    0.000000] Initial ramdisk at: 0x(____ptrval____) (6262784 bytes)\n[    0.000000] Zone ranges:\n[    0.000000]   DMA32    [mem 0x0000000080400000-0x00000000fdffffff]\n[    0.000000]   Normal   empty\n[    0.000000] Movable zone start for each node\n[    0.000000] Early memory node ranges\n[    0.000000]   node   0: [mem 0x0000000080400000-0x00000000fdffffff]\n[    0.000000] Initmem setup node 0 [mem 0x0000000080400000-0x00000000fdffffff]\n[    0.000000] software IO TLB: mapped [mem 0x00000000f8475000-0x00000000fc475000] (64MB)\n[    0.000000] SBI specification v0.2 detected\n[    0.000000] SBI implementation ID=0x1 Version=0x9\n[    0.000000] SBI v0.2 TIME extension detected\n[    0.000000] SBI v0.2 IPI extension detected\n[    0.000000] SBI v0.2 RFENCE extension detected\n[    0.000000] SBI v0.2 HSM extension detected\n[    0.000000] riscv: ISA extensions acdfim\n[    0.000000] riscv: ELF capabilities acdfim\n[    0.000000] percpu: Embedded 16 pages/cpu s25432 r8192 d31912 u65536\n[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 508030\n[    0.000000] Kernel command line: earlycon=sbi console=ttyNUC0\n[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)\n[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)\n[    0.000000] Sorting __ex_table...\n[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off\n[    0.000000] Memory: 1943116K/2060288K available (4737K kernel code, 4114K rwdata, 2048K rodata, 192K init, 333K bss, 117172K reserved, 0K cma-reserved)\n[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1\n[    0.000000] rcu: Hierarchical RCU implementation.\n[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.\n[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0\n[    0.000000] riscv-intc: 64 local interrupts mapped\n[    0.000000] plic: interrupt-controller@1c000000: mapped 53 interrupts with 8 handlers for 16 contexts.\n[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [6]\n[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1ef4687b1, max_idle_ns: 112843571739654 ns\n[    0.000152] sched_clock: 64 bits at 32kHz, resolution 30517ns, wraps every 70368744171142ns\n[    0.005554] Calibrating delay loop (skipped), value calculated using timer frequency.. 0.06 BogoMIPS (lpj=327)\n[    0.006164] pid_max: default: 32768 minimum: 301\n[    0.007659] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)\n[    0.008056] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)\n[    0.035339] rcu: Hierarchical SRCU implementation.\n[    0.037139] EFI services will not be available.\n[    0.038848] smp: Bringing up secondary CPUs ...\n[    0.054565] smp: Brought up 1 node, 8 CPUs\n[    0.068145] devtmpfs: initialized\n[    0.077972] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns\n[    0.079010] futex hash table entries: 2048 (order: 5, 131072 bytes, linear)\n[    0.080230] pinctrl core: initialized pinctrl subsystem\n[    0.082885] NET: Registered protocol family 16\n[    0.135375] clocksource: Switched to clocksource riscv_clocksource\n[    0.145080] NET: Registered protocol family 2\n[    0.148315] IP idents hash table entries: 32768 (order: 6, 262144 bytes, linear)\n[    0.159118] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear)\n[    0.159729] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)\n[    0.160308] TCP bind hash table entries: 16384 (order: 6, 262144 bytes, linear)\n[    0.160827] TCP: Hash tables configured (established 16384 bind 16384)\n[    0.162322] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)\n[    0.162841] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)\n[    0.165191] NET: Registered protocol family 1\n[    0.170776] RPC: Registered named UNIX socket transport module.\n[    0.171112] RPC: Registered udp transport module.\n[    0.171325] RPC: Registered tcp transport module.\n[    0.171569] RPC: Registered tcp NFSv4.1 backchannel transport module.\n[    0.175933] Trying to unpack rootfs image as initramfs...\n[    0.458953] Freeing initrd memory: 6108K\n[    0.464111] workingset: timestamp_bits=62 max_order=19 bucket_order=0\n[    0.481048] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.\n[    0.483306] JFS: nTxBlock = 8192, nTxLock = 65536\n[    0.492706] jitterentropy: Initialization failed with host not compliant with requirements: 2\n[    0.493286] NET: Registered protocol family 38\n[    0.493896] io scheduler mq-deadline registered\n[    0.494293] io scheduler kyber registered\n[    0.617645] 10013000.serial: ttyNUC0 at MMIO 0x10013000 (irq = 1, base_baud = 3125000) is a Nuclei UART/USART\n[    0.621459] printk: console [ttyNUC0] enabled\n[    0.621459] printk: console [ttyNUC0] enabled\n[    0.623016] printk: bootconsole [sbi0] disabled\n[    0.623016] printk: bootconsole [sbi0] disabled\n[    0.660919] brd: module loaded\n[    0.670166] loop: module loaded\n[    0.672973] nuclei_spi 10014000.spi: mapped; irq=2, cs=1\n[    0.688415] spi-nor spi0.0: is25wp256 (32768 Kbytes)\n[    0.794097] ftl_cs: FTL header not found.\n[    0.800598] nuclei_spi 10034000.spi: mapped; irq=3, cs=1\n[    0.848205] mmc_spi spi1.0: SD/MMC host mmc0, no DMA, no WP, no poweroff, cd polling\n[    0.851928] ipip: IPv4 and MPLS over IPv4 tunneling driver\n[    0.857940] NET: Registered protocol family 10\n[    0.871582] Segment Routing with IPv6\n[    0.872680] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver\n[    0.880401] NET: Registered protocol family 17\n[    0.918304] Freeing unused kernel memory: 192K\n[    0.924316] mmc0: host does not support reading read-only switch, assuming write-enable\n[    0.925354] mmc0: new SD card on SPI\n[    0.928375] mmcblk0: mmc0:0000 QEMU! 1.00 GiB\n[    0.958953] Run /init as init process\n[    0.961059]  mmcblk0: p1\nStarting syslogd: OK\nStarting klogd: OK\nRunning sysctl: OK\nStarting mdev... OK\nmodprobe: can't change directory to '/lib/modules': No such file or directory\nSaving random seed: [    4.833526] random: dd: uninitialized urandom read (32 bytes read)\nOK\n\nWelcome to Nuclei System Technology\nnucleisys login: root\nPassword:\n# cat /proc/cpuinfo\nprocessor       : 0\nhart            : 6\nisa             : rv64imafdc\nmmu             : sv39\n\nprocessor       : 1\nhart            : 0\nisa             : rv64imafdc\nmmu             : sv39\n\nprocessor       : 2\nhart            : 1\nisa             : rv64imafdc\nmmu             : sv39\n\nprocessor       : 3\nhart            : 2\nisa             : rv64imafdc\nmmu             : sv39\n\nprocessor       : 4\nhart            : 3\nisa             : rv64imafdc\nmmu             : sv39\n\nprocessor       : 5\nhart            : 4\nisa             : rv64imafdc\nmmu             : sv39\n\nprocessor       : 6\nhart            : 5\nisa             : rv64imafdc\nmmu             : sv39\n\nprocessor       : 7\nhart            : 7\nisa             : rv64imafdc\nmmu             : sv39\n\n# uname -a\nLinux nucleisys 5.10.196+ #1 SMP Thu Nov 16 15:59:29 CST 2023 riscv64 GNU/Linux\n# mount /dev/mmcblk0p1 /mnt/\n# ls /mnt/\nboot.scr     kernel.dtb   uImage.lz4   uInitrd.lz4\n# free -m\n              total        used        free      shared  buff/cache   available\nMem:           1904          27        1856          14          21        1850\nSwap:             0           0           0\n~~~\n\n## Booting Linux on Nuclei FPGA Evaluation Board\n\n### Get Nuclei Eval SoC FPGA Bitstream from Nuclei\n\n\u003e Demo SoC is deprecated, please use Eval SoC bitstream from Nuclei.\n\nContact with our sales via email **contact@nucleisys.com** to get FPGA bitstream for Nuclei\nEval SoC and get guidance about how to program FPGA bitstream in the board.\n\nNuclei Eval SoC can be configured using Nuclei RISC-V Linux Capable Core such as UX600 and U900/UX900,\nTo learn about Nuclei RISC-V Linux Capable Core, please check:\n\n* [UX600 Series 64-Bit High Performance Application Processor](https://nucleisys.com/product/600.php)\n* [900 Series 32/64-Bit High Performance Processor](https://nucleisys.com/product/900.php)\n\nNuclei FPGA Evaluation Board, DDR200T/KU060/VCU118 are correct hardwares to\nrun linux on it, click [Nuclei FPGA Evaluation Board](https://nucleisys.com/developboard.php#ddr200t) to learn about more.\n\n### Apply changes for your SoC\n\nBefore compiling this source code, please make sure you have done the following changes.\n\nNow we have two version of SoC for customer to evaluate our RISC-V CPU IP, if the bitstream you get from us\nhas the `iregion` feature, you should use `evalsoc`, otherwise choose `demosoc`(deprecated).\n\nIf there is double float fpu and isa is rv64 in the bitstream supported, you should choose `ux600fd` or `ux900fd`.\n\n- Default cpu/periph freq and timer freq are 16MHz and 32768Hz for demosoc.\n- Default cpu/periph freq and timer freq are 50Mhz and 32768Hz for evalsoc.\n\nIf the bitstream you get not matching above settings, please change co-reponsibing `conf/\u003cSOC\u003e/build.mk`'s `TIMER_HZ`/`CPU_HZ`/`PERIPH_HZ`.\n\nIf you don't change this `build.mk` you can also change the dts files `conf/\u003cSOC\u003e/*.dts` to match the correct frequency.\n\nFor example, you have get a bitstream which is our ux900 series cpu ip, with double float fpu, and cpu frequency is 100MHz.\n\nYou should change `SOC` to `evalsoc`, `CORE` to `ux900fd` in [Makefile](Makefile).\n\nAnd change `CPU_HZ` in `conf/\u003cSOC\u003e/build.mk` or **CPUCLK_FREQ** in the `nuclei_rv64imafdc.dts` and `nuclei_rv64imac.dts`\nin `conf/$SOC/`(`conf/evalsoc` for this case).\n\n### Build Freeloader\n\n\u003e Make sure you have network access to outside world, buildroot will download required packages in build steps.\n\n*freeloader* is a first stage bootloader which contains *opensbi*, *uboot* and *dtb* binaries,\nwhen bootup, it will enable I/D cache and load *opensbi*, *uboot* and *dtb* from onboard\nnorflash to DDR, and then goto entry of *opensbi*.\n\nTo build *freeloader*, you just need to run `make freeloader`\n\n### Upload Freeloader to FPGA Evaluation Board\n\nIf you have connected your board to your Linux development environment, and setuped JTAG drivers,\nthen you can run `make upload_freeloader` to upload the *work/$SOC/freeloader/freeloader.elf* to your board.\n\nYou can also use `riscv-nuclei-elf-gdb` and `openocd` to download this program by yourself, for\nsimple steps, please see [Known issues and FAQs](#Known-issues-and-FAQs).\n\n### Build SDCard Boot Images\n\nIf **BOOT_MODE** is set to `flash`, then no need to prepare the boot images, just program the\n**freeloader.elf** to on board flash, but it required at least 8M flash.\n\nIf you have run `make sim` command before, please make sure you run `make preboot` to prepare\nbuild environment for generate boot images.\n\nIf the freeloader is flashed to the board, then you can prepare the SDCard boot materials,\nyou can run `make bootimages` to generate the boot images to *work/$SOC/boot*, and an zip file\ncalled *work/$SOC/boot.zip* , you can extract this *boot.zip* to your SDCard or copy all the files\nlocated in *work/$SOC/boot*, make sure the files need to be put **right in the root of SDCard**,\nthen you can insert this SDCard to your SDCard slot(J57) beside the TFT LCD.\n\nThe contents of *work/$SOC/boot* or *work/$SOC/boot.zip* are as below:\n\n* **kernel.dtb**  : optional, device tree binary file, this dtb is optional now, since freeloader.elf already contains dtb, we can use dtb inside freeloader.elf, and if you want to use a different device tree for linux kernel, you can change this dtb, and place it in sdcard, otherwise this dtb is not a required file for sdcard.\n* **boot.scr**    : required, boot script used by uboot, generated from [./conf/evalsoc/uboot.cmd](conf/evalsoc/uboot.cmd)\n* **uImage.lz4**  : required, lz4 archived kernel image\n* **uInitrd.lz4** : required, lz4 archived rootfs image\n\n\u003e SDCard is recommended to use SDHC format.\n\u003e SDCard need to be formatted to `FAT32` format, with only 1 partition.\n\n### Run Linux\n\nWhen all above is done, you can reset the power on board, then opensbi will boot uboot, and\nuboot will automatically load linux image and initramfs from SDCard and boot linux if everything\nis prepared correctly.\n\nIf you met with issues, please check the [**Known issues and FAQ**](#Known-issues-and-FAQs).\n\nThe linux login user name and password is *root* and *nuclei*.\n\nSample output in **UART @ 115200bps, Data 8bit, Parity None, Stop Bits 1bit, No Flow Control**.\n\n\u003e **Flow control must be disabled in UART terminal**.\n\n\u003e UART baudrate changed from 57600bps to 115200bps, due to evaluation SoC frequency by default\n\u003e changed from 8MHz to 16MHz or 50MHz, and now uart can work correctly on 115200bps.\n\n\u003e The output may be out of date, take care.\n\n~~~\nOpenSBI v0.9\n   ____                    _____ ____ _____\n  / __ \\                  / ____|  _ \\_   _|\n | |  | |_ __   ___ _ __ | (___ | |_) || |\n | |  | | '_ \\ / _ \\ '_ \\ \\___ \\|  _ \u003c | |\n | |__| | |_) |  __/ | | |____) | |_) || |_\n  \\____/| .__/ \\___|_| |_|_____/|____/_____|\n        | |\n        |_|\n\nPlatform Name             : Nuclei Evaluation SoC\nPlatform Features         : timer,mfdeleg\nPlatform HART Count       : 8\nFirmware Base             : 0x80000000\nFirmware Size             : 156 KB\nRuntime SBI Version       : 0.2\n\nDomain0 Name              : root\nDomain0 Boot HART         : 0\nDomain0 HARTs             : 0*,1*,2*,3*,4*,5*,6*,7*\nDomain0 Region00          : 0x0000000080000000-0x000000008003ffff ()\nDomain0 Region01          : 0x0000000000000000-0xffffffffffffffff (R,W,X)\nDomain0 Next Address      : 0x0000000080200000\nDomain0 Next Arg1         : 0x0000000088000000\nDomain0 Next Mode         : S-mode\nDomain0 SysReset          : yes\n\nBoot HART ID              : 0\nBoot HART Domain          : root\nBoot HART ISA             : rv64imafdcbsu\nBoot HART Features        : scounteren,mcounteren,time\nBoot HART PMP Count       : 16\nBoot HART PMP Granularity : 4096\nBoot HART PMP Address Bits: 30\nBoot HART MHPM Count      : 0\nBoot HART MHPM Count      : 0\nBoot HART MIDELEG         : 0x0000000000000222\nBoot HART MEDELEG         : 0x000000000000b109\n\n\nU-Boot 2021.01-00021-g7e7c388fc6 (Jun 09 2023 - 17:01:18 +0800)\n\nCPU:   rv64imafdc\nModel: nuclei,evalsoc\nDRAM:  2 GiB\nBoard: Initialized\nMMC:   Nuclei SPI version 0xee010102\nspi@10034000:mmc@0: 0\nIn:    serial@10013000\nOut:   serial@10013000\nErr:   serial@10013000\nNet:   No ethernet found.\nHit any key to stop autoboot:  0\nswitch to partitions #0, OK\nmmc0 is current device\nScanning mmc 0:1...\nFound U-Boot script /boot.scr\n725 bytes read in 334 ms (2 KiB/s)\n## Executing script at 80200000\nBoot images located in .\nLoading kernel: ./uImage.lz4\n4030405 bytes read in 19703 ms (199.2 KiB/s)\nLoading ramdisk: ./uInitrd.lz4\n6261647 bytes read in 30264 ms (201.2 KiB/s)\n./kernel.dtb not found, ignore it\nStarts booting from SD\n## Booting kernel from Legacy Image at 83000000 ...\n   Image Name:   Linux\n   Image Type:   RISC-V Linux Kernel Image (lz4 compressed)\n   Data Size:    4034958 Bytes = 3.8 MiB\n   Load Address: 80400000\n   Entry Point:  80400000\n   Verifying Checksum ... OK\n## Loading init Ramdisk from Legacy Image at 88300000 ...\n   Image Name:   Initrd\n   Image Type:   RISC-V Linux RAMDisk Image (lz4 compressed)\n   Data Size:    6260898 Bytes = 6 MiB\n   Load Address: 00000000\n   Entry Point:  00000000\n   Verifying Checksum ... OK\n## Flattened Device Tree blob at 88000000\n   Booting using the fdt blob at 0x88000000\n   Uncompressing Kernel Image\n   Using Device Tree in place at 0000000088000000, end 0000000088004244\n\nStarting kernel ...\n\n[    0.000000] Linux version 5.10.181+ (xl_ci@whml1.corp.nucleisys.com) (riscv-nuclei-linux-gnu-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP Fri Jun 9 17:03:39 CST 2023\n[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80400000\n[    0.000000] Machine model: nuclei,evalsoc\n[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')\n[    0.000000] printk: bootconsole [sbi0] enabled\n[    0.000000] efi: UEFI not found.\n[    0.000000] Initial ramdisk at: 0x(____ptrval____) (6262784 bytes)\n[    0.000000] Zone ranges:\n[    0.000000]   DMA32    [mem 0x0000000080400000-0x00000000fdffffff]\n[    0.000000]   Normal   empty\n[    0.000000] Movable zone start for each node\n[    0.000000] Early memory node ranges\n[    0.000000]   node   0: [mem 0x0000000080400000-0x00000000fdffffff]\n[    0.000000] Initmem setup node 0 [mem 0x0000000080400000-0x00000000fdffffff]\n[    0.000000] software IO TLB: mapped [mem 0x00000000f8475000-0x00000000fc475000] (64MB)\n[    0.000000] SBI specification v0.2 detected\n[    0.000000] SBI implementation ID=0x1 Version=0x9\n[    0.000000] SBI v0.2 TIME extension detected\n[    0.000000] SBI v0.2 IPI extension detected\n[    0.000000] SBI v0.2 RFENCE extension detected\n[    0.000000] SBI v0.2 HSM extension detected\n[    0.000000] riscv: ISA extensions acdfim\n[    0.000000] riscv: ELF capabilities acdfim\n[    0.000000] percpu: Embedded 16 pages/cpu s25432 r8192 d31912 u65536\n[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 508030\n[    0.000000] Kernel command line: earlycon=sbi console=ttyNUC0\n[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)\n[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)\n[    0.000000] Sorting __ex_table...\n[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off\n[    0.000000] Memory: 1943116K/2060288K available (4731K kernel code, 4122K rwdata, 2048K rodata, 192K init, 333K bss, 117172K reserved, 0K cma-reserved)\n[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1\n[    0.000000] rcu: Hierarchical RCU implementation.\n[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.\n[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0\n[    0.000000] riscv-intc: 64 local interrupts mapped\n[    0.000000] plic: interrupt-controller@1c000000: mapped 53 interrupts with 8 handlers for 16 contexts.\n[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]\n[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1ef4687b1, max_idle_ns: 112843571739654 ns\n[    0.000091] sched_clock: 64 bits at 32kHz, resolution 30517ns, wraps every 70368744171142ns\n[    0.010131] Calibrating delay loop (skipped), value calculated using timer frequency.. 0.06 BogoMIPS (lpj=327)\n[    0.019897] pid_max: default: 32768 minimum: 301\n[    0.027313] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)\n[    0.035186] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)\n[    0.068054] rcu: Hierarchical SRCU implementation.\n[    0.075897] EFI services will not be available.\n[    0.089385] smp: Bringing up secondary CPUs ...\n[    0.187866] smp: Brought up 1 node, 8 CPUs\n[    0.202362] devtmpfs: initialized\n[    0.227691] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns\n[    0.237274] futex hash table entries: 2048 (order: 5, 131072 bytes, linear)\n[    0.248870] pinctrl core: initialized pinctrl subsystem\n[    0.264373] NET: Registered protocol family 16\n[    0.407867] clocksource: Switched to clocksource riscv_clocksource\n[    0.429260] NET: Registered protocol family 2\n[    0.441894] IP idents hash table entries: 32768 (order: 6, 262144 bytes, linear)\n[    0.493499] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear)\n[    0.502899] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)\n[    0.515624] TCP bind hash table entries: 16384 (order: 6, 262144 bytes, linear)\n[    0.532165] TCP: Hash tables configured (established 16384 bind 16384)\n[    0.542694] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)\n[    0.550628] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)\n[    0.561370] NET: Registered protocol family 1\n[    0.574340] RPC: Registered named UNIX socket transport module.\n[    0.579925] RPC: Registered udp transport module.\n[    0.584472] RPC: Registered tcp transport module.\n[    0.589416] RPC: Registered tcp NFSv4.1 backchannel transport module.\n[    0.598327] Trying to unpack rootfs image as initramfs...\n[    4.828521] Freeing initrd memory: 6108K\n[    4.844085] workingset: timestamp_bits=62 max_order=19 bucket_order=0\n[    4.932403] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.\n[    4.944885] JFS: nTxBlock = 8192, nTxLock = 65536\n[    6.455963] NET: Registered protocol family 38\n[    6.460235] io scheduler mq-deadline registered\n[    6.464508] io scheduler kyber registered\n[    7.040069] 10013000.serial: ttyNUC0 at MMIO 0x10013000 (irq = 1, base_baud = 3125000) is a Nuclei UART/USART\n[    7.049835] printk: console [ttyNUC0] enabled\n[    7.049835] printk: console [ttyNUC0] enabled\n[    7.058288] printk: bootconsole [sbi0] disabled\n[    7.058288] printk: bootconsole [sbi0] disabled\n[    7.178802] brd: module loaded\n[    7.289184] loop: module loaded\n[    7.295959] nuclei_spi 10014000.spi: mapped; irq=2, cs=4\n[    7.308898] spi-nor spi0.0: w25q128 (16384 Kbytes)\n[    8.300964] ftl_cs: FTL header not found.\n[    8.315277] nuclei_spi 10034000.spi: mapped; irq=4, cs=4\n[    8.368408] mmc_spi spi1.0: SD/MMC host mmc0, no DMA, no WP, no poweroff, cd polling\n[    8.380371] ipip: IPv4 and MPLS over IPv4 tunneling driver\n[    8.398406] NET: Registered protocol family 10\n[    8.417083] Segment Routing with IPv6\n[    8.421417] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver\n[    8.434722] NET: Registered protocol family 17\n[    8.457489] Freeing unused kernel memory: 192K\n[    8.490570] Run /init as init process\n[    8.549285] mmc0: host does not support reading read-only switch, assuming write-enable\n[    8.556854] mmc0: new SDHC card on SPI\n[    8.575378] mmcblk0: mmc0:0000 NCard 29.1 GiB\n[    8.628082]  mmcblk0: p1\nStarting syslogd: OK\nStarting klogd: OK\nRunning sysctl: OK\nStarting mdev... OK\nmodprobe: can't change directory to '/lib/modules': No such file or directory\nSaving random seed: [   15.487396] random: dd: uninitialized urandom read (32 bytes read)\nOK\n\nWelcome to Nuclei System Technology\nnucleisys login:\n~~~\n\n## Application Development\n\n### Quick help\n\nYou can run `make help` to show quick help message about how to use this linux sdk.\n\nFor detailed usage about components like buildroot, linux kernel, opensbi or uboot, please\n\ncheck [Reference](#Reference).\n\n### Customize buildroot packages\n\nYou can customize buildroot packages to add or remove package in buildroot using command:\n\n~~~shell\nmake buildroot_initramfs-menuconfig\n~~~\n\nThe new configuration for evalsoc will be saved to `conf/evalsoc` folder, for when a full rebuild of buildroot\nis necessary, please check [this link](https://buildroot.org/downloads/manual/manual.html#full-rebuild).\n\n* *conf/evalsoc/buildroot_initramfs_rv64imac_config*: The buildroot configuration for RISC-V ISA/ARCH is **rv64imac**, such as ux600 and ux900\n* *conf/evalsoc/buildroot_initramfs_rv64imafdc_config*: The buildroot configuration for for RISC-V ISA/ARCH is **rv64imafdc**, such as ux600fd and ux900fd\n* *conf/evalsoc/buildroot_initramfs_rv32imac_config*: The buildroot configuration for RISC-V ISA/ARCH is **rv32imac**, such as u900\n* *conf/evalsoc/buildroot_initramfs_rv32imafdc_config*: The buildroot configuration for for RISC-V ISA/ARCH is **rv32imafdc**, such as u900fd\n\nBy default, we add many packages in buildroot default configuration, you can remove the packages\nyou dont need in configuration to generate smaller rootfs, a full rebuild of SDK is required for\nremoving buildroot package.\n\n### Customize kernel configuration\n\nYou can customize linux kernel configuration using command `make linux-menuconfig`, the new configuration will be saved to `conf` folder\n\n* *conf/evalsoc/linux_rv64imac_defconfig*: The linux kernel configuration for RISC-V rv64imac ARCH.\n* *conf/evalsoc/linux_rv64imafdc_defconfig*: The linux kernel configuration for  RISC-V rv64imafdc ARCH.\n* *conf/evalsoc/linux_rv32imac_defconfig*: The linux kernel configuration for RISC-V rv32imac ARCH.\n* *conf/evalsoc/linux_rv32imafdc_defconfig*: The linux kernel configuration for  RISC-V rv32imafdc ARCH.\n* *conf/evalsoc/nuclei_rv64imac.dts*: Device tree for RISC-V rv64imac ARCH used in hardware\n* *conf/evalsoc/nuclei_rv64imafdc.dts*: Device tree for RISC-V rv64imafdc ARCH used in hardware\n* *conf/evalsoc/nuclei_rv32imac.dts*: Device tree for RISC-V rv32imac ARCH used in hardware\n* *conf/evalsoc/nuclei_rv32imafdc.dts*: Device tree for RISC-V rv32imafdc ARCH used in hardware\n\n\u003e `xlspike` dts are only used internally\n* *conf/evalsoc/nuclei_rv64imac_sim.dts*: Device tree for RISC-V rv64imac ARCH used in xlspike simulation\n* *conf/evalsoc/nuclei_rv64imafdc_sim.dts*: Device tree for RISC-V rv64imafdc ARCH used in xlspike simulation\n\n### Customize uboot configuration\n\nYou can customize linux kernel configuration using command `make uboot-menuconfig`, the new configuration will be saved to `conf` folder\n\n* *conf/evalsoc/uboot_rv64imac_flash_config*: uboot configuration for RISC-V rv64imac ARCH, flash boot mode\n* *conf/evalsoc/uboot_rv64imafdc_flash_config*: uboot configuration for RISC-V rv64imafdc ARCH, flash boot mode\n* *conf/evalsoc/uboot_rv64imac_sd_config*: uboot configuration for RISC-V rv64imac ARCH, flash boot mode\n* *conf/evalsoc/uboot_rv64imafdc_sd_config*: uboot configuration for RISC-V rv64imafdc ARCH, sd boot mode\n* *conf/evalsoc/uboot_rv32imac_flash_config*: uboot configuration for RISC-V rv32imac ARCH, flash boot mode\n* *conf/evalsoc/uboot_rv32imafdc_flash_config*: uboot configuration for RISC-V rv32imafdc ARCH, flash boot mode\n* *conf/evalsoc/uboot_rv32imac_sd_config*: uboot configuration for RISC-V rv32imac ARCH, flash boot mode\n* *conf/evalsoc/uboot_rv32imafdc_sd_config*: uboot configuration for RISC-V rv32imafdc ARCH, sd boot mode\n\n### Remove generated boot images\n\nYou can remove generated boot images using command `make cleanboot`.\n\n### Prebuilt applications with RootFS\n\nIf you want to do application development in Linux with FPGA Evaluation board, please\nfollow these steps.\n\nCurrently, SDCard is not working in Linux, so if you want to put your own application, and run it in\nlinux, you have to add your application into rootfs and rebuild it, and use the newly generated boot\nimages, and put it into SDCard.\n\nFor example, I would like to compile new `dhrystone` application and run it in linux.\n\n0. Make sure you have built boot images, using `make bootimages`\n\n1. Copy the old `dhrystone` source code from `work/$SOC/buildroot_initramfs/build/dhrystone-2` to\n   `work/$SOC/buildroot_initramfs/build/dhrystone-3`\n\n2. cd to `work/$SOC/buildroot_initramfs/build/dhrystone-3`, and modify `Makefile` as below:\n\n   ~~~makefile\n   # Make sure you use the compiler in this path below\n   CC = ../../host/bin/riscv-nuclei-linux-gnu-gcc\n   CPPFLAGS += -DNO_PROTOTYPES=1 -DHZ=100\n   # Customized optimization options\n   CFLAGS +=  -O2 -flto -funroll-all-loops -finline-limit=600 \\\n            -ftree-dominator-opts -fno-if-conversion2 -fselective-scheduling \\\n            -fno-code-hoisting -fno-common -funroll-loops -finline-functions \\\n            -falign-functions=4 -falign-jumps=4 -falign-loops=4\n   LDLIBS += -lm\n\n   all: dhrystone\n\n   dhrystone: dhry_1.o dhry_2.o\n      $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)\n\n   clean:\n      rm -f *.o dhrystone\n\n   .PHONY: all clean\n   ~~~\n\n3. Run `make clean all` to rebuild this `dhrystone`\n\n4. Copy generated `dhrystone` to previous generated buildroot_initramfs_sysroot folder, using\n   command `cp dhrystone ../../../buildroot_initramfs_sysroot/usr/bin/dhrystone_opt`\n\n5. cd to Nuclei linux SDK root, and run `make preboot` to clean previously generated boot images.\n\n6. Generate new boot images with `dhrystone_opt` application added using command `make bootimages`\n\n7. Download the generated `work/$SOC/boot.zip` and extract it right under the SDCard root.\n\n8. If you have already flashed `freeloader` using openocd, then just insert the SDCard, and reboot the\n   board, when board is power on, and linux kernel is up, you can run the application `dhrystone_opt` in\n   linux shell.\n\n\n### Put prebuilt applications into SDCard\n\nIn the lastest commits since 079414d, sdcard can be initialized successfully during kernel boot.\n\nSample console output of kernel init message for sdcard ready.\n\n~~~\n[  124.646575] mmcblk0: mmc0:0000 SA08G 7.21 GiB\n[  125.242645]  mmcblk0: p1\n~~~\n\n\u003e **Note**: Currently the sdcard driver is using polling mode as temporary workaround.\n\nWhen you have login the linux system, you can run command below to check\nwhether sdcard is initialized successfully.\n\n~~~sh\n# ls -l /dev/mmc*\nbrw-rw----    1 root     root      179,   0 Jan  1 00:04 /dev/mmcblk0\nbrw-rw----    1 root     root      179,   1 Jan  1 00:04 /dev/mmcblk0p1\n~~~\n\nIf there are **/dev/mmcblk0p1** devices, then you can mount sdcard in *mnt*\ndirectory using command:\n\n~~~sh\n# Mount /dev/mmcblk0p1 into /mnt\nmount -t vfat /dev/mmcblk0p1 /mnt\n# Check whether sdcard is mounted successfully\nls -l /mnt\n~~~\n\nIf you want to put your prebuilt applications into SDCard, you need to unmount\nthe sdcard first using `umount /mnt`, and then eject the sdcard from the tf slot, and then insert the sdcard to sdcard reader and connect to your PC, and copy your prebuilt applications into SDCard.\n\nWhen your applications are placed into the sdcard correctly, then you can insert your card into tf slot, and mount it into `/mnt` directory.\n\nFor example, if you have an application called `coremark`, then you can directly run it using `/mnt/coremark`.\n\n## Port to your target\n\n\u003e demosoc is deprecated, please take evalsoc as example.\n\nFor our current development evalsoc, we used the following resources:\n\n* RV64IMAC or RV64IMAFDC Core, with 16 PMP entries\n* DDR RAM: *0x80000000 - 0x100000000*, 2GB, DDR RAM is seperated to place opensbi, uboot, kernel, rootfs, dtb binaries.\n* I/D Cache enabled\n* UART @ 0x10013000\n* PLIC @ 0x1C000000\n* QSPI @ 0x10034000, which connect to SDCard, SDCard will be used when boot from SDCard\n* QSPI @ 0x10014000, which connect to XIP SPIFlash 4M, memory mapped started at 0x20000000.\n\n  SPIFlash is used to place freeloader, which contains opensbi, uboot, dtb, and optional kernel and rootfs\n  when flash-only boot is performed. **Flash-only boot** will required at least 8M flash.\n\nTo basically port this SDK to match your target, you can make a copy of `conf/evalsoc` such as `conf/nsoc`:\n\n* *freeloader.mk*: change the variable defined in this mk to match your design\n  * **DDR_BASE**, **FLASH_BASE** and **FLASH_SIZE** are used to set DDR base address and Flash base address and size used by freeloader.\n  * If you want to use SMP linux, you need to set **ENABLE_SMP** and **ENABLE_L2** to 1\n  * If you only have 1 core, please make sure **ENABLE_SMP** and **ENABLE_L2** is 0\n  * If you will not using amp mode, please set **AMP_START_CORE** to max hart id,\n    for example, if you have four core, change it to 4.\n  * **CACHE_CTRL** and **TLB_CTRL** is used to control L1/L2 cache control CSR `mcache_ctl` and TLB CTRL csr `mtlb_ctl`\n  * **SPFL1DCTRL1**, **SPFL1DCTRL2** and **MERGL1DCTRL** are used to control L1 DCache Prefetch and Write Streaming or Merge Control registers `spfl1dctrl1`, `spfl1dctrl2` and `mergel1dctrl`\n\n* *build.mk*:\n  * Change **UIMAGE_AE_CMD** to match your DDR base, used by Makefile to generate rootfs for uboot.\n  * If you have qemu support, you can change your qemu machine options **QEMU_MACHINE_OPTS** to match your qemu machine.\n  * If you are using AMP, **CORE1_APP_BIN**, **CORE2_APP_BIN**, **CORE3_APP_BIN**, **CORE4_APP_BIN**,\n    **CORE5_APP_BIN**, **CORE6_APP_BIN** and **CORE7_APP_BIN** need to be configured, CORE1-CORE7 each memory is default 4MB(configured by **AMPFW_SIZE**)\n    and application base address is default offset 0x7E000000(configured by **AMPFW_START_OFFSET**) at DDR base, you can refer to https://github.com/Nuclei-Software/nuclei-linux-sdk/issues/18 for how to use AMP demo.\n    \u003e Here each core memory is changed from 8M to 4M, due to only 32MB is reserved for amp binaries, and now we support 8 cores.\n    - **CORE1_APP_BIN** start offset is **DDR_BASE** + **0x7E000000**, such as `$(confdir)/amp/c1.bin`\n    - **CORE2_APP_BIN** start offset is **DDR_BASE** + **0x7E000000** + **4M**, such as `$(confdir)/amp/c2.bin`\n    - **CORE3_APP_BIN** start offset is **DDR_BASE** + **0x7E000000** + **4M*2**, such as `$(confdir)/amp/c3.bin`\n    - **CORE4_APP_BIN** start offset is **DDR_BASE** + **0x7E000000** + **4M*3**, such as `$(confdir)/amp/c4.bin`\n    - **CORE5_APP_BIN** start offset is **DDR_BASE** + **0x7E000000** + **4M*4**, such as `$(confdir)/amp/c5.bin`\n    - **CORE6_APP_BIN** start offset is **DDR_BASE** + **0x7E000000** + **4M*5**, such as `$(confdir)/amp/c6.bin`\n    - **CORE7_APP_BIN** start offset is **DDR_BASE** + **0x7E000000** + **4M*6**, such as `$(confdir)/amp/c7.bin`\n  * **TIMER_HZ**, **CPU_HZ**, **PERIPH_HZ** are used by `*.dts` files to generate correct timer, cpu, peripheral clock hz, if you directly\n    set it in dts, not need for this variables.\n\n* *opensbi/*: Change the opensbi support code for your soc, all the files need to be modified.\n\n* *nuclei_rv32imac.dts*, *nuclei_rv32imafdc.dts*, *nuclei_rv64imac.dts*, *nuclei_rv64imafdc.dts* and *openocd.cfg*: Change these files to match your SoC design.\n  - Select the right dts which match your cpu isa, for example, if you are using rv64imafdc, please use `nuclei_rv64imafdc.dts`\n  - External interrupts connected to plic interrupt number started from 1, 0 is reserved.\n    For example, in evalsoc, interrupt id of UART0 is 32, then plic interrupt number is 33,\n    and if elic also present, the eclic interrupt number will be 32+19=51\n  - If you want to boot linux using hvc console(console via sbi console, useful when uart driver in linux is not ready),\n    you can change `bootargs` to make `console=/dev/hvc0`, then it will use sbi console to print message\n  - If you UART driver in linux is ready, then you can change the console to your real uart device name.\n\n* *uboot.cmd*: Change to match your memory map.\n\n* *uboot_rv64imac_sd_config*, *uboot_rv64imac_flash_config*, *uboot_rv64imafdc_sd_config* and *uboot_rv64imafdc_flash_config*:\n* *uboot_rv32imac_sd_config*, *uboot_rv32imac_flash_config*, *uboot_rv32imafdc_sd_config* and *uboot_rv32imafdc_flash_config*:\n  change **CONFIG_SYS_TEXT_BASE** and **CONFIG_BOOTCOMMAND** to match your uboot system text address and boot command address.\n\n* If you have a lot of changes in uboot or linux, please directly change code in it.\n\n\u003e In evalsoc support, spmp bypass is controlled by code in `conf/evalsoc/opensbi/platform.c` for opensbi v0.9, `conf/evalsoc/opensbi/evalsoc.c` for opensbi \u003e= v1.2\n\n\u003e From commit 6507c68 on, the spmp will be bypassed(done in code as below) when tee is present(checked mcfg_info csr).\n\u003e If you have enabled TEE feature(sPMP module included), you need to configure spmp csr registers\n\u003e as this commit https://github.com/Nuclei-Software/opensbi/commit/1d28050d01b93b6afe590487324b663c65a2c429 .\n\u003e Then you will be able to boot up linux kernel, otherwise the init process will fail.\n\n## Known issues and FAQs\n\n\u003e Please also track issues located in https://github.com/Nuclei-Software/nuclei-linux-sdk/issues\n\n* Clone source code from github or gitee failed with issue `the remote end hung up unexpectedly`.\n\n  see https://github.com/Nuclei-Software/nuclei-linux-sdk/issues/10 for up to date answer.\n\n  This Nuclei Linux SDK repo is a very big repo with many submodules, just simple clone is not enough, you always need to\n  do submodule init and update, sometimes due to connection issue or http clone not stable issue, please switch to use ssh\n  protocol used in git clone, see similar issue posted in stackoverflow, see https://stackoverflow.com/questions/6842687/the-remote-end-hung-up-unexpectedly-while-git-cloning\n\n  Or you can try shallow submodule update:\n\n  ~~~shell\n  ## clone repo from github\n  git clone https://github.com/Nuclei-Software/nuclei-linux-sdk.git\n  ## if github is not working please use gitee, no longer working, deprecated now, see https://github.com/Nuclei-Software/nuclei-linux-sdk/issues/10#issuecomment-1728920670\n  # git clone https://gitee.com/Nuclei-Software/nuclei-linux-sdk.git\n  ## if https is not ok, please switch to ssh method, but you need to follow guidance in github or gitee\n  ## github: https://docs.github.com/cn/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent\n  ## gitee: https://gitee.com/help/articles/4181\n  cd nuclei-linux-sdk\n  git submodule update --init --depth=1\n  ## please check sample output here: https://github.com/Nuclei-Software/nuclei-linux-sdk/wiki/Sample-Outputs#sample-output-for-git-clone\n  ~~~\n\n  Or you just want to get latest source code without any git histories, you can also open our repo's github action link in github\n  https://github.com/Nuclei-Software/nuclei-linux-sdk/actions , make sure your github is logged in, and then click on any successful\n  action of your desired branch, and find the *nuclei_linux_sdk_source* in the **Artifacts** at the bottom of page, and click the\n  *nuclei_linux_sdk_source* and download it.\n\n* For Nuclei Demo SoC, if you run simulation using xl_spike, it can run to login prompt, but when you login, it will\n  show timeout issue, this is caused by xl_spike timer is not standard type, but the boot images for FPGA evaluation\n  board can boot successfully and works well.\n\n  If you want to execute using *xl_spike* without the login, you can edit the `work/$SOC/buildroot_initramfs_sysroot/etc/inittab`\n  file(started from `# now run any rc scripts`) as below, and save it:\n\n  ~~~\n  # now run any rc scripts\n  #::sysinit:/etc/init.d/rcS\n\n  # Put a getty on the serial port\n  #console::respawn:/sbin/getty -L  console 0 vt100 # GENERIC_SERIAL\n  ::respawn:-/bin/sh\n  ~~~\n\n  And then type `make presim` and `make sim` to run linux in *xl_spike*, you will be able to get following output in final:\n\n  ~~~\n  ## a lot of boot message are reduced here ##\n  UART: [  246.974853] sdhci: Secure Digital Host Controller Interface driver\n  UART: [  247.057922] sdhci: Copyright(c) Pierre Ossman\n  UART: [  247.447723] NET: Registered protocol family 17\n  UART: [  266.205169] Freeing unused kernel memory: 36052K\n  UART: [  266.314117] Run /init as init process\n  UART: # ls\n  ls\n  UART: bin      init     linuxrc  opt      run      tmp\n  UART: dev      lib      media    proc     sbin     usr\n  UART: etc      lib64    mnt      root     sys      var\n  UART: # cat /proc/cpuinfo\n  cat /proc/cpuinfo\n  UART: processor\t: 0\n  UART: hart\t\t: 0\n  UART: isa\t\t: rv64imac\n  UART: mmu\t\t: sv39\n  UART:\n  ~~~\n\n* For some SDCard format, it might not be supported, please check your SDCard is SDHC format.\n\n* If you can't boot with the sdcard boot images, you can run the following commands in uboot to check whether sdcard is recognized.\n\n  1. Type `mmcinfo` to check whether sdcard is recognized? If no output, please re-insert the sdcard, and try\n     this command again, if still not working, please confirm that the MCS is correct or not?\n\n     ~~~\n     Hit any key to stop autoboot:  0\n     =\u003e mmcinfo\n     Device: spi@10034000:mmc@0\n     Manufacturer ID: 2\n     OEM: 544d\n     Name: SA08G\n     Bus Speed: 20000000\n     Mode: MMC legacy\n     Rd Block Len: 512\n     SD version 2.0\n     High Capacity: Yes\n     Capacity: 7.2 GiB\n     Bus Width: 1-bit\n     Erase Group Size: 512 Bytes\n     ~~~\n\n  2. If SDCard is recognized correctly, please type `fatls mmc 0`, and check whether the following files\n     are listed as below, if you can get the following files in your sdcard, please reformat your sdcard to `Fat32` format,\n     and copy the generated files in *work/$SOC/boot/* to the root of sdcard, and re-insert the sdcard to SD slot, and retry from step 1.\n\n     **Note:** Please make sure your SDCard is safely injected in your OS, and SDCard is formated to `Fat32`.\n\n     ~~~\n     =\u003e fatls mmc 0\n         2594   kernel.dtb   # device tree binary file\n          345   boot.scr     # boot script used by uboot, generated from ./conf/\u003cSOC\u003e/uboot.cmd\n      3052821   uImage.lz4   # lz4 archived kernel image\n      19155960  uInitrd.lz4  # lz4 archived rootfs image\n\n      4 file(s), 0 dir(s)\n     ~~~\n\n  3. If the above steps are all correct, then you can run `boot` command to boot linux, or type commands\n     located in [./conf/evalsoc/uboot.cmd](conf/evalsoc/uboot.cmd) for evalsoc.\n\n* The linux kernel and rootfs size is too big, is there any way to reduce it to speed up boot speed?\n\n  If you are familiar with linux and buildroot configuration files, you can directly modify the configuration\n  files located in `conf` folder.\n\n  If you modified this files directly and want to take effects, you need to `make clean` first, and regenerate\n  boot images.\n\n  You can also try `make buildroot_initramfs-menuconfig` to get a terminal menuconfig to configure the buildroot\n  packages.\n\n  You can also try `make linux-menuconfig` to get a menuconfig to configure the linux kernel.\n\n  You can also try `make uboot-menuconfig` to get a menuconfig to configure the uboot.\n\n* Other possible ways to reduce generated rootfs image size.\n\n  If you are familiar with the generated rootfs files located in `work/\u003cSOC\u003e/buildroot_initramfs_sysroot`, you can\n  manually remove the files you think it is not used, and type `make cleanboot` and then `make bootimages`,\n  you can check the size information generated by the command.\n\n* The best way to learn this project is taking a look at the [Makefile](Makefile) of this project to learn about\n  what is really done in each make target.\n\n* Download *work/$SOC/freeloader/freeloader.elf* using Nuclei SDK.\n\n  If you don't want to build the nuclei sdk, you can also download the boot images generated by [github action](https://github.com/Nuclei-Software/nuclei-linux-sdk/actions).\n\n  For example, for `dev_nuclei_next` branch, you can find the previous built artifacts in [prebuilt artifacts][1].\n\n  Then you can extra the downloaded `bootimages_ux600.zip` and extract `freeloader/freeloader.elf` to your disk,\n  such as `D:/freeloader.elf`.\n\n  Make sure you have followed [steps](https://doc.nucleisys.com/nuclei_sdk/quickstart.html) to setup nuclei sdk\n  development environment, then you can follow steps below to download this `D:/freeloader.elf`.\n\n  see https://github.com/Nuclei-Software/nuclei-linux-sdk/wiki/Program-freeloader\n\n\n## Reference\n\n* [Buildroot Manual](https://buildroot.org/downloads/manual/manual.html)\n* [OpenSBI Manual](https://github.com/riscv/opensbi#documentation)\n* [Uboot Manual](https://www.denx.de/wiki/U-Boot/Documentation)\n* [Linux Manual](https://www.kernel.org/doc/html/latest/)\n\n---\n\n[1]: https://github.com/Nuclei-Software/nuclei-linux-sdk/actions/runs/2232759453\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuclei-software%2Fnuclei-linux-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuclei-software%2Fnuclei-linux-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuclei-software%2Fnuclei-linux-sdk/lists"}