• 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_clkfunc.h 1016 Bytes
/*
 * Copyright (c) 2017-2018, STMicroelectronics - All Rights Reserved
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef STM32MP1_CLKFUNC_H
#define STM32MP1_CLKFUNC_H

#include <stdbool.h>

enum stm32mp_osc_id {
	_HSI,
	_HSE,
	_CSI,
	_LSI,
	_LSE,
	_I2S_CKIN,
	_USB_PHY_48,
	NB_OSC,
	_UNKNOWN_OSC_ID = 0xFF
};

extern const char *stm32mp_osc_node_label[NB_OSC];

int fdt_osc_read_freq(const char *name, uint32_t *freq);
bool fdt_osc_read_bool(enum stm32mp_osc_id osc_id, const char *prop_name);
uint32_t fdt_osc_read_uint32_default(enum stm32mp_osc_id osc_id,
				     const char *prop_name,
				     uint32_t dflt_value);

uint32_t fdt_rcc_read_addr(void);
int fdt_rcc_read_uint32_array(const char *prop_name,
			      uint32_t *array, uint32_t count);
int fdt_rcc_subnode_offset(const char *name);
const uint32_t *fdt_rcc_read_prop(const char *prop_name, int *lenp);
bool fdt_get_rcc_secure_status(void);

uintptr_t fdt_get_stgen_base(void);
int fdt_get_clock_id(int node);

#endif /* STM32MP1_CLKFUNC_H */