Open BMC开发系列(十一)配置BMC的网络

        配置网络步骤如下:

1,查找对应的ast2500的官方文档,看下网卡配置,查看具体的物理位置网口。添加对应的对外的网口设备树。

&mac1 {
    status = "okay";

    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_rgmii2_default &pinctrl_mdio2_default>;
};

2,重新编译镜像,烧录到板子上。

3,登录BMC后,查看网卡驱动是否有正常加载,命令行输入:dmesg

root@s2600wf:~# dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.8.17 (oe-user@oe-host) (arm-openbmc-linux-gnueabi-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.0.20200730) #1 Fri Nov 12 02:57:18 UTC 2021
[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] OF: fdt: Machine model: S2600WF BMC
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 16 MiB at 0x9a800000
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000080000000-0x000000009bffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x000000009bffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000009bffffff]
[    0.000000] On node 0 totalpages: 114688
[    0.000000]   Normal zone: 896 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 114688 pages, LIFO batch:31
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 113792
[    0.000000] Kernel command line: console=ttyS4,115200n8 root=/dev/ram rw
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 393456K/458752K available (7168K kernel code, 459K rwdata, 1556K rodata, 1024K init, 147K bss, 48912K reserved, 16384K cma-reserved)
[    0.000000] random: get_random_u32 called from cache_alloc_refill+0x41c/0x958 with crng_init=0
[    0.000000] ftrace: allocating 22147 entries in 44 pages
[    0.000000] ftrace: allocated 44 pages with 3 groups
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] i2c controller registered, irq 17
[    0.000000] clocksource: FTTMR010-TIMER2: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 77222644334 ns
[    0.000019] sched_clock: 32 bits at 24MHz, resolution 40ns, wraps every 86767015915ns
[    0.000088] Switching to timer-based delay loop, resolution 40ns
[    0.001277] Calibrating delay loop (skipped), value calculated using timer frequency.. 49.50 BogoMIPS (lpj=247500)
[    0.001328] pid_max: default: 32768 minimum: 301
[    0.002092] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.002133] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.003882] CPU: Testing write buffer coherency: ok
[    0.005498] Setting up static identity map for 0x80100000 - 0x80100038
[    0.009006] devtmpfs: initialized
[    0.024018] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.024079] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.027444] pinctrl core: initialized pinctrl subsystem
[    0.028472] NET: Registered protocol family 16
[    0.030845] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.033035] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[    0.033065] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.088624] mc: Linux media interface: v0.10
[    0.088767] videodev: Linux video capture interface: v2.00
[    0.092293] clocksource: Switched to clocksource FTTMR010-TIMER2
[    0.154293] NET: Registered protocol family 2
[    0.155503] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.155590] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.155680] TCP bind hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.155748] TCP: Hash tables configured (established 4096 bind 4096)
[    0.155980] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.156050] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.156516] NET: Registered protocol family 1
[    0.157438] Unpacking initramfs...
[    1.098140] Freeing initrd memory: 1096K
[    1.100605] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[    1.101118] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.101153] jffs2: version 2.2. (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    1.101816] NET: Registered protocol family 38
[    1.103606] IPMI message handler: version 39.2
[    1.103784] ipmi device interface
[    1.103897] ipmi_si: IPMI System Interface driver
[    1.104328] ipmi_si: Unable to find any System Interface(s)
[    1.104359] ipmi_ssif: IPMI SSIF Interface driver
[    1.104604] IPMI Watchdog: driver initialized
[    1.104630] IPMI poweroff: Copyright (C) 2004 MontaVista Software - IPMI Powerdown via sys_reboot
[    1.112380] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled
[    1.116933] 1e783000.serial: ttyS0 at MMIO 0x1e783000 (irq = 31, base_baud = 1500000) is a 16550A
[    1.118442] 1e784000.serial: ttyS4 at MMIO 0x1e784000 (irq = 32, base_baud = 1500000) is a 16550A
[    1.548251] printk: console [ttyS4] enabled
[    1.554176] 1e78d000.serial: ttyS1 at MMIO 0x1e78d000 (irq = 35, base_baud = 1500000) is a 16550A
[    1.564688] 1e78e000.serial: ttyS2 at MMIO 0x1e78e000 (irq = 36, base_baud = 1500000) is a 16550A
[    1.575164] 1e78f000.serial: ttyS3 at MMIO 0x1e78f000 (irq = 37, base_baud = 1500000) is a 16550A
[    1.585991] timeriomem_rng 1e6e2078.hwrng: 32bits from 0x(ptrval) @ 1us
[    1.593737] aspeed_gfx 1e6e6000.display: failed to initialize reserved mem: -19
[    1.601639] random: fast init done
[    1.611846] random: crng init done
[    1.628591] loop: module loaded
[    1.667811] aspeed-smc 1e620000.spi: Using 50 MHz SPI frequency
[    1.674025] aspeed-smc 1e620000.spi: mx25l51245g (65536 Kbytes)
[    1.679984] aspeed-smc 1e620000.spi: CE0 window [ 0x20000000 - 0x24000000 ] 64MB
[    1.687493] aspeed-smc 1e620000.spi: CE1 window [ 0x24000000 - 0x2a000000 ] 96MB
[    1.694976] aspeed-smc 1e620000.spi: read control register: 203c0641
[    1.838597] 5 fixed-partitions partitions found on MTD device bmc
[    1.844809] Creating 5 MTD partitions on "bmc":
[    1.849365] 0x000000000000-0x000000060000 : "u-boot"
[    1.856767] 0x000000060000-0x000000080000 : "u-boot-env"
[    1.864653] 0x000000080000-0x0000004c0000 : "kernel"
[    1.872134] 0x0000004c0000-0x000001c00000 : "rofs"
[    1.879447] 0x000001c00000-0x000002000000 : "rwfs"
[    1.888448] aspeed-smc 1e630000.spi: Using 50 MHz SPI frequency
[    1.894600] aspeed-smc 1e630000.spi: unrecognized JEDEC id bytes: ff ff ff ff ff ff
[    1.902374] aspeed-smc 1e630000.spi: Aspeed SMC probe failed -2
[    1.913599] aspeed-smc: probe of 1e630000.spi failed with error -2
[    1.922620] libphy: Fixed MDIO Bus: probed
[    1.928124] ftgmac100 1e660000.ethernet: Generated random MAC address 1e:21:e6:d5:3a:c3
[    1.936272] ftgmac100 1e660000.ethernet: Using NCSI interface
[    1.943441] ftgmac100 1e660000.ethernet eth0: irq 20, mapped at a10f16f9
[    1.950818] ftgmac100 1e680000.ethernet: Generated random MAC address ca:de:cb:65:60:29
[    1.967238] libphy: ftgmac100_mdio: probed
[    1.973093] RTL8211F Gigabit Ethernet 1e680000.ethernet--1:00: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:phy_addr=1e680000.ethernet--1:00, irq=POLL)
[    1.988868] ftgmac100 1e680000.ethernet eth1: irq 21, mapped at 244d461a
[    1.996641] udc-core: couldn't find an available UDC - added [g_mass_storage] to list of pending drivers
[    2.006787] i2c /dev entries driver
[    2.011580] aspeed-i2c-bus 1e78a040.i2c-bus: i2c bus 0 registered, irq 38
[    2.019607] aspeed-i2c-bus 1e78a080.i2c-bus: i2c bus 1 registered, irq 39
[    2.027809] aspeed-i2c-bus 1e78a0c0.i2c-bus: i2c bus 2 registered, irq 40
[    2.035992] aspeed-i2c-bus 1e78a100.i2c-bus: i2c bus 3 registered, irq 41
[    2.044177] aspeed-i2c-bus 1e78a140.i2c-bus: i2c bus 4 registered, irq 42
[    2.052384] aspeed-i2c-bus 1e78a180.i2c-bus: i2c bus 5 registered, irq 43
[    2.060487] aspeed-i2c-bus 1e78a1c0.i2c-bus: i2c bus 6 registered, irq 44
[    2.068698] aspeed-i2c-bus 1e78a300.i2c-bus: i2c bus 7 registered, irq 45
[    2.076859] aspeed-i2c-bus 1e78a380.i2c-bus: i2c bus 9 registered, irq 46
[    2.085156] aspeed-i2c-bus 1e78a480.i2c-bus: i2c bus 13 registered, irq 47
[    2.093049] Driver for 1-wire Dallas network protocol.
[    2.105680] peci peci-0: cdev of adapter [1e78b000.peci-bus] registered as minor 0
[    2.114064] peci_aspeed 1e78b000.peci-bus: peci bus 0 registered, irq 34
[    2.123415] NET: Registered protocol family 10
[    2.130553] Segment Routing with IPv6
[    2.135023] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.142551] NET: Registered protocol family 17
[    2.147066] 8021q: 802.1Q VLAN Support v1.8
[    2.161648] printk: console [netcon0] enabled
[    2.166128] netconsole: network logging started
[    2.177454] Freeing unused kernel memory: 1024K
[    2.185353] Checked W+X mappings: passed, no W+X pages found
[    2.191062] Run /init as init process
[    2.194821]   with arguments:
[    2.194833]     /init
[    2.194839]   with environment:
[    2.194845]     HOME=/
[    2.194849]     TERM=linux
[    2.974088] jffs2: notice: (77) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[    3.593099] overlayfs: upper fs does not support tmpfile.
[    3.599236] overlayfs: upper fs does not support RENAME_WHITEOUT.
[   13.232782] systemd[1]: Failed to look up module alias 'autofs4': Function not implemented
[   13.678039] systemd[1]: systemd 246.6+ running in system mode. (+PAM -AUDIT -SELINUX -IMA -APPARMOR -SMACK +SYSVINIT -UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS -ACL +XZ -LZ4 -ZSTD -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid)
[   13.702256] systemd[1]: Detected architecture arm.
[   14.033584] systemd[1]: Set hostname to <s2600wf>.
[   14.340676] systemd[1]: Initializing machine ID from random generator.
[   18.704515] systemd[1]: unit_file_find_fragment: obmc-host-reset@.target+0 → obmc-host-reset@0.target
[   18.827731] systemd[1]: unit_file_find_fragment: obmc-host-reset-running@.target+0 → obmc-host-reset-running@0.target
[   18.919352] systemd[1]: unit_file_find_fragment: obmc-host-stop@.target+0 → obmc-host-stop@0.target
[   18.952068] systemd[1]: unit_file_find_fragment: obmc-host-startmin@.target+0 → obmc-host-startmin@0.target
[   19.046548] systemd[1]: unit_file_find_fragment: obmc-power-on@.target+0 → obmc-power-on@0.target
[   19.075552] systemd[1]: unit_file_find_fragment: obmc-power-start@.target+0 → obmc-power-start@0.target
[   19.207104] systemd[1]: unit_file_find_fragment: obmc-power-start-pre@.target+0 → obmc-power-start-pre@0.target
[   19.337705] systemd[1]: unit_file_find_fragment: obmc-host-started@.target+0 → obmc-host-started@0.target
[   19.367134] systemd[1]: unit_file_find_fragment: obmc-host-starting@.target+0 → obmc-host-starting@0.target
[   19.406812] systemd[1]: unit_file_find_fragment: obmc-host-start-pre@.target+0 → obmc-host-start-pre@0.target
[   19.530024] systemd[1]: unit_file_find_fragment: obmc-host-quiesce@.target+0 → obmc-host-quiesce@0.target
[   19.562012] systemd[1]: unit_file_find_fragment: obmc-chassis-poweroff@.target+0 → obmc-chassis-poweroff@0.target
[   19.660972] systemd[1]: unit_file_find_fragment: obmc-chassis-powerreset@.target+0 → obmc-chassis-powerreset@0.target
[   19.691492] systemd[1]: unit_file_find_fragment: obmc-chassis-poweron@.target+0 → obmc-chassis-poweron@0.target
[   19.786113] systemd[1]: unit_file_find_fragment: obmc-chassis-powered-off@.target+0 → obmc-chassis-powered-off@0.target
[   20.013208] systemd[1]: Failed to put bus name to hashmap: File exists
[   20.019887] systemd[1]: xyz.openbmc_project.State.Host.service: Two services allocated for the same bus name xyz.openbmc_project.State.Host, refusing operation.
[   21.647439] systemd[1]: /lib/systemd/system/phosphor-ipmi-net@.socket:3: Invalid interface name, ignoring: sys-subsystem-net-devices-%i.device
[   21.764329] systemd[1]: xyz.openbmc_project.State.Host.service: Cannot add dependency job, ignoring: Unit xyz.openbmc_project.State.Host.service failed to load properly: File exists.
[   21.824387] systemd[1]: Queued start job for default target Multi-User System.
[   21.844218] systemd[1]: Created slice system-getty.slice.
[   21.885765] systemd[1]: Created slice system-mapper\x2dwait.slice.
[   21.935737] systemd[1]: Created slice system-obmc\x2dled\x2dgroup\x2dstart.slice.
[   21.985813] systemd[1]: Created slice system-org.openbmc.control.Bmc.slice.
[   22.035812] systemd[1]: Created slice system-org.openbmc.control.Host.slice.
[   22.085789] systemd[1]: Created slice system-phosphor\x2dcertificate\x2dmanager.slice.
[   22.135837] systemd[1]: Created slice system-phosphor\x2ddiscover\x2dsystem\x2dstate.slice.
[   22.185541] systemd[1]: Created slice system-phosphor\x2dipmi\x2dkcs.slice.
[   22.235635] systemd[1]: Created slice system-phosphor\x2dipmi\x2dnet.slice.
[   22.285890] systemd[1]: Created slice system-phosphor\x2dreset\x2dhost\x2dcheck.slice.
[   22.335909] systemd[1]: Created slice system-phosphor\x2dreset\x2dhost\x2drunning.slice.
[   22.385915] systemd[1]: Created slice system-phosphor\x2dreset\x2dsensor\x2dstates.slice.
[   22.435659] systemd[1]: Created slice system-serial\x2dgetty.slice.
[   22.484452] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[   22.534394] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[   22.586756] systemd[1]: Reached target Paths.
[   22.623680] systemd[1]: Reached target Remote File Systems.
[   22.663288] systemd[1]: Reached target Slices.
[   22.703988] systemd[1]: Reached target Swap.
[   22.790652] systemd[1]: Listening on Syslog Socket.
[   23.094796] systemd[1]: Listening on Process Core Dump Socket.
[   23.110241] systemd[1]: Listening on initctl Compatibility Named Pipe.
[   23.155018] systemd[1]: Condition check resulted in Journal Audit Socket being skipped.
[   23.175668] systemd[1]: Listening on Journal Socket (/dev/log).
[   23.216515] systemd[1]: Listening on Journal Socket.
[   23.256653] systemd[1]: Listening on Network Service Netlink Socket.
[   23.306443] systemd[1]: Listening on udev Control Socket.
[   23.325625] systemd[1]: Listening on udev Kernel Socket.
[   23.366155] systemd[1]: Condition check resulted in Huge Pages File System being skipped.
[   23.384894] systemd[1]: Condition check resulted in POSIX Message Queue File System being skipped.
[   23.406050] systemd[1]: Mounting Kernel Debug File System...
[   23.444000] systemd[1]: Mounting Kernel Trace File System...
[   23.515503] systemd[1]: Mounting Temporary Directory (/tmp)...
[   23.536805] systemd[1]: Condition check resulted in Create list of static device nodes for the current kernel being skipped.
[   23.603974] systemd[1]: Condition check resulted in File System Check on Root Device being skipped.
[   23.642701] systemd[1]: Starting Journal Service...
[   23.963979] systemd[1]: Condition check resulted in Load Kernel Modules being skipped.
[   23.975771] systemd[1]: Condition check resulted in FUSE Control File System being skipped.
[   24.023957] systemd[1]: Mounting Kernel Configuration File System...
[   24.068199] systemd[1]: Starting Remount Root and Kernel File Systems...
[   24.141939] systemd[1]: Starting Apply Kernel Variables...
[   24.223316] systemd[1]: Starting Coldplug All udev Devices...
[   24.317254] systemd[1]: Mounted Kernel Debug File System.
[   24.354922] systemd[1]: Mounted Kernel Trace File System.
[   24.395152] systemd[1]: Mounted Temporary Directory (/tmp).
[   24.536916] systemd[1]: Mounted Kernel Configuration File System.
[   24.885291] systemd[1]: Finished Remount Root and Kernel File Systems.
[   25.204859] systemd[1]: Starting Rebuild Hardware Database...
[   25.223624] systemd[1]: Condition check resulted in Platform Persistent Storage Archival being skipped.
[   25.364587] systemd[1]: Starting Create System Users...
[   25.386856] systemd[1]: Started Journal Service.
[   34.331493] 8021q: adding VLAN 0 to HW filter on device eth0
[   38.509004] ftgmac100 1e680000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[   38.552469] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   41.617549] udc-core: couldn't find an available UDC or it's busy
[   51.362527] ftgmac100 1e660000.ethernet eth0: NCSI: No channel found to configure!
[   52.402471] ftgmac100 1e660000.ethernet eth0: Wrong NCSI state 0x100 in workqueue
root@s2600wf:~# 
 

从结果可以看到:

[    1.973093] RTL8211F Gigabit Ethernet 1e680000.ethernet--1:00: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:phy_addr=1e680000.ethernet--1:00, irq=POLL)

网卡有正常加载驱动。

如果在这里没有看到网卡加载驱动,则需要

a,拿到板子的bmc的mac接口的网络芯片,即phy芯片型号。

b,进入网卡驱动文件ftgmac100.c加调试代码进行调试。

        

4,测试网络

a,网线连接好。

b,配置两端的连接网卡IP为同网段IP。

c,相互ping一下,能通则表示网络OK。

最后:

        点赞是美德,

        关注是缘分,

        收藏是肯定,

        打赏你随意,

你的鼓励是我世界善的一部分,爱你们!

  • 15
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 12
    评论
评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大余里

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值