summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/ofw
Commit message (Collapse)AuthorAgeFilesLines
* Remove leftover from r215163.andreast2012-09-211-1/+0
|
* Don't probe the openfirmware framebuffer if the system is a Wii or itadrian2012-08-211-0/+6
| | | | | | will crash. Submitted by: Margarida Gouveia
* Make ofw_bus_get_node() consistently return -1 when there is no associatednwhitehorn2012-03-152-2/+2
| | | | | | | OF node, instead of a random mixture of 0 and -1. Update all checks for 0 to check for -1 instead. MFC after: 4 weeks
* - Add a bus_dma tag to each PCI bus that is a child of a Host-PCI bridge.jhb2012-03-021-5/+6
| | | | | | | | | | | | | | | The tag enforces a single restriction that all DMA transactions must not cross a 4GB boundary. Note that while this restriction technically only applies to PCI-express, this change applies it to all PCI devices as it is simpler to implement that way and errs on the side of caution. - Add a softc structure for PCI bus devices to hold the bus_dma tag and a new pci_attach_common() routine that performs actions common to the attach phase of all PCI bus drivers. Right now this only consists of a bootverbose printf and the allocate of a bus_dma tag if necessary. - Adjust all PCI bus drivers to allocate a PCI bus softc and to call pci_attach_common() from their attach routines. MFC after: 2 weeks
* The bus resource adjustment API is not meant to work on active resources.nwhitehorn2012-02-071-16/+6
| | | | | | | Return an error if a driver attempts this, and, if INVARIANTS is on, panic. Reviewed by: jhb
* Inherit from PCI bridge driver instead of manually specifying all of itsnwhitehorn2012-02-051-24/+3
| | | | | | | methods. Obtained from: sparc64 MFC after: 1 week
* Make sure to remap adjusted resources.nwhitehorn2012-02-051-1/+17
|
* Add support for bus_adjust_resource() on all PowerPC/AIM PCI bridges. Withnwhitehorn2012-02-051-0/+28
| | | | | this change, NEW_PCIB appears to work without incident at least on a G5 iMac. More testing will be required before it is turned on in GENERIC.
* Unify OF PCI infrastructure, including changing from parsing the devicenwhitehorn2012-02-042-0/+575
| | | | | | | tree based on heuristics to parsing it based on the spec. This should also lay the foundation for NEW_PCIB on PowerPC. MFC after: 3 months
* Avoid warnings about duplicate modules.nwhitehorn2012-02-041-1/+1
| | | | MFC after: 2 weeks
* This commit adds profiling support for powerpc64. Now we can do applicationandreast2012-01-201-2/+2
| | | | | | | | | | | | | profiling and kernel profiling. To enable kernel profiling one has to build kgmon(8). I will enable the build once I managed to build and test powerpc (32-bit) kernels with profiling support. - add a powerpc64 PROF_PROLOGUE for _mcount. - add macros to avoid adding the PROF_PROLOGUE in certain assembly entries. - apply these macros where needed. - add size information to the MCOUNT function. MFC after: 3 weeks, together with r230291
* Prevent an error resulting from signed/unsigned comparison on systemsnwhitehorn2012-01-201-2/+2
| | | | | | | that do not comply with the OF spec. Submitted by: Anders Gavare MFC after: 1 week
* - There's no need to overwrite the default device method with the defaultmarius2011-11-222-14/+10
| | | | | | | | | | 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.
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-071-1/+1
| | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-072-2/+3
| | | | This means that their use is restricted to a single C file.
* Add better error handling for RTAS calls. These can potentially causenwhitehorn2011-06-261-1/+18
| | | | | | | machine checks (e.g. invalid PCI configuration cycles), but these can be caught and recovered from. This change also the RTAS PCI driver to work without modification as a replacement for the Grackle driver on Grackle-based Powermacs.
* Use the ABI-mandated thread pointer register (r2 for ppc32, r13 for ppc64)nwhitehorn2011-06-231-6/+8
| | | | | | | | | | | | | | | instead of a PCPU field for curthread. This averts a race on SMP systems with a high interrupt rate where the thread looking up the value of curthread could be preempted and migrated between obtaining the PCPU pointer and reading the value of pc_curthread, resulting in curthread being observed to be the current thread on the thread's original CPU. This played merry havoc with the system, in particular with mutexes. Many thanks to jhb for helping me work this one out. Note that Book-E is in principle susceptible to the same problem, but has not been modified yet due to lack of Book-E hardware. MFC after: 2 weeks
* Retry the memory map-related portions of r222613, written by andreast,nwhitehorn2011-06-041-26/+145
| | | | | after some minor tweaks and an increase in the early-boot stack space in r222632.
* Temporarily back out those parts of r222613 related to parsing the memorynwhitehorn2011-06-021-144/+25
| | | | | map. They cause non-understood boot failures on some Apple machines with more than 2 GB of RAM (like my work desktop).
* MFpseries:nwhitehorn2011-06-026-42/+905
| | | | | | | | | | Renovate and improve the AIM Open Firmware support: - Add RTAS (Run-Time Abstraction Services) support, found on all IBM systems and some Apple ones - Improve support for 32-bit real mode Open Firmware systems - Pull some more OF bits over from the AIM directory - Fix memory detection on IBM LPARs and systems with more than one /memory node (by andreast@)
* Fix whitespace nit.nwhitehorn2011-03-091-1/+1
|
* Rename INTR_VEC to MAP_IRQ. From the OFW or FDT we obtain amarcel2011-02-022-4/+4
| | | | | PIC handle with interrupt pin. This we map to the resource called SYS_RES_IRQ.
* Fix null string handling in ofw_real_nextprop function. Pass the rightandreast2011-01-051-4/+10
| | | | | | | | length to ofw_real_map in case of a null string. This makes ofwdump(8) work correctly when trying to print all properties with ofwdump -p. Approved by: nwhitehorn (mentor)
* Remove use of a separate ofw_pmap on 32-bit CPUs. Many Open Firmwarenwhitehorn2010-11-121-0/+661
| | | | | | | | | | mappings need to end up in the kernel anyway since the kernel begins executing in OF context. Separating them adds needless complexity, especially since the powerpc64 and mmu_oea64 code gave up on it a long time ago. As a side effect, the PPC ofw_machdep code is no longer AIM-specific, so move it to powerpc/ofw.
* Map the Open Firmware framebuffer console with write combining turned on,nwhitehorn2010-10-011-13/+27
| | | | | | and set memory attributes appropriately for mmap() calls on /dev/console. Xorg no longer uses /dev/console to mmap the framebuffer, so framebuffer write combining support in X will arrive in the next patch.
* Change OF_interpret() to also take an array of cell_t (missed in r209801).marius2010-09-111-4/+3
| | | | Reviewed by: nwhitehorn
* Make ofw_syscons work on 64-bit systems.nwhitehorn2010-07-081-3/+3
|
* Fix several bugs in the real-mode Open Firmware implementation and providenwhitehorn2010-07-081-157/+325
| | | | | | a virtual-mode version for use on 64-bit systems, which have 32-bit firmware implementations and require similar constraints on addressing to the real-mode implementation.
* Change the argument type to OF_call_method to take an array of cell_tnwhitehorn2010-07-081-4/+3
| | | | | instead of unsigned longs to prepare for platforms where they are not the same.
* Add MSI support for PCI devices attached to the CPC925 and CPC945 bridgesnwhitehorn2010-06-181-0/+5
| | | | found in Apple and IBM G5 systems.
* Change the default interrupt polarity on PowerPC systems from high to low.nwhitehorn2010-06-181-10/+22
| | | | | | On Apple systems at least, all the level interrupts are wired active low. Before this change, our PIC programming only worked because Apple hardware ignores the interrupt polarity bit on all interrupts except IRQ 0.
* Provide for multiple, cascaded PICs on PowerPC systems, and extend thenwhitehorn2010-06-182-11/+28
| | | | | | OFW interrupt map interface to also return the device's interrupt parent. MFC after: 8.1-RELEASE
* Modify the console mouse pointer drawing routine to use single-byte writesnwhitehorn2010-06-151-17/+4
| | | | | | | | | instead of 4-byte ones. Because the mouse pointer can start part way through a character cell, 4-byte memory operations are not necessarily aligned, triggering a fatal alignment exception when the console pointer was moved on PowerPC G5 systems. MFC after: 3 days
* Prepare and extend OFW layer for FDT support.raj2010-05-281-2/+3
| | | | | | | | | | | | | 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-161-23/+0
| | | | | | PPC ofw_machdep.c, in recognition of its state as a machine specific hack. Requested by: marius
* Relocate interrupt sense setting for K2 SATA from the ATA driver to thenwhitehorn2010-05-161-8/+25
| | | | | | | OFW PCI layer and read the sense directly from the device tree instead of guessing. MFC after: 1 week
* On PowerMac11,2 and (presumably) PowerMac12,1, we need to quiesce thenwhitehorn2010-05-161-0/+23
| | | | | | | | | | 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
* Set hw.ofwfb.relax_mmap=1 by default. While these checks may be a goodnwhitehorn2010-03-281-2/+2
| | | | | | | | idea in principle, X does not work without them on basically any hardware, and this is probably the most frequent problem people run into on PowerPC. Prodded by: rnoland MFC after: 1 week
* Do not declare the various OFW command buffers static. It does notnwhitehorn2010-03-231-23/+23
| | | | | | | appear to be necessary on either sparc64 or powerpc, and is a concurrency nightmare. Reviewed by: marius
* Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.rnoland2009-12-291-2/+2
| | | | | | | | | | | | | This replaces d_mmap() with the d_mmap2() implementation and also changes the type of offset to vm_ooffset_t. Purge d_mmap2(). All driver modules will need to be rebuilt since D_VERSION is also bumped. Reviewed by: jhb@ MFC after: Not in this lifetime...
* strict kobj signatures: some ofw_setprop fixesavg2009-06-111-4/+4
| | | | | | | propname parameter is const Reviewed by: imp, current@ Approved by: jhb (mentor)
* Introduce support for cpufreq on PowerPC with the dynamic frequencynwhitehorn2009-05-311-0/+206
| | | | switching capabilities of the MPC7447A and MPC7448.
* Add an Open Firmware access module for real-mode OF accesses to the PowerPCnwhitehorn2009-04-051-0/+922
| | | | | build. This is required for the IBM Mambo simulator, as well as a variety of non-Apple PowerPC hardware.
* Add support for 64-bit PowerPC CPUs operating in the 64-bit bridge modenwhitehorn2009-04-041-11/+22
| | | | | | | | | | provided, for example, on the PowerPC 970 (G5), as well as on related CPUs like the POWER3 and POWER4. This also adds support for various built-in hardware found on Apple G5 hardware (e.g. the IBM CPC925 northbridge). Reviewed by: grehan
* Adapt parts of the sparc64 Open Firmware bus enumeration code (in particular,nwhitehorn2008-12-152-189/+228
| | | | | | | | | | | | | | | 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
* Allow OFW syscons to restore itself when the X server exits or there is a VT ↵nwhitehorn2008-12-131-26/+38
| | | | | | | | switch by redoing the Open Firmware card initialization calls in ofwfb_set_mode(). This uses the same trick (setting V_ADP_MODECHANGE) to arrange this as machfb(4) and creatorfb(4).
* Add support for a console mouse pointer on Open Firmware syscons.nwhitehorn2008-12-132-1/+85
| | | | MFC after: 7.1-RELEASE
* Prevent the OF syscons module from trying to attach to real devices on thenwhitehorn2008-10-151-0/+5
| | | | nexus by only attaching to a device with no OF node.
* Convert PowerPC AIM PCI and nexus busses to standard OFW bus interface. Thisnwhitehorn2008-10-145-287/+377
| | | | | | | | | | | simplifies certain device attachments (Kauai ATA, for instance), and makes possible others on new hardware. On G5 systems, there are several otherwise standard PCI devices (Serverworks SATA) that will not allow their interrupt properties to be written, so this information must be supplied directly from Open Firmware. Obtained from: sparc64
OpenPOWER on IntegriCloud