• Antonio Nino Diaz's avatar
    Standardise header guards across codebase · c3cf06f1
    Antonio Nino Diaz authored
    
    All identifiers, regardless of use, that start with two underscores are
    reserved. This means they can't be used in header guards.
    
    The style that this project is now to use the full name of the file in
    capital letters followed by 'H'. For example, for a file called
    "uart_example.h", the header guard is UART_EXAMPLE_H.
    
    The exceptions are files that are imported from other projects:
    
    - CryptoCell driver
    - dt-bindings folders
    - zlib headers
    
    Change-Id: I50561bf6c88b491ec440d0c8385c74650f3c106e
    Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
    c3cf06f1
stm32mp1_clk.h 717 Bytes
/*
 * Copyright (c) 2018, STMicroelectronics - All Rights Reserved
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef STM32MP1_CLK_H
#define STM32MP1_CLK_H

#include <arch_helpers.h>
#include <stdbool.h>

int stm32mp1_clk_probe(void);
int stm32mp1_clk_init(void);
bool stm32mp1_clk_is_enabled(unsigned long id);
int stm32mp1_clk_enable(unsigned long id);
int stm32mp1_clk_disable(unsigned long id);
unsigned long stm32mp1_clk_get_rate(unsigned long id);
void stm32mp1_stgen_increment(unsigned long long offset_in_ms);

static inline uint32_t get_timer(uint32_t base)
{
	if (base == 0U) {
		return (uint32_t)(~read_cntpct_el0());
	}

	return base - (uint32_t)(~read_cntpct_el0());
}

#endif /* STM32MP1_CLK_H */