355387 |
04-Dec-2019 |
loos |
MFC r320159: Add the ofw_bus_get_node() callback in mv_twsi, it is mandatory for the ofw_iicbus usage.
Sponsored by: Rubicon Communications, LLC (Netgate) |
350031 |
16-Jul-2019 |
avg |
MFC r348355: revert r273728 and parts of r306589, iicbus no-stop by default feature
After r349227 the only consumer of that broken code is gone from this branch. |
346548 |
22-Apr-2019 |
ian |
MFC r337731:
Export the eeprom device size via readonly sysctl. Also export the write page size and address size, although they are likely to be inherently less-interesting values outside of the driver. |
331722 |
29-Mar-2018 |
eadler |
Revert r330897:
This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code.
Revert with prejudice.
This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes.
Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes.
Requested by: gjb (re) |
331503 |
24-Mar-2018 |
ian |
MFC r325233, r328956, r329170, r329172-r329173, r329224, r330403-r330407, r330411-r330412, r330416, r330430-r330431, r330433, r330528-r330529, r330767
r325233: [i2c/clock] add support for EPSON RTC-8583
RTC-8583 is time-of-day clock used in some SOHO routers. This clock has only 2 bits for year values, but thanks to user SRAM it's possible to save year value and keep it up to date via driver code.
Tested on Planex_MZK-W300NAG (SoC is RT2880)
Submitted by: Hiroki Mori <yamori83@yahoo.co.jp> Differential Revision: https://reviews.freebsd.org/D12833
r328956: Use const pointers for input data not modified by clock utility functions.
r329170: Replace the existing print_ct() private debugging function with a set of three public functions to format and print the three major data structures used by realtime clock drivers (clocktime, bcd_clocktime, and timespec).
r329172: Add a set of convenience routines for RTC drivers to use for debug output, and a debug.clock_show_io sysctl to control debugging output.
r329173: Add a new sysctl, debug.clock_do_io, to allow manully triggering a one-shot read or write of all registered realtime clocks. In the read case, the values read are simply discarded. For writes, there's no alternative but to actually write the current system time to the device.
r329224: Fix bad indentation. Whitespace only, no functional changes.
Reported by: bde@
r330403: Add calls to the new clock_dbgprint_xxx() functions.
r330404: Add calls to the new clock_dbgprint_xxx() functions.
r330405: Oops, fix a paste-o.
r330406: Add calls to the new clock_dbgprint_xxx() functions.
r330407: Add calls to the new clock_dbgprint_xxx() functions. Also, stop applying a local .5 second adjustment to the time, since that is now done by the code in subr_rtc.c.
r330411: Convert to the new(ish) bcd_clocktime conversion functions, add calls to the new debug output functions, and when setting the clock, propagate the timespec nsecs to the 1/100ths register.
r330412: Build iicbus/rtc8583 as a module.
r330416: The year is stored in a single byte in sram, in binary format, as a count of years since the century, so strip the century out when converting to or from bcd_clocktime format (the conversion routines will infer century by pivoting on 70).
r330430: Switch to the new bcd_clocktime conversion routines, and add calls to the new clock_dbgprint_xxx() functions.
r330431: Switch to the new bcd_clocktime conversion routines, and add calls to the new clock_dbgprint_xxx() functions.
r330433: Switch to the new bcd_clocktime conversion routines, and add calls to the new clock_dbgprint_xxx() functions.
r330528: Fix a paste-o that broke the build. There is no softc pointer here, just use the dev arg.
Reported by: Jonathan Looney <jonlooney@gmail.com> Pointy hat: ian@
r330529: Build the ds1672 driver as a module. Add a detach() to unregister the rtc.
r330767: Convert atrtc the new style rtc debugging output. Remove the db show command handler which provided much the same information. Removing the possibility of accessing the hardware regs from the debugger context paves the way for simplifying the locking code in the driver. |
331501 |
24-Mar-2018 |
ian |
MFC r329479-r329480, r329483, r329506-r329507, r329526, r329529, r329536, r329541, r329730, r329841, r329988, r330397
r329479: Do not try to deallocate memory that wasn't allocated (you'd think that would be safe, but the function also tries to destroy mutexes that never got created).
I guess this can only happen when imx_ehci_detach() is called on the error-exit path from imx_ehci_attach(), and that path never got exercised before today.
r329480: Don't call sdhci_cleanup_slot() if sdhci_init_slot() never got called. Also, do callout_init() very early in attach, so that callout_drain() can be called in detach without worrying about whether it ever got init'd.
r329483: Fix fallout from the import of fresh dts source files from linux 4.15. It appears that node names no longer include leading zeroes in the @address qualifiers, so we have to search for the nodes involved in interrupt fixup using both flavors of name to be compatible with old and new .dtb files.
(You know you're in a bad place when you're applying a workaround to code that exists only as a workaround for another problem.)
r329506: Add a detach method so that this can be a kldunload-friendly module.
r329507: Build modules specific to imx5/imx6 only when building those kernels.
This adds sys/modules/imx with a SUBDIR makefile to make the whole collection of modules that are specific to these SoCs. Initially, that "whole collection" consists of the if_ffec and imx_i2c drivers.
The if_ffec driver is referenced in its existing home in ../ffec rather than moving it into the imx directory, because it's used by powerpc too, but it is no longer built for all armv6/7 systems.
The imx_i2c driver is newly added as a module.
r329526: Allow i2c hardware drivers to declare their own relationships to ofw_iicbus rather than relying on a set of canned EARLY_DRIVER_MODULE() statements in the ofw_iicbus source. This means hw drivers will no longer be required to use one of a few predefined driver names. They will also now be able to decide themselves if they want to use DRIVER_MODULE or EARLY_DRIVER_MODULE and to set which pass to attach on for early modules.
Mainly, this adds extern declarations for the driver and devclass variables. It also renames ofwiicbus_devclass to ofw_iicbus_devclass to be consistant with the way we use ofw_ prefixes on this stuff.
r329529: Give the imx_i2c driver its own name, set up its relationship to ofw_iicbus. Previously it called itself 'iichb' to link up with the EARLY_DRIVER_MODULE declaration in ofw_iicbus.c.
r329536: Add the MODULE_DEPEND()s needed so that the kernel linker can resolve all the symbols at load time when iicbus is not compiled into the kernel.
r329541: Build ofw_iicbus as a module if OPT_FDT is defined.
r329730: Add required header files.
Reported by: andreast@
r329841: Add a missing line continuation.
How many commits does it take to get a simple module makefile working? Apparently at least three.
Pointy hat to: ian
r329988: Instead of building ofw_iicbus as a separate module, just compile it in to the iicbus module for FDT-based systems.
The primary motivation for this is that host controller drivers which declare DRIVER_MODULE(ofw_iicbus, thisdriver, etc, etc) now only need a single MODULE_DEPEND(thisdriver, ofw_iicbus) for runtime linking to resolve all the symbols. With ofw_iicbus and iicbus in separate modules, drivers would need to declare a MODULE_DEPEND() on both, because symbol lookup is non-recursive through the dependency chain. Requiring a driver to have MODULE_DEPENDS() on both amounts to requiring the drivers to understand the kobj inheritence details of how ofw_iicbus is implemented, which seems like something they shouldn't have to know (and could even change some day).
Also, this is somewhat analogous to how the drivers get built when compiled into the kernel. You don't have to ask for ofw_iicbus separately, it just gets built in along with iicbus when option FDT is in effect.
r330397: Fix a paste-o: use the IICBUS version constants, not IICBB bitbang driver's. |
331497 |
24-Mar-2018 |
ian |
MFC r328307, r328311-r328312
r328307: Fix a bug introduced with recursive bus ownership support in r321584.
The recursive ownership support added in r321584 was unconditionally in effect all the time -- whenever a given i2c slave device instance tried to lock the i2c bus for exclusive use when it already owned the bus, the call returned immediately without waiting. However, many i2c slave drivers use bus ownership to enforce that only a single thread at a time can be using the slave device. The recursive locking changes broke this use case.
Now there is a new flag, IIC_RECURSIVE, which can be mixed in with the other flags passed to iicbus_acquire_bus() to allow drivers to indicate when recursive locking is desired. Using the flag implies that the driver is managing concurrent access to the device by different threads in some way.
This immediately fixes all existing i2c slave drivers except for the two i2c RTC drivers which use the recursive locking feature; those will be fixed in a followup commit.
r328311 and r328312: Follow changes in r328307 by using new IIC_RECURSIVE flag.
The driver now ensures only one thread at a time is running in the API functions (clock_gettime() and clock_settime()) by specifically requesting ownership of the i2c bus without using IIC_RECURSIVE, then it does all IO using IIC_RECURSIVE so that each individual IO operation doesn't try to re-acquire the bus.
The other IO done by the driver happens at attach or intr_config_hooks time, when there can't be multiple threads running with the same device instance. So, the IIC_RECURSIVE flag can be safely ORed into the wait flags for all IO done by the driver, because it's all either done in a single-threaded environment, or protected within a block bounded by explict iicbus_acquire_bus() and iicbus_release_bus() calls. |
331496 |
24-Mar-2018 |
ian |
MFC r306288, r314936, r325527, r327971, r328005, r328039, r328068-r328069, r328301-r328303
r306288: Fix ds1307 probing
'compat' can never be NULL, because the compatible check loop ends when compat->ocd_str is NULL. This causes ds1307 to attach to any unclaimed i2c device.
r314936: Validate values read from the RTC before trying BCD decoding
Submitted by: cem Reported by: Michael Gmelin <freebsd@grem.de> Tested by: Oleksandr Tymoshenko <gonzo@bluezbox.com> Sponsored by: Dell EMC
r325527: DS1307: Add the mcp7941x enable bit
Summary: Existing code recognizes the mcp7941x RTC, but this RTC has an enable bit at the same location as the "Clock Halt" bit on the ds1307, with an opposite assertion (set == on, whereas CH set == clock stopped). Thus the current code halts the clock, with no way to enable it.
Reviewed By: ian Differential Revision: https://reviews.freebsd.org/D12961
r327971: Add RTC clock conversions for BCD values, with non-panic validation.
RTC clock hardware frequently uses BCD numbers. Currently the low-level bcd2bin() and bin2bcd() functions will KASSERT if given out-of-range BCD values. Every RTC driver must implement its own code for validating the unreliable data coming from the hardware to avoid a potential kernel panic.
This change introduces two new functions, clock_bcd_to_ts() and clock_ts_to_bcd(). The former validates its inputs and returns EINVAL if any values are out of range. The latter guarantees the returned data will be valid BCD in a known format (4-digit years, etc).
A new bcd_clocktime structure is used with the new functions. It is similar to the original clocktime structure, but defines the fields holding BCD values as uint8_t (uint16_t for year), and adds a PM flag for handling hours using AM/PM mode.
PR: 224813 Differential Revision: https://reviews.freebsd.org/D13730 (no reviewers)
r328005: Convert the x86 RTC driver to use new validated BCD<->timespec conversions.
New common routines were added to kern/subr_clock.c for converting between calendrical time expressed in BCD and struct timespec. The new functions return EINVAL on error, as expected when the clock hardware does not provide valid time.
PR: 224813 Differential Revision: https://reviews.freebsd.org/D13731 (no reviewers)
r328039: Add static inline rtcin_locked() and rtcout_locked() functions for doing a related series of operations without doing a lock/unlock for each byte. Use them when reading and writing the entire set of time registers.
The original rtcin() and writertc() functions which do lock/unlock on each byte still exist, because they are public and called by outside code.
r328068: Move some code around and rename a couple variables; no functional changes.
The static atrtc_set() function was called only from clock_settime(), so just move its contents entirely into clock_settime() and delete atrtc_set().
Rename the struct bcd_clocktime variables from 'ct' to 'bct'. I had originally wanted to emphasize how identical the clocktime and bcd_clocktime structs were, but things evolved to the point where the structs are not at all identical anymore, so now emphasizing the difference seems better.
r328069: Remove redundant critical_enter/exit() calls. The block of code delimited by these calls is now protected by a spin mutex (obscured within the RTC_LOCK/RTC_UNLOCK macros).
Reported by: bde@
r328301: Switch to using the bcd_clocktime conversion functinos that validate the BCD data without panicking, and have common code for handling AM/PM mode.
r328302: Switch to using the bcd_clocktime conversion functions that validate the BCD data without panicking, and have common code for handling AM/PM mode.
r328303: Switch to using the bcd_clocktime conversion functions that validate the BCD data without panicking, and have common code for handling AM/PM mode. |
331495 |
24-Mar-2018 |
ian |
MFC r327756-r327758
r327756: Bugfix: on RTC chips with a 32-bit binary counter, after reading the time, return immediately rather than falling through to the logic that reads BCD-encoded time.
r327757: Bugfix: don't lose the am/pm mode flag when setting the time. Unlike most RTC chips that have a control register bit for am/pm mode, the DS13xx series uses one of the high bits in the hour register. Thus, when setting the time in am/pm mode, the am/pm mode flag has to be ORed into the hour.
r327758: Convert a collection of unrelated bitwise flags to a collection of boolean vars in the softc. It makes the code more compact and readable, and actually uses less memory too. |
331182 |
19-Mar-2018 |
eadler |
MFC r327184:
Change the remaining files using my personnal email address to my freebsd one |
330897 |
14-Mar-2018 |
eadler |
Partial merge of the SPDX changes
These changes are incomplete but are making it difficult to determine what other changes can/should be merged.
No objections from: pfg |
327653 |
06-Jan-2018 |
ian |
MFC r326750:
Do not give up if writing to the chip's control and status registers fails during startup. When a brand new chip leaves the factory, it is in a special power-saving mode that disables most functions on the chip to save battery power. The chip is stuck in this mode until the first write to the time registers, which automatically clears the special power-saving mode and starts the oscillator.
Also, the day-of-week register in this chip counts 1-7, not 0-6, so write the values accordingly.
These changes are based on the patch submitted by Brian Scott, but I elimated warnings since this condition is expected, and added some comments, and so in general blame me for any mistakes.
PR: 223642 |
323931 |
22-Sep-2017 |
ian |
MFC r323474, r323553, r323691
r323474: Add a default implementation that returns ENODEV for start, repeat_start, stop, read, and write methods. Some controllers don't implement these individual operations and have only a transfer method. In that case, we should return an indication that the device is present but doesn't support the method, as opposed to the kobj default error ENXIO which makes it look like the whole device is missing. Userland tools such as i2c(8) can use the differing return values to switch between the two different i2c IO mechanisms.
r323553: Defer attaching and probing iicbus and its children until interrupts are available, in i2c controller drivers that require interrupts for transfers.
This is the result of auditing all 22 existing drivers that attach iicbus. These drivers were the only ones remaining that require interrupts and were not using config_intrhook to defer attachment. That has led, over the years, to various i2c slave device drivers needing to use config_intrhook themselves rather than performing bus transactions in their probe() and attach() methods, just in case they were attached too early.
r323691: Give icee(4) a detach() method so it can be used as a module. Add a module makefile for it. |
323467 |
11-Sep-2017 |
ian |
MFC r321708-r321712, r321721, r321726-r321727, r321746, r321751, r321791-r321792, r321795, r321798, r321821, r321823, r321826, r321828, r321841, r321934, r322025-r322026, r322282, r322431, r322473, r322475-r322479
Lots of i2c RTC driver stuff...
r321708: Replace the pcf8563 i2c RTC driver with a new nxprtc driver which handles all the chips in the NXP PCA212x and PCA/PCF85xx series. In addition to supporting more chips, this driver uses the countdown timer on the chips as a fractional seconds counter, giving it a resolution of about 15 milliseconds.
r321709: Fix building this driver on non-FDT platforms.
r321710: Add a few missing i2c devices that build fine on all arches.
r321711: Move the device descriptions onto the device lines, so they cut and paste nicely into other config files.
r321712: Add the i2c RTC drivers found on various arm systems.
r321721: Switch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so that transfers will be done with proper ownership of the bus. No behavioral changes.
r321726: Bugfixes and enhancements...
Don't enable the oscillator when it is found to be stopped at init time, just let the first setting of valid time start it. But still report a dead battery if it's stopped at init time.
Don't force the chip into 24hr mode, just cope with whatever mode it is already in.
Align the RTC clock to top of second when setting it.
r321727: Fix AM/PM mode handling. The bits to mask off in the hours register changes between 12/24 hour mode. Also fix conversion between 12 and 24 hour mode. It's not as easy as adding/subtracting 12, because the clock doesn't roll over 11->0, it rolls over 12->1; 0 isn't a valid hour in AM/PM mode.
r321746: Use the new clock_schedule() to arrange for clock_settime() to be called at the right time to keep the RTC hardware time in sync, instead of using pause_sbt() to sleep until the right time.
r321751: Remove now-unused variable.
r321791: Switch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so that transfers will be done with proper ownership of the bus. No behavioral changes. Also add a detach() method.
r321792: Add a detach() method.
r321795: Check the clock-halted flag every time the clock is read, not just once at startup. The flag stays set until the clock is loaded with good time, so we need to keep saying the time is invalid until that happens.
r321798: Restore a few rather important lines of code that got fumbled in r321746.
r321821: No need to call getnanotime() now that the waiting is done by the central subr_rtc code, switch from CLOCKF_SETTIME_NO_TS to CLOCKF_SETTIME_NO_ADJ so that we get fed a timestamp, but it's not adjusted to compensate for inaccuracy in setting time.
r321823: Bugfixes and enhancements...
Don't enable the oscillator when it is found to be stopped at init time, just let the first setting of valid time start it. But still report a dead battery if it's stopped at init time.
Don't force the chip into 24hr mode, just cope with whatever mode it is already in.
Schedule the clock_settime() callbacks to align the RTC clock to top of second when setting it.
r321826: Restructure the SUBDIR list as 1-per-line and alphabetize, so it will be easier to add new things (and see what changed) in the future.
r321828: Build iicbus/{ds1307,ds3231,nxprtc} as modules.
r321841: Add a driver for the Intersil ISL12xx family of i2c RTC chips.
Supports ISL1209, ISL1218, ISL1219, ISL1220, ISL1221 (just basic RTC functionality, not all the other fancy stuff the chips can do).
r321934: Add missing ofw_bus_if.h src file.
r322025: Switch to iicdev_readfrom/writeto() to do xfers with proper bus ownership.
Tested by: manu@
r322026: Add missing header file to SRCS.
Reported by: manu@
r322282: Remove the ds133x and s35390a i2c RTC drivers for now. They both do i2c transfers in their probe() or attach() routines, and that doesn't work when the low-level controller requires interrupts to be functional.
The DS133x family of chips is nearly identical to the DS1307 and support for them should be added to that driver, then the ds133x driver can be deleted. The s35390a driver just needs a non-trivial workover. In both cases that work will be done and committed separately.
r322431: Bid for the device with BUS_PROBE_GENERIC, because this is very much a generic driver with minimal feature support for a large number of chips. More featureful per-chip drivers might exist (especially out-of-tree) and those should win the bidding even if they use BUS_PROBE_DEFAULT.
r322473: Add a new driver, ds13rtc, that handles all DS13xx series i2c RTC chips.
This driver supports only basic timekeeping functionality. It completely replaces the ds133x driver. It can also replace the ds1374 driver, but that will take a few other changes in MIPS code and config, and will be committed separately. It does NOT replace the existing ds1307 driver, which provides access to some of the extended features on the 1307 chip, such as controlling the square wave output signal. If both ds1307 and ds13rtc drivers are present, the ds1307 driver will outbid and win control of the device.
This driver can be configured with FDT data, or by using hints on non-FDT systems. In addition to the standard hints for i2c devices, it requires a "chiptype" string of the form "dallas,ds13xx" where 'xx' is the chip id (i.e., the same format as FDT compat strings).
r322475: Change "chiptype" to "compatible". Making the hint name the same as the FDT property name should make it easier to document the list of names accepted by both configuration mechanisms.
r322476: Remove the old ds1374 driver and use the ds13rtc driver instead. Adjust several mips config files accordingly.
r322477: Minor fixes and enhancements for the s35390a i2c RTC driver...
- Add FDT probe code. - Do i2c transfers with exclusive bus ownership. - Use config_intrhook_oneshot() to defer chip setup because some i2c busses can't do transfers without interrupts. - Add a detach() routine. - Add to module build.
r322478: Add back the drivers for Dallas/Maxim ds13xx and Seiko S35390x now that they've been rewritten/fixed to not cause panics by doing i2c transfers before interrupts are available.
PR: 221227
r322479: Add hinted attachment for non-FDT systems. Also, print a message if setting up the timer fails, because on some types of chips that's the first attempt to access the device. If the chip is missing/non-responsive then you'd get a driver that attached and didn't register the rtc, with no clue about why. On other chip types there are inits that come before timer setup, and they already print messages about errors. |
323446 |
11-Sep-2017 |
ian |
MFC r321583, r321584:
Add a pair of convenience routines for doing simple "register" read/writes on i2c devices, where the "register" can be any length.
Add support for tracking nested calls to iicbus_request/release_bus(). Usually it is sufficient to use iicbus_transfer_excl(), or one of the higher-level convenience functions that use it, to reserve the bus for the duration of each register access. Occasionally it is important that a series of accesses or read-modify-write operations must be done without any other intervening access to the device, to prevent corrupting state. |
323421 |
11-Sep-2017 |
ian |
MFC r320743:
Fix drivers that assume ticks starts at zero. These drivers all have logic similar to "if (ticks > localvar+interval) {localvar=ticks; ...}" where localvar is initialized to zero. Ticks is initialized to a negative value since r278230, and that leads to these if statements never being true. |
323419 |
11-Sep-2017 |
ian |
MFC r320460, r320461, r320462, r320463:
If an i2c transfer ends due to error, issue a stop on the bus even if the nostop option is set, if a start was issued.
Add iic_recover_bus(), a helper function that can be used by any i2c driver which is able to manipulate the clock and data lines directly. When an i2c bus is hung by a slave device stuck in the middle of a transaction that didn't complete properly, this function manipulates the clock and data lines in a sequence known to reliably reset slave devices. The most common cause of a hung i2c bus is a system reboot in the middle of an i2c transfer (so it doesnt' happen often, but now there is a way other than power cycling to recover from it).
Add bus recovery handling to the imx5/imx6 i2c driver. |
315221 |
14-Mar-2017 |
pfg |
MFC r313982, r314068: sys: Replace zero with NULL for pointers.
Found with: devel/coccinelle |
310522 |
24-Dec-2016 |
avg |
MFC r308530: iicsmb: SMB_MAXBLOCKSIZE can be used again |
310072 |
14-Dec-2016 |
avg |
MFC r308104: add iic interface to ig4 driver, move isl and cyapa to iicbus |
310070 |
14-Dec-2016 |
avg |
MFC r306589: Implement iicbus_write_ivar and impelemnt the NOSTOP ivar in both read and write. |
308756 |
17-Nov-2016 |
avg |
MFC r307195: convert iicsmb to use iicbus_transfer for all operations |
308333 |
05-Nov-2016 |
mmel |
MFC r304459,r305527:
r304459: INTRNG: Rework handling with resources. Partially revert r301453. - Read interrupt properties at bus enumeration time and store it into global mapping table. - At bus_activate_resource() time, given mapping entry is resolved and connected to real interrupt source. A copy of mapping entry is attached to given resource. - At bus_setup_intr() time, mapping entry stored in resource is used for delivery of requested interrupt configuration. - For MSI/MSIX interrupts, mapping entry is created within pci_alloc_msi()/pci_alloc_msix() call. - For legacy PCI interrupts, mapping entry must be created within pcib_route_interrupt() by pcib driver itself. r305527: Fix MIPS INTRNG (both FDT and non-FDT) behaviour broken by r304459 |
308324 |
05-Nov-2016 |
mmel |
MFC r302523,r302528:
r302523: Add clk_get_by_ofw_node_index, which is like clk_get_by_ofw_index but operates on a specific OF node instead of the pass in device's OF node. r302528: EXTRES: Add OF node as argument to all <foo>_get_by_ofw_<bar>() functions. In some cases, the driver must handle given properties located in specific OF subnode. Instead of creating duplicate set of function, add 'node' as argument to existing functions, defaulting it to device OF node. |
302408 |
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
301453 |
05-Jun-2016 |
skra |
INTRNG - change the way how an interrupt mapping data are provided to the framework in OFW (FDT) case.
This is a follow-up to r301451.
Differential Revision: https://reviews.freebsd.org/D6634
|
300777 |
26-May-2016 |
manu |
Add support for interrupts, sensors and GPIO for AXP209 PMIC. Pressing the PEK (power enable key) will shutdown the board. Some events are reported to devd via system "PMU" and subsystem "Battery", "AC" and "USB" such as connected/disconnected. Some sensors values (power source voltage/current) are reported via sysctl (dev.axp209_pmu.X.) It also expose a gpioc node usable in kernel and userland. Only 3 of the 4 GPIO are exposed (The GPIO3 is different and mostly unused on boards). Most popular boards uses GPIO1 as a sense pin for OTG power. Add a dtsi file that adds gpio-controller capability to the device as upstream doesn't defined it and include it in our custom DTS.
Reviewed by: jmcneill Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D6135
|
300550 |
24-May-2016 |
loos |
Move the OFW iicbus code to dev/iicbus to stop polluting dev/ofw with unrelated code.
Discussed with: nwhitehorn (a long time ago)
|
300421 |
22-May-2016 |
loos |
Fix the deciKelvin to Celsius conversion in kernel.
After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as 0C reference and as result, the temperature read in sysctl(8) now exibits a +0.1C difference.
This commit fix the kernel references to match the reference value used in sysctl(8) after r285994.
Sponsored by: Rubicon Communications (Netgate)
|
300394 |
22-May-2016 |
loos |
Remove a couple of extra blank lines.
|
300258 |
20-May-2016 |
jah |
iic_rdwr_data->nmsgs is uint32_t, so limit the allowable number of messages to prevent memory exhaustion and short allocations on 32-bit systems. Since iicrdwr is intended to be a workalike of a Linux i2c-dev call, use the same limit of 42 that Linux uses.
Also check the return value of copyin(9) to prevent unnecessary allocation in the failure case.
Submitted by: ngie Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5155
|
299756 |
14-May-2016 |
gonzo |
Use OF_prop_free instead of direct call to free(9)
Reviewed by: jhibbits
|
299745 |
14-May-2016 |
jmcneill |
Add allwinner,sun8i-a83t-i2c to the list of compatible devices.
|
298955 |
03-May-2016 |
pfg |
sys/dev: minor spelling fixes.
Most affect comments, very few have user-visible effects.
|
297627 |
06-Apr-2016 |
jmcneill |
Convert Allwinner port to extres clk/hwreset/regulator APIs.
Reviewed by: andrew, gonzo, Emmanuel Vadot <manu@bidouilliste.com> Approved by: gonzo (mentor) Differential Revision: https://reviews.freebsd.org/D5752
|
297573 |
05-Apr-2016 |
jhibbits |
Add support for the Microchip mcp7941x.
This is compatible with the ds1307, but comparing the mcp7941x datasheet vs the ds1307 code, appears there is one bit placement difference, so that is now accounted for.
Relnotes: yes
|
297199 |
22-Mar-2016 |
jhibbits |
Fix the resource_list_print_type() calls to use uintmax_t.
Missed a bunch from r297000.
|
296137 |
27-Feb-2016 |
jhibbits |
Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().
Most calls to bus_alloc_resource() use "anywhere" as the range, with a given count. Migrate these to use the new bus_alloc_resource_anywhere() API.
Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370
|
296093 |
26-Feb-2016 |
andrew |
Add the start of support for the Allwinner A31 clocks. It only adds support for the i2c, mmc, and gmac clocks. Further clocks can be added as needed.
Submitted by: Emmanuel Vadot <manu@bidouilliste.com> Reviewed by: jmcneill Differential Revision: https://reviews.freebsd.org/D5339
|
295630 |
15-Feb-2016 |
andrew |
Fix the spelling of OF_getencprop. It will fix the data correctly for the endian of the CPU so there is no need to call fdt32_to_cpu.
Sponsored by: ABT Systems Ltd
|
295626 |
15-Feb-2016 |
andrew |
Add support for the Allwinner i2c device. This is similar to the existing Marvell twsi part, however uses different register locations, as such split the existing driver into Marvell and Allwinner attachments.
While here clean a few style issues.
Submitted by: Emmanuel Vadot <manu@bidouilliste.com> Differential Revision: https://reviews.freebsd.org/D4846
|
295622 |
14-Feb-2016 |
andrew |
Move the twsi driver source to be under iicbus. It is in a separate directory as it is expected multiple attachments will be added for the SoC families that use this hardware.
Sponsored by: ABT Systems Ltd
|
295080 |
30-Jan-2016 |
ngie |
Use the correct type for i when iterating over `buf` to avoid unlikely negative array indexing in iicrdwr(..)
Differential Revision: https://reviews.freebsd.org/D5132 Obtained from: HardenedBSD PR: 206754 Reported by: CTurt <cturt@hardenedbsd.org> Submitted by: Madhi Moktari <mokhi64@gmail.com> Sponsored by: EMC / Isilon Storage Division
|
289727 |
22-Oct-2015 |
ian |
Add FDT compatibility to the icee driver.
The FDT bindings for eeprom parts don't include any metadata about the device other than the part name encoded in the compatible property. Instead, a driver is required to have a compiled-in table of information about the various parts (page size, device capacity, addressing scheme). So much for FDT being an abstract description of hardware characteristics, huh?
In addition to the FDT-specific changes, this also switches to using the newer iicbus_transfer_excl() mechanism which holds bus ownership for the duration of the transfer. Previously this code held the bus across all the transfers needed to complete the user's IO request, which could be up to 128KB of data which might occupy the bus for 10-20 seconds. Now the bus will be released and re-aquired between every page-sized (8-256 byte) transfer, making this driver a much nicer citizen on the i2c bus.
The hint-based configuration mechanism is still in place for non-FDT systems.
Michal Meloun contributed some of the code for these changes.
|
289726 |
22-Oct-2015 |
ian |
Add iicbus_transfer_excl(), a helper routine to do an i2c bus transaction while holding exclusive ownership of the bus. This is the routine most slave drivers should use unless they have a need to acquire and hold the bus across a series of related operations that involves multiple transfers.
|
289657 |
20-Oct-2015 |
dumbbell |
iicbus: Use device_delete_children() instead of explicit child removal
If the bus is detached and deleted by a call to device_delete_child() or device_delete_children() on a device higher in the tree, I²C children were already detached and deleted. So the device_t pointer stored in sc points to freed memory: we must not try to delete it again.
By using device_delete_children(), we let subr_bus.c figure out if there are children to take care of.
While here, make sure iicbus_detach() and iicoc_detach() call device_delete_children() too, to be safe.
Reviewed by: jhb, imp Approved by: jhb, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3926
|
289656 |
20-Oct-2015 |
dumbbell |
iicbus: Remove trailing whitespaces
MFC after: 1 week
|
289118 |
10-Oct-2015 |
ian |
Replace a local sx lock that allowed only one client at a time to access an eeprom device with iicbus_request/release_bus(), which achieves the same effect and also keeps other i2c slave drivers from clashing on the bus.
|
289105 |
10-Oct-2015 |
ian |
Translate iic hardware layer status values to errno return values.
|
289104 |
10-Oct-2015 |
ian |
Add a short name, IIC_INTRWAIT, for the common case (IIC_INTR | IIC_WAIT).
|
289098 |
10-Oct-2015 |
ian |
Fix more cases of iicbus-layer functions that must return IIC_Exxxx values.
|
289097 |
10-Oct-2015 |
ian |
Return only IIC_Exxxx status values from iicbus-layer functions. Most of these functions are thin wrappers around calling the hardware-layer driver, but some of them do sanity checks and return an error. Since the hardware layer can only return IIC_Exxxxx status values, the iicbus helper functions must also adhere to that, so that drivers at higher layers can assume that any non-zero status value is an IIC_Exxxx value that provides details about what happened at the hardware layer (sometimes those details are important for certain slave drivers).
|
289095 |
09-Oct-2015 |
ian |
Add iic2errno(), a helper function to translate IIC_Exxxxx status values to errno values that are at least vaguely equivelent. Also add a new status value, IIC_ERESOURCE, to indicate a failure to acquire memory or other required resources to complete a transaction.
The IIC_Exxxxxx values are supposed to communicate low-level details of the i2c transaction status between the lowest-layer hardware driver and higher-layer bus protocol and device drivers for slave devices on the bus. Most of those slave drivers just return all status values from the lower layers directly to their callers, resulting in crazy error reporting from a user's point of view (things like timeouts being reported as "no such process"). Now there's a helper function to make it easier to start cleaning up all those drivers.
|
289093 |
09-Oct-2015 |
ian |
Use IIC_EBUSBSY and IIC_BUSERR status values consistantly across all drivers. Make it clearer what each one means in the comments that define them.
IIC_BUSBSY was used in many places to mean two different things, either "someone else has reserved the bus so you have to wait until they're done" or "the signal level on the bus was not in the state I expected before/after issuing some command".
Now IIC_BUSERR is used consistantly to refer to protocol/signaling errors, and IIC_BUSBSY refers to ownership/reservation of the bus.
|
289084 |
09-Oct-2015 |
ian |
Bugfix: Exit the transfer loop if any read or write operation fails. Also, perform a stop operation on the bus if there was an error, otherwise the bus will remain hung forever. Consistantly use 'if (error != 0)' style in the function.
|
289083 |
09-Oct-2015 |
ian |
Style and whitespace cleanups. The only functional change is removal of a printf that appears to be left over from development debugging.
|
282702 |
10-May-2015 |
loos |
Remove unnecessary code and make use of generic implementations for bus_alloc_resource(), bus_release_resource() and bus_set_resource() (bus_generic_rl_alloc_resource(), bus_generic_rl_release_resource() and bus_generic_rl_set_resource() respectively).
Do not print the resources for nomatch devices.
Use the inherited method for bus_get_resource_list() on ofw_iicbus.c.
Submitted by: jhb and Michal Meloun (D2033)
|
282674 |
09-May-2015 |
loos |
Handle IRQ resources on iicbus and ofw_iicbus.
Based on a patch submitted by Michal Meloun <meloun@miracle.cz>.
|
282668 |
08-May-2015 |
loos |
Replace spaces with tabs, removes an extra blank line.
No functional changes.
|
281989 |
25-Apr-2015 |
loos |
Make the pcf8563 RTC work on FDT systems and on interrupt based i2c controllers.
Call iicbus_transfer() from the device context and not from the iicbus context.
I am committing a slightly different patch, so if something break, it is probably my fault.
PR: 199496 Submitted by: Juraj Lutter <otis@sk.FreeBSD.org>
|
281828 |
21-Apr-2015 |
jah |
Fix numerous issues in iic(4) and iicbus(4): --Allow multiple open iic fds by storing addressing state in cdevpriv --Fix, as much as possible, the baked-in race conditions in the iic ioctl interface by requesting bus ownership on I2CSTART, releasing it on I2CSTOP/I2CRSTCARD, and requiring bus ownership by the current cdevpriv to use the I/O ioctls --Reduce internal iic buffer size and remove 1K read/write limit by iteratively calling iicbus_read/iicbus_write --Eliminate dynamic allocation in I2CWRITE/I2CREAD --Move handling of I2CRDWR to separate function and improve error handling --Add new I2CSADDR ioctl to store address in current cdevpriv so that I2CSTART is not needed for read(2)/write(2) to work --Redesign iicbus_request_bus() and iicbus_release_bus(): --iicbus_request_bus() no longer falls through if the bus is already owned by the requesting device. Multiple threads on the same device may want exclusive access. Also, iicbus_release_bus() was never device-recursive anyway. --Previously, if IICBUS_CALLBACK failed in iicbus_release_bus(), but the following iicbus_poll() call succeeded, IICBUS_CALLBACK would not be issued again --Do not hold iicbus mtx during IICBUS_CALLBACK call. There are several drivers that may sleep in IICBUS_CALLBACK, if IIC_WAIT is passed. --Do not loop in iicbus_request_bus if IICBUS_CALLBACK returns EWOULDBLOCK; instead pass that to the caller so that it can retry if so desired.
Differential Revision: https://reviews.freebsd.org/D2140 Reviewed by: imp, jhb, loos Approved by: kib (mentor)
|
280300 |
20-Mar-2015 |
loos |
Add a driver for the Dallas/Maxim DS1307, another common i2c RTC.
Many thanks to ian who gently provided me the DS1307 breakout board.
Tested on: Raspberry pi Differential Revision: https://reviews.freebsd.org/D2022 Reviewed by: rpaulo
|
279852 |
10-Mar-2015 |
loos |
Fix off-by-one bugs.
Spotted by: rpaulo (on another review)
|
279399 |
28-Feb-2015 |
loos |
Add a driver for the Maxim DS3231 a low-cost, extremely accurate (+-2PPM) I2C real-time clock (RTC).
The DS3231 has an integrated temperature-compensated crystal oscillator (TXCO) and crystal.
DS3231 has a temperature sensor, an independent 32kHz output (which can be turned on and off by the driver) and another output that can be used as interrupt for alarms or as a second square-wave output, which frequency and operation mode can be set by driver sysctl(8) knobs.
Differential Revision: https://reviews.freebsd.org/D1016 Reviewed by: ian, rpaulo Tested on: Raspberry pi model B
|
278918 |
17-Feb-2015 |
loos |
Replace hardcoded sizes by sizeof() and nitems().
Set all the sysctls as CTLFLAG_MPSAFE.
|
278917 |
17-Feb-2015 |
loos |
Fix the display of negative temperatures.
Fix the setting of TOS (overtemperature shutdown) and THYST (hysteresis temperature).
|
277314 |
18-Jan-2015 |
jhibbits |
Use proper signed types. The ADT746x uses signed 8-bit numbers for the temperature.
MFC after: 2 weeks
|
274641 |
18-Nov-2014 |
ian |
Allow i2c bus speed to be configured via hints, FDT data, and sysctl.
The current support for controlling i2c bus speed is an inconsistant mess. There are 4 symbolic speed values defined, UNKNOWN, SLOW, FAST, FASTEST. It seems to be universally assumed that SLOW means the standard 100KHz rate from the original spec. Nothing ever calls iicbus_reset() with a speed of FAST, although some drivers would treat it as the 400KHz standard speed. Mostly iicbus_reset() is called with the speed set to UNKNOWN or FASTEST, and there's really no telling what any individual driver will do with those.
The speed of an i2c bus is limited by the speed of the slowest device on the bus. This means that generally the bus speed needs to be configured based on the board/system and the components within it. Historically for i2c we've configured with device hints. Newer systems use FDT data and it documents a clock-frequency property for i2c busses. Hobbyists and developers are likely to want on the fly changes. These changes provide all 3 methods, but do not require any existing drivers to change to use the new facilities.
This adds an iicbus method, iicbus_get_frequency(dev, speed) that gets the frequency for the requested symbolic speed. If the symbolic speed is SLOW or if there is no speed configured for the bus, the returned value is 100KHz, always. Otherwise, if bus speed is configured by hints, fdt, tunable, or sysctl, that speed is returned. It also adds a helper function, iicbus_init_frequency() that any bus driver subclassed from iicbus can initialize the frequency from some other source of info.
Initial driver implementations are provided for Freescale and TI.
Differential Revision: https://reviews.freebsd.org/D1174 PR: 195009
|
273728 |
27-Oct-2014 |
kib |
Add a method to iicbus to request IIC_M_NOSTOP behaviour for multibyte transfers to be default. It simplifies porting code which assumes such settings.
Discussed with: avg, llos, nwhitehorn Sponsored by: The FreeBSD Foundation MFC after: 1 week
|
273156 |
16-Oct-2014 |
jhibbits |
Move the adm1030 driver to the proper location, and rename it.
For compatibility, 'device windtunnel' is still supported, but one should use 'device adm1030' instead, and this has been updated in GENERIC and NOTES.
|
273016 |
12-Oct-2014 |
jhibbits |
Check error return from reading integer part of temperature.
There's a very remote, but possible, chance that the integer part read will fail, but the fraction read succeeds, at which point the reported temperature is invalid.
Reported by: Matthew Rezny MFC after: 3 weeks
|
271849 |
19-Sep-2014 |
glebius |
Mechanically convert to if_inc_counter().
|
268564 |
12-Jul-2014 |
rpaulo |
Revert r268543.
We should probably fix sys/gpio.h instead.
|
268543 |
12-Jul-2014 |
rpaulo |
Move iic.h to sys/ so that it's automatically installed in /usr/include/sys.
This lets us call iic(4) ioctls without needing the kernel source code and follows the same model of GPIO.
MFC after: 3 weeks
|
266923 |
31-May-2014 |
loos |
Ignore IIC_ENOADDR from iicbus_reset() as it only means we have a master-only controller.
This fixes the iic bus scan with i2c(8) (on supported controllers).
Tested with gpioiic(4).
|
265813 |
10-May-2014 |
loos |
Add the lm75 i2c digital temperature sensor driver.
This driver supports the low and high precision models (9 and 11 bits) and it will auto-detect the both variants.
The driver expose the temperature registers (actual temperature, shutdown and hysteresys temperature) and also the configuration register.
It was tested on FDT systems: RPi, BBB and on non-FDT systems: AR71xx, with both, hardware i2c controllers (when available) and gpioiic(4).
This provides a simple and cheap way for verifying the i2c bus on embedded systems.
|
261844 |
13-Feb-2014 |
loos |
Allow the use of OFW I2C bus together with iicbb(4) on OFW-based systems.
This change makes ofw_iicbus attach to iicbb(4) controllers in addition to the already supported i2c host bridges (iichb).
On iicbb(4) allow the direct access of the OFW parent node by its children, so they can be directly attached to iicbb(4) node on the DTS without the need of describing the i2c bus.
Approved by: adrian (mentor, implicit)
|
261421 |
03-Feb-2014 |
jhibbits |
Add driver for the ADT7460/ADT7467 fan controller found in later PowerBooks and iBooks. Original work by andreast.
MFC after: 1 month
|
259082 |
07-Dec-2013 |
jhibbits |
Make more unsigned ints signed.
Found by: clang (powerpc64) MFC after: 1 week
|
259080 |
07-Dec-2013 |
jhibbits |
Fix some integer signs. These unsigned integers should all be signed.
Found by: clang (powerpc64)
|
257176 |
26-Oct-2013 |
glebius |
The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h
Sponsored by: Netflix Sponsored by: Nginx, Inc.
|
255471 |
11-Sep-2013 |
glebius |
Clean up SIOCSIFDSTADDR usage from ifnet drivers. The ioctl itself is extremely outdated, and I doubt that it was ever used for ifnet drivers. It was used for AF_INET sockets in pre-FreeBSD time.
Approved by: re (hrs) Sponsored by: Nginx, Inc.
|
249925 |
26-Apr-2013 |
glebius |
Add const qualifier to the dst parameter of the ifnet if_output method.
|
246128 |
30-Jan-2013 |
sbz |
Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on device_method_t arrays
Reviewed by: cognet Approved by: cognet
|
242947 |
13-Nov-2012 |
kevlo |
Check the return value of uiomove(9).
|
241679 |
18-Oct-2012 |
marius |
It turns out that as documented, PCF8563_R_SECOND_VL (i.e. battery low) doesn't automatically clear when VDD rises above Vlow again and needs to be cleared manually. However, apparently this needs all of the time registers to be set, i.e. pcf8563_settime(), and not just PCF8563_R_SECOND in order for PCF8563_R_SECOND_VL to stick. Thus, we just issue a warning during pcf8563_attach() rather than failing with ENXIO in case it is set.
MFC after: 3 days
|
241048 |
29-Sep-2012 |
kevlo |
Remove unused variables.
|
239507 |
21-Aug-2012 |
hrs |
Add s35390a_rtc(4) driver for Seiko Instruments S-35390A RTC.
Submitted by: Yusuke Tanaka
|
239400 |
19-Aug-2012 |
andreast |
Add a new temperature driver for certain PowerMacs. Found here on my Quad G5.
|
239399 |
19-Aug-2012 |
andreast |
Unify the sysctl description with the other PowerMac temperature drivers.
|
239398 |
19-Aug-2012 |
andreast |
Avoid using the degree symbol. Looks ugly on the console.
|
239397 |
19-Aug-2012 |
andreast |
Do the ADC init only at startup and not during every sensor read call. This reduces the number of interrupts.
|
235652 |
19-May-2012 |
marcel |
Don't include MIPS machine headers. There's no need for it.
|
234248 |
13-Apr-2012 |
marius |
Add a driver for the NXP (Philips) PCF8563 RTC.
Obtained from: NetBSD (pcf8563reg.h)
|
233539 |
27-Mar-2012 |
jchandra |
Driver for OpenCores I2C controller.
Add a Simple polled driver iicoc for the OpenCores I2C controller. This is used in Netlogic XLP processors.
Submitted by: Sreekanth M. S. (kanthms at netlogicmicro com)
|
233538 |
27-Mar-2012 |
jchandra |
Fix property name, r233537 used mime-type instead of svn:mime-type
|
233537 |
27-Mar-2012 |
jchandra |
Move driver for DS1374 RTC to sys/dev/iicbus
The earlier version of the driver is sys/mips/rmi/dev/iic/ds1374u.c Convert all references to ds1374u to ds1374, and use DEVMETHOD_END. Also update the license header as Netlogic is now Broadcom.
|
232400 |
02-Mar-2012 |
andreast |
Fix typo.
|
232365 |
01-Mar-2012 |
kan |
Provide pre/post transfer method callbacks for icbbb clients.
These are helful when making certain drivers work on both Linux and FreeBSD without changing the code flow too much.
Reviewed by: kib, wlosh MFC after: 1 month
|
228728 |
20-Dec-2011 |
adrian |
IIC bitbang changes - prepare to make the bit delay configurable; debug print changes.
* Right now the delay is hard coded at 10uS. This is a bit long when doing lots of periodic i2c transactions. So create a 'udelay' parameter and initialise it to 10. This can be tuned later.
* Add a newline after a transaction finishes, so the debugging output isn't so horrible.
|
228257 |
04-Dec-2011 |
adrian |
Allow the i2c node requirements to be slightly relaxed.
These realtek switch PHYs speak a variant of i2c with some slightly modified handling.
From the submitter, slightly modified now that some further digging has been done:
The I2C framework makes a assumption that the read/not-write bit of the first byte (the address) indicates whether reads or writes are to follow.
The RTL8366 family uses the bus: after sending the address+read/not-write byte, two register address bytes are sent, then the 16-bit register value is sent or received. While the register write access can be performed as a 4-byte write, the read access requires the read bit to be set, but the first two bytes for the register address then need to be transmitted.
This patch maintains the i2c protocol behaviour but allows it to be relaxed (for these kinds of switch PHYs, and whatever else Realtek may do with this almost-but-not-quite i2c bus) - by setting the "strict" hint to 0. The "strict" hint defaults to 1.
Submitted by: Stefan Bethke <stb@lassitu.de>
|
227843 |
22-Nov-2011 |
marius |
- There's no need to overwrite the default device method with the default 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.
|
227293 |
07-Nov-2011 |
ed |
Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.
This means that their use is restricted to a single C file.
|
226442 |
16-Oct-2011 |
brueffer |
Revert r226398 and instead move the allocation of usrbufs after the error check.
Suggested by: pjd MFC after: 1 week
|
226398 |
15-Oct-2011 |
brueffer |
Properly free resources in an error case.
CID: 4203 Found with: Coverity Prevent(tm) MFC after: 1 week
|
223741 |
03-Jul-2011 |
bz |
Tag mbufs of all incoming frames or packets with the interface's FIB setting (either default or if supported as set by SIOCSIFFIB, e.g. from ifconfig).
Submitted by: Alexander V. Chernikov (melifaro ipfw.ru) Reviewed by: julian MFC after: 2 weeks
|
223624 |
28-Jun-2011 |
kevlo |
Remove duplicate header includes
|
222860 |
08-Jun-2011 |
andreast |
- Improve error handling. - Add retry loops in the i2c read/write functions. - Combied the ADC channel selection and readout of the value into one iicbus_transfer to avoid possible races.
Reviewed by: nwhitehorn
|
222813 |
07-Jun-2011 |
attilio |
etire the cpumask_t type and replace it with cpuset_t usage.
This is intended to fix the bug where cpu mask objects are capped to 32. MAXCPU, then, can now arbitrarely bumped to whatever value. Anyway, as long as several structures in the kernel are statically allocated and sized as MAXCPU, it is suggested to keep it as low as possible for the time being.
Technical notes on this commit itself: - More functions to handle with cpuset_t objects are introduced. The most notable are cpusetobj_ffs() (which calculates a ffs(3) for a cpuset_t object), cpusetobj_strprint() (which prepares a string representing a cpuset_t object) and cpusetobj_strscan() (which creates a valid cpuset_t starting from a string representation). - pc_cpumask and pc_other_cpus are target to be removed soon. With the moving from cpumask_t to cpuset_t they are now inefficient and not really useful. Anyway, for the time being, please note that access to pcpu datas is protected by sched_pin() in order to avoid migrating the CPU while reading more than one (possible) word - Please note that size of cpuset_t objects may differ between kernel and userland. While this is not directly related to the patch itself, it is good to understand that concept and possibly use the patch as a reference on how to deal with cpuset_t objects in userland, when accessing kernland members. - KTR_CPUMASK is changed and now is represented through a string, to be set as the example reported in NOTES.
Please additively note that no MAXCPU is bumped in this patch, but private testing has been done until to MAXCPU=128 on a real 8x8x2(htt) machine (amd64).
Please note that the FreeBSD version is not yet bumped because of the upcoming pcpu changes. However, note that this patch is not targeted for MFC.
People to thank for the time spent on this patch: - sbruno, pluknet and Nicholas Esborn (nick AT desert DOT net) tested several revision of the patches and really helped in improving stability of this work. - marius fixed several bugs in the sparc64 implementation and reviewed patches related to ktr. - jeff and jhb discussed the basic approach followed. - kib and marcel made targeted review on some specific part of the patch. - marius, art, nwhitehorn and andreast reviewed MD specific part of the patch. - marius, andreast, gonzo, nwhitehorn and jceel tested MD specific implementations of the patch. - Other people have made contributions on other patches that have been already committed and have been listed separately.
Companies that should be mentioned for having participated at several degrees: - Yahoo! for having offered the machines used for testing on big count of CPUs. - The FreeBSD Foundation for having sponsored my devsummit attendance, which has been instrumental. - Sandvine for having offered offices and infrastructure during development.
(I really hope I didn't forget anyone, if it happened I apologize in advance).
|
222674 |
04-Jun-2011 |
andreast |
- Improve error handling. - Add a retry loop for the i2c sensor reading. - Check on busy status of the chip and on invalid values. - Fix a typo in a comment. - Replace the constant 2732 with the ZERO_C_TO_K macro.
Approved by: nwhitehorn (mentor)
|
222673 |
04-Jun-2011 |
andreast |
Replace the FCU_ZERO_C_TO_K with the ZERO_C_TO_K from powermac_thermal.h.
Approved by: nwhitehorn (mentor)
|
222658 |
03-Jun-2011 |
andreast |
- Improve error handling. - Add a retry loop for the i2c sensor reading. - Update the sensor handling for sensors which do not have a location entry. [1]
Submitted by: [1] Justin Hibbits. Approved by: nwhitehorn (mentor)
|
222461 |
29-May-2011 |
nwhitehorn |
Move the celsius-to-kelvin conversion to a place that powermac_thermal can see it as well.
|
222458 |
29-May-2011 |
nwhitehorn |
Update the I2C-based temperature/fan drivers to connect to the Powermac thermal control module. This provides automatic fan management on all G5 PowerMacs and Xserves.
|
222449 |
29-May-2011 |
andreast |
Add a new driver, the ad7417, to read temperatures and voltages on some PowerMac's.
Approved by: nwhitehorn (mentor)
|
217560 |
18-Jan-2011 |
andreast |
There are PowerMacs which do not have a hwsensor-location property for this sensor. Instead of leaving this location empty we use here the default name 'sensor'.
Submitted by: Justin Hibbits <chmeeedalf at gmail dot com> Approved by: nwhitehorn (mentor)
|
217452 |
15-Jan-2011 |
andreast |
Remove unused variable. Spotted by a cppcheck (devel/cppcheck, http://sourceforge.net/projects/cppcheck) run.
Approved by: nwhitehorn (mentor)
|
216360 |
10-Dec-2010 |
andreast |
On the Xserve G5 we find the LM75 instead of the DS1775. The core functionality is the same, a difference is that the DS1775 has a better precision than the LM75. But we do not use it in our setup. Make the LM75 work the same as the DS1775.
Fix a typo in device_set_desc.
Tested by: Paul Mather <paul at gromit dlib vt edu>
Approved by: nwhitehorn (mentor)
|
214999 |
08-Nov-2010 |
nwhitehorn |
Provide support for IIC_M_NOSTOP/IIC_M_NOSTART for bit-banging and otherwise low-level controllers.
Reviewed by: thompsa
|
213904 |
15-Oct-2010 |
andreast |
Add three new drivers for fan control and temperature reading on the PowerMac7,2.
- The fcu driver lets us read and write the fan RPMs for all fans in the PowerMac7,2. This driver is PowerMac specific. - The ds1775 is a driver to read the temperature for the drive bay sensor. - The max6690 is another driver to read temperatures. Here it is used to read the inlet, the backside and the U3 heatsink temperature.
An additional driver, the ad7417, will follow later.
Thanks to nwhitehorn for guiding me through this driver development.
Approved by: nwhitehorn (mentor)
|
212413 |
10-Sep-2010 |
avg |
bus_add_child: change type of order parameter to u_int
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
|
210998 |
07-Aug-2010 |
joel |
Fix typo in comment.
|
209800 |
08-Jul-2010 |
nwhitehorn |
Fix iicbus_get_addr() on 64-bit big-endian systems. The bus accessor passes a uintptr_t, not a uint32_t.
|
209301 |
18-Jun-2010 |
nwhitehorn |
Revert changes accidentally committed as part of r209298.
|
209298 |
18-Jun-2010 |
nwhitehorn |
Provide for multiple, cascaded PICs on PowerPC systems, and extend the OFW interrupt map interface to also return the device's interrupt parent.
MFC after: 8.1-RELEASE
|
208839 |
05-Jun-2010 |
nwhitehorn |
Add two new flags (IIC_M_NOSTOP and IIC_M_NOSTART) to struct iic_msg to allow consumers of iicbus_transfer() to send messages with repeated starts.
Reviewed by: imp
|
207554 |
03-May-2010 |
sobomax |
Add new tunable 'net.link.ifqmaxlen' to set default send interface queue length. The default value for this parameter is 50, which is quite low for many of today's uses and the only way to modify this parameter right now is to edit if_var.h file. Also add read-only sysctl with the same name, so that it's possible to retrieve the current value.
MFC after: 1 month
|
191369 |
21-Apr-2009 |
stas |
- Rename ds1672 and ds133x devices to "ds1672_rtc" and "ds133x_rtc" respectivly. This will allow one to have a kernel with both devices present and use it for multiple boards with different types of RTC sitting on a bus.
Discussed with: imp
|
191322 |
20-Apr-2009 |
stas |
- Give a warning and start the oscillator if it was not previously runned. - Rename ds1672 -> rtc to follow the other drivers. - Refactor/simplify the code a bit.
MFC after: 2 weeks
|
191148 |
16-Apr-2009 |
kmacy |
Change if_output to take a struct route as its fourth argument in order to allow passing a cached struct llentry * down to L2
Reviewed by: rwatson
|
188461 |
10-Feb-2009 |
imp |
Fix iicbus_intr, iicbus_write and device_read_ivar prototypes...
|
187709 |
26-Jan-2009 |
raj |
Teach iic(4) the 'repeated start' I2C condition. This will be used by the upcoming i2c(8) diag utility.
Reviewed by: bms, stas Obtained from: Semihalf
|
187457 |
20-Jan-2009 |
nwhitehorn |
Change the probe priority for PCI and I2C generic bus modules from numerical constants to BUS_PROBE_GENERIC.
Suggested by: jhb
|
187321 |
15-Jan-2009 |
nwhitehorn |
Revert revision 186833 and try a different strategy to allow this device to work when the bus attaches its own children. Instead of hardcoding a unit number and returning BUS_PROBE_NOWILDCARD, which will break multiple iicbus systems, check in the probe routine whether the device address is 0. Real I2C devices will never have this address, but devices added with BUS_ADD_CHILD() will.
Requested by: jhb Reviewed by: jhb
|
187261 |
15-Jan-2009 |
nwhitehorn |
Import an Open Firmware I2C bus module. This attaches firmware device tree indicated I2C devices, and provides an ofw_bus interface for driver probing. This should be MI, but is currently provided only on PowerPC due to lack of sparc64 hardware with an I2C controller.
Discussed on: freebsd-arch
|
186833 |
06-Jan-2009 |
nwhitehorn |
Change the way I2C bus attachment works to allow firmware-assisted bus subclasses as are available with PCI. Changes I2C device drivers without real probe logic to return BUS_PROBE_NOWILDWARD to avoid interference with firmware bus enumeration, and reduces the probe priority of the iicbus base driver to allow subclass attachment at higher priority.
Discussed on: freebsd-arch
|
183714 |
09-Oct-2008 |
peter |
Clean out some empty mergeinfo records, presumably by people doing local cp/mv operations. The full repo-relative URL should be specified for the source in these cases.
|
182872 |
08-Sep-2008 |
raj |
Streamline #include sections in ds133x and ds1672 drivers. This unbreaks the LINT build.
|
182870 |
08-Sep-2008 |
raj |
ds133x: Introduce device_identify method; update NOTES.
Obtained from: Semihalf
|
182034 |
23-Aug-2008 |
imp |
Handle errors from device_get_chidlren. Free child list when there's more children than we expected.
|
181682 |
13-Aug-2008 |
ed |
Fix compilation of arm's AVILA.
Compilation of the AVILA kernel failed because of two reasons:
- It needed curthread, which is defined through <sys/pcpu.h>.
- It still referred the softc's sc_mtx field, which has been replaced by sc_lock three weeks ago.
To solve the first problem, I decided to include <sys/pcpu.h> in <sys/sx.h>, which also seems to be done by <sys/mutex.h> and <sys/rwlock.h>. Those header files also require curthread.
Approved by: jhb
|
181602 |
11-Aug-2008 |
raj |
Rework Dallas Semiconductor RTC support.
- Extend the DS1339 driver to recognize more chips in the family: DS1337, DS1338, DS1339 are now supported - Provide run-time chip detection
Reviewed, tested by: stas Obtained from: Piotr Ziecik kosmo ! semihalf dot com
|
181601 |
11-Aug-2008 |
raj |
Rename ds1339 -> ds133x to better fit the upcoming driver extensions.
|
181325 |
05-Aug-2008 |
stas |
- Reflect the iicbus infrastructure changes.
Approved by: raj
|
181324 |
05-Aug-2008 |
stas |
- Reflect changes in iic infrastructure.
|
181305 |
04-Aug-2008 |
jhb |
Lock the consumers of the iicbus(4) infrastructure: - ad7418(4) uses an sx lock instead of a mtx since the iicbus(4) stuff it calls can sleep (request_bus()). Also, I expanded the locking slightly to serialize writes to data stored in the softc. - Similarly, the icee(4) driver now uses an sx lock instead of a mutex. I also removed the pointless OPENED flag and flags field from the softc. - The locking for the ic(4) driver was a bit trickier: - Add a mutex to the softc to protect softc data. - The driver uses malloc'd buffers that are the size of the interface MTU to send and receive packets. Previously, these were allocated every time the interface was brought up and anytime the MTU was changed, with various races that could result in memory leaks. I changed this to be a bit simpler and more like other NIC drivers in that we allocate buffers during attach for the default MTU size and only reallocate them on MTU changes. The reallocation procedure goes to some lengths with various flags to not replace either the the receive or transmit buffers while the driver is busy receiving or transmitting a packet. - Store the device_t of the driver in the softc instead of detours into new-bus using if_dunit from the ifnet and an even more bizarre detour to get the softc instead of using if_softc. - Drop the driver mutex when invoking netisr_dispatch() to pass the packet up to IP. - Use if_printf().
|
181304 |
04-Aug-2008 |
jhb |
Add locking to the core iicbus(4) drivers: - Add an sx lock to the iic(4) driver to serialize open(), close(), read(), and write and to protect sc_addr and sc_count in the softc. - Use cdev->si_drv1 instead of using the minor number of the cdev to lookup the softc via newbus in iic(4). - Store the device_t in the softc to avoid a similar detour via minor numbers in iic(4). - Only add at most one instance of iic(4) and iicsmb(4) to each iicbus(4) instance, and do it in the child driver. - Add a mutex to the iicbus(4) softc to synchronize the request/release bus stuff. - Use __BUS_ACCESSOR() for IICBUS_ACCESSOR() instead of rolling our own. - Add a mutex to the iicsmb(4) softc to protect softc state updated in the interrupt handler. - Remove Giant from all the smbus methods in iicsmb(4) now that all the iicbus(4) backend is locked.
|
181303 |
04-Aug-2008 |
jhb |
Add locking to the various iicbus(4) bridge drivers: - Just grab Giant in the ixp425_iic(4) driver since this driver uses a shared address/data register window pair to access the actual I2C registers. None of the other ixp425 drivers lock access to these shared address/data registers yet and that would need to be done before this could use any meaningful locking. - Add locking to the interrupt handler and 'iicbus_reset' methods of the at91_twi(4) driver. - Add locking to the pcf(4) driver. Other pcf(4) fixes include: - Don't needlessly zero the softc. - Use bus_foo rather than bus_space_foo and remove bus space tag and handle from softc. - The lpbb(4) driver just grabs Giant for now. This will be refined later when ppbus(4) is locked. - As was done with smbus earlier, move the DRIVER_MODULE() lines to match the bus driver (either iicbus or iicbb) to the bridge driver into the bridge drivers.
Tested by: sam (arm/ixp425)
|
180811 |
25-Jul-2008 |
stas |
- Add driver for Dallas Semiconductor DS1339 RTC sitting on I2C bus.
Reviewed by: raj Approved by: imp MFC after: 2 week
|
179624 |
06-Jun-2008 |
jhb |
Explicitly lock Giant in smbus_if methods in the bktr_i2c and iicsmb drivers for now. This can be replaced with driver locks when these drivers are locked.
|
168806 |
17-Apr-2007 |
imp |
Don't use spinlocks here. The iicbus transactions can take a long time, and this prevents interrupts (say for Hz/hardclock) from happening. Time stands still during the transfers...
|
167857 |
23-Mar-2007 |
imp |
New device: icee. Generic i2c eeprom driver.
|
167856 |
23-Mar-2007 |
imp |
MFp4: Make the iicbus fully hinted. We no longer automatically add some devices (and not others). To get instances onto the iicbus, one now needs hints or an identify routine. We also do not probe the bus for devices because many iic devices cannot be safely probed (and when they can, the probe order turns out to be somewhat difficult to get right).
# I'm not 100% sure that the iicsmb removal is right. Please contact me if # this causes difficulty.
|
167855 |
23-Mar-2007 |
imp |
MFp4: Make iicbus_trasnfer_gen suitable for bridge drivers. Use it in the bitbang bridge.
|
167854 |
23-Mar-2007 |
imp |
MFp4: Create an ivar for each iic device on the iicbus. This ivar holds the device's address.
|
164901 |
05-Dec-2006 |
imp |
const poison
submitted by: john wehle
|
164900 |
05-Dec-2006 |
imp |
More properly cleanup the iicbus child when deleting it.
These are from patches by John Wehle, but the commentary has been updated by me.
Obtained from: ports/multimedia/pvr250, indirectly
|
164897 |
05-Dec-2006 |
imp |
Reference Hauppage's cxm_iic bit-bang device here. Add a note that suggests a cleanup.
Note: This patch was derived based on looking at the pvrxxx/pvr250 ports' Makefiles only, and may be incomplete. It is not derived from anything I saw from Hauppage.
|
164714 |
28-Nov-2006 |
imp |
Add a fake flag for write. Many drivers have started to use it and it seems like a good idea.
Submitted by: sam
|
164704 |
28-Nov-2006 |
imp |
Remove unused leftovers.
|
164502 |
22-Nov-2006 |
imp |
MFp4: Add ixpiic bit-bang driver.
Submitted by: sam@
|
164501 |
22-Nov-2006 |
imp |
<blush> copyout on read, not write. Tweak a comment while I'm here.
|
164421 |
19-Nov-2006 |
sam |
o define transfer method o attach ds1672 and ad7418, to be cleaned up
MFC after: 1 month
|
164420 |
19-Nov-2006 |
sam |
i2c and clock driver for Dallas Semiconductor DS1672 RTC
MFC after: 1 month
|
164419 |
19-Nov-2006 |
sam |
i2c driver for Analog Devices AD7418
MFC after: 1 month
|
162234 |
11-Sep-2006 |
jhb |
Minor overhaul of SMBus support: - Change smbus_callback() to pass a void * rather than caddr_t. - Change smbus_bread() to pass a pointer to the count and have it be an in/out parameter. The input is the size of the buffer (same as before), but on return it will contain the actual amount of data read back from the bus. Note that this value may be larger than the input value. It is up to the caller to treat this as an error if desired. - Change the SMB_BREAD ioctl to write out the updated struct smbcmd which will contain the actual number of bytes read in the 'count' field. To preserve the previous ABI, the old ioctl value is mapped to SMB_OLD_BREAD which doesn't copy the updated smbcmd back out to userland. I doubt anyone actually used the old BREAD anyway as it was rediculous to do a bulk-read but not tell the using program how much data was actually read. - Make the smbus driver and devclass public in the smbus module and push all the DRIVER_MODULE()'s for attaching the smbus driver to various foosmb drivers out into the foosmb modules. This makes all the foosmb logic centralized and allows new foosmb modules to be self-contained w/o having to hack smbus.c everytime a new smbus driver is added. - Add a new SMB_EINVAL error bit and use it in place of EINVAL to return an error for bad arguments (such as invalid counts for bread and bwrite). - Map SMB bus error bits to EIO in smbus_error(). - Make the smbus driver call bus_generic_probe() and require child drivers such as smb(4) to create device_t's via identify routines. Previously, smbus just created one anonymous device during attach, and if you had multiple drivers that could attach it was just random chance as to which driver got to probe for the sole device_t first. - Add a mutex to the smbus(4) softc and use it in place of dummy splhigh() to protect the 'owner' field and perform necessary synchronization for smbus_request_bus() and smbus_release_bus(). - Change the bread() and bwrite() methods of alpm(4), amdpm(4), and viapm(4) to only perform a single transaction and not try to use a loop of multiple transactions for a large request. The framing and commands to use for a large transaction depend on the upper-layer protocol (such as SSIF for IPMI over SMBus) from what I can tell, and the smb(4) driver never allowed bulk read/writes of more than 32-bytes anyway. The other smb drivers only performed single transactions. - Fix buffer overflows in the bread() methods of ichsmb(4), alpm(4), amdpm(4), amdsmb(4), intpm(4), and nfsmb(4). - Use SMB_xxx errors in viapm(4). - Destroy ichsmb(4)'s mutex after bus_generic_detach() to avoid problems from child devices making smb upcalls that would use the mutex during their detach methods.
MFC after: 1 week Reviewed by: jmg (mostly)
|
162074 |
06-Sep-2006 |
imp |
jhb points out that these mallocs don't need to be checked because of M_WAITOK.
|
162072 |
06-Sep-2006 |
imp |
MFp4: check the return value of malloc and report an error when invalid.
|
161516 |
21-Aug-2006 |
imp |
Minor style(9) treatment to make things a little more consistant within iicbus code.
|
160372 |
14-Jul-2006 |
imp |
Allow iic bridges to support a generalized transfer, rather than forcing all transfers to do the start read/write stop by hand. Some smart bridges prefer this sort of operation, and this allows us to support their features more easily. When bridges don't support it, we fall back to using the old-style opertaions. Expand the ioctl interface to expose this function. Unlike the old-style interface, this interface is thread safe, even on old bridges.
|
157827 |
17-Apr-2006 |
jmg |
remove DRIVER_MODULE lines that are useless... pcf doesn't exist (only as pcf_ebus and pcf_isa, they should probably be fixed back to pcf), and bti2c doesn't exist, bktr has smbus or iicbb as children..
Brought to you by: http://people.FreeBSD.org/~jmg/driver.pdf
|
157523 |
04-Apr-2006 |
imp |
newbus will zero softc, so no need to duplicate the zeroing here. Plus a minor formatting nit in nearby code.
|
157497 |
04-Apr-2006 |
imp |
Turn a file that was mostly style(9) compliant to a file that's really close to being completely style(9). The odd-ball indentation in a few places was really distracting.
|
157482 |
04-Apr-2006 |
imp |
Replace hard coded '0' with symbolic constant IIC_UNKNOWN to reflect what we're actually doing.
|
148920 |
10-Aug-2005 |
obrien |
Remove public declarations of variables that were forgotten when they were made static.
|
148887 |
09-Aug-2005 |
rwatson |
Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field.
Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so.
Reviewed by: pjd, bz MFC after: 7 days
|
147611 |
26-Jun-2005 |
dwmalone |
Fix some long standing bugs in writing to the BPF device attached to a DLT_NULL interface. In particular:
1) Consistently use type u_int32_t for the header of a DLT_NULL device - it continues to represent the address family as always. 2) In the DLT_NULL case get bpf_movein to store the u_int32_t in a sockaddr rather than in the mbuf, to be consistent with all the DLT types. 3) Consequently fix a bug in bpf_movein/bpfwrite which only permitted packets up to 4 bytes less than the MTU to be written. 4) Fix all DLT_NULL devices to have the code required to allow writing to their bpf devices. 5) Move the code to allow writing to if_lo from if_simloop to looutput, because it only applies to DLT_NULL devices but was being applied to other devices that use if_simloop possibly incorrectly.
PR: 82157 Submitted by: Matthew Luckie <mjl@luckie.org.nz> Approved by: re (scottl)
|
147256 |
10-Jun-2005 |
brooks |
Stop embedding struct ifnet at the top of driver softcs. Instead the struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com.
This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go.
Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr.
Reviewed by: sobomax, sam
|
139749 |
06-Jan-2005 |
imp |
Start each of the license/copyright comments with /*-, minor shuffle of lines
|
133690 |
13-Aug-2004 |
rwatson |
Since if_ic doesn't contain locking or run with INTR_MPSAFE, mark the interface as IFF_NEEDSGIANT so if_start is run holding Giant.
|
130585 |
16-Jun-2004 |
phk |
Do the dreaded s/dev_t/struct cdev */ Bump __FreeBSD_version accordingly.
|
129778 |
27-May-2004 |
joerg |
Make "envctrl" a known master driver for iicbus.
|
129291 |
16-May-2004 |
joerg |
Another candidate that didn't use copyin/copyout for user<->kernel transfers.
MFC after: 1 month
|
129289 |
16-May-2004 |
joerg |
After successfully attaching an iicbus instance, instead of using a NULL name in device_add_child(), explicitly name all of our known child drivers in order to give them a chance to attach to us. Otherwise, only the first one present would be probed and attached.
Reviewed by: nsouch MFC after: 1 month
|
129152 |
12-May-2004 |
joerg |
Convert the #if 0 magic to #if SCAN_IICBUS, and make it actually compile again. While it's not generally recommended anymore, it might still prove useful for debugging purposes.
|
126080 |
21-Feb-2004 |
phk |
Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION.
Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
|
126076 |
21-Feb-2004 |
phk |
Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.
A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number.
|
123922 |
28-Dec-2003 |
sam |
o eliminate widespread on-stack mbuf use for bpf by introducing a new bpf_mtap2 routine that does the right thing for an mbuf and a variable-length chunk of data that should be prepended. o while we're sweeping the drivers, use u_int32_t uniformly when when prepending the address family (several places were assuming sizeof(int) was 4) o return M_ASSERTVALID to BPF_MTAP* now that all stack-allocated mbufs have been eliminated; this may better be moved to the bpf routines
Reviewed by: arch@ and several others
|
121816 |
31-Oct-2003 |
brooks |
Replace the if_name and if_unit members of struct ifnet with new members if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance.
This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics.
Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
|
119418 |
24-Aug-2003 |
obrien |
Use __FBSDID(). Also some minor style cleanups.
|
118728 |
10-Aug-2003 |
ticso |
Don't hardcode unit numer '0'. We can have multiple instances.
|
116559 |
19-Jun-2003 |
jmg |
make iicbb_devclass and iicbb_driver globally visible. This will let drivers that implemnt the i2c bit banging bus interface not have to recompile iicbb in order to add an attachment for it.
This will mean the bktr and other definitions can go back to their respective drivers.
|
111888 |
04-Mar-2003 |
jlemon |
Update netisr handling; Each SWI now registers its queue, and all queue drain routines are done by swi_net, which allows for better queue control at some future point. Packets may also be directly dispatched to a netisr instead of queued, this may be of interest at some installations, but currently defaults to off.
Reviewed by: hsu, silby, jayanth, sam Sponsored by: DARPA, NAI Labs
|
111815 |
03-Mar-2003 |
phk |
Gigacommit to improve device-driver source compatibility between branches:
Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values.
This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386.
Approved by: re(scottl)
|
111119 |
19-Feb-2003 |
imp |
Back out M_* changes, per decision of the TRB.
Approved by: trb
|
109623 |
21-Jan-2003 |
alfred |
Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
|
106937 |
14-Nov-2002 |
sam |
network interface driver changes:
o don't strip the Ethernet header from inbound packets; pass packets up the stack intact (required significant changes to some drivers) o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN) o track ether_ifattach/ether_ifdetach API changes o track bpf changes (use BPF_TAP and BPF_MTAP) o track vlan changes (ifnet capabilities, revised processing scheme, etc.) o use if_input to pass packets "up" o call ether_ioctl for default handling of ioctls
Reviewed by: many Approved by: re
|
105214 |
16-Oct-2002 |
phk |
Fix misindentation.
Spotted by: FlexeLint
|
103588 |
19-Sep-2002 |
peter |
move <machine/iic.h> and <machine/smb.h> to <dev/iicbus/iic.h> and <dev/smbus/smb.h> - there is nothing MD about these ioctl definitions.
|
93023 |
23-Mar-2002 |
nsouch |
Major rework of the iicbus/smbus framework:
- VIA chipset SMBus controllers added - alpm driver updated - Support for dynamic modules added - bktr FreeBSD smbus updated but not tested - cleanup
|
87599 |
10-Dec-2001 |
obrien |
Update to C99, s/__FUNCTION__/__func__/, also don't use ANSI string concatenation.
|
83366 |
12-Sep-2001 |
julian |
KSE Milestone 2 Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process.
Sorry john! (your next MFC will be a doosie!)
Reviewed by: peter@freebsd.org, dillon@freebsd.org
X-MFC after: ha ha ha ha
|
74810 |
26-Mar-2001 |
phk |
Send the remains (such as I have located) of "block major numbers" to the bit-bucket.
|
69152 |
25-Nov-2000 |
jlemon |
Lock down the network interface queues. The queue mutex must be obtained before adding/removing packets from the queue. Also, the if_obytes and if_omcasts fields should only be manipulated under protection of the mutex.
IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on the queue. An IF_LOCK macro is provided, as well as the old (mutex-less) versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which needs them, but their use is discouraged.
Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF, which takes care of locking/enqueue, and also statistics updating/start if necessary.
|
67882 |
29-Oct-2000 |
phk |
Remove unneeded #include <sys/proc.h> lines.
|
67164 |
15-Oct-2000 |
phk |
Remove unneeded #include <machine/clock.h>
|
61722 |
16-Jun-2000 |
jake |
Allow these drivers to be detached.
Reviewed by: mdodd
|
59760 |
29-Apr-2000 |
phk |
Remove unneeded #include <sys/kernel.h>
|
59391 |
19-Apr-2000 |
phk |
Remove ~25 unneeded #include <sys/conf.h> Remove ~60 unneeded #include <sys/malloc.h>
|
59368 |
18-Apr-2000 |
phk |
Remove unneeded <sys/buf.h> includes.
Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks by 924 bytes.
|
59093 |
08-Apr-2000 |
dfr |
* Factor out the object system from new-bus so that it can be used by non-device code. * Re-implement the method dispatch to improve efficiency. The new system takes about 40ns for a method dispatch on a 300Mhz PII which is only 10ns slower than a direct function call on the same hardware.
This changes the new-bus ABI slightly so make sure you re-compile any driver modules which you use.
|
55205 |
29-Dec-1999 |
peter |
Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
|
54073 |
03-Dec-1999 |
mdodd |
Remove the 'ivars' arguement to device_add_child() and device_add_child_ordered(). 'ivars' may now be set using the device_set_ivars() function.
This makes it easier for us to change how arbitrary data structures are associated with a device_t. Eventually we won't be modifying device_t to add additional pointers for ivars, softc data etc.
Despite my best efforts I've probably forgotten something so let me know if this breaks anything. I've been running with this change for months and its been quite involved actually isolating all the changes from the rest of the local changes in my tree.
Reviewed by: peter, dfr
|
53329 |
18-Nov-1999 |
peter |
Convert iic to use make_dev() rather than cdevsw_add(). This stops the annoying 'iic is usurping iic's cdevsw' type messages. (Yes, there are other ways to fix cdevsw_add(), but that is a doomed api)
|
53005 |
08-Nov-1999 |
peter |
Use cdevsw_add() explicitly and DRIVER_MODULE().
|
52776 |
01-Nov-1999 |
nsouch |
Sync with RELENG_3.
|
51936 |
04-Oct-1999 |
peter |
Fix: WARNING: "iic" is usurping "iic"'s cdevsw[] - the DEV_DRIVER_MODULE() takes care of the cdevsw_add() - it doesn't need to be done twice.
|
51658 |
25-Sep-1999 |
phk |
Remove five now unused fields from struct cdevsw. They should never have been there in the first place. A GENERIC kernel shrinks almost 1k.
Add a slightly different safetybelt under nostop for tty drivers.
Add some missing FreeBSD tags
|
51646 |
25-Sep-1999 |
phk |
Remove NBPF conditionality of bpf calls in most of our network drivers.
This means that we will not have to have a bpf and a non-bpf version of our driver modules.
This does not open any security hole, because the bpf core isn't loadable
The drivers left unchanged are the "cross platform" drivers where the respective maintainers are urged to DTRT, whatever that may be.
Add a couple of missing FreeBSD tags.
|
50477 |
28-Aug-1999 |
peter |
$Id$ -> $FreeBSD$
|
49195 |
29-Jul-1999 |
mdodd |
Alter the behavior of sys/kern/subr_bus.c:device_print_child()
- device_print_child() either lets the BUS_PRINT_CHILD method produce the entire device announcement message or it prints "foo0: not found\n"
Alter sys/kern/subr_bus.c:bus_generic_print_child() to take on the previous behavior of device_print_child() (printing the "foo0: <FooDevice 1.1>" bit of the announce message.)
Provide bus_print_child_header() and bus_print_child_footer() to actually print the output for bus_generic_print_child(). These functions should be used whenever possible (unless you can just use bus_generic_print_child())
The BUS_PRINT_CHILD method now returns int instead of void.
Modify everything else that defines or uses a BUS_PRINT_CHILD method to comply with the above changes.
- Devices are 'on' a bus, not 'at' it. - If a custom BUS_PRINT_CHILD method does the same thing as bus_generic_print_child(), use bus_generic_print_child() - Use device_get_nameunit() instead of both device_get_name() and device_get_unit() - All BUS_PRINT_CHILD methods return the number of characters output.
Reviewed by: dfr, peter
|
48645 |
06-Jul-1999 |
des |
Rename bpfilter to bpf.
|
48557 |
04-Jul-1999 |
phk |
Remove cmaj and bmaj args from DEV_DRIVER_MODULE.
|
47640 |
31-May-1999 |
phk |
Simplify cdevsw registration.
The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing.
cdevsw_add() will print an message if the d_maj field looks bogus.
Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL.
Move bdevsw() and devsw() functions to kern/kern_conf.c
Bump __FreeBSD_version to 400006
This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions
if_xe.c bogusly accessed cdevsw[], author/maintainer please fix.
I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
|
47625 |
30-May-1999 |
phk |
This commit should be a extensive NO-OP:
Reformat and initialize correctly all "struct cdevsw".
Initialize the d_maj and d_bmaj fields.
The d_reset field was not removed, although it is never used.
I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way.
Vinum and i4b not modified, patches emailed to respective authors.
|
46792 |
09-May-1999 |
phk |
Unconfuse DEV_MODULE() and DEV_DRIVER_MODULE() about the difference between a major number for a dev_t.
|
46743 |
08-May-1999 |
dfr |
Move the declaration of the interrupt type from the driver structure to the BUS_SETUP_INTR call.
|
46635 |
07-May-1999 |
phk |
Continue where Julian left off in July 1998:
Virtualize bdevsw[] from cdevsw. bdevsw() is now an (inline) function.
Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention to the order of the cmaj/bmaj arguments!)
Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE (ditto!)
(Next step will be to convert all bdev dev_t's to cdev dev_t's before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
|
45575 |
11-Apr-1999 |
eivind |
Staticize.
|
43976 |
13-Feb-1999 |
nsouch |
Handle correctly iicbus request/release mechanism. Add iicbus allocation to the general purpose i/o iic(4) driver.
|
43714 |
06-Feb-1999 |
roger |
Changed to use IICBUS_REPEATED_START
Submitted by: Changed to use IICBUS_REPEATED_START
|
43347 |
28-Jan-1999 |
roger |
Submitted by: Nicolas Souchu <nsouch@freebsd.org>
Updated to support bt848 driver and MSP3400 audio chip. This adds changes made in 1.4.2.1 and 1.4.2.2 from RELENG_3
|
43346 |
28-Jan-1999 |
roger |
Submitted by: Nicolas Souchu <nsouch@freebsd.org>
Updated to support bt848 driver MSP34xx audio chip. This adds changes made in 1.3.2.1 and 1.3.2.2 from RELENG_3
|
43345 |
28-Jan-1999 |
roger |
Submitted by: Nicolas Souchu <nsouch@freebsd.org>
Added support required by bt848 driver for MSP34xx audio chip
|
43301 |
27-Jan-1999 |
dillon |
Fix warnings in preparation for adding -Wall -Wcast-qual to the kernel compile
|
42442 |
09-Jan-1999 |
nsouch |
Change /dev/smb and /dev/iic interface to allow user programs to interact with devices dynamically. That means,
+ only one /dev/iic or /dev/smb device for each smb/iic bus to access + I2C/SMB device address must be given to any ioctl + new devices may be plugged and accessed after boot, which was impossible previously (device addresses were hardcoded into the kernel)
|
41591 |
07-Dec-1998 |
archie |
The "easy" fixes for compiling the kernel -Wunused: remove unreferenced static and local variables, goto labels, and functions declared but not defined.
|
41296 |
22-Nov-1998 |
nsouch |
Remove broken and useless intr interface.
Submitted by: Doug Rabson <dfr@nlsystems.com> Amancio Hasty <hasty@rah.star-gate.com>
Avoid compile warnings.
|
41015 |
08-Nov-1998 |
nsouch |
Check if devclass exists for probed devices before declaring the device 'alive'.
|
41012 |
08-Nov-1998 |
nsouch |
Add semicolon to INTERFACE declarations
|
40992 |
07-Nov-1998 |
nsouch |
Add iic driver iff the corresponding devclass exists.
|
40914 |
04-Nov-1998 |
nsouch |
Properly reset parent to get interface addr.
|
40782 |
31-Oct-1998 |
nsouch |
iicbb is generic support for I2C bit-banging.
Other files: timeout management added to the I2C framework.
|
39023 |
09-Sep-1998 |
nsouch |
Major number allocated for generic I2C i/o -> 105
|
38813 |
04-Sep-1998 |
nsouch |
Device registration temporaly removed until major number allocation ok.
|
38780 |
03-Sep-1998 |
nsouch |
Reviewed by: Doug Rabson Submitted by: nsouch I2C and SMB ioctls
|
38775 |
03-Sep-1998 |
nsouch |
This commit was generated by cvs2svn to compensate for changes in r38774, which included commits to RCS files with non-trunk default branches.
|