Commit Graph

2560 Commits

Author SHA1 Message Date
Andrew Turner
77a732bda5 Make ti_padconf_devmap static in both places it is defined. 2014-05-25 10:56:45 +00:00
Andrew Turner
0a8c1fdf5a Allow the OMAP4 and AM335x prcm drivers to be compiled in the same kernel
by renaming the structures used.
2014-05-25 10:49:07 +00:00
Andrew Turner
8166c218e6 Reduce the diff between the PandaBoard and BeableBone kernel configs to
help with the creation of a more generic Ti kernel config.
2014-05-25 10:17:26 +00:00
Zbigniew Bodek
94831f6d21 Enable automatic superpages promotion by default on ARMv6/v7
From now on superpages are enabled by default on ARM.
One can still disable superpages utilization by adding:

vm.pmap.sp_enabled=0

to loader.conf
2014-05-24 22:46:00 +00:00
Ian Lepore
11d47032ee Eliminate one of the causes of spurious interrupts on armv6. The arm weak
memory ordering model allows writes to different devices to complete out
of order, leading to a situation where the write that clears an interrupt
source at a device can complete after a write that unmasks and EOIs the
interrupt at the interrupt controller, leading to a spurious re-interrupt.

This adds a generic barrier function specific to the needs of interrupt
controllers, and calls that function from the GIC and TI AINTC controllers.
There may still be other soc-specific controllers that need to make the call.

Reviewed by:	cognet, Svatopluk Kraus <onwahe@gmail.com>
MFC after:	3 days
2014-05-24 16:21:16 +00:00
Warner Losh
32d5c97723 Remove NetBSD implementation details not relevant to FreeBSD. 2014-05-23 00:21:02 +00:00
Ian Lepore
97bbab9993 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.

MFC after:	1 week
2014-05-22 23:38:17 +00:00
Hans Petter Selasky
5c657683bb Optimise reading of pending interrupt registers. If there are no
pending interrupt bits, skip the bit iteration loop.

Reviewed by:	ian @
2014-05-20 15:03:23 +00:00
Andrew Turner
101355bc67 Allow us to compile the Ti iic driver for both OMAP4 and AM335x.
MFC after:	1 week
2014-05-17 18:52:20 +00:00
Andrew Turner
f37128c048 Move the Ti SoCs to use the ARM platform. This should help allowing a
single kernel to work on both PandaBoard and BeagleBone.
2014-05-17 18:35:22 +00:00
Andrew Turner
87ff982083 Add FDT_PLATFORM_DEF2 for when there are multiple platforms needing to use
the same platform methods.
2014-05-17 18:02:46 +00:00
Andrew Turner
92e7f50a4e Fix a comment s/initarm_/platform_/ 2014-05-17 11:29:44 +00:00
Andrew Turner
27521ff8e4 Add the start of the ARM platform code. This is based on the PowerPC
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@
2014-05-17 11:27:36 +00:00
Gavin Atkinson
015280f64c Fix spelling mistake in comment.
Spotted during:	http://www.bsdcan.org/2014/schedule/events/484.en.html
2014-05-16 21:20:13 +00:00
Ruslan Bukin
3d0bf6b1d0 Fix return value. Should be logic one or zero. 2014-05-15 10:06:59 +00:00
Mark Murray
7ff2eaaad3 Give suitably-endowed ARMs a register similar to the x86 TSC register.
Here, "suitably endowed" means that the System Control Coprocessor
(#15) has Performance Monitoring Registers, including a CCNT (Cycle
Count) register.

The CCNT register is used in a way similar to the TSC register in
x86 processors by the get_cyclecount(9) function. The entropy-harvesting
thread is a heavy user of this function, and will benefit from not
having to call binuptime(9) instead.

One problem with the CCNT register is that it is 32-bit only, so
the upper 32-bits of the returned number are always 0. The entropy
harvester does not care, but in case any one else does, follow-up
work may include an interrup trap to increment an upper-32-bit
counter on CCNT overflow.

Another problem is that the CCNT register is not readable in user-mode
code; in can be made readable by userland, but then it is also
writable, and so is a good chunk of the PMU system. For that reason,
the CCNT is not enabled for user-mode access in this commit.

Like the x86, there is one CCNT per core, so they don't all run in
perfect sync.

Reviewed by:	ian@ (an earlier version)
Tested by:	ian@ (same earlier version)
Committed from:	WANDBOARD-QUAD
2014-05-14 19:11:15 +00:00
Ruslan Bukin
876ac29ddc Fix typo. 2014-05-14 14:19:57 +00:00
Aleksandr Rybalko
279204f2e0 Remove extra newlines.
No functional changes.

Sponsored by:	The FreeBSD Foundation
2014-05-14 11:15:48 +00:00
Ian Lepore
ad622f7078 Cleanup some style nits. 2014-05-12 13:08:37 +00:00
Ian Lepore
02bb9ba1cc Interrupts need to be disabled on entry to cpu_sleep() for ARM. Given
that and the need to be in a critical section when switching to idleclock
mode for event timers, use spinlock_enter()/exit() to achieve both needs.

The ARM WFI (wait for interrupt) instruction blocks until an interrupt is
asserted, and it will unblock even if interrupts are masked, and it will
unblock immediately if an interrupt is already pending.  It is necessary
to execute it with interrupts disabled, otherwise the interrupt that
should unblock it may occur and be serviced just prior to executing the
instruction.  At that point the system is inappropriately asleep until
the next timer tick or some other random interrupt happens.

In general, interrupts need to be disabled continuously from the time the
decision is made that there is no work to be done and sleeping is needed
until actually going to sleep, to avoid a race where handling a new
interrupt changes the basis for deciding there is no work to be done.

Submitted by:	hps@ (in slightly different form)
2014-05-12 13:05:03 +00:00
Ian Lepore
b07d0cbce3 Add cpu_l2cache_drain_writebuf(), use it to implement generic_bs_barrier().
On modern ARM SoCs the L2 cache controller sits between the CPU and the
AXI bus, and most on-chip memory-mapped devices are on the AXI bus.  We
map the device registers using the 'Device' memory attribute, which means
the memory is not cached, but writes to it are buffered.  Ensuring that a
write has made it all the way to a device may require that the L2
controller take some action.

There is currently only one implementation of the new function, for the
PL310 cache controller.  It invokes a function that the controller
manual calls "cache sync" but it actually has nothing to do with cache at
all, it triggers a drain of all pending store buffer writes and it blocks
until they complete.

The sheeva and xscale L2 controllers (which predate the concept of Device
memory) don't seem to have a corresponding function.  It appears that the
standard armv5 drain_writebuf function includes draining all the way
through the L2 controller.
2014-05-11 04:24:57 +00:00
Peter Grehan
ffd328487a Enable SMP for Exynos-based platforms (i.e. Chromebook)
Reviewed by:	br
2014-05-11 04:18:51 +00:00
Ian Lepore
6af0d51bce Make the hardware memory and instruction barrier functions work on armv4
and armv5 as well.
2014-05-11 00:43:06 +00:00
Andrew Turner
b36b897e51 Rename platform_gpio_init to be SoC specific 2014-05-10 21:30:19 +00:00
Andrew Turner
87ef4d1f85 Rename platform_gpio_init to be platform specific, and make it static as
it's only used from this file.
2014-05-10 20:31:05 +00:00
Andrew Turner
3664cbc0f0 Rename platform_gpio_init to be SoC specific, and make it static as it's
only called from this file.
2014-05-10 20:26:49 +00:00
Ian Lepore
b8821f8415 When mapping device memory, use PTE_DEVICE rather than PTE_NOCACHE.
On armv4 these are defined as synonyms right now, but it's a bit ambiguous
what NOCACHE means (is buffering/write-combining also enabled or not?); this
is a first step towards replacing PTE_NOCACHE with a less ambiguous name.
2014-05-10 20:03:03 +00:00
Ian Lepore
dfd03689d7 Call idcache_inv_all from the AP core entry code before turning on the MMU.
Also, enable instruction and branch caches, which should be safe now that
they're properly initialized/invalidated first.
2014-05-09 19:14:34 +00:00
Ganbold Tsagaankhuu
08d56ebf0a Add the codes for enabling CPU cores of Rockchip RK3188 SoC.
Enable SMP for Radxa Rock board.

Approved by:	stas (mentor)
2014-05-09 05:39:57 +00:00
Ian Lepore
9f8e153645 Consolitate all the AP core startup stuff under a single #ifdef SMP block.
Remove some other ifdefs that came in with a copy/paste that mean basically
"if this processor supports multicore stuff", because if you're starting up
an AP core... it does.
2014-05-08 20:02:38 +00:00
Ian Lepore
f296249f58 Move the mptramp code which is specific to the Marvell ArmadaXP SoC out of
the common locore.S file and into the mv/armadaxp directory.
2014-05-08 18:36:42 +00:00
Ian Lepore
0bd55d38ec Use edge-triggered interrupts rather than polling loops to avoid missing
transitions of the INIT_B line.  Also, release the mutex during uiomove().

Submitted by:	Thomas Skibo <ThomasSkibo@sbcglobal.net>
2014-05-08 17:20:45 +00:00
Ian Lepore
95da66135d Enable PL310 power-saving modes and tune the cache ram latencies for imx6. 2014-05-06 14:26:24 +00:00
Ian Lepore
334b9c79c3 Add a public routine to set the L2 cache ram latencies. This can be
called by platform init routines to fine-tune cache performance.
2014-05-06 14:19:54 +00:00
Ian Lepore
7b41388248 Add defines for the bits in the PL310 debug control register.
This should have been part of r265444.
2014-05-06 14:08:42 +00:00
Ian Lepore
b450e1090d Call platform_pl310_init() before enabling the controller, and handle the
case where the controller is already enabled.

Some of the pl310 configuration registers cannot be changed while the
controller is active, so if there is any platform-specific init to be done
it must happen before enabling the controller.

The controller should not be enabled upon entry to the kernel, but u-boot
has recently developed the bad habit of leaving caches enabled when
launching the kernel, and since we have no control over that source code
we have to do our best to cope with it.  The PL310 manual doesn't document
a safe sequence for disabling the controller, but the sequence used here
(force write-through mode and disable linefill allocations, then clean and
invalidate the current contents before disabling the hardware) appears to
be sound both by analysis and empirical testing.

These changes were developed and tested in collaboration with
Svatopluk Kraus <onwahe@gmail.com>.

Reviewed by:	cognet@
2014-05-06 14:03:35 +00:00
Ian Lepore
9925f09b81 Break out the code that figures out the L2 cache geometry to its own
routine, so that it can be called from multiple places in upcoming changes.
2014-05-06 13:46:36 +00:00
Ian Lepore
a787d4c699 Move the pl310.enabled tunable to hw.pl310.enabled. Clean up a few minor
style(9) nits.  Use DEVMETHOD_END.
2014-05-06 13:38:34 +00:00
Luiz Otavio O Souza
1deba728cd Fix the tinderbox armv6/arm build failure.
VYBRID code depends on FDT.
2014-05-03 03:40:36 +00:00
Ganbold Tsagaankhuu
b4ce42b4b8 Switch to use arm_devmap_add_entry() to setup static device mapping.
Approved by:	stas (mentor)
2014-05-02 01:20:13 +00:00
Warner Losh
9f06808398 This was copied to IMX6, which has since evolved further. Remove this
as it is no longer needed.
2014-04-30 18:02:19 +00:00
Warner Losh
7621eebbb1 Omit from the universe build all config files tagged with
#NO_UNIVERSE. Many of these config files are important examples, but
add little to no regresive value to the intended purpose of
UNIVERSE. We now build over 120 kernels during universe. There's
really little to no value to this over building say 60 or even 30 of
them (either is still a way too big number). This is especially true
for kernels that are nothing more than including a common base and
adding a static DTB file. Start by pruning 1/3 of the arm kernels that
add little regresion value.
2014-04-30 18:02:10 +00:00
Ian Lepore
4c05359867 Convert the Zynq SoC support to the new routines for static device mapping. 2014-04-30 14:38:13 +00:00
Ian Lepore
457e64a02f Make this declaration into a proper function prototype. 2014-04-29 23:29:28 +00:00
Ian Lepore
06177e52c9 Add SMP support for Zedboard.
Submitted by:	Thomas Skibo <ThomasSkibo@sbcglobal.net>
2014-04-29 17:48:57 +00:00
Ian Lepore
440fe55df6 Don't use multiprocessing-extensions instruction on processors that don't
support SMP.

Submitted by:	loos@
Pointy hat to:	me
2014-04-28 02:35:28 +00:00
Ian Lepore
88b3694bd9 Move duplicated code to print l2 cache config into the common code. 2014-04-27 23:47:38 +00:00
Ian Lepore
f62cbe0e49 Explain why wbinv_all is SMP-safe in this case, and add a missing l2 cache
flush.  (Either it was missing here, or it isn't needed in the minidump
case.  Adding it here seems like the safer path to consistancy.)
2014-04-27 20:26:15 +00:00
Ian Lepore
fa046341af Flush and invalidate caches on each CPU as part of handling IPI_STOP.
Flushing the caches is required before doing a panic dump, but ARM
doesn't provide a flavor of flush that gets broadcast to other cores.
However, all cores except one are stopped before doing a dump, so this
works around the lack of a global flush/invalidate by doing it locally
on each CPU as part of stopping.

Discussed with:	cognet@
2014-04-27 20:16:51 +00:00
Ian Lepore
824e4131a0 There is no difference between IPI_STOP and IPI_STOP_HARD on ARM, so
map them both to the same interrupt number like other arches do.
2014-04-27 20:01:59 +00:00
Ian Lepore
edecf7f6c1 Remove cpu_idcache_wbinv_all() from kdb_cpu_trap(), it's no longer needed.
This was added ca. 2004 for the purpose of ensuring the caches were in the
right state after the debugger set a breakpoint.  kdb_cpu_sync_icache()
was added in 2007 to handle that situation, and now the wbinv_all is
actually harmful because the operation isn't broadcast to other cores.
2014-04-27 18:12:55 +00:00
Ian Lepore
91c650065a Provide a proper armv7 implementation of icache_sync_all rather than
using armv7_idcache_wbinv_all, because wbinv_all doesn't broadcast the
operation to other cores.  In elf_cpu_load_file() use icache_sync_all()
and explain why it's needed (and why other sync operations aren't).

As part of doing this, all callers of cpu_icache_sync_all() were
inspected to ensure they weren't relying on the old side effect of
doing a wbinv_all along with the icache work.
2014-04-27 00:46:01 +00:00
Ian Lepore
75c95895f5 Call cpu_icache_sync_range() rather than sync_all since we know the range
and flushing the entire icache is needlessly expensive.
2014-04-26 23:09:01 +00:00
Scott Long
60ad8150c7 Retire smp_active. It was racey and caused demonstrated problems with
the cpufreq code.  Replace its use with smp_started.  There's at least
one userland tool that still looks at the kern.smp.active sysctl, so
preserve it but point it to smp_started as well.

Discussed with: peter, jhb
MFC after: 3 days
Obtained from: Netflix
2014-04-26 20:27:54 +00:00
Ian Lepore
a7fa939bb3 Stop calling imx51_ccm_foo() clock functions from imx6 code. Instead
define a few imx_ccm_foo() functions that are implemented by the imx51 or
imx6 ccm code.  Of course, the imx6 ccm code is still more a wish than
reality, so for now its implementations just return hard-coded numbers.
2014-04-26 16:48:09 +00:00
Ian Lepore
49f85c3edb Remove uncessary cache and TLB maintenance ops.
- These were needed on armv4/5 (VIVT cache), not needed on armv6.
 - The wbinv_all call can't be used on SMP systems; cache operations by
   set/way are not broadcast to other cores.
 - The TLB maintenance operations needed for pmap_growkernel() happen in
   pmap_grow_l2_bucket(), so there's no need to flush all TLB entries at
   the end.
 - There may not be any need for the TLB flush at the beginning of
   pmap_release(), but it's left in for now pending more investigation.

Pointed out by:	   Svatopluk Kraus <onwahe@gmail.com>
Discussed with:	   cognet@
2014-04-20 18:21:05 +00:00
Rui Paulo
9e63671c57 Updates to i.MX53:
* Define support for the SDHCI driver, although it doesn't work yet
* Fix the memory mappings for IPU [1]

Reviewed by:	ray [1]
2014-04-08 04:05:04 +00:00
Rui Paulo
9d3cc729fb Move sys/arm/econa to sys/arm/cavium/cns11xx. 2014-04-07 05:33:30 +00:00
Ian Lepore
0b7d5b8f89 Tell VM we now have ARM platforms with physically discontiguous memory. 2014-04-06 21:40:39 +00:00
Luiz Otavio O Souza
1f1e8f1681 Partially revert r264083.
While it is the recommended initialization procedure, it hangs on the reset
of the second GPIO module on pandaboard.

Removes the module reset for now as more investigation would be needed.

Reported by:	jceel
2014-04-06 17:09:51 +00:00
Ian Lepore
2d1e88da97 Add a couple more required TLB flushes.
These should have been part of r264129, they are part of the overall set
of changes that got several weeks of testing.  I must have fumbled them
while merging various patchsets.
2014-04-06 00:17:41 +00:00
Rui Paulo
87c6502bba Follow files.imx51 and add vt support. 2014-04-05 23:16:51 +00:00
Rui Paulo
9fe6f910fd Remove code under PMAP_CACHE_VIVT that is not compiled anymore.
This is for ARMv4/ARMv5 and it doesn't belong in ARMv6 code.

Reviewed by:	ian
2014-04-05 18:13:28 +00:00
Luiz Otavio O Souza
db8a14ec74 - Fix the setup of interrupts for banks 2 and 3 on AM335x.
On AM335x each one of the four GPIO banks has two physical interrupt
    lines, so we now allocate resources and setup our interrupt handler for
    all the (8) available interrupts.

    On OMAP3 and OMAP4 there is only one interrupt for each GPIO bank (6
    banks, 6 interrupts), but there are two set of registers where the
    first one is used to setup the delivery of interrupts to the MPU and
    the second set, setup the delivery of interrupts to the DSP.

    On AM335x, each set of registers controls each one of the interrupt
    lines.

- Remove nonexistent registers for OMAP4 and AM335x, replace their use with
  the correct ones for these SoCs.

- Remove stray whitespace.

Based on OMAP3, OMAP4 and AM335x TRMs.

Tested on Beaglebone-black.
2014-04-05 17:53:59 +00:00
Ruslan Bukin
11a99c6984 Correct the end address of the video frame buffer.
This fixes problem that sometimes display suddenly
goes blank.
2014-04-05 16:38:27 +00:00
Ian Lepore
78806b5ec8 Enable SMP for Pandaboard. 2014-04-04 20:58:45 +00:00
Ian Lepore
de6a23b300 Switch wandboards over to the common IMX6 kernel config, which has SMP
enabled.  Also switch IMX6 to use SCHED_ULE.

The now-unreferenced WANDBOARD.common config will be deleted after giving
folks who may be including it a heads-up to switch to IMX6.
2014-04-04 20:42:44 +00:00
Ian Lepore
e69ba7c708 We don't support any ARM systems with an ISA bus and don't need a freelist
of memory to support ISA addressing limitations.
2014-04-04 19:35:38 +00:00
Ian Lepore
24ca71778e Allocate per-cpu resources for doing pmap_zero_page() and pmap_copy_page().
This is performance enhancement rather than bugfix.
2014-04-04 17:57:49 +00:00
Ian Lepore
a2f5bf29cd Fix TLB maintenance issues for armv6 and armv7.
- Add cpu_cpwait to comply with the convention.
  - Add missing TLB invalidations, especially in pmap_kenter & pmap_kremove
    with distinguishing between D and ID pages.
  - Modify pmap init/bootstrap invalidations to ID, just to be safe.
  - Fix TLB-inv and PTE_SYNC ordering.

This combines changes submitted by ian@, cognet@, and Wojciech Macek,
which have all been tested together as a unit.
2014-04-04 17:45:39 +00:00
Ian Lepore
028a159090 Fix TTB set operation for armv7.
Perform sychronization (by "isb" barrier) after TTB is set.  This
is done to ensure that TLB invalidation always executes after
TTB modification and operates on valid CP15 data (per specification).

Submitted by:	Wojciech Macek <wma@semihalf.com>
Reviewed by:	ian@, cognet@
2014-04-04 17:39:05 +00:00
Ian Lepore
453efe588d Flag several sysctl variables as tunables. 2014-04-04 15:31:57 +00:00
Ian Lepore
922e7b19a7 Adjust the comments about translating clock divisor bits to match recent
code changes.
2014-04-04 15:03:03 +00:00
Ruslan Bukin
10b54ef6a9 Remove unused prototype. 2014-04-04 05:05:43 +00:00
Ian Lepore
05f1e1778e Let's try having just one mmc/sd controller driver.
Pointed out by:	gjb
2014-04-04 03:48:43 +00:00
Ian Lepore
d9da5f55cd Use the sdhci driver for Pandaboard. 2014-04-04 03:24:19 +00:00
Ian Lepore
8a9361b862 Switch OMAP4 (Pandaboard et. al.) to use the ti_sdhci driver. 2014-04-04 03:11:06 +00:00
Ian Lepore
927f53548b Fix the logic for translating between MMCHS and SDHCI clock divisors.
Submitted by:	Svatopluk Kraus <onwahe@gmail.com>
2014-04-04 03:04:29 +00:00
Ian Lepore
ef3c56a250 Various fixes to the ti_sdhci driver, mostly to make it work on Pandaboard.
- Don't allow high-speed mode on OMAP4 due to hardware erratum.
 - Check the proper bit in the status register when waiting for the
   controller to come out of reset.
 - Add handling for the "non-removable" fdt property by always returning
   "card is present" status.
 - Add the non-removable property for the MMC card on a Beaglebone Black.
 - Add the non-removable property for Pandaboard as a workaround.

For Pandaboard the card detect pin is handled by the twl6030 fpga device
which gets an interrupt on pin change and then has to query the fpga
for the actual status.  We don't have code to do that yet.

Submitted by:	Svatopluk Kraus <onwahe@gmail.com>
2014-04-04 00:59:40 +00:00
Ian Lepore
e354cdacde Actually save the clock frequency retrieved from fdt data. I fumbled
this when I converted getprop to getencprop.

Submitted by:	Thomas Skibo
Pointy hat to:	ian
2014-04-04 00:00:05 +00:00
Luiz Otavio O Souza
9b1cba84ac Move the GPIO bank initialization to a new function to make easier to detect
errors.

Reset the GPIO module during the initialization.  This is guaranteed to be
the same as a hardware reset.  Tested on AM335x (BBB) and checked against
the omap3 and omap4 TRM.

Do a better job freeing resources when there are errors and on
ti_gpio_detach().
2014-04-03 17:55:08 +00:00
Ruslan Bukin
12899ea195 - Setup both secure and non-secure timer IRQs.
We don't know our ARM security state, so one of them will operate.
- Don't set frequency, since it's unpossible in non-secure state.
  Only rely on DTS clock-frequency value or get clock from timer.

Discussed with:	ian, cognet
2014-04-03 05:48:56 +00:00
Ian Lepore
0140748043 Rework the cpu frequency management code for imx6.
This adds the concept of "operating points," combinations of frequency
and voltage at which the cpu is known to work correctly.  Some day these
should come from FDT data, but for now the table is hard-coded.

This also allows tuning the min and max operating frequencies.  The min
frequency is what the thermal management code will slow down to if the
core temperature gets too high.  The max frequency is what gets used if
the temperature is okay.

Normally the max cannot be set higher than the value burned into the
ocotp fuses as the chip's rated max, but there is now a new sysctl+tunable
cpu_overclock_enable; when set to non-zero it allows raising the frequency
above the ocotp value: USE WITH CARE!  (At least one of my imx6 boards
has a cpu whose ocotp values never got set correctly; they claim a max
of 792mhz, but the physical markings on the chip say it's good to 1ghz.)

Because all these values affect the entire SoC, there is a new sysctl
node, hw.imx6, where all these values live.  The values that are currently
under dev.imx6_anatop.0 should probably move to hw.imx6 too, because
"anatop" doesn't even mean anything to me, let alone to an end user.
2014-04-02 21:34:48 +00:00
Ian Lepore
a3ff7ef69c Switch imx6 to using the mpcore per-cpu event timers, but continue to use
the GPT timer, which is fixed-frequency, as a timecounter.
2014-04-02 21:06:43 +00:00
Ian Lepore
647c8464a6 Don't call sdhci_init_slot() until after handling the FDT properties
related to detecting card presence.  This actually makes no difference
now, but will when we get support for gpio-based card detection.
2014-04-02 19:06:53 +00:00
Ian Lepore
5b9b849b45 Trivial changes/forced-commit to document previous change r264050 whose
description was eaten by the dog (or an editor crash or something).

Add variable-frequency support to the arm mpcore eventtimer driver.

This allows a platform's early init code to tell the mpcore driver that the
clock frequency can vary.  That causes the mpcore driver to register an
eventtimer, but not a timecounter.  The platform has to provide a time
counter using some other fixed-frequency clock, but can still use the
per-cpu goodness of the mpcore hardware for event timers.

When the platform support code does something to change the frequency of
the CPU clocks (power saving, thermal management) it must tell the mpcore
driver code about it using arm_tmr_change_frequency().
2014-04-02 18:49:50 +00:00
Ian Lepore
b24b2743ce 2014-04-02 18:43:56 +00:00
Ian Lepore
c878f70aae Disable the timer and clear any pending bit, then setup the new counter
register values, then restart the timer.  This prevents a situation where
an old event fires just as we're about to load a new value into the timer,
when the start routine is called to change the time of the current event.

Also re-nest the parens properly for casting the result of converting
time and frequency to a count.  This doesn't actually change the result of
the calcs, but will some day prevent a loss-of-precision warning on the
assignment, if that warning gets enabled.
2014-04-02 18:32:27 +00:00
Luiz Otavio O Souza
ff5823beea Fix some of the style(9) problems on ti_gpio. Note that this commit does
not fix all the style(9) problems, but will open room for the next commits.

Remove redundant code and declarations.

No functional changes.
2014-04-01 18:46:56 +00:00
Tijl Coosemans
0a4c54d606 Rename __wchar_t so it no longer conflicts with __wchar_t from clang 3.4
-fms-extensions.

MFC after:	2 weeks
2014-04-01 14:46:11 +00:00
Ruslan Bukin
66e227bf1e Add Cortex-A15 cpu id revisions. 2014-04-01 04:56:40 +00:00
Ruslan Bukin
2638cebe23 Release i2c bus on detach. 2014-04-01 04:40:08 +00:00
Ruslan Bukin
657fae63fc Add support for keyboard used in Samsung Chromebook (ARM machine)
Support covers device drivers for:
- Interrupt Combiner
- gpio/pad, External Interrupts Controller (pad)
- I2C Interface
- Chrome Embedded Controller
- Chrome Keyboard

Also:
- Use new gpio dev class in EHCI driver
- Expand device tree information
2014-03-30 15:22:36 +00:00
Ruslan Bukin
a3fcf1f8d9 Add lowercase postfix, so SoC-common file will be ignored by tinderbox. 2014-03-30 14:57:00 +00:00
Ruslan Bukin
1a59c06c73 Directly call kmem_alloc_contig to allocate framebuffer memory
and pass VM_MEMATTR_UNCACHEABLE (no-cache, no-buffer).
This fixes screen refreshing problem when data is updated too slowly.

Discussed with:	ian
2014-03-30 14:42:53 +00:00
Ruslan Bukin
89eecf5b97 - Merge SoC-common parts
- Enable iicbus device
2014-03-30 14:25:14 +00:00
Andrew Turner
d4f9011c2e VFP fixes/cleanups for ARM11:
* Save the required VFP registers on context switch. If the exception bit
   is set we need to save and restore the FPINST register, and if the fp2v
   bit is also set we need to save and restore FPINST2.
 * Move saving and restoring the floating point control registers to C.
 * Clear the fpexc exception and fp2v flags on a floating-point exception.
 * Signal a SIGFPE if the fpexc exception flag is set on an undefined
   instruction. This is how the ARM core signals to software there is a
   floating-point exception.
2014-03-29 14:35:36 +00:00
Andrew Turner
2819cfdf3f Initialise fpscr to a sane value when we create the pcb. This sets NaNs to
be the default NaN and for denormalised numbers to be flushed to zero.
2014-03-29 14:17:04 +00:00
Andrew Turner
4797432ff7 Add more flags for the fpexc register from the ARM1176JZF-S Manual 2014-03-29 10:11:19 +00:00
Ganbold Tsagaankhuu
fe47fb7b1c Switch to my freebsd.org emal address in copyright.
Approved by:	stas (mentor)
2014-03-25 08:31:47 +00:00