331722 |
29-Mar-2018 |
eadler |
Revert r330897:
This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code.
Revert with prejudice.
This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes.
Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes.
Requested by: gjb (re) |
330907 |
14-Mar-2018 |
kevans |
MFC r330019: ofw_fdt: Simplify parts with new libfdt methods
libfdt now provides methods to iterate through subnodes and properties in a convenient fashion.
Replace our ofw_fdt_{peer,child} searches with calls to their corresponding libfdt methods. Rework ofw_fdt_nextprop to use the fdt_for_each_property_offset macro, making it even more obvious what it's doing.
No functional change intended. |
330906 |
14-Mar-2018 |
kevans |
MFC r329579: Set internal error returns [of some OF functions] to 0
Set internal error returns for OF_peer(), OF_child(), and OF_parent() to zero, matching the IEEE 1275 standard. Since these internal error paths have never, to my knowledge, been taken, behavior is unchanged. |
330905 |
14-Mar-2018 |
kevans |
MFC r327391: Avoid use of the fdt_get_property_*() API
[It is] intrinsically incompatible with FDT versions < 16. This also simplifies the code a bit. |
330904 |
14-Mar-2018 |
kevans |
MFC r326310: Back out OF module installation in the event of failure.
PS3 firmware gives some ancient FDT version (2) that fails the init check in OFW_FDT. It is still possible to make progress, but not while the OF layer is going crazy. |
330903 |
14-Mar-2018 |
kevans |
MFC r326204: Do not bind to CPUs with SMT
Do not bind to CPUs with SMT, which use a different CPU numbering convention that does not play well with this driver. |
330902 |
14-Mar-2018 |
kevans |
MFC r322359: Enable OF_setprop API function to add property in FDT
This patch modifies function ofw_fdt_setprop (called by OF_setprop), so that it can add property, when replacing is not possible. Adding property is needed to fixup FDT's that have missing properties. |
330901 |
14-Mar-2018 |
kevans |
MFC r322289: Enable uing ofw_bus_find_compatible in early platform code
Before this patch function ofw_bus_find_compatible was using memory allocations in order to find compatible node and the property's length. This way there was always a suited buffer for property, however this approach had also disadvantages - ofw_bus_find_compatible couldn't be used when malloc is not available, e.g. during fdt fixup stage.
In order to remove the usage limitation of ofw_bus_find_compatible(), this patch modifies the function to use ofw_bus_node_is_compatible() (instead of the one without _int suffix), which uses a fixed buffer on stack instead of dynamic allocations. |
330900 |
14-Mar-2018 |
kevans |
MFC r322287 (mw): Add support for "compatible" parameter in ofw_fdt_fixup
Sometimes it's convenient to provide fixup to many boards that use the same SoC family (eg. Marvell Armada 38x). Instead of putting multiple entries in fdt_fixup_table, use one entry which refers to all boards with given SoC. |
330899 |
14-Mar-2018 |
kevans |
MFC r317191, r317195: Don't ignore "disabled" CPUs
r317191 (cognet): ePAPR states that any non-boot CPU will come in "disabled" state. So we should not consider a "disabled" cpu as a CPU we have to ignore, and we should use them if they provide a "enable-method". While I'm there, support "ok" as well as "okay", while ePAPR only accepts "okay", linux accepts "ok" too so we can expect it to be used.
r317195 (cognet): Update comment ot reflect realilty, we know also take care of CPUs that provide a enable-method. |
330897 |
14-Mar-2018 |
eadler |
Partial merge of the SPDX changes
These changes are incomplete but are making it difficult to determine what other changes can/should be merged.
No objections from: pfg |
315221 |
14-Mar-2017 |
pfg |
MFC r313982, r314068: sys: Replace zero with NULL for pointers.
Found with: devel/coccinelle |
314506 |
01-Mar-2017 |
ian |
MFC r306262, r306267, r310021: (needed to avoid conflicts on later merges)
Remove bus_dma_get_range and bus_dma_get_range_nb on armv6. We only need this on a few earlier arm SoCs.
Restrict where we need to define fdt_fixup_table to just PowerPC and Marvell.
Add the missing void to function signatures in much of the arm code. |
308373 |
06-Nov-2016 |
jhibbits |
MFC r304970:
Check all compatible strings on uart devices in powerpc
Summary: Some device trees put "fsl,ns16650" first in the compatible list. This causes the probe code to choke, even though the device is compatible with ns16650, and has it listed later in the tree.
Reviewed by: nwhitehorn Differential Revision: https://reviews.freebsd.org/D7676 |
308333 |
05-Nov-2016 |
mmel |
MFC r304459,r305527:
r304459: INTRNG: Rework handling with resources. Partially revert r301453. - Read interrupt properties at bus enumeration time and store it into global mapping table. - At bus_activate_resource() time, given mapping entry is resolved and connected to real interrupt source. A copy of mapping entry is attached to given resource. - At bus_setup_intr() time, mapping entry stored in resource is used for delivery of requested interrupt configuration. - For MSI/MSIX interrupts, mapping entry is created within pci_alloc_msi()/pci_alloc_msix() call. - For legacy PCI interrupts, mapping entry must be created within pcib_route_interrupt() by pcib driver itself. r305527: Fix MIPS INTRNG (both FDT and non-FDT) behaviour broken by r304459 |
307347 |
15-Oct-2016 |
mmel |
MFC r302951,r302952,r304071:
r302951: OFWPCI: Improve resource handling. - add new rman for prefetchable memory. Is used only if given 'ranges' property contains prefetchable memory range. r302952: OFWPCI: Add support for NEW_PCIB. r304071: OFWPCI: Don't strip RF_ACTIVE from flags when parent bus method is called. |
307346 |
15-Oct-2016 |
mmel |
MFC r302560:
OFWPCI: Fix style(9). No functional change. |
302408 |
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
301453 |
05-Jun-2016 |
skra |
INTRNG - change the way how an interrupt mapping data are provided to the framework in OFW (FDT) case.
This is a follow-up to r301451.
Differential Revision: https://reviews.freebsd.org/D6634
|
300757 |
26-May-2016 |
ian |
Fix a typo in a comment.
|
300550 |
24-May-2016 |
loos |
Move the OFW iicbus code to dev/iicbus to stop polluting dev/ofw with unrelated code.
Discussed with: nwhitehorn (a long time ago)
|
299932 |
16-May-2016 |
andrew |
Add a pcib interface for use by interrupt controllers that need to translate the pci rid to a controller ID. The translation could be based on the 'msi-map' OFW property, a similar ACPI option, or hard-coded for hardware lacking the above options.
Reviewed by: wma Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
|
299855 |
15-May-2016 |
mmel |
OFWIICBUS: Make ofwiicbus_devclass externaly visible. It's needed for binding of iic controllers.
|
299477 |
11-May-2016 |
gonzo |
Add OF_prop_free function as a counterpart for OF_*prop_alloc
- Introduce new OF API function OF_prop_free to free memory allocated by OF_getprop_alloc and OF_getencprop_alloc. Current code just calls free(9) with M_OFWPROP memory class which assumes knowledge about OF_*prop_alloc functions' internals and leads to unneccessary code coupling
- Convert some of the free(..., M_OFWPROP) instances to OF_prop_free
Files affected by this commit are the ones I was able to test on real hardware. The rest of free(..., M_OFWPROP) instances will be handled with idividual maintainers
Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D6315
|
297392 |
29-Mar-2016 |
zbb |
Reduce OFW PCI code duplication - involves ARM, PPC and SPARC64
Import portions of the PowerPC OF PCI implementation into new file "ofwpci.c", common for other platforms. The files ofw_pci.c and ofw_pci.h from sys/powerpc/ofw no longer exist. All required declarations are moved to sys/dev/ofw/ofwpci.h. This creates a new ofw_pci_write_ivar() function and modifies some others methods. Most functions contain existing ppc implementations in the majority unchanged. Now there is no need to have multiple identical copies of methods for various architectures.
Requested by: jhibbits Reviewed by: jhibbits, marius Submitted by: Marcin Mazurek <mma@semihalf.com> Obtained from: Semihalf Sponsored by: Annapurna Labs Differential Revision: https://reviews.freebsd.org/D4879
|
297000 |
18-Mar-2016 |
jhibbits |
Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.
On some architectures, u_long isn't large enough for resource definitions. Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but type `long' is only 32-bit. This extends rman's resources to uintmax_t. With this change, any resource can feasibly be placed anywhere in physical memory (within the constraints of the driver).
Why uintmax_t and not something machine dependent, or uint64_t? Though it's possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on 32-bit architectures. 64-bit architectures should have plenty of RAM to absorb the increase on resource sizes if and when this occurs, and the number of resources on memory-constrained systems should be sufficiently small as to not pose a drastic overhead. That being said, uintmax_t was chosen for source clarity. If it's specified as uint64_t, all printf()-like calls would either need casts to uintmax_t, or be littered with PRI*64 macros. Casts to uintmax_t aren't horrible, but it would also bake into the API for resource_list_print_type() either a hidden assumption that entries get cast to uintmax_t for printing, or these calls would need the PRI*64 macros. Since source code is meant to be read more often than written, I chose the clearest path of simply using uintmax_t.
Tested on a PowerPC p5020-based board, which places all device resources in 0xfxxxxxxxx, and has 8GB RAM. Regression tested on qemu-system-i386 Regression tested on qemu-system-mips (malta profile)
Tested PAE and devinfo on virtualbox (live CD)
Special thanks to bz for his testing on ARM.
Reviewed By: bz, jhb (previous) Relnotes: Yes Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D4544
|
296901 |
15-Mar-2016 |
mmel |
Use EARLY_DRIVER_MODULE() with BUS_PASS_BUS priority for ofw_gpiobus and ofw_iicbus. This causes enumeration of gpiobus/iicbus at the base driver attach time. Due to this, childern drivers can be also attached early.
|
295837 |
20-Feb-2016 |
zbb |
Revert r295756: Extract common code from PowerPC's ofw_pci
Import portions of the PowerPC OF PCI implementation into new file "ofw_pci.c", common for other platforms. The files ofw_pci.c and ofw_pci.h from sys/powerpc/ofw no longer exist. All required declarations are moved to sys/dev/ofw/ofw_pci.h.
This creates a new ofw_pci_write_ivar() function and modifies ofw_pci_nranges(), ofw_pci_read_ivar(), ofw_pci_route_interrupt() methods. Most functions contain existing ppc implementations in the majority unchanged. Now there is no need to have multiple identical copies of methods for various architectures.
Submitted by: Marcin Mazurek <mma@semihalf.com> Obtained from: Semihalf Sponsored by: Annapurna Labs Reviewed by: jhibbits, mmel Differential Revision: https://reviews.freebsd.org/D4879
This needs to return to the drawing board as it breaks both PowerPC and Sparc64 build.
Pointed out by: jhibbits
|
295832 |
20-Feb-2016 |
jhibbits |
Introduce a RMAN_IS_DEFAULT_RANGE() macro, and use it.
This simplifies checking for default resource range for bus_alloc_resource(), and improves readability.
This is part of, and related to, the migration of rman_res_t from u_long to uintmax_t.
Discussed with: jhb Suggested by: marcel
|
295762 |
18-Feb-2016 |
zbb |
Fix build for i386 and arm64 after r295755
- Take bus_space_tag_t type into consideration when returning default, zero value. - Include missing rman.h required by ofw_pci.h
|
295756 |
18-Feb-2016 |
zbb |
Extract common code from PowerPC's ofw_pci
Import portions of the PowerPC OF PCI implementation into new file "ofw_pci.c", common for other platforms. The files ofw_pci.c and ofw_pci.h from sys/powerpc/ofw no longer exist. All required declarations are moved to sys/dev/ofw/ofw_pci.h.
This creates a new ofw_pci_write_ivar() function and modifies ofw_pci_nranges(), ofw_pci_read_ivar(), ofw_pci_route_interrupt() methods. Most functions contain existing ppc implementations in the majority unchanged. Now there is no need to have multiple identical copies of methods for various architectures.
Submitted by: Marcin Mazurek <mma@semihalf.com> Obtained from: Semihalf Sponsored by: Annapurna Labs Reviewed by: jhibbits, mmel Differential Revision: https://reviews.freebsd.org/D4879
|
295754 |
18-Feb-2016 |
zbb |
Fix bug in ofwbus_release_resource() for non-ofwbus descendants
Resource list for devices that are not ofwbus descendants, but got to ofwbus method via bus_generic_release_resource() call chain, cannot be found using BUS_GET_RESOURCE_LIST() used by ofwbus. In that case, changing device's resource list should be avoided (will not contain resource list prepared by ofw or simplebus).
Pointy-hat to: zbb Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5304
|
295662 |
16-Feb-2016 |
andrew |
Allow callers of OF_decode_addr to get the size of the found mapping. This will allow for code that uses the old fdt_get_range and fdt_regsize functions to find a range, map it, access, then unmap to replace this, up to and including the map, with a call to OF_decode_addr.
As this function should only be used in the early boot code the unmap is mostly do document we no longer need the mapping as it's a no-op, at least on arm.
Reviewed by: jhibbits Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D5258
|
295424 |
09-Feb-2016 |
adrian |
Teach ofw_bus_parse_xref_list_alloc to be able to return the length of the parsed list.
Currently, there is no easy way to know in advance how many entries a list parsed by ofw_bus_parse_xref_list_alloc() in sys/dev/ofw/ofw_bus_subr.c has.
This patch:
* teaches the existing function about handling idx == -1 and returning how big the set is; then renames it as _internal; * create a new function that asserts idx != -1, so the old API is maintained; * add a new function that returns just the list length.
Submitted by: Stanislav Galabov <sgalabov@gmail.com> Differential Revision: https://reviews.freebsd.org/D5043
|
294928 |
27-Jan-2016 |
andrew |
Fix the value we print when the size is too large. While here fix the types we cast to to be unsigned as the data is unsigned.
Reviewed by: ian
|
294927 |
27-Jan-2016 |
andrew |
When finding the physical address of a device allow intermediate addresses to be 64-bit on 32-bit architectures. It is not uncommon for device trees to use the upper 32-bits to store what effectively is an index into the parent ranges property. In this case, when running with a 32-bit bus_addr_t and bus_size_t, we would previously truncate the address, this may then incorrectly match the wrong range, and return the wrong address.
Tested by: bz (earlier version)
|
294883 |
27-Jan-2016 |
jhibbits |
Convert rman to use rman_res_t instead of u_long
Summary: Migrate to using the semi-opaque type rman_res_t to specify rman resources. For now, this is still compatible with u_long.
This is step one in migrating rman to use uintmax_t for resources instead of u_long.
Going forward, this could feasibly be used to specify architecture-specific definitions of resource ranges, rather than baking a specific integer type into the API.
This change has been broken out to facilitate MFC'ing drivers back to 10 without breaking ABI.
Reviewed By: jhb Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5075
|
294729 |
25-Jan-2016 |
zbb |
Do not destroy input buffer of the OF_getencprop() function on error
Currently when the OF_getprop() function returns with error, the caller (OF_getencprop()) still changes the buffer endiannes. This may destroy the default value passed in the input buffer if used on a Little Endian platform.
Reviewed by: mmel Submitted by: Zbigniew Bodek <zbb@semihalf.com> Obtained from: Semihalf Sponsored by: Cavium
|
294668 |
24-Jan-2016 |
andrew |
Fix the style of the reading of a nodes xref to make it readable.
|
294511 |
21-Jan-2016 |
andrew |
Remove fdt_fixup_table from architectures where it's unneeded. We only make use of fdt_fixup_table on PowerPC and ARM. As such we can remove it from other architectures as it's unneeded.
Reviewed by: nwhitehorn Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D5013
|
294440 |
20-Jan-2016 |
mmel |
OFW: Fix ofw_bus_string_list_to_array() function. Originally committed version was unfinished and didn't work at all, because I took it from the wrong WIP branch by mistake.
Approved by: kib (mentor)
|
293057 |
02-Jan-2016 |
nwhitehorn |
Make using the #address-cells property on the interrupt parent in device tree parsing opt-out rather than opt-in. All FDT-based systems as well as PowerPC systems with real Open Firmware use the CHRP-derived binding that includes it, which makes SPARC the odd man out here. Making it opt-out avoids astonishment on new platform bring up.
|
292579 |
22-Dec-2015 |
ian |
Fix the detection of IO/memory space changing across busses when the bus is not pci (and thus where, ironically, the whole situation is meaningless).
This was not an error in the original code, it was introduced during my refactoring to commonize the routine. A small change a few lines above drove the need to make this change, and the error didn't show up on the platforms I initially tested with.
|
292577 |
22-Dec-2015 |
ian |
Include machine/_bus.h so that bus_space_[tag|handle]_t will be available.
It appears that all platforms except aarch64 are getting the file via various header pollution, and ensuring _bus.h is included before any openfirmware headers in every consumer of ofw/fdt stuff seems like more of a career path than a task, so I'm taking this easy way out.
|
292555 |
21-Dec-2015 |
ian |
Implement OF_decode_addr() for arm. Move most of powerpc's implementation into a new function that other platforms can share.
This creates a new ofw_reg_to_paddr() function (in a new ofw_subr.c file) that contains most of the existing ppc implementation, mostly unchanged. The ppc code now calls the new MI code from the MD code, then creates a ppc-specific bus_space mapping from the results. The new arm implementation does the same in an arm-specific way.
This also moves the declaration of OF_decode_addr() from ofw_machdep.h to openfirm.h, except on sparc64 which uses a different function signature.
This will help all FDT platforms to set up early console access using OF_decode_addr().
|
292424 |
18-Dec-2015 |
imp |
Create a simplebus PNP info wrapper.
Differential Review: https://reviews.freebsd.org/D4517
|
292405 |
17-Dec-2015 |
andrew |
Support the variant of the interrupt-map property where the parent bus has the #address-cells property set. For this we need to read more data before the parent interrupt description.
this is only enabled on arm64 for now as it's not quite compliant with the ePAPR spec. We should use a default of 2 where the #address-cells property is missing, however this will need further testing across architectures.
Obtained from: ABT Systems Ltd Sponsored by: SoftIron Inc Differential Revision: https://reviews.freebsd.org/D4518
|
292157 |
13-Dec-2015 |
mmel |
OFW_IICBUS: Register ofw_iicbus node. The iicbus can be referenced from other nodes in DT.
Approved by: kib (mentor)
|
292156 |
13-Dec-2015 |
mmel |
OFW: Add helper functions for parsing xref based lists. By using this functions, we can parse a list of tuples, each of them holds xref and variable number of values. This kind of list is used in DT for clocks, gpios, resets ...
Discussed with: ian, nwhitehorn Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D4316
|
291648 |
02-Dec-2015 |
mmel |
OFW: Move code for searching interrupt parent into separate function. It can be used by interrupt controller drivers.
Approved by: kib (mentor)
|
290557 |
08-Nov-2015 |
andreast |
Improve r290373, do a runtime check rather than a compile time switch. I learned that the Power8 and the PS3 have a mix of OFW and FDT. Both have AIM defined. But currently they are not affected. They have no I2C devices under OFW.
This version was tested on a Quad G5 and build tested for armv6*.
Discussed with nwhitehorn@ Reviewed by: ian@
|
290373 |
04-Nov-2015 |
andreast |
Add a compile time switch to distinguish between 7-bit and 8-bit I2C address usage. The comment in the code should explain the situation.
Discussed with: ian@
|
289704 |
21-Oct-2015 |
ian |
Fix parsing of I2C addresses properties in fdt data. I2C address is represented in 7-bits format in DT files, but system expect it in 8-bit format. Also, fix two drivers that locally hack around this bug.
Submitted by: Michal Meloun <meloun@miracle.cz>
|
285957 |
28-Jul-2015 |
zbb |
Limit ofw_cpu_early_foreach() to CPUs only
On some platforms, the /cpus node contains cpu-to-cluster map which deffinitely is not a CPU node. Its presence was causing incrementing of "id" variable and reporting more CPUs available than it should. To make "id" valid, increment it only when an entry really is a CPU device.
Reviewed by: andrew Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3216
|
285865 |
25-Jul-2015 |
gonzo |
OF_getencprop_alloc shouldn't be used to get string value. If string length + 1 is not divisible by 4 this function returns NULL property value. Otherwise - string with each 4 letters inverted
|
285601 |
15-Jul-2015 |
andrew |
Fix an infinite loop when a node doesn't have an interrupt-parent property.
Submitted by: Aleksey Kuleshov <rndfax@yandex.ru> Differential Revision: https://reviews.freebsd.org/D3041
|
285551 |
14-Jul-2015 |
andrew |
Also accept "ok" to enable a device, some vendor device trees use this when they mean "okay"
|
284624 |
20-Jun-2015 |
imp |
Add ofw_bus_find_child_by_phandle, a helper routine to find a device_t child matchig a given phandle_t.
Differential Revision: https://reviews.freebsd.org/D2871
|
283503 |
25-May-2015 |
gonzo |
Rename fdt_find_child to ofw_bus_find_child. There is nothing FDT-specific in this function.
Suggested by: andrew@
|
282972 |
15-May-2015 |
br |
Provide the number of interrupt resources added to the list by using extra argument, so caller will know that.
|
282864 |
13-May-2015 |
andrew |
Use the correct node wen reading the compatible property.
|
282773 |
11-May-2015 |
andrew |
Add the ofw_bus_subr.h change missed in r282770.
|
282770 |
11-May-2015 |
andrew |
Add ofw_bus_find_compatible to find a compatible ofw node. This will be used on ARM to help find the correct node to use to start secondary CPUs as this happens before device enumeration.
|
282702 |
10-May-2015 |
loos |
Remove unnecessary code and make use of generic implementations for bus_alloc_resource(), bus_release_resource() and bus_set_resource() (bus_generic_rl_alloc_resource(), bus_generic_rl_release_resource() and bus_generic_rl_set_resource() respectively).
Do not print the resources for nomatch devices.
Use the inherited method for bus_get_resource_list() on ofw_iicbus.c.
Submitted by: jhb and Michal Meloun (D2033)
|
282674 |
09-May-2015 |
loos |
Handle IRQ resources on iicbus and ofw_iicbus.
Based on a patch submitted by Michal Meloun <meloun@miracle.cz>.
|
282480 |
05-May-2015 |
andrew |
Move the point we attach the ofw driver on arm64 to nexus.c. This will allow us to have a single place to decide to use ofw or acpi.
|
280848 |
30-Mar-2015 |
zbb |
Fix bug in xrefinfo_find() for 64-bit platforms
uintptr_t may be 64-bit on some platforms, therefore when finding xrefinfo by pointer to device the high word is being cut off due to cast to phandle_t which is 32-bit long by definition. Due to that we loose the high word of the address to compare with xi->dev's address. To fix that, first argument of xrefinfo_find() is extended to uintptr_t and is being cast to appropriate type (phandle_t) when compared.
Submitted by: Zbigniew Bodek <zbb@semihalf.com> Reviewed by: nwhitehorn Obtained from: Semihalf
|
280772 |
27-Mar-2015 |
ian |
Make simplebus a base class of ofwbus. This allows the elimination of duplicated code in the two classes, and also allows devices in FDT-based systems to declare simplebus as their parent and still work correctly when the FDT data describes the device at the root of the tree rather than as a child of a simplebus (which is common for interrupt, clock, and power controllers).
Differential Revision: https://reviews.freebsd.org/D1990 Submitted by: Michal Meloun
|
279012 |
19-Feb-2015 |
andrew |
Adda function to iterate over the cpu nodes in the OFW or FDT data. This will be used with arm64 to find which cpus to enable, and could also be used with 32-bit arm and mips for the same purpose.
Differential Revision: https://reviews.freebsd.org/D1825 Sponsored by: The FreeBSD Foundation
|
278998 |
19-Feb-2015 |
andrew |
Add support to get the cpu ID from its device driver in a generic way. This will be needed by arm64 to find the value to pass to the psci (Power State Coordination Interface) driver, among other things, used to enable cores.
Differential Revision: https://reviews.freebsd.org/D1824 Reviewed by: imp Sponsored by: The FreeBSD Foundation
|
277928 |
30-Jan-2015 |
loos |
Do not leak the OFW memory when the result does not satisfy our alignment requirement.
While here, fix style(9) issues.
|
277491 |
21-Jan-2015 |
andrew |
Update the parsing of the cpu node. We are unable to use the reg property as the cpu id on arm64 as it may use two cells. In it's place we can use the device id.
It is expected we will use the reg data on arm64 to enable cores so we still need to read and store it even if it is not yet used.
Differential Revision: https://reviews.freebsd.org/D1555 Reviewed by: nwhitehorn Sponsored by: The FreeBSD Foundation
|
277378 |
19-Jan-2015 |
andrew |
Make the clock-frequency property optional as it may not be present on FDT systems.
Sponsored by: The FreeBSD Foundation
|
277289 |
17-Jan-2015 |
nwhitehorn |
Return an appropriate error code in the case of a missing property rather than random numbers.
MFC after: 1 week
|
277257 |
16-Jan-2015 |
nwhitehorn |
Add two fake properties ("fdtbootcpu" and "fdtmemreserv") to the device tree's /chosen node to provide out-of-band header fields of the FDT. This emulation is not perfect without corresponding changes to ofw_fdt_nextprop(), but is enough to enable lookup by memory-map-parsing code.
MFC after: 1 week
|
277098 |
13-Jan-2015 |
zbb |
Introduce ofw_bus_reg_to_rl() to replace part of common bus code
Instead of reusing the same reg parsing code, create one, common function that puts reg contents to the resource list. Address cells and size cells are passed rather than acquired here so that any bus can have different default values.
Obtained from: Semihalf Reviewed by: andrew, ian, nwhitehorn Sponsored by: The FreeBSD Foundation
|
276726 |
05-Jan-2015 |
nwhitehorn |
Restore use of ofw_bus_intr_to_rl() in the pseries vdevice driver after fixing ofw_bus_intr_to_rl() to match the spec for unspecified interrupt-parent properties.
|
276514 |
01-Jan-2015 |
nwhitehorn |
The path entry for a device tree node and its name property are usually, but not always, identical. In particular, the path entry may contain a unit address that the name does not. If the FDT node does have an explicit name property, treat that as an override of the FDT path rather than ignoring it.
MFC after: 2 weeks
|
276162 |
24-Dec-2014 |
ian |
Don't assume required FDT properties are present.
|
275815 |
15-Dec-2014 |
emaste |
Use standard BSD license disclaimer text
Approved by: benno, nwhitehorn
|
275779 |
14-Dec-2014 |
rpaulo |
Move ofw_cpu.c to sys/dev/ofw so that it can be used by other architectures.
Differential Revision: https://reviews.freebsd.org/D1307 Reviewed by: jhibbits
|
274641 |
18-Nov-2014 |
ian |
Allow i2c bus speed to be configured via hints, FDT data, and sysctl.
The current support for controlling i2c bus speed is an inconsistant mess. There are 4 symbolic speed values defined, UNKNOWN, SLOW, FAST, FASTEST. It seems to be universally assumed that SLOW means the standard 100KHz rate from the original spec. Nothing ever calls iicbus_reset() with a speed of FAST, although some drivers would treat it as the 400KHz standard speed. Mostly iicbus_reset() is called with the speed set to UNKNOWN or FASTEST, and there's really no telling what any individual driver will do with those.
The speed of an i2c bus is limited by the speed of the slowest device on the bus. This means that generally the bus speed needs to be configured based on the board/system and the components within it. Historically for i2c we've configured with device hints. Newer systems use FDT data and it documents a clock-frequency property for i2c busses. Hobbyists and developers are likely to want on the fly changes. These changes provide all 3 methods, but do not require any existing drivers to change to use the new facilities.
This adds an iicbus method, iicbus_get_frequency(dev, speed) that gets the frequency for the requested symbolic speed. If the symbolic speed is SLOW or if there is no speed configured for the bus, the returned value is 100KHz, always. Otherwise, if bus speed is configured by hints, fdt, tunable, or sysctl, that speed is returned. It also adds a helper function, iicbus_init_frequency() that any bus driver subclassed from iicbus can initialize the frequency from some other source of info.
Initial driver implementations are provided for Freescale and TI.
Differential Revision: https://reviews.freebsd.org/D1174 PR: 195009
|
274249 |
07-Nov-2014 |
zbb |
Avoid panic in ofwbus caused by not released resource list entry
After resource allocation and release, resource list entry stays non-NULL. This causes panic in ofwbus_alloc_resource() on subsequent resource allocation. Clean appropriate list entry on release to avoid this.
Obtained from: Semihalf Reviewed by: ian Sponsored by: The FreeBSD Foundation
|
272109 |
25-Sep-2014 |
ian |
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, which allows specifying multiple interrupts for a node where each interrupt can have a separate interrupt-parent. The bindings for this state that the property cells contain an xref phandle to the interrupt parent followed by whatever interrupt info that parent normally expects. This leads to having a variable number of icells per interrupt in the property. For example you could have <&intc1 1 &intc2 26 9 0 &intc3 9 4>.
Differential Revision: https://reviews.freebsd.org/D803
|
271202 |
06-Sep-2014 |
ian |
When registering an association between a device and an xref phandle, create an entry in the xref list if one doesn't already exist for the given handle.
On a system that uses phandle properties, the init-time scan of the tree which builds the xref list will pre-create entries for every xref handle that exists in the data. On systems where the xref and node handles are synonymous there is no phandle property in referenced nodes, and the xref list will initialize to an empty state. In the latter case, we still need to be able to associate a device_t with an xref handle, so we create list entries on the fly as needed. Since the node and xref handles are synonymous, we have all the info needed to create a list entry at device registration time.
The downside to this change is that it basically allows on the fly creation of xref handles as synonyms of node handles, and the association of a device_t with them. Whether this is a bug or a feature is in the eye of the beholder, I guess.
|
271199 |
06-Sep-2014 |
ian |
Revert rr271190, it was based on a misunderstanding. The problem of non-existant device<->xref info needs to be handled by creating the info, which will come in a subsequent commit.
|
271190 |
06-Sep-2014 |
ian |
Add OF_xref_from_node_strict() which returns -1 if there is no xref handle for the node. The default routine returns the untranslated handle, which is sometimes useful, but sometimes you really need to know there's no entry in the xref<->node<->device translation table.
|
270975 |
02-Sep-2014 |
jhb |
Use callout(9) instead of timeout(9).
Tested by: danfe
|
270960 |
02-Sep-2014 |
ian |
Fix typo.
Pointy hat: ian
|
270958 |
02-Sep-2014 |
ian |
Add OF_xref_from_device() so that there's no need to have an intermediate call to ofw_bus_get_node() to lookup info that's already in the xreflist.
|
270953 |
01-Sep-2014 |
ian |
Create a mechanism for looking up a device_t associated with an ofw/fdt xref handle, and for registering that association. Also use the same data for faster translations between node and xref handles.
Now when fdt properties contain &othernode references, a driver can find the device instance that corresponds to &othernode, and thus can use interfaces provided by that instance.
Reviewed by: nwhitehorn
|
270945 |
01-Sep-2014 |
ian |
Rename OF_xref_phandle() to OF_node_from_xref() and add a new function that provides the inverse translation, OF_xref_from_node().
Discussed with: nwhitehorn
|
269770 |
10-Aug-2014 |
ian |
Handle various ways that interrupt config data can be malformed by warning and assuming more or less reasonable values.
|
269769 |
10-Aug-2014 |
ian |
Use a separate variable for resource id, because 'i' may increment at a rate greater than 1 on each iteration.
|
269597 |
05-Aug-2014 |
ian |
Adjust ofwbus and simplebus to attach at BUS_PASS_ORDER_MIDDLE, so that a platform can attach some other bus first if necessary.
|
269594 |
05-Aug-2014 |
ian |
Set ofwbus and simplebus to attach during BUS_PASS_BUS.
|
265888 |
11-May-2014 |
nwhitehorn |
OF_peer() in IEEE 1275 returns 0 if no peer exists, not -1.
|
265310 |
04-May-2014 |
loos |
Move gpiobus routines to dev/gpio. Avoid polluting ofw_bus with bus specific parts.
Requested by: nwhitehorn
|
265012 |
27-Apr-2014 |
loos |
Fix the gpio-specifier decoding by respecting the GPIO controller's #gpio-cells property.
Add a new ofw_bus method (OFW_BUS_MAP_GPIOS()) that allows the GPIO controller to implement its own mapping to deal with gpio-specifiers, allowing the decoding of gpio-specifiers to be controller specific.
The default ofw_bus_map_gpios() decodes the linux standard (#gpio-cells = <2>) and the FreeBSD standard (#gpio-cells = <3>).
It pass the gpio-specifier flag field to the children as an ivar variable so they can act upon.
|
261844 |
13-Feb-2014 |
loos |
Allow the use of OFW I2C bus together with iicbb(4) on OFW-based systems.
This change makes ofw_iicbus attach to iicbb(4) controllers in addition to the already supported i2c host bridges (iichb).
On iicbb(4) allow the direct access of the OFW parent node by its children, so they can be directly attached to iicbb(4) node on the DTS without the need of describing the i2c bus.
Approved by: adrian (mentor, implicit)
|
261513 |
05-Feb-2014 |
nwhitehorn |
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.
Reviewed by: imp, ian
|
261403 |
02-Feb-2014 |
nwhitehorn |
Add a set of helpers (ofw_bus_get_status() and ofw_bus_status_okay()) to process "status" properties of OF nodes.
I've avoided adding new KOBJ methods here so that we don't have to modify every ofw_bus in the tree. Since 100% of implementations of ofw_bus use only ofw_bus_gen_*(), it might be worth garbage-collecting the other methods as well.
|
261351 |
01-Feb-2014 |
nwhitehorn |
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.
|
259516 |
17-Dec-2013 |
nwhitehorn |
Simplify the ofw_bus_lookup_imap() API slightly: make it allocate maskbuf internally instead of requiring the caller to allocate it.
|
259513 |
17-Dec-2013 |
nwhitehorn |
Configure interrupt sense based on device tree information. This extends the OF interrupt map API to return sense information to the caller and the PowerPC Open Firmware PCI base driver to use it to program the PIC.
|
259398 |
14-Dec-2013 |
nwhitehorn |
Avoid warning about insecure format with clang.
|
259199 |
10-Dec-2013 |
nwhitehorn |
Return the correct IEEE 1275 code for "nextprop".
|
258805 |
01-Dec-2013 |
nwhitehorn |
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.
|
258046 |
12-Nov-2013 |
loos |
Fix a typo on a comment in ofw_bus_if.m, the default method will return -1 when a node doesn't exist.
Reviewed by: nwhitehorn Approved by: adrian (mentor)
|
257747 |
06-Nov-2013 |
nwhitehorn |
An addendum: it is possible, though of questionable utility, for a node to have no properties at all. Do the right thing in such cases.
|
257745 |
06-Nov-2013 |
nwhitehorn |
Make OF_nextprop() work correctly for FDT by using the libfdt fdt_next_property_offset() API. The old code would sometimes (e.g. on the device tree supplied by the RB800 boot loader) get confused and stop partway through listing properties.
MFC after: 1 week
|
257130 |
25-Oct-2013 |
ian |
Add a helper routine to search for a compat string in a table that associates compat strings with arbitrary values that mean something to the driver. This is handy for drivers that support several variations of similar hardware and need to know which one matched.
Reviewed by: imp, jmg, nwhitehorn
|
257118 |
25-Oct-2013 |
nwhitehorn |
Make sure to get the right node when looking up #interrupt-cells.
|
257075 |
24-Oct-2013 |
nwhitehorn |
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.
|
257055 |
24-Oct-2013 |
nwhitehorn |
interrupt-parent and #interrupt-cells are written to the tree using encode-int.
|
257016 |
23-Oct-2013 |
nwhitehorn |
Factor out MI portions of the PowerPC nexus device into /sys/dev/ofw. The sparc64 driver will be modified to use this shortly.
|
256994 |
23-Oct-2013 |
nwhitehorn |
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.
FDT integration will happen significantly later due to larger testing requirements. This patch in general also lays the groundwork for the removal of /sys/dev/fdt/fdt_ARCH.c and machine/fdt.h.
|
256967 |
23-Oct-2013 |
nwhitehorn |
Remove OF_instance_to_package() hack for FDT and replace with use of the generic OF_xref_phandle() API universally. Also replace some related explicit uses of fdt32_to_cpu() with OF_getencprop() calls.
|
256966 |
23-Oct-2013 |
nwhitehorn |
Make all Open Firmware internal interfaces endian-safe by using the new OF_getencprop() API. This removes one explicit endianness conversion in ofw_iicbus.c.
|
256953 |
23-Oct-2013 |
andreast |
Fix build.
|
256938 |
22-Oct-2013 |
nwhitehorn |
A few other common cases for encode-int decoding: OF_getencprop_alloc() and OF_searchencprop(). I thought about using the element size parameter to OF_getprop_alloc() to do endian-switching automatically, but it breaks use with structs and a *lot* of FDT code (which can hopefully be moved to these new APIs).
MFC after: 2 weeks
|
256932 |
22-Oct-2013 |
nwhitehorn |
Add a new function (OF_getencprop()) that undoes the transformation applied by encode-int. Specifically, it takes a set of 32-bit cell values and changes them to host byte order. Most non-string instances of OF_getprop() should be using this function, which is a no-op on big-endian platforms.
|
256870 |
22-Oct-2013 |
nwhitehorn |
Return standards-compliant code from OF_nextprop() with FDT when no properties remain on this node.
|
256816 |
21-Oct-2013 |
nwhitehorn |
Allow the OFW interrupt mapping code to work with PCI devices not enumerated by Open Firmware, as in the case of FDT.
|
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
|
255424 |
09-Sep-2013 |
nwhitehorn |
Make the primary name of the OF console device /dev/ofwcons, and only alias it to the contents of the output property if it is defined. This avoids a panic when booting machines (QEMU) where the output-device property is not defined.
Since output-device is free-form and potentially conflicts with other entries in /dev, I also am not sure we should be doing the aliasing at all, but this at least makes things work again.
Approved by: re (kib)
|
239366 |
18-Aug-2012 |
hrs |
- Add OF_hasprop() and ofw_bus_has_prop(). These can be used to check existence of the property.
- Fix ofw_bus_is_compatible{,_strict}() to prevent substring match in the compatible string.
Reviewed by: raj
|
239273 |
15-Aug-2012 |
gonzo |
Merging of projects/armv6, part 4
r232281: Fix byte order.
|
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
|
230631 |
27-Jan-2012 |
marius |
Implement OF_printf() using kvprintf() directly, avoiding to use a buffer and allowing to handle newlines properly
|
228631 |
17-Dec-2011 |
avg |
kern cons: introduce infrastructure for console grabbing by kernel
At the moment grab and ungrab methods of all console drivers are no-ops.
Current intended meaning of the calls is that the kernel takes control of console input. In the future the semantics may be extended to mean that the calling thread takes full ownership of the console (e.g. console output from other threads could be suspended).
Inspired by: bde MFC after: 2 months
|
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
|
227848 |
22-Nov-2011 |
marius |
s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention of kobj(9) from device drivers.
|
227537 |
15-Nov-2011 |
marius |
As it turns out, r186347 actually is insufficient to avoid the use of the curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style curthread implementation on sparc64, crashing the kernel in its early cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the things we need for that, which leads to a chicken-and-egg problem). What happens is that due to the fact that the idea of r210623 actually is to allow the compiler to cache invocations of curthread, it factors out obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to before the branch based on kobj_mutex_inited when compiling the kernel without the debugging options. So change kobj_class_compile_static(9) to just never acquire kobj_mtx, effectively restricting it to its documented use, and add a kobj_init_static(9) for initializing objects using a class compiled with the former and that also avoids using mutex(9) (and malloc(9)). Also assert in both of these functions that they are used in their intended way only. While at it, inline kobj_register_method() and kobj_unregister_method() as there wasn't much point for factoring them out in the first place and so that a reader of the code has to figure out the locking for fewer functions missing a KOBJ_ASSERT. Tested on powerpc{,64} by andreast.
Reviewed by: nwhitehorn (earlier version), jhb MFC after: 3 days
|
226466 |
17-Oct-2011 |
jchandra |
FDT changes for 64 bit kernel
Use the offset into the device tree from fdtp as the phandle instead of using pointer into the device tree. This will make sure that the phandle fits into a uint32_t type, even when compiled for 64bit.
Reviewed by: raj, nathanw, marcel
|
225214 |
27-Aug-2011 |
rwatson |
Follow up to r225203 refining break-to-debugger run-time configuration improvements:
(1) Implement new model in previously missed at91 UART driver (2) Move BREAK_TO_DEBUGGER and ALT_BREAK_TO_DEBUGGER from opt_comconsole.h to opt_kdb.h (spotted by np) (3) Garbage collect now-unused opt_comconsole.h
MFC after: 3 weeks Approved by: re (bz)
|
225203 |
26-Aug-2011 |
rwatson |
Attempt to make break-to-debugger and alternative break-to-debugger more accessible:
(1) Always compile in support for breaking into the debugger if options KDB is present in the kernel.
(2) Disable both by default, but allow them to be enabled via tunables and sysctls debug.kdb.break_to_debugger and debug.kdb.alt_break_to_debugger.
(3) options BREAK_TO_DEBUGGER and options ALT_BREAK_TO_DEBUGGER continue to behave as before -- only now instead of compiling in break-to-debugger support, they change the default values of the above sysctls to enable those features by default. Current kernel configurations should, therefore, continue to behave as expected.
(4) Migrate alternative break-to-debugger state machine logic out of individual device drivers into centralised KDB code. This has a number of upsides, but also one downside: it's now tricky to release sio spin locks when entering the debugger, so we don't. However, similar logic does not exist in other device drivers, including uart.
(5) dcons requires some special handling; unlike other console types, it allows overriding KDB's own debugger selection, so we need a new interface to KDB to allow that to work.
GENERIC kernels in -CURRENT will now support break-to-debugger as long as appropriate boot/run-time options are set, which should improve the debuggability of BETA kernels significantly.
MFC after: 3 weeks Reviewed by: kib, nwhitehorn Approved by: re (bz)
|
215120 |
11-Nov-2010 |
raj |
Return IEEE 1275 compliant error codes.
Submitted by: nwhitehorn
|
215049 |
09-Nov-2010 |
nwhitehorn |
Make all OF client interface calls return the maximum kind of does-not-exist error when no client interface module is installed instead of dereferencing NULL pointers. This eases implementation of platforms that may or may not have Open Firmware.
|
212477 |
11-Sep-2010 |
marius |
Change OF_interpret() to also take an array of cell_t (missed in r209801).
Reviewed by: nwhitehorn
|
212413 |
10-Sep-2010 |
avg |
bus_add_child: change type of order parameter to u_int
This reflects actual type used to store and compare child device orders. Change is mostly done via a Coccinelle (soon to be devel/coccinelle) semantic patch. Verified by LINT+modules kernel builds.
Followup to: r212213 MFC after: 10 days
|
209817 |
08-Jul-2010 |
nwhitehorn |
Missed a file in r209803: this header contains a definition of OFW_STD_32BIT.
Pointy hat to: me
|
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.
|
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
|
208615 |
28-May-2010 |
raj |
Initial implementation of the OFW i/f methods for FDT back-end.
Reviewed by: imp Sponsored by: The FreeBSD Foundation
|
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
|
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
|
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
|
204520 |
01-Mar-2010 |
joel |
The NetBSD Foundation has granted permission to remove clause 3 and 4 from their software.
Obtained from: NetBSD
|
194139 |
14-Jun-2009 |
marius |
Missed style fixes.
|
194138 |
14-Jun-2009 |
marius |
Fix style.
|
194025 |
11-Jun-2009 |
avg |
strict kobj signatures: some ofw_setprop fixes
propname parameter is const
Reviewed by: imp, current@ Approved by: jhb (mentor)
|
193018 |
29-May-2009 |
ed |
Last minute TTY API change: remove mutex argument from tty_alloc().
I don't want people to override the mutex when allocating a TTY. It has to be there, to keep drivers like syscons happy. So I'm creating a tty_alloc_mutex() which can be used in those cases. tty_alloc_mutex() should eventually be removed.
The advantage of this approach, is that we can just remove a function, without breaking the regular API in the future.
|
190522 |
29-Mar-2009 |
marius |
Unbreak OF_interpret() and its standard implementation after r186347.
|
189280 |
02-Mar-2009 |
nwhitehorn |
Some Apple I2C buses give the device's I2C address in a property with the name i2c-address instead of reg. Change the OFW I2C probe to check both locations for the address.
Submitted by: Marco Trillo Reported by: Justin Hibbits
|
187472 |
20-Jan-2009 |
nwhitehorn |
Set the wrong softc size when defining the ofw_iicbus class. Change it to the correct value.
|
187261 |
15-Jan-2009 |
nwhitehorn |
Import an Open Firmware I2C bus module. This attaches firmware device tree indicated I2C devices, and provides an ofw_bus interface for driver probing. This should be MI, but is currently provided only on PowerPC due to lack of sparc64 hardware with an I2C controller.
Discussed on: freebsd-arch
|
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
|
186347 |
20-Dec-2008 |
nwhitehorn |
Modularize the Open Firmware client interface to allow run-time switching of OFW access semantics, in order to allow future support for real-mode OF access and flattened device frees. OF client interface modules are implemented using KOBJ, in a similar way to the PPC PMAP modules.
Because we need Open Firmware to be available before mutexes can be used on sparc64, changes are also included to allow KOBJ to be used very early in the boot process by only using the mutex once we know it has been initialized.
Reviewed by: marius, grehan
|
186133 |
15-Dec-2008 |
nwhitehorn |
Unbreak ofwdump build by moving the pcell_t definition to after the kernel types headers, and inside the _KERNEL ifdef.
Pointy hat to: me
|
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
|
184329 |
27-Oct-2008 |
ed |
Remove unused consdev structure fields.
The cn_unit and cn_tp fields don't seem to be used anywhere. Some drivers set them, while others don't. Just remove them, in an attempt to make our consdev code a little easier to understand.
|
181905 |
20-Aug-2008 |
ed |
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to make it friendly to use. A good example is the output path, where the device drivers directly access the output buffers. This means that an in-kernel PPP implementation must always convert network buffers into TTY buffers.
If a PPP implementation would be built on top of the new TTY layer (still needs a hooks layer, though), it would allow the PPP implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from the system. This implementation has a two-step destructing design, where the driver first abandons the TTY. After all threads have left the TTY, the TTY layer calls a routine in the driver, which can be used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected to improve scalability when compared to the old Giant locking. Another change is the unbuffered copying to userspace, which is both used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions, existing kernel configuration files do not need to be changed, except when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/... Approved by: philip (ex-mentor) Discussed: on the lists, at BSDCan, at the DevSummit Sponsored by: Snow B.V., the Netherlands dcons(4) fixed by: kan
|
178766 |
04-May-2008 |
peter |
Expand kdb_alt_break a little, most commonly used with the option ALT_BREAK_TO_DEBUGGER. In addition to "Enter ~ ctrl-B" (to enter the debugger), there is now "Enter ~ ctrl-P" (force panic) and "Enter ~ ctrl-R" (request clean reboot, ala ctrl-alt-del on syscons).
We've used variations of this at work. The force panic sequence is best used with KDB_UNATTENDED for when you just want it to dump and get on with it.
The reboot request is a safer way of getting into single user than a power cycle. eg: you've hosed the ability to log in (pam, rtld, etc). It gives init the reboot signal, which causes an orderly reboot.
I've taken my best guess at what the !x86 and non-sio code changes should be.
This also makes sio release its spinlock before calling KDB/DDB.
|
177253 |
16-Mar-2008 |
rwatson |
In keeping with style(9)'s recommendations on macros, use a ';' after each SYSINIT() macro invocation. This makes a number of lightweight C parsers much happier with the FreeBSD kernel source, including cflow's prcc and lxr.
MFC after: 1 month Discussed with: imp, rink
|
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.
|
174802 |
20-Dec-2007 |
marius |
In openprom_ioctl() ensure appropriate permissions and that data isn't NULL and doesn't point to a NULL pointer before dereferencing it. This fixes a panic triggered by Xorg 7.3.
Reported and tested by: Bill Green MFC after: 3 days
|
172836 |
20-Oct-2007 |
julian |
Rename the kthread_xxx (e.g. kthread_create()) calls to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first.
I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
|
171265 |
06-Jul-2007 |
peter |
Fix warnings. nxge: cast page size fragments down to (int). If the vm's demand paging PAGE_SIZE is ever too big for that, we've got far bigger problems. ofw: move va_start() a little earlier. gcc-4.2 doesn't like us modifying the last arg before the va_start().
Approved by: re (rwatson)
|
170842 |
16-Jun-2007 |
marius |
In OF_init() check the return value of OF_getprop().
Found with: Coverity Prevent(tm) CID: 679
|
170841 |
16-Jun-2007 |
marius |
- Restore the machine independency of sys/dev/ofw/openfirm.{c,h} by moving OF_set_mmfsa_traptable() (SUNW,set-trap-table with the two arguments used here is specific to sun4v) to MD code. - In sys/dev/ofw/openfirm.h remove prototypes for unimplemented functions and unused Solaris compatibility macros.
|
170838 |
16-Jun-2007 |
marius |
Sync the styles of sys/boot/ofw/libofw/openfirm.c and sys/dev/ofw/openfirm.c with themselves, with each-other and with style(9).
|
164049 |
06-Nov-2006 |
rwatson |
Add missing includes of priv.h.
|
164033 |
06-Nov-2006 |
rwatson |
Sweep kernel replacing suser(9) calls with priv(9) calls, assigning specific privilege names to a broad range of privileges. These may require some future tweaking.
Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
|
163221 |
11-Oct-2006 |
kmacy |
Using the ptr defines broke the powerpc build - convert set_mmfsa to the same convention as the rest of openfirm.c
|
163146 |
09-Oct-2006 |
kmacy |
kernel clean up to make the sun4v kernel build
Reviewed by: jmg Approved by: rwatson (mentor)
|
161836 |
01-Sep-2006 |
marius |
Fix spelling and wording in a comment.
|
159065 |
30-May-2006 |
phk |
Fix various typos and brainos in last commit.
Submmited by: Andrew Turner <andrew@fubar.geek.nz>
|
158964 |
26-May-2006 |
phk |
Update to new console api.
|
152683 |
22-Nov-2005 |
marius |
- Add a new method ofw_bus_default_get_devinfo() that allows to retrieve a newly introduced struct ofw_bus_devinfo which can hold the OFW info of a device recallable via the ofw_bus KOBJ interface. Introduce a set of functions ofw_bus_gen_get_*() which use ofw_bus_default_get_devinfo() to provide generic subroutines for implementing the rest of the ofw_bus KOBJ interface in a bus driver. This is inspired by bus_get_resource_list() and bus_generic_rl_*_resource() and allows to reduce code duplication in bus drivers as they only have to provide an ofw_bus_default_get_devinfo() implementation in order to provide the ofw_bus KOBJ interface via ofw_bus_gen_get_*(). - While here add a comment to ofw_bus_if.m describing the intention of the ofw_bus KOBJ interface.
Reviewed by: marcel
|
152682 |
22-Nov-2005 |
marius |
Remove unused function and variables.
|
151894 |
31-Oct-2005 |
grehan |
The mediasize shouldn't be multipled by the sector size when it was in bytes to start off with. This caused the GPT geom sniffer to attempt a seek just back from the end of the 'disk', which resulted in a > 4G seek, causing gdb psim to exit since it only supports 32-bit seeks.
The size of the disk should really be specified in the psim device tree, but for now do the minimal amount of work to get psim to run again.
|
151388 |
16-Oct-2005 |
phk |
Make ttyconsolemode() call ttsetwater() so that drivers don't have to.
|
146401 |
19-May-2005 |
marius |
Sync with openfirm(4) and check the return value of malloc() although this isn't exactly necessary with M_WAITOK.
|
146400 |
19-May-2005 |
marius |
Update the names of some member variables in comments to refect reality. Apparently this was forgotten when this code was derived from the BSD openprom(4).
|
141752 |
12-Feb-2005 |
marius |
Merge revision 1.5 from NetBSD: Fix a typo in a comment. NetBSD rev. 1.4 (addition of the OFW_PCI_PHYS_HI_BUS macro) had already been merged prior to adding this file to FreeBSD (with the 1.3 tag though).
|
139749 |
06-Jan-2005 |
imp |
Start each of the license/copyright comments with /*-, minor shuffle of lines
|
139372 |
28-Dec-2004 |
grehan |
Don't probe for a disk unless explicitly enabled by a tunable. This allows boot to proceed on a real system until the issue of calling back into certain OpenFirmware calls (e.g. finddevice) in thread context is understood.
(this commit only affects psim users, of which I think I am the only one...)
|
139100 |
21-Dec-2004 |
grehan |
GEOMify the OFW disk driver. Code taken unashamedly from the preload case in dev/md/md.c.
|
136680 |
18-Oct-2004 |
phk |
Add new function ttyinitmode() which sets our systemwide default modes on a tty structure.
Both the ".init" and the current settings are initialized allowing the function to be used both at attach and open time.
The function takes an argument to decide if echoing should be enabled. Echoing should not be enabled for regular physical serial ports unless they are consoles, in which case they should be configured by ttyconsolemode() instead.
Use the new function throughout.
|
136454 |
12-Oct-2004 |
phk |
Add a couple of XXX comments and fix a couple of fine points.
I have not tried to make this a "canonical tty driver".
|
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
|
133096 |
04-Aug-2004 |
gad |
Fix problems with the OFW console which happen when the system goes into single-user mode (as seen on sparc64 and PPC). Problems were due to a minor oversight in the changes committed in revision 1.25.
Submitted by: grehan Tested by: gad & yongari
|
132226 |
15-Jul-2004 |
phk |
Preparation commit for the tty cleanups that will follow in the near future:
rename ttyopen() -> tty_open() and ttyclose() -> tty_close().
We need the ttyopen() and ttyclose() for the new generic cdevsw functions for tty devices in order to have consistent naming.
|
132199 |
15-Jul-2004 |
phk |
Do a pass over all modules in the kernel and make them return EOPNOTSUPP for unknown events.
A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
|
131916 |
10-Jul-2004 |
marcel |
Update for the KDB framework: o Make debugging code conditional upon KDB instead of DDB. o Call kdb_alt_break() instead of db_alt_break(). o Call kdb_enter() instead of breakpoint().
|
131103 |
25-Jun-2004 |
grehan |
- set resid correctly so that a failed seek (e.g. end of file) returns correctly - included required <sys/module.h>
|
131016 |
24-Jun-2004 |
obrien |
Better OFW console support on Sun Ultra2 machines. Ultra2 users may want to set OFWCONS_POLL_HZ to a value of '20'. I have left default value at '4' as higher values can consume a more than is acceptable amount of CPU, and we don't have a consensus yet what is an optimal value.
Submitted by: Pyun YongHyeon <yongari@kt-is.co.kr>
|
130585 |
16-Jun-2004 |
phk |
Do the dreaded s/dev_t/struct cdev */ Bump __FreeBSD_version accordingly.
|
130323 |
10-Jun-2004 |
marius |
Remove second <sys/cdefs.h> and __FBSDID.
|
130077 |
04-Jun-2004 |
phk |
Machine generated patch which changes linedisc calls from accessing linesw[] directly to using the ttyld...() functions
The ttyld...() functions ar inline so there is no performance hit.
|
129944 |
01-Jun-2004 |
phk |
Gainfully employ the new ttyioctl in the trivial cases.
|
129588 |
22-May-2004 |
marius |
- Rearrange a comment to fit in 80 chars per line, like the rest of this file. - Remove a superfluous ';'.
|
129587 |
22-May-2004 |
marius |
- Move OFW_NAME_MAX, used as a limit for OFW property names and device identifiers, to openfirmio.h as OFIOCMAXNAME, so programs can use it for buffer sizes etc. Note: Although this is only a rough upper limit to make the code more robust and to prevent the allocation of ridiculous amounts of memory, the current limit of one page (8191 + '\0' in openfirm_getstr()) still appears a bit high. The maximum length of OFW property names is 31. I didn't find a maximum length for the device identifiers in the OFW documentation but it certainly is much smaller than 8191, too. - Enable the OFIOCSET ioctl, i.e. move it out from under #if 0. - Don't use openfirm_getstr() for the property value in OFIOCSET, there are also properties whose values aren't strings and it makes sense to use a different maximum length for property values than OFW_NAME_MAX/ OFIOCMAXNAME. The maximum accepted property value is defined in openfirmio.h as OFIOCMAXVALUE (currently the maximum size of the value of the nvramrc property). - Make OFIOCSET not return EINVAL when OF_setprop() returns a different length for the written value than it was told to write, this is normal for the text string values of the properties in the OFW /options node. Instead, only return EINVAL if OF_setprop() returned -1 (value could not be written or property could not be created). Add a comment about the specialty of the OFW /options node. - Make OFIOCSET return the length of the written value returned by OF_setprop(), just like OF_getprop() does. Quite useful, at least for debugging.
Reviewed by: tmm
|
128019 |
07-Apr-2004 |
imp |
Remove advertising clause from University of California Regent's license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson.
Approved by: core, peter, alc, rwatson
|
126080 |
21-Feb-2004 |
phk |
Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION.
Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
|
126078 |
21-Feb-2004 |
phk |
Device megapatch 3/6:
Add missing D_TTY flags to various drivers.
Complete asserts that dev_t's passed to ttyread(), ttywrite(), ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty pointer.
Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default cdevsw methods for D_TTY drivers and remove the explicit initializations in various drivers cdevsw structures.
|
126076 |
21-Feb-2004 |
phk |
Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.
A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number.
|
125975 |
18-Feb-2004 |
phk |
Change the disk(9) API in order to make device removal more robust.
Previously the "struct disk" were owned by the device driver and this gave us problems when the device disappared and the users of that device were not immediately disappearing.
Now the struct disk is allocate with a new call, disk_alloc() and owned by geom_disk and just abandonned by the device driver when disk_create() is called.
Unfortunately, this results in a ton of "s/\./->/" changes to device drivers.
Since I'm doing the sweep anyway, a couple of other API improvements have been carried out at the same time:
The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to DISKFLAG_NEEDSGIANT
A version number have been added to disk_create() so that we can detect, report and ignore binary drivers with old ABI in the future.
Manual page update to follow shortly.
|
125435 |
04-Feb-2004 |
grehan |
- add an identify method, since the disk device used to be picked up in the recursive OpenFirmware node walk. Rely on the psim config file to have a "ofwdisk" device alias - minor white space nits
|
123543 |
15-Dec-2003 |
grehan |
- The last change conflicted with disks on a live system, as opposed to the psim simulator. Look for the "file" property which only exists on psim disks, and as a bonus, print the contents of this at boot-time, which is the host file being used for the disk image. - remove remaining warnings.
|
123490 |
12-Dec-2003 |
grehan |
- accept device_type of "block", which is how psim/gdb6.0 defines disks. continue to accept "disk" for psim/gdb5.x users. - remove unneeded ofwd_identify
|
121209 |
18-Oct-2003 |
phk |
Use bio_offset instead of bio_blkno
|
120544 |
28-Sep-2003 |
jake |
Only create the ofwcons device nodes if it has been initialized, not just probed.
|
120542 |
28-Sep-2003 |
jake |
Make ofw_console a low priority console device, so that uart will be preferred in all cases, even if the "remote" bit is not set.
|
120506 |
27-Sep-2003 |
phk |
The present defaults for the open and close for device drivers which provide no methods does not make any sense, and is not used by any driver.
It is a pretty hard to come up with even a theoretical concept of a device driver which would always fail open and close with ENODEV.
Change the defaults to be nullopen() and nullclose() which simply does nothing.
Remove explicit initializations to these from the drivers which already used them.
|
120491 |
26-Sep-2003 |
phk |
OK, I messed up /dev/console with what I had hoped would be compat code. Convert remaining console drivers and hope for the best.
|
120467 |
26-Sep-2003 |
phk |
Initialize the cn_name instead of the cn_dev
|
119418 |
24-Aug-2003 |
obrien |
Use __FBSDID(). Also some minor style cleanups.
|
116551 |
19-Jun-2003 |
jake |
Add a solaris compatible ofw interface for third party software that expects one to use. Only the functions used by XFree86 are actually implemented.
Glanced at by: tmm
|
116210 |
11-Jun-2003 |
tmm |
- Add an OFIOCGETPROPLEN ioctl() to get the length of a property. - Do not use a fixed major. - Minor cleanups.
|
115973 |
07-Jun-2003 |
jake |
Implement OF_interpret.
Obtained from: netbsd
|
113038 |
03-Apr-2003 |
obrien |
Use __FBSDID rather than rcsid[].
|
113020 |
03-Apr-2003 |
des |
<sys/disk.h> -> <geom/geom_disk.h>
|
111979 |
08-Mar-2003 |
phk |
Centralize the devstat handling for all GEOM disk device drivers in geom_disk.c.
As a side effect this makes a lot of #include <sys/devicestat.h> lines not needed and some biofinish() calls can be reduced to biodone() again.
|
111815 |
03-Mar-2003 |
phk |
Gigacommit to improve device-driver source compatibility between branches:
Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values.
This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386.
Approved by: re(scottl)
|
111340 |
23-Feb-2003 |
phk |
NO_GEOM cleanup:
Move to "struct disk *" centered API.
Fix some minor nits.
|
111194 |
20-Feb-2003 |
phk |
Change the console interface to pass a "struct consdev *" instead of a dev_t to the method functions.
The dev_t can still be found at struct consdev *->cn_dev.
Add a void *cn_arg element to struct consdev which the drivers can use for retrieving their softc.
|
111119 |
19-Feb-2003 |
imp |
Back out M_* changes, per decision of the TRB.
Approved by: trb
|
110509 |
07-Feb-2003 |
harti |
Implement the ALT_BREAK_TO_DEBUGGER option for the ofw console. This is very handy if the machine is on another floor. A minor issue with this is that these functions are also used by the debugger, so its possible to break into the debugger from the debugger.
PR: sparc64/47143 Reviewed by: benno Approved by: jake (mentor)
|
109921 |
27-Jan-2003 |
jake |
Change ofwcons to use the output-device property from the firmware for the name of the device that it creates. Update /etc/ttys accordingly.
An alias is created for the old name so that old /etc/ttys will continue to work, but due to aliases being implemented as symlinks in devfs you cannot login as root when using the alias device.
Discussed with: grehan
|
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.
|
107044 |
18-Nov-2002 |
jake |
Create the ofwcons device at SI_SUB_CONFIGURE instead of SI_SUB_DRIVERS, after configure() has run. Only create the device if ofwcons is the highest priority console. Make a dev alias with the same name as the firmware output-device property.
|
105398 |
18-Oct-2002 |
tmm |
Add a pseudo device which allows to access the OpenFirmware device tree via ioctl()s. This was ported from NetBSD and adapted a bit to better match our OpenFirmware support code.
|
105397 |
18-Oct-2002 |
tmm |
Add an #ifdef _KERNEL to make it possible to include this file from userland (to get the typedefs).
|
103723 |
20-Sep-2002 |
grehan |
Add missing semicolon
|
103714 |
20-Sep-2002 |
phk |
(This commit touches about 15 disk device drivers in a very consistent and predictable way, and I apologize if I have gotten it wrong anywhere, getting prior review on a patch like this is not feasible, considering the number of people involved and hardware availability etc.)
If struct disklabel is the messenger: kill the messenger.
Inside struct disk we had a struct disklabel which disk drivers used to communicate certain metrics to the disklayer above (GEOM or the disk mini-layer). This commit changes this communication to use four explicit fields instead.
Amongst the benefits is that the fields do not get overwritten by wrong or bogus on-disk disklabels.
Once that is clear, <sys/disk.h> which is included in the drivers no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in, the few places that needs them, have gotten explicit #includes for them.
The disklabel inside struct disk is now only for internal use in the disk mini-layer, so instead of embedding it, we malloc it as we need it.
This concludes (modulus any mistakes) the series of disklabel related commits.
I belive it all amounts to a NOP for all the rest of you :-)
Sponsored by: DARPA & NAI Labs.
|
94749 |
15-Apr-2002 |
benno |
Basic OpenFirmware disk driver. It will attach to anything in OpenFirmware that declares itself to be a disk, which may be the wrong thing to do in the long term but it works well enough to attach to emulated disks in the PowerPC simulator in gdb now that they have the proper device_type property.
|
93593 |
01-Apr-2002 |
jhb |
Change the suser() API to take advantage of td_ucred as well as do a general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag.
Discussed on: smp@
|
89115 |
09-Jan-2002 |
jake |
Move the make_dev call from the cn_probe to a sysinit that runs at SI_SUB_DRIVERS. cnprobe is too early.
|
88792 |
01-Jan-2002 |
jake |
1. Lower the poll timeout for the ofw console driver from hz / 50 to hz / 4. This gives a bit of a sluggish console, but it prevents the console from getting stuck if we poll too fast, as well as other badness on certain machines. 2. Fix a test for != 0 that should have been > 0.
Noticed by: Jamey Wood <Jamey.Wood@Sun.COM> and myself Submitted by: tmm (2)
|
86557 |
18-Nov-2001 |
tmm |
1. Add ofw_pci.h with definitions for the OpenFirmware PCI bindings 2. Add OF_getprop_alloc(), a helper function that will malloc() a sufficient amount of memory and then retrieve a property value into it.
Approved by: benno Obtained from: NetBSD (1)
|
83366 |
12-Sep-2001 |
julian |
KSE Milestone 2 Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process.
Sorry john! (your next MFC will be a doosie!)
Reviewed by: peter@freebsd.org, dillon@freebsd.org
X-MFC after: ha ha ha ha
|
80697 |
31-Jul-2001 |
jake |
Make the openfirmware functions work on 64 bit architectures by using a standard cell_t type for the fields of all argument structs. Also make ihandle_t and phandle_t unsigned to avoid sign extension problems.
Approved by: benno
|
80696 |
31-Jul-2001 |
jake |
Quiet uninitialized variable warning (also a bug).
|
78877 |
27-Jun-2001 |
benno |
Bracket this file in the usual #ifndef/#define/#endif stuff to prevent multiple inclusion.
|
78876 |
27-Jun-2001 |
benno |
Garbage collect some debug code.
|
78346 |
16-Jun-2001 |
benno |
OpenFirmware kernel support, as used by the PowerPC and hopefully other ports later on.
This includes the basic MI interface routines as well as a console driver. The MD code is kept in the MD directories.
Reviewed by: obrien
|
68548 |
10-Nov-2000 |
benno |
OpenFirmware/PowerPC loader, part 2.
As of this patchset, the loader builds (under NetBSD/macppc), boots, interacts and talks to BOOTP/NFS servers.
(main.c was moved from boot/ofw/libofw to boot/ofw/common but has no revision history)
Reviewed by: obrien
|
67204 |
16-Oct-2000 |
obrien |
"Ok, my loader's now up to putting up a prompt. It probes disks partially but can't boot from them yet."
Thanks to Stephane Potvin for the some of the code in this set.
Submitted by: Benno Rice <benno@jeamland.net>
|