aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/powermac_nvram/powermac_nvram.c
Commit message (Collapse)AuthorAgeFilesLines
* chore: replace {0, 0} with {DEV,KOBJ}METHOD_ENDEnji Cooper11 days1-1/+1
| | | | | | | | | | | | | | Both of the aforementioned macros have been present in FreeBSD for well over a decade: 2009 for `KOBJMETHOD_END`; 2011 for `DEVMETHOD_END`. Adapt all hardcoded references of `{0, 0}` with `DEVMETHOD_END` and `KOBJMETHOD_END` as appropriate. This helps ensure that future adaptations to drivers following patterns documented in driver(9) can be made more easily/without issue. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D55414
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* powerpc_nvram: Fix a bug in the adler32 checksum.John Baldwin2022-10-031-1/+1
| | | | | | | | | | | | | | | | | The Adler32 digest consists of two 16-bit words whose values are calculated modulo 65521 (largest prime < 2^16). To avoid two division instructions per byte, this version copies an optimization found in zlib which defers the modulus until close to the point that the intermediate sums can overflow 2^32. (zlib uses NMAX == 5552 for this, this version uses 5000) The bug is that in the deferred modulus case, the modulus was only applied to the high word (and twice at that) but not to the low word. The fix is to apply it to both words. Reviewed by: jhibbits Reported by: Miod Vallat <miod@openbsd.org> Differential Revision: https://reviews.freebsd.org/D36798
* pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t.John Baldwin2022-09-221-11/+11
| | | | | | | | This matches the return type of pmap_mapdev/bios. Reviewed by: kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36548
* powermac_nvram: Remove unused devclass argument to DRIVER_MODULE.John Baldwin2022-05-101-3/+1
|
* powermac_nvram: Actually return EBUSY on error from open.John Baldwin2022-04-121-1/+1
|
* powermac_nvram: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-2/+1
| | | | Notes: svn path=/head/; revision=365177
* [PowerPC] De-giant powermac_nvram, update documentationBrandon Bergren2020-06-191-3/+30
| | | | | | | | | | | | * Remove the giant lock requirement from powermac_nvram. * Update manual pages to reflect current state. Reviewed by: bcr (manpages), jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D24812 Notes: svn path=/head/; revision=362406
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-1/+3
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Move Open Firmware device root on PowerPC, ARM, and MIPS systems toNathan Whitehorn2014-02-051-1/+1
| | | | | | | | | | | 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. Reviewed by: imp, ian Notes: svn path=/head/; revision=261513
* "nvram,flash" may not be the first in the compatible list property of theJustin Hibbits2012-05-201-1/+2
| | | | | | | | | | nvram ofw node, so check all strings in the list. Approved by: nwhitehorn (mentor) MFC after: 3 days Notes: svn path=/head/; revision=235678
* Add support for the Sharp/Micron flash chips to powermac_mvram(4).Alexander Motin2010-09-051-6/+104
| | | | | | | | | Tested on PowerMac G4 AGP. Reviewed by: nwhitehorn Notes: svn path=/head/; revision=212240
* Use si_drv1 instead of dev2unit() in powermac_nvram.Ed Schouten2009-04-141-15/+5
| | | | | | | Reviewed by: nwhitehorn Notes: svn path=/head/; revision=191058
* Add support for 64-bit PowerPC CPUs operating in the 64-bit bridge modeNathan Whitehorn2009-04-041-4/+10
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=190681
* Convert PowerPC AIM PCI and nexus busses to standard OFW bus interface. ThisNathan Whitehorn2008-10-141-7/+5
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=183882
* Replace all calls to minor() with dev2unit().Ed Schouten2008-09-271-1/+1
| | | | | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib Notes: svn path=/head/; revision=183397
* Redefine bus_space_tag_t on PowerPC from a 32-bit integral toMarcel Moolenaar2007-12-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=174782
* Add device to access and modify Open Firmware NVRAM settings inMaxim Sobolev2006-08-011-0/+423
PowerPC-based Apple's machines and small utility to do it from userland modelled after the similar utility in Darwin/OSX. Only tested on 1.25GHz G4 Mac Mini. MFC after: 1 month Notes: svn path=/head/; revision=160892