Be consistent with register names in common QC/A header
[oweals/u-boot_mod.git] / u-boot / cpu / mips / ar7240 / qca_common.c
1 /*
2  * Qualcomm/Atheros WiSoCs common/helper functions
3  *
4  * Copyright (C) 2016 Piotr Dymacz <piotr@dymacz.pl>
5  *
6  * SPDX-License-Identifier: GPL-2.0
7  */
8
9 #include <config.h>
10 #include <common.h>
11 #include <asm/addrspace.h>
12 #include <soc/qca_soc_common.h>
13
14 /*
15  * Returns 1 if reference clock is 40 MHz
16  */
17 inline u32 qca_xtal_is_40mhz(void)
18 {
19         return ((qca_soc_reg_read(QCA_RST_BOOTSTRAP_REG) &
20                         QCA_RST_BOOTSTRAP_REF_CLK_MASK) >> QCA_RST_BOOTSTRAP_REF_CLK_SHIFT);
21 }
22
23 /*
24  * Performs full chip reset
25  */
26 void qca_full_chip_reset(void)
27 {
28         volatile u32 i = 1;
29
30         do {
31                 qca_soc_reg_write(QCA_RST_RESET_REG,
32                                                   QCA_RST_RESET_FULL_CHIP_RST_MASK
33                                                   | QCA_RST_RESET_DDR_RST_MASK);
34         } while (i);
35 }