Re: [beagleboard] Re: Debugging SPI device

2021-02-12 Thread Yendor
Thanks Jon for the links,

Looking at the Beagleboard blog:
https://beagleboard.org/blog/2018-01-17-building-a-device-tree-overlay-for-your-new-pocketcape-design

I got the Idea that maybe all I need to do is free up some pins, so 
trawling through  
https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm, I found 
BB-SPIDEV1-00A0.dts so using that as my base I came up with the below 
changing to use my pins.

/*
 * Virtual cape for LoRa mPCIe on connector pins P8.19 P9.23 P9.29 P9.30 P9.31 
P2.02
 */

/dts-v1/;
/plugin/;

#include 
#include 

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

/* identification */
part-number = "SEEED_SENSECAP_GATEWAY";
version = "00A0";

/* state the resources this cape uses */
exclusive-use =
/* the pin header uses */
"P8.19",/* LoRa Power */
"P9.23",/* LoRa Reset */
"P9.29",/* LoRa SPI1_D0 */
"P9.30",/* LoRa SPI1_D1 */
"P9.31",/* LoRa SPI1_SCLK */
"P2.02",/* LoRa CS1 */
/* the hardware ip uses */
"spi1";

/*
 * Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
 */
fragment@0 {
target-path="/";
__overlay__ {

chosen {
overlays {
SEEED_SENSECAP_GATEWAY-00A0 = __TIMESTAMP__;
};
};
};
};

/*
 * Free up the pins used by the cape from the pinmux helpers.
 */
fragment@1 {
target = <&ocp>;
__overlay__ {
P8_19_pinmux { status = "disabled"; };  /* LoRa Power */
P9_23_pinmux { status = "disabled"; };  /* LoRa Reset */
P9_29_pinmux { status = "disabled"; };  /* LoRa SPI1_D0 */
P9_30_pinmux { status = "disabled"; };  /* LoRa SPI1_D1 */
P9_31_pinmux { status = "disabled"; };  /* LoRa SPI1_SCLK */
P2_02_pinmux { status = "disabled"; };  /* Lora CS1 */
};
};

fragment@2 {
target = <&am33xx_pinmux>;
__overlay__ {
/* default state has all gpios released and mode set to uart1 */
spi1_pins_s0: spi1_pins_s0 {
pinctrl-single,pins = <
0x190 0x33  /* mcasp0_aclkx.spi1_sclk, INPUT_PULLUP | 
MODE3 */
0x194 0x33  /* mcasp0_fsx.spi1_d0, INPUT_PULLUP | MODE3 
*/
0x198 0x13  /* mcasp0_axr0.spi1_d1, OUTPUT_PULLUP | 
MODE3 */
0x6c  0x17  /* gpmc_a11.gpio1_27, OUTPUT_PULLUP | MODE7 
*/
>;
};
};
};

fragment@3 {
target = <&spi1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;

status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&spi1_pins_s0>;
ti,pio-mode; /* disable dma when used as an overlay, dma gets stuck 
at 160 bits... */

channel@0 {
#address-cells = <1>;
#size-cells = <0>;

compatible = "spidev";
symlink = "spi/1.0";

reg = <0>;
spi-max-frequency = <1600>;
};

channel@1 {
#address-cells = <1>;
#size-cells = <0>;

compatible = "spidev";
symlink = "spi/1.1";

reg = <1>;
spi-max-frequency = <1600>;
};
};
};
};

This been the first go, this does not compile as I get an syntax error 
'Error: SEEED_SENSECAP_GATEWAY-00A0.dts:8.1-9 syntax error'

While I work through this, I just want to ask will this approach work?

Welcome any help or pointers.

Kind Regards,


On Tuesday, February 9, 2021 at 8:09:38 AM UTC+10 jonn...@gmail.com wrote:

> Actually, Bootlin has a Device Tree 101 Webinar scheduled for tomorrow.  
> You might find this useful:
>
> https://www.eventbrite.fr/e/webinar-device-tree-101-registration-135964923747?utm_source=eventbrite&utm_medium=email&utm_campaign=event_reminder&utm_term=eventname
>
> They have some free documentation on their site as well.:
> https://bootlin.com/
>
> This is on the Beagleboard page:
>
> https://beagleboard.org/blog/2018-01-17-building-a-device-tree-overlay-for-your-new-pocketcape-design
>
> For the Beaglebone specific stuff, the Derek Molloy book is quite handy. 
> The Second Edition is more relevant to the current kernel implementation. 
>
> https://www.amazon.com/Exploring-BeagleBone-Techniques-Building-Embedded-dp-1119533163/dp/1119533163/ref=dp_ob_title_bk
>
>
> There is a ton of info out there, so others may have their own references.
>
> Cheers,
>
> Jon
>
> On Sun, Feb 7, 2021 at 11:28 AM Yendor  wrote:
>
>> Hi Robert,
>> Been completely new to all this what would be the best why to begin 
>> writing a new *.dtb
>>
>> Regards,
>>
>> On Monday, February 8, 2021 at 1:39:02 AM UTC+10 RobertCNel

Re: [beagleboard] Re: Debugging SPI device

2021-02-08 Thread jonnymo
Actually, Bootlin has a Device Tree 101 Webinar scheduled for tomorrow.
You might find this useful:
https://www.eventbrite.fr/e/webinar-device-tree-101-registration-135964923747?utm_source=eventbrite&utm_medium=email&utm_campaign=event_reminder&utm_term=eventname

They have some free documentation on their site as well.:
https://bootlin.com/

This is on the Beagleboard page:
https://beagleboard.org/blog/2018-01-17-building-a-device-tree-overlay-for-your-new-pocketcape-design

For the Beaglebone specific stuff, the Derek Molloy book is quite handy.
The Second Edition is more relevant to the current kernel implementation.
https://www.amazon.com/Exploring-BeagleBone-Techniques-Building-Embedded-dp-1119533163/dp/1119533163/ref=dp_ob_title_bk


There is a ton of info out there, so others may have their own references.

Cheers,

Jon

On Sun, Feb 7, 2021 at 11:28 AM Yendor  wrote:

> Hi Robert,
> Been completely new to all this what would be the best why to begin
> writing a new *.dtb
>
> Regards,
>
> On Monday, February 8, 2021 at 1:39:02 AM UTC+10 RobertCNelson wrote:
>
>> On Sat, Feb 6, 2021 at 7:22 PM Yendor  wrote:
>> >
>> > Thanks for the info Robert, would you know how I could reclaim /
>> rewrite these pins to act as SPI pins?
>> >
>> > What would be the best way of doing this? modify
>> 'am335x-bonegreen-wireless-uboot-univ.dts' or can we get the boards to load
>> a custom default dt config?
>>
>> Honestly, since you have a custom board, i'd just start carving a new
>> *.dtb and stop using overlays for other boards..
>>
>> Regards,
>>
>> --
>> Robert Nelson
>> https://rcn-ee.com/
>>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/56b31b3d-418a-442a-a750-3bc14832c1c0n%40googlegroups.com
> 
> .
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAG99bkqG2N2Q5-m-Tv-e82HA4kE8tRscJ1WbcxL4Bc3oZCxFTg%40mail.gmail.com.


Re: [beagleboard] Re: Debugging SPI device

2021-02-07 Thread Yendor
Hi Robert,
Been completely new to all this what would be the best why to begin writing 
a new *.dtb

Regards,

On Monday, February 8, 2021 at 1:39:02 AM UTC+10 RobertCNelson wrote:

> On Sat, Feb 6, 2021 at 7:22 PM Yendor  wrote:
> >
> > Thanks for the info Robert, would you know how I could reclaim / rewrite 
> these pins to act as SPI pins?
> >
> > What would be the best way of doing this? modify 
> 'am335x-bonegreen-wireless-uboot-univ.dts' or can we get the boards to load 
> a custom default dt config?
>
> Honestly, since you have a custom board, i'd just start carving a new
> *.dtb and stop using overlays for other boards..
>
> Regards,
>
> -- 
> Robert Nelson
> https://rcn-ee.com/
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/56b31b3d-418a-442a-a750-3bc14832c1c0n%40googlegroups.com.


Re: [beagleboard] Re: Debugging SPI device

2021-02-07 Thread Robert Nelson
On Sat, Feb 6, 2021 at 7:22 PM Yendor  wrote:
>
> Thanks for the info Robert, would you know how I could reclaim / rewrite 
> these pins to act as SPI pins?
>
> What would be the best way of doing this? modify 
> 'am335x-bonegreen-wireless-uboot-univ.dts' or can we get the boards to load a 
> custom default dt config?

Honestly, since you have a custom board, i'd just start carving a new
*.dtb and stop using overlays for other boards..

Regards,

-- 
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYi9Bxw80givWRrsHs42Ab_gSNWbymu45wPmkBgjhexh4w%40mail.gmail.com.


Re: [beagleboard] Re: Debugging SPI device

2021-02-06 Thread Yendor
Thanks for the info Robert, would you know how I could reclaim / rewrite 
these pins to act as SPI pins?

What would be the best way of doing this? modify 
'am335x-bonegreen-wireless-uboot-univ.dts' or can we get the boards to load 
a custom default dt config?

Regards,

On Sunday, February 7, 2021 at 11:03:03 AM UTC+10 RobertCNelson wrote:

> On Sat, Feb 6, 2021 at 4:03 PM Yendor  wrote:
> >
> > Digging down, it looks like 'am335x-bonegreen-wireless-uboot-univ.dts' 
> is been loaded as the default and this includes 
> 'am335x-bonegreen-wireless-common-univ.dtsi'
> > which in turn sets 'MCASP0_ACLKX' and 'MCASP0_FSX' as 'audio' on the P9 
> header.
> >
> > Question is it possible to modify 
> 'am335x-bonegreen-wireless-uboot-univ.dts' to allow me to use SPI1 on the 
> pins I want?
> >
> > The pins I need are:
> > ZCZ Ball Pin Name Signal Mode Assumed Commands
> > A13 MCASP0_ACLKX SPI1_SCLK 3 AM33XX_IOPAD(0x0990, PIN_OUTPUT_PULLUP | 
> INPUT_EN | MUX_MODE3)
> > B13 MCASP0_FSX SPI1_D0 3 AM33XX_IOPAD(0x0994, PIN_INPUT_PULLUP | 
> INPUT_EN | MUX_MODE3)
> > D12 MCASP0_AXR0 SPI1_D1 3 AM33XX_IOPAD(0x0998, PIN_OUTPUT_PULLUP | 
> INPUT_EN | MUX_MODE3)
> > V17 GPMC_A11 LoRa_CS1 7 AM33XX_IOPAD(0x086c, PIN_OUTPUT_PULLUP | 
> INPUT_EN | MUX_MODE7)
> >
> > Is anyone able to show me what would need to be modified, Thanks.
> >
>
> That's right, the BBGW, has the audio muxed to the wl18xx's
> bluetooth.. The idea was to stream bluetooth audio.. i don't think
> this is fully supported yet either.. (aka there was a random
> driver/bugs..)
>
> Regards,
>
> -- 
> Robert Nelson
> https://rcn-ee.com/
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/de43eb0b-0746-4f0f-8478-cf19d5c9d90fn%40googlegroups.com.


Re: [beagleboard] Re: Debugging SPI device

2021-02-06 Thread Robert Nelson
On Sat, Feb 6, 2021 at 4:03 PM Yendor  wrote:
>
> Digging down, it looks like 'am335x-bonegreen-wireless-uboot-univ.dts' is 
> been loaded as the default and this includes 
> 'am335x-bonegreen-wireless-common-univ.dtsi'
> which in turn sets 'MCASP0_ACLKX' and 'MCASP0_FSX' as 'audio' on the P9 
> header.
>
> Question is it possible to modify  'am335x-bonegreen-wireless-uboot-univ.dts' 
> to allow me to use SPI1 on the pins I want?
>
> The pins I need are:
> ZCZ BallPin NameSignal  ModeAssumed Commands
> A13 MCASP0_ACLKXSPI1_SCLK   3   AM33XX_IOPAD(0x0990, 
> PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE3)
> B13 MCASP0_FSX  SPI1_D0 3   AM33XX_IOPAD(0x0994, 
> PIN_INPUT_PULLUP | INPUT_EN | MUX_MODE3)
> D12 MCASP0_AXR0 SPI1_D1 3   AM33XX_IOPAD(0x0998, 
> PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE3)
> V17 GPMC_A11LoRa_CS17   AM33XX_IOPAD(0x086c, 
> PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE7)
>
> Is anyone able to show me what would need to be modified, Thanks.
>

That's right, the BBGW, has the audio muxed to the wl18xx's
bluetooth.. The idea was to stream bluetooth audio.. i don't think
this is fully supported yet either.. (aka there was a random
driver/bugs..)

Regards,

-- 
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYgY5hqLY9pcXuUgHF9110gFvPRieqN59y6K%3DSqABvje6g%40mail.gmail.com.


Re: [beagleboard] Re: Debugging SPI device

2021-02-06 Thread Yendor
Digging down, it looks like 'am335x-bonegreen-wireless-uboot-univ.dts' is 
been loaded as the default and this includes 
'am335x-bonegreen-wireless-common-univ.dtsi' 
which in turn sets 'MCASP0_ACLKX' and 'MCASP0_FSX' as 'audio' on the P9 
header.

Question is it possible to modify  
'am335x-bonegreen-wireless-uboot-univ.dts' to allow me to use SPI1 on the 
pins I want?

The pins I need are:
ZCZ BallPin NameSignal  ModeAssumed Commands
A13 MCASP0_ACLKXSPI1_SCLK   3   AM33XX_IOPAD(0x0990, 
PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE3)
B13 MCASP0_FSX  SPI1_D0 3   AM33XX_IOPAD(0x0994, 
PIN_INPUT_PULLUP | INPUT_EN | MUX_MODE3)
D12 MCASP0_AXR0 SPI1_D1 3   AM33XX_IOPAD(0x0998, 
PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE3)
V17 GPMC_A11LoRa_CS17   AM33XX_IOPAD(0x086c, 
PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE7)

Is anyone able to show me what would need to be modified, Thanks.


On Friday, February 5, 2021 at 7:42:32 AM UTC+10 Yendor wrote:

> I think I see the problem, but don't know how to fix it.
>
> when looking at dmesg or running the version script I see
>
> [0.938342] pinctrl-single 44e10800.pinmux: 142 pins, size 568
> [1.262375] pinctrl-single 44e10800.pinmux: pin PIN100 already 
> requested by ocp:P9_31_pinmux; cannot claim for 481a.spi
> [1.273762] pinctrl-single 44e10800.pinmux: pin-100 (481a.spi) 
> status -22
> [1.280975] pinctrl-single 44e10800.pinmux: could not request pin 100 
> (PIN100) from group spi1_pins_s0  on device pinctrl-single
>
> so the pin can't be reassigned for use as spi1. Currently trying to figure 
> out what is assigning PIN100 (P9_31_pinmux) and seeing what can be done.
>
> I thought that the new or call dt file would over right any previous 
> settings, but It does look like it.
>
> Regards, 
>
> On Thursday, January 28, 2021 at 10:04:33 AM UTC+10 Yendor wrote:
>
>> Copying from https://elinux.org/BeagleBone_Black_Enable_SPIDEV I came up 
>> with
>>
>> --
>> /dts-v1/;
>> /plugin/;
>>
>> /* SPI1 */
>> /* D1 Output and D0 Input */
>>
>> / {
>>
>> compatible = "ti,beaglebone", "ti,beaglebone-black", "beaglebone-green";
>>
>> /* identification */
>> part-number = "spi1mux";
>>
>> fragment@0 {
>> target = <&am33xx_pinmux>;
>> __overlay__ {
>> spi1_pins_s0: spi1_pins_s0 {
>> pinctrl-single,pins = <
>>
>> 0x190 0x33  /* mcasp0_aclkx.spi1_sclk, 
>> INPUT_PULLUP | MODE3 */
>>
>> 0x194 0x33  /* mcasp0_fsx.spi1_d0, 
>> INPUT_PULLUP | MODE3 */
>>
>> 0x198 0x13  /* mcasp0_axr0.spi1_d1, 
>> OUTPUT_PULLUP | MODE3 */
>>
>> 0x6c  0x17  /* gpmc_a11.gpio1_27, 
>> OUTPUT_PULLUP | MODE7 */
>> >;
>> };
>> };
>> };
>>
>> fragment@1 {
>> target = <&spi1>;
>> __overlay__ {
>>
>>  #address-cells = < 0x01 >;
>>  #size-cells = < 0x00 >;
>>  status = "okay";
>>  pinctrl-names = "default";
>>  pinctrl-0 = <&spi1_pins_s0>;
>>
>>  spidev@1 {
>>  spi-max-frequency = < 0xf42400 >;
>>  reg = < 0x00 >;
>>  compatible = "linux,spidev";
>> };
>> };
>> };
>> };
>> --
>> and compiled to dtbo, add to uEnv.txt rebooted but still no reflection 
>> when test the SPI, hmmm? don't know if this is been overwritten or just not 
>> working?
>>
>> what the best way to track down what pin are been connected to the SPI 
>> bus, I'm thinking I should be able to find what pin are controlling the 
>> SCLK, MOSI and MISO.
>>
>> Regards,
>> On Thursday, January 28, 2021 at 6:44:35 AM UTC+10 Yendor wrote:
>>
>>> How to setup pins as SPI?
>>>
>>> Support has let me know what pins are controlling the SPI bus for the 
>>> LoRa connector and now I need to know how to set them up so they work as 
>>> SPI0.0
>>>
>>> the known pins:
>>> MCASP0_ACLKXgpio3_14110SPI1_SCLK
>>> MCASP0_FSX gpio3_15111SPI1_DO
>>> MCASP0_AXR0  gpio3_16112SPI1_D1
>>> GPMC_A11 gpio1_2759   LoRa_CS1
>>>
>>> after getting this working I would like to write a dts that enables the 
>>> ethernet, set the spi correctly and enables LoRa (set gpio0_22 as a output 
>>> and set high), what are the best resources for doing this?
>>>
>>> Regards,
>>>
>>> On Monday, January 25, 2021 at 5:35:38 AM UTC+10 Yendor wrote:
>>>
 Thanks for the links Jon,

 I see in /dev/spi:
 lrwxrwxrwx  1 root root   12 Jan 24 06:30 0.0 -> ../spidev0.0
 lrwxrwxrwx  1 root root   12 Jan 24 06:30 0.1 -> ../spidev0.1
 lrwxrwxrwx  1 root root   12 Jan 24 06:30 1.0 -> ../spidev1.0
 lrwxrwxrwx  1 root root   12 Jan 24 06:30 1.1 -> ../spidev1.1
>>

Re: [beagleboard] Re: Debugging SPI device

2021-02-04 Thread Yendor
I think I see the problem, but don't know how to fix it.

when looking at dmesg or running the version script I see

[0.938342] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[1.262375] pinctrl-single 44e10800.pinmux: pin PIN100 already requested 
by ocp:P9_31_pinmux; cannot claim for 481a.spi
[1.273762] pinctrl-single 44e10800.pinmux: pin-100 (481a.spi) 
status -22
[1.280975] pinctrl-single 44e10800.pinmux: could not request pin 100 
(PIN100) from group spi1_pins_s0  on device pinctrl-single

so the pin can't be reassigned for use as spi1. Currently trying to figure 
out what is assigning PIN100 (P9_31_pinmux) and seeing what can be done.

I thought that the new or call dt file would over right any previous 
settings, but It does look like it.

Regards, 

On Thursday, January 28, 2021 at 10:04:33 AM UTC+10 Yendor wrote:

> Copying from https://elinux.org/BeagleBone_Black_Enable_SPIDEV I came up 
> with
>
> --
> /dts-v1/;
> /plugin/;
>
> /* SPI1 */
> /* D1 Output and D0 Input */
>
> / {
>
> compatible = "ti,beaglebone", "ti,beaglebone-black", "beaglebone-green";
>
> /* identification */
> part-number = "spi1mux";
>
> fragment@0 {
> target = <&am33xx_pinmux>;
> __overlay__ {
> spi1_pins_s0: spi1_pins_s0 {
> pinctrl-single,pins = <
>
> 0x190 0x33  /* mcasp0_aclkx.spi1_sclk, 
> INPUT_PULLUP | MODE3 */
>
> 0x194 0x33  /* mcasp0_fsx.spi1_d0, 
> INPUT_PULLUP | MODE3 */
>
> 0x198 0x13  /* mcasp0_axr0.spi1_d1, 
> OUTPUT_PULLUP | MODE3 */
>
> 0x6c  0x17  /* gpmc_a11.gpio1_27, 
> OUTPUT_PULLUP | MODE7 */
> >;
> };
> };
> };
>
> fragment@1 {
> target = <&spi1>;
> __overlay__ {
>
>  #address-cells = < 0x01 >;
>  #size-cells = < 0x00 >;
>  status = "okay";
>  pinctrl-names = "default";
>  pinctrl-0 = <&spi1_pins_s0>;
>
>  spidev@1 {
>  spi-max-frequency = < 0xf42400 >;
>  reg = < 0x00 >;
>  compatible = "linux,spidev";
> };
> };
> };
> };
> --
> and compiled to dtbo, add to uEnv.txt rebooted but still no reflection 
> when test the SPI, hmmm? don't know if this is been overwritten or just not 
> working?
>
> what the best way to track down what pin are been connected to the SPI 
> bus, I'm thinking I should be able to find what pin are controlling the 
> SCLK, MOSI and MISO.
>
> Regards,
> On Thursday, January 28, 2021 at 6:44:35 AM UTC+10 Yendor wrote:
>
>> How to setup pins as SPI?
>>
>> Support has let me know what pins are controlling the SPI bus for the 
>> LoRa connector and now I need to know how to set them up so they work as 
>> SPI0.0
>>
>> the known pins:
>> MCASP0_ACLKXgpio3_14110SPI1_SCLK
>> MCASP0_FSX gpio3_15111SPI1_DO
>> MCASP0_AXR0  gpio3_16112SPI1_D1
>> GPMC_A11 gpio1_2759   LoRa_CS1
>>
>> after getting this working I would like to write a dts that enables the 
>> ethernet, set the spi correctly and enables LoRa (set gpio0_22 as a output 
>> and set high), what are the best resources for doing this?
>>
>> Regards,
>>
>> On Monday, January 25, 2021 at 5:35:38 AM UTC+10 Yendor wrote:
>>
>>> Thanks for the links Jon,
>>>
>>> I see in /dev/spi:
>>> lrwxrwxrwx  1 root root   12 Jan 24 06:30 0.0 -> ../spidev0.0
>>> lrwxrwxrwx  1 root root   12 Jan 24 06:30 0.1 -> ../spidev0.1
>>> lrwxrwxrwx  1 root root   12 Jan 24 06:30 1.0 -> ../spidev1.0
>>> lrwxrwxrwx  1 root root   12 Jan 24 06:30 1.1 -> ../spidev1.1
>>>
>>> config-pin give a error
>>> ERROR: open() for /sys/devices/platform/ocp/ocp:P9_17_pinmux/state 
>>> failed, No such file or directory
>>>
>>> and for spi_test on /dev/spidev0.0 to 1.1 with shorting the mosi and 
>>> miso pins, I get:
>>> sudo ./spi_test --device /dev/spidev0.0 
>>> spi mode: 0
>>> bits per word: 8
>>> max speed: 50 Hz (500 KHz)
>>>
>>> 00 00 00 00 00 00
>>> 00 00 00 00 00 00
>>> 00 00 00 00 00 00
>>> 00 00 00 00 00 00
>>> 00 00 00 00 00 00
>>> 00 00 00 00 00 00
>>> 00 00
>>>
>>> On Sunday, January 24, 2021 at 4:44:57 PM UTC+10 jonn...@gmail.com 
>>> wrote:
>>>
 A quick test is to see if a SPI device has been created under '/dev/'.

 A few SPI test references:

 https://github.com/derekmolloy/exploringBB/tree/version2/chp08/spi/spidev_test
 https://elinux.org/BeagleBone_Black_Enable_SPIDEV
 https://gist.github.com/pdp7/33a8ad95efcbcc0fadc3f96a70d4b159


 Cheers,

 Jon

 On Sat, Jan 23, 2021 at 9:15 PM Yendor  wrote:

> How can I tell if the SPI interface is enabled?
>
> On Wednesday, January 20, 2021 at 7:24:32 AM UTC+10 Yendor wrote:
>
>> Hi,
>> 

Re: [beagleboard] Re: Debugging SPI device

2021-01-27 Thread Yendor
Copying from https://elinux.org/BeagleBone_Black_Enable_SPIDEV I came up 
with

--
/dts-v1/;
/plugin/;

/* SPI1 */
/* D1 Output and D0 Input */

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

/* identification */
part-number = "spi1mux";

fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
spi1_pins_s0: spi1_pins_s0 {
pinctrl-single,pins = <
0x190 0x33  /* mcasp0_aclkx.spi1_sclk, 
INPUT_PULLUP | MODE3 */
0x194 0x33  /* mcasp0_fsx.spi1_d0, 
INPUT_PULLUP | MODE3 */
0x198 0x13  /* mcasp0_axr0.spi1_d1, 
OUTPUT_PULLUP | MODE3 */
0x6c  0x17  /* gpmc_a11.gpio1_27, 
OUTPUT_PULLUP | MODE7 */
>;
};
};
};

fragment@1 {
target = <&spi1>;
__overlay__ {

 #address-cells = < 0x01 >;
 #size-cells = < 0x00 >;
 status = "okay";
 pinctrl-names = "default";
 pinctrl-0 = <&spi1_pins_s0>;

 spidev@1 {
 spi-max-frequency = < 0xf42400 >;
 reg = < 0x00 >;
 compatible = "linux,spidev";
};
};
};
};
--
and compiled to dtbo, add to uEnv.txt rebooted but still no reflection when 
test the SPI, hmmm? don't know if this is been overwritten or just not 
working?

what the best way to track down what pin are been connected to the SPI bus, 
I'm thinking I should be able to find what pin are controlling the SCLK, 
MOSI and MISO.

Regards,
On Thursday, January 28, 2021 at 6:44:35 AM UTC+10 Yendor wrote:

> How to setup pins as SPI?
>
> Support has let me know what pins are controlling the SPI bus for the LoRa 
> connector and now I need to know how to set them up so they work as SPI0.0
>
> the known pins:
> MCASP0_ACLKXgpio3_14110SPI1_SCLK
> MCASP0_FSX gpio3_15111SPI1_DO
> MCASP0_AXR0  gpio3_16112SPI1_D1
> GPMC_A11 gpio1_2759   LoRa_CS1
>
> after getting this working I would like to write a dts that enables the 
> ethernet, set the spi correctly and enables LoRa (set gpio0_22 as a output 
> and set high), what are the best resources for doing this?
>
> Regards,
>
> On Monday, January 25, 2021 at 5:35:38 AM UTC+10 Yendor wrote:
>
>> Thanks for the links Jon,
>>
>> I see in /dev/spi:
>> lrwxrwxrwx  1 root root   12 Jan 24 06:30 0.0 -> ../spidev0.0
>> lrwxrwxrwx  1 root root   12 Jan 24 06:30 0.1 -> ../spidev0.1
>> lrwxrwxrwx  1 root root   12 Jan 24 06:30 1.0 -> ../spidev1.0
>> lrwxrwxrwx  1 root root   12 Jan 24 06:30 1.1 -> ../spidev1.1
>>
>> config-pin give a error
>> ERROR: open() for /sys/devices/platform/ocp/ocp:P9_17_pinmux/state 
>> failed, No such file or directory
>>
>> and for spi_test on /dev/spidev0.0 to 1.1 with shorting the mosi and miso 
>> pins, I get:
>> sudo ./spi_test --device /dev/spidev0.0 
>> spi mode: 0
>> bits per word: 8
>> max speed: 50 Hz (500 KHz)
>>
>> 00 00 00 00 00 00
>> 00 00 00 00 00 00
>> 00 00 00 00 00 00
>> 00 00 00 00 00 00
>> 00 00 00 00 00 00
>> 00 00 00 00 00 00
>> 00 00
>>
>> On Sunday, January 24, 2021 at 4:44:57 PM UTC+10 jonn...@gmail.com wrote:
>>
>>> A quick test is to see if a SPI device has been created under '/dev/'.
>>>
>>> A few SPI test references:
>>>
>>> https://github.com/derekmolloy/exploringBB/tree/version2/chp08/spi/spidev_test
>>> https://elinux.org/BeagleBone_Black_Enable_SPIDEV
>>> https://gist.github.com/pdp7/33a8ad95efcbcc0fadc3f96a70d4b159
>>>
>>>
>>> Cheers,
>>>
>>> Jon
>>>
>>> On Sat, Jan 23, 2021 at 9:15 PM Yendor  wrote:
>>>
 How can I tell if the SPI interface is enabled?

 On Wednesday, January 20, 2021 at 7:24:32 AM UTC+10 Yendor wrote:

> Hi,
> Carrying on from the SeeedStudio SenseCAP Gateway hacking form this 
> conversation (https://groups.google.com/g/beagleboard/c/Y_Zx_D2HJUA)
>
> I am now looking to get the LoRa interface working, the interface is a 
> mPCIe SPI RAK2247 
> 
>  
> LoRa card connector.
>
> The things I think I need to find out how to do:
>
>- Identify the correct SPI bus for the connector;
>- and what GPIO drives the reset pin (PIN 22) of the connector.
>
> if anyone has any ideas on the best why to do this, please feel free 
> to share.
>
> Regards,
>
> result of gpioinfo:
> gpiochip0 - 32 lines:
> line   0:  "MDIO_DATA"   unused   input  active-high
> line   1:   "MDIO_CLK"   unused   input  active-high
> line   2:  "SPI0_SCLK"  "P9_22"   input  active-high [used]
> line   3:"SPI0_D0"  "P9_21"   input  active-high [used]
> line   

Re: [beagleboard] Re: Debugging SPI device

2021-01-27 Thread Yendor
How to setup pins as SPI?

Support has let me know what pins are controlling the SPI bus for the LoRa 
connector and now I need to know how to set them up so they work as SPI0.0

the known pins:
MCASP0_ACLKXgpio3_14110SPI1_SCLK
MCASP0_FSX gpio3_15111SPI1_DO
MCASP0_AXR0  gpio3_16112SPI1_D1
GPMC_A11 gpio1_2759   LoRa_CS1

after getting this working I would like to write a dts that enables the 
ethernet, set the spi correctly and enables LoRa (set gpio0_22 as a output 
and set high), what are the best resources for doing this?

Regards,

On Monday, January 25, 2021 at 5:35:38 AM UTC+10 Yendor wrote:

> Thanks for the links Jon,
>
> I see in /dev/spi:
> lrwxrwxrwx  1 root root   12 Jan 24 06:30 0.0 -> ../spidev0.0
> lrwxrwxrwx  1 root root   12 Jan 24 06:30 0.1 -> ../spidev0.1
> lrwxrwxrwx  1 root root   12 Jan 24 06:30 1.0 -> ../spidev1.0
> lrwxrwxrwx  1 root root   12 Jan 24 06:30 1.1 -> ../spidev1.1
>
> config-pin give a error
> ERROR: open() for /sys/devices/platform/ocp/ocp:P9_17_pinmux/state failed, 
> No such file or directory
>
> and for spi_test on /dev/spidev0.0 to 1.1 with shorting the mosi and miso 
> pins, I get:
> sudo ./spi_test --device /dev/spidev0.0 
> spi mode: 0
> bits per word: 8
> max speed: 50 Hz (500 KHz)
>
> 00 00 00 00 00 00
> 00 00 00 00 00 00
> 00 00 00 00 00 00
> 00 00 00 00 00 00
> 00 00 00 00 00 00
> 00 00 00 00 00 00
> 00 00
>
> On Sunday, January 24, 2021 at 4:44:57 PM UTC+10 jonn...@gmail.com wrote:
>
>> A quick test is to see if a SPI device has been created under '/dev/'.
>>
>> A few SPI test references:
>>
>> https://github.com/derekmolloy/exploringBB/tree/version2/chp08/spi/spidev_test
>> https://elinux.org/BeagleBone_Black_Enable_SPIDEV
>> https://gist.github.com/pdp7/33a8ad95efcbcc0fadc3f96a70d4b159
>>
>>
>> Cheers,
>>
>> Jon
>>
>> On Sat, Jan 23, 2021 at 9:15 PM Yendor  wrote:
>>
>>> How can I tell if the SPI interface is enabled?
>>>
>>> On Wednesday, January 20, 2021 at 7:24:32 AM UTC+10 Yendor wrote:
>>>
 Hi,
 Carrying on from the SeeedStudio SenseCAP Gateway hacking form this 
 conversation (https://groups.google.com/g/beagleboard/c/Y_Zx_D2HJUA)

 I am now looking to get the LoRa interface working, the interface is a 
 mPCIe SPI RAK2247 
 
  
 LoRa card connector.

 The things I think I need to find out how to do:

- Identify the correct SPI bus for the connector;
- and what GPIO drives the reset pin (PIN 22) of the connector.

 if anyone has any ideas on the best why to do this, please feel free to 
 share.

 Regards,

 result of gpioinfo:
 gpiochip0 - 32 lines:
 line   0:  "MDIO_DATA"   unused   input  active-high
 line   1:   "MDIO_CLK"   unused   input  active-high
 line   2:  "SPI0_SCLK"  "P9_22"   input  active-high [used]
 line   3:"SPI0_D0"  "P9_21"   input  active-high [used]
 line   4:"SPI0_D1"  "P9_18"   input  active-high [used]
 line   5:   "SPI0_CS0"  "P9_17"   input  active-high [used]
 line   6:   "SPI0_CS1" "cd"   input   active-low [used]
 line   7: "ECAP0_IN_PWM0_OUT" "P9_42" input active-high [used]
 line   8: "LCD_DATA12"  "P8_35"   input  active-high [used]
 line   9: "LCD_DATA13"  "P8_33"   input  active-high [used]
 line  10: "LCD_DATA14"  "P8_31"   input  active-high [used]
 line  11: "LCD_DATA15"  "P8_32"   input  active-high [used]
 line  12: "UART1_CTSN"  "P9_20"   input  active-high [used]
 line  13: "UART1_RTSN"  "P9_19"   input  active-high [used]
 line  14:  "UART1_RXD"  "P9_26"   input  active-high [used]
 line  15:  "UART1_TXD"  "P9_24"   input  active-high [used]
 line  16: "GMII1_TXD3"   unused   input  active-high
 line  17: "GMII1_TXD2"   unused   input  active-high
 line  18: "USB0_DRVVBUS" unused input active-high
 line  19: "XDMA_EVENT_INTR0" "A15" input active-high [used]
 line  20: "XDMA_EVENT_INTR1" "P9_41" input active-high [used]
 line  21: "GMII1_TXD1"   unused   input  active-high
 line  22:   "GPMC_AD8"  "P8_19"   input  active-high [used]
 line  23:   "GPMC_AD9"  "P8_13"   input  active-high [used]
 line  24: "NC"   unused   input  active-high
 line  25: "NC"   unused   input  active-high
 line  26:  "GPMC_AD10"   unused   input  active-high
 line  27:  "GPMC_AD11"   unused   input  active-high
 line  28: "GMII1_TXD0"   unused   input  active-high
 line  29: "RMII1_REFCLK" unused input active-high
  

Re: [beagleboard] Re: Debugging SPI device

2021-01-24 Thread Yendor
Thanks for the links Jon,

I see in /dev/spi:
lrwxrwxrwx  1 root root   12 Jan 24 06:30 0.0 -> ../spidev0.0
lrwxrwxrwx  1 root root   12 Jan 24 06:30 0.1 -> ../spidev0.1
lrwxrwxrwx  1 root root   12 Jan 24 06:30 1.0 -> ../spidev1.0
lrwxrwxrwx  1 root root   12 Jan 24 06:30 1.1 -> ../spidev1.1

config-pin give a error
ERROR: open() for /sys/devices/platform/ocp/ocp:P9_17_pinmux/state failed, 
No such file or directory

and for spi_test on /dev/spidev0.0 to 1.1 with shorting the mosi and miso 
pins, I get:
sudo ./spi_test --device /dev/spidev0.0 
spi mode: 0
bits per word: 8
max speed: 50 Hz (500 KHz)

00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00

On Sunday, January 24, 2021 at 4:44:57 PM UTC+10 jonn...@gmail.com wrote:

> A quick test is to see if a SPI device has been created under '/dev/'.
>
> A few SPI test references:
>
> https://github.com/derekmolloy/exploringBB/tree/version2/chp08/spi/spidev_test
> https://elinux.org/BeagleBone_Black_Enable_SPIDEV
> https://gist.github.com/pdp7/33a8ad95efcbcc0fadc3f96a70d4b159
>
>
> Cheers,
>
> Jon
>
> On Sat, Jan 23, 2021 at 9:15 PM Yendor  wrote:
>
>> How can I tell if the SPI interface is enabled?
>>
>> On Wednesday, January 20, 2021 at 7:24:32 AM UTC+10 Yendor wrote:
>>
>>> Hi,
>>> Carrying on from the SeeedStudio SenseCAP Gateway hacking form this 
>>> conversation (https://groups.google.com/g/beagleboard/c/Y_Zx_D2HJUA)
>>>
>>> I am now looking to get the LoRa interface working, the interface is a 
>>> mPCIe SPI RAK2247 
>>>  
>>> LoRa card connector.
>>>
>>> The things I think I need to find out how to do:
>>>
>>>- Identify the correct SPI bus for the connector;
>>>- and what GPIO drives the reset pin (PIN 22) of the connector.
>>>
>>> if anyone has any ideas on the best why to do this, please feel free to 
>>> share.
>>>
>>> Regards,
>>>
>>> result of gpioinfo:
>>> gpiochip0 - 32 lines:
>>> line   0:  "MDIO_DATA"   unused   input  active-high
>>> line   1:   "MDIO_CLK"   unused   input  active-high
>>> line   2:  "SPI0_SCLK"  "P9_22"   input  active-high [used]
>>> line   3:"SPI0_D0"  "P9_21"   input  active-high [used]
>>> line   4:"SPI0_D1"  "P9_18"   input  active-high [used]
>>> line   5:   "SPI0_CS0"  "P9_17"   input  active-high [used]
>>> line   6:   "SPI0_CS1" "cd"   input   active-low [used]
>>> line   7: "ECAP0_IN_PWM0_OUT" "P9_42" input active-high [used]
>>> line   8: "LCD_DATA12"  "P8_35"   input  active-high [used]
>>> line   9: "LCD_DATA13"  "P8_33"   input  active-high [used]
>>> line  10: "LCD_DATA14"  "P8_31"   input  active-high [used]
>>> line  11: "LCD_DATA15"  "P8_32"   input  active-high [used]
>>> line  12: "UART1_CTSN"  "P9_20"   input  active-high [used]
>>> line  13: "UART1_RTSN"  "P9_19"   input  active-high [used]
>>> line  14:  "UART1_RXD"  "P9_26"   input  active-high [used]
>>> line  15:  "UART1_TXD"  "P9_24"   input  active-high [used]
>>> line  16: "GMII1_TXD3"   unused   input  active-high
>>> line  17: "GMII1_TXD2"   unused   input  active-high
>>> line  18: "USB0_DRVVBUS" unused input active-high
>>> line  19: "XDMA_EVENT_INTR0" "A15" input active-high [used]
>>> line  20: "XDMA_EVENT_INTR1" "P9_41" input active-high [used]
>>> line  21: "GMII1_TXD1"   unused   input  active-high
>>> line  22:   "GPMC_AD8"  "P8_19"   input  active-high [used]
>>> line  23:   "GPMC_AD9"  "P8_13"   input  active-high [used]
>>> line  24: "NC"   unused   input  active-high
>>> line  25: "NC"   unused   input  active-high
>>> line  26:  "GPMC_AD10"   unused   input  active-high
>>> line  27:  "GPMC_AD11"   unused   input  active-high
>>> line  28: "GMII1_TXD0"   unused   input  active-high
>>> line  29: "RMII1_REFCLK" unused input active-high
>>> line  30: "GPMC_WAIT0"  "P9_11"   input  active-high [used]
>>> line  31:   "GPMC_WPN"  "P9_13"   input  active-high [used]
>>> gpiochip1 - 32 lines:
>>> line   0:   "GPMC_AD0"  "P8_25"   input  active-high [used]
>>> line   1:   "GPMC_AD1"  "P8_24"   input  active-high [used]
>>> line   2:   "GPMC_AD2"  "P8_05"   input  active-high [used]
>>> line   3:   "GPMC_AD3"  "P8_06"   input  active-high [used]
>>> line   4:   "GPMC_AD4"  "P8_23"   input  active-high [used]
>>> line   5:   "GPMC_AD5"  "P8_22"   input  active-high [used]
>>> line   6:   "GPMC_AD6"  "P8_03"   input  active-high [used]
>>> line   7:   "GPMC_AD7"  "P8_04"   input  active-high [used]
>>> line 

Re: [beagleboard] Re: Debugging SPI device

2021-01-23 Thread jonnymo
A quick test is to see if a SPI device has been created under '/dev/'.

A few SPI test references:
https://github.com/derekmolloy/exploringBB/tree/version2/chp08/spi/spidev_test
https://elinux.org/BeagleBone_Black_Enable_SPIDEV
https://gist.github.com/pdp7/33a8ad95efcbcc0fadc3f96a70d4b159


Cheers,

Jon

On Sat, Jan 23, 2021 at 9:15 PM Yendor  wrote:

> How can I tell if the SPI interface is enabled?
>
> On Wednesday, January 20, 2021 at 7:24:32 AM UTC+10 Yendor wrote:
>
>> Hi,
>> Carrying on from the SeeedStudio SenseCAP Gateway hacking form this
>> conversation (https://groups.google.com/g/beagleboard/c/Y_Zx_D2HJUA)
>>
>> I am now looking to get the LoRa interface working, the interface is a
>> mPCIe SPI RAK2247
>> 
>> LoRa card connector.
>>
>> The things I think I need to find out how to do:
>>
>>- Identify the correct SPI bus for the connector;
>>- and what GPIO drives the reset pin (PIN 22) of the connector.
>>
>> if anyone has any ideas on the best why to do this, please feel free to
>> share.
>>
>> Regards,
>>
>> result of gpioinfo:
>> gpiochip0 - 32 lines:
>> line   0:  "MDIO_DATA"   unused   input  active-high
>> line   1:   "MDIO_CLK"   unused   input  active-high
>> line   2:  "SPI0_SCLK"  "P9_22"   input  active-high [used]
>> line   3:"SPI0_D0"  "P9_21"   input  active-high [used]
>> line   4:"SPI0_D1"  "P9_18"   input  active-high [used]
>> line   5:   "SPI0_CS0"  "P9_17"   input  active-high [used]
>> line   6:   "SPI0_CS1" "cd"   input   active-low [used]
>> line   7: "ECAP0_IN_PWM0_OUT" "P9_42" input active-high [used]
>> line   8: "LCD_DATA12"  "P8_35"   input  active-high [used]
>> line   9: "LCD_DATA13"  "P8_33"   input  active-high [used]
>> line  10: "LCD_DATA14"  "P8_31"   input  active-high [used]
>> line  11: "LCD_DATA15"  "P8_32"   input  active-high [used]
>> line  12: "UART1_CTSN"  "P9_20"   input  active-high [used]
>> line  13: "UART1_RTSN"  "P9_19"   input  active-high [used]
>> line  14:  "UART1_RXD"  "P9_26"   input  active-high [used]
>> line  15:  "UART1_TXD"  "P9_24"   input  active-high [used]
>> line  16: "GMII1_TXD3"   unused   input  active-high
>> line  17: "GMII1_TXD2"   unused   input  active-high
>> line  18: "USB0_DRVVBUS" unused input active-high
>> line  19: "XDMA_EVENT_INTR0" "A15" input active-high [used]
>> line  20: "XDMA_EVENT_INTR1" "P9_41" input active-high [used]
>> line  21: "GMII1_TXD1"   unused   input  active-high
>> line  22:   "GPMC_AD8"  "P8_19"   input  active-high [used]
>> line  23:   "GPMC_AD9"  "P8_13"   input  active-high [used]
>> line  24: "NC"   unused   input  active-high
>> line  25: "NC"   unused   input  active-high
>> line  26:  "GPMC_AD10"   unused   input  active-high
>> line  27:  "GPMC_AD11"   unused   input  active-high
>> line  28: "GMII1_TXD0"   unused   input  active-high
>> line  29: "RMII1_REFCLK" unused input active-high
>> line  30: "GPMC_WAIT0"  "P9_11"   input  active-high [used]
>> line  31:   "GPMC_WPN"  "P9_13"   input  active-high [used]
>> gpiochip1 - 32 lines:
>> line   0:   "GPMC_AD0"  "P8_25"   input  active-high [used]
>> line   1:   "GPMC_AD1"  "P8_24"   input  active-high [used]
>> line   2:   "GPMC_AD2"  "P8_05"   input  active-high [used]
>> line   3:   "GPMC_AD3"  "P8_06"   input  active-high [used]
>> line   4:   "GPMC_AD4"  "P8_23"   input  active-high [used]
>> line   5:   "GPMC_AD5"  "P8_22"   input  active-high [used]
>> line   6:   "GPMC_AD6"  "P8_03"   input  active-high [used]
>> line   7:   "GPMC_AD7"  "P8_04"   input  active-high [used]
>> line   8: "UART0_CTSN"   unused   input  active-high
>> line   9: "UART0_RTSN"   unused   input  active-high
>> line  10:  "UART0_RXD"   unused   input  active-high
>> line  11:  "UART0_TXD"   unused   input  active-high
>> line  12:  "GPMC_AD12"  "P8_12"   input  active-high [used]
>> line  13:  "GPMC_AD13"  "P8_11"   input  active-high [used]
>> line  14:  "GPMC_AD14"  "P8_16"   input  active-high [used]
>> line  15:  "GPMC_AD15"  "P8_15"   input  active-high [used]
>> line  16:"GPMC_A0"  "P9_15"   input  active-high [used]
>> line  17:"GPMC_A1"  "P9_23"   input  active-high [used]
>> line  18:"GPMC_A2"  "P9_14"   input  active-high [used]
>> line  19:"GPMC_A3"  "P9_16"   input  active-high [used]
>> line  20:"GPMC_A4"   un

[beagleboard] Re: Debugging SPI device

2021-01-23 Thread Yendor
How can I tell if the SPI interface is enabled?

On Wednesday, January 20, 2021 at 7:24:32 AM UTC+10 Yendor wrote:

> Hi,
> Carrying on from the SeeedStudio SenseCAP Gateway hacking form this 
> conversation (https://groups.google.com/g/beagleboard/c/Y_Zx_D2HJUA)
>
> I am now looking to get the LoRa interface working, the interface is a 
> mPCIe SPI RAK2247 
>  
> LoRa card connector.
>
> The things I think I need to find out how to do:
>
>- Identify the correct SPI bus for the connector;
>- and what GPIO drives the reset pin (PIN 22) of the connector.
>
> if anyone has any ideas on the best why to do this, please feel free to 
> share.
>
> Regards,
>
> result of gpioinfo:
> gpiochip0 - 32 lines:
> line   0:  "MDIO_DATA"   unused   input  active-high
> line   1:   "MDIO_CLK"   unused   input  active-high
> line   2:  "SPI0_SCLK"  "P9_22"   input  active-high [used]
> line   3:"SPI0_D0"  "P9_21"   input  active-high [used]
> line   4:"SPI0_D1"  "P9_18"   input  active-high [used]
> line   5:   "SPI0_CS0"  "P9_17"   input  active-high [used]
> line   6:   "SPI0_CS1" "cd"   input   active-low [used]
> line   7: "ECAP0_IN_PWM0_OUT" "P9_42" input active-high [used]
> line   8: "LCD_DATA12"  "P8_35"   input  active-high [used]
> line   9: "LCD_DATA13"  "P8_33"   input  active-high [used]
> line  10: "LCD_DATA14"  "P8_31"   input  active-high [used]
> line  11: "LCD_DATA15"  "P8_32"   input  active-high [used]
> line  12: "UART1_CTSN"  "P9_20"   input  active-high [used]
> line  13: "UART1_RTSN"  "P9_19"   input  active-high [used]
> line  14:  "UART1_RXD"  "P9_26"   input  active-high [used]
> line  15:  "UART1_TXD"  "P9_24"   input  active-high [used]
> line  16: "GMII1_TXD3"   unused   input  active-high
> line  17: "GMII1_TXD2"   unused   input  active-high
> line  18: "USB0_DRVVBUS" unused input active-high
> line  19: "XDMA_EVENT_INTR0" "A15" input active-high [used]
> line  20: "XDMA_EVENT_INTR1" "P9_41" input active-high [used]
> line  21: "GMII1_TXD1"   unused   input  active-high
> line  22:   "GPMC_AD8"  "P8_19"   input  active-high [used]
> line  23:   "GPMC_AD9"  "P8_13"   input  active-high [used]
> line  24: "NC"   unused   input  active-high
> line  25: "NC"   unused   input  active-high
> line  26:  "GPMC_AD10"   unused   input  active-high
> line  27:  "GPMC_AD11"   unused   input  active-high
> line  28: "GMII1_TXD0"   unused   input  active-high
> line  29: "RMII1_REFCLK" unused input active-high
> line  30: "GPMC_WAIT0"  "P9_11"   input  active-high [used]
> line  31:   "GPMC_WPN"  "P9_13"   input  active-high [used]
> gpiochip1 - 32 lines:
> line   0:   "GPMC_AD0"  "P8_25"   input  active-high [used]
> line   1:   "GPMC_AD1"  "P8_24"   input  active-high [used]
> line   2:   "GPMC_AD2"  "P8_05"   input  active-high [used]
> line   3:   "GPMC_AD3"  "P8_06"   input  active-high [used]
> line   4:   "GPMC_AD4"  "P8_23"   input  active-high [used]
> line   5:   "GPMC_AD5"  "P8_22"   input  active-high [used]
> line   6:   "GPMC_AD6"  "P8_03"   input  active-high [used]
> line   7:   "GPMC_AD7"  "P8_04"   input  active-high [used]
> line   8: "UART0_CTSN"   unused   input  active-high
> line   9: "UART0_RTSN"   unused   input  active-high
> line  10:  "UART0_RXD"   unused   input  active-high
> line  11:  "UART0_TXD"   unused   input  active-high
> line  12:  "GPMC_AD12"  "P8_12"   input  active-high [used]
> line  13:  "GPMC_AD13"  "P8_11"   input  active-high [used]
> line  14:  "GPMC_AD14"  "P8_16"   input  active-high [used]
> line  15:  "GPMC_AD15"  "P8_15"   input  active-high [used]
> line  16:"GPMC_A0"  "P9_15"   input  active-high [used]
> line  17:"GPMC_A1"  "P9_23"   input  active-high [used]
> line  18:"GPMC_A2"  "P9_14"   input  active-high [used]
> line  19:"GPMC_A3"  "P9_16"   input  active-high [used]
> line  20:"GPMC_A4"   unused   input  active-high
> line  21:"GPMC_A5" "beaglebone:green:usr0" output active-high 
> [used]
> line  22:"GPMC_A6" "beaglebone:green:usr1" output active-high 
> [used]
> line  23:"GPMC_A7" "beaglebone:green:usr2" output active-high 
> [used]
> line  24:"GPMC_A8" "beaglebone:green:usr3" output active-high 
> [used]
> line  25:"GPMC_A9"   unused   input  activ