162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci#ifndef __ASM_ARCH_OMAP_IO_H 362306a36Sopenharmony_ci#define __ASM_ARCH_OMAP_IO_H 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci#ifndef __ASSEMBLER__ 662306a36Sopenharmony_ci#include <linux/types.h> 762306a36Sopenharmony_ci 862306a36Sopenharmony_ci#ifdef CONFIG_ARCH_OMAP1 962306a36Sopenharmony_ci/* 1062306a36Sopenharmony_ci * NOTE: Please use ioremap + __raw_read/write where possible instead of these 1162306a36Sopenharmony_ci */ 1262306a36Sopenharmony_ciextern u8 omap_readb(u32 pa); 1362306a36Sopenharmony_ciextern u16 omap_readw(u32 pa); 1462306a36Sopenharmony_ciextern u32 omap_readl(u32 pa); 1562306a36Sopenharmony_ciextern void omap_writeb(u8 v, u32 pa); 1662306a36Sopenharmony_ciextern void omap_writew(u16 v, u32 pa); 1762306a36Sopenharmony_ciextern void omap_writel(u32 v, u32 pa); 1862306a36Sopenharmony_ci#elif defined(CONFIG_COMPILE_TEST) 1962306a36Sopenharmony_cistatic inline u8 omap_readb(u32 pa) { return 0; } 2062306a36Sopenharmony_cistatic inline u16 omap_readw(u32 pa) { return 0; } 2162306a36Sopenharmony_cistatic inline u32 omap_readl(u32 pa) { return 0; } 2262306a36Sopenharmony_cistatic inline void omap_writeb(u8 v, u32 pa) { } 2362306a36Sopenharmony_cistatic inline void omap_writew(u16 v, u32 pa) { } 2462306a36Sopenharmony_cistatic inline void omap_writel(u32 v, u32 pa) { } 2562306a36Sopenharmony_ci#endif 2662306a36Sopenharmony_ci#endif 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci/* 2962306a36Sopenharmony_ci * ---------------------------------------------------------------------------- 3062306a36Sopenharmony_ci * System control registers 3162306a36Sopenharmony_ci * ---------------------------------------------------------------------------- 3262306a36Sopenharmony_ci */ 3362306a36Sopenharmony_ci#define MOD_CONF_CTRL_0 0xfffe1080 3462306a36Sopenharmony_ci#define MOD_CONF_CTRL_1 0xfffe1110 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci/* 3762306a36Sopenharmony_ci * --------------------------------------------------------------------------- 3862306a36Sopenharmony_ci * UPLD 3962306a36Sopenharmony_ci * --------------------------------------------------------------------------- 4062306a36Sopenharmony_ci */ 4162306a36Sopenharmony_ci#define ULPD_REG_BASE (0xfffe0800) 4262306a36Sopenharmony_ci#define ULPD_IT_STATUS (ULPD_REG_BASE + 0x14) 4362306a36Sopenharmony_ci#define ULPD_SETUP_ANALOG_CELL_3 (ULPD_REG_BASE + 0x24) 4462306a36Sopenharmony_ci#define ULPD_CLOCK_CTRL (ULPD_REG_BASE + 0x30) 4562306a36Sopenharmony_ci# define DIS_USB_PVCI_CLK (1 << 5) /* no USB/FAC synch */ 4662306a36Sopenharmony_ci# define USB_MCLK_EN (1 << 4) /* enable W4_USB_CLKO */ 4762306a36Sopenharmony_ci#define ULPD_SOFT_REQ (ULPD_REG_BASE + 0x34) 4862306a36Sopenharmony_ci# define SOFT_UDC_REQ (1 << 4) 4962306a36Sopenharmony_ci# define SOFT_USB_CLK_REQ (1 << 3) 5062306a36Sopenharmony_ci# define SOFT_DPLL_REQ (1 << 0) 5162306a36Sopenharmony_ci#define ULPD_DPLL_CTRL (ULPD_REG_BASE + 0x3c) 5262306a36Sopenharmony_ci#define ULPD_STATUS_REQ (ULPD_REG_BASE + 0x40) 5362306a36Sopenharmony_ci#define ULPD_APLL_CTRL (ULPD_REG_BASE + 0x4c) 5462306a36Sopenharmony_ci#define ULPD_POWER_CTRL (ULPD_REG_BASE + 0x50) 5562306a36Sopenharmony_ci#define ULPD_SOFT_DISABLE_REQ_REG (ULPD_REG_BASE + 0x68) 5662306a36Sopenharmony_ci# define DIS_MMC2_DPLL_REQ (1 << 11) 5762306a36Sopenharmony_ci# define DIS_MMC1_DPLL_REQ (1 << 10) 5862306a36Sopenharmony_ci# define DIS_UART3_DPLL_REQ (1 << 9) 5962306a36Sopenharmony_ci# define DIS_UART2_DPLL_REQ (1 << 8) 6062306a36Sopenharmony_ci# define DIS_UART1_DPLL_REQ (1 << 7) 6162306a36Sopenharmony_ci# define DIS_USB_HOST_DPLL_REQ (1 << 6) 6262306a36Sopenharmony_ci#define ULPD_SDW_CLK_DIV_CTRL_SEL (ULPD_REG_BASE + 0x74) 6362306a36Sopenharmony_ci#define ULPD_CAM_CLK_CTRL (ULPD_REG_BASE + 0x7c) 6462306a36Sopenharmony_ci 6562306a36Sopenharmony_ci/* 6662306a36Sopenharmony_ci * ---------------------------------------------------------------------------- 6762306a36Sopenharmony_ci * Clocks 6862306a36Sopenharmony_ci * ---------------------------------------------------------------------------- 6962306a36Sopenharmony_ci */ 7062306a36Sopenharmony_ci#define CLKGEN_REG_BASE (0xfffece00) 7162306a36Sopenharmony_ci#define ARM_CKCTL (CLKGEN_REG_BASE + 0x0) 7262306a36Sopenharmony_ci#define ARM_IDLECT1 (CLKGEN_REG_BASE + 0x4) 7362306a36Sopenharmony_ci#define ARM_IDLECT2 (CLKGEN_REG_BASE + 0x8) 7462306a36Sopenharmony_ci#define ARM_EWUPCT (CLKGEN_REG_BASE + 0xC) 7562306a36Sopenharmony_ci#define ARM_RSTCT1 (CLKGEN_REG_BASE + 0x10) 7662306a36Sopenharmony_ci#define ARM_RSTCT2 (CLKGEN_REG_BASE + 0x14) 7762306a36Sopenharmony_ci#define ARM_SYSST (CLKGEN_REG_BASE + 0x18) 7862306a36Sopenharmony_ci#define ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24) 7962306a36Sopenharmony_ci 8062306a36Sopenharmony_ci#define CK_RATEF 1 8162306a36Sopenharmony_ci#define CK_IDLEF 2 8262306a36Sopenharmony_ci#define CK_ENABLEF 4 8362306a36Sopenharmony_ci#define CK_SELECTF 8 8462306a36Sopenharmony_ci#define SETARM_IDLE_SHIFT 8562306a36Sopenharmony_ci 8662306a36Sopenharmony_ci/* DPLL control registers */ 8762306a36Sopenharmony_ci#define DPLL_CTL (0xfffecf00) 8862306a36Sopenharmony_ci 8962306a36Sopenharmony_ci/* DSP clock control. Must use __raw_readw() and __raw_writew() with these */ 9062306a36Sopenharmony_ci#define DSP_CONFIG_REG_BASE IOMEM(0xe1008000) 9162306a36Sopenharmony_ci#define DSP_CKCTL (DSP_CONFIG_REG_BASE + 0x0) 9262306a36Sopenharmony_ci#define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4) 9362306a36Sopenharmony_ci#define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8) 9462306a36Sopenharmony_ci#define DSP_RSTCT2 (DSP_CONFIG_REG_BASE + 0x14) 9562306a36Sopenharmony_ci 9662306a36Sopenharmony_ci/* 9762306a36Sopenharmony_ci * ---------------------------------------------------------------------------- 9862306a36Sopenharmony_ci * Pulse-Width Light 9962306a36Sopenharmony_ci * ---------------------------------------------------------------------------- 10062306a36Sopenharmony_ci */ 10162306a36Sopenharmony_ci#define OMAP_PWL_BASE 0xfffb5800 10262306a36Sopenharmony_ci#define OMAP_PWL_ENABLE (OMAP_PWL_BASE + 0x00) 10362306a36Sopenharmony_ci#define OMAP_PWL_CLK_ENABLE (OMAP_PWL_BASE + 0x04) 10462306a36Sopenharmony_ci 10562306a36Sopenharmony_ci/* 10662306a36Sopenharmony_ci * ---------------------------------------------------------------------------- 10762306a36Sopenharmony_ci * Pin multiplexing registers 10862306a36Sopenharmony_ci * ---------------------------------------------------------------------------- 10962306a36Sopenharmony_ci */ 11062306a36Sopenharmony_ci#define FUNC_MUX_CTRL_0 0xfffe1000 11162306a36Sopenharmony_ci#define FUNC_MUX_CTRL_1 0xfffe1004 11262306a36Sopenharmony_ci#define FUNC_MUX_CTRL_2 0xfffe1008 11362306a36Sopenharmony_ci#define COMP_MODE_CTRL_0 0xfffe100c 11462306a36Sopenharmony_ci#define FUNC_MUX_CTRL_3 0xfffe1010 11562306a36Sopenharmony_ci#define FUNC_MUX_CTRL_4 0xfffe1014 11662306a36Sopenharmony_ci#define FUNC_MUX_CTRL_5 0xfffe1018 11762306a36Sopenharmony_ci#define FUNC_MUX_CTRL_6 0xfffe101C 11862306a36Sopenharmony_ci#define FUNC_MUX_CTRL_7 0xfffe1020 11962306a36Sopenharmony_ci#define FUNC_MUX_CTRL_8 0xfffe1024 12062306a36Sopenharmony_ci#define FUNC_MUX_CTRL_9 0xfffe1028 12162306a36Sopenharmony_ci#define FUNC_MUX_CTRL_A 0xfffe102C 12262306a36Sopenharmony_ci#define FUNC_MUX_CTRL_B 0xfffe1030 12362306a36Sopenharmony_ci#define FUNC_MUX_CTRL_C 0xfffe1034 12462306a36Sopenharmony_ci#define FUNC_MUX_CTRL_D 0xfffe1038 12562306a36Sopenharmony_ci#define PULL_DWN_CTRL_0 0xfffe1040 12662306a36Sopenharmony_ci#define PULL_DWN_CTRL_1 0xfffe1044 12762306a36Sopenharmony_ci#define PULL_DWN_CTRL_2 0xfffe1048 12862306a36Sopenharmony_ci#define PULL_DWN_CTRL_3 0xfffe104c 12962306a36Sopenharmony_ci#define PULL_DWN_CTRL_4 0xfffe10ac 13062306a36Sopenharmony_ci 13162306a36Sopenharmony_ci/* OMAP-1610 specific multiplexing registers */ 13262306a36Sopenharmony_ci#define FUNC_MUX_CTRL_E 0xfffe1090 13362306a36Sopenharmony_ci#define FUNC_MUX_CTRL_F 0xfffe1094 13462306a36Sopenharmony_ci#define FUNC_MUX_CTRL_10 0xfffe1098 13562306a36Sopenharmony_ci#define FUNC_MUX_CTRL_11 0xfffe109c 13662306a36Sopenharmony_ci#define FUNC_MUX_CTRL_12 0xfffe10a0 13762306a36Sopenharmony_ci#define PU_PD_SEL_0 0xfffe10b4 13862306a36Sopenharmony_ci#define PU_PD_SEL_1 0xfffe10b8 13962306a36Sopenharmony_ci#define PU_PD_SEL_2 0xfffe10bc 14062306a36Sopenharmony_ci#define PU_PD_SEL_3 0xfffe10c0 14162306a36Sopenharmony_ci#define PU_PD_SEL_4 0xfffe10c4 14262306a36Sopenharmony_ci 14362306a36Sopenharmony_ci#endif 144