[PATCH 00/34] Integrate pre-qualified LEON3 BSP

Sebastian Huber sebastian.huber at embedded-brains.de
Wed May 31 16:30:35 UTC 2023


The register block specification were recently integrated in the RTEMS
Software Engineering manual.  Now it is time to integrate the
pre-qualified LEON3 BSP which uses the generated GRLIB header files.

The existing tests in the RTEMS test suite are basically BSP
independent. This patch set introduces BSP-specific validation tests.
These tests are disabled for other BSPs through the build system, for
example:

spec/build/testsuites/validation/bsp-sparc-leon3-gr712rc.yml
[...]
cxxflags: []
enabled-by: sparc/gr712rc
features: c cprogram
[...]

The patch set introduces new header files for GRLIB in
"bsps/include/grlib".  These header files were generated from
specification items in:

https://github.com/RTEMS/rtems-central/tree/master/spec/dev/grlib/if

The specification was created using the GRIP reference manual
(https://www.gaisler.com/products/grlib/grip.pdf) and is quite complete.
The generated header files were reviewed by the ISVV activity which
resulted in two tickets:

https://devel.rtems.org/ticket/4828

https://devel.rtems.org/ticket/4842

In the long term, the existing GRLIB header files should be replaced by
the generated header files. Using specification items for the register
blocks has the potential benefit that, in addition to the C header
files, files for C++/Rust/Python could be generated.

The main change for the sparc/gr712rc and sparc/gr740 BSPs is the
removal of the dynamic device enumeration in favor of a static
initialization.  This greatly simplifies the specification and
validation of the BSP-specific parts. It also reduces the code and data
size for applications which do not need the dynamic device enumeration.

Sebastian Huber (34):
  validation: Test sparc/leon3 BSP family
  bsps/grlib: Add generated headers
  bsps/grlib: Fix FTMCTRL - MCFG1 bit fields
  bsps/grlib: Fix GRGPIO - IRQMAP bit fields
  bsps/grlib: Fix SpaceWire RMAP - Product ID
  bsps/grlib: Expand SpaceWire port bit fields
  bsps/grlib: Fix SPWTDP register name
  validation: grlib
  bsp/leon3: Untangle interrupt controller support
  bsp/leon3: Move and simplify bsp_irq_fixup()
  bsps: Use new APBUART register block API
  bsp/leon3: Use new IRQ(A)MP register block API
  bsp/leon3: Move system control register support
  bsp/leon3: Move up-counter support
  bsp/leon3: Use new GPTIMER register block API
  bsp/leon3: Use new L2CACHE register block API
  bsp/leon3: Add LEON3_APBUART_BASE
  bsp/leon3: Add LEON3_GPTIMER_BASE
  bsp/leon3: Add LEON3_APBUART_BASE
  bsp/leon3: Add LEON3_IRQAMP_BASE
  bsp/leon3: LEON3_PLB_FREQUENCY_DEFINED_BY_GPTIMER
  bsp/leon3: Add LEON3_IRQAMP_PROBE_TIMESTAMP
  bsp/leon3: Add LEON3_HAS_ASR_22_23_UP_COUNTER
  bsp/leon3: Add LEON3_L2CACHE_BASE
  bsp/leon3: Move leon3_power_down_loop()
  bsp/leon3: Simplify fatal error handling
  bsp/leon3: Add LEON3_PROBE_ASR_22_23_UP_COUNTER
  bsp/leon3: Add LEON3_IRQAMP_EXTENDED_INTERRUPT
  bsp/leon3: Use LEON3_GPTIMER_BASE
  bsp/leon3: Enable up-counter conditionally
  bsps/sparc: Remove BSP_POWER_DOWN_AT_FATAL_HALT
  bsp/leon3: Fix group memberships
  bsp/leon3: Add specialized target hash
  bsp/leon3: Simplify shutdown

 bsps/include/grlib/ahbstat-regs.h             |  171 ++
 bsps/include/grlib/ahbtrace-regs.h            |  313 ++++
 bsps/include/grlib/apbuart-regs.h             |  281 ++++
 bsps/include/grlib/apbuart.h                  |  108 +-
 bsps/include/grlib/apbuart_termios.h          |    4 +-
 bsps/include/grlib/dsu4-regs.h                |  788 +++++++++
 bsps/include/grlib/ftmctrl-regs.h             |  322 ++++
 bsps/include/grlib/gptimer-regs.h             |  379 +++++
 bsps/include/grlib/gr1553b-regs.h             | 1393 ++++++++++++++++
 bsps/include/grlib/gr740thsens-regs.h         |  226 +++
 bsps/include/grlib/grcan-regs.h               |  722 +++++++++
 bsps/include/grlib/grclkgate-regs.h           |  212 +++
 bsps/include/grlib/grethgbit-regs.h           |  446 +++++
 bsps/include/grlib/grgpio-regs.h              |  630 +++++++
 bsps/include/grlib/grgprbank-regs.h           |  677 ++++++++
 bsps/include/grlib/grgpreg-regs.h             |  135 ++
 bsps/include/grlib/griommu-regs.h             |  878 ++++++++++
 bsps/include/grlib/grpci2-regs.h              |  875 ++++++++++
 bsps/include/grlib/grspw2-regs.h              |  587 +++++++
 bsps/include/grlib/grspwrouter-regs.h         |  890 ++++++++++
 bsps/include/grlib/irqamp-regs.h              |  874 ++++++++++
 bsps/include/grlib/irqamp.h                   |  101 ++
 bsps/include/grlib/l2cache-regs.h             |  807 +++++++++
 bsps/include/grlib/l4stat-regs.h              |  297 ++++
 bsps/include/grlib/memscrub-regs.h            |  568 +++++++
 bsps/include/grlib/mmctrl-regs.h              |  434 +++++
 bsps/include/grlib/spictrl-regs.h             |  464 ++++++
 bsps/include/grlib/spwpnp-regs.h              |  553 +++++++
 bsps/include/grlib/spwrmap-regs.h             | 1443 +++++++++++++++++
 bsps/include/grlib/spwtdp-regs.h              | 1268 +++++++++++++++
 bsps/shared/grlib/btimer/gptimer.c            |  170 +-
 bsps/shared/grlib/uart/apbuart_cons.c         |  136 +-
 bsps/shared/grlib/uart/apbuart_polled.c       |   52 +-
 bsps/shared/grlib/uart/apbuart_termios.c      |   49 +-
 bsps/sparc/include/grlib/io.h                 |  210 +++
 bsps/sparc/leon3/btimer/btimer.c              |   13 +-
 bsps/sparc/leon3/btimer/watchdog.c            |   27 +-
 bsps/sparc/leon3/clock/ckinit.c               |  233 ++-
 bsps/sparc/leon3/console/console.c            |    2 +-
 bsps/sparc/leon3/console/printk_support.c     |   43 +-
 bsps/sparc/leon3/gnatsupp/gnatsupp.c          |    2 +-
 bsps/sparc/leon3/include/bsp/irq.h            |    4 +-
 bsps/sparc/leon3/include/bsp/leon3.h          |  413 +++++
 bsps/sparc/leon3/include/leon.h               |  209 +--
 bsps/sparc/leon3/include/tm27.h               |    2 +-
 bsps/sparc/leon3/start/amba.c                 |   42 +-
 bsps/sparc/leon3/start/bspclean.c             |   52 +-
 bsps/sparc/leon3/start/bspdelay.c             |    8 +-
 bsps/sparc/leon3/start/bspsmp.c               |   25 +-
 bsps/sparc/leon3/start/bspstart.c             |    2 +-
 bsps/sparc/leon3/start/cache.c                |   74 +-
 bsps/sparc/leon3/start/cpucounter.c           |  116 +-
 bsps/sparc/leon3/start/eirq.c                 |  139 +-
 .../start/gettargethash.c}                    |   61 +-
 bsps/sparc/leon3/start/setvec.c               |    2 +-
 bsps/sparc/shared/irq/bsp_isr_handler.c       |    4 +
 bsps/sparc/shared/irq/irq-shared.c            |    4 +
 cpukit/score/cpu/sparc/syscall.S              |    2 +
 spec/build/bsps/arm/imxrt/bspimxrt1052.yml    |    2 +-
 spec/build/bsps/arm/imxrt/grp.yml             |    2 +-
 spec/build/bsps/arm/imxrt/obj-mimxrt1052.yml  |    2 +-
 .../bsps/arm/imxrt/obj-mimxrt1166-cm4.yml     |    2 +-
 .../bsps/arm/imxrt/obj-mimxrt1166-cm7.yml     |    2 +-
 spec/build/bsps/arm/imxrt/obj.yml             |    2 +-
 .../bsps/arm/imxrt/optmemocramorigin.yml      |    2 +-
 spec/build/bsps/arm/imxrt/optvariant.yml      |    2 +-
 spec/build/bsps/sparc/erc32/bsperc32.yml      |    3 -
 spec/build/bsps/sparc/erc32/optpwrdwnhlt.yml  |   16 -
 spec/build/bsps/sparc/leon2/grp.yml           |    2 -
 spec/build/bsps/sparc/leon2/obj.yml           |    1 -
 spec/build/bsps/sparc/leon2/optpwrdwnhlt.yml  |   16 -
 spec/build/bsps/sparc/leon3/grp.yml           |   18 +-
 spec/build/bsps/sparc/leon3/obj.yml           |    3 +-
 .../build/bsps/sparc/leon3/optapbuartbase.yml |   20 +
 spec/build/bsps/sparc/leon3/optasrupcnt.yml   |   17 +
 .../bsps/sparc/leon3/optasrupcntprobe.yml     |   19 +
 .../build/bsps/sparc/leon3/optgptimerbase.yml |   20 +
 spec/build/bsps/sparc/leon3/optirqampbase.yml |   19 +
 .../bsps/sparc/leon3/optirqampextirq.yml      |   19 +
 spec/build/bsps/sparc/leon3/optirqampts.yml   |   22 +
 .../build/bsps/sparc/leon3/optl2cachebase.yml |   19 +
 spec/build/bsps/sparc/leon3/optplbfreq.yml    |   21 +
 spec/build/bsps/sparc/leon3/optpwrdwnhlt.yml  |   16 -
 .../validation/bsp-sparc-leon3-gr712rc.yml    |   21 +
 ...arc-leon3-cache-snooping-disabled-boot.yml |   24 +
 ...eon3-cache-snooping-disabled-secondary.yml |   25 +
 ...l-bsp-sparc-leon3-clock-initialization.yml |   21 +
 .../fatal-bsp-sparc-leon3-shutdown.yml        |   25 +
 spec/build/testsuites/validation/grp.yml      |   12 +
 spec/build/testsuites/validation/objgrlib.yml |   16 +
 .../validation/validation-dev-0.yml           |   23 +
 .../validation/tc-bsp-sparc-leon3-gr712rc.c   |  124 ++
 .../tc-dev-grlib-apbuart-inbyte-nonblocking.c |  348 ++++
 testsuites/validation/tc-dev-grlib-io.c       |  295 ++++
 .../tc-dev-grlib-irqamp-get-timestamp.c       |  304 ++++
 .../tc-fatal-bsp-sparc-leon3-shutdown.c       |  211 +++
 ...sparc-leon3-cache-snooping-disabled-boot.c |  175 ++
 ...sparc-leon3-cache-snooping-disabled-boot.h |   84 +
 ...-leon3-cache-snooping-disabled-secondary.c |  176 ++
 ...-leon3-cache-snooping-disabled-secondary.h |   84 +
 ...tal-bsp-sparc-leon3-clock-initialization.c |  190 +++
 ...tal-bsp-sparc-leon3-clock-initialization.h |   84 +
 .../validation/ts-bsp-sparc-leon3-gr712rc.c   |   64 +-
 ...sparc-leon3-cache-snooping-disabled-boot.c |   79 +
 ...-leon3-cache-snooping-disabled-secondary.c |   82 +
 ...tal-bsp-sparc-leon3-clock-initialization.c |   79 +
 ...-fatal-bsp-sparc-leon3-shutdown-response.c |   94 ++
 .../ts-fatal-bsp-sparc-leon3-shutdown.c       |  170 ++
 testsuites/validation/ts-validation-dev-0.c   |   72 +
 109 files changed, 21288 insertions(+), 803 deletions(-)
 create mode 100644 bsps/include/grlib/ahbstat-regs.h
 create mode 100644 bsps/include/grlib/ahbtrace-regs.h
 create mode 100644 bsps/include/grlib/apbuart-regs.h
 create mode 100644 bsps/include/grlib/dsu4-regs.h
 create mode 100644 bsps/include/grlib/ftmctrl-regs.h
 create mode 100644 bsps/include/grlib/gptimer-regs.h
 create mode 100644 bsps/include/grlib/gr1553b-regs.h
 create mode 100644 bsps/include/grlib/gr740thsens-regs.h
 create mode 100644 bsps/include/grlib/grcan-regs.h
 create mode 100644 bsps/include/grlib/grclkgate-regs.h
 create mode 100644 bsps/include/grlib/grethgbit-regs.h
 create mode 100644 bsps/include/grlib/grgpio-regs.h
 create mode 100644 bsps/include/grlib/grgprbank-regs.h
 create mode 100644 bsps/include/grlib/grgpreg-regs.h
 create mode 100644 bsps/include/grlib/griommu-regs.h
 create mode 100644 bsps/include/grlib/grpci2-regs.h
 create mode 100644 bsps/include/grlib/grspw2-regs.h
 create mode 100644 bsps/include/grlib/grspwrouter-regs.h
 create mode 100644 bsps/include/grlib/irqamp-regs.h
 create mode 100644 bsps/include/grlib/irqamp.h
 create mode 100644 bsps/include/grlib/l2cache-regs.h
 create mode 100644 bsps/include/grlib/l4stat-regs.h
 create mode 100644 bsps/include/grlib/memscrub-regs.h
 create mode 100644 bsps/include/grlib/mmctrl-regs.h
 create mode 100644 bsps/include/grlib/spictrl-regs.h
 create mode 100644 bsps/include/grlib/spwpnp-regs.h
 create mode 100644 bsps/include/grlib/spwrmap-regs.h
 create mode 100644 bsps/include/grlib/spwtdp-regs.h
 create mode 100644 bsps/sparc/include/grlib/io.h
 create mode 100644 bsps/sparc/leon3/include/bsp/leon3.h
 rename bsps/sparc/{shared/start/bsp_fatal_halt.c => leon3/start/gettargethash.c} (58%)
 delete mode 100644 spec/build/bsps/sparc/erc32/optpwrdwnhlt.yml
 delete mode 100644 spec/build/bsps/sparc/leon2/optpwrdwnhlt.yml
 create mode 100644 spec/build/bsps/sparc/leon3/optapbuartbase.yml
 create mode 100644 spec/build/bsps/sparc/leon3/optasrupcnt.yml
 create mode 100644 spec/build/bsps/sparc/leon3/optasrupcntprobe.yml
 create mode 100644 spec/build/bsps/sparc/leon3/optgptimerbase.yml
 create mode 100644 spec/build/bsps/sparc/leon3/optirqampbase.yml
 create mode 100644 spec/build/bsps/sparc/leon3/optirqampextirq.yml
 create mode 100644 spec/build/bsps/sparc/leon3/optirqampts.yml
 create mode 100644 spec/build/bsps/sparc/leon3/optl2cachebase.yml
 create mode 100644 spec/build/bsps/sparc/leon3/optplbfreq.yml
 delete mode 100644 spec/build/bsps/sparc/leon3/optpwrdwnhlt.yml
 create mode 100644 spec/build/testsuites/validation/bsp-sparc-leon3-gr712rc.yml
 create mode 100644 spec/build/testsuites/validation/fatal-bsp-sparc-leon3-cache-snooping-disabled-boot.yml
 create mode 100644 spec/build/testsuites/validation/fatal-bsp-sparc-leon3-cache-snooping-disabled-secondary.yml
 create mode 100644 spec/build/testsuites/validation/fatal-bsp-sparc-leon3-clock-initialization.yml
 create mode 100644 spec/build/testsuites/validation/fatal-bsp-sparc-leon3-shutdown.yml
 create mode 100644 spec/build/testsuites/validation/objgrlib.yml
 create mode 100644 spec/build/testsuites/validation/validation-dev-0.yml
 create mode 100644 testsuites/validation/tc-bsp-sparc-leon3-gr712rc.c
 create mode 100644 testsuites/validation/tc-dev-grlib-apbuart-inbyte-nonblocking.c
 create mode 100644 testsuites/validation/tc-dev-grlib-io.c
 create mode 100644 testsuites/validation/tc-dev-grlib-irqamp-get-timestamp.c
 create mode 100644 testsuites/validation/tc-fatal-bsp-sparc-leon3-shutdown.c
 create mode 100644 testsuites/validation/tr-fatal-bsp-sparc-leon3-cache-snooping-disabled-boot.c
 create mode 100644 testsuites/validation/tr-fatal-bsp-sparc-leon3-cache-snooping-disabled-boot.h
 create mode 100644 testsuites/validation/tr-fatal-bsp-sparc-leon3-cache-snooping-disabled-secondary.c
 create mode 100644 testsuites/validation/tr-fatal-bsp-sparc-leon3-cache-snooping-disabled-secondary.h
 create mode 100644 testsuites/validation/tr-fatal-bsp-sparc-leon3-clock-initialization.c
 create mode 100644 testsuites/validation/tr-fatal-bsp-sparc-leon3-clock-initialization.h
 rename bsps/sparc/leon3/start/bsp_fatal_halt.c => testsuites/validation/ts-bsp-sparc-leon3-gr712rc.c (55%)
 create mode 100644 testsuites/validation/ts-fatal-bsp-sparc-leon3-cache-snooping-disabled-boot.c
 create mode 100644 testsuites/validation/ts-fatal-bsp-sparc-leon3-cache-snooping-disabled-secondary.c
 create mode 100644 testsuites/validation/ts-fatal-bsp-sparc-leon3-clock-initialization.c
 create mode 100644 testsuites/validation/ts-fatal-bsp-sparc-leon3-shutdown-response.c
 create mode 100644 testsuites/validation/ts-fatal-bsp-sparc-leon3-shutdown.c
 create mode 100644 testsuites/validation/ts-validation-dev-0.c

-- 
2.35.3



More information about the devel mailing list