- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

# include/pm/pm_v2_regs.h

Go to the documentation of this file.

    00001
    00041 #ifndef HARDWARE_PM_V2_REGS_H_INCLUDED
    00042 #define HARDWARE_PM_V2_REGS_H_INCLUDED
    00043
    00044 /* Register offsets */
    00045 #define PM_MCCTRL                       0x0000  /* Main Clock Control */
    00046 # define PM_MCCTRL_MCSEL_MASK           (3   <<  0)     /* Main clock select */
    00047 # define PM_MCCTRL_MCSEL(x)             ((x) <<  0)
    00048 # define PM_MCCTRL_MCSEL_SLOW           (0   <<  0)     /* Slow clock */
    00049 # define PM_MCCTRL_MCSEL_OSC0           (1   <<  0)     /* OSC0 */
    00050 # define PM_MCCTRL_MCSEL_PLL0           (2   <<  0)     /* PLL0 */
    00051 # define PM_MCCTRL_OSCEN(x)             (1 << ((x) + 2)) /* OSCx enable */
    00052 # define PM_MCCTRL_OSCEN_BIT(x)         ((x) + 2)       /* OSCx enable */
    00053 #define PM_CKSEL                        0x0004  /* Clock Select */
    00054 # define PM_CKSEL_CPUSEL(x)             ((x) <<  0)     /* CPU clock divider */
    00055 # define PM_CKSEL_CPUDIV                (1   <<  7)     /* CPU div enable */
    00056 # define PM_CKSEL_HSBSEL(x)             ((x) <<  8)     /* HSB clock divider */
    00057 # define PM_CKSEL_HSBDIV                (1   << 15)     /* HSB div enable */
    00058 # define PM_CKSEL_PBASEL(x)             ((x) << 16)     /* PBA clock divider */
    00059 # define PM_CKSEL_PBADIV                (1   << 23)     /* PBA div enable */
    00060 # define PM_CKSEL_PBBSEL(x)             ((x) << 24)     /* PBB clock divider */
    00061 # define PM_CKSEL_PBBDIV                (1   << 31)     /* PBB div enable */
    00062 #define PM_CPUMASK                      0x0008  /* CPU clock mask */
    00063 #define PM_HSBMASK                      0x000c  /* HSB clock mask */
    00064 #define PM_PBAMASK                      0x0010  /* PBA clock mask */
    00065 #define PM_PBBMASK                      0x0014  /* PBB clock mask */
    00066 #define PM_PLL(x)       (0x0020 + 4 * (x))      /* PLL control */
    00067 # define PM_PLL_PLLEN                   (1   <<  0)     /* PLL enable */
    00068 # define PM_PLL_PLLOSC(x)               ((x) <<  1)     /* Osc select */
    00069 # define PM_PLL_GET_PLLOSC(reg)         (((reg) >> 1) & 1)
    00070 # define PM_PLL_VCO_MHZ_MASK            (1   <<  2)     /* VCO frequency */
    00071 # define PM_PLL_VCO_MHZ_160_240         (0   <<  2)     /* 160-240 MHz */
    00072 # define PM_PLL_VCO_MHZ_80_180          (1   <<  2)     /* 80-180 MHz */
    00073 # define PM_PLL_OUTPUT_DIV_BY_2         (1   <<  3)     /* Divide by 2 */
    00074 # define PM_PLL_WIDE_BANDWIDTH_DIS      (1   <<  4)     /* Wide bandwidth */
    00075 # define PM_PLL_PLLDIV(x)               ((x) <<  8)     /* PLL divider */
    00076 # define PM_PLL_GET_PLLDIV(reg)         (((reg) >> 8) & 0xff)
    00077 # define PM_PLL_PLLMUL(x)               ((x) << 16)     /* PLL multiplier */
    00078 # define PM_PLL_GET_PLLMUL(reg)         (((reg) >> 16) & 0xff)
    00079 # define PM_PLL_PLLCOUNT(x)             ((x) << 24)     /* PLL startup count */
    00080 #define PM_OSCCTRL(x)   (0x0028 + 4 * (x))
    00081 # define PM_OSC_MODE_MASK               (7   <<  0)     /* Oscillator Mode */
    00082 # define PM_OSC_MODE_EXT                (0   <<  0)     /* External clock */
    00083 # define PM_OSC_MODE_XTAL               (1   <<  0)     /* Crystal */
    00084 # define PM_OSC_STARTUP_MASK            (7   <<  8)     /* Startup cycles */
    00085 # define PM_OSC_STARTUP_0               (0   <<  8)     /* 0 cycles */
    00086 # define PM_OSC_STARTUP_64              (1   <<  8)     /* 64 cycles */
    00087 # define PM_OSC_STARTUP_128             (2   <<  8)     /* 128 cycles */
    00088 # define PM_OSC_STARTUP_2048            (3   <<  8)     /* 2048 cycles */
    00089 # define PM_OSC_STARTUP_4096            (4   <<  8)     /* 4096 cycles */
    00090 # define PM_OSC_STARTUP_8192            (5   <<  8)     /* 8192 cycles */
    00091 # define PM_OSC_STARTUP_16384           (6   <<  8)     /* 16384 cycles */
    00092 #define PM_OSCCTRL32                    0x0030
    00093 # define PM_OSC32_EN                    (1   <<  0)     /* OSC32 enable */
    00094 # define PM_OSC32_MODE_MASK             (7   <<  8)     /* Oscillator Mode */
    00095 # define PM_OSC32_MODE_EXT              (0   <<  8)     /* External clock */
    00096 # define PM_OSC32_MODE_XTAL             (1   <<  8)     /* Crystal */
    00097 # define PM_OSC32_STARTUP_MASK          (7   << 16)     /* Startup cycles */
    00098 # define PM_OSC32_STARTUP_0             (0   << 16)     /* 0 cycles */
    00099 # define PM_OSC32_STARTUP_128           (1   << 16)     /* 128 cycles */
    00100 # define PM_OSC32_STARTUP_8192          (2   << 16)     /* 8192 cycles */
    00101 # define PM_OSC32_STARTUP_16384         (3   << 16)     /* 16384 cycles */
    00102 # define PM_OSC32_STARTUP_65536         (4   << 16)     /* 65536 cycles */
    00103 # define PM_OSC32_STARTUP_131072        (5   << 16)     /* 131072 cycles */
    00104 # define PM_OSC32_STARTUP_262144        (6   << 16)     /* 262144 cycles */
    00105 # define PM_OSC32_STARTUP_524288        (7   << 16)     /* 524288 cycles */
    00106 #define PM_IER                          0x0040
    00107 #define PM_IDR                          0x0044
    00108 #define PM_IMR                          0x0048
    00109 #define PM_ISR                          0x004c
    00110 #define PM_ICR                          0x0050
    00111 #define PM_POSCSR                       0x0054
    00112 # define PM_LOCK(x)                     (1 << (x))      /* PLLx locked */
    00113 # define PM_CKRDY                       (1   <<  5)     /* Clock ready */
    00114 # define PM_MSKRDY                      (1   <<  6)     /* Mask ready */
    00115 # define PM_OSCRDY(x)                   (1  << ((x) + 7)) /* OSCx ready */
    00116 # define PM_OSCRDY_BIT(x)               ((x) + 7)
    00117 # define PM_OSC32RDY                    (1   <<  9)     /* OSC32 ready */
    00118 # define PM_BODDET                      (1   << 16)     /* Brown-out detected */
    00119 #define PM_GCCTRL(x)    (0x0060 + 4 * (x))      /* Generic Clock Control */
    00120 # define PM_GCCTRL_OSCSEL(x)            ((x) <<  0)     /* Clock source */
    00121 # define PM_GCCTRL_OSCSEL_MASK          (3   <<  0)
    00122 # define PM_GCCTRL_CEN                  (1   <<  2)     /* Clock enable */
    00123 # define PM_GCCTRL_DIVEN                (1   <<  3)     /* Divider enable */
    00124 # define PM_GCCTRL_DIV(x)               ((x) <<  8)     /* Divider */
    00125 #define PM_RCCR                         0x00c0
    00126 #define PM_BGCR                         0x00c4
    00127 #define PM_VREGCR                       0x00c8
    00128 #define PM_BOD                          0x00d0
    00129 #define PM_RCAUSE                       0x0140          /* Reset Cause */
    00130 #define PM_AWEN                         0x0144
    00131 #define PM_GPLP                         0x0200
    00132
    00133 /* Register access macros */
    00134 #define pm_read_reg(reg)                                        \
    00135         mmio_read32((void *)PM_BASE + PM_##reg)
    00136 #define pm_write_reg(reg, value)                                \
    00137         mmio_write32((void *)PM_BASE + PM_##reg, value)
    00138
    00139 #endif /* HARDWARE_PM_V2_REGS_H_INCLUDED */