Commit Graph

62650 Commits

Author SHA1 Message Date
christos
31ee5a7a9a use :Q to quote variables properly. 2016-01-25 18:55:25 +00:00
christos
c441eba884 Don't expose kernel structs to userland. 2016-01-25 18:14:40 +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
9789416488 Need _KERNTYPES for round_page() vaddr_t. 2016-01-25 16:34:52 +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
2f34b929f6 use __register_t 2016-01-24 20:02:38 +00:00
christos
2b7829fe47 expose __register32_t for frame.h 2016-01-24 19:49:35 +00:00
christos
512ffbb6fc expose __vaddr_t for segments.h since it is a userland api. 2016-01-24 18:21:50 +00:00
christos
0496cf4b33 use __paddr_t since this is a userland API. 2016-01-24 16:47:50 +00:00
christos
55745840fb use namespace protected types. 2016-01-24 16:13:19 +00:00
christos
f7947ff0c1 expose label_t for _KMEMUSER 2016-01-24 16:08:05 +00:00
christos
5dc68936fa expose __fpregister_t too, merge definitions. 2016-01-24 16:00:45 +00:00
christos
d6d783a302 use namespace protected types. 2016-01-24 16:00:29 +00:00
christos
d84c286204 expose the kernel types for standalone code. 2016-01-23 22:31:19 +00:00
christos
d77af8a6d9 We'll define the kernel types for standalone code. 2016-01-23 22:29:29 +00:00
christos
0512edd781 revert previous, we'll do differently 2016-01-23 22:28:09 +00:00
christos
0d5ae2fd97 Add -D_KERNTYPES 2016-01-23 22:20:45 +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
ffeb8dbf4e Define _KERNTYPES for things that need it. 2016-01-23 21:22:45 +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
riz
9ed3ff4a08 Enable KDTRACE_HOOKS on i386 and amd64 GENERIC. 2016-01-22 21:56:56 +00:00
christos
df13a573b0 PR/50685: David Binderman: fix memory leak 2016-01-21 17:14:05 +00:00
christos
a7dbc6bff9 PR/50684: David Binderman: Fix memory leak 2016-01-21 17:00:23 +00:00
christos
8ad8763155 PR/50683: David Binderman: Fix memory leak. 2016-01-21 16:58:36 +00:00
jklos
cd6b0c019b Change base address to account for later Alpha models with later firmware
which require more space for SRM.
2016-01-20 12:49:21 +00:00
msaitoh
73eb2fb364 Add comments. Fix comments. No functional change. 2016-01-18 05:59:37 +00:00
tsutsui
1cc0bb1b71 Fix fatal "intr_dispatch: stray level 6 interrupt" panic by the GENERIC
kernel on machines without arcofi(4) audio (i.e. all hp300 except HP425e).

I failed to pull all necessary changes for arcofi(4) from OpenBSD
and I should have tested 7.0_RC kernels on my HP382 too :-(

Should be pulled up to netbsd-7 and netbsd-7-0.
2016-01-17 17:49:55 +00:00
christos
f99428016a PR/50668: David Binderman: Don't compare unsigned to -1 2016-01-17 14:57:18 +00:00
martin
5f5662b21a PR port-alpha/50667: add missing va_start/va_end. 2016-01-17 10:44:57 +00:00
tsutsui
e559dfd4b7 Enable LIBSA_CREAD_NOCRC. PR/50638
Bump version to denote user visible change.
Tested on HP9000/382.
2016-01-17 08:05:20 +00:00
tsutsui
db6b7e2af5 Enable LIBSA_CREAD_NOCRC. PR/50638
Bump version to denote user visible change.
Tested on simh 4.0-Beta1 emulationg MicroVAX 3900.
2016-01-17 04:53:16 +00:00
tsutsui
03a3a2cfbc Enable LIBSA_CREAD_NOCRC. PR/50638
Bump version to denote user visible change.
Tested on NWS-1750.
2016-01-17 04:50:36 +00:00
tsutsui
512eb09ee8 Enable LIBSA_CREAD_NOCRC. PR/50638
Bump version to denote user visible change.
 XXX: recent visible changes (memsize probe, SRAM switch command)
      were not denoted in versions
Tested on (real) X68030.
2016-01-17 04:47:59 +00:00
tsutsui
ed7ecb5525 Enable LIBSA_CREAD_NOCRC. PR/50638
Also bump version to denote user visible change.
Tested on LUNA-II.
2016-01-17 04:40:10 +00:00
tsutsui
d943d96739 Make this build without installed DESTDIR files. 2016-01-17 03:08:39 +00:00
mlelstv
2aacffe133 Add 'C' option to bootblock to enable serial console. 2016-01-15 08:27:04 +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
msaitoh
0ed1e694ab Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.
2016-01-13 08:05:58 +00:00
msaitoh
85f00b4def PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
  linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
  decoded.
2016-01-13 07:28:56 +00:00
msaitoh
2faed34875 Add some AMD's bit definitions from "BIOS and Kernel Developer(BKDG) for AMD
Family 15h Models 60h-6Fh Processors".
2016-01-13 07:19:29 +00:00
macallan
cf0c3bdf9c moar register bits 2016-01-11 17:09:25 +00:00
skrll
e87edd2456 PR port-hppa/50642: src/sys/arch/hppa/include/db_machdep.h:118: bad if test ?
Correct the test for rfir and add one for rfi while I'm here.
2016-01-11 08:14:08 +00:00
skrll
0bc3546c15 PR port-arm/50641: src/sys/arch/aarch64/include/db_machdep.h:67: possible bad if test ?
Fix the bl instruction test.
2016-01-11 07:46:15 +00:00
ryo
c2acaf5fa5 __mcount_lock is moved to MI from MD.
because it is needed for all MULTIPROCESSOR arch, but it is exists only in i386 and amd64.

ok christos@, on tech-kern@
2016-01-10 09:04:32 +00:00
christos
92de9d75ce scsibus at scsi should work; if it does not... 2016-01-10 04:09:28 +00:00
christos
8f042a8186 PR/50636: Ryo ONODERA: Add scsibus to vioscsi 2016-01-10 03:19:36 +00:00
msaitoh
68a809a11f Add CLFLUSHOPT bit. 2016-01-08 03:26:35 +00:00
msaitoh
083b66ecbf Add x86 FPU Data Pointer Updated Only bit from Intel SDM. 2016-01-08 02:27:07 +00:00
msaitoh
30fc93dfd1 Index 0x6c is not 126 entries but 128 entries. The old value was from
previous SDM.
2016-01-08 02:25:15 +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
bouyer
13ee92e7ec Apply patch from xsa155: make sure that the backend won't read parts of the
request again (possibly because of compiler optimisations), by using
copies and barrier.
From XSA155:
The compiler can emit optimizations in the PV backend drivers which
can lead to double fetch vulnerabilities. Specifically the shared
memory between the frontend and backend can be fetched twice (during
which time the frontend can alter the contents) possibly leading to
arbitrary code execution in backend.
2016-01-06 15:28:40 +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
msaitoh
0c27f9bb62 Add ismt(4). 2016-01-05 11:33:18 +00:00
hannken
fdc67f6924 Adapt prototypes and usage of rdmsr_locked() and wrmsr_locked() to
their implementation.  Both functions don't take the passcode as
argument.

As wrmsr_locked() no longer writes the passcode to the msr the
erratum 721 on my Opteron 2356 really gets patched and cc1 no longer
crashes with SIGSEGV.
2016-01-05 10:20:22 +00:00
ozaki-r
01554394be Fix #endif; it should be after __END_DECLS
This unbreaks the build of sun2.
2016-01-05 00:47:08 +00:00
christos
8b50aec9fa revert, this has to do with the bootloader protocol version and should
stay the same until there is a reason for it to change.
2016-01-04 18:17:31 +00:00
phx
7a71b65cf8 Make the -p option work, like with loadbsd.
Otherwise the kernel could load into a low-priority 512MB Z3 RAM segment.
2016-01-04 14:10:15 +00:00
christos
c4c05f8e97 change 60 to 70 which is the current release. Noticed by Rares Aioanei. 2016-01-03 20:59:47 +00:00
jdc
2415217316 Remove duplicate register definitions and merge them all into pcf8584reg.h.
No functional change.
2016-01-03 17:32:17 +00:00
macallan
6a9f064d48 comment out ukphy 2016-01-03 06:23:25 +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
macallan
bdb6cefb4c enable ehci, now that it works properly 2016-01-02 16:55:46 +00:00
macallan
1ae1c2335b properly initialize the EHCI
from Alexander Kabaev ( kan at freebsd.org )
2016-01-02 16:50:52 +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
tls
e4dd39cedc Enable second noise source on newer VIA CPUs 2016-01-01 19:46:48 +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
jdc
aa22af27ce Restrict the check for fully specified interrupts to machines with psycho
controllers only, and adjust comments to note this.

See also the mail thread starting at:
  http://mail-index.NetBSD.org/port-sparc64/2015/12/03/msg002488.html
2015-12-30 09:16:17 +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
christos
d075aff38a disable code that does not work for sun2/coldfire 2015-12-29 16:02:37 +00:00
christos
ed74e51b8a Holiday food satiation. 2015-12-29 14:51:38 +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
6f8a66951d wildcard attachments to fdtbus 2015-12-27 12:26:42 +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
macallan
0d755f15d0 add awiniic* and tve 2015-12-27 06:24:25 +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
aef4a7dee1 add dwcmmc 2015-12-26 23:14:08 +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
jmcneill
01c706f76f tag kernel as type linux so we get the fdt address in r2 2015-12-26 22:53:52 +00:00
macallan
c1cfa97a05 driver for cubietruck's VGA port. Not quite finished but enough to be useful 2015-12-26 16:56:41 +00:00
macallan
d7c9e3d9d2 add access function to get the i2c_controller, awiniic2 is the VGA output's
DDC2 port on cubietruck
2015-12-26 16:54:41 +00:00
macallan
593ac207e3 add registers for TV encoder / VGA output 2015-12-26 16:48:54 +00:00
christos
3f78fc62e3 make this compile for c++ 2015-12-25 16:19:38 +00:00
christos
3feb613f34 get rid of dup fenv. 2015-12-25 06:03:06 +00:00
christos
522db2ab36 move fenv inside ifdef 2015-12-25 06:02:10 +00:00
christos
94ed82768d remove dup fenv 2015-12-25 06:01:38 +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
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
marty
193691568d try 2 2015-12-06 00:33:44 +00:00
marty
327d10328a Reorganize Exynos code step 1 of N
create config files that use evbarm/exynos rather than evbarm/odroid for
the machdep portion.

point ODROID-XU4 at those files

add evbarm/exynos/exyos_{start.S, machdep.c} and platform.h that are exynos
5422 specific.  -- We'll edit in other exynos platforms once this one
fully works.

This boots the Odroid XU4 to the same point as using evbarm/odroid does, but
with some differences in gpio handling.  Everything else should be semantically
equivalent.
2015-12-06 00:31:24 +00:00
jmcneill
3547891a12 fix div clk set/get 2015-12-05 18:29:22 +00:00
jmcneill
55d1432cda add exy5422clk0 2015-12-05 13:32:49 +00:00
jmcneill
159c01c90a Add clock controller backend for Exynos5422. Work in progress. 2015-12-05 13:32:27 +00:00
skrll
0646ffbda9 Update comments to reflect reality 2015-12-04 11:14:14 +00:00
skrll
e53ab2206b Use tabs instead of spaces 2015-12-04 11:09:54 +00:00
skrll
be813c7e4c Shave another whole instruction when KERNEL_BASE_VOFFSET == 0 2015-12-04 11:01:35 +00:00
jmcneill
0faea1444b replace 2292MHz entry with 2316MHz 2015-12-01 22:08:13 +00:00
skrll
fa67479436 Whitespace 2015-11-30 07:51:44 +00:00
skrll
0748561f22 Page align KERNEL_BASE_{PHYS,VIRT} and fix boot on my BPI after the XN
fix.
2015-11-29 19:52:03 +00:00
jmcneill
b8bc161064 Fix A9 periph clock when selecting frequencies below 1200MHz. Remove
frequencies below 312MHz as they require special handling. We can now
choose between 1536 1488 1320 1200 1008 816 720 600 504 408 312.
2015-11-29 19:16:58 +00:00
jmcneill
3c6f5bd68b Retire CPUFREQ option, instead just pick the highest available frequency
at boot. Update the list of supported frequencies to match the list of dvfs
frequencies from the meson8b dts, capped at 1.5GHz. The highest available
frequency is changed from 1512MHz to 1536MHz.
2015-11-29 16:52:00 +00:00
marty
11b4c07d53 Exit hypervisor mode before entering supervisor
The Odroid XU4 is booted in hypervisor mode, probably because it is trust
zone enabled.  Before we can put it in supervisor we must explicitly remove
it from hypervisor.

This change is from Nick, who figured it out and adapted code from FreeBSD
to make the necessary change.
2015-11-28 20:51:36 +00:00
maxv
5f9c9faaae KNF 2015-11-28 18:08:40 +00:00
dholland
cf8a8cd732 If the kernel jumps to NULL, print where it came from instead of trying
to dereference and faulting again.
2015-11-28 15:06:55 +00:00
skrll
26d7324de5 EXYNOS_CONSOLE_EARLY doesn't belong here 2015-11-27 22:02:15 +00:00
joerg
079b557452 Don't use dynamically sized unions, they are a horrible GNUism. Just use
the existing upper limit all the time.
2015-11-27 16:52:32 +00:00
joerg
7a3084cdcb Shuffle a bit to avoid empty loop body. 2015-11-27 13:51:57 +00:00
joerg
1caddb70de Left-shift of negative values is UB. 2015-11-27 13:51:24 +00:00
joerg
b5e21344a8 Remove shifts of the PSR constants before applying to the trap frame.
Oring 0 doesn't do anything useful.
2015-11-27 13:45:17 +00:00
skrll
d290e6d4a4 Save a whole instruction when KERNEL_BASE_VOFFSET is zero. 2015-11-27 09:45:03 +00:00
skrll
382a7e8f5d Improve a comment 2015-11-27 09:43:18 +00:00
martin
48c485ef40 Use __BIT() for some masks to fix the sparc build.
No binary changes.
2015-11-27 09:34:36 +00:00
skrll
9fac32b813 Add some KERNEL_BASES_EQUAL improvements from other start.S files.
My ODROID-XU still boots.
2015-11-27 08:48:24 +00:00
skrll
c3386d6a28 #ifdef -> #if defined()
No functional change
2015-11-27 08:43:10 +00:00
skrll
6ec9fcac24 Don't use magic number.
No functional change.
2015-11-27 07:47:45 +00:00
skrll
4752849d34 Use movw/movt to get EXYNOS_CORE_PBASE (just in case) 2015-11-27 07:45:58 +00:00
skrll
5d40bab545 Use character literals and not decimals.
No functional change.
2015-11-27 07:44:39 +00:00
mrg
f226e7b3ac s/pa/busaddr/ in a debug message, we print the actual paddr next. 2015-11-27 00:36:58 +00:00
mrg
ed60313be6 adjust a bunch of debugging messages to use __func__ and to normalise
newline usage (some sequences ended up printing blank lines.)
2015-11-26 23:44:57 +00:00
marty
9b6341fa5f remove *all* of my changes to odroid_start.S 2015-11-26 22:22:44 +00:00
marty
0a242e0558 repair conflicts from previous commit
stupid marty checked in version with conflicts. bad marty no donut.
2015-11-26 21:42:18 +00:00
marty
add5642d6d Revert my previous change -- it breaks other odroid devices 2015-11-26 21:27:31 +00:00
jakllsch
6687fa94ab Move acpimcfg_map_bus() before no-MSI bailout in pci_attach_hook(). 2015-11-26 16:27:05 +00:00
martin
76713fa86f We never exec(2) with a kernel vmspace, so do not test for that, but instead
KASSERT() that we don't.
When calculating the load address for the interpreter (e.g. ld.elf_so),
we need to take into account wether the exec'd process will run with
topdown memory or bottom up. We can not use the current vmspace's flags
to test for that, as this happens too early. Luckily the execpack already
knows what the new state will be later, so instead of testing the current
vmspace, pass the info as additional argument to struct emul
e_vm_default_addr.
Fix all such functions and adopt all callers.
2015-11-26 13:15:34 +00:00
jmcneill
4f2f3d26d2 disable watchdog at startup 2015-11-26 00:06:59 +00:00
maxv
386a6446d1 Cosmetic changes. 2015-11-25 16:00:09 +00:00
skrll
24c4f56c61 G/C TEGRAK1_PMAP_WORKAROUND.
Using XN (eXecute Never) properly means speculative reads from devices
aren't done.  Pretty sure this was the cause of the wedges.
2015-11-25 08:39:45 +00:00
skrll
58ba3c2d62 In the ARM_MMU_EXTENDED case make sure the kernel mappings are marked with
XN (eXecute Never) appropriately.

The XN logic is inconsistent and could do with changing to XN always set
and cleared for VM_PROT_EXECUTE (or the inverse) everywhere.
2015-11-25 08:36:50 +00:00
skrll
ebd4a8ed79 Trailing whitespace. 2015-11-25 08:32:33 +00:00
marty
cfcf2b60eb snapshot: Does NOT boot 2015-11-25 04:04:13 +00:00
marty
aed5bf48c5 something temporary that will go away once odroid xu4 works 2015-11-25 04:03:34 +00:00
jdc
19c1caef81 Set the target JPID for all interrupts on Tomatillo.
If the "ino-bitmap" property is available, use it to route error interrupts.
Minor cosmetic changes.
Add register printing when DEBUG is defined.
2015-11-23 21:40:14 +00:00
tsutsui
2af5fde181 Remove \n from set_cpumodel(), and explicitly print \n during boot instead.
Fixes dmesg on NetBSD/dreamcast 7.0 (and probably NetBSD/hpcsh 7.0):
---
NetBSD 7.0 (GENERIC.201509250726Z)
SEGA Dreamcasttotal memory = 16384 KB
avail memory = 13668 KB
---
which was mangled when cpu_getmode() and cpu_setmodel() were introduced:
 http://mail-index.netbsd.org/source-changes/2014/03/24/msg053273.html

Should be pulled up to netbsd-7 and netbsd-7-0.
2015-11-22 18:44:25 +00:00
aymeric
c480fc766d do not fail if no awintcon is present so that ALLWINNER_A80 compiles again 2015-11-22 17:50:48 +00:00
maxv
165df8bad6 Remove cpu_vendorname (unused). It is retrieved later in identcpu.c. 2015-11-22 14:06:08 +00:00
maxv
a406542551 KNF a bit, so I don't get scared each time I open a file 2015-11-22 13:41:24 +00:00
jmcneill
a5c784b329 replace inline mc_read/write with MC_READ/WRITE macros, install intr handler with IST_MPSAFE flag 2015-11-22 12:26:11 +00:00
martin
49e022399f Reduce the "MAXDSIZ" limit for bottom-up-VA (i.e. old binaries) processes
to the old limit of 1 GB. Some old binaries can not deal with more.
2015-11-22 11:42:55 +00:00
martin
4d43062345 Use NETBSD32PTR32I() for pointer-to-32bit value conversion, requested
by mrg.
2015-11-22 11:24:08 +00:00
maxv
67b107f811 Clarify:
- add some comments
 - rename some jumps
 - KNF
No functional change.
2015-11-22 10:18:59 +00:00
martin
44d63857d1 Removy now unused {s,f}uword 2015-11-22 10:18:14 +00:00
martin
536e060075 remove all MD uses of suword(), replace by copyout() 2015-11-22 09:32:34 +00:00
jmcneill
e2e02058ba enable tegrasoctherm 2015-11-21 22:55:46 +00:00