summaryrefslogtreecommitdiffstats
path: root/sys/mips/cavium
Commit message (Collapse)AuthorAgeFilesLines
* MFC r307518:hselasky2016-11-071-6/+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
* sys: use our roundup2/rounddown2() macros when param.h is available.pfg2016-04-211-2/+2
| | | | | | | | | | 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.
* Don't assume that bio_cmd is a bitfield.imp2016-03-101-21/+22
| | | | Differential Revision: https://reviews.freebsd.org/D5591
* As <machine/pmap.h> is included from <vm/pmap.h>, there is no need toskra2016-02-222-2/+0
| | | | | | | include it explicitly when <vm/pmap.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5373
* Convert rman to use rman_res_t instead of u_longjhibbits2016-01-273-5/+7
| | | | | | | | | | | | | | | | | | | | 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
* Fix typo (s/harware/hardware/)kevlo2015-12-251-1/+1
|
* Add domain support to PCI bus allocationzbb2015-09-161-1/+1
| | | | | | | | | | | | When the system has more than a single PCI domain, the bus numbers are not unique, thus they cannot be used for "pci" device numbering. Change bus numbers to -1 (i.e. to-be-determined automatically) wherever the code did not care about domains. Reviewed by: jhb Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3406
* Huge cleanup of random(4) code.markm2015-06-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * GENERAL - Update copyright. - Make kernel options for RANDOM_YARROW and RANDOM_DUMMY. Set neither to ON, which means we want Fortuna - If there is no 'device random' in the kernel, there will be NO random(4) device in the kernel, and the KERN_ARND sysctl will return nothing. With RANDOM_DUMMY there will be a random(4) that always blocks. - Repair kern.arandom (KERN_ARND sysctl). The old version went through arc4random(9) and was a bit weird. - Adjust arc4random stirring a bit - the existing code looks a little suspect. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Redo read_random(9) so as to duplicate random(4)'s read internals. This makes it a first-class citizen rather than a hack. - Move stuff out of locked regions when it does not need to be there. - Trim RANDOM_DEBUG printfs. Some are excess to requirement, some behind boot verbose. - Use SYSINIT to sequence the startup. - Fix init/deinit sysctl stuff. - Make relevant sysctls also tunables. - Add different harvesting "styles" to allow for different requirements (direct, queue, fast). - Add harvesting of FFS atime events. This needs to be checked for weighing down the FS code. - Add harvesting of slab allocator events. This needs to be checked for weighing down the allocator code. - Fix the random(9) manpage. - Loadable modules are not present for now. These will be re-engineered when the dust settles. - Use macros for locks. - Fix comments. * src/share/man/... - Update the man pages. * src/etc/... - The startup/shutdown work is done in D2924. * src/UPDATING - Add UPDATING announcement. * src/sys/dev/random/build.sh - Add copyright. - Add libz for unit tests. * src/sys/dev/random/dummy.c - Remove; no longer needed. Functionality incorporated into randomdev.*. * live_entropy_sources.c live_entropy_sources.h - Remove; content moved. - move content to randomdev.[ch] and optimise. * src/sys/dev/random/random_adaptors.c src/sys/dev/random/random_adaptors.h - Remove; plugability is no longer used. Compile-time algorithm selection is the way to go. * src/sys/dev/random/random_harvestq.c src/sys/dev/random/random_harvestq.h - Add early (re)boot-time randomness caching. * src/sys/dev/random/randomdev_soft.c src/sys/dev/random/randomdev_soft.h - Remove; no longer needed. * src/sys/dev/random/uint128.h - Provide a fake uint128_t; if a real one ever arrived, we can use that instead. All that is needed here is N=0, N++, N==0, and some localised trickery is used to manufacture a 128-bit 0ULLL. * src/sys/dev/random/unit_test.c src/sys/dev/random/unit_test.h - Improve unit tests; previously the testing human needed clairvoyance; now the test will do a basic check of compressibility. Clairvoyant talent is still a good idea. - This is still a long way off a proper unit test. * src/sys/dev/random/fortuna.c src/sys/dev/random/fortuna.h - Improve messy union to just uint128_t. - Remove unneeded 'static struct fortuna_start_cache'. - Tighten up up arithmetic. - Provide a method to allow eternal junk to be introduced; harden it against blatant by compress/hashing. - Assert that locks are held correctly. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Turn into self-sufficient module (no longer requires randomdev_soft.[ch]) * src/sys/dev/random/yarrow.c src/sys/dev/random/yarrow.h - Improve messy union to just uint128_t. - Remove unneeded 'staic struct start_cache'. - Tighten up up arithmetic. - Provide a method to allow eternal junk to be introduced; harden it against blatant by compress/hashing. - Assert that locks are held correctly. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Turn into self-sufficient module (no longer requires randomdev_soft.[ch]) - Fix some magic numbers elsewhere used as FAST and SLOW. Differential Revision: https://reviews.freebsd.org/D2025 Reviewed by: vsevolod,delphij,rwatson,trasz,jmg Approved by: so (delphij)
* CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenjkim2015-05-222-2/+2
| | | | | | | | | | years for head. However, it is continuously misused as the mpsafe argument for callout_init(9). Deprecate the flag and clean up callout_init() calls to make them more consistent. Differential Revision: https://reviews.freebsd.org/D2613 Reviewed by: jhb MFC after: 2 weeks
* Add support for the uart classes to set their default register shift value.andrew2015-04-111-1/+2
| | | | | | | | | | | This is needed with the pl011 driver. Before this change it would default to a shift of 0, however the hardware places the registers at 4-byte addresses meaning the value should be 2. This patch fixes this for the pl011 when configured using the fdt. The other drivers have a default value of 0 to keep this a no-op. MFC after: 1 week
* Implement GPIO_GET_BUS() method for all GPIO drivers.loos2015-01-312-5/+21
| | | | | Add helper routines to deal with attach and detach of gpiobus and gpioc devices that are common to all drivers.
* Replace spaces with tabs, this will easier future changes on softcloos2015-01-311-5/+5
| | | | | | structure. No functional changes.
* Clean up and fix the device detach routine and the failure path on GPIOloos2015-01-311-3/+8
| | | | | | drivers. This paves the way for upcoming work.
* Add 64-bit DMA support in the XHCI controller driver.hselasky2015-01-051-0/+1
| | | | | | | - Fix some comments and whitespace while at it. MFC after: 1 month Submitted by: marius@
* Moves all the duplicate code to a single function.loos2014-11-181-9/+1
| | | | | Verify for invalid modes and unwanted flags before pass the new flags to driver.
* Make the GPIO children attach to the first unit available and not only toloos2014-10-281-2/+3
| | | | | | | | | unit 0. It seems that this 'simplification' was copied to all GPIO drivers in tree. This fix a bug where a GPIO controller could fail to attach its children (gpioc and gpiobus) if another GPIO driver attach first.
* Mechanically convert to if_inc_counter().glebius2014-09-193-10/+10
|
* Migrate ie->ie_assign_cpu and associated code to use an int for CPU ratheradrian2014-09-171-5/+5
| | | | | | | | | | | | | | | | | than u_char. Migrate post_filter to use an int for a CPU rather than u_char. Change intr_event_bind() to use an int for CPU rather than u_char. It touches the ppc, sparc64, arm and mips machdep code but it should (hah!) be a no-op. Tested: * i386, AMD64 laptops Reviewed by: jhb
* Fix RTC clock writes on many Octeon boards.kan2014-09-141-4/+5
| | | | | The struct clocktime uses 0-based week day number, so back out part of r229161 by gonzo, which actually broke the RTC clock writes on Sundays.
* Add delay to Octeon MDIO access routines.kan2014-09-141-0/+2
| | | | | | Prevent saturattion of the bus by constant polling which in extreme cases can cause interface lockup. This makes FreeBSD match similar case in the executive.
* Use define from if_var.h to access a field inside struct if_data,glebius2014-08-302-3/+3
| | | | | | that resides in struct ifnet. Sponsored by: Nginx, Inc.
* Pull in r267961 and r267973 again. Fix for issues reported will follow.hselasky2014-06-281-4/+1
|
* Revert r267961, r267973:gjb2014-06-271-1/+4
| | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifhselasky2014-06-271-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies
* Update NetBSD Foundation copyrights to 2-clause BSDemaste2014-03-181-7/+0
| | | | | | | | | | | The NetBSD Foundation states "Third parties are encouraged to change the license on any files which have a 4-clause license contributed to the NetBSD Foundation to a 2-clause license." This change removes clauses 3 and 4 from copyright / license blocks that list The NetBSD Foundation as the only copyright holder. Sponsored by: The FreeBSD Foundation
* Introduce grab and ungrab upcalls. When the kernel desires to grab theimp2014-01-191-0/+35
| | | | | | | | | | console, it calls the grab functions. These functions should turn off the RX interrupts, and any others that interfere. This makes mountroot prompt work again. If there's more generalized need other than prompting, many of these routines should be expanded to do those new things. Reviewed by: bde (with reservations)
* Remove two redundantly repetitive assignments.imp2014-01-161-2/+0
|
* Add missing includes.jmallett2013-12-102-0/+3
|
* Remove the gross hack for the Octeon Simple Executive to the leastimp2013-11-061-0/+4
| | | | | | | | intrusive place for it to be: the octeon std file. Fix a comment while I'm here. Allow for future architectural specific flags. Reviewed by: jmallet@
* Devices that rely on hints or identify routines for discovery need tonwhitehorn2013-10-295-5/+5
| | | | | | | return BUS_PROBE_NOWILDCARD from their probe routines to avoid claiming wildcard devices on their parent bus. Do a sweep through the MIPS tree. MFC after: 2 weeks
* - Provide necessary includes.glebius2013-10-2910-0/+10
| | | | | | | - Remove unnecessary includes. Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Snapshot. This passes the build test, but has not yet been finished or debugged.markm2013-10-041-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Contains: * Refactor the hardware RNG CPU instruction sources to feed into the software mixer. This is unfinished. The actual harvesting needs to be sorted out. Modified by me (see below). * Remove 'frac' parameter from random_harvest(). This was never used and adds extra code for no good reason. * Remove device write entropy harvesting. This provided a weak attack vector, was not very good at bootstrapping the device. To follow will be a replacement explicit reseed knob. * Separate out all the RANDOM_PURE sources into separate harvest entities. This adds some secuity in the case where more than one is present. * Review all the code and fix anything obviously messy or inconsistent. Address som review concerns while I'm here, like rename the pseudo-rng to 'dummy'. Submitted by: Arthur Mesh <arthurmesh@gmail.com> (the first item)
* Yarrow wants entropy estimations to be conservative; the usual ideamarkm2013-09-061-1/+1
| | | | | is that if you are certain you have N bits of entropy, you declare N/2.
* This file isn't derived from anything delivered by Berkeley, so removeimp2013-07-221-4/+0
| | | | this statement.
* Use cvmx_mgmt_port_num_ports() instead of the inlined copy of aimp2013-05-022-16/+2
| | | | previous version of this function.
* Octeon 2 (6xxx) and newer CPUs don't use the clock CPU speed for itsimp2013-04-261-1/+1
| | | | | | | | | | I/O clock. Thankfully, the simple executive provies a way to querry the proper clock that works on all models. Move to asking for the SCLK via this interface. This gets the serial console working after we start init and open the console and set the divisor (which turned the output from good to bad). I can login on the console now.
* Fix undefined behaviour in several gpio_pin_setflags() routines (underdim2013-04-131-2/+2
| | | | | | | | | sys/arm and sys/mips), squelching the clang 3.3 warnings about this. Noticed by: tinderbox and many irate spectators Submitted by: Luiz Otavio O Souza <loos.br@gmail.com> PR: kern/177759 MFC after: 3 days
* Merge from vmobj-rwlock branch:attilio2013-02-261-1/+0
| | | | | | | | Remove unused inclusion of vm/vm_pager.h and vm/vnode_pager.h. Sponsored by: EMC / Isilon storage division Tested by: pho Reviewed by: alc
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-053-3/+3
| | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually
* Use bootverbose to control debug printfs from the Cavium Simple Executivejmallett2012-11-241-0/+18
| | | | | code. Also remove an unnecessary CVMX_ENABLE_DEBUG_PRINTS conditional around what is already a cvmx_dprintf.
* o) Add support for specifying a model of Octeon to target at compile-time,jmallett2012-11-241-10/+29
| | | | | | | reducing the number of runtime checks done by the SDK code. o) Group board/CPU information at early startup by subject matter, so that e.g. CPU information is adjacent to CPU information and board information is adjacent to board information.
* Prevent hang on ATCA-7220 when transmitting packets < 60 bytes.jmallett2012-11-191-0/+13
|
* Remove redundant printf of SDK version which already appears earlier in boot.jmallett2012-11-191-2/+0
|
* Add basic support for the Radisys-specific PCI console mechanism found on thejmallett2012-11-191-11/+125
| | | | Radisys ATCA-7220.
* o) Do boot descriptor parsing before console setup so that we can use a consolejmallett2012-11-191-79/+75
| | | | | | | | | other than UART 0 from the outset. o) Print board information from sysinfo after consoles have been initialized rather than doing it during boot descriptor parsing. o) Use cvmx_safe_printf and platform_reset rather than panic when doing very early boot descriptor parsing before the console is set up. o) Get rid of the global octeon_bootinfo.
* Add preliminary Octeon PCI console support. Radisys-specific PCI consolejmallett2012-11-132-0/+124
| | | | | support may follow soon (it uses a proprietary memory layout, but operation looks pretty trivial.)
* Don't disable PCIe just because the host is not a PCI host; the latter flagjmallett2012-11-011-4/+4
| | | | | only applies to non-PCIe systems. If PCIe is in target mode, it will simply and gracefully fail to attach of its own accord.
* Fix longstanding misprint.jmallett2012-10-311-1/+1
|
* If the CF physical base is 0, attach no CF devices. This fixes a warningjmallett2012-10-311-0/+2
| | | | | about a 0 passed to cvmx_phys_to_ptr on systems without a CF interface, such as the RSYS4GBE.
* Actually check board type rather than using a specialized octeon_is_simulationjmallett2012-10-308-30/+9
| | | | function.
OpenPOWER on IntegriCloud