summaryrefslogtreecommitdiffstats
path: root/sys/dev/mk48txx
Commit message (Collapse)AuthorAgeFilesLines
* MFC r262613:dim2014-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | Merge the projects/clang-sparc64 branch back to head. This brings in several updates from the llvm and clang trunks to make the sparc64 backend fully functional. Apart from one patch to sys/sparc64/include/pcpu.h which is still under discussion, this makes it possible to let clang fully build world and kernel for sparc64. Any assistance with testing this on actual sparc64 hardware is greatly appreciated, as there will unavoidably be bugs left. Many thanks go to Roman Divacky for his upstream work on getting the sparc64 backend into shape. MFC r262985: Repair a few minor mismerges from r262261 in the clang-sparc64 project branch. This is also to minimize differences with upstream.
* Add support for MK48T37.marius2011-05-152-1/+6
|
* Fix botches in r201005:marius2010-01-011-1/+1
| | | | | - Actually use the newly introduced sc_res in the front-end. - Remove a whitespace glitch in mk48txx_gettime().
* - Take advantage of bus_{read,write}_*(9).marius2009-12-252-4/+12
| | | | | - Set dow = -1 in mk48txx_gettime() because some drivers (for example the NetBSD and OpenBSD mk48txx(4)) don't set it correctly.
* Remove clause 3 and 4 from TNF licenses.marius2009-12-253-24/+3
| | | | Obtained from: NetBSD
* Style changesmarius2009-12-253-79/+79
|
* Revisit the watchdogs: Resetting the error to EINVAL after failing to set then_hibma2007-03-271-4/+4
| | | | | | | | watchdog might hide the succesful arming of an earlier one. Accept that on failing to arm any watchdog (because of non-supported timeouts) EOPNOTSUPP is returned instead of the more appropriate EINVAL. MFC after: 3 days
* Align the interfaces for the various watchdogs and make the interfacen_hibma2006-12-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | behave as expected. Also: - Return an error if WD_PASSIVE is passed in to the ioctl as only WD_ACTIVE is implemented at the moment. See sys/watchdog.h for an explanation of the difference between WD_ACTIVE and WD_PASSIVE. - Remove the I_HAVE_TOTALLY_LOST_MY_SENSE_OF_HUMOR define. If you've lost your sense of humor, than don't add a define. Specific changes: i80321_wdog.c Don't roll your own passive watchdog tickle as this would defeat the purpose of an active (userland) watchdog tickle. ichwd.c / ipmi.c: WD_ACTIVE means active patting of the watchdog by a userland process, not whether the watchdog is active. See sys/watchdog.h. kern_clock.c: (software watchdog) Remove a check for WD_ACTIVE as this does not make sense here. This reverts r1.181.
* Fix spelling in a status message.marius2006-09-011-1/+1
| | | | MFC after: 1 day
* - Add locking.marius2005-05-193-41/+120
| | | | | | | | | | | | | | | | | | | | | | | | | - Add support for storing the century in MK48TXX_WDAY_CB on MK48Txx with extended registers when the MK48TXX_NO_CENT_ADJUST flag is set (and which is termed somewhat confusing as it actually means don't manually adjust the century in the driver). - Add the MI part of interfacing the watchdog functionality of MK48Txx with extended registers with watchdog(9). This is inspired by the SunOS/Solaris drivers for the 'eeprom' devices also having watchdog support. I actually expected this to work out of the box on Sun Exx00 machines with 'eeprom' devices which have a 'watchdog-enable' property. On terminal count of the the watchdog timer however only the MK48TXX_FLAGS_WDF bit rises but the reset signal and the interrupt respectively (depending on whether the MK48TXX_WDOG_WDS bit of the chip and the MK48TXX_WDOG_ENABLE_WDS flag of the driver respectively is set) goes nowhere. Apparently passing the reset signal on to the WDR line of the CPUs has to be enabled somewhere else but we don't have documentation for the Exx00 specific controllers. I decided to commit this nevertheless so it can be enabled in the eeprom(4) front-end later in e.g. 6.0-STABLE without breaking the API. Besides the Exx00 the watchdog part of the MK48Txx should also work on E250 and E450. Possibly also without extra fiddling on these machines but I haven't found someone willing to give it a try on such a machine so far. - Use uintXX_t instead of u_intXX_t, use __func__ instead of hardcoded function names in error strings.
* o Sync with the NetBSD mk48txx driver (the result simplyfies some changesmarius2004-11-173-74/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | I have in mind for the genclock interface): - Recognize the MK48T18 as well (differs from the MK48T08 only in packaging options and voltages). - Allow MD code to provide functions for reading/writing NVRAM/RTC locations. If passed NULL, the old behaviour using bus_space_{read,write}_1() is used. Otherwise, all access to the chip goes via the MD functions. This is necessary for mvmeppc boards where the mk48txx NVRAM/RTC is not directly addressable. - Cleanup MI mk48txx(4) todclock driver: - Prepare mk48txxvar.h and leave only register definitions in mk48txxreg.h. - Define struct mk48txx_softc as usual devices and allocate necessary members in it. - Change mk48txx_attach() to only take a device_t. o While converting the sparc64 eeprom driver to the above changes: - Remove some dead code and stale comments. - Use the NVRAM size provided by the mk48txx driver instead of hardcoding it as suggested by a comment. - Add a comment about why it doesn't make much sense to read the hostid directly from the NVRAM except for displaying it when attaching. - Don't print the hostid if it reads all zero because it's stored elsewhere.
* Correct value and description of the unused MK48TXX_WDAY_FT macro.marius2004-09-201-1/+1
|
* - Some of the upper bits of the time related (seconds, minutes, etc.)marius2004-09-192-19/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | registers are control bits or depending on the model contain additional time bits with a different meaning than the lower ones. In order to only read the desired time bits and not change the upper bits on write use appropriate masks in the gettime and settime function respectively. Due to the polarity of the stop oscillator bit and the fact that the century bits aren't used on sparc64 not masking them didn't cause problems so far. - Fix two off-by-one errors in the handling of the day of week. The genclock code represents the dow as 0 - 6 with 0 being Sunday but the mk48txx use 1 - 7 with 1 being Sunday. In the settime function when writing the dow to the clock the range wasn't adjusted accordingly but the clock apparently played along nicely otherwise the second bug in the gettime function which mapped 1 - 7 to 0 - 6 but with 0 meaning Saturday would have been triggered. Fixing these makes the date being stored in the same format Sun/Solaris uses and cures the "Invalid time in real time clock. Check and reset the date immediately!" when the date was set under Solaris prior to booting FreeBSD/sparc64. [1] Looking at other clock drivers/code e.g. FreeBSD/alpha the former "bug", i.e. storing the dow as 0 - 6 even when the clock uses 1 - 7, seems to be common but might be on purpose for compatibility when multi-booting with other OS which do the same. So it might make sense to add a flag to handle the dow off-by-one for use of this driver on platforms other than sparc64. - Check the state of the battery on mk48txx that support this in the attach function. - Add a note that use of the century bit should be implemented but isn't required at the moment because it isn't used on sparc64. Problem noted by: joerg [1] MT5 candidate.
* Use __FBSDID().obrien2003-08-241-2/+3
| | | | Also some minor style cleanups.
* s#<mk48txx/mk48txxreg.h>#<dev/mk48txx/mk48txxreg.h>#marcel2003-08-231-1/+1
|
* Add a driver back end for the Mostek MK48T02, MK48T08 and MK48T59tmm2002-04-042-0/+307
time-of-day clocks, ported from NetBSD. The front-ends are expected to be at least partly machine-dependent; the sparc64 EBus and SBus ones will be commited to MD directories for now (in a subsequent commit).
OpenPOWER on IntegriCloud