2251 Commits

Author SHA1 Message Date
ian
afbd2ea226 MFC r272333: Honor exclusion flags when building the memory lists. 2014-10-26 04:06:29 +00:00
ian
2008cd3c3f MFC r271906:
Make the ARM MPCore Timer driver work with published standard FDT bindings.
2014-10-26 03:55:09 +00:00
ian
839e78bb76 MFC r271595, r271601, r271607, r271630:
Add compat strings for all the flavors of GIC this driver should support.
  Also allow the driver to attach to ofwbus as well as simplebus, some FDT
  data puts the root interrupt controller on the root bus.

  Add a common routine for parsing FDT data describing an ARM GIC interrupt.

  Use gic_decode_fdt() rather than a local routine to parse fdt interrupt
  properties.  Move fdt_pic_table and fdt_fixup_table into imx6_machdep.c,
  which means imx6 doesn't need imx_common.c anymore.

  The private peripheral interrupts start at offset 16, not 0.  Also, use
  names rather than inline mystery constants for these offsets.
2014-10-26 03:52:45 +00:00
ian
1ede59bf75 MFC r271594:
Fix an undefined variable that was accidentally not causing an error.
2014-10-26 03:48:12 +00:00
ian
552dafa953 MFC r271550, r271591:
Replace the imx5 and imx6 iomux drivers with a single common driver that
  uses the new fdt_pinctrl interface.
2014-10-26 03:44:19 +00:00
ian
9e4d760d5e MFC r271310:
Rename new to newval in inline asm code, to avoid clashes with C++ new.
2014-10-26 03:13:19 +00:00
ian
6bda1023a0 MFC r271097, r271100, r271101, r271102, r271124:
- Add a basic iomux driver for imx6.
 - Implement the same public interface in imx51 and imx6 iomux
 - The iomux driver is no longer optional, remove it from kernel configs.
 - Implement the imx_iomux_get/set_gpr() interface for imx6.
 - Stop setting the iomux device status to disabled, now that we have a driver.
2014-10-26 02:44:41 +00:00
ian
caa088c379 MFC r268973, r268977: Rename i.MX I2C driver file, enable it on imx6. 2014-10-26 02:40:34 +00:00
ian
bb76782ad5 MFC r268834, r268835:
o Enable GPIO device driver for i.MX6.
   It was originally written for i.MX5 and compatible with newer chip.
 o Extend device tree information
 o style(9) fixes
 o Rename gpio driver file.
2014-10-26 02:37:42 +00:00
ian
c691dc79ec MFC r271055, r271084, r271094:
Add a function to get the frequency of the AHB bus.  Another stopgap
  function until we have full clock support for imx6.

  The imx5x and imx6 chips have an onboard IOMUX device which also contains a
  few "general purpose registers" whose values control chip behavior in ways
  that have nothing to do with IO pin mux control.  Define a simple API that
  other soc-specific code can use to read and write the registers, and provide
  the imx51 implementation of them.

  Fix a typo.
2014-10-26 02:25:34 +00:00
ian
04b1fcec06 MFC r270955,r270956: make the imx6 octop and anatop drivers early attachers. 2014-10-26 02:09:58 +00:00
ian
1c8cde378e MFC r270945:
Rename OF_xref_phandle() to OF_node_from_xref() and add a new function
that provides the inverse translation, OF_xref_from_node().
2014-10-26 01:30:46 +00:00
ian
520f9702ad MFC r270025:
Implement the FDT static pinctl/pinmux spec for Atmel.
2014-10-26 01:26:53 +00:00
ian
f2e6118a3c MFC r257200, r259121, r261410, r265853:
- Remove #include <machine/frame.h>.
 - Add gpio parse routines according to sys/boot/fdt/dts/bindings-gpio.txt.
 - Follow r261352 by updating all drivers which are children of simplebus
   to check the status property in their probe routines.
 - Rename platform_gpio_init to be SoC specific, and make it static as it's
   only called from this file.

This is mostly catching up on some old MFCs that were done before this file
existed in the 10 branch.
2014-10-26 01:15:16 +00:00
ian
682138b2b9 MFC r268633, r271046:
Fixes and enhancements for the if_cgem driver...

  - miibus fixes as suggested by Yonghyeon Pyun.
  - enable VLAN MTU support.
  - fix a few WITNESS complaints in cgem_attach().
  - have cgem_attach() properly init the ifnet struct before calling
    mii_attach() to fix panic when using e1000phy.
  - fix ethernet address changing.
  - fix transmit queue overflow handling.
  - tweak receive queue handling to reduce receive overflows.
  - bring out MAC statistic counters to sysctls.
  - add e1000phy to config file.
  - implement receive hang work-around described in reference guide.
  - change device name from if_cgem to cgem to be consistent with other
    interfaces.

  Fix the Zedboard/Zynq ethernet driver to handle media speed changes so
  that it can connect to switches at speeds other than 1gb.
2014-10-25 20:34:10 +00:00
rpaulo
6e4e970c3a MFC r273261:
Remove an unused mutex.
2014-10-25 02:08:02 +00:00
rpaulo
22c57adcd5 MFC r273258:
Make the ti_mbox and ti_pruss drivers optional.
2014-10-25 02:06:40 +00:00
rpaulo
f85f42f997 MFC r273257:
Add a driver for the TI watchdog.

 The TI watchdog timer is present on BeagleBone's.  Since 2014, U-Boot
 has been booting the BeagleBone with the watchdog enabled.  We need
 to
 disable it on boot to avoid a spurious reset.
 The timer isn't exactly precise, but it will do as a watchdog.  This
 is also a reflection of the watchdog(9) API.

 In the future, we could handle interrupts, but the watchdog(9) API
 needs to be a bit smarter before that can happen.
2014-10-25 02:05:21 +00:00
tuexen
1a3a68be7f MFC r270673:
Announce SCTP support in the kern.features sysctl variables.

MFC r270859:
Enable SCTP support. It runs perfectly fine on a Wandboard quad.

MFC r271204 with manual intervention:
Fix the handling of sysctl variables when used with VIMAGE.
While there do some cleanup of the code.

MFC r271209:
Fix a leak of an address, if the address is scheduled for removal
and the stack is torn down.
Thanks to Peter Bostroem and Jiayang Liu from Google for reporting the
issue.

MFC r271219:
Use SYSCTL_PROC instead of SYSCTL_VNET_PROC.
Suggested by: glebius@

MFC r271221:
Use union sctp_sockstore instead of struct sockaddr_storage. This
eliminates some warnings when building in userland.
Thanks to Patrick Laimbock for reporting this issue.
Remove also some unnecessary casts.
There should be no functional change.

MFC r271228:
Address another warnings reported by Patrick Laimbock when compiling
in userspace. While there, improve consistency.

MFC r271230:
Address warnings generated by the clang analyzer.

Approved by: re (kib)
2014-09-18 08:58:22 +00:00
ian
a5cc4ff425 Disable debugging-related options in all ARM kernel configs for stable-10.
This is a direct commit to stable-10.  The following options are disabled
in all arm kernel configs:

	DEADLKRES
	DIAGNOSTIC
	INVARIANTS
	INVARIANTS_SUPPORT
	WITNESS
	WITNESS_SKIPSPIN
Approved by:	re(gjb)
2014-09-11 15:36:36 +00:00
ian
e41a7eca9f MFC r271050: Disable DIAGNOSTIC on low-end ARM platforms.
Approved by:	re(gjb)
2014-09-09 23:31:30 +00:00
ian
8a19588768 MFC r270882, r270930:
In ARM asm code, ensure that every ENTRY(foo) has a matching END(foo).
  The EABI unwind info requires a .fnend for every .fnstart, and newer
  binutils will complain about seeing two .fnstart in a row.  This change
  allows newer tools to compile our code.

  Do not generate unwind info in asm functions if _STANDALONE is defined.
  The .fnend op causes the assembler to emit RELOC references to unwind
  support functions that don't exist in libstand.

Approved by:	re(gjb)
2014-09-09 22:24:01 +00:00
ian
a029ba8e5f MFC r270065:
Move the imx6 sysctl temperature info to hw.imx6 where all the other
  soc-wide info lives.  It was under dev.imx6_anatop.0.

Approved by:	re(gjb)
2014-09-09 19:47:35 +00:00
ian
ba4eeb7160 MFC r270858, 270879:
Remove duplicated option FDT from individual Wandboard configs, leave
  the one in the common IMX6 file that they all include.

Approved by:	re(gjb)
2014-09-09 19:26:55 +00:00
ian
d8cb26ab27 MFC r270862, r270878: MMU fixes for kernel startup.
Fix the handling of MMU type in the AP entry code.  The ARM_MMU_V6/V7
  symbols are always #defined to 0 or 1, so use #if SYM not #if defined(SYM).
  Also, it helps if you include the header file that defines the symbols.

  The Marvell PJ4B cpu family is armv7, not armv6.

Approved by:	re(gjb)
2014-09-09 18:17:43 +00:00
marius
e31bbc3dc1 MFC: r270885, r270948
- Nuke unused sdhci_softc.
- Static'ize sdhci_debug local to sdhci.c.
- Const'ify PCI device description strings.
- Nuke redundant resource ID members from sdhci_pci_softc.
- Nuke unused hw.sdhci_pci.debug tunable.
- Add support for using MSI instead of INTx, controllable via the tunable
  hw.sdhci.enable_msi (defaulting to on) and tested with a RICOH R5CE823 SD
  controller.
- Use NULL instead of 0 for pointers.
2014-09-03 20:07:26 +00:00
kib
798eea1614 Fix a leak of the wired pages when unwiring of the PROT_NONE-mapped
wired region.  Rework the handling of unwire to do the it in batch,
both at pmap and object level.

All commits below are by alc.

MFC r268327:
Introduce pmap_unwire().

MFC r268591:
Implement pmap_unwire() for powerpc.

MFC r268776:
Implement pmap_unwire() for arm.

MFC r268806:
pmap_unwire(9) man page.

MFC r269134:
When unwiring a region of an address space, do not assume that the
underlying physical pages are mapped by the pmap.  This fixes a leak
of the wired pages on the unwiring of the region mapped with no access
allowed.

MFC r269339:
In the implementation of the new function pmap_unwire(), the call to
MOEA64_PVO_TO_PTE() must be performed before any changes are made to the
PVO. Otherwise, MOEA64_PVO_TO_PTE() will panic.

MFC r269365:
Correct a long-standing problem in moea{,64}_pvo_enter() that was revealed
by the combination of r268591 and r269134: When we attempt to add the
wired attribute to an existing mapping, moea{,64}_pvo_enter() do nothing.
(They only set the wired attribute on newly created mappings.)

MFC r269433:
Handle wiring failures in vm_map_wire() with the new functions
pmap_unwire() and vm_object_unwire().
Retire vm_fault_{un,}wire(), since they are no longer used.

MFC r269438:
Rewrite a loop in vm_map_wire() so that gcc doesn't think that the variable
"rv" is uninitialized.

MFC r269485:
Retire pmap_change_wiring().

Reviewed by:	alc
2014-09-01 07:58:15 +00:00
kib
25782a7fab Merge the changes to pmap_enter(9) for sleep-less operation (requested
by flag).  The ia64 pmap.c changes are direct commit, since ia64 is
removed on head.

MFC r269368 (by alc):
Retire PVO_EXECUTABLE.

MFC r269728:
Change pmap_enter(9) interface to take flags parameter and superpage
mapping size (currently unused).

MFC r269759 (by alc):
Update the text of a KASSERT() to reflect the changes in r269728.

MFC r269822 (by alc):
Change {_,}pmap_allocpte() so that they look for the flag
PMAP_ENTER_NOSLEEP instead of M_NOWAIT/M_WAITOK when deciding whether
to sleep on page table page allocation.

MFC r270151 (by alc):
Replace KASSERT that no PV list locks are held with a conditional
unlock.

Reviewed by:	alc
Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2014-08-24 07:53:15 +00:00
dumbbell
9ac8060e57 vt(4): Colors are indexed against a console palette, not a VGA palette
Rename vt_generate_vga_palette() to vt_generate_cons_palette() and
change it to build a palette where the color index is the same than in
terminal escape codes, not the VGA index. That's what TCHAR_CREATE()
uses and passes to vt(4).

The main differences between both orders are:
    o  Blue and red are swapped (1 <-> 4)
    o  Yellow and cyan are swapped (3 <-> 6)

The problem remained unnoticed, because the RGB bit indexes passed to
vt_generate_vga_palette() were reversed. This inversion was cancelled
by the colors inversions in the generated palette. For instance, red
(0xff0000) and blue (0x0000ff) have bytes in opposite order, but were
swapped in the palette. But after changing the value of blue (see last
paragraph), the modified color was in fact the red one.

While here, tune the palette to better match console colors and improve
the readability (especially the dark blue).

This is an MFC of r269783 and r269791.
2014-08-21 10:18:42 +00:00
loos
e4ebeceadb MFC r267021:
FreeBSD, historically, has always used 8-bit addresses for i2c devices
  (7-bit device address << 1), always leaving the room for the read/write
  bit.

  This commit convert ti_i2c and revert r259127 on bcm2835_bsc to make them
  compatible with 8-bit addresses.  Previous to this commit an i2c device
  would have different addresses depending on the controller it was attached
  to (by example, when compared to any iicbb(4) based i2c controller), which
  was a pretty annoying behavior.

  Also, update the PMIC i2c address on beaglebone* DTS files to match the
  new address scheme.

  Now the userland utilities need to do the correct slave address shifting
  (but it is going to work with any i2c controller on the system).

  Discussed with:	ian

MFC r267834:

  Clarify the expected usage of I2C 7-bit slave addresses on ioctl(2)
  interface.

  While here add the cross reference to iic(4) on iicbus(4).

  CR:		D210
  Suggested by:	jmg
2014-08-20 19:37:05 +00:00
loos
5bf7922115 MFC r266923:
Ignore IIC_ENOADDR from iicbus_reset() as it only means we have a
  master-only controller.

  This fixes the iic bus scan with i2c(8) (on supported controllers).

  Tested with gpioiic(4).

MFC r267009:

  Remove the unnecessary i2c slave address assignment.

  The ti_i2c controller only works in the master mode and the i2c address
  passed on iicbus_reset() is used to set the controller slave address when
  operating as an i2c slave (which isn't currently supported).

  When talking to a slave, the slave address is correctly provided to
  ti_i2c_tranfer().
2014-08-20 19:12:19 +00:00
loos
f091b317e3 MFC r266960:
Configure the analog input 7 which, on BBB, is connected to the 3V3B rail
  through a voltage divisor (R163 and R164 on page 4 of BBB schematic).

  Add a note about this on ti_adc(4) man page.  The ti_adc(4) man page will
  first appear on 10.1-RELEASE.

  Suggested by: Sulev-Madis Silber (ketas)
  Manual page reviewed by:      brueffer (D127)
2014-08-20 18:10:12 +00:00
loos
a23b573cf1 MFC r266937:
Export two new settings for the AM335x PWM, the clock prescaler (clkdiv)
  and the actual PWM frequency.

  Enforce the maximum value for the period sysctl.

  The frequency systcl now allows the direct setting of the PWM frequency
  (it will try to find the better clkdiv and period for a given frequency,
  i.e. the ones that will give the better PWM resolution).

  This allows the use lower frequencies on the PWM.  Without changing the
  clock prescaler the minimum PWM frequency was 1.52kHz.

  PWM frequencies checked with an osciloscope.

  PWM output tested with some R/C servos at 50Hz.
2014-08-20 17:57:23 +00:00
ian
266195b56b MFC r269646: Use a SYSINIT to init the array of interrupt names on arm. 2014-08-17 01:48:12 +00:00
ian
704fa959ad MFC r269607, r269698:
Cache the imx6 SoC type in a static var so that it only has to be figured
  out by sniffing hardware registers once.

  Add a missing clock register definition.
2014-08-17 01:32:33 +00:00
ian
2cc6abb7fb MFC r269594, r269596, r269597, r269598, r269605, r269606:
Set ofwbus and simplebus to attach during BUS_PASS_BUS.

  Define names that drivers can use to adjust their position relative to
  other drivers within a BUS_PASS

  Adjust ofwbus and simplebus to attach at BUS_PASS_ORDER_MIDDLE, so that
  a platform can attach some other bus first if necessary.

  Set the pl310 L2 cache driver to attach during the middle of BUS_PASS_CPU.

  Attach arm generic interrupt and timer drivers in the middle of
  BUS_PASS_INTERRUPT and BUS_PASS_TIMER, respectively.

  Add an arm option, ARM_DEVICE_MULTIPASS, used to opt-in to multi-pass
  device attachment on arm platforms.  If this is defined, nexus attaches
  early in BUS_PASS_BUS, and other busses and devices attach later, in the
  pass number they are set up for.  Without it defined, nexus attaches in
  BUS_PASS_DEFAULT and thus so does everything else, which is status quo.
2014-08-17 01:28:03 +00:00
ian
6b999dff3e MFC r269403, r269405, r269410, r269414:
Add 64-bit atomic ops for armv6, and also for armv4 only in kernel code.
  Use the new ops in the cddl code (and avoid defining functions with the
  same names locally).
2014-08-11 02:20:24 +00:00
ian
8067096dad MFC r269393, r269394, r269395:
Fix parsing of arch extensions in binutils/gas.
  Use ".arch_extension sec" when compiling ARM TI code that uses the
  security extensions.
2014-08-11 01:48:00 +00:00
ian
059e60aeba MFC r269390: Fix unwind info in hand-written asm (avoid nested functions). 2014-08-11 01:29:28 +00:00
ian
b9e66f3b29 MFC r269206, r269207, r269208, r269209, r269210, r269211, r269212, r269213,
r269214, r269215, r269216, r269217, r269221:

  busdma-v6 improvements, primarily:
  - Allocate the temporary segments array per-map rather than per-tag.
  - Avoid needlessly bouncing IO for mbufs and buffers allocated by
    bus_dmamem_alloc() (in both situations we known they're allocated
    on cacheline boundaries and don't need bouncing).
  - Various minor reformatting and cleanups.
2014-08-11 01:10:15 +00:00
ian
a08c00a48a MFC r268993, r268893, r268994, plus partial r264070, r264082
Fix C++ exception handling for ARM EABI.

 Just the part of r264070 that creates the FBSD_1.4 namespace in libc
 is hand-applied, and then r264082 which creates the Versions.def entry
 is MFC'd.
2014-08-10 22:26:29 +00:00
ian
50af577d29 MFC r256691, r256748: casuword fixes
Use unsigned compare against KERNBASE addr.
  Use atomic ops on armv6.
2014-08-07 17:49:42 +00:00
ian
3a58a39d52 MFC r268401, r268495:
Pending interrupt status is cleared by writing to the ISR, not the data reg.

  Use named constant rather than '0' to access the reset controller register.
2014-07-25 23:36:39 +00:00
ian
67c03a1145 MFC r266565, r266651:
Map device memory using PTE_DEVICE attributes, and also ensure that the
  shared flag is set on normal-memory mappings made via pmap_kenter() for SMP.

  The "shared flag" part of this change isn't obvious from the diff, here's
  the deal... by using the array of preformatted page table entry templates
  instead of constructing the PTE from scratch, we automatically get the
  right attribute bits set for both caching and shared.

  Fix whitespace glitches.
2014-07-25 23:29:55 +00:00
kib
d7d6313cf4 MFC r267213 (by alc):
Add a page size field to struct vm_page.

Approved by:	alc
2014-07-24 16:29:44 +00:00
imp
07bb5d08f3 MFC r263749,267146:
>r267146 | imp | 2014-06-05 22:08:55 -0600 (Thu, 05 Jun 2014) | 4 lines
>Restore comments accidentally removed.

>r263749 | imp | 2014-03-25 16:08:31 -0600 (Tue, 25 Mar 2014) | 18 lines
>Rather than require a makeoptions DEBUG to get debug correct,
>add it in kern.mk, but only if we're using clang. While this
>option is supported by both clang and gcc, in the future there
>may be changes to clang which change the defaults that require
>a tweak to build our kernel such that other tools in our tree
>will work. Set a good example by forcing -gdwarf-2 only for
>clang builds, and only if the user hasn't specified another
>dwarf level already. Update UPDATING to reflect the changed
>state of affairs. This also keeps us from having to update
>all the ARM kernels to add this, and also keeps us from
>in the future having to update all the MIPS kernels and is
>one less place the user will have to know to do something
>special for clang and one less thing developers will need
>to do when moving an architecture to clang.
2014-07-17 22:31:46 +00:00
ian
4be89b4268 MFC 266621: Eliminte spurious interrupts caused by ARM weak memory ordering. 2014-05-27 16:17:25 +00:00
ian
ffc031ceb6 MFC r264096, r264097, r264099 r264100, r264101, r264102, r264119:
Fixes to the ti_sdhci and sdhci drivers (fix clock divisor calcs).

Use the ti_sdhci driver instead of ti_mmchs for Pandaboard.
2014-05-27 15:30:24 +00:00
ian
369b19b027 MFC 258287: Implement pmap_align_superpage(). 2014-05-18 17:46:48 +00:00
ian
37b56a8b54 MFC 257231:
Make sure the PCB is aligned on 8 bytes, we may use ldrd/strd to access it,
  which may have strong alignment requirements.
2014-05-18 16:39:47 +00:00