1150c2493STom Warren /* 2*9399e540SStephen Warren * (C) Copyright 2010,2011,2014 3150c2493STom Warren * NVIDIA Corporation <www.nvidia.com> 4150c2493STom Warren * 51a459660SWolfgang Denk * SPDX-License-Identifier: GPL-2.0+ 6150c2493STom Warren */ 7150c2493STom Warren 8150c2493STom Warren #ifndef _PMC_H_ 9150c2493STom Warren #define _PMC_H_ 10150c2493STom Warren 11150c2493STom Warren /* Power Management Controller (APBDEV_PMC_) registers */ 12150c2493STom Warren struct pmc_ctlr { 13150c2493STom Warren uint pmc_cntrl; /* _CNTRL_0, offset 00 */ 14150c2493STom Warren uint pmc_sec_disable; /* _SEC_DISABLE_0, offset 04 */ 15150c2493STom Warren uint pmc_pmc_swrst; /* _PMC_SWRST_0, offset 08 */ 16150c2493STom Warren uint pmc_wake_mask; /* _WAKE_MASK_0, offset 0C */ 17150c2493STom Warren uint pmc_wake_lvl; /* _WAKE_LVL_0, offset 10 */ 18150c2493STom Warren uint pmc_wake_status; /* _WAKE_STATUS_0, offset 14 */ 19150c2493STom Warren uint pmc_sw_wake_status; /* _SW_WAKE_STATUS_0, offset 18 */ 20150c2493STom Warren uint pmc_dpd_pads_oride; /* _DPD_PADS_ORIDE_0, offset 1C */ 21150c2493STom Warren uint pmc_dpd_sample; /* _DPD_PADS_SAMPLE_0, offset 20 */ 22150c2493STom Warren uint pmc_dpd_enable; /* _DPD_PADS_ENABLE_0, offset 24 */ 23150c2493STom Warren uint pmc_pwrgate_timer_off; /* _PWRGATE_TIMER_OFF_0, offset 28 */ 24*9399e540SStephen Warren #if defined(CONFIG_TEGRA20) || defined(CONFIG_TEGRA30) 25150c2493STom Warren uint pmc_pwrgate_timer_on; /* _PWRGATE_TIMER_ON_0, offset 2C */ 26*9399e540SStephen Warren #else 27*9399e540SStephen Warren uint pmc_clamp_status; /* _CLAMP_STATUS_0, offset 2C */ 28*9399e540SStephen Warren #endif 29150c2493STom Warren uint pmc_pwrgate_toggle; /* _PWRGATE_TOGGLE_0, offset 30 */ 30150c2493STom Warren uint pmc_remove_clamping; /* _REMOVE_CLAMPING_CMD_0, offset 34 */ 31150c2493STom Warren uint pmc_pwrgate_status; /* _PWRGATE_STATUS_0, offset 38 */ 32150c2493STom Warren uint pmc_pwrgood_timer; /* _PWRGOOD_TIMER_0, offset 3C */ 33150c2493STom Warren uint pmc_blink_timer; /* _BLINK_TIMER_0, offset 40 */ 34150c2493STom Warren uint pmc_no_iopower; /* _NO_IOPOWER_0, offset 44 */ 35150c2493STom Warren uint pmc_pwr_det; /* _PWR_DET_0, offset 48 */ 36150c2493STom Warren uint pmc_pwr_det_latch; /* _PWR_DET_LATCH_0, offset 4C */ 37150c2493STom Warren 38150c2493STom Warren uint pmc_scratch0; /* _SCRATCH0_0, offset 50 */ 39150c2493STom Warren uint pmc_scratch1; /* _SCRATCH1_0, offset 54 */ 40150c2493STom Warren uint pmc_scratch2; /* _SCRATCH2_0, offset 58 */ 41150c2493STom Warren uint pmc_scratch3; /* _SCRATCH3_0, offset 5C */ 42150c2493STom Warren uint pmc_scratch4; /* _SCRATCH4_0, offset 60 */ 43150c2493STom Warren uint pmc_scratch5; /* _SCRATCH5_0, offset 64 */ 44150c2493STom Warren uint pmc_scratch6; /* _SCRATCH6_0, offset 68 */ 45150c2493STom Warren uint pmc_scratch7; /* _SCRATCH7_0, offset 6C */ 46150c2493STom Warren uint pmc_scratch8; /* _SCRATCH8_0, offset 70 */ 47150c2493STom Warren uint pmc_scratch9; /* _SCRATCH9_0, offset 74 */ 48150c2493STom Warren uint pmc_scratch10; /* _SCRATCH10_0, offset 78 */ 49150c2493STom Warren uint pmc_scratch11; /* _SCRATCH11_0, offset 7C */ 50150c2493STom Warren uint pmc_scratch12; /* _SCRATCH12_0, offset 80 */ 51150c2493STom Warren uint pmc_scratch13; /* _SCRATCH13_0, offset 84 */ 52150c2493STom Warren uint pmc_scratch14; /* _SCRATCH14_0, offset 88 */ 53150c2493STom Warren uint pmc_scratch15; /* _SCRATCH15_0, offset 8C */ 54150c2493STom Warren uint pmc_scratch16; /* _SCRATCH16_0, offset 90 */ 55150c2493STom Warren uint pmc_scratch17; /* _SCRATCH17_0, offset 94 */ 56150c2493STom Warren uint pmc_scratch18; /* _SCRATCH18_0, offset 98 */ 57150c2493STom Warren uint pmc_scratch19; /* _SCRATCH19_0, offset 9C */ 58150c2493STom Warren uint pmc_scratch20; /* _SCRATCH20_0, offset A0 */ 59150c2493STom Warren uint pmc_scratch21; /* _SCRATCH21_0, offset A4 */ 60150c2493STom Warren uint pmc_scratch22; /* _SCRATCH22_0, offset A8 */ 61150c2493STom Warren uint pmc_scratch23; /* _SCRATCH23_0, offset AC */ 62150c2493STom Warren 63150c2493STom Warren uint pmc_secure_scratch0; /* _SECURE_SCRATCH0_0, offset B0 */ 64150c2493STom Warren uint pmc_secure_scratch1; /* _SECURE_SCRATCH1_0, offset B4 */ 65150c2493STom Warren uint pmc_secure_scratch2; /* _SECURE_SCRATCH2_0, offset B8 */ 66150c2493STom Warren uint pmc_secure_scratch3; /* _SECURE_SCRATCH3_0, offset BC */ 67150c2493STom Warren uint pmc_secure_scratch4; /* _SECURE_SCRATCH4_0, offset C0 */ 68150c2493STom Warren uint pmc_secure_scratch5; /* _SECURE_SCRATCH5_0, offset C4 */ 69150c2493STom Warren 70150c2493STom Warren uint pmc_cpupwrgood_timer; /* _CPUPWRGOOD_TIMER_0, offset C8 */ 71150c2493STom Warren uint pmc_cpupwroff_timer; /* _CPUPWROFF_TIMER_0, offset CC */ 72150c2493STom Warren uint pmc_pg_mask; /* _PG_MASK_0, offset D0 */ 73150c2493STom Warren uint pmc_pg_mask_1; /* _PG_MASK_1_0, offset D4 */ 74150c2493STom Warren uint pmc_auto_wake_lvl; /* _AUTO_WAKE_LVL_0, offset D8 */ 75150c2493STom Warren uint pmc_auto_wake_lvl_mask; /* _AUTO_WAKE_LVL_MASK_0, offset DC */ 76150c2493STom Warren uint pmc_wake_delay; /* _WAKE_DELAY_0, offset E0 */ 77150c2493STom Warren uint pmc_pwr_det_val; /* _PWR_DET_VAL_0, offset E4 */ 78150c2493STom Warren uint pmc_ddr_pwr; /* _DDR_PWR_0, offset E8 */ 79150c2493STom Warren uint pmc_usb_debounce_del; /* _USB_DEBOUNCE_DEL_0, offset EC */ 80150c2493STom Warren uint pmc_usb_ao; /* _USB_AO_0, offset F0 */ 81150c2493STom Warren uint pmc_crypto_op; /* _CRYPTO_OP__0, offset F4 */ 82150c2493STom Warren uint pmc_pllp_wb0_override; /* _PLLP_WB0_OVERRIDE_0, offset F8 */ 83150c2493STom Warren 84150c2493STom Warren uint pmc_scratch24; /* _SCRATCH24_0, offset FC */ 85150c2493STom Warren uint pmc_scratch25; /* _SCRATCH24_0, offset 100 */ 86150c2493STom Warren uint pmc_scratch26; /* _SCRATCH24_0, offset 104 */ 87150c2493STom Warren uint pmc_scratch27; /* _SCRATCH24_0, offset 108 */ 88150c2493STom Warren uint pmc_scratch28; /* _SCRATCH24_0, offset 10C */ 89150c2493STom Warren uint pmc_scratch29; /* _SCRATCH24_0, offset 110 */ 90150c2493STom Warren uint pmc_scratch30; /* _SCRATCH24_0, offset 114 */ 91150c2493STom Warren uint pmc_scratch31; /* _SCRATCH24_0, offset 118 */ 92150c2493STom Warren uint pmc_scratch32; /* _SCRATCH24_0, offset 11C */ 93150c2493STom Warren uint pmc_scratch33; /* _SCRATCH24_0, offset 120 */ 94150c2493STom Warren uint pmc_scratch34; /* _SCRATCH24_0, offset 124 */ 95150c2493STom Warren uint pmc_scratch35; /* _SCRATCH24_0, offset 128 */ 96150c2493STom Warren uint pmc_scratch36; /* _SCRATCH24_0, offset 12C */ 97150c2493STom Warren uint pmc_scratch37; /* _SCRATCH24_0, offset 130 */ 98150c2493STom Warren uint pmc_scratch38; /* _SCRATCH24_0, offset 134 */ 99150c2493STom Warren uint pmc_scratch39; /* _SCRATCH24_0, offset 138 */ 100150c2493STom Warren uint pmc_scratch40; /* _SCRATCH24_0, offset 13C */ 101150c2493STom Warren uint pmc_scratch41; /* _SCRATCH24_0, offset 140 */ 102150c2493STom Warren uint pmc_scratch42; /* _SCRATCH24_0, offset 144 */ 103150c2493STom Warren 104150c2493STom Warren uint pmc_bo_mirror0; /* _BOUNDOUT_MIRROR0_0, offset 148 */ 105150c2493STom Warren uint pmc_bo_mirror1; /* _BOUNDOUT_MIRROR1_0, offset 14C */ 106150c2493STom Warren uint pmc_bo_mirror2; /* _BOUNDOUT_MIRROR2_0, offset 150 */ 107150c2493STom Warren uint pmc_sys_33v_en; /* _SYS_33V_EN_0, offset 154 */ 108150c2493STom Warren uint pmc_bo_mirror_access; /* _BOUNDOUT_MIRROR_ACCESS_0, off158 */ 109150c2493STom Warren uint pmc_gate; /* _GATE_0, offset 15C */ 110150c2493STom Warren }; 111150c2493STom Warren 112150c2493STom Warren #define CPU_PWRED 1 113150c2493STom Warren #define CPU_CLMP 1 114150c2493STom Warren 115150c2493STom Warren #define PARTID_CP 0xFFFFFFF8 116150c2493STom Warren #define START_CP (1 << 8) 117150c2493STom Warren 118150c2493STom Warren #define CPUPWRREQ_OE (1 << 16) 1192fc65e28STom Warren #define CPUPWRREQ_POL (1 << 15) 1202fc65e28STom Warren 1212fc65e28STom Warren #define CRAILID (0) 1222fc65e28STom Warren #define CE0ID (14) 1232fc65e28STom Warren #define C0NCID (15) 1242fc65e28STom Warren #define CRAIL (1 << CRAILID) 1252fc65e28STom Warren #define CE0 (1 << CE0ID) 1262fc65e28STom Warren #define C0NC (1 << C0NCID) 127150c2493STom Warren 128150c2493STom Warren #endif /* PMC_H */ 129