aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fdt/fdt_common.h
Commit message (Collapse)AuthorAgeFilesLines
* Increase the number of fdt memory regions we support to 16. Some SoCs haveAndrew Turner2018-05-291-1/+1
| | | | | | | | | | | many excluded regions causing a buffer overflow in the early boot code if this value is too small. Obtained from: ABT Systems Ltd Sponsored by: Turing Robotic Industries Notes: svn path=/head/; revision=334341
* Handle reserved memory with the no-map property.Andrew Turner2018-05-221-0/+1
| | | | | | | | | | | | | We shouldn't be mapping this memory, so we need to find it so it can be excluded from the phys_avail map. Reviewed by: manu Obtained from: ABT Systems Ltd Sponsored by: Turing Robotic Industries Differential Revision: https://reviews.freebsd.org/D15518 Notes: svn path=/head/; revision=334056
* Move fdt_is_type to be a Marvell specific function. It's not used by anyAndrew Turner2018-04-081-1/+0
| | | | | | | | | other SoCs. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=332274
* Remove fdt_pm_is_enabled as it's Marvell specific. Replace the only call toAndrew Turner2018-04-041-2/+0
| | | | | | | | | it with a call to the helper function fdt_pm_is_enabled would call. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=332026
* Remove fdt_is_enabled, fdt_reg_to_rl, and fdt_get_unit. These are not usedAndrew Turner2018-04-031-3/+0
| | | | | | | | | by anything in the tree. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=331925
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | 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
* Make fdt_pm_mask_table internal to the Marvell code, it's unued anywhereAndrew Turner2017-01-261-6/+0
| | | | | | | | | else. Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=312813
* Make fdt_is_compatible a static function. It's only used in fdt_common.c.Andrew Turner2016-11-191-1/+0
| | | | | | | Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=308830
* Add hw.fdt sysctl node.Stephen J. Kiernan2016-08-061-0/+3
| | | | | | | | | | | | | Make FDT blob available via opaque hw.fdt.dtb sysctl, if a DTB has been installed by the time sysctls are registered. Reviewed by: andrew Approved by: sjg (mentor) Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D7411 Notes: svn path=/head/; revision=303803
* Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machineAndrew Turner2016-04-151-1/+1
| | | | | | | | | | independent code that needs to know about INTRNG such as PCI drivers. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=298068
* ARM: Parse command line delivered by U-Boot:Michal Meloun2016-03-261-0/+1
| | | | | | | | | | | | | | | | - in atags - in DT blob (by using 'fdt chosen' U-Boot command) The command line must start with guard's string 'FreeBSD:' and can contain list of comma separated kenv strings. Also, boot modifier strings from boot.h are recognised and parsed into boothowto. The command line must be passed from U-Boot by setting of bootargs variable: 'setenv bootargs FreeBSD:boot_single=1,vfs.root.mountfrom=ufs:/dev/ada0s1a' followed by 'fdt chosen' (only for DT based boot) Notes: svn path=/head/; revision=297286
* Make the memory size returned from fdt_get_mem_regions a 64-bit type. ThisAndrew Turner2016-03-011-1/+1
| | | | | | | | | | | | | is the physical memory size so may be larger than a u_long can hold, e.g. on ARM with LPAE we could see an address space of up to 40 bits. On ARM u_long is only 32 bits so the memory size will be truncated, possibly to zero. Reported by: bz Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=296265
* Fix fdt_get_mem_regions() to work with 64-bit addressesWojciech Macek2016-02-291-1/+1
| | | | | | | | | | | | | | | Use u_long instead of uint32_t variables to avoid overflow in case of PA space bigger than 32-bit. Obtained from: Semihalf Submitted by: Michal Stanek <mst@semihalf.com> Sponsored by: Annapurna Labs Approved by: cognet (mentor) Reviewed by: andrew, br, wma Differential revision: https://reviews.freebsd.org/D5393 Notes: svn path=/head/; revision=296189
* Only define fdt_pic_table on arm, and when not using intrng as this isAndrew Turner2016-01-221-0/+2
| | | | | | | the only place that uses it. Notes: svn path=/head/; revision=294562
* Remove fdt_fixup_table from architectures where it's unneeded. We only makeAndrew Turner2016-01-211-0/+2
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=294511
* Rename fdt_find_child to ofw_bus_find_child. There is nothing FDT-specificOleksandr Tymoshenko2015-05-241-1/+0
| | | | | | | | | in this function. Suggested by: andrew@ Notes: svn path=/head/; revision=283503
* Add helper method fdt_find_child to make access to child nodes easier.Oleksandr Tymoshenko2015-05-221-0/+1
| | | | | | | | | Some FDT nodes have complex properties organized as a child sub-nodes (e.g. timing for LCD panel) we need easy way to obtain handles for these sub-nodes Notes: svn path=/head/; revision=283275
* Eliminate fdt_data_verify(). The verification it proceed is wrongRuslan Bukin2014-12-151-2/+0
| | | | | | | | | disallowing us to encode 64-bit register numbers. Discussed with: nwhitehorn, andrew Notes: svn path=/head/; revision=275792
* Replace multiple nearly-identical copies of code to walk through an FDTIan Lepore2014-09-251-1/+0
| | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=272109
* Add a helper routine to depth-search the device tree for a node with aIan Lepore2014-02-161-0/+1
| | | | | | | | | | matching 'compatible' property. This probably has a short half-life (as do most of the fdt_ functions), but it helps solve some near-term needs until we work out the larger problems of device instantiation order versus the order of things in the fdt data. Notes: svn path=/head/; revision=261955
* Remove dev/fdt/fdt_pci.c, which was code specific to Marvell ARM SoCs,Ian Lepore2014-01-051-9/+0
| | | | | | | | | related to setting up static device mappings. Since it was only used by arm/mv/mv_pci.c, it's now just static functions within that file, plus one public function that gets called only from arm/mv/mv_machdep.c. Notes: svn path=/head/; revision=260340
* Retire machine/fdt.h as a header used by MI code, as its function is nowNathan Whitehorn2014-01-051-1/+0
| | | | | | | | | | | | | | | | | | obsolete. This involves the following pieces: - Remove it entirely on PowerPC, where it is not used by MD code either - Remove all references to machine/fdt.h in non-architecture-specific code (aside from uart_cpu_fdt.c, shared by ARM and MIPS, and so is somewhat non-arch-specific). - Fix code relying on header pollution from machine/fdt.h includes - Legacy fdtbus.c (still used on x86 FDT systems) now passes resource requests to its parent (nexus). This allows x86 FDT devices to allocate both memory and IO requests and removes the last notionally MI use of fdtbus_bs_tag. - On those architectures that retain a machine/fdt.h, unused bits like FDT_MAP_IRQ and FDT_INTR_MAX have been removed. Notes: svn path=/head/; revision=260327
* Reimplement fdt_intr_to_rl() in terms of OFW_BUS_MAP_INTR() andNathan Whitehorn2014-01-041-2/+1
| | | | | | | | OFW_BUS_CONFIG_INTR(). This function is only used by simplebus, so will likely be moved there in the future. Notes: svn path=/head/; revision=260282
* Remove dead code. Most of this was in an #if 0 block; the rest is notNathan Whitehorn2013-12-171-10/+0
| | | | | | | used and duplicates functionality in dev/ofw. Notes: svn path=/head/; revision=259514
* MFP4: 223121 (FDT infrastructure portion)Brooks Davis2013-10-211-0/+7
| | | | | | | | | | | | | Implement support for interrupt-parent nodes in simplebus. The current implementation requires that device declarations have an interrupt-parent node and that it point to a device that has registered itself as a interrupt controller in fdt_ic_list_head and implements the fdt_ic interface. Sponsored by: DARPA/AFRL Notes: svn path=/head/; revision=256861
* Bump per-device interrupt limit to more reasonable default.Oleksandr Tymoshenko2013-02-231-1/+1
| | | | | | | | | | | Some hardware like DMA and GPIO controllers might require more then 8 interrupts per device instance. Submitted by: Daisuke Aoyama <aoyama at peach.ne.jp> Discussed with: gber@, raj@ Notes: svn path=/head/; revision=247207
* Add fdt_get_reserved_regions function. API is simmilar to fdt_get_mem_regionsOleksandr Tymoshenko2012-11-301-0/+1
| | | | | | | | | It returns memory regions restricted from being used by kernel. These regions are dfined in "memreserve" property of root node in the same format as "reg" property of /memory node Notes: svn path=/head/; revision=243690
* Add fdt_get_unit() function.Grzegorz Bernacki2012-09-141-0/+1
| | | | | | | Obtained from: Semihalf Notes: svn path=/head/; revision=240485
* Merging of projects/armv6, part 4Oleksandr Tymoshenko2012-08-151-1/+2
| | | | | | | | | | | | | | | | | | | | r233822: Remove useless and wrong piece of code in fdt_get_range() which i overwrites passed phandle_t node. Modify debug printf in fdt_reg_to_rl() to be consistent (that is, print start and end *virtual* addresses). r230560: Handle "ranges;" Make fdt_reg_to_rl() responsible for mapping the device memory, instead on just hoping that there's only one simplebus, and using fdt_immr_va as the base VA. r230315 Add a function to get the PA from range, instead of (ab)using fdt_immr_pa, and use it for the UART driver Notes: svn path=/head/; revision=239274
* Add a new geom class which allows to divide NAND Flash chipGrzegorz Bernacki2012-05-221-0/+1
| | | | | | | | | | | | | into partitions. Partitions are created based on data in dts file which are extracted and interpreted by slicer. Obtained from: Semihalf Supported by: FreeBSD Foundation, Juniper Networks Notes: svn path=/head/; revision=235778
* Respect phy-handle property in Ethernet nodes of the device tree.Rafal Jaworowski2012-03-041-1/+1
| | | | | | | | | | | This lets specify whereabouts of the parent PHY for a given MAC node (and get rid of ugly kludges in mge(4) and tsec(4)). Obtained from: Semihalf MFC after: 1 week Notes: svn path=/head/; revision=232518
* Eliminate FDT_IMMR_VA define.Rafal Jaworowski2010-07-191-1/+1
| | | | | | | | This removes platform dependencies from <machine>/fdt.h for the benfit of portability. Notes: svn path=/head/; revision=210247
* Import the common Flattened Device Tree infrastructure.Rafal Jaworowski2010-06-021-0/+112
o fdtbus(4) - the main abstract bus driver for all FDT-compliant systems. This is a direct replacement for the many incompatible bus drivers grouping integrated peripherals on embedded platforms (like obio(4), ocpbus(4) etc.) o simplebus(4) - bus driver representing ePAPR style 'simple-bus' node, which is an umbrella device for most of the integrated peripherals on a typical system-on-chip device. o Other components (common routines library, PCI node processing helper functions) Reviewed by: imp Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=208747