SK-AM62B-P1: AM62 SPIDEV clock log problem?

Part Number: SK-AM62B-P1

Tool/software:

Champs:.

 

What is the 16666666 Hz max meaning in the below log?

BR Rio

  18.687705] omap2_mcspi 20100000.spi: registered master spi1

[   18.692298] spi spi1.0: setup: speed 24000000, sample leading edge, clk normal

[   18.692337] spi spi1.0: setup mode 0, 8 bits/w, 16666666 Hz max --> 0

[   18.692838] lan865x spi1.0: setup: speed 24000000, sample leading edge, clk normal

[   18.692858] spi_master spi1: will run message pump with realtime priority

[   18.741084] lan865x spi1.0: setup mode 0, 8 bits/w, 16666666 Hz max --> 0

  • Hi Rio,

    if you search for this message in the Kernel source...

    [   18.692337] spi spi1.0: setup mode 0, 8 bits/w, 16666666 Hz max --> 0

    ...like this...

    a0797059@jiji:~/git/linux (ti-linux-6.6.y)
    $ git grep -C 10 'setup mode.*max'
    drivers/spi/spi.c-
    drivers/spi/spi.c-      mutex_unlock(&spi->controller->io_mutex);
    drivers/spi/spi.c-
    drivers/spi/spi.c-      if (spi->rt && !spi->controller->rt) {
    drivers/spi/spi.c-              spi->controller->rt = true;
    drivers/spi/spi.c-              spi_set_thread_rt(spi->controller);
    drivers/spi/spi.c-      }
    drivers/spi/spi.c-
    drivers/spi/spi.c-      trace_spi_setup(spi, status);
    drivers/spi/spi.c-
    drivers/spi/spi.c:      dev_dbg(&spi->dev, "setup mode %lu, %s%s%s%s%u bits/w, %u Hz max --> %d\n",
    drivers/spi/spi.c-                      spi->mode & SPI_MODE_X_MASK,
    drivers/spi/spi.c-                      (spi->mode & SPI_CS_HIGH) ? "cs_high, " : "",
    drivers/spi/spi.c-                      (spi->mode & SPI_LSB_FIRST) ? "lsb, " : "",
    drivers/spi/spi.c-                      (spi->mode & SPI_3WIRE) ? "3wire, " : "",
    drivers/spi/spi.c-                      (spi->mode & SPI_LOOP) ? "loopback, " : "",
    drivers/spi/spi.c-                      spi->bits_per_word, spi->max_speed_hz,
    drivers/spi/spi.c-                      status);
    drivers/spi/spi.c-
    drivers/spi/spi.c-      return status;
    drivers/spi/spi.c-}
    

    ...you see that the '--> 0' means the status/return value of an operation was zero, which in the Linux kernel world means no error.

    However this being said, are you really trying to set the SPI frequency to 166MHz?? Note that 50MHz is the datasheet limit I think; don't go higher than that (and to get to real 50MHz you need to set the SPI module input clock frequency from 166MHz to 200MHz due to the integer clock dividers implemented in HW.

    Regards, Andreas

  • However this being said, are you really trying to set the SPI frequency to 166MHz??

    Never mind, I see it's actually 16.6MHz, not 166MHz. So that will be ok.

    Regards, Andreas