Summary of Contents for SMART Embedded Computing COMX-P2020 BSP
Page 1
COMX-P2020 BSP User Guide P/N: 6806800L84C December 2019...
Page 2
Computing” and the SMART Embedded Computing logo are trademarks of SMART Modular Technologies, Inc. All other names and logos referred to are trade names, trademarks, or registered trademarks of their respective owners. These materials are provided by SMART Embedded Computing as a service to its customers and may be used for informational purposes only. Disclaimer* SMART Embedded Computing (SMART EC) assumes no responsibility for errors or omissions in these materials.
Repeated item for example node 1, node 2, ..., node 12 Omission of information from example/command that is not necessary at the time Ranges, for example: 0..4 means one of the integers 0,1,2,3, and 4 (used in registers) Logical OR COMX-P2020 BSP User Guide (6806800L84C)
Page 12
Indicates an electrical situation that could result in moderate injury or death Indicates that when working in an ESD environment care should be taken to use proper ESD practices No danger encountered, pay attention to important information COMX-P2020 BSP User Guide (6806800L84C)
Page 13
This manual has been revised and replaces all prior editions. Part Number Publication Date Description 6806800L84A December 2010 GA version 6806800L84B July 2014 Re-branded to Artesyn 6806800L84C December 2019 Rebrand to SMART Embedded Computing template COMX-P2020 BSP User Guide (6806800L84C)
Page 14
About this Manual About this Manual COMX-P2020 BSP User Guide (6806800L84C)
Although it can also be used to upgrade SPI Flash as u-boot-spi.bin, Not using it is suggested because it will cost much more time than u-boot-spi.bin. COMX-P2020.src.tar.gz: The tar ball of the BSP source code, which can be used to compile all of the above BSP targets. COMX-P2020 BSP User Guide (6806800L84C)
Page 16
Overview Overview COMX-P2020 BSP User Guide (6806800L84C)
1. Please contact SMART EC for the tar ball of BSP source file: COMX-2020.src.tar.gz and copy it to the home directory of the user. 2. As a non-root user, uncompress the file COMX-P2020.src.tar.gz. [percy@localhost ~]$ tar zxvf COMX-P2020.src.tar.gz COMX-P2020 BSP User Guide (6806800L84C)
Linux Kernel. ~/u-boot is the U-boot directory, which can be used to compile the U-boot for COMX-P2020. 4. Run "make" at the COMX-P2020 BSP directory to see the help information. [percy@localhost p2020]$ make ++++++++++++++++++++++++++++++++++++++++++++++++++++++ Emerson BlackAdder - P2020 Build...
Page 21
++++++++++++++++++++++++++++++++++++++++++++++++++++++ current output dir = /home/percy/p2020/. COMX-P2020 BSP User Guide (6806800L84C)
Page 22
OUTPUTDIR For example: export OUTPUTDIR=/local/tftpboot/COMX- P2020/current 5. Set the output directory for the compiled BSP targets. If no output directory is set, then the working directory will be regarded as output directory. export OUTPUTDIR=/local/tftpboot/COMX-P2020/current COMX-P2020 BSP User Guide (6806800L84C)
(MPC5xx, MPC8xx, MPC82xx, MPC7xx, MPC74xx, 4xx, QorIQ) while P2020 is a base-on- supported-QorIQ processor, it is possible, as well as useful, to provide the U-boot firmware as the COMX-P2020 bootloader. COMX-P2020 only supports starting-up U-boot from SPI Flash and SD Card. COMX-P2020 BSP User Guide (6806800L84C)
Build rootfs-min-ext2.img 1. To build rootfs-min-ext2.img, run the command: "make rootfs-min-ext2" at P2020 BSP directory: [percy@localhost p2020]$ make rootfs-min-ext2 make -C linux/fs -f Makefile rootfs-min-ext2 make[1]: Entering directory `/home/percy/p2020/linux/fs' rm -f /tmp/percy/rootfs_ext2_min.img /local/tftpboot/COMX- P2020/current/rootfs-min.ext2.img ./scripts/gen_rootfs_ext2.sh min COMX-P2020 BSP User Guide (6806800L84C)
Page 32
Leaving directory `/home/percy/p2020/linux/fs' [percy@localhost p2020]$ 2. If successful, the rootfs-min-ext2.img can be found at the output directory: [percy@localhost p2020]$ ls -al /local/tftpboot/COMX- P2020/current/rootfs-min.ext2.img -rw-r--r-- 1 percy percy 3873983 Dec 13 11:39 /local/tftpboot/COMX- P2020/current/rootfs-min.ext2.img [percy@localhost p2020]$ COMX-P2020 BSP User Guide (6806800L84C)
Page 38
2. If successful, the COMX-P2020.bsp.tar.gz and u-boot.bin can be found at the output directory: [percy@localhost p2020]$ ls -al /local/tftpboot/COMX- P2020/current/* -rw-rw-r-- 1 percy percy 462424461 Dec 13 12:12 /local/tftpboot/COMX-P2020/current/COMX-P2020.bsp.tar.gz -rw-rw-r-- 1 percy percy 4194304 Dec 13 12:12 /local/tftpboot/COMX-P2020/current/u-boot.bin [percy@localhost p2020]$ COMX-P2020 BSP User Guide (6806800L84C)
5. Power on the board and check the console prompt. 6. Extract the BSP targets from the compressed BSP tar ball as below: [percy@localhost current]$ pwd/local/tftpboot/COMX-P2020/current [percy@localhost current]$ tar zxvf COMX-P2020.bsp.tar.gz make_sd.sh u-boot-spi.bin u-boot-sd.bin comx.dtb uImage rootfs-LRFS.tar.gz rootfs-nfs.tar.gz rootfs-dev.ext2.img rootfs-usr.ext2.img rootfs-min.ext2.img [percy@localhost current]$ COMX-P2020 BSP User Guide (6806800L84C)
COMX-P2020. If the SD card is damaged, we can program it at the Linux host with a USB reader as below: Create the /local/tftpboot/COMX-P2020/current directory at host, and copy the release file: COMX-P2020.bsp.tar.gz to the directory: /local/tftpboot/COMX- P2020/current COMX-P2020 BSP User Guide (6806800L84C)
Page 41
2 18:43 /dev/sdb [percy@localhost current]$ sudo fdisk -l /dev/sdb Disk /dev/sdb: 2002 MB, 2002780160 bytes 62 heads, 62 sectors/track, 1017 cylinders Units = cylinders of 3844 * 512 = 1968128 bytes Device Boot Start Blocks Id System COMX-P2020 BSP User Guide (6806800L84C)
To understand the structure of SD card, please refer the chapter: LINK deploy filesystem to SD Card. 5.3.2 Start-up U-boot from SD Card Set the switch as: SW1[1] = OFF, SW1[2] = OFF, SW2[1] = OFF, SW2[2] = ON, and power on the board. COMX-P2020 BSP User Guide (6806800L84C)
1. Install the driver and application of the SF100 at the Windows OS. 2. Connect the SF100 to the USB port and insert the SPI Flash into the socket of SF100. The COMX-P2020 support the SPI Flash: S25FL032A(P) COMX-P2020 BSP User Guide (6806800L84C)
Page 44
3. Run DediPro.exe: If the driver and application for SF100 installs successfully, the Dediprog can find the SPI Flash: S25FL032A(P) as above. 4. Load file by clicking the File and select the u-boot-spi.bin.Select "Raw Binary". COMX-P2020 BSP User Guide (6806800L84C)
- 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 COMX-P2020 BSP User Guide (6806800L84C)
Page 47
- load S-Record file over serial line loady - load binary file over serial line (ymodem mode) loop - infinite loop on address range - display and program the system ID and MAC addresses in EEPROM - memory display COMX-P2020 BSP User Guide (6806800L84C)
Page 48
TFTP protocol - USB sub-system usbboot - boot from USB device version - print monitor version - setting watchdog => Most of the displayed commands were inherited from U-boot. COMX-P2020 BSP User Guide (6806800L84C)
Connected to the COM-E Carrier Board Multiplex as SDHC_CD: which is used to GPIO 8 check if the SD insert or not. Multiplex as SDHC_WP: which is used to GPIO 9 check the SD is write protect or not. COMX-P2020 BSP User Guide (6806800L84C)
Always the four ISO- 0x00-0x03 Tag ID 4 Byte NXID Static 8859 characters "NXID" with no null termination. "From 1 to 11 ISO- 8859 characters 0x04-0x0F Serial Number 12 Byte "12345678901\0 describing the Variable module family, null terminated. COMX-P2020 BSP User Guide (6806800L84C)
0x54-0x71 Reserved 30 Byte Reserved Static 00h a0h 14h 10h 32 bit CRC of values 0x72-0x75 CRC32 4 Byte Means the CRC is: 0x00 through 0x71, Variable 0x00A01410 inclusive 0x76-0xFF Reserved 138 Byte Reserved Static COMX-P2020 BSP User Guide (6806800L84C)
Page 53
Save the seeting to the ID EEPROM: mac save Programming passed. Show the setting of the ID EEPROM: ID: NXID v0 SN: 12345678901 Errata: 1234 Build date: 2010/04/30 16:50:00 Eth0: 00:05:9f:ff:a1:01 Eth1: 00:05:9f:ff:a1:02 Eth2: 00:05:9f:ff:a1:03 CRC: 5a314c3d COMX-P2020 BSP User Guide (6806800L84C)
16 Bytes "COME2\0" for Static Family module family, null P2020 derivitaves terminated "COME3\0" for P1022 derivatives "From 1 to 7 ISO-8859 Module characters describing the 0x40-0x47 8 Bytes "GA\0 Variable Version module version, null terminated COMX-P2020 BSP User Guide (6806800L84C)
Page 55
Valid chip addresses: 38 50 54 70 Excluded chip addresses: 29 => The following command can be used to program the Board EEPROM: Set Tag value: brd id Set the process family: brd pf P2020 COMX-P2020 BSP User Guide (6806800L84C)
Page 56
ID: COMX Processor Family: P2020 Processor Version: B Processor Errata: 00 Module Family: COME2 Module Version: GA Module Errata: 00 Memory Size(MB): 2048 Module Description: ComExpress module on P2020(1.2GHz) Manufacturer: Emerson Network Power CRC: b5d7e834 => COMX-P2020 BSP User Guide (6806800L84C)
Show the channel connected to the I2C Bus: The command: "i2cswitch show" can be used to show all the channels that connected to the I2C bus. i2cswitch connect 0 i2cswitch connect 1 i2cswitch show Connected I2C Bus: 0 1 COMX-P2020 BSP User Guide (6806800L84C)
The DDR3 SPD address is A6h(8-bit), and it can be accessed at I2C#2. Chip Probe: The DDR3 SPD address is A6h(8-bit), and it can be accessed at I2C#2. 2. Read SPD The SPD information can be read out with the following commands: COMX-P2020 BSP User Guide (6806800L84C)
1. Chip Probe: The M41ST85W address is D0h(8-bit), and it can be accessed at I2C#2. => i2c dev 1 Setting bus to 1 => i2c probe Valid chip addresses: 1B 33 48 53 68 Excluded chip addresses: COMX-P2020 BSP User Guide (6806800L84C)
Page 60
=> wdg enable 20 => wdg reset => wdg reset 5. Disable Watchdog We can disable the watchdog by the command: "wdg disable": => wdg enable 20 => wdg disable COMX-P2020 BSP User Guide (6806800L84C)
- read `len' bytes starting at `offset' to memory at `addr' sf write addr offset len - write `len' bytes from memory at `addr' to flash at `offset' sf erase offset len - erase `len' bytes from `offset' COMX-P2020 BSP User Guide (6806800L84C)
There are three PCI Express controllers at COMX-P2020: the PCI Express 1 is connected to GPU Z11M, the other two are connected to the carrier board. The U-boot will scan and show the PCI devices when booting as follows: COMX-P2020 BSP User Guide (6806800L84C)
Page 63
.w, .l] b.d.f address - modify, read and keep CFG address pci modify[.b, .w, .l] b.d.f address modify, auto increment CFG address pci write[.b, .w, .l] b.d.f address value - write to CFG address COMX-P2020 BSP User Guide (6806800L84C)
5.5.1 Default U-boot environment When the COMX-P2020 U-boot comes up, it creates the following environment by default: => printenv ramboot=setenv bootargs root=/dev/ram rw DVO_OUTPUT=$DVO_OUTPUT console=$consoledev,$baudrate $othbootargs;tftp $ramdiskaddr $tftppath/$ramdiskfile;tftp $loadaddr $tftppath/$bootfile;tftp $fdtaddr $tftppath/$fdtfile;bootm $loadaddr $ramdiskaddr $fdtaddr COMX-P2020 BSP User Guide (6806800L84C)
Page 65
$loadaddr $bootfile; fatload usb 0:2 $fdtaddr $fdtfile; fatload usb 0:2 $ramdiskaddr $ramdiskfile; bootm $loadaddr $ramdiskaddr $fdtaddr usbext2boot=setenv bootargs root=/dev/ram rw DVO_OUTPUT=$DVO_OUTPUT console=$consoledev,$baudrate $othbootargs; usb start; ext2load usb 0:4 $loadaddr $bootfile; ext2load usb 0:4 $fdtaddr $fdtfile; ext2load usb 0:4 $ramdiskaddr $ramdiskfile; bootm $loadaddr $ramdiskaddr $fdtaddr COMX-P2020 BSP User Guide (6806800L84C)
The following environment settings are required to configure the u-boot for ramdisk deployment using tftp. At U-boot prompt, set u-boot environment like: =>setenv ipaddr <board_ipaddress> =>setenv serverip <tftp_serverip> =>setenv gatewayip <your_gatewayip> =>setenv netmask <net_mask> =>setenv ramdiskfile <root_image> =>setenv tftppath COMX-P2020/current =>saveenv COMX-P2020 BSP User Guide (6806800L84C)
Speed: 100, full duplex Using eTSEC1 device host 192.168.0.197 is alive => tftp COMX-P2020/current/u-boot-spi.bin Enet starting in 100BT/FD Speed: 100, full duplex Using eTSEC1 device TFTP from server 192.168.0.197; our IP address is 192.168.0.250 Filename 'COMX-P2020/current/u-boot-spi.bin'. COMX-P2020 BSP User Guide (6806800L84C)
Page 69
Using eTSEC1 device TFTP from server 192.168.0.197; our IP address is 192.168.0.250 Filename 'u-boot-spi.bin'. Load address: 0x1000000 Loading: #################################### done Bytes transferred = 525312 (80400 hex) 4. Reset the board to boot up from new U-boot image. COMX-P2020 BSP User Guide (6806800L84C)
################################################################# ################################################################# ########################################## done Bytes transferred = 3473422 (35000e hex) Enet starting in 100BT/FD Speed: 100, full duplex Using eTSEC1 device TFTP from server 192.168.0.197; our IP address is 192.168.0.250 Filename 'COMX-P2020/COMX.uImage'. Load address: 0x1000000 COMX-P2020 BSP User Guide (6806800L84C)
Page 72
!!!!! WARNING !!!!!!! The default password for the root account is: root please change this password using the 'passwd' command and then edit this message (/etc/issue) to remove this message COMX-P2020 login: root Password: [root@COMX-P2020 /root]# COMX-P2020 BSP User Guide (6806800L84C)
################################################################# ################################################################# ###################################### done Bytes transferred = 3416476 (34219c hex) Enet starting in 100BT/FD Speed: 100, full duplex Using eTSEC1 device TFTP from server 192.168.0.197; our IP address is 192.168.0.250 Filename 'COMX-P2020/current/comx.dtb'. Load address: 0xc00000 COMX-P2020 BSP User Guide (6806800L84C)
Page 74
!!!!! WARNING !!!!!!! The default password for the root account is: root please change this password using the 'passwd' command and then edit this message (/etc/issue) to remove this message COMX-P2020 login: root Password: [root@COMX-P2020 root]# COMX-P2020 BSP User Guide (6806800L84C)
FAT16 /dev/sda3 1052257+ 82 Linux swap / Solaris /dev/sda4 979965 Linux 3. Format the partition with the following command: [root@COMX-P2020 root]# umount /dev/sda1 [root@COMX-P2020 root]# umount /dev/sda2 [root@COMX-P2020 root]# umount /dev/sda3 [root@COMX-P2020 root]# umount /dev/sda4 COMX-P2020 BSP User Guide (6806800L84C)
Page 77
11 user user 4096 Sep 28 14:53 etc drwxr-xr-x 3 user user 4096 Sep 28 14:48 home drwxr-xr-x 10 user user 4096 Sep 28 14:48 include drwxr-xr-x 5 user user 4096 Sep 28 14:48 lib COMX-P2020 BSP User Guide (6806800L84C)
To starting kernel with inflated ext2FS, please run the command: run usbboot at U-boot prompt: => run usbboot (Re)start USB... USB: Register 10011 NbrPorts 1 USB EHCI 1.00 scanning bus for devices... 3 USB Device(s) found scanning bus for storage devices... 1 Storage Device(s) found COMX-P2020 BSP User Guide (6806800L84C)
Page 79
CPU maps initialized for 1 thread per core bootconsole [udbg0] enabled setup_arch: bootmem mpc85xx_rdb_setup_arch() …… Welcome to the LTIB Embedded Linux Environment !!!!! WARNING !!!!!!! The default password for the root account is: root please change this password using the 'passwd' command COMX-P2020 BSP User Guide (6806800L84C)
Starting the Kernel with Ramdisk using ext2 Partition By default the USB stick will contain ext2 partition on partition 4, as shown in the above table. To boot from the partition 4, execute the following command: COMX-P2020 BSP User Guide (6806800L84C)
Page 82
The default password for the root account is: root please change this password using the 'passwd' command and then edit this message (/etc/issue) to remove this message COMX-P2020 login: PHY: mdio@ffe24520:00 - Link is Up - 100/Full ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready COMX-P2020 BSP User Guide (6806800L84C)
The following method can deploy filesystem to an empty 2GB SD Card: 1. Start COMX-P2020 to Linux with NFS file system. 2. Insert a 2GB SD to COMX-P2020 and fdisk the SD as the above partition table: [root@COMX-P2020 root]# umount /dev/mmcblk0p1 COMX-P2020 BSP User Guide (6806800L84C)
Page 84
[root@COMX-P2020 /root]#mkdir /mnt/sd1 [root@COMX-P2020 /root]#mkdir /mnt/sd2 [root@COMX-P2020 /root]#mount /dev/mmcblk0p1 /mnt/sd1 [root@COMX-P2020 /root]#mount /dev/mmcblk0p2 /mnt/sd2 5. Copy the release image to partition1 of SD. [root@COMX-P2020 /root]#scp <user>@<tftp_serverip>:/local/tftpboot/COMX-P2020/current/u-boot- *.bin /mnt/sd1 [root@COMX-P2020 /root]#scp <user>@<tftp_serverip>:/local/tftpboot/COMX- P2020/current/comx.dtb /mnt/sd1 COMX-P2020 BSP User Guide (6806800L84C)
Page 85
2 user user 4096 Sep 28 16:42 boot drwxr-xr-x 2 user user 4096 Sep 28 16:41 boot_format drwxr-xr-x 2 user user 4096 Sep 28 16:41 dev drwxrwxr-x 11 user user 4096 Sep 28 16:40 etc COMX-P2020 BSP User Guide (6806800L84C)
Page 86
The first partition of SD must be FAT16, and its size must less than 2GB. Please run following command: [root@COMX-P2020 root]# umount /dev/mmcblk0p1 [root@COMX-P2020 root]# umount /dev/mmcblk0p2 [root@COMX-P2020 root]# cd /boot_format/ COMX-P2020 BSP User Guide (6806800L84C)
Manufacturer ID: 1b OEM: 534d Name: 00000 Tran Speed: 25000000 Rd Block Len: 512 SD version 2.0 High Capacity: No Capacity: 2002780160 Bus Width: 4-bit reading uImage 3416506 bytes read reading comx.dtb 9824 bytes read reading rootfs-dev.ext2.img COMX-P2020 BSP User Guide (6806800L84C)
Page 90
Linux version 2.6.32 (ec7987@cncdebaobs04.emrsn.org) (gcc version 4.3.2 (GCC) ) #1 SMP Thu Dec 9 14:51:54 CST 2010 Found initrd at 0xe96ac000:0xeffffb04 CPU maps initialized for 1 thread per core bootconsole [udbg0] enabled setup_arch: bootmem mpc85xx_rdb_setup_arch() ......COMX-P2020 BSP User Guide (6806800L84C)
Page 91
!!!!! WARNING !!!!!!! The default password for the root account is: root please change this password using the 'passwd' command and then edit this message (/etc/issue) to remove this message COMX-P2020 login: root Password: [root@COMX-P2020 root]# COMX-P2020 BSP User Guide (6806800L84C)
Page 92
Start Linux Start Linux COMX-P2020 BSP User Guide (6806800L84C)
WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-1. I will probe address range 0x03-0x77. Continue? [Y/n] y 6 7 8 9 a b c d e f COMX-P2020 BSP User Guide (6806800L84C)
[root@COMX-P2020 /]# i2cdump 0 0x50 b WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-0, address 0x50, mode byte Continue? [Y/n] y COMX-P2020 BSP User Guide (6806800L84C)
WARNING! This program can confuse your I2C bus, cause data loss and worse! I will read from device file /dev/i2c-1, chip address 0x48, data address 0x00, using read byte data. Continue? [Y/n] y 0x2d [root@P2020RDB lib]# The 0x2d means that current temperature is 45 degree Celsius. COMX-P2020 BSP User Guide (6806800L84C)
= 2048 Then we can check the output of VGA that the pixel will be changed to another color one by one. The process will take 50 seconds. Figure 7-1 Output for Framebuffer Test Program COMX-P2020 BSP User Guide (6806800L84C)
2. Run the Minigui sample and check the output of VGA to verify that all devices can work well at the board. [root@COMX-P2020 root]# cd /usr/private/mg-samples-1.6.10/src [root@COMX-P2020 src]# ./mywins Figure 7-2 Output for MiniGUI Example COMX-P2020 BSP User Guide (6806800L84C)
Need help?
Do you have a question about the COMX-P2020 BSP and is the answer not in the manual?
Questions and answers