0
votes

I am trying to use LCD7 cape with Serial cape but UART4 has conflicting pins. I don't use UART4 so I disabled it by removing configuration from dts file, saved the file under the name in /lib/firmware. Compilation was done on cmd line as:

dtc -O dtb -o cape-CBB-Serial-r02.dtbo -b 0 -@ cape-CBB-Serial-r02.dts

Loading cape with: echo cape-CBB-Serial:r02 > slots

Issues:

For some reason even after disabling cape it still shows in slots:

root@beaglebone:/lib/firmware# cat /sys/devices/bone_capemgr.9/slots 
 0: 54:PF---  1: 55:P---- cape-CBB-Serial,r01,Logic Supply,cape-CBB-Serial 
 2: 56:PF---  3: 57:PF---  
 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G 
 5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI

Contents of /boot/uEnv.txt:

 cat /boot/uEnv.txt
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=3.8.13-bone70
#dtb= cmdline=quiet init=/lib/systemd/systemd

##Example
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=

##Disable HDMI/eMMC
#cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G

##Disable HDMI cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN

##Disable eMMC
#cape_disable=capemgr.disable_partno=BB-BONE-EMMC-2G

##Audio Cape (needs HDMI Audio disabled)
#cape_disable=capemgr.disable_partno=BB-BONELT-HDMI
#cape_enable=capemgr.enable_partno=BB-BONE-AUDI-02


##enable BBB: eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh


cape_disable=capemgr.disable_partno=cape-CBB-Serial

My version of dts never gets loaded:

/* cape-CBB-Serial-r01.dts
 * Written by Alexander Hiam <[email protected]>
 * for Logic Supply - http://logicsupply.com
 * Jan 28, 2014
 *
 * This is the Device Tree overlay for the CBB-Serial BeagleBone and
 * BeagleBone Black cape. It will enable the UART2, UART4 and DCAN1
 * interfaces, as well as mux GPIO1_16 for userspace control for
 * using software control of the RS485 receiver/driver enable.
 *
 * Note: the BeagleBone Black has GPIO1_16 tied to GPIO2_0 (which
 * is not exposed on the header), so this overlay muxes and controls
 * both pins.
 *
 * Copyright (c) 2014 - Logic Supply (http://logicsupply.com)
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

/dts-v1/;
/plugin/;

/{
  compatible = "ti,beaglebone", "ti,beaglebone-black";

  part-number = "cape-CBB-Serial";
  version = "r02";

  /* state the resources this cape uses */
  exclusive-use =
    "P9.21", /* uart2_txd */
    "P9.22", /* uart2_rxd */

    "P9.24", /* dcan1_rx */
    "P9.26", /* dcan1_tx */

    /* the hardware IP uses */
    "gpio1_16",
    "gpio2_0",
    "uart2",
    "uart4",
    "dcan1";

  fragment@0 {
    target = <&am33xx_pinmux>;
    __overlay__ {

      cbb_serial_uart2_pins: pinmux_cbb_serial_uart2_pins {
        pinctrl-single,pins = <
          0x150 0x21 /* spi0_sclk - RX_ENABLED | MODE6 (UART2 RX) */
          0x154 0x01 /* spi0_d0 - MODE6 (UART2 TX) */
        >;
      };

     cbb_serial_dcan1_pins: pinmux_cbb_serial_dcan1_pins {
        pinctrl-single,pins = <
          0x180 0x12 /* uart1_rxd - PULLUP | MODE2 (DCAN TX) */
          0x184 0x32 /* uart1_txd - RX_ENABLED | PULLUP | MODE2 (DCAN1 RX) */
        >;
      };
    };
  };

  fragment@1 {
    target = <&uart3>;
    __overlay__ {
      status = "okay";
      pinctrl-names = "default";
      pinctrl-0 = <&cbb_serial_uart2_pins>;
    };
  };


  fragment@3 {
    target = <&dcan1>;
    __overlay__ {
      status = "okay";
      pinctrl-names = "default";
      pinctrl-0 = <&cbb_serial_dcan1_pins>;
    };
  };
};

Somehow serial cape gets automagically loaded from somewhere ? :(

1

1 Answers

1
votes

Notice the CBB-Serial entry doesn't have the L flag - that means it's not loaded. It still shows up in the slots file because capemgr sees the cape EEPROM. You should still be able to manually load your version. What's the output of $ dmesg | tail -n 100 after trying to load your version?

Also, while you removed the UART4 fragment, you still have uart4 listed in the exclusive-use array, which is where capemgr looks to detect conflicts. You'll want to remove that, and you should also adjust your fragment numbering so they increment consistently (not sure if that actually matters):

/dts-v1/;
/plugin/;

/{
  compatible = "ti,beaglebone", "ti,beaglebone-black";

  part-number = "cape-CBB-Serial";
  version = "r02";

  /* state the resources this cape uses */
  exclusive-use =
    "P9.21", /* uart2_txd */
    "P9.22", /* uart2_rxd */

    "P9.24", /* dcan1_rx */
    "P9.26", /* dcan1_tx */

    /* the hardware IP uses */
    "gpio1_16",
    "gpio2_0",
    "uart2",
    "dcan1";

  fragment@0 {
    target = <&am33xx_pinmux>;
    __overlay__ {

      cbb_serial_uart2_pins: pinmux_cbb_serial_uart2_pins {
        pinctrl-single,pins = <
          0x150 0x21 /* spi0_sclk - RX_ENABLED | MODE6 (UART2 RX) */
          0x154 0x01 /* spi0_d0 - MODE6 (UART2 TX) */
        >;
      };

     cbb_serial_dcan1_pins: pinmux_cbb_serial_dcan1_pins {
        pinctrl-single,pins = <
          0x180 0x12 /* uart1_rxd - PULLUP | MODE2 (DCAN TX) */
          0x184 0x32 /* uart1_txd - RX_ENABLED | PULLUP | MODE2 (DCAN1 RX) */
        >;
      };
    };
  };

  fragment@1 {
    target = <&uart3>;
    __overlay__ {
      status = "okay";
      pinctrl-names = "default";
      pinctrl-0 = <&cbb_serial_uart2_pins>;
    };
  };

  fragment@2 {
    target = <&dcan1>;
    __overlay__ {
      status = "okay";
      pinctrl-names = "default";
      pinctrl-0 = <&cbb_serial_dcan1_pins>;
    };
  };
};