summaryrefslogtreecommitdiffstats
path: root/sys/mips
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Implement FBT provider (MD part) for DTrace on MIPS.br2016-05-052-8/+11
| | | | | | | Tested on MIPS64. Sponsored by: DARPA, AFRL Sponsored by: HEIF5
* INTRNG - redefine struct intr_map_data to avoid headers pollution. Eachskra2016-05-056-22/+46
| | | | | | | | | | | | | | | | 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.
* When attempting to satisfy mmap() requests for superpage alignment onrwatson2016-04-302-7/+9
| | | | | | | | | | 64-bit MIPS, use superpage rather than physical-segment constants, or we may improperly fail to apply suitable alignment -- yet still allow mmap() to appear to succeed. Reviewed by: sson MFC after: 1 week Sponsored by: DARPA, AFRL
* sys: Make use of our rounddown() macro when sys/param.h is available.pfg2016-04-303-3/+3
| | | | No functional change.
* Add a bus_null_rescan() method that always fails with an error.jhb2016-04-271-1/+1
| | | | | Use this in place of kobj_error_method to disable BUS_RESCAN() on PCI drivers that do not use the "standard" scanning algorithm.
* Implement a PCI bus rescan method.jhb2016-04-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Rescanning a PCI bus uses the following steps: - Fetch the current set of child devices and save it in the 'devlist' array. - Allocate a parallel array 'unchanged' initalized with NULL pointers. - Scan the bus checking each slot (and each function on slots with a multifunction device). - If a valid function is found, look for a matching device in the 'devlist' array. If a device is found, save the pointer in the 'unchanged' array. If a device is not found, add a new device. - After the scan has finished, walk the 'devlist' array deleting any devices that do not have a matching pointer in the 'unchanged' array. - Finally, fetch an updated set of child devices and explicitly attach any devices that are not present in the 'unchanged' array. This builds on the previous changes to move subclass data management into pci_alloc_devinfo(), pci_child_added(), and bus_child_deleted(). Subclasses of the PCI bus use custom rescan logic explicitly override the rescan method to disable rescans. Differential Revision: https://reviews.freebsd.org/D6018
* [mips] correctly represent memory region allocations >> 2^^31adrian2016-04-261-2/+2
| | | | | | | Without this, it'd get promoted incorrectly and fail allocation. Submitted by: Mori Hiroki <yamori813@yahoo.co.jp> Reviewed by: imp
* Remove uart_dev_mtk_ns8250sgalabov2016-04-232-114/+0
| | | | | | | | | | | | | | | | | | The purpose of this file was to simply detect the UART speed before attaching the actual ns8250 driver so that we don't have to specify the UART speed in DTS files. However, OpenWRT DTS files specify ns16550a as a compatible string in their DTS files and this makes the original ns8250 driver attach to the device. So we would have to edit the DTS files anyway and since this is only the case for MT7621 and MT7628/MT7688 for now, it's better to just add the clock-frequency property to those (UART is always clocked by the same clock in both these SoCs, so that's fine) instead of having a separate driver and still having to change the DTS files. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6044
* Use cpu_establish_hardintr in mtk_intr_gicsgalabov2016-04-231-14/+3
| | | | | | | | This allows us to come closer to OpenWRT vanilla DTS files. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6045
* Introduce palmbus for Mediatek/Ralink SoCssgalabov2016-04-231-0/+81
| | | | | | | | | This allows us to get closer to OpenWRT DTS files and minimize the diffs a little more. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6042
* Minor pinctrl fixes for Mediatek/Ralinksgalabov2016-04-231-3/+3
| | | | | | Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6041
* sys: use our roundup2/rounddown2() macros when param.h is available.pfg2016-04-215-9/+9
| | | | | | | | | | 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.
* sys: use our nitems() macro when param.h is available.pfg2016-04-212-4/+4
| | | | | | This should cover all the remaining cases in the kernel. Discussed in: freebsd-current
* Remove slightly used const values that can be replaced with nitems().pfg2016-04-211-2/+1
| | | | Suggested by: jhb
* Rework Mediatek/Ralink configuration filessgalabov2016-04-2111-184/+503
| | | | | | | | Only compile what each SoC needs and get rid of MEDIATEK generic config. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5996
* Use our nitems() macro when param.h is available.pfg2016-04-201-1/+1
| | | | | | Replacements specific to arm, mips, pc98, powerpc and sparc64. Discussed in: freebsd-current
* Add compat strings used by OpenWRT to some Mediatek/Ralink driverssgalabov2016-04-202-6/+3
| | | | | | Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5995
* Rework mtk_gpio_v1 driversgalabov2016-04-201-47/+50
| | | | | | | | | This revision makes the mtk_gpio_v1 driver read its register map property from the OpenWRT dts files. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6029
* Introduce OpenWRT compatible pinctrl driver for Mediatek/Ralink SoCssgalabov2016-04-202-4/+481
| | | | | | | | The driver can read and parse the OpenWRT pinctrl dts entries. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5999
* Allow RT3350 CPU clock to be detected as part of RT3050/RT3052 detectionsgalabov2016-04-182-8/+12
| | | | | | | | | | | OpenWRT's dts files treat RT3050/RT3052/RT3350 within the same SoC dtsi file, so we need to distinguish between the three dynamically, mainly because the bit we use to determine the clock speed on RT3050/RT3052 can actually be floating on RT3350 and RT3350 is always at 320MHz. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5983
OpenPOWER on IntegriCloud