summaryrefslogtreecommitdiff
path: root/sys/dev/ofw
Commit message (Collapse)AuthorAgeFilesLines
* [PowerPC] Allow traversal of oversize OF properties.Brandon Bergren2020-11-132-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In standards such as LoPAPR, property names in excess of the usual 31 characters exist. This breaks property traversal. While in IEEE 1275-1994, nextprop is defined explicitly to work with a 32-byte region of memory, using a larger buffer should be fine. There is actually no way to pass a buffer length to the nextprop call in the OF client interface, so SLOF actually just blindly overflows the buffer. So we have to defensively make the buffer larger, to avoid memory corruption when reading out long properties on live OF systems. Note also that on real-mode OF, things are pretty tight because we are allocating against a static bounce buffer in low memory, so we can't just use a huge buffer to work around this without it being wasteful of our limited amount of 32-bit physical memory. This allows a patched ofwdump to operate properly on SLOF (i.e. pseries) systems, as well as any other PowerPC systems with overlength properties. Reviewed by: jhibbits MFC after: 2 weeks Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D26669 Notes: svn path=/head/; revision=367643
* ofw: clean up empty lines in .c and .h filesMateusz Guzik2020-09-016-7/+1
| | | | Notes: svn path=/head/; revision=365185
* tty: convert tty_lock_assert to tty_assert_locked to hide lock typeKyle Evans2020-04-171-1/+1
| | | | | | | | | | | | | | | | | A later change, currently being iterated on in D24459, will in-fact change the lock type to an sx so that TTY drivers can sleep on it if they need to. Committing this ahead of time to make the review in question a little more palatable. tty_lock_assert() is unfortunately still needed for now in two places to make sure that the tty lock has not been recursed upon, for those scenarios where it's supplied by the TTY driver and possibly a mutex that is allowed to recurse. Suggested by: markj Notes: svn path=/head/; revision=360051
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (11 of many)Pawel Biernacki2020-02-241-2/+2
| | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Approved by: kib (mentor, blanket) Differential Revision: https://reviews.freebsd.org/D23636 Notes: svn path=/head/; revision=358280
* Remove sparc64 kernel supportWarner Losh2020-02-031-4/+1
| | | | | | | | | Remove all sparc64 specific files Remove all sparc64 ifdefs Removee indireeect sparc64 ifdefs Notes: svn path=/head/; revision=357455
* SPDX: update some tags with two licenses.Pedro F. Giffuni2019-12-281-1/+1
| | | | Notes: svn path=/head/; revision=356142
* Add an OFWBUS_PNP_INFO() macro for devices that hang directly off the rootIan Lepore2019-11-301-1/+2
| | | | | | | | ofwbus. Also, apply some style(9) whitespace fixing to the SIMPLEBUS_PNP_INFO() macro (no functional change). Notes: svn path=/head/; revision=355239
* ofw: ofw_reg_to_paddr: Use a 256 static array for the cellEmmanuel Vadot2019-08-071-1/+2
| | | | | | | | | | | | | Some hardware needs more than 32, bump this value. We cannot use the _alloc for of getencprop as this function is called too early in the boot before pmap is initialized and we only have 2k of stack when cninit is called. Discussed with: ian Notes: svn path=/head/; revision=350674
* Add necessary bits for Linux KPI to work correctly on powerpcJustin Hibbits2019-08-041-0/+42
| | | | | | | | | | | | | | | | | | | | | PowerPC, and possibly other architectures, use different address ranges for PCI space vs physical address space, which is only mapped at resource activation time, when the BAR gets written. The DRM kernel modules do not activate the rman resources, soas not to waste KVA, instead only mapping parts of the PCI memory at a time. This introduces a BUS_TRANSLATE_RESOURCE() method, implemented in the Open Firmware/FDT PCI driver, to perform this necessary translation without activating the resource. In addition to system KPI changes, LinuxKPI is updated to handle a big-endian host, by adding proper endian swaps to the I/O functions. Submitted by: mmacy Reported by: hselasky Differential Revision: https://reviews.freebsd.org/D21096 Notes: svn path=/head/; revision=350570
* Define macros making it easier to define bus-specific pnpinfo for FDT systems.Ian Lepore2019-05-231-3/+5
| | | | | | | | | | | Pnpinfo is bus-specific and requires the bus name. The FDTCOMPAT_PNP_INFO() macro makes it easier to define new FDT-based pnpinfo for busses other than simplebus. Differential Revision: https://reviews.freebsd.org/D20382 Notes: svn path=/head/; revision=348169
* ofw_graph: Add functions for graph bindingsEmmanuel Vadot2019-04-172-0/+230
| | | | | | | | | | | | Those functions are helpers to work on graph bindings. graphs are mostly use with video related devices. See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/graph.txt?id=4436a3711e3249840e0679e92d3c951bcaf25515 MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19877 Notes: svn path=/head/; revision=346332
* Reapply, with minor tweaks, r338025, from the original commit:Warner Losh2018-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused and easy to misuse PNP macro parameter Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Approved by: re (glen) Notes: svn path=/head/; revision=338948
* Back out r338035 until Warner is finished churning GSoC PNP patchesConrad Meyer2018-08-191-1/+1
| | | | | | | | | | I was not aware Warner was making or planning to make forward progress in this area and have since been informed of that. It's easy to apply/reapply when churn dies down. Notes: svn path=/head/; revision=338037
* Remove unused and easy to misuse PNP macro parameterConrad Meyer2018-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Notes: svn path=/head/; revision=338035
* ofw_cpu: Add support for getting cpu clock via clock propertyEmmanuel Vadot2018-07-311-3/+27
| | | | | | | | | | | | Nominal Mhz is either expressed via the clock-frequency property or can be get via the clock property that holds the cpu clock. Add support for the later. Reviewed by: nwhitehorn Differential Revision: https://reviews.freebsd.org/D16346 Notes: svn path=/head/; revision=337004
* Add missing include of sys/boot.hWarner Losh2018-07-131-0/+1
| | | | Notes: svn path=/head/; revision=336253
* Use boot_parse_* to parse command line args and retire cut-n-pasteWarner Losh2018-07-131-39/+1
| | | | | | | | | | code that was substantially identical. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D16205 Notes: svn path=/head/; revision=336245
* Attach dev.cpu nodes on powerpc SMT cores, using only the first found threadJustin Hibbits2018-06-201-4/+37
| | | | | | | | | | | | Summary: In order to use cpufreq(4), a dev.cpu attachment must be created. If the IBM property is found denoting SMT, attach only to the first thread setup, so that a cpufreq device can bind. Reviewed by: nwhitehorn Differential Revision: https://reviews.freebsd.org/D15921 Notes: svn path=/head/; revision=335442
* Check for a 'pci' prefix rather than a full match in get_addr_propsJustin Hibbits2018-06-151-1/+3
| | | | | | | | | | | | | Summary: Newer OPAL device trees, such as those on POWER9 systems, use 'pciex' for device_type, not 'pci'. Rather than enumerating all possible variants, just check for a 'pci' prefix. Reviewed by: nwhitehorn, breno.leitao_gmail.com Differential Revision: https://reviews.freebsd.org/D15817 Notes: svn path=/head/; revision=335226
* ofw_reg_to_paddr(): Fix minor typo in KASSERT messageJustin Hibbits2018-06-151-1/+1
| | | | Notes: svn path=/head/; revision=335187
* simplebus pnp: Do not generate pnp info is the bus status is not okayEmmanuel Vadot2018-06-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generating the pnp info have the side effect to include all nodes even if the status isn't "okay". That means that loading the module will load but not attach as it checks the status in the probe function. On pine64 before : root@pine64-lts:~ # devmatch -u unattached on ofwbus pnpinfo name=memory unattached on ofwbus pnpinfo name=chosen unattached on ofwbus pnpinfo name=sound_spdif compat=simple-audio-card unattached on ofwbus pnpinfo name=spdif-out compat=linux,spdif-dit unattached on simplebus pnpinfo name=dma-controller@1c02000 compat=allwinner,sun50i-a64-dma unattached on simplebus pnpinfo name=mmc@1c10000 compat=allwinner,sun50i-a64-mmc unattached on simplebus pnpinfo name=usb@1c19000 compat=allwinner,sun8i-a33-musb unattached on simplebus pnpinfo name=spdif@1c21000 compat=allwinner,sun50i-a64-spdif unattached on simplebus pnpinfo name=i2s@1c22000 compat=allwinner,sun50i-a64-i2s unattached on simplebus pnpinfo name=i2s@1c22400 compat=allwinner,sun50i-a64-i2s unattached on simplebus pnpinfo name=serial@1c28400 compat=snps,dw-apb-uart unattached on simplebus pnpinfo name=serial@1c28800 compat=snps,dw-apb-uart unattached on simplebus pnpinfo name=serial@1c28c00 compat=snps,dw-apb-uart unattached on simplebus pnpinfo name=serial@1c29000 compat=snps,dw-apb-uart unattached on simplebus pnpinfo name=i2c@1c2ac00 compat=allwinner,sun6i-a31-i2c unattached on simplebus pnpinfo name=i2c@1c2b000 compat=allwinner,sun6i-a31-i2c unattached on simplebus pnpinfo name=i2c@1c2b400 compat=allwinner,sun6i-a31-i2c unattached on ofwbus pnpinfo name=aliases unattached on ofwbus pnpinfo name=symbols All simplebus node are disabled After : root@pine64-lts:~ # devmatch -u unattached on ofwbus pnpinfo name=memory unattached on ofwbus pnpinfo name=chosen unattached on ofwbus pnpinfo name=sound_spdif compat=simple-audio-card unattached on ofwbus pnpinfo name=spdif-out compat=linux,spdif-dit unattached on simplebus pnpinfo name=dma-controller@1c02000 compat=allwinner,sun50i-a64-dma unattached on simplebus pnpinfo name=usb@1c19000 compat=allwinner,sun8i-a33-musb unattached on ofwbus pnpinfo name=aliases unattached on ofwbus pnpinfo name=symbols Reviewed by: imp (with some objection) Differential Revision: https://reviews.freebsd.org/D15770 Notes: svn path=/head/; revision=335014
* dev/ofw: Fix ofw_fdt_getprop() return values to match documentationBreno Leitao2018-06-071-5/+2
| | | | | | | | | | | | | Fix the behavior of ofw_fdt_getprop() and ofw_fdt_getprop() functions to match the documentation as the non-fdt code. Submitted by: Luis Pires <lffpires@ruabrasil.org> Reviewed by: manu, jhibbits Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D15680 Notes: svn path=/head/; revision=334790
* Use NULL for SYSINIT's last arg, which is a pointer typeEd Maste2018-05-181-1/+1
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333806
* Align OF_getencprop_alloc API with OF_getencprop and OF_getprop_allocOleksandr Tymoshenko2018-04-093-15/+27
| | | | | | | | | | | | | | | | | | | | | Change OF_getencprop_alloc semantics to be combination of malloc and OF_getencprop and return size of the property, not number of elements allocated. For the use cases where number of elements is preferred introduce OF_getencprop_alloc_multi helper function that copies semantics of OF_getencprop_alloc prior to this change. This is to make OF_getencprop_alloc and OF_getencprop_alloc_multi function signatures consistent with OF_getencprop_alloc and OF_getencprop_alloc_multi. Functionality-wise this patch is mostly rename of OF_getencprop_alloc to OF_getencprop_alloc_multi except two calls in ofw_bus_setup_iinfo where 1 was used as a block size. Notes: svn path=/head/; revision=332341
* Make OF_searchencprop signature consistent with OF_getencpropOleksandr Tymoshenko2018-04-092-2/+2
| | | | | | | | Use pcell_t* as a destination buffer argument instead of void pointer to be consistent with OF_getencprop signature. Notes: svn path=/head/; revision=332312
* Clean up OF_getprop_alloc APIOleksandr Tymoshenko2018-04-083-16/+45
| | | | | | | | | | | | | | | | | | | | OF_getprop_alloc takes element size argument and returns number of elements in the property. There are valid use cases for such behavior but mostly API consumers pass 1 as element size to get string properties. What API users would expect from OF_getprop_alloc is to be a combination of malloc + OF_getprop with the same semantic of return value. This patch modifies API signature to match these expectations. For the valid use cases with element size != 1 and to reduce modification scope new OF_getprop_alloc_multi function has been introduced that behaves the same way OF_getprop_alloc behaved prior to this patch. Reviewed by: ian, manu Differential Revision: https://reviews.freebsd.org/D14850 Notes: svn path=/head/; revision=332310
* Add api for creating resource list based on 'assigned-addresses'Marcin Wojtas2018-04-042-4/+23
| | | | | | | | | | | | | | According to device tree binding 'assigned-addresses' can refer to PCIE MMIO register space. New function ofw_bus_assigned_addresses_to_rl is provided to support it. Submitted by: Rafal Kozik <rk@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14750 Notes: svn path=/head/; revision=332016
* [ofw] fix errneous checks for OF_finddevice(9) return valueOleksandr Tymoshenko2018-03-202-2/+2
| | | | | | | | | | | | | | | OF_finddevices returns ((phandle_t)-1) in case of failure. Some code in existing drivers checked return value to be equal to 0 or less/equal to 0 which is also wrong because phandle_t is unsigned type. Most of these checks were for negative cases that were never triggered so trhere was no impact on functionality. Reviewed by: nwhitehorn MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14645 Notes: svn path=/head/; revision=331229
* ofw_fdt: Simplify parts with new libfdt methodsKyle Evans2018-02-261-38/+18
| | | | | | | | | | | | | | | | | | | 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. Reviewed by: nwhitehorn MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14225 Notes: svn path=/head/; revision=330019
* Set internal error returns for OF_peer(), OF_child(), and OF_parent() toNathan Whitehorn2018-02-191-3/+3
| | | | | | | | | | | zero, matching the IEEE 1275 standard. Since these internal error paths have never, to my knowledge, been taken, behavior is unchanged. Reported by: gonzo MFC after: 2 weeks Notes: svn path=/head/; revision=329579
* Out of an abundance of caution, NUL out the first byte in the PNPWarner Losh2018-01-281-0/+1
| | | | | | | info. Notes: svn path=/head/; revision=328520
* Remove fdt fixups for powerpc, they are no longer needed.Justin Hibbits2018-01-131-2/+2
| | | | | | | | | If a fixup really is needed, it should be fixed in u-boot, not in FreeBSD. Suggested by: nwhitehorn Notes: svn path=/head/; revision=327907
* Avoid use of the fdt_get_property_*() API, which is intrinsicallyNathan Whitehorn2017-12-301-7/+6
| | | | | | | | | incompatible with FDT versions < 16. This also simplifies the code a bit. MFC after: 1 month Notes: svn path=/head/; revision=327391
* Do pass removing some write-only variables from the kernel.Alexander Kabaev2017-12-252-7/+2
| | | | | | | | | | | | This reduces noise when kernel is compiled by newer GCC versions, such as one used by external toolchain ports. Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial) Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c) Differential Revision: https://reviews.freebsd.org/D10385 Notes: svn path=/head/; revision=327173
* Back out OF module installation in the event of failure. PS3 firmware givesNathan Whitehorn2017-11-281-0/+6
| | | | | | | | 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. Notes: svn path=/head/; revision=326310
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2713-0/+26
| | | | | | | | | | | | | | | 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
* Do not bind to CPUs with SMT, which use a different CPU numbering conventionNathan Whitehorn2017-11-251-0/+4
| | | | | | | | | that does not play well with this driver. MFC after: 2 weeks Notes: svn path=/head/; revision=326204
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-202-0/+4
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. 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. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326022
* 'private' isn't a PNP string field, so instead used the reserved '#'Warner Losh2017-10-041-1/+1
| | | | | | | | | | name for this field (it might even be possible to just drop it entirely, since it will be ignored either way). Sponsored by: Netflix Notes: svn path=/head/; revision=324280
* Enable OF_setprop API function to add property in FDTMarcin Wojtas2017-08-101-1/+5
| | | | | | | | | | | | | | | | 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. Submitted by: Patryk Duda <pdk@semihalf.com> Reviewed by: nwhitehorn, cognet (mentor) Approved by: cognet (mentor) Obtained from: Semihalf Differential Revision: https://reviews.freebsd.org/D11879 Notes: svn path=/head/; revision=322359
* Enable using ofw_bus_find_compatible in early platform codeMarcin Wojtas2017-08-091-10/+2
| | | | | | | | | | | | | | | | | | | | | | 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. Submitted by: Patryk Duda <pdk@semihalf.com> Reviewed by: nwhitehorn, cognet (mentor) Approved by: cognet (mentor) Obtained from: Semihalf Differential Revision: https://reviews.freebsd.org/D11880 Notes: svn path=/head/; revision=322289
* Add support for "compatible" parameter in ofw_fdt_fixupMarcin Wojtas2017-08-091-1/+10
| | | | | | | | | | | | | | | | 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. Submitted by: Patryk Duda <pdk@semihalf.com> Reviewed by: nwhitehorn, cognet (mentor) Approved by: cognet (mentor) Obtained from: Semihalf Differential Revision: https://reviews.freebsd.org/D11878 Notes: svn path=/head/; revision=322287
* Update comment ot reflect realilty, we know also take care of CPUs thatOlivier Houchard2017-04-201-1/+2
| | | | | | | | | provide a enable-method. Suggested by: jhibbits Notes: svn path=/head/; revision=317195
* ePAPR states that any non-boot CPU will come in "disabled" state. So we shouldOlivier Houchard2017-04-201-2/+4
| | | | | | | | | | | | 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. Reviewed by: andrew (partially) Notes: svn path=/head/; revision=317191
* Renumber copyright clause 4Warner Losh2017-02-282-2/+2
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Convert PCIe Hot Plug to using pci_request_featureWarner Losh2017-02-251-0/+1
| | | | | | | | | | | | Convert PCIe hot plug support over to asking the firmware, if any, for permission to use the HotPlug hardware. Implement pci_request_feature for ACPI. All other host pci connections to allowing all valid feature requests. Sponsored by: Netflix Notes: svn path=/head/; revision=314250
* sys/dev: Replace zero with NULL for pointers.Pedro F. Giffuni2017-02-201-1/+1
| | | | | | | | | | | Makes things easier to read, plus architectures may set NULL to something different than zero. Found with: devel/coccinelle MFC after: 3 weeks Notes: svn path=/head/; revision=313982
* Expand OpenFirmware API with ofw_bus_node_status_okayWojciech Macek2017-01-252-0/+20
| | | | | | | | | | | | | | | | | | method Method could be used before we can access device_t structure. As per simple phandle_t handle we can access FDT to check if specified node has been enabled. It will be used in Marvell's common configuration code. Submitted by: Konrad Adamczyk <ka@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: zbb, meloun-miracle-cz Differential revision: https://reviews.freebsd.org/D9218 Notes: svn path=/head/; revision=312745
* Restrict where we need to define fdt_fixup_table to just PowerPC andAndrew Turner2016-09-231-2/+11
| | | | | | | | | Marvell. Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=306267
* Add a ofw_parse_bootargs function, and use it for powerpcJustin Hibbits2016-09-212-0/+64
| | | | | | | | | | | | | | | | | Summary: If the environment variable is set, U-boot adds a 'bootargs' property to /chosen. This is already handled by ARM and MIPS, but should be handled in a central location. For now, ofw_subr.c is a good place until we determine if it should be moved to init_main.c, or somewhere more central to all architectures. Eventually arm and mips should be modified to use ofw_parse_bootargs() as well, rather than using the duplicate code already. Reviewed By: adrian Differential Revision: https://reviews.freebsd.org/D7846 Notes: svn path=/head/; revision=306065