00001
00040 #ifndef PMIC_REGS_H_INCLUDED
00041 #define PMIC_REGS_H_INCLUDED
00042
00043 #include <chip/memory-map.h>
00044 #include <io.h>
00045
00046 #define PMIC_STATUS 0x00
00047 #define PMIC_INTPRI 0x01
00048 #define PMIC_CTRL 0x02
00049
00050 #define PMIC_STATUS_LOLVLEX (1 << 0)
00051 #define PMIC_STATUS_MEDLVLEX (1 << 1)
00052 #define PMIC_STATUS_HILVLEX (1 << 2)
00053 #define PMIC_STATUS_NMIEX (1 << 7)
00054
00055 #define PMIC_CTRL_LOLVLEN (1 << 0)
00056 #define PMIC_CTRL_MEDLVLEN (1 << 1)
00057 #define PMIC_CTRL_HILVLEN (1 << 2)
00058 #define PMIC_CTRL_IVSEL (1 << 6)
00059 #define PMIC_CTRL_RREN (1 << 7)
00060
00061 #define pmic_write_reg8(reg, value) \
00062 mmio_write8((void *) (PMIC_BASE + PMIC_##reg), value)
00063
00064 #define pmic_read_reg8(reg) \
00065 mmio_read8((void *) (PMIC_BASE + PMIC_##reg))
00066
00067 #endif