[riot-commits] [RIOT-OS/RIOT] a51d16: cpu/sam0: use GCLK ID instead of bitmask

Dylan Laduranty noreply at github.com
Wed Feb 5 09:29:51 CET 2020


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: a51d167a430a53fd3a330244567ca8eca769d74f
      https://github.com/RIOT-OS/RIOT/commit/a51d167a430a53fd3a330244567ca8eca769d74f
  Author: Benjamin Valentin <benjamin.valentin at ml-pa.com>
  Date:   2020-02-04 (Tue, 04 Feb 2020)

  Changed paths:
    M boards/arduino-mkrwan1300/include/periph_conf.h
    M boards/arduino-zero/include/periph_conf.h
    M boards/common/arduino-mkr/include/periph_conf.h
    M boards/common/arduino-mkr/include/periph_conf_common.h
    M boards/common/saml1x/include/periph_conf.h
    M boards/common/sodaq/include/cfg_spi_default.h
    M boards/common/sodaq/include/cfg_timer_default.h
    M boards/feather-m0/include/periph_conf.h
    M boards/hamilton/include/periph_conf.h
    M boards/samd21-xpro/include/periph_conf.h
    M boards/same54-xpro/include/periph_conf.h
    M boards/saml21-xpro/include/periph_conf.h
    M boards/samr21-xpro/include/periph_conf.h
    M boards/samr30-xpro/include/periph_conf.h
    M boards/samr34-xpro/include/periph_conf.h
    M boards/sensebox_samd21/include/periph_conf.h
    M boards/sodaq-autonomo/include/periph_conf.h
    M boards/sodaq-explorer/include/periph_conf.h
    M boards/sodaq-one/include/periph_conf.h
    M boards/sodaq-sara-aff/include/periph_conf.h
    M cpu/sam0_common/include/periph_cpu_common.h
    M cpu/sam0_common/periph/i2c.c
    M cpu/sam0_common/periph/timer.c

  Log Message:
  -----------
  cpu/sam0: use GCLK ID instead of bitmask

To simplify board definitions and for unification between samd2x and
newer models, don't use the GCLK bitmask in board definitions.
Instead use the GCLK index and generate the bitmask when needed.


  Commit: 1496149bbaa27316fb7ce558c946b005ceeb6c6a
      https://github.com/RIOT-OS/RIOT/commit/1496149bbaa27316fb7ce558c946b005ceeb6c6a
  Author: Benjamin Valentin <benjamin.valentin at ml-pa.com>
  Date:   2020-02-04 (Tue, 04 Feb 2020)

  Changed paths:
    M boards/arduino-zero/include/periph_conf.h
    M boards/common/arduino-mkr/include/periph_conf_common.h
    M boards/common/sodaq/include/cfg_usbdev_default.h
    M boards/feather-m0/include/periph_conf.h
    M boards/same54-xpro/include/periph_conf.h
    M boards/samr21-xpro/include/periph_conf.h
    M boards/sensebox_samd21/include/periph_conf.h
    M cpu/sam0_common/include/periph_cpu_common.h
    M cpu/sam0_common/periph/i2c.c
    M cpu/sam0_common/periph/spi.c
    M cpu/sam0_common/periph/timer.c
    M cpu/sam0_common/periph/uart.c
    M cpu/sam0_common/periph/usbdev.c
    M cpu/samd21/cpu.c
    M cpu/samd5x/cpu.c
    M cpu/saml1x/cpu.c
    M cpu/saml21/cpu.c

  Log Message:
  -----------
  cpu/sam0: don't hard-code peripheral clocks

Instead of hard-coding the peripheral clocks to CLOCK_CORECLOCK
introduce helper functions to return the frequency of the individual
GCLKs and use those for baud-rate calculations.

This requires the GCLK to be part of the peripheral's config struct.
While this is already the case for most peripherals, this also adds
it for those where it wasn't used before.

As it defaults to 0 (CLOCK_CORECLOCK) no change is to be expected.


  Commit: 4fbca251bc6f1996c1f6bfad5a5264b029639d2e
      https://github.com/RIOT-OS/RIOT/commit/4fbca251bc6f1996c1f6bfad5a5264b029639d2e
  Author: Benjamin Valentin <benjamin.valentin at ml-pa.com>
  Date:   2020-02-04 (Tue, 04 Feb 2020)

  Changed paths:
    M boards/same54-xpro/include/periph_conf.h

  Log Message:
  -----------
  boards/same54-xpro: use 48 MHz GCLK6 for I2C

We can't run I2C off the 120 MHz main clock as the availiable dividers are too small.
Use the 48 MHz GCLK 6 instead which offers an appropriate frequency.

fixes #12037


  Commit: df33ffd0d38c4a26cac6b85d651604a44a916992
      https://github.com/RIOT-OS/RIOT/commit/df33ffd0d38c4a26cac6b85d651604a44a916992
  Author: Benjamin Valentin <benjamin.valentin at ml-pa.com>
  Date:   2020-02-04 (Tue, 04 Feb 2020)

  Changed paths:
    M cpu/sam0_common/periph/rtc.c
    M cpu/samd21/cpu.c

  Log Message:
  -----------
  cpu/samd21: only configure one 32kHz GCLK

Use the same 32 kHz GCLK to feed the PLL and the RTT, etc.


  Commit: 38b6ee56f3498ee557f272a24ad1edc5263af600
      https://github.com/RIOT-OS/RIOT/commit/38b6ee56f3498ee557f272a24ad1edc5263af600
  Author: Benjamin Valentin <benjamin.valentin at ml-pa.com>
  Date:   2020-02-04 (Tue, 04 Feb 2020)

  Changed paths:
    M cpu/sam0_common/periph/rtc.c
    M cpu/sam0_common/periph/rtt.c
    M cpu/sam0_common/periph/wdt.c
    M cpu/samd21/cpu.c
    M cpu/samd21/include/periph_cpu.h
    M cpu/samd5x/cpu.c
    M cpu/samd5x/include/periph_cpu.h
    M cpu/saml1x/cpu.c
    M cpu/saml1x/include/periph_cpu.h
    M cpu/saml21/cpu.c
    M cpu/saml21/include/periph_cpu.h

  Log Message:
  -----------
  cpu/sam0: use defines for GCLK IDs

Give the clocks explicit names to better identify their meaning.


  Commit: c4e0ed4b7991683f6dfd25fd2905dcc43e0d371e
      https://github.com/RIOT-OS/RIOT/commit/c4e0ed4b7991683f6dfd25fd2905dcc43e0d371e
  Author: Benjamin Valentin <benjamin.valentin at ml-pa.com>
  Date:   2020-02-04 (Tue, 04 Feb 2020)

  Changed paths:
    M boards/arduino-mkrwan1300/include/periph_conf.h
    M boards/arduino-zero/include/periph_conf.h
    M boards/common/arduino-mkr/include/periph_conf.h
    M boards/common/arduino-mkr/include/periph_conf_common.h
    M boards/common/saml1x/include/periph_conf.h
    M boards/common/sodaq/include/cfg_spi_default.h
    M boards/common/sodaq/include/cfg_timer_default.h
    M boards/common/sodaq/include/cfg_usbdev_default.h
    M boards/feather-m0/include/periph_conf.h
    M boards/hamilton/include/periph_conf.h
    M boards/samd21-xpro/include/periph_conf.h
    M boards/same54-xpro/include/periph_conf.h
    M boards/saml21-xpro/include/periph_conf.h
    M boards/samr21-xpro/include/periph_conf.h
    M boards/samr30-xpro/include/periph_conf.h
    M boards/samr34-xpro/include/periph_conf.h
    M boards/sensebox_samd21/include/periph_conf.h
    M boards/sodaq-autonomo/include/periph_conf.h
    M boards/sodaq-explorer/include/periph_conf.h
    M boards/sodaq-one/include/periph_conf.h
    M boards/sodaq-sara-aff/include/periph_conf.h

  Log Message:
  -----------
  boards: use explicit GCLK_SRC defines


  Commit: 83604db37bbec94d43a2a1172e560bfae9ed5214
      https://github.com/RIOT-OS/RIOT/commit/83604db37bbec94d43a2a1172e560bfae9ed5214
  Author: Dylan Laduranty <dylan.laduranty at mesotic.com>
  Date:   2020-02-05 (Wed, 05 Feb 2020)

  Changed paths:
    M boards/arduino-mkrwan1300/include/periph_conf.h
    M boards/arduino-zero/include/periph_conf.h
    M boards/common/arduino-mkr/include/periph_conf.h
    M boards/common/arduino-mkr/include/periph_conf_common.h
    M boards/common/saml1x/include/periph_conf.h
    M boards/common/sodaq/include/cfg_spi_default.h
    M boards/common/sodaq/include/cfg_timer_default.h
    M boards/common/sodaq/include/cfg_usbdev_default.h
    M boards/feather-m0/include/periph_conf.h
    M boards/hamilton/include/periph_conf.h
    M boards/samd21-xpro/include/periph_conf.h
    M boards/same54-xpro/include/periph_conf.h
    M boards/saml21-xpro/include/periph_conf.h
    M boards/samr21-xpro/include/periph_conf.h
    M boards/samr30-xpro/include/periph_conf.h
    M boards/samr34-xpro/include/periph_conf.h
    M boards/sensebox_samd21/include/periph_conf.h
    M boards/sodaq-autonomo/include/periph_conf.h
    M boards/sodaq-explorer/include/periph_conf.h
    M boards/sodaq-one/include/periph_conf.h
    M boards/sodaq-sara-aff/include/periph_conf.h
    M cpu/sam0_common/include/periph_cpu_common.h
    M cpu/sam0_common/periph/i2c.c
    M cpu/sam0_common/periph/rtc.c
    M cpu/sam0_common/periph/rtt.c
    M cpu/sam0_common/periph/spi.c
    M cpu/sam0_common/periph/timer.c
    M cpu/sam0_common/periph/uart.c
    M cpu/sam0_common/periph/usbdev.c
    M cpu/sam0_common/periph/wdt.c
    M cpu/samd21/cpu.c
    M cpu/samd21/include/periph_cpu.h
    M cpu/samd5x/cpu.c
    M cpu/samd5x/include/periph_cpu.h
    M cpu/saml1x/cpu.c
    M cpu/saml1x/include/periph_cpu.h
    M cpu/saml21/cpu.c
    M cpu/saml21/include/periph_cpu.h

  Log Message:
  -----------
  Merge pull request #12969 from benpicco/sam0-gclk

cpu/sam0: provide interface to query GCLK frequency


Compare: https://github.com/RIOT-OS/RIOT/compare/11d7396e3856...83604db37bbe


More information about the commits mailing list