1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 25655108aSChandan Nath /* 35655108aSChandan Nath * cpu.h 45655108aSChandan Nath * 55655108aSChandan Nath * AM33xx specific header file 65655108aSChandan Nath * 75655108aSChandan Nath * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/ 85655108aSChandan Nath */ 95655108aSChandan Nath 105655108aSChandan Nath #ifndef _AM33XX_CPU_H 115655108aSChandan Nath #define _AM33XX_CPU_H 125655108aSChandan Nath 135655108aSChandan Nath #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__)) 145655108aSChandan Nath #include <asm/types.h> 155655108aSChandan Nath #endif /* !(__KERNEL_STRICT_NAMES || __ASSEMBLY__) */ 165655108aSChandan Nath 175655108aSChandan Nath #include <asm/arch/hardware.h> 185655108aSChandan Nath 195655108aSChandan Nath #define CL_BIT(x) (0 << x) 205655108aSChandan Nath 215655108aSChandan Nath /* Timer register bits */ 225655108aSChandan Nath #define TCLR_ST BIT(0) /* Start=1 Stop=0 */ 235655108aSChandan Nath #define TCLR_AR BIT(1) /* Auto reload */ 245655108aSChandan Nath #define TCLR_PRE BIT(5) /* Pre-scaler enable */ 255655108aSChandan Nath #define TCLR_PTV_SHIFT (2) /* Pre-scaler shift value */ 265655108aSChandan Nath #define TCLR_PRE_DISABLE CL_BIT(5) /* Pre-scalar disable */ 2725b0a729SHannes Petermaier #define TCLR_CE BIT(6) /* compare mode enable */ 2825b0a729SHannes Petermaier #define TCLR_SCPWM BIT(7) /* pwm outpin behaviour */ 2925b0a729SHannes Petermaier #define TCLR_TCM BIT(8) /* edge detection of input pin*/ 3025b0a729SHannes Petermaier #define TCLR_TRG_SHIFT (10) /* trigmode on pwm outpin */ 3125b0a729SHannes Petermaier #define TCLR_PT BIT(12) /* pulse/toggle mode of outpin*/ 3225b0a729SHannes Petermaier #define TCLR_CAPTMODE BIT(13) /* capture mode */ 3325b0a729SHannes Petermaier #define TCLR_GPOCFG BIT(14) /* 0=output,1=input */ 345655108aSChandan Nath 3525b0a729SHannes Petermaier #define TCFG_RESET BIT(0) /* software reset */ 3625b0a729SHannes Petermaier #define TCFG_EMUFREE BIT(1) /* behaviour of tmr on debug */ 3725b0a729SHannes Petermaier #define TCFG_IDLEMOD_SHIFT (2) /* power management */ 385655108aSChandan Nath 391f957708SLokesh Vutla /* cpu-id for AM43XX AM33XX and TI81XX family */ 401f957708SLokesh Vutla #define AM437X 0xB98C 415655108aSChandan Nath #define AM335X 0xB944 428b029f22SMatt Porter #define TI81XX 0xB81E 438b029f22SMatt Porter #define DEVICE_ID (CTRL_BASE + 0x0600) 445287946cSTom Rini #define DEVICE_ID_MASK 0x1FFF 4559041a50SLokesh Vutla #define PACKAGE_TYPE_SHIFT 16 4659041a50SLokesh Vutla #define PACKAGE_TYPE_MASK (3 << 16) 4759041a50SLokesh Vutla 4859041a50SLokesh Vutla /* Package Type */ 4959041a50SLokesh Vutla #define PACKAGE_TYPE_UNDEFINED 0x0 5059041a50SLokesh Vutla #define PACKAGE_TYPE_ZCZ 0x1 5159041a50SLokesh Vutla #define PACKAGE_TYPE_ZCE 0x2 5259041a50SLokesh Vutla #define PACKAGE_TYPE_RESERVED 0x3 535287946cSTom Rini 545287946cSTom Rini /* MPU max frequencies */ 555287946cSTom Rini #define AM335X_ZCZ_300 0x1FEF 565287946cSTom Rini #define AM335X_ZCZ_600 0x1FAF 575287946cSTom Rini #define AM335X_ZCZ_720 0x1F2F 585287946cSTom Rini #define AM335X_ZCZ_800 0x1E2F 595287946cSTom Rini #define AM335X_ZCZ_1000 0x1C2F 605287946cSTom Rini #define AM335X_ZCE_300 0x1FDF 615287946cSTom Rini #define AM335X_ZCE_600 0x1F9F 625655108aSChandan Nath 635655108aSChandan Nath /* This gives the status of the boot mode pins on the evm */ 645655108aSChandan Nath #define SYSBOOT_MASK (BIT(0) | BIT(1) | BIT(2)\ 655655108aSChandan Nath | BIT(3) | BIT(4)) 665655108aSChandan Nath 675655108aSChandan Nath #define PRM_RSTCTRL_RESET 0x01 6870239507SLokesh Vutla #define PRM_RSTST_WARM_RESET_MASK 0x232 695655108aSChandan Nath 70025a0d40SRuss Dill /* EMIF Control register bits */ 71025a0d40SRuss Dill #define EMIF_CTRL_DEVOFF BIT(0) 72025a0d40SRuss Dill 735655108aSChandan Nath #ifndef __KERNEL_STRICT_NAMES 745655108aSChandan Nath #ifndef __ASSEMBLY__ 75d7ebbe9dSLukasz Majewski #include <asm/ti-common/omap_wdt.h> 768eb16b7fSIlya Yanok 77c06e498aSLokesh Vutla #ifndef CONFIG_AM43XX 785655108aSChandan Nath /* Encapsulating core pll registers */ 795655108aSChandan Nath struct cm_wkuppll { 805655108aSChandan Nath unsigned int wkclkstctrl; /* offset 0x00 */ 815655108aSChandan Nath unsigned int wkctrlclkctrl; /* offset 0x04 */ 82d88bc042STom Rini unsigned int wkgpio0clkctrl; /* offset 0x08 */ 835655108aSChandan Nath unsigned int wkl4wkclkctrl; /* offset 0x0c */ 8425b0a729SHannes Petermaier unsigned int timer0clkctrl; /* offset 0x10 */ 8525b0a729SHannes Petermaier unsigned int resv2[3]; 865655108aSChandan Nath unsigned int idlestdpllmpu; /* offset 0x20 */ 87694607b5SHeiko Schocher unsigned int sscdeltamstepdllmpu; /* off 0x24 */ 88694607b5SHeiko Schocher unsigned int sscmodfreqdivdpllmpu; /* off 0x28 */ 895655108aSChandan Nath unsigned int clkseldpllmpu; /* offset 0x2c */ 905655108aSChandan Nath unsigned int resv4[1]; 915655108aSChandan Nath unsigned int idlestdpllddr; /* offset 0x34 */ 925655108aSChandan Nath unsigned int resv5[2]; 935655108aSChandan Nath unsigned int clkseldpllddr; /* offset 0x40 */ 945655108aSChandan Nath unsigned int resv6[4]; 955655108aSChandan Nath unsigned int clkseldplldisp; /* offset 0x54 */ 965655108aSChandan Nath unsigned int resv7[1]; 975655108aSChandan Nath unsigned int idlestdpllcore; /* offset 0x5c */ 985655108aSChandan Nath unsigned int resv8[2]; 995655108aSChandan Nath unsigned int clkseldpllcore; /* offset 0x68 */ 1005655108aSChandan Nath unsigned int resv9[1]; 1015655108aSChandan Nath unsigned int idlestdpllper; /* offset 0x70 */ 1027df5cf35SIlya Yanok unsigned int resv10[2]; 1037df5cf35SIlya Yanok unsigned int clkdcoldodpllper; /* offset 0x7c */ 1045655108aSChandan Nath unsigned int divm4dpllcore; /* offset 0x80 */ 1055655108aSChandan Nath unsigned int divm5dpllcore; /* offset 0x84 */ 1065655108aSChandan Nath unsigned int clkmoddpllmpu; /* offset 0x88 */ 1075655108aSChandan Nath unsigned int clkmoddpllper; /* offset 0x8c */ 1085655108aSChandan Nath unsigned int clkmoddpllcore; /* offset 0x90 */ 1095655108aSChandan Nath unsigned int clkmoddpllddr; /* offset 0x94 */ 1105655108aSChandan Nath unsigned int clkmoddplldisp; /* offset 0x98 */ 1115655108aSChandan Nath unsigned int clkseldpllper; /* offset 0x9c */ 1125655108aSChandan Nath unsigned int divm2dpllddr; /* offset 0xA0 */ 1135655108aSChandan Nath unsigned int divm2dplldisp; /* offset 0xA4 */ 1145655108aSChandan Nath unsigned int divm2dpllmpu; /* offset 0xA8 */ 1155655108aSChandan Nath unsigned int divm2dpllper; /* offset 0xAC */ 1165655108aSChandan Nath unsigned int resv11[1]; 1175655108aSChandan Nath unsigned int wkup_uart0ctrl; /* offset 0xB4 */ 118b4116edeSPatil, Rachna unsigned int wkup_i2c0ctrl; /* offset 0xB8 */ 119072cefe0SHannes Petermaier unsigned int wkup_adctscctrl; /* offset 0xBC */ 12025b0a729SHannes Petermaier unsigned int resv12; 12125b0a729SHannes Petermaier unsigned int timer1clkctrl; /* offset 0xC4 */ 12225b0a729SHannes Petermaier unsigned int resv13[4]; 1235655108aSChandan Nath unsigned int divm6dpllcore; /* offset 0xD8 */ 1245655108aSChandan Nath }; 1255655108aSChandan Nath 1265655108aSChandan Nath /** 1275655108aSChandan Nath * Encapsulating peripheral functional clocks 1285655108aSChandan Nath * pll registers 1295655108aSChandan Nath */ 1305655108aSChandan Nath struct cm_perpll { 1315655108aSChandan Nath unsigned int l4lsclkstctrl; /* offset 0x00 */ 1325655108aSChandan Nath unsigned int l3sclkstctrl; /* offset 0x04 */ 1335655108aSChandan Nath unsigned int l4fwclkstctrl; /* offset 0x08 */ 1345655108aSChandan Nath unsigned int l3clkstctrl; /* offset 0x0c */ 135fb072a3eSChandan Nath unsigned int resv1; 136fb072a3eSChandan Nath unsigned int cpgmac0clkctrl; /* offset 0x14 */ 137d88bc042STom Rini unsigned int lcdclkctrl; /* offset 0x18 */ 138d88bc042STom Rini unsigned int usb0clkctrl; /* offset 0x1C */ 139d88bc042STom Rini unsigned int resv2; 140d88bc042STom Rini unsigned int tptc0clkctrl; /* offset 0x24 */ 1415655108aSChandan Nath unsigned int emifclkctrl; /* offset 0x28 */ 1425655108aSChandan Nath unsigned int ocmcramclkctrl; /* offset 0x2c */ 143fb072a3eSChandan Nath unsigned int gpmcclkctrl; /* offset 0x30 */ 144d88bc042STom Rini unsigned int mcasp0clkctrl; /* offset 0x34 */ 145d88bc042STom Rini unsigned int uart5clkctrl; /* offset 0x38 */ 146fb072a3eSChandan Nath unsigned int mmc0clkctrl; /* offset 0x3C */ 147fb072a3eSChandan Nath unsigned int elmclkctrl; /* offset 0x40 */ 148fb072a3eSChandan Nath unsigned int i2c2clkctrl; /* offset 0x44 */ 149fb072a3eSChandan Nath unsigned int i2c1clkctrl; /* offset 0x48 */ 150fb072a3eSChandan Nath unsigned int spi0clkctrl; /* offset 0x4C */ 151fb072a3eSChandan Nath unsigned int spi1clkctrl; /* offset 0x50 */ 152d88bc042STom Rini unsigned int resv3[3]; 1535655108aSChandan Nath unsigned int l4lsclkctrl; /* offset 0x60 */ 1545655108aSChandan Nath unsigned int l4fwclkctrl; /* offset 0x64 */ 155d88bc042STom Rini unsigned int mcasp1clkctrl; /* offset 0x68 */ 156d88bc042STom Rini unsigned int uart1clkctrl; /* offset 0x6C */ 157d88bc042STom Rini unsigned int uart2clkctrl; /* offset 0x70 */ 158d88bc042STom Rini unsigned int uart3clkctrl; /* offset 0x74 */ 159d88bc042STom Rini unsigned int uart4clkctrl; /* offset 0x78 */ 160d88bc042STom Rini unsigned int timer7clkctrl; /* offset 0x7C */ 1615655108aSChandan Nath unsigned int timer2clkctrl; /* offset 0x80 */ 162d88bc042STom Rini unsigned int timer3clkctrl; /* offset 0x84 */ 163d88bc042STom Rini unsigned int timer4clkctrl; /* offset 0x88 */ 164d88bc042STom Rini unsigned int resv4[8]; 165d88bc042STom Rini unsigned int gpio1clkctrl; /* offset 0xAC */ 166fb072a3eSChandan Nath unsigned int gpio2clkctrl; /* offset 0xB0 */ 167d88bc042STom Rini unsigned int gpio3clkctrl; /* offset 0xB4 */ 168d88bc042STom Rini unsigned int resv5; 169d88bc042STom Rini unsigned int tpccclkctrl; /* offset 0xBC */ 170d88bc042STom Rini unsigned int dcan0clkctrl; /* offset 0xC0 */ 171d88bc042STom Rini unsigned int dcan1clkctrl; /* offset 0xC4 */ 172072cefe0SHannes Petermaier unsigned int resv6; 173072cefe0SHannes Petermaier unsigned int epwmss1clkctrl; /* offset 0xCC */ 1745655108aSChandan Nath unsigned int emiffwclkctrl; /* offset 0xD0 */ 17514c0158bSHeiko Schocher unsigned int epwmss0clkctrl; /* offset 0xD4 */ 17614c0158bSHeiko Schocher unsigned int epwmss2clkctrl; /* offset 0xD8 */ 1775655108aSChandan Nath unsigned int l3instrclkctrl; /* offset 0xDC */ 1785655108aSChandan Nath unsigned int l3clkctrl; /* Offset 0xE0 */ 17925b0a729SHannes Petermaier unsigned int resv8[2]; 18025b0a729SHannes Petermaier unsigned int timer5clkctrl; /* offset 0xEC */ 18125b0a729SHannes Petermaier unsigned int timer6clkctrl; /* offset 0xF0 */ 182d88bc042STom Rini unsigned int mmc1clkctrl; /* offset 0xF4 */ 183d88bc042STom Rini unsigned int mmc2clkctrl; /* offset 0xF8 */ 184d88bc042STom Rini unsigned int resv9[8]; 1855655108aSChandan Nath unsigned int l4hsclkstctrl; /* offset 0x11C */ 1865655108aSChandan Nath unsigned int l4hsclkctrl; /* offset 0x120 */ 187fb072a3eSChandan Nath unsigned int resv10[8]; 188d88bc042STom Rini unsigned int cpswclkstctrl; /* offset 0x144 */ 18914c0158bSHeiko Schocher unsigned int lcdcclkstctrl; /* offset 0x148 */ 1905655108aSChandan Nath }; 1917ca1b2a2SLokesh Vutla 1927ca1b2a2SLokesh Vutla /* Encapsulating Display pll registers */ 1937ca1b2a2SLokesh Vutla struct cm_dpll { 19425b0a729SHannes Petermaier unsigned int resv1; 19525b0a729SHannes Petermaier unsigned int clktimer7clk; /* offset 0x04 */ 1967ca1b2a2SLokesh Vutla unsigned int clktimer2clk; /* offset 0x08 */ 19725b0a729SHannes Petermaier unsigned int clktimer3clk; /* offset 0x0C */ 19825b0a729SHannes Petermaier unsigned int clktimer4clk; /* offset 0x10 */ 19925b0a729SHannes Petermaier unsigned int resv2; 20025b0a729SHannes Petermaier unsigned int clktimer5clk; /* offset 0x18 */ 20125b0a729SHannes Petermaier unsigned int clktimer6clk; /* offset 0x1C */ 20225b0a729SHannes Petermaier unsigned int resv3[2]; 20325b0a729SHannes Petermaier unsigned int clktimer1clk; /* offset 0x28 */ 20425b0a729SHannes Petermaier unsigned int resv4[2]; 2057ca1b2a2SLokesh Vutla unsigned int clklcdcpixelclk; /* offset 0x34 */ 2067ca1b2a2SLokesh Vutla }; 207fc46bae2SJames Doublesin 208fc46bae2SJames Doublesin struct prm_device_inst { 209fc46bae2SJames Doublesin unsigned int prm_rstctrl; 210fc46bae2SJames Doublesin unsigned int prm_rsttime; 211fc46bae2SJames Doublesin unsigned int prm_rstst; 212fc46bae2SJames Doublesin }; 213c06e498aSLokesh Vutla #else 214c06e498aSLokesh Vutla /* Encapsulating core pll registers */ 215c06e498aSLokesh Vutla struct cm_wkuppll { 216c06e498aSLokesh Vutla unsigned int resv0[136]; 217c06e498aSLokesh Vutla unsigned int wkl4wkclkctrl; /* offset 0x220 */ 218fc2f15d2SKishon Vijay Abraham I unsigned int resv1[7]; 219fc2f15d2SKishon Vijay Abraham I unsigned int usbphy0clkctrl; /* offset 0x240 */ 220fc2f15d2SKishon Vijay Abraham I unsigned int resv112; 221fc2f15d2SKishon Vijay Abraham I unsigned int usbphy1clkctrl; /* offset 0x248 */ 222fc2f15d2SKishon Vijay Abraham I unsigned int resv113[45]; 223c06e498aSLokesh Vutla unsigned int wkclkstctrl; /* offset 0x300 */ 224c06e498aSLokesh Vutla unsigned int resv2[15]; 225c06e498aSLokesh Vutla unsigned int wkup_i2c0ctrl; /* offset 0x340 */ 226c06e498aSLokesh Vutla unsigned int resv3; 227c06e498aSLokesh Vutla unsigned int wkup_uart0ctrl; /* offset 0x348 */ 228c06e498aSLokesh Vutla unsigned int resv4[5]; 229c06e498aSLokesh Vutla unsigned int wkctrlclkctrl; /* offset 0x360 */ 230c06e498aSLokesh Vutla unsigned int resv5; 231c06e498aSLokesh Vutla unsigned int wkgpio0clkctrl; /* offset 0x368 */ 232c06e498aSLokesh Vutla 233c06e498aSLokesh Vutla unsigned int resv6[109]; 234c06e498aSLokesh Vutla unsigned int clkmoddpllcore; /* offset 0x520 */ 235c06e498aSLokesh Vutla unsigned int idlestdpllcore; /* offset 0x524 */ 236c06e498aSLokesh Vutla unsigned int resv61; 237c06e498aSLokesh Vutla unsigned int clkseldpllcore; /* offset 0x52C */ 238c06e498aSLokesh Vutla unsigned int resv7[2]; 239c06e498aSLokesh Vutla unsigned int divm4dpllcore; /* offset 0x538 */ 240c06e498aSLokesh Vutla unsigned int divm5dpllcore; /* offset 0x53C */ 241c06e498aSLokesh Vutla unsigned int divm6dpllcore; /* offset 0x540 */ 242c06e498aSLokesh Vutla 243c06e498aSLokesh Vutla unsigned int resv8[7]; 244c06e498aSLokesh Vutla unsigned int clkmoddpllmpu; /* offset 0x560 */ 245c06e498aSLokesh Vutla unsigned int idlestdpllmpu; /* offset 0x564 */ 246c06e498aSLokesh Vutla unsigned int resv9; 247c06e498aSLokesh Vutla unsigned int clkseldpllmpu; /* offset 0x56c */ 248c06e498aSLokesh Vutla unsigned int divm2dpllmpu; /* offset 0x570 */ 249c06e498aSLokesh Vutla 250c06e498aSLokesh Vutla unsigned int resv10[11]; 251c06e498aSLokesh Vutla unsigned int clkmoddpllddr; /* offset 0x5A0 */ 252c06e498aSLokesh Vutla unsigned int idlestdpllddr; /* offset 0x5A4 */ 253c06e498aSLokesh Vutla unsigned int resv11; 254c06e498aSLokesh Vutla unsigned int clkseldpllddr; /* offset 0x5AC */ 255c06e498aSLokesh Vutla unsigned int divm2dpllddr; /* offset 0x5B0 */ 256c06e498aSLokesh Vutla 257c06e498aSLokesh Vutla unsigned int resv12[11]; 258c06e498aSLokesh Vutla unsigned int clkmoddpllper; /* offset 0x5E0 */ 259c06e498aSLokesh Vutla unsigned int idlestdpllper; /* offset 0x5E4 */ 260c06e498aSLokesh Vutla unsigned int resv13; 261c06e498aSLokesh Vutla unsigned int clkseldpllper; /* offset 0x5EC */ 262c06e498aSLokesh Vutla unsigned int divm2dpllper; /* offset 0x5F0 */ 263c06e498aSLokesh Vutla unsigned int resv14[8]; 264c06e498aSLokesh Vutla unsigned int clkdcoldodpllper; /* offset 0x614 */ 265c06e498aSLokesh Vutla 266c06e498aSLokesh Vutla unsigned int resv15[2]; 267c06e498aSLokesh Vutla unsigned int clkmoddplldisp; /* offset 0x620 */ 268c06e498aSLokesh Vutla unsigned int resv16[2]; 269c06e498aSLokesh Vutla unsigned int clkseldplldisp; /* offset 0x62C */ 270c06e498aSLokesh Vutla unsigned int divm2dplldisp; /* offset 0x630 */ 271c06e498aSLokesh Vutla }; 272c06e498aSLokesh Vutla 273c06e498aSLokesh Vutla /* 274c06e498aSLokesh Vutla * Encapsulating peripheral functional clocks 275c06e498aSLokesh Vutla * pll registers 276c06e498aSLokesh Vutla */ 277c06e498aSLokesh Vutla struct cm_perpll { 278c06e498aSLokesh Vutla unsigned int l3clkstctrl; /* offset 0x00 */ 279c06e498aSLokesh Vutla unsigned int resv0[7]; 280c06e498aSLokesh Vutla unsigned int l3clkctrl; /* Offset 0x20 */ 281fc2f15d2SKishon Vijay Abraham I unsigned int resv112[7]; 282c06e498aSLokesh Vutla unsigned int l3instrclkctrl; /* offset 0x40 */ 283c06e498aSLokesh Vutla unsigned int resv2[3]; 284c06e498aSLokesh Vutla unsigned int ocmcramclkctrl; /* offset 0x50 */ 285c06e498aSLokesh Vutla unsigned int resv3[9]; 286c06e498aSLokesh Vutla unsigned int tpccclkctrl; /* offset 0x78 */ 287c06e498aSLokesh Vutla unsigned int resv4; 288c06e498aSLokesh Vutla unsigned int tptc0clkctrl; /* offset 0x80 */ 289c06e498aSLokesh Vutla 290c06e498aSLokesh Vutla unsigned int resv5[7]; 291c06e498aSLokesh Vutla unsigned int l4hsclkctrl; /* offset 0x0A0 */ 292c06e498aSLokesh Vutla unsigned int resv6; 293c06e498aSLokesh Vutla unsigned int l4fwclkctrl; /* offset 0x0A8 */ 294c06e498aSLokesh Vutla unsigned int resv7[85]; 295c06e498aSLokesh Vutla unsigned int l3sclkstctrl; /* offset 0x200 */ 296c06e498aSLokesh Vutla unsigned int resv8[7]; 297c06e498aSLokesh Vutla unsigned int gpmcclkctrl; /* offset 0x220 */ 298c06e498aSLokesh Vutla unsigned int resv9[5]; 299c06e498aSLokesh Vutla unsigned int mcasp0clkctrl; /* offset 0x238 */ 300c06e498aSLokesh Vutla unsigned int resv10; 301c06e498aSLokesh Vutla unsigned int mcasp1clkctrl; /* offset 0x240 */ 302c06e498aSLokesh Vutla unsigned int resv11; 303c06e498aSLokesh Vutla unsigned int mmc2clkctrl; /* offset 0x248 */ 304b56e71e2SSourav Poddar unsigned int resv12[3]; 305b56e71e2SSourav Poddar unsigned int qspiclkctrl; /* offset 0x258 */ 306b56e71e2SSourav Poddar unsigned int resv121; 307c06e498aSLokesh Vutla unsigned int usb0clkctrl; /* offset 0x260 */ 308fc2f15d2SKishon Vijay Abraham I unsigned int resv122; 309fc2f15d2SKishon Vijay Abraham I unsigned int usb1clkctrl; /* offset 0x268 */ 310fc2f15d2SKishon Vijay Abraham I unsigned int resv13[101]; 311c06e498aSLokesh Vutla unsigned int l4lsclkstctrl; /* offset 0x400 */ 312c06e498aSLokesh Vutla unsigned int resv14[7]; 313c06e498aSLokesh Vutla unsigned int l4lsclkctrl; /* offset 0x420 */ 314c06e498aSLokesh Vutla unsigned int resv15; 315c06e498aSLokesh Vutla unsigned int dcan0clkctrl; /* offset 0x428 */ 316c06e498aSLokesh Vutla unsigned int resv16; 317c06e498aSLokesh Vutla unsigned int dcan1clkctrl; /* offset 0x430 */ 318c06e498aSLokesh Vutla unsigned int resv17[13]; 319c06e498aSLokesh Vutla unsigned int elmclkctrl; /* offset 0x468 */ 320c06e498aSLokesh Vutla 321c06e498aSLokesh Vutla unsigned int resv18[3]; 322c06e498aSLokesh Vutla unsigned int gpio1clkctrl; /* offset 0x478 */ 323c06e498aSLokesh Vutla unsigned int resv19; 324c06e498aSLokesh Vutla unsigned int gpio2clkctrl; /* offset 0x480 */ 325c06e498aSLokesh Vutla unsigned int resv20; 326c06e498aSLokesh Vutla unsigned int gpio3clkctrl; /* offset 0x488 */ 327cd8341b7SDave Gerlach unsigned int resv41; 328cd8341b7SDave Gerlach unsigned int gpio4clkctrl; /* offset 0x490 */ 329cd8341b7SDave Gerlach unsigned int resv42; 330cd8341b7SDave Gerlach unsigned int gpio5clkctrl; /* offset 0x498 */ 331cd8341b7SDave Gerlach unsigned int resv21[3]; 332c06e498aSLokesh Vutla 333c06e498aSLokesh Vutla unsigned int i2c1clkctrl; /* offset 0x4A8 */ 334c06e498aSLokesh Vutla unsigned int resv22; 335c06e498aSLokesh Vutla unsigned int i2c2clkctrl; /* offset 0x4B0 */ 336c06e498aSLokesh Vutla unsigned int resv23[3]; 337c06e498aSLokesh Vutla unsigned int mmc0clkctrl; /* offset 0x4C0 */ 338c06e498aSLokesh Vutla unsigned int resv24; 339c06e498aSLokesh Vutla unsigned int mmc1clkctrl; /* offset 0x4C8 */ 340c06e498aSLokesh Vutla 341c06e498aSLokesh Vutla unsigned int resv25[13]; 342c06e498aSLokesh Vutla unsigned int spi0clkctrl; /* offset 0x500 */ 343c06e498aSLokesh Vutla unsigned int resv26; 344c06e498aSLokesh Vutla unsigned int spi1clkctrl; /* offset 0x508 */ 345c06e498aSLokesh Vutla unsigned int resv27[9]; 346c06e498aSLokesh Vutla unsigned int timer2clkctrl; /* offset 0x530 */ 347c06e498aSLokesh Vutla unsigned int resv28; 348c06e498aSLokesh Vutla unsigned int timer3clkctrl; /* offset 0x538 */ 349c06e498aSLokesh Vutla unsigned int resv29; 350c06e498aSLokesh Vutla unsigned int timer4clkctrl; /* offset 0x540 */ 351c06e498aSLokesh Vutla unsigned int resv30[5]; 352c06e498aSLokesh Vutla unsigned int timer7clkctrl; /* offset 0x558 */ 353c06e498aSLokesh Vutla 354c06e498aSLokesh Vutla unsigned int resv31[9]; 355c06e498aSLokesh Vutla unsigned int uart1clkctrl; /* offset 0x580 */ 356c06e498aSLokesh Vutla unsigned int resv32; 357c06e498aSLokesh Vutla unsigned int uart2clkctrl; /* offset 0x588 */ 358c06e498aSLokesh Vutla unsigned int resv33; 359c06e498aSLokesh Vutla unsigned int uart3clkctrl; /* offset 0x590 */ 360c06e498aSLokesh Vutla unsigned int resv34; 361c06e498aSLokesh Vutla unsigned int uart4clkctrl; /* offset 0x598 */ 362c06e498aSLokesh Vutla unsigned int resv35; 363c06e498aSLokesh Vutla unsigned int uart5clkctrl; /* offset 0x5A0 */ 364fc2f15d2SKishon Vijay Abraham I unsigned int resv36[5]; 365fc2f15d2SKishon Vijay Abraham I unsigned int usbphyocp2scp0clkctrl; /* offset 0x5B8 */ 366fc2f15d2SKishon Vijay Abraham I unsigned int resv361; 367fc2f15d2SKishon Vijay Abraham I unsigned int usbphyocp2scp1clkctrl; /* offset 0x5C0 */ 368fc2f15d2SKishon Vijay Abraham I unsigned int resv3611[79]; 369c06e498aSLokesh Vutla 370c06e498aSLokesh Vutla unsigned int emifclkstctrl; /* offset 0x700 */ 371fc2f15d2SKishon Vijay Abraham I unsigned int resv362[7]; 372c06e498aSLokesh Vutla unsigned int emifclkctrl; /* offset 0x720 */ 373c06e498aSLokesh Vutla unsigned int resv37[3]; 374c06e498aSLokesh Vutla unsigned int emiffwclkctrl; /* offset 0x730 */ 375c06e498aSLokesh Vutla unsigned int resv371; 376c06e498aSLokesh Vutla unsigned int otfaemifclkctrl; /* offset 0x738 */ 377c06e498aSLokesh Vutla unsigned int resv38[57]; 378c06e498aSLokesh Vutla unsigned int lcdclkctrl; /* offset 0x820 */ 379c06e498aSLokesh Vutla unsigned int resv39[183]; 380c06e498aSLokesh Vutla unsigned int cpswclkstctrl; /* offset 0xB00 */ 381c06e498aSLokesh Vutla unsigned int resv40[7]; 382c06e498aSLokesh Vutla unsigned int cpgmac0clkctrl; /* offset 0xB20 */ 383c06e498aSLokesh Vutla }; 3845655108aSChandan Nath 385d3daba10SLokesh Vutla struct cm_device_inst { 386d3daba10SLokesh Vutla unsigned int cm_clkout1_ctrl; 387d3daba10SLokesh Vutla unsigned int cm_dll_ctrl; 388d3daba10SLokesh Vutla }; 389d3daba10SLokesh Vutla 390fc46bae2SJames Doublesin struct prm_device_inst { 391025a0d40SRuss Dill unsigned int rstctrl; 392025a0d40SRuss Dill unsigned int rstst; 393025a0d40SRuss Dill unsigned int rsttime; 394025a0d40SRuss Dill unsigned int sram_count; 395025a0d40SRuss Dill unsigned int ldo_sram_core_set; /* offset 0x10 */ 396025a0d40SRuss Dill unsigned int ldo_sram_core_ctr; 397025a0d40SRuss Dill unsigned int ldo_sram_mpu_setu; 398025a0d40SRuss Dill unsigned int ldo_sram_mpu_ctrl; 399025a0d40SRuss Dill unsigned int io_count; /* offset 0x20 */ 400025a0d40SRuss Dill unsigned int io_pmctrl; 401025a0d40SRuss Dill unsigned int vc_val_bypass; 402025a0d40SRuss Dill unsigned int resv1; 403025a0d40SRuss Dill unsigned int emif_ctrl; /* offset 0x30 */ 404fc46bae2SJames Doublesin }; 405fc46bae2SJames Doublesin 4065655108aSChandan Nath struct cm_dpll { 4077ca1b2a2SLokesh Vutla unsigned int resv1; 4087ca1b2a2SLokesh Vutla unsigned int clktimer2clk; /* offset 0x04 */ 409bba379d4SSteve Kipisz unsigned int resv2[11]; 410bba379d4SSteve Kipisz unsigned int clkselmacclk; /* offset 0x34 */ 4115655108aSChandan Nath }; 4127ca1b2a2SLokesh Vutla #endif /* CONFIG_AM43XX */ 4135655108aSChandan Nath 414000820b5SVaibhav Hiremath /* Control Module RTC registers */ 415000820b5SVaibhav Hiremath struct cm_rtc { 416000820b5SVaibhav Hiremath unsigned int rtcclkctrl; /* offset 0x0 */ 417000820b5SVaibhav Hiremath unsigned int clkstctrl; /* offset 0x4 */ 418000820b5SVaibhav Hiremath }; 419000820b5SVaibhav Hiremath 4205655108aSChandan Nath /* Timer 32 bit registers */ 4215655108aSChandan Nath struct gptimer { 4225655108aSChandan Nath unsigned int tidr; /* offset 0x00 */ 423fb072a3eSChandan Nath unsigned char res1[12]; 4245655108aSChandan Nath unsigned int tiocp_cfg; /* offset 0x10 */ 425fb072a3eSChandan Nath unsigned char res2[12]; 4265655108aSChandan Nath unsigned int tier; /* offset 0x20 */ 4275655108aSChandan Nath unsigned int tistatr; /* offset 0x24 */ 4285655108aSChandan Nath unsigned int tistat; /* offset 0x28 */ 4295655108aSChandan Nath unsigned int tisr; /* offset 0x2c */ 4305655108aSChandan Nath unsigned int tcicr; /* offset 0x30 */ 4315655108aSChandan Nath unsigned int twer; /* offset 0x34 */ 4325655108aSChandan Nath unsigned int tclr; /* offset 0x38 */ 4335655108aSChandan Nath unsigned int tcrr; /* offset 0x3c */ 4345655108aSChandan Nath unsigned int tldr; /* offset 0x40 */ 4355655108aSChandan Nath unsigned int ttgr; /* offset 0x44 */ 4365655108aSChandan Nath unsigned int twpc; /* offset 0x48 */ 4375655108aSChandan Nath unsigned int tmar; /* offset 0x4c */ 4385655108aSChandan Nath unsigned int tcar1; /* offset 0x50 */ 4395655108aSChandan Nath unsigned int tscir; /* offset 0x54 */ 4405655108aSChandan Nath unsigned int tcar2; /* offset 0x58 */ 4415655108aSChandan Nath }; 4425655108aSChandan Nath 4435655108aSChandan Nath /* UART Registers */ 4445655108aSChandan Nath struct uart_sys { 4455655108aSChandan Nath unsigned int resv1[21]; 4465655108aSChandan Nath unsigned int uartsyscfg; /* offset 0x54 */ 4475655108aSChandan Nath unsigned int uartsyssts; /* offset 0x58 */ 4485655108aSChandan Nath }; 4495655108aSChandan Nath 4505655108aSChandan Nath /* VTP Registers */ 4515655108aSChandan Nath struct vtp_reg { 4525655108aSChandan Nath unsigned int vtp0ctrlreg; 4535655108aSChandan Nath }; 4545655108aSChandan Nath 4555655108aSChandan Nath /* Control Status Register */ 4565655108aSChandan Nath struct ctrl_stat { 4575655108aSChandan Nath unsigned int resv1[16]; 4585655108aSChandan Nath unsigned int statusreg; /* ofset 0x40 */ 4596995a289SSatyanarayana, Sandhya unsigned int resv2[51]; 4606995a289SSatyanarayana, Sandhya unsigned int secure_emif_sdram_config; /* offset 0x0110 */ 461cf04d032SLokesh Vutla unsigned int resv3[319]; 462cf04d032SLokesh Vutla unsigned int dev_attr; 4635655108aSChandan Nath }; 4643b97152bSSteve Sakoman 4653b97152bSSteve Sakoman /* AM33XX GPIO registers */ 4663b97152bSSteve Sakoman #define OMAP_GPIO_REVISION 0x0000 4673b97152bSSteve Sakoman #define OMAP_GPIO_SYSCONFIG 0x0010 4683b97152bSSteve Sakoman #define OMAP_GPIO_SYSSTATUS 0x0114 4693b97152bSSteve Sakoman #define OMAP_GPIO_IRQSTATUS1 0x002c 4703b97152bSSteve Sakoman #define OMAP_GPIO_IRQSTATUS2 0x0030 4719c410f7cSHeiko Schocher #define OMAP_GPIO_IRQSTATUS_SET_0 0x0034 4729c410f7cSHeiko Schocher #define OMAP_GPIO_IRQSTATUS_SET_1 0x0038 4733b97152bSSteve Sakoman #define OMAP_GPIO_CTRL 0x0130 4743b97152bSSteve Sakoman #define OMAP_GPIO_OE 0x0134 4753b97152bSSteve Sakoman #define OMAP_GPIO_DATAIN 0x0138 4763b97152bSSteve Sakoman #define OMAP_GPIO_DATAOUT 0x013c 4773b97152bSSteve Sakoman #define OMAP_GPIO_LEVELDETECT0 0x0140 4783b97152bSSteve Sakoman #define OMAP_GPIO_LEVELDETECT1 0x0144 4793b97152bSSteve Sakoman #define OMAP_GPIO_RISINGDETECT 0x0148 4803b97152bSSteve Sakoman #define OMAP_GPIO_FALLINGDETECT 0x014c 4813b97152bSSteve Sakoman #define OMAP_GPIO_DEBOUNCE_EN 0x0150 4823b97152bSSteve Sakoman #define OMAP_GPIO_DEBOUNCE_VAL 0x0154 4833b97152bSSteve Sakoman #define OMAP_GPIO_CLEARDATAOUT 0x0190 4843b97152bSSteve Sakoman #define OMAP_GPIO_SETDATAOUT 0x0194 4853b97152bSSteve Sakoman 486e79cd8ebSChandan Nath /* Control Device Register */ 4878038b497SCooper Jr., Franklin 4888038b497SCooper Jr., Franklin /* Control Device Register */ 4898038b497SCooper Jr., Franklin #define MREQPRIO_0_SAB_INIT1_MASK 0xFFFFFF8F 4908038b497SCooper Jr., Franklin #define MREQPRIO_0_SAB_INIT0_MASK 0xFFFFFFF8 4918038b497SCooper Jr., Franklin #define MREQPRIO_1_DSS_MASK 0xFFFFFF8F 4928038b497SCooper Jr., Franklin 493e79cd8ebSChandan Nath struct ctrl_dev { 494e79cd8ebSChandan Nath unsigned int deviceid; /* offset 0x00 */ 4957df5cf35SIlya Yanok unsigned int resv1[7]; 4967df5cf35SIlya Yanok unsigned int usb_ctrl0; /* offset 0x20 */ 4977df5cf35SIlya Yanok unsigned int resv2; 4987df5cf35SIlya Yanok unsigned int usb_ctrl1; /* offset 0x28 */ 4997df5cf35SIlya Yanok unsigned int resv3; 500e79cd8ebSChandan Nath unsigned int macid0l; /* offset 0x30 */ 501e79cd8ebSChandan Nath unsigned int macid0h; /* offset 0x34 */ 502e79cd8ebSChandan Nath unsigned int macid1l; /* offset 0x38 */ 503e79cd8ebSChandan Nath unsigned int macid1h; /* offset 0x3c */ 5047df5cf35SIlya Yanok unsigned int resv4[4]; 505e79cd8ebSChandan Nath unsigned int miisel; /* offset 0x50 */ 5068038b497SCooper Jr., Franklin unsigned int resv5[7]; 5078038b497SCooper Jr., Franklin unsigned int mreqprio_0; /* offset 0x70 */ 5088038b497SCooper Jr., Franklin unsigned int mreqprio_1; /* offset 0x74 */ 5098038b497SCooper Jr., Franklin unsigned int resv6[97]; 5105287946cSTom Rini unsigned int efuse_sma; /* offset 0x1FC */ 511e79cd8ebSChandan Nath }; 512dafd4db3SHeiko Schocher 5138038b497SCooper Jr., Franklin /* Bandwidth Limiter Portion of the L3Fast Configuration Register */ 5148038b497SCooper Jr., Franklin #define BW_LIMITER_BW_FRAC_MASK 0xFFFFFFE0 5158038b497SCooper Jr., Franklin #define BW_LIMITER_BW_INT_MASK 0xFFFFFFF0 5168038b497SCooper Jr., Franklin #define BW_LIMITER_BW_WATERMARK_MASK 0xFFFFF800 5178038b497SCooper Jr., Franklin 5188038b497SCooper Jr., Franklin struct l3f_cfg_bwlimiter { 5198038b497SCooper Jr., Franklin u32 padding0[2]; 5208038b497SCooper Jr., Franklin u32 modena_init0_bw_fractional; 5218038b497SCooper Jr., Franklin u32 modena_init0_bw_integer; 5228038b497SCooper Jr., Franklin u32 modena_init0_watermark_0; 5238038b497SCooper Jr., Franklin }; 5248038b497SCooper Jr., Franklin 525dafd4db3SHeiko Schocher /* gmii_sel register defines */ 526dafd4db3SHeiko Schocher #define GMII1_SEL_MII 0x0 527dafd4db3SHeiko Schocher #define GMII1_SEL_RMII 0x1 528dafd4db3SHeiko Schocher #define GMII1_SEL_RGMII 0x2 529dafd4db3SHeiko Schocher #define GMII2_SEL_MII 0x0 530dafd4db3SHeiko Schocher #define GMII2_SEL_RMII 0x4 531dafd4db3SHeiko Schocher #define GMII2_SEL_RGMII 0x8 532dafd4db3SHeiko Schocher #define RGMII1_IDMODE BIT(4) 533dafd4db3SHeiko Schocher #define RGMII2_IDMODE BIT(5) 534dafd4db3SHeiko Schocher #define RMII1_IO_CLK_EN BIT(6) 535dafd4db3SHeiko Schocher #define RMII2_IO_CLK_EN BIT(7) 536dafd4db3SHeiko Schocher 537dafd4db3SHeiko Schocher #define MII_MODE_ENABLE (GMII1_SEL_MII | GMII2_SEL_MII) 538dafd4db3SHeiko Schocher #define RMII_MODE_ENABLE (GMII1_SEL_RMII | GMII2_SEL_RMII) 539dafd4db3SHeiko Schocher #define RGMII_MODE_ENABLE (GMII1_SEL_RGMII | GMII2_SEL_RGMII) 540dafd4db3SHeiko Schocher #define RGMII_INT_DELAY (RGMII1_IDMODE | RGMII2_IDMODE) 541dafd4db3SHeiko Schocher #define RMII_CHIPCKL_ENABLE (RMII1_IO_CLK_EN | RMII2_IO_CLK_EN) 542dafd4db3SHeiko Schocher 54314c0158bSHeiko Schocher /* PWMSS */ 54414c0158bSHeiko Schocher struct pwmss_regs { 54514c0158bSHeiko Schocher unsigned int idver; 54614c0158bSHeiko Schocher unsigned int sysconfig; 54714c0158bSHeiko Schocher unsigned int clkconfig; 54814c0158bSHeiko Schocher unsigned int clkstatus; 54914c0158bSHeiko Schocher }; 55014c0158bSHeiko Schocher #define ECAP_CLK_EN BIT(0) 55114c0158bSHeiko Schocher #define ECAP_CLK_STOP_REQ BIT(1) 552f61c9bcdStomas.melin@vaisala.com #define EPWM_CLK_EN BIT(8) 553f61c9bcdStomas.melin@vaisala.com #define EPWM_CLK_STOP_REQ BIT(9) 55414c0158bSHeiko Schocher 55514c0158bSHeiko Schocher struct pwmss_ecap_regs { 55614c0158bSHeiko Schocher unsigned int tsctr; 55714c0158bSHeiko Schocher unsigned int ctrphs; 55814c0158bSHeiko Schocher unsigned int cap1; 55914c0158bSHeiko Schocher unsigned int cap2; 56014c0158bSHeiko Schocher unsigned int cap3; 56114c0158bSHeiko Schocher unsigned int cap4; 56214c0158bSHeiko Schocher unsigned int resv1[4]; 56314c0158bSHeiko Schocher unsigned short ecctl1; 56414c0158bSHeiko Schocher unsigned short ecctl2; 56514c0158bSHeiko Schocher }; 56614c0158bSHeiko Schocher 567f61c9bcdStomas.melin@vaisala.com struct pwmss_epwm_regs { 568f61c9bcdStomas.melin@vaisala.com unsigned short tbctl; 569f61c9bcdStomas.melin@vaisala.com unsigned short tbsts; 570f61c9bcdStomas.melin@vaisala.com unsigned short tbphshr; 571f61c9bcdStomas.melin@vaisala.com unsigned short tbphs; 572f61c9bcdStomas.melin@vaisala.com unsigned short tbcnt; 573f61c9bcdStomas.melin@vaisala.com unsigned short tbprd; 574f61c9bcdStomas.melin@vaisala.com unsigned short res1; 575f61c9bcdStomas.melin@vaisala.com unsigned short cmpctl; 576f61c9bcdStomas.melin@vaisala.com unsigned short cmpahr; 577f61c9bcdStomas.melin@vaisala.com unsigned short cmpa; 578f61c9bcdStomas.melin@vaisala.com unsigned short cmpb; 579f61c9bcdStomas.melin@vaisala.com unsigned short aqctla; 580f61c9bcdStomas.melin@vaisala.com unsigned short aqctlb; 581f61c9bcdStomas.melin@vaisala.com unsigned short aqsfrc; 582f61c9bcdStomas.melin@vaisala.com unsigned short aqcsfrc; 583f61c9bcdStomas.melin@vaisala.com unsigned short dbctl; 584f61c9bcdStomas.melin@vaisala.com unsigned short dbred; 585f61c9bcdStomas.melin@vaisala.com unsigned short dbfed; 586f61c9bcdStomas.melin@vaisala.com unsigned short tzsel; 587f61c9bcdStomas.melin@vaisala.com unsigned short tzctl; 588f61c9bcdStomas.melin@vaisala.com unsigned short tzflg; 589f61c9bcdStomas.melin@vaisala.com unsigned short tzclr; 590f61c9bcdStomas.melin@vaisala.com unsigned short tzfrc; 591f61c9bcdStomas.melin@vaisala.com unsigned short etsel; 592f61c9bcdStomas.melin@vaisala.com unsigned short etps; 593f61c9bcdStomas.melin@vaisala.com unsigned short etflg; 594f61c9bcdStomas.melin@vaisala.com unsigned short etclr; 595f61c9bcdStomas.melin@vaisala.com unsigned short etfrc; 596f61c9bcdStomas.melin@vaisala.com unsigned short pcctl; 597f61c9bcdStomas.melin@vaisala.com unsigned int res2[66]; 598f61c9bcdStomas.melin@vaisala.com unsigned short hrcnfg; 599f61c9bcdStomas.melin@vaisala.com }; 600f61c9bcdStomas.melin@vaisala.com 60114c0158bSHeiko Schocher /* Capture Control register 2 */ 60214c0158bSHeiko Schocher #define ECTRL2_SYNCOSEL_MASK (0x03 << 6) 60314c0158bSHeiko Schocher #define ECTRL2_MDSL_ECAP BIT(9) 60414c0158bSHeiko Schocher #define ECTRL2_CTRSTP_FREERUN BIT(4) 60514c0158bSHeiko Schocher #define ECTRL2_PLSL_LOW BIT(10) 60614c0158bSHeiko Schocher #define ECTRL2_SYNC_EN BIT(5) 60714c0158bSHeiko Schocher 6085655108aSChandan Nath #endif /* __ASSEMBLY__ */ 6095655108aSChandan Nath #endif /* __KERNEL_STRICT_NAMES */ 6105655108aSChandan Nath 6115655108aSChandan Nath #endif /* _AM33XX_CPU_H */ 612