summaryrefslogtreecommitdiffstats
path: root/sys/mips
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Revert "MFC r319871:""Luiz Souza2018-02-231-2/+0
| | | | This reverts commit 63302e53ed4b3fe59711d939ba87433a9a12199d.
* Revert "Revert "MFC r319873:""Luiz Souza2018-02-231-9/+12
| | | | This reverts commit 4c9907d21517c211b27a3cf5b7a2a976623820cc.
* Merge remote-tracking branch 'origin/RELENG_2_4-meltdown' into RELENG_2_4Luiz Souza2018-02-231-0/+4
|\
| * MFC r325530 (jeff), r325566 (kib), r325588 (kib):markj2018-02-211-0/+4
| | | | | | | | | | | | Replace many instances of VM_WAIT with blocking page allocation flags. (cherry picked from commit 2069f0080fbdcf49b623bc3c1eda76524a4d1a77)
* | Revert "MFC r319873:"Luiz Souza2018-02-211-12/+9
| | | | | | | | This reverts commit 5dad0dd804a33b8a372d49fa342b24c67b1c2fb3.
* | Revert "MFC r319871:"Luiz Souza2018-02-211-0/+2
|/ | | | This reverts commit 045793a68906243d204d36b336867187c1a33f00.
* MFC r319871:kib2018-02-191-2/+0
| | | | | | | Make struct syscall_args visible to userspace compilation environment from machine/proc.h, consistently on all architectures. (cherry picked from commit 06d5fa0600b92e97e90e41785ef10f641bdec89f)
* MFC r319873:kib2018-02-191-9/+12
| | | | | | | Move struct syscall_args syscall arguments parameters container into struct thread. (cherry picked from commit 985b26c6741218c134a15526fd32b736bd73fa8a)
* ofw_spi: Parse property for the SPI mode and CS polarity.manu2017-10-174-0/+8
| | | | | | | | | | | As cs is stored in a uint32_t, use the last bit to store the active high flag as it's unlikely that we will have that much CS. Reviewed by: loos MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D8614 (cherry picked from commit f5f9058ccaec11fccc18817f45fff8859798a317)
* MFC r318353:hselasky2017-05-271-3/+7
| | | | | | | | | | | | | | | | | | | | | Avoid use of contiguous memory allocations in busdma when possible. This patch improves the boundary checks in busdma to allow more cases using the regular page based kernel memory allocator. Especially in the case of having a non-zero boundary in the parent DMA tag. For example AMD64 based platforms set the PCI DMA tag boundary to PCI_DMA_BOUNDARY, 4GB, which before this patch caused contiguous memory allocations to be preferred when allocating more than PAGE_SIZE bytes. Even if the required alignment was less than PAGE_SIZE bytes. This patch also fixes the nsegments check for using kmem_alloc_attr() when the maximum segment size is less than PAGE_SIZE bytes. Updated some comments describing the code in question. Differential Revision: https://reviews.freebsd.org/D10645 Reviewed by: kib, jhb, gallatin, scottl Sponsored by: Mellanox Technologies
* MFC efivar(8) (by imp):kib2017-05-201-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | List of revisions merged: r307070 r307071 r307072 r307074 r307189 r307224 r307339 r307390 r307391 r309776 r314231 r314232 r314615 r314616 r314617 r314618 r314619 r314620 r314621 r314623 r314890 r314925 r314926 r314927 r314928 r315770 r315771 Discussed with: gjb (re), imp Sponsored by: The FreeBSD Foundation
* MFC r311169,r311898,r312925,r312973,r312975,r313007,r313040,r313080,mjg2017-03-161-2/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r313254,r313341 amd64: add atomic_fcmpset == sparc64: add atomic_fcmpset == Implement atomic_fcmpset_* for arm and arm64. == Add atomic_fcmpset_*() inlines for powerpc Summary: atomic_fcmpset_*() is analogous to atomic_cmpset(), but saves off the read value from the target memory location into the 'old' pointer in the case of failure. == i386: add atomic_fcmpset == Don't retry a lost reservation in atomic_fcmpset() The desired behavior of atomic_fcmpset_() is to always exit on error. Instead of retrying on lost reservation, leave the retry to the caller, and return == Add atomic_fcmpset_*() inlines for MIPS atomic_fcmpset_*() is analogous to atomic_cmpset(), but saves off the read value from the target memory location into the 'old' pointer. == i386: fixup fcmpset An incorrect output specifier was used which worked with clang by accident, but breaks with the in-tree gcc version. While here plug a whitespace nit. == Implement atomic_fcmpset_*() for RISC-V. == Use 64bit store instruction in atomic_fcmpset_64.
* MFC r313194:kib2017-02-111-2/+0
| | | | Define the vm_ooffset_t and vm_pindex_t types as machine-independend.
* MFC 307332,312086: Drop support for using mmap() with /dev/kmem.jhb2017-01-181-6/+0
| | | | | | | | | | | | | | | | | | | 307332: Drop support for using mmap() with /dev/kmem. Using the device pager with /dev/kmem is not stable since KVA mappings are transient, but the device pager caches the PA associated with a given offset forever. Interestingly, mips' implementation of memmap() already refused requests for /dev/kmem. Note that kvm_read/kvm_write do not use mmap, but use read and write on /dev/kmem, so this should not affect libkvm users. 312086: Trim a few comments on platforms that did not implement mmap of /dev/kmem. After r307332, no platforms implement mmap for /dev/kmem, so the lack of it for these platforms is no longer unique.
* MFC r309935:manu2016-12-164-11/+19
| | | | Use the spibus accessor when applicable.
* MFC 308690: Sync instruction cache's after writing user breakpoints on MIPS.jhb2016-12-161-4/+10
| | | | | | Add an implementation for pmaps_sync_icache() on MIPS that sync's the instruction cache on all CPUs via smp_rendezvous() after a debugger inserts a breakpoint via ptrace(PT_IO).
* MFC r307518:hselasky2016-11-0711-66/+0
| | | | | | | | | | | | | | | | | | | | | Fix device delete child function. When detaching device trees parent devices must be detached prior to detaching its children. This is because parent devices can have pointers to the child devices in their softcs which are not invalidated by device_delete_child(). This can cause use after free issues and panic(). Device drivers implementing trees, must ensure its detach function detaches or deletes all its children before returning. While at it remove now redundant device_detach() calls before device_delete_child() and device_delete_children(), mostly in the USB controller drivers. Tested by: Jan Henrik Sylvester <me@janh.de> Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D8070
* MFC r306899, r307059, r307151gonzo2016-11-061-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | r306899: Fix release MSI method for ARM GIC r307059: INTRNG - fix MSI/MSIX release path Use isrc in attached MSI data structure instead of using map's isrc directly. map's isrc is set to NULL on IRQ deactivation which happens prior to pci_release_msi so MSI_RELEASE_MSI receives array of NULLs Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D8206 r307151: INTRNG: Propagate IRQ activation error to API consumer Keep resource state consistent with INTRNG state - if intr_activate_irq fails - deactivate resource and propagate error to calling function Reviewed by: mmel
* MFC r304459,r305527:mmel2016-11-053-20/+115
| | | | | | | | | | | | | | | | | | 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
* MFC r307152: Add COMPAT_FREEBSD10 to the MIPS ERL kernel configemaste2016-10-191-0/+1
| | | | | | | As of r302092, pipe is a wrapper around pipe2 and the pipe syscall is no longer used. It is included only with the COMPAT_FREEBSD10 kernel option. Add the compat option to support upgrades from systems with an earlier userland.
* Fixed FreeBSD/mips MALTA support for QEMUgonzo2016-06-291-5/+5
| | | | | | | | | | | | | Recource management functions in GT PCI controller driver treated memory/IO resources as KSEG1 addresses, later during activation these values would be increased by KSEG1 base again rendering the address invalid and causing "bus error" trap. Actual logic was converted to use real physical addresses, so mapping takes place only during activation. Submitted by: Aleksandr Rybalko <ray@FreeBSD.org> Approved by: re (gjb)
* Replace mips/sentry5 with mips/broadcomlandonf2016-06-2521-788/+144
| | | | | | | | | | | | | | | | | The delta between SENTRY5 and BCM was already small due to BCM being derived from SENTRY5; re-integrating the two avoids the maintenance overhead of keeping them both in sync with bhnd(4) changes. - Re-integrate minor SENTRY5 deltas in bcm_machdep.c - Modify uart_cpu_chipc to allow specifying UART debug/console flags via kenv and device hints. - Switch SENTRY5 to std.broadcom - Enabled CFI flash support for SENTRY5 Reviewed by: Michael Zhilin <mizkha@gmail.com> (Broadcom MIPS support) Approved by: re (gjb), adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6897
* bhnd(4): Perform explicit chipc child enumeration.landonf2016-06-251-61/+6
| | | | | | | | | | | | | Replaces use of DEVICE_IDENTIFY with explicit enumeration of chipc child devices using the chipc capability structure. This is a precursor to PMU support, which requires more complex resource assignment handling than achievable with the static device name-based hints table. Reviewed by: Michael Zhilin <mizkha@gmail.com> (Broadcom MIPS support) Approved by: re (gjb), adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6896
* Update comments for the MD functions managing contexts for newkib2016-06-161-11/+10
| | | | | | | | | | | | | | | | threads, to make it less confusing and using modern kernel terms. Rename the functions to reflect current use of the functions, instead of the historic KSE conventions: cpu_set_fork_handler -> cpu_fork_kthread_handler (for kthreads) cpu_set_upcall -> cpu_copy_thread (for forks) cpu_set_upcall_kse -> cpu_set_upcall (for new threads creation) Reviewed by: jhb (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (hrs) Differential revision: https://reviews.freebsd.org/D6731
* [mips] Tidy up setting/clearing the hardfloat flag.adrian2016-06-141-1/+6
| | | | | Submitted by: kan Approved by: re (delphij)
* [mips] set hardfloat for fpu instruction generation for gcc/binutils 5.xadrian2016-06-131-0/+1
| | | | | | | This allows -HEAD to be compiled again using the gcc-5 mips port compiler. Reviewed by: imp Approved by: re@
* bhnd(4): Fix mips/broadcom core matching and bus pass order.landonf2016-06-081-8/+11
| | | | | | | | | | | | | | | | | Changes: - Fixed incorrect MIPS74k vendor ID in the bhnd core descriptor tables - Fixed MIPS core driver's matching against MIPS/MIPS33 cores. - Improved MIPS3302 core description. - Enabled BUS_PASS_BUS on the bhnd nexus drivers to allow early probing of the MIPS core. - Enabled BUS_PASS_CPU on the MIPS core driver to ensure correct attach order. - Disabled matching of the MIPS core driver on non-SoC devices. Reviewed by: Michael Zhilin <mizhka@gmail.com> Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6735
* bhnd(4): Add a vendor parameter to BHND_DEVICE(), replacing vendor-specificlandonf2016-06-081-3/+3
| | | | | | | BHND_*_DEVICE macros. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6736
* Get rid of struct proc p_sched and struct thread td_sched pointers.kib2016-06-051-1/+1
| | | | | | | | | | | | | | p_sched is unused. The struct td_sched is always co-allocated with the struct thread, except for the thread0. Avoid useless indirection, instead calculate td_sched location using simple pointer arithmetic in td_get_sched(9). For thread0, which is statically allocated, create a structure to emulate layout of the dynamic allocation. Reviewed by: jhb (previous version) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D6711
* INTRNG - change the way how an interrupt mapping data are providedskra2016-06-051-0/+4
| | | | | | | | to the framework in OFW (FDT) case. This is a follow-up to r301451. Differential Revision: https://reviews.freebsd.org/D6634
* Switch mips/sentry5 to bhnd(4), and unify with mips/broadcomlandonf2016-06-045-39/+18
| | | | | | | | | | | | | | | | | | | | | Now that bhnd(4) provides feature parity with the previous siba/mips implementation, we can switch sentry5 over and begin lifting common support code out for use across bhnd(4) embedded targets. Changes: - Fixed enumeration of siba(4) per-core address maps, required for discovery of memory mapped chipc flash region on siba(4) devices. - Simplified bhnd kernel configuration (dropped 'bhndbus' option). - Replaced files.broadcom's direct file references with their corresponding standard kernel options. - Lifted out common bcma/siba nexus support, inheriting from the new generic bhnd_nexus driver. - Dropped now-unused sentry5 siba code. - Re-integrated BCM into the universe build now that it actually compiles. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6712
* bhnd(4): Add support for chipc-attached flashlandonf2016-06-041-3/+20
| | | | | | | | | This adds support for serial (via SPI) and parallel (via CFI) flash as found on BCM47xx/BCM53xx SoCs. Submitted by: Michael Zhilin <mizhka@gmail.com> Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6250
* Build etherswitch support for appropriate Ralink/Mediatek SoCssgalabov2016-05-253-0/+15
| | | | | | | | Etherswitch support is built by default on all SoCs except RT3662/RT3883 as they have no built-in switch and their configurations with external switches are not yet supported. Sponsored by: Smartcom - Bulgaria AD
* Garbage collect unused prototype for clockintr().rwatson2016-05-201-2/+0
| | | | MFC after: 3 days
* Exclude BCM from universe build until it compiles again.bz2016-05-191-0/+2
|
* Ralink: Add more SoC compatible stringssgalabov2016-05-191-0/+3
| | | | | | | | | Add more 'compatible' strings found in various LEDE DTS files. Reviewed by: adrian Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6432
* Return the struct intr_pic pointer from intr_pic_register. This will beandrew2016-05-187-7/+7
| | | | | | | | 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
* Don't repeat the the word 'the'eadler2016-05-171-1/+1
| | | | | | | (one manual change to fix grammar) Confirmed With: db Approved by: secteam (not really, but this is a comment typo fix)
* Add proper PCIe init for MT7628/MT7688 SoCssgalabov2016-05-171-0/+1
| | | | | | | | | | | | | PCIe PHY needs different initialization on MT7628/MT7688 SoCs than it does on MT7620. However, LEDE (and OpenWRT) dts files have the PCIe node for MT7628/MT7688 as compatible with mt7620-pci. We already can handle this properly in our driver, so we just need to add compat strings to fbsd-mt7628an.dtsi and the PCIe driver. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6395
* [mips] also add otus/urtwn USB modules.adrian2016-05-171-1/+1
| | | | | | | I'm using both AR933x (because the boards fit in small boxes) as well as AR934x for doing USB wifi testing on MIPS. So far so good, for both of them.
* [mips] add urtwn and otus NIC modules.adrian2016-05-171-1/+1
| | | | I'm using this platform for testing USB wifi on MIPS.
* [mips/broadcom] Add initial support for Broadcom MIPS processoradrian2016-05-179-0/+724
| | | | | | | | | | | | | Relies on BHND(4) driver. There files contains machine-dependent code for Broadcom MIPS processor and provide UART driver. This is a work in progress; it and the current bhnd code is enough to boot on the ASUS RT-N16 and RT-N53 platforms. Submitted by: Michael Zhilin <mizhka@gmail.com> Differential Revision: https://reviews.freebsd.org/D6251
* [mips/broadcom] Add initial code for interrupts on the Broadcom MIPS processoradrian2016-05-162-0/+183
| | | | | | | Broadcom MIPS processor doesn't reset TI flag if additional manipulation is done. Thanks to @sobomax!
* Introduce MSI and MSI-X support to intrng. This adds a new msi deviceandrew2016-05-161-0/+1
| | | | | | | | | | | | interface with 5 methods to mirror the 5 MSI/MSI-X methods in the pcib interface. The pcib driver will need to perform a device specific lookup to find the MSI controller and pass this to intrng as the xref. Intrng will finally find the controller and have it handle the requested operation. Obtained from: ABT Systems Ltd MFH: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5985
* Use OF_prop_free instead of direct call to free(9)gonzo2016-05-142-3/+3
| | | | Reviewed by: sgalabov
* Remove NULL checks after M_WAITOK allocations from sys/mips/.trasz2016-05-115-20/+0
| | | | | | | Reviewed by: adrian@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6301
* Rename siba -> siba_s5, to specifically reference that it's for theadrian2016-05-101-2/+1
| | | | | | | | | | legacy siba sentry5 cpu glue. The siba_cc code is the hard-coded chipcommon bits for the sentry s5, which will eventually be replaced with the more flexible bhnd sipa/cc code. bwn, etc uses siba_bwn, which doesn't use siba or siba_cc to do anything.
* siba depends on bhndbus; add the device to the kernel config.bz2016-05-101-0/+1
| | | | This gets us past compiling and now only linking is failing on builtins.
* mtk_spi cleanup commented printfssgalabov2016-05-062-11/+0
| | | | | | Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6223
* mtk_gpio fixessgalabov2016-05-062-38/+16
| | | | | | | | | | Allow output pins to be read and input pins to be set. Fix bugs where we were trying to access the gpio softc before doing device_get_softc. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6222
OpenPOWER on IntegriCloud