History log of /freebsd-10-stable/sys/powerpc/ofw/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
330938 14-Mar-2018 jhb

Convert pci_delete_child() to a bus_child_deleted() method.

Instead of providing a wrapper around device_delete_child() that the PCI
bus and child bus drivers must call explicitly, move the bulk of the logic
from pci_delete_child() into a bus_child_deleted() method
(pci_child_deleted()). This allows PCI devices to be safely deleted via
device_delete_child().
- Add a bus_child_deleted method to the ACPI PCI bus which clears the
device_t associated with the corresponding ACPI handle in addition to
the normal PCI bus cleanup.
- Change cardbus_detach_card to call device_delete_children() and move
CardBus-specific delete logic into a new cardbus_child_deleted() method.
- Use device_delete_child() instead of pci_delete_child() in the SRIOV code.
- Add a bus_child_deleted method to the OpenFirmware PCI bus drivers which
frees the OpenFirmware device info for each PCI device.

To preserve KBI, a pci_delete_child() function is left in place that
just calls device_delete_child().

PR: 226562
Requested by: dexuan

278608 12-Feb-2015 ian

MFC r275779, r275963, r276101, r276161, r276297:

Move ofw_cpu.c to sys/dev/ofw so that it can be used by other
architectures.

Add driver for CPU frequency/voltage control on the Raspberry Pi.

On initialization, do not use bcm_mbox_intr() to read the pending messages.
This fixes the hang that happens on boot while initializing the cpufreq on
Raspberry Pi.

273675 26-Oct-2014 ian

MFC r272109, r272181:

Replace multiple nearly-identical copies of code to walk through an FDT
node's interrupts=<...> property creating resource list entries with a
single common implementation. This change makes ofw_bus_intr_to_rl() the
one true copy of that code and removes the copies of it from other places.

This also adds handling of the interrupts-extended property.

273652 26-Oct-2014 ian

MFC r270945:

Rename OF_xref_phandle() to OF_node_from_xref() and add a new function
that provides the inverse translation, OF_xref_from_node().

266160 15-May-2014 ian

MFC r261423, r261424, r261516, r261513, r261562, r261563, r261564, r261565,
r261596, r261606

Add the imx sdhci controller.

Move Open Firmware device root on PowerPC, ARM, and MIPS systems to
a sub-node of nexus (ofwbus) rather than direct attach under nexus. This
fixes FDT on x86 and will make coexistence with ACPI on ARM systems easier.
SPARC is unchanged.

Add the missing ')' at end of sentence. Reword it to use a more common idiom.

Pass the kernel physical address to initarm through the boot param struct.

Make functions only used in vfp.c static, and remove vfp_enable.

Fix __syscall on armeb EABI. As it returns a 64-bit value it needs to
place 32-bit data in r1, not r0. 64-bit data is already packed correctly.

Use abp_physaddr for the physical address over KERNPHYSADDR. This helps us
remove the need to load the kernel at a fixed address.

Remove references to PHYSADDR where it's used only in debugging output.

Dynamically generate the page table. This will allow us to detect the
physical address we are loaded at to change the mapping.


/freebsd-10-stable/sys/arm/arm/elf_trampoline.c
/freebsd-10-stable/sys/arm/arm/locore.S
/freebsd-10-stable/sys/arm/arm/machdep.c
/freebsd-10-stable/sys/arm/arm/nexus.c
/freebsd-10-stable/sys/arm/arm/pmap-v6.c
/freebsd-10-stable/sys/arm/arm/pmap.c
/freebsd-10-stable/sys/arm/arm/support.S
/freebsd-10-stable/sys/arm/arm/vfp.c
/freebsd-10-stable/sys/arm/arm/vm_machdep.c
/freebsd-10-stable/sys/arm/at91/at91_machdep.c
/freebsd-10-stable/sys/arm/broadcom/bcm2835/bcm2835_fb.c
/freebsd-10-stable/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
/freebsd-10-stable/sys/arm/econa/econa_machdep.c
/freebsd-10-stable/sys/arm/freescale/imx/tzic.c
/freebsd-10-stable/sys/arm/include/cpu.h
/freebsd-10-stable/sys/arm/include/machdep.h
/freebsd-10-stable/sys/arm/mv/mv_localbus.c
/freebsd-10-stable/sys/arm/mv/mv_pci.c
/freebsd-10-stable/sys/arm/s3c2xx0/s3c24x0_machdep.c
/freebsd-10-stable/sys/arm/xscale/ixp425/avila_machdep.c
/freebsd-10-stable/sys/conf/files
/freebsd-10-stable/sys/conf/files.powerpc
/freebsd-10-stable/sys/dev/fdt/fdtbus.c
/freebsd-10-stable/sys/dev/fdt/simplebus.c
/freebsd-10-stable/sys/dev/mmc/mmc.c
/freebsd-10-stable/sys/dev/ofw/ofw_nexus.c
/freebsd-10-stable/sys/dev/ofw/ofw_nexus.h
/freebsd-10-stable/sys/dev/ofw/ofwbus.c
/freebsd-10-stable/sys/dev/powermac_nvram/powermac_nvram.c
/freebsd-10-stable/sys/mips/beri/beri_simplebus.c
/freebsd-10-stable/sys/mips/mips/nexus.c
/freebsd-10-stable/sys/powerpc/mambo/mambo.c
/freebsd-10-stable/sys/powerpc/mpc85xx/lbc.c
/freebsd-10-stable/sys/powerpc/mpc85xx/pci_mpc85xx.c
ofw_cpu.c
openpic_ofw.c
/freebsd-10-stable/sys/powerpc/powermac/cpcht.c
/freebsd-10-stable/sys/powerpc/powermac/grackle.c
/freebsd-10-stable/sys/powerpc/powermac/smu.c
/freebsd-10-stable/sys/powerpc/powermac/uninorth.c
/freebsd-10-stable/sys/powerpc/powermac/uninorthpci.c
/freebsd-10-stable/sys/powerpc/powerpc/nexus.c
/freebsd-10-stable/sys/powerpc/pseries/rtas_dev.c
/freebsd-10-stable/sys/powerpc/pseries/rtas_pci.c
/freebsd-10-stable/sys/powerpc/pseries/vdevice.c
/freebsd-10-stable/sys/powerpc/pseries/xics.c
/freebsd-10-stable/sys/powerpc/psim/iobus.c
266128 15-May-2014 ian

MFC r261351, r261352, r261355, r261396, r261397, r261398, r261403, r261404,
r261405

Open Firmware interrupt specifiers can consist of arbitrary-length byte
strings and include arbitrary information (IRQ line/domain/sense). When the
ofw_bus_map_intr() API was introduced, it assumed that, as on most systems,
these were either 1 cell, containing an interrupt line, or 2, containing
a line number plus a sense code. It turns out a non-negligible number of
ARM systems use 3 (or even 4!) cells for interrupts, so make this more
general.

Provide a simpler and more standards-compliant simplebus implementation to
get the Routerboard 800 up and running with the vendor device tree. This
does not implement some BERI-specific features (which hopefully won't be
necessary soon), so move the old code to mips/beri, with a higher attach
priority when built, until MIPS interrupt domain support is rearranged.

Allow nesting of simplebuses.

Add a set of helpers (ofw_bus_get_status() and ofw_bus_status_okay()) to
process "status" properties of OF nodes.

Fix one remnant endian flaw in nexus.

266020 14-May-2014 ian

MFC r258800, r258802, r258805, r258806, r258807, r258851, r258857,
r259199, r259484, r259513, r259514, r259516

The kernel stack guard pages are only below the stack pointer, not above.

Remove unnecessary double-setting of the thread's onfault state in
copyinstr().

Open Firmware mandates that certain cross-references, in particular those
in /chosen, be ihandles. The ePAPR spec makes those cross-reference phandles,
since FDT has no concept of ihandles. Have the OF FDT CI module interpret
queries about ihandles as cross-reference phandles.

Real OF systems have an ihandle under /chosen/stdout, not a phandle. Use
the right type.

Rearchitect platform memory map parsing to make it less
Open Firmware-centric.

Remove fdtbus_bs_tag definition, which is now obsolete. The remainder of
this file is also slated for future demolition.

Return the correct IEEE 1275 code for "nextprop".

Use the common Open Firmware PCI interrupt routing code instead of the
duplicate version in dev/fdt.

Configure interrupt sense based on device tree information.

Simplify the ofw_bus_lookup_imap() API slightly: make it allocate maskbuf
internally instead of requiring the caller to allocate it.

266019 14-May-2014 ian

MFC r258268, r258271, r258272, r258274, r258275, r258427, r258694, r258696,
r258697, r258757

Do not assume a value for #address-cells when parsing the OF translations
map. This allows the kernel to get farther with OpenBIOS on 64-bit CPUs.

Actually look up #address-cells instead of assuming it is correlated with
the Uninorth version number.

#interrupt-cells belongs to the iparent, not the device parent.

Add a sysctl to allow disabling resetting the OF syscons.

For PCI<->PCI bridges, #address-cells may be 3.

Make RTAS calls, which call setfault() to recover from machine checks,
preserve any existing fault buffer.

badaddr() is used only in the grackle PCI driver, so move its definition
there. Clean up a spurious setfault() declaration as well.

This [phyp_console] driver doesn't need the /options node, so don't check
for it.

Use the Open Firmware-based CPU frequency determination as a generic
fallback if we can't measure CPU frequency. This is also useful on a
variety of embedded systems using FDT.

265969 13-May-2014 ian

MFC r256994, r257016, r257055, r257059, r257060, r257075

Add two new interfaces to ofw_bus:
- ofw_bus_map_intr()
Maps an (iparent, IRQ) tuple to a system-global interrupt number in some
platform dependent way. This is meant to be implemented as a replacement
for [FDT_]MAP_IRQ() that is an MI interface that knows about the bus
hierarchy.
- ofw_bus_config_intr()
Configures an interrupt (previously mapped) based on firmware sense flags.
This replaces manual interpretation of the sense field in bus drivers and
will, in a follow-up, allow that interpretation to be redirected to the PIC
drivers where it belongs. This will eventually replace the tables in
/sys/dev/fdt/fdt_ARCH.c

The PowerPC/AIM code has been converted to use these globally, with an
implementation in terms of MAP_IRQ() and powerpc_config_intr(), assuming
OpenPIC, at the bus root in nexus(4). The ofw_bus_config_intr() will shortly
be integrated into pic_if.m and bounced through nexus into the PIC tree.

Factor out MI portions of the PowerPC nexus device into /sys/dev/ofw. The
sparc64 driver will be modified to use this shortly.

Allow PIC drivers to translate firmware sense codes for themselves. This
is designed to replace the tables in dev/fdt/fdt_ARCH.c, but will not
happen quite yet.

Do not map IRQs twice. This fixes PowerPC/FDT systems with multiple PICs,
which would try to treat the previously-mapped interrupts from
fdt_decode_intr() as interrupt line numbers on the same parent PIC.

Remove some of the code required for supporting ssm(4) on SPARC in favor
of a more PowerPC/FDT-focused design. Whenever SPARC64 is integrated
into this rework, this should be (trivially) revisited.

265959 13-May-2014 ian

MFC r256870, r256898, r256899, r256900 (by nwhitehorn):

Standards-conformance and code deduplication:
- Use bus reference phandles in place of FDT offsets as IRQ domain keys
- Unify the identical macio/fdt/mambo OpenPIC drivers into one
- Be more forgiving (following ePAPR) about what we need from the device
tree to identify an OpenPIC
- Correctly map all IRQs into an interrupt domain
- Set IRQ_*_CONFORM for interrupts on an unknown PIC type instead of
failing attachment for that device.

Allow lots of interrupts (useful on multi-domain platforms) and do not
set device_quiet() on all devices attached under nexus(4).

265954 13-May-2014 ian

MFC r256814, r256816, r256818, r256846, r256855, r256864 (by nwhitehorn):

- Handle 2GB of ram
- Allow the OFW interrupt mapping code to work with PCI devices not
enumerated by Open Firmware, as in the case of FDT.
- Provide an interface for PCI bus drivers that need some of ofw_pci's
metadata during attach.
- Use standard ofw_bus helpers instead of reinventing the wheel.
- Make hard-wired TLB allocations be at minimum one page.

262586 28-Feb-2014 brueffer

MFC: r261884

Correct the order of arguments to mtx_init().

PR: 186701
Submitted by: Takanori Sawada <tak.swd at gmail.com>

259258 12-Dec-2013 andreast

MFC: r258427, r258694

r258694:
Make RTAS calls, which call setfault() to recover from machine checks,
preserve any existing fault buffer. RTAS calls are meant to be safe from
interrupt context (and are indeed used there to implement the xics PIC
driver). Without this, calling into RTAS in interrupt context would have
the effect of clearing any existing onfault state of the interrupted
thread, potentially leading to a panic.

r258427:
For PCI<->PCI bridges, #address-cells may be 3. Allow this when parsing the
ibm,dma-window properties. This is especially a concern when
#ibm,dma-address-cells is not specified and we have to use the regular
#address-cells property.

259257 12-Dec-2013 andreast

MFC: r258051, r258052

r258052:
Following the approach with ACPI DMAR on x86, split IOMMU handling into
a variant PCI bus instead of trying to shoehorn it into the PCI host bridge
adapter. Besides matching better the architecture on other platforms, this
also allows systems with multiple partitionable endpoints per PCI host
bridge to work correctly.

r258051:
Actually add IOMMU domain to the list of known mappings. This fixes a bug
where multiple devices in the same IOMMU domain would be allocated
conflicting mappings unless they also shared a DMA tag.

259235 11-Dec-2013 andreast

MFC r257991, r257992, 257993, 258504

r257991:
Consolidate Apple firmware hacks and improve them by switching on the
presence of mac-io devices in the tree, which uniquely identifies Apple
hardware.

r257992:
Allow OF_decode_addr() to also be able to map resources on big-endian
devices. To this end, make PCI device detection rely on the device_type
field rather than name, as per the standard.

r257993:

Make tsec work with the device tree present on the RB800. The previous code
assumed that the MDIO bus was a direct child of the Ethernet interface. It
may not be and indeed on many device trees is not. While here, add proper
locking for MII transactions, which may be on a bus shared by several MACs.

r258504:

Save and restore the trap vectors when doing OF calls on pSeries machines.

It turned out that on pSeries machines the call into OF modified the trap
vectors and this made further behaviour unpredictable.

With this commit I'm now able to boot multi user on a network booted
environment on my IntelliStation 285. This is a POWER5+ machine.

259231 11-Dec-2013 andreast

MFC r258778

Add a printf to inform about the logical memory block size which is in use
by the system. This might give a hint why a pSeries system is not booting.

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


255910 27-Sep-2013 nwhitehorn

Rework handling of ofw_quiesce(), making it the responsibility of the
platform modules. Whether to call this function or not is highly machine
dependent: on some systems, it is required, while on others it breaks
everything. Platform modules are in a better position to figure this
out. This is required for POWER hypervisor SCSI to work correctly. There
are no functional changes on Powermac systems.

Approved by: re (kib)


255904 26-Sep-2013 nwhitehorn

Allow Open Firmware syscons to attach to devices without an "address"
property such as those found on some real and emulated IBM systems. The
approach, which is taken from Linux, is to scan through the PCI bars
until we find one large enough to contain the linear framebuffer and
which is ideally prefetchable if no "address" property can be found.
This makes the graphical console work with the pSeries target in QEMU.

Approved by: re (delphij)


255642 17-Sep-2013 nwhitehorn

Only attach if properties we need (address, in particular) are present.
This is the correct version of r255420.

Approved by: re (kib)


255615 16-Sep-2013 nwhitehorn

Add a loader tunable to use only device tree-provided PCI devices. This is
needed on some more fragile systems to avoid machine checks when blindly
probing the PCI bus. Also reduce ofw_pcibus's priority slightly so that it
can be overridden.

Approved by: re (gjb)


255596 15-Sep-2013 nwhitehorn

Add a kernel interface (OF_xref_phandle()) for systems where phandles
used as cross-references in the device tree and phandles as used by the
Open Firmware client interface are in different namespaces. This include
IBM pSeries hardware as well as FDT systems. FDT certainly abuses
ihandles for this purpose and should be modified to use this API
eventually. This changes no behavior on systems where FreeBSD already
worked.

Reviewed by: marius
Approved by: re (kib)
MFC after: 2 weeks


255421 09-Sep-2013 nwhitehorn

Revert r255420. This seems to break some Powermac systems and will be
revisited much later.

Pointy hat to: me
Approved by: re (kib, implicit due to breakage 10 minutes ago)


255420 09-Sep-2013 nwhitehorn

Attach only on hardware that is actually supported as opposed to hardware
that seems like it has some of the problems we might want.

Approved by: re (kib)


255416 09-Sep-2013 nwhitehorn

Use a spin lock instead of a mutex to gate RTAS. This is required if RTAS
calls are involved in interrupt handling.

Approved by: re (kib)


255378 07-Sep-2013 nwhitehorn

Fix error in r252115: space for the softc needs to be allocated. This
seemed to be working by chance on most systems.


253979 06-Aug-2013 jhibbits

Micro-optimize OFW syscons 8-bit blank.

MFC after: 1 week


253588 24-Jul-2013 jhibbits

Increase the size of the OFW bounce buffer to 4 pages. With this I can now run
'ofwdump -ap' on my quad G5.

MFC after: 9.2 branch


252115 23-Jun-2013 jhibbits

Cache the Open Firmware CPU properties at attach time, so we don't always
enter it at runtime to get static data.


240793 21-Sep-2012 andreast

Remove leftover from r215163.


239479 21-Aug-2012 adrian

Don't probe the openfirmware framebuffer if the system is a Wii or it
will crash.

Submitted by: Margarida Gouveia


233018 15-Mar-2012 nwhitehorn

Make ofw_bus_get_node() consistently return -1 when there is no associated
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


232403 02-Mar-2012 jhb

- Add a bus_dma tag to each PCI bus that is a child of a Host-PCI bridge.
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


231149 07-Feb-2012 nwhitehorn

The bus resource adjustment API is not meant to work on active resources.
Return an error if a driver attempts this, and, if INVARIANTS is on,
panic.

Reviewed by: jhb


231046 05-Feb-2012 nwhitehorn

Inherit from PCI bridge driver instead of manually specifying all of its
methods.

Obtained from: sparc64
MFC after: 1 week


231026 05-Feb-2012 nwhitehorn

Make sure to remap adjusted resources.


231003 05-Feb-2012 nwhitehorn

Add support for bus_adjust_resource() on all PowerPC/AIM PCI bridges. With
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.


230993 04-Feb-2012 nwhitehorn

Unify OF PCI infrastructure, including changing from parsing the device
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


230992 04-Feb-2012 nwhitehorn

Avoid warnings about duplicate modules.

MFC after: 2 weeks


230400 20-Jan-2012 andreast

This commit adds profiling support for powerpc64. Now we can do application
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


230398 20-Jan-2012 nwhitehorn

Prevent an error resulting from signed/unsigned comparison on systems
that do not comply with the OF spec.

Submitted by: Anders Gavare
MFC after: 1 week


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.


227309 07-Nov-2011 ed

Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

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.


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.


223571 26-Jun-2011 nwhitehorn

Add better error handling for RTAS calls. These can potentially cause
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.


223485 23-Jun-2011 nwhitehorn

Use the ABI-mandated thread pointer register (r2 for ppc32, r13 for ppc64)
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


222667 04-Jun-2011 nwhitehorn

Retry the memory map-related portions of r222613, written by andreast,
after some minor tweaks and an increase in the early-boot stack space in
r222632.


222622 02-Jun-2011 nwhitehorn

Temporarily back out those parts of r222613 related to parsing the memory
map. They cause non-understood boot failures on some Apple machines with
more than 2 GB of RAM (like my work desktop).


222613 02-Jun-2011 nwhitehorn

MFpseries:
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@)


219428 09-Mar-2011 nwhitehorn

Fix whitespace nit.


218184 02-Feb-2011 marcel

Rename INTR_VEC to MAP_IRQ. From the OFW or FDT we obtain a
PIC handle with interrupt pin. This we map to the resource
called SYS_RES_IRQ.


217027 05-Jan-2011 andreast

Fix null string handling in ofw_real_nextprop function. Pass the right
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)


215163 12-Nov-2010 nwhitehorn

Remove use of a separate ofw_pmap on 32-bit CPUs. Many Open Firmware
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.


213336 01-Oct-2010 nwhitehorn

Map the Open Firmware framebuffer console with write combining turned on,
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.


212477 11-Sep-2010 marius

Change OF_interpret() to also take an array of cell_t (missed in r209801).

Reviewed by: nwhitehorn


209804 08-Jul-2010 nwhitehorn

Make ofw_syscons work on 64-bit systems.


209803 08-Jul-2010 nwhitehorn

Fix several bugs in the real-mode Open Firmware implementation and provide
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.


209801 08-Jul-2010 nwhitehorn

Change the argument type to OF_call_method to take an array of cell_t
instead of unsigned longs to prepare for platforms where they are not
the same.


209310 18-Jun-2010 nwhitehorn

Add MSI support for PCI devices attached to the CPC925 and CPC945 bridges
found in Apple and IBM G5 systems.


209299 18-Jun-2010 nwhitehorn

Change the default interrupt polarity on PowerPC systems from high to low.
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.


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


209222 15-Jun-2010 nwhitehorn

Modify the console mouse pointer drawing routine to use single-byte writes
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


208614 28-May-2010 raj

Prepare and extend OFW layer for FDT support.

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


208172 16-May-2010 nwhitehorn

Pull OF_quiesce() out of the MI Open Firmware layer and entirely into
PPC ofw_machdep.c, in recognition of its state as a machine specific hack.

Requested by: marius


208162 16-May-2010 nwhitehorn

Relocate interrupt sense setting for K2 SATA from the ATA driver to the
OFW PCI layer and read the sense directly from the device tree instead
of guessing.

MFC after: 1 week


208152 16-May-2010 nwhitehorn

On PowerMac11,2 and (presumably) PowerMac12,1, we need to quiesce the
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.


206116 02-Apr-2010 marius

With r205496 in place we should ensure that nargs and nreturns are always
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


205795 28-Mar-2010 nwhitehorn

Set hw.ofwfb.relax_mmap=1 by default. While these checks may be a good
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


205496 23-Mar-2010 nwhitehorn

Do not declare the various OFW command buffers static. It does not
appear to be necessary on either sparc64 or powerpc, and is a
concurrency nightmare.

Reviewed by: marius


201223 29-Dec-2009 rnoland

Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.

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...


194025 11-Jun-2009 avg

strict kobj signatures: some ofw_setprop fixes

propname parameter is const

Reviewed by: imp, current@
Approved by: jhb (mentor)


193156 31-May-2009 nwhitehorn

Introduce support for cpufreq on PowerPC with the dynamic frequency
switching capabilities of the MPC7447A and MPC7448.


190747 05-Apr-2009 nwhitehorn

Add an Open Firmware access module for real-mode OF accesses to the PowerPC
build. This is required for the IBM Mambo simulator, as well as a variety
of non-Apple PowerPC hardware.


190681 04-Apr-2009 nwhitehorn

Add support for 64-bit PowerPC CPUs operating in the 64-bit bridge mode
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


186128 15-Dec-2008 nwhitehorn

Adapt parts of the sparc64 Open Firmware bus enumeration code (in particular,
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


186055 13-Dec-2008 nwhitehorn

Allow OFW syscons to restore itself when the X server exits or there is a VT 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).


186050 13-Dec-2008 nwhitehorn

Add support for a console mouse pointer on Open Firmware syscons.

MFC after: 7.1-RELEASE


183901 15-Oct-2008 nwhitehorn

Prevent the OF syscons module from trying to attach to real devices on the
nexus by only attaching to a device with no OF node.


183882 14-Oct-2008 nwhitehorn

Convert PowerPC AIM PCI and nexus busses to standard OFW bus interface. This
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


183317 23-Sep-2008 sobomax

Improve rev 183168, so that if /chosen/stdout is connected to the serial
port by OF the syscons won't take over console. Only attach syscons to "screen"
if /chosen/stdout is not connected, which could be the case when loader(8)
is booted directly from the OF. This fixes Marcel's Xserver.

Reported by: marcel


183168 19-Sep-2008 sobomax

When attaching framebuffer to "/chosen/stdout" node fails, try attaching
to "screen" node directly. The problem is that by default OF on some (all?)
Macs either doesn't provide "/chosen/stdout" or redirects it somewhere,
unless you boot in manual mode via CMD-ALT-O-F. It's nice to see normal
FreeBSD boot output instead of blank gray screen.


154079 06-Jan-2006 jhb

- Make pcib_devclass private to sys/dev/pci/pci_pci.c and change all the
various pcib drivers to use their own private devclass_t variables for
their modules.
- Use the DEFINE_CLASS_0() macro to declare drivers for the various pcib
drivers while I'm here.


150686 28-Sep-2005 marius

Add a font width argument to vi_load_font_t, vi_save_font_t and vi_putm_t
and do some preparations for handling 12x22 fonts (currently lots of code
implies and/or hardcodes a font width of 8 pixels). This will be required
on sparc64 which uses a default font size of 12x22 in order to add font
loading and saving support as well as to use a syscons(4)-supplied mouse
pointer image.
This API breakage is committed now so it can be MFC'ed in time for 6.0
and later on upcoming framebuffer drivers destined for use on sparc64
and which are expected to rely on using font loading internally and on
a syscons(4)-supplied mouse pointer image can be easily MFC'ed to
RELENG_6 rather than requiring a backport.

Tested on: i386, sparc64, make universe
MFC after: 1 week


149116 16-Aug-2005 grehan

Remove unnecessary and alarming printf.

MFC after: 1 day


146462 21-May-2005 grehan

Quick hack-o-rama to allow the Xorg Radeon driver to start up. It
tries to mmap memory outside of the available BARs, so allow the
range checks to be relaxed with a sysctl.


143830 19-Mar-2005 grehan

Optimize putc routine to write 2 ints instead of 8 chars to uncached
framebuffer memory. Speeds up system time of large ascii file cat
by 4x.

Inspired by: Linux scrolling so damned fast.


142414 25-Feb-2005 grehan

Mods for Xorg server:

- store assigned PCI addresses at cninit time for later mmap range
check
- implement set_border to scrub X remnants when switching back to VTYs
- implement mmap, only allowing addresses within the range of the
console adapter.


139825 07-Jan-2005 imp

/* -> /*- for license, minor formatting changes


133862 16-Aug-2004 marius

Instead of "OpenFirmware", "openfirmware", etc. use the official spelling
"Open Firmware" from IEEE 1275 and OpenFirmware.org (no pun intended).

Ok'ed by: tmm


133809 16-Aug-2004 grehan

Advertise that color is supported so that syscons doesn't come up
in monochrome mode when run as init.


131671 06-Jul-2004 grehan

Add 32-bit framebuffer support. Tested on PearPC at lo-res, too painful
to watch at hi-res.


131102 25-Jun-2004 grehan

Catchup to now-required <sys/module.h> for PowerPC


130585 16-Jun-2004 phk

Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.


125677 10-Feb-2004 grehan

Correctly create interrupt key for PCI, which is the OpenFirmware
pci-hi/med/lo + node 'interrupts' property. This worked by
accident until recent notebooks required correct operation.

Tested by: Suleiman Souhlal <refugee@segfaulted.com>


124771 21-Jan-2004 grehan

A syscons implementation using the 8-bit framebuffer set up by
OpenFirmware. Not at all optimized, but provides a PC-style
user-experience.

Tested on revA imac, B&W G3, 2k iBook, and G4 eMac.


119291 22-Aug-2003 imp

Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.


111814 03-Mar-2003 grehan

Simplify ofw_pci_fixup(). It doesn't need to be recursive, since the
bridge code already handles IRQ adjustment on the far side of a bridge.

Reviewed by: benno


109008 09-Jan-2003 benno

Make ofw_pci_find_node() use the reg property instead of the
assigned-addresses property. This works a lot better.


109001 09-Jan-2003 benno

Add a pcib variant to allow us to fix up interrupt assignments.

We probably want to do something wrt bus enumeration as well at some point.


99661 09-Jul-2002 benno

OpenFirmware PCI support code.

This and the sparc64 equivalent should probably be merged at some point.