## GT King pro電視盒子調(diào)試日志
@201126 初步啟動內(nèi)核,使用bee-link論壇發(fā)布的最新manjora鏡像SD啟動uboot.
1. 新版mkimage后面必須接輸入輸出文件名即mkimage -d Image uImage,其他格式控制參數(shù)放在其后,否則不執(zhí)行。
mkimage -d Image uImage -A arm64 -a 8080000 -e 8080000 -C none
2. gtking_pro千兆網(wǎng)口使用RTL8211,要啟用dwmac(origin from stm)和realtek phy驅(qū)動才能支持,
3. bootargs參數(shù),如果使用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內(nèi)核成功引導(dǎo)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卡拔掉就不報錯了!
經(jīng)過幾天的代碼跟蹤,判斷原因是SD/mmc host初始化出錯,但是一直不得其解。
后來在s922x的mmc 驅(qū)動代碼(meson-gx-mmc.c)
static int meson_mmc_probe(struct platform_device *pdev)
中發(fā)現(xiàn)如下代碼,一開始也沒想到會跟電壓調(diào)節(jié)器相關(guān)。
/* Get regulators and the supported OCR mask */
host->vqmmc_enabled = false;
ret = mmc_regulator_get_supply(mmc);
if (ret) goto free_host;
皇天不負(fù)有心人,第N次配置內(nèi)核 make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig, 時看到 Voltage and Current Regulator Support選項,感覺會不會跟它相關(guān)呢?所以便把它選上了,編譯下載測試竟然不報錯了!!
只需要把根選項選上就行了,不需要其他子選項。
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塊設(shè)備等依賴此模塊實現(xiàn)其他頂層功能。
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主機實現(xiàn)模塊,mmc驅(qū)動接口]
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設(shè)備樹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>;
};
聯(lián)系客服