3. Проверка и настройка параметров карты (MMC)
Здесь в качестве MMC (MultiMedia Card) подразумевается микроSD-карта.
Примечание. Внутренняя (встроенная) флеш-память приставки, которая называется eMMC (embedded MMC
– встроенная ММС) - это тоже - карта (card). Отличия в этих двух видах 'карт' - только в наличии
у eMMC собственного встроенного контроллера и буфера, а у внешней карты - интерфейса для подключения
к SD-слоту. Поэтому для загрузки прошивки нет принципиальной разницы - откуда загружаться:
с внутренней eMMC или с нешней MMC, т.е. с микроSD-карты (SD - Secure Digital).
Если точнее, то современные карты имеют стандарт SDHC(емкость до 32 Gb) и SDXC(емкость выше 32 Gb)
if (work_mode != WORK_MODE_BOOT)
{ pr_info("Is not Boot mode!
");
return 0;
}
Используется драйвер MMC 'sunxi_mmc_tuning.c'
( MMC driver for allwinner sunxi platform).
Здесь определяется тип контроллера SD-карты и производится её настройка:
SUNXI SDMMC Controller Version:0x40502
.......
write_tuning_try_freq: write ok
Pattern compare ok
Write tuning pattern ok
Лог: Проверка и настройка параметров карты (MMC)
try card 2
set card number 2
get card number 2
[00.695][mmc]: mmc driver ver uboot2018:2021-12-20 13:35:00
[00.701][mmc]: get sdc_type fail and use default host:tm4.
[00.706][mmc]: Is not Boot mode!
[00.709][mmc]: SUNXI SDMMC Controller Version:0x40502
[00.720][mmc]: ************Try SD card 2************
[00.726][mmc]: mmc 2 cmd timeout 100 status 100
[00.730][mmc]: smc 2 err, cmd 8, RTO
[00.733][mmc]: mmc 2 close bus gating and reset
[00.738][mmc]: mmc 2 cmd timeout 100 status 100
[00.742][mmc]: smc 2 err, cmd 55, RTO
[00.746][mmc]: mmc 2 close bus gating and reset
[00.750][mmc]: ************Try MMC card 2************
[00.826][mmc]: mmc 2 cmd timeout 100 status 100
[00.830][mmc]: smc 2 err, cmd 8, RTO
[00.833][mmc]: mmc 2 close bus gating and reset
[00.838][mmc]: mmc 2 cmd timeout 100 status 100
[00.842][mmc]: smc 2 err, cmd 55, RTO
[00.846][mmc]: mmc 2 close bus gating and reset
[00.862][mmc]: gen_tuning_blk_bus8: total blk 10
[00.866][mmc]: gen_tuning_blk_bus4: total blk 6
[00.870][mmc]: Using 8 bit tuning now
[00.912][mmc]: write_tuning_try_freq: write ok
[00.917][mmc]: Pattern compare ok
[00.920][mmc]: Write tuning pattern ok
[00.923][mmc]: ================== HSSDR52_SDR25...
[00.928][mmc]: skip freq 400000
[00.931][mmc]: skip freq 25000000
[00.934][mmc]: freq: 2-50000000-64-4
[01.546][mmc]: [0-41|42] [44-63|20]
[01.549][mmc]: ================== HS200_SDR104...
[01.555][mmc]: skip freq 400000
[01.557][mmc]: skip freq 25000000
[01.560][mmc]: freq: 2-50000000-64-4
[02.122][mmc]: freq: 3-100000000-64-4
[02.632][mmc]: freq: 4-150000000-64-4
[03.109][mmc]: skip freq 200000000
[03.112][mmc]: [0-37|38] [40-63|24]
[03.116][mmc]: [0-37|38] [40-63|24]
[03.119][mmc]: [0-2|3] [5-37|33] [40-63|24]
[03.123][mmc]: ================== HSDDR52_DDR50...
[03.128][mmc]: skip freq 400000
[03.131][mmc]: freq: 1-25000000-64-4
[03.704][mmc]: freq: 2-50000000-64-4
[04.229][mmc]: [0-37|38] [40-42|3] [44-52|9] [54-63|10]
[04.234][mmc]: [0-37|38] [40-63|24]
[04.237][mmc]: ================== HS400...
[04.241][mmc]: skip freq 400000
[04.244][mmc]: skip freq 25000000
[04.247][mmc]: freq: 2-50000000
[04.263][mmc]: freq: 3-100000000
[04.278][mmc]: skip freq 150000000
[04.281][mmc]: skip freq 200000000
[04.284][mmc]: speed mode: HS400
[04.287][mmc]: [0-37|38] [39-63|25]
[04.291][mmc]: [0-63|64]
[04.293][mmc]: skip freq 400000
[04.296][mmc]: skip freq 25000000
[04.299][mmc]: freq: 2-50000000-64-4
[04.709][mmc]: freq: 3-100000000-64-4
[04.907][mmc]: skip freq 150000000
[04.909][mmc]: skip freq 200000000
[04.913][mmc]: [0-10|11] [12-49|38]
[04.916][mmc]: [0-23|24]
[04.919][mmc]: DS26/SDR12: 0xffffffff 0xffffffff
[04.923][mmc]: HSSDR52/SDR25: 0xff15ffff 0xffffffff
[04.928][mmc]: HSDDR52/DDR50: 0xff1313ff 0xffffffff
[04.932][mmc]: HS200/SDR104: 0x1313ffff 0xffffff15
[04.937][mmc]: HS400: 0x0c1fffff 0xffffffff
[04.941][mmc]: HS400: 0x2013ffff 0xffffffff
[04.947][mmc]: Best spd md: 4-HS400, freq: 3-100000000, Bus width: 8
[04.953][mmc]: mmc driver ver uboot2018:2021-12-20 13:35:00
[04.958][mmc]: get sdc_type fail and use default host:tm1.
[04.964][mmc]: can't find node "mmc0",will add new node
[04.968][mmc]: fdt err returned
[04.972][mmc]: Using default timing para
[04.976][mmc]: SUNXI SDMMC Controller Version:0x40200
[04.995][mmc]: card_caps:0x3000000a
[04.998][mmc]: host_caps:0x3000003f
[05.003]init_clocks:finish