Commit Graph

154 Commits

Author SHA1 Message Date
dholland
8498a0b32b bus_width is not used, so don't fetch it; but do leave the logic in place
commented out so it's there if anyone wants it in the future.
PR 50594 from David Binderman.
2016-05-30 16:38:35 +00:00
skrll
4e8e66439e Merge nick-nhusb
- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
    - kern/48308
    - uhub status notification improvements
    - umass(4) probe fix (applied to HEAD already)
    - ohci(4) short transfer fix
2016-04-23 10:15:27 +00:00
chs
2f02870f3b zero the i2c_attach_args structure before filling it in.
fixes occasional crashes in iic_attach().
2016-02-14 19:54:19 +00:00
marty
d973601a09 exynos mct -- snapshot
This code is still a mess, but at least it uses an interrupt-map so I can
use it to test whether interrupt-map handling in fdt_intr_ is working
properly.

Need to get some real documentation and redo this so it works. :(
2016-01-07 04:45:10 +00:00
marty
0d08bb6498 Exynos WDT - change the compatible string to match the current dts 2016-01-07 04:41:46 +00:00
marty
5cba62781b FDT: Interrupts -- add support for interrupt maps
The mct on exynos uses an interrupt map so we add support now.  Devices
represent their interrupts either through a combination of interrupt-parent
and interrupts properties, where the 'interrupts' property is an array of
one or more interrupt specifiers; or through a combination of an
interrupt-parent that points to an interrupt-map, where the interrupt-map
contains 2 or more entries consisting of an index, a pointer to an
interrupt-controller, and a specifier for that controller.

This code adds the ability to walk the interrupt-map and return a specifier.
Unfortunately, the addition requires changing the interface to the
interrupt-controllers' _establish and _intstr functions, so this check in
contains a rototill of the three existing fdt interrupt controllers to use
the new interface.
2016-01-05 21:53:48 +00:00
marty
6965913be9 XU4 interrupt combiner / fake sysmmu
Add sysmmu to have something that calls through to the combiner's establish
routine.  Debug the combiner with it.

At this point the combiner is mostly done, but the interrupt handler has not
been tested.  This may never happen as we may never support any of the
devices that use the combiner for interrupts.  (Or maybe mct)
2016-01-03 04:10:58 +00:00
marty
aab26c1761 XU4 FDT pinctrl
Rewrite the use of pinctrl to reflect the new model from Jared.
2016-01-01 22:37:07 +00:00
marty
2de605cb9d XU4 gpio - get rid of annoying printf 2015-12-31 03:50:34 +00:00
marty
9c676a63b6 XU4 i2c, gpio & pinctrl changes
modify exynos_gpio.c to support the new pinctrl model.
set up the new pinctrl model in exynos_pinctrl.c

Flesh out exynos_i2c.c and set it up to use the new pinctrl model.  NOTE:
exynos_i2c.c is still incomplete.  I need to figure out what to set the
prescaler and scaler to.
2015-12-30 04:30:27 +00:00
jmcneill
ec8413de65 get fifo depth from fdt, use default clock parent for biu 2015-12-27 20:49:01 +00:00
jmcneill
34bb36fc87 make exynos_gpio_fdt_acquire actually work, now dwcmmc properly does card detect for micro SD slot 2015-12-27 12:42:14 +00:00
jmcneill
6e0b285f04 handle active low flag, simplify bank / pin name parsing, no need to panic if bank lookup fails 2015-12-27 12:22:28 +00:00
jmcneill
e2450495a5 update compatible string to match exynos5422-odroidxu3.dts 2015-12-27 12:21:37 +00:00
jmcneill
484b5995c7 update exynosfdt_init to match the devices in exynos5422-odroidxu3.dts 2015-12-27 12:21:12 +00:00
marty
ae03e518e3 XU4 USB snapshot: Reorganize source files
This is just a skeleton,  not a set of drivers, but the pieces are now
more or less in the right places.
2015-12-27 02:54:12 +00:00
marty
73be4c1664 XU4 gpio clean up acquire code
properly locate the bank in the acquire code.  This may even work.
2015-12-27 02:43:42 +00:00
jmcneill
430edbd247 Add dwcmmc glue 2015-12-26 23:13:50 +00:00
jmcneill
74b53f6e7b hook exynos5422 clock support into fdtbus 2015-12-26 22:57:09 +00:00
marty
a8082a0bd6 XU4 I2C snapshot
This is a complete, but untested, driver; except that it needs to be able
to configure gpios and, afaict, we don't yet have an fdtbus_gpio_* function
that will do that.
2015-12-24 21:30:05 +00:00
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
marty
ab4448fde0 XU4 GPIO Review Changes
Implement suggestions from Jared.
2015-12-24 01:10:51 +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
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
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
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
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
marty
2260f977c3 EXYNOS FDT sscom 2015-12-17 22:39:37 +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
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
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
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
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
marty
666117ed73 Fix a typo 2015-12-10 21:56:04 +00:00
jmcneill
3547891a12 fix div clk set/get 2015-12-05 18:29:22 +00:00
jmcneill
159c01c90a Add clock controller backend for Exynos5422. Work in progress. 2015-12-05 13:32:27 +00:00
marty
bf9db215fe add 5422 gic handling to attach code 2015-11-19 05:44:41 +00:00
riastradh
56d3242969 Include <sys/rndsource.h> where it is actually used.
I had removed <sys/rnd.h> from files that didn't mention anything of
the rnd(9) API.  But they included other files which assumed
<sys/rnd.h> had already been included.
2015-04-14 20:32:35 +00:00
riastradh
445478ce67 MD rnd.h cleanups. Please let me know if I broke anything! 2015-04-13 21:18:40 +00:00
joerg
5aebfecd7c Improve inline asm around dsb/dmb/isb:
- always use volatile and mark them as memory barrier
- use the common version from locore.h in all places not included from
  userland
2015-02-25 13:52:42 +00:00