Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Fishwaldo committed Apr 10, 2024
0 parents commit ab3df29
Show file tree
Hide file tree
Showing 80 changed files with 95,280 additions and 0 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Build Docker Image
on:
push:
tags:
- '*'
branches:
- '*'

jobs:
build-docker-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: checkout
uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
src:
- 'scripts/**'
- '.github/**'
- name: Log into registry ghcr.io
if: github.event_name != 'pull_request' && steps.filter.outputs.src == 'true'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
if: steps.filter.outputs.src == 'true'
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/fishwaldo/sophgo-sg200x-debian

- name: Build and push Docker image
if: steps.filter.outputs.src == 'true'
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
file: ./scripts/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}


build-image:
strategy:
matrix:
boards: [licheervnano]
runs-on: ubuntu-latest
needs: build-docker-image
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Get Board Configs
uses: actions/checkout@v4
- name: Build Images
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/fishwaldo/sophgo-sg200x-debian:master
options: --privileged -v ${{ github.workspace }}/images/:/output -v ${{ github.workspace }}/configs/:/configs/
run: |
make BOARD=${{ matrix.boards }} image
chmod 777 /output/
- name: Pack
run: |
cd images/
ls -lah
if [ -f ${{ matrix.boards }}_sd.img ]; then
lz4 -9 -f ${{ matrix.boards }}_sd.img ${{ matrix.boards }}_sd.img.lz4
rm ${{ matrix.boards }}_sd.img
fi
tar czvf ${{ matrix.boards }}_debs.tar.gz *.deb
rm *.deb
echo "PACKAGE=${{ github.workspace }}/images/*" >> $GITHUB_ENV
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: image-files-${{ matrix.boards }}
path: |
${{env.PACKAGE}}
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [build-image]
permissions: write-all
steps:
- name: download firmware
uses: actions/download-artifact@v4
- name: list images
run: |
ls -lah
ls -lah image-files-*/
- name: publish artifacts
uses: softprops/action-gh-release@v2
with:
append_body: true
files: |
image-files-*/*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__
image/*
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions build_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker build -t builder -f scripts/Dockerfile .
2 changes: 2 additions & 0 deletions build_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
docker run --privileged -it --rm -v ./configs/:/configs -v ./image:/output builder make BOARD=licheervnano image
12 changes: 12 additions & 0 deletions configs/common/dts/cv180x/cv180x_asic_bga.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
&dac{
mute-gpio-l = <&porta 15 GPIO_ACTIVE_LOW>;
mute-gpio-r = <&porta 30 GPIO_ACTIVE_LOW>;
};

/ {
/delete-node/ i2s@04110000;
/delete-node/ i2s@04120000;
/delete-node/ sound_ext1;
/delete-node/ sound_ext2;
/delete-node/ sound_PDM;
};
66 changes: 66 additions & 0 deletions configs/common/dts/cv180x/cv180x_asic_qfn.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
&sd {
no-1-8-v;
};

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

&dac{
mute-gpio-r = <&porte 2 GPIO_ACTIVE_LOW>;
};

&spi0 {
status = "disabled";
num-cs = <1>;
spidev@0 {
compatible = "rohm,dh2228fv";
spi-max-frequency = <1000000>;
reg = <0>;
};
};

&spi1 {
status = "disabled";
num-cs = <1>;
spidev@0 {
compatible = "rohm,dh2228fv";
spi-max-frequency = <1000000>;
reg = <0>;
};
};

&spi2 {
status = "disabled";
num-cs = <1>;
spidev@0 {
compatible = "rohm,dh2228fv";
spi-max-frequency = <1000000>;
reg = <0>;
};
};

&spi3 {
status = "okay";
num-cs = <1>;
spidev@0 {
compatible = "rohm,dh2228fv";
spi-max-frequency = <1000000>;
reg = <0>;
};
};

/ {
/delete-node/ wifi-sd@4320000;
/delete-node/ i2s@04110000;
/delete-node/ sound_ext1;
/delete-node/ sound_ext2;
/delete-node/ sound_PDM;

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

};
4 changes: 4 additions & 0 deletions configs/common/dts/cv180x/cv180x_asic_sd.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/ {
/delete-node/ cv-emmc@4300000;
/delete-node/ cv-spinf@4060000;
};
5 changes: 5 additions & 0 deletions configs/common/dts/cv180x/cv180x_asic_spinand.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/ {
/delete-node/ cvi-spif@10000000;
/delete-node/ cv-emmc@4300000;
};

5 changes: 5 additions & 0 deletions configs/common/dts/cv180x/cv180x_asic_spinor.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/ {
/delete-node/ cv-emmc@4300000;
/delete-node/ cv-spinf@4060000;
};

Loading

0 comments on commit ab3df29

Please sign in to comment.