diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2006-03-28 17:04:00 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-04-01 21:31:29 -0500 |
commit | 81507ea9cfa64e9851b53e0fefebfa776eda9ecb (patch) | |
tree | 0e76e2e8dd0bc5d0542c8490f09af886a5c82749 /drivers/acpi/motherboard.c | |
parent | 683aa4012f53b2ada0f430487e05d37b0d94e90a (diff) |
ACPI: request correct fixed hardware resource type (MMIO vs I/O port)
ACPI supports fixed hardware (PM_TMR, GPE blocks, etc) in either I/O port
or MMIO space, but used to always request the regions from I/O space
because it didn't check the address_space_id.
Sample ACPI fixed hardware in MMIO space (HP rx2600), was incorrectly
reported in /proc/ioports, now reported in /proc/iomem:
ff5c1004-ff5c1007 : PM_TMR
ff5c1008-ff5c100b : PM1a_EVT_BLK
ff5c100c-ff5c100d : PM1a_CNT_BLK
ff5c1010-ff5c1013 : GPE0_BLK
ff5c1014-ff5c1017 : GPE1_BLK
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/motherboard.c')
-rw-r--r-- | drivers/acpi/motherboard.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/drivers/acpi/motherboard.c b/drivers/acpi/motherboard.c index 468244147ec1..14ffe68a094e 100644 --- a/drivers/acpi/motherboard.c +++ b/drivers/acpi/motherboard.c | |||
@@ -123,41 +123,46 @@ static struct acpi_driver acpi_motherboard_driver2 = { | |||
123 | }, | 123 | }, |
124 | }; | 124 | }; |
125 | 125 | ||
126 | static void __init acpi_request_region (struct acpi_generic_address *addr, | ||
127 | unsigned int length, char *desc) | ||
128 | { | ||
129 | if (!addr->address || !length) | ||
130 | return; | ||
131 | |||
132 | if (addr->address_space_id == ACPI_ADR_SPACE_SYSTEM_IO) | ||
133 | request_region(addr->address, length, desc); | ||
134 | else if (addr->address_space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) | ||
135 | request_mem_region(addr->address, length, desc); | ||
136 | } | ||
137 | |||
126 | static void __init acpi_reserve_resources(void) | 138 | static void __init acpi_reserve_resources(void) |
127 | { | 139 | { |
128 | if (acpi_gbl_FADT->xpm1a_evt_blk.address && acpi_gbl_FADT->pm1_evt_len) | 140 | acpi_request_region(&acpi_gbl_FADT->xpm1a_evt_blk, |
129 | request_region(acpi_gbl_FADT->xpm1a_evt_blk.address, | ||
130 | acpi_gbl_FADT->pm1_evt_len, "PM1a_EVT_BLK"); | 141 | acpi_gbl_FADT->pm1_evt_len, "PM1a_EVT_BLK"); |
131 | 142 | ||
132 | if (acpi_gbl_FADT->xpm1b_evt_blk.address && acpi_gbl_FADT->pm1_evt_len) | 143 | acpi_request_region(&acpi_gbl_FADT->xpm1b_evt_blk, |
133 | request_region(acpi_gbl_FADT->xpm1b_evt_blk.address, | ||
134 | acpi_gbl_FADT->pm1_evt_len, "PM1b_EVT_BLK"); | 144 | acpi_gbl_FADT->pm1_evt_len, "PM1b_EVT_BLK"); |
135 | 145 | ||
136 | if (acpi_gbl_FADT->xpm1a_cnt_blk.address && acpi_gbl_FADT->pm1_cnt_len) | 146 | acpi_request_region(&acpi_gbl_FADT->xpm1a_cnt_blk, |
137 | request_region(acpi_gbl_FADT->xpm1a_cnt_blk.address, | ||
138 | acpi_gbl_FADT->pm1_cnt_len, "PM1a_CNT_BLK"); | 147 | acpi_gbl_FADT->pm1_cnt_len, "PM1a_CNT_BLK"); |
139 | 148 | ||
140 | if (acpi_gbl_FADT->xpm1b_cnt_blk.address && acpi_gbl_FADT->pm1_cnt_len) | 149 | acpi_request_region(&acpi_gbl_FADT->xpm1b_cnt_blk, |
141 | request_region(acpi_gbl_FADT->xpm1b_cnt_blk.address, | ||
142 | acpi_gbl_FADT->pm1_cnt_len, "PM1b_CNT_BLK"); | 150 | acpi_gbl_FADT->pm1_cnt_len, "PM1b_CNT_BLK"); |
143 | 151 | ||
144 | if (acpi_gbl_FADT->xpm_tmr_blk.address && acpi_gbl_FADT->pm_tm_len == 4) | 152 | if (acpi_gbl_FADT->pm_tm_len == 4) |
145 | request_region(acpi_gbl_FADT->xpm_tmr_blk.address, 4, "PM_TMR"); | 153 | acpi_request_region(&acpi_gbl_FADT->xpm_tmr_blk, 4, "PM_TMR"); |
146 | 154 | ||
147 | if (acpi_gbl_FADT->xpm2_cnt_blk.address && acpi_gbl_FADT->pm2_cnt_len) | 155 | acpi_request_region(&acpi_gbl_FADT->xpm2_cnt_blk, |
148 | request_region(acpi_gbl_FADT->xpm2_cnt_blk.address, | ||
149 | acpi_gbl_FADT->pm2_cnt_len, "PM2_CNT_BLK"); | 156 | acpi_gbl_FADT->pm2_cnt_len, "PM2_CNT_BLK"); |
150 | 157 | ||
151 | /* Length of GPE blocks must be a non-negative multiple of 2 */ | 158 | /* Length of GPE blocks must be a non-negative multiple of 2 */ |
152 | 159 | ||
153 | if (acpi_gbl_FADT->xgpe0_blk.address && acpi_gbl_FADT->gpe0_blk_len && | 160 | if (!(acpi_gbl_FADT->gpe0_blk_len & 0x1)) |
154 | !(acpi_gbl_FADT->gpe0_blk_len & 0x1)) | 161 | acpi_request_region(&acpi_gbl_FADT->xgpe0_blk, |
155 | request_region(acpi_gbl_FADT->xgpe0_blk.address, | ||
156 | acpi_gbl_FADT->gpe0_blk_len, "GPE0_BLK"); | 162 | acpi_gbl_FADT->gpe0_blk_len, "GPE0_BLK"); |
157 | 163 | ||
158 | if (acpi_gbl_FADT->xgpe1_blk.address && acpi_gbl_FADT->gpe1_blk_len && | 164 | if (!(acpi_gbl_FADT->gpe1_blk_len & 0x1)) |
159 | !(acpi_gbl_FADT->gpe1_blk_len & 0x1)) | 165 | acpi_request_region(&acpi_gbl_FADT->xgpe1_blk, |
160 | request_region(acpi_gbl_FADT->xgpe1_blk.address, | ||
161 | acpi_gbl_FADT->gpe1_blk_len, "GPE1_BLK"); | 166 | acpi_gbl_FADT->gpe1_blk_len, "GPE1_BLK"); |
162 | } | 167 | } |
163 | 168 | ||