2305 Commits

Author SHA1 Message Date
ian
d9b84ac407 Write translation code for the SDHCI_PRESENT_STATE register. Freescale
moved some bits around in their version of the register, adjust things
so that the sdhci code sees the standard layout.
2014-02-13 02:38:16 +00:00
ian
03444312d7 Use the same logic as the x86 platforms to avoid trying perform fault fixup
while in a critical section or while holding a non-sleepable lock.

Reviewed by:	cognet
2014-02-12 20:09:27 +00:00
ian
64c07b454d Use the right symbols for determining arm architecture. Include the
necessary header file which has the new FAULT_WNR symbol defined in it.
2014-02-12 19:59:30 +00:00
ian
722eaf0a07 On armv6 and later, use the WriteNotRead bit of the fault status register
to decide what protections are required by the faulting access.  The old
code disassembled the faulting instruction, and there are a lot of new
instructions that aren't handled.  The old code is still used for armv4/5
which doesn't have the WNR bit)
2014-02-12 18:55:26 +00:00
imp
b3e5336bce Convert two while(1); statements into proper panics. Soon, kernels
with early printf support will print this info... For kernels without,
the observed behavior will be the same as it is now...
2014-02-12 03:19:35 +00:00
ian
4ca4e5e369 Rework the EARLY_PRINTF mechanism. Instead of defining a special eprintf()
routine, now a platform can provide a pointer to an early_putc() routine
which is used instead of cn_putc().  Control can be handed off from early
printf support to standard console support by NULLing out the pointer
during standard console init.

This leverages all the existing error reporting that uses printf calls,
such as panic() which can now be usefully employed even in early
platform init code (useful at least to those who maintain that code and
build kernels with EARLY_PRINTF defined).

Reviewed by:	imp, eadler
2014-02-12 00:53:38 +00:00
imp
c847d19664 Swap PA and VA so they are in the right registers... 2014-02-11 22:09:03 +00:00
ian
74fc279d26 Check in the "real" board_tsc4370 file in place of the stubbed out one.
Real means the one TSC / Symmetricom / Microsemi actually uses on their 4370
and other rm9200 boards.  This code demonstrates a variety of useful things
board init code can do, including adjusting the master clock frequency.
2014-02-11 21:13:37 +00:00
br
39db181035 Disable debugging by default. 2014-02-11 20:14:54 +00:00
ian
0b5f9c7142 Update legacy platforms to use new arm_physmem helper routines. 2014-02-09 22:10:14 +00:00
ian
2ec8b64037 If someone tries to boot a generic ATMEL kernel that has no board_init()
routine compiled in, print a friendly error message about it rather than
mysteriously hanging while trying to init 4GB of nonexistant ram.
2014-02-09 21:21:10 +00:00
imp
f89ada715f Add FDT attachment. 2014-02-09 21:02:46 +00:00
imp
ef1ac29eb3 FDT attachment... 2014-02-09 21:01:53 +00:00
imp
bdaa9ef245 Add TWI attachment for FDT. We're only matching the SAMG20 device for
now, others to follow.
2014-02-09 21:01:10 +00:00
imp
da8067e163 Add FDT attachment. 2014-02-09 21:00:22 +00:00
imp
d8e5eadddc Add FDT attachment. Flag lost functionality with FDT_HACKS so we can
find it later.
2014-02-09 20:59:46 +00:00
imp
5d72dffadd Add FDT attachment. 2014-02-09 20:58:03 +00:00
imp
b4092f9107 Add FDT attachment, plus minor code shuffle. 2014-02-09 20:57:26 +00:00
imp
813fe7dc49 Add FDT attachment. 2014-02-09 20:56:39 +00:00
imp
8a6437c7ce Add FDT matching code. 2014-02-09 20:55:49 +00:00
ian
555263254f Add some extra debugging output when DEBUG is defined. 2014-02-09 20:20:49 +00:00
ian
df50b97cf3 Fix the exclude-region clipping logic for the edge-trim case. 2014-02-09 20:19:41 +00:00
andrew
22ac5f8411 Pass the pagetable used from locore.S to initarm to allow it to map data
in as required.
2014-02-09 15:54:31 +00:00
ian
85ab9dc838 No need to set physmem in each initarm() instance anymore, it's handled
in common code now.
2014-02-09 14:46:50 +00:00
ian
8edf3a41fc Use vm_paddr_t, not vm_offset_t, when dealing with physical addresses.
Pointed out by:	alc
2014-02-09 14:35:44 +00:00
andrew
9b316f5262 Remove the now unused MMU_INIT macro. 2014-02-09 12:52:39 +00:00
ian
0a3cc34ebf It turns out a global variable is the only straightforward way to
communicate the kernel's physical load address from where it's known in
initarm() into cpu_mp_start() which is called from non-arm code and
takes no parameters.

This adds the global variable and ensures that all the various copies
of initarm() set it.  It uses the variable in cpu_mp_start(), eliminating
the last uses of KERNPHYSADDR outside of locore.S (where we can now
calculate it instead of relying on the constant).
2014-02-09 02:39:00 +00:00
ian
968d73cfcf Calculate the kernel's load address from the PC in the elf / gzip
trampoline instead of relying on KERNPHYSADDR as a compile-time constant.
2014-02-09 02:06:12 +00:00
ian
0a15dbb231 Replace compile-time constant KERNPHYSADDR with abp_physaddr (determined
at runtime) where it's trivial to do so.  Another breadcrumb on the trail
to a kernel that can be loaded at any 1MB boundary.
2014-02-09 01:21:30 +00:00
ian
30d95028f0 Consolidate code related to setting up physical memory configuration into
a new physmem.c file.  The new code provides helper routines that can be
used by legacy SoCs and newer FDT-based systems.  There are routines to
add one or more regions of physically contiguous ram, and exclude one or
more physically contiguous regions of ram.  Ram can be excluded from crash
dumps, from being given over to the vm system for allocation management,
or both.  After all the included and excluded regions have been added,
arm_physmem_init_kernel_globals() processes the regions into the global
dump_avail and phys_avail arrays and realmem and physmem variables that
communicate memory configuration to the rest of the kernel.

Convert all existing SoCs to use the new helper code.
2014-02-08 23:54:16 +00:00
ian
5da54698fa Remove the ARM_USE_SMALL_ALLOC option and code related to it.
This was an optimization used only by a few xscale platforms.  Part of
the optimization was to create a direct map for all physical pages, and
that resulted in making multiple mappings of pages in a way that bypassed
the logic in pmap.c to handle VIVT cache aliasing.  It also just generally
made the code more complex and hard to maintain for all SoCs.

Reviewed by:	cognet
2014-02-08 22:21:38 +00:00
br
833d3a1a45 Add drivers for:
- Enhanced Direct Memory Access Controller (eDMA)
- Direct Memory Access Multiplexer (DMAMUX)
2014-02-08 19:47:59 +00:00
andrew
b32b7a2805 Dynamically generate the page table. This will allow us to detect the
physical address we are loaded at to change the mapping.
2014-02-07 19:15:25 +00:00
ian
82efdd5031 Remove references to PHYSADDR where it's used only in debugging output,
and where the code that references it can safely be elided if it's not
defined (meaning the code is used for legacy arm platforms that still
define the compile-time PHYSADDR but not on newer systems that calculate
the value at runtime).
2014-02-07 14:38:51 +00:00
ian
78f8db379a Add option USB_HOST_ALIGN=64 for all SoCs that have 64 byte cache lines. 2014-02-07 04:05:08 +00:00
ian
b438f06822 Revert r260440. I didn't realize that most of this change was already
in effect due to r250753.  That is sufficient for all SoCs with a 32 byte
cache line size.  Systems with 64 byte cache lines will need the option;
that will be done in a separate commit.

Thanks to loos@ for pointing out r250753.
2014-02-07 03:30:16 +00:00
andrew
c51bf58e25 Use abp_physaddr for the physical address over KERNPHYSADDR. This helps us
remove the need to load the kernel at a fixed address.
2014-02-06 20:35:33 +00:00
andrew
86e9507289 Fix __syscall on armeb EABI. As it returns a 64-bit value it needs to place
32-bit data in r1, not r0. 64-bit data is already packed correctly.
2014-02-06 20:26:36 +00:00
andrew
856dc98ce4 Make functions only used in this file static, and remove vfp_enable as it
is unused.
2014-02-06 20:23:35 +00:00
andrew
7d7c6ea116 Pass the kernel physical address to initarm through the boot param struct. 2014-02-06 20:17:58 +00:00
nwhitehorn
c9c7c29042 Move Open Firmware device root on PowerPC, ARM, and MIPS systems to
a sub-node of nexus (ofwbus) rather than direct attach under nexus. This
fixes FDT on x86 and will make coexistence with ACPI on ARM systems easier.
SPARC is unchanged.

Reviewed by:	imp, ian
2014-02-05 14:44:22 +00:00
imp
53d82a8781 Remove trailing tabs causing false grep positives 2014-02-04 05:26:12 +00:00
imp
08048e32b9 s/standard/optional/ for ohci and echi, since these files are optional
and not standard.
2014-02-04 05:21:57 +00:00
cognet
c506ced3d3 Only use the CPU ID register if SMP is defined. Some non-MPCore armv6 cpu,
such as the one found in the RPi, don't have it, and just hang when we try
to access it.
2014-02-02 23:29:51 +00:00
cognet
3fc2ce7400 Invalidate cachelines for bounce pages on PREREAD too, there may still be
stale entries from a previous transfer.
2014-02-02 22:26:30 +00:00
ian
4ef449f28f Add missing semicolon. 2014-02-02 21:44:04 +00:00
br
ddfbb3ea13 o Add prototype for tcon_bypass() used by dcu4
o Add register definition
2014-02-02 21:10:40 +00:00
cognet
b1d1b439a3 Change the way pcpu and curthread are stored per-core:
the old way was to store pcpu in a register, and get curthread from pcpu,
which is not very atomic, and led to issues if the thread was migrated
to another core between the time we got the pcpu address and the time we
got curthread.
Instead, we now store curthread where pcpu used to be store, and we
calculate the pcpu address based on the cpu id.
2014-02-02 20:58:23 +00:00
cognet
e4ce47a41c Don't call device_set_ivars() for the mmchs, it doesn't seem to be used,
and it overrides the ivars set by the simplebus.
2014-02-02 20:45:41 +00:00
br
1e1f8dcd24 Add driver for Display Control Unit (DCU4). 2014-02-02 20:25:27 +00:00