1 /* SPDX-License-Identifier: GPL-2.0 */
2 /************************************************************************
3 File : Clock H/w specific Information
5 Author: Pankaj Dev <pankaj.dev@st.com>
7 Copyright (C) 2014 STMicroelectronics
8 ************************************************************************/
10 #ifndef __CLKGEN_INFO_H
11 #define __CLKGEN_INFO_H
13 extern spinlock_t clkgen_a9_lock
;
21 static inline unsigned long clkgen_read(void __iomem
*base
,
22 struct clkgen_field
*field
)
24 return (readl(base
+ field
->offset
) >> field
->shift
) & field
->mask
;
28 static inline void clkgen_write(void __iomem
*base
, struct clkgen_field
*field
,
31 writel((readl(base
+ field
->offset
) &
32 ~(field
->mask
<< field
->shift
)) | (val
<< field
->shift
),
33 base
+ field
->offset
);
38 #define CLKGEN_FIELD(_offset, _mask, _shift) { \
44 #define CLKGEN_READ(pll, field) clkgen_read(pll->regs_base, \
47 #define CLKGEN_WRITE(pll, field, val) clkgen_write(pll->regs_base, \
48 &pll->data->field, val)
50 #endif /*__CLKGEN_INFO_H*/