Add board-specific documentations
This commit is contained in:
parent
f80ea06b6a
commit
7a083bb385
5 changed files with 9630 additions and 7 deletions
18
README.md
18
README.md
|
@ -4,8 +4,8 @@ This is where I plan to store all of my notes and documentation regarding my RIS
|
|||
|
||||
- Mainboard: [Milk-V Jupiter](https://milkv.io/jupiter) with SpacemiT M1-x processor (Original retail price) [^1]
|
||||
- RAM: 16GB of LPDDR4X (Soldered)
|
||||
- GPU: [Gigabyte GTX 1050Ti](https://www.techpowerup.com/gpu-specs/gigabyte-gtx-1050-ti-oc.b3909) (Use, ~$50 off eBay)
|
||||
- Power Supply: 750W SFX PSU (model number to come; something cheap off amazon)
|
||||
- GPU: [Gigabyte GTX 1050Ti](https://www.techpowerup.com/gpu-specs/gigabyte-gtx-1050-ti-oc.b3909) (Used, ~$50 off eBay)
|
||||
- Power Supply: FPS SFX Pro 450W 80Plus Bronze PSU (something cheap off amazon)
|
||||
- Case: [SGPC K49 Case](https://www.sgpcdesign.com/products/sgpc-itx-mini-case-k49steel) (Something cheap off amazon)
|
||||
- CPU Cooler: Cheap generic heatsink off amazon; not strictly necessary
|
||||
|
||||
|
@ -87,18 +87,20 @@ bootcmd=run set_bootargs; run load_files; booti $kernel_addr_r $ramdisk_addr_r:$
|
|||
|
||||
U-Boot is configured to find this textfile, and execute the `bootcmd` portion, which runs the previous two commands before booting to the initramfs to begin the boot process.
|
||||
|
||||
Once you've built and installed the kernel, and modified the `env` textfile,
|
||||
Once you've built and installed the kernel, and modified the `env` textfile, reboot the board. This will ensure that the basic build works properly. This isn't strictly necessary, but checking every step along the way is good practice.
|
||||
|
||||
In this repo, there is a [config file](./kernel.config) that you can save and copy into your kernel repository, rename to `.config`, rebuild the kernel, and happily be on your way. There is also a `diff` available, showing the changes made from the default config for kernel version 6.6.63. In general, you need to disable the SpacemiT GPU, the PowerVR drivers that drive it, enable nouveau, and enable the NVidia framebuffer. Once you've rebuilt and installed all the bits and bobs just like before, reboot to check that everything still works. You should no longer have any display outputs, but you should be able to access the board over SSH and over serial.
|
||||
|
||||
# NeoVim: Text Editor
|
||||
|
||||
Nowadays, I use NeoVim for my text editing, and I really enjoy its behaviour ovarall. However, one thing I can't easily do is use it on RISC-V, because at time of writing, [LuaJIT does not support RISC-V](https://github.com/LuaJIT/LuaJIT/pull/1267). While I'm here, I'll document my process for installing NeoVim, for complete documentation of my system.
|
||||
Nowadays, I use NeoVim for my text editing, and I really enjoy its behaviour ovarall. However, one thing I can't easily do is use it on RISC-V, because at time of writing, [LuaJIT does not support RISC-V](https://github.com/LuaJIT/LuaJIT/pull/1267). While I'm here, I'll document my process for installing NeoVim, for complete documentation of my system. Debian has a port for RISC-V, but it is lacking in many features, rather than building in LuaJIT as we will do here.
|
||||
|
||||
Using the [fork of LuaJIT](https://github.com/plctlab/LuaJIT/tree/v2.1-riscv64-pr) which supports RISC-V, git clone, `make`, and `sudo make install`, just like any other from-source project.
|
||||
Once this is done, or while it's building in the background, clone [NeoVim](https://github.com/neovim/neovim). Checkout the stable branch, install the dependencies, and build the package without LuaJIT (it should be able to find the previously built and installed version mentioned above):
|
||||
```bash
|
||||
git checkout stable && sudo apt-get install ninja-build gettext cmake unzip curl build-essential && make BUNDLED_CMAKE_FLAG="-DUSE_BUNDLED_LUAJIT=OFF"
|
||||
```
|
||||
Then, run `cd build && cpack -G DEB && sudo dpkg -i nvim-linux-riscv64.deb` to install using APT. NeoVim no longer supports this feature, and marks it as best effort, so expect this behaviour to change in the future, and require the same `make install` as for LuaJIT, but at time of writing it works fine.
|
||||
Then, run `cd build && cpack -G DEB && sudo dpkg -i nvim-linux-riscv64.deb` to install using APT. NeoVim no longer supports this feature, and marks it as best effort, so expect this behaviour to change in the future, and require the same `make install` as for LuaJIT, but at time of writing for tag `v0.10.4` it works fine.
|
||||
|
||||
# DeviceTree Modification
|
||||
|
||||
|
@ -111,9 +113,11 @@ Now, you'd think that the `swiotlb` command is enough for the GPU to at least re
|
|||
Along with these, we have the additional requirements of
|
||||
|
||||
- it can't overlap with existing devices
|
||||
- The amount of space available needs to be at least `0x180000000` (this is a requirement defined by the board if the BAR cannot be fully allocated as expected)
|
||||
- The amount of space available needs to be at least `0x18000000` (this is a requirement defined by the board if the BAR cannot be fully allocated as expected)
|
||||
|
||||
TODO: Copy-paste DTS block with explanation
|
||||
Through trial and error, along with some help from `Opvolger`s patches on [his github](https://github.com/Opvolger/spacemit-k1-linux-6.6), I've determined that the modifications listed [in this patch file](./devicetree.patch) are all that's necessary to get all BARs initialised properly. A map of the implemented registers available to use and currently used registers are also available [in this repository](./devicetreeTesting.md), although this document should not be considered complete.
|
||||
|
||||
Once you've modified the DeviceTree file, return to the root of your kernel build folder and rebuild the kernel, modules, and headers as mentioned previously, but ***do not install them***. Building should take significantly less time now, since the majority of the build is consistent. Everything from the Linux setup is ready, but the board isn't quite prepared yet.
|
||||
|
||||
# x86 Emulation
|
||||
|
||||
|
|
25
devicetree.patch
Normal file
25
devicetree.patch
Normal file
|
@ -0,0 +1,25 @@
|
|||
diff --git a/arch/riscv/boot/dts/spacemit/k1-x.dtsi b/arch/riscv/boot/dts/spacemit/k1-x.dtsi
|
||||
index 24366372e064..d0df2e87331d 100644
|
||||
--- a/arch/riscv/boot/dts/spacemit/k1-x.dtsi
|
||||
+++ b/arch/riscv/boot/dts/spacemit/k1-x.dtsi
|
||||
@@ -2281,7 +2281,7 @@ pcie1_rc: pcie@ca400000 {
|
||||
#size-cells = <2>;
|
||||
ranges = <0x01000000 0x0 0x9f002000 0 0x9f002000 0x0 0x100000>,
|
||||
<0x02000000 0x0 0x90000000 0 0x90000000 0x0 0x0f000000>;
|
||||
- interconnects = <&dram_range6>;
|
||||
+ interconnects = <&dram_range2>;
|
||||
interconnect-names = "dma-mem";
|
||||
|
||||
interrupts = <142>, <146>;
|
||||
@@ -2329,9 +2329,9 @@ pcie2_rc: pcie@ca800000 {
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges = <0x01000000 0x0 0xb7002000 0 0xb7002000 0x0 0x100000>,
|
||||
- <0x42000000 0x0 0xa0000000 0 0xa0000000 0x0 0x10000000>,
|
||||
+ <0x42000000 0x0 0xd5000000 0 0xd5000000 0x0 0x20000000>,
|
||||
<0x02000000 0x0 0xb0000000 0 0xb0000000 0x0 0x7000000>;
|
||||
- interconnects = <&dram_range7>;
|
||||
+ interconnects = <&dram_range2>;
|
||||
interconnect-names = "dma-mem";
|
||||
|
||||
interrupts = <143>, <147>;
|
18
devicetreeTesting.md
Normal file
18
devicetreeTesting.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
Seeking `0x0018000000` free
|
||||
|
||||
|Status|Beginning address| End address | Range |
|
||||
|---|---|---|---|
|
||||
|RAM| `0x0000080000` | `0x002ff40000` |
|
||||
|RESERVED|`0x002ff40000` | `0x0030380000` |
|
||||
| RAM |`0x0030380000` | `0x0080000000` |
|
||||
|PCIEMEM |`0x0080000000` | `0x008f000000` |
|
||||
| PCIEIO |`0x008f002000` | `0x008f102000` |
|
||||
|Free |`0x008f102000` | `0x0090000000` | `0x0000efe000` |
|
||||
|PCIEMEM |`0x0090000000` | `0x009f000000` |
|
||||
|PCIEIO |`0x009f002000` | `0x009f102000` |
|
||||
|Free |`0x009f102000` | `0x00b7000000` | `0x0017efe000` |
|
||||
|PCIEIO |`0x00b7000000` | `0x00b7002000` |
|
||||
|Free |`0x00b7002000` | `0x00c0b10000` | `0x0009b0e800` |
|
||||
|PuPHY |`0x00c0b10000` | `0x00c0b10800` |
|
||||
|Free |`0x00c0b10800` | `0x00d4000000` | `0x00134ef800` |
|
||||
|PDMA |`0x00d4000000` | `0x00d4004000` |
|
9422
kernel.config
Normal file
9422
kernel.config
Normal file
File diff suppressed because it is too large
Load diff
154
kernel.config.diff
Normal file
154
kernel.config.diff
Normal file
|
@ -0,0 +1,154 @@
|
|||
724a725
|
||||
> CONFIG_MMU_NOTIFIER=y
|
||||
1708a1710
|
||||
> CONFIG_AUXILIARY_BUS=y
|
||||
1722,1723c1724
|
||||
< CONFIG_EXTRA_FIRMWARE="nvidia/gp107/acr/bl.bin nvidia/gp107/acr/ucode_load.bin nvidia/gp107/acr/ucode_unload.bin nvidia/gp107/acr/unload_bl.bin nvidia/gp107/gr/fecs_bl.bin nvidia/gp107/gr/fecs_data.bin nvidia/gp107/gr/fecs_inst.bin nvidia/gp107/gr/fecs_sig.bin nvidia/gp107/gr/gpccs_bl.bin nvidia/gp107/gr/gpccs_data.bin nvidia/gp107/gr/gpccs_inst.bin nvidia/gp107/gr/gpccs_sig.bin nvidia/gp107/gr/sw_bundle_init.bin nvidia/gp107/gr/sw_ctx.bin nvidia/gp107/gr/sw_method_init.bin nvidia/gp107/gr/sw_nonctx.bin nvidia/gp107/nvdec/scrubber.bin nvidia/gp107/sec2/desc-1.bin nvidia/gp107/sec2/desc.bin nvidia/gp107/sec2/image-1.bin nvidia/gp107/sec2/image.bin nvidia/gp107/sec2/sig-1.bin nvidia/gp107/sec2/sig.bin esos.elf"
|
||||
< CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"
|
||||
---
|
||||
> CONFIG_EXTRA_FIRMWARE=""
|
||||
2048d2048
|
||||
< # CONFIG_UACCE is not set
|
||||
3174c3174
|
||||
< CONFIG_I2C_ALGOBIT=y
|
||||
---
|
||||
> CONFIG_I2C_ALGOBIT=m
|
||||
5174a5175
|
||||
> CONFIG_DRM_MIPI_DSI=y
|
||||
5182a5184
|
||||
> CONFIG_DRM_DP_AUX_BUS=y
|
||||
5185d5186
|
||||
< CONFIG_DRM_DISPLAY_HDMI_HELPER=y
|
||||
5189d5189
|
||||
< CONFIG_DRM_EXEC=m
|
||||
5191c5191
|
||||
< CONFIG_DRM_SCHED=m
|
||||
---
|
||||
> CONFIG_DRM_SUBALLOC_HELPER=m
|
||||
5210c5210,5211
|
||||
< # CONFIG_DRM_RADEON is not set
|
||||
---
|
||||
> CONFIG_DRM_RADEON=m
|
||||
> CONFIG_DRM_RADEON_USERPTR=y
|
||||
5212,5217c5213
|
||||
< CONFIG_DRM_NOUVEAU=m
|
||||
< CONFIG_NOUVEAU_DEBUG=5
|
||||
< CONFIG_NOUVEAU_DEBUG_DEFAULT=3
|
||||
< # CONFIG_NOUVEAU_DEBUG_MMU is not set
|
||||
< # CONFIG_NOUVEAU_DEBUG_PUSH is not set
|
||||
< CONFIG_DRM_NOUVEAU_BACKLIGHT=y
|
||||
---
|
||||
> # CONFIG_DRM_NOUVEAU is not set
|
||||
5239a5236
|
||||
> # CONFIG_DRM_PANEL_ASUS_Z00T_TM5P5_NT35596 is not set
|
||||
5240a5238,5241
|
||||
> # CONFIG_DRM_PANEL_BOE_BF060Y8M_AJ0 is not set
|
||||
> # CONFIG_DRM_PANEL_BOE_HIMAX8279D is not set
|
||||
> # CONFIG_DRM_PANEL_BOE_TV101WUM_NL6 is not set
|
||||
> # CONFIG_DRM_PANEL_DSI_CM is not set
|
||||
5243a5245,5249
|
||||
> # CONFIG_DRM_PANEL_EBBG_FT8719 is not set
|
||||
> # CONFIG_DRM_PANEL_ELIDA_KD35T133 is not set
|
||||
> # CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02 is not set
|
||||
> # CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D is not set
|
||||
> # CONFIG_DRM_PANEL_HIMAX_HX8394 is not set
|
||||
5245a5252
|
||||
> # CONFIG_DRM_PANEL_ILITEK_ILI9881C is not set
|
||||
5246a5254,5261
|
||||
> # CONFIG_DRM_PANEL_INNOLUX_P079ZCA is not set
|
||||
> # CONFIG_DRM_PANEL_JADARD_JD9365DA_H3 is not set
|
||||
> # CONFIG_DRM_PANEL_JDI_LT070ME05000 is not set
|
||||
> # CONFIG_DRM_PANEL_JDI_R63452 is not set
|
||||
> # CONFIG_DRM_PANEL_KHADAS_TS050 is not set
|
||||
> # CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04 is not set
|
||||
> # CONFIG_DRM_PANEL_LEADTEK_LTK050H3146W is not set
|
||||
> # CONFIG_DRM_PANEL_LEADTEK_LTK500HD1829 is not set
|
||||
5249a5265
|
||||
> # CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966 is not set
|
||||
5250a5267
|
||||
> # CONFIG_DRM_PANEL_NEWVISION_NV3051D is not set
|
||||
5251a5269,5273
|
||||
> # CONFIG_DRM_PANEL_NOVATEK_NT35510 is not set
|
||||
> # CONFIG_DRM_PANEL_NOVATEK_NT35560 is not set
|
||||
> # CONFIG_DRM_PANEL_NOVATEK_NT35950 is not set
|
||||
> # CONFIG_DRM_PANEL_NOVATEK_NT36523 is not set
|
||||
> # CONFIG_DRM_PANEL_NOVATEK_NT36672A is not set
|
||||
5252a5275
|
||||
> # CONFIG_DRM_PANEL_MANTIX_MLAF057WE51 is not set
|
||||
5254a5278,5284
|
||||
> # CONFIG_DRM_PANEL_ORISETECH_OTM8009A is not set
|
||||
> # CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS is not set
|
||||
> # CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00 is not set
|
||||
> # CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set
|
||||
> # CONFIG_DRM_PANEL_RAYDIUM_RM67191 is not set
|
||||
> # CONFIG_DRM_PANEL_RAYDIUM_RM68200 is not set
|
||||
> # CONFIG_DRM_PANEL_RONBO_RB070D30 is not set
|
||||
5256a5287
|
||||
> # CONFIG_DRM_PANEL_SAMSUNG_S6D16D0 is not set
|
||||
5258a5290,5291
|
||||
> # CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2 is not set
|
||||
> # CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03 is not set
|
||||
5261a5295
|
||||
> # CONFIG_DRM_PANEL_SAMSUNG_SOFEF00 is not set
|
||||
5262a5297
|
||||
> # CONFIG_DRM_PANEL_SHARP_LQ101R1SX01 is not set
|
||||
5263a5299,5302
|
||||
> # CONFIG_DRM_PANEL_SHARP_LS043T1LE01 is not set
|
||||
> # CONFIG_DRM_PANEL_SHARP_LS060T1SX01 is not set
|
||||
> # CONFIG_DRM_PANEL_SITRONIX_ST7701 is not set
|
||||
> # CONFIG_DRM_PANEL_SITRONIX_ST7703 is not set
|
||||
5265a5305,5308
|
||||
> # CONFIG_DRM_PANEL_SONY_TD4353_JDI is not set
|
||||
> # CONFIG_DRM_PANEL_SONY_TULIP_TRULY_NT35521 is not set
|
||||
> # CONFIG_DRM_PANEL_STARTEK_KD070FHFID015 is not set
|
||||
> # CONFIG_DRM_PANEL_TDO_TL070WSH30 is not set
|
||||
5268a5312,5315
|
||||
> # CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA is not set
|
||||
> # CONFIG_DRM_PANEL_VISIONOX_RM69299 is not set
|
||||
> # CONFIG_DRM_PANEL_VISIONOX_VTDR6130 is not set
|
||||
> # CONFIG_DRM_PANEL_VISIONOX_R66451 is not set
|
||||
5269a5317
|
||||
> # CONFIG_DRM_PANEL_XINPENG_XPP055C272 is not set
|
||||
5359,5360c5407,5413
|
||||
< # CONFIG_DRM_SPACEMIT is not set
|
||||
< # CONFIG_POWERVR_ROGUE is not set
|
||||
---
|
||||
> CONFIG_DRM_SPACEMIT=y
|
||||
> CONFIG_SPACEMIT_MIPI_PANEL=y
|
||||
> CONFIG_SPACEMIT_HDMI=y
|
||||
> CONFIG_DRM_LT8911EXB=y
|
||||
> CONFIG_DRM_LT9711=y
|
||||
> # CONFIG_POWERVR_ROGUE_NULLDRMDISP is not set
|
||||
> CONFIG_POWERVR_ROGUE=y
|
||||
5383,5386c5436
|
||||
< CONFIG_FB_NVIDIA=y
|
||||
< CONFIG_FB_NVIDIA_I2C=y
|
||||
< CONFIG_FB_NVIDIA_DEBUG=y
|
||||
< CONFIG_FB_NVIDIA_BACKLIGHT=y
|
||||
---
|
||||
> # CONFIG_FB_NVIDIA is not set
|
||||
5426c5476
|
||||
< CONFIG_FIRMWARE_EDID=y
|
||||
---
|
||||
> # CONFIG_FIRMWARE_EDID is not set
|
||||
5428d5477
|
||||
< CONFIG_FB_DDC=y
|
||||
5438a5488
|
||||
> CONFIG_FB_IOMEM_HELPERS=y
|
||||
5441,5442c5491
|
||||
< CONFIG_FB_BACKLIGHT=y
|
||||
< CONFIG_FB_MODE_HELPERS=y
|
||||
---
|
||||
> # CONFIG_FB_MODE_HELPERS is not set
|
||||
5468c5517
|
||||
< CONFIG_VGASTATE=y
|
||||
---
|
||||
> CONFIG_VIDEOMODE_HELPERS=y
|
||||
5735a5785
|
||||
> CONFIG_SPACEMIT_HDMIAUDIO=y
|
||||
6821d6870
|
||||
< # CONFIG_TEGRA186_GPC_DMA is not set
|
||||
7142d7190
|
||||
< CONFIG_IOMMU_API=y
|
||||
9078a9127
|
||||
> CONFIG_INTERVAL_TREE=y
|
Loading…
Add table
Reference in a new issue