summaryrefslogtreecommitdiffstats
path: root/sys/mips
Commit message (Collapse)AuthorAgeFilesLines
* Merge the 1 and 2 byte versions of the atomic functions into one.ed2013-06-081-207/+108
| | | | | | | | After pushing in my fix for the 2 byte functions, I realized that the functions for 1 and 2 byte operations had become identical. Reduce the code size by merging the functions for 1 and 2 byte operations together. While there, slightly improve variable naming and comments.
* Add 8devices CARAMBOLA2 support.adrian2013-06-082-0/+162
| | | | | | | | | | This is based on the AR933x (Hornet) SoC from Qualcomm Atheros. It's a much nicer board to do development on - 64MB RAM, 16MB flash. The development board breaks out the GPIO pins, ethernet, serial (via a USB<->RS232 chip), USB host and of course a small wifi antenna. Everything but the wifi works thus far.
* Actually make the 2-byte atomics work.ed2013-06-081-33/+87
| | | | | | | | | Even though I tested the 1-byte operations on arbitrarily aligned bytes, it seems I did not do this for the 2-byte operations. Create easy to read functions that are used to get/put bytes and halfwords in words. To keep the compiler happy, explicitly read two bytes into a union to obtain a 16-bit value.
* Add proper __sync_*() intrinsics for MIPS.ed2013-06-081-0/+436
| | | | | | | | | | | | | | | | | | | | To make <stdatomic.h> work on MIPS (and ARM) using GCC, we need to provide implementations of the __sync_*() functions. I already added these functions for 4 and 8 byte types to libcompiler-rt some time ago, based on top of <machine/atomic.h>. Unfortunately, <machine/atomic.h> only provides a subset of the features needed to implement <stdatomic.h>. This means that in some cases we had to do compare-and-exchange calls in loops, where a simple ll/sc would suffice. Also implement these functions for 1 and 2 byte types. MIPS only provides ll/sc instructions for 4 and 8 byte types, but this is of course no limitation. We can simply load 4 bytes and use some bitmask tricks to modify only the bytes affected. Discussed on: mips, arch Tested with: QEMU
* Don't assign the copyright to the FreeBSD foundation for the yearsmarcel2013-05-291-1/+0
| | | | | | | this file is in FreeBSD. There's formality to this that hasn't happened and Juniper is perfectly fine with being the holder. Discussed with: eadler, imp, jhb
* Change the copyright notice to a standard BSD 2-clause license and assignmarcel2013-05-231-0/+22
| | | | | | | | | | | | | | | ownership to the FreeBSD foundation for the years this file has been in the FreeBSD repository. This file was originally created by Juniper as part of upgrading to FreeBSD 4.10 (which had no MIPS support) and held functions found on other machines It grew actual functionality over time. The functionaliy was copied from other architectures and ported to MIPS on a as-needed basis. Approved by: Mark Baushke (Juniper IP) Approved by: Megan Sugiyama (Juniper legal) Pointed out by: jmallett@ Requested by: core (jhb@)
* o Relax locking assertions for vm_page_find_least()attilio2013-05-211-1/+2
| | | | | | | | | | | | o Relax locking assertions for pmap_enter_object() and add them also to architectures that currently don't have any o Introduce VM_OBJECT_LOCK_DOWNGRADE() which is basically a downgrade operation on the per-object rwlock o Use all the mechanisms above to make vm_map_pmap_enter() to work mostl of the times only with readlocks. Sponsored by: EMC / Isilon storage division Reviewed by: alc
* Fix several typoseadler2013-05-121-1/+1
| | | | | | PR: kern/176054 Submitted by: Christoph Mallon <christoph.mallon@gmx.de> MFC after: 3 days
* Tidy up some CVS workarounds.peter2013-05-122-2/+0
|
* Add commented out OCTEON_VENDOR_GEFESimp2013-05-101-0/+1
|
* MFp4 CH=227440:bz2013-05-092-134/+134
| | | | | | | | | Convert the structures to C99 style initialisation, which makes it a lot easier to check that all of them are set and to generate a derived template from them. Sponsored by: DARPA, AFRL MFC after: 2 weeks
* Add some missing arge MDIO hints.adrian2013-05-091-0/+6
| | | | Submitted by: Luiz Otavio O Souza <loos.br@gmail.com>
* Modify the routerstation config to use ukswitch for now.adrian2013-05-082-2/+13
| | | | | | | | Until an ADM6996 driver shows up, this allows for the two switch ports to be used. Submitted by: Luiz Otavio O Souza <loos.br@gmail.com> Reviewed by: ray
* Rename VM_NDOMAIN into MAXMEMDOM and move it into machine/param.h inattilio2013-05-072-7/+4
| | | | | | | | | order to match the MAXCPU concept. The change should also be useful for consolidation and consistency. Sponsored by: EMC / Isilon storage division Obtained from: jeff Reviewed by: alc
* Use cvmx_mgmt_port_num_ports() instead of the inlined copy of aimp2013-05-022-16/+2
| | | | previous version of this function.
* Add the AR933x SoC GPIO pin count limitation.adrian2013-05-021-0/+5
|
* Don't include asm.h in non-asm files.imp2013-05-014-119/+55
| | | | | | Remove #define to get kludges that asm.h used to define Move clever macros to access assembler instructions to trap.c Remove __ASSEMBLER__ ifdefs in regdef.h: they aren't needed anymore.
* Remove asm.h dependency in a hackish way.imp2013-05-011-5/+17
| | | | Fixed comment.
* Import NetBSD's version, which is perfectly fine.imp2013-05-011-38/+76
| | | | Submitted by: jmallet@
* Add the standard #ifdef header protection.imp2013-05-011-0/+5
|
* Import virgin regdef.h from 4.4 Lite 2's sys/pmax/include/regdef.h,imp2013-05-011-81/+62
| | | | | | | expand the %sccs.include.redist.c% directive with the standard 3-clause license, and add $FreeBSD$ to keep the commit script happy. # This may break some mips stuff, which will be fixed in the next commit.
* 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.
* Minor whitespace nitimp2013-04-251-1/+1
|
* Use the offsets from pcb.h rather than regnum.h to store the registersimp2013-04-253-84/+68
| | | | | | | | | in the pcb. setjmp/longjmp in the kernel also used these values, so continue to use them although their use isn't technically the pcb register array (matching is all that's important for setjmp/longjmp in the kernel). Finally, eliminate the old register names from regnum.h. This is a lexical change only. The non-debug .o files have the same md5.
* Make it possible to include this file in assembler .S sources.imp2013-04-251-13/+14
|
* Use the defines from pcb.h over the ones from regnum.h for this 'C'imp2013-04-251-3/+3
| | | | | code. In theory, the ones from regnum.h should be used only for assembler code.
* Fix N32/N64 ABIs to use proper registers after recent changes.imp2013-04-241-8/+8
| | | | Pointy Hat to: imp
* Update trapframe to be consistent with the changes made to regnum.h. Thisimp2013-04-235-14/+62
| | | | should fix the booting problems people have been seeing.
* MFP4 223084, 227821:brooks2013-04-222-0/+77
| | | | | | | | | | | | Partially implement generic_bs_*_8() for MIPS platforms. This is known to work with TARGET_ARCH=mips64 with FreeBSD/BERI. Assuming that other definitions in cpufunc.h are correct it will work on non-o64 ABI systems except sibyte. On sibyte and o32 systems generic_bs_*_8() will remain panic() implementations. Sponsored by: DARPA, AFRL Reviewed by: imp, jmallett (older versions)
* Add the static kernel boot environment, needed to actually boot this thing.adrian2013-04-171-0/+6
| | | | | | | | | (Wasting 4k just as a temporary placeholder for a boot environment seems a bit ridiculous, but hey.) Tested: gxemul: $ gxemul -e malta -d i:/home/adrian/work/freebsd/svn/mfsroot-rspro.img -C 4Kc /tftpboot/kernel.MALTA
* Point to regdef.h. May need to dig up references to the N32 standardimp2013-04-161-1/+1
| | | | | that support this usage (which may be a bit rough, since different parts of the standard say mutually contradictory things).
* Fix N32/N64 register saving by ensuring that all registers resolveimp2013-04-151-3/+31
| | | | | | | | | | | | | | to unique values. There's some confusion about what the n32 assembler API really is (since on page 9 of the spec they say that t0-t3 don't exist, then turn around on page 22 and say that t4-t7 don't exist), and this doesn't touch that. NetBSD's version of this file follows the convention I used here, and is likely to be correct. This should fix gdb/ptrace.
* Fix undefined behaviour in several gpio_pin_setflags() routines (underdim2013-04-133-6/+6
| | | | | | | | | 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
* Move MIPS_MAX_TLB_ENTRIES definition from cpuregs.h to tlb.cjchandra2013-04-122-6/+22
| | | | | | | | | | | | | | | Having MIPS_MAX_TLB_ENTRIES defined to 128 is misleading, since it used to be 64 in older releases of MIPS architecture (where it could be read from Config1) and can be much more than 128 for the newer processors. For now, move the definition to the only file using it (mips/mips/tlb.c) and define MIPS_MAX_TLB_ENTRIES depending on the MIPS cpu defined. Also add few checks so that we do not write beyond the end of the tlb_state array. This fixes a kernel data corruption seen in Netlogic XLP, which was casued by tlb_save() writing beyond the end of tlb_state array when breaking into debugger.
* 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.
* Merge from projects/counters: counter(9).glebius2013-04-081-0/+54
| | | | | | | | | | | | | Introduce counter(9) API, that implements fast and raceless counters, provided (but not limited to) for gathering of statistical data. See http://lists.freebsd.org/pipermail/freebsd-arch/2013-April/014204.html for more details. In collaboration with: kib Reviewed by: luigi Tested by: ae, ray Sponsored by: Nginx, Inc.
* Merge from projects/counters:glebius2013-04-081-1/+17
| | | | | | | Pad struct pcpu so that its size is denominator of PAGE_SIZE. This is done to reduce memory waste in UMA_PCPU_ZONE zones. Sponsored by: Nginx, Inc.
* Add the basic GPIO pin mapping to the hints file.adrian2013-04-051-29/+13
| | | | | | Tested: * AP121 board, tested USB/jumpstart LEDs
* Implement USB device reset and poweron.adrian2013-04-051-35/+6
| | | | | | Tested: * Atheros AP131, AR9331 SoC
* Fix AR933x USB support - this needs the same controller initialisationadrian2013-04-051-0/+2
| | | | | | | | | as the AR7242. Tested: * Atheros AP121, AR9331 * ZyDas wifi device, and 64MB (yes, ew) USB flash storage
* Add AP121 ethernet / switch PHY support.adrian2013-04-052-34/+28
| | | | | | | | | | | | | | | * arge0 is MII * arge1 is GMII * the MDIO bus is on arge1, not arge0 * the default switch config is to have ports 0-3 as the switch group, with port 4 being an external PHY dedicated to arge0 (ie, 'cpu' port.) Whilst I'm here, remove unused bits and pieces from the config. Tested: * AP121, ping on both arge0 and arge1 * Tested switch port detection using etherswitchcfg
* Implement the AR933x ethernet support.adrian2013-04-053-1/+24
| | | | Obtained from: OpenWRT
* Now that interrupt driven uart IO is working, flip this back on.adrian2013-04-051-1/+1
|
* Implement the AR933x interrupt driven UART code.adrian2013-04-051-46/+103
| | | | | | | | | | | | | | | | | | | | | | | | * Enable RX and host interrupts during bus probe/attach * Disable all interrupts (+ host ISR) during bus detach * Enable TX DONE interrupt only when we start transmitting; clear it when we're done. * The RX/TX FIFO depth is still conjecture on my part. I'll fix this shortly. * The TX FIFO interrupt isn't an "empty" interrupt, it's an "almost empty" interrupt. Sigh. So.. * .. in ar933x_bus_transmit(), wait for the FIFO to drain before continuing. I dislike having to wait for the FIFO to drain, alas. Tested: * Atheros AP121 board, AR9331 SoC. TODO: * RX/TX overflow, RX error, BREAK support, etc. * Figure out the true RX/TX FIFO depth.
* AR9330/AR9331 also needs to ACK the APB interrupt register, same asadrian2013-04-051-0/+2
| | | | | | | AR724x. This fixes 'stuck interrupt' problems I was having when writing the uart interrupt code.
* * Add AR9330/AR9331 to the soc identifier enum;adrian2013-04-052-1/+5
| | | | * Set it when probing the CPU type.
* Use geom_uncompress here; we need this to fit in a 4MB flash part.adrian2013-04-051-3/+3
|
* Implement AR933x polled IO uart bus code.adrian2013-04-042-317/+113
| | | | | | | | | | | | | | | | This implements the bus transmit/receive/sigchg/ipend methods with a polled interrupt handler (ipend) rather than enabling hardware interrupts. The FIFO is faked at 16 bytes deep for now, just so the transmit IO side doesn't suck too bad (the callout frequency limits how quickly IO is flushed to the sender, rather than scheduling the callout more frequently whilst there's active TX. But I digress.) Tested: * Atheros AP121 (AR9330) reference board, booting to multi-user interactive mode.
* Remove all legacy ATA code parts, not used since options ATA_CAM enabled inmav2013-04-047-7/+0
| | | | | | | | | most kernels before FreeBSD 9.0. Remove such modules and respective kernel options: atadisk, ataraid, atapicd, atapifd, atapist, atapicam. Remove the atacontrol utility and some man pages. Remove useless now options ATA_CAM. No objections: current@, stable@ MFC after: never
* Fix low-level uart drivers that set their fifo sizes in the softc too late.ian2013-04-012-6/+6
| | | | | | | | | uart(4) allocates send and receiver buffers in attach() before it calls the low-level driver's attach routine. Many low-level drivers set the fifo sizes in their attach routine, which is too late. Other drivers set them in the probe() routine, so that they're available when uart(4) allocates buffers. This fixes the ones that were setting the values too late by moving the code to probe().
OpenPOWER on IntegriCloud