Jelajahi Sumber

1. 修复多媒体播放卡死的问题。
2. 修复随机的录音卡住以及开发板录音没有内容的问题。
3. emmc根文件系统由ext2改成ext4,解决数据拷贝导致文件系统空间变小的问题。
4. 修复小概率的动画提前隐藏,未插sd卡情况下误判进入卡升级等问题。

huangliang 4 tahun lalu
induk
melakukan
dac876f1e5

+ 0 - 4
buildroot-external/configs/ark1668e_devb_defconfig

@@ -35,12 +35,10 @@ BR2_PACKAGE_QT5BASE_DEFAULT_QPA="linuxfb"
 BR2_PACKAGE_QT5BASE_JPEG=y
 BR2_PACKAGE_QT5BASE_PNG=y
 BR2_PACKAGE_QT5BASE_DBUS=y
-BR2_PACKAGE_LZO=y
 BR2_PACKAGE_DBUS_CPP=y
 BR2_PACKAGE_FDK_AAC=y
 BR2_PACKAGE_LIBMAD=y
 BR2_PACKAGE_LIBVORBIS=y
-BR2_PACKAGE_OPENSSL=y
 BR2_PACKAGE_LIBOPENSSL_BIN=y
 BR2_PACKAGE_LIBOPENSSL_ENGINES=y
 BR2_PACKAGE_LIBUSB=y
@@ -63,8 +61,6 @@ BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
 BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO=y
 BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
 BR2_PACKAGE_ANDROID_TOOLS=y
-BR2_PACKAGE_UTIL_LINUX=y
-BR2_PACKAGE_UTIL_LINUX_LIBUUID=y
 BR2_TARGET_ROOTFS_UBI=y
 BR2_TARGET_ROOTFS_UBI_SUBSIZE=2048
 BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x1f000

+ 1 - 1
buildroot-external/configs/ark1668e_devb_emmc_defconfig

@@ -55,7 +55,7 @@ BR2_PACKAGE_ANDROID_TOOLS=y
 BR2_PACKAGE_UTIL_LINUX=y
 BR2_PACKAGE_UTIL_LINUX_LIBUUID=y
 BR2_TARGET_ROOTFS_EXT2=y
-BR2_TARGET_ROOTFS_EXT2_2r0=y
+BR2_TARGET_ROOTFS_EXT2_4=y
 BR2_TARGET_ROOTFS_EXT2_SIZE="500M"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_LIBARKAPI_ARK1668E=y

+ 1 - 1
buildroot-external/package/DashBoard/mainwindow.cpp

@@ -11,7 +11,7 @@ MainWindow::MainWindow(QWidget *parent) :
     QMainWindow(parent)
 {
 #ifdef __ARM__
-    QResource::registerResource("usr/share/images.rcc");
+    QResource::registerResource("/usr/share/images.rcc");
     this->setWindowFlag(Qt::FramelessWindowHint);
 #endif
     QPalette pal = palette();

+ 67 - 20
buildroot-external/package/libarkapi/software/src/ark_video.c

@@ -23,6 +23,8 @@
 
 struct display_data *pdd = NULL;
 
+//#define DECODE_SCALE_PARALLEL
+
 static int get_shared_display_data(void)
 {
 	if (pdd == NULL) {
@@ -164,6 +166,7 @@ static void video_display_process(video_handle *handle, unsigned int yaddr, unsi
 	int out_w, out_h;
 	int winx = 0, winy = 0, winwidth = 0, winheight = 0;
 	unsigned int dst_phyaddr, read_addr = 0;
+	int ret;
 
 	if(!handle || !handle->handle_disp){
 		printf("%s: handle null, error.\n", __func__);
@@ -213,6 +216,42 @@ static void video_display_process(video_handle *handle, unsigned int yaddr, unsi
 	off_y = handle->cfg_vid.disp_y;
 	out_w = handle->cfg_vid.disp_width;
 	out_h = handle->cfg_vid.disp_height;
+
+#ifndef DECODE_SCALE_PARALLEL
+	if (yaddr == 0)
+		return;
+
+	if(handle->cfg_vid.win_src_width && handle->cfg_vid.win_src_height){
+		winx = handle->cfg_vid.win_src_x;
+		winy = handle->cfg_vid.win_src_y;
+		winwidth = handle->cfg_vid.win_src_width;
+		winheight = handle->cfg_vid.win_src_height;
+	}else{
+		winwidth = handle->out_buffer.codedWidth;
+		winheight = handle->out_buffer.codedHeight;
+	}
+
+	dst_phyaddr = handle->rotate_buffer[handle->rotate_buffer_index].busAddress;
+	handle->rotate_buffer_index = (handle->rotate_buffer_index + 1) % ROTATE_BUF_MAX;
+	arkapi_display_get_layer_addr(handle->handle_disp, &read_addr, NULL, NULL);
+	if (read_addr == dst_phyaddr)
+		arkapi_display_wait_for_vsync(handle->handle_disp);
+	ret = arkapi_scalar(yaddr, uaddr, vaddr,
+					ARK_SCALE_FORMAT_Y_UV420,
+					handle->out_buffer.frameWidth, handle->out_buffer.frameHeight,
+					winx, winy, winwidth, winheight,
+					0, 0, 0, 0,
+					handle->cfg_vid.disp_width, handle->cfg_vid.disp_height,
+					dst_phyaddr, dst_phyaddr + out_w * out_h, 0,
+					ARK_SCALE_OUT_FORMAT_Y_UV420,
+					SCALE_ROTATE_0);
+	if (ret) {
+		printf("arkapi_scalar fail.\n");
+		handle->last_display_addr = 0;
+	} else {
+		handle->last_display_addr = dst_phyaddr;
+	}
+#endif
 #endif
 
 	if (handle->last_display_addr) {
@@ -243,6 +282,7 @@ static void video_display_process(video_handle *handle, unsigned int yaddr, unsi
 		handle->last_display_addr = 0;
 	}
 
+#ifdef DECODE_SCALE_PARALLEL
 #if LIBARKAPI_PLATFORM != LIBARKAPI_ARK1668
 	if (yaddr == 0)
 		return;
@@ -257,23 +297,30 @@ static void video_display_process(video_handle *handle, unsigned int yaddr, unsi
 		winheight = handle->out_buffer.codedHeight;
 	}
 
-	arkapi_scalar_wait_idle();
-	dst_phyaddr = handle->rotate_buffer[handle->rotate_buffer_index].busAddress;
-	handle->rotate_buffer_index = (handle->rotate_buffer_index + 1) % ROTATE_BUF_MAX;
-	arkapi_display_get_layer_addr(handle->handle_disp, &read_addr, NULL, NULL);
-	if (read_addr == dst_phyaddr)
-		arkapi_display_wait_for_vsync(handle->handle_disp);
-	arkapi_scalar_nowait(yaddr, uaddr, vaddr,
-					ARK_SCALE_FORMAT_Y_UV420,
-					handle->out_buffer.frameWidth, handle->out_buffer.frameHeight,
-					winx, winy, winwidth, winheight,
-					0, 0, 0, 0,
-					handle->cfg_vid.disp_width, handle->cfg_vid.disp_height,
-					dst_phyaddr, dst_phyaddr + out_w * out_h, 0,
-					ARK_SCALE_OUT_FORMAT_Y_UV420,
-					SCALE_ROTATE_0);
-	handle->last_display_addr = dst_phyaddr;
-
+	ret = arkapi_scalar_wait_idle();
+	if (ret) {
+		printf("arkapi_scalar_wait_idle fail.\n");
+	} else {
+		dst_phyaddr = handle->rotate_buffer[handle->rotate_buffer_index].busAddress;
+		handle->rotate_buffer_index = (handle->rotate_buffer_index + 1) % ROTATE_BUF_MAX;
+		arkapi_display_get_layer_addr(handle->handle_disp, &read_addr, NULL, NULL);
+		if (read_addr == dst_phyaddr)
+			arkapi_display_wait_for_vsync(handle->handle_disp);
+		ret = arkapi_scalar_nowait(yaddr, uaddr, vaddr,
+						ARK_SCALE_FORMAT_Y_UV420,
+						handle->out_buffer.frameWidth, handle->out_buffer.frameHeight,
+						winx, winy, winwidth, winheight,
+						0, 0, 0, 0,
+						handle->cfg_vid.disp_width, handle->cfg_vid.disp_height,
+						dst_phyaddr, dst_phyaddr + out_w * out_h, 0,
+						ARK_SCALE_OUT_FORMAT_Y_UV420,
+						SCALE_ROTATE_0);
+		if (!ret)
+			handle->last_display_addr = dst_phyaddr;
+		else
+			printf("arkapi_scalar_nowait fail.\n");
+	}
+#endif
 #endif
 	//ark_dbg("%s: <---end.\n", __func__);
 }
@@ -296,7 +343,7 @@ void sig_handler(int sigio)
 		if (handle)
 			video_display_process(handle, handle->last_render_yaddr, handle->last_render_uaddr,
 				handle->last_render_vaddr);
-#if LIBARKAPI_PLATFORM != LIBARKAPI_ARK1668
+#if LIBARKAPI_PLATFORM != LIBARKAPI_ARK1668 && defined(DECODE_SCALE_PARALLEL)
 		video_display_process(handle, 0, 0, 0);
 #endif
 	}
@@ -670,7 +717,7 @@ int arkapi_video_play_eof(video_handle *handle, int fps)
 
 	arkapi_video_lock(handle);
 
-#if LIBARKAPI_PLATFORM != LIBARKAPI_ARK1668
+#if LIBARKAPI_PLATFORM != LIBARKAPI_ARK1668 && defined(DECODE_SCALE_PARALLEL)
 	video_display_process(handle, 0, 0, 0);
 #endif
 
@@ -690,7 +737,7 @@ int arkapi_video_play_eof(video_handle *handle, int fps)
 		}
 	}
 
-#if LIBARKAPI_PLATFORM != LIBARKAPI_ARK1668
+#if LIBARKAPI_PLATFORM != LIBARKAPI_ARK1668 && defined(DECODE_SCALE_PARALLEL)
 	video_display_process(handle, 0, 0, 0);
 #endif
 

+ 7 - 7
linux/arch/arm/boot/dts/ark1668e.dtsi

@@ -280,7 +280,7 @@
 				div-offset = <4>;
 				div-mask = <0xf>;
 				div-value = <1>;
-				div-mode = <ARK_CLK_DIVMODE_PLUSONE>;
+				div-mode = <ARK_CLK_DIVMODE_NOZERO>;
 				enable-reg = <0x48 0x50>;
 				enable-offset = <13 27>;			
 			};
@@ -400,7 +400,7 @@
 				div-offset = <24>;
 				div-mask = <0xf>;
 				div-value = <3>;
-				div-mode = <ARK_CLK_DIVMODE_PLUSONE>;
+				div-mode = <ARK_CLK_DIVMODE_NOZERO>;
 				//enable-reg = <0x44 0x4c 0x50 0x50>;
 				//enable-offset = <21 15 25 14>;
 			};
@@ -433,13 +433,13 @@
 				div-offset = <12>;
 				div-mask = <0xf>;
 				div-value = <1>;
-				div-mode = <ARK_CLK_DIVMODE_PLUSONE>;
+				div-mode = <ARK_CLK_DIVMODE_NOZERO>;
 			};
 
 			i2s_adc_clk: i2s_adc_clk {
 				#clock-cells = <0>;
 				compatible = "arkmiro,ark-clk-sys";
-				clocks = <&axipll>, <&audpll>;
+				clocks = <&xtal24mhz>, <&audpll>;
 				reg = <0x6c>;
 				index-offset = <0>;
 				index-mask = <0x1>;
@@ -449,7 +449,7 @@
 			i2s_dac_clk: i2s_dac_clk {
 				#clock-cells = <0>;
 				compatible = "arkmiro,ark-clk-sys";
-				clocks = <&axipll>, <&audpll>;
+				clocks = <&xtal24mhz>, <&audpll>;
 				reg = <0x6c>;
 				index-offset = <2>;
 				index-mask = <0x1>;
@@ -459,7 +459,7 @@
 			i2s2_dac_clk: i2s2_dac_clk {
 				#clock-cells = <0>;
 				compatible = "arkmiro,ark-clk-sys";
-				clocks = <&axipll>, <&audpll>;
+				clocks = <&xtal24mhz>, <&audpll>;
 				reg = <0x6c>;
 				index-offset = <4>;
 				index-mask = <0x1>;
@@ -521,7 +521,7 @@
 			compatible = "arkmicro,ark1668e-i2s";
 			reg = <0xe4000000 0x1000
 					0xe4900000 0x1000>;
-			//external-adc;
+			external-adc;
 			interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
 			nco-reg = <0xe4900174>;
 			dmas = <&dmac 0 1 0>, <&dmac 1 0 1>;

+ 0 - 2
linux/arch/arm/configs/ark1668e_devb_defconfig

@@ -265,8 +265,6 @@ CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
 # CONFIG_CRYPTO_ECHAINIV is not set
-CONFIG_CRYPTO_DEFLATE=y
-CONFIG_CRYPTO_LZO=y
 CONFIG_CRYPTO_CRC32C=y
 # CONFIG_CRYPTO_HW is not set
 CONFIG_XZ_DEC=y

+ 2 - 1
linux/drivers/soc/arkmicro/hx170dec/hx170dec.c

@@ -211,7 +211,8 @@ static void animation_dec_work(struct work_struct *work)
 	if (timeout_count > 50) {
 		printk(KERN_ALERT "%s Error! Dec timeout.\n", __FUNCTION__);
 		context->animation_end = true;
-	} else if (context->animation_file_phyaddr + size >= context->animation_data_phyaddr + context->animation_data_size) {
+	} else if (context->animation_file_phyaddr + size >= context->animation_data_phyaddr + context->animation_data_size
+		&& frame < header->aniCount + header->hasBootlogo ? 1 : 0) {
 		printk(KERN_ALERT "%s Error! Animation data is beyond the mark.\n", __FUNCTION__);
 		context->animation_end = true;
 	}

+ 11 - 16
linux/drivers/soc/arkmicro/scale/scale_core.c

@@ -837,23 +837,26 @@ EXPORT_SYMBOL(ark_scale_get_busy_status);
 
 int ark_scale_start_nowait(struct ark_scale_context *context, struct ark_scale_param *param)
 {
-	int ret = 0;
-
 	if (unlikely(down_interruptible(&context->scale_sem))) {
 		printk(KERN_ALERT "down_interruptible scale error\n");
 		return -1;	
 	}
 
+	if (unlikely(context->busy)) {
+		printk(KERN_ALERT "%s error! scale is busy now.\n", __FUNCTION__);
+		return -1;
+	}
+
 	context->busy = 1;
 
-	clk_disable_unprepare(context->clk);
+	/* clk_disable_unprepare(context->clk);
 	scale_softreset(context);
-	clk_prepare_enable(context->clk);
+	clk_prepare_enable(context->clk); */
 
 	ark_scale_set_param(context, param);
 	ark_scale_start_writeback(context);
 
-	return ret;
+	return 0;
 }
 EXPORT_SYMBOL(ark_scale_start_nowait);
 
@@ -861,16 +864,6 @@ int ark_scale_wait_idle(struct ark_scale_context *context)
 {
 	int ret;
 
-	spin_lock(&context->lock);
-	if (!context->busy) {
-		//printk("scale is idle now.\n");
-		spin_unlock(&context->lock);
-		up(&context->scale_sem);
-		return 0;
-	}
-	spin_unlock(&context->lock);
-
-	//printk("scale is busy now.\n");
 	ret = ark_scale_wait_finish_int(context);
 	up(&context->scale_sem);
 
@@ -883,8 +876,10 @@ int ark_scale_start(struct ark_scale_context *context, struct ark_scale_param *p
 	int ret;
 
 	ret = ark_scale_start_nowait(context, param);
-	if (ret < 0)
+	if (ret < 0) {
+		up(&context->scale_sem);
 		return ret;
+	}
 
 	ret = ark_scale_wait_finish_int(context);
 

+ 1 - 1
linux/drivers/video/fbdev/arkmicro/ark1668e_lcdfb.c

@@ -282,7 +282,7 @@ static int ark1668e_lcdfb_check_var(struct fb_var_screeninfo *var,
 		var->xres_virtual = var->xres;
 
 	if (var->yres >= var->yres_virtual)
-		var->yres_virtual = var->yres * 2;
+		var->yres_virtual = var->yres * 3;
 
 	/* Force same alignment for each line */
 	var->xres = (var->xres + 3) & ~3UL;

+ 6 - 0
u-boot/arch/arm/mach-arkmicro/include/mach/ark1668e-sysreg.h

@@ -15,6 +15,12 @@
 #define SYS_DDR_IO_CFG			0x19c
 #define SYS_PAD_CTRL00			0x1c0
 #define SYS_PAD_CTRL01			0x1c4
+#define SYS_PAD_CTRL02			0x1c8
+#define SYS_PAD_CTRL03			0x1cc
+#define SYS_PAD_CTRL04			0x1d0
+#define SYS_PAD_CTRL05			0x1d4
+#define SYS_PAD_CTRL06			0x1d8
+#define SYS_PAD_CTRL07			0x1dc
 #define SYS_PAD_CTRL08			0x1e0
 #define SYS_PAD_CTRL09			0x1e4
 #define SYS_IO_DRIVER01			0x1f4

+ 2 - 6
u-boot/arch/arm/mach-arkmicro/spl_ark1668e.c

@@ -217,13 +217,9 @@ static void switch_to_main_crystal_osc(void)
 	/* switch to sys pll clk */
 	/* ahb and pclk and pclk1 must have the same clk source */
 	/* change the config will cause mfc working fail */
-	/* ahb clk */
+	/* ahb and apb clk */
 	regval = 0x04040404;
-	regval |= (2 << 12) | (1 << 8);
-	write_sys_reg(regval, SYS_CLK_SEL);
-	udelay(50);
-	/* pclk */
-	regval |= (5 << 4) | 1;
+	regval |= (2 << 12) | (1 << 8) | (5 << 4) | 1;
 	write_sys_reg(regval, SYS_CLK_SEL);
 	udelay(50);
 	/* pclk1 */

+ 2 - 1
u-boot/board/arkmicro/ark1668e_devb/ark1668e_devb.c

@@ -261,7 +261,8 @@ int board_late_init(void)
 	need_update = env_get("need_update");
 	if (!strcmp(need_update, "yes")) {
 		loadaddr = env_get_hex("loadaddr", 0);
-
+		if (loadaddr)
+			memset(loadaddr, 0, strlen(ARK1668_UPDATE_MAGIC));
 		sprintf(cmd, "fatload %s %s %s update-magic", "mmc", env_get("sd_dev_part"), env_get("loadaddr"));
 		run_command(cmd, 0);
 		if (loadaddr && !memcmp((void *)loadaddr, ARK1668_UPDATE_MAGIC, strlen(ARK1668_UPDATE_MAGIC))) {

+ 14 - 0
u-boot/drivers/video/arkmicro/ark1668e_lcd.c

@@ -235,6 +235,20 @@ static void ark_lcdc_init(struct udevice *dev)
 	else if(priv->interface_type == ARK1668E_LCDC_INTERFACE_TTL)
 	{
 		lcdc_writel_sys(priv, SYS_CTL_2A, SWITCH_LVDS_TO_TTL);
+		/* pad config */
+		value = lcdc_readl_sys(priv, SYS_PAD_CTRL05);
+		value &= ~(0x3ffff << 12);
+		value |= (1 << 27) | (1 << 24) | (1 << 21) | (1 << 18) | (1 << 15) | (1 << 12);
+		lcdc_writel_sys(priv, SYS_PAD_CTRL05, value);
+
+		value = (1<<27) | (1<<24) | (1<<21) | (1<<18) | (1<<15) | (1<<12) | (1<<9) | (1<<6) | (1<<3) | (1<<0);
+		lcdc_writel_sys(priv, SYS_PAD_CTRL06, value);
+		lcdc_writel_sys(priv, SYS_PAD_CTRL07, value);
+
+		value = lcdc_readl_sys(priv, SYS_PAD_CTRL08);
+		value &= ~((7 << 3) | (7 << 0));
+		value |= (1 << 3) | (1 << 0);
+		lcdc_writel_sys(priv, SYS_PAD_CTRL08, value);
 	}
 
 	/* sync always on */

+ 1 - 2
u-boot/include/configs/ark1668e_devb_emmc.h

@@ -99,7 +99,6 @@
 		"${mtdparts} " \
 		"root=${nandroot} " \
 		"rootfstype=${nandrootfstype}\0" \
-		"root=/dev/mmcblk0p2 rw rootfstype=ext2 rootwait \0" \
 	"nandroot=ubi0:rootfs rw ubi.mtd=rootfs ubi.fm_autoconvert=1\0" \
 	"nandrootfstype=ubifs rootwait\0" \
 	"nandboot=echo Booting from nand ...; " \
@@ -212,7 +211,7 @@
 		"root=${emmcroot} " \
 		"rootfstype=${emmcrootfstype}\0" \
 	"emmcroot=/dev/mmcblk0p10 rw\0" \
-	"emmcrootfstype=ext2 rootwait\0" \
+	"emmcrootfstype=ext4 rootwait\0" \
 	"emmcboot=echo Booting from emmc ...; " \
 		"run emmcargs; " \
 		"mmc dev ${emmc_dev_part}; " \