Skip to content

Commit

Permalink
k230 linux sdk release v0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwentao committed Aug 5, 2024
1 parent 1fe3b5d commit abfaa92
Show file tree
Hide file tree
Showing 194 changed files with 47,710 additions and 210 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
/dl
compile_commands.json
.cache
/test
/linux

443 changes: 418 additions & 25 deletions .gitlab-ci.yml

Large diffs are not rendered by default.

16 changes: 4 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include .last_conf
BRW_BUILD_DIR = $(CURDIR)/output/$(CONF)


.PHONY: all buildroot debian ubuntu openouler ruyi k230d_32bit_rootfs k230d_canmv_kernel64_root32
.PHONY: all buildroot debian ubuntu openouler ruyi
all : buildroot

debian ubuntu openouler : buildroot
Expand All @@ -21,14 +21,6 @@ debian ubuntu openouler : buildroot
buildroot: $(BRW_BUILD_DIR)/.config
make -C $(BRW_BUILD_DIR) all

k230d_32bit_rootfs:sync
make -C $(BR_SRC_DIR) k230d_canmv_32bit_rootfs_defconfig O=$(CURDIR)/output/k230d_canmv_32bit_rootfs_defconfig
make -C $(CURDIR)/output/k230d_canmv_32bit_rootfs_defconfig all

k230d_canmv_kernel64_root32: sync k230d_32bit_rootfs
make -C $(BR_SRC_DIR) k230d_canmv_64kernel_32rootfs_defconfig O=$(CURDIR)/output/k230d_canmv_64kernel_32rootfs_defconfig
make -C $(CURDIR)/output/k230d_canmv_64kernel_32rootfs_defconfig all

.PHONY:dl
dl: $(BRW_BUILD_DIR)/.config
echo "download all source"
Expand All @@ -48,14 +40,14 @@ help:sync
@echo " make CONF=k230_canmv_defconfig -build k230 linux sdk user k230_canmv_defconfig"
@echo " -CONF can be $$(ls $(BR_OVERLAY_DIR)/configs | tr '\n' '/')"
@echo "dcoker build and run example:"
@echo " docker build -f tools/docker/Dockerfile -t wjx/linux_sdk_docker_tt tools/docker "
@echo ' docker run -it -h k230 -e uid=$$(id -u) -e gid=$$(id -g) -e user=$${USER} -v $$HOME:$$HOME -w $$(pwd) wjx/linux_sdk_docker_tt:latest '
@echo " docker build -f tools/docker/Dockerfile -t wjx/d tools/docker "
@echo ' docker run -it --rm -h k230 -e uid=$$(id -u) -e gid=$$(id -g) -e user=$${USER} -v $$HOME:$$HOME -v /opt/toolchain:/opt/toolchain -w $$(pwd) wjx/d:latest '

.PHONY:sync
sync:
make -f tools/sync.mk sync BR_SRC_DIR=$(BR_SRC_DIR) BR_OVERLAY_DIR=$(BR_OVERLAY_DIR) BR_NAME=$(BR_NAME)

this-makefile := $(lastword $(MAKEFILE_LIST)) all dl help savedefconfig sync %_defconfig k230d_32bit_rootfs k230d_canmv_kernel64_root32
this-makefile := $(lastword $(MAKEFILE_LIST)) all dl help savedefconfig sync %_defconfig
$(filter-out $(this-makefile) , $(MAKECMDGOALS)): $(BRW_BUILD_DIR)/.config
[ -d $(BRW_BUILD_DIR) ] && make -C $(BRW_BUILD_DIR) $@

Expand Down
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
# K230 Linux SDK

>This document uses the k230d_canmv_defconfig configuration as an example. If you use other configurations, replace k230d_canmv_defconfig with correct names. All the configurations supported by this sdk, can be found in buildroot-overlay/configs directory.
## Install toolchain and dependencies

>This document uses the k230d_canmv_defconfig configuration as an example. If you use other configurations, replace k230d_canmv_defconfig with correct names. All the configurations supported by this sdk, can be found in buildroot-overlay/configs directory.
download Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1-20240712.tar.gz toolchan from `https://www.xrvm.cn/community/download?id=4333581795569242112`
uncompress the toolchain to the /opt/toolchain(Refer command):

```bash
mkdir -p /opt/toolchain;
tar -zxvf Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1-20240712.tar.gz -C /opt/toolchain;
```

install dependencies(Refer command):

```bash
apt-get install -y git sed make binutils build-essential diffutils gcc g++ bash patch gzip \
bzip2 perl tar cpio unzip rsync file bc findutils wget libncurses-dev python3 \
libssl-dev gawk cmake bison flex bash-completion
```

>k230d_canmv_ilp32_defconfig required ubuntu 22.04 or 24.04 and install rv64ilp32 toolchain(refer command):
>
>`wget -c https://github.com/ruyisdk/riscv-gnu-toolchain-rv64ilp32/releases/download/2024.06.25/riscv64ilp32-elf-ubuntu-22.04-gcc-nightly-2024.06.25-nightly.tar.gz;`
>
>`mkdir -p /opt/toolchain/riscv64ilp32-elf-ubuntu-22.04-gcc-nightly-2024.06.25/;`
>`tar -xvf riscv64ilp32-elf-ubuntu-22.04-gcc-nightly-2024.06.25-nightly.tar.gz -C /opt/toolchain/riscv64ilp32-elf-ubuntu-22.04-gcc-nightly-2024.06.25/;`
## build

```bash

make CONF=k230d_canmv_defconfig #build k230d canmv image (kernel and rootfs both 64bit);
# make CONF=k230_canmv_defconfig # build k230 canmv image
# make CONF=k230d_canmv_32bit_rootfs_defconfig #build k230d canmv 32bit rootfs;
# make CONF=k230d_canmv_64kernel_32rootfs_defconfig #build k230d 64bit kernel and 32bit rootfs image
# make CONF=k230d_canmv_ilp32_defconfig #build k230d canmv 32bit rootfs;
# make help # view help
```

>[BR2_PRIMARY_SIT configuration primary download site]("https://bootlin.com/pub/conferences/2011/elce/using-buildroot-real-project/using-buildroot-real-project.pdf") for example:make CONF=k230d_canmv_defconfig BR2_PRIMARY_SITE=https://ai.b-bug.org/~/wangjianxin/dl/
>[BR2_PRIMARY_SIT configuration primary download site]("https://bootlin.com/pub/conferences/2011/elce/using-buildroot-real-project/using-buildroot-real-project.pdf") for example: `make CONF=k230d_canmv_defconfig BR2_PRIMARY_SITE=https://ai.b-bug.org/~/wangjianxin/dl/`
## output

Expand All @@ -44,14 +65,13 @@ output/k230d_canmv_defconfig/build/uboot-2022.10/ #uboot full code,uboot build d
make linux-menuconfig #modify configuration
make linux-savedefconfig #save to defconfig

make linux-rebuild opensbi-rebuild #rebuild linux,rebuild opensbi
make linux-rebuild #rebuild linux
make linux-dirclean #linux clean
```

>linux source code can be specified using the LINUX_OVERRIDE_SRCDIR macro,for example:
>echo LINUX_OVERRIDE_SRCDIR=/home/wangjianxin/t/linux-xuantie-kernel >output/k230d_canmv_defconfig/local.mk

## buildroot

```bash
Expand Down
8 changes: 6 additions & 2 deletions buildroot-overlay/board/canaan/k230-soc/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ ramdisk_addr=0xa100000
serverip=10.10.1.94
vendor=canaan
quick_boot=false
blinux=ext4load mmc 1:1 0x3000000 /fw_jump_add_uboot_head.bin && ext4load mmc 1:1 0x200000 /Image && ext4load mmc 1:1 0x2200000 /k.dtb && bootm 0x3000000 - 0x2200000;
bnuttx=ext4load mmc 1:1 0x7000000 /nuttx-7000000-uart2.bin && boot_baremetal 0 0x${fileaddr} 0x${filesize};
k=Image
kilp32=Image_ilp32
nuttex=nuttx-7000000-uart2.bin
blinux=ext4load mmc 1:1 0x3000000 /fw_jump_add_uboot_head.bin && ext4load mmc 1:1 0x200000 /${k} && ext4load mmc 1:1 0x2200000 /k.dtb && bootm 0x3000000 - 0x2200000;
blinuxilp32= setenv k Image_ilp32 && run blinux;
bnuttx=ext4load mmc 1:1 0x7000000 /${nuttex} && boot_baremetal 0 0x${fileaddr} 0x${filesize};
31 changes: 22 additions & 9 deletions buildroot-overlay/board/canaan/k230-soc/post-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,23 @@ gz_file_add_ver()
local CONF=$(basename ${BASE_DIR})

local sdk_ver="v0.0.0";
local nncase_ver="0.0.0";
local nncase_ver="2.9.0";

local sdk_ver_file="${K230_SDK_ROOT}/buildroot-overlay/board/canaan/k230-soc/rootfs_overlay/etc/version/release_version"
#local nncase_ver_file="${K230_SDK_ROOT}/src/big/nncase/riscv64/nncase/include/nncase/version.h"
local nncase_ver_file="${K230_SDK_ROOT}/output/${CONF}/build/libnncase/nncase/include/nncase/version.h"


local storage="$(echo "$f" | sed -nE "s#[^-]*-([^\.]*).*#\1#p")"
local conf_name="${CONF%%_defconfig}"


sdk_ver=$(awk -F- '/^sdk:/ { print $1}' ${sdk_ver_file} | cut -d: -f2 )

# cat ${nncase_ver_file} | grep NNCASE_VERSION -w | cut -d\" -f 2 > /dev/null && \
# nncase_ver=$(cat ${nncase_ver_file} | grep NNCASE_VERSION -w | cut -d\" -f 2)
rm -rf ${conf_name}_${storage}_${sdk_ver}_nncase_v${nncase_ver}.img.gz;
ln -s $f ${conf_name}_${storage}_${sdk_ver}_nncase_v${nncase_ver}.img.gz;
if [ -e "${nncase_ver_file}" ]; then
cat ${nncase_ver_file} | grep NNCASE_VERSION -w | cut -d\" -f 2 > /dev/null && \
nncase_ver=$(cat ${nncase_ver_file} | grep NNCASE_VERSION -w | cut -d\" -f 2)
fi
rm -rf ${conf_name}_linux_${sdk_ver}_nncase_v${nncase_ver}.img.gz;
ln -s $f ${conf_name}_linux_${sdk_ver}_nncase_v${nncase_ver}.img.gz;
}


Expand Down Expand Up @@ -199,24 +201,35 @@ gen_image()
gen_env_bin()
{
local mkenvimage="${UBOOT_BUILD_DIR}/tools/mkenvimage"
local CONFT=${BUILD_DIR%/build*}
local CONF=${CONFT##*/output/};


cd "${BINARIES_DIR}/";
local default_env_file=${env_dir}/default.env;

if [ ${DTB} == "k230-canmv-01studio.dtb" ]; then
default_env_file=${env_dir}/01studio.env;
fi

if [ ${CONF} == "k230d_canmv_ilp32_defconfig" ]; then
sed -i 's/^bootcmd=.*$/bootcmd=run blinuxilp32;/g' ${default_env_file}
else
sed -i 's/^bootcmd=.*$/bootcmd=run blinux;/g' ${default_env_file}
fi
${mkenvimage} -s 0x10000 -o uboot/env.env ${default_env_file}
}
gen_boot_ext4()
{
cd "${BINARIES_DIR}/";
mkdir boot;
mkdir -p boot;

cp ${K230_SDK_ROOT}/buildroot-overlay/board/canaan/k230-soc/rootfs_overlay/boot/nuttx-7000000-uart2.bin boot/;
cp Image boot/;
${UBOOT_BUILD_DIR}/tools/mkimage -A riscv -O linux -T kernel -C none -a 0 -e 0 -n linux -d ${BINARIES_DIR}/fw_jump.bin boot/fw_jump_add_uboot_head.bin
[ ! -f "Image_ilp32" ] || cp Image_ilp32 boot/;
cp ${DTB} boot;
cd boot; rm -rf k.dtb;ln -s ${DTB} k.dtb; cd -;
${UBOOT_BUILD_DIR}/tools/mkimage -A riscv -O linux -T kernel -C none -a 0 -e 0 -n linux -d ${BINARIES_DIR}/fw_jump.bin boot/fw_jump_add_uboot_head.bin
rm -rf boot.ext4 ;fakeroot mkfs.ext4 -d boot -r 1 -N 0 -m 1 -L "boot" -O ^64bit boot.ext4 45M
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#############SDK VERSION######################################
sdk:v0.1-20240606-114414-wangjianxin-develop-5bc8e1c
sdk:v0.2-20240722-041214-wangjianxin-k230-a402e06
##############################################################
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@
(IO44) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO38_IO49<<MSC | 0<<IE | 1<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST )
(IO45) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO38_IO49<<MSC | 1<<IE | 0<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST )

// IIC0 -> CAM
(IO48) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO38_IO49<<MSC | 0<<IE | 1<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST )
(IO49) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO38_IO49<<MSC | 1<<IE | 0<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST )
//iic0
(IO48) ( 3<<SEL | 0<<SL | BANK_VOLTAGE_IO38_IO49<<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 7<<DS | 1<<ST )
(IO49) ( 3<<SEL | 0<<SL | BANK_VOLTAGE_IO38_IO49<<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 7<<DS | 1<<ST )

// JP1-PIN24
(IO59) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO50_IO61<<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 7<<DS | 1<<ST )
Expand All @@ -162,4 +162,4 @@
(IO63) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO62_IO63<<MSC | 0<<IE | 1<<OE | 0<<PU | 1<<PD | 4<<DS | 1<<ST )
>;
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
/* Copyright (c) 2023, Canaan Bright Sight Co., Ltd
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/dts-v1/;
#include <dt-bindings/pinctrl/k230_evb.h>
#define BANK_VOLTAGE_IO0_IO1 K230_MSC_1V8 // FIXED
#define BANK_VOLTAGE_IO2_IO13 K230_MSC_3V3
#define BANK_VOLTAGE_IO14_IO25 K230_MSC_3V3
#define BANK_VOLTAGE_IO26_IO37 K230_MSC_3V3
#define BANK_VOLTAGE_IO38_IO49 K230_MSC_3V3
#define BANK_VOLTAGE_IO50_IO61 K230_MSC_3V3
#define BANK_VOLTAGE_IO62_IO63 K230_MSC_3V3
#include "k230d.dtsi"

/ {
model = "kendryte k230d canmv";
compatible = "kendryte,k230d_canmv";

memory@0 {
device_type = "memory";
reg = <
0x0 0 0x0 0x7000000 /*MEM_LINUX_SYS*/
0x0 0x7000000 0 0x1000000 /*nuttx*/
>;
};
};

&mmc0 {
status = "okay";
};

&mmc1 {
status = "okay";
};

&usbotg0 {
status = "okay";
};

&iomux {
pinctrl-names = "default";
pinctrl-0 = <&drop_pins &pins>;

// Please pay attention to the bank voltage! will damage the chip.
pins: iomux_pins {
u-boot,dm-pre-reloc;
pinctrl-single,pins = <

// SW3 KEY
(IO0 ) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO0_IO1 <<MSC | 1<<IE | 0<<OE | 1<<PU | 0<<PD | 2<<DS | 0<<ST )
(IO1 ) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO0_IO1 <<MSC | 1<<IE | 0<<OE | 1<<PU | 0<<PD | 2<<DS | 0<<ST )

//jp1-pin15
(IO2 ) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO2_IO13 <<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 4<<DS | 0<<ST )

//jp1-pin8,10 GPIO3/JTAG_TDI/PULSE_CNTR1/UART1_TXD/TEST_PIN0
(IO3 ) ( 3<<SEL | 0<<SL | BANK_VOLTAGE_IO2_IO13 <<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 4<<DS | 1<<ST )
(IO4 ) ( 3<<SEL | 0<<SL | BANK_VOLTAGE_IO2_IO13 <<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 4<<DS | 1<<ST )

//jp1-pin7
(IO5 ) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO2_IO13 <<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 4<<DS | 0<<ST )
//jp1-13,gpio
(IO6 ) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO2_IO13 <<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 4<<DS | 0<<ST )

// IIC4 -> CAM0
(IO7 ) ( 2<<SEL | 0<<SL | BANK_VOLTAGE_IO2_IO13 <<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 7<<DS | 1<<ST ) //GPIO7/PWM2/IIC4_SCL/TEST_PIN3/DI0
(IO8 ) ( 2<<SEL | 0<<SL | BANK_VOLTAGE_IO2_IO13 <<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 7<<DS | 1<<ST ) //GPIO8/PWM3/IIC4_SDA/TEST_PIN4/DI1
//jp1-pin18 gpio
(IO10) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO2_IO13 <<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 8<<DS | 0<<ST )

//jp1-pin3,5 bp,iic2,clk,data
(IO11) ( 3<<SEL | 0<<SL | BANK_VOLTAGE_IO2_IO13 <<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 8<<DS | 1<<ST )
(IO12) ( 3<<SEL | 0<<SL | BANK_VOLTAGE_IO2_IO13 <<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 8<<DS | 1<<ST )

// M_CLK
(IO13) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO2_IO13 <<MSC | 0<<IE | 1<<OE | 0<<PU | 1<<PD | 4<<DS | 1<<ST )

//jp1-pin24 gpio
(IO14) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO14_IO25<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 15<<DS | 1<<ST ) //GPIO14/OSPI_CS/TEST_PIN5/QSPI0_CS0/DO3

// JP1-PIN23,19,21,---
(IO15) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO14_IO25<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 15<<DS | 1<<ST )
(IO16) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO14_IO25<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 15<<DS | 1<<ST )
(IO17) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO14_IO25<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 15<<DS | 1<<ST )

// GPIO18/OSPI_D2/QSPI1_CS2/QSPI0_D2/CO0
(IO18) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO14_IO25<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 15<<DS | 1<<ST )
// JP1-PIN11--spice1
(IO19) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO14_IO25<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 15<<DS | 1<<ST )
//pwm, GPIO20/OSPI_D4/QSPI1_CS0/PULSE_CNTR0/TEST_PIN5
(IO20) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO14_IO25<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 15<<DS | 1<<ST )
// CAM1_GPIO
(IO21) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO14_IO25<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 15<<DS | 1<<ST )
// TP_INT
(IO22) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO14_IO25<<MSC | 1<<IE | 0<<OE | 0<<PU | 0<<PD | 15<<DS | 1<<ST )
//jp1-pin35, pwm, GPIO23/OSPI_D7/QSPI1_D1/PULSE_CNTR3/TEST_PIN8
(IO23) ( 3<<SEL | 0<<SL | BANK_VOLTAGE_IO14_IO25<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 15<<DS | 1<<ST )
// jp1-pin29,31------gpio
(IO24) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO14_IO25<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST )
(IO25) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO14_IO25<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST )

// SD
(IO26) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO26_IO37<<MSC | 0<<IE | 1<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST )//clk
(IO27) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO26_IO37<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST ) //cmd
(IO28) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO26_IO37<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST ) //d0
(IO29) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO26_IO37<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST )
(IO30) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO26_IO37<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST )
(IO31) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO26_IO37<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST ) //d3

//GPIO32/IIC0_SCL/IIS_CLK/UART3_TXD/TEST_PIN12
(IO32) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO26_IO37<<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 4<<DS | 1<<ST )
//jp1-27,iicd, GPIO33/IIC0_SDA/IIS_WS/UART3_RXD/TEST_PIN13
(IO33) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO26_IO37<<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 4<<DS | 1<<ST )

(IO34) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO26_IO37<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 4<<DS | 0<<ST )
(IO35) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO26_IO37<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 4<<DS | 0<<ST )

//tp reset, lcd_reset;-----[k230zeor]iic3--tp,
(IO36) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO26_IO37<<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 7<<DS | 1<<ST )
(IO37) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO26_IO37<<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 7<<DS | 1<<ST )

// UART0
(IO38) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO38_IO49<<MSC | 0<<IE | 1<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST )
(IO39) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO38_IO49<<MSC | 1<<IE | 0<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST ) //GPIO39/UART0_RXD/TEST_PIN9/QSPI1_CLK/VSYNC0

// IIC1 -> CAM
(IO40) ( 2<<SEL | 0<<SL | BANK_VOLTAGE_IO38_IO49<<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 7<<DS | 1<<ST )
(IO41) ( 2<<SEL | 0<<SL | BANK_VOLTAGE_IO38_IO49<<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 7<<DS | 1<<ST )

// UART2
(IO44) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO38_IO49<<MSC | 0<<IE | 1<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST )
(IO45) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO38_IO49<<MSC | 1<<IE | 0<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST )

//iic0
(IO48) ( 3<<SEL | 0<<SL | BANK_VOLTAGE_IO38_IO49<<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 7<<DS | 1<<ST )
(IO49) ( 3<<SEL | 0<<SL | BANK_VOLTAGE_IO38_IO49<<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 7<<DS | 1<<ST )

// bp not use
(IO59) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO50_IO61<<MSC | 1<<IE | 1<<OE | 1<<PU | 0<<PD | 7<<DS | 1<<ST )
// JP1-PIN33, pwm, GPIO60/PWM0/IIC0_SCL/QSPI0_CS2/HSYNC1
(IO60) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO50_IO61<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 7<<DS | 1<<ST )
// GPIO61/PWM1/IIC0_SDA/QSPI0_CS1/VSYNC1,pwm
(IO61) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO50_IO61<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 7<<DS | 0<<ST )

// gpio
(IO62) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO62_IO63<<MSC | 1<<IE | 1<<OE | 0<<PU | 1<<PD | 4<<DS | 1<<ST )
//jp1-pin37,gpio, GPIO63/M_CLK3/UART3_RE/TEST_PIN15
(IO63) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO62_IO63<<MSC | 0<<IE | 1<<OE | 0<<PU | 1<<PD | 4<<DS | 1<<ST )
>;
};
};
Loading

0 comments on commit abfaa92

Please sign in to comment.