| 268 | } |
| 269 | |
| 270 | static int |
| 271 | geode_probe(device_t self) |
| 272 | { |
| 273 | #define BIOS_OEM_MAXLEN 80 |
| 274 | static u_char bios_oem[BIOS_OEM_MAXLEN] = "\0"; |
| 275 | |
| 276 | switch (pci_get_devid(self)) { |
| 277 | case 0x0515100b: |
| 278 | if (geode_counter == 0) { |
| 279 | /* |
| 280 | * The address of the CBA is written to this register |
| 281 | * by the bios, see p161 in data sheet. |
| 282 | */ |
| 283 | cba = pci_read_config(self, 0x64, 4); |
| 284 | if (bootverbose) |
| 285 | printf("Geode CBA@ 0x%x\n", cba); |
| 286 | geode_counter = cba + 0x08; |
| 287 | outl(cba + 0x0d, 2); |
| 288 | if (bootverbose) |
| 289 | printf("Geode rev: %02x %02x\n", |
| 290 | inb(cba + 0x3c), inb(cba + 0x3d)); |
| 291 | tc_init(&geode_timecounter); |
| 292 | EVENTHANDLER_REGISTER(watchdog_list, geode_watchdog, |
| 293 | NULL, 0); |
| 294 | set_cputicker(geode_cputicks, 27000000, 0); |
| 295 | } |
| 296 | break; |
| 297 | case 0x0510100b: |
| 298 | gpio = pci_read_config(self, PCIR_BAR(0), 4); |
| 299 | gpio &= ~0x1f; |
| 300 | if (bootverbose) |
| 301 | printf("Geode GPIO@ = %x\n", gpio); |
| 302 | if (bios_oem_strings(&bios_soekris, |
| 303 | bios_oem, sizeof bios_oem) > 0 ) { |
| 304 | led1b = 20; |
| 305 | led1 = led_create(led_func, &led1b, "error"); |
| 306 | } else if (bios_oem_strings(&bios_pcengines, |
| 307 | bios_oem, sizeof bios_oem) > 0 ) { |
| 308 | led1b = -2; |
| 309 | led2b = -3; |
| 310 | led3b = -18; |
| 311 | led1 = led_create(led_func, &led1b, "led1"); |
| 312 | led2 = led_create(led_func, &led2b, "led2"); |
| 313 | led3 = led_create(led_func, &led3b, "led3"); |
| 314 | /* |
| 315 | * Turn on first LED so we don't make |
| 316 | * people think their box just died. |
| 317 | */ |
| 318 | led_func(&led1b, 1); |
| 319 | } |
| 320 | if (*bios_oem) |
| 321 | printf("Geode %s\n", bios_oem); |
| 322 | break; |
| 323 | case 0x01011078: |
| 324 | if (bios_oem_strings(&bios_advantech, |
| 325 | bios_oem, sizeof bios_oem) > 0 ) { |
| 326 | printf("Geode %s\n", bios_oem); |
| 327 | EVENTHANDLER_REGISTER(watchdog_list, advantech_watchdog, |
nothing calls this directly
no test coverage detected