summaryrefslogtreecommitdiffstats
path: root/sys/arm/at91
Commit message (Collapse)AuthorAgeFilesLines
* ofw_spi: Parse property for the SPI mode and CS polarity.manu2017-10-171-0/+2
| | | | | | | | | | | As cs is stored in a uint32_t, use the last bit to store the active high flag as it's unlikely that we will have that much CS. Reviewed by: loos MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D8614 (cherry picked from commit f5f9058ccaec11fccc18817f45fff8859798a317)
* Use the modern spelling of ofw_bus_node_is_compatible in sys/arm.andrew2017-09-061-1/+2
| | | | | | Sponsored by: ABT Systems Ltd (cherry picked from commit 7168ae84d82220caac0bb5f5f5d68ccc4e20915b)
* MFC: r312939, r313250, r314811 (partial), r314887 (partial), r315760,marius2017-05-111-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r315845, 315430, r317981, r315466 o Fix some overly long lines, whitespace and other bugs according to style(9) as well as spelling etc. in mmc(4), mmcsd(4) and sdhci(4). o In the mmc(4) bridges and sdhci(4) (bus) front-ends: - Remove redundant assignments of the default bus_generic_print_child device method, - use DEVMETHOD_END, - use NULL instead of 0 for pointers. o Trim/adjust includes. o Add and use a MMC_DECLARE_BRIDGE macro for declaring mmc(4) bridges as kernel drivers and their dependency onto mmc(4). o Add support for eMMC "partitions". Besides the user data area, i. e. the default partition, eMMC v4.41 and later devices can additionally provide up to: 1 enhanced user data area partition 2 boot partitions 1 RPMB (Replay Protected Memory Block) partition 4 general purpose partitions (optionally with a enhanced or extended attribute) Besides simply subdividing eMMC devices, some Intel NUCs having UEFI code in the boot partitions etc., another use case for the partition support is the activation of pseudo-SLC mode, which manufacturers of eMMC chips typically associate with the enhanced user data area and/ or the enhanced attribute of general purpose partitions. CAVEAT EMPTOR: Partitioning eMMC devices is a one-time operation. o Now that properly issuing CMD6 is crucial (so data isn't written to the wrong partition for example), make a step into the direction of correctly handling the timeout for these commands in the MMC layer. Also, do a SEND_STATUS when CMD6 is invoked with an R1B response as recommended by relevant specifications. o Add an IOCTL interface to mmcsd(4); this is sufficiently compatible with Linux so that the GNU mmc-utils can be ported to and used with FreeBSD (note that due to the remaining deficiencies outlined above SANITIZE operations issued by/with `mmc` currently most likely will fail). These latter have been added to ports as sysutils/mmc-utils. Among others, the `mmc` tool of mmc-utils allows for partitioning eMMC devices (tested working). o For devices following the eMMC specification v4.41 or later, year 0 is 2013 rather than 1997; so correct this for assembling the device ID string properly. o Let mmcsd.ko depend on mmc.ko. Additionally, bump MMC_VERSION as at least for some of the above a matching pair is required. o In the ACPI front-end of sdhci(4) describe the Intel eMMC and SDXC controllers as such in order to match the PCI one. Additionally, in the entry for the 80860F14 SDXC controller remove the eMMC-only SDHCI_QUIRK_INTEL_POWER_UP_RESET.
* MFC r303261,r315059:mmel2017-04-161-3/+2
| | | | | | | | r303261: Add more UEFI/e820 memory types from latest specifications. r315059: Split overbloated machep.c to multiple files and do basic cleanup of these fragments.
* MFC r306262, r306267, r310021: (needed to avoid conflicts on later merges)ian2017-03-011-4/+0
| | | | | | | | | | Remove bus_dma_get_range and bus_dma_get_range_nb on armv6. We only need this on a few earlier arm SoCs. Restrict where we need to define fdt_fixup_table to just PowerPC and Marvell. Add the missing void to function signatures in much of the arm code.
* MFC r309912:manu2016-12-161-2/+3
| | | | CS ivar is uint32_t, not int.
* MFC r307518:hselasky2016-11-072-12/+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
* MFC r306902:mmel2016-11-056-10/+0
| | | | ARM: Remove unused includes.
* Use the new(-ish) CP15_SCTLR macro to generate system control reg accessesian2016-05-231-3/+4
| | | | | | | | | where possible. In the places that doesn't work (multi-line inline asm, and places where the old armv4 cpufuncs mechanism is used), annotate the accesses with a comment that includes SCTLR. Now a grep -i sctlr can find all the system control register manipulations. No functional changes.
* Use OF_prop_free instead of direct call to free(9)gonzo2016-05-131-3/+3
|
* sys/arm: Minor spelling fixes.pfg2016-05-048-16/+16
| | | | Only affects comments: no functional change.
* sys: Make use of our rounddown() macro when sys/param.h is available.pfg2016-04-301-1/+1
| | | | No functional change.
* sys/arm: make use of the howmany() macro when available.pfg2016-04-261-1/+1
| | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read.
* Move arm's devmap to some generic place, so it can be usedbr2016-04-263-9/+9
| | | | | | | | | by other architectures. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D6091 Sponsored by: DARPA, AFRL Sponsored by: HEIF5
* sys: use our roundup2/rounddown2() macros when param.h is available.pfg2016-04-211-3/+3
| | | | | | | | | | 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.
* Use our nitems() macro when param.h is available.pfg2016-04-201-3/+3
| | | | | | Replacements specific to arm, mips, pc98, powerpc and sparc64. Discussed in: freebsd-current
* Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machineandrew2016-04-151-1/+1
| | | | | | | independent code that needs to know about INTRNG such as PCI drivers. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* arm: for pointers replace 0 with NULL.pfg2016-04-157-17/+17
| | | | | | These are mostly cosmetical, no functional change. Found with devel/coccinelle.
* ARM: Teach LINUX_BOOT_ABI to recognize DT blob.mmel2016-03-261-1/+1
| | | | | | | This allow us to boot FreeBSD kernel (using uImage encapsulation) directly from U-boot using 'bootm' command or by Android fastboot loader. For now, kernel uImage must be marked as Linux, but we can add support for FreeBSD into U-Boot later.
* Fix the resource_list_print_type() calls to use uintmax_t.jhibbits2016-03-222-5/+5
| | | | Missed a bunch from r297000.
* Fix fallout from r292180 (Dec 2015)... ensure that every driver which hasian2016-03-211-0/+1
| | | | | | | | | a DRIVER_MODULE() referencing mmc_driver has a MODULE_DEPEND() on mmc. This is because the kernel linker only searches for symbols in dependent modules, so loading sdhci_pci (and other bus-flavors of sdhci) would fail when mmc was not compiled into the kernel (even if you hand-loaded mmc first). (Thanks to jilles@ for providing the vital clue about the kernel linker.)
* Introduce a RMAN_IS_DEFAULT_RANGE() macro, and use it.jhibbits2016-02-202-2/+2
| | | | | | | | | | | 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
* Remove pd_prot and pd_cache members from struct arm_devmap_entry.skra2016-02-171-13/+1
| | | | | The struct is used for definition of static device mappings which should always have same protection and attributes.
* Stop defining fdt_pic_table when building for ARM_INTRNG.andrew2016-02-111-0/+2
|
* ARM: Consistently use cpu_setttb() instead of setttb().mmel2016-02-031-2/+2
| | | | Remove unused #define for drain_writebuf.
* 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
* We don't need at91_bs_tag. arm_base_bs_tag works now that we haveimp2016-01-165-167/+8
| | | | | better dynamic device mapping that didn't exit when we started this port. Remove it, since everything works w/o it.
* Move ohci files to their proper place in the tree for atmel.imp2016-01-163-3/+501
| | | | | | | Fix when it is included (we don't have a at91rm9200 device). From a similar patch in the PR, with tweaked names. PR: 206229
* Reduce diffs to upstream by adding a couple comment blocks and moving theian2016-01-151-28/+34
| | | | parse_boot_param() function to the end of the file.
* Fix the handling of the "PDC write transfer length" erratum for at91. Theian2016-01-141-11/+10
| | | | | | | | | | problem affects revision 1xx hardware as well as later versions. Also, the recommended workaround is to set the PDC count register for a 12-byte transfer when the actual size is less than that, but there is no need to extend or zero-out the data buffer, because the blklen register contains the real transfer size and only that many bytes will be transferred. Also add a sysctl to turn debugging printfs on or off on the fly.
* Remove the arm KERNPHYSADDR option as it is no longer used. The makeandrew2015-12-2212-12/+0
| | | | option is still in existance as it is used to build the trampoline code.
* Move the DRIVER_MODULE() statements that declare mmc(4) to be a child ofian2015-12-141-0/+1
| | | | | | the various bridge drivers out of dev/mmc.c and into the bridge drivers. Requested by: jhb (almost two years ago; better late than never)
* Move more bus_space_* files to be built by files.arm. This leaves theandrew2015-11-211-1/+0
| | | | | | | definition in a file.* file under sys/arm/arm in the few cases we need it for non-fdt platforms. Sponsored by: ABT Systems Ltd
* Correct !FDT case with proper name.imp2015-11-071-1/+1
|
* Implement the phy-mode property for ate and macb. If it is set toimp2015-11-072-18/+112
| | | | | | | | | | "rmii", use rmii mode for the MAC, otherwise use MII mode. The code is somewhat duplicated between these drivers for this. Also, add AT91RM9200 compatibility strings to the ate driver. In the future, there's a good chance that ate will lose the MACB support and only attach to the AT91RM9200 EMAC device since the macb works now that RMII support has been added to it.
* Add support for RMII in macb, cribbed slightly from the ateimp2015-11-073-4/+12
| | | | | | | | | | | driver. This is taken from the MAC at boot, but can be overridden with 'options AT91_MACB_USE_RMII'. Switch to macb for HL201 and SAM9G20EK boards. It now works both places. Also start to sneak up on FDT for the SAM9G20EK board, but leave disabled due to issues with MMC that haven't been resolved. Add early debug support for the SAM9G20EK since that is required for FDT to work presently on these SoC.
* Make if_macb work with FDT.cognet2015-11-051-0/+17
|
* Make at91_pmc probe any at91 pmc device we support, not just at91rm9200.cognet2015-11-051-1/+4
| | | | MFC after: 1 week
* Make kstack_pages a tunable on arm, x86, and powepc. On i386, thekib2015-08-101-2/+2
| | | | | | | | | | | | | | | | | | | initial thread stack is not adjusted by the tunable, the stack is allocated too early to get access to the kernel environment. See TD0_KSTACK_PAGES for the thread0 stack sizing on i386. The tunable was tested on x86 only. From the visual inspection, it seems that it might work on arm and powerpc. The arm USPACE_SVC_STACK_TOP and powerpc USPACE macros seems to be already incorrect for the threads with non-default kstack size. I only changed the macros to use variable instead of constant, since I cannot test. On arm64, mips and sparc64, some static data structures are sized by KSTACK_PAGES, so the tunable is disabled. Sponsored by: The FreeBSD Foundation MFC after: 2 week
* Fix KSTACK_PAGES issue when the default value was changed in KERNCONFzbb2015-07-161-0/+1
| | | | | | | | | | | | | | | | | | If KSTACK_PAGES was changed to anything alse than the default, the value from param.h was taken instead in some places and the value from KENRCONF in some others. This resulted in inconsistency which caused corruption in SMP envorinment. Ensure all places where KSTACK_PAGES are used the opt_kstack_pages.h is included. The file opt_kstack_pages.h could not be included in param.h because was breaking the toolchain compilation. Reviewed by: kib Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3094
* Need to handle the !FDT case still too... I thought in r270025 weimp2015-05-221-0/+4
| | | | wouldn't need it, but it appears that we still do for the moment...
* Include machine/intr.h for arm_post_filter.andrew2015-04-041-0/+7
|
* Build the cpufunc_asm_* files based on the cpu type, not which config fileandrew2015-03-291-1/+0
| | | | we happen to be building.
* Remove the bootconfig parsing. We never used it and always passed either anandrew2015-03-291-1/+1
| | | | empty string or NULL to the setup functions that called into it.
* Move the uart_class definitions and fdt compat data into the individualian2015-03-073-0/+14
| | | | | | | uart implementations, and export them using the new linker-set mechanism. Differential Revision: https://reviews.freebsd.org/D1993 Submitted by: Michal Meloun
* Use explicit initializer style, fill in missing functions.ian2015-01-212-70/+71
|
* For some reason, all the arm bus_space functions that work with uint16ian2015-01-211-15/+14
| | | | | values have armv4 in the name. There's nothing armv4-special about them, so just use the same sort of names as all the other functions.
* Revise the arm bus_space implementation to avoid dereferencing the tag onian2015-01-211-12/+7
| | | | | | | | | | | | | | | | | every operation to retrieve the bs_cookie value almost nothing actually uses. The bus_space struct contains a private data pointer (poorly named bs_cookie, now renamed to bs_privdata) which is used only by a few old armv4 xscale implementations. The bus_space functions were all defined to take this value as the first parameter instead of the bus_space_tag_t, requiring all the inline macro and function expansions to dereference the tag to pass it to another function, which never uses it. Now all the functions take the tag as the first parameter and retrieve the privdata if they need it. Also fix a couple bus_space_unmap() implementations that were calling kva_free() instead of pmap_unmapdev(). Discussed with: cognet
* Eliminate a redundant declaration.ian2014-12-211-2/+0
|
* Remove the ARM_DEVICE_MULTIPASS option and make its effect be the default.ian2014-10-261-1/+0
| | | | | | | | | | Multipass device attachment was tested on many arm platforms by users and only success was reported on the arm@ mailing list. This is just the long-delayed followup of making it the default. Multipass attachment is necessary when using vendor-supplied FDT data, because our devices may need to be attached in a different order than they are described in the FDT data.
OpenPOWER on IntegriCloud