load (usb0,0)/boot/vmlinuz.
initrd (usb0,0)/boot/initrd.gz
g console=ttyS0,115200
tar xvf loongarch64-linux-gnu-2021-06-19-vector.tar.gz -C /opt/
#
# Define target endian
#
makeoptions ENDIAN=EL # Little endian version.
option SMBIOS_SUPPORT
option ACPI_SUPPORT //取消注释
select acpi_support //取消注释
option LS_STR //取消注释
cd zloader.ls2k2000
make cfg all tgt=rom ARCH=loongarch CROSS_COMPILE=/opt/loongarch64-linux-gnu-2021-06-19-vector/bin/loongarch64-linux-gnu- DEBUG=-g
make dtb ARCH=loongarch CROSS_COMPILE=/opt/loongarch64-linux-gnu-2021-06-19-vector/bin/loongarch64-linux-gnu-
PMON> devls
Device name Type
syn0 IFNET
syn1 IFNET
syn2 IFNET
wd0 DISK
ngbe0 IFNET
ngbe1 IFNET
ngbe2 IFNET
ngbe3 IFNET
ngbe4 IFNET
ngbe5 IFNET
ngbe6 IFNET
ngbe7 IFNET
ngbe8 IFNET
ngbe9 IFNET
PMON>
ifconfig syn0 10.50.122.1
ping 10.50.122.10
fload tftp://10.10.10.10/gzrom-gpu.bin
loongnix系统更换为anntec内核后需要改为DTS传参,注销ACPI选项后重新编译PMON,并更新到板卡。
mount /dev/sda2 /mnt
vim /mnt/boot.cfg
cp vminuz /mnt/
umount /mnt
root@test-pc:~# lscpu
Architecture: loongarch64
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
BIOS Vendor ID: Loongson-2K2000-EVB-V1.0
Model name: Loongson-2K2000-EVB-V1.0
BIOS Model name: Loongson-2K2000-EVB-V1.0 CPU @ 1.2GHz
BIOS CPU family: 1
CPU family: Loongson-64bit
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 1
BogoMIPS: 2400.00
Flags: cpucfg lam ual fpu lsx crc32 lbt_x86 lbt_arm lbt_mips
Caches (sum of all):
L1d: 128 KiB (2 instances)
L1i: 128 KiB (2 instances)
L2: 2 MiB (1 instance)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0,1
#elif defined(LOONGSON_2K2000)
sprintf(board_name, "S-%s-V1.0", "2K2000");
root@test-pc:~# dmidecode -t2
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.6 present.
Handle 0x0002, DMI type 2, 17 bytes
Base Board Information
Manufacturer: Anntec.cn S-2K2000-V1.0
Product Name: 1.0
Version: <BAD INDEX>
Serial Number: Not Specified
Asset Tag: Not Specified
Features:
Board is a hosting board
Board is replaceable
Location In Chassis: Not Specified
Chassis Handle: 0x0000
Type: Motherboard
Contained Object Handles: 0
./l2fwd -l 1 --proc-type auto --socket-mem 1024 --file-prefix lwd0 -- -q 2 -p 0x3 -T 5 --no-mac-updating -P ./l2fwd -l 1 --proc-type auto --socket-mem 1024 --file-prefix lwd0 -- -q 4 -p 0xf -T 5 --no-mac-updating -P ./l2fwd -l 1 -- -q2 -p3 -T0 --no-mac-updating -r 128 -t 256 -P
i2cset -f -y 0 0x2f 0x21 0x00
i2cset -f -y 0 0x2f 0x19 0xaa
运行build.sh
选中U盘路径执行
root@ubuntu:~/U-start# ./build.sh
保证U盘没有重要文件,U盘会全部格式化
您的磁盘为
sda 60G
sdb 29.6G
请输入您想分区的盘,格式为/dev/磁盘名称 (如 /dev/sda) :
/dev/sdb
/dev/sdb磁盘大小为29G,小于300G,可以正常使用
您想分区的磁盘名称为/dev/sdb, 确认请输入y,否则退出
请谨慎输入 (y,N) y
确认
umount: /dev/sdb1: no mount point specified.
umount: /dev/sdb2: no mount point specified.
umount: /dev/sdb3: no mount point specified.
umount: /dev/sdb4: not mounted.
umount: /dev/sdb5: no mount point specified.
Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): Partition number (1,2, default 2):
Partition 2 has been deleted.
Command (m for help): Selected partition 1
Partition 1 has been deleted.
Command (m for help): Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-62115839, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-62115839, default 62115839):
Created a new partition 1 of type 'Linux' and of size 1000 MiB.
Command (m for help): Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (2050048-62115839, default 2050048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2050048-62115839, default 62115839):
Created a new partition 2 of type 'Linux' and of size 20 MiB.
Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
/dev/sdb分区完成
############################################
/dev/sdb1正在进行格式化
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 256000 4k blocks and 64000 inodes
Filesystem UUID: 01668611-43eb-4819-af87-1c2728429910
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
/dev/sdb1格式化完成
/dev/sdb2正在进行格式化
mkfs.fat 4.1 (2017-01-24)
/dev/sdb2格式化完成
正在拷贝文件,请勿移动U盘
拷贝完成
Welcome to Buildroot
buildroot login: root
No mail.
# ls
2k0500 2k1500 3a5000 dpdk-l2fwd hugepage.sh
2k1000 2k2000 dpdk-bind.sh dpdk-testpmd setmrs.sh
说明:
//CPU型号目录下存放对应的igb_uio文件
//uio已经编译到内核
//hugepage.sh 设置大页内存
//setmrs.sh 无需设置
//dpdk-bin.sh 用于绑定接口
//dpdk-l2fwd,dpdk-testpmd 为测试程序
#
# insmod 2k2000/igb_uio.ko
[ 33.543679] igb_uio: loading out-of-tree module taints kernel.
[ 33.561711] igb_uio: Use MSIX interrupt by default
# ./hugepage.sh
# ./dpdk-bind.sh -b igb_uio 04:00.0
[ 51.039073] igb_uio 0000:04:00.0: mapping 1K dma=0x1a5c000 host=00000000f48b8029
[ 51.046452] igb_uio 0000:04:00.0: unmapping 1K dma=0x1a5c000 host=00000000f48b8029
[ 51.054242] pcieport 0000:00:0c.0: can't derive routing for PCI INT B
[ 51.060668] igb_uio 0000:04:00.1: PCI INT B: no GSI
[ 51.065656] igb_uio 0000:04:00.1: mapping 1K dma=0x1a5c000 host=00000000f48b8029
[ 51.073031] igb_uio 0000:04:00.1: unmapping 1K dma=0x1a5c000 host=00000000f48b8029
# ./dpdk-bind.sh -b igb_uio 04:00.1
[ 53.200501] pcieport 0000:00:0c.0: can't derive routing for PCI INT B
[ 53.206934] igb_uio 0000:04:00.1: PCI INT B: no GSI
[ 53.212105] igb_uio 0000:04:00.1: mapping 1K dma=0x1a5c000 host=00000000f48b8029
[ 53.219470] igb_uio 0000:04:00.1: unmapping 1K dma=0x1a5c000 host=00000000f48b8029
# ./dpdk-bind.sh -s
0000:00:08.0 drivers ahci
0000:04:00.0 drivers igb_uio
0000:04:00.1 drivers igb_uio
0000:00:16.0 drivers ls-spi-pci
0000:00:09.0 drivers pcieport
0000:00:0a.0 drivers pcieport
0000:00:0b.0 drivers pcieport
0000:00:0c.0 drivers pcieport
0000:00:0d.0 drivers pcieport
0000:00:0f.0 drivers pcieport
0000:00:03.0 drivers stmmaceth
0000:00:03.1 drivers stmmaceth
0000:00:03.2 drivers stmmaceth
0000:00:04.0 drivers xhci_hcd
0000:00:19.0 drivers xhci_hcd
# ./dpdk-testpmd -l 0,1 -- -i
EAL: Detected CPU lcores: 2
EAL: Detected NUMA nodes: 1
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
[ 123.025759] igb_uio 0000:04:00.0: uio device registered with irq 45
EAL: Probe PCI driver: net_ngbe (8088:101) device: 0000:04:00.0 (socket 0)
[ 123.172799] igb_uio 0000:04:00.1: uio device registered with irq 46
EAL: Probe PCI driver: net_ngbe (8088:101) device: 0000:04:00.1 (socket 0)
TELEMETRY: No legacy callbacks, legacy socket not created
Interactive-mode selected
testpmd: create a new mbuf pool <mb_pool_0>: n=155456, size=2176, socket=0
testpmd: preferred mempool ops selected: ring_mp_mc
Configuring Port 0 (socket 0)
Port 0: 8C:1C:DA:46:BF:00
Configuring Port 1 (socket 0)
Port 1: 8C:1C:DA:46:BF:01
Checking link statuses...
Done
testpmd> start