mtk_sysctl.h revision 297666
1297666Ssgalabov/*- 2297666Ssgalabov * Copyright (c) 2016 Stanislav Galabov. 3297666Ssgalabov * All rights reserved. 4297666Ssgalabov * 5297666Ssgalabov * Redistribution and use in source and binary forms, with or without 6297666Ssgalabov * modification, are permitted provided that the following conditions 7297666Ssgalabov * are met: 8297666Ssgalabov * 1. Redistributions of source code must retain the above copyright 9297666Ssgalabov * notice unmodified, this list of conditions, and the following 10297666Ssgalabov * disclaimer. 11297666Ssgalabov * 2. Redistributions in binary form must reproduce the above copyright 12297666Ssgalabov * notice, this list of conditions and the following disclaimer in the 13297666Ssgalabov * documentation and/or other materials provided with the distribution. 14297666Ssgalabov * 15297666Ssgalabov * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16297666Ssgalabov * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17297666Ssgalabov * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18297666Ssgalabov * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19297666Ssgalabov * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20297666Ssgalabov * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21297666Ssgalabov * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22297666Ssgalabov * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23297666Ssgalabov * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24297666Ssgalabov * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25297666Ssgalabov * SUCH DAMAGE. 26297666Ssgalabov * 27297666Ssgalabov * $FreeBSD: head/sys/mips/mediatek/mtk_sysctl.h 297666 2016-04-07 11:02:49Z sgalabov $ 28297666Ssgalabov */ 29297666Ssgalabov 30297666Ssgalabov#ifndef _MTK_SYSCTL_H_ 31297666Ssgalabov#define _MTK_SYSCTL_H_ 32297666Ssgalabov 33297666Ssgalabov/* System Control */ 34297666Ssgalabov#define SYSCTL_CHIPID0_3 0x00 35297666Ssgalabov#define SYSCTL_CHIPID4_7 0x04 36297666Ssgalabov 37297666Ssgalabov#define SYSCTL_REVID 0x0C 38297666Ssgalabov#define SYSCTL_REVID_MASK 0xFFFF 39297666Ssgalabov#define SYSCTL_MT7621_REV_E 0x0101 40297666Ssgalabov 41297666Ssgalabov#define SYSCTL_SYSCFG 0x10 42297666Ssgalabov#define SYSCTL_SYSCFG1 0x14 43297666Ssgalabov#define SYSCTL_CLKCFG0 0x2C 44297666Ssgalabov#define SYSCTL_CLKCFG1 0x30 45297666Ssgalabov#define SYSCTL_RSTCTRL 0x34 46297666Ssgalabov#define SYSCTL_GPIOMODE 0x60 47297666Ssgalabov 48297666Ssgalabov#define SYSCTL_CUR_CLK_STS 0x44 49297666Ssgalabov 50297666Ssgalabov#define SYSCTL_MT7620_CPLL_CFG0 0x54 51297666Ssgalabov#define SYSCTL_MT7620_CPLL_CFG1 0x58 52297666Ssgalabov 53297666Ssgalabov#define SYSCFG1_USB_HOST_MODE (1<<10) 54297666Ssgalabov 55297666Ssgalabovextern uint32_t mtk_sysctl_get(uint32_t); 56297666Ssgalabovextern void mtk_sysctl_set(uint32_t, uint32_t); 57297666Ssgalabovextern void mtk_sysctl_clr_set(uint32_t, uint32_t, uint32_t); 58297666Ssgalabov 59297666Ssgalabov#endif /* _MTK_SYSCTL_H_ */ 60