板子到货了


@nimadibaj 【资料】V853&V851 软件开发指南
https://bbs.aw-ol.com/topic/2266/share/1
验证了:
WiFi还有问题,SDIO扫不到卡:https://bbs.aw-ol.com/topic/1675/share/1


固件在这里下载:【在 V853 Vision 开发板上运行 Debian Linux】
既然都跑 Linux 了,不上个 Debian 怎么行? Linux 最有趣的是可以自由的定制 Linux 根文件系统。使用官方的 Linux 内核搭配上自己制作的 Debian 根文件来试试在 V853 上运行 Debian GNU/Linux。
那首先选一个 Debian 的版本来移植吧,先看看 debian 11

ummmmm还是算了,debian 10 咋样

有戏,不过感觉有坑,太菜了不敢用。
再看看 debian 9

啊,完美了,就决定是你了 debian 9
原神:全低画质 15~40 帧


Applications Graphics Acceleration Info:
Uptime: 13155175 Realtime: 13155175
** Graphics info for pid 18983 [com.miHoYo.Yuanshen] **
Stats since: 6718860763285ns
Total frames rendered: 104
Janky frames: 28 (26.92%)
Janky frames (legacy): 23 (22.12%)
50th percentile: 9ms
90th percentile: 25ms
95th percentile: 44ms
99th percentile: 150ms
Number Missed Vsync: 4
Number High input latency: 22
Number Slow UI thread: 5
Number Slow bitmap uploads: 0
Number Slow issue draw commands: 25
Number Frame deadline missed: 28
Number Frame deadline missed (legacy): 8
HISTOGRAM: 5ms=11 6ms=15 7ms=19 8ms=6 9ms=6 10ms=4 11ms=10 12ms=2 13ms=1 14ms=1 15ms=0 16ms=1 17ms=1 18ms=0 19ms=0 20ms=0 21ms=1 22ms=4 23ms=6 24ms=5 25ms=2 26ms=1 27ms=2 28ms=0 29ms=0 30ms=0 31ms=0 32ms=0 34ms=0 36ms=0 38ms=0 40ms=0 42ms=0 44ms=1 46ms=0 48ms=1 53ms=1 57ms=0 61ms=0 65ms=1 69ms=0 73ms=0 77ms=0 81ms=0 85ms=0 89ms=0 93ms=0 97ms=0 101ms=0 105ms=0 109ms=0 113ms=0 117ms=0 121ms=0 125ms=0 129ms=0 133ms=0 150ms=2 200ms=0 250ms=0 300ms=0 350ms=0 400ms=0 450ms=0 500ms=0 550ms=0 600ms=0 650ms=0 700ms=0 750ms=0 800ms=0 850ms=0 900ms=0 950ms=0 1000ms=0 1050ms=0 1100ms=0 1150ms=0 1200ms=0 1250ms=0 1300ms=0 1350ms=0 1400ms=0 1450ms=0 1500ms=0 1550ms=0 1600ms=0 1650ms=0 1700ms=0 1750ms=0 1800ms=0 1850ms=0 1900ms=0 1950ms=0 2000ms=0 2050ms=0 2100ms=0 2150ms=0 2200ms=0 2250ms=0 2300ms=0 2350ms=0 2400ms=0 2450ms=0 2500ms=0 2550ms=0 2600ms=0 2650ms=0 2700ms=0 2750ms=0 2800ms=0 2850ms=0 2900ms=0 2950ms=0 3000ms=0 3050ms=0 3100ms=0 3150ms=0 3200ms=0 3250ms=0 3300ms=0 3350ms=0 3400ms=0 3450ms=0 3500ms=0 3550ms=0 3600ms=0 3650ms=0 3700ms=0 3750ms=0 3800ms=0 3850ms=0 3900ms=0 3950ms=0 4000ms=0 4050ms=0 4100ms=0 4150ms=0 4200ms=0 4250ms=0 4300ms=0 4350ms=0 4400ms=0 4450ms=0 4500ms=0 4550ms=0 4600ms=0 4650ms=0 4700ms=0 4750ms=0 4800ms=0 4850ms=0 4900ms=0 4950ms=0
50th gpu percentile: 3ms
90th gpu percentile: 8ms
95th gpu percentile: 9ms
99th gpu percentile: 10ms
GPU HISTOGRAM: 1ms=4 2ms=35 3ms=31 4ms=7 5ms=4 6ms=2 7ms=6 8ms=6 9ms=5 10ms=3 11ms=1 12ms=0 13ms=0 14ms=0 15ms=0 16ms=0 17ms=0 18ms=0 19ms=0 20ms=0 21ms=0 22ms=0 23ms=0 24ms=0 25ms=0 4950ms=0
Pipeline=Skia (OpenGL)
CPU Caches:
Glyph Cache: 69.44 KB (1 entry)
Glyph Count: 26
Total CPU memory usage:
71103 bytes, 69.44 KB (0.00 bytes is purgeable)
GPU Caches:
Other:
Other: 0.00 bytes (1 entry)
Image:
Texture: 127.59 KB (10 entries)
Scratch:
Buffer Object: 78.00 KB (2 entries)
Texture: 2.00 MB (1 entry)
Total GPU memory usage:
2307680 bytes, 2.20 MB (127.59 KB is purgeable)
Profile data in ms:
com.miHoYo.Yuanshen/com.miHoYo.GetMobileInfo.MainActivity/android.view.ViewRootImpl@a46020a (visibility=0)
View hierarchy:
com.miHoYo.Yuanshen/com.miHoYo.GetMobileInfo.MainActivity/android.view.ViewRootImpl@a46020a
7 views, 8.70 kB of render nodes
Total ViewRootImpl : 1
Total attached Views : 7
Total RenderNode : 8.70 kB (used) / 8.70 kB (capacity)

Debian + LXDE + Python

屏厂一般会给这样的一个init code资料
{DSICMD_CMD,0x01},
{CMDDELAY_MS,120},
{DSICMD_CMD,0x11},
{CMDDELAY_MS,120},
{DSICMD_CMD,0xFF},
{DSICMD_DATA,0x77},
{DSICMD_DATA,0x01},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x11},
{DSICMD_CMD,0xD1},
{DSICMD_DATA,0x11},
{DSICMD_CMD,0x55},
{DSICMD_DATA,0xb0}, // 80 90 b0
{DSICMD_CMD,0xFF},
{DSICMD_DATA,0x77},
{DSICMD_DATA,0x01},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x10},
{DSICMD_CMD,0xC0},
{DSICMD_DATA,0x63},
{DSICMD_DATA,0x00},
{DSICMD_CMD,0xC1},
{DSICMD_DATA,0x09},
{DSICMD_DATA,0x02},
{DSICMD_CMD,0xC2},
{DSICMD_DATA,0x37},
{DSICMD_DATA,0x08},
{DSICMD_CMD,0xC7},//x-dir
{DSICMD_DATA,0x04}, // rotate 0 : 0x00 rotate 180 :0x04
{DSICMD_CMD,0xCC},
{DSICMD_DATA,0x38},
{DSICMD_CMD,0xB0},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x11},
{DSICMD_DATA,0x19},
{DSICMD_DATA,0x0C},
{DSICMD_DATA,0x10},
{DSICMD_DATA,0x06},
{DSICMD_DATA,0x07},
{DSICMD_DATA,0x0A},
{DSICMD_DATA,0x09},
{DSICMD_DATA,0x22},
{DSICMD_DATA,0x04},
{DSICMD_DATA,0x10},
{DSICMD_DATA,0x0E},
{DSICMD_DATA,0x28},
{DSICMD_DATA,0x30},
{DSICMD_DATA,0x1C},
{DSICMD_CMD,0xB1},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x12},
{DSICMD_DATA,0x19},
{DSICMD_DATA,0x0D},
{DSICMD_DATA,0x10},
{DSICMD_DATA,0x04},
{DSICMD_DATA,0x06},
{DSICMD_DATA,0x07},
{DSICMD_DATA,0x08},
{DSICMD_DATA,0x23},
{DSICMD_DATA,0x04},
{DSICMD_DATA,0x12},
{DSICMD_DATA,0x11},
{DSICMD_DATA,0x28},
{DSICMD_DATA,0x30},
{DSICMD_DATA,0x1C},
{DSICMD_CMD,0xFF},
{DSICMD_DATA,0x77},
{DSICMD_DATA,0x01},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x11}, // enable bk fun of command 2 BK1
{DSICMD_CMD,0xB0},
{DSICMD_DATA,0x4D},
{DSICMD_CMD,0xB1},
{DSICMD_DATA,0x60}, //0x56 0x4a 0x5b
{DSICMD_CMD,0xB2},
{DSICMD_DATA,0x07},
{DSICMD_CMD,0xB3},
{DSICMD_DATA,0x80},
{DSICMD_CMD,0xB5},
{DSICMD_DATA,0x47},
{DSICMD_CMD,0xB7},
{DSICMD_DATA,0x8A},
{DSICMD_CMD,0xB8},
{DSICMD_DATA,0x21},
{DSICMD_CMD,0xC1},
{DSICMD_DATA,0x78},
{DSICMD_CMD,0xC2},
{DSICMD_DATA,0x78},
{DSICMD_CMD,0xD0},
{DSICMD_DATA,0x88},
{CMDDELAY_MS,100},
{DSICMD_CMD,0xE0},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x02},
{DSICMD_CMD,0xE1},
{DSICMD_DATA,0x01},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0x03},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0x02},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0x04},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x44},
{DSICMD_DATA,0x44},
{DSICMD_CMD,0xE2},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_CMD,0xE3},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x33},
{DSICMD_DATA,0x33},
{DSICMD_CMD,0xE4},
{DSICMD_DATA,0x44},
{DSICMD_DATA,0x44},
{DSICMD_CMD,0xE5},
{DSICMD_DATA,0x01},
{DSICMD_DATA,0x26},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0x03},
{DSICMD_DATA,0x28},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0x05},
{DSICMD_DATA,0x2A},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0x07},
{DSICMD_DATA,0x2C},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0xA0},
{DSICMD_CMD,0xE6},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x33},
{DSICMD_DATA,0x33},
{DSICMD_CMD,0xE7},
{DSICMD_DATA,0x44},
{DSICMD_DATA,0x44},
{DSICMD_CMD,0xE8},
{DSICMD_DATA,0x02},
{DSICMD_DATA,0x26},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0x04},
{DSICMD_DATA,0x28},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0x06},
{DSICMD_DATA,0x2A},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0x08},
{DSICMD_DATA,0x2C},
{DSICMD_DATA,0xA0},
{DSICMD_DATA,0xA0},
{DSICMD_CMD,0xEB},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x01},
{DSICMD_DATA,0xE4},
{DSICMD_DATA,0xE4},
{DSICMD_DATA,0x44},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x40},
{DSICMD_CMD,0xED},
{DSICMD_DATA,0xFF},
{DSICMD_DATA,0xF7},
{DSICMD_DATA,0x65},
{DSICMD_DATA,0x4F},
{DSICMD_DATA,0x0B},
{DSICMD_DATA,0xA1},
{DSICMD_DATA,0xCF},
{DSICMD_DATA,0xFF},
{DSICMD_DATA,0xFF},
{DSICMD_DATA,0xFC},
{DSICMD_DATA,0x1A},
{DSICMD_DATA,0xB0},
{DSICMD_DATA,0xF4},
{DSICMD_DATA,0x56},
{DSICMD_DATA,0x7F},
{DSICMD_DATA,0xFF},
{DSICMD_CMD,0xFF},
{DSICMD_DATA,0x77},
{DSICMD_DATA,0x01},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_DATA,0x00},
{DSICMD_CMD,0x36}, // //U&D Y-DIR
{DSICMD_DATA,0x10}, //rotate 0: 0x00 : rotate 180 :0x10
{DSICMD_CMD,0x3A},
{DSICMD_DATA,0x55},
{DSICMD_CMD,0x29},
对应的初始化序列
{0x01, 1, {0x00} },
{REGFLAG_DELAY, REGFLAG_DELAY, {120} },
{0x11, 1, {0x00} },
{REGFLAG_DELAY, REGFLAG_DELAY, {120} },
{0xff, 5, {0x77, 0x01, 0x00, 0x00, 0x11} },
{0xd1, 1, {0x11} },
{0x55, 1, {0xb0} },
{0xff, 5, {0x77, 0x01, 0x00, 0x00, 0x10} },
{0xc0, 2, {0x63, 0x00} }, // SCNL = (0x63 + 1) * 8 = 800
{0xc1, 2, {0x09, 0x02} }, // VFB=0x09 VBF=0x02
{0xc2, 2, {0x37, 0x08} }, // PCLK= 512 + (0x08 * 16) = 640
{0xc7, 1, {0x00} }, // x-dir rotate 0 : 0x00 rotate 180 :0x04
{0xcc, 1, {0x38} },
{0xb0, 16, {0x00, 0x11, 0x19, 0x0c, 0x10, 0x06, 0x07, 0x0a, 0x09, 0x22,
0x04, 0x10, 0x0e, 0x28, 0x30, 0x1c} },
{0xb1, 16, {0x00, 0x12, 0x19, 0x0d, 0x10, 0x04, 0x06, 0x07, 0x08, 0x23,
0x04, 0x12, 0x11, 0x28, 0x30, 0x1c} },
{0xff, 5, {0x77, 0x01, 0x00, 0x00, 0x11} }, // enable bk fun of command 2 BK1
{0xb0, 1, {0x4d} },
{0xb1, 1, {0x5b} }, // 0x56 0x4a 0x5b
{0xb2, 1, {0x07} },
{0xb3, 1, {0x80} },
{0xb5, 1, {0x47} },
{0xb7, 1, {0x8a} },
{0xb8, 1, {0x21} },
{0xc1, 1, {0x78} },
{0xc2, 1, {0x78} },
{0xd0, 1, {0x88} },
{REGFLAG_DELAY, REGFLAG_DELAY, {100} },
{0xe0, 3, {0x00, 0x00, 0x02} },
{0xe1, 11, {0x01, 0xa0, 0x03, 0xa0, 0x02, 0xa0, 0x04, 0xa0, 0x00, 0x44,
0x44} },
{0xe2, 12, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00} },
{0xe3, 4, {0x00, 0x00, 0x33, 0x33} },
{0xe4, 2, {0x44, 0x44} },
{0xe5, 16, {0x01, 0x26, 0xa0, 0xa0, 0x03, 0x28, 0xa0, 0xa0, 0x05, 0x2a,
0xa0, 0xa0, 0x07, 0x2c, 0xa0, 0xa0} },
{0xe6, 4, {0x00, 0x00, 0x33, 0x33} },
{0xe7, 2, {0x44, 0x44} },
{0xe8, 16, {0x02, 0x26, 0xa0, 0xa0, 0x04, 0x28, 0xa0, 0xa0, 0x06, 0x2a,
0xa0, 0xa0, 0x08, 0x2c, 0xa0, 0xa0} },
{0xeb, 7, {0x00, 0x01, 0xe4, 0xe4, 0x44, 0x00, 0x40} },
{0xed, 16, {0xff, 0xf7, 0x65, 0x4f, 0x0b, 0xa1, 0xcf, 0xff, 0xff, 0xfc,
0x1a, 0xb0, 0xf4, 0x56, 0x7f, 0xff} },
{0xff, 5, {0x77, 0x01, 0x00, 0x00, 0x00} },
{0x36, 1, {0x00} }, // U&D Y-DIR rotate 0: 0x00 : rotate 180 :0x10
{0x3a, 1, {0x55} },
{0x29, 1, {0x00} },
{REGFLAG_END_OF_TABLE, REGFLAG_END_OF_TABLE, {} }
可以,详见:D1咋把控制台弄到hdmi上呢?
https://bbs.aw-ol.com/topic/1320/share/4




全志 A523M00X0000:


宏芯宇 HG4XD04G-C2JA 4GByte LPDDR4X

佰维 BWCTARV11X64G

芯智汇 AXP323


芯智汇 AXP717C


思立微 GSL3676


选用P26T平板(A523) 与 芒果派CyberPad(R818)跑分测试对比:
A523是4核心1.8G + 4核心1.4G big.LITTLE架构,Geekbench只会显示1.4G,无视即可

A523 单核心跑分 846,多核心 3265
R818 单核心跑分 638,多核心 1714

详细链接:https://browser.geekbench.com/v4/cpu/compare/16815834?baseline=16815756
A523 MaliG57 跑分 2836
R818 GE8300 跑分 1254

详细链接:https://browser.geekbench.com/v4/compute/compare/5203221?baseline=5203219

A523:单核 170,多核 778
R818:单核 113,多核 372

详细链接:https://browser.geekbench.com/v5/cpu/compare/21444054?baseline=21444058
由于GeekBench6不提供arm32版本,故此处对比跑分A523与RK3568

A523:单核 230,多核 850
RK3568:单核 208,多核 493

详细链接:https://browser.geekbench.com/v6/cpu/compare/1893406?baseline=1852318
A523:Vulkan跑分 441
RK3568:Vulkan跑分 435

详细链接:https://browser.geekbench.com/v6/compute/compare/663853?baseline=649654


先拉源码:
git clone https://github.com/Tina-Linux/d1s-melis.git
然后下载工具链[https://github.com/Tina-Linux/d1s-melis/releases/tag/v1.0.0]丢到prebuilt文件夹里。
source melis-env.sh
lunch
make -j655350
pack
就可以在out目录找到镜像文件了

刷机

然后就毫不意外的启动了


【视频】八分钟,教你下载 D1-H Tina SDK
https://bbs.aw-ol.com/topic/1177/share/1


@daming123 brandy-2.0/u-boot-2018/configs/sun20iw1p1_defconfig 注释掉 #CONFIG_DISP2_SUNXI=y,使用kernel初始化屏幕测试
D1的start.s __start部分是参考哪里怎么实现的?
首先是 eGON.BT0,这个Magic是BROM读取的,所以要在头部插入eGON.BT0
还有dram.c又是从那里得到的这些数据
这是使用mctl_hal.S和自己写的一个小裸机编译出的bin,mctl_hal.S全志的sdk里开源了,这个小裸机源码如下 6ee6e31c-72ef-47f5-b69f-0976197bb46a-d1-ddr.zip
最后的mksunxi 也是搞不懂依据在哪
这个是对齐后重新计算校验码的,然后填充在固定的位置让BROM读取,全志系列的老传统了,你看_start那里的checksum只是一个占位符0x12345678,mksunxi就是会对齐块设备然后计算校验填入然后修改长度
https://github.com/YuzukiHD/TinyKasKit/blob/master/sunxiboot/src/bootpack.cpp
@mhcsoft 如果要使用这个INIT,要进行一下其他配置。我一般就busybox了
@cwj1986521 在 pack 报错 中说:
/home/jay/linux/allwinner/Tina-Linux-20220815/Tina-Linux/lichee/linux-6.6/scripts/dtc/dtc:
你的环境里有 Linux 6.6 的dtc,版本更新了导致不认识 -F 参数
这个是自己魔改的tina吗
完成了基础 rootfs 配置,现在要进行软件包的配置了
1)chroot 进入 rootfs
LC_ALL=C LANGUAGE=C LANG=C chroot rootfs

2)修改设备名,密码
echo "v853-vision" > /etc/hostname # 修改设备名
passwd # 设置root用户密码

3)更新下 rootfs 内的 apt 源
apt update

4)apt 安装下软件包
这里准备了豪华大礼包(你也可以加入自己喜欢的包)
apt-get -y install \
libncurses5-dev libncursesw5-dev procps udev locales zip unzip cmake \
build-essential python3 python3-dev python3-pip lxde lightdm xorg \
xserver-xorg motion neofetch

5)配置一下fstab,挂载 rootfs 为可读写模式
echo "PARTLABEL="rootfs" / ext4 noatime,lazytime,rw 0 0" > /etc/fstab

6)配置开机驱动自动加载功能
ln -fs /lib/systemd/system/rc-local.service /etc/systemd/system/rc-local.service # 链接脚本
vi /etc/rc.local
然后在编辑器里输入这些配置
#!/bin/bash
mount -o remount, rw /
insmod /lib/modules/4.9.191/videobuf2-core.ko
insmod /lib/modules/4.9.191/videobuf2-memops.ko
insmod /lib/modules/4.9.191/videobuf2-dma-contig.ko
insmod /lib/modules/4.9.191/videobuf2-v4l2.ko
insmod /lib/modules/4.9.191/vin_io.ko
insmod /lib/modules/4.9.191/gc2053_mipi.ko
insmod /lib/modules/4.9.191/vin_v4l2.ko
insmod /lib/modules/4.9.191/xradio_mac.ko
insmod /lib/modules/4.9.191/xradio_core.ko
insmod /lib/modules/4.9.191/xradio_wlan.ko
cat /sys/devices/platform/soc/usbc0/usb_host

7)把驱动包复制到 rootfs 里
驱动包是从 tina linux 里扒下来的,路径 out\v853\vision\openwrt\build_dir\target\root-v853-vision\lib 只需要 firmware 和 module 文件夹
下载驱动包:驱动包.zip
首先退出 rootfs,Ctrl+D
把解压好的驱动包复制进 rootfs 内
cp -r firmware/ rootfs/lib/
cp -r modules/ rootfs/lib/

至此,rootfs 就配置完成了,接下来是打包了
@rockenergytech buildroot根本上不支持nand和nor,未来也没有计划支持
@kelsey 全志平台的固件只分为NOR固件和普通固件,NOR固件是高度裁剪压缩的,一般最大16MByte,只可以刷入SPI NOR储存器
而普通固件是通用的,可以刷入
具体可以刷入怎样的储存介质需要芯片与驱动支持。
例如我给固件配置了MMC和SPI NAND的驱动,这个固件就可以刷入eMMC,MMC,TF Card,SD NAND, SPI NAND。因为eMMC,MMC,TF Card,SD NAND的驱动都是SDC的MMC驱动,所以共用我配置的eMMC驱动即可,而SPI NAND是SPI NAND的驱动,需要单独配置。
所以SD卡切换到SPI NAND需要打开SPI NAND的驱动,SPI NAND切换到SD卡需要打开MMC的驱动,具体参考帖子:Tina Linux 存储介质切换:eMMC,SPI NAND,SPI NOR,SD Card,SD NAND https://bbs.aw-ol.com/topic/1701/share/1
可以参考这个伪代码了解BROM的启动逻辑:

@tigger 对,是有2个
可以当热点用,一个STATION模式一个AP模式,如果不想要两个可以修改Makefile加一行
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE

驱动文件
#include "d310t9362v1.h"
static void lcd_power_on(u32 sel);
static void lcd_power_off(u32 sel);
static void lcd_bl_open(u32 sel);
static void lcd_bl_close(u32 sel);
static void lcd_panel_init(u32 sel);
static void lcd_panel_exit(u32 sel);
#define panel_reset(sel, val) sunxi_lcd_gpio_set_value(sel, 0, val)
static void lcd_cfg_panel_info(panel_extend_para *info)
{
u32 i = 0, j = 0;
u32 items;
u8 lcd_gamma_tbl[][2] = {
{0, 0}, {15, 15}, {30, 30}, {45, 45}, {60, 60},
{75, 75}, {90, 90}, {105, 105}, {120, 120}, {135, 135},
{150, 150}, {165, 165}, {180, 180}, {195, 195}, {210, 210},
{225, 225}, {240, 240}, {255, 255},
};
u32 lcd_cmap_tbl[2][3][4] = {
{
{LCD_CMAP_G0, LCD_CMAP_B1, LCD_CMAP_G2, LCD_CMAP_B3},
{LCD_CMAP_B0, LCD_CMAP_R1, LCD_CMAP_B2, LCD_CMAP_R3},
{LCD_CMAP_R0, LCD_CMAP_G1, LCD_CMAP_R2, LCD_CMAP_G3},
},
{
{LCD_CMAP_B3, LCD_CMAP_G2, LCD_CMAP_B1, LCD_CMAP_G0},
{LCD_CMAP_R3, LCD_CMAP_B2, LCD_CMAP_R1, LCD_CMAP_B0},
{LCD_CMAP_G3, LCD_CMAP_R2, LCD_CMAP_G1, LCD_CMAP_R0},
},
};
items = sizeof(lcd_gamma_tbl) / 2;
for (i = 0; i < items - 1; i++) {
u32 num = lcd_gamma_tbl[i + 1][0] - lcd_gamma_tbl[i][0];
for (j = 0; j < num; j++) {
u32 value = 0;
value =
lcd_gamma_tbl[i][1] +
((lcd_gamma_tbl[i + 1][1] - lcd_gamma_tbl[i][1]) *
j) /
num;
info->lcd_gamma_tbl[lcd_gamma_tbl[i][0] + j] =
(value << 16) + (value << 8) + value;
}
}
info->lcd_gamma_tbl[255] = (lcd_gamma_tbl[items - 1][1] << 16) +
(lcd_gamma_tbl[items - 1][1] << 8) +
lcd_gamma_tbl[items - 1][1];
memcpy(info->lcd_cmap_tbl, lcd_cmap_tbl, sizeof(lcd_cmap_tbl));
}
static s32 lcd_open_flow(u32 sel)
{
printk("=====================lcd_open_flow\n");
LCD_OPEN_FUNC(sel, lcd_power_on, 10);
LCD_OPEN_FUNC(sel, lcd_panel_init, 120);
LCD_OPEN_FUNC(sel, sunxi_lcd_tcon_enable, 120);
LCD_OPEN_FUNC(sel, lcd_bl_open, 0);
return 0;
}
static s32 lcd_close_flow(u32 sel)
{
printk("=====================lcd_close_flow\n");
LCD_CLOSE_FUNC(sel, lcd_bl_close, 0);
LCD_CLOSE_FUNC(sel, lcd_panel_exit, 200);
LCD_CLOSE_FUNC(sel, sunxi_lcd_tcon_disable, 0);
LCD_CLOSE_FUNC(sel, lcd_power_off, 500);
return 0;
}
static void lcd_power_on(u32 sel)
{
printk("=====================lcd_power_on\n");
sunxi_lcd_pin_cfg(sel, 1);
sunxi_lcd_power_enable(sel, 0);
// sunxi_lcd_power_enable(sel, 1);
sunxi_lcd_delay_ms(50);
/* reset lcd by gpio */
panel_reset(sel, 1);
sunxi_lcd_delay_ms(5);
panel_reset(sel, 0);
sunxi_lcd_delay_ms(10);
panel_reset(sel, 1);
sunxi_lcd_delay_ms(120);
}
static void lcd_power_off(u32 sel)
{
printk("=====================lcd_power_off\n");
sunxi_lcd_pin_cfg(sel, 0);
sunxi_lcd_delay_ms(20);
panel_reset(sel, 0);
sunxi_lcd_delay_ms(5);
sunxi_lcd_power_disable(sel, 0);
}
static void lcd_bl_open(u32 sel)
{
printk("=====================lcd_bl_open\n");
sunxi_lcd_pwm_enable(sel);
sunxi_lcd_backlight_enable(sel);
}
static void lcd_bl_close(u32 sel)
{
printk("=====================lcd_bl_close\n");
sunxi_lcd_backlight_disable(sel);
sunxi_lcd_pwm_disable(sel);
}
#define REGFLAG_DELAY 0XFC
#define REGFLAG_END_OF_TABLE 0xFD /* END OF REGISTERS MARKER */
struct LCM_setting_table {
u8 cmd;
u32 count;
u8 para_list[32];
};
static struct LCM_setting_table lcm_initialization_setting[] = {
{0x01, 1, {0x00} },
{REGFLAG_DELAY, REGFLAG_DELAY, {120} },
{0x11, 1, {0x00} },
{REGFLAG_DELAY, REGFLAG_DELAY, {120} },
{0xff, 5, {0x77, 0x01, 0x00, 0x00, 0x11} },
{0xd1, 1, {0x11} },
{0x55, 1, {0xb0} },
{0xff, 5, {0x77, 0x01, 0x00, 0x00, 0x10} },
{0xc0, 2, {0x63, 0x00} }, // SCNL = (0x63 + 1) * 8 = 800
{0xc1, 2, {0x09, 0x02} }, // VFB=0x09 VBF=0x02
{0xc2, 2, {0x37, 0x08} }, // PCLK= 512 + (0x08 * 16) = 640
{0xc7, 1, {0x00} }, // x-dir rotate 0 : 0x00 rotate 180 :0x04
{0xcc, 1, {0x38} },
{0xb0, 16, {0x00, 0x11, 0x19, 0x0c, 0x10, 0x06, 0x07, 0x0a, 0x09, 0x22,
0x04, 0x10, 0x0e, 0x28, 0x30, 0x1c} },
{0xb1, 16, {0x00, 0x12, 0x19, 0x0d, 0x10, 0x04, 0x06, 0x07, 0x08, 0x23,
0x04, 0x12, 0x11, 0x28, 0x30, 0x1c} },
{0xff, 5, {0x77, 0x01, 0x00, 0x00, 0x11} }, // enable bk fun of command 2 BK1
{0xb0, 1, {0x4d} },
{0xb1, 1, {0x5b} }, // 0x56 0x4a 0x5b
{0xb2, 1, {0x07} },
{0xb3, 1, {0x80} },
{0xb5, 1, {0x47} },
{0xb7, 1, {0x8a} },
{0xb8, 1, {0x21} },
{0xc1, 1, {0x78} },
{0xc2, 1, {0x78} },
{0xd0, 1, {0x88} },
{REGFLAG_DELAY, REGFLAG_DELAY, {100} },
{0xe0, 3, {0x00, 0x00, 0x02} },
{0xe1, 11, {0x01, 0xa0, 0x03, 0xa0, 0x02, 0xa0, 0x04, 0xa0, 0x00, 0x44,
0x44} },
{0xe2, 12, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00} },
{0xe3, 4, {0x00, 0x00, 0x33, 0x33} },
{0xe4, 2, {0x44, 0x44} },
{0xe5, 16, {0x01, 0x26, 0xa0, 0xa0, 0x03, 0x28, 0xa0, 0xa0, 0x05, 0x2a,
0xa0, 0xa0, 0x07, 0x2c, 0xa0, 0xa0} },
{0xe6, 4, {0x00, 0x00, 0x33, 0x33} },
{0xe7, 2, {0x44, 0x44} },
{0xe8, 16, {0x02, 0x26, 0xa0, 0xa0, 0x04, 0x28, 0xa0, 0xa0, 0x06, 0x2a,
0xa0, 0xa0, 0x08, 0x2c, 0xa0, 0xa0} },
{0xeb, 7, {0x00, 0x01, 0xe4, 0xe4, 0x44, 0x00, 0x40} },
{0xed, 16, {0xff, 0xf7, 0x65, 0x4f, 0x0b, 0xa1, 0xcf, 0xff, 0xff, 0xfc,
0x1a, 0xb0, 0xf4, 0x56, 0x7f, 0xff} },
{0xff, 5, {0x77, 0x01, 0x00, 0x00, 0x00} },
{0x36, 1, {0x00} }, // U&D Y-DIR rotate 0: 0x00 : rotate 180 :0x10
{0x3a, 1, {0x55} },
{0x29, 1, {0x00} },
{REGFLAG_END_OF_TABLE, REGFLAG_END_OF_TABLE, {} }
};
static void lcd_panel_init(u32 sel)
{
u32 i = 0;
sunxi_lcd_dsi_clk_enable(sel);
sunxi_lcd_delay_ms(100);
for (i = 0;; i++) {
if (lcm_initialization_setting[i].count == REGFLAG_END_OF_TABLE)
break;
else if (lcm_initialization_setting[i].count == REGFLAG_DELAY) {
sunxi_lcd_delay_ms(lcm_initialization_setting[i].para_list[0]);
} else {
dsi_gen_wr(sel, lcm_initialization_setting[i].cmd,
lcm_initialization_setting[i].para_list,
lcm_initialization_setting[i].count);
}
/* break; */
}
}
static void lcd_panel_exit(u32 sel)
{
sunxi_lcd_dsi_dcs_write_0para(sel, 0x10);
sunxi_lcd_delay_ms(80);
sunxi_lcd_dsi_dcs_write_0para(sel, 0x28);
sunxi_lcd_delay_ms(50);
}
/*sel: 0:lcd0; 1:lcd1*/
static s32 lcd_user_defined_func(u32 sel, u32 para1, u32 para2, u32 para3)
{
return 0;
}
__lcd_panel_t d310t9362v1_panel = {
/* panel driver name, must mach the name of
* lcd_drv_name in sys_config.fex
*/
.name = "d310t9362v1",
.func = {
.cfg_panel_info = lcd_cfg_panel_info,
.cfg_open_flow = lcd_open_flow,
.cfg_close_flow = lcd_close_flow,
.lcd_user_defined_func = lcd_user_defined_func,
},
};
设备树文件
&lcd0 {
lcd_used = <1>;
lcd_driver_name = "d310t9362v1";
lcd_if = <4>;
lcd_x = <480>;
lcd_y = <800>;
lcd_width = <40>;
lcd_height = <67>;
lcd_dclk_freq = <34>;
lcd_hbp = <120>;
lcd_ht = <624>;
lcd_hspw = <48>;
lcd_vbp = <28>;
lcd_vt = <908>;
lcd_vspw = <12>;
lcd_dsi_if = <0>;
lcd_dsi_lane = <2>;
lcd_lvds_if = <0>;
lcd_lvds_colordepth = <0>;
lcd_lvds_mode = <0>;
lcd_frm = <0>;
lcd_hv_clk_phase = <0>;
lcd_hv_sync_polarity= <0>;
lcd_io_phase = <0x0000>;
lcd_gamma_en = <0>;
lcd_bright_curve_en = <0>;
lcd_cmap_en = <0>;
lcd_fsync_en = <0>;
lcd_fsync_act_time = <1000>;
lcd_fsync_dis_time = <1000>;
lcd_fsync_pol = <0>;
deu_mode = <0>;
lcdgamma4iep = <22>;
smart_color = <90>;
lcd_gpio_0 = <&pio PD 9 GPIO_ACTIVE_HIGH>;
lcd_bl_en = <&pio PE 12 GPIO_ACTIVE_HIGH>;
pinctrl-0 = <&dsi2lane_pins_a>;
pinctrl-1 = <&dsi2lane_pins_b>;
}
首先按照帖子《D1 开发板使用 XR829 mesh fw 出现 code(56) 错误,如何解决》:
https://bbs.aw-ol.com/topic/361/share/1 配置了蓝牙,输出
root@TinaLinux:/# hciattach -n ttyS1 xradio >/dev/null 2>&1 &
root@TinaLinux:/# [ 341.203731]sunxi-rfkill soc@3000000:rfkill@0: set block: 1
[ 341.210080]sunxi-rfkill soc@3000000:rfkill@0: bt power off success
[ 341.237565]sunxi-rfkill soc@3000000:rfkill@0: set block: 0
[ 341.253736]sunxi-rfkill soc@3000000:rfkill@0: bt power on success
[ 341.280858][XR_BT_LPM] bluedroid_write_proc_btwake: bluedroid_write_proc_btwake 1
[ 341.289318][XR_BT_LPM] bluedroid_write_proc_btwake: wakeup bt device
[ 341.296571][XR_BT_LPM] bluedroid_write_proc_lpm: disable lpm mode
root@TinaLinux:/# hciconfig -a hci0 up
root@TinaLinux:/# hciconfig
hci0: Type: Primary Bus: UART
BD Address: 22:22:65:05:28:FE ACL MTU: 1021:8 SCO MTU: 255:4
UP RUNNING
RX bytes:1154 acl:0 sco:0 events:54 errors:0
TX bytes:744 acl:0 sco:0 commands:54 errors:0
然后bt_test -i -p a2dp-source
root@TinaLinux:/# bt_test -i -p a2dp-source
8163.127547: BTMG[bt_manager_enable:407]: bt manager version:Version:3.0.1.202110291544,builed time:Oct 29 2021-09:42:35
8163.128196: BTMG[bt_test_status_cb:82]: bt is turnning on.
Bluetooth init has been completed!!
ln: /var/lib/bluetooth: No such file or directory
bluetoothd[296]: Bluetooth daemon 5.54
D-Bus setup failed: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
bluetoothd[296]: Unable to get on D-Bus
bluealsa: Couldn't initialize controller thread: Bad file descriptor
8164.563437: BTMG[bt_profile_global_init:355]: start bluealsa :1 times
8164.572354: BTMG[bt_routine:68]: Couldn't obtain D-Bus connection: Could not connect: No such file or directory
8165.065054: BTMG[bt_manager_enable:449]: init connection to bluez failed!
[ 577.128339]sunxi-rfkill soc@3000000:rfkill@0: block state already is 1
stop bluetoothd and hciattach
8165.198016: BTMG[bt_test_status_cb:65]: BT is off
估计是我什么配置的问题,麻烦大佬分析一下