- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13
Board refactor, sensors and NanoPi R2S, RPi 3B + CM4 support #1214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1a5f8f4    to
    eb00386      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome stuff! 🔥
        
          
                board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...riendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/factory-config.cfg
              
                Outdated
          
            Show resolved
            Hide resolved
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume the regular udevadm triggers are not sufficient. Why is that? Can we move them to accommodate the R2S without the need for a board specific patch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These triggers sometimes clash which is why we've made them board specific.  Unfortunately udev starts before the init.d/ scripts run and install these udev rules.  We've spent a good while thinking about how to fix this, but not yet come up with any good ideas.
| One more thing: have a look at the matching stuff I added to  | 
eb00386    to
    1624252      
    Compare
  
    | 
 Thanks for that, @wkz, didn't even know we had that type of matching! I've addressed almost all of your comments, only one was squashed into an existing commit (the big board refactor), the others are follow-up commits starting with  Also, for the  | 
        
          
                ...riendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/factory-config.cfg
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | @mattiaswal I've addressed your comments and I hope I've answered your questions. I can push another update with the whitespace fix, but that feels a bit excessive to waste CPU cycles on, unless you want me to also drop the "confd: minor, coding style fixes in ietf-hardware.c" commit as well? It clashed with your PR, right? | 
| 
 Thanks :D | 
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Use kernel cmdline option 'usbcore.authorized_default=2' to lock all
external/user-visible USB ports by default.
The kernel distinguishes internal vs external USB ports using ACPI
methods (_UPC and _PLD) on x86/x86_64 systems.  On ACPI systems, ports
marked as non-visible but connectable are considered internal (e.g.,
hard-wired USB-to-Ethernet adapters) and are automatically authorized,
while user-visible external ports require manual authorization.
However, on device tree systems the kernel lacks a standard mechanism
for identifying internal ports. The 'authorized_default=2' setting falls
back to requiring authorization for all devices on these platforms,
We list user-accessible USB ports in the device tree ('usb-ports' and
'usb-port-names'), with unlisted ports being implicitly internal and
managed separately.
Fixes #1065
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
    The BCM2837 core is used not just in the RPi 3B but also in the Zero 2W, both device trees have been added to the board config. The BCM2711 support has been extended to include RPi 400 and CM4 I/O. To support the BCM2837 family more firmware options habe been enabled, since the RPi3 does not have bootcode.bin flashed in the SoC. The SD card image now uses a hybrid GPT/MBR format so the RPi3 bootcode.bin can read all files from the first VFAT partition. The default device tree for Linux is now chosen by the U-Boot probe and the only exception is the "laundry room" detector that looks for a RPi4 with a 7" touch screen, which then selects the DSI enabled RPi4 variant. This is enough to properly load an RPi 3B and a CM4 based router board. The BCM2837 does not have PCI/PCIe or a built-in MAC so it relies on the USB to Ethernet LAN78xx which does not support disabling pause frames. I have opted for checking for EOPNOTSUPP instead of adding yet another quirk, because it is likely to be a common limitation of more drivers and chipsets, and this code is best-effort anyway. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit adds support for the Raspberry Pi CM4 based mini DFRobot IoT Router board, SKU:DFR0767. It comes with an additional RTL8111 PCIe NIC hence the addidtional kernel module and firmware. The latter fixes: r8169 0000:01:00.0: Direct firmware load for rtl_nic/rtl8168h-2.fw failed with error -2 r8169 0000:01:00.0: Unable to load firmware rtl_nic/rtl8168h-2.fw (-2) Please note, the change in BCMGENET from module to built-in is to ensure it is probed before any PCIe NIC, both this board and the CM4-based NVME NAS base board enumerate the built-in MAC as eth0. Also, unlike the RPi 3B/4B, it is not a given fact that a CM4 based board comes with WiFi onboard, and since most compute module setups are DYI, we take the easy way out and leave it as an exercise to the user to add WiFi interface to the config. https://wiki.dfrobot.com/Compute_Module_4_IoT_Router_Board_Mini_SKU_DFR0767 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit refactors USB port probing to: - Eliminate duplicates: previously, 'authorized' and 'authorized_default' were listed as separate USB port entries (confusing). Now each USB port is represented once, with the path pointing to the USB device directory, confd appends the appropriate attribute file as needed - Add support for Raspberry Pi 4B and CM4 USB port(s) using a generic discovery function that scans /sys/bus/usb/devices for USB root hubs. This should work seamlessly across all platforms - For backwards compatibility and better UX: - Single USB port systems: Named "USB" (no number) - Multi-port systems: Named "USB1", "USB2", etc. - Device tree-based discovery is tried first (for boards like Alder with explicit DT USB port definitions), with fallback to generic discovery for boards without DT Fixes: #315 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 💯
On some boards, and in particular with a hybrid mbr/gpt partition table, like on the RPi64, we must resize ext *after* reboot. Also, do some cleanup and consolidation of error handling to prevent us from entering an endless boot loop. Follow-up to 391e971 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The DWC2 controller is a very common IP block in ARM and RiscV SoCs. With the USB subsystem back to a built-in we can now enable host mode for the DWC2 (USB 2.0) ports on RPi. It also opens up for merging the NanoPi R2S into the generic aarch64 build. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Usually, when upgrading a system, you want to reboot it so the upgrade takes effect. This commit adds a 'reboot' option/flag, alongside the 'force' option, to facilitate this. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Remove class deviation to allow iana-hardware:sensor - Populate sensor operational data from /sys/class/thermal - Extend 'show hardware' Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit adds resource usage: memory, loadavg, and filesystem usage by augmenting ietf-system:/system-state. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
For more advanced hardware with multiple sensor types per device
(e.g., SFP modules with temperature, voltage, current, and power
sensors), use the YANG parent/child relationship to group related
sensors together for better presentation.
Changes:
 - Remove parent/parent-rel-pos deviations from infix-hardware.yang
 - Create parent components (class: module) for multi-sensor devices
 - Add parent references to child sensor components
 - Add human-readable descriptions from hwmon labels
 - Extend hwmon discovery to support voltage, current, and power
 - Normalize sensor names: strip vendor prefixes (mt7915_phy0 -> phy0)
 - Remove redundant TYPE column, clarify units (V -> VDC, add spaces)
 - Simplify child sensor display by stripping parent prefix
 - Fix "show system" to only show CPU temperature and fan speed
Example output from "show hardware":
  NAME                     VALUE               STATUS
  ===================================================
  sfp1:
    Rx Power               0.000 W             ok
    Tx Power               0.001 W             ok
    Vcc                    3.35 VDC            ok
    Bias                   0.006 A             ok
    Temperature            30.3 °C             ok
  sfp2:
    Rx Power               0.000 W             ok
    Tx Power               0.001 W             ok
    Vcc                    3.34 VDC            ok
    Bias                   0.006 A             ok
    Temperature            32.0 °C             ok
  cpu                      42.8 °C             ok
  phy0                     47.0 °C             ok
  phy1                     53.0 °C             ok
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
    Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
With the additional support for RPi3, including Zero 2W, this commit renames all relevant directories and Config.In options to match. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit consolidates all BSP support files into the Buildroot standard board/ directory. The concept of selectable boards in menuconfig remains as-is but now lives in board/ instead. Drop support for board-specific post-build.sh scripts, not needed atm. and we should really use Buildroot _POST_INSTALL_HOOKS in the board .mk files instead. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit drops the board specific defconfig in favor of proper BSP
support for the FriendlyARM NanoPi R2S to Infix as part of the default
Aarch64 build.
The name FriendlyARM was elected over FriendlyELEC ("new" name) to be
consistent with both kernel and Buildroot naming standards.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
    - Enable bridging of LAN ports in br0, default IP: 192.168.0.1/24 - Enable firewall with two zones: 'wan' and 'lan', policy: lan-to-wan - Enable DHCP server on br0 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1624252    to
    4b1f53d      
    Compare
  
    The xPi's usually don't have a VPD so the chassis mac-address probed at boot is usually null in /run/system.json. This commit adds a fallbkack mechanism to populate this field so it can be used for unique hostnames even on these boards. Ths ietf-hardware.yang model does not have a notion of physical address, so we augment one tht is generic enought to be used for other hardware components than Ethernet, similar to what ietf-interfaces.yang use. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Add new interface quirk to allow skipping disabling of flow control on all RPi 3B/4B devices that have the smsc95xx driver. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit consolidates mkimage.sh scripts into a unified SD card image creation tool that works for all boards. It needs a bootloader an $ARCH rootfs.squashfs image and a genimage.cfg.in template. - Detects build directories from `O=` environment variable or `output/` - Sources `.config` to discover Buildroot paths - Uses Buildroot's `support/scripts/genimage.sh` when available - Automatically generates `.bmap` files if `bmaptool` is available - Fallback to direct `genimage` invocation if wrapper not found See the online instructions for usage. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
4b1f53d    to
    149e9c6      
    Compare
  
    
Description
New Hardware Support:
Board Infrastructure:
src/board/*andpackage/board/*to unifiedboard/directoryraspberry-pi-4→raspberrypi-rpi64utils/mkimage.sh/varpartition auto-expansion to all MMC devicesmt7986_sd_boot_defconfig→bpi_r3_boot_defconfigUSB & Drivers:
Hardware Monitoring & Sensors
YANG Models:
infix-hardware@2025-10-18: Addedwifiidentity, enabled parent/child hierarchyinfix-system@2025-10-18: Added resource usage and service monitoringSensor Support:
CLI:
show system: hostname, uptime, load, CPU temp, fan, memory, diskshow hardware: hierarchical sensors, improved formatting, color-coded tempsConfiguration
Checklist
Tick relevant boxes, this PR is-a or has-a: