Changes between Version 13 and Version 14 of v2x


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

add uart information

Legend:

Unmodified
Added
Removed
Modified
  • v2x

    v13 v14  
    3838 * [https://www.unex.com.tw/products/v2x/v2xsolution/v2xmodule]
    3939 * [https://www.unex.com.tw/guide/SOM-301x.pdf Manual]
     40
     41== UART Information for GW73xx
     42
     43The UART3 (/dev/ttymxc2) on J10 on a GW73xx board is shared with the onboard Bluetooth module.
     44
     45This is defined in the device tree here:
     46[https://github.com/Gateworks/linux-venice/blob/v5.15.15-venice/arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx.dtsi#L218]
     47
     48{{{
     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";
     56
     57     bluetooth {
     58            compatible = "brcm,bcm4330-bt";
     59            shutdown-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
     60     };
     61};
     62
     63}}}
     64
     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.
     66
     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).
     68
     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.
     70
     71- In Linux find the device path
     72{{{
     73# find /proc/device-tree/ -name "bluetooth"
     74/proc/device-tree/soc@0/bus@30800000/spba-bus@30800000/serial@30880000/bluetooth
     75}}}
     76
     77- In U-Boot create a fixfdt script as documented on our wiki [http://trac.gateworks.com/wiki/linux/devicetree#fixfdtscript]
     78{{{
     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'
     80}}}
     81
     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.