/** * \brief Enable a module clock derived from the PBB clock * \param module_index Index of the module clock in the PBBMASK register */ void sysclk_enable_pbb_module(uint32_t module_index) { irqflags_t flags; /* Enable the bridge if necessary */ flags = cpu_irq_save(); if (PM->PM_PBBMASK == 0) { sysclk_enable_hsb_module(SYSCLK_PBB_BRIDGE); } cpu_irq_restore(flags); /* Enable the module */ sysclk_priv_enable_module(PM_CLK_GRP_PBB, module_index); }
/** * \brief Enable a module clock derived from the PBB clock * \param index Index of the module clock in the PBBMASK register */ void sysclk_enable_pbb_module(unsigned int index) { irqflags_t flags; /* Enable the bridge if necessary */ flags = cpu_irq_save(); if (!sysclk_pbb_refcount) sysclk_enable_hsb_module(SYSCLK_PBB_BRIDGE); sysclk_pbb_refcount++; cpu_irq_restore(flags); /* Enable the module */ sysclk_priv_enable_module(AVR32_PM_CLK_GRP_PBB, index); }
/** * \brief Enable a module clock derived from the PBB clock * \param index Index of the module clock in the PBBMASK register */ void sysclk_enable_pbb_module(unsigned int index) { unsigned int pbus_id = 0; irqflags_t flags; /* The AES module is on PBC, others are on PBB */ if (index == SYSCLK_AES) pbus_id = 1; /* Enable the bridge if necessary */ flags = cpu_irq_save(); if (!sysclk_bus_refcount[pbus_id]) sysclk_enable_hsb_module(2 + (4 * pbus_id)); sysclk_bus_refcount[pbus_id]++; cpu_irq_restore(flags); /* Enable the module */ sysclk_priv_enable_module(AVR32_PM_CLK_GRP_PBB, index); }