5dd3b7427a
* bsp: cvitek: kconfig: add wdt for cv18xx_riscv Add Watchdog timer in Kconfig. Signed-off-by: Chen Wang <unicorn_wang@outlook.com> * drv: cvitek: remove using macro from source file Building of source file should be controlled by SConscript, but not in source file itself. Signed-off-by: Chen Wang <unicorn_wang@outlook.com> * bsp: cvitek: kconfig: add i2c for cv18xx_riscv Add I2C in Kconfig for c906B. Note, the IRQ# is different from that of c906L. Signed-off-by: Chen Wang <unicorn_wang@outlook.com> * bsp: cvitek: kconfig: add rtc for cv18xx_riscv Add RTC in Kconfig for c906B. Signed-off-by: Chen Wang <unicorn_wang@outlook.com> * bsp: cvitek: fix channel issue for pwm driver The original code confuses the concepts of controllers and channels. Fixed it and do some code cleanup. Signed-off-by: Chen Wang <unicorn_wang@outlook.com> * bsp:cvitek: add i2c pinmux config for cv18xx_riscv Pinmux in driver code is controlled by SOC type, bcos driver code should be general and support all pins defined by SoC. Pinmux configuration in Kconfig is controlled by BOARD type, bcos when we operate on board, it does not expose all chip-level pin signals and we can only use part of them. Following is I2C signals exported by duo family. Details see https://milkv.io/docs/duo/overview. Note: we have not added support for duo-S. Duo === NAME I2C CV1800B/GPIO <PINNAME>__<FUNCNAME> ---- --- ------------ --------------------- GP0 I2C0_SCL XGPIOA[28] IIC0_SCL__IIC0_SCL GP1 I2C0_SDA XGPIOA[29] IIC0_SDA__IIC0_SDA GP4 I2C1_SCL PWR_GPIO[19] SD1_D2__IIC1_SCL GP9 I2C1_SCL PWR_GPIO[18] SD1_D3__IIC1_SCL GP11 I2C1_SCL XGPIOC[10] PAD_MIPIRX0N__IIC1_SCL GP5 I2C1_SDA PWR_GPIO[20] SD1_D1__IIC1_SDA GP8 I2C1_SDA PWR_GPIO[21] SD1_D0__IIC1_SDA GP10 I2C1_SDA XGPIOC[9] PAD_MIPIRX1P__IIC1_SDA GP7 I2C3_SCL PWR_GPIO[22] SD1_CMD__IIC3_SCL GP6 I2C3_SDA PWR_GPIO[23] SD1_CLK__IIC3_SDA Duo 256m ======== NAME I2C CV1800B/GPIO <PINNAME>__<FUNCNAME> ---- --- ------------ --------------------- GP4 I2C1_SCL PWR_GPIO[19] SD1_D2__IIC1_SCL GP9 I2C1_SCL PWR_GPIO[18] SD1_D3__IIC1_SCL GP5 I2C1_SDA PWR_GPIO[20] SD1_D1__IIC1_SDA GP8 I2C1_SDA PWR_GPIO[21] SD1_D0__IIC1_SDA GP11 I2C2_SCL XGPIOC[15] PAD_MIPI_TXP1__IIC2_SCL GP10 I2C2_SDA XGPIOC[14] PAD_MIPI_TXM1__IIC2_SDA GP7 I2C3_SCL PWR_GPIO[22] SD1_CMD__IIC3_SCL GP6 I2C3_SDA PWR_GPIO[23] SD1_CLK__IIC3_SDA Duo S ===== NAME I2C CV1800B/GPIO <PINNAME>__<FUNCNAME> ---- --- ------------ --------------------- J3-B18 I2C1_SCL XGPIOB[18] VIVO_D3__IIC1_SCL J3-B12 I2C1_SCL XGPIOB[12] VIVO_D9__IIC1_SCL J3-B11 I2C1_SDA XGPIOB[11] VIVO_D10__IIC1_SDA J3-B13 I2C2_SCL XGPIOB[13] VIVO_D8__IIC2_SCL J4-E1 I2C2_SCL PWR_GPIO[1] PWR_GPIO1__IIC2_SCL J3-B14 I2C2_SDA XGPIOB[14] VIVO_D7__IIC2_SDA J4-E2 I2C2_SDA PWR_GPIO[2] PWR_GPIO2__IIC2_SDA J3-B20 I2C4_SCL XGPIOB[20] VIVO_D1__IIC4_SCL J4-B1 I2C4_SCL XGPIOB[1] ADC3__IIC4_SCL J3-B21 I2C4_SDA XGPIOB[21] VIVO_D0__IIC4_SDA J4-B2 I2C4_SDA XGPIOB[2] ADC2__IIC4_SDA Signed-off-by: Chen Wang <unicorn_wang@outlook.com> Signed-off-by: flyingcys <flyingcys@163.com> * bsp:cvitek: remove using macro from source file for i2c Signed-off-by: Chen Wang <unicorn_wang@outlook.com> * bsp:cvitek: unify menu message text for i2c as other drivers Other dirvers has no extra word "HW". Signed-off-by: Chen Wang <unicorn_wang@outlook.com> * bsp:cvitek: add i2c pinmux config for c906_little Porting what we have done in commit "bsp:cvitek: add i2c pinmux config for cv18xx_riscv" to c906_little. Signed-off-by: Chen Wang <unicorn_wang@outlook.com> --------- Signed-off-by: Chen Wang <unicorn_wang@outlook.com> Signed-off-by: flyingcys <flyingcys@163.com> Co-authored-by: flyingcys <flyingcys@163.com> |
||
---|---|---|
.. | ||
c906_little | ||
cv18xx_aarch64 | ||
cv18xx_risc-v | ||
drivers | ||
.gitignore | ||
README.md | ||
board_env.sh | ||
combine-fip.sh | ||
mkimage | ||
mksdimg.sh |
README.md
cvitek bsp
支持芯片
针对算能系列 RISC-V 芯片的 bsp,包括:
- 大核
芯片名称 | 芯片架构 | 内存大小 | 默认日志串口 | 备注 |
---|---|---|---|---|
cv180x | RISC-V C906 | 64MByte | uart0 | 支持 MMU, 支持 RT-Thread 标准版 和 RT-SMART 模式,默认运行 RT-Thread 标准版本 |
cv181x | RISC-V C906 或 Cortex A53 通过硬件 IO 二选一 | 64MByte | uart0 | 支持 MMU, 支持 RT-Thread 标准版 和 RT-SMART 版,默认运行 RT-Thread 标准版本 |
- 小核
目录 | 内存大小 | 默认日志串口 | 备注 |
---|---|---|---|
c906-little | 与大核共享 | uart1 | 无 MMU,运行 RT-Thread 标准版 |
注:异构芯片需单独编译每个核的 OS
编译
异构芯片需单独编译每个核的 OS,在大/小核对应的目录下,依次执行:
- 开发板选择 Linux平台下,可以先执行:
$ scons --menuconfig
选择当前需要编译的目标开发板类型
Board Type (milkv-duo) --->
( ) milkv-duo
( ) milkv-duo-spinor
(X) milkv-duo256m
( ) milkv-duo256m-spinor
- 编译
$ scons
运行
编译成功后,会在 bsp/cvitek/output
对应开发板型号目录下自动生成 fip.bin
和 boot.sd
文件,其中大核运行文件在 boot.sd
中,小核的运行文件在 fip.bin
中。
- 将 SD 卡分为 2 个分区,第 1 个分区用于存放 bin 文件,第 2 个分区用于作为数据存储分区,分区格式为
FAT32
。 - 将根目录下的
fip.bin
和boot.sd
复制 SD 卡第一个分区中。- fip.bin:fsbl、 opensbi、uboot、小核运行文件打包后的 bin 文件
- boot.sd:大核打包后的 bin 文件
驱动支持列表
驱动 | 支持情况 | 备注 |
---|---|---|
uart | 支持 | 默认波特率115200 |
gpio | 支持 | |
i2c | 支持 | |
adc | 支持 | |
spi | 支持 | 默认CS引脚,每个数据之间CS会拉高,请根据时序选择GPIO作为CS。若读取数据,tx需持续dummy数据。 |
pwm | 支持 | |
timer | 支持 | |
wdt | 支持 | |
sdio | 支持 | |
eth | 支持 |
支持开发板
- milk-v duo: https://milkv.io/duo
- milk-v duo256m: https://milkv.io/duo256m
FAQ
-
如遇到不能正常编译,请先使用
scons --menuconfig
重新生成配置。 -
错误:./mkimage: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
可在 http://security.ubuntu.com/ubuntu/pool/main/o/openssl 下载 libssl1.1_1.1.1f-1ubuntu2_amd64.deb
文件后安装即可解决。
或使用以下命令下载安装:
$ wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
$ sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
- 如发现切换开发板编译正常,但无法正常打包,请切换至自动下载的
cvi_bootloader
目录,并手工运行git pull
更新,或删除该目录后重新自动下载。
联系人信息
维护人:flyingcys
更多信息请参考 https://riscv-rtthread-programming-manual.readthedocs.io