aboutsummaryrefslogtreecommitdiff
path: root/sys/arm/allwinner
Commit message (Collapse)AuthorAgeFilesLines
* Bring a few simplifications to a10_gpio:Luiz Otavio O Souza2015-07-131-155/+103
| | | | | | | | | | | | | | o Return the real hardware state in gpio_pin_getflags() instead of keep the last state in an internal table. Now the driver returns the real state of pins (input/output and pull-up/pull-down) at all times. o Use a spin mutex. This is required by interrupts and the 1-wire code. o Use better variable names and place parentheses around them in MACROS. o Do not lock the driver when returning static data. Tested with gpioled(4) and DS1820 (1-wire) sensors on banana pi. Notes: svn path=/head/; revision=285484
* Return the FDT node of the GPIO controller to gpiobus. It is used by theLuiz Otavio O Souza2015-07-111-0/+11
| | | | | | | children of gpiobus. Notes: svn path=/head/; revision=285407
* Add the routines to activate the GMAC clock and setup the GMAC mode.Luiz Otavio O Souza2015-07-032-0/+45
| | | | | | | Tested on Cubieboard 2 and Banana pi. Notes: svn path=/head/; revision=285106
* Rename a10_emac_gpio_config() to a10_gpio_ethernet_activate() to make theLuiz Otavio O Souza2015-07-033-12/+12
| | | | | | | | | | | | | | | | change to GMAC easier on A20 SoCs. On A10 only the EMAC controller is available (fast ethernet), but on A20 there is also GMAC a high (or better) performant controller (gigabit ethernet). On A20 the both controllers uses the same pins to talk to the ethernet PHY (MII or RGMII) and they can be selected by the GPIO pin mux. There is work in progress to bring in GMAC support. Notes: svn path=/head/; revision=285105
* Remove duplicate and unnecessary includes.Luiz Otavio O Souza2015-07-032-11/+0
| | | | | | | While here remove an unused and wrong define. Notes: svn path=/head/; revision=285103
* Add AHCI attachment code for Allwinner A10/A20 SoCs.Luiz Otavio O Souza2015-07-034-0/+412
| | | | | | | | | | | | | | | | | | | | | | | | The Allwinner SoC has an AHCI device on its internal main bus rather than the PCI bus. This SoC is somewhat underdocumented, and its SATA controller is no exception. The methods to support this chip were harvested from the Linux Allwinner SDK, and then constants invented to describe what's going on based on low-level constants contained in the SATA standard and guess work. This SoC requires a specific AHCI channel setup in order to start the operations on the channel properly. Clock setup and AHCI channel setup idea came from NetBSD. Tested on Cubieboard 2 and Banana pi (and attachment on Cubieboard by Pratik Singhal). Differential Revision: https://reviews.freebsd.org/D737 Submitted by: imp Reviewed by: imp, ganbold, mav, andrew Notes: svn path=/head/; revision=285090
* Add DMA support for Allwinner MMC controller.Luiz Otavio O Souza2015-07-012-22/+237
| | | | | | | | | | | | | | | DMA handles all data transfers up to 128K or 16 segments and fallback to pio mode when DMA requirements are not met. The read performance has improved greatly while the write performance also showed some improvement but seems limited by the card type and quality. Submitted by: Pratik Singhal <pratiksinghal@freebsd.org> Sponsored by: Google Summer of Code 2015 Tested on: A10 (cubieboard) and A20 (cubieboard 2 and banana pi) Notes: svn path=/head/; revision=285017
* Add the MMC/SD driver for Allwinner SoCs.Luiz Otavio O Souza2015-05-215-1/+1007
| | | | | | | | | | | | | | | | | | | | | | | | | This is based on the patch sent by Alexander Fedorov with the following fixes/improvements: - Better error handling; - Clock is derived from PLL6 (obtained from netbsd); - No more unnecessary busy loops on interrupt handler; - style(9) fixes and code cleanup. I also want to thanks Martin Galvan who has sent an alternative implementation with some interesting fixes. Tested on CubieBoard2, Banana-Pi (thanks to netgate!) and Cubieboard1 (Pratik Singhal). This is intended to pave the way for the upcoming GSoC work (and make easier the build of images for the supported boards). PR: 196081 Submitted by: Alexander Fedorov <alexander.fedorov@rtlservice.com> Notes: svn path=/head/; revision=283253
* Add the gic to files.arm under "device gic" and use it with theAndrew Turner2015-05-101-2/+0
| | | | | | | | CUBIEBOARD2 config. This is common across a few SoCs so should be a common option. Notes: svn path=/head/; revision=282715
* Clean up the style to use "options<space><tab>".Andrew Turner2015-05-101-3/+3
| | | | Notes: svn path=/head/; revision=282707
* Set ARM_L2_PIPT for A10 and RPI2, they are probably missing by accident.Luiz Otavio O Souza2015-04-251-0/+2
| | | | | | | Noted by: Michal Meloun <meloun@miracle.cz> Notes: svn path=/head/; revision=281991
* Make a comment reflect reality.Marius Strobl2015-04-191-1/+2
| | | | Notes: svn path=/head/; revision=281752
* Move the items common to all SoCs to a single file.Luiz Otavio O Souza2015-04-185-30/+20
| | | | Notes: svn path=/head/; revision=281679
* Fix the style(9) and adds two missing parentheses on the licence.Luiz Otavio O Souza2015-04-181-81/+81
| | | | | | | | | Reduce the differences to bring in the MMC/SD driver. Approved by: ganbold (licence change) Notes: svn path=/head/; revision=281678
* Simplify the receiver code a bit.Luiz Otavio O Souza2015-04-182-54/+60
| | | | | | | Drain the RX FIFO and continue on failure. Notes: svn path=/head/; revision=281675
* Add the necessary support to use both TX queues available on if_emac.Luiz Otavio O Souza2015-04-172-12/+29
| | | | | | | | | | | | | | | Each TX queue can hold one packet (yes, if_emac can send only two(!) packets at a time). Even with this change the very limited FIFO buffer (3 KiB for TX and 13 KiB for RX) fill up too quick to sustain higher throughput. For the TCP case it turns out that TX isn't the limiting factor, but the RX side is (the FIFO fill up and starts to discard packets, so the sender has to slow down). Notes: svn path=/head/; revision=281673
* Remove unnecessary checks and fix an issue where the interrupt handlerLuiz Otavio O Souza2015-04-171-10/+6
| | | | | | | could return with lock held. Notes: svn path=/head/; revision=281669
* Fix the 'wrong packet header' errors for if_emac.Luiz Otavio O Souza2015-04-171-3/+1
| | | | | | | | | | | | | | Do not strip the ethernet CRC until we read all data from FIFO, otherwise the CRC bytes would be left in FIFO causing the failure of next packet (wrong packet header). When this error happens the receiver has to be disabled and the RX FIFO flushed, discarding valid packets. With this fix if_emac behaves a lot better. Notes: svn path=/head/; revision=281639
* Include vm/pmap.h for pmap_kextract.Andrew Turner2015-04-041-0/+3
| | | | Notes: svn path=/head/; revision=281092
* Stop using machine/fdt.h in the arm kernel code when we don't need it.Andrew Turner2015-04-047-7/+0
| | | | Notes: svn path=/head/; revision=281085
* Build the cpufunc_asm_* files based on the cpu type, not which config fileAndrew Turner2015-03-292-2/+0
| | | | | | | we happen to be building. Notes: svn path=/head/; revision=280831
* Remove cpufunc_asm_arm11.S from the ARMv7 configs, it's not used.Andrew Turner2015-03-292-2/+0
| | | | Notes: svn path=/head/; revision=280826
* Stop building unused cpuvunc_* files, we don't need anything from these.Andrew Turner2015-03-292-4/+0
| | | | Notes: svn path=/head/; revision=280810
* Implement GPIO_GET_BUS() method for all GPIO drivers.Luiz Otavio O Souza2015-01-311-5/+17
| | | | | | | | Add helper routines to deal with attach and detach of gpiobus and gpioc devices that are common to all drivers. Notes: svn path=/head/; revision=277996
* Clean up and fix the device detach routine and the failure path on GPIOLuiz Otavio O Souza2015-01-311-3/+4
| | | | | | | | | drivers. This paves the way for upcoming work. Notes: svn path=/head/; revision=277968
* Rename bus_space-v6.c to bus_space_base.c, because it's not v6-specificIan Lepore2015-01-212-4/+4
| | | | | | | | and now some v5 Marvell systems are using it. Only define fdt_bus_tag if option FDT is defined. Notes: svn path=/head/; revision=277472
* Rename gic_init_secondary to arm_init_secondary_ic to help with the mergeAndrew Turner2015-01-111-1/+1
| | | | | | | of the arm_intrng project branch. Notes: svn path=/head/; revision=276984
* Add 64-bit DMA support in the XHCI controller driver.Hans Petter Selasky2015-01-051-0/+1
| | | | | | | | | | - Fix some comments and whitespace while at it. MFC after: 1 month Submitted by: marius@ Notes: svn path=/head/; revision=276717
* Remove -Wa,-march=armv7a from arm kernel configs, it makes clang 3.5 sadIan Lepore2015-01-012-2/+2
| | | | | | | and apparently isn't needed now that we're using the integrated assembler. Notes: svn path=/head/; revision=276520
* Add -march=armv7a to the kernel compile for all ARM systems which are v7a.Ian Lepore2014-12-212-0/+2
| | | | | | | Submitted by: Michal Meloun <meloun@miracle.cz> Notes: svn path=/head/; revision=276047
* Moves all the duplicate code to a single function.Luiz Otavio O Souza2014-11-181-14/+0
| | | | | | | | Verify for invalid modes and unwanted flags before pass the new flags to driver. Notes: svn path=/head/; revision=274670
* Make the GPIO children attach to the first unit available and not only toLuiz Otavio O Souza2014-10-281-2/+2
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=273799
* Allow timer0 to run at full 24MHz not at 24MHz/16 by setting prescale to 1.Ganbold Tsagaankhuu2014-10-021-1/+1
| | | | | | | Approved by: stas (mentor) Notes: svn path=/head/; revision=272397
* Fix typo in comment.Ganbold Tsagaankhuu2014-09-201-1/+2
| | | | | | | | | Disable AHB clock gate for ehci0. Approved by: stas (mentor) Notes: svn path=/head/; revision=271901
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-191-7/+7
| | | | Notes: svn path=/head/; revision=271859
* Add the start of the ARM platform code. This is based on the PowerPCAndrew Turner2014-05-171-5/+6
| | | | | | | | | | | | | platform code, it is expected these will be merged in the future when the ARM code is more complete. Until more boards can be tested only use this with the Raspberry Pi and rrename the functions on the other SoCs. Reviewed by: ian@ Notes: svn path=/head/; revision=266301
* Switch to my freebsd.org emal address in copyright.Ganbold Tsagaankhuu2014-03-2516-16/+16
| | | | | | | Approved by: stas (mentor) Notes: svn path=/head/; revision=263711
* Add code for enabling second CPU core for A20 SoC.Ganbold Tsagaankhuu2014-03-252-0/+159
| | | | | | | | | Enable SMP on Cubieboard2. Approved by: stas (mentor) Notes: svn path=/head/; revision=263698
* Eliminate irq_dispatch.S. Move the data items it contained into arm/intr.cIan Lepore2014-03-102-2/+0
| | | | | | | | | | | and the functionality it provided into arm/exception.S. Rename the main irq handling routine from arm_handler_execute() to arm_irq_handler() to make it more congruent with how other exception handlers are named, and also update its signature to reflect what has long been reality: it is passed just a trapframe pointer, no interrupt number argument. Notes: svn path=/head/; revision=262979
* Follow r262916 with one more config file that references a renamed common.cIan Lepore2014-03-091-1/+1
| | | | Notes: svn path=/head/; revision=262935
* Move all the files named foo/common.c to foo/foo_common.c, asWarner Losh2014-03-082-6/+6
| | | | | | | | | appropriate for each of the 'foo' in the tree. This will allow us to compile them together (although symbol conflicts prevent us from doing that today, this just fixes the file name collision). Notes: svn path=/head/; revision=262916
* Add EMAC and SRAM controller entries to FDT.Ganbold Tsagaankhuu2014-03-032-0/+4
| | | | | | | | | | Add EMAC device to kernel config files and enable EMAC, SRAM drivers for build. Approved by: stas (mentor) Notes: svn path=/head/; revision=262711
* Add EMAC 10/100 Ethernet controller driver for A10/A20.Ganbold Tsagaankhuu2014-03-032-0/+1391
| | | | | | | | | | | | | | | It is available mostly in A10 devices like Hackberry, Marsboard, Mele A1000, A2000, A100 HTPC, cubieboard1 and A20 device like cubieboard2. TX performance can be improved using both channels 0 and 1. RX performance is poor and needs improvement with the assistance of external DMA controller in case there is bulk TCP receiver. Reviewed by: yongari@ Approved by: stas (mentor) Notes: svn path=/head/; revision=262710
* Add Static Random Access Memory controller driver for A10/A20.Ganbold Tsagaankhuu2014-03-032-0/+168
| | | | | | | | | | A10/A20's SRAM is used by devices, such as CPU, EMAC, for extra fast memory or as cache. Approved by: stas (mentor) Notes: svn path=/head/; revision=262709
* Add gpio and clock bits for A10/A20's EMAC ethernet controller driver, such as:Ganbold Tsagaankhuu2014-03-034-2/+76
| | | | | | | | | | - EMAC gpio configuration - EMAC clock activation Approved by: stas (mentor) Notes: svn path=/head/; revision=262708
* Replace many pasted identical definitions of cpu_initclocks() with a commonIan Lepore2014-02-261-6/+0
| | | | | | | | | | | implementation in arm/machdep.c. Most arm platforms either don't need to do anything, or just need to call the standard eventtimer init routines. A generic implementation that does that is now provided via weak linkage. Any platform that needs to do something different can provide a its own implementation to override the generic one. Notes: svn path=/head/; revision=262534
* Follow r261352 by updating all drivers which are children of simplebusIan Lepore2014-02-026-0/+22
| | | | | | | | | | | | | | | | to check the status property in their probe routines. Simplebus used to only instantiate its children whose status="okay" but that was improper behavior, fixed in r261352. Now that it doesn't check anymore and probes all its children; the children all have to do the check because really only the children know how to properly interpret their status property strings. Right now all existing drivers only understand "okay" versus something- that's-not-okay, so they all use the new ofw_bus_status_okay() helper. Notes: svn path=/head/; revision=261410
* Remove STARTUP_PAGETABLE_ADDR from the ARM configs and replace it withAndrew Turner2014-01-282-4/+0
| | | | | | | | | | | | memory at the end of the kernel. This helps reduce the SoC and board specific configuration required. Reviewed by: bsdimp Tested by: jmg (armeb), br Notes: svn path=/head/; revision=261227
* Switch to using arm_devmap_add_entry() to set up static device mapping.Ian Lepore2014-01-061-22/+10
| | | | | | | | This eliminates the hard-coded max kva and roughly doubles the available kva space. Notes: svn path=/head/; revision=260374
* Switch allwinner A10/A20 and rockchip ports to use common ARMv6/v7 bus_space ↵Aleksandr Rybalko2013-11-063-115/+2
| | | | | | | | | tag. Tested by: ganbold Notes: svn path=/head/; revision=257740