Commit Graph

3045 Commits

Author SHA1 Message Date
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
Andrew Turner
46b1fe9224 Add a driver for the ARM Power State Coordination Interface (PSCI). This
handles versions 0.1 and 0.2 of the standard on 32-bit ARM.

With this driver we can shutdown in QEMU. Further work is needed to
turn secondary cores on on boot and to support later revisions of the
specification.

Submitted by:	Robin Randhawa <Robin.Randhawa at ARM.com>
Sponsored by:	The FreeBSD Foundation
2015-04-12 13:00:58 +00:00
Andrew Turner
fac289a29e Switch to the new v6 pmap code to increase its testing. It will now be
built as part of universe.
2015-04-12 08:10:18 +00:00
Andrew Turner
849d143dba Change the virtual address used to not be 0xc0000000, the arm loader
doesn't handle this address.
2015-04-11 20:44:21 +00:00
Andrew Turner
42f0d1fa49 Add support for the QEMU virt SoC. This is a SoC built depending on the
command line arguments passed in. It will then generate a dtb on the fly,
as such no dts will be added as it may be incorrect.

Relnotes:	yes
2015-04-11 17:52:47 +00:00
Andrew Turner
405ada37fb Add support for the uart classes to set their default register shift value.
This is needed with the pl011 driver. Before this change it would default
to a shift of 0, however the hardware places the registers at 4-byte
addresses meaning the value should be 2.

This patch fixes this for the pl011 when configured using the fdt. The
other drivers have a default value of 0 to keep this a no-op.

MFC after:	1 week
2015-04-11 17:16:23 +00:00
Ganbold Tsagaankhuu
c119629dd0 This modifies several FreeBSD drivers to use the GNU approach to
supply clk81 information.  It also changes the hardware strings
in some of the drivers to match what's present in the GNU files.

Submitted by:  John Wehle
Reviewed by:   imp
2015-04-11 08:34:41 +00:00
Ganbold Tsagaankhuu
5254cb2676 This modifies several FreeBSD drivers to use the hardware strings
present in the GNU dts files.

Submitted by:  John Wehle
Reviewed by:   imp
2015-04-11 08:30:37 +00:00
Ian Lepore
7669914f32 Add a pmap_kremove_device() to undo mappings made with pmap_kenter_device().
Previously we used pmap_kremove(), but with ARM_NEW_PMAP it does the remove
in a way that isn't SMP-coherent (which is appropriate in some circumstances
such as mapping/unmapping sf buffers).  With matching enter/remove routines
for device mappings, each low-level implementation can do the right thing.

Reviewed by:	Svatopluk Kraus <onwahe@gmail.com>
2015-04-10 13:26:35 +00:00
Andrew Turner
63d071445e Add support to the efi boot1 and loader for 32-bit ARM. This will be used
by the future qemu virt support.

Differential Revision:	https://reviews.freebsd.org/D2238
Reviewed by:	emaste
2015-04-06 15:50:20 +00:00
Andrew Turner
02df43b866 dev/ofw/openfirm.h is not needed in the arm machine/fdt.h 2015-04-05 09:50:22 +00:00
Andrew Turner
e8cfd62ed8 Re-add machine/bus.h to machine/fdt.h on arm, it's still needed. 2015-04-04 23:10:13 +00:00
Andrew Turner
087af50ab8 Include vm/pmap.h for pmap_kextract. 2015-04-04 23:03:11 +00:00
Andrew Turner
610373a6f7 Include machine/intr.h for arm_post_filter. 2015-04-04 23:00:37 +00:00
Andrew Turner
8c7336d57f Don't include unneeded files in the arm machine/fdt.h. While here, remove
it from more files.
2015-04-04 22:22:04 +00:00
Andrew Turner
7defa9a75c Move the definition of fdt_localbus_devmap to a Marvell specific file as
it's only used there.
2015-04-04 22:05:43 +00:00
Andrew Turner
ff3b52bb19 Stop using machine/fdt.h in the arm kernel code when we don't need it. 2015-04-04 21:34:26 +00:00
Andrew Turner
3e1eb51df7 Add support for arm64 to the existing arm generic timer driver:
- Add macros to handle the differences in accessing these registers on arm
   and arm64.
 - Use the fdt data to detect if we are on an ARMv7 or ARMv8.
 - Use the virtual timer by default on arm64, we may not have access to
   the physical timer.

Differential Revision:	https://reviews.freebsd.org/D2208
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2015-04-04 09:07:31 +00:00
Andrew Turner
a1ba12b1cc Merge the common parts of the SOCKIT and SOCKIT-BERI kerenel, and mark the
former as NO_UNIVERSE.
2015-04-03 11:12:59 +00:00
Andrew Turner
9ee5c7d09d Stop including machine/fdt.h, it's not needed.
Sponsored by:	The FreeBSD Foundation
2015-04-02 13:02:25 +00:00
Andrew Turner
bd61d9d481 We may not be using gcc to compile this.
Sponsored by:	The FreeBSD Foundation
2015-04-02 12:58:04 +00:00
Andrew Turner
7b309274e3 Add the generic timer registers to sysreg.h and cpu-v6.h, and use the
access functions in the generic timer driver.

Differential Revision:	https://reviews.freebsd.org/D2198
Sponsored by:	The FreeBSD Foundation
2015-04-02 12:56:06 +00:00
Oleksandr Tymoshenko
0daa281ac0 - Make interrupt resource optional: some upstream FDT blobs (e.g. TI's) do
not have interupt property in pl310 node. Interrupt is used only to
    detect cache activity when L2 cache is disabled, it's not vital for
    normal operations.
- Fix intrhook allocation/initialization
2015-04-02 03:25:35 +00:00
Ganbold Tsagaankhuu
90120cf6e6 Add kernel config files for Hardkernel Odroid-C1 and Visson ATV-102 devices.
Submitted by:	  John Wehle
Approved by:	  stas (mentor)
2015-03-31 11:59:57 +00:00
Ganbold Tsagaankhuu
562246dff8 Add necessary changes to support various Amlogic SoC devices
specially aml8726-m6 and aml8726-m8b SoC based devices.
aml8726-m6 SoC exist in devices such as Visson ATV-102.
Hardkernel ODROID-C1 board has aml8726-m8b SoC.

The following support is included:
  Basic machdep code
  SMP
  Interrupt controller
  Clock control driver (aka gate)
  Pinctrl
  Timer
  Real time clock
  UART
  GPIO
  I2C
  SD controller
  SDXC controller
  USB
  Watchdog
  Random number generator
  PLL / Clock frequency measurement
  Frame buffer

Submitted by:   John Wehle
Approved by:    stas (mentor)
2015-03-31 11:50:46 +00:00
Andrew Turner
0bf92a38d1 Restore setting cpufuncs on arm1176, it was removed by accident with the
arm1136 code.

Reviewed by:	ian
2015-03-30 20:44:08 +00:00
Andrew Turner
a3db11e053 Remove support for CPU_XSCALE_80200. None of our configs support it, and
there wasn;t an option to enable it.

While here remove a check for CPU_ARM10 being defined as it has also been
removed.
2015-03-30 09:29:45 +00:00
Andrew Turner
303c8079ab Remove support for CPU_FA626TE. It's unused by any of our kernel configs. 2015-03-30 08:38:18 +00:00
Andrew Turner
53b2405ec0 arm11_sleep is no longer needed, remove it. 2015-03-29 22:46:07 +00:00
Andrew Turner
37b25ee6f2 pj4b_config and pj4bv7_setup are only used when CPU_MV_PJ4B is defined. 2015-03-29 22:45:33 +00:00
Andrew Turner
0ebebb1260 Build the cpufunc_asm_* files based on the cpu type, not which config file
we happen to be building.
2015-03-29 22:43:39 +00:00
Andrew Turner
d9d02715d3 Remove cpufunc_asm_arm11.S from the ARMv7 configs, it's not used. 2015-03-29 21:45:28 +00:00
Andrew Turner
930798f3a1 Remove arm1136 support. We don't have any configs that use it, and I don't
expect us to add support for any more arm11 SoCs.
2015-03-29 21:12:59 +00:00
Andrew Turner
9a25f3e847 Remove the bootconfig parsing. We never used it and always passed either an
empty string or NULL to the setup functions that called into it.
2015-03-29 20:37:28 +00:00
Andrew Turner
760b9ede07 We only need cpufunc_asm_arm11.S on bcm2835, not bcm2836 2015-03-29 20:21:59 +00:00
Andrew Turner
fd78c994f5 Remove ARM9_CACHE_WRITE_THROUGH, none of our configs define it. 2015-03-29 18:59:04 +00:00
Andrew Turner
ba14973ac5 Remove the unused armv5 cpufunc code. 2015-03-29 18:46:12 +00:00
Andrew Turner
6532862008 Remove unused cpufunc arm11 and armv6 code. While here only define the
remaining functions in the context we use them in.
2015-03-29 18:44:15 +00:00
Andrew Turner
745202c280 We don't use cpufunc_asm_armv5.S in any of these configs, remove it. 2015-03-29 18:41:43 +00:00
Andrew Turner
c0fde778ab Remove unused arm10_* functions. The remaining functions are only used in
mv configs.
2015-03-29 17:42:32 +00:00
Andrew Turner
698234c19b Stop building unused cpuvunc_* files, we don't need anything from these. 2015-03-29 17:33:03 +00:00
Andrew Turner
7a959e4944 Remove support for CPU_ARM10. No kernel configs could possibly use this as
it's not an available option. Along with this we will never support this
cpu type as very few arm10 chips were made.
2015-03-29 17:13:44 +00:00
Bjoern A. Zeeb
0ede88a413 Rather than defining our own magic checks here use INKERNEL() for
the PMC_IN_KERNEL() macro definition.

Add missing macros to extract the return address (LR) from the trapframe.

Discussed with:	andrew
Obtained from:	Cambridge/L41
Sponsored by:	DARPA, AFRL
MFC after:	2 weeks
2015-03-27 08:47:16 +00:00