MFC r346305, r346691-r346694, r346696-r346697r346305:arm: allwinner: Makes more device optionalr346691:arm: allwinner: Add pnpinfo for aw_sid and add module Makefiler346692:arm: allwinner: A
MFC r346305, r346691-r346694, r346696-r346697r346305:arm: allwinner: Makes more device optionalr346691:arm: allwinner: Add pnpinfo for aw_sid and add module Makefiler346692:arm: allwinner: Add pnp info to aw_thermal and compile it as module toor346693:arm: allwinner: Add pnp info to axp81x and compile it as module toor346694:arm: allwinner: Add pnp info to aw_rtc and compile it as module toor346696:arm: allwinner: Add pnp info to if_awg and compile it as module tooWhile here make it depend on aw_sid as it's needed for mac generation.r346697:arm: allwinner: Add pnp info to aw_rsb and compile it as module too
show more ...
MFC r343826, r346698, r349057-r349060, r349073-r349077, r349080-r349086, r349088, r349091-r349097, r349115, r349119, r349130-r349132, r349143-r349145, r349164-r349168, r349174, r349269-r34927
MFC r343826, r346698, r349057-r349060, r349073-r349077, r349080-r349086, r349088, r349091-r349097, r349115, r349119, r349130-r349132, r349143-r349145, r349164-r349168, r349174, r349269-r349273r343826 by yuripv:pwm.8: fix markup in synopsis, add -f descriptionr346698 by manu:arm: allwinner: aw_pwm: compile it as module toor349057:Allow pwm(9) components to be selected individually, while 'device pwm'still includes it all.r349058:In detach(), check for failure of bus_generic_detach(), only releaseresources if they got allocated (because detach() gets called from attach()to handle various failures), and delete the pwmbus child if it got created.r349059:Don't call pwmbus_attach_bus(), because it may not be present if thisdriver is compiled into the kernel but pwmbus will be loaded as a modulewhen needed (and because of that, pwmbus_attach_bus() is going away inthe near future). Instead, just directly do what that function did:register the fdt xfef handle, and attach the pwmbus.r349060:Handle failure to enable the clock or obtain its frequency.r349073:Do not include pwm.h here, it is purely a userland interface file containingioctl defintions for the pwmc driver. It is not part of the pwmbus interface.r349074:Move/rename the sys/pwm.h header file to dev/pwm/pwmc.h. The file containsioctl definitions and related datatypes that allow userland control of pwmhardware via the pwmc device. The new name and location better reflects itsassocation with a single device driver.r349075:Remove pwmbus_attach_bus(), it no longer has any callers. Also remove acouple prototypes for functions that never existed (and never will).r349076:Use device_delete_children() instead of a locally-rolled copy of it thatleaks the device-list memory.r349077:Add a missing #include. I suspect this used to get included via some headerpollution that was cleaned up recently, and this file got missed in thecleanup because it's not attached to the build unless you specificallyrequest this device in a custom kernel config.r349080:Make pwmbus driver and devclass vars static; they're not mentioned in anyheader file, so they can't be used outside this file anyway.r349081:Unwrap prototype lines so that return type and function name are on thesame line. No functional changes.r349082:Spell unsigned int as u_int and channel as chan; eliminates the need to wrapsome long lines.r349083:Give the aw_pwm driver a module version.r349084:Rename the channel_max method to channel_count, because that's what it'sreturning. (If the channel count is 2, then the max channel number is 1.)r349085:Destroy the cdev on device detach. Also, make the driver and devclassstatic, because nothing outside this file needs them.r349086:Restructure the pwm device hirearchy and interfaces.The pwm and pwmbus interfaces were nearly identical, this merges them into asingle pwmbus interface. The pwmbus driver now implements the pwmbusinterface by simply passing all calls through to its parent (the hardwaredriver). The channel_count method moves from pwm to pwmbus, and theget_bus method is deleted (just no longer needed).The net effect is that the interface for doing pwm stuff is now the sameregardless of whether you're a child of pwmbus, or some random driverelsewhere in the hierarchy that is bypassing the pwmbus layer and is talkingdirectly to the hardware driver via cross-hierarchy connections establishedusing fdt data.The pwmc driver is now a child of pwmbus, instead of being its sibling(that's why the get_bus method is no longer needed; pwmc now gets thedevice_t of the bus using device_get_parent()).r349088:Make pwm channel numbers unsigned.r349091:The pwm interface was replaced with pwmbus, include the right header file.r349092:Make channel number unsigned, and spell unsigned int u_int. This shouldhave been part of r349088.r349093:This code no longer uses fdt/ofw stuff, no need to include ofw headers.r349094:Add module makefiles for pwm.r349095:Split the dtb MODULES_EXTRA line to a series of += lines, making it easierto maintain and keep in alphabetical order, and paving the way for addingsome other modules that aren't dtb-related.r349096:Add module makefiles for Texas Instruments ARM SoCs.The natural place to look for them based on how other SoCs are organizedwould be sys/modules/ti, but that's already taken. Drop a clue intomodules/ti/Makefile directing people to modules/arm_ti if they're lookingfor ARM modules.r349097:Build SoC-specific modules with GENERIC for the SoCs that have them.r349115:Rename pwmbus.h to ofw_pwm.h, because after all the recent changes, thereis nothing left in the file that related to pwmbus at all. It just containsprototypes for the functions implemented in dev/pwm.ofw_pwm.c, so name itaccordingly and fix the include protect wrappers to match.A new pwmbus.h will be coming along in a future commit.r349119:Rework pwmbus and pwmc so that each child will handle a single PWM channel.Previously, there was a pwmc instance for each instance of pwm hardwareregardless of how many pwm channels that hardware supported. Now therewill be a pwmc instance for each channel when the hardware supportsmultiple channels. With a separate instance for each channel, we can have"named channels" in userland by making devfs alias entries in /dev/pwm.These changes add support for ivars to pwmbus, and use an ivar to track thechannel number for each child. It also adds support for hinted children.In pwmc, the driver checks for a label hint, and if present, it's used tocreate an alias for the cdev in /dev/pwm. It's not anticipated that hintswill be heavily used, but it's easy to do and allows quick ad-hoc creationof named channels from userland by using kenv to create hint.pwmc.N.label=hints. Upcoming changes will add FDT support, and most labels willprobably be specified that way.r349130:Add ofw_pwmbus to enumerate pwmbus devices on systems configured with fdtdata. Also, add fdt support to pwmc.r349131:Implement the ofw_bus_get_node method in aw_pwm(4) so that ofw_pwmbus canfind its metadata for instantiating children.r349132:Add back a const qualifier I somehow fumbled away between test-buildingand committing recent changes.r349143:Put the pwmc cdev filenames under the pwm directory along with any labelnames. I.e., everything related to pwm now goes in /dev/pwm. This willmake it easier for userland tools to turn an unqualified name into a fullyqualified pathname, whether it's the base pwmcX.Y name or a label name.r349144:Follow changes in the pwmc(4) driver in relation to device filenames.The driver now names its cdev nodes pwmcX.Y where X is unit number andY is the channel within that unit. Change the default device name frompwmc0 to pwmc0.0. The driver now puts cdev files and label aliases inthe /dev/pwm directory, so allow the user to provide unqualified nameswith -f and automatically prepend the /dev/pwm part for them.Update the examples in the manpage to show the new device name formatand location within /dev/pwm.r349145:Put periods at the ends of argument descriptions. Explain the relationshipbetween the period and duty arguments.r349164:Remove everything related to channels from the pwmc public interface, nowthat there is a pwmc(4) instance per channel and the channel number ismaintained as a driver ivar rather than being passed in from userland.r349165:Explain the relationship between PWM hardware channels being controlled andpwmc(4) device filenames. Also, use uppercase PWM when the term is beingused as an acronym, and expand the acronym where it's first used.r349166:Rearrange the argument checking and processing so that enable and disablecan be combined with configuring the period and duty cycle (the same ioctlsets all 3 values at once, so there's no reason to require the user to runthe program twice to get all 3 things set).r349167:Oops, it seems I left out the word 'cycle', fix it.r349168:Add a pwmc(4) manpage.r349174:Handle labels specified with hints even on FDT systems. Hints are theeasiest thing for a user to control (via loader.conf or kenv+kldload), sohandle them in addition to any label specified via the FDT data.r349269:Some mundane tweaks and cleanups to help de-clutter the diffs of someupcoming functional changes.Add an ofw_compat_data table for probing compat strings, and use it to addPNP data. Remove some stray semicolons at the end of macro definitions,and add a PWM_LOCK_ASSERT macro to round out the usual suite. Move thedevice_t and driver_methods structs to the end of the file. Tweak comments.r349270:Add support for the PWM(9) API. This allows configuring the pwm output usingpwm(9), but also maintains the historical sysctl config interface forcompatiblity with existing apps. The two config systems are not compatiblewith each other; if you use both interfaces to change configurations you'relikely to end up with incorrect output or none at all.r349271:Catch up with recent changes in pwmbus(9). The pwm(9) and pwmbus(9)interfaces were unified into pwmbus(9), and the PWMBUS_CHANNEL_MAX methodwas renamed PWMBUS_CHANNEL_COUNT. The pwmbus_attach_bus() function justwent away completely. Also, fix a few typos such as s/is/if/.r349272:Do some general cleanup and light wordsmithing.Sort methods alphabetically. Wrap long lines. Start sentences on a newline. Remove contractions (not because it's a good idea, just to silenceigor). Add some explanation of the units for the period and duty argumentsand the convention for channel numbers.r349273:Add pwm to the armv7 GENERIC kernel, it's now used by TI and Allwinner.
alwinner: Add missing files in r333708