summaryrefslogtreecommitdiffstats
path: root/sys/dev/ofw
Commit message (Collapse)AuthorAgeFilesLines
* Return IEEE 1275 compliant error codes.raj2010-11-111-8/+8
| | | | Submitted by: nwhitehorn
* Make all OF client interface calls return the maximum kind ofnwhitehorn2010-11-091-6/+74
| | | | | | does-not-exist error when no client interface module is installed instead of dereferencing NULL pointers. This eases implementation of platforms that may or may not have Open Firmware.
* Change OF_interpret() to also take an array of cell_t (missed in r209801).marius2010-09-114-10/+8
| | | | Reviewed by: nwhitehorn
* bus_add_child: change type of order parameter to u_intavg2010-09-101-3/+3
| | | | | | | | | | 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
* Missed a file in r209803: this header contains a definition ofnwhitehorn2010-07-081-0/+1
| | | | | | OFW_STD_32BIT. Pointy hat to: me
* Change the argument type to OF_call_method to take an array of cell_tnwhitehorn2010-07-083-8/+7
| | | | | instead of unsigned longs to prepare for platforms where they are not the same.
* Provide for multiple, cascaded PICs on PowerPC systems, and extend thenwhitehorn2010-06-182-5/+11
| | | | | | OFW interrupt map interface to also return the device's interrupt parent. MFC after: 8.1-RELEASE
* Initial implementation of the OFW i/f methods for FDT back-end.raj2010-05-281-0/+458
| | | | | Reviewed by: imp Sponsored by: The FreeBSD Foundation
* Prepare and extend OFW layer for FDT support.raj2010-05-286-11/+73
| | | | | | | | | | | | | o Let OFW_INIT() and OF_init() return status value. o Provide helper routines for 'compatible' property handling. o Only compile OF and OFW code, which is relevant in FDT scenario. o Other minor cosmetics Reviewed by: imp Sponsored by: The FreeBSD Foundation
* Pull OF_quiesce() out of the MI Open Firmware layer and entirely intonwhitehorn2010-05-164-36/+0
| | | | | | PPC ofw_machdep.c, in recognition of its state as a machine specific hack. Requested by: marius
* On PowerMac11,2 and (presumably) PowerMac12,1, we need to quiesce thenwhitehorn2010-05-164-0/+36
| | | | | | | | | | firmware in order to take over control of the SMU. Without doing this, the firmware background process doing fan control will run amok as we take over the system and crash the management chip. This is limited to these two machines because our kernel is heavily dependent on firmware accesses, and so quiescing firmware can cause nasty problems.
* With r205496 in place we should ensure that nargs and nreturns are alwaysmarius2010-04-021-0/+6
| | | | | | | | set to sane values as they no longer default to 0, otherwise some OFW implementation might copy in or out arguments not based on what the actual function takes but what ever stack garbage nargs and nreturns supply. Reviewed by: nwhitehorn
* Do not declare the various OFW command buffers static. It does notnwhitehorn2010-03-231-24/+24
| | | | | | | appear to be necessary on either sparc64 or powerpc, and is a concurrency nightmare. Reviewed by: marius
* The NetBSD Foundation has granted permission to remove clause 3 and 4 fromjoel2010-03-011-7/+0
| | | | | | their software. Obtained from: NetBSD
* Missed style fixes.marius2009-06-141-5/+3
|
* Fix style.marius2009-06-1410-183/+193
|
* strict kobj signatures: some ofw_setprop fixesavg2009-06-111-4/+4
| | | | | | | propname parameter is const Reviewed by: imp, current@ Approved by: jhb (mentor)
* Last minute TTY API change: remove mutex argument from tty_alloc().ed2009-05-291-1/+1
| | | | | | | | | | I don't want people to override the mutex when allocating a TTY. It has to be there, to keep drivers like syscons happy. So I'm creating a tty_alloc_mutex() which can be used in those cases. tty_alloc_mutex() should eventually be removed. The advantage of this approach, is that we can just remove a function, without breaking the regular API in the future.
* Unbreak OF_interpret() and its standard implementation after r186347.marius2009-03-292-2/+4
|
* Some Apple I2C buses give the device's I2C address in a property with thenwhitehorn2009-03-021-2/+9
| | | | | | | | name i2c-address instead of reg. Change the OFW I2C probe to check both locations for the address. Submitted by: Marco Trillo Reported by: Justin Hibbits
* Set the wrong softc size when defining the ofw_iicbus class. Change it tonwhitehorn2009-01-201-2/+2
| | | | the correct value.
* Import an Open Firmware I2C bus module. This attaches firmware device treenwhitehorn2009-01-151-0/+183
| | | | | | | | 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
* Fix the OFW interrupt map parser to use its own idea of the number of interruptnwhitehorn2009-01-033-18/+24
| | | | | | | | | cells in the map, instead of using a value passed to it and then panicing if it disagrees. This fixes interrupt map parsing for PCI bridges on some Apple Uninorth PCI controllers. Reported by: marcel Tested on: G4 iBook, Sun Ultra 5
* Modularize the Open Firmware client interface to allow run-time switchingnwhitehorn2008-12-207-585/+1375
| | | | | | | | | | | | of OFW access semantics, in order to allow future support for real-mode OF access and flattened device frees. OF client interface modules are implemented using KOBJ, in a similar way to the PPC PMAP modules. Because we need Open Firmware to be available before mutexes can be used on sparc64, changes are also included to allow KOBJ to be used very early in the boot process by only using the mutex once we know it has been initialized. Reviewed by: marius, grehan
* Unbreak ofwdump build by moving the pcell_t definition to after the kernelnwhitehorn2008-12-151-6/+6
| | | | | | types headers, and inside the _KERNEL ifdef. Pointy hat to: me
* Adapt parts of the sparc64 Open Firmware bus enumeration code (in particular,nwhitehorn2008-12-153-0/+178
| | | | | | | | | | | | | | | the code for parsing interrupt maps) to PowerPC and reflect their new MI status by moving them to the shared dev/ofw directory. This commit also modifies the OFW PCI enumeration procedure on PowerPC to allow the bus to find non-firmware-enumerated devices that Apple likes to add, and adds some useful Open Firmware properties (compat and name) to the pnpinfo string of children on OFW SBus, EBus, PCI, and MacIO links. Because of the change to PCI enumeration on PowerPC, X has started working again on PPC machines with Grackle hostbridges. Reviewed by: marius Obtained from: sparc64
* Remove unused consdev structure fields.ed2008-10-271-3/+1
| | | | | | The cn_unit and cn_tp fields don't seem to be used anywhere. Some drivers set them, while others don't. Just remove them, in an attempt to make our consdev code a little easier to understand.
* Integrate the new MPSAFE TTY layer to the FreeBSD operating system.ed2008-08-201-111/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve the following: - Improved driver model: The old TTY layer has a driver model that is not abstract enough to make it friendly to use. A good example is the output path, where the device drivers directly access the output buffers. This means that an in-kernel PPP implementation must always convert network buffers into TTY buffers. If a PPP implementation would be built on top of the new TTY layer (still needs a hooks layer, though), it would allow the PPP implementation to directly hand the data to the TTY driver. - Improved hotplugging: With the old TTY layer, it isn't entirely safe to destroy TTY's from the system. This implementation has a two-step destructing design, where the driver first abandons the TTY. After all threads have left the TTY, the TTY layer calls a routine in the driver, which can be used to free resources (unit numbers, etc). The pts(4) driver also implements this feature, which means posix_openpt() will now return PTY's that are created on the fly. - Improved performance: One of the major improvements is the per-TTY mutex, which is expected to improve scalability when compared to the old Giant locking. Another change is the unbuffered copying to userspace, which is both used on TTY device nodes and PTY masters. Upgrading should be quite straightforward. Unlike previous versions, existing kernel configuration files do not need to be changed, except when they reference device drivers that are listed in UPDATING. Obtained from: //depot/projects/mpsafetty/... Approved by: philip (ex-mentor) Discussed: on the lists, at BSDCan, at the DevSummit Sponsored by: Snow B.V., the Netherlands dcons(4) fixed by: kan
* Expand kdb_alt_break a little, most commonly used with the optionpeter2008-05-041-2/+17
| | | | | | | | | | | | | | | | | | | ALT_BREAK_TO_DEBUGGER. In addition to "Enter ~ ctrl-B" (to enter the debugger), there is now "Enter ~ ctrl-P" (force panic) and "Enter ~ ctrl-R" (request clean reboot, ala ctrl-alt-del on syscons). We've used variations of this at work. The force panic sequence is best used with KDB_UNATTENDED for when you just want it to dump and get on with it. The reboot request is a safer way of getting into single user than a power cycle. eg: you've hosed the ability to log in (pam, rtld, etc). It gives init the reboot signal, which causes an orderly reboot. I've taken my best guess at what the !x86 and non-sio code changes should be. This also makes sio release its spinlock before calling KDB/DDB.
* In keeping with style(9)'s recommendations on macros, use a ';'rwatson2008-03-161-1/+1
| | | | | | | | | after each SYSINIT() macro invocation. This makes a number of lightweight C parsers much happier with the FreeBSD kernel source, including cflow's prcc and lxr. MFC after: 1 month Discussed with: imp, rink
* Add a new 'why' argument to kdb_enter(), and a set of constants to userwatson2007-12-251-1/+1
| | | | | | | | | for that argument. This will allow DDB to detect the broad category of reason why the debugger has been entered, which it can use for the purposes of deciding which DDB script to run. Assign approximate why values to all current consumers of the kdb_enter() interface.
* In openprom_ioctl() ensure appropriate permissions and that data isn'tmarius2007-12-201-1/+9
| | | | | | | | NULL and doesn't point to a NULL pointer before dereferencing it. This fixes a panic triggered by Xorg 7.3. Reported and tested by: Bill Green MFC after: 3 days
* Rename the kthread_xxx (e.g. kthread_create()) callsjulian2007-10-201-1/+1
| | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
* Fix warnings.peter2007-07-061-1/+1
| | | | | | | | | nxge: cast page size fragments down to (int). If the vm's demand paging PAGE_SIZE is ever too big for that, we've got far bigger problems. ofw: move va_start() a little earlier. gcc-4.2 doesn't like us modifying the last arg before the va_start(). Approved by: re (rwatson)
* In OF_init() check the return value of OF_getprop().marius2007-06-161-1/+2
| | | | | Found with: Coverity Prevent(tm) CID: 679
* - Restore the machine independency of sys/dev/ofw/openfirm.{c,h} bymarius2007-06-162-62/+0
| | | | | | | moving OF_set_mmfsa_traptable() (SUNW,set-trap-table with the two arguments used here is specific to sun4v) to MD code. - In sys/dev/ofw/openfirm.h remove prototypes for unimplemented functions and unused Solaris compatibility macros.
* Sync the styles of sys/boot/ofw/libofw/openfirm.c andmarius2007-06-161-272/+263
| | | | | sys/dev/ofw/openfirm.c with themselves, with each-other and with style(9).
* Add missing includes of priv.h.rwatson2006-11-061-0/+1
|
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-061-1/+2
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Using the ptr defines broke the powerpc build - convert set_mmfsa to the samekmacy2006-10-111-2/+2
| | | | convention as the rest of openfirm.c
* kernel clean up to make the sun4v kernel buildkmacy2006-10-092-0/+59
| | | | | Reviewed by: jmg Approved by: rwatson (mentor)
* Fix spelling and wording in a comment.marius2006-09-011-2/+2
|
* Fix various typos and brainos in last commit.phk2006-05-301-5/+4
| | | | Submmited by: Andrew Turner <andrew@fubar.geek.nz>
* Update to new console api.phk2006-05-261-28/+11
|
* - Add a new method ofw_bus_default_get_devinfo() that allows to retrievemarius2005-11-223-2/+213
| | | | | | | | | | | | | | | | a newly introduced struct ofw_bus_devinfo which can hold the OFW info of a device recallable via the ofw_bus KOBJ interface. Introduce a set of functions ofw_bus_gen_get_*() which use ofw_bus_default_get_devinfo() to provide generic subroutines for implementing the rest of the ofw_bus KOBJ interface in a bus driver. This is inspired by bus_get_resource_list() and bus_generic_rl_*_resource() and allows to reduce code duplication in bus drivers as they only have to provide an ofw_bus_default_get_devinfo() implementation in order to provide the ofw_bus KOBJ interface via ofw_bus_gen_get_*(). - While here add a comment to ofw_bus_if.m describing the intention of the ofw_bus KOBJ interface. Reviewed by: marcel
* Remove unused function and variables.marius2005-11-221-19/+0
|
* The mediasize shouldn't be multipled by the sector size when it wasgrehan2005-10-311-1/+2
| | | | | | | | | in bytes to start off with. This caused the GPT geom sniffer to attempt a seek just back from the end of the 'disk', which resulted in a > 4G seek, causing gdb psim to exit since it only supports 32-bit seeks. The size of the disk should really be specified in the psim device tree, but for now do the minimal amount of work to get psim to run again.
* Make ttyconsolemode() call ttsetwater() so that drivers don't have to.phk2005-10-161-1/+0
|
* Sync with openfirm(4) and check the return value of malloc() althoughmarius2005-05-191-2/+15
| | | | this isn't exactly necessary with M_WAITOK.
* Update the names of some member variables in comments to refect reality.marius2005-05-191-2/+2
| | | | | Apparently this was forgotten when this code was derived from the BSD openprom(4).
OpenPOWER on IntegriCloud