Skip to content

add: initial support for Milk-V Jupiter/SpacemiT K1#56

Draft
Owen-sz wants to merge 20 commits intoUMN-Kernel-Object:trunkfrom
Owen-sz:owen/add-jupiter-dev-image
Draft

add: initial support for Milk-V Jupiter/SpacemiT K1#56
Owen-sz wants to merge 20 commits intoUMN-Kernel-Object:trunkfrom
Owen-sz:owen/add-jupiter-dev-image

Conversation

@Owen-sz
Copy link
Copy Markdown
Contributor

@Owen-sz Owen-sz commented Oct 3, 2025

Adds genimage.cfg, brings in vendor opensbi and u-boot via nix files. Adds Jupiter dev-image

remexre added a commit that referenced this pull request Oct 4, 2025
- Fixes the Nix build by removing the absolute path to Bash.

- Changes packages to be named "name/target" instead of "name-target"
  - Target names also have hyphens in them, so parsing them is a bit of
    a pain.

- Removes aliases for components of the image. These are still exposed
  as passthru attributes, but they don't have the target name in them
  any more. This should be more consistent and simpler to program around.

- Uses a "g" prefix for non-release versions instead of another
  hyphenated component. This again reduces ambiguity in parsing paths.

- Adds flake checks that all the ukoOS builds succeed and all the image
  builds succeed, and runs these checks in GitHub Actions.

- Prepares GitHub Actions to be used with other image targets (e.g. #56).
  This is done through the all-images package; whatever files that
  builds will get uploaded as artifacts.

- Fixes the REUSE tool being added as a dependency of ukoos instead of
  as a devShell input.

Signed-off-by: Nathan Ringo <me@remexre.com>
remexre added a commit that referenced this pull request Oct 4, 2025
- Fixes the Nix build by removing the absolute path to Bash.

- Changes packages to be named "name/target" instead of "name-target"
  - Target names also have hyphens in them, so parsing them is a bit of
    a pain.

- Removes aliases for components of the image. These are still exposed
  as passthru attributes, but they don't have the target name in them
  any more. This should be more consistent and simpler to program around.

- Uses a "g" prefix for non-release versions instead of another
  hyphenated component. This again reduces ambiguity in parsing paths.

- Adds flake checks that all the ukoOS builds succeed and all the image
  builds succeed, and runs these checks in GitHub Actions.

- Prepares GitHub Actions to be used with other image targets (e.g. #56).
  This is done through the all-images package; whatever files that
  builds will get uploaded as artifacts.

- Fixes the REUSE tool being added as a dependency of ukoos instead of
  as a devShell input.

Signed-off-by: Nathan Ringo <me@remexre.com>
github-merge-queue bot pushed a commit that referenced this pull request Oct 9, 2025
* Large-scale refactor of Nix flake.

- Fixes the Nix build by removing the absolute path to Bash.

- Changes packages to be named "name/target" instead of "name-target"
  - Target names also have hyphens in them, so parsing them is a bit of
    a pain.

- Removes aliases for components of the image. These are still exposed
  as passthru attributes, but they don't have the target name in them
  any more. This should be more consistent and simpler to program around.

- Uses a "g" prefix for non-release versions instead of another
  hyphenated component. This again reduces ambiguity in parsing paths.

- Adds flake checks that all the ukoOS builds succeed and all the image
  builds succeed, and runs these checks in GitHub Actions.

- Prepares GitHub Actions to be used with other image targets (e.g. #56).
  This is done through the all-images package; whatever files that
  builds will get uploaded as artifacts.

- Fixes the REUSE tool being added as a dependency of ukoos instead of
  as a devShell input.

Signed-off-by: Nathan Ringo <me@remexre.com>

* Adds doc/book/ to .gitignore.

Signed-off-by: Nathan Ringo <me@remexre.com>

---------

Signed-off-by: Nathan Ringo <me@remexre.com>
@Owen-sz Owen-sz force-pushed the owen/add-jupiter-dev-image branch from 3a3be76 to 00278bf Compare October 9, 2025 02:36
@Owen-sz Owen-sz changed the title add: initial support for jupiter add: initial support for Milk-V Jupiter/SpacemiT K1 Oct 9, 2025
@Owen-sz Owen-sz marked this pull request as ready for review October 14, 2025 02:52
@Owen-sz
Copy link
Copy Markdown
Contributor Author

Owen-sz commented Oct 14, 2025

Should be good now.

Copy link
Copy Markdown
Member

@remexre remexre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test that this boots the ukoOS kernel on real hardware, plz

@Owen-sz
Copy link
Copy Markdown
Contributor Author

Owen-sz commented Jan 9, 2026

Notes for testing:

Setup:
Attach UART pins to CPU UART, not security chip UART thing

build:
nix build -L .#all-images

flash src/result/dev-image-milkv-jupiter.img to microSD card

serial into the board

Need to see what u-boot is doing (it's loading GRUB?)

pins to reset/ignore SPI flash, since u-boot is being loaded form SPI flash?

@Owen-sz
Copy link
Copy Markdown
Contributor Author

Owen-sz commented Feb 13, 2026

--- UPDATED NOTES ---

BOOT STATUS:

[   6.977] Trying to boot from SD...
[   7.090] switch to partitions #0, OK
[   7.090] mmc0 is current device
[   7.126] 136096 bytes read in 21 ms (6.2 MiB/s)
[   7.128] Unhandled exception: Store/AMO access fault
[   7.133] EPC: 000000007eea8ca8 RA: 000000007ef50ce0 TVAL: 0000000000000000
[   7.139] EPC: 0000000000201ca8 RA: 00000000002a9ce0 reloc adjusted
[   7.146] 
Code: b383 0385 be03 0405 be83 0485 bf03 0505 (e110)
[   7.151] 

CHANGES:

The commit after this will be updating the memory addresses in code to match that of the Jupiter, which is a temporary fix, and this should not be merged with those changes.
It also fixes the u-boot.txt file with more configs for the Jupiter.

TESTING:

Go to the ukoOS u-boot repo, use commit ed29515c8baed05cdc1284474a847df214b0383c from the spacemit-k1-testing branch, copy the src/image-milkv-jupiter/u-boot.txt from this Pull Request into the board/spacemit/k1-x/k1-x.env, then to build:
nix build --override-input u-boot-spacemit-k1 ../ukoos-uboot/ -L .#all-images

@Owen-sz Owen-sz marked this pull request as draft February 13, 2026 07:21
Copy link
Copy Markdown
Contributor

@jastintime jastintime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look at my comments.

Appreciate your hard work and dedication, love to see it 🦾

@@ -0,0 +1,22 @@
Redistribution and use in source and binary forms, with or without
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bruh why we bringing this bloat in

image boot.vfat {
vfat {
label = "ukoos-boot"
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bloat wasting sizeof("ukoos-boot")

version = "2.2.27";

src = fetchgit {
url = "https://gitee.com/bianbu-linux/opensbi.git";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tell us what commit you are bringing in 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep up the good work!

make \
''${enableParallelBuilding:+-j''${NIX_BUILD_CORES}} \
ARCH=riscv \
CROSS_COMPILE=riscv64-unknown-linux-musl- \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why linux-musl and not ukoos-nolibcs 😎

Comment on lines +2 to +6
autostart=no
bootdelay=0
bootfile=kernel.elf
loadaddr=0x200000
startaddr=0x8200000
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

appeared out of thin air 😢

nativeBuildInputs = [
dtc
pkgsCross.riscv64-musl.stdenv.cc.bintools.bintools
pkgsCross.riscv64-musl.stdenv.cc.cc
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double check? why musl stuff

partition-type-uuid = "u-boot-env"
offset = "384K"
image = "uboot.env"
size = 256K
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🫃 big size, checky

@Owen-sz
Copy link
Copy Markdown
Contributor Author

Owen-sz commented Mar 22, 2026

It works!

When you get into u-boot on the Jupiter:

run custom_bootcmd
gok ${startaddr} ${fdtcontroladdr}

TODO: Make this automatic

Owen-sz added 7 commits March 21, 2026 19:56
Signed-off-by: Owen <owen@fyralabs.com>
Signed-off-by: Owen <owen@fyralabs.com>
Signed-off-by: Owen <owen@fyralabs.com>
Signed-off-by: Owen <owen@fyralabs.com>
Signed-off-by: Owen <owen@fyralabs.com>
Signed-off-by: Owen Zimmerman <owen@fyralabs.com>
Signed-off-by: Owen Zimmerman <owen@fyralabs.com>
@Owen-sz Owen-sz force-pushed the owen/add-jupiter-dev-image branch from 3b9dabd to 0eee5e3 Compare March 22, 2026 01:08
@Owen-sz
Copy link
Copy Markdown
Contributor Author

Owen-sz commented Mar 22, 2026

Resolves #78

@Owen-sz Owen-sz force-pushed the owen/add-jupiter-dev-image branch from 0eee5e3 to e0ad720 Compare March 22, 2026 01:26
Owen-sz added 4 commits March 21, 2026 20:27
Signed-off-by: Owen <owen@fyralabs.com>
Signed-off-by: Owen-sz <owen@fyralabs.com>
Signed-off-by: Owen-sz <owen@fyralabs.com>
Signed-off-by: Owen-sz <owen@fyralabs.com>
Owen-sz added 9 commits March 21, 2026 20:27
Signed-off-by: Owen-sz <owen@fyralabs.com>
Signed-off-by: Owen-sz <owen@fyralabs.com>
Signed-off-by: Owen-sz <owen@fyralabs.com>
Signed-off-by: Owen-sz <owen@fyralabs.com>
Signed-off-by: Owen-sz <owen@fyralabs.com>
Correct Jupiter nix file to load kernel into correct spot
Add /boot into Jupiter genimage.cfg
Update u-boot.txt with Jupiter things, and set new startaddr because the Jupiter's RAM is not the same place as the Duo S and QEMU
Update files that rg told me had the Duo S/QEMU staraddr to temporarily to include the Jupiters startaddr

Signed-off-by: Owen-sz <owen@fyralabs.com>
Signed-off-by: Owen-sz <owen@fyralabs.com>
…artaddress is used per make target

Signed-off-by: Owen-sz <owen@fyralabs.com>
Signed-off-by: Owen-sz <owen@fyralabs.com>
@Owen-sz Owen-sz force-pushed the owen/add-jupiter-dev-image branch from e0ad720 to d088483 Compare March 22, 2026 01:27
@Owen-sz
Copy link
Copy Markdown
Contributor Author

Owen-sz commented Mar 22, 2026

TODO:

  • gitignore bootstub.ld
  • Go through more comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants