History log of /freebsd-10-stable/sys/powerpc/powermac/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
273736 27-Oct-2014 hselasky

MFC r263710, r273377, r273378, r273423 and r273455:

- De-vnet hash sizes and hash masks.
- Fix multiple issues related to arguments passed to SYSCTL macros.

Sponsored by: Mellanox Technologies


/freebsd-10-stable/sys/amd64/amd64/fpu.c
/freebsd-10-stable/sys/arm/arm/busdma_machdep-v6.c
/freebsd-10-stable/sys/arm/arm/busdma_machdep.c
/freebsd-10-stable/sys/cam/scsi/scsi_sa.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
/freebsd-10-stable/sys/cddl/dev/dtrace/dtrace_sysctl.c
/freebsd-10-stable/sys/compat/ndis/kern_ndis.c
/freebsd-10-stable/sys/dev/acpi_support/acpi_asus.c
/freebsd-10-stable/sys/dev/acpi_support/acpi_asus_wmi.c
/freebsd-10-stable/sys/dev/acpi_support/acpi_hp.c
/freebsd-10-stable/sys/dev/acpi_support/acpi_ibm.c
/freebsd-10-stable/sys/dev/acpi_support/acpi_rapidstart.c
/freebsd-10-stable/sys/dev/acpi_support/acpi_sony.c
/freebsd-10-stable/sys/dev/bxe/bxe.c
/freebsd-10-stable/sys/dev/cxgb/cxgb_sge.c
/freebsd-10-stable/sys/dev/cxgbe/t4_main.c
/freebsd-10-stable/sys/dev/e1000/if_em.c
/freebsd-10-stable/sys/dev/e1000/if_igb.c
/freebsd-10-stable/sys/dev/e1000/if_lem.c
/freebsd-10-stable/sys/dev/hatm/if_hatm.c
/freebsd-10-stable/sys/dev/ixgbe/ixgbe.c
/freebsd-10-stable/sys/dev/ixgbe/ixv.c
/freebsd-10-stable/sys/dev/ixl/if_ixl.c
/freebsd-10-stable/sys/dev/mpr/mpr.c
/freebsd-10-stable/sys/dev/mps/mps.c
/freebsd-10-stable/sys/dev/mrsas/mrsas.c
/freebsd-10-stable/sys/dev/mrsas/mrsas.h
/freebsd-10-stable/sys/dev/mxge/if_mxge.c
/freebsd-10-stable/sys/dev/oce/oce_sysctl.c
/freebsd-10-stable/sys/dev/qlxgb/qla_os.c
/freebsd-10-stable/sys/dev/qlxgbe/ql_os.c
/freebsd-10-stable/sys/dev/rt/if_rt.c
/freebsd-10-stable/sys/dev/sound/pci/hda/hdaa.c
/freebsd-10-stable/sys/dev/vxge/vxge.c
/freebsd-10-stable/sys/dev/xen/netfront/netfront.c
/freebsd-10-stable/sys/fs/devfs/devfs_devs.c
/freebsd-10-stable/sys/fs/fuse/fuse_main.c
/freebsd-10-stable/sys/fs/fuse/fuse_vfsops.c
/freebsd-10-stable/sys/fs/nfsserver/nfs_nfsdkrpc.c
/freebsd-10-stable/sys/geom/geom_kern.c
/freebsd-10-stable/sys/kern/kern_cpuset.c
/freebsd-10-stable/sys/kern/kern_descrip.c
/freebsd-10-stable/sys/kern/kern_mib.c
/freebsd-10-stable/sys/kern/kern_synch.c
/freebsd-10-stable/sys/kern/subr_devstat.c
/freebsd-10-stable/sys/kern/subr_kdb.c
/freebsd-10-stable/sys/kern/subr_uio.c
/freebsd-10-stable/sys/kern/vfs_cache.c
/freebsd-10-stable/sys/mips/mips/busdma_machdep.c
/freebsd-10-stable/sys/net/if_lagg.c
/freebsd-10-stable/sys/net/pfvar.h
/freebsd-10-stable/sys/net80211/ieee80211_ht.c
/freebsd-10-stable/sys/net80211/ieee80211_hwmp.c
/freebsd-10-stable/sys/net80211/ieee80211_mesh.c
/freebsd-10-stable/sys/net80211/ieee80211_superg.c
/freebsd-10-stable/sys/netgraph/bluetooth/common/ng_bluetooth.c
/freebsd-10-stable/sys/netgraph/ng_base.c
/freebsd-10-stable/sys/netgraph/ng_socket.c
/freebsd-10-stable/sys/netinet/cc/cc_chd.c
/freebsd-10-stable/sys/netinet/tcp_reass.c
/freebsd-10-stable/sys/netipsec/ipsec.h
/freebsd-10-stable/sys/netipx/ipx_proto.c
/freebsd-10-stable/sys/netpfil/pf/if_pfsync.c
/freebsd-10-stable/sys/netpfil/pf/pf.c
/freebsd-10-stable/sys/netpfil/pf/pf_ioctl.c
/freebsd-10-stable/sys/ofed/drivers/net/mlx4/mlx4_en.h
fcu.c
smu.c
/freebsd-10-stable/sys/powerpc/powerpc/busdma_machdep.c
/freebsd-10-stable/sys/powerpc/powerpc/cpu.c
/freebsd-10-stable/sys/sys/sysctl.h
/freebsd-10-stable/sys/vm/memguard.c
/freebsd-10-stable/sys/vm/vm_kern.c
/freebsd-10-stable/sys/x86/x86/busdma_bounce.c
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().

271205 06-Sep-2014 jhibbits

MFC r259657,r264205,r264207:

r259657:

Add suspend/resume capabilities to the ATI backlight ppc driver.

With this, also shut off the display (DPMS-style) and disable the
clocking when the backlight level is set to 0. This is taken from the
radeonkms driver (radeon_legacy_encoders.c) which doesn't yet support
PowerPC.

r264205,r264207:

Fix the ATI backlight driver off/on handling. Now this driver works
correctly with the ATI Radeon 9700 in the PowerBook G4 1.67GHz.

Code shamelessly taken in spirit from the radeonkms driver, which I
hope will make this driver redundant in the future.

Approved by: re (marius)
Relnotes: yes (not suspend/resume, but the rest)

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
/freebsd-10-stable/sys/powerpc/ofw/ofw_cpu.c
/freebsd-10-stable/sys/powerpc/ofw/openpic_ofw.c
cpcht.c
grackle.c
smu.c
uninorth.c
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
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.

265970 13-May-2014 ian

MFC r257093:

Be a little more suspicious of thermal sensors, which can have single
crazy readings occasionally. One wild reading should not be enough to
trigger a shutdown, so instead wait for several concerning readings in
a row.

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

264375 12-Apr-2014 andreast

MFC r260607, r260610, r260934:

r260607:
The onyx codec works also as module, so add it.

r260610:
Described in the man page but not implemented. Here it comes,
atomic_swap_32/64. The latter only for powerpc64.

r260934:
Fix the resource information for the i2s-a node on certain G5 PowerMacs.
This is the first step needed to get the snapper codec working on those
machines.
The second step is to enable the corresponding I2S device and its clock.

Tested on machines where the snapper codec was already working, a G4 PowerBook
and a PowerMac9,1 with a Shasta based macio.
The PowerMac7,2/7,3 with a K2 based macio can now also play sound.

262675 02-Mar-2014 jhibbits

MFC r261309

Unbreak non-SMP builds. This was broken by r259284. Also, reorganize the
code introduced in that revision a bit.

261455 04-Feb-2014 eadler

MFC r258779,r258780,r258787,r258822:

Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit. Instead use (1U << 31) which gets the
expected result.

Similar to the (1 << 31) case it is not defined to do (2 << 30).

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.


/freebsd-10-stable/lib/libc/sparc64/fpu/fpu.c
/freebsd-10-stable/lib/libc/sparc64/fpu/fpu_sqrt.c
/freebsd-10-stable/lib/libc/xdr/xdr_rec.c
/freebsd-10-stable/sys/amd64/pci/pci_cfgreg.c
/freebsd-10-stable/sys/amd64/vmm/intel/vmcs.h
/freebsd-10-stable/sys/amd64/vmm/intel/vmx_controls.h
/freebsd-10-stable/sys/amd64/vmm/intel/vtd.c
/freebsd-10-stable/sys/arm/arm/cpufunc_asm_pj4b.S
/freebsd-10-stable/sys/arm/arm/db_trace.c
/freebsd-10-stable/sys/arm/arm/pl190.c
/freebsd-10-stable/sys/arm/at91/if_macbvar.h
/freebsd-10-stable/sys/arm/broadcom/bcm2835/bcm2835_dma.c
/freebsd-10-stable/sys/arm/econa/if_ece.c
/freebsd-10-stable/sys/arm/freescale/imx/imx6_anatopreg.h
/freebsd-10-stable/sys/arm/freescale/imx/imx6_usbphy.c
/freebsd-10-stable/sys/arm/freescale/imx/imx_gptreg.h
/freebsd-10-stable/sys/arm/include/armreg.h
/freebsd-10-stable/sys/arm/lpc/if_lpereg.h
/freebsd-10-stable/sys/arm/lpc/lpcreg.h
/freebsd-10-stable/sys/arm/mv/mv_pci.c
/freebsd-10-stable/sys/arm/samsung/exynos/ehci_exynos5.c
/freebsd-10-stable/sys/arm/xscale/i8134x/i81342reg.h
/freebsd-10-stable/sys/arm/xscale/ixp425/ixp425reg.h
/freebsd-10-stable/sys/boot/arm/at91/libat91/mci_device.h
/freebsd-10-stable/sys/boot/i386/libfirewire/fwohci.h
/freebsd-10-stable/sys/boot/i386/libfirewire/fwohcireg.h
/freebsd-10-stable/sys/dev/aac/aacvar.h
/freebsd-10-stable/sys/dev/acpica/acpi_video.c
/freebsd-10-stable/sys/dev/agp/agp_i810.c
/freebsd-10-stable/sys/dev/ahci/ahci.h
/freebsd-10-stable/sys/dev/bktr/bktr_core.c
/freebsd-10-stable/sys/dev/cesa/cesa.h
/freebsd-10-stable/sys/dev/drm/i915_reg.h
/freebsd-10-stable/sys/dev/drm/mach64_drv.h
/freebsd-10-stable/sys/dev/drm/mga_drv.h
/freebsd-10-stable/sys/dev/drm/r128_drv.h
/freebsd-10-stable/sys/dev/drm/r300_reg.h
/freebsd-10-stable/sys/dev/drm/r600_blit.c
/freebsd-10-stable/sys/dev/drm/radeon_cp.c
/freebsd-10-stable/sys/dev/drm/radeon_drv.h
/freebsd-10-stable/sys/dev/drm/via_irq.c
/freebsd-10-stable/sys/dev/drm2/i915/i915_reg.h
/freebsd-10-stable/sys/dev/drm2/radeon/evergreen_blit_kms.c
/freebsd-10-stable/sys/dev/drm2/radeon/evergreen_cs.c
/freebsd-10-stable/sys/dev/drm2/radeon/evergreend.h
/freebsd-10-stable/sys/dev/drm2/radeon/nid.h
/freebsd-10-stable/sys/dev/drm2/radeon/r200.c
/freebsd-10-stable/sys/dev/drm2/radeon/r300.c
/freebsd-10-stable/sys/dev/drm2/radeon/r300_reg.h
/freebsd-10-stable/sys/dev/drm2/radeon/r500_reg.h
/freebsd-10-stable/sys/dev/drm2/radeon/r600_blit.c
/freebsd-10-stable/sys/dev/drm2/radeon/r600_blit_kms.c
/freebsd-10-stable/sys/dev/drm2/radeon/r600_cs.c
/freebsd-10-stable/sys/dev/drm2/radeon/r600d.h
/freebsd-10-stable/sys/dev/drm2/radeon/radeon_cp.c
/freebsd-10-stable/sys/dev/drm2/radeon/radeon_drv.h
/freebsd-10-stable/sys/dev/drm2/radeon/radeon_reg.h
/freebsd-10-stable/sys/dev/drm2/radeon/rv770d.h
/freebsd-10-stable/sys/dev/drm2/radeon/sid.h
/freebsd-10-stable/sys/dev/drm2/ttm/ttm_bo.c
/freebsd-10-stable/sys/dev/e1000/e1000_82575.h
/freebsd-10-stable/sys/dev/e1000/e1000_ich8lan.c
/freebsd-10-stable/sys/dev/e1000/e1000_regs.h
/freebsd-10-stable/sys/dev/etherswitch/arswitch/arswitchreg.h
/freebsd-10-stable/sys/dev/ffec/if_ffecreg.h
/freebsd-10-stable/sys/dev/firewire/firewire.c
/freebsd-10-stable/sys/dev/firewire/fwohci.c
/freebsd-10-stable/sys/dev/firewire/fwohcireg.h
/freebsd-10-stable/sys/dev/firewire/sbp.c
/freebsd-10-stable/sys/dev/firewire/sbp.h
/freebsd-10-stable/sys/dev/firewire/sbp_targ.c
/freebsd-10-stable/sys/dev/hatm/if_hatmreg.h
/freebsd-10-stable/sys/dev/hwpmc/hwpmc_piv.h
/freebsd-10-stable/sys/dev/iwn/if_iwnreg.h
/freebsd-10-stable/sys/dev/mge/if_mgevar.h
/freebsd-10-stable/sys/dev/mpt/mpt_cam.c
/freebsd-10-stable/sys/dev/msk/if_mskreg.h
/freebsd-10-stable/sys/dev/mvs/mvs.h
/freebsd-10-stable/sys/dev/mxge/mxge_mcp.h
/freebsd-10-stable/sys/dev/qlxge/qls_dump.c
/freebsd-10-stable/sys/dev/ral/rt2560reg.h
/freebsd-10-stable/sys/dev/ral/rt2661reg.h
/freebsd-10-stable/sys/dev/ral/rt2860reg.h
/freebsd-10-stable/sys/dev/sound/pci/hda/hdaa.h
/freebsd-10-stable/sys/dev/usb/controller/ehci.h
/freebsd-10-stable/sys/dev/usb/wlan/if_rumreg.h
/freebsd-10-stable/sys/dev/usb/wlan/if_runreg.h
/freebsd-10-stable/sys/dev/usb/wlan/if_uralreg.h
/freebsd-10-stable/sys/dev/usb/wlan/if_urtwreg.h
/freebsd-10-stable/sys/dev/usb/wlan/if_zydreg.h
/freebsd-10-stable/sys/dev/wpi/if_wpireg.h
/freebsd-10-stable/sys/geom/raid/tr_raid1e.c
/freebsd-10-stable/sys/i386/pci/pci_cfgreg.c
/freebsd-10-stable/sys/mips/atheros/ar71xxreg.h
/freebsd-10-stable/sys/mips/atheros/ar934xreg.h
/freebsd-10-stable/sys/mips/atheros/if_argevar.h
/freebsd-10-stable/sys/mips/malta/gt_pci.c
/freebsd-10-stable/sys/mips/nlm/dev/net/nae.c
/freebsd-10-stable/sys/mips/nlm/xlp_machdep.c
/freebsd-10-stable/sys/mips/rmi/pic.h
/freebsd-10-stable/sys/ofed/drivers/infiniband/hw/mlx4/qp.c
/freebsd-10-stable/sys/ofed/drivers/infiniband/hw/mthca/mthca_mcg.c
/freebsd-10-stable/sys/ofed/drivers/infiniband/hw/mthca/mthca_qp.c
/freebsd-10-stable/sys/ofed/drivers/net/mlx4/mcg.c
/freebsd-10-stable/sys/powerpc/fpu/fpu_emu.c
/freebsd-10-stable/sys/powerpc/fpu/fpu_sqrt.c
nvbl.c
/freebsd-10-stable/sys/sys/consio.h
/freebsd-10-stable/sys/x86/iommu/intel_reg.h
/freebsd-10-stable/usr.sbin/bluetooth/bthidd/kbd.c
261177 26-Jan-2014 jhibbits

MFC r260872:

There's actually no data in the PMU_GET_VERSION command. Don't send any.
This change now allows the PMU to be used on PowerBook5,8

260674 15-Jan-2014 jhibbits

MFC r259284,r259287

Add PMU-based CPU frequency scalling. This is used on most Titanium
PowerBooks.

260673 15-Jan-2014 jhibbits

MFC r259082

Make some unsigned ints signed.

Found by: clang (powerpc64)

256857 21-Oct-2013 andreast

MFC: 256555

Move the resource allocation from the ata_*_probe section to the ata_*_attach
section. This prevents a boot crash on nearly all iMacs and PowerMacs/Books.

The allocation in the probe section was working before because ata_probe was
returning 0 which did not invoke a second DEVICE_PROBE. Now it returns
a BUS_PROBE_DEFAULT which can invoke a second DEVICE_PROBE which results in
a "failed to reserve resource" exit.

PR: powerpc/182978
Approved by: re(gjb)

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)


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)


255100 31-Aug-2013 jhibbits

Only add the backlight device if it actually exists in OF.

MFC after: 1 week


254737 23-Aug-2013 andreast

Return EIO iso -1, the kiic_transfer has an signed return.

Submitted by: Luiz Otavio O Souza <loos.br AT gmail.com>


253825 31-Jul-2013 jhibbits

Add the macio attachment for wi(4). Partially obtained from NetBSD.

Reviewed by: adrian
Obtained from: NetBSD (partially)


250290 05-May-2013 nwhitehorn

Only check fan type once. Not only is continuously rechecking pointless, a
single random failure can reprogram what control mechanism we try to use.

MFC after: 2 weeks


249213 06-Apr-2013 marius

- With the demise of !ATA_CAM, ATA_STATIC_ID is the only ata(4) related
option left but actually consumed by ada(4), so move it to opt_ada.h
and get rid of opt_ata.h.
- Fix stand-alone build of atacore(4) by adding opt_cam.h.
- Use __FBSDID.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.


246732 13-Feb-2013 rpaulo

Introduce PLATFORMMETHOD_END and use it.


242315 29-Oct-2012 nwhitehorn

Work around broken device tree on last-generation PowerPC iMacs
(PowerMac12,1), which have a mac-io MPIC cell that indifies itself
as the root PIC despite the actual root PIC being on the northbridge.
No CPC945 systems have a mac-io PIC that does anything so just don't
attach on CPC945 (U4) systems.

MFC after: 3 days


239548 21-Aug-2012 jhibbits

phandle_t is unsigned, and OF_finddevice() returns (phandle_t)(-1) on
failure, so check for that instead of 0.

While here, provide a better description for ATI backlight driver.

Reported by: jchandra@
MFC after: 3 days


239027 04-Aug-2012 jhibbits

Add backlight support for nVidia-based PowerBooks/iBooks/iMacs.

Approved by: nwhitehorn (mentor)
MFC after: 9.1-RELEASE


237936 01-Jul-2012 rpaulo

Remove bogus __unused attribute from hrowpic_eoi().


233188 19-Mar-2012 andreast

Provide a fix for certain PowerMacs where the U3 i2c lacks the interrupt
info.

Tested by: Robert Hish
MFC after: 1 week


232482 04-Mar-2012 andreast

Add support for PWM controlled fans. I found these fans on my PowerMac9,1.
These fans are not located under the same node as the the RPM controlled ones,
So I had to adapt the current source to parse and fill the properties correctly.
To control the fans we can set the PWM ratio via sysctl between 20 and 100%.

Tested by: nwhitehorn
MFC after: 3 weeks


232177 26-Feb-2012 jhibbits

Add backlight control to ATI-graphics PowerBooks and iBooks.

Approved by: nwhitehorn (mentor)
MFC after: 1 week


231770 15-Feb-2012 nwhitehorn

Improve error handling in smusat(4).

MFC after: 4 days


230999 04-Feb-2012 nwhitehorn

Compatibility with IBM firmware.


230994 04-Feb-2012 nwhitehorn

Miffed r230993 due to a one-character typo while reviewing the patch.


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


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


230035 12-Jan-2012 jhibbits

Add PWM monitoring sysctl to G4 MDD (Windtunnel) fan driver. While there, clean
up some style nits.

Approved by: nwhitehorn (mentor)
MFC after: 3 days


228277 05-Dec-2011 jhibbits

Fix style(9) issues from r228270.

Approved by: nwhitehorn (mentor)


228270 05-Dec-2011 jhibbits

Add a devd notification for closing/opening the lid on PowerBooks and iBooks.

Approved by: nwhitehorn (mentor)


228201 02-Dec-2011 jchandra

Fix OF_finddevice error return value in case of FDT.

According to the open firmware standard, finddevice call has to return
a phandle with value of -1 in case of error.

This commit is to:
- Fix the FDT implementation of this interface (ofw_fdt_finddevice) to
return (phandle_t)-1 in case of error, instead of 0 as it does now.
- Fix up the callers of OF_finddevice() to compare the return value with
-1 instead of 0 to check for errors.
- Since phandle_t is unsigned, the return value of OF_finddevice should
be checked with '== -1' rather than '<= 0' or '> 0', fix up these cases
as well.

Reported by: nwhitehorn

Reviewed by: raj
Approved by: raj, nwhitehorn


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.


224505 30-Jul-2011 nwhitehorn

Fix an error that could cause sysctl -a to enter an infinite loop in the
event of a broken or busy fan due to returning incorrect error codes from
the FCU sysctl handler.

Reported by: Path Mather <paul at gromit dot dlib dot vt dot edu>1
Approved by: re (kib)


223555 26-Jun-2011 nwhitehorn

Turn the minimum PWM fan speed down to 30 from 40. It turns out the burning
smell that caused me to turn this up was due to a failed fan burning, not
a CPU (plus a healthy dose of paranoia).

Submitted by: Paul Mather <paul at gromit dot dlib dot vt dot edu>


222686 04-Jun-2011 andreast

Add new fan controller driver for the G4 MDD PowerMac. Submitted and tested
by Justin Hibbits.

Approved by: nwhitehorn (mentor)


222675 04-Jun-2011 andreast

- Improve error handling.
- Add retry loops for the i2c read/write functions.

Approved by: nwhitehorn (mentor)


222659 03-Jun-2011 andreast

- Introduce a define for ZERO_C_TO_K.
- Fix the printing of the temperature when we exceed the critical value.

Approved by: nwhitehorn (mentor)


222469 29-May-2011 nwhitehorn

Use kproc_exit() instead of returning from the management function on
systems with no manageable thermal control devices.


222463 29-May-2011 nwhitehorn

Add some error handling here: if a sensor returns an error code (a negative
Kelvin temperature, which is impossible except for some contrived magnetic
spin systems), use the previous measurement from that sensor instead of
corrupting everything and randomly changing the fans or shutting off the
machine.


222462 29-May-2011 nwhitehorn

Add the next digit of precision to temperatures, which I missed when
converting the reporting format from degrees C to 0.1 degree K.


222460 29-May-2011 nwhitehorn

Don't put negative values into the averages.


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.


222431 28-May-2011 nwhitehorn

Adapt smusat(4) to use powermac_thermal. This provides automatic fan
management on dual- and quad-core Powermac G5s, and the last G5 iMacs.


222430 28-May-2011 nwhitehorn

Require an error instead of a timeout to decide the new-style fan
commands won't work. This prevents a busy system from making smu(4)
suddenly decide its fans use the old-style command set.

MFC after: 3 days


222429 28-May-2011 nwhitehorn

Factor out the SMU fan management code into a new module (powermac_thermal)
that will connect all of the various sensors and fan control modules on
Apple hardware with software-controlled fans (e.g. all G5 systems).

MFC after: 1 month


221519 06-May-2011 nwhitehorn

Do not use Open Firmware to open the device and instead program its start
on our own. This prevents hangs at boot when using a bm(4) NIC where the
cable is not plugged in at boot time.

Obtained from: NetBSD
MFC after: 1 week


219624 13-Mar-2011 nwhitehorn

Don't sleep while setting the clock. This can cause panics when
periodic_resettodr() calls CLOCK_SETTIME() and smu tries to sleep while
running from a callout.

Reported by: Torfinn Ingolfsen


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.


218075 29-Jan-2011 marcel

Fix the interrupt code, broken 7 months ago. The interrupt framework
already supported nested PICs, but was limited to having a nested
AT-PIC only. With G5 support the need for nested OpenPIC controllers
needed to be added. This was done the wrong way and broke the MPC8555
eval system in the process.

OFW, as well as FDT, describe the interrupt routing in terms of a
controller and an interrupt pin on it. This needs to be mapped to a
flat and global resource: the IRQ. The IRQ is the same as the PCI
intline and as such needs to be representable in 8 bits. Secondly,
ISA support pretty much dictates that IRQ 0-15 should be reserved
for ISA interrupts, because of the internal workins of south bridges.
Both were broken.

This change reverts revision 209298 for a big part and re-implements
it simpler. In particular:
o The id() method of the PIC I/F is removed again. It's not needed.
o The openpic_attach() function has been changed to take the OFW
or FDT phandle of the controller as a second argument. All bus
attachments that previously used openpic_attach() as the attach
method of the device I/F now implement as bus-specific method
and pass the phandle_t to the renamed openpic_attach().
o Change powerpc_register_pic() to take a few more arguments. In
particular:
- Pass the number of IPIs specificly. The number of IRQs carved
out for a PIC is the sum of the number of int. pins and IPIs.
- Pass a flag indicating whether the PIC is an AT-PIC or not.
This tells the interrupt framework whether to assign IRQ 0-15
or some other range.
o Until we implement proper multi-pass bus enumeration, we have to
handle the case where we need to map from PIC+pin to IRQ *before*
the PIC gets registered. This is done in a similar way as before,
but rather than carving out 256 IRQs per PIC, we carve out 128
IRQs (124 pins + 4 IPIs). This is supposed to handle the G5 case,
but should really be fixed properly using multiple passes.
o Have the interrupt framework set root_pic in most cases and not
put that burden in PIC drivers (for the most part).
o Remove powerpc_ign_lookup() and replace it with powerpc_get_irq().
Remove IGN_SHIFT, INTR_INTLINE and INTR_IGN.

Related to the above, fix the Freescale PCI controller driver, broken
by the FDT code. Besides not attaching properly, bus numbers were
assigned improperly and enumeration was broken in general. This
prevented the AT PIC from being discovered and interrupt routing to
work properly. Consequently, the ata(4) controller stopped functioning.

Fix the driver, and FDT PCI support, enough to get the MPC8555CDS
going again. The FDT PCI code needs a whole lot more work.

No breakages are expected, but lackiong G5 hardware, it's possible
that there are unpleasant side-effects. At least MPC85xx support is
back to where it was 7 months ago -- it's amazing how badly support
can be broken in just 7 months...

Sponsored by: Juniper Networks


217756 23-Jan-2011 nwhitehorn

Disable ATAPI DMA unconditionally on Apple Kauai ATA controllers, like it
is on the MacIO ones. It appears to be unreliable on all DBDMA-based
controllers for unknown reasons, which should be figured out eventually.

Tested by: Torfinn Ingolfsen
MFC after: 1 week


217659 20-Jan-2011 andreast

Remove unused variables. Spotted by a cppcheck
(devel/cppcheck, http://sourceforge.net/projects/cppcheck) run.

Approved by: nwhitehorn (mentor)


217658 20-Jan-2011 andreast

Correct parsing of the grackle and uninorthpci ranges property.

Approved by: nwhitehorn (mentor)


217639 20-Jan-2011 nwhitehorn

Correct parsing of the cpcht ranges property.

Submitted by: andreast
MFC after: 2 weeks


217286 11-Jan-2011 andreast

Add new functions, fcu_fan_set_pwm and fcu_fan_get_pwm, to set and get
the pwm values. We can now set the fan's speed of a PWM controlled fan
with % numbers between 30 and 100 % instead of trying to model a
% number based on rpm.
The fcu chip offers both, the dutycycle and the rpm value of the PWM
controlled fans. I added the rpm value to the list of information
available via sysctl(8).

Tested by: Paul Mather <paul at gromit dlib vt edu>

Approved by: nwhitehorn (mentor)


217065 06-Jan-2011 andreast

Remove unused variables. Spotted by a cppcheck
(devel/cppcheck, http://sourceforge.net/projects/cppcheck) run.

Approved by: nwhitehorn (mentor)


216083 30-Nov-2010 marius

Several chipset drivers alter parameters relevant for the DMA tag creation,
i.e. alignment, max_address, max_iosize and segsize (only max_address is
thought to have an negative impact regarding this issue though), after
calling ata_dmainit() either directly or indirectly so these values have
no effect or at least no effect on the DMA tags and the defaults are used
for the latter instead. So change the drivers to set these parameters
up-front and ata_dmainit() to honor them.

This file was missed in r216013.

Submitted by: nwhitehorn


215100 10-Nov-2010 nwhitehorn

Disabling CPU NAP modes during SMU commands is a hack needed only on U3
systems. Don't use it on non-U3 systems to allow cpu_idle() to work
correctly.


214575 30-Oct-2010 nwhitehorn

Allow access to the HT I/O port space on the IBM CPC9X5 northbridge chips.

MFC after: 2 weeks


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)


212687 15-Sep-2010 andreast

Increase register access delay to deal with the high-latency I2C
chipset found in some models of Powermac G5.

Approved by: nwhitehorn (mentor)


212483 11-Sep-2010 nwhitehorn

ATAPI DMA does not seem to work completely reliably on Shasta controllers,
especially in conjunction with ATA_CAM, so disable it for now.


212054 31-Aug-2010 nwhitehorn

Restructure how reset and poweroff are handled on PowerPC systems, since
the existing code was very platform specific, and broken for SMP systems
trying to reboot from KDB.

- Add a new PLATFORM_RESET() method to the platform KOBJ interface, and
migrate existing reset functions into platform modules.
- Modify the OF_reboot() routine to submit the request by hand to avoid
the IPIs involved in the regular openfirmware() routine. This fixes
reboot from KDB on SMP machines.
- Move non-KDB reset and poweroff functions on the Powermac platform
into the relevant power control drivers (cuda, pmu, smu), instead of
using them through the Open Firmware backdoor.
- Rename platform_chrp to platform_powermac since it has become
increasingly Powermac specific. When we gain support for IBM systems,
we will grow a new platform_chrp.


209958 12-Jul-2010 grehan

Fix printf specifier to allow 32/64 bit builds.

Obtained from: projects/ppc64


209724 06-Jul-2010 nwhitehorn

Move the EOI logic when starting ithreads into intr_machdep instead of
relying on it as a side effect of PIC_MASK() in the PIC drivers, and add
an inmplementation of assign_cpu() for the kernel interrupt layer.


209639 02-Jul-2010 marcel

Remove the unneeded header <machine/intr.h>.


209486 23-Jun-2010 nwhitehorn

Configure interrupts on SMP systems to be distributed among all online
CPUs by default, and provide a functional version of BUS_BIND_INTR().
While here, fix some potential concurrency problems in the interrupt
handling code.


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.


209302 18-Jun-2010 nwhitehorn

Add support for the Keywest I2C controller in Apple uninorth northbridges.
Although the Keywest registers have only 1 byte of content, they are
secretly 4-byte registers, which became apparent from them moving on the
big-endian Uninorth version of the controller.


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


208871 06-Jun-2010 nwhitehorn

Add Open Firmware PNP info strings to GPIOs and Uninorth cells.

Submitted by: Andreas Tobler


208842 05-Jun-2010 nwhitehorn

Add a driver for the CPU temperature sensors attached over I2C on the
PowerMac 11,2.


208841 05-Jun-2010 nwhitehorn

Add support for the I2C busses hanging off Apple system management chips.


208840 05-Jun-2010 nwhitehorn

Utilize the Keywest I2C combined mode for messages with repeated starts.


208285 19-May-2010 nwhitehorn

Correct a typo.

Pointy hat to: me


208168 16-May-2010 nwhitehorn

It is not necessary (and in some cases harmful) to hardcode ata_kauai's
IRQ to 39 on K2 devices, as well as Shasta ones.

Reported by: Andreas Tobler


208167 16-May-2010 nwhitehorn

Enable smu(4) to report fan speeds on late-model Powermac G5s.


208149 16-May-2010 nwhitehorn

Add support for the U4 PCI-Express bridge chipset used in late-generation
Powermac G5 systems. MSI and several other things are not presently
supported.

The U3/U4 internal device support portions of this change were contributed
by Andreas Tobler.

MFC after: 1 week


205506 23-Mar-2010 nwhitehorn

Get nexus(4) out of the RTC business. The interface used by nexus(4)
in Open Firmware was Apple-specific, and we have complete coverage of Apple
system controllers, so move RTC responsibilities into the system controller
drivers. This avoids interesting problems from manipulating these devices
through Open Firmware behind the backs of their drivers.

Obtained from: NetBSD
MFC after: 2 weeks


205356 20-Mar-2010 nwhitehorn

Let unin(4) attach to U3 controllers found on G5 machines.

Submitted by: Andreas Tobler


204692 04-Mar-2010 nwhitehorn

Rework smu(4) to be asynchronous. It turns out that the combination of
the automatic fan management and the polling in smu_run_cmd() was
putting my system interrupt load at 20%. This change reduces that to
0.4%.


204270 24-Feb-2010 nwhitehorn

Add the ability to set SMU-based machines to restart automatically after
power loss.


204218 22-Feb-2010 nwhitehorn

Provide a new useless feature: an led(4) interface for the system's sleep
LED.


204180 21-Feb-2010 nwhitehorn

Add a simple fan management callout to the SMU driver. This is designed
such that a fancier thermal management algorithm can be run from user
space, but the kernel will at least ensure your machine does not either
sound like a wind tunnel or catch fire.


204179 21-Feb-2010 nwhitehorn

Fix several mistakes in this file, in order to allow individual fan speeds
to be read and set correctly.


204082 19-Feb-2010 nwhitehorn

Allow the SMU driver to read a variety of hardware sensors (possible
questions on the thermal calibration), and to read and set fan RPMs from
software. While here, fix a number of bugs.

Calibration code from: OpenBSD
MFC after: 2 weeks


200171 06-Dec-2009 mav

MFp4:
Introduce ATA_CAM kernel option, turning ata(4) controller drivers into
cam(4) interface modules. When enabled, this options deprecates all ata(4)
peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers
(ada, cd, ...) and interfaces to be natively used instead.

As side effect of this, ata(4) mode setting code was completely rewritten
to make controller API more strict and permit above change. While doing
this, SATA revision was separated from PATA mode. It allows DMA-incapable
SATA devices to operate and makes hw.ata.atapi_dma tunable work again.

Also allow ata(4) controller drivers (except some specific or broken ones)
to handle larger data transfers. Previous constraint of 64K was artificial
and is not really required by PCI ATA BM specification or hardware.

Submitted by: nwitehorn (powerpc part)


198444 24-Oct-2009 nwhitehorn

Allow Heathrow-based machines to boot a kernel containing option SMP
without panicing.


194679 23-Jun-2009 nwhitehorn

Add cpufreq support on the PowerPC G5, along with a skeleton SMU driver
in order to slew CPU voltage during frequency changes. The OpenBSD SMU
driver was an extremely helpful reference for this.


194027 11-Jun-2009 avg

strict kobj signatures: fix adb_hb_controller_poll impl in powermac

the method return u_int, not void

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


193159 31-May-2009 nwhitehorn

Provide an analogous sysctl to hw.acpi.acline (dev.pmu.0.acline) to
determine whether the computer is plugged in to mains power.


193156 31-May-2009 nwhitehorn

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


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


190403 25-Mar-2009 nwhitehorn

Disable ATA DMA for ATAPI devices for now. Apparently, certain revisions
of this controller, in combination with certain ATAPI devices and phases
of the moon, will cause DMA operations for ATAPI to fail.


187473 20-Jan-2009 nwhitehorn

Fix a race condition in kiic(4) made possible by the way the device's STOP
condition is sent. We used to put the bus in the STOP state, but returned
without waiting for that to actually occur.

Submitted by: Marco Trillo


187455 19-Jan-2009 nwhitehorn

Provide a device description for macio-attached ATA cells.


187262 15-Jan-2009 nwhitehorn

Driver for Apple Keywest I2C controllers found in MacIO ASICs. Used for
power and thermal control, as well as GPIOs on Xserves and controlling
sound codecs for Apple built-in audio.

Submitted by: Marco Trillo
Obtained from: NetBSD


187071 12-Jan-2009 nwhitehorn

Some early Macintosh GPIO controllers don't provide reg properties for
interrupt-only GPIOs. Honor this, and allow interrupt attachment, but not
read/write access for such devices.

Reported by: Niels Eliasen


186805 06-Jan-2009 nwhitehorn

Add a new quirk type so that the MacIO driver will assign memory resources
belonging to a devices children, in analogy to the way we handle interrupts
for SCC serial devices. This is required to counteract overly deep nesting
on onboard audio devices.

Submitted by: Marco Trillo


186728 03-Jan-2009 nwhitehorn

Fix the OFW interrupt map parser to use its own idea of the number of interrupt
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


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


186046 13-Dec-2008 nwhitehorn

Use a static free packet queue instead of using malloc() to allocate new ADB packets.
This fixes some locking problems.


185782 09-Dec-2008 nwhitehorn

Add the ability to control the sleep LED with led(4). Adding this fairly
useless feature gives us a reasonably complete PMU implementation.


185757 08-Dec-2008 nwhitehorn

Clean up the mac GPIO interface a little. Also remove bogus copyright
and 3rd license clause.

Submitted by: Marco Trillo


185754 08-Dec-2008 nwhitehorn

Add facilities to pmu(4) to interrogate battery status on Apple PowerPC
laptops. This includes battery presence detection, charging status, current
and voltage readouts, and charge level indication. The sysctl interface
is somewhat ACPI-like.


185727 07-Dec-2008 nwhitehorn

Add support for automated reboot after power failure on Apple Core99 machines
(G3 laptops, all G4 machines, early G5s, G5 Xserves). The relevant sysctl
is named dev.pmu.0.server_mode for mental compatibility with Linux.


185724 06-Dec-2008 nwhitehorn

Fix some nasty race conditions in the VIA-CUDA driver that ended up preventing
my right mouse button and keyboard LEDs from working due to mangled
configuration packets. Fixed several other races and associated problems in the
main ADB stack that were exposed while fixing this.


184473 30-Oct-2008 nwhitehorn

Fix some possible infinite loops in the ADB code, and remove some hacks
that were inserted in desperation during bring-up. In addition, move ADB bus
enumeration and child attachment to when interrupts are available.


184429 28-Oct-2008 nwhitehorn

DBDMA can transfer a maximum of 64K - 1 bytes per descriptor, as the byte
count field is 16 bits. Inform ATA of this fact.

Reported by: Marco Trillo


184382 27-Oct-2008 nwhitehorn

Clean up some magic numbers in the DBDMA code by replacing them with
appropriately defined constants.

Suggested by: gnn


184314 27-Oct-2008 nwhitehorn

Bring Kauai ATA driver in line with Macio ATA by reading the PIO config reg
to set the initial PIO mode instead of assuming PIO4. There are still a few
nagging issues:

- There are some problems with 64 K DMA transfers waiting on lower level
changes.

- ATAPI DMA is broken on Marcel's Mac Mini because we need an ATA SELECT hook
propagated up to individual drivers for hardware without timing registers for
each ATA channel.


184299 26-Oct-2008 nwhitehorn

Add ADB support. This provides support for the external ADB bus on the PowerMac
G3 as well as the internal ADB keyboard and mice in PowerBooks and iBooks. This
also brings in Mac GPIO support, for which we should eventually have a better
interface.

Obtained from: NetBSD (CUDA and PMU drivers)


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


183411 27-Sep-2008 nwhitehorn

Expand the DBDMA API to allow setting device-dependent control bits. While
here, clean up and document this a little.

Submitted by: Marco Trillo
MFC after: 1 week


183409 27-Sep-2008 nwhitehorn

Add DMA support for Apple built-in ATA controllers.

Tested by: grehan, marcotrillo@gmail.com
MFC after: 1 month


183288 23-Sep-2008 nwhitehorn

Change the DBDMA API to allow DBDMA registers in a subregion of a resource. This is necessary to allow future support of DMA for the various Apple on-board ATA controllers.

MFC after: 1 week


179746 12-Jun-2008 kevlo

Return an error code rather than ENXIO when both rman_init() and
rman_manage_region() failed.

Reviewed by: marcel


179644 07-Jun-2008 marcel

Add support for Apple's Descriptor-Based DMA (DBDMA) engine. The DMA
engine is usful to various existing drivers, such as ata(4) and scc(4),
and is used bhy the soon to be added bm(4).

Submitted by: Nathan Whitehorn


178599 26-Apr-2008 marcel

Take into account the size of the interrupt cell. It's determined
by the parent for interrupt resources. This corrects parsing of
the interrupts property.

With parsing of the property fixed, add all interrupts to the
resource list. Bump the max. number of interrupts from 5 to 6
as scc(4) attached to macio(4) has 6 interrupts (3 per channel).

Submitted by: Nathan Whitehorn <nathanw@uchicago.edu>


176918 07-Mar-2008 marcel

Add support for the BUS_CONFIG_INTR() method to the platform and to
openpic(4). Make use of it in ocpbus(4). On the MPC85xxCDS, IRQ0:4
are active-low.


176208 12-Feb-2008 marcel

Add PIC support for IPIs. When registering an interrupt handler,
the PIC also informs the platform at which IRQ level it can start
assigning IPIs, since this can depend on the number of IRQs
supported for external interrupts.


175668 26-Jan-2008 julian

One of my powerbooks has this chip in it..
Confirmed by looking at netbsd.. they have also added this.
checked by grehen
MFC After: 3 days


174898 25-Dec-2007 rwatson

Add a new 'why' argument to kdb_enter(), and a set of constants to use
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.


174822 21-Dec-2007 marcel

Apply missing s/rv/res/g in previous commit.


174820 20-Dec-2007 jhb

MFamd64/ia64/i386: Only set the rman bus tags and handles in
bus_activate_resource() methods instead of splitting it up between
bus_alloc_resource() and bus_activate_resource().

Glanced at by: marcel


174782 19-Dec-2007 marcel

Redefine bus_space_tag_t on PowerPC from a 32-bit integral to
a pointer to struct bus_space. The structure contains function
pointers that do the actual bus space access.

The reason for this change is that previously all bus space
accesses were little endian (i.e. had an explicit byte-swap
for multi-byte accesses), because all busses on Macs are little
endian.
The upcoming support for Book E, and in particular the E500
core, requires support for big-endian busses because all
embedded peripherals are in the native byte-order.

With this change, there's no distinction between I/O port
space and memory mapped I/O. PowerPC doesn't have I/O port
space. Busses assign tags based on the byte-order only.
For that purpose, two global structures exist (bs_be_tag and
bs_le_tag), of which the address can be taken to get a valid
tag.

Obtained from: Juniper, Semihalf


172394 30-Sep-2007 marius

Make the PCI code aware of PCI domains (aka PCI segments) so we can
support machines having multiple independently numbered PCI domains
and don't support reenumeration without ambiguity amongst the
devices as seen by the OS and represented by PCI location strings.
This includes introducing a function pci_find_dbsf(9) which works
like pci_find_bsf(9) but additionally takes a domain number argument
and limiting pci_find_bsf(9) to only search devices in domain 0 (the
only domain in single-domain systems). Bge(4) and ofw_pcibus(4) are
changed to use pci_find_dbsf(9) instead of pci_find_bsf(9) in order
to no longer report false positives when searching for siblings and
dupe devices in the same domain respectively.
Along with this change the sole host-PCI bridge driver converted to
actually make use of PCI domain support is uninorth(4), the others
continue to use domain 0 only for now and need to be converted as
appropriate later on.
Note that this means that the format of the location strings as used
by pciconf(8) has been changed and that consumers of <sys/pciio.h>
potentially need to be recompiled.

Suggested by: jhb
Reviewed by: grehan, jhb, marcel
Approved by: re (kensmith), jhb (PCI maintainer hat)


171805 11-Aug-2007 marcel

Revamp the interrupt handling in support of INTR_FILTER. This includes:
o Revamp the PIC I/F to only abstract the PIC hardware. The
resource handling has been moved to nexus, where it belongs.
o Include EOI and MASK+EOI methods to the PIC I/F in support of
INTR_FILTER.
o With the allocation of interrupt resources and setup of
interrupt handlers in the common platform code we can delay
talking to the PIC hardware after enumeration of all devices.
Introduce a call to powerpc_intr_enable() in configure_final()
to achieve that and have powerpc_setup_intr() only program the
PIC when !cold.
o As a consequence of the above, remove all early_attach() glue
from the OpenPIC and Heathrow PIC drivers and have them
register themselves when they're found during enumeration.
o Decouple the interrupt vector from the interrupt request line.
Allocate vectors increasingly so that they can be used for
the intrcnt index as well. Extend the Heathrow PIC driver to
translate between IRQ and vector. The OpenPIC driver already
has the support for vectors in hardware.

Approved by: re (blanket)


168200 01-Apr-2007 marcel

When writing to PCI configuration registers, don't immediately
read the same register back. It can cause hangs or machine
checks in certain cases. One particular case is with bge(4)
when a reset is initiated for the controller.

MFC after: 1 month


167170 02-Mar-2007 piso

Make pswitch_intr() returns interrupt handling status.


166978 25-Feb-2007 piso

Catch up with bus_setup_intr() modification and garbage collect a
reference to INTR_FAST.


166901 23-Feb-2007 piso

o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@


157895 20-Apr-2006 imp

Set the rid for any resource obtained from rman_resource_reserve.


153050 03-Dec-2005 marius

Convert to use the recently introduced set of ofw_bus_gen_get_*() for
providing the ofw_bus KOBJ interface.

Tested by: grehan


146737 29-May-2005 grehan

The end values passed to rman_manage_region() for PCI i/o and mem
spaces were 1 too large. This resulted in the rman list not being
sorted correctly, and USB ports not being discovered on older
TiBooks.

Detective work by: Andreas Tobler <toa at pop dot agri dot ch>


146198 14-May-2005 grehan

Remove incorrect configuration setting that limited the Kauai ATA controller
to be master-only. The slave ATAPI drive on the Mac-Mini is now recognised.


145772 01-May-2005 grehan

Catch up with latest ATA newbus commits.


145311 20-Apr-2005 grehan

Get order right when initializing task file bus resources. ATA drives are
now recognised when booting from the drive, as opposed to net-booting which
the previous botched commit was tested with.


145221 18-Apr-2005 grehan

Catch up with ATA mkIII definitions for registers that have different
functions for read vs. write.


144457 01-Apr-2005 grehan

Introduce channel-level setmode newbus method.

Thanks to sos for the code re-org that allowed this.


144359 31-Mar-2005 grehan

Catch up with ATA-mkIII


140049 11-Jan-2005 grehan

- allow a device hint to disable probing a slot on a Uninorth PCI bus.
e.g. at the loader:

set hint.pcib.1.skipslot=26

This allows undocumented and problematic hardware on some systems
to be ignored, for instance, the USB keyboard/mouse that shows up
on a 12" albook that doesn't exist nor do anything other than eat up
the syscons keyboard. Another one is the unused USB cell in the old
366MHz iBook that locks up the machine when probed.

In a way this is temporary, since there are better fixes for the
above problems, but will be useful in the meantime by allowing
a keyboard to be used to help debug said fixes :)

- while here remove some trailing white space


139825 07-Jan-2005 imp

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


139819 07-Jan-2005 grehan

Return correct value in the lock routine.


137119 02-Nov-2004 ssouhlal

Stay up to date with the latest ATA developments, where
ata_channel.locking now returns an int.

Approved by: grehan (mentor)


135861 27-Sep-2004 gallatin

Add sc_iostart to softc and unbreak the build.
This was forgotten in my previous commit to add i/o port to uninorth.c

Pointy-hat to: me


135800 26-Sep-2004 gallatin

Add support for i/o-ports. This was cut and pasted from grackle.c


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


133589 12-Aug-2004 marius

- Introduce an ofw_bus kobj-interface for retrieving the OFW node and a
subset ("compatible", "device_type", "model" and "name") of the standard
properties in drivers for devices on Open Firmware supported busses. The
standard properties "reg", "interrupts" und "address" are not covered by
this interface because they are only of interest in the respective bridge
code. There's a remaining standard property "status" which is unclear how
to support properly but which also isn't used in FreeBSD at present.
This ofw_bus kobj-interface allows to replace the various (ebus_get_node(),
ofw_pci_get_node(), etc.) and partially inconsistent (central_get_type()
vs. sbus_get_device_type(), etc.) existing IVAR ones with a common one.
This in turn allows to simplify and remove code-duplication in drivers for
devices that can hang off of more than one OFW supported bus.
- Convert the sparc64 Central, EBus, FHC, PCI and SBus bus drivers and the
drivers for their children to use the ofw_bus kobj-interface. The IVAR-
interfaces of the Central, EBus and FHC are entirely replaced by this. The
PCI bus driver used its own kobj-interface and now also uses the ofw_bus
one. The IVARs special to the SBus, e.g. for retrieving the burst size,
remain.
Beware: this causes an ABI-breakage for modules of drivers which used the
IVAR-interfaces, i.e. esp(4), hme(4), isp(4) and uart(4), which need to be
recompiled.
The style-inconsistencies introduced in some of the bus drivers will be
fixed by tmm@ in a generic clean-up of the respective drivers later (he
requested to add the changes in the "new" style).
- Convert the powerpc MacIO bus driver and the drivers for its children to
use the ofw_bus kobj-interface. This invloves removing the IVARs related
to the "reg" property which were unused and a leftover from the NetBSD
origini of the code. There's no ABI-breakage caused by this because none
of these driver are currently built as modules.
There are other powerpc bus drivers which can be converted to the ofw_bus
kobj-interface, e.g. the PCI bus driver, which should be done together
with converting powerpc to use the OFW PCI code from sparc64.
- Make the SBus and FHC front-end of zs(4) and the sparc64 eeprom(4) take
advantage of the ofw_bus kobj-interface and simplify them a bit.

Reviewed by: grehan, tmm
Approved by: re (scottl)
Discussed with: tmm
Tested with: Sun AX1105, AXe, Ultra 2, Ultra 60; PPC cross-build on i386


133521 11-Aug-2004 marius

- Use the rman_get_* functions instead of reaching into struct resource.
- Remove __RMAN_RESORUCE_VISIBLE again. It's no longer required either
because of the above change or because struct rman is no longer hidden.

Reviewed by: grehan
Tested by: cross-compile on i386


132519 22-Jul-2004 gallatin

Make this compile: add sys/module.h and KDBify.


131400 01-Jul-2004 grehan

Catch up with __RMAN_RESOURCE_VISIBLE change


131399 01-Jul-2004 grehan

Move soft structs back to C files to avoid exposing rman fields
to clients now that it's protected with __RMAN_RESOURCE_VISIBLE


131102 25-Jun-2004 grehan

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


128595 23-Apr-2004 grehan

- Catch up with recent ATA changes.
- Remove trailing space in ata_macio.c


127703 01-Apr-2004 grehan

Match the specific MPC106 host bridge PCI ID rather than all
generic host bridges: this avoids a race with the UniNorth
generic match.


127659 31-Mar-2004 grehan

The end argument to bus_alloc_resource() should have been ~0 and
not ~1, but the call has been switched over to bus_alloc_resource_any()
which has the same effect.

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


127135 17-Mar-2004 njl

Convert callers to the new bus_alloc_resource_any(9) API.

Submitted by: Mark Santcroos <marks@ripe.net>
Reviewed by: imp, dfr, bde


126394 29-Feb-2004 grehan

Bring to working PIO state.
- use correct rid when allocating PCI mem resource
- ATA taskfile registers are indeed spaced 0x10 apart just like
the Macio ATA cell. Adjust offsets in ATA channel struct.

Tested by: Suleiman Souhlal <ssouhlal@vt.edu>


125735 12-Feb-2004 grehan

Work-in-progress for the 'Kauai' ATA device in Mac notebooks. The
device seems to be the macio ATA cell with a PCI front-end, and
has no relation to PIIX-style ATA/PCI devices.


125688 11-Feb-2004 grehan

- remove trailing whitespace
- fix compile warnings. badaddr() will go to a header file soon.


125414 04-Feb-2004 grehan

- removed debug printf that was a false positive on non-OpenPIC systems
- white space nits


125378 03-Feb-2004 grehan

Use device alias "mpic" to locate the macio OpenPIC. This works
on the new 12/15/17" PowerBooks that don't have the "interrupt-controller"
property underneath "/chosen", which was the previous way of
searching.


124581 15-Jan-2004 grehan

Catch up with ATA UMA changes


124470 13-Jan-2004 grehan

Use a device identify entry point to attach to nexus, since the
nexus code no longer searches for interrupt controllers.


124469 13-Jan-2004 grehan

Make the OpenPic driver bus-independent, with attachments for
the MacIO chip and PSIM's IOBus. Bus-specific drivers should
use the identify method to attach themselves to nexus so
interrupt can be allocated before the h/w is probed. The
'early attach' routine in openpic is used for this stage
of boot. When h/w is probed, the openpic can be attached
properly. It will enable interrupts allocated prior to
this.


124466 13-Jan-2004 grehan

Catch up with ATA changes by including <sys/sema.h>


123371 10-Dec-2003 grehan

imac revA-D and beige G3 OpenFirmware uses the "ide" string for
ATA drives.


122841 17-Nov-2003 peter

Widen the enable/disable helper function's argument in line with the
ithread_create() changes etc. This should be mostly a NOP.


120335 22-Sep-2003 grehan

ATAng requires <sys/taskqueue.h>


117017 29-Jun-2003 grehan

Allow the interrupt controller to be probed - this picks up the
Heathrow PIC, while not affecting the OpenPIC.


116965 28-Jun-2003 grehan

A module to handle the interrupt controller on Heathrow/Paddington
MacIO chips, found on older Mac G3's.


116964 28-Jun-2003 grehan

A module for the Motorola MPC106 system controller aka 'Grackle'
found on older Mac G3's.


113648 18-Apr-2003 grehan

Vastly simplify the macio ATA attachment, now that the register file
indirection is handled in the ATA common code.


113647 18-Apr-2003 grehan

Remove sparse addressing hack. The macio ATA driver no longer requires
this.


112428 20-Mar-2003 grehan

- Add PCI ID for Paddington i/o controller, used in old G3's
- Add ID for the Intrepid i/o controller, used in new 12"/17" PowerBooks
- put IDs in chronological order


111404 24-Feb-2003 grehan

Catch up with ATAng changes


111119 19-Feb-2003 imp

Back out M_* changes, per decision of the TRB.

Approved by: trb


110441 06-Feb-2003 benno

Oops. Include opt_ddb.h.


110439 06-Feb-2003 benno

Add a driver that attaches to the gpio node of macio and allows you to enter
DDB when the interrupt button (aka the "programmer's switch") is pressed.

This isn't unfortunately an NMI, but it's a handy way to get into DDB
quickly if needed.


110437 06-Feb-2003 benno

Add a cast to silence a warning.


110436 06-Feb-2003 benno

If a device tries to allocate an interrupt that's not on it's resource list,
assume that the child knows what it's doing and add it to the resource list.


110080 30-Jan-2003 benno

Rework of how memory resources are discovered and dealt with in macio.
- Store the OpenFirmware "reg" property in the macio ivars.
- Use a struct to define the structure of a "reg" property entry.
- Discover all memory ranges, not just the first.
- In ata_macio, manage our own range and hand out our own allocations using
bus_space_subregion.
- Fix bus_space_subregion to handle subregions of sparse maps.


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.


108994 09-Jan-2003 benno

Allocate interrupts from the resource list.


108991 09-Jan-2003 benno

- Remove the ignore list and replace it with a quirk list of sorts.
- Add a quirk type for devices whose interrupt properties are actually
attached to their children.
- Flag the "escc" (zs-alike serial controller) device as having this quirk.
- Rework the interrupt discovery code to deal with devices that have more than
one interrupt.


108981 09-Jan-2003 grehan

- remove unneeded includes
- fix big in use of rid for SYS_RES_IRQ
- catch up with ATA common code by adding lock function


103619 19-Sep-2002 grehan

Driver for the macio south bridge, and ATA cell contained within.

Approved by: benno


103618 19-Sep-2002 grehan

softc and register defs for the UniNorth chip

Approved by: benno


103617 19-Sep-2002 grehan

- probe the UniNorth chip in addition to the PCI bridges
- enable GEM ethernet cell if present
- allow sparse address mapping for devices

Approved by: benno


99724 10-Jul-2002 benno

Remove some dead code.


99723 10-Jul-2002 benno

Remove some unused includes.


99663 09-Jul-2002 benno

Driver for the Apple UniNorth Host-PCI bridge.

This is in a PowerMac-specific subdirectory as it is hoped that we will support
more than just the PowerMac platform.