Commit Graph

3087 Commits

Author SHA1 Message Date
Zbigniew Bodek
c4b8fcd66c Add new CP15 operations and DB_SHOW_COMMAND to print CP15 registers
Submitted by:   Wojciech Macek <wma@semihalf.com>
Reviewed by:    imp, Michal Meloun <meloun@miracle.cz>
Obtained from:  Semihalf
2015-05-06 15:17:28 +00:00
Ganbold Tsagaankhuu
c1e22c8ece This patch adds support for the extended baud rate register
available on the aml8726-m6 (and later) SoC which allows for
lower speeds.

Differential Revision:	https://reviews.freebsd.org/D2433
Submitted by:	John Wehle
2015-05-06 01:07:59 +00:00
Ian Lepore
955691fecd Add the code necessary to run the imx6 chip at its lowest clock/power
operating point (396MHz/950mV).
2015-05-05 23:27:49 +00:00
Andrew Turner
9e67e4202d Start to reduce the diff between the Atmel kernel configs. 2015-05-05 18:29:51 +00:00
Andrew Turner
6193335c45 The VIRT kernel config targets armv6. 2015-05-05 18:04:47 +00:00
Andrew Turner
5c1bbeb74b Move the first batch of common armv6 options to std.armv6. 2015-05-05 17:59:02 +00:00
Ian Lepore
65c3de4e62 Create std.arm and std.armv6 config files and include the right one from
each of the existing kernel configs.  This gives a place to put config
that applies to the entire arch.

Add the ARM_NEW_PMAP option to std.armv6.  This is working well in early
testing and it's time for wide exposure, but it's still nice to be able
to fall back to the old implementation for testing when a problem comes
along.  Eventually the option and the old implementation will go away.

The opportunity now exists to move a whole lot of boilerplate from all the
arm kernel config files into std.arm*, but that's a commit for another day.
2015-05-05 16:09:25 +00:00
Andrew Turner
1c110e85d9 Update the comment on what CPUs this driver supports. 2015-05-05 14:17:15 +00:00
Luiz Otavio O Souza
d12acb19af Now that DMA works, enable the audio driver on RPi 2. 2015-05-05 01:45:38 +00:00
Luiz Otavio O Souza
382ac7c838 Enable DMA for sdhci on RPi 2 (BCM2836). 2015-05-05 00:27:55 +00:00
Luiz Otavio O Souza
2ae580711a Fix DMA on RPi 2.
BCM2836 has a different base address for peripherals.

Obtained from:	netbsd
2015-05-05 00:19:04 +00:00
Luiz Otavio O Souza
1263958474 In preparation for the next cycle of official ARM images, add ARM_NEW_PMAP
to supported kernels.

This is a temporary solution and should be reverted when ARM_NEW_PMAP is
enabled by default.
2015-05-04 20:59:23 +00:00
Ian Lepore
f49c3ab774 On an icache sync by address/len, round the length up if the operation spans
a cacheline boundary.

PR:		199740
Submitted by:	Juergen Weiss <weiss@uni-mainz.de>
2015-05-04 14:55:21 +00:00
Luiz Otavio O Souza
11cede4873 Fix the voltage and clock levels for cpufreq on RPi 2.
Submitted by:	Daisuke Aoyama <aoyama@peach.ne.jp>
2015-05-04 00:01:35 +00:00
Luiz Otavio O Souza
61dfa98164 Fix the vt(4) framebuffer driver on RPi 2.
Use the BCM2835_MBOX_CHAN_PROP mbox channel to setup the framebuffer,
remove DMA code (its now done in bcm2835_mbox.c).

Also adjust the color palette when bcm2708_fb.fbswap is set.  The
firmware used on RPi 2 uses this mode.

Tested on:	RPi-B and RPi 2 with 16, 24 and 32bpp
Note:		The 32bpp mode on RPi-B has the red and blue swapped, this
		is a know problem (not a driver problem).
2015-05-02 22:48:56 +00:00
Luiz Otavio O Souza
aafead11b2 Fix the sc(4) framebuffer driver on RPi 2.
Use the BCM2835_MBOX_CHAN_PROP mbox channel to setup the framebuffer,
remove unused code and unnecessary includes.

Adjust the color palette when bcm2708_fb.fbswap is set on /chosen/bootargs
node of DTB.  The firmware used on RPi 2 uses this mode.

Tested on:	RPi-B and RPi 2 with 16, 24 and 32bpp
2015-05-02 22:40:41 +00:00
Luiz Otavio O Souza
ae29e2d8a4 Add the routines to query and setup the framebuffer state using the
BCM2835_MBOX_CHAN_PROP channel.  The old channel (BCM2835_MBOX_CHAN_FB)
seems deprecated on recent firmware versions and is causing a freeze on
RPi 2.

The actual changes in the framebuffer drivers will follow in subsequent
commits.
2015-05-02 22:24:33 +00:00
Luiz Otavio O Souza
f6c05535af Fix the kernel ident for RPI2. 2015-05-02 20:41:49 +00:00
Luiz Otavio O Souza
c8af988eae Remove an unused variable. 2015-05-02 20:14:43 +00:00
Warner Losh
3fd9c15ab5 Remove support for being compiled under OABI. We don't support that
any more, so this is just dead code.

Differential Revision: https://reviews.freebsd.org/D2419
2015-05-02 03:01:03 +00:00
Andrew Turner
2a1803d048 Fix pmap_dcache_wb_pou in the new armv6 pmap to correctly achieve icache
consistency from ptrace.

PR:		199739
Submitted by:	Jurgen Weiss <weiss at uni-mainz.de> (original version)
Submitted by:	Svatopluk Kraus <onwahe at gmail.com>
2015-04-28 16:47:34 +00:00
Ganbold Tsagaankhuu
033d737ab5 Update Amlogic MMC driver:
1) Advertise the actual min / max speeds the hardware is capable
       of supporting given the reference clock used by the board.

  2) Rather than attempting to extend the hardware's timeout register
       in software (the hardware doesn't have sufficient bits to directly
            support long timeouts), simply implement the same timeout approach
	         used in the SDXC driver.

  3) Set the timeout for a linked command (e.g. STOP TRANSMISSION) based
       on the previous multiblock read / write.

The changes have been smoke tested on both the ODROID-C1 and the VSATV102-M6
using the following cards:

* PQI 2GB microSD
* SanDisk 2GB microSD
* PQI 8GB SDHC (not a microSD so only tested on the ATV-102)
* PNY 8GB microSDHC
* SanDisk Ultra 32GB microSDHC

Submitted by:  John Wehle
2015-04-28 08:27:44 +00:00
Hans Petter Selasky
5caa65ca2d The add_bounce_page() function can be called when loading physical
pages which pass a NULL virtual address. If the BUS_DMA_KEEP_PG_OFFSET
flag is set, use the physical address to compute the page offset
instead. The physical address should always be valid when adding
bounce pages and should contain the same page offset like the virtual
address.

Submitted by:	Svatopluk Kraus <onwahe@gmail.com>
MFC after:	1 week
Reviewed by:	jhb@
2015-04-28 06:12:37 +00:00
Luiz Otavio O Souza
723af368a1 Pass the supplied buffer length instead of a fixed size. 2015-04-27 01:36:16 +00:00
Ganbold Tsagaankhuu
c34625f7b7 Enable root mounting from mmc/sd card. 2015-04-27 00:39:57 +00:00
Andrew Turner
2d8bbd0b6d Cleanup a little more:
- Remove whitespace at the end of lines
 - Use a tab after instructions, not spaces
2015-04-26 16:37:27 +00:00
Andrew Turner
ed5bb96b5d Fix the style of locore-v4.S and locore-v6.S to help find any common code. 2015-04-26 16:18:41 +00:00
Andrew Turner
365a1e502e Remove the armv6 code from locore-v4.S, it's not needed there. 2015-04-26 15:57:02 +00:00
Andrew Turner
61e9519f63 Use ARMv7 style unaligned access on ARMv6. We set this bit in locore, but
it was missing from here.
2015-04-26 11:54:25 +00:00
Luiz Otavio O Souza
d24e6f4add Set ARM_L2_PIPT for A10 and RPI2, they are probably missing by accident.
Noted by:	Michal Meloun <meloun@miracle.cz>
2015-04-25 22:42:03 +00:00
Andrew Turner
092b8f61cd Add the SOC_IMX51, SOC_IMX53, and SOC_IMX6 options. These are used to
select which SoCs the kernel config will support.

Use these options to merge files.imx51 and files.imx53.
2015-04-23 22:20:43 +00:00
Andrew Turner
bb135ad6af Reduce the diff between files.imx51 and files.imx53 2015-04-23 21:39:32 +00:00
Andrew Turner
bb456994ee Pull out the common parts of the ODROIDC1 and VSATV102 kernels to a new
kernel config. This also removes the per-board config files from universe.
2015-04-23 21:31:06 +00:00
Andrew Turner
442938a94f Remove the need for board specific std files on aml8726 by moving the
options they set to the main kernel config.
2015-04-23 20:53:29 +00:00
Andrew Turner
4ca6cef0b5 Move KERNVIRTADDR to the common std.aml8726. 2015-04-23 20:43:24 +00:00
Andrew Turner
7a26ccdd87 - Move files selected in files.smp to files.aml8726 and remove it.
- Remove a redundant file from files.aml8726
2015-04-23 20:39:40 +00:00
Andrew Turner
3aaf2b23e7 Update the ODROIDC1 and VSATV102 to reduce the diff to the other armv6
kernel config files.
2015-04-23 20:28:56 +00:00
Luiz Otavio O Souza
fb39e63bdf Now that we have an U-Boot for RPI2, do not use the static DTB compiled
into the kernel, which is used mostly on early development stages.

On RPI(2) the DTB is loaded and modified by firmware and then handed to
kernel via U-Boot and ubldr.

The RPI firmware adds (or modify) a few valuable data to the in memory
DTB, like:

 - System memory;
 - Ethernet MAC address;
 - framebuffer settings;
 - Board serial and revision;
 - clock-frequency for most of devices.
2015-04-23 19:50:22 +00:00
Luiz Otavio O Souza
b7fbc36963 Fetch the SDHCI frequency from videocore (our prefered source) and only if
it fails, fetch the clock-frequency from DTB.

If both methods fail, use the hardcoded default.
2015-04-22 18:35:02 +00:00
Luiz Otavio O Souza
14c1e97f57 Build and install the DTB for all the supported AllWinner SoCs.
We will need them when we start booting using ubldr.
2015-04-20 22:12:19 +00:00
Marius Strobl
7420755437 Make a comment reflect reality. 2015-04-19 20:20:52 +00:00
Luiz Otavio O Souza
a5e68d8c0d Move the items common to all SoCs to a single file. 2015-04-18 03:07:01 +00:00
Luiz Otavio O Souza
3427dceb4e Fix the style(9) and adds two missing parentheses on the licence.
Reduce the differences to bring in the MMC/SD driver.

Approved by:	ganbold (licence change)
2015-04-18 01:01:39 +00:00
Luiz Otavio O Souza
8c2df90ac9 Simplify the receiver code a bit.
Drain the RX FIFO and continue on failure.
2015-04-18 00:35:00 +00:00
Luiz Otavio O Souza
74ccc02b18 Add the necessary support to use both TX queues available on if_emac.
Each TX queue can hold one packet (yes, if_emac can send only two(!)
packets at a time).

Even with this change the very limited FIFO buffer (3 KiB for TX and 13 KiB
for RX) fill up too quick to sustain higher throughput.

For the TCP case it turns out that TX isn't the limiting factor, but the RX
side is (the FIFO fill up and starts to discard packets, so the sender has
to slow down).
2015-04-17 23:49:43 +00:00
Luiz Otavio O Souza
8e64cb895d Remove unnecessary checks and fix an issue where the interrupt handler
could return with lock held.
2015-04-17 22:17:22 +00:00
Andrew Turner
44b0f6a020 Remove support for reading the syscall code in OABI. This is unneeded now
we can only build for EABI.
2015-04-17 09:17:35 +00:00
Andrew Turner
d5b05f1963 Use cp15_ifar_get to get the instruction fault address. When using Thumb-2
the instruction may be over two pages so the program counter could point
to the wrong page.
2015-04-17 09:14:58 +00:00
Luiz Otavio O Souza
e4dc9b78d7 Fix the 'wrong packet header' errors for if_emac.
Do not strip the ethernet CRC until we read all data from FIFO, otherwise
the CRC bytes would be left in FIFO causing the failure of next packet
(wrong packet header).

When this error happens the receiver has to be disabled and the RX FIFO
flushed, discarding valid packets.

With this fix if_emac behaves a lot better.
2015-04-17 03:56:50 +00:00
Andrew Turner
67cca85e45 Update the arm devmap code to also work with arm64.
There are a few differences between the two. On arm we need to provide a
list of addresses we may be mapping before we have initialised the virtual
memory subsystem, however on arm64 we allocate a small (2MiB for a 4k
granule) range to be used for such purposes.

Differential Revision:	https://reviews.freebsd.org/D2249
Sponsored by:	The FreeBSD Foundation
2015-04-13 13:21:27 +00:00