您尚未登录。

楼主 #1 2020-12-05 12:56:41

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

全志V831芯片裸机开发日记--移植V831到xboot

全志V831,带有一个0.2T的NPU,cortex-A7单核,内置64M DDR2,基本跟V3S类似,主要差异是,这个芯片用QFN88来封装,跟F1C100S的一致,还有一个就是NPU了,主频比V3S低200M,只到800M。QFN88封装的CORTEX-A7,应该是市面上唯一的一颗了。





先计划在xboot平台支持这个芯片,这个帖子作为项目开发记录,有什么进展都发布在此贴子下,比较有挑战的地方就是DDR初始化了,这个现在没找到任何参考,估计到时只能猜测了。

离线

#2 2020-12-05 12:57:14

微凉VeiLiang
会员
所在地: 深圳
注册时间: 2018-10-28
已发帖子: 562
积分: 501
个人网站

Re: 全志V831芯片裸机开发日记--移植V831到xboot

前排支持xboot大佬

离线

#3 2020-12-05 12:57:34

aozima
会员
所在地: 深圳
注册时间: 2019-05-25
已发帖子: 298
积分: 179.5
个人网站

Re: 全志V831芯片裸机开发日记--移植V831到xboot

前排支持

离线

#4 2020-12-05 12:58:06

微凉VeiLiang
会员
所在地: 深圳
注册时间: 2018-10-28
已发帖子: 562
积分: 501
个人网站

Re: 全志V831芯片裸机开发日记--移植V831到xboot

有板子或者芯片卖么

离线

楼主 #5 2020-12-05 13:00:03

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

昨天拿到板子,第一时间试跑了下Tina系统,没有太大问题,也能顺利进入uboot命令行,有这个可以加快驱动的开发工作。
开发的bsp包,放置在下面这个路径
https://github.com/xboot/xboot/tree/master/src/arch/arm32/mach-v831

离线

楼主 #6 2020-12-05 13:04:08

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

通过uboot的ymodem,传输xboot到DDR,然go命令执行xboot,顺利启动。
在写这个帖子时,已完成时钟树配置,reset驱动,gpio驱动,中断驱动。
自举引导这个现在是不支持的。

        _                   _                     
 _  _ | |___ _____ _____ _| |_                   
\ \/ /|  _  |  _  |  _  |_   _|  (C) 2007-2020   
 )  ( | |_| | |_| | |_| | | |____JIANJUN.JIANG__ 
/_/\_\|_____|_____|_____| |_____________________|
V3.0.0 (Dec  5 2020 - 12:04:01) - [sipeed][Sipeed(Maix-II) Based On Allwinner V831 SOC]
[    0.000000] Probe device 'blk-romdisk.0' with blk-romdisk
[    0.000010] Probe device 'losc' with clk-fixed
[    0.000020] Probe device 'iosc' with clk-fixed
[    0.000030] Probe device 'osc24m' with clk-fixed
[    0.000040] Probe device 'pll-periph0div25m' with clk-fixed
[    0.000050] Probe device 'osc48m' with clk-fixed
[    0.000060] Probe device 'pll-cpux' with clk-v831-pll
[    0.000070] Probe device 'pll-ddr0' with clk-v831-pll
[    0.000080] Probe device 'pll-periph0' with clk-v831-pll
[    0.000090] Probe device 'pll-uni' with clk-v831-pll
[    0.000100] Probe device 'pll-video0' with clk-v831-pll
[    0.000110] Probe device 'pll-audio' with clk-v831-pll
[    0.000120] Probe device 'pll-csi' with clk-v831-pll
[    0.000130] Probe device 'pll-periph0x2' with clk-fixed-factor
[    0.000140] Probe device 'periph32k' with clk-fixed-factor
[    0.000150] Probe device 'pll-unix2' with clk-fixed-factor
[    0.000160] Probe device 'pll-audiox4' with clk-fixed-factor
[    0.000170] Probe device 'pll-audiox2' with clk-fixed-factor
[    0.000180] Probe device 'pll-video0x4' with clk-fixed-factor
[    0.000190] Probe device 'mbus' with clk-fixed-factor
[    0.000200] Probe device 'osc24m-2' with clk-fixed-factor
[    0.000210] Probe device 'osc24m-750' with clk-fixed-factor
[    0.000220] Probe device 'osc48m-4' with clk-fixed-factor
[    0.000230] Probe device 'cpu' with clk-mux
[    0.000240] Probe device 'axi' with clk-divider
[    0.000250] Probe device 'cpuapb' with clk-ratio
[    0.000260] Probe device 'mux-psi' with clk-mux
[    0.000270] Probe device 'div-psi' with clk-divider
[    0.000280] Probe device 'radio-psi' with clk-ratio
[    0.000290] Probe device 'psi' with clk-gate
[    0.000300] Probe device 'ahb1' with clk-link
[    0.000310] Probe device 'ahb2' with clk-link
[    0.000320] Probe device 'mux-ahb3' with clk-mux
[    0.000330] Probe device 'div-ahb3' with clk-divider
[    0.000340] Probe device 'ahb3' with clk-ratio
[    0.000350] Probe device 'mux-apb1' with clk-mux
[    0.000360] Probe device 'div-apb1' with clk-divider
[    0.000370] Probe device 'apb1' with clk-ratio
[    0.000380] Probe device 'mux-apb2' with clk-mux
[    0.000390] Probe device 'div-apb2' with clk-divider
[    0.000400] Probe device 'apb2' with clk-ratio
[    0.000410] Probe device 'mux-de' with clk-mux
[    0.000420] Probe device 'div-de' with clk-divider
[    0.000430] Probe device 'gate-de' with clk-gate
[    0.000440] Probe device 'de' with clk-gate
[    0.000450] Probe device 'mux-g2d' with clk-mux
[    0.000460] Probe device 'div-g2d' with clk-divider
[    0.000470] Probe device 'gate-g2d' with clk-gate
[    0.000480] Probe device 'g2d' with clk-gate
[    0.000490] Probe device 'mux-ce' with clk-mux
[    0.000500] Probe device 'div-ce' with clk-divider
[    0.000510] Probe device 'radio-ce' with clk-ratio
[    0.000520] Probe device 'gate-ce' with clk-gate
[    0.000530] Probe device 'ce' with clk-gate
[    0.000540] Probe device 'mux-ve' with clk-mux
[    0.000550] Probe device 'div-ve' with clk-divider
[    0.000560] Probe device 'gate-ve' with clk-gate
[    0.000570] Probe device 've' with clk-gate
[    0.000580] Probe device 'mux-eise' with clk-mux
[    0.000590] Probe device 'div-eise' with clk-divider
[    0.000600] Probe device 'gate-eise' with clk-gate
[    0.000610] Probe device 'eise' with clk-gate
[    0.000620] Probe device 'mux-nna' with clk-mux
[    0.000630] Probe device 'div-nna' with clk-divider
[    0.000640] Probe device 'gate-nna' with clk-gate
[    0.000650] Probe device 'nna' with clk-gate
[    0.000660] Probe device 'dma' with clk-gate
[    0.000670] Probe device 'hstimer' with clk-gate
[    0.000680] Probe device 'avs' with clk-gate
[    0.000690] Probe device 'dbgsys' with clk-gate
[    0.000700] Probe device 'pwm' with clk-gate
[    0.000710] Probe device 'mux-sdram' with clk-mux
[    0.000720] Probe device 'div-sdram' with clk-divider
[    0.000730] Probe device 'sdram' with clk-gate
[    0.000740] Probe device 'mux-sdmmc0' with clk-mux
[    0.000750] Probe device 'div-sdmmc0' with clk-divider
[    0.000760] Probe device 'radio-sdmmc0' with clk-ratio
[    0.000770] Probe device 'gate-sdmmc0' with clk-gate
[    0.000780] Probe device 'sdmmc0' with clk-gate
[    0.000790] Probe device 'mux-sdmmc1' with clk-mux
[    0.000800] Probe device 'div-sdmmc1' with clk-divider
[    0.000810] Probe device 'radio-sdmmc1' with clk-ratio
[    0.000820] Probe device 'gate-sdmmc1' with clk-gate
[    0.000830] Probe device 'sdmmc1' with clk-gate
[    0.000840] Probe device 'mux-sdmmc2' with clk-mux
[    0.000850] Probe device 'div-sdmmc2' with clk-divider
[    0.000860] Probe device 'radio-sdmmc2' with clk-ratio
[    0.000870] Probe device 'gate-sdmmc2' with clk-gate
[    0.000880] Probe device 'sdmmc2' with clk-gate
[    0.000890] Probe device 'uart0' with clk-gate
[    0.000900] Probe device 'uart1' with clk-gate
[    0.000910] Probe device 'uart2' with clk-gate
[    0.000920] Probe device 'uart3' with clk-gate
[    0.000930] Probe device 'twi0' with clk-gate
[    0.000940] Probe device 'twi1' with clk-gate
[    0.000950] Probe device 'twi2' with clk-gate
[    0.000960] Probe device 'twi3' with clk-gate
[    0.000970] Probe device 'mux-spi0' with clk-mux
[    0.000980] Probe device 'div-spi0' with clk-divider
[    0.000990] Probe device 'radio-spi0' with clk-ratio
[    0.001000] Probe device 'gate-spi0' with clk-gate
[    0.001010] Probe device 'spi0' with clk-gate
[    0.001020] Probe device 'mux-spi1' with clk-mux
[    0.001030] Probe device 'div-spi1' with clk-divider
[    0.001040] Probe device 'radio-spi1' with clk-ratio
[    0.001050] Probe device 'gate-spi1' with clk-gate
[    0.001060] Probe device 'spi1' with clk-gate
[    0.001070] Probe device 'mux-spi2' with clk-mux
[    0.001080] Probe device 'div-spi2' with clk-divider
[    0.001090] Probe device 'radio-spi2' with clk-ratio
[    0.001100] Probe device 'gate-spi2' with clk-gate
[    0.001110] Probe device 'spi2' with clk-gate
[    0.001120] Probe device 'gate-ephy' with clk-gate
[    0.001130] Probe device 'ephy' with clk-gate
[    0.001140] Probe device 'gmac' with clk-gate
[    0.001150] Probe device 'gpadc' with clk-gate
[    0.001160] Probe device 'ths' with clk-gate
[    0.001170] Probe device 'mux-i2s0' with clk-mux
[    0.001180] Probe device 'radio-i2s0' with clk-ratio
[    0.001190] Probe device 'gate-i2s0' with clk-gate
[    0.001200] Probe device 'i2s0' with clk-gate
[    0.001210] Probe device 'mux-i2s1' with clk-mux
[    0.001220] Probe device 'radio-i2s1' with clk-ratio
[    0.001230] Probe device 'gate-i2s1' with clk-gate
[    0.001240] Probe device 'i2s1' with clk-gate
[    0.001250] Probe device 'mux-codec1x' with clk-mux
[    0.001260] Probe device 'div-codec1x' with clk-divider
[    0.001270] Probe device 'gate-codec1x' with clk-gate
[    0.001280] Probe device 'codec1x' with clk-gate
[    0.001290] Probe device 'mux-codec4x' with clk-mux
[    0.001300] Probe device 'div-codec4x' with clk-divider
[    0.001310] Probe device 'gate-codec4x' with clk-gate
[    0.001320] Probe device 'codec4x' with clk-gate
[    0.001330] Probe device 'mux-usbohci0' with clk-mux
[    0.001340] Probe device 'usbphy0' with clk-gate
[    0.001350] Probe device 'gate-usbohci0' with clk-gate
[    0.001360] Probe device 'usbohci0' with clk-gate
[    0.001370] Probe device 'usbehci0' with clk-gate
[    0.001380] Probe device 'usbotg' with clk-gate
[    0.001390] Probe device 'mux-mipidphy0' with clk-mux
[    0.001400] Probe device 'div-mipidphy0' with clk-divider
[    0.001410] Probe device 'radio-mipidphy0' with clk-ratio
[    0.001420] Probe device 'gate-mipidphy0' with clk-gate
[    0.001430] Probe device 'mipidphy0' with clk-gate
[    0.001440] Probe device 'mux-mipihost0' with clk-mux
[    0.001450] Probe device 'div-mipihost0' with clk-divider
[    0.001460] Probe device 'gate-mipihost0' with clk-gate
[    0.001470] Probe device 'mipihost0' with clk-gate
[    0.001480] Probe device 'displaytop' with clk-gate
[    0.001490] Probe device 'mux-tcon' with clk-mux
[    0.001500] Probe device 'gate-tcon' with clk-gate
[    0.001510] Probe device 'tcon' with clk-gate
[    0.001520] Probe device 'mux-csitop' with clk-mux
[    0.001530] Probe device 'div-csitop' with clk-divider
[    0.001540] Probe device 'gate-csitop' with clk-gate
[    0.001550] Probe device 'csitop' with clk-gate
[    0.001560] Probe device 'mux-csimaster0' with clk-mux
[    0.001570] Probe device 'div-csimaster0' with clk-divider
[    0.001580] Probe device 'gate-csimaster0' with clk-gate
[    0.001590] Probe device 'csimaster0' with clk-gate
[    0.001600] Probe device 'mux-csimaster1' with clk-mux
[    0.001610] Probe device 'div-csimaster1' with clk-divider
[    0.001620] Probe device 'gate-csimaster1' with clk-gate
[    0.001630] Probe device 'csimaster1' with clk-gate
[    0.001640] Probe device 'mux-isp' with clk-mux
[    0.001650] Probe device 'div-isp' with clk-divider
[    0.001660] Probe device 'isp' with clk-gate
[    0.001670] Probe device 'mux-dspo' with clk-mux
[    0.001680] Probe device 'div-dspo' with clk-divider
[    0.001690] Probe device 'radio-dspo' with clk-ratio
[    0.001700] Probe device 'gate-dspo' with clk-gate
[    0.001710] Probe device 'dspo' with clk-gate
[    0.001720] Probe device 'pio' with clk-link
[    0.001730] Probe device 'wdg' with clk-link
[    0.001740] Probe device 'reset-v831.0' with reset-v831                          
[    0.001750] Probe device 'reset-v831.1' with reset-v831                         
[    0.001760] Probe device 'reset-v831.2' with reset-v831                           
[    0.001770] Probe device 'reset-v831.3' with reset-v831                          
[    0.001780] Probe device 'reset-v831.4' with reset-v831                          
[    0.001790] Probe device 'reset-v831.5' with reset-v831
[    0.001800] Probe device 'reset-v831.6' with reset-v831
[    0.001810] Probe device 'reset-v831.7' with reset-v831
[    0.001820] Probe device 'reset-v831.8' with reset-v831
[    0.001830] Probe device 'reset-v831.9' with reset-v831
[    0.001840] Probe device 'reset-v831.10' with reset-v831
[    0.001850] Probe device 'reset-v831.11' with reset-v831
[    0.001860] Probe device 'reset-v831.12' with reset-v831
[    0.001870] Probe device 'reset-v831.13' with reset-v831
[    0.001880] Probe device 'reset-v831.14' with reset-v831
[    0.001890] Probe device 'reset-v831.15' with reset-v831
[    0.001900] Probe device 'reset-v831.16' with reset-v831
[    0.001910] Probe device 'reset-v831.17' with reset-v831
[    0.001920] Probe device 'reset-v831.18' with reset-v831
[    0.001930] Probe device 'reset-v831.19' with reset-v831
[    0.001940] Probe device 'reset-v831.20' with reset-v831
[    0.001950] Probe device 'reset-v831.21' with reset-v831
[    0.001960] Probe device 'reset-v831.22' with reset-v831
[    0.001970] Probe device 'reset-v831.23' with reset-v831
[    0.001980] Probe device 'reset-v831.24' with reset-v831
[    0.001990] Probe device 'reset-v831.25' with reset-v831
[    0.002000] Probe device 'reset-v831.26' with reset-v831
[    0.002010] Probe device 'irq-gic400.0' with irq-gic400
[    0.002020] Probe device 'gpio-v831.0' with gpio-v831
[    0.002030] Probe device 'gpio-v831.1' with gpio-v831
[    0.002040] Probe device 'gpio-v831.2' with gpio-v831
[    0.002050] Probe device 'gpio-v831.3' with gpio-v831
[    0.002060] Probe device 'gpio-v831.4' with gpio-v831
[    0.002070] Probe device 'gpio-v831.5' with gpio-v831
[    0.002080] Probe device 'gpio-v831.6' with gpio-v831
[    0.002090] Probe device 'gpio-v831.7' with gpio-v831
[    0.002100] Probe device 'uart-16550.0' with uart-16550
[    0.002110] Probe device 'uart-16550.1' with uart-16550
[    0.002120] Probe device 'uart-16550.2' with uart-16550
[    0.002130] Probe device 'uart-16550.3' with uart-16550
[    0.002140] Probe device 'wdg-v831.0' with wdg-v831
[    0.002150] Probe device 'console-uart.0' with console-uart
[    0.002160] mount /private with 'ram' filesystem
xboot: /# 
xboot: /# 

离线

楼主 #7 2020-12-05 13:10:21

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

看门狗驱动测试也是OK的,顺便添加了一个fel命令,这个命令会让V831重启并进入fel模式
本质是设置一个RTC标志,然后V831的BROM在引导时会判断此标志,如果值为0x5aa5a55a,则进入fel模式,在这个模式下,可以通过sunxi-fel命令来烧录芯片。

/*
 * command/cmd-fel.c
 */

#include <xboot.h>
#include <command/command.h>

static void usage(void)
{
	printf("usage:\r\n");
	printf("    fel\r\n");
}

static int do_fel(int argc, char ** argv)
{
	virtual_addr_t virt = phys_to_virt(0x07000000);

	do {
		write32(virt + 0x100 + 0x8, 0x5aa5a55a);
		dsb();
		isb();
	} while(read32(virt + 0x100 + 0x8) != 0x5aa5a55a);

	arm32_interrupt_disable();
	machine_reboot();
	return 0;
}

static struct command_t cmd_fel = {
	.name	= "fel",
	.desc	= "reboot and enter to fel mode",
	.usage	= usage,
	.exec	= do_fel,
};

static __init void fel_cmd_init(void)
{
	register_command(&cmd_fel);
}

static __exit void fel_cmd_exit(void)
{
	unregister_command(&cmd_fel);
}

command_initcall(fel_cmd_init);
command_exitcall(fel_cmd_exit);

离线

楼主 #8 2020-12-05 13:14:28

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

上传一下这个芯片的规格书
V833_V831_Datasheet_V1_1.pdf

离线

楼主 #9 2020-12-05 13:19:01

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

贴一下,reset驱动的编号

#define V831_RESET_DE			(32 *  0 + 16)
#define V831_RESET_G2D			(32 *  1 + 16)
#define V831_RESET_CE			(32 *  2 + 16)
#define V831_RESET_VE			(32 *  3 + 16)
#define V831_RESET_EISE			(32 *  4 + 16)
#define V831_RESET_NPU			(32 *  5 + 16)
#define V831_RESET_DMA			(32 *  6 + 16)
#define V831_RESET_HSTIMER		(32 *  7 + 16)
#define V831_RESET_DBGSYS		(32 *  8 + 16)
#define V831_RESET_PSI			(32 *  9 + 16)
#define V831_RESET_PWM			(32 * 10 + 16)
#define V831_RESET_DRAM			(32 * 11 + 16)
#define V831_RESET_SMHC0		(32 * 12 + 16)
#define V831_RESET_SMHC1		(32 * 12 + 17)
#define V831_RESET_SMHC2		(32 * 12 + 18)
#define V831_RESET_UART0		(32 * 13 + 16)
#define V831_RESET_UART1		(32 * 13 + 17)
#define V831_RESET_UART2		(32 * 13 + 18)
#define V831_RESET_UART3		(32 * 13 + 19)
#define V831_RESET_TWI0			(32 * 14 + 16)
#define V831_RESET_TWI1			(32 * 14 + 17)
#define V831_RESET_TWI2			(32 * 14 + 18)
#define V831_RESET_TWI3			(32 * 14 + 19)
#define V831_RESET_SPI0			(32 * 15 + 16)
#define V831_RESET_SPI1			(32 * 15 + 17)
#define V831_RESET_SPI2			(32 * 15 + 18)
#define V831_RESET_EMAC			(32 * 16 + 16)
#define V831_RESET_GPADC		(32 * 17 + 16)
#define V831_RESET_THS			(32 * 18 + 16)
#define V831_RESET_I2S0			(32 * 19 + 16)
#define V831_RESET_I2S1			(32 * 19 + 17)
#define V831_RESET_CODEC		(32 * 20 + 16)
#define V831_RESET_USBOHCI0		(32 * 21 + 16)
#define V831_RESET_USBEHCI0		(32 * 21 + 20)
#define V831_RESET_USBOTG		(32 * 21 + 24)
#define V831_RESET_MIPI_DSI		(32 * 22 + 16)
#define V831_RESET_DISPLAY_TOP	(32 * 23 + 16)
#define V831_RESET_TCON			(32 * 24 + 16)
#define V831_RESET_CSI			(32 * 25 + 16)
#define V831_RESET_DSPO			(32 * 26 + 16)

离线

楼主 #10 2020-12-05 13:21:24

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

GPIO驱动的编号,V831跟V833是同一个DIE,但V831有很多GPIO没有引出,这里编写驱动时是按V833的pin脚来定义的。V831中有很多GPIO无法使用。

#define V831_GPIOC0			(64 + 0)
#define V831_GPIOC1			(64 + 1)
#define V831_GPIOC2			(64 + 2)
#define V831_GPIOC3			(64 + 3)
#define V831_GPIOC4			(64 + 4)
#define V831_GPIOC5			(64 + 5)
#define V831_GPIOC6			(64 + 6)
#define V831_GPIOC7			(64 + 7)
#define V831_GPIOC8			(64 + 8)
#define V831_GPIOC9			(64 + 9)
#define V831_GPIOC10		(64 + 10)
#define V831_GPIOC11		(64 + 11)

#define V831_GPIOD0			(96 + 0)
#define V831_GPIOD1			(96 + 1)
#define V831_GPIOD2			(96 + 2)
#define V831_GPIOD3			(96 + 3)
#define V831_GPIOD4			(96 + 4)
#define V831_GPIOD5			(96 + 5)
#define V831_GPIOD6			(96 + 6)
#define V831_GPIOD7			(96 + 7)
#define V831_GPIOD8			(96 + 8)
#define V831_GPIOD9			(96 + 9)
#define V831_GPIOD10		(96 + 10)
#define V831_GPIOD11		(96 + 11)
#define V831_GPIOD12		(96 + 12)
#define V831_GPIOD13		(96 + 13)
#define V831_GPIOD14		(96 + 14)
#define V831_GPIOD15		(96 + 15)
#define V831_GPIOD16		(96 + 16)
#define V831_GPIOD17		(96 + 17)
#define V831_GPIOD18		(96 + 18)
#define V831_GPIOD19		(96 + 19)
#define V831_GPIOD20		(96 + 20)
#define V831_GPIOD21		(96 + 21)
#define V831_GPIOD22		(96 + 22)

#define V831_GPIOE0			(128 + 0)
#define V831_GPIOE1			(128 + 1)
#define V831_GPIOE2			(128 + 2)
#define V831_GPIOE3			(128 + 3)
#define V831_GPIOE4			(128 + 4)
#define V831_GPIOE5			(128 + 5)
#define V831_GPIOE6			(128 + 6)
#define V831_GPIOE7			(128 + 7)
#define V831_GPIOE8			(128 + 8)
#define V831_GPIOE9			(128 + 9)
#define V831_GPIOE10		(128 + 10)
#define V831_GPIOE11		(128 + 11)
#define V831_GPIOE12		(128 + 12)
#define V831_GPIOE13		(128 + 13)
#define V831_GPIOE14		(128 + 14)
#define V831_GPIOE15		(128 + 15)
#define V831_GPIOE16		(128 + 16)
#define V831_GPIOE17		(128 + 17)
#define V831_GPIOE18		(128 + 18)
#define V831_GPIOE19		(128 + 19)
#define V831_GPIOE20		(128 + 20)
#define V831_GPIOE21		(128 + 21)

#define V831_GPIOF0			(160 + 0)
#define V831_GPIOF1			(160 + 1)
#define V831_GPIOF2			(160 + 2)
#define V831_GPIOF3			(160 + 3)
#define V831_GPIOF4			(160 + 4)
#define V831_GPIOF5			(160 + 5)
#define V831_GPIOF6			(160 + 6)

#define V831_GPIOG0			(192 + 0)
#define V831_GPIOG1			(192 + 1)
#define V831_GPIOG2			(192 + 2)
#define V831_GPIOG3			(192 + 3)
#define V831_GPIOG4			(192 + 4)
#define V831_GPIOG5			(192 + 5)
#define V831_GPIOG6			(192 + 6)
#define V831_GPIOG7			(192 + 7)

#define V831_GPIOH0			(224 + 0)
#define V831_GPIOH1			(224 + 1)
#define V831_GPIOH2			(224 + 2)
#define V831_GPIOH3			(224 + 3)
#define V831_GPIOH4			(224 + 4)
#define V831_GPIOH5			(224 + 5)
#define V831_GPIOH6			(224 + 6)
#define V831_GPIOH7			(224 + 7)
#define V831_GPIOH8			(224 + 8)
#define V831_GPIOH9			(224 + 9)
#define V831_GPIOH10		(224 + 10)
#define V831_GPIOH11		(224 + 11)
#define V831_GPIOH12		(224 + 12)
#define V831_GPIOH13		(224 + 13)
#define V831_GPIOH14		(224 + 14)
#define V831_GPIOH15		(224 + 15)

#define V831_GPIOI0			(256 + 0)
#define V831_GPIOI1			(256 + 1)
#define V831_GPIOI2			(256 + 2)
#define V831_GPIOI3			(256 + 3)
#define V831_GPIOI4			(256 + 4)

#define V831_GPIOL0			(288 + 0)
#define V831_GPIOL1			(288 + 1)
#define V831_GPIOL2			(288 + 2)
#define V831_GPIOL3			(288 + 3)
#define V831_GPIOL4			(288 + 4)
#define V831_GPIOL5			(288 + 5)

离线

#11 2020-12-05 13:38:39

xiaohui
会员
注册时间: 2019-01-15
已发帖子: 245
积分: 168.5

Re: 全志V831芯片裸机开发日记--移植V831到xboot

恭喜大佬,喜开新坑

离线

楼主 #12 2020-12-05 13:44:15

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

这是内核里面的时钟,感觉内核里面的sdram频率计算错误,内核里面计算出来是1056MHZ,然后mbus也跟着计算错误,sdram的时钟频率应该是528MHZ,这个在BOOT0里有打印出。

/sys/kernel/debug/clk# cat clk_summary 
   clock                         enable_cnt  prepare_cnt        rate   accuracy   phase
----------------------------------------------------------------------------------------
 osc48m                                   0            0    48000000          0 0  
    osc48md4                              0            0    12000000          0 0  
       usbohci0_12m                       0            0    12000000          0 0  
 pll_periph0div25m                        0            0    25000000          0 0  
    ephy_25m                              0            0    25000000          0 0  
 hosc                                    13           13    24000000          0 0  
    dcxo_out                              0            0    24000000          0 0  
    spwm                                  0            0    24000000          0 0  
    cpurapbs2                             0            0    24000000          0 0  
    cpurcpus                              1            1    24000000          0 0  
       cpurahbs                           1            1    24000000          0 0  
          cpurapbs1                       1            1    24000000          0 0  
             cpurpio                      1            1    24000000          0 0  
             stwi                         0            0    24000000          0 0  
    csi_master1                           0            0    24000000          0 0  
    csi_master0                           0            0    24000000          0 0  
    mipi_host0                            0            0    24000000          0 0  
    usbphy0                               1            1    24000000          0 0  
    ths                                   0            0    24000000          0 0  
    gpadc                                 1            1    24000000          0 0  
    spi2                                  0            0    24000000          0 0  
    spi1                                  0            0    24000000          0 0  
    spi0                                  0            0    24000000          0 0  
    sdmmc2_rst                            0            0    24000000          0 0  
    sdmmc2_bus                            0            0    24000000          0 0  
    sdmmc2_mod                            0            0    24000000          0 0  
    sdmmc1_rst                            1            1    24000000          0 0  
    sdmmc1_bus                            1            1    24000000          0 0  
    sdmmc0_rst                            1            1    24000000          0 0  
    sdmmc0_bus                            1            1    24000000          0 0  
    dbgsys                                0            0    24000000          0 0  
    avs                                   0            0    24000000          0 0  
    apb2                                  3            3    24000000          0 0  
       twi3                               0            0    24000000          0 0  
       twi2                               1            1    24000000          0 0  
       twi1                               1            1    24000000          0 0  
       twi0                               0            0    24000000          0 0  
       uart3                              0            0    24000000          0 0  
       uart2                              0            0    24000000          0 0  
       uart1                              0            0    24000000          0 0  
       uart0                              1            1    24000000          0 0  
    hoscd2                                0            0    12000000          0 0  
    pll_csi                               0            0   540000000          0 0  
    pll_audio                             2            2    22579200          0 0  
       codec_1x                           1            1    22579200          0 0  
       codec_4x                           0            0    22579200          0 0  
       i2s1                               0            0    22579200          0 0  
       i2s0                               0            0    22579200          0 0  
       pll_audiox2                        0            0    45158400          0 0  
       pll_audiox4                        0            0    90316800          0 0  
    pll_video0                            1            1   120000000          0 0  
       dspo                               0            0   120000000          0 0  
       tcon_lcd                           1            1   120000000          0 0  
       mipi_dphy0                         0            0   120000000          0 0  
       pll_video0x4                       0            0   480000000          0 0  
    pll_uni                               3            4   600000000          0 0  
       ve                                 0            1   600000000          0 0  
       de                                 1            1   300000000          0 0  
       g2d                                1            1   300000000          0 0  
       csi_top                            0            0   600000000          0 0  
       isp                                0            0   600000000          0 0  
       eise                               0            0   600000000          0 0  
       pll_unix2                          2            2  1200000000          0 0  
          sdmmc1_mod                      1            1   100000000          0 0  
          sdmmc0_mod                      1            1   100000000          0 0  
    pll_periph0                           4            4   600000000          0 0  
       cpurapbs2_pll                      0            0   600000000          0 0  
       cpurcpus_pll                       0            0   600000000          0 0  
       nna_rst                            0            0   600000000          0 0  
       apb1                               2            2   100000000          0 0  
          pio                             1            1   100000000          0 0  
          pwm                             1            1   100000000          0 0  
       ahb3                               2            2   200000000          0 0  
          display_top                     1            1   200000000          0 0  
          usbotg                          1            1   200000000          0 0  
          usbehci0                        0            0   200000000          0 0  
          usbohci0                        0            0   200000000          0 0  
          gmac                            0            0   200000000          0 0  
       psi                                1            1   200000000          0 0  
          ahb2                            0            0   200000000          0 0  
          ahb1                            2            2   200000000          0 0  
             iommu                        1            1   200000000          0 0  
             hstimer                      0            0   200000000          0 0  
             dma                          1            1   200000000          0 0  
       periph32k                          0            0       32768          0 0  
       pll_periph0x2                      1            1  1200000000          0 0  
          ce                              1            1   300000000          0 0  
          nna                             0            0  1200000000          0 0  
    pll_ddr0                              0            0  1056000000          0 0  
       sdram                              0            0  1056000000          0 0  
       mbus                               0            0   264000000          0 0  
    pll_cpu                               0            0   816000000          0 0  
       cpu                                0            0   816000000          0 0  
          cpuapb                          0            0   204000000          0 0  
          axi                             0            0   272000000          0 0  
 iosc                                     0            0    16000000          0 0  
 losc                                     1            1       32768          0 0  
    losc_out                              1            1       32768          0 0  
    cpurowc                               0            0       32768          0 0
[50]DRAM BOOT DRIVE INFO: V0.41
[53]DRAM CLK = 528 MHz
[55]DRAM Type = 2 (2:DDR2,3:DDR3)
[58]DRAMC read ODT  off.
[61]DRAM ODT off.
[63]DRAM SIZE =64 M
[69]DRAM simple test OK.

离线

楼主 #13 2020-12-05 13:45:42

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

XBOOT刚开始也是算出双倍了,后面修复了下。

xboot: /sys/device/clk/sdram# cat summary
name                         rate   enable
sdram               528.000000MHZ        1
div-sdram           528.000000MHZ        1
mux-sdram           528.000000MHZ        1
pll-ddr0            528.000000MHZ        1
osc24m               24.000000MHZ        1

离线

楼主 #14 2020-12-05 14:53:41

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

定时器驱动调试OK,led心跳灯可以闪烁了。
一个clocksource驱动,还一个clockevent驱动,前面一个用于计时,后面一个用于定时。

[    0.002140] Probe device 'ce-v831-timer.0' with ce-v831-timer
[    0.000020] Probe device 'cs-v831-timer.0' with cs-v831-timer
...
[    0.022069] Probe device 'led-gpio.0' with led-gpio
[    0.026928] Probe device 'ledtrigger-heartbeat.0' with ledtrigger-heartbeat

离线

楼主 #15 2020-12-05 16:36:31

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

I2C驱动调试OK,可以探测到I2C设备。

xboot: /sys/device/i2c/i2c-v831.2# cat detect
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- 26 -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --    

离线

楼主 #16 2020-12-05 17:17:42

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

使用fastboot加快调试

前面的调试都是利用串口ymodem来传输xboot,特别慢,现在更换了下方式,需要点技巧。
进入uboot命令行,然后在uboot命令行里敲fastboot,进入fastboot模式
PC上,执行sudo fastboot boot output/xboot.bin ,这个时候会卡住,但文件已传输到DDR里了
在uboot的命令行里按CTRL+C,退出fastoot模式
然后在uboot里敲go 0x41000800,这样就可以进入xboot了

比起串口调试,这种方式要快很多了,等DDR搞定后,使用sunxi-fel工具会更方便

最近编辑记录 xboot (2020-12-05 17:18:35)

离线

#17 2020-12-05 17:37:49

aozima
会员
所在地: 深圳
注册时间: 2019-05-25
已发帖子: 298
积分: 179.5
个人网站

Re: 全志V831芯片裸机开发日记--移植V831到xboot

一个人顶上一个团队了

离线

楼主 #18 2020-12-05 18:08:23

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

添加gpio中断驱动,下面是所支持的中断编号

#define V831_IRQ_GPADC			(32)
#define V831_IRQ_THS			(33)
#define V831_IRQ_DRAM			(41)
#define V831_IRQ_DMA			(42)
#define V831_IRQ_WDOG			(46)
#define V831_IRQ_PWM			(47)
#define V831_IRQ_BUS_TIMEOUT	(49)
#define V831_IRQ_SMC			(50)
#define V831_IRQ_PSI			(51)
#define V831_IRQ_NPU			(52)
#define V831_IRQ_G2D			(53)
#define V831_IRQ_VE				(57)
#define V831_IRQ_EISE			(58)
#define V831_IRQ_EMAC0			(59)
#define V831_IRQ_AUDIO_CODEC	(60)
#define V831_IRQ_DE				(63)
#define V831_IRQ_ISP0			(65)
#define V831_IRQ_CE_NS			(67)
#define V831_IRQ_CE_S			(68)
#define V831_IRQ_I2S0			(69)
#define V831_IRQ_I2S1			(70)
#define V831_IRQ_TWI0			(73)
#define V831_IRQ_TWI1			(74)
#define V831_IRQ_TWI2			(75)
#define V831_IRQ_TWI3			(76)
#define V831_IRQ_MIPI_DIS0		(77)
#define V831_IRQ_SMHC0			(78)
#define V831_IRQ_SMHC1			(79)
#define V831_IRQ_SMHC2			(80)
#define V831_IRQ_UART0			(81)
#define V831_IRQ_UART1			(82)
#define V831_IRQ_UART2			(83)
#define V831_IRQ_UART3			(84)
#define V831_IRQ_SPI0			(86)
#define V831_IRQ_SPI1			(87)
#define V831_IRQ_SPI2			(88)
#define V831_IRQ_HSTIME0		(90)
#define V831_IRQ_HSTIME1		(91)
#define V831_IRQ_TIMER0			(92)
#define V831_IRQ_TIMER1			(93)
#define V831_IRQ_TCON_LCD0		(94)
#define V831_IRQ_OTG_DEVICE		(96)
#define V831_IRQ_OTG_EHCI		(97)
#define V831_IRQ_OTG_OHCI		(98)
#define V831_IRQ_GPIOC			(99)
#define V831_IRQ_GPIOD			(100)
#define V831_IRQ_GPIOE			(101)
#define V831_IRQ_GPIOF			(102)
#define V831_IRQ_GPIOG			(103)
#define V831_IRQ_GPIOH			(104)
#define V831_IRQ_GPIOI			(105)
#define V831_IRQ_CSI_DMA0		(106)
#define V831_IRQ_CSI_DMA1		(107)
#define V831_IRQ_CSI_DMA2		(108)
#define V831_IRQ_CSI_DMA3		(109)
#define V831_IRQ_CSI_PARSER0	(110)
#define V831_IRQ_CSI_PARSER1	(111)
#define V831_IRQ_CSI_MIPI0_RX	(114)
#define V831_IRQ_CSI_TOP_PKT	(124)
#define V831_IRQ_DSPO			(125)
#define V831_IRQ_IOMMU			(127)
#define V831_IRQ_EXT_NMI		(136)
#define V831_IRQ_R_ALARM0		(137)
#define V831_IRQ_R_GPIOL		(138)
#define V831_IRQ_R_TWI0			(139)
#define V831_IRQ_R_RSB			(142)
#define V831_IRQ_R_OWC			(146)
#define V831_IRQ_C0_CTI0		(160)
#define V831_IRQ_C0_COMMTX0		(164)
#define V831_IRQ_C0_COMMRX0		(168)
#define V831_IRQ_C0_PMU0		(172)
#define V831_IRQ_C0_AXI_ERROR	(176)
#define V831_IRQ_AXI_WR			(178)
#define V831_IRQ_AXI_RD			(179)

#define V831_IRQ_GPIOC0			(192 + 0)
#define V831_IRQ_GPIOC1			(192 + 1)
#define V831_IRQ_GPIOC2			(192 + 2)
#define V831_IRQ_GPIOC3			(192 + 3)
#define V831_IRQ_GPIOC4			(192 + 4)
#define V831_IRQ_GPIOC5			(192 + 5)
#define V831_IRQ_GPIOC6			(192 + 6)
#define V831_IRQ_GPIOC7			(192 + 7)
#define V831_IRQ_GPIOC8			(192 + 8)
#define V831_IRQ_GPIOC9			(192 + 9)
#define V831_IRQ_GPIOC10		(192 + 10)
#define V831_IRQ_GPIOC11		(192 + 11)

#define V831_IRQ_GPIOD0			(224 + 0)
#define V831_IRQ_GPIOD1			(224 + 1)
#define V831_IRQ_GPIOD2			(224 + 2)
#define V831_IRQ_GPIOD3			(224 + 3)
#define V831_IRQ_GPIOD4			(224 + 4)
#define V831_IRQ_GPIOD5			(224 + 5)
#define V831_IRQ_GPIOD6			(224 + 6)
#define V831_IRQ_GPIOD7			(224 + 7)
#define V831_IRQ_GPIOD8			(224 + 8)
#define V831_IRQ_GPIOD9			(224 + 9)
#define V831_IRQ_GPIOD10		(224 + 10)
#define V831_IRQ_GPIOD11		(224 + 11)
#define V831_IRQ_GPIOD12		(224 + 12)
#define V831_IRQ_GPIOD13		(224 + 13)
#define V831_IRQ_GPIOD14		(224 + 14)
#define V831_IRQ_GPIOD15		(224 + 15)
#define V831_IRQ_GPIOD16		(224 + 16)
#define V831_IRQ_GPIOD17		(224 + 17)
#define V831_IRQ_GPIOD18		(224 + 18)
#define V831_IRQ_GPIOD19		(224 + 19)
#define V831_IRQ_GPIOD20		(224 + 20)
#define V831_IRQ_GPIOD21		(224 + 21)
#define V831_IRQ_GPIOD22		(224 + 22)

#define V831_IRQ_GPIOE0			(256 + 0)
#define V831_IRQ_GPIOE1			(256 + 1)
#define V831_IRQ_GPIOE2			(256 + 2)
#define V831_IRQ_GPIOE3			(256 + 3)
#define V831_IRQ_GPIOE4			(256 + 4)
#define V831_IRQ_GPIOE5			(256 + 5)
#define V831_IRQ_GPIOE6			(256 + 6)
#define V831_IRQ_GPIOE7			(256 + 7)
#define V831_IRQ_GPIOE8			(256 + 8)
#define V831_IRQ_GPIOE9			(256 + 9)
#define V831_IRQ_GPIOE10		(256 + 10)
#define V831_IRQ_GPIOE11		(256 + 11)
#define V831_IRQ_GPIOE12		(256 + 12)
#define V831_IRQ_GPIOE13		(256 + 13)
#define V831_IRQ_GPIOE14		(256 + 14)
#define V831_IRQ_GPIOE15		(256 + 15)
#define V831_IRQ_GPIOE16		(256 + 16)
#define V831_IRQ_GPIOE17		(256 + 17)
#define V831_IRQ_GPIOE18		(256 + 18)
#define V831_IRQ_GPIOE19		(256 + 19)
#define V831_IRQ_GPIOE20		(256 + 20)
#define V831_IRQ_GPIOE21		(256 + 21)

#define V831_IRQ_GPIOF0			(288 + 0)
#define V831_IRQ_GPIOF1			(288 + 1)
#define V831_IRQ_GPIOF2			(288 + 2)
#define V831_IRQ_GPIOF3			(288 + 3)
#define V831_IRQ_GPIOF4			(288 + 4)
#define V831_IRQ_GPIOF5			(288 + 5)
#define V831_IRQ_GPIOF6			(288 + 6)

#define V831_IRQ_GPIOG0			(320 + 0)
#define V831_IRQ_GPIOG1			(320 + 1)
#define V831_IRQ_GPIOG2			(320 + 2)
#define V831_IRQ_GPIOG3			(320 + 3)
#define V831_IRQ_GPIOG4			(320 + 4)
#define V831_IRQ_GPIOG5			(320 + 5)
#define V831_IRQ_GPIOG6			(320 + 6)
#define V831_IRQ_GPIOG7			(320 + 7)

#define V831_IRQ_GPIOH0			(352 + 0)
#define V831_IRQ_GPIOH1			(352 + 1)
#define V831_IRQ_GPIOH2			(352 + 2)
#define V831_IRQ_GPIOH3			(352 + 3)
#define V831_IRQ_GPIOH4			(352 + 4)
#define V831_IRQ_GPIOH5			(352 + 5)
#define V831_IRQ_GPIOH6			(352 + 6)
#define V831_IRQ_GPIOH7			(352 + 7)
#define V831_IRQ_GPIOH8			(352 + 8)
#define V831_IRQ_GPIOH9			(352 + 9)
#define V831_IRQ_GPIOH10		(352 + 10)
#define V831_IRQ_GPIOH11		(352 + 11)
#define V831_IRQ_GPIOH12		(352 + 12)
#define V831_IRQ_GPIOH13		(352 + 13)
#define V831_IRQ_GPIOH14		(352 + 14)
#define V831_IRQ_GPIOH15		(352 + 15)

#define V831_IRQ_GPIOI0			(384 + 0)
#define V831_IRQ_GPIOI1			(384 + 1)
#define V831_IRQ_GPIOI2			(384 + 2)
#define V831_IRQ_GPIOI3			(384 + 3)
#define V831_IRQ_GPIOI4			(384 + 4)

离线

#19 2020-12-05 23:36:42

david
会员
注册时间: 2018-03-05
已发帖子: 192
积分: 161.5

Re: 全志V831芯片裸机开发日记--移植V831到xboot

裸奔路上的又一员悍将

离线

楼主 #20 2020-12-07 11:00:03

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

一直被ARM的对齐访问数据异常所困扰,自己写的代码可以保证所有访问都是对齐的,但对于引入的第三方库,就没有办法做到这一点了,这种情况在X86模式下是没有任何问题的,cpu自行做处理了,但ARM就不行了,需要自行处理数据异常,查了一下编译选项,有一个-mstrict-align,但这个参数在arm32 平台是没有的,arm64上,高版本的gcc倒是看到了,那么在arm32上有什么样的方法控制所有编译出来的都是对齐的呢

离线

楼主 #21 2020-12-07 11:10:21

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

经过研究结论如下:
解决的思路有下面三个
1,arm v7以上平台,关闭非对齐检测功能
2,编译参数增加 -mno-unaligned-access选项
3,打开非对齐检测功能,软件实现非对齐访问数据异常处理

对于arm32平台,就这三种方法,没有其他方法了,就看怎么选择了

研究结果贴一下,给遇到同样困惑的道友一臂之力

最近编辑记录 xboot (2020-12-07 11:24:41)

离线

#22 2020-12-07 12:00:05

lghtjpu
会员
注册时间: 2020-02-23
已发帖子: 38
积分: 32.5

Re: 全志V831芯片裸机开发日记--移植V831到xboot

请问下这个V831哪里能买到开发板或者芯片呢?

离线

#23 2020-12-07 12:12:25

aozima
会员
所在地: 深圳
注册时间: 2019-05-25
已发帖子: 298
积分: 179.5
个人网站

Re: 全志V831芯片裸机开发日记--移植V831到xboot

有cache的情况下,非对齐访问结果好像也是正确的。可以关闭检测。
非cache部分,可以打开,再软件修正? 但好像无法动态切换。

离线

楼主 #24 2020-12-07 12:14:50

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

对于armv7以上,可以关闭检测,但比较旧的arm核就无能为力了,只能加编译参赛或者做异常处理

离线

楼主 #25 2020-12-07 12:15:42

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

lghtjpu 说:

请问下这个V831哪里能买到开发板或者芯片呢?

静等sipeed出品吧

离线

楼主 #26 2020-12-07 16:15:16

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

V831的brom dump
v831-brom.7z

离线

楼主 #27 2020-12-07 19:09:36

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

编写了一个简单的程序,跑在sram中,实验了下sunxi-fel工具,可以顺利执行,为后面的自举做些前期工作。
让V831芯片进入fel模式后,然后执行如下命令:

sudo sunxi-fel -p write 0x00022000 output/v831spl.bin ; sudo sunxi-fel exec 0x00022000;

执行sunxi-fel指令相关log

100% [================================================]     6 kB,  187.4 kB/s

执行完后,V831的串口会打印如下信息:

V831SPL
i = 0
i = 1
i = 2
i = 3
i = 4
i = 0
i = 1
i = 2
i = 3
i = 4
i = 0
i = 1
i = 2
i = 3

附件是镜像,感兴趣的可以实验下。
v831spl-step1.7z

离线

楼主 #28 2020-12-08 14:58:44

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

简单理一下boot0 相关流程,里面的ddr init能搞得出来吗?

void main_entry(void)

{
  undefined *puVar1;
  undefined *puVar2;
  int iVar3;
  undefined uVar4;
  int local_r0_46;
  int dram_size;
  int iVar5;
  int iVar6;
  undefined4 extraout_r1;
  undefined4 extraout_r1_00;
  undefined4 extraout_r1_01;
  undefined4 uVar7;
  undefined *local_28;
  int local_24;
  int local_20;
  undefined *local_1c;
  
  puVar1 = PTR__start_00023fe4;
  local_28 = (undefined *)0x0;
  local_24 = 0;
  local_20 = 0;
  local_1c = (undefined *)0x0;
  uart0_init();
  uart_print(PTR_s_HELLO!_BOOT0_is_starting!_00023fe8);
  uart_print(PTR_s_BOOT0_commit_:_%s_00023fec,puVar1 + 0x2f8);
  local_r0_46 = board_init();
                    /*  */
  if (local_r0_46 == 0) {
    dram_size = checkid();
    if (dram_size == 0) {
      dram_size = ddr_init(0,puVar1 + 0x38);
      if (dram_size != 0) {
        uart_print(PTR_s_dram_size_=%d_00023ff0,dram_size);
        set_boot_flag((uint)(byte)puVar1[0x34]);
        iVar5 = check_boot_pin();
        if (iVar5 == 0x32) {
          set_boot_flag(3);
          uart_print(PTR_s_detected_user_input_2_00023ff4);
        }
        else {
          if (iVar5 == 100) {
            set_boot_flag(8);
            uart_print(PTR_s_detected_user_input_d_00023ff8);
          }
          spi();
          iVar6 = return_0();
          if ((iVar6 == 0) && (iVar6 = spi_nor_read(), iVar6 == 0)) {
            FUN_00024028(&local_28,&local_24,&local_20,&local_1c);
            iVar3 = local_20;
            iVar6 = local_24;
            puVar2 = local_28;
            puVar1 = PTR_DAT_00024000;
            if (local_1c == (undefined *)0x0) {
              uVar7 = *(undefined4 *)(DAT_00023ffc + 0x24);
              *(int *)(local_28 + 0x4f8) = dram_size;
              *(undefined4 *)(local_28 + 0x4f4) = uVar7;
              thunk_FUN_00020520(local_28 + 0x30,puVar1,0x80);
              if (iVar3 != 0) {
                puVar2[0x4e9] = 1;
              }
              if (iVar6 != 0) {
                puVar2[0x4e8] = 1;
              }
              uVar4 = FUN_00021474(0xff);
              puVar2[0x4ea] = uVar4;
              FUN_000244ec(puVar2);
              *(short *)(puVar2 + 0x502) = (short)iVar5;
              *(undefined2 *)(puVar2 + 0x500) = 0;
              *(undefined2 *)(puVar2 + 0x504) = 0;
              uVar4 = FUN_000213b4();
              puVar2[0x507] = uVar4;
            }
            cleanup();
            uart_print(PTR_s_Jump_to_second_Boot._00024004);
            if (local_20 == 0) {
              if (local_24 == 0) {
                if (local_1c == (undefined *)0x0) {
                  go_address(local_28,extraout_r1_00);
                }
                else {
                  uart_print(PTR_s_jump_to_rtos_00024008);
                  go_address(local_1c,extraout_r1_01);
                }
              }
              else {
                FUN_0002154c(local_24,local_28);
              }
            }
            else {
              empty_func();
            }
            do {
                    /* WARNING: Do nothing block with infinite loop */
            } while( true );
          }
        }
      }
    }
    else {
      die_loop();
    }
  }
  FUN_00020ec4();
  FUN_000210a0();
  cleanup();
  FUN_00021170(10);
  go_address((undefined *)0x20,extraout_r1);
  return;
}

离线

#29 2020-12-08 15:49:19

huxh
会员
注册时间: 2020-12-08
已发帖子: 2
积分: 2

Re: 全志V831芯片裸机开发日记--移植V831到xboot

大佬牛呀,顶礼!

离线

楼主 #30 2020-12-08 16:11:37

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

DDR先放一放,没那么容易搞定的。先搞点其他的。

离线

楼主 #31 2020-12-08 16:14:55

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

搞定spi驱动,可以探测到spi nor flash了,同时,也修改好了spl的spi nor 读取,sys-spinor.c,为后面的自举打下基础。

[    0.032855] Probe device 'spi-v831.0' with spi-v831
...
[    0.113743]   0x0000000000000000 ~ 0x0000000000ffffff 16.000MB  - blk-spinor.0
[    0.121440]   0x0000000000000000 ~ 0x00000000003fffff 4.000MB   - blk-spinor.0.xboot
[    0.129658]   0x0000000000400000 ~ 0x0000000000ffffff 12.000MB  - blk-spinor.0.private

离线

楼主 #32 2020-12-08 16:15:37

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

SDCARD驱动也搞定了,可以探测到sd卡了

[    0.046386] SD/MMC card at the 'sdhci-v831.0' host controller:
[    0.052489]   Attached is a SD card
[    0.056208]   Version: 2.0
[    0.059081]   Capacity: 14.727GB
[    0.062516]   High capacity card
[    0.065939]   CID: AD4C5355-53443030-1094171A-D801445B
[    0.071417]   CSD: 400E0032-DB790000-75CF7F80-0A40000F
[    0.076868]   Max transfer speed: 25000000 HZ
[    0.081496]   Manufacturer ID: AD
[    0.085006]   OEM/Application ID: 4C53
[    0.088966]   Product name: 'USD00'
[    0.092667]   Product revision: 1.0
[    0.096377]   Serial no: 3481239562
[    0.100086]   Manufacturing date: 2020.4
[    0.105007] Probe device 'sdhci-v831.0' with sdhci-v831

离线

楼主 #33 2020-12-08 16:19:04

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

刚刚测试的是16MB的spi flash,现在测试了32MB的 spi nor flash也是ok的

[    0.112621] Found partition:
[    0.115633]   0x0000000000000000 ~ 0x0000000001ffffff 32.000MB  - blk-spinor.0
[    0.123337]   0x0000000000000000 ~ 0x00000000003fffff 4.000MB   - blk-spinor.0.xboot
[    0.131739]   0x0000000000400000 ~ 0x0000000001ffffff 28.000MB  - blk-spinor.0.private

离线

楼主 #34 2020-12-08 18:14:10

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

DDR问题头大,现在连寄存器都没有,干瞪眼了,期待高人协助。
先贴一下xboot的完整log吧

       _                   _                     
 _  _ | |___ _____ _____ _| |_                   
\ \/ /|  _  |  _  |  _  |_   _|  (C) 2007-2020   
 )  ( | |_| | |_| | |_| | | |____JIANJUN.JIANG__ 
/_/\_\|_____|_____|_____| |_____________________|
V3.0.0 (Dec  8 2020 - 18:07:13) - [sipeed][Sipeed(Maix-II) Based On Allwinner V831 SOC]
[    0.000000] Probe device 'blk-romdisk.0' with blk-romdisk
[    0.000010] Probe device 'losc' with clk-fixed
[    0.000020] Probe device 'iosc' with clk-fixed
[    0.000030] Probe device 'osc24m' with clk-fixed
[    0.000040] Probe device 'pll-periph0div25m' with clk-fixed
[    0.000050] Probe device 'osc48m' with clk-fixed
[    0.000060] Probe device 'pll-cpux' with clk-v831-pll
[    0.000070] Probe device 'pll-ddr0' with clk-v831-pll
[    0.000080] Probe device 'pll-periph0' with clk-v831-pll
[    0.000090] Probe device 'pll-uni' with clk-v831-pll
[    0.000100] Probe device 'pll-video0' with clk-v831-pll
[    0.000110] Probe device 'pll-audio' with clk-v831-pll
[    0.000120] Probe device 'pll-csi' with clk-v831-pll
[    0.000130] Probe device 'pll-periph0x2' with clk-fixed-factor
[    0.000140] Probe device 'periph32k' with clk-fixed-factor
[    0.000150] Probe device 'pll-unix2' with clk-fixed-factor
[    0.000160] Probe device 'pll-audiox4' with clk-fixed-factor
[    0.000170] Probe device 'pll-audiox2' with clk-fixed-factor
[    0.000180] Probe device 'pll-video0x4' with clk-fixed-factor
[    0.000190] Probe device 'mbus' with clk-fixed-factor
[    0.000200] Probe device 'osc24m-2' with clk-fixed-factor
[    0.000210] Probe device 'osc24m-750' with clk-fixed-factor
[    0.000220] Probe device 'osc48m-4' with clk-fixed-factor
[    0.000230] Probe device 'cpu' with clk-mux
[    0.000240] Probe device 'axi' with clk-divider
[    0.000250] Probe device 'cpuapb' with clk-ratio
[    0.000260] Probe device 'mux-psi' with clk-mux
[    0.000270] Probe device 'div-psi' with clk-divider
[    0.000280] Probe device 'radio-psi' with clk-ratio
[    0.000290] Probe device 'psi' with clk-gate
[    0.000300] Probe device 'ahb1' with clk-link
[    0.000310] Probe device 'ahb2' with clk-link
[    0.000320] Probe device 'mux-ahb3' with clk-mux
[    0.000330] Probe device 'div-ahb3' with clk-divider
[    0.000340] Probe device 'ahb3' with clk-ratio
[    0.000350] Probe device 'mux-apb1' with clk-mux
[    0.000360] Probe device 'div-apb1' with clk-divider
[    0.000370] Probe device 'apb1' with clk-ratio
[    0.000380] Probe device 'mux-apb2' with clk-mux
[    0.000390] Probe device 'div-apb2' with clk-divider
[    0.000400] Probe device 'apb2' with clk-ratio
[    0.000410] Probe device 'mux-de' with clk-mux
[    0.000420] Probe device 'div-de' with clk-divider
[    0.000430] Probe device 'gate-de' with clk-gate
[    0.000440] Probe device 'de' with clk-gate
[    0.000450] Probe device 'mux-g2d' with clk-mux
[    0.000460] Probe device 'div-g2d' with clk-divider
[    0.000470] Probe device 'gate-g2d' with clk-gate
[    0.000480] Probe device 'g2d' with clk-gate
[    0.000490] Probe device 'mux-ce' with clk-mux
[    0.000500] Probe device 'div-ce' with clk-divider
[    0.000510] Probe device 'radio-ce' with clk-ratio
[    0.000520] Probe device 'gate-ce' with clk-gate
[    0.000530] Probe device 'ce' with clk-gate
[    0.000540] Probe device 'mux-ve' with clk-mux
[    0.000550] Probe device 'div-ve' with clk-divider
[    0.000560] Probe device 'gate-ve' with clk-gate
[    0.000570] Probe device 've' with clk-gate
[    0.000580] Probe device 'mux-eise' with clk-mux
[    0.000590] Probe device 'div-eise' with clk-divider
[    0.000600] Probe device 'gate-eise' with clk-gate
[    0.000610] Probe device 'eise' with clk-gate
[    0.000620] Probe device 'mux-nna' with clk-mux
[    0.000630] Probe device 'div-nna' with clk-divider
[    0.000640] Probe device 'gate-nna' with clk-gate
[    0.000650] Probe device 'nna' with clk-gate
[    0.000660] Probe device 'dma' with clk-gate
[    0.000670] Probe device 'hstimer' with clk-gate
[    0.000680] Probe device 'avs' with clk-gate
[    0.000690] Probe device 'dbgsys' with clk-gate
[    0.000700] Probe device 'pwm' with clk-gate
[    0.000710] Probe device 'mux-sdram' with clk-mux
[    0.000720] Probe device 'div-sdram' with clk-divider
[    0.000730] Probe device 'sdram' with clk-gate
[    0.000740] Probe device 'mux-sdmmc0' with clk-mux
[    0.000750] Probe device 'div-sdmmc0' with clk-divider
[    0.000760] Probe device 'radio-sdmmc0' with clk-ratio
[    0.000770] Probe device 'gate-sdmmc0' with clk-gate
[    0.000780] Probe device 'sdmmc0' with clk-gate
[    0.000790] Probe device 'mux-sdmmc1' with clk-mux
[    0.000800] Probe device 'div-sdmmc1' with clk-divider
[    0.000810] Probe device 'radio-sdmmc1' with clk-ratio
[    0.000820] Probe device 'gate-sdmmc1' with clk-gate
[    0.000830] Probe device 'sdmmc1' with clk-gate
[    0.000840] Probe device 'mux-sdmmc2' with clk-mux
[    0.000850] Probe device 'div-sdmmc2' with clk-divider
[    0.000860] Probe device 'radio-sdmmc2' with clk-ratio
[    0.000870] Probe device 'gate-sdmmc2' with clk-gate
[    0.000880] Probe device 'sdmmc2' with clk-gate
[    0.000890] Probe device 'uart0' with clk-gate
[    0.000900] Probe device 'uart1' with clk-gate
[    0.000910] Probe device 'uart2' with clk-gate
[    0.000920] Probe device 'uart3' with clk-gate
[    0.000930] Probe device 'twi0' with clk-gate
[    0.000940] Probe device 'twi1' with clk-gate
[    0.000950] Probe device 'twi2' with clk-gate
[    0.000960] Probe device 'twi3' with clk-gate
[    0.000970] Probe device 'mux-spi0' with clk-mux
[    0.000980] Probe device 'div-spi0' with clk-divider
[    0.000990] Probe device 'radio-spi0' with clk-ratio
[    0.001000] Probe device 'gate-spi0' with clk-gate
[    0.001010] Probe device 'spi0' with clk-gate
[    0.001020] Probe device 'mux-spi1' with clk-mux
[    0.001030] Probe device 'div-spi1' with clk-divider
[    0.001040] Probe device 'radio-spi1' with clk-ratio
[    0.001050] Probe device 'gate-spi1' with clk-gate
[    0.001060] Probe device 'spi1' with clk-gate
[    0.001070] Probe device 'mux-spi2' with clk-mux
[    0.001080] Probe device 'div-spi2' with clk-divider
[    0.001090] Probe device 'radio-spi2' with clk-ratio
[    0.001100] Probe device 'gate-spi2' with clk-gate
[    0.001110] Probe device 'spi2' with clk-gate
[    0.001120] Probe device 'gate-ephy' with clk-gate
[    0.001130] Probe device 'ephy' with clk-gate
[    0.001140] Probe device 'gmac' with clk-gate
[    0.001150] Probe device 'gpadc' with clk-gate
[    0.001160] Probe device 'ths' with clk-gate
[    0.001170] Probe device 'mux-i2s0' with clk-mux
[    0.001180] Probe device 'radio-i2s0' with clk-ratio
[    0.001190] Probe device 'gate-i2s0' with clk-gate
[    0.001200] Probe device 'i2s0' with clk-gate
[    0.001210] Probe device 'mux-i2s1' with clk-mux
[    0.001220] Probe device 'radio-i2s1' with clk-ratio
[    0.001230] Probe device 'gate-i2s1' with clk-gate
[    0.001240] Probe device 'i2s1' with clk-gate
[    0.001250] Probe device 'mux-codec1x' with clk-mux
[    0.001260] Probe device 'div-codec1x' with clk-divider
[    0.001270] Probe device 'gate-codec1x' with clk-gate
[    0.001280] Probe device 'codec1x' with clk-gate
[    0.001290] Probe device 'mux-codec4x' with clk-mux
[    0.001300] Probe device 'div-codec4x' with clk-divider
[    0.001310] Probe device 'gate-codec4x' with clk-gate
[    0.001320] Probe device 'codec4x' with clk-gate
[    0.001330] Probe device 'mux-usbohci0' with clk-mux
[    0.001340] Probe device 'usbphy0' with clk-gate
[    0.001350] Probe device 'gate-usbohci0' with clk-gate
[    0.001360] Probe device 'usbohci0' with clk-gate
[    0.001370] Probe device 'usbehci0' with clk-gate
[    0.001380] Probe device 'usbotg' with clk-gate
[    0.001390] Probe device 'mux-mipidphy0' with clk-mux
[    0.001400] Probe device 'div-mipidphy0' with clk-divider
[    0.001410] Probe device 'radio-mipidphy0' with clk-ratio
[    0.001420] Probe device 'gate-mipidphy0' with clk-gate
[    0.001430] Probe device 'mipidphy0' with clk-gate
[    0.001440] Probe device 'mux-mipihost0' with clk-mux
[    0.001450] Probe device 'div-mipihost0' with clk-divider
[    0.001460] Probe device 'gate-mipihost0' with clk-gate
[    0.001470] Probe device 'mipihost0' with clk-gate
[    0.001480] Probe device 'displaytop' with clk-gate
[    0.001490] Probe device 'mux-tcon' with clk-mux
[    0.001500] Probe device 'gate-tcon' with clk-gate
[    0.001510] Probe device 'tcon' with clk-gate
[    0.001520] Probe device 'mux-csitop' with clk-mux
[    0.001530] Probe device 'div-csitop' with clk-divider
[    0.001540] Probe device 'gate-csitop' with clk-gate
[    0.001550] Probe device 'csitop' with clk-gate
[    0.001560] Probe device 'mux-csimaster0' with clk-mux
[    0.001570] Probe device 'div-csimaster0' with clk-divider
[    0.001580] Probe device 'gate-csimaster0' with clk-gate
[    0.001590] Probe device 'csimaster0' with clk-gate
[    0.001600] Probe device 'mux-csimaster1' with clk-mux
[    0.001610] Probe device 'div-csimaster1' with clk-divider
[    0.001620] Probe device 'gate-csimaster1' with clk-gate
[    0.001630] Probe device 'csimaster1' with clk-gate
[    0.001640] Probe device 'mux-isp' with clk-mux
[    0.001650] Probe device 'div-isp' with clk-divider
[    0.001660] Probe device 'isp' with clk-gate
[    0.001670] Probe device 'mux-dspo' with clk-mux
[    0.001680] Probe device 'div-dspo' with clk-divider
[    0.001690] Probe device 'radio-dspo' with clk-ratio
[    0.001700] Probe device 'gate-dspo' with clk-gate
[    0.001710] Probe device 'dspo' with clk-gate
[    0.001720] Probe device 'mux-timer0' with clk-mux
[    0.001730] Probe device 'timer0' with clk-ratio
[    0.001740] Probe device 'mux-timer1' with clk-mux
[    0.001750] Probe device 'timer1' with clk-ratio
[    0.001760] Probe device 'pio' with clk-link
[    0.001770] Probe device 'wdg' with clk-link
[    0.001780] Probe device 'reset-v831.0' with reset-v831
[    0.001790] Probe device 'reset-v831.1' with reset-v831
[    0.001800] Probe device 'reset-v831.2' with reset-v831
[    0.001810] Probe device 'reset-v831.3' with reset-v831
[    0.001820] Probe device 'reset-v831.4' with reset-v831
[    0.001830] Probe device 'reset-v831.5' with reset-v831
[    0.001840] Probe device 'reset-v831.6' with reset-v831
[    0.001850] Probe device 'reset-v831.7' with reset-v831
[    0.001860] Probe device 'reset-v831.8' with reset-v831
[    0.001870] Probe device 'reset-v831.9' with reset-v831
[    0.001880] Probe device 'reset-v831.10' with reset-v831
[    0.001890] Probe device 'reset-v831.11' with reset-v831
[    0.001900] Probe device 'reset-v831.12' with reset-v831
[    0.001910] Probe device 'reset-v831.13' with reset-v831
[    0.001920] Probe device 'reset-v831.14' with reset-v831
[    0.001930] Probe device 'reset-v831.15' with reset-v831
[    0.001940] Probe device 'reset-v831.16' with reset-v831
[    0.001950] Probe device 'reset-v831.17' with reset-v831
[    0.001960] Probe device 'reset-v831.18' with reset-v831
[    0.001970] Probe device 'reset-v831.19' with reset-v831
[    0.001980] Probe device 'reset-v831.20' with reset-v831
[    0.001990] Probe device 'reset-v831.21' with reset-v831
[    0.002000] Probe device 'reset-v831.22' with reset-v831
[    0.002010] Probe device 'reset-v831.23' with reset-v831
[    0.002020] Probe device 'reset-v831.24' with reset-v831
[    0.002030] Probe device 'reset-v831.25' with reset-v831
[    0.002040] Probe device 'reset-v831.26' with reset-v831
[    0.002050] Probe device 'irq-gic400.0' with irq-gic400
[    0.002060] Probe device 'irq-v831-gpio.0' with irq-v831-gpio
[    0.002070] Probe device 'irq-v831-gpio.1' with irq-v831-gpio
[    0.002080] Probe device 'irq-v831-gpio.2' with irq-v831-gpio
[    0.002090] Probe device 'irq-v831-gpio.3' with irq-v831-gpio
[    0.002100] Probe device 'irq-v831-gpio.4' with irq-v831-gpio
[    0.002110] Probe device 'irq-v831-gpio.5' with irq-v831-gpio
[    0.002120] Probe device 'irq-v831-gpio.6' with irq-v831-gpio
[    0.002130] Probe device 'gpio-v831.0' with gpio-v831
[    0.002140] Probe device 'gpio-v831.1' with gpio-v831
[    0.002150] Probe device 'gpio-v831.2' with gpio-v831
[    0.002160] Probe device 'gpio-v831.3' with gpio-v831
[    0.002170] Probe device 'gpio-v831.4' with gpio-v831
[    0.002180] Probe device 'gpio-v831.5' with gpio-v831
[    0.002190] Probe device 'gpio-v831.6' with gpio-v831
[    0.002200] Probe device 'ce-v831-timer.0' with ce-v831-timer
[    0.000023] Probe device 'cs-v831-timer.0' with cs-v831-timer
[    0.006158] Probe device 'uart-16550.0' with uart-16550
[    0.011805] Probe device 'uart-16550.1' with uart-16550
[    0.017341] Probe device 'i2c-v831.0' with i2c-v831
[    0.022503] Probe device 'i2c-v831.1' with i2c-v831
[    0.027694] Probe device 'i2c-v831.2' with i2c-v831
[    0.032872] Probe device 'spi-v831.0' with spi-v831
[    0.046396] SD/MMC card at the 'sdhci-v831.0' host controller:
[    0.052525]   Attached is a SD card
[    0.056201]   Version: 2.0
[    0.059074]   Capacity: 14.727GB
[    0.062509]   High capacity card
[    0.065950]   CID: AD4C5355-53443030-1094171A-D801445B
[    0.071436]   CSD: 400E0032-DB790000-75CF7F80-0A40000F
[    0.076887]   Max transfer speed: 25000000 HZ
[    0.081541]   Manufacturer ID: AD
[    0.085034]   OEM/Application ID: 4C53
[    0.088986]   Product name: 'USD00'
[    0.092669]   Product revision: 1.0
[    0.096379]   Serial no: 3481239562
[    0.100079]   Manufacturing date: 2020.4
[    0.105028] Probe device 'sdhci-v831.0' with sdhci-v831
[    0.121146] Found partition:
[    0.124123]   0x0000000000000000 ~ 0x0000000000ffffff 16.000MB  - blk-spinor.0
[    0.131809]   0x0000000000000000 ~ 0x00000000003fffff 4.000MB   - blk-spinor.0.xboot
[    0.140012]   0x0000000000400000 ~ 0x0000000000ffffff 12.000MB  - blk-spinor.0.private
[    0.148402] Probe device 'blk-spinor.0' with blk-spinor
[    0.153981] Probe device 'wdg-v831.0' with wdg-v831
[    0.159155] Probe device 'led-gpio.0' with led-gpio
[    0.164328] Probe device 'ledtrigger-heartbeat.0' with ledtrigger-heartbeat
[    0.171741] Probe device 'console-uart.0' with console-uart
[    0.179436] mount /private with 'ram' filesystem
Press any key to stop auto boot:  0.630
xboot: /# 

离线

楼主 #35 2020-12-09 17:57:38

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

好消息,关于ddr初始化,直接利用闭源二进制,构造环境,可以有如下打印了,这种方式,理论上可以搞定全志任何一个芯片的DDR初始化。

dram_tpr5:0x0x48484848.
dram_tpr6:0x0x00000048.
DX0 state:1
DX1 state:1
dram_tpr5:0x0x48484848.
dram_tpr6:0x0x00000048.
[AUTO DEBUG] two rank and full DQ!
[AUTO DEBUG] DDR2 try success
dram_tpr5:0x0x48484848.
dram_tpr6:0x0x00000048.
[AUTO DEBUG] single rank and full DQ!
dram_tpr5:0x0x48484848.
dram_tpr6:0x0x00000048.
[AUTO DEBUG] rank 0 row = 13 
[AUTO DEBUG] rank 0 bank = 4 
[AUTO DEBUG] rank 0 page size = 2 KB 
DRAM BOOT DRIVE INFO: V0.20
DRAM CLK = 528 MHz
DRAM Type = 2 (2:DDR2,3:DDR3)
DRAMC read ODT  off.
DRAM ODT off.
DRAM tpr10 = 0x00000000
DRAM tpr11 = 0x00120000
DRAM tpr12 = 0x00000023
dram_tpr5:0x0x48484848.
dram_tpr6:0x0x00000048.
ACMDLR: 0x00804646
DXnMDLR(0): 0x00604545
DXnMDLR(1): 0x00484445
DRAM SIZE =64 M
DRAM simple random test OK.

离线

#36 2020-12-09 18:05:55

aozima
会员
所在地: 深圳
注册时间: 2019-05-25
已发帖子: 298
积分: 179.5
个人网站

Re: 全志V831芯片裸机开发日记--移植V831到xboot

>>直接利用闭源二进制

妙,只要里面别乱引用其它东西。

离线

#37 2020-12-09 18:13:27

raspberryman
会员
注册时间: 2019-12-27
已发帖子: 503
积分: 465

Re: 全志V831芯片裸机开发日记--移植V831到xboot

aozima 说:

>>直接利用闭源二进制

妙,只要里面别乱引用其它东西。

有创意!

离线

楼主 #38 2020-12-09 18:40:03

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

v831spl_ddr.7z
执行如下命令,可以初始化DDR

sudo sunxi-fel write 0x00030000 output/v831spl.bin;
sudo sunxi-fel exe 0x00030000;

初始化DDR后,就可以执行下面的命令,启动xboot,这样可以彻底独立了,不依赖ymodem或者fastboot来传输了。

sudo sunxi-fel -p write 0x40000000 output/xboot.bin;
sudo sunxi-fel exec 0x40000000;

离线

楼主 #39 2020-12-10 07:31:57

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

上面的spl无法直接使用sunxi-fel的spl命令,经过debug解决这个问题了,是因为,ddr_bin要放置在0x22000,大概12K,spl代码本身位置无关,我链接到0x30000这个位置,然后spl指令,有可能将整个spl,里面还有ddr_bin的二进制,放到0x20000这个位置,然后我会在运行时将ddr_bin拷贝到0x22000,这个过程破坏spl自身的代码了,所以需要运行spl时,第一时间运行一次自拷贝,让出0x22000到0x30000这段空间,这样处理后,就可以spl命令了

离线

#40 2020-12-10 08:44:24

aozima
会员
所在地: 深圳
注册时间: 2019-05-25
已发帖子: 298
积分: 179.5
个人网站

Re: 全志V831芯片裸机开发日记--移植V831到xboot

楼主真早,虽然暂时用不到,但相关姿势可以借用。

最近编辑记录 aozima (2020-12-10 08:53:54)

离线

楼主 #41 2020-12-10 09:20:07

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

v831spl-ddr-support-sunxi-fel-spl-command.7z

这个程序,可以支持spl指令了,执行后,ddr会被初始化,然后再次进入fel模式,这个动作后,就可以随心所欲了。

sudo sunxi-fel write 0x00030000 output/v831spl.bin;sudo sunxi-fel exe 0x00030000;
sudo sunxi-fel spl output/v831spl.bin

这两条指令,效果一致,如果当成独立的spl程序,这个算最终迷你版的了,完全够用了,但对于xboot而言,还需要进一步开发。稍后描述下。

离线

楼主 #42 2020-12-10 09:49:31

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

因为整个spl的实现是位置无关的,但引入的闭源二进制,这个算在链接时会生成只读数据段,而只读数据段就不是位置无关了,这就会导致你最终程序的链接地址,只能在SRAM中,而不能在DDR中,这个问题需要编写一些汇编代码,来解决此问题。

xboot的最终链接地址一定是DDR中的0x4000000,而spl代码同样也被链接在DDR中,在执行时,需要多次自拷贝,大概有以下过程。
1,芯片上电,内部BROM代码开始运行,其会搬运引导介质里面的几十K代码到内部SRAM中,然后开始运行。这个过程不受控。
2,在SRAM中运行的几十K代码,这里简称SPL代码,开始执行。从这里开始就完全受控了。
3,SPL代码里,先保存FEL环境上下文,用于恢复到FEL模式,保存地址为0x00037ff8
4,进入arm的 srv模式并关闭中断。
5,设置中断向量地址到最终链接地址,DDR中。
6,打开SMP bit位,用于后面的mmu cache 加速。
7,使能NEON,VFP单元。
8,自拷贝spl代码到0x00030000地址,给未来的闭源的二进制让路,保留空间0x00022000-0x00030000给其使用
9,初始化jtag,串口,还有时钟
10,初始化DDR,这个过程时运行闭源二进制来实现的,通过构造环境,让其运行。基本靠逆向出来的。
11,到这里DDR已经OK了,但代码还在SRAM中执行。
12,初始化栈,到DDR空间
13,运行自拷贝,这里就是sys_copyself函数了,这个函数会根据当前的引导情况,自动选择介质,将当前完整代码拷贝到DDR中,这个过程先不细说,后面补充。
14,清BSS段
15,跳到DDR里的xboot_main函数,
16,至此,已进入C的世界,而且还运行在DDR中。

有点惊心动魄的感觉,这一路过来,感觉不容易。有些细节,没有描述,有机会再补充吧。

最近编辑记录 xboot (2020-12-10 10:03:22)

离线

楼主 #43 2020-12-10 13:16:07

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

搞定因引入闭源二进制而导致无法生成位置无关代码的问题,现在可以链接到DDR里了,下面就需要研究启动模式,以及实现SPI NOR FLASH自举了。

最近编辑记录 xboot (2020-12-10 13:16:55)

离线

楼主 #44 2020-12-10 14:30:46

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

已实现SPI NOR FLASH自举引导,下面是完整log

dram_init start.
dram_tpr5:0x0x48484848.
dram_tpr6:0x0x00000048.
DX0 state:1
DX1 state:1
dram_tpr5:0x0x48484848.
dram_tpr6:0x0x00000048.
[AUTO DEBUG] two rank and full DQ!
[AUTO DEBUG] DDR2 try success
dram_tpr5:0x0x48484848.
dram_tpr6:0x0x00000048.
[AUTO DEBUG] single rank and full DQ!
dram_tpr5:0x0x48484848.
dram_tpr6:0x0x00000048.
[AUTO DEBUG] rank 0 row = 13 
[AUTO DEBUG] rank 0 bank = 4 
[AUTO DEBUG] rank 0 page size = 2 KB 
DRAM BOOT DRIVE INFO: V0.20
DRAM CLK = 528 MHz
DRAM Type = 2 (2:DDR2,3:DDR3)
DRAMC read ODT  off.
DRAM ODT off.
DRAM tpr10 = 0x00000000
DRAM tpr11 = 0x00120000
DRAM tpr12 = 0x00000023
dram_tpr5:0x0x48484848.
dram_tpr6:0x0x00000048.
ACMDLR: 0x00804646
DXnMDLR(0): 0x00604545
DXnMDLR(1): 0x00484445
DRAM SIZE =64 M
DRAM simple random test OK.
       _                   _                     
 _  _ | |___ _____ _____ _| |_                   
\ \/ /|  _  |  _  |  _  |_   _|  (C) 2007-2020   
 )  ( | |_| | |_| | |_| | | |____JIANJUN.JIANG__ 
/_/\_\|_____|_____|_____| |_____________________|
V3.0.0 (Dec 10 2020 - 14:24:46) - [sipeed][Sipeed(Maix-II) Based On Allwinner V831 SOC]
[    0.000000] Probe device 'blk-romdisk.0' with blk-romdisk
[    0.000010] Probe device 'losc' with clk-fixed
[    0.000020] Probe device 'iosc' with clk-fixed
[    0.000030] Probe device 'osc24m' with clk-fixed
[    0.000040] Probe device 'pll-periph0div25m' with clk-fixed
[    0.000050] Probe device 'osc48m' with clk-fixed
[    0.000060] Probe device 'pll-cpux' with clk-v831-pll
[    0.000070] Probe device 'pll-ddr0' with clk-v831-pll
[    0.000080] Probe device 'pll-periph0' with clk-v831-pll
[    0.000090] Probe device 'pll-uni' with clk-v831-pll
[    0.000100] Probe device 'pll-video0' with clk-v831-pll
[    0.000110] Probe device 'pll-audio' with clk-v831-pll
[    0.000120] Probe device 'pll-csi' with clk-v831-pll
[    0.000130] Probe device 'pll-periph0x2' with clk-fixed-factor
[    0.000140] Probe device 'periph32k' with clk-fixed-factor
[    0.000150] Probe device 'pll-unix2' with clk-fixed-factor
[    0.000160] Probe device 'pll-audiox4' with clk-fixed-factor
[    0.000170] Probe device 'pll-audiox2' with clk-fixed-factor
[    0.000180] Probe device 'pll-video0x4' with clk-fixed-factor
[    0.000190] Probe device 'mbus' with clk-fixed-factor
[    0.000200] Probe device 'osc24m-2' with clk-fixed-factor
[    0.000210] Probe device 'osc24m-750' with clk-fixed-factor
[    0.000220] Probe device 'osc48m-4' with clk-fixed-factor
[    0.000230] Probe device 'cpu' with clk-mux
[    0.000240] Probe device 'axi' with clk-divider
[    0.000250] Probe device 'cpuapb' with clk-ratio
[    0.000260] Probe device 'mux-psi' with clk-mux
[    0.000270] Probe device 'div-psi' with clk-divider
[    0.000280] Probe device 'radio-psi' with clk-ratio
[    0.000290] Probe device 'psi' with clk-gate
[    0.000300] Probe device 'ahb1' with clk-link
[    0.000310] Probe device 'ahb2' with clk-link
[    0.000320] Probe device 'mux-ahb3' with clk-mux
[    0.000330] Probe device 'div-ahb3' with clk-divider
[    0.000340] Probe device 'ahb3' with clk-ratio
[    0.000350] Probe device 'mux-apb1' with clk-mux
[    0.000360] Probe device 'div-apb1' with clk-divider
[    0.000370] Probe device 'apb1' with clk-ratio
[    0.000380] Probe device 'mux-apb2' with clk-mux
[    0.000390] Probe device 'div-apb2' with clk-divider
[    0.000400] Probe device 'apb2' with clk-ratio
[    0.000410] Probe device 'mux-de' with clk-mux
[    0.000420] Probe device 'div-de' with clk-divider
[    0.000430] Probe device 'gate-de' with clk-gate
[    0.000440] Probe device 'de' with clk-gate
[    0.000450] Probe device 'mux-g2d' with clk-mux
[    0.000460] Probe device 'div-g2d' with clk-divider
[    0.000470] Probe device 'gate-g2d' with clk-gate
[    0.000480] Probe device 'g2d' with clk-gate
[    0.000490] Probe device 'mux-ce' with clk-mux
[    0.000500] Probe device 'div-ce' with clk-divider
[    0.000510] Probe device 'radio-ce' with clk-ratio
[    0.000520] Probe device 'gate-ce' with clk-gate
[    0.000530] Probe device 'ce' with clk-gate
[    0.000540] Probe device 'mux-ve' with clk-mux
[    0.000550] Probe device 'div-ve' with clk-divider
[    0.000560] Probe device 'gate-ve' with clk-gate
[    0.000570] Probe device 've' with clk-gate
[    0.000580] Probe device 'mux-eise' with clk-mux
[    0.000590] Probe device 'div-eise' with clk-divider
[    0.000600] Probe device 'gate-eise' with clk-gate
[    0.000610] Probe device 'eise' with clk-gate
[    0.000620] Probe device 'mux-nna' with clk-mux
[    0.000630] Probe device 'div-nna' with clk-divider
[    0.000640] Probe device 'gate-nna' with clk-gate
[    0.000650] Probe device 'nna' with clk-gate
[    0.000660] Probe device 'dma' with clk-gate
[    0.000670] Probe device 'hstimer' with clk-gate
[    0.000680] Probe device 'avs' with clk-gate
[    0.000690] Probe device 'dbgsys' with clk-gate
[    0.000700] Probe device 'pwm' with clk-gate
[    0.000710] Probe device 'mux-sdram' with clk-mux
[    0.000720] Probe device 'div-sdram' with clk-divider
[    0.000730] Probe device 'sdram' with clk-gate
[    0.000740] Probe device 'mux-sdmmc0' with clk-mux
[    0.000750] Probe device 'div-sdmmc0' with clk-divider
[    0.000760] Probe device 'radio-sdmmc0' with clk-ratio
[    0.000770] Probe device 'gate-sdmmc0' with clk-gate
[    0.000780] Probe device 'sdmmc0' with clk-gate
[    0.000790] Probe device 'mux-sdmmc1' with clk-mux
[    0.000800] Probe device 'div-sdmmc1' with clk-divider
[    0.000810] Probe device 'radio-sdmmc1' with clk-ratio
[    0.000820] Probe device 'gate-sdmmc1' with clk-gate
[    0.000830] Probe device 'sdmmc1' with clk-gate
[    0.000840] Probe device 'mux-sdmmc2' with clk-mux
[    0.000850] Probe device 'div-sdmmc2' with clk-divider
[    0.000860] Probe device 'radio-sdmmc2' with clk-ratio
[    0.000870] Probe device 'gate-sdmmc2' with clk-gate
[    0.000880] Probe device 'sdmmc2' with clk-gate
[    0.000890] Probe device 'uart0' with clk-gate
[    0.000900] Probe device 'uart1' with clk-gate
[    0.000910] Probe device 'uart2' with clk-gate
[    0.000920] Probe device 'uart3' with clk-gate
[    0.000930] Probe device 'twi0' with clk-gate
[    0.000940] Probe device 'twi1' with clk-gate
[    0.000950] Probe device 'twi2' with clk-gate
[    0.000960] Probe device 'twi3' with clk-gate
[    0.000970] Probe device 'mux-spi0' with clk-mux
[    0.000980] Probe device 'div-spi0' with clk-divider
[    0.000990] Probe device 'radio-spi0' with clk-ratio
[    0.001000] Probe device 'gate-spi0' with clk-gate
[    0.001010] Probe device 'spi0' with clk-gate
[    0.001020] Probe device 'mux-spi1' with clk-mux
[    0.001030] Probe device 'div-spi1' with clk-divider
[    0.001040] Probe device 'radio-spi1' with clk-ratio
[    0.001050] Probe device 'gate-spi1' with clk-gate
[    0.001060] Probe device 'spi1' with clk-gate
[    0.001070] Probe device 'mux-spi2' with clk-mux
[    0.001080] Probe device 'div-spi2' with clk-divider
[    0.001090] Probe device 'radio-spi2' with clk-ratio
[    0.001100] Probe device 'gate-spi2' with clk-gate
[    0.001110] Probe device 'spi2' with clk-gate
[    0.001120] Probe device 'gate-ephy' with clk-gate
[    0.001130] Probe device 'ephy' with clk-gate
[    0.001140] Probe device 'gmac' with clk-gate
[    0.001150] Probe device 'gpadc' with clk-gate
[    0.001160] Probe device 'ths' with clk-gate
[    0.001170] Probe device 'mux-i2s0' with clk-mux
[    0.001180] Probe device 'radio-i2s0' with clk-ratio
[    0.001190] Probe device 'gate-i2s0' with clk-gate
[    0.001200] Probe device 'i2s0' with clk-gate
[    0.001210] Probe device 'mux-i2s1' with clk-mux
[    0.001220] Probe device 'radio-i2s1' with clk-ratio
[    0.001230] Probe device 'gate-i2s1' with clk-gate
[    0.001240] Probe device 'i2s1' with clk-gate
[    0.001250] Probe device 'mux-codec1x' with clk-mux
[    0.001260] Probe device 'div-codec1x' with clk-divider
[    0.001270] Probe device 'gate-codec1x' with clk-gate
[    0.001280] Probe device 'codec1x' with clk-gate
[    0.001290] Probe device 'mux-codec4x' with clk-mux
[    0.001300] Probe device 'div-codec4x' with clk-divider
[    0.001310] Probe device 'gate-codec4x' with clk-gate
[    0.001320] Probe device 'codec4x' with clk-gate
[    0.001330] Probe device 'mux-usbohci0' with clk-mux
[    0.001340] Probe device 'usbphy0' with clk-gate
[    0.001350] Probe device 'gate-usbohci0' with clk-gate
[    0.001360] Probe device 'usbohci0' with clk-gate
[    0.001370] Probe device 'usbehci0' with clk-gate
[    0.001380] Probe device 'usbotg' with clk-gate
[    0.001390] Probe device 'mux-mipidphy0' with clk-mux
[    0.001400] Probe device 'div-mipidphy0' with clk-divider
[    0.001410] Probe device 'radio-mipidphy0' with clk-ratio
[    0.001420] Probe device 'gate-mipidphy0' with clk-gate
[    0.001430] Probe device 'mipidphy0' with clk-gate
[    0.001440] Probe device 'mux-mipihost0' with clk-mux
[    0.001450] Probe device 'div-mipihost0' with clk-divider
[    0.001460] Probe device 'gate-mipihost0' with clk-gate
[    0.001470] Probe device 'mipihost0' with clk-gate
[    0.001480] Probe device 'displaytop' with clk-gate
[    0.001490] Probe device 'mux-tcon' with clk-mux
[    0.001500] Probe device 'gate-tcon' with clk-gate
[    0.001510] Probe device 'tcon' with clk-gate
[    0.001520] Probe device 'mux-csitop' with clk-mux
[    0.001530] Probe device 'div-csitop' with clk-divider
[    0.001540] Probe device 'gate-csitop' with clk-gate
[    0.001550] Probe device 'csitop' with clk-gate
[    0.001560] Probe device 'mux-csimaster0' with clk-mux
[    0.001570] Probe device 'div-csimaster0' with clk-divider
[    0.001580] Probe device 'gate-csimaster0' with clk-gate
[    0.001590] Probe device 'csimaster0' with clk-gate
[    0.001600] Probe device 'mux-csimaster1' with clk-mux
[    0.001610] Probe device 'div-csimaster1' with clk-divider
[    0.001620] Probe device 'gate-csimaster1' with clk-gate
[    0.001630] Probe device 'csimaster1' with clk-gate
[    0.001640] Probe device 'mux-isp' with clk-mux
[    0.001650] Probe device 'div-isp' with clk-divider
[    0.001660] Probe device 'isp' with clk-gate
[    0.001670] Probe device 'mux-dspo' with clk-mux
[    0.001680] Probe device 'div-dspo' with clk-divider
[    0.001690] Probe device 'radio-dspo' with clk-ratio
[    0.001700] Probe device 'gate-dspo' with clk-gate
[    0.001710] Probe device 'dspo' with clk-gate
[    0.001720] Probe device 'mux-timer0' with clk-mux
[    0.001730] Probe device 'timer0' with clk-ratio
[    0.001740] Probe device 'mux-timer1' with clk-mux
[    0.001750] Probe device 'timer1' with clk-ratio
[    0.001760] Probe device 'pio' with clk-link
[    0.001770] Probe device 'wdg' with clk-link
[    0.001780] Probe device 'reset-v831.0' with reset-v831
[    0.001790] Probe device 'reset-v831.1' with reset-v831
[    0.001800] Probe device 'reset-v831.2' with reset-v831
[    0.001810] Probe device 'reset-v831.3' with reset-v831
[    0.001820] Probe device 'reset-v831.4' with reset-v831
[    0.001830] Probe device 'reset-v831.5' with reset-v831
[    0.001840] Probe device 'reset-v831.6' with reset-v831
[    0.001850] Probe device 'reset-v831.7' with reset-v831
[    0.001860] Probe device 'reset-v831.8' with reset-v831
[    0.001870] Probe device 'reset-v831.9' with reset-v831
[    0.001880] Probe device 'reset-v831.10' with reset-v831
[    0.001890] Probe device 'reset-v831.11' with reset-v831
[    0.001900] Probe device 'reset-v831.12' with reset-v831
[    0.001910] Probe device 'reset-v831.13' with reset-v831
[    0.001920] Probe device 'reset-v831.14' with reset-v831
[    0.001930] Probe device 'reset-v831.15' with reset-v831
[    0.001940] Probe device 'reset-v831.16' with reset-v831
[    0.001950] Probe device 'reset-v831.17' with reset-v831
[    0.001960] Probe device 'reset-v831.18' with reset-v831
[    0.001970] Probe device 'reset-v831.19' with reset-v831
[    0.001980] Probe device 'reset-v831.20' with reset-v831
[    0.001990] Probe device 'reset-v831.21' with reset-v831
[    0.002000] Probe device 'reset-v831.22' with reset-v831
[    0.002010] Probe device 'reset-v831.23' with reset-v831
[    0.002020] Probe device 'reset-v831.24' with reset-v831
[    0.002030] Probe device 'reset-v831.25' with reset-v831
[    0.002040] Probe device 'reset-v831.26' with reset-v831
[    0.002050] Probe device 'irq-gic400.0' with irq-gic400
[    0.002060] Probe device 'irq-v831-gpio.0' with irq-v831-gpio
[    0.002070] Probe device 'irq-v831-gpio.1' with irq-v831-gpio
[    0.002080] Probe device 'irq-v831-gpio.2' with irq-v831-gpio
[    0.002090] Probe device 'irq-v831-gpio.3' with irq-v831-gpio
[    0.002100] Probe device 'irq-v831-gpio.4' with irq-v831-gpio
[    0.002110] Probe device 'irq-v831-gpio.5' with irq-v831-gpio
[    0.002120] Probe device 'irq-v831-gpio.6' with irq-v831-gpio
[    0.002130] Probe device 'gpio-v831.0' with gpio-v831
[    0.002140] Probe device 'gpio-v831.1' with gpio-v831
[    0.002150] Probe device 'gpio-v831.2' with gpio-v831
[    0.002160] Probe device 'gpio-v831.3' with gpio-v831
[    0.002170] Probe device 'gpio-v831.4' with gpio-v831
[    0.002180] Probe device 'gpio-v831.5' with gpio-v831
[    0.002190] Probe device 'gpio-v831.6' with gpio-v831
[    0.002200] Probe device 'ce-v831-timer.0' with ce-v831-timer
[    0.000023] Probe device 'cs-v831-timer.0' with cs-v831-timer
[    0.006156] Probe device 'uart-16550.0' with uart-16550
[    0.011786] Probe device 'uart-16550.1' with uart-16550
[    0.017372] Probe device 'i2c-v831.0' with i2c-v831
[    0.022596] Probe device 'i2c-v831.1' with i2c-v831
[    0.027789] Probe device 'i2c-v831.2' with i2c-v831
[    0.033018] Probe device 'spi-v831.0' with spi-v831
[    0.182614] Probe device 'sdhci-v831.0' with sdhci-v831
[    0.198685] Found partition:
[    0.201662]   0x0000000000000000 ~ 0x0000000000ffffff 16.000MB  - blk-spinor.0
[    0.209421]   0x0000000000000000 ~ 0x00000000003fffff 4.000MB   - blk-spinor.0.xboot
[    0.217707]   0x0000000000400000 ~ 0x0000000000ffffff 12.000MB  - blk-spinor.0.private
[    0.226141] Probe device 'blk-spinor.0' with blk-spinor
[    0.231753] Probe device 'wdg-v831.0' with wdg-v831
[    0.236974] Probe device 'led-gpio.0' with led-gpio
[    0.242195] Probe device 'ledtrigger-heartbeat.0' with ledtrigger-heartbeat
[    0.249626] Probe device 'console-uart.0' with console-uart
[    0.257367] mount /private with 'ram' filesystem
Press any key to stop auto boot:  0.000
xboot: /# 

离线

楼主 #45 2020-12-10 14:33:43

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

编译源码,生成的目标文件在output目录下

make clean
make CROSS_COMPILE=/path/to/arm-linux-gnueabihf- PLATFORM=arm32-v831

烧写到RAM中并运行

sunxi-fel spl xboot.bin; sunxi-fel -p write 0x40000000 xboot.bin; sunxi-fel exec 0x40000000;

烧写普通镜像到SPI Flash

sunxi-fel -p spiflash-write 0 xboot.bin

关于sunxi-fel工具
sunxi-fel工具默认并没有集成spi flash写入功能,这里需要自行下载源码并编译,以支持spi flash烧写功能

下载sunxi-fel源码

git clone https://github.com/linux-sunxi/sunxi-tools.git

编译安装sunxi-fel

make
sudo make install

离线

楼主 #46 2020-12-10 14:50:04

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

扩展支持压缩镜像引导启动。

烧写压缩镜像到SPI Flash

sunxi-fel -p spiflash-write 0 xboot.bin.z

离线

楼主 #47 2020-12-10 14:53:20

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

对于SPI flash里面含有引导信息时,可以通过下面的指令,清除引导,避免繁琐的短接方式。

dcp @0x10:100 blk-spinor.0

就是随便写点数据去破坏引导头。

离线

楼主 #48 2020-12-10 15:13:08

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

V831内存带宽测试

tinymembench v0.3.9 (simple benchmark for memory throughput and latency)

==========================================================================
== Memory bandwidth tests                                               ==
==                                                                      ==
== Note 1: 1MB = 1000000 bytes                                          ==
== Note 2: Results for 'copy' tests show how many bytes can be          ==
==         copied per second (adding together read and writen           ==
==         bytes would have provided twice higher numbers)              ==
== Note 3: 2-pass copy means that we are using a small temporary buffer ==
==         to first fetch data into it, and only then write it to the   ==
==         destination (source -> L1 cache, L1 cache -> destination)    ==
== Note 4: If sample standard deviation exceeds 0.1%, it is shown in    ==
==         brackets                                                     ==
==========================================================================

 C copy backwards                                     :    206.3 MB/s
 C copy                                               :    641.3 MB/s
 C copy prefetched (32 bytes step)                    :    707.9 MB/s
 C copy prefetched (64 bytes step)                    :    707.9 MB/s
 C 2-pass copy                                        :    552.4 MB/s
 C 2-pass copy prefetched (32 bytes step)             :    626.1 MB/s
 C 2-pass copy prefetched (64 bytes step)             :    626.3 MB/s
 C fill                                               :   1999.9 MB/s
 ---
 standard memcpy                                      :    514.1 MB/s (17.9%)
 standard memset                                      :   1996.8 MB/s
 ---
 NEON read                                            :   1070.6 MB/s
 NEON read prefetched (32 bytes step)                 :   1168.2 MB/s
 NEON read prefetched (64 bytes step)                 :   1197.8 MB/s
 NEON read 2 data streams                             :    314.2 MB/s
 NEON read 2 data streams prefetched (32 bytes step)  :    577.8 MB/s
 NEON read 2 data streams prefetched (64 bytes step)  :    626.3 MB/s
 NEON copy                                            :    690.7 MB/s
 NEON copy prefetched (32 bytes step)                 :    693.0 MB/s
 NEON copy prefetched (64 bytes step)                 :    762.1 MB/s
 NEON unrolled copy                                   :    688.1 MB/s (0.1%)
 NEON unrolled copy prefetched (32 bytes step)        :    723.7 MB/s
 NEON unrolled copy prefetched (64 bytes step)        :    731.8 MB/s
 NEON copy backwards                                  :    678.1 MB/s
 NEON copy backwards prefetched (32 bytes step)       :    682.2 MB/s
 NEON copy backwards prefetched (64 bytes step)       :    748.8 MB/s
 NEON 2-pass copy                                     :    660.3 MB/s
 NEON 2-pass copy prefetched (32 bytes step)          :    698.0 MB/s
 NEON 2-pass copy prefetched (64 bytes step)          :    712.3 MB/s
 NEON unrolled 2-pass copy                            :    553.8 MB/s
 NEON unrolled 2-pass copy prefetched (32 bytes step) :    543.9 MB/s
 NEON unrolled 2-pass copy prefetched (64 bytes step) :    585.7 MB/s
 NEON fill                                            :   2001.8 MB/s
 NEON fill backwards                                  :   1997.8 MB/s
 ARM fill (STRD)                                      :   1996.9 MB/s
 ARM fill (STM with 8 registers)                      :   2000.7 MB/s
 ARM fill (STM with 4 registers)                      :   2001.7 MB/s
 ARM copy prefetched (incr pld)                       :    739.2 MB/s
 ARM copy prefetched (wrap pld)                       :    693.7 MB/s
 ARM 2-pass copy prefetched (incr pld)                :    652.7 MB/s
 ARM 2-pass copy prefetched (wrap pld)                :    625.4 MB/s

==========================================================================
== Memory latency test                                                  ==
==                                                                      ==
== Average time is measured for random memory accesses in the buffers   ==
== of different sizes. The larger is the buffer, the more significant   ==
== are relative contributions of TLB, L1/L2 cache misses and SDRAM      ==
== accesses. For extremely large buffer sizes we are expecting to see   ==
== page table walk with several requests to SDRAM for almost every      ==
== memory access (though 64MiB is not nearly large enough to experience ==
== this effect to its fullest).                                         ==
==                                                                      ==
== Note 1: All the numbers are representing extra time, which needs to  ==
==         be added to L1 cache latency. The cycle timings for L1 cache ==
==         latency can be usually found in the processor documentation. ==
== Note 2: Dual random read means that we are simultaneously performing ==
==         two independent memory accesses at a time. In the case if    ==
==         the memory subsystem can't handle multiple outstanding       ==
==         requests, dual random read has the same timings as two       ==
==         single reads performed one after another.                    ==
==========================================================================

block size : single random read / dual random read
      1024 :    0.0 ns          /     0.0 ns 
      2048 :    0.0 ns          /     0.0 ns 
      4096 :    0.0 ns          /     0.0 ns 
      8192 :    0.0 ns          /     0.0 ns 
     16384 :    0.0 ns          /     0.0 ns 
     32768 :    0.0 ns          /     0.0 ns 
     65536 :    7.1 ns          /    12.7 ns 
    131072 :   10.9 ns          /    18.4 ns 
    262144 :   94.2 ns          /   153.3 ns 
    524288 :  145.8 ns          /   209.1 ns 
   1048576 :  173.6 ns          /   230.1 ns 
   2097152 :  187.8 ns          /   238.3 ns 
   4194304 :  194.8 ns          /   242.0 ns 
   8388608 :  198.3 ns          /   243.9 ns

离线

楼主 #49 2020-12-10 15:40:20

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

最难啃的骨头已搞定,剩下的就看各位道友各显神通了,我的任务完成了。

离线

#50 2020-12-10 15:47:24

aozima
会员
所在地: 深圳
注册时间: 2019-05-25
已发帖子: 298
积分: 179.5
个人网站

Re: 全志V831芯片裸机开发日记--移植V831到xboot

xboot 说:

最难啃的骨头已搞定,剩下的就看各位道友各显神通了,我的任务完成了。

搞点白菜板来玩玩,哈哈。

NPU部分得要原厂给支持了,不用NPU没灵魂。

最近编辑记录 aozima (2020-12-10 15:48:29)

离线

楼主 #51 2020-12-10 16:09:56

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

NPU还需要集各大网友的力量,这个肯定需要时间

离线

楼主 #52 2020-12-11 19:56:47

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

增加高级组件可配置选项,增强灵活性,有效降低程序体积。
第一个选项是,LUA FRAMEWORK框架,禁止后,lua相关的全部关闭
第二个选项是,CAIRO加速渲染驱动,禁止后,用系统自带的渲染库,这个能少个1-2MB空间。
第三个选项,正常情况都是关闭的,白盒测试工具。

#
# Configurable advanced custom components
#
CFG_FRAMEWORK	?= y
CFG_CAIRO		?= y
CFG_WBOXTEST 	?= n

将上面的选项改成下面的选项,并删除所有字体文件

#
# Configurable advanced custom components
#
CFG_FRAMEWORK	?= n
CFG_CAIRO		?= n
CFG_WBOXTEST 	?= n

体积大大缩小,不压缩1.3MB,压缩后800KB,有效降低了程序的体积

copy from `../output/xboot' [elf32-littlearm] to `../output/xboot.bin' [binary]
Make header information for brom booting
The bootloader head has been fixed, spl size is 19456 bytes.
Compressed 1381888 bytes into 834800 bytes ==> 60.410106% [C][S]

离线

楼主 #53 2020-12-11 20:01:21

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

现在禁用各种高级组件后,启动速度,还不是很快,还需要进一步优化,核心瓶颈应该是SPI NOR FLASH的读取速度,还有一个地方就是压缩镜像的解压速度。
现在压缩镜像体积比不压缩的小了40%,但是启动速度却慢了很多,看来解压速度这块,瓶颈比较明显。
这个解压速度瓶颈,应该跟mmu相关,在自拷贝时,还没能开mmu,这个地方可以优化。

离线

楼主 #54 2020-12-11 21:45:58

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

终于压缩镜像的启动速度比非压缩镜像的启动速度快了,主要有两个改变:
1,SRAM里的代码执行速度很慢,在DDR初始化好后,立即先自拷贝一份SPL到DDR,然后跳到DDR再执行后面的操作,比如,初始化栈,完整代码自拷贝,清BSS段等等。也就是说,要尽可能快的离开慢吞吞的SRAM。
2,在完整自拷贝前,先初始化MMU,这样压缩镜像的解压提升很明显。

如果仅仅做第二点修改,而第一点未修改时,解压速度还是很慢的,猜测,其实不是SRAM速度慢,而是DDR空间做了MMU映射,SRAM空间未做任何映射导致的。

离线

楼主 #55 2020-12-11 22:01:48

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

猜测不成立,SRAM就是水,都无法使能CACHE,看来还是要坚守第一时间离开SRAM环境。

离线

楼主 #56 2020-12-11 22:12:26

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

整体启动速度大大提升,基本可以接受的层次,如果还要优化启动速度,特别是需要提升大镜像启动速度时,就剩最后一个可以优化的地方了,就是提升SPI NOR FLASH的读取速度了,现在的带宽大概2MB,提升个10倍还是有可能的,这个任务有热心的网友吗,V831的SPI控制器跟V3S,F1C100S的兼容,不过增加了一些寄存器。

离线

楼主 #57 2020-12-12 20:28:02

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

一个技巧,minicom可以打印时间戳,可以很方便的调试启动时间,这个是压缩镜像的启动时间,spi flash 自拷贝以及解压大概500ms左右。

[2020-12-12 20:25:21.224] dram_tpr5:0x0x48484848.
[2020-12-12 20:25:21.228] dram_tpr6:0x0x00000048.
[2020-12-12 20:25:21.228] DX0 state:1
[2020-12-12 20:25:21.228] DX1 state:1
[2020-12-12 20:25:21.256] dram_tpr5:0x0x48484848.
[2020-12-12 20:25:21.256] dram_tpr6:0x0x00000048.
[2020-12-12 20:25:21.260] [AUTO DEBUG] two rank and full DQ!
[2020-12-12 20:25:21.263] [AUTO DEBUG] DDR2 try success
[2020-12-12 20:25:21.283] dram_tpr5:0x0x48484848.
[2020-12-12 20:25:21.288] dram_tpr6:0x0x00000048.
[2020-12-12 20:25:21.292] [AUTO DEBUG] single rank and full DQ!
[2020-12-12 20:25:21.315] dram_tpr5:0x0x48484848.
[2020-12-12 20:25:21.320] dram_tpr6:0x0x00000048.
[2020-12-12 20:25:21.320] [AUTO DEBUG] rank 0 row = 13 
[2020-12-12 20:25:21.324] [AUTO DEBUG] rank 0 bank = 4 
[2020-12-12 20:25:21.329] [AUTO DEBUG] rank 0 page size = 2 KB 
[2020-12-12 20:25:21.329] DRAM BOOT DRIVE INFO: V0.20
[2020-12-12 20:25:21.332] DRAM CLK = 528 MHz
[2020-12-12 20:25:21.332] DRAM Type = 2 (2:DDR2,3:DDR3)
[2020-12-12 20:25:21.336] DRAMC read ODT  off.
[2020-12-12 20:25:21.340] DRAM ODT off.
[2020-12-12 20:25:21.340] DRAM tpr10 = 0x00000000
[2020-12-12 20:25:21.340] DRAM tpr11 = 0x00120000
[2020-12-12 20:25:21.344] DRAM tpr12 = 0x00000023
[2020-12-12 20:25:21.352] dram_tpr5:0x0x48484848.
[2020-12-12 20:25:21.356] dram_tpr6:0x0x00000048.
[2020-12-12 20:25:21.356] ACMDLR: 0x00804646
[2020-12-12 20:25:21.360] DXnMDLR(0): 0x00604545
[2020-12-12 20:25:21.360] DXnMDLR(1): 0x00444445
[2020-12-12 20:25:21.364] DRAM SIZE =64 M
[2020-12-12 20:25:21.364] DRAM simple random test OK.
[2020-12-12 20:25:21.828]        _                   _                     
[2020-12-12 20:25:21.832]  _  _ | |___ _____ _____ _| |_                   
[2020-12-12 20:25:21.836] \ \/ /|  _  |  _  |  _  |_   _|  (C) 2007-2020   
[2020-12-12 20:25:21.840]  )  ( | |_| | |_| | |_| | | |____JIANJUN.JIANG__ 
[2020-12-12 20:25:21.844] /_/\_\|_____|_____|_____| |_____________________|
[2020-12-12 20:25:21.852] V3.0.0 (Dec 12 2020 - 20:22:07) - [sipeed][Sipeed(Maix-II) Based On Allwinner V831 SOC]
[2020-12-12 20:25:21.860] [    0.000000] Probe device 'blk-romdisk.0' with blk-romdisk
[2020-12-12 20:25:21.872] [    0.000010] Probe device 'losc' with clk-fixed
[2020-12-12 20:25:21.876] [    0.000020] Probe device 'iosc' with clk-fixed
[2020-12-12 20:25:21.880] [    0.000030] Probe device 'osc24m' with clk-fixed
[2020-12-12 20:25:21.884] [    0.000040] Probe device 'pll-periph0div25m' with clk-fixed
[2020-12-12 20:25:21.892] [    0.000050] Probe device 'osc48m' with clk-fixed
[2020-12-12 20:25:21.896] [    0.000060] Probe device 'pll-cpux' with clk-v831-pll
[2020-12-12 20:25:21.900] [    0.000070] Probe device 'pll-ddr0' with clk-v831-pll
[2020-12-12 20:25:21.908] [    0.000080] Probe device 'pll-periph0' with clk-v831-pll
[2020-12-12 20:25:21.912] [    0.000090] Probe device 'pll-uni' with clk-v831-pll
[2020-12-12 20:25:21.916] [    0.000100] Probe device 'pll-video0' with clk-v831-pll
[2020-12-12 20:25:21.924] [    0.000110] Probe device 'pll-audio' with clk-v831-pll
[2020-12-12 20:25:21.928] [    0.000120] Probe device 'pll-csi' with clk-v831-pll
[2020-12-12 20:25:21.932] [    0.000130] Probe device 'pll-periph0x2' with clk-fixed-factor
[2020-12-12 20:25:21.940] [    0.000140] Probe device 'periph32k' with clk-fixed-factor
[2020-12-12 20:25:21.944] [    0.000150] Probe device 'pll-unix2' with clk-fixed-factor
[2020-12-12 20:25:21.952] [    0.000160] Probe device 'pll-audiox4' with clk-fixed-factor
[2020-12-12 20:25:21.956] [    0.000170] Probe device 'pll-audiox2' with clk-fixed-factor
[2020-12-12 20:25:21.964] [    0.000180] Probe device 'pll-video0x4' with clk-fixed-factor
[2020-12-12 20:25:21.968] [    0.000190] Probe device 'mbus' with clk-fixed-factor
[2020-12-12 20:25:21.976] [    0.000200] Probe device 'osc24m-2' with clk-fixed-factor
[2020-12-12 20:25:21.980] [    0.000210] Probe device 'osc24m-750' with clk-fixed-factor
[2020-12-12 20:25:21.988] [    0.000220] Probe device 'osc48m-4' with clk-fixed-factor
[2020-12-12 20:25:21.992] [    0.000230] Probe device 'cpu' with clk-mux
[2020-12-12 20:25:21.996] [    0.000240] Probe device 'axi' with clk-divider
[2020-12-12 20:25:22.004] [    0.000250] Probe device 'cpuapb' with clk-ratio
[2020-12-12 20:25:22.008] [    0.000260] Probe device 'mux-psi' with clk-mux
[2020-12-12 20:25:22.012] [    0.000270] Probe device 'div-psi' with clk-divider
[2020-12-12 20:25:22.016] [    0.000280] Probe device 'radio-psi' with clk-ratio
[2020-12-12 20:25:22.024] [    0.000290] Probe device 'psi' with clk-gate
[2020-12-12 20:25:22.028] [    0.000300] Probe device 'ahb1' with clk-link
[2020-12-12 20:25:22.032] [    0.000310] Probe device 'ahb2' with clk-link
[2020-12-12 20:25:22.036] [    0.000320] Probe device 'mux-ahb3' with clk-mux
[2020-12-12 20:25:22.040] [    0.000330] Probe device 'div-ahb3' with clk-divider
[2020-12-12 20:25:22.048] [    0.000340] Probe device 'ahb3' with clk-ratio
[2020-12-12 20:25:22.052] [    0.000350] Probe device 'mux-apb1' with clk-mux
[2020-12-12 20:25:22.056] [    0.000360] Probe device 'div-apb1' with clk-divider
[2020-12-12 20:25:22.060] [    0.000370] Probe device 'apb1' with clk-ratio
[2020-12-12 20:25:22.068] [    0.000380] Probe device 'mux-apb2' with clk-mux
[2020-12-12 20:25:22.072] [    0.000390] Probe device 'div-apb2' with clk-divider
[2020-12-12 20:25:22.076] [    0.000400] Probe device 'apb2' with clk-ratio
[2020-12-12 20:25:22.080] [    0.000410] Probe device 'mux-de' with clk-mux
[2020-12-12 20:25:22.084] [    0.000420] Probe device 'div-de' with clk-divider
[2020-12-12 20:25:22.092] [    0.000430] Probe device 'gate-de' with clk-gate
[2020-12-12 20:25:22.096] [    0.000440] Probe device 'de' with clk-gate
[2020-12-12 20:25:22.100] [    0.000450] Probe device 'mux-g2d' with clk-mux
[2020-12-12 20:25:22.104] [    0.000460] Probe device 'div-g2d' with clk-divider
[2020-12-12 20:25:22.112] [    0.000470] Probe device 'gate-g2d' with clk-gate
[2020-12-12 20:25:22.116] [    0.000480] Probe device 'g2d' with clk-gate
[2020-12-12 20:25:22.120] [    0.000490] Probe device 'mux-ce' with clk-mux
[2020-12-12 20:25:22.124] [    0.000500] Probe device 'div-ce' with clk-divider
[2020-12-12 20:25:22.128] [    0.000510] Probe device 'radio-ce' with clk-ratio
[2020-12-12 20:25:22.136] [    0.000520] Probe device 'gate-ce' with clk-gate
[2020-12-12 20:25:22.140] [    0.000530] Probe device 'ce' with clk-gate
[2020-12-12 20:25:22.144] [    0.000540] Probe device 'mux-ve' with clk-mux
[2020-12-12 20:25:22.148] [    0.000550] Probe device 'div-ve' with clk-divider
[2020-12-12 20:25:22.156] [    0.000560] Probe device 'gate-ve' with clk-gate
[2020-12-12 20:25:22.160] [    0.000570] Probe device 've' with clk-gate
[2020-12-12 20:25:22.164] [    0.000580] Probe device 'mux-eise' with clk-mux
[2020-12-12 20:25:22.168] [    0.000590] Probe device 'div-eise' with clk-divider
[2020-12-12 20:25:22.172] [    0.000600] Probe device 'gate-eise' with clk-gate
[2020-12-12 20:25:22.180] [    0.000610] Probe device 'eise' with clk-gate
[2020-12-12 20:25:22.184] [    0.000620] Probe device 'mux-nna' with clk-mux
[2020-12-12 20:25:22.188] [    0.000630] Probe device 'div-nna' with clk-divider
[2020-12-12 20:25:22.192] [    0.000640] Probe device 'gate-nna' with clk-gate
[2020-12-12 20:25:22.200] [    0.000650] Probe device 'nna' with clk-gate
[2020-12-12 20:25:22.204] [    0.000660] Probe device 'dma' with clk-gate
[2020-12-12 20:25:22.208] [    0.000670] Probe device 'hstimer' with clk-gate
[2020-12-12 20:25:22.212] [    0.000680] Probe device 'avs' with clk-gate
[2020-12-12 20:25:22.216] [    0.000690] Probe device 'dbgsys' with clk-gate
[2020-12-12 20:25:22.224] [    0.000700] Probe device 'pwm' with clk-gate
[2020-12-12 20:25:22.228] [    0.000710] Probe device 'mux-sdram' with clk-mux
[2020-12-12 20:25:22.232] [    0.000720] Probe device 'div-sdram' with clk-divider
[2020-12-12 20:25:22.236] [    0.000730] Probe device 'sdram' with clk-gate
[2020-12-12 20:25:22.240] [    0.000740] Probe device 'mux-sdmmc0' with clk-mux
[2020-12-12 20:25:22.248] [    0.000750] Probe device 'div-sdmmc0' with clk-divider
[2020-12-12 20:25:22.252] [    0.000760] Probe device 'radio-sdmmc0' with clk-ratio
[2020-12-12 20:25:22.256] [    0.000770] Probe device 'gate-sdmmc0' with clk-gate
[2020-12-12 20:25:22.264] [    0.000780] Probe device 'sdmmc0' with clk-gate
[2020-12-12 20:25:22.268] [    0.000790] Probe device 'mux-sdmmc1' with clk-mux
[2020-12-12 20:25:22.272] [    0.000800] Probe device 'div-sdmmc1' with clk-divider
[2020-12-12 20:25:22.280] [    0.000810] Probe device 'radio-sdmmc1' with clk-ratio
[2020-12-12 20:25:22.284] [    0.000820] Probe device 'gate-sdmmc1' with clk-gate
[2020-12-12 20:25:22.288] [    0.000830] Probe device 'sdmmc1' with clk-gate
[2020-12-12 20:25:22.296] [    0.000840] Probe device 'mux-sdmmc2' with clk-mux
[2020-12-12 20:25:22.300] [    0.000850] Probe device 'div-sdmmc2' with clk-divider
[2020-12-12 20:25:22.304] [    0.000860] Probe device 'radio-sdmmc2' with clk-ratio
[2020-12-12 20:25:22.312] [    0.000870] Probe device 'gate-sdmmc2' with clk-gate
[2020-12-12 20:25:22.316] [    0.000880] Probe device 'sdmmc2' with clk-gate
[2020-12-12 20:25:22.320] [    0.000890] Probe device 'uart0' with clk-gate
[2020-12-12 20:25:22.324] [    0.000900] Probe device 'uart1' with clk-gate
[2020-12-12 20:25:22.332] [    0.000910] Probe device 'uart2' with clk-gate
[2020-12-12 20:25:22.336] [    0.000920] Probe device 'uart3' with clk-gate
[2020-12-12 20:25:22.340] [    0.000930] Probe device 'twi0' with clk-gate
[2020-12-12 20:25:22.344] [    0.000940] Probe device 'twi1' with clk-gate
[2020-12-12 20:25:22.348] [    0.000950] Probe device 'twi2' with clk-gate
[2020-12-12 20:25:22.354] [    0.000960] Probe device 'twi3' with clk-gate
[2020-12-12 20:25:22.359] [    0.000970] Probe device 'mux-spi0' with clk-mux
[2020-12-12 20:25:22.364] [    0.000980] Probe device 'div-spi0' with clk-divider
[2020-12-12 20:25:22.368] [    0.000990] Probe device 'radio-spi0' with clk-ratio
[2020-12-12 20:25:22.372] [    0.001000] Probe device 'gate-spi0' with clk-gate
[2020-12-12 20:25:22.380] [    0.001010] Probe device 'spi0' with clk-gate
[2020-12-12 20:25:22.384] [    0.001020] Probe device 'mux-spi1' with clk-mux
[2020-12-12 20:25:22.388] [    0.001030] Probe device 'div-spi1' with clk-divider
[2020-12-12 20:25:22.392] [    0.001040] Probe device 'radio-spi1' with clk-ratio
[2020-12-12 20:25:22.400] [    0.001050] Probe device 'gate-spi1' with clk-gate
[2020-12-12 20:25:22.404] [    0.001060] Probe device 'spi1' with clk-gate
[2020-12-12 20:25:22.408] [    0.001070] Probe device 'mux-spi2' with clk-mux
[2020-12-12 20:25:22.412] [    0.001080] Probe device 'div-spi2' with clk-divider
[2020-12-12 20:25:22.420] [    0.001090] Probe device 'radio-spi2' with clk-ratio
[2020-12-12 20:25:22.424] [    0.001100] Probe device 'gate-spi2' with clk-gate
[2020-12-12 20:25:22.428] [    0.001110] Probe device 'spi2' with clk-gate
[2020-12-12 20:25:22.436] [    0.001120] Probe device 'gate-ephy' with clk-gate
[2020-12-12 20:25:22.440] [    0.001130] Probe device 'ephy' with clk-gate
[2020-12-12 20:25:22.444] [    0.001140] Probe device 'gmac' with clk-gate
[2020-12-12 20:25:22.448] [    0.001150] Probe device 'gpadc' with clk-gate
[2020-12-12 20:25:22.452] [    0.001160] Probe device 'ths' with clk-gate
[2020-12-12 20:25:22.456] [    0.001170] Probe device 'mux-i2s0' with clk-mux
[2020-12-12 20:25:22.464] [    0.001180] Probe device 'radio-i2s0' with clk-ratio
[2020-12-12 20:25:22.468] [    0.001190] Probe device 'gate-i2s0' with clk-gate
[2020-12-12 20:25:22.472] [    0.001200] Probe device 'i2s0' with clk-gate
[2020-12-12 20:25:22.476] [    0.001210] Probe device 'mux-i2s1' with clk-mux
[2020-12-12 20:25:22.484] [    0.001220] Probe device 'radio-i2s1' with clk-ratio
[2020-12-12 20:25:22.488] [    0.001230] Probe device 'gate-i2s1' with clk-gate
[2020-12-12 20:25:22.492] [    0.001240] Probe device 'i2s1' with clk-gate
[2020-12-12 20:25:22.496] [    0.001250] Probe device 'mux-codec1x' with clk-mux
[2020-12-12 20:25:22.504] [    0.001260] Probe device 'div-codec1x' with clk-divider
[2020-12-12 20:25:22.508] [    0.001270] Probe device 'gate-codec1x' with clk-gate
[2020-12-12 20:25:22.516] [    0.001280] Probe device 'codec1x' with clk-gate
[2020-12-12 20:25:22.520] [    0.001290] Probe device 'mux-codec4x' with clk-mux
[2020-12-12 20:25:22.524] [    0.001300] Probe device 'div-codec4x' with clk-divider
[2020-12-12 20:25:22.528] [    0.001310] Probe device 'gate-codec4x' with clk-gate
[2020-12-12 20:25:22.536] [    0.001320] Probe device 'codec4x' with clk-gate
[2020-12-12 20:25:22.540] [    0.001330] Probe device 'mux-usbohci0' with clk-mux
[2020-12-12 20:25:22.544] [    0.001340] Probe device 'usbphy0' with clk-gate
[2020-12-12 20:25:22.552] [    0.001350] Probe device 'gate-usbohci0' with clk-gate
[2020-12-12 20:25:22.555] [    0.001360] Probe device 'usbohci0' with clk-gate
[2020-12-12 20:25:22.560] [    0.001370] Probe device 'usbehci0' with clk-gate
[2020-12-12 20:25:22.564] [    0.001380] Probe device 'usbotg' with clk-gate
[2020-12-12 20:25:22.572] [    0.001390] Probe device 'mux-mipidphy0' with clk-mux
[2020-12-12 20:25:22.576] [    0.001400] Probe device 'div-mipidphy0' with clk-divider
[2020-12-12 20:25:22.580] [    0.001410] Probe device 'radio-mipidphy0' with clk-ratio
[2020-12-12 20:25:22.588] [    0.001420] Probe device 'gate-mipidphy0' with clk-gate
[2020-12-12 20:25:22.592] [    0.001430] Probe device 'mipidphy0' with clk-gate
[2020-12-12 20:25:22.600] [    0.001440] Probe device 'mux-mipihost0' with clk-mux
[2020-12-12 20:25:22.604] [    0.001450] Probe device 'div-mipihost0' with clk-divider
[2020-12-12 20:25:22.608] [    0.001460] Probe device 'gate-mipihost0' with clk-gate
[2020-12-12 20:25:22.616] [    0.001470] Probe device 'mipihost0' with clk-gate
[2020-12-12 20:25:22.620] [    0.001480] Probe device 'displaytop' with clk-gate
[2020-12-12 20:25:22.624] [    0.001490] Probe device 'mux-tcon' with clk-mux
[2020-12-12 20:25:22.632] [    0.001500] Probe device 'gate-tcon' with clk-gate
[2020-12-12 20:25:22.636] [    0.001510] Probe device 'tcon' with clk-gate
[2020-12-12 20:25:22.640] [    0.001520] Probe device 'mux-csitop' with clk-mux
[2020-12-12 20:25:22.644] [    0.001530] Probe device 'div-csitop' with clk-divider
[2020-12-12 20:25:22.652] [    0.001540] Probe device 'gate-csitop' with clk-gate
[2020-12-12 20:25:22.656] [    0.001550] Probe device 'csitop' with clk-gate
[2020-12-12 20:25:22.660] [    0.001560] Probe device 'mux-csimaster0' with clk-mux
[2020-12-12 20:25:22.668] [    0.001570] Probe device 'div-csimaster0' with clk-divider
[2020-12-12 20:25:22.672] [    0.001580] Probe device 'gate-csimaster0' with clk-gate
[2020-12-12 20:25:22.676] [    0.001590] Probe device 'csimaster0' with clk-gate
[2020-12-12 20:25:22.684] [    0.001600] Probe device 'mux-csimaster1' with clk-mux
[2020-12-12 20:25:22.688] [    0.001610] Probe device 'div-csimaster1' with clk-divider
[2020-12-12 20:25:22.696] [    0.001620] Probe device 'gate-csimaster1' with clk-gate
[2020-12-12 20:25:22.700] [    0.001630] Probe device 'csimaster1' with clk-gate
[2020-12-12 20:25:22.704] [    0.001640] Probe device 'mux-isp' with clk-mux
[2020-12-12 20:25:22.712] [    0.001650] Probe device 'div-isp' with clk-divider
[2020-12-12 20:25:22.716] [    0.001660] Probe device 'isp' with clk-gate
[2020-12-12 20:25:22.720] [    0.001670] Probe device 'mux-dspo' with clk-mux
[2020-12-12 20:25:22.724] [    0.001680] Probe device 'div-dspo' with clk-divider
[2020-12-12 20:25:22.732] [    0.001690] Probe device 'radio-dspo' with clk-ratio
[2020-12-12 20:25:22.736] [    0.001700] Probe device 'gate-dspo' with clk-gate
[2020-12-12 20:25:22.740] [    0.001710] Probe device 'dspo' with clk-gate
[2020-12-12 20:25:22.744] [    0.001720] Probe device 'mux-timer0' with clk-mux
[2020-12-12 20:25:22.752] [    0.001730] Probe device 'timer0' with clk-ratio
[2020-12-12 20:25:22.756] [    0.001740] Probe device 'mux-timer1' with clk-mux
[2020-12-12 20:25:22.760] [    0.001750] Probe device 'timer1' with clk-ratio
[2020-12-12 20:25:22.763] [    0.001760] Probe device 'pio' with clk-link
[2020-12-12 20:25:22.768] [    0.001770] Probe device 'wdg' with clk-link
[2020-12-12 20:25:22.776] [    0.001780] Probe device 'reset-v831.0' with reset-v831
[2020-12-12 20:25:22.780] [    0.001790] Probe device 'reset-v831.1' with reset-v831
[2020-12-12 20:25:22.784] [    0.001800] Probe device 'reset-v831.2' with reset-v831
[2020-12-12 20:25:22.792] [    0.001810] Probe device 'reset-v831.3' with reset-v831
[2020-12-12 20:25:22.796] [    0.001820] Probe device 'reset-v831.4' with reset-v831
[2020-12-12 20:25:22.804] [    0.001830] Probe device 'reset-v831.5' with reset-v831
[2020-12-12 20:25:22.808] [    0.001840] Probe device 'reset-v831.6' with reset-v831
[2020-12-12 20:25:22.812] [    0.001850] Probe device 'reset-v831.7' with reset-v831
[2020-12-12 20:25:22.820] [    0.001860] Probe device 'reset-v831.8' with reset-v831
[2020-12-12 20:25:22.824] [    0.001870] Probe device 'reset-v831.9' with reset-v831
[2020-12-12 20:25:22.832] [    0.001880] Probe device 'reset-v831.10' with reset-v831
[2020-12-12 20:25:22.836] [    0.001890] Probe device 'reset-v831.11' with reset-v831
[2020-12-12 20:25:22.840] [    0.001900] Probe device 'reset-v831.12' with reset-v831
[2020-12-12 20:25:22.848] [    0.001910] Probe device 'reset-v831.13' with reset-v831
[2020-12-12 20:25:22.852] [    0.001920] Probe device 'reset-v831.14' with reset-v831
[2020-12-12 20:25:22.860] [    0.001930] Probe device 'reset-v831.15' with reset-v831
[2020-12-12 20:25:22.863] [    0.001940] Probe device 'reset-v831.16' with reset-v831
[2020-12-12 20:25:22.867] [    0.001950] Probe device 'reset-v831.17' with reset-v831
[2020-12-12 20:25:22.876] [    0.001960] Probe device 'reset-v831.18' with reset-v831
[2020-12-12 20:25:22.880] [    0.001970] Probe device 'reset-v831.19' with reset-v831
[2020-12-12 20:25:22.888] [    0.001980] Probe device 'reset-v831.20' with reset-v831
[2020-12-12 20:25:22.892] [    0.001990] Probe device 'reset-v831.21' with reset-v831
[2020-12-12 20:25:22.900] [    0.002000] Probe device 'reset-v831.22' with reset-v831
[2020-12-12 20:25:22.904] [    0.002010] Probe device 'reset-v831.23' with reset-v831
[2020-12-12 20:25:22.908] [    0.002020] Probe device 'reset-v831.24' with reset-v831
[2020-12-12 20:25:22.916] [    0.002030] Probe device 'reset-v831.25' with reset-v831
[2020-12-12 20:25:22.920] [    0.002040] Probe device 'reset-v831.26' with reset-v831
[2020-12-12 20:25:22.928] [    0.002050] Probe device 'irq-gic400.0' with irq-gic400
[2020-12-12 20:25:22.932] [    0.002060] Probe device 'irq-v831-gpio.0' with irq-v831-gpio
[2020-12-12 20:25:22.940] [    0.002070] Probe device 'irq-v831-gpio.1' with irq-v831-gpio
[2020-12-12 20:25:22.944] [    0.002080] Probe device 'irq-v831-gpio.2' with irq-v831-gpio
[2020-12-12 20:25:22.952] [    0.002090] Probe device 'irq-v831-gpio.3' with irq-v831-gpio
[2020-12-12 20:25:22.956] [    0.002100] Probe device 'irq-v831-gpio.4' with irq-v831-gpio
[2020-12-12 20:25:22.964] [    0.002110] Probe device 'irq-v831-gpio.5' with irq-v831-gpio
[2020-12-12 20:25:22.968] [    0.002120] Probe device 'irq-v831-gpio.6' with irq-v831-gpio
[2020-12-12 20:25:22.976] [    0.002130] Probe device 'gpio-v831.0' with gpio-v831
[2020-12-12 20:25:22.980] [    0.002140] Probe device 'gpio-v831.1' with gpio-v831
[2020-12-12 20:25:22.988] [    0.002150] Probe device 'gpio-v831.2' with gpio-v831
[2020-12-12 20:25:22.992] [    0.002160] Probe device 'gpio-v831.3' with gpio-v831
[2020-12-12 20:25:22.996] [    0.002170] Probe device 'gpio-v831.4' with gpio-v831
[2020-12-12 20:25:23.004] [    0.002180] Probe device 'gpio-v831.5' with gpio-v831
[2020-12-12 20:25:23.008] [    0.002190] Probe device 'gpio-v831.6' with gpio-v831
[2020-12-12 20:25:23.012] [    0.002200] Probe device 'ce-v831-timer.0' with ce-v831-timer
[2020-12-12 20:25:23.020] [    0.000023] Probe device 'cs-v831-timer.0' with cs-v831-timer
[    0.006155] Probe device 'uart-16550.0' with uart-16550
[2020-12-12 20:25:23.032] [    0.011832] Probe device 'uart-16550.1' with uart-16550
[2020-12-12 20:25:23.036] [    0.017419] Probe device 'i2c-v831.0' with i2c-v831
[2020-12-12 20:25:23.040] [    0.022614] Probe device 'i2c-v831.1' with i2c-v831
[2020-12-12 20:25:23.048] [    0.027832] Probe device 'i2c-v831.2' with i2c-v831
[2020-12-12 20:25:23.052] [    0.033061] Probe device 'spi-v831.0' with spi-v831
[2020-12-12 20:25:23.200] [    0.182667] Probe device 'sdhci-v831.0' with sdhci-v831
[2020-12-12 20:25:23.220] [    0.198836] Found partition:
[2020-12-12 20:25:23.220] [    0.201838]   0x0000000000000000 ~ 0x0000000000ffffff 16.000MB  - blk-spinor.0
[2020-12-12 20:25:23.228] [    0.209551]   0x0000000000000000 ~ 0x00000000003fffff 4.000MB   - blk-spinor.0.xboot
[2020-12-12 20:25:23.236] [    0.217824]   0x0000000000400000 ~ 0x0000000000ffffff 12.000MB  - blk-spinor.0.private
[2020-12-12 20:25:23.244] [    0.226257] Probe device 'blk-spinor.0' with blk-spinor
[2020-12-12 20:25:23.252] [    0.231853] Probe device 'wdg-v831.0' with wdg-v831
[2020-12-12 20:25:23.256] [    0.237081] Probe device 'led-gpio.0' with led-gpio
[2020-12-12 20:25:23.260] [    0.242277] Probe device 'ledtrigger-heartbeat.0' with ledtrigger-heartbeat
[2020-12-12 20:25:23.268] [    0.249715] Probe device 'console-uart.0' with console-uart
[2020-12-12 20:25:23.276] [    0.256532] mount /private with 'ram' filesystem
Press any key to stop auto boot:  0.000

离线

楼主 #58 2020-12-12 20:40:49

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

上面的启动时间,从上电到进xboot命令行,总共2S左右,其中除了前面的500ms,自拷贝解压消耗,剩下的都是xboot启动时的串口打印消耗,做个实验,关闭xboot的log信息,看看启动速度。

[2020-12-12 20:34:42.695] dram_tpr5:0x0x48484848.
[2020-12-12 20:34:42.695] dram_tpr6:0x0x00000048.
[2020-12-12 20:34:42.699] DX0 state:1
[2020-12-12 20:34:42.699] DX1 state:1
[2020-12-12 20:34:42.727] dram_tpr5:0x0x48484848.
[2020-12-12 20:34:42.727] dram_tpr6:0x0x00000048.
[2020-12-12 20:34:42.731] [AUTO DEBUG] two rank and full DQ!
[2020-12-12 20:34:42.731] [AUTO DEBUG] DDR2 try success
[2020-12-12 20:34:42.755] dram_tpr5:0x0x48484848.
[2020-12-12 20:34:42.759] dram_tpr6:0x0x00000048.
[2020-12-12 20:34:42.759] [AUTO DEBUG] single rank and full DQ!
[2020-12-12 20:34:42.787] dram_tpr5:0x0x48484848.
[2020-12-12 20:34:42.787] dram_tpr6:0x0x00000048.
[2020-12-12 20:34:42.791] [AUTO DEBUG] rank 0 row = 13 
[2020-12-12 20:34:42.795] [AUTO DEBUG] rank 0 bank = 4 
[2020-12-12 20:34:42.795] [AUTO DEBUG] rank 0 page size = 2 KB 
[2020-12-12 20:34:42.799] DRAM BOOT DRIVE INFO: V0.20
[2020-12-12 20:34:42.803] DRAM CLK = 528 MHz
[2020-12-12 20:34:42.803] DRAM Type = 2 (2:DDR2,3:DDR3)
[2020-12-12 20:34:42.807] DRAMC read ODT  off.
[2020-12-12 20:34:42.807] DRAM ODT off.
[2020-12-12 20:34:42.811] DRAM tpr10 = 0x00000000
[2020-12-12 20:34:42.811] DRAM tpr11 = 0x00120000
[2020-12-12 20:34:42.815] DRAM tpr12 = 0x00000023
[2020-12-12 20:34:42.823] dram_tpr5:0x0x48484848.
[2020-12-12 20:34:42.823] dram_tpr6:0x0x00000048.
[2020-12-12 20:34:42.827] ACMDLR: 0x00464646
[2020-12-12 20:34:42.827] DXnMDLR(0): 0x00404546
[2020-12-12 20:34:42.831] DXnMDLR(1): 0x00504444
[2020-12-12 20:34:42.831] DRAM SIZE =64 M
[2020-12-12 20:34:42.835] DRAM simple random test OK.
Press any key to stop auto boot:  0.000
[2020-12-12 20:34:43.503]  could not found 'launcher' command
[2020-12-12 20:34:43.503] xboot: /# 

关闭log信息后,可以看出从上电到进xboot命令行总共808毫秒,如果减去前面的500ms自拷贝,xboot自身启动过程大概消耗300ms左右。

这个结果也是比较能接受的,如果还要优化,就优化自拷贝的带宽,200ms自拷贝的话,那么总共500ms就显得比较完美了。

离线

楼主 #59 2020-12-12 20:55:42

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

DDR初始化消耗了大概150ms,所以,xboot自身消耗也就150ms,如果再花200ms的自拷贝,那么总共是350ms左右。

最近编辑记录 xboot (2020-12-12 22:45:04)

离线

#60 2020-12-13 03:49:45

mfkiwl
会员
注册时间: 2019-02-27
已发帖子: 45
积分: 32

Re: 全志V831芯片裸机开发日记--移植V831到xboot

支持大佬。要是搞定了NPU,那这芯片用途就大了。这个NPU据说是通用性比较强的,也就是说可能用于矩阵运算等用途

离线

#61 2020-12-13 12:55:15

TivonLiu
会员
注册时间: 2019-12-27
已发帖子: 41
积分: 41

Re: 全志V831芯片裸机开发日记--移植V831到xboot

感谢分享,留下记录,后面慢慢研究

离线

楼主 #62 2020-12-15 14:08:01

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

小蚁1080P版摄像头,一个V831芯片的马甲。
1.jpg
2.jpg

离线

#63 2020-12-15 14:16:51

lghtjpu
会员
注册时间: 2020-02-23
已发帖子: 38
积分: 32.5

Re: 全志V831芯片裸机开发日记--移植V831到xboot

可否买来当开发板呢?

离线

楼主 #64 2020-12-15 14:21:48

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

小蚁摄像头反编译后的设备树文件,有这个就没必要猜测硬件连接了,直接看源码。

devicetree.zip

离线

楼主 #65 2020-12-15 14:24:53

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

可以当开发板,就是没啥外围可玩设备比较少而已,如果获取设备树,看这个链接。
https://github.com/Stefichen5/YiHomeLinux

离线

#66 2020-12-15 14:53:45

gdfsli
会员
注册时间: 2018-07-11
已发帖子: 28
积分: 28

Re: 全志V831芯片裸机开发日记--移植V831到xboot

AI版Y3是不是?

离线

#67 2020-12-15 14:54:16

李某人
会员
注册时间: 2020-01-10
已发帖子: 19
积分: 14

Re: 全志V831芯片裸机开发日记--移植V831到xboot

V831上哪儿买的开发板

离线

楼主 #68 2020-12-15 16:06:07

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

YI 1080P 具体是这个型号,Y20GA,串口打印信息。

[38]HELLO! BOOT0 is starting Nov 14 2019 20:01:31!
[43]BOOT0 commit : 81c18ee
[46]board init start
[48]set pll start
[50]set pll end
[52][pmu]: bus read error
[54]board init ok
[56]chip id check OK
[58]DRAM BOOT DRIVE INFO: V0.41
[61]DRAM CLK = 528 MHz
[63]DRAM Type = 2 (2:DDR2,3:DDR3)
[67]DRAMC read ODT  off.
[69]DRAM ODT off.
[71]DRAM SIZE =64 M
[78]DRAM simple test OK.
[80]rtc standby flag is 0x0, super standby flag is 0x0
[86]dram size =64
[88]spinor id is: 1c 70 18, read cmd: 03
[92]Succeed in reading toc file head.
[96]The size of toc is 6c000.
[169]Entry_name        = optee
[173]Entry_name        = u-boot
[178]Entry_name        = dtb
[181]Jump to secend Boot.
MESSAGE: [0x0] TEE-CORE: OP-TEE version: sun8iw19p1_v0.6.0-12-g97f2688 #1 2019年 11月 08日 星期五 08:26:51 UTC arm
ERROR:   [0x0] TEE-CORE:platform_standby_fdt_parse:126: no pmu node
ERROR:   [0x0] TEE-CORE:sunxi_twi_parse_from_dt:84: no pmu node


U-Boot 2018.05-00002-g932b424-dirty (Dec 13 2019 - 18:10:34 +0800) Allwinner Technology

[00.249]CPU:   Allwinner Family
[00.252]Model: sun8iw19
I2C:   ready
[00.256]DRAM:  64 MiB
[00.259]Relocation Offset is: f9f6a000
[00.275]secure enable bit: 0
[00.277]pmu_axp2101_probe pmic_bus_read fail
[00.281]drivers/sunxi_power/pmu_axpnull.c pmu_axpnull_probe 26 axpdummy probe
[00.288]bmu_axp2101_probe pmic_bus_read fail
[00.292]BMU: AXPNULL
[00.295]CPU=816 MHz,PLL6=600 Mhz,AHB=200 Mhz, APB1=100Mhz  MBus=132Mhz
[00.301]gic: sec monitor mode
[00.304]flash init start
[00.306]workmode = 0,storage type = 3
SF: Detected en25qh128 with page size 256 Bytes, erase size 64 KiB, total 16 MiB
[00.316]sunxi flash init ok



[00.320]Loading Environment from SUNXI_FLASH... OK
[00.351]sprite_led_gpio start
[00.355]update dts
root_partition is rootfs
set root to /dev/mtdblock2
[00.365]update part info
[00.367]update bootcmd
[00.369]No ethernet found.
[00.371]get mem for descripter OK !

[00.597]Card did not respond to voltage select!
card0 init failed
No sd-card insert,will normal boot
Hit any key to stop autoboot:  0 
## Booting kernel from Legacy Image at 45000000 ...
   Image Name:   ARM OpenWrt Linux-4.9.118
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2080440 Bytes = 2 MiB
   Load Address: 40008000
   Entry Point:  40008000
[02.153]Starting kernel ...

[    0.000000] ion_mem_reserve: err format for ion reserve list!
[    0.112556] ion_heap_create: Invalid heap type 4
[    0.119527] sunxi_i2c_probe()2209 - [i2c1] warning: failed to get regulator id
[    0.147483] uart uart0: get regulator failed
[    0.175081] sunxi-wlan wlan: request pincrtl handle for device [wlan] failed
[    0.183454] sunxi-wlan wlan: get gpio chip_en failed
[    0.205744] mtd: partition "UDISK" is out of reach -- disabled
[    0.217258] VE: get debugfs_mpp_root is NULL, please check mpp
[    0.217258] 
[    0.490547] mmc:failed to get gpios
[    0.533994] sunxi-mmc sdc1: smc 1 p1 err, cmd 52, RTO !!
[    0.540851] sunxi-mmc sdc1: smc 1 p1 err, cmd 52, RTO !!
[    0.551315] sunxi-mmc sdc1: smc 1 p1 err, cmd 8, RTO !!
[    0.558112] sunxi-mmc sdc1: smc 1 p1 err, cmd 5, RTO !!
[    0.564894] sunxi-mmc sdc1: smc 1 p1 err, cmd 5, RTO !!
[    0.571675] sunxi-mmc sdc1: smc 1 p1 err, cmd 5, RTO !!
[    0.578461] sunxi-mmc sdc1: smc 1 p1 err, cmd 5, RTO !!
[    0.585253] sunxi-mmc sdc1: smc 1 p1 err, cmd 55, RTO !!
[    0.592104] sunxi-mmc sdc1: smc 1 p1 err, cmd 55, RTO !!
[    0.598985] sunxi-mmc sdc1: smc 1 p1 err, cmd 55, RTO !!
[    0.605889] sunxi-mmc sdc1: smc 1 p1 err, cmd 55, RTO !!
[    0.612920] sunxi-mmc sdc1: smc 1 p1 err, cmd 1, RTO !!
starting pid 465, tty '': '/etc/init.d/rcS boot'
[RCS]: /etc/init.d/S01udev
Populating /dev using udev: [    0.919848] udevd[470]: bind failed: Read-only file system
[    0.926166] udevd[470]: error binding udev control socket
done
[RCS]: /etc/init.d/S02app
[RCS]: /etc/init.d/S20urandom
--------------------------home app init.sh--------------------------
read-only file system detected...done
starting pid 481, tty '/dev/console': '-/bin/sh'
vm.dirty_background_ratio = 2


BusyBox v1.27.2 () built-in shell (ash)

vm.dirty_expire_centisecs = 500
vm.dirty_ratio = 2

            __    __   _
            \ \  / /  | |
             \ \/ /   | |
              \  /    | |
              / /     | |
             /_/      |_|
 ------------------------------------
 Welcome to XiaoYi Linux.
 ------------------------------------
 
root@xiaoyi:/# vm.dirty_writeback_centisecs = 100
fs.mqueue.msg_max = 256
cat: can't open '/sys/block/mmcblk0/device/cid': No such file or directory
checkdisk, main() ret_status(10012) 
checkdisk, main() ret_status(10012),g_sysconf_ptr->tf_status.stat(10012) 
umount: can't unmount /tmp/sd: Invalid argument
mount: mounting /dev/mmcblk0p1 on /tmp/sd failed: No such file or directory
---update file(home_y20gam) Not exist---
--------------------------insmod sound--------------------------
[    3.232950] --->sunxi_daudio_dev_probe<--- strat.
[    3.238706] --->sunxi_daudio_dev_probe<--- end.
--------------------------insmod sensor--------------------------
[    3.870154] sunxi-mmc sdc1: smc 1 p1 err, cmd 8, RTO !!
insmod: can't insert '/home/app/localko/ssp_ms41909.ko': No such file or directory
hue, start_with_reset = 1 @get_config()->g_sysconf.ssid == 0 
>>>>>>>>>>>>>#########is_sd_exit chg to: 10012<<<<<<<<<<<<<<<<<<<WARNING: awplayer <log_set_level:30>: Set log level to 3
DEBUG  : awplayer <ReadPluginEntry:194>: read plugin entry adecoder-0 fail!
DEBUG  : awplayer <CdxPluginLoadList:221>: have config 0 entry
DEBUG  : awplayer <CdxPluginLoadList:222>: start to open adecoder lib
DEBUG  : awplayer <CdxPluginLoadList:202>: Load Plugin list vdecoder
DEBUG  : awplayer <ReadPluginEntry:178>: read plugin entry vdecoder-0 ok.
DEBUG  : awplayer <ReadPluginEntry:178>: read plugin entry vdecoder-1 ok.
DEBUG  : awplayer <ReadPluginEntry:178>: read plugin entry vdecoder-2 ok.
DEBUG  : awplayer <ReadPluginEntry:194>: read plugin entry vdecoder-3 fail!
DEBUG  : awplayer <CdxPluginLoadList:221>: have config 3 entry
DEBUG  : awplayer <CdxPluginLoadList:222>: start to open vdecoder lib
DEBUG  : awplayer <DlOpenPlugin:96>: plugin vdecoder.h264 comment is "h264_vdecoder"
DEBUG  : awplayer <DlOpenPlugin:97>: plugin open lib: libawh264.so
ERROR  : awplayer <DlOpenPlugin:103>: dlopen 'libawh264.so' fail: Error loading shared library libawh264.so: No such file or directory
DEBUG  : awplayer <CdxPluginLoadList:231>: load vdecoder id vdecoder.h264 fail!
DEBUG  : awplayer <DlOpenPlugin:96>: plugin vdecoder.h265 comment is "h265_vdecoder"
DEBUG  : awplayer <DlOpenPlugin:97>: plugin open lib: libawh265.so
ERROR  : awplayer <DlOpenPlugin:103>: dlopen 'libawh265.so' fail: Error loading shared library libawh265.so: No such file or directory
DEBUG  : awplayer <CdxPluginLoadList:231>: load vdecoder id vdecoder.h265 fail!
DEBUG  : awplayer <DlOpenPlugin:96>: plugin vdecoder.mjpegplus comment is "mjpegplus_vdecoder"
DEBUG  : awplayer <DlOpenPlugin:97>: plugin open lib: libawmjpegplus.so
ERROR  : awplayer <DlOpenPlugin:103>: dlopen 'libawmjpegplus.so' fail: Error loading shared library libawmjpegplus.so: No such file or directory
DEBUG  : awplayer <CdxPluginLoadList:231>: load vdecoder id vdecoder.mjpegplus fail!
DEBUG  : awplayer <CdxPluginLoadList:202>: Load Plugin list plugin
DEBUG  : awplayer <ReadPluginEntry:194>: read plugin entry plugin-0 fail!
DEBUG  : awplayer <CdxPluginLoadList:221>: have config 0 entry
DEBUG  : awplayer <CdxPluginLoadList:222>: start to open plugin lib
----detect sensor name[sp2305_mipi]----
insmod: can't insert '/home/app/localko/ssp_ms41909.ko': No such file or directory
>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Media Process Platform<<<<<<<<<<<<<<<<<<<<<<<<<<<<
modName : MPP-Platform
tag   : V1.0 Release
branch: v5-dev
commit: 4eed413532ad87725895a8cb1ba75e22fc328233
date  : 20170725
author: jenkins
[ISP]>>>>>>>>>>>>>>>>>>>> ISP VERSION INFO <<<<<<<<<<<<<<<<<<<
IPCORE: ISP521
branch: libisp-dev
commit: f7a1fa1355aeec538bba4966c371096781171ef8
date  : Wed Dec 25 15:48:50 2019 +0800
author: jiangwei
--------------------------------------------------------

debug  : cedarc <VeInitialize:1214>: *** nPhyOffset = 0x0
debug  : cedarc <VeSetSpeed:1730>: *** set ve freq to 300 Mhz ***
debug  : cedarc <VeInitialize:1270>: ve init ok

E0119 06:41:37.734069   533 alsa_interface.c:785]           <alsaMixerSetAudioCodecHubMode> aec_elem_audio_codec_hub_mode:codec hub mode-1
E0119 06:41:37.734411   533 alsa_interface.c:808]           <alsaMixerSetDAudio0HubMode> aec_elem_daudio0_hub_mode:sunxi daudio audio hub mode-2
E0119 06:41:37.734570   533 alsa_interface.c:831]           <alsaMixerSetDAudio0LoopBackEn> aec_elem_daudio0_loopback_en:sunxi daudio loopback debug-1
W0119 06:41:37.781163   533 mpi_ao.c:194]                   <AW_MPI_AO_EnableChn> AODev has started when enableChn(0)! It must be started by other chns!
(Allwinner Audio Middle Layer),line(1091) : Create Decoder!!=====
(Allwinner Audio Middle Layer),line(709) : AudioDec_Installaudiolib ok
(Allwinner Audio Middle Layer),line(712) : audio decoder init start ...
(AllwinnerAlibs),line(50) : 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Audio <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
tag   : audiocodec-v1.2
branch: new
commit: 3ba65962c01cbf1280ddda19d843009b6ef8ce85
date  : Tue Jan 8 16:25:27 2019 +0800
----------------------------------------------------------------------

(AllwinnerAlibs),line(654) : ----Loading so success!
(AllwinnerAlibs),line(852) : *************pAudioStreamInfo start******************
(AllwinnerAlibs),line(853) : eCodecFormat         :id(4), name(aac low-complexy)
(AllwinnerAlibs),line(854) : eSubCodecFormat      :0
(AllwinnerAlibs),line(855) : nChannelNum          :1
(AllwinnerAlibs),line(856) : nBitsPerSample       :1024
(AllwinnerAlibs),line(857) : nSampleRate          :16000
(AllwinnerAlibs),line(858) : nAvgBitrate          :0
(AllwinnerAlibs),line(859) : nMaxBitRate          :0
(AllwinnerAlibs),line(860) : nFileSize            :0
(AllwinnerAlibs),line(861) : eAudioBitstreamSource:0
(AllwinnerAlibs),line(862) : eDataEncodeType      :0
(AllwinnerAlibs),line(863) : nCodecSpecificDataLen:2
(AllwinnerAlibs),line(864) : pCodecSpecificData   :0x14bfc70
(AllwinnerAlibs),line(865) : nFlags               :0
(AllwinnerAlibs),line(866) : nBlockAlign          :0
(AllwinnerAlibs),line(867) : *************pAudioStreamInfo end  ******************
(AAC Decoder),line(36) : init successs...
(Allwinner Audio Middle Layer),line(720) : AUDIO DECODE INIT OK...0
[ISP]video device name is vin_video2
[ISP]open video device[2] success!
E0119 06:41:37.855777   533 video_buffer_manager.c:211]     <VideoBufMgrCreate> Alloc 20 input frame buffers in list manager.
E0119 06:41:37.856811   533 VideoVirVi_Component.c:481]     <VideoViSetViDevAttr> fps 20 nbufs 3
open /dev/sunxi_soc_info failed!loop VideoInputHw_CapThread vipp_id = 2, buf_num=3.
E0119 06:41:37.861135   533 v429_mpp.c:3185]                <rmm_init_vi> create VI, devNum:2, virChCnt:1
[ISP]>>>>>>>>>>>>>>>>>>>> ISP VERSION INFO <<<<<<<<<<<<<<<<<<<
IPCORE: ISP521
branch: libisp-dev
commit: f7a1fa1355aeec538bba4966c371096781171ef8
date  : Wed Dec 25 15:48:50 2019 +0800
author: jiangwei
--------------------------------------------------------

[ISP]open isp device[0] success!
[ISP_WARN]sdcard is not mounted!!!
[ISP]find sp2305_mipi_1936_1096_20_0 [sp2305_mipi_init_day] isp config
[ISP]create isp0 server thread!
move mirror to mpi_vi.h : AW_MPI_VI_GetVippMirror. 
move flip to mpi_vi.h : AW_MPI_VI_GetVippFlip. 
debug  : cedarc <LogVersionInfo:40>: 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Cedar Codec <<<<<<<<<<<<<<<<<<<<<<<<<<<<
tag   : CedarC-v1.2.0
branch: tina-dev
commit: 3d35be0e1fa8e19e358705ecf0e6f62064287e6f
date  : Tue May 7 18:26:47 2019 +0800
author: ericwang
patch : 
----------------------------------------------------------------------

debug  : cedarc <VeInitialize:1214>: *** nPhyOffset = 0x0
debug  : cedarc <VeSetSpeed:1730>: *** set ve freq to 300 Mhz ***
debug  : cedarc <VeInitialize:1270>: ve init ok

debug  : ionAlloc <__GetIonMemOpsS:956>: *** get __GetIonMemOpsS ***
debug  : ionAlloc <ion_alloc_open:137>: begin ion_alloc_open 

debug  : cedarc <VeInitialize:1214>: *** nPhyOffset = 0x0
debug  : cedarc <VeSetSpeed:1730>: *** set ve freq to 300 Mhz ***
debug  : cedarc <VeInitialize:1270>: ve init ok

debug  : ionAlloc <ion_alloc_open:178>: ** phy offset = 0
debug  : cedarc <VeRelease:1342>: ve release ok

debug  : cedarc <JpegEncOpen:1246>: init mutex_overlay
warning: cedarc <JpegSetParameter:2188>: jpeg do not support this 4 indexType
debug  : cedarc <BitStreamCreate:121>: BitStreamCreate OK
warning: cedarc <JpegSetParameter:2188>: jpeg do not support this 1287 indexType
rmm_init_yuv_jpg(4146) VenChn(3): rmm_create_bmp_osd ok.
rmm_create_time_osd(564) rmm_create_time_osd, VenChn(3), osd_hdl(7) ok.
rmm_init_yuv_jpg(4156) VenChn(3): rmm_create_time_osd ok.
rmm_init_yuv_jpg ok. 
E0119 06:41:38.007961   599 AudioDec_Component.c:2275]      <ComponentThread> get audio decoder info fail!
W0119 06:41:38.010634   609 audio_hw.c:1647]                <AudioHw_AO_SetPubAttr> Careful for 2 AoChns at the same time! They must have the same param!
send_ao_beep(2540) ----read audio file finish----

msg_head->mainOperation(4098)
send_ao_beep(2540) ----read audio file finish----

离线

楼主 #69 2020-12-15 16:08:17

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

gdfsli 说:

AI版Y3是不是?

Y20这个是V831芯片
1_20201215-1607.jpg

离线

楼主 #70 2020-12-15 16:59:42

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

YI 1080P dump image
yi1080p-spi-nor.7z

离线

楼主 #71 2020-12-15 18:31:36

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

gpiochip1: GPIOs 0-287, parent: platform/pio, pio:
 gpio-0   (                    |?                   ) in  lo    
 gpio-68  (                    |card-pwr-gpios      ) out lo    
 gpio-144 (                    |reset_btn           ) in  hi    
 gpio-145 (                    |led_orange          ) out hi    
 gpio-166 (                    |cd                  ) in  lo    
 gpio-198 (                    |wlan_regon          ) out hi    
 gpio-199 (                    |wlan_hostwake       ) in  hi    
 gpio-235 (                    |ir_cut_anode        ) out lo    
 gpio-236 (                    |ir_cut_cathode      ) out lo    
 gpio-237 (                    |led_bule            ) out lo    
 gpio-238 (                    |speaker_en          ) out hi    
 gpio-259 (                    |?                   ) out hi    
 gpio-260 (                    |?                   ) out hi   

离线

楼主 #72 2020-12-15 18:32:53

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

小蚁摄像头相关GPIO定义

离线

楼主 #73 2020-12-15 18:40:54

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

 pwm-0   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
 pwm-1   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
 pwm-2   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
 pwm-3   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
 pwm-4   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
 pwm-5   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
 pwm-6   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
 pwm-7   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
 pwm-8   (ir_led              ): requested enabled period: 1000 ns duty: 0 ns polarity: inverse
 pwm-9   ((null)              ): period: 0 ns duty: 0 ns polarity: normal

离线

楼主 #74 2020-12-15 18:50:55

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

registered pins: 93
pin 64 (PC0) 
pin 65 (PC1) 
pin 66 (PC2) 
pin 67 (PC3) 
pin 68 (PC4) 
pin 69 (PC5) 
pin 70 (PC6) 
pin 71 (PC7) 
pin 72 (PC8) 
pin 73 (PC9) 
pin 74 (PC10) 
pin 75 (PC11) 
pin 96 (PD0) 
pin 97 (PD1) 
pin 98 (PD2) 
pin 99 (PD3) 
pin 100 (PD4) 
pin 101 (PD5) 
pin 102 (PD6) 
pin 103 (PD7) 
pin 104 (PD8) 
pin 105 (PD9) 
pin 106 (PD10) 
pin 107 (PD11) 
pin 108 (PD12) 
pin 109 (PD13) 
pin 110 (PD14) 
pin 111 (PD15) 
pin 112 (PD16) 
pin 113 (PD17) 
pin 114 (PD18) 
pin 115 (PD19) 
pin 116 (PD20) 
pin 117 (PD21) 
pin 118 (PD22) 
pin 128 (PE0) 
pin 129 (PE1) 
pin 130 (PE2) 
pin 131 (PE3) 
pin 132 (PE4) 
pin 133 (PE5) 
pin 134 (PE6) 
pin 135 (PE7) 
pin 136 (PE8) 
pin 137 (PE9) 
pin 138 (PE10) 
pin 139 (PE11) 
pin 140 (PE12) 
pin 141 (PE13) 
pin 142 (PE14) 
pin 143 (PE15) 
pin 144 (PE16) 
pin 145 (PE17) 
pin 146 (PE18) 
pin 147 (PE19) 
pin 148 (PE20) 
pin 149 (PE21) 
pin 160 (PF0) 
pin 161 (PF1) 
pin 162 (PF2) 
pin 163 (PF3) 
pin 164 (PF4) 
pin 165 (PF5) 
pin 166 (PF6) 
pin 192 (PG0) 
pin 193 (PG1) 
pin 194 (PG2) 
pin 195 (PG3) 
pin 196 (PG4) 
pin 197 (PG5) 
pin 198 (PG6) 
pin 199 (PG7) 
pin 224 (PH0) 
pin 225 (PH1) 
pin 226 (PH2) 
pin 227 (PH3) 
pin 228 (PH4) 
pin 229 (PH5) 
pin 230 (PH6) 
pin 231 (PH7) 
pin 232 (PH8) 
pin 233 (PH9) 
pin 234 (PH10) 
pin 235 (PH11) 
pin 236 (PH12) 
pin 237 (PH13) 
pin 238 (PH14) 
pin 239 (PH15) 
pin 256 (PI0) 
pin 257 (PI1) 
pin 258 (PI2) 
pin 259 (PI3) 
pin 260 (PI4)

离线

楼主 #75 2020-12-16 17:49:47

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

更新eclipse环境的交叉编译器,用上ARM官方的GCC-10.2,高版本多了些警告,应该是更完备了,将出现警告的地方做了修复。涉及的BSP较多,全统一修改了,一个比较大的变化是,DMA POOL实现是个弱函数了,还有malloc也是一个弱函数了,方便overlay。

https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads

离线

楼主 #76 2020-12-16 17:53:12

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

还有一个重大改变,就是malloc对齐问题,之前32位系统malloc分配的是4字节对齐,64位系统是8字节对齐,这个其实是不满足规范的,应该是两倍VOID * 大小,也就是说,32位系统是8字节对齐,64位系统是16字节对齐。

这个问题不修复的话,32位系统下,malloc double类型是可能出现对齐问题的,不仅仅是效率问题,而是根本无法正确执行。

离线

楼主 #77 2020-12-18 09:36:58

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

V833跟V831是同一个die,但封装不一样,性能要强很多,拆解了一款科大讯飞的词典笔,使用的V833,体验不错。
拆解链接
https://zhuanlan.zhihu.com/p/337743111

离线

#78 2020-12-19 10:33:52

mysteryli
会员
注册时间: 2020-03-05
已发帖子: 305
积分: 254
个人网站

Re: 全志V831芯片裸机开发日记--移植V831到xboot

xboot 说:

大佬,这个貌似是齐感的芯片吧,不是全志的啊,还是说他俩本就是一家??

离线

楼主 #79 2020-12-19 13:42:21

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

同一颗芯片的,丝印了下,算个马甲

离线

楼主 #80 2020-12-21 21:36:16

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

实现V831的DMA驱动,驱动路径
https://github.com/xboot/xboot/blob/master/src/arch/arm32/mach-v831/driver/dma-v831.c
一个小插曲,在编写DMA驱动时,发现一个奇怪的现象,如果先跑下uboot,再执行xboot的话,xboot里的DMA驱动就完全正常,如果直接运行xboot,不先跑下uboot的,就不正常,DMA完全不工作。这个问题比较棘手,比较了整个DMA寄存器,完全没有差异,但CCU部分有几个寄存器有差别,将这些差异重新初始化,DMA就完全正常了,问题就出在这4个寄存器里了,对照手册,发现是804这个gating没开。

	//cpux
	write32(0x03001400, 0x1440400e);

	write32(0x0300179c, 0x00000001);
	write32(0x03001804, 0x00000005);
	write32(0x03001830, 0x8100000b);

打如下补丁,彻底解决此问题。

ea47494e9ad86c460fb724daa9d083af909122bc
 src/arch/arm32/mach-v831/sys-clock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/arch/arm32/mach-v831/sys-clock.c b/src/arch/arm32/mach-v831/sys-clock.c
index 82311fdad..0a8d1ec28 100644
--- a/src/arch/arm32/mach-v831/sys-clock.c
+++ b/src/arch/arm32/mach-v831/sys-clock.c
@@ -102,4 +102,7 @@ void sys_clock_init(void)
 
 	/* apb2 = osc24m / (0 + 1) / (0 + 1) */
 	write32(V831_CCU_BASE + CCU_APB2_CFG, 0x00000000);
+
+	/* mclk gating enable for core component */
+	write32(V831_CCU_BASE + 0x0804, 0x08800707);
 }

离线

楼主 #81 2020-12-22 14:17:44

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

编写GPADC驱动,V831自带2路12位ADC,实际仅引出一路,代码路径
https://github.com/xboot/xboot/blob/master/src/arch/arm32/mach-v831/driver/adc-v831.c

基于ADC通道0,实现ADC按键,仅需增加如下设备树。

	"key-adc@0": {
		"adc-name": "adc-v831.0",
		"adc-channel": 0,
		"poll-interval-ms": 100,
		"keys": [
			{ "min-voltage":  850000, "max-voltage":  950000, "key-code": 10 },
			{ "min-voltage": 1000000, "max-voltage": 1100000, "key-code": 11 }
		]
	},

用event工具测试按键事件

xboot: /# event
[key-adc.0]: [KeyDown] [10]
[key-adc.0]: [KeyUp] [10]
[key-adc.0]: [KeyDown] [10]
[key-adc.0]: [KeyUp] [10]
[key-adc.0]: [KeyDown] [10]
[key-adc.0]: [KeyUp] [10]
[key-adc.0]: [KeyDown] [10]
[key-adc.0]: [KeyUp] [10]
[key-adc.0]: [KeyDown] [10]
[key-adc.0]: [KeyUp] [10]
[key-adc.0]: [KeyDown] [10]
[key-adc.0]: [KeyUp] [10]
[key-adc.0]: [KeyDown] [11]
[key-adc.0]: [KeyUp] [11]
[key-adc.0]: [KeyDown] [11]
[key-adc.0]: [KeyUp] [11]
[key-adc.0]: [KeyDown] [11]
[key-adc.0]: [KeyUp] [11]
[key-adc.0]: [KeyDown] [11]
[key-adc.0]: [KeyUp] [11]
[key-adc.0]: [KeyDown] [11]
[key-adc.0]: [KeyUp] [11]
[key-adc.0]: [KeyDown] [11]
[key-adc.0]: [KeyUp] [11]
[key-adc.0]: [KeyDown] [11]
[key-adc.0]: [KeyUp] [11]
[key-adc.0]: [KeyDown] [11]
[key-adc.0]: [KeyUp] [11]
[key-adc.0]: [KeyDown] [10]
[key-adc.0]: [KeyUp] [10]
[key-adc.0]: [KeyDown] [11]
[key-adc.0]: [KeyUp] [11]

离线

楼主 #82 2020-12-22 14:37:21

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

全志V831实现基于ADC的按键驱动
https://zhuanlan.zhihu.com/p/338706534

离线

楼主 #83 2020-12-22 19:37:37

xboot
会员
注册时间: 2019-10-15
已发帖子: 442
积分: 286

Re: 全志V831芯片裸机开发日记--移植V831到xboot

离线

#84 2020-12-30 14:19:26

xiaohui
会员
注册时间: 2019-01-15
已发帖子: 245
积分: 168.5

Re: 全志V831芯片裸机开发日记--移植V831到xboot

感觉外设拆的差不多了。

离线

#85 2021-01-05 13:06:35

liio
会员
注册时间: 2021-01-05
已发帖子: 1
积分: 1

Re: 全志V831芯片裸机开发日记--移植V831到xboot

@xboot 请问有没有兴趣考虑来微信的工作?

离线

#86 2021-01-05 13:56:01

raspberryman
会员
注册时间: 2019-12-27
已发帖子: 503
积分: 465

Re: 全志V831芯片裸机开发日记--移植V831到xboot

liio 说:

@xboot 请问有没有兴趣考虑来微信的工作?

诱惑太小的话,xboot是挖不动的,除非投资他的公司。

离线

#87 2021-01-18 20:10:55

jlau
会员
注册时间: 2018-06-11
已发帖子: 159
积分: 147.5

Re: 全志V831芯片裸机开发日记--移植V831到xboot

liio 说:

@xboot 请问有没有兴趣考虑来微信的工作?

拿张小龙的钱,维护xboot和libonnx吗? lol

离线

#88 2021-01-19 10:13:25

jiangchun9981
会员
注册时间: 2019-07-31
已发帖子: 154
积分: 139.5

Re: 全志V831芯片裸机开发日记--移植V831到xboot

在xboot的群混过

xboot的性格,不可能接受打工的,即使年薪再高   除非一个有吸引力的项目当老大权限很大的那种,就像腾讯和张小龙的关系

离线

#89 2021-01-25 21:30:59

kekemuyu
会员
注册时间: 2018-12-13
已发帖子: 752
积分: 688

Re: 全志V831芯片裸机开发日记--移植V831到xboot

在淘宝看到sipeed 的maix2开卖了(基于v831)

离线

#90 2021-01-26 13:14:33

大帅
会员
注册时间: 2019-01-17
已发帖子: 164
积分: 133.5

Re: 全志V831芯片裸机开发日记--移植V831到xboot

这个片子多少钱?是不是一百多 lol

离线

#91 2021-01-26 13:15:52

大帅
会员
注册时间: 2019-01-17
已发帖子: 164
积分: 133.5

Re: 全志V831芯片裸机开发日记--移植V831到xboot

搞错了,AIC800 一百多

离线

#92 2021-01-27 00:08:03

lghtjpu
会员
注册时间: 2020-02-23
已发帖子: 38
积分: 32.5

Re: 全志V831芯片裸机开发日记--移植V831到xboot

AIC800也不用一百多吧,貌似70内

离线

#93 2021-01-27 10:19:11

jiangchun9981
会员
注册时间: 2019-07-31
已发帖子: 154
积分: 139.5

Re: 全志V831芯片裸机开发日记--移植V831到xboot

sipeed 的maix2
看到介绍提供神经网络的PYTHON实现,那搞AI就比较方便了啊   
原来K210只有8M的SRAM,模型不能太大 
这个V831 64M的DDR ,不知道模型限制如何?

离线

#94 2021-07-06 08:20:22

feisheng168
会员
注册时间: 2021-04-21
已发帖子: 2
积分: 66

Re: 全志V831芯片裸机开发日记--移植V831到xboot

牛掰呀,V831必须支持:P

离线

#95 2021-07-06 09:03:03

sunxiang
会员
注册时间: 2021-05-05
已发帖子: 176
积分: 120

Re: 全志V831芯片裸机开发日记--移植V831到xboot

有NPU是不是代表可以通过硬件支持神经网络加速了?

离线

#96 2021-08-15 00:28:14

shareall123
会员
注册时间: 2021-08-14
已发帖子: 1
积分: 0.5

Re: 全志V831芯片裸机开发日记--移植V831到xboot

请问,谁有V833/V831_PINOUT.xls
准备做个板子

离线

#97 2021-09-23 16:18:45

huanghaibo1984
会员
注册时间: 2021-09-23
已发帖子: 1
积分: 0.5

Re: 全志V831芯片裸机开发日记--移植V831到xboot

请全志V831开发,可以留下联系方式吗?VX15014208663

离线

#98 2021-11-19 14:12:37

ghosoft
会员
注册时间: 2020-02-16
已发帖子: 14
积分: 13.5

Re: 全志V831芯片裸机开发日记--移植V831到xboot

该评论内容与本帖子无关,鼓励各位坑友积极发言讨论与帖子有关的内容!

离线

  • 不通过:其他

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn