summaryrefslogtreecommitdiffstats
path: root/sys/arm/mv
Commit message (Collapse)AuthorAgeFilesLines
* MFC r308640:ian2017-03-012-22/+16
| | | | | Use the correct OF_getencprop over OF_getprop + fdt32_to_cpu to read integer data from the device tree.
* MFC r306902:mmel2016-11-051-1/+0
| | | | ARM: Remove unused includes.
* MFC r306756:mmel2016-10-151-1/+2
| | | | | ARM: SEV/WFE instructions are implemented starting from ARMv6K, use it directly.
* Use nitems() macro instead of re-inventing itzbb2016-06-031-1/+1
| | | | | | | | Fixed after r301221. Pointed out by: oshogbo Submitted by: Michal Stanek <mst@semihalf.com> Obtained from: Semihalf
* Configure CPU window to second CESA SRAMzbb2016-06-022-0/+44
| | | | | | | | | | | Check if there is a second CESA SRAM node in FDT and add a CPU window for it. Define A38X specific macro for setting device attribute for each node. Submitted by: Michal Stanek <mst@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D6216
* Map CESA SRAM memory in driver attach for Armada38xzbb2016-06-021-1/+1
| | | | | | | | | | | | | | | On other platforms with CESA accelerator the SRAM memory is mapped in early init before driver is attached. This method only works correctly with mappings no smaller than L1 section size (1MB). There may be more SRAM blocks and they may have smaller sizes than 1MB as is the case for Armada38x. Instead, map SRAM memory with bus_space_map() in CESA driver attach. Note that we can no longer assume that VA == PA for the SRAM. Submitted by: Michal Stanek <mst@semihalf.com Obtained from: Semihalf Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D6215
* Include machine/acle-compat.h in cdefs.h on arm if the compiler doesn'tian2016-05-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | have ACLE support built in. The ACLE (ARM C Language Extensions) defines a set of standardized symbols which indicate the architecture version and features available. ACLE support is built in to modern compilers (both clang and gcc), but absent from gcc prior to 4.4. ARM (the company) provides the acle-compat.h header file to define the right symbols for older versions of gcc. Basically, acle-compat.h does for arm about the same thing cdefs.h does for freebsd: defines standardized macros that work no matter which compiler you use. If ARM hadn't provided this file we would have ended up with a big #ifdef __arm__ section in cdefs.h with our own compatibility shims. Remove #include <machine/acle-compat.h> from the zillion other places (an ever-growing list) that it appears. Since style(9) requires sys/types.h or sys/param.h early in the include list, and both of those lead to including cdefs.h, only a couple special cases still need to include acle-compat.h directly. Loves it: imp
* Use the new(-ish) CP15_SCTLR macro to generate system control reg accessesian2016-05-231-2/+9
| | | | | | | | | where possible. In the places that doesn't work (multi-line inline asm, and places where the old armv4 cpufuncs mechanism is used), annotate the accesses with a comment that includes SCTLR. Now a grep -i sctlr can find all the system control register manipulations. No functional changes.
* Fix the deciKelvin to Celsius conversion in kernel.loos2016-05-221-1/+1
| | | | | | | | | | | After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as 0C reference and as result, the temperature read in sysctl(8) now exibits a +0.1C difference. This commit fix the kernel references to match the reference value used in sysctl(8) after r285994. Sponsored by: Rubicon Communications (Netgate)
* INTRNG - implement pic_post_filter method. This method is fundamentalskra2016-05-221-0/+6
| | | | | one and must always be implemented for a PIC. There is no default for it intentionally.
* Return the struct intr_pic pointer from intr_pic_register. This will beandrew2016-05-181-1/+1
| | | | | | | | needed in later changes where we may not be able to lock the pic list lock to perform a lookup, e.g. from within interrupt context. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Use OF_prop_free instead of direct call to free(9)gonzo2016-05-131-1/+1
|
* INTRNG - redefine struct intr_map_data to avoid headers pollution. Eachskra2016-05-051-3/+7
| | | | | | | | | | | | | | | | struct associated with some type defined in enum intr_map_data_type must have struct intr_map_data on the top of its own definition now. When such structs are used, correct type and size must be filled in. There are three such structs defined in sys/intr.h now. Their definitions should be moved to corresponding headers by follow-up commits. While this change was propagated to all INTRNG like PICs, pic_map_intr() method implementations were corrected on some places. For this specific method, it's ensured by a caller that the 'data' argument passed to this method is never NULL. Also, the return error values were standardized there.
* sys/arm: Minor spelling fixes.pfg2016-05-042-2/+2
| | | | Only affects comments: no functional change.
* Move arm's devmap to some generic place, so it can be usedbr2016-04-266-15/+15
| | | | | | | | | by other architectures. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D6091 Sponsored by: DARPA, AFRL Sponsored by: HEIF5
* sys: use our roundup2/rounddown2() macros when param.h is available.pfg2016-04-211-1/+1
| | | | | | | | | | rounddown2 tends to produce longer lines than the original code and when the code has a high indentation level it was not really advantageous to do the replacement. This tries to strike a balance between readability using the macros and flexibility of having the expressions, so not everything is converted.
* Use our nitems() macro when param.h is available.pfg2016-04-201-2/+2
| | | | | | Replacements specific to arm, mips, pc98, powerpc and sparc64. Discussed in: freebsd-current
* Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machineandrew2016-04-152-11/+11
| | | | | | | independent code that needs to know about INTRNG such as PCI drivers. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Cleanup unnecessary semicolons from the kernel.pfg2016-04-101-1/+1
| | | | Found with devel/coccinelle.
* Remove FDT specific parts from INTRNG. Change its interface to make itskra2016-04-041-86/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | universal. (1) New struct intr_map_data is defined as a container for arbitrary description of an interrupt used by a device. Typically, an interrupt number and configuration relevant to an interrupt controller is encoded in such description. However, any additional information may be encoded too like a set of cpus on which an interrupt should be enabled or vendor specific data needed for setup of an interrupt in controller. The struct intr_map_data itself is meant to be opaque for INTRNG. (2) An intr_map_irq() function is created which takes an interrupt controller identification and struct intr_map_data as arguments and returns global interrupt number which identifies an interrupt. (3) A set of functions to be used by bus drivers is created as well as a corresponding set of methods for interrupt controller drivers. These sets take both struct resource and struct intr_map_data as one of the arguments. There is a goal to keep struct intr_map_data in struct resource, however, this way a final solution is not limited to that. (4) Other small changes are done to reflect new situation. This is only first step aiming to create stable interface for interrupt controller drivers. Thus, some temporary solution is taken. Interrupt descriptions for devices are stored in INTRNG and two specific mapping function are created to be temporary used by bus drivers. That's why the struct intr_map_data is not opaque for INTRNG now. This temporary solution will be replaced by final one in next step. Differential Revision: https://reviews.freebsd.org/D5730
* Move support for Synopsys Designware APB UART out of ns8250 and into ajmcneill2016-04-011-0/+1
| | | | | | | | | separate driver. Add support for activating clock and hwreset resources for these devices when the EXT_RESOURCES option is present. Reviewed by: andrew, mmel, Emmanuel Vadot <manu@bidouilliste.com> Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5749
* Fix the resource_list_print_type() calls to use uintmax_t.jhibbits2016-03-221-2/+2
| | | | Missed a bunch from r297000.
* Remove redefinitions in ARMADA codewma2016-03-151-3/+3
| | | | | | | * Rename IRQ_MASK to MPIC_IRQ_MASK not to overlap with register name from mvreg.h * Remove ARM_INTRNG from ARMADA38X, apparently was already included.
* Add support for USB3.0 on Armada38xwma2016-03-143-2/+108
| | | | | | | | | | | | | | | | | This commit provides attachment of xhci-platform for A38X boards, making it possible to mount FreeBSD world from USB3.0 flash. 'xhci' device was added to files.mv (as optional) and kernconf of Armada38x was enhanced. It was also necessary to open programmable memory windows of USB3.0. fdt_win_setup needed improvement so it's able to traverse through children of internal-regs node. Submitted by: Bartosz Szczepanek <bsz@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: hselasky Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D5031
* Make MPIC compatible with ARM_INTRNGwma2016-03-143-54/+298
| | | | | | | | | | | | | | | | | | | | | | | After ARM_INTRNG introduction, MPIC code needed several modifications: - IRQ resource and its handler added - several DEVMETHODs of INTRNG interface implemented - defines enhanced to ensure code compiles as well for AXP as for A38X - added dummy MSI_IRQ, ERR_IRQ defines for Armada38x - MPIC driver was added to files.armada38x, ARM_INTRNG option enabled in kernconf file and regs of MPIC corrected in dts file. Instead of modifying Armada38X DTS, offsets to CPU registers defined in driver were changed. That required restoring 'reg' property of mpic node in ArmadaXP to state compliant with Linux DTS. Additionally, required ARM_INTRNG definitions were added to mv_common.c. Submitted by: Bartosz Szczepanek <bsz@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: adrian, andrew, ian, skra Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D5030
* Make the fdt_get_mem_regions memsize argument optional. It's only used inandrew2016-03-011-2/+1
| | | | | | by a few callers. Sponsored by: ABT Systems Ltd
* Fix fdt_get_mem_regions() to work with 64-bit addresseswma2016-02-291-1/+2
| | | | | | | | | | | | 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
* Almost all copies of platform_mp_init_secondary just calledandrew2016-02-263-12/+5
| | | | | | | | | intr_pic_init_secondary. Replace them with a direct call. On BCM2836 and ARMADA XP we need to add this function, but it can be empty. Reviewed by: ian, imp Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D5460
* Remove platform_mp_probe as it's almost identical on most ARM SoCs, andandrew2016-02-262-14/+0
| | | | | | | | | | slightly wrong on the others. We should just check if mp_ncpus is set to more than one CPU as we may wish to run on a single core even when SMP is available. Reviewed by: ian Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D5458
* Remove platform_ipi_send, it's an unneeded as all implementations areandrew2016-02-252-14/+0
| | | | | | identical. Sponsored by: ABT Systems Ltd
* Move ARM_L2_PIPT option to std.armv6 for all armv6 platforms.skra2016-02-221-2/+0
| | | | | | | Only L2 PIPT cache is supported for __ARM_ARCH >= 6. In fact, this is just a pure proclamation as this option is used only in armv4 specific files now.
* As <machine/vm.h> is included from <vm/vm.h>, there is no need toskra2016-02-221-1/+0
| | | | | | | include it explicitly when <vm/vm.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5380
* Introduce a RMAN_IS_DEFAULT_RANGE() macro, and use it.jhibbits2016-02-202-2/+2
| | | | | | | | | | | 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
* Include ofw_bus_subr.h before ofw_pci.h for the definition of structandrew2016-02-191-1/+1
| | | | | | ofw_bus_iinfo. Sponsored by: ABT Systems Ltd
* Remove pd_prot and pd_cache members from struct arm_devmap_entry.skra2016-02-174-24/+2
| | | | | The struct is used for definition of static device mappings which should always have same protection and attributes.
* Add support for the Allwinner i2c device. This is similar to the existingandrew2016-02-151-0/+1
| | | | | | | | | | Marvell twsi part, however uses different register locations, as such split the existing driver into Marvell and Allwinner attachments. While here clean a few style issues. Submitted by: Emmanuel Vadot <manu@bidouilliste.com> Differential Revision: https://reviews.freebsd.org/D4846
* Move the twsi driver source to be under iicbus. It is in a separateandrew2016-02-142-645/+0
| | | | | | | directory as it is expected multiple attachments will be added for the SoC families that use this hardware. Sponsored by: ABT Systems Ltd
* Create the twsi device option in preparation to move the driver to a commonandrew2016-02-141-1/+1
| | | | | | location. The device is also found in Allwinner SoCs. Sponsored by: ABT Systems Ltd
* Remove an unused include.andrew2016-02-141-1/+0
|
* Stop adding an extra null terminator to strings, OF_getprop already returnsandrew2016-02-121-4/+2
| | | | a null terminated string.
* Stop defining fdt_pic_table when building for ARM_INTRNG.andrew2016-02-111-0/+2
|
* ARM: Use new ARMv6 naming conventions for cache and TLB functionsmmel2016-02-052-3/+5
| | | | | | in all but ARMv4 specific files. Expand ARMv6 compatibility stubs in cpu-v4.h. Use physical address in L2 cache functions if ARM_L2_PIPT is defined.
* Remove all remaining references to old and not more used structskra2016-02-023-3/+3
| | | | | pmap_devmap, pmap_devmap_bootstrap() and pmap_devmap[]. It was replaced in r257660.
* Remove not needed <machine/pte.h> includes.skra2016-02-011-1/+0
|
* ARM: Rename remaining instances of cpufunc_id() to cpu_ident(),mmel2016-02-012-2/+2
| | | | | forgotten in r295096. Remove tlb_flushI/tlb_flushI_SE functions forgotten in r295122.
* Convert rman to use rman_res_t instead of u_longjhibbits2016-01-272-4/+4
| | | | | | | | | | | | | | | | | | | | 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
* Remove an extra '!' found by clang 3.8.andrew2016-01-211-1/+1
|
* Introduce initial driver for PMSU on Armada38xzbb2016-01-205-0/+193
| | | | | | | | | | | | | | | This is a stub for PMSU driver. Note that it cannot be used to set the secondary core boot address during attach because drivers are attached later than SI_SUB_CPU sysinit where cores are started. Setting the boot address should be done manually in platform_mp_start_ap(). SMP is working fine with this commit and was enabled in Armada38x kernel configuration file. Obtained from: Semihalf Sponsored by: Stormshield Submitted by: Michal Stanek <mst@semihalf.com> Differential revision: https://reviews.freebsd.org/D4427
* Add initial support for SMP on Armada38xzbb2016-01-204-1/+188
| | | | | | | | | | | | | - Add file sys/arm/mv/armada38x/armada38x_mp.c - Set mp_maxid and mp_ncpus based on FDT unless SCU register indicates only one core - Boot CPU1 in platform_mp_start_ap() - IPI range defined Obtained from: Semihalf Sponsored by: Stormshield Submitted by: Michal Stanek <mst@semihalf.com> Differential revision: https://reviews.freebsd.org/D4426
* Open window to bootROM memory on Armada38x to allow CPU1 to bootzbb2016-01-203-1/+60
| | | | | | | | | | CPU1 is halted in bootROM code while it is waiting to be released. Memory window to bootROM must be opened before booting the core. Obtained from: Semihalf Sponsored by: Stormshield Submitted by: Michal Stanek <mst@semihalf.com> Differential revision: https://reviews.freebsd.org/D4425
OpenPOWER on IntegriCloud