Jump to content
    

В файле pcw.dtsi эти строки отвечают за конфигурацию контроллера SD?

&sdhci0 {
    clock-frequency = <200000000>;
    status = "okay";
    xlnx,mio_bank = <0x0>;
};

Пока пытаюсь поменять их на

&sdhci0 {
    clock-frequency = <200000000>;
    status = "okay";
    xlnx,mio_bank = <0x0>;

    bus-width = <8>;
};

Share this post


Link to post
Share on other sites

Говорю же, тормозните U-Boot на загрузке и поизучайте его DT. В наиболее общем случае, у U-Boot и у ядра могут быть разные DT

Vivado (и SDK) какой версии используете?

Share this post


Link to post
Share on other sites

Quote

root@zynqmp:~# ls -l /sys/firmware/devicetree/base/amba/sdhci*
/sys/firmware/devicetree/base/amba/sdhci@ff160000:
total 0
-r--r--r-- 1 root root  4 May 30 16:42 #stream-id-cells
-r--r--r-- 1 root root  4 May 30 16:42 clock-frequency
-r--r--r-- 1 root root 16 May 30 16:42 clock-names
-r--r--r-- 1 root root 16 May 30 16:42 clocks
-r--r--r-- 1 root root 35 May 30 16:42 compatible
-r--r--r-- 1 root root  4 May 30 16:42 interrupt-parent
-r--r--r-- 1 root root 12 May 30 16:42 interrupts
-r--r--r-- 1 root root  8 May 30 16:42 iommus
-r--r--r-- 1 root root  6 May 30 16:42 name
-r--r--r-- 1 root root  4 May 30 16:42 power-domains
-r--r--r-- 1 root root 16 May 30 16:42 reg
-r--r--r-- 1 root root  5 May 30 16:42 status
-r--r--r-- 1 root root  0 May 30 16:42 u-boot,dm-pre-reloc
-r--r--r-- 1 root root  4 May 30 16:42 xlnx,device_id
-r--r--r-- 1 root root  4 May 30 16:42 xlnx,mio_bank

Т.е. bus-width оно не увидело?

9 minutes ago, gosha-z said:

тормозните U-Boot на загрузке и поизучайте его DT

Какой командой?

Quote

ZynqMP> dm tree
 Class      Probed  Driver      Name
----------------------------------------
 root       [ + ]   root_drive  root_driver
 simple_bus [   ]   generic_si  |-- amba_apu@0
 simple_bus [ + ]   generic_si  |-- amba
 eth        [ + ]   zynq_gem    |   |-- ethernet@ff0e0000
 gpio       [   ]   gpio_zynq   |   |-- gpio@ff0a0000
 spi        [ + ]   zynqmp_qsp  |   |-- spi@ff0f0000
 spi_flash  [   ]   spi_flash_  |   |   `-- spi_flash@0:0
 mmc        [ + ]   arasan_sdh  |   |-- sdhci@ff160000
 blk        [   ]   mmc_blk     |   |   `-- sdhci@ff160000.blk
 serial     [ + ]   serial_zyn  |   |-- serial@ff000000
 serial     [   ]   serial_zyn  |   `-- serial@ff010000
 clk        [ + ]   fixed_rate  |-- pss_ref_clk
 clk        [ + ]   fixed_rate  |-- video_clk
 clk        [ + ]   fixed_rate  |-- pss_alt_ref_clk
 clk        [ + ]   fixed_rate  |-- gt_crx_ref_clk
 clk        [ + ]   fixed_rate  |-- aux_ref_clk
 clk        [ + ]   zynqmp-clk  |-- clk
 clk        [   ]   fixed_rate  |-- dp_aclk
 simple_bus [   ]   generic_si  `-- amba_pl@0
ZynqMP>

Оно?

Share this post


Link to post
Share on other sites

3 minutes ago, doom13 said:

Т.е. bus-width оно не увидело?

Нет, не увидел.

3 minutes ago, doom13 said:

Какой командой?

fdt, если есть. Хотя я могу путать, и это команда просмотра загруженного  DT

Share this post


Link to post
Share on other sites

Quote

ZynqMP> fdt list
fdt - flattened device tree utility commands
 
Usage:
fdt addr [-c]  <addr> [<length>]   - Set the [control] fdt location to <addr>
fdt move   <fdt> <newaddr> <length> - Copy the fdt to <addr> and make it active
fdt resize [<extrasize>]            - Resize fdt to size + padding to 4k addr + some optional <extrasize> if needed
fdt print  <path> [<prop>]          - Recursive print starting at <path>
fdt list   <path> [<prop>]          - Print one level starting at <path>
fdt get value <var> <path> <prop>   - Get <property> and store in <var>
fdt get name <var> <path> <index>   - Get name of node <index> and store in <var>
fdt get addr <var> <path> <prop>    - Get start address of <property> and store in <var>
fdt get size <var> <path> [<prop>]  - Get size of [<property>] or num nodes and store in <var>
fdt set    <path> <prop> [<val>]    - Set <property> [to <val>]
fdt mknode <path> <node>            - Create a new node after <path>
fdt rm     <path> [<prop>]          - Delete the node or <property>
fdt header                          - Display header info
fdt bootcpu <id>                    - Set boot cpuid
fdt memory <addr> <size>            - Add/Update memory node
fdt rsvmem print                    - Show current mem reserves
fdt rsvmem add <addr> <size>        - Add a mem reserve
fdt rsvmem delete <index>           - Delete a mem reserves
fdt chosen [<start> <end>]          - Add/update the /chosen branch in the tree
                                        <start>/<end> - initrd start/end addr
NOTE: Dereference aliases by omitting the leading '/', e.g. fdt print ethernet0.
ZynqMP>

Команда есть, но опции непонятны

Quote

ZynqMP> help
?       - alias for 'help'
aes     - AES 128 CBC encryption
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
booti   - boot arm64 Linux Image image from memory
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
chpart  - change active partition
clk     - CLK sub-system
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
cpu     - Multiprocessor CPU boot manipulation and release
crc32   - checksum calculation
dhcp    - boot image via network using DHCP/TFTP protocol
dm      - Driver model low level access
echo    - echo args to console
editenv - edit environment variable
env     - environment handling commands
exit    - exit script
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
ext4load- load binary file from a Ext4 filesystem
ext4ls  - list files in a directory (default /)
ext4size- determine a file's size
ext4write- create a file in the root directory
false   - do nothing, unsuccessfully
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fatsize - determine a file's size
fatwrite- write file into a dos filesystem
fdt     - flattened device tree utility commands
fpga    - loadable FPGA image support
fstype  - Look up a filesystem type
go      - start application at address 'addr'
gpt     - GUID Partition Table
gzwrite - unzip and write memory to block device
help    - print command description/usage
i2c     - I2C sub-system
iminfo  - print header information for application image
imxtract- extract a part of a multi-image
itest   - return true/false on integer compare
load    - load binary file from a filesystem
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loadx   - load binary file over serial line (xmodem mode)
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
ls      - list files in a directory (default /)
lzmadec - lzma uncompress a memory region
md      - memory display
mdio    - MDIO utility commands
mii     - MII utility commands
mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - display MMC info
mtdparts- define flash/nand partitions
mtest   - simple RAM read/write test
mw      - memory write (fill)
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
part    - disk partition related commands
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
pxe     - commands to get and boot from pxe files
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
save    - save file to a filesystem
saveenv - save environment variables to persistent storage
setenv  - set environment variables
setexpr - set environment variable as the result of eval expression
sf      - SPI flash sub-system
showvar - print local hushshell variables
size    - determine a file's size
sleep   - delay execution for some time
source  - run script from memory
sspi    - SPI utility command
sysboot - command to get and boot from syslinux files
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
tftpput - TFTP put command, for uploading files to a server
time    - run commands and summarize execution time
timer   - access the system timer
true    - do nothing, successfully
ubi     - ubi commands
ubifsload- load file from an UBIFS filesystem
ubifsls - list files in a directory
ubifsmount- mount UBIFS volume
ubifsumount- unmount UBIFS volume
unzip   - unzip a memory region
version - print monitor, compiler and linker version
zynqmp  - Verify and load secure images
ZynqMP>

Всё, что есть в helpe

Share this post


Link to post
Share on other sites

Может быть стоит проверить работоспособность eMMC из SDK, на уровне комманд, попробовать попереключать шину? Или тут стопудово u-boot не понимает, что шину в х8 включить надо?

Share this post


Link to post
Share on other sites

14 hours ago, gosha-z said:

2. Лучше сделайте PMUFW и FSBL в SDK, а не в пиволинуксе 

FSBL у меня свой (шаблонный + немного своего кода), было необходимо конфигурирование системы тактирования. Ещё добавил в него инициализацию eMMC, судя по printf-ам она проходит.

Share this post


Link to post
Share on other sites

Надо весь комплект - PMUFW, FSBL, U-Boot. "Своя" инициализация eMMC в FSBL погоды не сделает - пока не пересоберете U-Boot с правильным Device Tree, он не будет читать в 8-bit width

Share this post


Link to post
Share on other sites

Проверил на всякий случай, что происходит с памятью если пытаться её конфигурировать (использовал SDK BSP). Значение BUS_WIDTH [183] (Extended CSD[183]) при переключении шины меняется с 0 на 2, т.е. как и должно быть для шины х8. Пробую PMUFW выкатить из SDK.

Share this post


Link to post
Share on other sites

13 minutes ago, doom13 said:

Проверил на всякий случай, что происходит с памятью если пытаться её конфигурировать (использовал SDK BSP). Значение BUS_WIDTH [183] (Extended CSD[183]) при переключении шины меняется с 0 на 2, т.е. как и должно быть для шины х8. Пробую PMUFW выкатить из SDK.

А потом U-Boot на это забивает и работает так, как ему сказано. Предлагаю начать медитировать на тему Device Tree Control - Default Device Tree for DT control

Share this post


Link to post
Share on other sites

Quote

root@zynqmp:~# ls -l /sys/firmware/devicetree/base/amba/sdhci*
/sys/firmware/devicetree/base/amba/sdhci@ff160000:
total 0
-r--r--r-- 1 root root  4 May 30 16:41 #stream-id-cells
-r--r--r-- 1 root root  4 May 30 16:41 bus-width
-r--r--r-- 1 root root  4 May 30 16:41 clock-frequency
-r--r--r-- 1 root root 16 May 30 16:41 clock-names
-r--r--r-- 1 root root 16 May 30 16:41 clocks
-r--r--r-- 1 root root 35 May 30 16:41 compatible
-r--r--r-- 1 root root  4 May 30 16:41 interrupt-parent
-r--r--r-- 1 root root 12 May 30 16:41 interrupts
-r--r--r-- 1 root root  8 May 30 16:41 iommus
-r--r--r-- 1 root root  4 May 30 16:41 max-frequency
-r--r--r-- 1 root root  6 May 30 16:41 name
-r--r--r-- 1 root root  4 May 30 16:41 power-domains
-r--r--r-- 1 root root 16 May 30 16:41 reg
-r--r--r-- 1 root root  5 May 30 16:41 status
-r--r--r-- 1 root root  0 May 30 16:41 u-boot,dm-pre-reloc
-r--r--r-- 1 root root  4 May 30 16:41 xlnx,device_id
-r--r--r-- 1 root root  4 May 30 16:41 xlnx,mio_bank
root@zynqmp:~#
root@zynqmp:~#
root@zynqmp:~# cat /sys/kernel/debug/mmc0/ios
clock:        200000000 Hz
actual clock:    200000000 Hz
vdd:        21 (3.3 ~ 3.4 V)
bus mode:    2 (push-pull)
chip select:    0 (don't care)
power mode:    2 (on)
bus width:    3 (8 bits)
timing spec:    9 (mmc HS200)
signal voltage:    1 (1.80 V)
driver type:    0 (driver type B)
root@zynqmp:~#

 

Добавил /<plnx_proj>/components/plnx_workspace/device-tree/device-tree/system-user.dtsi (Вообще советуют делать Customizing Device Trees in Yocto , но у меня так не получилось, ошибки плюёт).

Quote

/include/ "system-conf.dtsi"
/ {
};

/* SD0 eMMC, 8-bit wide data bus */
/* non-removable; */
/* broken-mmc-highspeed; */

&sdhci0 {
    max-frequency = <200000000>;
        bus-width = <8>;
};

после старта в Linux разрядность шины поменяло, но u-boot работает, как и раньше в х4

Quote

U-BOOT for zynqmp
 
Hit any key to stop autoboot:  1 0  
Device: sdhci@ff160000
Manufacturer ID: 13
OEM: 14e
Name: Q2J55  
Tran Speed: 200000000
Rd Block Len: 512
MMC version 5.0
High Capacity: Yes
Capacity: 7.1 GiB
Bus Width: 4-bit
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 7.1 GiB WRREL
Boot Capacity: 16 MiB ENH
RPMB Capacity: 4 MiB ENH
reading image.ub

 

Share this post


Link to post
Share on other sites

В очередной раз повторяю: в наиболее общем случае, у U-Boot и у ядра могут быть разные device tree...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...