Commit Graph

2981 Commits

Author SHA1 Message Date
Ed Maste
371f621a11 Delete stray clause 3 and renumber. 2015-03-13 02:49:55 +00:00
Ian Lepore
868c7673d2 Remove MODULES_OVERRIDE="" for Marvel-based armv5 systems.
Also add some #NO_UNIVERSE to configs that essentially duplicate DB-88F6XXX.
2015-03-10 14:36:51 +00:00
Ian Lepore
140e744269 Remove MODULES_OVERRIDE="" and WITHOUT_MODULES="ahc" from armv6 configs.
These are left over from long ago when there was no way to load modules
on early armv6 platforms, and when there was a build problem with ahc
that has long since been fixed, and they just keep getting copy-pasted
into new configs.
2015-03-10 02:33:51 +00:00
Ian Lepore
3e096b705c Change the name of the dmtimer pps device from /dev/ppsN to /dev/dmtppsN.
ntpd is hard-coded to use /dev/ppsN, and typically when multiple PPS sources
are available the sysadmin will symlink the right one(s) to /dev/ppsN, so
it's best to not usurp those names directly.
2015-03-09 21:58:41 +00:00
Ian Lepore
f61d8cc6fe Remove the static DTB config and instead build modules/dtb/am335x.
Also, remove WITHOUT_MODULES="ahc" which was added long ago to work around
build problems that have long since been fixed correctly.

PR:		198460
2015-03-09 21:54:27 +00:00
Ian Lepore
726f3ad5aa Attach the prcm clock driver early, so it can set the mpcore timer frequency.
Submitted by:	Svatopluk Kraus
2015-03-09 15:54:14 +00:00
Warner Losh
601e4171b4 Add the DTrace modules to the build, rather than only build the dtrace
modules.
2015-03-09 15:43:33 +00:00
Ian Lepore
a286c311ab Add minimum cache line sizes to struct cpuinfo, use them in the new cache
maintenance routines.  Also add a routine to invalidate the branch cache.

Submitted by:	Michal Meloun
2015-03-09 14:46:10 +00:00
Ian Lepore
5ca6daaa26 Clean data cache before instruction cache in armv7_icache_sync_range().
Also ensure dsb precedes isb in all icache maintenance routines (first
do a data sync, then stall the instruction stream until it finishes).

Submitted by:	Michal Meloun
2015-03-09 14:42:25 +00:00
Andrew Turner
686513878d Call config_intrhook_disestablish on failure of the bcm2835 fb and fbd intr
hooks. With this we can get through the boot even if these functions fail.

Sponsored by:	ABT Systems Ltd
2015-03-08 14:15:57 +00:00
Andrew Turner
8f3ad0f84e Add support for enabling the USB on the Raspberry Pi boards when it hasn't
been done by U-Boot. This allows the USB to work when we load the kernel
directly.

No dma sync is performed after these operations as the data we read/write
is not used by the cpu after the calls to the maimbox driver.

Differential Revision:	https://reviews.freebsd.org/D1940
Reviewed by:	imp, Michal Meloun (meloun AT miracle.cz)
MFC after:	1 Week
Sponsored by:	ABT Systems Ltd
2015-03-08 13:52:07 +00:00
Ian Lepore
d3df8026cf Fix spurious interrupts on arm am335x (beaglebone), by doing the EOI in
both the post-filter and post-thread callbacks.

Also eliminate a completely unecessary write to INTC_ISR_CLEAR register,
which clears a software-generated interrupt that can only happen with a
write to INTC_ISR_SET (which nothing does).
2015-03-08 03:34:06 +00:00
Ian Lepore
3bb693af87 Move the uart_class definitions and fdt compat data into the individual
uart implementations, and export them using the new linker-set mechanism.

Differential Revision:	https://reviews.freebsd.org/D1993
Submitted by:	Michal Meloun
2015-03-07 15:24:15 +00:00
Ian Lepore
d7c6a65a2b Update a comment that had drifted out of date with the last changes. 2015-03-06 20:52:05 +00:00
Ruslan Bukin
32c282c74a Fix style. 2015-03-06 16:23:30 +00:00
Oleksandr Tymoshenko
8e01fdea2b Add sysctls to control PS-PL level shifters and FCLK settings.
PL (programmable logic) uses FCLK0..FCLK3 as a clock sources.
Normally they're configured by first stage boot loader (FSBL)
and normal user never has to touch them. These sysctls may come
useful for hardware developers

hw.fpga.fclk.N.source: clock source (IO, DDR, ARM)
hw.fpga.fclk.N.freq: requested frequency in Hz
hw.fpga.fclk.N.actual_freq: actual frequency in Hz (R/O)

hw.fgpa.level_shifters: 0/1 to enable/disable PS-PL level shifters,
    normally they're enabled either by FSBL or after programming
    FPGA through devcfg(4)
2015-03-05 21:41:58 +00:00
Andrew Turner
4a8169d97b Add the MD parts of dtrace needed to use fbt on ARM. For this we need to
emulate the instructions used in function entry and exit.

For function entry ARM will use a push instruction to push up to 16
registers to the stack. While we don't expect all 16 to be used we need to
handle any combination the compiler may generate, even if it doesn't make
sense (e.g. pushing the program counter).

On function return we will either have a pop or branch instruction. The
former is similar to the push instruction, but with care to make sure we
update the stack pointer and program counter correctly in the cases they
are either in the list of registers or not. For branch we need to take the
24-bit offset, sign-extend it, and add that number of 4-byte words to the
program counter. Care needs to be taken as, due to historical reasons, the
address the branch is relative to is not the current instruction, but 8
bytes later.

This allows us to use the following probes on ARM boards:
  dtrace -n 'fbt::malloc:entry { stack() }'
and
  dtrace -n 'fbt:🆓return { stack() }'

Differential Revision:	https://reviews.freebsd.org/D2007
Reviewed by:	gnn, rpaulo
Sponsored by:	ABT Systems Ltd
2015-03-05 17:55:31 +00:00
Ian Lepore
2dec0ccd42 Add a "module" to build the dtb files for all supported imx6 systems. 2015-03-02 22:12:56 +00:00
Hans Petter Selasky
2ac11c1199 Add quirk to disable 64-bit XHCI DMA after r276717.
Requested by:	Gary Jennejohn <gljennjohn@gmail.com>
MFC after:	3 days
2015-03-02 20:42:06 +00:00
Ian Lepore
d4047613ff Revert r279338. The casts are apparently bogus, despite the fact that
they've been working in i386 (where this change came from).
2015-03-02 20:40:25 +00:00
Hans Petter Selasky
ee1e767596 Update Exynos5 XHCI attach code after r276717.
MFC after:	3 days
2015-03-02 20:38:17 +00:00
Andrew Turner
e61722f320 Remove SMP support from the Wandboard-Solo and have it run as part of
universe as a config with sched_ule but without SMP.

Sponsored by:	The FreeBSD Foundation
2015-02-27 12:40:44 +00:00
Ian Lepore
87ac2b4068 Add casting to make atomic ops work for pointers. (Apparently nobody has
ever done atomic ops on pointers before now on arm).

Submitted by:	Svatopluk Kraus <onwahe@gmail.com>
2015-02-26 23:05:46 +00:00
Dimitry Andric
4c991ff32f Fix a number of -Wcast-qual warnings under sys/arm. No functional
change.

Submitted by:	andrew
MFC after:	3 days
2015-02-26 07:47:35 +00:00
Dimitry Andric
9e950417ce In sys/arm/ti/am335x/am335x_rtc.c, fix a clang 3.6.0 warning about
am33x_rtc_softc::sc_irq_res (which is an array) never being NULL.

Submitted by:	andrew
MFC after:	3 days
2015-02-26 07:45:40 +00:00
Zbigniew Bodek
b63ea39440 Fix endianness on FDT read in ARM GIC
Submitted by:  Jakub Palider <jpa@semihalf.com>
Reviewed by:   ian, nwhitehorn
Obtained from: Semihalf
2015-02-24 12:31:08 +00:00
Ian Lepore
c82bcdb25e There is no reason to do i+dcache writeback and invalidate when changing
the translation table (this may be left over from armv5 days).  It's
especially bad to do so using a cache operation that isn't coherent on
SMP systems.

Submitted by:	Michal Meloun
2015-02-23 20:09:05 +00:00
Andrew Turner
d792cd9231 Add support to the bcm2835 mailbox driver to work before interrupts are
enabled. This will be needed to enable the power on devices early on in the
boot process.
2015-02-22 11:11:05 +00:00
Ian Lepore
6baca8256b Correct a comment which was exactly backwards from reality. 2015-02-21 22:19:59 +00:00
Andrew Turner
1b23f9b9c3 Allow the ARM unwinder to work through modules. This will be used to add
support for unwinding from dtrace.

Tested by:	gnn (with dtrace)
Sponsored by:	ABT Systems Ltd
2015-02-19 12:06:57 +00:00
Luiz Otavio O Souza
5508fc88ba Make use of the newly introduced macros.
Update the copyright.
2015-02-17 20:37:21 +00:00
Andrew Turner
6da235a325 Pull the ARM ddb unwind code out to a new file. This will allow it to be
used by other places that expect to unwind the stack, e.g. dtrace and
stack(9).

As I have written most of this code I'm changing the license to the
standard FreeBSD license. I have received approval from the other
developers who have changed any of the affected code.

Approved by:	ian, imp, rpaulo, eadler (all license change)
2015-02-17 13:09:20 +00:00
Luiz Otavio O Souza
b4ae2f3c55 Add a mask to match only the relative base address of BSC controllers.
This should fix the attach of BSC on RPI2 (based on andrew@ dmesg).
2015-02-16 19:06:31 +00:00
Andrew Turner
88cb7e2852 Add the structures needed to get/set the power state. These can be used
when, for example, we boot without U-Boot and wish to enable USB, or to
suspend an unneeded device.

MFC after:	1 week
2015-02-15 11:23:27 +00:00
Ian Lepore
8e6dd301f0 Add logic for handling new-style ARM cpu ID info.
Submitted by:	Michal Meloun <meloun@miracle.cz>
2015-02-14 18:54:52 +00:00
Andrew Turner
ee23449b37 Remove the non-EABI code from the DDB stack unwinder, we only support the
ARM EABI now.
2015-02-11 10:40:49 +00:00
Andrew Turner
90e8f62386 The cpu_id macro was renamed in r278529, catch up with this new name. 2015-02-11 10:37:55 +00:00
George V. Neville-Neil
fcb5606706 Initial version of DTrace on ARM32.
Submitted by:	Howard Su based on work by Oleksandr Tymoshenko
Reviewed by:	ian, andrew, rpaulo, markj
2015-02-10 19:41:30 +00:00
Zbigniew Bodek
9fc0d68aeb Resolve cache line size from CP15
Switch the cache line size during invalidations/flushes
to be read from CP15 cache type register.

Submitted by:  Wojciech Macek <wma@semihalf.com>
Reviewed by:   ian, imp
Obtained from: Semihalf
2015-02-10 14:11:23 +00:00
Oleksandr Tymoshenko
2f99b597e0 Add VideoCore audio driver for Rasperry Pi (BCM2835) 2015-02-08 01:12:40 +00:00
Oleksandr Tymoshenko
939099221b Make VCHI driver optional and add "device vchiq" to default RPI-B config 2015-02-07 01:03:45 +00:00
Warner Losh
854739a4aa Pull in the rpi.dts -> rpi.dtb module (dtb/rpi) and have it install
rpi.dtb in /boot/dtb by default.
2015-02-07 00:41:08 +00:00
Oleksandr Tymoshenko
262f27b29e Import VCHI driver for Broadcom's VideoCore IV GPU
Differential Revision:	D1753
2015-02-05 19:54:03 +00:00
Luiz Otavio O Souza
7d732cea63 Fix a bug where an interrupt could be masked unintentionally when
bus_config_intr() is called with the same interrupt type and polarity that
is already set.

Pointy hat:	loos
2015-02-04 18:35:49 +00:00
Luiz Otavio O Souza
12471cec7c Add GPIO interrupt support for BCM2835 (Raspberry pi).
With this commit any of the GPIO pins can now be programmed to act as an
interrupt source for GPIO devices (i.e. limited to devices directly
attached to gpiobus - at least for now).

Differential Revision:	https://reviews.freebsd.org/D1000
2015-02-04 18:15:28 +00:00
Luiz Otavio O Souza
e74d6e2a12 Sort and remove unnecessary includes. 2015-02-04 17:23:02 +00:00
Luiz Otavio O Souza
d86f31b96b Remove stale comments about the issues with HS mode.
Remove a previous workaround to limit the minimum sdhci frequency that
isn't needed anymore.
2015-02-04 16:36:51 +00:00
Luiz Otavio O Souza
07c7a520f1 Remove some duplicate calls to bus_release_resource() and destroy the mutex
on error cases.

While here remove unnecessary includes.
2015-02-04 16:21:45 +00:00
Rui Paulo
851d8eaaa4 am335x_clk_pruss_activate(): use the L3F clock.
The DISP DPLL clock is slower and was making the PRU programs slower
on FreeBSD than on Linux.

Submitted by:	Manuel Stuehn <freebsdnewbie at freenet.de>
MFC after:	1 week
2015-02-02 08:01:10 +00:00
Ian Lepore
0e192fecb4 Remove a stale comment. The logic that deleted the map before other
resources was removed long ago, but the comment stuck somehow.
2015-02-01 17:19:57 +00:00