[PATCH rtems v2 2/7] bsps/imx: Move imx-gpio to arm/shared

2020-11-18 Thread Christian Mauderer
Update #4180
---
 bsps/arm/imx/headers.am | 5 -
 bsps/arm/shared/headers.am  | 5 +
 bsps/arm/{imx => shared}/include/bsp/imx-gpio.h | 0
 bsps/arm/{imx/gpio => shared/pins}/imx-gpio.c   | 0
 c/src/lib/libbsp/arm/imx/Makefile.am| 2 +-
 spec/build/bsps/arm/imx/bspimx.yml  | 4 ++--
 6 files changed, 8 insertions(+), 8 deletions(-)
 rename bsps/arm/{imx => shared}/include/bsp/imx-gpio.h (100%)
 rename bsps/arm/{imx/gpio => shared/pins}/imx-gpio.c (100%)

diff --git a/bsps/arm/imx/headers.am b/bsps/arm/imx/headers.am
index e7a2418dea..4db8035c38 100644
--- a/bsps/arm/imx/headers.am
+++ b/bsps/arm/imx/headers.am
@@ -17,9 +17,4 @@ include_arm_freescale_imx_HEADERS += 
../../../../../../bsps/arm/imx/include/arm/
 
 include_bspdir = $(includedir)/bsp
 include_bsp_HEADERS =
-include_bsp_HEADERS += ../../../../../../bsps/arm/imx/include/bsp/imx-gpio.h
 include_bsp_HEADERS += ../../../../../../bsps/arm/imx/include/bsp/irq.h
-
-include_dev_clockdir = $(includedir)/dev/clock
-include_dev_clock_HEADERS =
-include_dev_clock_HEADERS += 
../../../../../../bsps/include/dev/clock/arm-generic-timer.h
diff --git a/bsps/arm/shared/headers.am b/bsps/arm/shared/headers.am
index 4fd7238f81..34474400ec 100644
--- a/bsps/arm/shared/headers.am
+++ b/bsps/arm/shared/headers.am
@@ -4,3 +4,8 @@ include_arm_freescale_imxdir = $(includedir)/arm/freescale/imx
 include_arm_freescale_imx_HEADERS =
 include_arm_freescale_imx_HEADERS += 
../../../../../../bsps/arm/shared/include/arm/freescale/imx/imx_iomuxreg.h
 include_arm_freescale_imx_HEADERS += 
../../../../../../bsps/arm/shared/include/arm/freescale/imx/imx_iomuxvar.h
+
+include_bspdir = $(includedir)/bsp
+include_bsp_HEADERS =
+include_bsp_HEADERS += ../../../../../../bsps/arm/shared/include/bsp/imx-gpio.h
+include_bsp_HEADERS += 
../../../../../../bsps/arm/shared/include/bsp/imx-iomux.h
diff --git a/bsps/arm/imx/include/bsp/imx-gpio.h 
b/bsps/arm/shared/include/bsp/imx-gpio.h
similarity index 100%
rename from bsps/arm/imx/include/bsp/imx-gpio.h
rename to bsps/arm/shared/include/bsp/imx-gpio.h
diff --git a/bsps/arm/imx/gpio/imx-gpio.c b/bsps/arm/shared/pins/imx-gpio.c
similarity index 100%
rename from bsps/arm/imx/gpio/imx-gpio.c
rename to bsps/arm/shared/pins/imx-gpio.c
diff --git a/c/src/lib/libbsp/arm/imx/Makefile.am 
b/c/src/lib/libbsp/arm/imx/Makefile.am
index 80871a286c..c9537a773d 100644
--- a/c/src/lib/libbsp/arm/imx/Makefile.am
+++ b/c/src/lib/libbsp/arm/imx/Makefile.am
@@ -66,7 +66,7 @@ librtemsbsp_a_SOURCES += 
../../../../../../bsps/arm/shared/cache/cache-cp15.c
 librtemsbsp_a_SOURCES += 
../../../../../../bsps/arm/shared/cache/cache-v7ar-disable-data.S
 
 # GPIO
-librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/imx/gpio/imx-gpio.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/pins/imx-gpio.c
 
 # I2C
 librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/imx/i2c/imx-i2c.c
diff --git a/spec/build/bsps/arm/imx/bspimx.yml 
b/spec/build/bsps/arm/imx/bspimx.yml
index 442c631b3a..6b3cfdbb2e 100644
--- a/spec/build/bsps/arm/imx/bspimx.yml
+++ b/spec/build/bsps/arm/imx/bspimx.yml
@@ -28,7 +28,7 @@ install:
   - bsps/arm/imx/include/arm/freescale/imx/imx_wdogreg.h
 - destination: ${BSP_INCLUDEDIR}/bsp
   source:
-  - bsps/arm/imx/include/bsp/imx-gpio.h
+  - bsps/arm/shared/include/bsp/imx-gpio.h
   - bsps/arm/imx/include/bsp/irq.h
   - bsps/arm/shared/include/bsp/imx-iomux.h
 - destination: ${BSP_INCLUDEDIR}/dev/clock
@@ -83,7 +83,7 @@ links:
   uid: ../../bspopts
 source:
 - bsps/arm/imx/console/console-config.c
-- bsps/arm/imx/gpio/imx-gpio.c
+- bsps/arm/shared/pins/imx-gpio.c
 - bsps/arm/imx/i2c/imx-i2c.c
 - bsps/arm/imx/spi/imx-ecspi.c
 - bsps/arm/imx/start/bspreset.c
-- 
2.26.2

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH rtems v2 3/7] cpu/armv7m: Add table based init for ARMV7M_MPU

2020-11-18 Thread Christian Mauderer
Modify the MPU functions of the stm32h7 BSP to be table based and
available for all ARMV7M BSPs.

Update #4180
---
 bsps/arm/stm32h7/start/bspstarthooks.c| 168 ++
 .../cpu/arm/include/rtems/score/armv7m.h  | 100 +++
 2 files changed, 150 insertions(+), 118 deletions(-)

diff --git a/bsps/arm/stm32h7/start/bspstarthooks.c 
b/bsps/arm/stm32h7/start/bspstarthooks.c
index 565bd6876a..41c510aa4c 100644
--- a/bsps/arm/stm32h7/start/bspstarthooks.c
+++ b/bsps/arm/stm32h7/start/bspstarthooks.c
@@ -35,6 +35,52 @@
 
 #include 
 
+const ARMV7M_MPU_Region_Config
+  stm32h7_start_config_mpu_region [] = {
+{
+  .begin = stm32h7_memory_sram_axi_begin,
+  .end = stm32h7_memory_sram_axi_end,
+  .flags = ARMV7M_MPU_RASR_XN
+| ARMV7M_MPU_RASR_AP(0x3)
+| ARMV7M_MPU_RASR_TEX(0x1) | ARMV7M_MPU_RASR_C | ARMV7M_MPU_RASR_B
+| ARMV7M_MPU_RASR_ENABLE,
+}, {
+  .begin = stm32h7_memory_sdram_1_begin,
+  .end = stm32h7_memory_sdram_1_end,
+  .flags = ARMV7M_MPU_RASR_XN
+| ARMV7M_MPU_RASR_AP(0x3)
+| ARMV7M_MPU_RASR_TEX(0x1) | ARMV7M_MPU_RASR_C | ARMV7M_MPU_RASR_B
+| ARMV7M_MPU_RASR_ENABLE,
+}, {
+  .begin = bsp_section_start_begin,
+  .end = bsp_section_text_end,
+  .flags = ARMV7M_MPU_RASR_AP(0x5)
+| ARMV7M_MPU_RASR_TEX(0x1) | ARMV7M_MPU_RASR_C | ARMV7M_MPU_RASR_B
+| ARMV7M_MPU_RASR_ENABLE,
+}, {
+  .begin = bsp_section_rodata_begin,
+  .end = bsp_section_rodata_end,
+  .flags = ARMV7M_MPU_RASR_XN
+| ARMV7M_MPU_RASR_AP(0x5)
+| ARMV7M_MPU_RASR_TEX(0x1) | ARMV7M_MPU_RASR_C | ARMV7M_MPU_RASR_B
+| ARMV7M_MPU_RASR_ENABLE,
+}, {
+  .begin = bsp_section_nocache_begin,
+  .end = bsp_section_nocachenoload_end,
+  .flags = ARMV7M_MPU_RASR_XN
+| ARMV7M_MPU_RASR_AP(0x3)
+| ARMV7M_MPU_RASR_TEX(0x2)
+| ARMV7M_MPU_RASR_ENABLE,
+}, {
+  .begin = stm32h7_memory_null_begin,
+  .end = stm32h7_memory_null_end,
+  .flags = ARMV7M_MPU_RASR_XN | ARMV7M_MPU_RASR_ENABLE,
+}
+  };
+
+const size_t stm32h7_start_config_mpu_region_count =
+  RTEMS_ARRAY_SIZE(stm32h7_start_config_mpu_region);
+
 void HAL_MspInit(void)
 {
   __HAL_RCC_SYSCFG_CLK_ENABLE();
@@ -83,123 +129,6 @@ static void init_peripheral_clocks(void)
   }
 }
 
-static uint32_t get_region_size(uintptr_t size)
-{
-  if ((size & (size - 1)) == 0) {
-return ARMV7M_MPU_RASR_SIZE(30 - __builtin_clz(size));
-  } else {
-return ARMV7M_MPU_RASR_SIZE(31 - __builtin_clz(size));
-  }
-}
-
-static void set_region(
-  volatile ARMV7M_MPU *mpu,
-  uint32_t region,
-  uint32_t rasr,
-  const void *begin,
-  const void *end
-)
-{
-  uintptr_t size;
-  uint32_t rbar;
-
-  RTEMS_OBFUSCATE_VARIABLE(begin);
-  RTEMS_OBFUSCATE_VARIABLE(end);
-  size = (uintptr_t) end - (uintptr_t) begin;
-
-  if ( size > 0 ) {
-rbar = (uintptr_t) begin | region | ARMV7M_MPU_RBAR_VALID;
-rasr |= get_region_size(size);
-  } else {
-rbar = region;
-rasr = 0;
-  }
-
-  mpu->rbar = rbar;
-  mpu->rasr = rasr;
-}
-
-static void init_mpu(void)
-{
-  volatile ARMV7M_MPU *mpu;
-  volatile ARMV7M_SCB *scb;
-  uint32_t region_count;
-  uint32_t region;
-
-  mpu = _ARMV7M_MPU;
-  scb = _ARMV7M_SCB;
-
-  region_count = ARMV7M_MPU_TYPE_DREGION_GET(mpu->type);
-
-  for (region = 0; region < region_count; ++region) {
-mpu->rbar = ARMV7M_MPU_RBAR_VALID | region;
-mpu->rasr = 0;
-  }
-
-  set_region(
-mpu,
-0,
-ARMV7M_MPU_RASR_XN
-  | ARMV7M_MPU_RASR_AP(0x3)
-  | ARMV7M_MPU_RASR_TEX(0x1) | ARMV7M_MPU_RASR_C | ARMV7M_MPU_RASR_B
-  | ARMV7M_MPU_RASR_ENABLE,
-stm32h7_memory_sram_axi_begin,
-stm32h7_memory_sram_axi_end
-  );
-  set_region(
-mpu,
-1,
-ARMV7M_MPU_RASR_XN
-  | ARMV7M_MPU_RASR_AP(0x3)
-  | ARMV7M_MPU_RASR_TEX(0x1) | ARMV7M_MPU_RASR_C | ARMV7M_MPU_RASR_B
-  | ARMV7M_MPU_RASR_ENABLE,
-stm32h7_memory_sdram_1_begin,
-stm32h7_memory_sdram_1_end
-  );
-  set_region(
-mpu,
-2,
-ARMV7M_MPU_RASR_AP(0x5)
-  | ARMV7M_MPU_RASR_TEX(0x1) | ARMV7M_MPU_RASR_C | ARMV7M_MPU_RASR_B
-  | ARMV7M_MPU_RASR_ENABLE,
-bsp_section_start_begin,
-bsp_section_text_end
-  );
-  set_region(
-mpu,
-3,
-ARMV7M_MPU_RASR_XN
-  | ARMV7M_MPU_RASR_AP(0x5)
-  | ARMV7M_MPU_RASR_TEX(0x1) | ARMV7M_MPU_RASR_C | ARMV7M_MPU_RASR_B
-  | ARMV7M_MPU_RASR_ENABLE,
-bsp_section_rodata_begin,
-bsp_section_rodata_end
-  );
-  set_region(
-mpu,
-4,
-ARMV7M_MPU_RASR_XN
-  | ARMV7M_MPU_RASR_AP(0x3)
-  | ARMV7M_MPU_RASR_TEX(0x2)
-  | ARMV7M_MPU_RASR_ENABLE,
-bsp_section_nocache_begin,
-bsp_section_nocachenoload_end
-  );
-  set_region(
-mpu,
-region - 1,
-ARMV7M_MPU_RASR_XN | ARMV7M_MPU_RASR_ENABLE,
-stm32h7_memory_null_begin,
-stm32h7_memory_null_end
-  );
-
-  mpu->ctrl = ARMV7M_MPU_CTRL_ENABLE | ARMV7M_MPU_CTRL_PRIVDEFENA;
-  scb->shcsr |= ARMV7M_SCB_SHCS

[PATCH rtems v2 1/7] bsps/imx: Move imx_iomux to arm/shared

2020-11-18 Thread Christian Mauderer
Update #4180
---
 bsps/arm/imx/headers.am   |  2 -
 bsps/arm/imx/include/bsp.h|  2 -
 bsps/arm/imx/spi/imx-ecspi.c  |  1 +
 bsps/arm/shared/headers.am|  6 +++
 .../include/arm/freescale/imx/imx_iomuxreg.h  |  0
 .../include/arm/freescale/imx/imx_iomuxvar.h  |  0
 bsps/arm/shared/include/bsp/imx-iomux.h   | 49 +++
 .../{imx/start => shared/pins}/imx_iomux.c|  0
 c/src/lib/libbsp/arm/imx/Makefile.am  |  2 +-
 spec/build/bsps/arm/imx/bspimx.yml| 10 ++--
 10 files changed, 63 insertions(+), 9 deletions(-)
 create mode 100644 bsps/arm/shared/headers.am
 rename bsps/arm/{imx => shared}/include/arm/freescale/imx/imx_iomuxreg.h (100%)
 rename bsps/arm/{imx => shared}/include/arm/freescale/imx/imx_iomuxvar.h (100%)
 create mode 100644 bsps/arm/shared/include/bsp/imx-iomux.h
 rename bsps/arm/{imx/start => shared/pins}/imx_iomux.c (100%)

diff --git a/bsps/arm/imx/headers.am b/bsps/arm/imx/headers.am
index 9863f34300..e7a2418dea 100644
--- a/bsps/arm/imx/headers.am
+++ b/bsps/arm/imx/headers.am
@@ -11,8 +11,6 @@ include_arm_freescale_imx_HEADERS += 
../../../../../../bsps/arm/imx/include/arm/
 include_arm_freescale_imx_HEADERS += 
../../../../../../bsps/arm/imx/include/arm/freescale/imx/imx_ecspireg.h
 include_arm_freescale_imx_HEADERS += 
../../../../../../bsps/arm/imx/include/arm/freescale/imx/imx_gpcreg.h
 include_arm_freescale_imx_HEADERS += 
../../../../../../bsps/arm/imx/include/arm/freescale/imx/imx_i2creg.h
-include_arm_freescale_imx_HEADERS += 
../../../../../../bsps/arm/imx/include/arm/freescale/imx/imx_iomuxreg.h
-include_arm_freescale_imx_HEADERS += 
../../../../../../bsps/arm/imx/include/arm/freescale/imx/imx_iomuxvar.h
 include_arm_freescale_imx_HEADERS += 
../../../../../../bsps/arm/imx/include/arm/freescale/imx/imx_srcreg.h
 include_arm_freescale_imx_HEADERS += 
../../../../../../bsps/arm/imx/include/arm/freescale/imx/imx_uartreg.h
 include_arm_freescale_imx_HEADERS += 
../../../../../../bsps/arm/imx/include/arm/freescale/imx/imx_wdogreg.h
diff --git a/bsps/arm/imx/include/bsp.h b/bsps/arm/imx/include/bsp.h
index 99b7a0d1d7..8b95a79535 100644
--- a/bsps/arm/imx/include/bsp.h
+++ b/bsps/arm/imx/include/bsp.h
@@ -59,8 +59,6 @@ extern uintptr_t imx_gic_dist_base;
 
 void *imx_get_reg_of_node(const void *fdt, int node);
 
-int imx_iomux_configure_pins(const void *fdt, uint32_t phandle);
-
 rtems_vector_number imx_get_irq_of_node(
   const void *fdt,
   int node,
diff --git a/bsps/arm/imx/spi/imx-ecspi.c b/bsps/arm/imx/spi/imx-ecspi.c
index 26ba812f62..1ffc4d9798 100644
--- a/bsps/arm/imx/spi/imx-ecspi.c
+++ b/bsps/arm/imx/spi/imx-ecspi.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/bsps/arm/shared/headers.am b/bsps/arm/shared/headers.am
new file mode 100644
index 00..4fd7238f81
--- /dev/null
+++ b/bsps/arm/shared/headers.am
@@ -0,0 +1,6 @@
+## This file was generated by "./boostrap -H".
+
+include_arm_freescale_imxdir = $(includedir)/arm/freescale/imx
+include_arm_freescale_imx_HEADERS =
+include_arm_freescale_imx_HEADERS += 
../../../../../../bsps/arm/shared/include/arm/freescale/imx/imx_iomuxreg.h
+include_arm_freescale_imx_HEADERS += 
../../../../../../bsps/arm/shared/include/arm/freescale/imx/imx_iomuxvar.h
diff --git a/bsps/arm/imx/include/arm/freescale/imx/imx_iomuxreg.h 
b/bsps/arm/shared/include/arm/freescale/imx/imx_iomuxreg.h
similarity index 100%
rename from bsps/arm/imx/include/arm/freescale/imx/imx_iomuxreg.h
rename to bsps/arm/shared/include/arm/freescale/imx/imx_iomuxreg.h
diff --git a/bsps/arm/imx/include/arm/freescale/imx/imx_iomuxvar.h 
b/bsps/arm/shared/include/arm/freescale/imx/imx_iomuxvar.h
similarity index 100%
rename from bsps/arm/imx/include/arm/freescale/imx/imx_iomuxvar.h
rename to bsps/arm/shared/include/arm/freescale/imx/imx_iomuxvar.h
diff --git a/bsps/arm/shared/include/bsp/imx-iomux.h 
b/bsps/arm/shared/include/bsp/imx-iomux.h
new file mode 100644
index 00..60421807c0
--- /dev/null
+++ b/bsps/arm/shared/include/bsp/imx-iomux.h
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSBSPsARM
+ *
+ * @brief Functions for imx iomux.
+ */
+
+/*
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMP

[PATCH rtems v2 0/7] Add imxrt BSP

2020-11-18 Thread Christian Mauderer
Hello,

this is a second verson for the imxrt BSP. If no one objects, it will be
the last for this patch set.

I don't re-send the documentation and libbsd parts. For libbsd it will
be the same and for documentation it will be the one with changes like
discussed.

The BSD-3-clause license and console commands are now on the list for
review in separate mails.

The import patch is still the same. It will most likely hit the size
limit for the mailing list again.

Changes in this patch set:

- I replaced the transient event with a semaphore in the SPI driver.
- The MPU initialization is reworked. Now a user could adapt it by
  overwriting the variables in his application.
- I fixed a bug that I introduced in imx.

Best regards

Christian


___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH rtems v2 5/7] bsp/imxrt: Fix warnings for imported files

2020-11-18 Thread Christian Mauderer
Update #4180
---
 bsps/arm/imxrt/include/fsl_common.h   | 295 ++
 bsps/arm/imxrt/include/fsl_flexspi_nor_boot.h |   2 +
 .../imxrt/nxp/boards/evkbimxrt1050/pin_mux.c  |   4 +
 .../nxp/devices/MIMXRT1052/drivers/fsl_dcp.c  |   4 +
 .../devices/MIMXRT1052/drivers/fsl_spdif.c|   2 +
 5 files changed, 307 insertions(+)

diff --git a/bsps/arm/imxrt/include/fsl_common.h 
b/bsps/arm/imxrt/include/fsl_common.h
index 358f973b9e..76f943ebba 100644
--- a/bsps/arm/imxrt/include/fsl_common.h
+++ b/bsps/arm/imxrt/include/fsl_common.h
@@ -663,6 +663,301 @@ void DefaultISR(void);
 */
 void SDK_DelayAtLeastUs(uint32_t delay_us, uint32_t coreClock_Hz);
 
+#ifdef __rtems__
+/* Prototypes for IRQHandlers */
+void FLEXIO_CommonIRQHandler(void);
+void FLEXIO_DriverIRQHandler(void);
+void FLEXIO0_DriverIRQHandler(void);
+void FLEXIO1_DriverIRQHandler(void);
+void UART2_FLEXIO_DriverIRQHandler(void);
+void FLEXIO2_DriverIRQHandler(void);
+void FLEXIO3_DriverIRQHandler(void);
+void CAN0_DriverIRQHandler(void);
+void CAN1_DriverIRQHandler(void);
+void CAN2_DriverIRQHandler(void);
+void CAN3_DriverIRQHandler(void);
+void CAN4_DriverIRQHandler(void);
+void DMA_FLEXCAN0_INT_DriverIRQHandler(void);
+void DMA_FLEXCAN1_INT_DriverIRQHandler(void);
+void DMA_FLEXCAN2_INT_DriverIRQHandler(void);
+void ADMA_FLEXCAN0_INT_DriverIRQHandler(void);
+void ADMA_FLEXCAN1_INT_DriverIRQHandler(void);
+void ADMA_FLEXCAN2_INT_DriverIRQHandler(void);
+void USDHC0_DriverIRQHandler(void);
+void USDHC1_DriverIRQHandler(void);
+void USDHC2_DriverIRQHandler(void);
+void LPUART0_LPUART1_RX_DriverIRQHandler(void);
+void LPUART0_LPUART1_TX_DriverIRQHandler(void);
+void LPUART0_LPUART1_DriverIRQHandler(void);
+void LPUART0_TX_DriverIRQHandler(void);
+void LPUART0_RX_DriverIRQHandler(void);
+void LPUART0_DriverIRQHandler(void);
+void LPUART1_TX_DriverIRQHandler(void);
+void LPUART1_RX_DriverIRQHandler(void);
+void LPUART1_DriverIRQHandler(void);
+void LPUART2_TX_DriverIRQHandler(void);
+void LPUART2_RX_DriverIRQHandler(void);
+void LPUART2_DriverIRQHandler(void);
+void LPUART3_TX_DriverIRQHandler(void);
+void LPUART3_RX_DriverIRQHandler(void);
+void LPUART3_DriverIRQHandler(void);
+void LPUART4_TX_DriverIRQHandler(void);
+void LPUART4_RX_DriverIRQHandler(void);
+void LPUART4_DriverIRQHandler(void);
+void LPUART5_TX_DriverIRQHandler(void);
+void LPUART5_RX_DriverIRQHandler(void);
+void LPUART5_DriverIRQHandler(void);
+void LPUART6_TX_DriverIRQHandler(void);
+void LPUART6_RX_DriverIRQHandler(void);
+void LPUART6_DriverIRQHandler(void);
+void LPUART7_TX_DriverIRQHandler(void);
+void LPUART7_RX_DriverIRQHandler(void);
+void LPUART7_DriverIRQHandler(void);
+void LPUART8_TX_DriverIRQHandler(void);
+void LPUART8_RX_DriverIRQHandler(void);
+void LPUART8_DriverIRQHandler(void);
+void M4_0_LPUART_DriverIRQHandler(void);
+void M4_1_LPUART_DriverIRQHandler(void);
+void M4_LPUART_DriverIRQHandler(void);
+void DMA_UART0_INT_DriverIRQHandler(void);
+void DMA_UART1_INT_DriverIRQHandler(void);
+void DMA_UART2_INT_DriverIRQHandler(void);
+void DMA_UART3_INT_DriverIRQHandler(void);
+void DMA_UART4_INT_DriverIRQHandler(void);
+void ADMA_UART0_INT_DriverIRQHandler(void);
+void ADMA_UART1_INT_DriverIRQHandler(void);
+void ADMA_UART2_INT_DriverIRQHandler(void);
+void ADMA_UART3_INT_DriverIRQHandler(void);
+void DMA0_04_DriverIRQHandler(void);
+void DMA0_15_DriverIRQHandler(void);
+void DMA0_26_DriverIRQHandler(void);
+void DMA0_37_DriverIRQHandler(void);
+void DMA1_04_DriverIRQHandler(void);
+void DMA1_15_DriverIRQHandler(void);
+void DMA1_26_DriverIRQHandler(void);
+void DMA1_37_DriverIRQHandler(void);
+void DMA1_04_DriverIRQHandler(void);
+void DMA1_15_DriverIRQHandler(void);
+void DMA1_26_DriverIRQHandler(void);
+void DMA1_37_DriverIRQHandler(void);
+void DMA0_08_DriverIRQHandler(void);
+void DMA0_19_DriverIRQHandler(void);
+void DMA0_210_DriverIRQHandler(void);
+void DMA0_311_DriverIRQHandler(void);
+void DMA0_412_DriverIRQHandler(void);
+void DMA0_513_DriverIRQHandler(void);
+void DMA0_614_DriverIRQHandler(void);
+void DMA0_715_DriverIRQHandler(void);
+void DMA1_08_DriverIRQHandler(void);
+void DMA1_19_DriverIRQHandler(void);
+void DMA1_210_DriverIRQHandler(void);
+void DMA1_311_DriverIRQHandler(void);
+void DMA1_412_DriverIRQHandler(void);
+void DMA1_513_DriverIRQHandler(void);
+void DMA1_614_DriverIRQHandler(void);
+void DMA1_715_DriverIRQHandler(void);
+void DMA0_DMA16_DriverIRQHandler(void);
+void DMA1_DMA17_DriverIRQHandler(void);
+void DMA2_DMA18_DriverIRQHandler(void);
+void DMA3_DMA19_DriverIRQHandler(void);
+void DMA4_DMA20_DriverIRQHandler(void);
+void DMA5_DMA21_DriverIRQHandler(void);
+void DMA6_DMA22_DriverIRQHandler(void);
+void DMA7_DMA23_DriverIRQHandler(void);
+void DMA8_DMA24_DriverIRQHandler(void);
+void DMA9_DMA25_DriverIRQHandler(void);
+void DMA10_DMA26_DriverIRQHandler(void);
+void DMA11_DMA27_DriverIRQHandler(void);
+void DMA12_DMA28_DriverIRQHandler(void);
+void DMA13_DMA29_DriverIRQHandler(void);
+void DMA14_DMA30_Driver

[PATCH rtems v2 6/7] bsp/imxrt: Adapt imported files

2020-11-18 Thread Christian Mauderer
Update #4180
---
 bsps/arm/imxrt/include/fsl_device_registers.h | 57 ++-
 bsps/arm/imxrt/include/fsl_flexspi_nor_boot.h |  6 ++
 ..._nor_config.h => fsl_flexspi_nor_config.h} |  0
 bsps/arm/imxrt/include/fsl_lpuart.h   |  4 ++
 bsps/arm/imxrt/include/fsl_pin_mux.h  |  4 ++
 .../nxp/boards/evkbimxrt1050/clock_config.c   | 12 
 .../imxrt/nxp/boards/evkbimxrt1050/pin_mux.c  |  6 ++
 .../devices/MIMXRT1052/drivers/fsl_lpuart.c   | 17 ++
 8 files changed, 80 insertions(+), 26 deletions(-)
 rename bsps/arm/imxrt/include/{evkbimxrt1050_flexspi_nor_config.h => 
fsl_flexspi_nor_config.h} (100%)

diff --git a/bsps/arm/imxrt/include/fsl_device_registers.h 
b/bsps/arm/imxrt/include/fsl_device_registers.h
index 54caf43ca6..00c3fc7036 100644
--- a/bsps/arm/imxrt/include/fsl_device_registers.h
+++ b/bsps/arm/imxrt/include/fsl_device_registers.h
@@ -1,36 +1,41 @@
-/*
- * Copyright 2014-2016 Freescale Semiconductor, Inc.
- * Copyright 2016-2018 NXP
- * All rights reserved.
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
  *
- * SPDX-License-Identifier: BSD-3-Clause
+ * @ingroup RTEMSBSPsARMimxrt
  *
+ * @brief Helper file for including registers for SDK drivers.
  */
 
-#ifndef __FSL_DEVICE_REGISTERS_H__
-#define __FSL_DEVICE_REGISTERS_H__
-
 /*
- * Include the cpu specific register header files.
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
  *
- * The CPU macro should be declared in the project or makefile.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  */
-#if (defined(CPU_MIMXRT1052CVJ5B) || defined(CPU_MIMXRT1052CVL5B) || 
defined(CPU_MIMXRT1052DVJ6B) || \
-defined(CPU_MIMXRT1052DVL6B))
-
-#define MIMXRT1052_SERIES
-
-/* CMSIS-style register definitions */
-#include "MIMXRT1052.h"
-/* CPU specific feature definitions */
-#include "MIMXRT1052_features.h"
 
-#else
-#error "No valid CPU defined!"
-#endif
+#ifndef FSL_DEVICE_REGISTERS_H
+#define FSL_DEVICE_REGISTERS_H
 
-#endif /* __FSL_DEVICE_REGISTERS_H__ */
+#include 
 
-/***
- * EOF
- 
**/
+#endif /* FSL_DEVICE_REGISTERS_H */
diff --git a/bsps/arm/imxrt/include/fsl_flexspi_nor_boot.h 
b/bsps/arm/imxrt/include/fsl_flexspi_nor_boot.h
index 7b256f6670..56995eca55 100644
--- a/bsps/arm/imxrt/include/fsl_flexspi_nor_boot.h
+++ b/bsps/arm/imxrt/include/fsl_flexspi_nor_boot.h
@@ -9,7 +9,9 @@
 #define __FLEXSPI_NOR_BOOT_H__
 
 #include 
+#ifndef __rtems__
 #include "board.h"
+#endif /* __rtems__ */
 
 /*! @name Driver version */
 /*@{*/
@@ -85,6 +87,7 @@ typedef struct _ivt_ {
 #define FLASH_BASE ((uint32_t)__FLASH_BASE)   
 #endif
 
+#ifndef __rtems__
 #if defined(XIP_BOOT_HEADER_DCD_ENABLE) && (1 == XIP_BOOT_HEADER_DCD_ENABLE)
 #define DCD_ADDRESS dcd_data
 #else
@@ -94,6 +97,7 @@ typedef struct _ivt_ {
 #define BOOT_DATA_ADDRESS &boot_data
 #define CSF_ADDRESS   0
 #define IVT_RSVD (uint32_t)(0x)
+#endif /* __rtems__ */
 
 /* 
  *  Boot Data 
@@ -114,11 +118,13 @@ typedef struct _boot_data_ {
 #endif /* __rtems__ */
 #define PLUGIN_FLAG   (uint32_t)0
 
+#ifndef __rtems__
 /* External Variables */
 const BOOT_DATA_T boot_data;
 #if defined(XIP_BOOT_HEADER_DCD_ENABLE) && (1 == XIP_BOOT_HEADER_DCD_ENABLE)
 extern const uint8_t dcd_data[];
 #endif
+#endif /* __rtems__ */
 
 #endif /* __FLEXSPI_NOR_BOOT_H__ */
 
diff --git a/bsps/arm/imxrt/include/evkbimxrt1050_flexspi_nor_config.h 
b/bsps/arm/imxrt/include/fsl_flexspi_nor_config.h
similarity index 100%
rename from bsps/arm/imxrt/include/evkbimxrt1050_flexspi_nor

Re: [PATCH rtems-docs 1/2] user/bsps: Add imxrt

2020-11-18 Thread Gedare Bloom
On Wed, Nov 18, 2020 at 12:52 AM Christian Mauderer
 wrote:
>
> Am 17.11.20 um 18:41 schrieb Gedare Bloom:
> > On Tue, Nov 17, 2020 at 4:09 AM Christian Mauderer
> >  wrote:
> >>
> >> Update #4180
> >> ---
> >>   user/bsps/arm/imxrt.rst | 174 
> >>   user/bsps/bsps-arm.rst  |   1 +
> >>   2 files changed, 175 insertions(+)
> >>   create mode 100644 user/bsps/arm/imxrt.rst
> >>
> >> diff --git a/user/bsps/arm/imxrt.rst b/user/bsps/arm/imxrt.rst
> >> new file mode 100644
> >> index 000..41c6bff
> >> --- /dev/null
> >> +++ b/user/bsps/arm/imxrt.rst
> >> @@ -0,0 +1,174 @@
> >> +.. SPDX-License-Identifier: CC-BY-SA-4.0
> >> +
> >> +.. Copyright (C) 2020 embedded brains GmbH
> >> +.. Copyright (C) 2020 Christian Mauderer
> >> +
> >> +imxrt (NXP i.MXRT)
> >> +==
> >> +
> >> +This BSP offers only one variant, the `imxrt1052`. This variant supports 
> >> the
> >> +i.MXRT 1052 processor on a IMXRT1050-EVKB (tested with rev A1). You can 
> >> also
> >> +configure it to work with custom boards.
> >> +
> >> +Build Configuration Options
> >> +---
> >> +
> >> +Please see the documentation of the `IMXRT_*` and `BSP_*` configuration 
> >> options
> >> +for that. You can generate a default set of options with::
> > one colon: I think?
> >
>
> That's the start for the literal block below. Restructured Text allows
> three syntax variants for that. From Wikipedia:
>
> ::
>
>some literal text
>
> This may also be used inline at the end of a paragraph, like so::
>
>some more literal text
>
> .. code:: python
>
> print("A literal block directive explicitly marked as python code")
>
thanks

> >> +
> >> +  ./waf bsp_defaults --rtems-bsps=arm/imxrt1052 > config.ini
> >> +
> >> +Boot Process
> >> +
> >> +
> >> +There are two possible boot processes supported:
> >> +
> >> +1) The ROM code loads a configuration from HyperFlash (connected to 
> >> FlexSPI),
> >> +   does some initialization (based on device configuration data (DCD)) 
> >> and then
> >> +   starts the application. This is the default case. `linkcmds.flexspi` 
> >> is used
> >> +   for this case.
> >> +
> >> +2) Some custom bootloader does the basic initialization, loads the 
> >> application
> >> +   to SDRAM and starts it from there. Select the `linkcmds.sdram` for 
> >> this.
> >> +
> >> +For programming the HyperFlash in case 1, you can use the on board 
> >> debugger
> >> +integrated into the IMXRT1050-EVKB. You can generate a flash image out of 
> >> a
> >> +compiled RTEMS application with for example::
> >> +
> >> +  arm-rtems6-objcopy -O binary 
> >> build/arm/imxrt1052/testsuites/samples/hello.exe hello.bin
> >> +
> >> +Then just copy the generated binary to the mass storage provided by the
> >> +debugger. Wait a bit till the mass storage vanishes and re-appears. After 
> >> that,
> >> +reset the board and the newly programmed application will start.
> >> +
> >> +For debugging: Create a special application with a `while(true)` loop at 
> >> end of
> >> +`bsp_start_hook_1`. Load that application into flash. Then remove the loop
> >> +again, build your BSP for SDRAM and use a debugger to load the 
> >> application into
> >> +SDRAM after the BSP started from flash did the basic initialization.
> >> +
> >> +Flash Image
> >> +---
> >> +
> >> +For booting from a HyperFlash (or other storage connected to FlexSPI), 
> >> the ROM
> >> +code of the i.MXRT first reads some special flash header information from 
> >> a
> >> +fixed location of the connected flash device. This consists of the Image 
> >> vector
> >> +table (IVT), Boot data and Device configuration data (DCD).
> >> +
> >> +In RTEMS, these flash headers are generated using some C-structures. If 
> >> you use
> >> +a board other then the IMXRT1050-EVKB, they have to be adapted. To do that
> > s/then/than
>
> Thanks.
>
> > s/they have/it has
> I thought that multiple structures for multiple headers have to be
> adapted. Would it really be correct to use "it" for that?
>
I see. In this case, it would be more clear to say "those structures
have" since it is not entirely clear what "they" refers back to.

> >
> >> +re-define the following variables in your application (you only need the 
> >> ones
> >> +that need different values):
> >> +
> >> +.. code-block:: c
> >> +
> >> +  #include 
> >> +  const uint8_t imxrt_dcd_data[] =
> >> +  { /* Your DCD data here */ };
> >> +  const ivt imxrt_image_vector_table =
> >> +  { /* Your IVT here */ };
> >> +  const BOOT_DATA_T imxrt_boot_data =
> >> +  { /* Your boot data here */ };
> >> +  const flexspi_nor_config_t imxrt_flexspi_config =
> >> +  { /* Your FlexSPI config here */ };
> >> +
> >> +You can find the default definitions in `bsps/arm/imxrt/start/flash-*.c`. 
> >> Take a
> >> +look at the `i.MX RT1050 Processor Reference Manual, Rev. 4, 12/2019` 
> >> chapter
> >> +`9.7 Program image` for details about the contents.
> >> +
> >> +FDT
> >> 

Re: [PATCH rtems v2 0/7] Add imxrt BSP

2020-11-18 Thread Gedare Bloom
v2 looks fine to me

On Wed, Nov 18, 2020 at 7:47 AM Christian Mauderer
 wrote:
>
> Hello,
>
> this is a second verson for the imxrt BSP. If no one objects, it will be
> the last for this patch set.
>
> I don't re-send the documentation and libbsd parts. For libbsd it will
> be the same and for documentation it will be the one with changes like
> discussed.
>
> The BSD-3-clause license and console commands are now on the list for
> review in separate mails.
>
> The import patch is still the same. It will most likely hit the size
> limit for the mailing list again.
>
> Changes in this patch set:
>
> - I replaced the transient event with a semaphore in the SPI driver.
> - The MPU initialization is reworked. Now a user could adapt it by
>   overwriting the variables in his application.
> - I fixed a bug that I introduced in imx.
>
> Best regards
>
> Christian
>
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] Add License file for BSD-3-Clause

2020-11-18 Thread Gedare Bloom
Looks good, push it

On Wed, Nov 18, 2020 at 12:37 AM Christian Mauderer
 wrote:
>
> We have some files with a SPDX identifier for this license. Therefore
> the license should be here too.
> ---
>
> Note: This is a resubmission of the patch. Previously I submitted it together
> with the patches that add a new imxrt BSP:
>
> https://lists.rtems.org/pipermail/devel/2020-November/063273.html
>
> I only noted that it would have been better separate after Gedare said it.
>
>  LICENSE.BSD-3-Clause | 27 +++
>  1 file changed, 27 insertions(+)
>  create mode 100644 LICENSE.BSD-3-Clause
>
> diff --git a/LICENSE.BSD-3-Clause b/LICENSE.BSD-3-Clause
> new file mode 100644
> index 00..09d01c1ff5
> --- /dev/null
> +++ b/LICENSE.BSD-3-Clause
> @@ -0,0 +1,27 @@
> +https://spdx.org/licenses/BSD-3-Clause
> +
> +Redistribution and use in source and binary forms, with or without
> +modification, are permitted provided that the following conditions are
> +met:
> +
> +1. Redistributions of source code must retain the above copyright
> +   notice, this list of conditions and the following disclaimer.
> +2. Redistributions in binary form must reproduce the above
> +   copyright notice, this list of conditions and the following
> +   disclaimer in the documentation and/or other materials provided
> +   with the distribution.
> +3. Neither the name of the copyright holder nor the names of its
> +   contributors may be used to endorse or promote products derived
> +   from this software without specific prior written permission.
> +
> +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> --
> 2.26.2
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: How do I skip over a portion on code while debugging with GDB

2020-11-18 Thread Richi Dubey
Hi,

Thank you for your replies Dr. Bloom and Dr. Sherrill.

I completely forgot that I could do a break with the line number. I have
been manually working with the next instruction for the past few weeks when
I could easily have done break :p.

Thanks.

On Wed, Nov 18, 2020 at 12:43 AM Joel Sherrill  wrote:

> Next is good but setting a breakpoint at the line after the task create
> loop
> is probably the solution here. Or "next NUMBER" to next a number of times.
> Many gdb commands take a number.
>
> Another interesting option is using continue and break conditions. You
> could
> then continue until the loop counter is 99 or something.
>
> https://sourceware.org/gdb/onlinedocs/gdb/Continuing-and-Stepping.html
>
> On Tue, Nov 17, 2020 at 12:41 PM Gedare Bloom  wrote:
>
>> Use 'next' to step by instructions in program order ignoring their
>> control flow. This also will skip over function calls.
>>
>> On Tue, Nov 17, 2020 at 8:54 AM Richi Dubey  wrote:
>> >
>> > Hi,
>> >
>> > When I am trying to debug the tm24 test suite, there's some line of
>> code that repeats the same code that creates a task around 100 times. Is
>> there a way I can skip that code while debugging? Please let me know.
>> >
>> > Thanks,
>> > Richi.
>> > ___
>> > devel mailing list
>> > devel@rtems.org
>> > http://lists.rtems.org/mailman/listinfo/devel
>> ___
>> devel mailing list
>> devel@rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Doubt in rtems_task_wake_after

2020-11-18 Thread Richi Dubey
Hi,

In the program tm24
, the
Init task creates
 only
1 HIGH task that executes (after Init task finishes) the High_task function
and then the Init task creates
 100
REST or LOOP task which execute (After High_task finishes) the Tasks
function.

Then, how can the High_task call

rtems_task_wake_after
100 times? Shouldn't it exit right after a single call
to rtems_task_wake_after, since the function yields the processor that is
held by the executing thread?

Please let me know how this works.

Thanks,
Richi.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: libdl: How to debug dl object with GDB

2020-11-18 Thread Hesham Almatary
Thanks for the info, Chris.

On Wed, 18 Nov 2020 at 02:43, Chris Johns  wrote:
>
>
>
> On 17/11/20 10:43 pm, Hesham Almatary wrote:
> > Hello,
> >
> > I am trying to debug a dynamically loaded ELF object with GDB: My setup is:
> > rtems-riscv64:
> > GDB: GNU gdb (GDB) 10.0.50.20200904-git (build with RSB/rtems6)
> > Host: Ubuntu 20.04.1 LTS
> >
> > GDB doesn't seem to notice when I dlopen an object (which gets loaded,
> > linked and run fine).
>
> libdl has the NetBSD type support built in for debugging. A function is called
> when a module is loaded and there is a table of modules GDB reads and then 
> loads
> the object file.
>
Is that expected to work on Linux with recent GDB versions? GDB
doesn't seem to detect when "_rtld_debug_state" is called from dlopen,
and consequently isn't aware of the list of objects. Does that need
GDB to be modified with solib-rtems* or something?

> > Any instructions or idea how to troubleshoot that further?
>
> At this point the simplest path is to get the load address(es) and load the
> symbols with the VMA.
>
I can use "add-symbol-file" filename for each object and give it the
text_base address. This only allows me to break on functions within
loaded objects. If that's not what you mean, how can I load the
symbols with the VMA?


> Anything else would require adding support to GDB or maybe a python module 
> would
> work. I am not sure if the python approach is possible.
>
> Chris



--
Hesham
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH rtems v2 3/7] cpu/armv7m: Add table based init for ARMV7M_MPU

2020-11-18 Thread Sebastian Huber

On 18/11/2020 15:45, Christian Mauderer wrote:


+/**
+ * Higher level region configuration.
+ *
+ * Allows to configure with begin and end which is more convenient for
+ * calculating the sizes from linker command file. Note that you still have to
+ * follow the following rules:
+ *
+ * - Begin address has to be aligned to 0x20 (lower 5 bits set to 0)
+ * - Sizes can only be a value of 2^x with a minimum of 32 Byte. If you have an
+ *   end address that is not aligned, the region will get bigger.
+ * - Later regions have higher priority.
+ */
+typedef struct {
+  const void *begin;
+  const void *end;
+  uint32_t flags;


uint32_t rasr;

I guess the flags are actually a value stored directly to the RASR?


+} ARMV7M_MPU_Region_Config;


ARMV7M_MPU_Region_config


+
  typedef struct {
uint32_t dhcsr;
uint32_t dcrsr;
@@ -611,6 +632,85 @@ void _ARMV7M_Supervisor_call( void );
  
  void _ARMV7M_Clock_handler( void );
  
+static inline uint32_t _ARMV7M_MPU_get_region_size(uintptr_t size)


_ARMV7M_MPU_Get_region_size


+{
+  if ((size & (size - 1)) == 0) {
+return ARMV7M_MPU_RASR_SIZE(30 - __builtin_clz(size));
+  } else {
+return ARMV7M_MPU_RASR_SIZE(31 - __builtin_clz(size));
+  }
+}
+
+static inline void _ARMV7M_MPU_set_region(


_ARMV7M_MPU_Set_region


+  volatile ARMV7M_MPU *mpu,
+  uint32_t region,
+  uint32_t rasr,
+  const void *begin,
+  const void *end
+)
+{
+  uintptr_t size;
+  uint32_t rbar;
+
+  RTEMS_OBFUSCATE_VARIABLE(begin);
+  RTEMS_OBFUSCATE_VARIABLE(end);
+  size = (uintptr_t) end - (uintptr_t) begin;
+
+  if ( size > 0 ) {
+rbar = (uintptr_t) begin | region | ARMV7M_MPU_RBAR_VALID;
+rasr |= _ARMV7M_MPU_get_region_size(size);
+  } else {
+rbar = region;
+rasr = 0;
+  }
+
+  mpu->rbar = rbar;
+  mpu->rasr = rasr;
+}
+
+static inline void _ARMV7M_MPU_disable_region(


_ARMV7M_MPU_Disable_region


+  volatile ARMV7M_MPU *mpu,
+  uint32_t region
+)
+{
+  mpu->rbar = ARMV7M_MPU_RBAR_VALID | region;
+  mpu->rasr = 0;
+}
+
+static inline void _ARMV7M_MPU_setup_from_config_and_enable(
+  const ARMV7M_MPU_Region_Config *cfg,
+  size_t cfg_count
+)


_ARMV7M_MPU_Setup

The config is implicit in the parameter. You don't necessarily enable a 
configured region. It depends on the user provided RASR value.


+{
+  volatile ARMV7M_MPU *mpu;
+  volatile ARMV7M_SCB *scb;
+  uint32_t region_count;
+  uint32_t region;
+
+  mpu = _ARMV7M_MPU;
+  scb = _ARMV7M_SCB;
+
+  region_count = ARMV7M_MPU_TYPE_DREGION_GET(mpu->type);
+
+  if (cfg_count > region_count) {
+rtems_panic("invalid MPU config");
+  }


I think rtems_panic() is too heavy weight at this point. It uses 
printk(). Maybe just use _Assert(). I think we need some light weight 
general purpose fatal error which could just use the return address to 
identify the error location.



+
+  for (region = 0; region < region_count; ++region) {


for (region = cfg_count; region < region_count; ++region)

Only disable not configured regions?


+_ARMV7M_MPU_disable_region(mpu, region);
+  }
+
+  for (region = 0; region < cfg_count; ++region) {
+_ARMV7M_MPU_set_region(mpu, region, cfg->flags, cfg->begin, cfg->end);
+  }
+
+  mpu->ctrl = ARMV7M_MPU_CTRL_ENABLE | ARMV7M_MPU_CTRL_PRIVDEFENA;
+  scb->shcsr |= ARMV7M_SCB_SHCSR_MEMFAULTENA;
+
+  _ARM_Data_synchronization_barrier();
+  _ARM_Instruction_synchronization_barrier();
+}


--
embedded brains GmbH
Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
Phone: +49-89-18 94 741 - 16
Fax:   +49-89-18 94 741 - 08
PGP: Public key available on request.

embedded brains GmbH
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier: 
https://embedded-brains.de/datenschutzerklaerung/

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] Add License file for BSD-3-Clause

2020-11-18 Thread Christian Mauderer

Thanks. I pushed it.

Am 18.11.20 um 17:17 schrieb Gedare Bloom:

Looks good, push it

On Wed, Nov 18, 2020 at 12:37 AM Christian Mauderer
 wrote:


We have some files with a SPDX identifier for this license. Therefore
the license should be here too.
---

Note: This is a resubmission of the patch. Previously I submitted it together
with the patches that add a new imxrt BSP:

https://lists.rtems.org/pipermail/devel/2020-November/063273.html

I only noted that it would have been better separate after Gedare said it.

  LICENSE.BSD-3-Clause | 27 +++
  1 file changed, 27 insertions(+)
  create mode 100644 LICENSE.BSD-3-Clause

diff --git a/LICENSE.BSD-3-Clause b/LICENSE.BSD-3-Clause
new file mode 100644
index 00..09d01c1ff5
--- /dev/null
+++ b/LICENSE.BSD-3-Clause
@@ -0,0 +1,27 @@
+https://spdx.org/licenses/BSD-3-Clause
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above
+   copyright notice, this list of conditions and the following
+   disclaimer in the documentation and/or other materials provided
+   with the distribution.
+3. Neither the name of the copyright holder nor the names of its
+   contributors may be used to endorse or promote products derived
+   from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--
2.26.2

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


--

embedded brains GmbH
Christian MAUDERER
Dornierstr. 4
82178 Puchheim
Germany
email: christian.maude...@embedded-brains.de
Phone: +49-89-18 94 741 - 18
Fax:   +49-89-18 94 741 - 08
PGP: Public key available on request.

embedded brains GmbH
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH 2/2] config: Initialize task stack allocator on demand

2020-11-18 Thread Sebastian Huber
Register a custom task stack allocator initialization handler only if
necessary.
---
 cpukit/include/rtems/confdefs/wkspace.h | 19 +++
 cpukit/score/src/stackallocatorinit.c   |  5 +
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/cpukit/include/rtems/confdefs/wkspace.h 
b/cpukit/include/rtems/confdefs/wkspace.h
index de555101a1..78d669d790 100644
--- a/cpukit/include/rtems/confdefs/wkspace.h
+++ b/cpukit/include/rtems/confdefs/wkspace.h
@@ -144,10 +144,19 @@ const uintptr_t _Stack_Space_size = 
_CONFIGURE_STACK_SPACE_SIZE;
   #endif
 
   #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_INIT
+RTEMS_STATIC_ASSERT(
+  CONFIGURE_TASK_STACK_ALLOCATOR_INIT != NULL,
+  CONFIGURE_TASK_STACK_ALLOCATOR_INIT_MUST_NOT_BE_NULL
+);
+
 const Stack_Allocator_initialize _Stack_Allocator_initialize =
   CONFIGURE_TASK_STACK_ALLOCATOR_INIT;
-  #else
-const Stack_Allocator_initialize _Stack_Allocator_initialize = NULL;
+
+RTEMS_SYSINIT_ITEM(
+  _Stack_Allocator_do_initialize,
+  RTEMS_SYSINIT_DIRTY_MEMORY,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
   #endif
 
   RTEMS_STATIC_ASSERT(
@@ -165,12 +174,6 @@ const uintptr_t _Stack_Space_size = 
_CONFIGURE_STACK_SPACE_SIZE;
 
   const Stack_Allocator_free _Stack_Allocator_free =
 CONFIGURE_TASK_STACK_DEALLOCATOR;
-
-  RTEMS_SYSINIT_ITEM(
-_Stack_Allocator_do_initialize,
-RTEMS_SYSINIT_DIRTY_MEMORY,
-RTEMS_SYSINIT_ORDER_MIDDLE
-  );
 #elif defined(CONFIGURE_TASK_STACK_ALLOCATOR) \
   || defined(CONFIGURE_TASK_STACK_DEALLOCATOR)
   #error "CONFIGURE_TASK_STACK_ALLOCATOR and CONFIGURE_TASK_STACK_DEALLOCATOR 
must be both defined or both undefined"
diff --git a/cpukit/score/src/stackallocatorinit.c 
b/cpukit/score/src/stackallocatorinit.c
index 412e3142b3..31e239bd46 100644
--- a/cpukit/score/src/stackallocatorinit.c
+++ b/cpukit/score/src/stackallocatorinit.c
@@ -45,8 +45,5 @@ void _Stack_Allocator_do_initialize( void )
   rtems_stack_allocate_init_hook init_hook;
 
   init_hook = rtems_configuration_get_stack_allocate_init_hook();
-
-  if ( init_hook  != NULL ) {
-(*init_hook )( rtems_configuration_get_stack_space_size() );
-  }
+  ( *init_hook )( rtems_configuration_get_stack_space_size() );
 }
-- 
2.26.2

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 1/2] config: Simplify task stack allocator init

2020-11-18 Thread Sebastian Huber
Replace runtime checks with compile time assertions.  This makes the
INTERNAL_ERROR_BAD_STACK_HOOK obsolete.
---
 cpukit/include/rtems/confdefs/wkspace.h | 10 ++
 cpukit/include/rtems/score/interr.h |  2 +-
 cpukit/score/src/stackallocatorinit.c   |  8 -
 spec/build/testsuites/sptests/grp.yml   |  2 --
 spec/build/testsuites/sptests/spfatal06.yml | 19 ---
 testsuites/sptests/Makefile.am  |  9 -
 testsuites/sptests/configure.ac |  1 -
 testsuites/sptests/spfatal06/init.c | 38 -
 testsuites/sptests/spfatal06/spfatal06.doc  | 20 ---
 testsuites/sptests/spfatal06/spfatal06.scn  |  3 --
 testsuites/sptests/spinternalerror01/init.c | 15 ++--
 testsuites/sptests/sptimecounter01/init.c   | 15 ++--
 12 files changed, 37 insertions(+), 105 deletions(-)
 delete mode 100644 spec/build/testsuites/sptests/spfatal06.yml
 delete mode 100644 testsuites/sptests/spfatal06/init.c
 delete mode 100644 testsuites/sptests/spfatal06/spfatal06.doc
 delete mode 100644 testsuites/sptests/spfatal06/spfatal06.scn

diff --git a/cpukit/include/rtems/confdefs/wkspace.h 
b/cpukit/include/rtems/confdefs/wkspace.h
index d40194cbec..de555101a1 100644
--- a/cpukit/include/rtems/confdefs/wkspace.h
+++ b/cpukit/include/rtems/confdefs/wkspace.h
@@ -150,9 +150,19 @@ const uintptr_t _Stack_Space_size = 
_CONFIGURE_STACK_SPACE_SIZE;
 const Stack_Allocator_initialize _Stack_Allocator_initialize = NULL;
   #endif
 
+  RTEMS_STATIC_ASSERT(
+CONFIGURE_TASK_STACK_ALLOCATOR != NULL,
+CONFIGURE_TASK_STACK_ALLOCATOR_MUST_NOT_BE_NULL
+  );
+
   const Stack_Allocator_allocate _Stack_Allocator_allocate =
 CONFIGURE_TASK_STACK_ALLOCATOR;
 
+  RTEMS_STATIC_ASSERT(
+CONFIGURE_TASK_STACK_DEALLOCATOR != NULL,
+CONFIGURE_TASK_STACK_DEALLOCATOR_MUST_NOT_BE_NULL
+  );
+
   const Stack_Allocator_free _Stack_Allocator_free =
 CONFIGURE_TASK_STACK_DEALLOCATOR;
 
diff --git a/cpukit/include/rtems/score/interr.h 
b/cpukit/include/rtems/score/interr.h
index 85767d0bc5..4b06199ae9 100644
--- a/cpukit/include/rtems/score/interr.h
+++ b/cpukit/include/rtems/score/interr.h
@@ -177,7 +177,7 @@ typedef enum {
   INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS = 11,
   INTERNAL_ERROR_OUT_OF_PROXIES = 12,
   INTERNAL_ERROR_INVALID_GLOBAL_ID = 13,
-  INTERNAL_ERROR_BAD_STACK_HOOK = 14,
+  /* INTERNAL_ERROR_BAD_STACK_HOOK = 14, */
   /* INTERNAL_ERROR_BAD_ATTRIBUTES = 15, */
   /* INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY = 16, */
   /* INTERNAL_ERROR_IMPLEMENTATION_BLOCKING_OPERATION_CANCEL = 17, */
diff --git a/cpukit/score/src/stackallocatorinit.c 
b/cpukit/score/src/stackallocatorinit.c
index 60d243631f..412e3142b3 100644
--- a/cpukit/score/src/stackallocatorinit.c
+++ b/cpukit/score/src/stackallocatorinit.c
@@ -38,20 +38,12 @@
 #endif
 
 #include 
-#include 
 #include 
 
 void _Stack_Allocator_do_initialize( void )
 {
   rtems_stack_allocate_init_hook init_hook;
 
-  if (
-rtems_configuration_get_stack_allocate_hook() == NULL
-  || rtems_configuration_get_stack_free_hook() == NULL
-  ) {
-_Internal_error( INTERNAL_ERROR_BAD_STACK_HOOK );
-  }
-
   init_hook = rtems_configuration_get_stack_allocate_init_hook();
 
   if ( init_hook  != NULL ) {
diff --git a/spec/build/testsuites/sptests/grp.yml 
b/spec/build/testsuites/sptests/grp.yml
index 64b0a54b0e..1c865777a7 100644
--- a/spec/build/testsuites/sptests/grp.yml
+++ b/spec/build/testsuites/sptests/grp.yml
@@ -226,8 +226,6 @@ links:
   uid: spfatal04
 - role: build-dependency
   uid: spfatal05
-- role: build-dependency
-  uid: spfatal06
 - role: build-dependency
   uid: spfatal09
 - role: build-dependency
diff --git a/spec/build/testsuites/sptests/spfatal06.yml 
b/spec/build/testsuites/sptests/spfatal06.yml
deleted file mode 100644
index 6e4be90a2a..00
--- a/spec/build/testsuites/sptests/spfatal06.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
-build-type: test-program
-cflags: []
-copyrights:
-- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
-cppflags: []
-cxxflags: []
-enabled-by: true
-features: c cprogram
-includes: []
-ldflags: []
-links: []
-source:
-- testsuites/sptests/spfatal06/init.c
-stlib: []
-target: testsuites/sptests/spfatal06.exe
-type: build
-use-after: []
-use-before: []
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 854ec3daf8..14788f7fb1 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -940,15 +940,6 @@ spfatal05_CPPFLAGS = $(AM_CPPFLAGS) 
$(TEST_FLAGS_spfatal05) \
$(support_includes)
 endif
 
-if TEST_spfatal06
-sp_tests += spfatal06
-sp_screens += spfatal06/spfatal06.scn
-sp_docs += spfatal06/spfatal06.doc
-spfatal06_SOURCES = spfatal06/init.c
-spfatal06_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal06) \
-   $(support_includes)
-endif
-
 if TEST_spfatal09
 sp_tests += spfatal09
 sp_screens += spfatal09/sp

Re: [PATCH rtems v2 3/7] cpu/armv7m: Add table based init for ARMV7M_MPU

2020-11-18 Thread Christian Mauderer

Am 19.11.20 um 08:19 schrieb Sebastian Huber:

On 18/11/2020 15:45, Christian Mauderer wrote:


+/**
+ * Higher level region configuration.
+ *
+ * Allows to configure with begin and end which is more convenient for
+ * calculating the sizes from linker command file. Note that you 
still have to

+ * follow the following rules:
+ *
+ * - Begin address has to be aligned to 0x20 (lower 5 bits set to 0)
+ * - Sizes can only be a value of 2^x with a minimum of 32 Byte. If 
you have an

+ *   end address that is not aligned, the region will get bigger.
+ * - Later regions have higher priority.
+ */
+typedef struct {
+  const void *begin;
+  const void *end;
+  uint32_t flags;


uint32_t rasr;

I guess the flags are actually a value stored directly to the RASR?


+} ARMV7M_MPU_Region_Config;


ARMV7M_MPU_Region_config


+
  typedef struct {
    uint32_t dhcsr;
    uint32_t dcrsr;
@@ -611,6 +632,85 @@ void _ARMV7M_Supervisor_call( void );
  void _ARMV7M_Clock_handler( void );
+static inline uint32_t _ARMV7M_MPU_get_region_size(uintptr_t size)


_ARMV7M_MPU_Get_region_size


+{
+  if ((size & (size - 1)) == 0) {
+    return ARMV7M_MPU_RASR_SIZE(30 - __builtin_clz(size));
+  } else {
+    return ARMV7M_MPU_RASR_SIZE(31 - __builtin_clz(size));
+  }
+}
+
+static inline void _ARMV7M_MPU_set_region(


_ARMV7M_MPU_Set_region


+  volatile ARMV7M_MPU *mpu,
+  uint32_t region,
+  uint32_t rasr,
+  const void *begin,
+  const void *end
+)
+{
+  uintptr_t size;
+  uint32_t rbar;
+
+  RTEMS_OBFUSCATE_VARIABLE(begin);
+  RTEMS_OBFUSCATE_VARIABLE(end);
+  size = (uintptr_t) end - (uintptr_t) begin;
+
+  if ( size > 0 ) {
+    rbar = (uintptr_t) begin | region | ARMV7M_MPU_RBAR_VALID;
+    rasr |= _ARMV7M_MPU_get_region_size(size);
+  } else {
+    rbar = region;
+    rasr = 0;
+  }
+
+  mpu->rbar = rbar;
+  mpu->rasr = rasr;
+}
+
+static inline void _ARMV7M_MPU_disable_region(


_ARMV7M_MPU_Disable_region


+  volatile ARMV7M_MPU *mpu,
+  uint32_t region
+)
+{
+  mpu->rbar = ARMV7M_MPU_RBAR_VALID | region;
+  mpu->rasr = 0;
+}
+
+static inline void _ARMV7M_MPU_setup_from_config_and_enable(
+  const ARMV7M_MPU_Region_Config *cfg,
+  size_t cfg_count
+)


_ARMV7M_MPU_Setup

The config is implicit in the parameter. You don't necessarily enable a 
configured region. It depends on the user provided RASR value.



+{
+  volatile ARMV7M_MPU *mpu;
+  volatile ARMV7M_SCB *scb;
+  uint32_t region_count;
+  uint32_t region;
+
+  mpu = _ARMV7M_MPU;
+  scb = _ARMV7M_SCB;
+
+  region_count = ARMV7M_MPU_TYPE_DREGION_GET(mpu->type);
+
+  if (cfg_count > region_count) {
+    rtems_panic("invalid MPU config");
+  }


I think rtems_panic() is too heavy weight at this point. It uses 
printk(). Maybe just use _Assert(). I think we need some light weight 
general purpose fatal error which could just use the return address to 
identify the error location.



+
+  for (region = 0; region < region_count; ++region) {


for (region = cfg_count; region < region_count; ++region)

Only disable not configured regions?


I think I maybe have to disable the MPU first if I do that. Otherwise it 
is possible that there is (for example) a region 0 that prevents access 
to all memory and a high region (lets say 5) that allows access to 
program memory. As soon as I clear the high one but not the low one, the 
system will crash because it can't access the memory any more.


But most likely a similar situation can be constructed with cleaning all 
regions. I'll take a look at disabling MPU before setting it up.





+    _ARMV7M_MPU_disable_region(mpu, region);
+  }
+
+  for (region = 0; region < cfg_count; ++region) {
+    _ARMV7M_MPU_set_region(mpu, region, cfg->flags, cfg->begin, 
cfg->end);

+  }
+
+  mpu->ctrl = ARMV7M_MPU_CTRL_ENABLE | ARMV7M_MPU_CTRL_PRIVDEFENA;
+  scb->shcsr |= ARMV7M_SCB_SHCSR_MEMFAULTENA;
+
+  _ARM_Data_synchronization_barrier();
+  _ARM_Instruction_synchronization_barrier();
+}




--

embedded brains GmbH
Christian MAUDERER
Dornierstr. 4
82178 Puchheim
Germany
email: christian.maude...@embedded-brains.de
Phone: +49-89-18 94 741 - 18
Fax:   +49-89-18 94 741 - 08
PGP: Public key available on request.

embedded brains GmbH
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] c-user: Update internal error list

2020-11-18 Thread Sebastian Huber
---
 c-user/fatal_error.rst | 37 -
 1 file changed, 8 insertions(+), 29 deletions(-)

diff --git a/c-user/fatal_error.rst b/c-user/fatal_error.rst
index 2c72deb..81cfa0c 100644
--- a/c-user/fatal_error.rst
+++ b/c-user/fatal_error.rst
@@ -146,15 +146,6 @@ INTERNAL_ERROR_TOO_LITTLE_WORKSPACE (2)
 There is not enough memory for the workspace.  This fatal error may occur
 during system initialization.  It is an application configuration error.
 
-INTERNAL_ERROR_WORKSPACE_ALLOCATION (3)
-An allocation from the workspace failed.  This fatal error may occur during
-system initialization.  It is an application configuration error.
-
-INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL (4)
-The configured interrupt stack size is too small.  This fatal error may
-occur during system initialization.  It is an application configuration
-error.
-
 INTERNAL_ERROR_THREAD_EXITTED (5)
 A non-POSIX thread entry function returned.  This is an API usage error.
 
@@ -222,17 +213,6 @@ INTERNAL_ERROR_INVALID_GLOBAL_ID (13)
 find the global object for a specific object identifier.  In case this
 happens, then this is probably an operating system bug.
 
-INTERNAL_ERROR_BAD_STACK_HOOK (14)
-The stack allocator hook or stack free hook is NULL.  This fatal error may
-occur during system initialization.  It is an application configuration
-error.
-
-INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0 (19)
-An object class is configured to use the unlimited objects option, however,
-the count of objects for each extension is zero.  This fatal error may
-occur during system initialization.  It is an application configuration
-error.
-
 INTERNAL_ERROR_NO_MEMORY_FOR_HEAP (23)
 There is not enough memory for the C program heap.  This fatal error may
 occur during system initialization.  It is an application configuration
@@ -372,15 +352,6 @@ INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED (33)
 occur during system initialization.  It is an application configuration
 error.
 
-INTERNAL_ERROR_LIBIO_USER_ENV_KEY_CREATE_FAILED (34)
-Creation of the IO library user environment POSIX key failed.  This fatal
-error may occur during system initialization.  It is an application
-configuration error.
-
-INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED (35)
-Creation of the IO library semaphore failed.  This fatal error may occur
-during system initialization.  It is an application configuration error.
-
 INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED (36)
 Open of the standard output file descriptor failed or resulted in an
 unexpected file descriptor number.  This fatal error may occur during
@@ -405,6 +376,14 @@ INTERNAL_ERROR_NO_MEMORY_FOR_PER_CPU_DATA (40)
 enough memory available to populate the per-CPU data areas, see
 ` 
`_.
 
+INTERNAL_ERROR_TOO_LARGE_TLS_SIZE (41)
+This fatal error may happen during system initialization.  The actual
+thread-local storage (TLS) size of the application exceeds the configured
+maximum, see
+:ref:`CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE 
`.
+You can get the thread-local storage size of an application using the RTEMS
+tool ``rtems-execinfo``.
+
 Operations
 ==
 
-- 
2.26.2

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel