gtking_pro_s922x内核调试日志
## GT King pro电视盒子调试日志
@201126 初步启动内核,使用bee-link论坛发布的最新manjora镜像SD启动uboot.
1. 新版mkimage后面必须接输入输出文件名即mkimage -d Image uImage,其他格式控制参数放在其后,否则不执行。
mkimage -d Image uImage -A arm64 -a 8080000 -e 8080000 -C none
2. gtking_pro千兆网口使用RTL8211,要启用dwmac(origin from stm)和realtek phy驱动才能支持,
3. bootargs参数,如果使用initrd格式启动则可以不需要,
setenv bootargs 'root=/dev/nfs rw nfsroot=192.168.1.113:/home/work/gtking_rootfs ip=192.168.1.51:192.168.1.113:192.168.1.1:255.255.255.0::eth0:off init=/linuxrc'
4. tftp自动下载命令
setenv bootcmd "dhcp;setenv serverip 192.168.1.113;tftp $kernel_addr_r uImage;tftp $ramdisk_addr_r uInitrd;tftp $fdt_addr_r meson-g12b-gtking-pro_599.dtb;bootm $kernel_addr_r $ramdisk_addr_r $fdt_addr_r;"
run bootcmd
5. @201128 解决一个困扰几天的问题:
用5.9.9的linux内核成功引导gtking_pro启动后一直不停输出如下错误信息
[ 5.568574] sd card's ocr= 40ff8000 whereas host's ocr= 0
[ T45] meson-gx-mmc ffe05000.sd: no support for card's volts
[ 13.066049][ T45] mmc0: error -22 whilst initialising SD card
初步判断原因是sd卡识别出错,因为把sd卡拔掉就不报错了!
经过几天的代码跟踪,判断原因是SD/mmc host初始化出错,但是一直不得其解。
后来在s922x的mmc 驱动代码(meson-gx-mmc.c)
static int meson_mmc_probe(struct platform_device *pdev)
中发现如下代码,一开始也没想到会跟电压调节器相关。
/* Get regulators and the supported OCR mask */
host->vqmmc_enabled = false;
ret = mmc_regulator_get_supply(mmc);
if (ret) goto free_host;
皇天不负有心人,第N次配置内核 make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig, 时看到 Voltage and Current Regulator Support选项,感觉会不会跟它相关呢?所以便把它选上了,编译下载测试竟然不报错了!!
只需要把根选项选上就行了,不需要其他子选项。
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image -j5
mkimage -d arch/arm64/boot/Image ~/ftp_dir/uImage -A arm64 -a 8080000 -e 8080000 -C none
跟踪及分析代码如下:
<mmc/core/core.c> [mmc核心功能模块]各种操作接口,mmc块设备等依赖此模块实现其他顶层功能。
mmc_select_voltage(struct mmc_host *host, u32 ocr)
->mmc_attach_sd(struct mmc_host *host)
->mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
->mmc_rescan(struct work_struct *work)
->
<mmc/core/host.c> [mmc主机通用接口]
mmc_alloc_host(int extra, struct device *dev)
-><mmc/core/meson-gx-mmc.c> [mmc主机实现模块,mmc驱动接口]
meson_mmc_probe(struct platform_device *pdev)
sdhci_setup_host(struct sdhci_host *host)
->[sdhci-pltfm.c]
int sdhci_pltfm_register(struct platform_device *pdev,
const struct sdhci_pltfm_data *pdata,
size_t priv_size)
gtking_pro设备树mmc接口:
sd_emmc_b: sd@ffe05000 {
compatible = "amlogic,meson-axg-mmc";
reg = <0x0 0xffe05000 0x0 0x800>;
interrupts = <GIC_SPI 190 IRQ_TYPE_EDGE_RISING>;
status = "disabled";
clocks = <&clkc CLKID_SD_EMMC_B>,
<&clkc CLKID_SD_EMMC_B_CLK0>,
<&clkc CLKID_FCLK_DIV2>;
clock-names = "core", "clkin0", "clkin1";
resets = <&reset RESET_SD_EMMC_B>;
};
/* SD card */
&sd_emmc_b {
status = "okay";
pinctrl-0 = <&sdcard_c_pins>;
pinctrl-1 = <&sdcard_clk_gate_c_pins>;
pinctrl-names = "default", "clk-gate";
bus-width = <4>;
cap-sd-highspeed;
max-frequency = <50000000>;
disable-wp;
cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
vmmc-supply = <&vddao_3v3>;
vqmmc-supply = <&vddao_3v3>;
};