18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * arch/arm/mach-omap2/control.h
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * OMAP2/3/4 System Control Module definitions
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright (C) 2007-2010 Texas Instruments, Inc.
78c2ecf20Sopenharmony_ci * Copyright (C) 2007-2008, 2010 Nokia Corporation
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * Written by Paul Walmsley
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify
128c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License as published by
138c2ecf20Sopenharmony_ci * the Free Software Foundation.
148c2ecf20Sopenharmony_ci */
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#ifndef __ARCH_ARM_MACH_OMAP2_CONTROL_H
178c2ecf20Sopenharmony_ci#define __ARCH_ARM_MACH_OMAP2_CONTROL_H
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#include "am33xx.h"
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__
228c2ecf20Sopenharmony_ci#define OMAP242X_CTRL_REGADDR(reg)					\
238c2ecf20Sopenharmony_ci		OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
248c2ecf20Sopenharmony_ci#define OMAP243X_CTRL_REGADDR(reg)					\
258c2ecf20Sopenharmony_ci		OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
268c2ecf20Sopenharmony_ci#define OMAP343X_CTRL_REGADDR(reg)					\
278c2ecf20Sopenharmony_ci		OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
288c2ecf20Sopenharmony_ci#define AM33XX_CTRL_REGADDR(reg)					\
298c2ecf20Sopenharmony_ci		AM33XX_L4_WK_IO_ADDRESS(AM33XX_SCM_BASE + (reg))
308c2ecf20Sopenharmony_ci#else
318c2ecf20Sopenharmony_ci#define OMAP242X_CTRL_REGADDR(reg)					\
328c2ecf20Sopenharmony_ci		OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
338c2ecf20Sopenharmony_ci#define OMAP243X_CTRL_REGADDR(reg)					\
348c2ecf20Sopenharmony_ci		OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
358c2ecf20Sopenharmony_ci#define OMAP343X_CTRL_REGADDR(reg)					\
368c2ecf20Sopenharmony_ci		OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
378c2ecf20Sopenharmony_ci#define AM33XX_CTRL_REGADDR(reg)					\
388c2ecf20Sopenharmony_ci		AM33XX_L4_WK_IO_ADDRESS(AM33XX_SCM_BASE + (reg))
398c2ecf20Sopenharmony_ci#endif /* __ASSEMBLY__ */
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci/*
428c2ecf20Sopenharmony_ci * As elsewhere, the "OMAP2_" prefix indicates that the macro is valid for
438c2ecf20Sopenharmony_ci * OMAP24XX and OMAP34XX.
448c2ecf20Sopenharmony_ci */
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci/* Control submodule offsets */
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_INTERFACE		0x000
498c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_PADCONFS		0x030
508c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_GENERAL		0x270
518c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_MEM_WKUP	0x600
528c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_PADCONFS_WKUP	0xa00
538c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_GENERAL_WKUP	0xa60
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/* TI81XX spefic control submodules */
568c2ecf20Sopenharmony_ci#define TI81XX_CONTROL_DEVBOOT		0x040
578c2ecf20Sopenharmony_ci#define TI81XX_CONTROL_DEVCONF		0x600
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci/* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_SYSCONFIG		(OMAP2_CONTROL_INTERFACE + 0x10)
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci/* CONTROL_GENERAL register offsets common to OMAP2 & 3 */
648c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_DEVCONF0		(OMAP2_CONTROL_GENERAL + 0x0004)
658c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_MSUSPENDMUX_0	(OMAP2_CONTROL_GENERAL + 0x0020)
668c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_MSUSPENDMUX_1	(OMAP2_CONTROL_GENERAL + 0x0024)
678c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_MSUSPENDMUX_2	(OMAP2_CONTROL_GENERAL + 0x0028)
688c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_MSUSPENDMUX_3	(OMAP2_CONTROL_GENERAL + 0x002c)
698c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_MSUSPENDMUX_4	(OMAP2_CONTROL_GENERAL + 0x0030)
708c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_MSUSPENDMUX_5	(OMAP2_CONTROL_GENERAL + 0x0034)
718c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_SEC_CTRL		(OMAP2_CONTROL_GENERAL + 0x0040)
728c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_RPUB_KEY_H_0	(OMAP2_CONTROL_GENERAL + 0x0090)
738c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_RPUB_KEY_H_1	(OMAP2_CONTROL_GENERAL + 0x0094)
748c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_RPUB_KEY_H_2	(OMAP2_CONTROL_GENERAL + 0x0098)
758c2ecf20Sopenharmony_ci#define OMAP2_CONTROL_RPUB_KEY_H_3	(OMAP2_CONTROL_GENERAL + 0x009c)
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci/* 242x-only CONTROL_GENERAL register offsets */
788c2ecf20Sopenharmony_ci#define OMAP242X_CONTROL_DEVCONF	OMAP2_CONTROL_DEVCONF0 /* match TRM */
798c2ecf20Sopenharmony_ci#define OMAP242X_CONTROL_OCM_RAM_PERM	(OMAP2_CONTROL_GENERAL + 0x0068)
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci/* 243x-only CONTROL_GENERAL register offsets */
828c2ecf20Sopenharmony_ci/* CONTROL_IVA2_BOOT{ADDR,MOD} are at the same place on 343x - noted below */
838c2ecf20Sopenharmony_ci#define OMAP243X_CONTROL_DEVCONF1	(OMAP2_CONTROL_GENERAL + 0x0078)
848c2ecf20Sopenharmony_ci#define OMAP243X_CONTROL_CSIRXFE	(OMAP2_CONTROL_GENERAL + 0x007c)
858c2ecf20Sopenharmony_ci#define OMAP243X_CONTROL_IVA2_BOOTADDR	(OMAP2_CONTROL_GENERAL + 0x0190)
868c2ecf20Sopenharmony_ci#define OMAP243X_CONTROL_IVA2_BOOTMOD	(OMAP2_CONTROL_GENERAL + 0x0194)
878c2ecf20Sopenharmony_ci#define OMAP243X_CONTROL_IVA2_GEMCFG	(OMAP2_CONTROL_GENERAL + 0x0198)
888c2ecf20Sopenharmony_ci#define OMAP243X_CONTROL_PBIAS_LITE	(OMAP2_CONTROL_GENERAL + 0x0230)
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci/* 24xx-only CONTROL_GENERAL register offsets */
918c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_DEBOBS		(OMAP2_CONTROL_GENERAL + 0x0000)
928c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_EMU_SUPPORT	(OMAP2_CONTROL_GENERAL + 0x0008)
938c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_SEC_TEST	(OMAP2_CONTROL_GENERAL + 0x0044)
948c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_PSA_CTRL	(OMAP2_CONTROL_GENERAL + 0x0048)
958c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_PSA_CMD	(OMAP2_CONTROL_GENERAL + 0x004c)
968c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_PSA_VALUE	(OMAP2_CONTROL_GENERAL + 0x0050)
978c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_SEC_EMU	(OMAP2_CONTROL_GENERAL + 0x0060)
988c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_SEC_TAP	(OMAP2_CONTROL_GENERAL + 0x0064)
998c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_OCM_PUB_RAM_ADD	(OMAP2_CONTROL_GENERAL + 0x006c)
1008c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_EXT_SEC_RAM_START_ADD	(OMAP2_CONTROL_GENERAL + 0x0070)
1018c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_EXT_SEC_RAM_STOP_ADD	(OMAP2_CONTROL_GENERAL + 0x0074)
1028c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_SEC_STATUS		(OMAP2_CONTROL_GENERAL + 0x0080)
1038c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_SEC_ERR_STATUS		(OMAP2_CONTROL_GENERAL + 0x0084)
1048c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_STATUS			(OMAP2_CONTROL_GENERAL + 0x0088)
1058c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_GENERAL_PURPOSE_STATUS	(OMAP2_CONTROL_GENERAL + 0x008c)
1068c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_RAND_KEY_0	(OMAP2_CONTROL_GENERAL + 0x00a0)
1078c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_RAND_KEY_1	(OMAP2_CONTROL_GENERAL + 0x00a4)
1088c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_RAND_KEY_2	(OMAP2_CONTROL_GENERAL + 0x00a8)
1098c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_RAND_KEY_3	(OMAP2_CONTROL_GENERAL + 0x00ac)
1108c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_CUST_KEY_0	(OMAP2_CONTROL_GENERAL + 0x00b0)
1118c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_CUST_KEY_1	(OMAP2_CONTROL_GENERAL + 0x00b4)
1128c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_TEST_KEY_0	(OMAP2_CONTROL_GENERAL + 0x00c0)
1138c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_TEST_KEY_1	(OMAP2_CONTROL_GENERAL + 0x00c4)
1148c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_TEST_KEY_2	(OMAP2_CONTROL_GENERAL + 0x00c8)
1158c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_TEST_KEY_3	(OMAP2_CONTROL_GENERAL + 0x00cc)
1168c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_TEST_KEY_4	(OMAP2_CONTROL_GENERAL + 0x00d0)
1178c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_TEST_KEY_5	(OMAP2_CONTROL_GENERAL + 0x00d4)
1188c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_TEST_KEY_6	(OMAP2_CONTROL_GENERAL + 0x00d8)
1198c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_TEST_KEY_7	(OMAP2_CONTROL_GENERAL + 0x00dc)
1208c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_TEST_KEY_8	(OMAP2_CONTROL_GENERAL + 0x00e0)
1218c2ecf20Sopenharmony_ci#define OMAP24XX_CONTROL_TEST_KEY_9	(OMAP2_CONTROL_GENERAL + 0x00e4)
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_PADCONF_SYSNIRQ (OMAP2_CONTROL_INTERFACE + 0x01b0)
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci/* 34xx-only CONTROL_GENERAL register offsets */
1268c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_PADCONF_OFF	(OMAP2_CONTROL_GENERAL + 0x0000)
1278c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_MEM_DFTRW0	(OMAP2_CONTROL_GENERAL + 0x0008)
1288c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_MEM_DFTRW1	(OMAP2_CONTROL_GENERAL + 0x000c)
1298c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_DEVCONF1	(OMAP2_CONTROL_GENERAL + 0x0068)
1308c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_CSIRXFE		(OMAP2_CONTROL_GENERAL + 0x006c)
1318c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_SEC_STATUS		(OMAP2_CONTROL_GENERAL + 0x0070)
1328c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_SEC_ERR_STATUS		(OMAP2_CONTROL_GENERAL + 0x0074)
1338c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_SEC_ERR_STATUS_DEBUG	(OMAP2_CONTROL_GENERAL + 0x0078)
1348c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_STATUS			(OMAP2_CONTROL_GENERAL + 0x0080)
1358c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS	(OMAP2_CONTROL_GENERAL + 0x0084)
1368c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_RPUB_KEY_H_4	(OMAP2_CONTROL_GENERAL + 0x00a0)
1378c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_RAND_KEY_0	(OMAP2_CONTROL_GENERAL + 0x00a8)
1388c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_RAND_KEY_1	(OMAP2_CONTROL_GENERAL + 0x00ac)
1398c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_RAND_KEY_2	(OMAP2_CONTROL_GENERAL + 0x00b0)
1408c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_RAND_KEY_3	(OMAP2_CONTROL_GENERAL + 0x00b4)
1418c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEST_KEY_0	(OMAP2_CONTROL_GENERAL + 0x00c8)
1428c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEST_KEY_1	(OMAP2_CONTROL_GENERAL + 0x00cc)
1438c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEST_KEY_2	(OMAP2_CONTROL_GENERAL + 0x00d0)
1448c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEST_KEY_3	(OMAP2_CONTROL_GENERAL + 0x00d4)
1458c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEST_KEY_4	(OMAP2_CONTROL_GENERAL + 0x00d8)
1468c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEST_KEY_5	(OMAP2_CONTROL_GENERAL + 0x00dc)
1478c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEST_KEY_6	(OMAP2_CONTROL_GENERAL + 0x00e0)
1488c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEST_KEY_7	(OMAP2_CONTROL_GENERAL + 0x00e4)
1498c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEST_KEY_8	(OMAP2_CONTROL_GENERAL + 0x00e8)
1508c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEST_KEY_9	(OMAP2_CONTROL_GENERAL + 0x00ec)
1518c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEST_KEY_10	(OMAP2_CONTROL_GENERAL + 0x00f0)
1528c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEST_KEY_11	(OMAP2_CONTROL_GENERAL + 0x00f4)
1538c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEST_KEY_12	(OMAP2_CONTROL_GENERAL + 0x00f8)
1548c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEST_KEY_13	(OMAP2_CONTROL_GENERAL + 0x00fc)
1558c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_FUSE_OPP1_VDD1 (OMAP2_CONTROL_GENERAL + 0x0110)
1568c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_FUSE_OPP2_VDD1 (OMAP2_CONTROL_GENERAL + 0x0114)
1578c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_FUSE_OPP3_VDD1 (OMAP2_CONTROL_GENERAL + 0x0118)
1588c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_FUSE_OPP4_VDD1 (OMAP2_CONTROL_GENERAL + 0x011c)
1598c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_FUSE_OPP5_VDD1 (OMAP2_CONTROL_GENERAL + 0x0120)
1608c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_FUSE_OPP1_VDD2 (OMAP2_CONTROL_GENERAL + 0x0124)
1618c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_FUSE_OPP2_VDD2 (OMAP2_CONTROL_GENERAL + 0x0128)
1628c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_FUSE_OPP3_VDD2 (OMAP2_CONTROL_GENERAL + 0x012c)
1638c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_FUSE_SR        (OMAP2_CONTROL_GENERAL + 0x0130)
1648c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_IVA2_BOOTADDR	(OMAP2_CONTROL_GENERAL + 0x0190)
1658c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_IVA2_BOOTMOD	(OMAP2_CONTROL_GENERAL + 0x0194)
1668c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_DEBOBS(i)	(OMAP2_CONTROL_GENERAL + 0x01B0 \
1678c2ecf20Sopenharmony_ci					+ ((i) >> 1) * 4 + (!((i) & 1)) * 2)
1688c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_PROG_IO0	(OMAP2_CONTROL_GENERAL + 0x01D4)
1698c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_PROG_IO1	(OMAP2_CONTROL_GENERAL + 0x01D8)
1708c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_DSS_DPLL_SPREADING	(OMAP2_CONTROL_GENERAL + 0x01E0)
1718c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_CORE_DPLL_SPREADING	(OMAP2_CONTROL_GENERAL + 0x01E4)
1728c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_PER_DPLL_SPREADING	(OMAP2_CONTROL_GENERAL + 0x01E8)
1738c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_USBHOST_DPLL_SPREADING	(OMAP2_CONTROL_GENERAL + 0x01EC)
1748c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_PBIAS_LITE	(OMAP2_CONTROL_GENERAL + 0x02B0)
1758c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_TEMP_SENSOR	(OMAP2_CONTROL_GENERAL + 0x02B4)
1768c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_SRAMLDO4	(OMAP2_CONTROL_GENERAL + 0x02B8)
1778c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_SRAMLDO5	(OMAP2_CONTROL_GENERAL + 0x02C0)
1788c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_CSI		(OMAP2_CONTROL_GENERAL + 0x02C4)
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_ci/* OMAP3630 only CONTROL_GENERAL register offsets */
1818c2ecf20Sopenharmony_ci#define OMAP3630_CONTROL_FUSE_OPP1G_VDD1        (OMAP2_CONTROL_GENERAL + 0x0110)
1828c2ecf20Sopenharmony_ci#define OMAP3630_CONTROL_FUSE_OPP50_VDD1        (OMAP2_CONTROL_GENERAL + 0x0114)
1838c2ecf20Sopenharmony_ci#define OMAP3630_CONTROL_FUSE_OPP100_VDD1       (OMAP2_CONTROL_GENERAL + 0x0118)
1848c2ecf20Sopenharmony_ci#define OMAP3630_CONTROL_FUSE_OPP120_VDD1       (OMAP2_CONTROL_GENERAL + 0x0120)
1858c2ecf20Sopenharmony_ci#define OMAP3630_CONTROL_FUSE_OPP50_VDD2        (OMAP2_CONTROL_GENERAL + 0x0128)
1868c2ecf20Sopenharmony_ci#define OMAP3630_CONTROL_FUSE_OPP100_VDD2       (OMAP2_CONTROL_GENERAL + 0x012C)
1878c2ecf20Sopenharmony_ci#define OMAP3630_CONTROL_CAMERA_PHY_CTRL	(OMAP2_CONTROL_GENERAL + 0x02f0)
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci/* OMAP44xx control efuse offsets */
1908c2ecf20Sopenharmony_ci#define OMAP44XX_CONTROL_FUSE_IVA_OPP50		0x22C
1918c2ecf20Sopenharmony_ci#define OMAP44XX_CONTROL_FUSE_IVA_OPP100	0x22F
1928c2ecf20Sopenharmony_ci#define OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO	0x232
1938c2ecf20Sopenharmony_ci#define OMAP44XX_CONTROL_FUSE_IVA_OPPNITRO	0x235
1948c2ecf20Sopenharmony_ci#define OMAP44XX_CONTROL_FUSE_MPU_OPP50		0x240
1958c2ecf20Sopenharmony_ci#define OMAP44XX_CONTROL_FUSE_MPU_OPP100	0x243
1968c2ecf20Sopenharmony_ci#define OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO	0x246
1978c2ecf20Sopenharmony_ci#define OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO	0x249
1988c2ecf20Sopenharmony_ci#define OMAP44XX_CONTROL_FUSE_MPU_OPPNITROSB	0x24C
1998c2ecf20Sopenharmony_ci#define OMAP44XX_CONTROL_FUSE_CORE_OPP50	0x254
2008c2ecf20Sopenharmony_ci#define OMAP44XX_CONTROL_FUSE_CORE_OPP100	0x257
2018c2ecf20Sopenharmony_ci#define OMAP44XX_CONTROL_FUSE_CORE_OPP100OV	0x25A
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci/* AM35XX only CONTROL_GENERAL register offsets */
2048c2ecf20Sopenharmony_ci#define AM35XX_CONTROL_MSUSPENDMUX_6    (OMAP2_CONTROL_GENERAL + 0x0038)
2058c2ecf20Sopenharmony_ci#define AM35XX_CONTROL_DEVCONF2         (OMAP2_CONTROL_GENERAL + 0x0310)
2068c2ecf20Sopenharmony_ci#define AM35XX_CONTROL_DEVCONF3         (OMAP2_CONTROL_GENERAL + 0x0314)
2078c2ecf20Sopenharmony_ci#define AM35XX_CONTROL_CBA_PRIORITY     (OMAP2_CONTROL_GENERAL + 0x0320)
2088c2ecf20Sopenharmony_ci#define AM35XX_CONTROL_LVL_INTR_CLEAR   (OMAP2_CONTROL_GENERAL + 0x0324)
2098c2ecf20Sopenharmony_ci#define AM35XX_CONTROL_IP_SW_RESET      (OMAP2_CONTROL_GENERAL + 0x0328)
2108c2ecf20Sopenharmony_ci#define AM35XX_CONTROL_IPSS_CLK_CTRL    (OMAP2_CONTROL_GENERAL + 0x032C)
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci/* 34xx PADCONF register offsets */
2138c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK(i)		(OMAP2_CONTROL_PADCONFS + 0x5a8 + \
2148c2ecf20Sopenharmony_ci						(i)*2)
2158c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_CLK	OMAP343X_PADCONF_ETK(0)
2168c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_CTL	OMAP343X_PADCONF_ETK(1)
2178c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D0		OMAP343X_PADCONF_ETK(2)
2188c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D1		OMAP343X_PADCONF_ETK(3)
2198c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D2		OMAP343X_PADCONF_ETK(4)
2208c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D3		OMAP343X_PADCONF_ETK(5)
2218c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D4		OMAP343X_PADCONF_ETK(6)
2228c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D5		OMAP343X_PADCONF_ETK(7)
2238c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D6		OMAP343X_PADCONF_ETK(8)
2248c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D7		OMAP343X_PADCONF_ETK(9)
2258c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D8		OMAP343X_PADCONF_ETK(10)
2268c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D9		OMAP343X_PADCONF_ETK(11)
2278c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D10	OMAP343X_PADCONF_ETK(12)
2288c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D11	OMAP343X_PADCONF_ETK(13)
2298c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D12	OMAP343X_PADCONF_ETK(14)
2308c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D13	OMAP343X_PADCONF_ETK(15)
2318c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D14	OMAP343X_PADCONF_ETK(16)
2328c2ecf20Sopenharmony_ci#define OMAP343X_PADCONF_ETK_D15	OMAP343X_PADCONF_ETK(17)
2338c2ecf20Sopenharmony_ci
2348c2ecf20Sopenharmony_ci/* 34xx GENERAL_WKUP register offsets */
2358c2ecf20Sopenharmony_ci#define OMAP34XX_CONTROL_WKUP_CTRL	(OMAP343X_CONTROL_GENERAL_WKUP - 0x4)
2368c2ecf20Sopenharmony_ci#define OMAP36XX_GPIO_IO_PWRDNZ		BIT(6)
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_WKUP_DEBOBSMUX(i) (OMAP343X_CONTROL_GENERAL_WKUP + \
2398c2ecf20Sopenharmony_ci						0x008 + (i))
2408c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_WKUP_DEBOBS0 (OMAP343X_CONTROL_GENERAL_WKUP + 0x008)
2418c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_WKUP_DEBOBS1 (OMAP343X_CONTROL_GENERAL_WKUP + 0x00C)
2428c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_WKUP_DEBOBS2 (OMAP343X_CONTROL_GENERAL_WKUP + 0x010)
2438c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_WKUP_DEBOBS3 (OMAP343X_CONTROL_GENERAL_WKUP + 0x014)
2448c2ecf20Sopenharmony_ci#define OMAP343X_CONTROL_WKUP_DEBOBS4 (OMAP343X_CONTROL_GENERAL_WKUP + 0x018)
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci/* 36xx-only RTA - Retention till Access control registers and bits */
2478c2ecf20Sopenharmony_ci#define OMAP36XX_CONTROL_MEM_RTA_CTRL	0x40C
2488c2ecf20Sopenharmony_ci#define OMAP36XX_RTA_DISABLE		0x0
2498c2ecf20Sopenharmony_ci
2508c2ecf20Sopenharmony_ci/* 34xx D2D idle-related pins, handled by PM core */
2518c2ecf20Sopenharmony_ci#define OMAP3_PADCONF_SAD2D_MSTANDBY   0x250
2528c2ecf20Sopenharmony_ci#define OMAP3_PADCONF_SAD2D_IDLEACK    0x254
2538c2ecf20Sopenharmony_ci
2548c2ecf20Sopenharmony_ci/* TI81XX CONTROL_DEVBOOT register offsets */
2558c2ecf20Sopenharmony_ci#define TI81XX_CONTROL_STATUS		(TI81XX_CONTROL_DEVBOOT + 0x000)
2568c2ecf20Sopenharmony_ci
2578c2ecf20Sopenharmony_ci/* TI81XX CONTROL_DEVCONF register offsets */
2588c2ecf20Sopenharmony_ci#define TI81XX_CONTROL_DEVICE_ID	(TI81XX_CONTROL_DEVCONF + 0x000)
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ci/* OMAP4 CONTROL MODULE */
2618c2ecf20Sopenharmony_ci#define OMAP4_CTRL_MODULE_PAD_WKUP			0x4a31e000
2628c2ecf20Sopenharmony_ci#define OMAP4_CTRL_MODULE_PAD_WKUP_CONTROL_I2C_2	0x0604
2638c2ecf20Sopenharmony_ci#define OMAP4_CTRL_MODULE_CORE_STATUS			0x02c4
2648c2ecf20Sopenharmony_ci#define OMAP4_CTRL_MODULE_CORE_STD_FUSE_PROD_ID_1	0x0218
2658c2ecf20Sopenharmony_ci#define OMAP4_CTRL_MODULE_CORE_DSP_BOOTADDR		0x0304
2668c2ecf20Sopenharmony_ci#define OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY	0x0618
2678c2ecf20Sopenharmony_ci#define OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_CAMERA_RX	0x0608
2688c2ecf20Sopenharmony_ci
2698c2ecf20Sopenharmony_ci/* OMAP4 CONTROL_DSIPHY */
2708c2ecf20Sopenharmony_ci#define OMAP4_DSI2_LANEENABLE_SHIFT			29
2718c2ecf20Sopenharmony_ci#define OMAP4_DSI2_LANEENABLE_MASK			(0x7 << 29)
2728c2ecf20Sopenharmony_ci#define OMAP4_DSI1_LANEENABLE_SHIFT			24
2738c2ecf20Sopenharmony_ci#define OMAP4_DSI1_LANEENABLE_MASK			(0x1f << 24)
2748c2ecf20Sopenharmony_ci#define OMAP4_DSI1_PIPD_SHIFT				19
2758c2ecf20Sopenharmony_ci#define OMAP4_DSI1_PIPD_MASK				(0x1f << 19)
2768c2ecf20Sopenharmony_ci#define OMAP4_DSI2_PIPD_SHIFT				14
2778c2ecf20Sopenharmony_ci#define OMAP4_DSI2_PIPD_MASK				(0x1f << 14)
2788c2ecf20Sopenharmony_ci
2798c2ecf20Sopenharmony_ci/* OMAP4 CONTROL_CAMERA_RX */
2808c2ecf20Sopenharmony_ci#define OMAP4_CAMERARX_CSI21_LANEENABLE_SHIFT		24
2818c2ecf20Sopenharmony_ci#define OMAP4_CAMERARX_CSI21_LANEENABLE_MASK		(0x1f << 24)
2828c2ecf20Sopenharmony_ci#define OMAP4_CAMERARX_CSI22_LANEENABLE_SHIFT		29
2838c2ecf20Sopenharmony_ci#define OMAP4_CAMERARX_CSI22_LANEENABLE_MASK		(0x3 << 29)
2848c2ecf20Sopenharmony_ci#define OMAP4_CAMERARX_CSI22_CTRLCLKEN_SHIFT		21
2858c2ecf20Sopenharmony_ci#define OMAP4_CAMERARX_CSI22_CTRLCLKEN_MASK		(1 << 21)
2868c2ecf20Sopenharmony_ci#define OMAP4_CAMERARX_CSI22_CAMMODE_SHIFT		19
2878c2ecf20Sopenharmony_ci#define OMAP4_CAMERARX_CSI22_CAMMODE_MASK		(0x3 << 19)
2888c2ecf20Sopenharmony_ci#define OMAP4_CAMERARX_CSI21_CTRLCLKEN_SHIFT		18
2898c2ecf20Sopenharmony_ci#define OMAP4_CAMERARX_CSI21_CTRLCLKEN_MASK		(1 << 18)
2908c2ecf20Sopenharmony_ci#define OMAP4_CAMERARX_CSI21_CAMMODE_SHIFT		16
2918c2ecf20Sopenharmony_ci#define OMAP4_CAMERARX_CSI21_CAMMODE_MASK		(0x3 << 16)
2928c2ecf20Sopenharmony_ci
2938c2ecf20Sopenharmony_ci/* OMAP54XX CONTROL STATUS register */
2948c2ecf20Sopenharmony_ci#define OMAP5XXX_CONTROL_STATUS                0x134
2958c2ecf20Sopenharmony_ci#define OMAP5_DEVICETYPE_MASK          (0x7 << 6)
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_ci/* DRA7XX CONTROL CORE BOOTSTRAP */
2988c2ecf20Sopenharmony_ci#define DRA7_CTRL_CORE_BOOTSTRAP	0x6c4
2998c2ecf20Sopenharmony_ci#define DRA7_SPEEDSELECT_MASK		(0x3 << 8)
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ci/*
3028c2ecf20Sopenharmony_ci * REVISIT: This list of registers is not comprehensive - there are more
3038c2ecf20Sopenharmony_ci * that should be added.
3048c2ecf20Sopenharmony_ci */
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ci/*
3078c2ecf20Sopenharmony_ci * Control module register bit defines - these should eventually go into
3088c2ecf20Sopenharmony_ci * their own regbits file.  Some of these will be complicated, depending
3098c2ecf20Sopenharmony_ci * on the device type (general-purpose, emulator, test, secure, bad, other)
3108c2ecf20Sopenharmony_ci * and the security mode (secure, non-secure, don't care)
3118c2ecf20Sopenharmony_ci */
3128c2ecf20Sopenharmony_ci/* CONTROL_DEVCONF0 bits */
3138c2ecf20Sopenharmony_ci#define OMAP2_MMCSDIO1ADPCLKISEL	(1 << 24) /* MMC1 loop back clock */
3148c2ecf20Sopenharmony_ci#define OMAP24XX_USBSTANDBYCTRL		(1 << 15)
3158c2ecf20Sopenharmony_ci#define OMAP2_MCBSP2_CLKS_MASK		(1 << 6)
3168c2ecf20Sopenharmony_ci#define OMAP2_MCBSP1_FSR_MASK		(1 << 4)
3178c2ecf20Sopenharmony_ci#define OMAP2_MCBSP1_CLKR_MASK		(1 << 3)
3188c2ecf20Sopenharmony_ci#define OMAP2_MCBSP1_CLKS_MASK		(1 << 2)
3198c2ecf20Sopenharmony_ci
3208c2ecf20Sopenharmony_ci/* CONTROL_DEVCONF1 bits */
3218c2ecf20Sopenharmony_ci#define OMAP243X_MMC1_ACTIVE_OVERWRITE	(1 << 31)
3228c2ecf20Sopenharmony_ci#define OMAP2_MMCSDIO2ADPCLKISEL	(1 << 6) /* MMC2 loop back clock */
3238c2ecf20Sopenharmony_ci#define OMAP2_MCBSP5_CLKS_MASK		(1 << 4) /* > 242x */
3248c2ecf20Sopenharmony_ci#define OMAP2_MCBSP4_CLKS_MASK		(1 << 2) /* > 242x */
3258c2ecf20Sopenharmony_ci#define OMAP2_MCBSP3_CLKS_MASK		(1 << 0) /* > 242x */
3268c2ecf20Sopenharmony_ci
3278c2ecf20Sopenharmony_ci/* CONTROL_STATUS bits */
3288c2ecf20Sopenharmony_ci#define OMAP2_DEVICETYPE_MASK		(0x7 << 8)
3298c2ecf20Sopenharmony_ci#define OMAP2_SYSBOOT_5_MASK		(1 << 5)
3308c2ecf20Sopenharmony_ci#define OMAP2_SYSBOOT_4_MASK		(1 << 4)
3318c2ecf20Sopenharmony_ci#define OMAP2_SYSBOOT_3_MASK		(1 << 3)
3328c2ecf20Sopenharmony_ci#define OMAP2_SYSBOOT_2_MASK		(1 << 2)
3338c2ecf20Sopenharmony_ci#define OMAP2_SYSBOOT_1_MASK		(1 << 1)
3348c2ecf20Sopenharmony_ci#define OMAP2_SYSBOOT_0_MASK		(1 << 0)
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_ci/* CONTROL_PBIAS_LITE bits */
3378c2ecf20Sopenharmony_ci#define OMAP343X_PBIASLITESUPPLY_HIGH1	(1 << 15)
3388c2ecf20Sopenharmony_ci#define OMAP343X_PBIASLITEVMODEERROR1	(1 << 11)
3398c2ecf20Sopenharmony_ci#define OMAP343X_PBIASSPEEDCTRL1	(1 << 10)
3408c2ecf20Sopenharmony_ci#define OMAP343X_PBIASLITEPWRDNZ1	(1 << 9)
3418c2ecf20Sopenharmony_ci#define OMAP343X_PBIASLITEVMODE1	(1 << 8)
3428c2ecf20Sopenharmony_ci#define OMAP343X_PBIASLITESUPPLY_HIGH0	(1 << 7)
3438c2ecf20Sopenharmony_ci#define OMAP343X_PBIASLITEVMODEERROR0	(1 << 3)
3448c2ecf20Sopenharmony_ci#define OMAP2_PBIASSPEEDCTRL0		(1 << 2)
3458c2ecf20Sopenharmony_ci#define OMAP2_PBIASLITEPWRDNZ0		(1 << 1)
3468c2ecf20Sopenharmony_ci#define OMAP2_PBIASLITEVMODE0		(1 << 0)
3478c2ecf20Sopenharmony_ci
3488c2ecf20Sopenharmony_ci/* CONTROL_PROG_IO1 bits */
3498c2ecf20Sopenharmony_ci#define OMAP3630_PRG_SDMMC1_SPEEDCTRL	(1 << 20)
3508c2ecf20Sopenharmony_ci
3518c2ecf20Sopenharmony_ci/* CONTROL_IVA2_BOOTMOD bits */
3528c2ecf20Sopenharmony_ci#define OMAP3_IVA2_BOOTMOD_SHIFT	0
3538c2ecf20Sopenharmony_ci#define OMAP3_IVA2_BOOTMOD_MASK		(0xf << 0)
3548c2ecf20Sopenharmony_ci#define OMAP3_IVA2_BOOTMOD_IDLE		(0x1 << 0)
3558c2ecf20Sopenharmony_ci
3568c2ecf20Sopenharmony_ci/* CONTROL_PADCONF_X bits */
3578c2ecf20Sopenharmony_ci#define OMAP3_PADCONF_WAKEUPEVENT0	(1 << 15)
3588c2ecf20Sopenharmony_ci#define OMAP3_PADCONF_WAKEUPENABLE0	(1 << 14)
3598c2ecf20Sopenharmony_ci
3608c2ecf20Sopenharmony_ci#define OMAP343X_SCRATCHPAD_ROM		(OMAP343X_CTRL_BASE + 0x860)
3618c2ecf20Sopenharmony_ci#define OMAP343X_SCRATCHPAD		(OMAP343X_CTRL_BASE + 0x910)
3628c2ecf20Sopenharmony_ci#define OMAP343X_SCRATCHPAD_ROM_OFFSET	0x19C
3638c2ecf20Sopenharmony_ci#define OMAP343X_SCRATCHPAD_REGADDR(reg)	OMAP2_L4_IO_ADDRESS(\
3648c2ecf20Sopenharmony_ci						OMAP343X_SCRATCHPAD + reg)
3658c2ecf20Sopenharmony_ci
3668c2ecf20Sopenharmony_ci/* AM35XX_CONTROL_IPSS_CLK_CTRL bits */
3678c2ecf20Sopenharmony_ci#define AM35XX_USBOTG_VBUSP_CLK_SHIFT	0
3688c2ecf20Sopenharmony_ci#define AM35XX_CPGMAC_VBUSP_CLK_SHIFT	1
3698c2ecf20Sopenharmony_ci#define AM35XX_VPFE_VBUSP_CLK_SHIFT	2
3708c2ecf20Sopenharmony_ci#define AM35XX_HECC_VBUSP_CLK_SHIFT	3
3718c2ecf20Sopenharmony_ci#define AM35XX_USBOTG_FCLK_SHIFT	8
3728c2ecf20Sopenharmony_ci#define AM35XX_CPGMAC_FCLK_SHIFT	9
3738c2ecf20Sopenharmony_ci#define AM35XX_VPFE_FCLK_SHIFT		10
3748c2ecf20Sopenharmony_ci
3758c2ecf20Sopenharmony_ci/* AM35XX CONTROL_LVL_INTR_CLEAR bits */
3768c2ecf20Sopenharmony_ci#define AM35XX_CPGMAC_C0_MISC_PULSE_CLR	BIT(0)
3778c2ecf20Sopenharmony_ci#define AM35XX_CPGMAC_C0_RX_PULSE_CLR	BIT(1)
3788c2ecf20Sopenharmony_ci#define AM35XX_CPGMAC_C0_RX_THRESH_CLR	BIT(2)
3798c2ecf20Sopenharmony_ci#define AM35XX_CPGMAC_C0_TX_PULSE_CLR	BIT(3)
3808c2ecf20Sopenharmony_ci#define AM35XX_USBOTGSS_INT_CLR		BIT(4)
3818c2ecf20Sopenharmony_ci#define AM35XX_VPFE_CCDC_VD0_INT_CLR	BIT(5)
3828c2ecf20Sopenharmony_ci#define AM35XX_VPFE_CCDC_VD1_INT_CLR	BIT(6)
3838c2ecf20Sopenharmony_ci#define AM35XX_VPFE_CCDC_VD2_INT_CLR	BIT(7)
3848c2ecf20Sopenharmony_ci
3858c2ecf20Sopenharmony_ci/* AM35XX CONTROL_IP_SW_RESET bits */
3868c2ecf20Sopenharmony_ci#define AM35XX_USBOTGSS_SW_RST		BIT(0)
3878c2ecf20Sopenharmony_ci#define AM35XX_CPGMACSS_SW_RST		BIT(1)
3888c2ecf20Sopenharmony_ci#define AM35XX_VPFE_VBUSP_SW_RST	BIT(2)
3898c2ecf20Sopenharmony_ci#define AM35XX_HECC_SW_RST		BIT(3)
3908c2ecf20Sopenharmony_ci#define AM35XX_VPFE_PCLK_SW_RST		BIT(4)
3918c2ecf20Sopenharmony_ci
3928c2ecf20Sopenharmony_ci/* AM33XX CONTROL_STATUS register */
3938c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_STATUS		0x040
3948c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_SEC_CLK_CTRL	0x1bc
3958c2ecf20Sopenharmony_ci
3968c2ecf20Sopenharmony_ci/* AM33XX CONTROL_STATUS bitfields (partial) */
3978c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_STATUS_SYSBOOT1_SHIFT		22
3988c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_STATUS_SYSBOOT1_WIDTH		0x2
3998c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_STATUS_SYSBOOT1_MASK		(0x3 << 22)
4008c2ecf20Sopenharmony_ci
4018c2ecf20Sopenharmony_ci/* AM33XX PWMSS Control register */
4028c2ecf20Sopenharmony_ci#define AM33XX_PWMSS_TBCLK_CLKCTRL			0x664
4038c2ecf20Sopenharmony_ci
4048c2ecf20Sopenharmony_ci/* AM33XX  PWMSS Control bitfields */
4058c2ecf20Sopenharmony_ci#define AM33XX_PWMSS0_TBCLKEN_SHIFT			0
4068c2ecf20Sopenharmony_ci#define AM33XX_PWMSS1_TBCLKEN_SHIFT			1
4078c2ecf20Sopenharmony_ci#define AM33XX_PWMSS2_TBCLKEN_SHIFT			2
4088c2ecf20Sopenharmony_ci
4098c2ecf20Sopenharmony_ci/* DEV Feature register to identify AM33XX features */
4108c2ecf20Sopenharmony_ci#define AM33XX_DEV_FEATURE		0x604
4118c2ecf20Sopenharmony_ci#define AM33XX_SGX_MASK			BIT(29)
4128c2ecf20Sopenharmony_ci
4138c2ecf20Sopenharmony_ci/* Additional AM33XX/AM43XX CONTROL registers */
4148c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_SYSCONFIG_OFFSET			0x0010
4158c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_STATUS_OFFSET			0x0040
4168c2ecf20Sopenharmony_ci#define AM43XX_CONTROL_MPU_L2_CTRL_OFFSET		0x01e0
4178c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_CORTEX_VBBLDO_CTRL_OFFSET	0x041c
4188c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_CORE_SLDO_CTRL_OFFSET		0x0428
4198c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_MPU_SLDO_CTRL_OFFSET		0x042c
4208c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_CLK32KDIVRATIO_CTRL_OFFSET	0x0444
4218c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_BANDGAP_CTRL_OFFSET		0x0448
4228c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_BANDGAP_TRIM_OFFSET		0x044c
4238c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_PLL_CLKINPULOW_CTRL_OFFSET	0x0458
4248c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_MOSC_CTRL_OFFSET			0x0468
4258c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_RCOSC_CTRL_OFFSET		0x046c
4268c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_DEEPSLEEP_CTRL_OFFSET		0x0470
4278c2ecf20Sopenharmony_ci#define AM43XX_CONTROL_DISPLAY_PLL_SEL_OFFSET		0x0534
4288c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_INIT_PRIORITY_0_OFFSET		0x0608
4298c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_INIT_PRIORITY_1_OFFSET		0x060c
4308c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_MMU_CFG_OFFSET			0x0610
4318c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPTC_CFG_OFFSET			0x0614
4328c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_USB_CTRL0_OFFSET			0x0620
4338c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_USB_CTRL1_OFFSET			0x0628
4348c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_USB_WKUP_CTRL_OFFSET		0x0648
4358c2ecf20Sopenharmony_ci#define AM43XX_CONTROL_USB_CTRL2_OFFSET			0x064c
4368c2ecf20Sopenharmony_ci#define AM43XX_CONTROL_GMII_SEL_OFFSET			0x0650
4378c2ecf20Sopenharmony_ci#define AM43XX_CONTROL_MPUSS_CTRL_OFFSET		0x0654
4388c2ecf20Sopenharmony_ci#define AM43XX_CONTROL_TIMER_CASCADE_CTRL_OFFSET	0x0658
4398c2ecf20Sopenharmony_ci#define AM43XX_CONTROL_PWMSS_CTRL_OFFSET		0x0664
4408c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_MREQPRIO_0_OFFSET		0x0670
4418c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_MREQPRIO_1_OFFSET		0x0674
4428c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_HW_EVENT_SEL_GRP1_OFFSET		0x0690
4438c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_HW_EVENT_SEL_GRP2_OFFSET		0x0694
4448c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_HW_EVENT_SEL_GRP3_OFFSET		0x0698
4458c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_HW_EVENT_SEL_GRP4_OFFSET		0x069c
4468c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_SMRT_CTRL_OFFSET			0x06a0
4478c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_MPUSS_HW_DEBUG_SEL_OFFSET	0x06a4
4488c2ecf20Sopenharmony_ci#define AM43XX_CONTROL_CQDETECT_STS_OFFSET		0x0e00
4498c2ecf20Sopenharmony_ci#define AM43XX_CONTROL_CQDETECT_STS2_OFFSET		0x0e08
4508c2ecf20Sopenharmony_ci#define AM43XX_CONTROL_VTP_CTRL_OFFSET			0x0e0c
4518c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_VREF_CTRL_OFFSET			0x0e14
4528c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_0_3_OFFSET		0x0f90
4538c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_4_7_OFFSET		0x0f94
4548c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_8_11_OFFSET		0x0f98
4558c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_12_15_OFFSET	0x0f9c
4568c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_16_19_OFFSET	0x0fa0
4578c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_20_23_OFFSET	0x0fa4
4588c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_24_27_OFFSET	0x0fa8
4598c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_28_31_OFFSET	0x0fac
4608c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_32_35_OFFSET	0x0fb0
4618c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_36_39_OFFSET	0x0fb4
4628c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_40_43_OFFSET	0x0fb8
4638c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_44_47_OFFSET	0x0fbc
4648c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_48_51_OFFSET	0x0fc0
4658c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_52_55_OFFSET	0x0fc4
4668c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_56_59_OFFSET	0x0fc8
4678c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TPCC_EVT_MUX_60_63_OFFSET	0x0fcc
4688c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_TIMER_EVT_CAPT_OFFSET		0x0fd0
4698c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_ECAP_EVT_CAPT_OFFSET		0x0fd4
4708c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_ADC_EVT_CAPT_OFFSET		0x0fd8
4718c2ecf20Sopenharmony_ci#define AM43XX_CONTROL_ADC1_EVT_CAPT_OFFSET		0x0fdc
4728c2ecf20Sopenharmony_ci#define AM33XX_CONTROL_RESET_ISO_OFFSET			0x1000
4738c2ecf20Sopenharmony_ci
4748c2ecf20Sopenharmony_ci/* CONTROL OMAP STATUS register to identify OMAP3 features */
4758c2ecf20Sopenharmony_ci#define OMAP3_CONTROL_OMAP_STATUS	0x044c
4768c2ecf20Sopenharmony_ci
4778c2ecf20Sopenharmony_ci#define OMAP3_SGX_SHIFT			13
4788c2ecf20Sopenharmony_ci#define OMAP3_SGX_MASK			(3 << OMAP3_SGX_SHIFT)
4798c2ecf20Sopenharmony_ci#define		FEAT_SGX_FULL		0
4808c2ecf20Sopenharmony_ci#define		FEAT_SGX_HALF		1
4818c2ecf20Sopenharmony_ci#define		FEAT_SGX_NONE		2
4828c2ecf20Sopenharmony_ci
4838c2ecf20Sopenharmony_ci#define OMAP3_IVA_SHIFT			12
4848c2ecf20Sopenharmony_ci#define OMAP3_IVA_MASK			(1 << OMAP3_IVA_SHIFT)
4858c2ecf20Sopenharmony_ci#define		FEAT_IVA		0
4868c2ecf20Sopenharmony_ci#define		FEAT_IVA_NONE		1
4878c2ecf20Sopenharmony_ci
4888c2ecf20Sopenharmony_ci#define OMAP3_L2CACHE_SHIFT		10
4898c2ecf20Sopenharmony_ci#define OMAP3_L2CACHE_MASK		(3 << OMAP3_L2CACHE_SHIFT)
4908c2ecf20Sopenharmony_ci#define		FEAT_L2CACHE_NONE	0
4918c2ecf20Sopenharmony_ci#define		FEAT_L2CACHE_64KB	1
4928c2ecf20Sopenharmony_ci#define		FEAT_L2CACHE_128KB	2
4938c2ecf20Sopenharmony_ci#define		FEAT_L2CACHE_256KB	3
4948c2ecf20Sopenharmony_ci
4958c2ecf20Sopenharmony_ci#define OMAP3_ISP_SHIFT			5
4968c2ecf20Sopenharmony_ci#define OMAP3_ISP_MASK			(1 << OMAP3_ISP_SHIFT)
4978c2ecf20Sopenharmony_ci#define		FEAT_ISP		0
4988c2ecf20Sopenharmony_ci#define		FEAT_ISP_NONE		1
4998c2ecf20Sopenharmony_ci
5008c2ecf20Sopenharmony_ci#define OMAP3_NEON_SHIFT		4
5018c2ecf20Sopenharmony_ci#define OMAP3_NEON_MASK			(1 << OMAP3_NEON_SHIFT)
5028c2ecf20Sopenharmony_ci#define		FEAT_NEON		0
5038c2ecf20Sopenharmony_ci#define		FEAT_NEON_NONE		1
5048c2ecf20Sopenharmony_ci
5058c2ecf20Sopenharmony_ci
5068c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__
5078c2ecf20Sopenharmony_ci#ifdef CONFIG_ARCH_OMAP2PLUS
5088c2ecf20Sopenharmony_ciextern u8 omap_ctrl_readb(u16 offset);
5098c2ecf20Sopenharmony_ciextern u16 omap_ctrl_readw(u16 offset);
5108c2ecf20Sopenharmony_ciextern u32 omap_ctrl_readl(u16 offset);
5118c2ecf20Sopenharmony_ciextern void omap_ctrl_writeb(u8 val, u16 offset);
5128c2ecf20Sopenharmony_ciextern void omap_ctrl_writew(u16 val, u16 offset);
5138c2ecf20Sopenharmony_ciextern void omap_ctrl_writel(u32 val, u16 offset);
5148c2ecf20Sopenharmony_ci
5158c2ecf20Sopenharmony_ciextern void omap3_save_scratchpad_contents(void);
5168c2ecf20Sopenharmony_ciextern void omap3_clear_scratchpad_contents(void);
5178c2ecf20Sopenharmony_ciextern void omap3_restore(void);
5188c2ecf20Sopenharmony_ciextern void omap3_restore_es3(void);
5198c2ecf20Sopenharmony_ciextern void omap3_restore_3630(void);
5208c2ecf20Sopenharmony_ciextern u32 omap3_arm_context[128];
5218c2ecf20Sopenharmony_ciextern void omap3_control_save_context(void);
5228c2ecf20Sopenharmony_ciextern void omap3_control_restore_context(void);
5238c2ecf20Sopenharmony_ciextern void omap3_ctrl_write_boot_mode(u8 bootmode);
5248c2ecf20Sopenharmony_ciextern void omap_ctrl_write_dsp_boot_addr(u32 bootaddr);
5258c2ecf20Sopenharmony_ciextern void omap_ctrl_write_dsp_boot_mode(u8 bootmode);
5268c2ecf20Sopenharmony_ciextern void omap3630_ctrl_disable_rta(void);
5278c2ecf20Sopenharmony_ciextern int omap3_ctrl_save_padconf(void);
5288c2ecf20Sopenharmony_civoid omap3_ctrl_init(void);
5298c2ecf20Sopenharmony_ciint omap2_control_base_init(void);
5308c2ecf20Sopenharmony_ciint omap_control_init(void);
5318c2ecf20Sopenharmony_civoid omap2_set_globals_control(void __iomem *ctrl);
5328c2ecf20Sopenharmony_civoid __init omap3_control_legacy_iomap_init(void);
5338c2ecf20Sopenharmony_ci#else
5348c2ecf20Sopenharmony_ci#define omap_ctrl_readb(x)		0
5358c2ecf20Sopenharmony_ci#define omap_ctrl_readw(x)		0
5368c2ecf20Sopenharmony_ci#define omap_ctrl_readl(x)		0
5378c2ecf20Sopenharmony_ci#define omap4_ctrl_pad_readl(x)		0
5388c2ecf20Sopenharmony_ci#define omap_ctrl_writeb(x, y)		WARN_ON(1)
5398c2ecf20Sopenharmony_ci#define omap_ctrl_writew(x, y)		WARN_ON(1)
5408c2ecf20Sopenharmony_ci#define omap_ctrl_writel(x, y)		WARN_ON(1)
5418c2ecf20Sopenharmony_ci#define omap4_ctrl_pad_writel(x, y)	WARN_ON(1)
5428c2ecf20Sopenharmony_ci#endif
5438c2ecf20Sopenharmony_ci#endif	/* __ASSEMBLY__ */
5448c2ecf20Sopenharmony_ci
5458c2ecf20Sopenharmony_ci#endif /* __ARCH_ARM_MACH_OMAP2_CONTROL_H */
5468c2ecf20Sopenharmony_ci
547