9 #ifndef _BLACKFIN_DPMC_H_
10 #define _BLACKFIN_DPMC_H_
28 #define PM_REGSET0 R7:7
29 #define PM_REGSET1 R7:6
30 #define PM_REGSET2 R7:5
31 #define PM_REGSET3 R7:4
32 #define PM_REGSET4 R7:3
33 #define PM_REGSET5 R7:2
34 #define PM_REGSET6 R7:1
35 #define PM_REGSET7 R7:0
36 #define PM_REGSET8 R7:0, P5:5
37 #define PM_REGSET9 R7:0, P5:4
38 #define PM_REGSET10 R7:0, P5:3
39 #define PM_REGSET11 R7:0, P5:2
40 #define PM_REGSET12 R7:0, P5:1
41 #define PM_REGSET13 R7:0, P5:0
43 #define _PM_PUSH(n, x, w, base) PM_REG##n = w[FP + ((x) - (base))];
44 #define _PM_POP(n, x, w, base) w[FP + ((x) - (base))] = PM_REG##n;
45 #define PM_PUSH_SYNC(n) [--sp] = (PM_REGSET##n);
46 #define PM_POP_SYNC(n) (PM_REGSET##n) = [sp++];
47 #define PM_PUSH(n, x) PM_REG##n = [FP++];
48 #define PM_POP(n, x) [FP--] = PM_REG##n;
49 #define PM_CORE_PUSH(n, x) _PM_PUSH(n, x, , COREMMR_BASE)
50 #define PM_CORE_POP(n, x) _PM_POP(n, x, , COREMMR_BASE)
51 #define PM_SYS_PUSH(n, x) _PM_PUSH(n, x, , SYSMMR_BASE)
52 #define PM_SYS_POP(n, x) _PM_POP(n, x, , SYSMMR_BASE)
53 #define PM_SYS_PUSH16(n, x) _PM_PUSH(n, x, w, SYSMMR_BASE)
54 #define PM_SYS_POP16(n, x) _PM_POP(n, x, w, SYSMMR_BASE)
56 .macro bfin_init_pm_bench_cycles
57 #ifdef CONFIG_BFIN_PM_WAKEUP_TIME_BENCH
67 .macro bfin_cpu_reg_save
72 [--
sp] = (
R7:0, P5:0);
111 #ifndef CONFIG_BFIN_PM_WAKEUP_TIME_BENCH
124 .macro bfin_cpu_reg_restore
130 #ifndef CONFIG_BFIN_PM_WAKEUP_TIME_BENCH
170 (
R7:0, P5:0) = [
sp++];
174 .macro bfin_sys_mmr_save
250 PM_SYS_PUSH16(6,
SYSCR)
269 .macro bfin_sys_mmr_restore
290 PM_SYS_POP16(6,
SYSCR)
364 .macro bfin_core_mmr_save
506 .macro bfin_core_mmr_restore
509 I0.L = lo(COREMMR_BASE);
528 PM_POP(7, ICPLB_DATA15)
548 PM_POP(5, ICPLB_ADDR15)
568 PM_POP(3, DCPLB_DATA15)
588 PM_POP(1, DCPLB_ADDR15)
657 #include <mach/pll.h>
661 #define PLL_OFF 0x0002
662 #define STOPCK 0x0008
665 # define IN_DELAY 0x0014
666 # define OUT_DELAY 0x00C0
668 # define IN_DELAY 0x0040
669 # define OUT_DELAY 0x0080
671 #define BYPASS 0x0100
673 #define SPORT_HYST 0x8000
674 #define SET_MSEL(x) (((x)&0x3F) << 0x9)
679 #define CSEL_DIV1 0x0000
680 #define CSEL_DIV2 0x0010
681 #define CSEL_DIV4 0x0020
682 #define CSEL_DIV8 0x0030
684 #define CCLK_DIV1 CSEL_DIV1
685 #define CCLK_DIV2 CSEL_DIV2
686 #define CCLK_DIV4 CSEL_DIV4
687 #define CCLK_DIV8 CSEL_DIV8
689 #define SET_SSEL(x) ((x) & 0xF)
690 #define SCLK_DIV(x) (x)
693 #define ACTIVE_PLLENABLED 0x0001
694 #define FULL_ON 0x0002
695 #define ACTIVE_PLLDISABLED 0x0004
696 #define PLL_LOCKED 0x0020
701 #define KPADWS 0x4000
706 #if defined(__ADSPBF52x__) || defined(__ADSPBF51x__)
708 #define FREQ_1000 0x3000
711 #define FREQ_333 0x0001
712 #define FREQ_667 0x0002
713 #define FREQ_1000 0x0003
715 #define HIBERNATE 0x0000
718 #define GAIN_5 0x0000
719 #define GAIN_10 0x0004
720 #define GAIN_20 0x0008
721 #define GAIN_50 0x000C
725 #define VLEV_085 0x0040
726 #define VLEV_090 0x0050
727 #define VLEV_095 0x0060
728 #define VLEV_100 0x0070
729 #define VLEV_105 0x0080
730 #define VLEV_110 0x0090
731 #define VLEV_115 0x00A0
732 #define VLEV_120 0x00B0
734 #define VLEV_085 0x0060
735 #define VLEV_090 0x0070
736 #define VLEV_095 0x0080
737 #define VLEV_100 0x0090
738 #define VLEV_105 0x00A0
739 #define VLEV_110 0x00B0
740 #define VLEV_115 0x00C0
741 #define VLEV_120 0x00D0
742 #define VLEV_125 0x00E0
743 #define VLEV_130 0x00F0
747 #define PA15WE 0x00000001
748 #define PB15WE 0x00000002
749 #define PC15WE 0x00000004
750 #define PD06WE 0x00000008
751 #define PE12WE 0x00000010
752 #define PG04WE 0x00000020
753 #define PG13WE 0x00000040
754 #define USBWE 0x00000080
760 #define MXVRWE 0x0400
761 #define KPADWE 0x1000
763 #define CLKBUFOE 0x4000
764 #define SCKELOW 0x8000
766 #if defined(__ADSPBF52x__) || defined(__ADSPBF51x__)
781 #define VRPAIR(vlev, freq) (((vlev) << 16) | ((freq) >> 16))
783 #ifdef CONFIG_CPU_FREQ
784 #define CPUFREQ_CPU 0