aboutsummaryrefslogtreecommitdiff
path: root/src/soc/rockchip/rk3399/decompressor.c
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2018-05-14 11:43:30 -0700
committerJulius Werner <jwerner@chromium.org>2018-05-22 02:44:33 +0000
commit8f25a6680e23663f4c88f7fe61a7a62e8fe284c4 (patch)
treebb18eb627d3381267506d9fa1ff762c0c905f30d /src/soc/rockchip/rk3399/decompressor.c
parent99f4683adf3203d11c164b15a5455e778709a3e0 (diff)
rk3399: Enable bootblock compression
This patch enables the new bootblock compression feature on RK3399, which requires moving MMU initialization into the decompressor stage and linking the decompressor (rather than the bootblock) into the entry point jumped to by the masked ROM. RK3399's masked ROM seems to be using a bitbang SPI driver to load us (very long pauses between clocking in each byte), with an effective data rate of about 1Mbit. Bootblock loading time (as measured on a SPI analyzer) is reduced by almost 100ms (about a third), while the decompression time is trivial (under 1ms). Change-Id: I48967ca5bb51cc4481d69dbacb4ca3c6b96cccea Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/26341 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/rockchip/rk3399/decompressor.c')
-rw-r--r--src/soc/rockchip/rk3399/decompressor.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/soc/rockchip/rk3399/decompressor.c b/src/soc/rockchip/rk3399/decompressor.c
new file mode 100644
index 0000000000..7d3c71478b
--- /dev/null
+++ b/src/soc/rockchip/rk3399/decompressor.c
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2016 Rockchip Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <arch/io.h>
+#include <arch/mmu.h>
+#include <bootblock_common.h>
+#include <console/console.h>
+#include <soc/mmu_operations.h>
+#include <symbols.h>
+
+void decompressor_soc_init(void)
+{
+ mmu_init();
+
+ /* Set 0x0 to max sdram(4GiB) supported by RK3399 as device memory.
+ * We want to configure mmio space(start at 0xf8000000) to DEV_MEM,
+ * some boards may use 2GB sdram in future(who knows).
+ */
+ mmu_config_range((void *)0, (uintptr_t)4 * GiB, DEV_MEM);
+
+ mmu_config_range(_sram, _sram_size, SECURE_MEM);
+
+ mmu_enable();
+}