@willok 发表一个回复就是LV2了
A
awwwwa 发布的帖子
-
回复: R128驱动SD卡失败
可以尝试打入这个补丁
diff --git a/hal/source/sdmmc/_sdhost.h b/hal/source/sdmmc/_sdhost.h index ef910bd..b570026 100644 --- a/hal/source/sdmmc/_sdhost.h +++ b/hal/source/sdmmc/_sdhost.h @@ -404,6 +404,9 @@ #define SDXC_REG_DAT1_CRC (0x12C) #define SDXC_REG_DAT0_CRC (0x130) #define SDXC_REG_CRC_STA (0x134) +#define SDXC_REG_DRV_DL (0x140) +#define SDXC_REG_SAMP_DL (0x144) +#define SDXC_REG_DS_DL (0x148) #define SDXC_REG_FIFO (0x200) /* SMC FIFO Access Address */ #define SDXC_REG_FCTL (0x64) /* SMC FIFO Access Address */ diff --git a/hal/source/sdmmc/hal_sdhost.c b/hal/source/sdmmc/hal_sdhost.c index dedf897..e47b3da 100644 --- a/hal/source/sdmmc/hal_sdhost.c +++ b/hal/source/sdmmc/hal_sdhost.c @@ -1017,6 +1017,7 @@ uint32_t rval; uint32_t src = 0; uint32_t m, n; + uint32_t clk_2x; if (cclk > DEFINE_SYS_CRYSTAL/2) { #ifdef NUSE_STANDARD_INTERFACE @@ -1033,8 +1034,8 @@ #endif sclk = DEFINE_SYS_CRYSTAL; } - cclk = cclk * 2; /* 2x MODE clock configure */ - div = (2 * sclk + cclk) / (2 * cclk); + clk_2x = cclk * 2; /* 2x MODE clock configure */ + div = (2 * sclk + clk_2x) / (2 * clk_2x); div = div == 0 ? 1 : div; if (div > 128) { n = 3; @@ -1142,6 +1143,37 @@ mci_writel(rval, host, SDXC_REG_CLKCR); sdc_hex_dump_word((void *)SDC_CCM_BASE ,0x900); +#ifdef CONFIG_ARCH_SUN20IW2 +#define CFGDLY (0x3F<<0) +#define ENABLEDLY (1<<7) + uint32_t samclk_pha = 0; + + if (cclk <= 50000000) { + samclk_pha = 6;//6; //63 + } else if (cclk <= 100000000) { + samclk_pha = 21; + } else if (cclk <= 150000000) { + samclk_pha = 24;//11;//23;3-24 + } else if (cclk <= 200000000) { + samclk_pha = 24;//6;//15;//33; + } + rval = mci_readl(host, SDXC_REG_NTSR); + rval &= ~(0x1<<31); // old timming mode + mci_writel(rval, host, SDXC_REG_NTSR); + + rval = mci_readl(host, SDXC_REG_SAMP_DL); + rval &= ~CFGDLY; + rval |= ENABLEDLY | samclk_pha; + mci_writel(rval, host, SDXC_REG_SAMP_DL); + + rval = mci_readl(host, SDXC_REG_DS_DL); + rval &= ~CFGDLY; + rval |= ENABLEDLY | samclk_pha; + mci_writel(rval, host, SDXC_REG_DS_DL); + + mci_writel(0x0, host, SDXC_REG_DRV_DL); +#endif + return cclk; } @@ -1949,11 +1981,6 @@ mci_writel(rval, host, SDXC_REG_GCTRL); #endif -#ifdef CONFIG_ARCH_SUN20IW2 - mci_writel(mci_readl(host, SDXC_REG_NTSR) | 0x110, host, SDXC_REG_NTSR); - mci_writel(0x00030000, host, 0x140); -#endif - if (host->sdc_id == 0) { SDC_ENABLE_IRQ(SDC0_IRQn); } diff --git a/hal/source/sdmmc/sd.c b/hal/source/sdmmc/sd.c index f569730..957250d 100644 --- a/hal/source/sdmmc/sd.c +++ b/hal/source/sdmmc/sd.c @@ -732,6 +732,24 @@ return err; } +static int32_t mmc_sd_switch_hs_mode(struct mmc_card *card) +{ + uint32_t status[64/sizeof(uint32_t)] = {0}; + int32_t err; + uint32_t timing = 0; + uint8_t *p_sta = (uint8_t *)status; + + err = mmc_sd_switch(card, SD_SWITCH_SET, SD_SWITCH_GRP_ACCESS_MODE, card->sd_bus_speed, p_sta); + if (err) + return err; + + if ((p_sta[16] & 0xF) != card->sd_bus_speed) { + SD_LOGW("%s: Problem setting bus speed mode!\n", __func__); + } + + return 0; +} + /* * Test if the card supports high-speed mode and, if so, switch to it. */ @@ -993,9 +1011,12 @@ if (err) return -1; } else { - mmc_card_set_highspeed(card); card->sd_bus_speed = HIGH_SPEED_BUS_SPEED; - + err = mmc_sd_switch_hs_mode(card); + if (err) { + SD_LOGW("switch to high speed error, use DS: 25 MHz\n"); + } + mmc_card_set_highspeed(card); clk = mmc_sd_get_max_clock(card); err = HAL_SDC_Update_Clk(card->host, clk); if (err)
-
回复: R128驱动SD卡失败
正常挂载log
card_detect removed sdmmc_test->card_id=0 [WRN] SDC:sdc:0000000008280E50 no medium present SDC:Not imp HAL_SDC_PowerOff,2028 SDC:Not implement __mci_hold_io,823 SD:mmc_card_delete card:00000000081A3370 id:0 card_detect insert sdmmc_test->card_id=0 card id is 0 SD:mmc_card_create card:00000000081A3370 id:0 card debug mask 3c SDC:Not implement __mci_restore_io,838 HAL_GetHFClock,53 Warning Use fix value 24000000 HAL_GetHFClock,53 Warning Use fix value 24000000 HAL_GetHFClock,53 Warning Use fix value 24000000 SDC:SDC clock=416666 kHz,src:0, n:2, m:11 HAL_GetHFClock,53 Warning Use fix value 24000000 HAL_GetHFClock,53 Warning Use fix value 24000000 HAL_GetHFClock,53 Warning Use fix value 24000000 SDC:SDC clock=416666 kHz,src:0, n:2, m:11 [ERR] SDC:__mci_irq_handler,924 raw_int:100 err! [ERR] SDC:SDC err, cmd 52, RTO [ERR] SDC:sdc 701 abnormal status: RespErr [ERR] SDC:__mci_irq_handler,924 raw_int:100 err! [ERR] SDC:SDC err, cmd 52, RTO [ERR] SDC:sdc 701 abnormal status: RespErr SD:***** Try sdio ***** [ERR] SDC:__mci_irq_handler,924 raw_int:100 err! [ERR] SDC:SDC err, cmd 5, RTO [ERR] SDC:sdc 701 abnormal status: RespErr SD:***** Try sd ***** mmc_send_app_op_cond,89 SD:card ocr: c0ff8000 SD:Card CID number:2544d53 SD:card raw cid: SD:card raw csd: m:29567, e:2, dtr:25000000, cl:1461, len:9, cap:30277632 str:1 SD:card raw scr: SD:card raw SD status: HAL_GetHFClock,53 Warning Use fix value 24000000 HAL_GetDevClock,90 Warning Use fix value 192000000 HAL_GetDevClock,90 Warning Use fix value 192000000 SDC:SDC clock=48000000 kHz,src:1, n:0, m:1 SD:card is switched to high speed mode, clk:50000 KHz SD:Set bus width type: 2 SD: ============= card information ============== SD:Card Type : SDHC SD:Card Spec Ver : 5.0 SD:Card RCA : 0x1234 SD:Card OCR : 0x40ff8000 SD: vol_window : 0x00ff8000 SD: to_1v8_acpt : 0 SD: high_capac : 0 SD:Card CSD : SD: speed : 50000 KHz SD: cmd class : 0x5b5 SD: capacity : 14784MB SD:Card CUR_STA : SD: speed_mode : HS: 50 MHz SD: bus_width : 2 SD: speed_class : 10 SD:============================================= SD:***** sd init ok ***** Initial card success mount successully
-
回复: 使用docker环境arm交叉编译OpenCV出错
libopencv_highgui.so.4.8.0: file not recognized: File format not recognized
opencv不是交叉编译的
-
回复: V851s 设备添加了开机logo后提示can't find partition bootloader,并且无法显示开机logo
@newcastle 在 V851s 设备添加了开机logo后提示can't find partition bootloader,并且无法显示开机logo 中说:
** Unable to read file bootlogo.bmp **
找不到文件,bootlogo应该是在boot-resource里不在bootloader分区
-
回复: 请问谁有AIC600E3的DRAM初始化代码?
@lvjun0728 主线(u-boot)不支持AIC600E3的DRAM初始化,请向ArtInChip联系获得支持。
由于AIC600E3修改了 DRAM 的 pinmux 线序,如没有原厂支持测试这个mux需要尝试20w次以上
-
回复: Tina编译库依赖问题
单个包:
define Package/程序包名/extra_provides echo 'libz.so'; endef
多个包:
define Package/程序包名/extra_provides echo 'libstdc++.so.6'; \ echo 'libm.so.6'; \ echo 'libc.so.6'; \ echo 'libz.so'; endef
-
回复: 麻雀 MQ-Dual (双核A7版本内置128M运存) ,准备测试
@gonboy 换这个帖子里的驱动,芒果仓库里的摄像头驱动用不了的
D1-H (MQ-Pro)驱动 OV5640 摄像头
https://bbs.aw-ol.com/topic/4017/share/1 -
回复: mCore R818使用genimage 打包镜像通过dd if烧录 提示如下错误!
sunxi_gpt 可以这样生成
update_mbr sys_partition.bin 4 sunxi_mbr.fex dlinfo.fex 15269888 40960 0 sys_partition.bin----分区表的2进制文件 4----------------------分区表的备份个数,一般spinor为1,其他为4 sunxi_mbr.fex------生成mbr格式分区表的文件 dlinfo.fex-----------下载文件信息表 15269888----------该flash的大小,比如EMMC的USR分区的大小,单位为sector 20------------------该flash的逻辑地址,单位MByte 0--------------------代表flash的类型,1是spinor flash,0是非 spi nor类型
-
回复: mCore R818使用genimage 打包镜像通过dd if烧录 提示如下错误!
可以尝试使用 programmer_img 生成固件
使用方法
programmer_img boot0_sdcard.fex boot_package.fex ${out_img} boot0_sdcard.fex----boot0文件 boot_package.fex------即uboot文件 ${out_img}------为生成的镜像文件
或者
programmer_img sys_partition.bin sunxi_mbr.fex ${out_img} ${in_img} sunxi_gpt.fex sys_partition.bin----分区表的脚本文件 sunxi_mbr.fex------为mbr格式的分区表文件 ${out_img}------为输入的镜像文件 ${in_img}-----为输出的镜像文件 sunxi_gpt.fex----为gpt 格式的分区表文件
-
回复: V853 的 CPU1(E907)启动流程
参考Linux端代码即可,本质上为:
- 加载固件
- 调用 firmware 接口获取文件系统中的固件
- 解析固件的 resource_table 段,该段有如下内容
- 声明需要的内存(Linux 为其分配)
- 声明使用的 vdev(固定为一个)
- 声明使用的 vring(固定为两个)
- 将固件加载到指定地址
- 注册 rpmsg virtio 设备
- 提供 vdev->ops(基于 virtio 接口实现的)
- 与 rpmsg_bus 驱动匹配,完成 rpmsg 初始化
- 启动小核
- 调用 rproc->ops->start
- 加载固件
-
回复: camera获取图片效果问题
@h2631436132 open版本sdk没有awispapi,需要编译mpp使用
参考:
v851s MPP 模块概述以及编译 sample 步骤
https://bbs.aw-ol.com/topic/3286/share/1 -
回复: V853无法烧写SPI Nand
[05.750]sunxi-spinand-phy: read id failed : -110 try nand fail
nand找不到,确认一下sys_config.fex的spi引脚配置对不对