summaryrefslogtreecommitdiffstats
path: root/sys/arm/tegra
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2013-12-14 00:16:08 +0000
committerian <ian@FreeBSD.org>2013-12-14 00:16:08 +0000
commitf1d49f684de2d9eaa8fc5074d87fb2767fc56741 (patch)
tree3c0e8ffd313e6a983ce387f815a5a22f8f6a07d3 /sys/arm/tegra
parenteae48ec05ef90176b68b7b5c7ebf3e4c792448aa (diff)
downloadFreeBSD-src-f1d49f684de2d9eaa8fc5074d87fb2767fc56741.zip
FreeBSD-src-f1d49f684de2d9eaa8fc5074d87fb2767fc56741.tar.gz
MFC r257669, r257672, r257673, r257676, r257678:
Call initarm_lastaddr() later in the init sequence, after establishing static device mappings, rather than as the first of the initializations that a platform can hook into. This allows a platform to allocate KVA from the top of the address space downwards for things like static device mapping, and return the final "last usable address" result after that and other early init work is done. Because some platforms were doing work in initarm_lastaddr() that needs to be done early, add a new initarm_early_init() routine and move the early init code to that routine on those platforms. Make PTE_DEVICE a synonym for PTE_NOCACHE on armv4, to make it easier to share the same code on both architectures. Add new helper routines for arm static device mapping. The new code allocates kva space from the top down for the device mappings and builds entries in an internal table which is automatically used later by arm_devmap_bootstrap(). The platform code just calls the new arm_devmap_add_entry() function as many times as it needs to (up to 32 entries allowed; most platforms use 2 or 3 at most). Remove imx local devmap code and use the essentially identical common code that got moved from imx_machdep.c to arm/devmap.c.
Diffstat (limited to 'sys/arm/tegra')
-rw-r--r--sys/arm/tegra/tegra2_machdep.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/arm/tegra/tegra2_machdep.c b/sys/arm/tegra/tegra2_machdep.c
index 92ca04a..8904250 100644
--- a/sys/arm/tegra/tegra2_machdep.c
+++ b/sys/arm/tegra/tegra2_machdep.c
@@ -107,10 +107,15 @@ vm_offset_t
initarm_lastaddr(void)
{
+ return (fdt_immr_va);
+}
+
+void
+initarm_early_init(void)
+{
+
if (fdt_immr_addr(TEGRA2_BASE) != 0) /* FIXME ???? */
while (1);
-
- return (fdt_immr_va);
}
void
@@ -132,7 +137,7 @@ static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = {
* Construct pmap_devmap[] with DT-derived config data.
*/
int
-platform_devmap_init(void)
+initarm_devmap_init(void)
{
int i = 0;
fdt_devmap[i].pd_va = 0xe0000000;
OpenPOWER on IntegriCloud