summaryrefslogtreecommitdiffstats
path: root/sys/mips/nlm
Commit message (Collapse)AuthorAgeFilesLines
* 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
* sys: use our nitems() macro when param.h is available.pfg2016-04-211-2/+2
| | | | | | 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
* mips: for pointers replace 0 with NULL.pfg2016-04-151-1/+1
| | | | | | | | These are mostly cosmetical, no functional change. Found with devel/coccinelle. Reviewed by: adrian
* Add a new PCI bus interface method to alloc the ivars (dinfo) for a device.jhb2016-04-151-2/+2
| | | | | | | | | | | | | | The ACPI and OFW PCI bus drivers as well as CardBus override this to allocate the larger ivars to hold additional info beyond the stock PCI ivars. This removes the need to pass the size to functions like pci_add_iov_child() and pci_read_device() simplifying IOV and bus rescanning implementations. As a result of this and earlier changes, the ACPI PCI bus driver no longer needs its own device_attach and pci_create_iov_child methods but can use the methods in the stock PCI bus driver instead. Differential Revision: https://reviews.freebsd.org/D5891
* Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.jhibbits2016-03-182-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some architectures, u_long isn't large enough for resource definitions. Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but type `long' is only 32-bit. This extends rman's resources to uintmax_t. With this change, any resource can feasibly be placed anywhere in physical memory (within the constraints of the driver). Why uintmax_t and not something machine dependent, or uint64_t? Though it's possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on 32-bit architectures. 64-bit architectures should have plenty of RAM to absorb the increase on resource sizes if and when this occurs, and the number of resources on memory-constrained systems should be sufficiently small as to not pose a drastic overhead. That being said, uintmax_t was chosen for source clarity. If it's specified as uint64_t, all printf()-like calls would either need casts to uintmax_t, or be littered with PRI*64 macros. Casts to uintmax_t aren't horrible, but it would also bake into the API for resource_list_print_type() either a hidden assumption that entries get cast to uintmax_t for printing, or these calls would need the PRI*64 macros. Since source code is meant to be read more often than written, I chose the clearest path of simply using uintmax_t. Tested on a PowerPC p5020-based board, which places all device resources in 0xfxxxxxxxx, and has 8GB RAM. Regression tested on qemu-system-i386 Regression tested on qemu-system-mips (malta profile) Tested PAE and devinfo on virtualbox (live CD) Special thanks to bz for his testing on ARM. Reviewed By: bz, jhb (previous) Relnotes: Yes Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D4544
* Let rman_init() initialize the default rman range.jhibbits2016-03-031-8/+0
| | | | | If rm_start and rm_end are both 0 on input to rman_init(), rman_init() pre-initializes them to the default range. No need to set it before.
* As <machine/param.h> is included from <sys/param.h>, there is no needskra2016-02-222-2/+0
| | | | | | | to include it explicitly when <sys/param.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5378
* As <machine/pmap.h> is included from <vm/pmap.h>, there is no need toskra2016-02-221-1/+0
| | | | | | | include it explicitly when <vm/pmap.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5373
* Introduce a RMAN_IS_DEFAULT_RANGE() macro, and use it.jhibbits2016-02-201-1/+1
| | | | | | | | | | | 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
* Convert rman to use rman_res_t instead of u_longjhibbits2016-01-271-2/+2
| | | | | | | | | | | | | | | | | | | | 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
* Stop calling fdt_immr_addr from the xlp startup code. It's used to setandrew2016-01-221-2/+0
| | | | fdt_immr_{va,pa,size}, but these are not used outside a single ARM SoC.
* 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
* CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenjkim2015-05-221-1/+1
| | | | | | | | | | 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
* Use sbuf_printf() for sysctl strings instead of static buffers and snprintf.ian2015-03-141-12/+8
|
* Whitespace fixes for sys/mips/nlm/devjchandra2015-02-2816-131/+121
| | | | | Clean up whitespace issues under sys/mips/nlm/dev. No functional change in this commit.
* Whitespace fixes for files in sys/mips/nlmjchandra2015-02-2831-190/+191
| | | | | Clean up whitespace issues under sys/mips/nlm (except dev). No functional change in this commit.
* Add subclass of simplebus for Broadcom XLPjchandra2015-02-275-443/+363
| | | | | | | | | This will override the resource allocation of simplebus, and also merge the resource allocation code which was in xlp_pci.c. With this change the SoC devices that does not have proper PCI resources will be on the FDT simplebus. We can remove sys/mips/nlm/dev/cfi_pci_xlp.c and sys/mips/nlm/dev/uart_pci_xlp.c
* Move PCI bus below simplebus for Broadcom XLPjchandra2015-02-271-12/+10
| | | | | This will enable us to do common allocation code for memory and interrupts for SoC devices as well as PCI devices.
* Improve additional interrupt ACK for Broadcom XLPjchandra2015-02-273-33/+35
| | | | | | | | | | Handling some interrupts in XLP (like PCIe and SATA) involves writing to vendor specific registers as part of interrupt acknowledgement. This was earlier done with xlp_establish_intr(), but a better solution is to provide a function xlp_set_bus_ack() that can be used with cpu_establish_hardintr(). This will allow platform initialization code to setup these ACKs without changing the standrard drivers.
* Remove run-time allocation of XLP IRQsjchandra2015-02-264-138/+118
| | | | | Follow the same static IRQ to Interrupt Table Entry mapping as the other OS supported on XLP.
* Add netlogic,xlp-pic as interrupt controller for XLPjchandra2015-02-261-0/+40
| | | | | Add an empty driver for netlogic,xlp-pic to ensure that the device tree is correct and has an interrupt controller.
* Fix up interrupt definitions for Broadcom XLPjchandra2015-02-263-20/+16
| | | | | | Gather all the IRQ definitions to interrupt.h. Earlier these were in xlp.h and pic.h. Update the definition of XLP_IRQ_IS_PICINTR to check for last irq as well.
* Follow up to r225617. In order to maximize the re-usability of kernel codedavide2014-10-161-5/+5
| | | | | | | | in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv(). This fixes a namespace collision with libc symbols. Submitted by: kmacy Tested by: make universe
* Mechanically convert to if_inc_counter().glebius2014-09-191-6/+3
|
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thiseadler2013-11-302-3/+3
| | | | | | | | | | | | | shifts into the sign bit. Instead use (1U << 31) which gets the expected result. This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Discussed with: -arch, rdivacky Reviewed by: cperciva
* nclude missing net/if_var.h.andre2013-10-301-0/+1
| | | | Due to header pollution it wasn't noticed before.
* Panics about how things can't be attached should probably happen in thenwhitehorn2013-10-291-3/+3
| | | | | | attach method rather than probe. Submitted by: brooks
* Devices that rely on hints or identify routines for discovery need tonwhitehorn2013-10-292-3/+4
| | | | | | | 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
* Fixes for the Netlogic XLP on-chip RSA block driverjchandra2013-10-041-79/+77
| | | | | | | | | | | | | | | The changes are to: * Use contigmalloc/contigfree which handling microcode buffer * Use a different buffer to send microcode to each engine * Swap microcode in little-endian compilation * Fix freeback message queue id field * Simplify xlp_get_rsa_opsize() to remove unnecessary checks * Fix NULL check after use in xlp_free_cmd_params() * Do better error handling when the hardware returns error * Fix error codes in few cases Submitted by: Vekatesh J. V. <venkatesh.vivekanandan@broadcom.com> Approved by: re (hrs)
* Style fixes for the Netlogic XLP RSA driverjchandra2013-10-042-72/+75
| | | | | | | | | | | Updates to the Netlogic XLP on-chp RSA block driver. The changes are to follow style(9) guidelines, to improve readability and to remove unnecessary initialization. No changes to logic have been introduced by this commit. Submitted by: Venkatesh J. V. <venkatesh.vivekanandan@broadcom.com> Approved by: re (hrs)
* Netlogic XLP network driver updatejchandra2013-09-0710-301/+222
| | | | | | | | | | Changes are to - update board and network interface detection logic - fix reading onboard CPLD in little-endian config - print NAE frequency conrrectly for Bx chips - update XAUI config to disable Rx/Tx until interface is up Submitted by: Venkatesh J V <venkatesh.vivekanandan@broadcom.com>
* Fix incorrect KASSERTs in xlpgejchandra2013-04-121-2/+2
| | | | | Fix for crash in Netlogic XLP network accelerator driver when invariants are enabled - use correct the condition for KASSERT.
* MFcalloutng:mav2013-02-281-17/+9
| | | | | | | Switch eventtimers(9) from using struct bintime to sbintime_t. Even before this not a single driver really supported full dynamic range of struct bintime even in theory, not speaking about practical inexpediency. This change legitimates the status quo and cleans up the code.
* Little-endian and other fixes for Broadcom XLP network driverjchandra2013-01-242-7/+9
| | | | | | | | | | | | | | | The changes are: - the microcore code loaded into the NAE has to be byteswapped in LE - the descriptors in memory for a P2P NAE descriptor has to be byteswapped in LE - the m_data pointer is already cacheline aligned, so the unnecessary m_adj to cacheline size can be removed - fix mask used to obtain physical address from the Tx freeback descriptor - fix a compile error in code under #ifdef Obtained from: Venkatesh J V <venkatesh.vivekanandan@broadcom.com>
* Fix credit configuration on Broadcom XLP CMSjchandra2013-01-241-2/+2
| | | | | | The CMS output queue credit configuration register is 64 bit, so use a 64 bit variable while updating it. Obtained from: Venkatesh J V <venkatesh.vivekanandan@broadcom.com>
* Broadcom XLP network driver update for XLP 8xx B1 revjchandra2013-01-244-13/+28
| | | | | | | | Update MDIO reset code to support Broadcom XLP B1 revisions. Update nlm_xlpge_ioctl, nlm_xlpge_port_enable need not be called after nlm_xlpge_init. Obtained from: Venkatesh J V <venkatesh.vivekanandan@broadcom.com>
* Minor updates to the Broadcom XLP NAE driverjchandra2013-01-242-23/+11
| | | | | Remove unnecessary SGMII initialization code from nae.c. While there clean up some prints and whitespace.
* Broadcom XLP updates for the new firmwarejchandra2013-01-242-3/+31
| | | | | | | Support few more versions of board firmware. In case the security block is disabled, enable it at boot. Also increase the excluded memory region to cover the area used by the firmware to initialize devices.
* Little-endian fix for PCI on Broadcom XLP.jchandra2013-01-241-2/+5
| | | | | | Update the function xlp_pcib_hardware_swap_enable() to do nothing when BYTE_ORDER is not BIG_ENDIAN. PCIe hardware swap is not requred in little-endian mode as the endianness matches that of CPU.
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-051-1/+1
| | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually
* Add correct range parameter in XLP DTSjchandra2012-08-211-1/+1
| | | | | | | | r239274 added support for ranges. Update XLP DTS to provide the correct range parameter for the XLP SoC bus. Also fix bus_space_map method for XLP bus space. Submitted by: Sreekanth M. <sreekanth.molagavalli@broadcom.com>
* Define and exclude DRAM regions used by hardware/bootloder on XLPjchandra2012-08-201-65/+73
| | | | | Fix xlp_mem_init() - remove the ad-hoc code for excluding memory regions and use an array of regions.
* Support Netlogic XLP 8xx B1 revisions in xlpge.jchandra2012-07-092-20/+36
| | | | | Updates to the MDIO access code for the new revision of the XLP chip.
* Identify Netlogic XLP 8xx B1 chip revisionsjchandra2012-07-092-0/+25
| | | | | Add functions to check for 8xx B0 and 3xx Ax revisions which will be used in network block initialization.
* Fix PCIe hardware swap configuration for Netlogic XLPjchandra2012-07-091-2/+2
| | | | | | The last 12 bits of the limit registers have to be set to 1. These bits are not significant in bridge BARs and are 0 on read, but the bits are valid in the swap limit register and needs to be set.
* Remove unnecessary assembly code.jchandra2012-03-292-30/+26
| | | | | The compiler should generate lw/sw corresponding to register operations.
* Supply endianness implied by the -m flag when compiling ucore code.jmallett2012-03-291-1/+1
|
* Fix little-endian built.jmallett2012-03-291-1/+1
|
OpenPOWER on IntegriCloud