aboutsummaryrefslogtreecommitdiff
path: root/sys/isa
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove i386 XBOX support.Konstantin Belousov2017-11-161-19/+0
| | | | | | | | | | | | | | | It is for console presented at 2001 and featuring Pentium III processor. Even if any of them are still alive and run FreeBSD, we do not have any sign of life from their users. While removing another dozens of #ifdefs from the i386 sources reduces the aversion from looking at the code and improves the platform vitality. Reviewed by: cem, pfg, rink (XBOX support author) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D13016 Notes: svn path=/head/; revision=325892
* Use better hard-coded defaults for the cursor shape, and remove nearbyBruce Evans2017-08-191-6/+0
| | | | | | | | | | | | | | | | | | | | | redundant initializations. Hard-code base = 0, height = (approx. 1/8 of the boot-time font height) in all cases, and remove the BIOS/MD support for setting these values. This asks for an underline cursor sized for the boot-time font instead of various less hard-coded but worse values. I used that think that the x86 BIOS always gave the same values as the above hard-coding, but on 1 of my systems it gives the wrong value of base = 1. The remaining BIOS fields are shift_state and bell_pitch. These are now consistently not explicitly reinitialized to 0. All sc_get_bios_value() functions except x86's are now empty, and the only useful thing that x86 returns is shift_state. This really belongs in atkbdc, but heavier use of the BIOS to read the more useful typematic rate has been removed there. fb still makes much heavier use of the BIOS. Notes: svn path=/head/; revision=322705
* Stop calling atrtc_set() from the xen timer clock_settime() method. ThatIan Lepore2017-08-111-1/+0
| | | | | | | | | | | | | | | | | removes the only reference to atrtc_set() from outside of atrtc.c, so make it static. The xen timer driver registers as a realtime clock with 1us resolution. In the past that resulted in only the xen timer's clock_settime() getting called, so it would call atrtc_set() to set the hardware clock as well. As of r32090, the clock_settime() method of all registered realtime clocks gets called, so the xen driver no longer needs to chain-call the lower-resolution driver. Thanks to royger@ for talking me through the xen stuff, and for testing. Notes: svn path=/head/; revision=322411
* Protect access to the AT realtime clock with its own mutex.Ian Lepore2017-07-121-0/+1
| | | | | | | | | | | | | | | | | | The mutex protecting access to the registered realtime clock should not be overloaded to protect access to the atrtc hardware, which might not even be the registered rtc. More importantly, the resettodr mutex needs to be eliminated to remove locking/sleeping restrictions on clock drivers, and that can't happen if MD code for amd64 depends on it. This change moves the protection into what's really being protected: access to the atrtc date and time registers. This change also adds protection when the clock is accessed from xentimer_settime(), which bypasses the resettodr locking. Differential Revision: https://reviews.freebsd.org/D11483 Notes: svn path=/head/; revision=320901
* Renumber copyright clause 4Warner Losh2017-02-282-2/+2
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Remove pc98 support completely.Yoshihiro Takahashi2017-01-284-59/+0
| | | | | | | | | I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
* sys/isa: minor spelling fixes.Pedro F. Giffuni2016-05-033-3/+3
| | | | | | | No functional change. Notes: svn path=/head/; revision=299006
* atrtc: export function to set RTCRoger Pau Monné2016-05-021-0/+1
| | | | | | | | | | | | | | This is going to be used by the Xen clock on Dom0 in order to set the RTC of the host. The current logic in atrtc_settime is moved to atrtc_set and the unused device_t parameter is removed from the atrtc_set function call so it can be safely used by other callers. Sponsored by: Citrix Systems R&D Reviewed by: kib, jhb Differential revision: https://reviews.freebsd.org/D6067 Notes: svn path=/head/; revision=298928
* isa/pnp: for pointers replace 0 with NULL.Pedro F. Giffuni2016-04-141-5/+5
| | | | | | | | | These are mostly cosmetical, no functional change. Found with devel/coccinelle. Notes: svn path=/head/; revision=297978
* Fix the resource_list_print_type() calls to use uintmax_t.Justin Hibbits2016-03-221-4/+4
| | | | | | | Missed a bunch from r297000. Notes: svn path=/head/; revision=297199
* Replace all resource occurrences of '0UL/~0UL' with '0/~0'.Justin Hibbits2016-03-031-1/+1
| | | | | | | | | | | | | | | | Summary: The idea behind this is '~0ul' is well-defined, and casting to uintmax_t, on a 32-bit platform, will leave the upper 32 bits as 0. The maximum range of a resource is 0xFFF.... (all bits of the full type set). By dropping the 'ul' suffix, C type promotion rules apply, and the sign extension of ~0 on 32 bit platforms gets it to a type-independent 'unsigned max'. Reviewed By: cem Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5255 Notes: svn path=/head/; revision=296336
* Replace several bus_alloc_resource() calls using default arguments with ↵Justin Hibbits2016-02-192-8/+8
| | | | | | | | | | | | bus_alloc_resource_any() Since these calls only use default arguments, bus_alloc_resource_any() is the right call. Differential Revision: https://reviews.freebsd.org/D5306 Notes: svn path=/head/; revision=295790
* Convert rman to use rman_res_t instead of u_longJustin Hibbits2016-01-272-2/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: Migrate to using the semi-opaque type rman_res_t to specify rman resources. For now, this is still compatible with u_long. This is step one in migrating rman to use uintmax_t for resources instead of u_long. Going forward, this could feasibly be used to specify architecture-specific definitions of resource ranges, rather than baking a specific integer type into the API. This change has been broken out to facilitate MFC'ing drivers back to 10 without breaking ABI. Reviewed By: jhb Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5075 Notes: svn path=/head/; revision=294883
* Remove vestiges of knowing the ISA bus, which we gave up on around 20Warner Losh2014-03-191-115/+1
| | | | | | | years ago. Remove redunant copy of isaregs.h. Notes: svn path=/head/; revision=263379
* - There's no need to overwrite the default device method with the defaultMarius Strobl2011-11-221-2/+1
| | | | | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID. Notes: svn path=/head/; revision=227843
* Move VT switching hack for suspend/resume from bus drivers to syscons.cJung-uk Kim2011-05-091-127/+0
| | | | | | | | | using event handlers. A different version was Submitted by: Taku YAMAMOTO (taku at tackymt dot homeip dot net) Notes: svn path=/head/; revision=221708
* Retire isa_setup_intr() and isa_teardown_intr() and use the generic busJohn Baldwin2011-05-062-8/+2
| | | | | | | | | versions instead. They were never needed as bus_generic_intr() and bus_teardown_intr() had been changed to pass the original child device up in 42734, but the ISA bus was not converted to new-bus until 45720. Notes: svn path=/head/; revision=221526
* - Enable an extra debugging bootverbose printf when probing ISA PNP cardsJohn Baldwin2011-03-291-2/+2
| | | | | | | | | | | | listing each card as it is found on non-PC98 (PC98 already had this). - Increase the length of the DELAY() used before timing out while reading PNP resource data. Tested by: Steven Nikkel steven_nikkel ertyu org MFC after: 1 week Notes: svn path=/head/; revision=220126
* bus_add_child: change type of order parameter to u_intAndriy Gapon2010-09-101-1/+1
| | | | | | | | | | | | | This reflects actual type used to store and compare child device orders. Change is mostly done via a Coccinelle (soon to be devel/coccinelle) semantic patch. Verified by LINT+modules kernel builds. Followup to: r212213 MFC after: 10 days Notes: svn path=/head/; revision=212413
* When we are not switching VTs, just mark all buffer to be updated.Jung-uk Kim2010-07-151-1/+7
| | | | Notes: svn path=/head/; revision=210149
* Implement new event timers infrastructure. It provides unified APIs forAlexander Motin2010-06-201-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | writing event timer drivers, for choosing best possible drivers by machine independent code and for operating them to supply kernel with hardclock(), statclock() and profclock() events in unified fashion on various hardware. Infrastructure provides support for both per-CPU (independent for every CPU core) and global timers in periodic and one-shot modes. MI management code at this moment uses only periodic mode, but one-shot mode use planned for later, as part of tickless kernel project. For this moment infrastructure used on i386 and amd64 architectures. Other archs are welcome to follow, while their current operation should not be affected. This patch updates existing drivers (i8254, RTC and LAPIC) for the new order, and adds event timers support into the HPET driver. These drivers have different capabilities: LAPIC - per-CPU timer, supports periodic and one-shot operation, may freeze in C3 state, calibrated on first use, so may be not exactly precise. HPET - depending on hardware can work as per-CPU or global, supports periodic and one-shot operation, usually provides several event timers. i8254 - global, limited to periodic mode, because same hardware used also as time counter. RTC - global, supports only periodic mode, set of frequencies in Hz limited by powers of 2. Depending on hardware capabilities, drivers preferred in following orders, either LAPIC, HPETs, i8254, RTC or HPETs, LAPIC, i8254, RTC. User may explicitly specify wanted timers via loader tunables or sysctls: kern.eventtimer.timer1 and kern.eventtimer.timer2. If requested driver is unavailable or unoperational, system will try to replace it. If no more timers available or "NONE" specified for second, system will operate using only one timer, multiplying it's frequency by few times and uing respective dividers to honor hz, stathz and profhz values, set during initial setup. Notes: svn path=/head/; revision=209371
* Do not attempt to switch to the same VTs between suspend and resume.Jung-uk Kim2010-05-261-9/+11
| | | | Notes: svn path=/head/; revision=208567
* Let the first device suspend and the last device resume syscons(4).Jung-uk Kim2010-05-261-10/+5
| | | | Notes: svn path=/head/; revision=208564
* Fix more style(9) nits that I missed in the previous commit.Jung-uk Kim2010-05-221-5/+4
| | | | Notes: svn path=/head/; revision=208413
* Fix style(9) nits.Jung-uk Kim2010-05-221-36/+39
| | | | Notes: svn path=/head/; revision=208412
* Suspend screen updates when the video controller is powered down.Jung-uk Kim2010-05-221-15/+86
| | | | Notes: svn path=/head/; revision=208411
* Introduce the new kernel sub-tree x86 which should contain all the codeAttilio Rao2010-02-252-516/+0
| | | | | | | | | | | | | | | | | shared and generalized between our current amd64, i386 and pc98. This is just an initial step that should lead to a more complete effort. For the moment, a very simple porting of cpufreq modules, BIOS calls and the whole MD specific ISA bus part is added to the sub-tree but ideally a lot of code might be added and more shared support should grow. Sponsored by: Sandvine Incorporated Reviewed by: emaste, kib, jhb, imp Discussed on: arch MFC: 3 weeks Notes: svn path=/head/; revision=204309
* Remove extraneous semicolons, no functional changes.Martin Blapp2010-01-071-1/+1
| | | | | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week Notes: svn path=/head/; revision=201758
* Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.Robert Noland2009-12-291-2/+4
| | | | | | | | | | | | | | | | This replaces d_mmap() with the d_mmap2() implementation and also changes the type of offset to vm_ooffset_t. Purge d_mmap2(). All driver modules will need to be rebuilt since D_VERSION is also bumped. Reviewed by: jhb@ MFC after: Not in this lifetime... Notes: svn path=/head/; revision=201223
* Attach dpms(4) to vgapm and make sure to restore DPMS state afterJung-uk Kim2009-12-151-0/+3
| | | | | | | | | VGA is resumed properly. Reviewed by: jhb Notes: svn path=/head/; revision=200584
* - Partially revert hackish r198964 and r199002.Jung-uk Kim2009-11-121-92/+145
| | | | | | | | | | - Add a proxy driver vgapm to help vgapci to save/load VGA state. - Move device_set_desc() to the right place while we are here. Reviewed by: jhb Notes: svn path=/head/; revision=199229
* Remove duplicate suspend/resume code from vga_pci.c and let vga(4) registerJung-uk Kim2009-11-061-19/+53
| | | | | | | | | itself to an associated PCI device if it exists. It is little bit hackish but it should fix build without frame buffer driver since r198964. Fix some style(9) nits in vga_isa.c while we are here. Notes: svn path=/head/; revision=199002
* Save/restore VGA state from vga_pci.c instead of relying on vga_isa.c.Jung-uk Kim2009-11-051-19/+18
| | | | | | | | It was not working because we were saving its state after the device was powered down. Simplify vesa_load_state() as the culprit is fixed now. Notes: svn path=/head/; revision=198964
* Save/restore VGA color palette while suspending and resuming.Jung-uk Kim2009-11-041-10/+32
| | | | Notes: svn path=/head/; revision=198866
* Tweak the way that the ACPI and ISA bus drivers match hint devices toJohn Baldwin2009-08-241-4/+23
| | | | | | | | | | | | | | | | | | BIOS-enumerated devices: - Assume a device is a match if the memory and I/O ports match even if the IRQ or DRQ is wrong or missing. Some BIOSes don't include an IRQ for the atrtc device for example. - Add a hack to better match floppy controller devices. Many BIOSes do not include the starting port of the floppy controller listed in the hints (0x3f0) in the resources for the device. So far, however, all the BIOS variations encountered do include the 'port + 2' resource (0x3f2), so adjust the matching for "fdc" devices to look for 'port + 2'. Reviewed by: imp MFC after: 3 days Notes: svn path=/head/; revision=196520
* Rename statclock_disable variable to atrtcclock_disable that it actually is,Alexander Motin2009-05-032-0/+28
| | | | | | | | | | | | | | | | and hide it inside of atrtc driver. Add new tunable hint.atrtc.0.clock controlling it. Setting it to 0 disables using RTC clock as stat-/ profclock sources. Teach i386 and amd64 SMP platforms to emulate stat-/profclocks using i8254 hardclock, when LAPIC and RTC clocks are disabled. This allows to reduce global interrupt rate of idle system down to about 100 interrupts per core, permitting C3 and deeper C-states provide maximum CPU power efficiency. Notes: svn path=/head/; revision=191766
* Add resume methods to i8254 and atrtc devices.Alexander Motin2009-05-011-2/+8
| | | | Notes: svn path=/head/; revision=191733
* Allow syscons to work on amd64 and i386 without any hints:John Baldwin2009-03-051-3/+7
| | | | | | | | | | | - Enable keyboard autodetection by default for ISA syscons attachments. - If there are no syscons hints at all, assume there is a single sc0 device anyway. The console probe will still fail unless a VGA adapter is found. MFC after: 2 weeks Notes: svn path=/head/; revision=189421
* Allow device hints to wire the unit numbers of devices.John Baldwin2008-11-184-103/+149
| | | | | | | | | | | | | | | | | | | | | | | - An "at" hint now reserves a device name. - A new BUS_HINT_DEVICE_UNIT method is added to the bus interface. When determining the unit number of a device, this method is invoked to let the bus driver specify the unit of a device given a specific devclass. This is the only way a device can be given a name reserved via an "at" hint. - Implement BUS_HINT_DEVICE_UNIT() for the acpi(4) and isa(4) bus drivers. Both of these busses implement this by comparing the resources for a given hint device with the resources enumerated by ACPI/PnPBIOS and wire a unit if the hint resources are a subset of the "real" resources. - Use bus_hinted_children() for adding hinted devices on isa(4) busses now instead of doing it by hand. - Remove the unit kludging from sio(4) as it is no longer necessary. Prodding from: peter, imp OK'd by: marcel MFC after: 1 month Notes: svn path=/head/; revision=185059
* MFp4:Warner Losh2008-11-024-5/+32
| | | | | | | | | Make the ISA bus keep track of more PNP details. Plus a minor style fix while I'm here. More could be done here, but except for some SBCs that don't have ACPI, there's limited value to anybody in doing so. Notes: svn path=/head/; revision=184564
* MFp4 (my newcard tree):Warner Losh2008-08-242-55/+0
| | | | | | | | ISACFGATTR_MULTI is unused. Retire it, and a function that has no side effects used to compute it. Notes: svn path=/head/; revision=182103
* atrtc.c is a repocopy of the RTC device driver from i386/isa/clock.cPoul-Henning Kamp2008-04-142-599/+40
| | | | | | | | In addition to the device driver functionality, it exposes a number of functions which various other bits of code use to fondle the RTC chip. Notes: svn path=/head/; revision=178192
* Move i386 to generic RTC handling code.Poul-Henning Kamp2008-04-121-103/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make clock_if.m and subr_rtc.c standard on i386 Add hints for "atrtc" driver, for non-PnP, non-ACPI systems. NB: Make sure to install GENERIC.hints into /boot/device.hints in these! Nuke MD inittodr(), resettodr() functions. Don't attach to PHP0B00 in the "attimer" dummy driver any more, and remove comments that no longer apply for that reason. Add new "atrtc" device driver, which handles IBM PC AT Real Time Clock compatible devices using subr_rtc and clock_if. This driver is not entirely clean: other code still fondles the hardware to get a statclock interrupt on non-ACPI timer systems. Wrap some overly long lines. After it has settled in -current, this will be ported to amd64. Technically this is MFC'able, but I fail to see a good reason. Notes: svn path=/head/; revision=178163
* Back in the good old days, PC's had random pieces of rock forPoul-Henning Kamp2008-03-261-122/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | frequency generation and what frequency the generated was anyones guess. In general the 32.768kHz RTC clock x-tal was the best, because that was a regular wrist-watch Xtal, whereas the X-tal generating the ISA bus frequency was much lower quality, often costing as much as several cents a piece, so it made good sense to check the ISA bus frequency against the RTC clock. The other relevant property of those machines, is that they typically had no more than 16MB RAM. These days, CPU chips croak if their clocks are not tightly within specs and all necessary frequencies are derived from the master crystal by means if PLL's. Considering that it takes on average 1.5 second to calibrate the frequency of the i8254 counter, that more likely than not, we will not actually use the result of the calibration, and as the final clincher, we seldom use the i8254 for anything besides BEL in syscons anyway, it has become time to drop the calibration code. If you need to tell the system what frequency your i8254 runs, you can do so from the loader using hw.i8254.freq or using the sysctl kern.timecounter.tc.i8254.frequency. Notes: svn path=/head/; revision=177651
* Further cleanup of sound generation in syscons:Poul-Henning Kamp2008-03-261-9/+1
| | | | | | | | | | | The timer_spkr_*() functions take care of the enabling/disabling of the speaker. Test on the existence of timer_spkr_*() functions, rather than architectures. Notes: svn path=/head/; revision=177650
* The "free-lance" timer in the i8254 is only used for the speakerPoul-Henning Kamp2008-03-262-37/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | these days, so de-generalize the acquire_timer/release_timer api to just deal with speakers. The new (optional) MD functions are: timer_spkr_acquire() timer_spkr_release() and timer_spkr_setfreq() the last of which configures the timer to generate a tone of a given frequency, in Hz instead of 1/1193182th of seconds. Drop entirely timer2 on pc98, it is not used anywhere at all. Move sysbeep() to kern/tty_cons.c and use the timer_spkr*() if they exist, and do nothing otherwise. Remove prototypes and empty acquire-/release-timer() and sysbeep() functions from the non-beeping archs. This eliminate the need for the speaker driver to know about i8254frequency at all. In theory this makes the speaker driver MI, contingent on the timer_spkr_*() functions existing but the driver does not know this yet and still attaches to the ISA bus. Syscons is more tricky, in one function, sc_tone(), it knows the hz and things are just fine. In the other function, sc_bell() it seems to get the period from the KDMKTONE ioctl in terms if 1/1193182th second, so we hardcode the 1193182 and leave it at that. It's probably not important. Change a few other sysbeep() uses which obviously knew that the argument was in terms of i8254 frequency, and leave alone those that look like people thought sysbeep() took frequency in hertz. This eliminates the knowledge of i8254_freq from all but the actual clock.c code and the prof_machdep.c on amd64 and i386, where I think it would be smart to ask for help from the timecounters anyway [TBD]. Notes: svn path=/head/; revision=177642
* Rename timer0_max_count to i8254_max_count.Poul-Henning Kamp2008-03-262-50/+51
| | | | | | | | Rename timer0_real_max_count to i8254_real_max_count and make it static. Rename timer_freq to i8254_freq and make it a loader tunable. Notes: svn path=/head/; revision=177631
* The RTC related pscnt and psdiv variables have no business being public.Poul-Henning Kamp2008-03-261-2/+2
| | | | Notes: svn path=/head/; revision=177628
* Use cpu_spinwait() (i.e., "pause") when spinning on rdtsc during DELAY().John Baldwin2008-01-171-0/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=175405
* Replace explicit calls to video methods with their respective variantsWojciech A. Koszek2007-12-291-6/+4
| | | | | | | | | | | | | | | | | | implemented with macros. This patch improves code readability. Reasoning behind vidd_* is a sort of "video discipline". List of macros is supposed to be complete--all methods of video_switch ought to have their respective macros from now on. Functionally, this code should be no-op. My intention is to leave current behaviour of touched code as is. No objections: rwatson Silence on: freebsd-current@ Approved by: cognet Notes: svn path=/head/; revision=174985