diff --git a/doc/framework.md b/doc/framework.md index 501c8d3c728b0cda3f03e7822a1945b7c1d48c81..4672c7ed7d1c10bbad1ebda5cbd5df133cbadd38 100644 --- a/doc/framework.md +++ b/doc/framework.md @@ -85,7 +85,9 @@ If a dual-region memory configuration is used then *FIRMWARE_MEM1_BASE* and It is the responsibility of the firmware to define - in its Makefile - the architecture target for the image (using *BS_FIRMWARE_CPU*) and whether the firmware is multithreading-enabled (using *BS_FIRMWARE_HAS_MULTITHREADING*) -and/or has notification support (using *BS_FIRMWARE_HAS_NOTIFICATION*). +and/or has notification support (using *BS_FIRMWARE_HAS_NOTIFICATION*). The +firmware can optionally define the count of notification subscriptions +(using *BS_FIRMWARE_NOTIFICATION_COUNT*) to be supported. An example of a simple firmware directory which contains configuration files for two modules, the firmware.mk file, and the linker script. diff --git a/framework/src/fwk_module.c b/framework/src/fwk_module.c index 389687e9e34394e1f70115f1c5dac5ad07e276df..6f3e29ad5ffdeb215c52881e581be24b48fdfb43 100644 --- a/framework/src/fwk_module.c +++ b/framework/src/fwk_module.c @@ -20,9 +20,12 @@ #endif #define EVENT_COUNT 64 -#define NOTIFICATION_COUNT 64 #define BIND_ROUND_MAX 1 +#ifndef NOTIFICATION_COUNT +#define NOTIFICATION_COUNT 64 +#endif + /* Pre-runtime phase stages */ enum module_stage { MODULE_STAGE_INITIALIZE, diff --git a/module/system_pll/include/mod_system_pll.h b/module/system_pll/include/mod_system_pll.h index 03b30fad960627d2f0ba773ccba0128b8f8a1da0..e16c1257c0e7048a2534851d4590c02b60f3194f 100644 --- a/module/system_pll/include/mod_system_pll.h +++ b/module/system_pll/include/mod_system_pll.h @@ -50,7 +50,7 @@ struct mod_system_pll_dev_config { * Mask for the bit within the status register that indicates whether the * PLL has locked at the programmed rate. */ - const uint8_t lock_flag_mask; + const uint32_t lock_flag_mask; /*! The initial rate the PLL is set to during initialization. */ const uint64_t initial_rate; diff --git a/tools/build_system/doc.md b/tools/build_system/doc.md index 92671b26c79262ad75ff24141830498cf8ec49f0..7067bf20bc4561a912512fefea8f49f5a8ace346 100644 --- a/tools/build_system/doc.md +++ b/tools/build_system/doc.md @@ -65,6 +65,9 @@ The following parameters are mandatory: to yes, firmware will be built with multithreading support. * __BS_FIRMWARE_HAS_NOTIFICATION__ - Notification support. When set to yes, firmware will be built with notification support. +* __BS_FIRMWARE_NOTIFICATION_COUNT__ < count > - When notification support is set + to yes, firmware can optinally specifiy the number notfication subscriptions + to be supported. * __BS_FIRMWARE_MODULES__ - The list of modules to be included and built into the firmware and any APIs to be omitted from each module. * __BS_FIRMWARE_MODULE_HEADERS_ONLY__ - The list of modules to have their header @@ -176,13 +179,19 @@ Notification Support {#section_notification} When building a firmware and its dependencies, the BS_FIRMWARE_HAS_NOTIFICATION parameter controls whether notification support -is enabled or not. +is enabled or not. If notification support is enabled, the firmware can define +the number of notification subscriptions supported on the platform using +BS_FIRMWARE_NOTIFICATION_COUNT parameter. When notification support is enabled, the following applies: * The BUILD_HAS_NOTIFICATION definition is defined for the units being built. * Notification specific APIs are made available to the modules via the framework components (see \ref GroupLibFramework). +* The BUILD_NOTIFICATION_COUNT definition is defined if the optional + parameter BS_FIRMWARE_NOTIFICATION_COUNT is defined. It specified the + number of notification subscriptions supported and set to the value + defined by BS_FIRMWARE_NOTIFICATION_COUNT parameter. Definitions =========== diff --git a/tools/build_system/firmware.mk b/tools/build_system/firmware.mk index 90feab02b6f2d191ae79b2c19929f0cc3e39a854..e2b4649d9d25c1fc2121f339aeb46ee7cb1f4412 100644 --- a/tools/build_system/firmware.mk +++ b/tools/build_system/firmware.mk @@ -204,6 +204,13 @@ else endif export BUILD_HAS_NOTIFICATION +ifeq ($(BUILD_HAS_NOTIFICATION),yes) + ifdef BS_FIRMWARE_NOTIFICATION_COUNT + BUILD_NOTIFICATION_COUNT=$(BS_FIRMWARE_NOTIFICATION_COUNT) + endif + export BUILD_NOTIFICATION_COUNT +endif + # Add directories to the list of targets to build LIB_TARGETS_y += $(patsubst %,$(MODULES_DIR)/%/src, \ $(BUILD_STANDARD_MODULES)) diff --git a/tools/build_system/rules.mk b/tools/build_system/rules.mk index 1fa2c5dd17385e8b64db7b5fe198dc10ae54a3ee..67bb655d1a2cd9c62e732031dd2cac2e32503dc7 100644 --- a/tools/build_system/rules.mk +++ b/tools/build_system/rules.mk @@ -21,6 +21,10 @@ ifeq ($(BUILD_HAS_NOTIFICATION),yes) DEFINES += BUILD_HAS_NOTIFICATION endif +ifdef BUILD_NOTIFICATION_COUNT + DEFINES += NOTIFICATION_COUNT=$(BUILD_NOTIFICATION_COUNT) +endif + export AS := $(CC) export LD := $(CC)