Skip to content

Commit

Permalink
Add DuoS support (not EMMC version yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fishwaldo committed Apr 24, 2024
1 parent 88d97d3 commit fc32a03
Show file tree
Hide file tree
Showing 21 changed files with 1,069 additions and 13 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Debian Images for Sophgo cv1800/sg200x based boards
# Debian Images for Sophgo cv181x/sg200x based boards

This repository builds debian sid images for Sophgo cv1800/sg200x based boards such as MilkV Duo/Duo256 and Sipeed LicheeRvNano.
This repository builds debian sid images for Sophgo cv181x/sg200x based boards such as MilkV Duo256/DuoS (SD Version only) and Sipeed LicheeRvNano.

(Note, we don't support the MilkV Duo, as it does not have enough ram to run Debian)

The images aim to be as close to possible to debian best practices as possible

Expand Down Expand Up @@ -53,7 +55,7 @@ https://sophgo.my-ho.st:8443/ which pulls down the compiled debian packages from

To build a stock image with no modifications:
```
podman run --privileged -it --rm -v ./configs/:/configs -v ./image:/output -v ghcr.io/fishwaldo/sophgo-sg200x-debian:master make BOARD=licheervnano image
podman run --privileged -it --rm -v ./configs/:/configs -v ./image:/output ghcr.io/fishwaldo/sophgo-sg200x-debian:master make BOARD=licheervnano image
```

Replace the licheervnano with the board you want to build for:
Expand Down Expand Up @@ -85,9 +87,9 @@ The configs directory contains patches, configuration and device tree files that

The configs/common directory contains the common configuration for all boards, and the configs/licheervnano and configs/duo256 directories contain the board specific configuration.

To add packages to the image, either add the package name in PACKAGES variable of configs/settings.mk or if the packae is specific to a board, add it to the configs/<board>/settings.mk file
To add packages to the image, either add the package name in PACKAGES variable of configs/settings.mk or if the packae is specific to a board, add it to the configs/\<board\>/settings.mk file

Patches for the kernel, opensbi, u-boot or fsbl can be placed in configs/common/patches/ or configs/<board>/patches/ depending what they are for.
Patches for the kernel, opensbi, u-boot or fsbl can be placed in configs/common/patches/ or configs/\<board\>/patches/ depending what they are for.

To assist with developing the image, you can get a shell in the docker container by running:
```
Expand All @@ -98,7 +100,7 @@ inside the container, packages are build in the /builder/ directory, and the roo


# TODO
- Add support for the DuoS board
- Add support for the DuoS EMMC Board
- DeviceTree Overlay Support
- Add support for the MIPI-CSI/DSI drivers (Sample applications would be in the sophgo-sg200x-packages repository if they do not depend upon a musl libc version)
- Add support for the TPU drivers
Expand Down
134 changes: 134 additions & 0 deletions configs/duos/dts/cv181x_milkv_duos_sd.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/dts-v1/;
#include "cv181x_base_riscv.dtsi"
#include "cv181x_asic_bga.dtsi"
#include "cv181x_asic_sd.dtsi"
#include "cv181x_default_memmap.dtsi"

#include "dt-bindings/leds/common.h"
#ifndef __UBOOT__
#include <dt-bindings/mailbox/cvitek-mailbox.h>
#endif


&mipi_rx{
snsr-reset = <&portc 17 GPIO_ACTIVE_LOW>, <&portc 17 GPIO_ACTIVE_LOW>, <&portc 17 GPIO_ACTIVE_LOW>;
};

&dac{
/delete-property/ mute-gpio-l;
/delete-property/ mute-gpio-r;
};

&i2c0 {
status = "disabled";
};

&spi3 {
status = "okay";

spidev@0 {
status = "okay";
};
};

&usb {
vbus-gpio = <&portb 6 0>;
};

&wifisd {
status = "okay";
cap-sd-highspeed;
sd-uhs-sdr25;
sd-uhs-ddr50;
sd-uhs-sdr104;
min-frequency = <400000>;
max-frequency = <187500000>;
};

&wifi_pin {
compatible = "cvitek,wifi-pin";
poweron-gpio = <&porta 15 GPIO_ACTIVE_HIGH>;
wakeup-gpio = <&porte 7 GPIO_ACTIVE_HIGH>;
};

&uart4 {
status = "okay";
};

&soc_thermal_0 {
cooling-maps {
map0 {
trip = <&soc_thermal_trip_0>;
cooling-device = <&cv181x_cooling THERMAL_NO_LIMIT 1>;
};
map1 {
trip = <&soc_thermal_trip_1>;
cooling-device = <&cv181x_cooling THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};

&porta {
wifi_pwr {
gpio-hog;
gpios = <15 GPIO_ACTIVE_HIGH>;
output-high;
};
};

/ {
model = "Milk-V DuoS";

/delete-node/ wifi_pin;
/delete-node/ bt_pin;

leds {
compatible = "gpio-leds";
led0 {
gpios = <&porta 29 GPIO_ACTIVE_LOW>;
linux,default-trigger = "heartbeat";
function = LED_FUNCTION_HEARTBEAT;
label = "blue";
};
led1 {
gpios = <&porte 6 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "netdev";
function = LED_FUNCTION_HEARTBEAT;
label = "orange";
};
led2 {
gpios = <&porte 8 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "stmmac-0:00:link";
function = LED_FUNCTION_HEARTBEAT;
label = "green";
};
};


#ifndef __UBOOT__
mbox: mbox@0x01900000 {
compatible = "cvitek,sg200x-mailbox";
reg = <0x0 0x01900000 0x0 0x1000>;
reg-names = "mailbox";
interrupts = <101 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&plic0>;
status = "okay";
#mbox-cells = <4>;
};

cv181x-c906_1 {
compatible = "cvitek,cv181x-c906_1";
memory-region = <&fast_image &vdev0vring0 &vdev0vring1 &vdev0buffer>;
firmware = "c906-mcu.elf";
resets = <&rst RST_C906_1>;
reset-names = "sw_reset";
clocks = <&clk CV181X_CLK_C906_1>;
clock-names = "clk_c906_1";
mboxes = <&mbox 0 CVITEK_MBOX_DIRECTION_TX CVITEK_MBOX_C906_1 1>, <&mbox 1 CVITEK_MBOX_DIRECTION_RX CVITEK_MBOX_C906_1 1>;
mbox-names = "vq_tx", "vq_rx";
status = "okay";
};
#endif

};

Loading

0 comments on commit fc32a03

Please sign in to comment.