Commit Graph

62405 Commits

Author SHA1 Message Date
marty
09101f82f1 XU4 interrupt combiner
Written but untested.  I'm still confused about how to handle two things:

1) at interrupt disestablishment, where do I get an interrupt number so
   that I can disable the interrupt on the combiner?

2) How is interrupt multiplexing handled?  I don't seem to have any sort of
   interrupt dispatch routine that takes the 1 interrupt that reaches the
   gic and turn it into one of eight combined interrupts to call the
   established interrupt for the original uncombined interrupt source.
2015-12-24 21:20:17 +00:00
christos
d5137ecf34 fenv for m68k 2015-12-24 14:12:39 +00:00
jmcneill
cf0b2cc745 use "watchdog" clock if not defined in fdt 2015-12-24 12:47:38 +00:00
marty
ab4448fde0 XU4 GPIO Review Changes
Implement suggestions from Jared.
2015-12-24 01:10:51 +00:00
jmcneill
07ee0d855d HDAUDIO_FLAG_NO_STREAM_RESET hack no longer required 2015-12-23 12:44:06 +00:00
jmcneill
65ddbe033a fix divider calculations for hdmi, and treat clock ID 211 as pll_p_out0 instead of directly pll_p 2015-12-23 12:43:25 +00:00
jmcneill
72ca8a5122 explicitly set high cursor/winbuf address bits when setting modes 2015-12-23 11:58:10 +00:00
jmcneill
a3a1845d5b OF_getprop -> of_getprop_bool 2015-12-22 22:34:42 +00:00
jmcneill
c7c1c02cf1 build fix 2015-12-22 22:32:54 +00:00
jmcneill
1a623fc2e7 Add fdtbus_gpio_{read,write}_raw, which tells the controller not to take
polarity into account. Tegra GPIO pin data includes pin polarity, but so
does a regulator-fixed node, so the end result was that the enable value
was being swapped twice. Change fregulator to use the raw APIs, and adapt
Tegra and Exynos GPIO drivers to support this flag.
2015-12-22 22:19:07 +00:00
jmcneill
bf3831f489 tegra_car_* and tegra_i2c_dvc_write are no more 2015-12-22 22:12:08 +00:00
jmcneill
93e0bfeb6c Switch Tegra over to fdt based clocks and reset controls. 2015-12-22 22:10:36 +00:00
christos
408e0ea0a3 remove dup definitions from fenv.h 2015-12-22 05:28:46 +00:00
marty
7f10785380 XU4 GPIO Driver
This is a moderately tested working gpio driver for the Exynos based ODROID
XU4.  To use this you have to edit the dtd file exynos54422-pinctrl.dtsi
and change the two occurances of 'gpz' to 'gpz0'.  Otherewise it will crash
on a lookup failure.

It certainly could use a code review.
2015-12-22 03:36:01 +00:00
christos
c5319e4d97 fix label and variable name. 2015-12-21 20:44:54 +00:00
christos
5764ae0786 more checking 2015-12-21 19:54:35 +00:00
christos
257ef94e95 Add mips fenv.h (From FreeBSD) 2015-12-21 17:02:32 +00:00
marty
4abb095283 XU4 FDT final checkpoint
step N of N: get rid of baggage by removing whole files.  What's left is in
approximately the same shape as when the FDT update started, that is mostly
broken. What's missing is most of the 76 devices recognized in the dtd. In
other words, This is barely the start of a port.

Next up, gpio then i2c, followed either by straightening out usb or getting
the sdhc driver to work -- both probably require getting the interrupt
combiner to work first. A large chunk of work is left to do on the clocks.
I barely got them attaching to fdt and didn't do anything to take advantage
of the information in the dtd.

None of the other existing drivers, such as they are, properly request gpios,
i2c or clocks, and, of course power domains are off the table.
2015-12-21 04:58:50 +00:00
hkenken
7bb55e0310 Rewritten to take advantage of genfb(4). 2015-12-21 04:26:28 +00:00
marty
1076af4f1e XU4 FDT Last drivers converted
There is a minimum conversion on the clock driver.

The USB driver needs reordering and is broken, but it was broken before.

Next up: tactical nuclear weapons
2015-12-21 03:34:34 +00:00
marty
28841ed18f XU4 FDT missed files 2015-12-21 00:54:35 +00:00
marty
013239775d XU4 FDT checkpoint
It is rather amazing that XU4 gets as far as it does, given how much of this
code simply doesn't work.  Focusing now on getting everything converted to
FDT. Next up USB and clocks.  After that nuke everything that's not needed
and start the port in earnest.
2015-12-21 00:52:50 +00:00
christos
c6ad517cd0 new powerpc fenv.h 2015-12-20 16:23:38 +00:00
christos
ec195e5a37 Add fenv.h for powerpc (from FreeBSD) 2015-12-20 16:23:14 +00:00
marty
4c2606c249 XU4 debug cleanup
get rid of some unneeded debug chatter in machdep
2015-12-20 05:25:01 +00:00
marty
bb53f16923 XU4 GPIO FDT missing file. 2015-12-19 21:43:36 +00:00
marty
645518d8d4 XU4 GPIO FDT broken snapshot
This is broken. exynos_gpio_bank_config and the call to it are wrong, and
the acquire function doesn't work.

But I'm in over my head and I need to discuss this:

There is a problem with the dtd: it doesn't have addresses for the individual
gpios.  Do I add the addresses to it, or go back to the old version where I
have them hard coded in the driver.

There is a problem with creating the gpio device entries:  I suspect I really
need to treat the pinctrl devices as busses and create the gpios as attached
to those busses, but I'm not familiar with how to do that in NetBSD. At the
minimum, a pointer to a similar situation would give me code to follow.
This is different than the usual bus attachment in that the gpios aren't
devices in the dtd (they don't have "compatible" properties) so they don't
get an attach routine called.  An alternative to generating the bus
attachments might be to add "compatible" properties to the GPIO entries
in the dtd. so that they do get attached in the normal way.

If I'm going to modify the DTD, then it should be checked in, so a decision
on where to check them in would be nice, even if it does mean spreading them
all over because of license issues.  (This DTD is GPL v2)
2015-12-19 21:42:31 +00:00
skrll
7a6a862a20 Tweak CPUFLAGS to cover all CPUs 2015-12-19 13:28:22 +00:00
skrll
4f0e9fe0bc Deal with kernel builds where virtualisation isn't available 2015-12-19 13:27:29 +00:00
skrll
e114eb506e Fix up bus_space_map for latest RPI firmware which now passes the FB
address in the mailbox properties as a bus address.
2015-12-19 08:27:01 +00:00
marty
44e186a475 XU4 FDT sscon
This is a mess and I don't understand why part of it works, but it passes
the basic test.

There has to be some better way to get the info that I'm grabbing from the
exynos_uarts[] array.

I'm not sure how to deal with VA != PA when the DTB contains physical rather
than virtual addresses. This is going to be an issue for all of the drivers.
2015-12-17 22:40:49 +00:00
marty
2260f977c3 EXYNOS FDT sscom 2015-12-17 22:39:37 +00:00
skrll
c528b03989 Provide all the BCM2836_INT_CNT*_CPUN helper macros
No functional change.
2015-12-17 08:31:50 +00:00
skrll
4bade1fd54 Remove hypervisor code now it's done in cortex_init 2015-12-17 08:03:06 +00:00
skrll
e3dac3b98c Check for hypervisor mode in cortex_init and exit if the cpu started
there.

Needed by latest RPI firmware.
2015-12-17 08:02:42 +00:00
jmcneill
4e8cdc22f8 use of_getprop_uint32 2015-12-16 19:46:55 +00:00
maxv
38eb13bf9e Extend SMEP support to i386 (does not require PAE). 2015-12-16 18:54:03 +00:00
jmcneill
4d22e75533 move options FDT to std.tegra 2015-12-16 12:26:14 +00:00
jmcneill
bc39608c19 fdt_openfirm_set_data -> fdtbus_set_data 2015-12-16 12:18:02 +00:00
jdc
a0596c5c2c Add V210/V240 environmental sensors that are not in the OFW tree.
Add device properties for adm1026hm on V210, V240, and V440.
2015-12-16 08:01:19 +00:00
jdc
846fbf61f2 Add adm1026hm* for V210, V240, and V440 environmental monitoring. 2015-12-16 08:00:00 +00:00
marty
8c864ca5fe XU4 FDT WDT - convert driver to FDT
The watchdog timer is the most trivial driver in exynos, from the POV of
converting to FDT, so go ahead and do it first.  NOTE: There's a hack in
the driver that needs to eventually be fixed -- the clock frequency is
hardwired when it should be gotten from the clock in the device tree.  I'll
come back and fix this when I'm more comfortable with the api.
2015-12-15 23:15:53 +00:00
marty
6b9db15bac XU4 FDT -- fix bus tags
I got away with not having the generic bus tags for getting minimum fdt to
work; but for real drivers have to actually have them.  Make necessary
corrections.
2015-12-15 23:13:51 +00:00
jmcneill
29c385d652 remove some commented out entries for static i2c device instances 2015-12-15 15:35:10 +00:00
jmcneill
b07fbf224f wire down ldN to sdmmcN, so disk numbers dont jump around between boots 2015-12-15 15:34:04 +00:00
jmcneill
a2676611ae fdtbus_gpio_read handles pin polarity, so fix inverted test in tegra_sdhc_card_detect 2015-12-15 15:33:19 +00:00
marty
2d77e6bbdf XU$ genassym.cf
adding previously missed file.
2015-12-15 04:53:55 +00:00
marty
f2c43fb288 EXYNOS - change ODROID-XU4 to EXYNOS
EXYNOS will be a generic fdt kernel, so signify that with the name change,
as requested by Nick.
2015-12-15 04:38:30 +00:00
macallan
21e70d0c91 zero out struct i2cbus_attach_args before messing with it 2015-12-14 23:21:23 +00:00
marty
a0ce2ca6f0 XU4 FDT Missing file
maybe it'll compile now.
2015-12-14 22:51:42 +00:00
marty
02fc961cd3 XU4 FDT Enable the minimum device tree
This enables the use of FDT on the XU4 but doesn't add any drivers.  However,
with this check in, XU4 becomes useless without a device tree blob from the
Linux tree, which isn't checked in anywhere.
2015-12-14 22:06:57 +00:00
jmcneill
a729620424 add gpiokeys driver 2015-12-14 21:41:42 +00:00
jmcneill
f724ec7be8 handle GPIO_ACTIVE_LOW flag 2015-12-14 20:57:34 +00:00
skrll
b6c41919a3 Move mcrr and mrrc up the list so they match ahead of ldc/ldc2 2015-12-14 15:29:45 +00:00
martin
5a431888d0 Make it compile 2015-12-14 10:12:45 +00:00
skrll
41257cbf99 Delete pmap_pmaps and its only user pmap_dump_all. The list wasn't
being updated in an MP-safe manner.
2015-12-14 09:48:40 +00:00
marty
f017a086d4 FDT XU4 fix uboot support
remove some code I thought I'd previously removed which causes data
aborts if uboot is invoked with 'bootm ADDR - ADDR'.
2015-12-14 05:13:01 +00:00
marty
ba72a38a6c enable the watch dog
This will work only if the patch to sysmon_wdog.c to convert it to
MODULE_CLASS_DRIVER is installed.  Symptom of failure is a crash in
lockdebug because of an uninitialized mutex.
2015-12-14 00:00:22 +00:00
jmcneill
0572689e04 Remove JETSONTK1 and NYAN-BIG kernels, add a new unified kernel named TEGRA. 2015-12-13 23:02:56 +00:00
jmcneill
95d7e08adb Get rid of board-specific options. 2015-12-13 22:55:05 +00:00
marty
91cd6ab1cb undo 'typo' fix and restore 'frequency' to dictionary
Oops.  The 'typo' was elsewhere and I accidently removed setting
the frequency.  Fix that.
2015-12-13 22:28:09 +00:00
jmcneill
36dcd298ce attach nouveau to fdt 2015-12-13 22:05:52 +00:00
jmcneill
e0ffebf2fd remove tegraio 2015-12-13 21:24:06 +00:00
christos
035ebb230e one default is better than two 2015-12-13 21:03:31 +00:00
christos
136970621d PR/50514: David Binderman: Add missing break 2015-12-13 19:53:02 +00:00
christos
317883ba5f better than returning random errors. 2015-12-13 19:51:53 +00:00
christos
dbccff005f PR/50516: David Binderman: Add missing breaks 2015-12-13 19:49:34 +00:00
christos
01337ed743 PR/50523: David Binderman: Fix incorrect shifts. 2015-12-13 19:43:27 +00:00
christos
1fd17d5979 PR/50524: David Binderman: Fix incorrect test 2015-12-13 19:38:09 +00:00
christos
ddd60a0f40 PR/50525: David Binderman: Fix incorrect test. 2015-12-13 19:36:40 +00:00
christos
54e7435b9e PR/50526: David Binderman: Fix incorrect test 2015-12-13 19:18:32 +00:00
christos
ca395ddd87 PR/50530: David Binderman: Add missing printf args 2015-12-13 18:51:14 +00:00
christos
0ad388edf1 PR/50531: David Binderman: Add missing printf args 2015-12-13 18:41:09 +00:00
christos
23d819855e PR/50532: David Binderman: Add missing fclose. 2015-12-13 18:38:23 +00:00
christos
5a2e6e9910 PR/50537: David Binderman: fix bad sizeof 2015-12-13 18:24:50 +00:00
jmcneill
e6535ce7d1 fdt glue for gic 2015-12-13 17:45:37 +00:00
jmcneill
d59db8d057 Use fdt for device enumeration. 2015-12-13 17:39:19 +00:00
christos
19d921e536 need definition 2015-12-13 16:11:14 +00:00
maxv
e3befc155e Implement amd64 support for SMEP - Supervisor Mode Execution Protection.
Now, on CPUs that support this feature, if the kernel tries to execute
an instruction located in userland, the CPU will trigger a page fault.

Tested on amd64 (Intel Core i5).
2015-12-13 15:53:05 +00:00
christos
07d3d8c47c fix the build. 2015-12-13 15:22:31 +00:00
maxv
1848fa424a Retrieve cpuid7 (Structured Extended Features) into ci_feat_val. 2015-12-13 15:02:19 +00:00
jmcneill
6191c2d1d9 pass addr_shift 1 to of_enter_i2c_devs 2015-12-13 11:51:37 +00:00
cyber
c0fdefd598 mvsdio does not work on OPENRD, disable it.
Tested on OpenRD-Client, causes infinite loop during autoconf when enabled.
2015-12-13 04:55:12 +00:00
marty
a94d6459aa XU4: Fix build
missed a dependency on evbarm/odroid that should have been evbarm/exynos.
2015-12-12 21:57:40 +00:00
marty
3a54f27abe XU4: re-enable gpio
c'n'p error left gpio disabled.  fixed.
2015-12-12 21:56:54 +00:00
marty
934d9caf7d Remove ev that's no longer valid
development of the odroid boards has moved to evbarm/exynos and this
directory is now out of date with respect to new development.
2015-12-12 00:42:42 +00:00
macallan
67f9b9131c || -> &&
From PR50534
2015-12-11 19:47:52 +00:00
mlelstv
ad7d3c2070 PR 50516 bad switch case 2015-12-11 08:08:01 +00:00
mlelstv
75a9f56358 PR 50516 bad switch statement.
Adding some comments.
2015-12-11 08:04:20 +00:00
marty
ae8b8d2f78 EXYNOS rewrite step 3 of N: Add aliases for gpio pins
This adds the GPIO aliases that will be used for board-independent driver
lookup until we have FDT.

The idea here is that each pin used by any driver is given a name that
the driver knows that is independent of the gpio bank name.  The mapping
from the alias to the actual gpio bank + pin number is done in this file
and a lookup function is added to exynos_gpio.c that allows a driver to
ask for a gpio pin by the alias name, blisssfully unaware that there is
an underlying GPIO bank name.

Once set up with all the drivers, it should then be possible to move to a
different vendor's board simply by modifying exynos_machdep.c
2015-12-11 04:12:21 +00:00
marty
757c3ba73a add a dma file to the EXYNOS rewrite 2015-12-11 04:05:54 +00:00
marty
7f537c15f8 EXYNOS Rewrite step 2 of N: New exynos_gpio.c
I can't bring  myself to fully nuke from orbit, so there are really two
things in this checkin:

1) A major rewrite of exynos_gpio.c, based mostly on the Nvidia
   tegra_gpio.c file.  This is missing a major function that will be
   added the first time a customer for it is integrated, which is meant to
   select pins based on aliases, rather than pin bank names.

2) A small number of changes to other files that keep the tree compiling
   and progressing as far as ever; except it is now 5422 specific and
   will not boot on the other exynos socs, which I don't have hardware to
   test.

The choice to remove functionality is always controversial, but since
we are doing a significant rewrite and I don't have either
documentation or hardware *and* none of the code really works now
anyway, I'm taking the stance that only tested functionality should be
added, and that we'll layer the other exynos socs on this once it
fully boots.
2015-12-11 04:03:44 +00:00
marty
d5a1486a46 Move everything back into files.exynos 2015-12-11 03:55:18 +00:00
skrll
f5d2541133 PR port-arm/50512: Source code condition impossible
Fix condition which broke ARM1136 function selection when ARM1176 support
was added
2015-12-10 22:04:54 +00:00
marty
666117ed73 Fix a typo 2015-12-10 21:56:04 +00:00
maxv
5e224a552d KNF, and use C-style comments. Also, remove fusword/susword. 2015-12-09 16:55:18 +00:00
christos
8d10f96266 Replace DIOCGPART -> DIOCGPARTINFO which returns the data needed instead of
pointers.
2015-12-08 20:36:14 +00:00
skrll
5b56700641 Don't rely on uboot to enable am335x gpio clocks
From jmcneill@
2015-12-08 14:42:24 +00:00
tsutsui
e9ca2f5972 Make options SCIFCONSOLE patchable via a variable using gdb(1) etc.
Tested on dreamcast.
2015-12-06 02:21:55 +00:00
tsutsui
a97dd8a4c1 Convert tsleep(9)/wakeup(9) pairs to condvar(9) with mutex(9).
Briefly tested with mkbd(4).
2015-12-06 02:04:10 +00:00