Changes between Version 13 and Version 14 of v2x

02/22/2023 11:39:52 PM (15 months ago)
Ryan Erbstoesser

add uart information


  • v2x

    v13 v14  
    3838 * []
    3939 * [ Manual]
     41== UART Information for GW73xx
     43The UART3 (/dev/ttymxc2) on J10 on a GW73xx board is shared with the onboard Bluetooth module.
     45This is defined in the device tree here:
     49/* bluetooth HCI */
     50&uart3 {
     51     pinctrl-names = "default";
     52     pinctrl-0 = <&pinctrl_uart3>, <&pinctrl_bten>;
     53     cts-gpios = <&gpio5 8 GPIO_ACTIVE_LOW>;
     54     rts-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
     55     status = "okay";
     57     bluetooth {
     58            compatible = "brcm,bcm4330-bt";
     59            shutdown-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
     60     };
     65To understand this better, think of how it works: UART devices don't have any sort of magic device 'auto-detection' like enumerated busses such as PCI and USB do (which have a bus infrastructure to provide things like a class, manufacturer, and device ID). Therefore device-tree must be used to explain to the OS what is there and map it to a driver. This is what the 'compatible = "brcm,bcm4330-bt"' string does; there is a driver that matches that compatible string.
     67It is possible to not see a /dev/ttymxc2 corresponding to schematic UART3 (NXP references hardware blocks as 1 based, Linux references them as 0 based) is indeed because the bluetooth HCI driver (hci_bcm) claims the UART such that Linux removes access from it to not conflict with it. The 'hci_bcm' driver won't fail to recognize the UART (ie if on a GW7300 which doesn't load that part) and remove it's claim on the device. Gateworks will not typically try to do things like removing that dynamically in the boot firmware via a dt fixup based on the model (because mapping model strings to what parts are loaded is a really bad idea).
     69To remedy this, one can either comment out the 'bluetooth' node in the device-tree if using a custom kernel/dt or use a 'fix_fdt' script.
     71- In Linux find the device path
     73# find /proc/device-tree/ -name "bluetooth"
     77- In U-Boot create a fixfdt script as documented on our wiki []
     79u-boot=> setenv fixfdt 'fdt addr $fdt_addr_r; fdt resize; fdt set /soc@0/bus@30800000/spba-bus@30800000/serial@30880000/bluetooth status disabled'
     82If the V2X support requires a kernel driver then it will need a device-tree binding of its own in which case one can use a dt overlay or customize the device tree.