32 #include <linux/types.h>
33 #include <linux/pci.h>
36 #include <linux/sched.h>
41 #define MY_NAME "shpchp"
43 #define MY_NAME THIS_MODULE->name
52 #define dbg(format, arg...) \
55 printk(KERN_DEBUG "%s: " format, MY_NAME , ## arg); \
57 #define err(format, arg...) \
58 printk(KERN_ERR "%s: " format, MY_NAME , ## arg)
59 #define info(format, arg...) \
60 printk(KERN_INFO "%s: " format, MY_NAME , ## arg)
61 #define warn(format, arg...) \
62 printk(KERN_WARNING "%s: " format, MY_NAME , ## arg)
64 #define ctrl_dbg(ctrl, format, arg...) \
67 dev_printk(KERN_DEBUG, &ctrl->pci_dev->dev, \
70 #define ctrl_err(ctrl, format, arg...) \
71 dev_err(&ctrl->pci_dev->dev, format, ## arg)
72 #define ctrl_info(ctrl, format, arg...) \
73 dev_info(&ctrl->pci_dev->dev, format, ## arg)
74 #define ctrl_warn(ctrl, format, arg...) \
75 dev_warn(&ctrl->pci_dev->dev, format, ## arg)
78 #define SLOT_NAME_SIZE 10
123 #define PCI_DEVICE_ID_AMD_GOLAM_7450 0x7450
124 #define PCI_DEVICE_ID_AMD_POGO_7458 0x7458
127 #define PCIX_MEM_BASE_LIMIT_OFFSET 0x1C
128 #define PCIX_MISCII_OFFSET 0x48
129 #define PCIX_MISC_BRIDGE_ERRORS_OFFSET 0x80
132 #define PERRNONFATALENABLE_MASK 0x00040000
133 #define PERRFATALENABLE_MASK 0x00080000
134 #define PERRFLOODENABLE_MASK 0x00100000
135 #define SERRNONFATALENABLE_MASK 0x00200000
136 #define SERRFATALENABLE_MASK 0x00400000
139 #define PERR_OBSERVED_MASK 0x00000001
142 #define RSE_MASK 0x40000000
144 #define INT_BUTTON_IGNORE 0
145 #define INT_PRESENCE_ON 1
146 #define INT_PRESENCE_OFF 2
147 #define INT_SWITCH_CLOSE 3
148 #define INT_SWITCH_OPEN 4
149 #define INT_POWER_FAULT 5
150 #define INT_POWER_FAULT_CLEAR 6
151 #define INT_BUTTON_PRESS 7
152 #define INT_BUTTON_RELEASE 8
153 #define INT_BUTTON_CANCEL 9
155 #define STATIC_STATE 0
156 #define BLINKINGON_STATE 1
157 #define BLINKINGOFF_STATE 2
158 #define POWERON_STATE 3
159 #define POWEROFF_STATE 4
162 #define INTERLOCK_OPEN 0x00000002
163 #define ADD_NOT_SUPPORTED 0x00000003
164 #define CARD_FUNCTIONING 0x00000005
165 #define ADAPTER_NOT_SAME 0x00000006
166 #define NO_ADAPTER_PRESENT 0x00000009
167 #define NOT_ENOUGH_RESOURCES 0x0000000B
168 #define DEVICE_TYPE_NOT_SUPPORTED 0x0000000C
169 #define WRONG_BUS_FREQUENCY 0x0000000D
170 #define POWER_FAILURE 0x0000000E
186 static inline const char *slot_name(
struct slot *
slot)
195 u32 flags = OSC_SHPC_NATIVE_HP_CONTROL;
199 #define get_hp_hw_control_from_firmware(dev) (0)
237 return hotplug_slot->private;
245 if (slot->
device == device)
249 ctrl_err(ctrl,
"Slot (device=0x%02x) not found\n", device);
253 static inline void amd_pogo_errata_save_misc_reg(
struct slot *p_slot)
260 p_slot->
ctrl->pcix_misc2_reg = pcix_misc2_temp;
271 static inline void amd_pogo_errata_restore_misc_reg(
struct slot *p_slot)
274 u32 pcix_bridge_errors_reg;
275 u32 pcix_mem_base_reg;
284 "Bridge_Errors[ PERR_OBSERVED = %08X] (W1C)\n",
292 rse_set = pcix_mem_base_reg &
RSE_MASK;
294 ctrl_dbg(p_slot->
ctrl,
"Memory_Base_Limit[ RSE ] (W1C)\n");