Project

General

Profile

SPI bringup

Added by Nathan Olson 1 day ago

Are there any reference examples of software using SPI? I'm attempting to configure the QUP to use SPI on my carrier board.

Here's my device tree modification:

&spi12 {
    status = "okay";

    /*... SPI device config...*/
};

And here's my trust zone modification:

/*   PeriphID,         ProtocolID,               Mode,  NsOwner,       bAllowFifo, bLoad, bModExcl  */
{ QUPV3_1_SE4, QUPV3_PROTOCOL_SPI,     QUPV3_MODE_FIFO, AC_HLOS,            TRUE,  TRUE,  FALSE },

The boot crashes with the following error:

[    5.028870][  T123] cpufreq-dt cpufreq-dt: failed register driver: -17
[    5.095297][  T417] sc7280-pinctrl f100000.pinctrl: pin-48 (a90000.spi) status -22
[    5.105331][  T417] sc7280-pinctrl f100000.pinctrl: could not request pin 48 (GPIO_48) from group gpio48  on device f100000.pinctrl
[    5.105595][  T401] Internal error: synchronous external abort: 0000000096000010 [#1] PREEMPT SMP
[    5.106015][  T414] gpi a00000.dma-controller: Adding to iommu group 10
[    5.117481][  T417] geni_spi a90000.spi: Error applying setting, reverse things back
[    5.126576][  T401] Modules linked in: typec(+) qcom_stats(+) qcom_q6v5_pas(+) spi_geni_qcom(+) gpi(+) i2c_qcom_geni(+) llcc_qcom icc_bwmon(+) qcom_rproc_minidump qcom_pil_info snd_soc_lpass_wsa_macro snd_soc_lpass_rx_macro snd_soc_lpass_ô[    5.201973][  T401] CPU: 3 PID: 401 Comm: (udev-worker) Tainted: G           O       6.6.90-qli-1.5-ver.1.1-04509-gc4b8666c9a55-dirty #1
[    5.215658][  T401] Hardware name: Critical Link MitySOM-QC6490 (DT)
[    5.222737][  T401] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.231688][  T401] pc : geni_i2c_probe+0x318/0x7d4 [i2c_qcom_geni]
[    5.238691][  T401] lr : geni_i2c_probe+0x318/0x7d4 [i2c_qcom_geni]
[    5.245674][  T401] sp : ffffffc086233840
[    5.250315][  T401] x29: ffffffc086233840 x28: ffffffc086233bb0 x27: ffffffd9429e6d60
[    5.259372][  T401] x26: ffffffc086088068 x25: ffffff8083b5f810 x24: 0000000000000000
[    5.268436][  T401] x23: ffffffd9429e6d60 x22: ffffff8083b5f800 x21: ffffff8083b5f810
[    5.277498][  T401] x20: ffffff8082469080 x19: 0000000000000000 x18: ffffffd9442559b0
[    5.286565][  T401] x17: ffffffd944255998 x16: ffffffd9427b8728 x15: 00000000000002d2
[    5.295632][  T401] x14: 0000000000000000 x13: ffffff8081055400 x12: 0000000000000002
[    5.304699][  T401] x11: 0000000130503bbe x10: 0000000000000b10 x9 : ffffff8080ce6450
[    5.313768][  T401] x8 : ffffffc086233408 x7 : 0000000000000000 x6 : 0000000000000000
[    5.322838][  T401] x5 : ffffffd942a16320 x4 : ffffffd942a16364 x3 : ffffffd9429e6d60
[    5.331918][  T401] x2 : ffffffd91e131b3c x1 : ffffffc086088068 x0 : 0000000000000020
[    5.341016][  T401] Call trace:
[    5.344768][  T401]  geni_i2c_probe+0x318/0x7d4 [i2c_qcom_geni]
[    5.351372][  T401]  platform_probe+0x68/0xc8
[    5.356381][  T401]  really_probe+0x148/0x2b0
[    5.361380][  T401]  __driver_probe_device+0x78/0x12c
[    5.367088][  T401]  driver_probe_device+0x3c/0x15c
[    5.372605][  T401]  __driver_attach+0x90/0x19c
[    5.377754][  T401]  bus_for_each_dev+0x7c/0xe0
[    5.382891][  T401]  driver_attach+0x24/0x30
[    5.387746][  T401]  bus_add_driver+0xe4/0x208
[    5.392767][  T401]  driver_register+0x5c/0x124
[    5.397864][  T401]  __platform_driver_register+0x28/0x34
[    5.403842][  T401]  geni_i2c_driver_init+0x20/0x1000 [i2c_qcom_geni]
[    5.410897][  T401]  do_one_initcall+0x58/0x2e4
[    5.415971][  T401]  do_init_module+0x58/0x1e4
[    5.420942][  T401]  load_module+0x1fa0/0x207c
[    5.425897][  T401]  init_module_from_file+0x88/0xcc
[    5.431372][  T401]  __arm64_sys_finit_module+0x148/0x328
[    5.437281][  T401]  invoke_syscall+0x48/0x114
[    5.442203][  T401]  el0_svc_common.constprop.0+0xc0/0xe0
[    5.448091][  T401]  do_el0_svc+0x1c/0x28
[    5.452544][  T401]  el0_svc+0x38/0xf8
[    5.456716][  T401]  el0t_64_sync_handler+0x120/0x12c
[    5.462208][  T401]  el0t_64_sync+0x1a0/0x1a4
[    5.466975][  T401] Code: 912cf042 9101a35a aa1a03e1 940003d2 (b9400353)
[    5.474250][  T401] ---[ end trace 0000000000000000 ]---
[    5.480001][  T401] Kernel panic - not syncing: synchronous external abort: Fatal exception
[    5.489179][  T401] SMP: stopping secondary CPUs
[    5.494252][  T401] Triggering bite
[    5.498160][  T401] gh-watchdog hypervisor:qcom,gh-watchdog: Causing a QCOM Apps Watchdog bite!
[    5.507750][  T401] gh-watchdog hypervisor:qcom,gh-watchdog: vWdog-CTL: 1, vWdog-time since last pet: 1128, vWdog-expired status: 1

Any ideas?


Replies (3)

RE: SPI bringup - Added by Nathan Olson about 14 hours ago

Edit: The boot crash in unrelated and I've resolved that. However, SPI configuration still fails:

[    4.936978][  T376] sc7280-pinctrl f100000.pinctrl: request() failed for pin 48
[    4.945645][  T376] sc7280-pinctrl f100000.pinctrl: pin-48 (a90000.spi) status -22
[    4.954125][  T376] sc7280-pinctrl f100000.pinctrl: could not request pin 48 (GPIO_48) from group gpio48  on device f100000.pinctrl
[    4.967793][  T376] geni_spi a90000.spi: Error applying setting, reverse things back

My guess is that this is due to these lines in qcm6490.dtsi:

&tlmm {
    gpio-reserved-ranges = <32 2>, <48 4>;
};

There's no comment describing what this is for. Is there any hope of getting these pins enabled as SPI on my carrier board?

RE: SPI bringup - Added by Nathan Olson about 13 hours ago

The original commit message for those lines is "Add gpio-reserved-ranges for QCM6490 boards."

In mainline linux, I found the following in qcs6490-rb3gen2.dts:

&tlmm {
    gpio-reserved-ranges = <32 2>, /* ADSP */
                   <48 4>; /* NFC */

I'm not using NFC, can I remove <48 4> from the gpio-reserved-ranges? Is there anything on the MitySOM using these pins?

RE: SPI bringup - Added by Michael Williamson about 13 hours ago

Hi Nathan,

I think you can remove the NFC pins and give it a shot.

-Mike

    (1-3/3)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)