Commit Graph

118 Commits

Author SHA1 Message Date
Andrew Turner
f622737b2e Fixthe spelling of ehci 2014-09-06 17:33:41 +00:00
Ian Lepore
f8afe33355 Implement the imx_iomux_get/set_gpr() interface for imx6. 2014-09-04 15:11:57 +00:00
Ian Lepore
1b8950cfab Implement the same public interface in imx51 and imx6 iomux; use the common
header file for both.  Remove some unused code from imx51_iomux.  The iomux
drivers are required, not optional, adjust the files.* entries accordingly.
2014-09-04 14:57:04 +00:00
Ian Lepore
f5a76413fe Add a basic iomux driver for imx6.
Submitted by:	bsam@
2014-09-04 14:25:32 +00:00
Ian Lepore
4734ecbfec Fix typo in variable name. 2014-09-04 13:13:42 +00:00
Ian Lepore
f214250a17 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.
2014-09-04 03:04:37 +00:00
Ian Lepore
f14514a385 Add a function to get the frequency of the AHB bus. Another stopgap
function until we have full clock support for imx6.
2014-09-03 21:45:39 +00:00
Ian Lepore
60f47da972 The anatop driver controls power and PLLs and needs to be available before
just about anything else (other than octop which provides it config info),
so make it an EARLY_DRIVER_MODULE().
2014-09-02 02:56:43 +00:00
Ian Lepore
866180c3fc The ocotp driver provides access to registers containing chip configuration
data that is needed by other drivers, so make it an EARLY_DRIVER_MODULE()
that loads before just about anything else.
2014-09-02 02:54:55 +00:00
Ian Lepore
8c8f31e7b2 sdhci.h has grown a dependency on sysctl.h, include the latter where needed. 2014-09-01 19:20:34 +00:00
Ian Lepore
752ba93078 Rename OF_xref_phandle() to OF_node_from_xref() and add a new function
that provides the inverse translation, OF_xref_from_node().

Discussed with:	nwhitehorn
2014-09-01 18:51:01 +00:00
Ian Lepore
1dfe3d275c Move the imx6 sysctl temperature info to hw.imx6 where all the other
soc-wide info lives.  It was under dev.imx6_anatop.0.

What does anatop mean anyway?  Nobody seems to know, so it's probably
not where somebody will think to look for imx6 hardware info.
2014-08-16 20:44:45 +00:00
Jean-Sébastien Pédron
ca885fdfde Fix two files forgotten in r269783 (vt_generate_cons_palette)
Reported by:	bz
MFC after:	1 week
MFC with:	269783
2014-08-10 22:24:14 +00:00
Ian Lepore
9ce4512ccd Add a missing clock register definition. 2014-08-08 01:23:43 +00:00
Ian Lepore
5fdc7f7e8f Cache the imx6 SoC type in a static var so that it only has to be figured
out by sniffing hardware registers once.
2014-08-05 19:10:53 +00:00
Ruslan Bukin
40d7d6323b Enable Freescale i.MX I2C driver for i.MX6. 2014-07-22 04:39:32 +00:00
Ruslan Bukin
484b4fd46c Rename i.MX I2C driver file. 2014-07-22 03:59:14 +00:00
Ruslan Bukin
0495dcef49 Rename gpio driver file. 2014-07-18 07:52:35 +00:00
Ruslan Bukin
e18aa9229a 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

Discussed with:	ian
2014-07-18 07:47:50 +00:00
Ian Lepore
8d99c2a062 Pending interrupt status is cleared by writing to the ISR, not the data reg.
MFC after:	1 week
2014-07-10 14:06:18 +00:00
Ian Lepore
1e3d53c687 Use named constant rather than '0' to access the reset controller register. 2014-07-08 14:35:09 +00:00
Hans Petter Selasky
af3b2549c4 Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
Glen Barber
37a107a407 Revert r267961, r267973:
These changes prevent sysctl(8) from returning proper output,
such as:

 1) no output from sysctl(8)
 2) erroneously returning ENOMEM with tools like truss(1)
    or uname(1)
 truss: can not get etype: Cannot allocate memory
2014-06-27 22:05:21 +00:00
Hans Petter Selasky
3da1cf1e88 Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.

Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.

MFC after:	2 weeks
Sponsored by:	Mellanox Technologies
2014-06-27 16:33:43 +00:00
Ruslan Bukin
b9402e3d56 Add very basic driver for 12-bit Analog to Digital Converter (ADC). 2014-06-15 12:08:33 +00:00
Ruslan Bukin
2aaaabd4c1 Add a driver for Serial Peripheral Interface (SPI). 2014-06-11 10:03:06 +00:00
Kevin Lo
6ed1354934 Remove extra semicolons. 2014-06-06 16:37:42 +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
Ruslan Bukin
3d0bf6b1d0 Fix return value. Should be logic one or zero. 2014-05-15 10:06:59 +00:00
Ruslan Bukin
876ac29ddc Fix typo. 2014-05-14 14:19:57 +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
88b3694bd9 Move duplicated code to print l2 cache config into the common code. 2014-04-27 23:47:38 +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
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
87c6502bba Follow files.imx51 and add vt support. 2014-04-05 23:16:51 +00:00
Ian Lepore
453efe588d Flag several sysctl variables as tunables. 2014-04-04 15:31:57 +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
5e4e1d4995 Eliminate irq_dispatch.S. Move the data items it contained into arm/intr.c
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.
2014-03-10 18:10:09 +00:00
Warner Losh
59c993d121 Move all the files named foo/common.c to foo/foo_common.c, as
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).
2014-03-08 00:14:40 +00:00
Ruslan Bukin
bcec4b54f3 - Export panel info to DTS
- Reset all the layers before setup first one
- Enable display
2014-03-07 16:14:51 +00:00
Ruslan Bukin
0c94becea6 Add driver for Port control and interrupts (PORT).
PORT is responsible for external interrupts management,
so move IRQ lines from GPIO driver.
2014-03-07 07:06:36 +00:00
Ian Lepore
f5a477a34b Add a tunable to set the number of active cores, and enable SMP by default. 2014-03-02 19:46:03 +00:00
Ian Lepore
f85153fec4 Add some rudimentary voltage control to go with the rudimentary frequency
control.  If we have to scale back the frequency due to temperature, it
will help to lower the voltage as well.
2014-02-28 00:26:57 +00:00
Ian Lepore
a78ec80526 Initialize the Low Power Mode bits to keep the ARM cores running during WFI. 2014-02-27 22:55:33 +00:00
Ruslan Bukin
9e04ee7729 Do not setup interrupt handler (polling is used). 2014-02-27 18:13:07 +00:00
Ruslan Bukin
6c68693129 Add driver for Inter-Integrated Circuit (I2C). 2014-02-27 09:59:15 +00:00
Ian Lepore
f0455d6562 Replace many pasted identical definitions of cpu_initclocks() with a common
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.
2014-02-26 22:06:10 +00:00
Ian Lepore
f3549ad525 Minor tweaks to the imx GPT timer...
- Don't use spaces or dots in the eventtimer or timecounter names.
   They turn into sysctl node names, and it's just confusing.
 - Use comparator #3 instead of #1 for one-shot events.  There's an
   extra 1-cycle penalty in the hardware for accessing the registers
   for comparator 1, no point in paying that penalty.
 - Lower the quality of the eventtimer from 1000 to 800, because the
   device can't support PERCPU timers and some other device in the system
   may be able to provide that.
2014-02-26 18:29:14 +00:00