Hello
I'm trying to get the
eth click board from MikroElektronika to work on a BBB but I fail. I can see that others successfully have used it on a PocketBeagle but I'm running on a BBB industrial.
To fit the board I use the
mikroBUS cape and I use slot 1 on the cape.
The Debian image from 2018-03-05 is used.
The file /boot/uEnv.txt has been modified with:
enable_uboot_overlays=1
###
###Overide capes with eeprom
uboot_overlay_addr0=/lib/firmware/BB-mBUS_1_eth_click-00A0.dtbo
#uboot_overlay_addr1=/lib/firmware/<file1>.dtbo
#uboot_overlay_addr2=/lib/firmware/<file2>.dtbo
#uboot_overlay_addr3=/lib/firmware/<file3>.dtbo
###Cape Universal Enable
#enable_uboot_cape_universal=1
I have modified the file
PB-SPI0-ETH-CLICK.dts to adapt to correct signals (if it's correct I don't know for sure)
this is later compiled with make BB-mBUS_1_eth_click.dtbo
/*
* Copyright (C) 2017 Robert Nelson <robertcnelson>
*
* Modified by Johan Lind for mikroBUS cape slot 1 (eth click)
*
* 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/;
#include <dt-bindings/board/am335x-bbw-bbb-base.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>
#include <dt-bindings/interrupt-controller/irq.h>
/ {
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
enc28j60_pins: pinmux_enc28j60_pins {
pinctrl-single,pins = <
AM33XX_IOPAD(0x0840, PIN_INPUT | MUX_MODE7 ) /* gpio1[16] INT P9.15 */
AM33XX_IOPAD(0x0878, PIN_INPUT | MUX_MODE7 ) /* gpio1[28] RESET P9.12 */
>;
};
pb_spi1_pins: pinmux_pb_spi1_pins {
pinctrl-single,pins = <
AM33XX_IOPAD(0x0990, PIN_INPUT | MUX_MODE3 ) /* spi1_sclk P9.31 */
AM33XX_IOPAD(0x0994, PIN_INPUT | MUX_MODE3 ) /* spi1_d0 P9.29*/
AM33XX_IOPAD(0x0998, PIN_INPUT | MUX_MODE3 ) /* spi1_d1 P9.30*/
AM33XX_IOPAD(0x099c, PIN_INPUT | MUX_MODE3 ) /* spi1_cs0 P9.28*/
>;
};
};
};
fragment@1 {
target = <&ocp>;
__overlay__ {
P9_15_pinmux {
status = "disabled";
};
P9_12_pinmux {
status = "disabled";
};
P9_31_pinmux {
status = "disabled";
};
P9_29_pinmux {
status = "disabled";
};
P9_30_pinmux {
status = "disabled";
};
P9_28_pinmux {
status = "disabled";
};
};
};
fragment@2 {
target = <&spi1>;
__overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pb_spi1_pins>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
status = "disabled";
};
channel@1 {
status = "disabled";
};
enc28j60: ethernet@1 {
compatible = "microchip,enc28j60";
pinctrl-names = "default";
pinctrl-0 = <&enc28j60_pins>;
reg = <0x1>;
interrupt-parent = <&gpio1>; /* P9.15 gpio1[16] */
interrupts = <16 IRQ_TYPE_EDGE_FALLING>; /* P9.15 gpio1[16] */
spi-max-frequency = <16000000>;
};
};
};
};
Looking at this it looks like the pins are configured for SPI usage.
$ sudo cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins | grep spi
pin 100 (PIN100): 481a0000.spi (GPIO UNCLAIMED) function pinmux_pb_spi1_pins group pinmux_pb_spi1_pins
pin 101 (PIN101): 481a0000.spi (GPIO UNCLAIMED) function pinmux_pb_spi1_pins group pinmux_pb_spi1_pins
pin 102 (PIN102): 481a0000.spi (GPIO UNCLAIMED) function pinmux_pb_spi1_pins group pinmux_pb_spi1_pins
pin 103 (PIN103): 481a0000.spi (GPIO UNCLAIMED) function pinmux_pb_spi1_pins group pinmux_pb_spi1_pins
However the version command give
$ sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[e307a944e0be0610ff5296e0abe4ad31a6e70daa]
eeprom:[A335BNLTEIA04816BBBK24A9]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2018-03-05]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.01-00002-ge9ff418fb8]:[location: dd MBR]
kernel:[4.9.82-ti-r102]
nodejs:[v6.13.0]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/BB-mBUS_1_eth_click-00A0.dtbo]
pkg:[bb-cape-overlays]:[4.4.20180625.0-0rcnee0~stretch+20180625]
pkg:[bb-wl18xx-firmware]:[1.20170829-0rcnee2~stretch+20180104]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee0~stretch+20170830]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 1.393378] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[ 1.640904] pinctrl-single 44e10800.pinmux: pin PIN103 already requested by 481a0000.spi; cannot claim for 48038000.mcasp
[ 1.652180] pinctrl-single 44e10800.pinmux: pin-103 (48038000.mcasp) status -22
[ 1.659672] pinctrl-single 44e10800.pinmux: could not request pin 103 (PIN103) from group mcasp0_pins on device pinctrl-single
dmesg | grep gpio-of-helper
[ 1.394409] gpio-of-helper ocp:cape-universal: ready
END
debian@beaglebone:~$
This indicates there is a conflict over the used pins.
My questions are:
1) Where is mcasp0_pins configured?
2) Can I remove the use of mcasp0_pins?
3) What does mcasp0_pins do?
4) How do I verify if overlay was loaded (I assume that the line in version.sh only show that it tried to load)?
5) Anything else you can say to point me in the right direction (errors in dts file, missing commands, etc)?