拿到了 T113 的片子,先焊接上去
然后准备下SDK,拉取了全新的D1-H 2.1SDK
然后去 https://github.com/YuzukiHD/TinaAddons 找到 T113 的补丁打进去
git clone https://github.com/YuzukiHD/TinaAddons.git
cp -rf TinaAddons/* .
chmod 777 apply_patch.sh
./apply_patch.sh
然后就能找到 T113 平台了
修改 DRAM 驱动,支持T113
驱动:https://github.com/YuzukiHD/TinyKasKit/blob/master/lib-dram-for-t113-s4.tar.gz
把这个驱动放到 lichee/brandy-2.0/spl/drivers/dram/sun8iw20p1
烧录~启动,识别了256M 内存
问题来了,卡OPTEE
M/TC: OP-TEE version: 963b7e95 (gcc version 5.3.1 20160412 (Linaro GCC 5.3-2016.05)) #1 Wed Jul 28 12:51:52 UTC 2021 arm
E/TC:0 0 check_hardware_info:122 data: 60 0 0 0
E/TC:0 0 check_hardware_info:123 hardware error 3
E/TC:0 0 Panic at core/arch/arm/plat-sun8iw20p1/main.c:301 <plat_init>
E/TC:0 0 Call stack:
E/TC:0 0 0x41b0a271
那就先跳过 OPTEE 吧,在 device/config/chips/t113/configs/nezha/
新建一个 boot_package.cfg
写入以下内容
[package]
item=u-boot, u-boot.fex
item=dtb, sunxi.fex
然后找到 lichee/linux-5.4/arch/arm/boot/dts/sun8iw20p1.dtsi
中的 psci 节点把他删了
psci {
compatible = "arm,psci-1.0";
method = "smc";
};
启动了,256M 可用内存
启用SMP
由于上面关闭了optee和pcsi,所以是不能用双核的,为了开启双核需要加下配置代码
打开 lichee/linux-5.4/arch/arm/mach-sunxi/platsmp.c
文件,在末尾加入下列内容
static int sun8i_t113_smp_boot_secondary(unsigned int cpu,
struct task_struct *idle)
{
u32 reg;
void __iomem *cpucfg_membase = ioremap(0x09010000, 0x10);
void __iomem *cpuexec_membase[] = {ioremap(0x070005C4, 0x10),ioremap(0x070005C8, 0x10)};
if (cpu != 1)
return 0;
spin_lock(&cpu_lock);
writel(__pa_symbol(secondary_startup), cpuexec_membase[cpu]);
reg = readl(cpucfg_membase);
writel(reg | BIT(cpu), cpucfg_membase);
spin_unlock(&cpu_lock);
return 0;
}
static const struct smp_operations sun8i_t113_smp_ops __initconst = {
.smp_boot_secondary = sun8i_t113_smp_boot_secondary,
};
CPU_METHOD_OF_DECLARE(sun8i_t113_smp, "allwinner,sun8iw20p1", &sun8i_t113_smp_ops);
配置smp,设置boot地址和rst地址并且启动即可