aboutsummaryrefslogtreecommitdiff
path: root/sys/arm/at91
Commit message (Collapse)AuthorAgeFilesLines
* Move remaining code and data related to static device mapping into theIan Lepore2013-11-042-4/+6
| | | | | | | | | | new devmap.[ch] files. Emphasize the MD nature of these things by using the prefix arm_devmap_ on the function and type names (already a few of these things found their way into MI code, hopefully it will be harder to do by accident in the future). Notes: svn path=/head/; revision=257660
* Fix typo. Sorry!Nathan Whitehorn2013-10-291-1/+1
| | | | Notes: svn path=/head/; revision=257370
* A last BUS_PROBE_NOWILDCARD. Move setting the postfilter function into theNathan Whitehorn2013-10-291-2/+3
| | | | | | | | attach function probe shouldn't actually set anything up but just bid on the device. Notes: svn path=/head/; revision=257343
* Sweep up a bit of arm-land fallout after r257244; include necessaryIan Lepore2013-10-281-0/+1
| | | | | | | headers directly that are no longer available via accidental include. Notes: svn path=/head/; revision=257258
* Remove #include <machine/frame.h> from all the arm code that doesn'tIan Lepore2013-10-272-2/+0
| | | | | | | | | really need it. That would be almost everywhere it was included. Add it in a couple files that really do need it and were previously getting it by accident via another header. Notes: svn path=/head/; revision=257200
* Replace kernel virtual address space allocation with vmem. This providesJeff Roberson2013-08-071-1/+1
| | | | | | | | | | | | | | | | transparent layering and better fragmentation. - Normalize functions that allocate memory to use kmem_* - Those that allocate address space are named kva_* - Those that operate on maps are named kmap_* - Implement recursive allocation handling for kmem_arena in vmem. Reviewed by: alc Tested by: pho Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=254025
* Fix regression issue after r248910.Hans Petter Selasky2013-04-072-3/+3
| | | | | | | | PR: arm/177685 Submitted by: Christoph Mallon <christoph.mallon@gmx.de> Notes: svn path=/head/; revision=249232
* Enable hardware flow control and high speed bulk data transfer in at91 uarts.Ian Lepore2013-04-011-53/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes to make rtc/cts flow control work... This does not turn on the builtin hardware flow control on the SoC's usart device, because that doesn't work on uart1 due to a chip erratum (they forgot to wire up pin PA21 to RTS0 internally). Instead it uses the hardware flow control logic where the tty layer calls the driver to assert and de-assert the flow control lines as needed. This prevents overruns at the tty layer (app doesn't read fast enough), but does nothing for overruns at the driver layer (interrupts not serviced fast enough). To work around the wiring problem with RTS0, the driver reassigns that pin as a GPIO and controls it manually. It only does so if given permission via hint.uart.1.use_rts0_workaround=1, to prevent accidentally driving the pin if uart1 is used without flow control (because something not related to serial IO could be wired to that pin). In addition to the RTS0 workaround, driver changes were needed in the area of reading the current set of DCE signals. A priming read is now done at attach() time, and the interrupt routine now sets SER_INT_SIGCHG when any of the DCE signals change. Without these changes, nothing could ever be transmitted, because the tty layer thought CTS was de-asserted (when in fact we had just never read the status register, and the hwsig variable was init'd to CTS de-asserted). Changes to support bulk high-speed (230kbps and higher) data reception... Allow the receive fifo size to be tuned with hint.uart.<dev>.fifo_bytes. For high speed receive, a fifo size of 1024 works well. The default is still 128 bytes if no hint is provided. Using a value larger than 384 requires a change in dev/uart/uart_core.c to size the intermediate buffer as MAX(384, 3*sc->sc_rxfifosize). Recalculate the receive timeout whenever the baud rate changes. At low baud rates (19.2kbps and below) the timeout is the number of bits in 2 characters. At higher speed it's calculated to be 500 microseconds worth of bits. The idea is to compromise between being responsive in interactive situations and not timing out prematurely during a brief pause in bulk data flow. The old fixed timeout of 1.5 characters was just 32 microseconds at 460kbps. At interrupt time, check for receiver holding register overrun status and set the corresponding status bit in the return value. When handling a buffer overrun, get a single buffer emptied and handed back to the hardware as quickly as possible, then deal with the second buffer. This at least minimizes data loss compared to the old logic that fully processed both buffers before restarting the hardware. Rewrite the logic for handling buffers after a receive timeout. The original author speculated in a comment that there may be a race with high speed data. There was, although it was rare. The code now handles all three possible scenarios on receive timeout: two empty buffers, one empty and one partial buffer, or one full and one partial buffer. Reviewed by: imp Notes: svn path=/head/; revision=248964
* Fix a typo in the CF device driver name that prevented instantiation.Ian Lepore2013-03-311-1/+1
| | | | Notes: svn path=/head/; revision=248944
* Add userland access to at91 gpio functionality via ioctl calls. Also,Ian Lepore2013-03-292-29/+228
| | | | | | | | | | | | | | | | | add the ability for userland to be notified of changes on gpio pins via a select(2)/read(2) interface. Change the interrupt handler from filtered to threaded. Because of the uiomove() calls in the new interface, change locking from standard mutex to sx. Add / restore the at91_gpio_high_z() function. Reviewed by: imp (long ago) Notes: svn path=/head/; revision=248911
* Change the API for at91_pio_gpio_get() to return the entire masked setIan Lepore2013-03-291-3/+1
| | | | | | | | | of bits, not just a 0/1 indicating whether any of the masked bits are on. This is compatible with the single in-tree caller of this function right now (at91_vbus_poll() in dev/usb/controller/at91dci_atemelarm.c). Notes: svn path=/head/; revision=248910
* Call soc_info.soc_data->soc_clock_init() before at91_pmc_init_clock(), soIan Lepore2013-03-291-2/+11
| | | | | | | | that the latter correctly fills in the clock data structures based on proper hardware-specific shift and mask values from the soc_data structure. Notes: svn path=/head/; revision=248909
* Redo the workaround for at91rm9200 erratum #26 in a way that doesn'tIan Lepore2013-03-291-15/+9
| | | | | | | cause a lockup on some rm92 hardware. Notes: svn path=/head/; revision=248904
* Fix a typo: the RXD0 pin is PA18, not PA19.Ian Lepore2013-03-291-1/+1
| | | | Notes: svn path=/head/; revision=248902
* Remove a really noisy printf left over from debugging hardware errata.Ian Lepore2013-03-291-2/+0
| | | | Notes: svn path=/head/; revision=248899
* Functions m_getm2() and m_get2() have different order of arguments,Gleb Smirnoff2013-03-121-2/+2
| | | | | | | | | | and that can drive someone crazy. While m_get2() is young and not documented yet, change its order of arguments to match m_getm2(). Sorry for churn, but better now than later. Notes: svn path=/head/; revision=248207
* Use m_get2() to get an mbuf of appropriate size.Gleb Smirnoff2013-03-121-6/+3
| | | | | | | | Reviewed by: marius Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=248189
* Eliminate a redundant #include: machine/pmap.h is already includedAlan Cox2013-02-261-1/+0
| | | | | | | through vm/pmap.h. Notes: svn path=/head/; revision=247313
* Merge from vmobj-rwlock branch:Attilio Rao2013-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 Notes: svn path=/head/; revision=247297
* Initialize vm_max_kernel_address on non-FDT platforms. (This should haveAlan Cox2013-02-201-1/+2
| | | | | | | | | | | been included in r246926.) The second parameter to pmap_bootstrap() is redundant. Eliminate it. Reviewed by: andrew Notes: svn path=/head/; revision=247046
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-052-6/+6
| | | | | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually Notes: svn path=/head/; revision=243882
* Unbreak building a kernel with EHCI: there's no ehci_atmelarm.c.Marcel Moolenaar2012-11-261-1/+0
| | | | Notes: svn path=/head/; revision=243575
* Reduce differences between these two initarms a bit more.Warner Losh2012-11-081-15/+19
| | | | Notes: svn path=/head/; revision=242746
* Minor cosmetic changes to bring atmel's initarm and the defaultWarner Losh2012-11-071-5/+5
| | | | | | | initarm for FDT closer together. More to follow. Notes: svn path=/head/; revision=242700
* Loop reading the RTC registers until the same values are obtainedWarner Losh2012-10-071-3/+14
| | | | | | | | | twice, as advised in the atmel docs. Submitted by: Ian Lapore Notes: svn path=/head/; revision=241333
* Improve a few comments.Warner Losh2012-10-071-6/+11
| | | | Notes: svn path=/head/; revision=241308
* Use the RTC unit to get the time. This works on all known AT91SAM9*Warner Losh2012-10-072-25/+136
| | | | | | | | | | | | processors, either on reboot or after power down with battery backup. However, the AT91RM9200 RTC always resets on reboot making it just about useless at the moment (if we support a low-power mode or an extended sleep mode, it might become useful). Submitted by: Ian Lepore Notes: svn path=/head/; revision=241307
* Create a common set_stackptrs in sys/arm/machdep.c.Andrew Turner2012-09-221-11/+2
| | | | | | | | | | On single core devices set_stackptrs is only ever called with cpu = 0 in initarm and will be identical to the existing function. On SMP this needs to be implemented for sys/arm/mp_machdep.c, but the implementations are identical for each SoC. Notes: svn path=/head/; revision=240802
* Make this work on the AT91SAM9G20:Warner Losh2012-08-291-9/+22
| | | | | | | | | | | | o Disable multi-block operations: they sometimes fail. o Don't use the PROOF bits yet: they hang the system hard. o Disable the the multi-block operations for !rm9200, but it still doesn't help. o Fix writing < 12 bytes errata to actually work. o Enable, for the moment, reporting extra bytes soaked up. Notes: svn path=/head/; revision=239805
* When copying data, use memcpy instead of bcopy. It matches theWarner Losh2012-08-291-7/+7
| | | | | | | | | arguments better. Also, set the need to use the workaround flag before we actually need to use it, rather than after. Notes: svn path=/head/; revision=239804
* Make AT91_MCI_ALLOW_OVERCLOCK a real option. Rename old use 30MHz toWarner Losh2012-08-281-86/+89
| | | | | | | | this new option. Only try to use > 25MHz when our best frequency is < 15MHz and overclocking is enabled. Fix minor style chaff. Notes: svn path=/head/; revision=239785
* Clip the upper end to 31MHz for slow clock speeds. On fasterWarner Losh2012-08-281-5/+6
| | | | | | | machines, we wind up with a 66MHz clock, which is too fast. Notes: svn path=/head/; revision=239780
* Move to using a flag instead of checking the CPU type eachWarner Losh2012-08-281-2/+9
| | | | | | | transaction for the MCI1 rev 2.x write workarounds. Notes: svn path=/head/; revision=239764
* Style: Move these routines to be before the forward declared functionsWarner Losh2012-08-281-12/+12
| | | | | | | as is the normal practice. Notes: svn path=/head/; revision=239763
* Bring in the multi-block patches for mci. These required extensiveWarner Losh2012-08-281-193/+664
| | | | | | | | | | | | | | | | restructuring of the driver. I've tried to preserve the other silicon workarounds that we've added over the years, but haven't had a chance to extensively test on other hardware. On my AT91RM9200 with 30MHz/1 wire/64 block transfers, I've been able to go from ~.66MB/s to 2.25MB/s in the simple tests I performed, almost a 3.5x improvement. This cuts the boot time almost in half when everything else goes right (timed from rtc message to login: prompt). PR: 155214 Submitted by: Ian Lapore Notes: svn path=/head/; revision=239762
* Add hint and sysctl support for 4 wire mode.Warner Losh2012-08-271-7/+13
| | | | | | | | PR: 155241 Submitted by: Ian Lapore Notes: svn path=/head/; revision=239721
* Minor style(9) nit.Warner Losh2012-08-271-1/+2
| | | | Notes: svn path=/head/; revision=239720
* Don't puprosely overclock the SD bus to 30MHz, make the userWarner Losh2012-08-271-11/+91
| | | | | | | | | | | | | | | | | explicltly enable that. The driver chose to use 60MHz / 2 (30MHz) most of the time rather than 60MHz / 4 (15MHz) based on the Linux driver of the time. This pushes the spec a little in order to not suffer the penalty of running at 15MHz. However, when other bus masters are active in the system, and the user tries 4-wire mode, the internal bus arbitration would fail with data loss as a result. # Comments from PR were reworked to reflect my historical perspective PR: 155214 (partial) Submitted by: Ian Lepore Notes: svn path=/head/; revision=239719
* Fetch the chip select in the bridge driver, like all the other spiWarner Losh2012-08-231-5/+9
| | | | | | | bridges do. Notes: svn path=/head/; revision=239626
* Use proper resource type when freeing.Warner Losh2012-08-231-1/+1
| | | | | | | Submitted by: Ian Lapore (indirectly in a larger patch) Notes: svn path=/head/; revision=239623
* Make some at91_pcm_xxx() functions NULL safe.Hans Petter Selasky2012-08-211-1/+6
| | | | Notes: svn path=/head/; revision=239530
* Set machine correctly on ARM. This allows universe to use the correct worldAndrew Turner2012-08-184-5/+4
| | | | | | | | | when building each kernel. Reviewed by: imp Notes: svn path=/head/; revision=239362
* Preliminary Embest ATEB9200 support.Warner Losh2012-08-163-0/+79
| | | | Notes: svn path=/head/; revision=239324
* Unbreak build for the rest of AT91 platformsOleksandr Tymoshenko2012-08-152-0/+2
| | | | Notes: svn path=/head/; revision=239308
* Unbreak ATMEL kernel buildOleksandr Tymoshenko2012-08-151-0/+1
| | | | Notes: svn path=/head/; revision=239291
* Merging projects/armv6, part 1Oleksandr Tymoshenko2012-08-152-5/+2
| | | | | | | | | | | | Cummulative patch of changes that are not vendor-specific: - ARMv6 and ARMv7 architecture support - ARM SMP support - VFP/Neon support - ARM Generic Interrupt Controller driver - Simplification of startup code for all platforms Notes: svn path=/head/; revision=239268
* Correct the PLLA setting functions and centralize.Warner Losh2012-08-115-70/+41
| | | | Notes: svn path=/head/; revision=239190
* Update comments about setting PLLA and refernce the tables in theWarner Losh2012-08-111-6/+15
| | | | | | | datasheet that express the limits. Notes: svn path=/head/; revision=239189
* Don't use C++ comments.Warner Losh2012-08-111-11/+12
| | | | Notes: svn path=/head/; revision=239188
* More comments about setting PLLA, or rather that we never do.Warner Losh2012-08-101-7/+12
| | | | Notes: svn path=/head/; revision=239168