0001
0002
0003
0004 #ifndef _ASM_X86_OLPC_H
0005 #define _ASM_X86_OLPC_H
0006
0007 #include <asm/geode.h>
0008
0009 struct olpc_platform_t {
0010 int flags;
0011 uint32_t boardrev;
0012 };
0013
0014 #define OLPC_F_PRESENT 0x01
0015 #define OLPC_F_DCON 0x02
0016
0017 #ifdef CONFIG_OLPC
0018
0019 extern struct olpc_platform_t olpc_platform_info;
0020
0021
0022
0023
0024
0025
0026
0027
0028 static inline uint32_t olpc_board(uint8_t id)
0029 {
0030 return (id << 4) | 0x8;
0031 }
0032
0033 static inline uint32_t olpc_board_pre(uint8_t id)
0034 {
0035 return id << 4;
0036 }
0037
0038 static inline int machine_is_olpc(void)
0039 {
0040 return (olpc_platform_info.flags & OLPC_F_PRESENT) ? 1 : 0;
0041 }
0042
0043
0044
0045
0046
0047 static inline int olpc_has_dcon(void)
0048 {
0049 return (olpc_platform_info.flags & OLPC_F_DCON) ? 1 : 0;
0050 }
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 static inline int olpc_board_at_least(uint32_t rev)
0061 {
0062 return olpc_platform_info.boardrev >= rev;
0063 }
0064
0065 #else
0066
0067 static inline int machine_is_olpc(void)
0068 {
0069 return 0;
0070 }
0071
0072 static inline int olpc_has_dcon(void)
0073 {
0074 return 0;
0075 }
0076
0077 #endif
0078
0079 #ifdef CONFIG_OLPC_XO1_PM
0080 extern void do_olpc_suspend_lowlevel(void);
0081 extern void olpc_xo1_pm_wakeup_set(u16 value);
0082 extern void olpc_xo1_pm_wakeup_clear(u16 value);
0083 #endif
0084
0085 extern int pci_olpc_init(void);
0086
0087
0088
0089 #define OLPC_GPIO_MIC_AC 1
0090 #define OLPC_GPIO_DCON_STAT0 5
0091 #define OLPC_GPIO_DCON_STAT1 6
0092 #define OLPC_GPIO_DCON_IRQ 7
0093 #define OLPC_GPIO_THRM_ALRM geode_gpio(10)
0094 #define OLPC_GPIO_DCON_LOAD 11
0095 #define OLPC_GPIO_DCON_BLANK 12
0096 #define OLPC_GPIO_SMB_CLK 14
0097 #define OLPC_GPIO_SMB_DATA 15
0098 #define OLPC_GPIO_WORKAUX geode_gpio(24)
0099 #define OLPC_GPIO_LID 26
0100 #define OLPC_GPIO_ECSCI 27
0101
0102 #endif