Commit Graph

4945 Commits

Author SHA1 Message Date
bouyer
bdf10c852a The UART in the allwiner SoCs is not full-compatible with the 16550, and
it's not a 16750 either. Like the 16750 it has the IIR_BUSY interrupt,
which is triggered when writing to LCR while the chip
can't accept it. But unlike the 16750, it has a specific register,
HALT, to allow writing to the LCR and divisor registers, and then
commit the changes.
Tested on an A20 SoC, changing the baud rate while keeping the
tty device open and incoming data.
2016-05-27 20:01:49 +00:00
bouyer
727b83213d Remove a KASSERT() which is A20-specific, as well as the local variable
used here.
Fix "error: unused variable 'grp'" for non-DIAGNOSTIC kernels,
reported by Rin Okuyama.
2016-05-26 07:45:51 +00:00
jmcneill
84e0ecfe04 IST_MPSAFE is not a valid flag for fdtbus_intr_establish; use
FDT_INTR_MPSAFE instead.
2016-05-23 18:21:14 +00:00
msaitoh
7ca43d6799 Fix CORTEXA9Rx definitions. 2016-05-17 08:27:24 +00:00
ryo
ec48232126 Add initial support for Freescale i.MX7 SoC and
Atmark Techno Armadillo-IoT G3 boards.

Contributed by Internet Initiative Japan Inc.
2016-05-17 06:44:45 +00:00
bouyer
ba413bf9c2 As proposed in
http://mail-index.netbsd.org/tech-kern/2016/04/28/msg020504.html
add gpio interrupt support to the gpio framework, and an implementation
for the allwinner gpio backend (tested on A20 only).
gpio(4) has new public functions:
- gpio_intr() called by backends when an interrupt condition for
  a gpio pin is present
- gpio_find_device() and gpio_get_name(), support functions for
  gpio(4) users, wich respectively returns a void * cookie for a gpio device
  given its name, and returns the name given the cookie.
- gpio_pin_ctl_intr(), which is used to configure interrupts on a gpio pin and
  registers a callback.
- gpio_pin_irqen(), which is used to mask/unmask interrupts on a pin.

Nothing in the NetBSD tree uses this yet, but I have a i2c driver
(at https://github.com/mbouyer/marine_chartplotter/tree/master/software/NetBSD/driver) which uses it.
2016-05-11 18:33:40 +00:00
ryo
3116614042 * fix checking physical address range. on some arm devices, physical memory doesn't start from 0x00000000.
* allow /dev/mem to read/write memory mapped I/O area depending on kauth.
2016-04-30 19:20:47 +00:00
bouyer
175648e95c Add a driver for the lradc device found in allwinner SoCs.
The events are reported as hotkeys press/release to sysmon_power(9).
The levels and associated event names are configured in the fex script
(the channels remain disabled if no appropriate fex script is provided).
2016-04-25 20:15:46 +00:00
kiyohara
ca97d89123 Check ChipID == OMAP3530. OVERO supports both OMAP3530/3503. 2016-04-25 13:20:42 +00:00
kiyohara
c5b37b8ad4 Add omapscm to critical_devs[]. 2016-04-25 13:17:16 +00:00
kiyohara
699a73d7cf Add function omap_chipid(). 2016-04-25 13:14:37 +00:00
kiyohara
40654b0c2b Print OMAP3 ChipID. 2016-04-25 13:07:03 +00:00
jakllsch
303c7edfa1 Put omapwdt32k(4) in known state (disarmed) on attach.
Some newer U-Boot builds for am335x_evm (BeagleBone) hand us the hardware
with an armed watchdog.
2016-04-23 17:05:30 +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
bouyer
ab971176ac Alternate UART3 pins a PG6-7, not PG8-9 2016-04-12 10:54:29 +00:00
martin
07a988af43 David Binderman in port-arm/51013: masking of rxbdtlen happened before
the value was read - move it down a few lines.
2016-03-26 17:04:03 +00:00
skrll
dc4391d06a Restore HOST1X and AHB_A2 to pmap_devmap to give pmap less work to do 2016-03-26 09:07:31 +00:00
skrll
3e98a566a4 G/C old structs 2016-03-26 08:42:07 +00:00
christos
f415d76a88 PR/50963: David Binderman: Use kmem_zalloc() so all members are initialized. 2016-03-13 17:38:44 +00:00
skrll
16de05a45e #if 0 a KASSERT for now as it doesn't apply to Raspberry Pi 3 2016-03-08 08:01:23 +00:00
skrll
2a81ae4e13 Use the nvidia,has-utmi-pad-registers property.
From Jared.
2016-03-08 07:49:20 +00:00
skrll
8142c3d9b6 Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.
2016-03-03 17:01:31 +00:00
christos
179eb6b78f PR/50881: David Binderman: Remove redundant code. 2016-03-02 19:25:32 +00:00
ryo
cee558c2f4 fix always false comparison.
pointed out by joerg@
2016-02-25 13:27:33 +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
ozaki-r
9c4cd06355 Introduce softint-based if_input
This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
2016-02-09 08:32:07 +00:00
skrll
fc42e17ef4 Fix up bcm283[56] bus_space(4) to really use bus addresses for
peripherals, etc

Simplifies the code in various places and uses the abstraction in
more places. (bcm2835_gpio_subr.c still doesn't)
2016-02-02 13:55:50 +00:00
riastradh
461b4ecf4d Always initialize error.
Found by joerg.
2016-01-30 00:00:56 +00:00
christos
58941b580c protect locore. 2016-01-25 21:54:14 +00:00
christos
49d73c6b61 Move the ipl_cookie_t definition earlier, since the mutex internal impl
uses it.
2016-01-25 16:41:06 +00:00
christos
48bda0e905 This is a mess:
-> sys/mutex.h -> sys/intr.h -> machine/intr.h -> footbridge/footbridge_intr.h
-> arm/cpu.h -> sys/cpu_data.h -> sys/sched.h -> sys/time.h -> sys/timevar.h
-> sys/systm.h -> sys/param.h -> uvm_param.h -> sys/resourcevar.h

Now sys/resourcevar.h needs a concrete definition of kmutex_t, and
although we started including sys/mutex.h we never got to include
machine/mutex.h which actually defines it, since the footbridge_intr.h
took us for a long ride. Take the easy way out and include
arm/mutex.h in footbridge_intr.h so that we get the definition we
need.
2016-01-25 16:30:42 +00:00
christos
d84c286204 expose the kernel types for standalone code. 2016-01-23 22:31:19 +00:00
christos
8cd0a7d1e0 Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.
2016-01-23 21:39:17 +00:00
christos
4d497c90e6 Hide {p,v}{addr,size}_t and register_t (and a couple more types that
are machine-specific) from userland unless _KERNEL/_KMEMUSER and a
new _KERNTYPES variables is defined. The _KERNTYPES should be fixed
for many subsystems that should not be using it (rump)...
2016-01-23 21:22:13 +00:00
macallan
b16126123e revert accidentially committed changes in awin_tcon1_set_videomode() 2016-01-13 17:07:51 +00:00
macallan
f99039090a add OUTPUT_VGA in order to shut down the right output(s) when blanking etc. 2016-01-13 13:29:51 +00:00
macallan
cf0c3bdf9c moar register bits 2016-01-11 17:09:25 +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
ryo
66f8646dd2 use armv7_generic_space 2015-12-31 12:14:01 +00:00
ryo
1fc390a6bc add support iMX6 uSDHC
- some UHS-I/SDR104 card are not stable
- eMMC doesn't work yet
2015-12-31 11:53:18 +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