aboutsummaryrefslogtreecommitdiff
path: root/ast27x0/include/io.h
diff options
context:
space:
mode:
authorJamin Lin <jamin_lin@aspeedtech.com>2025-06-26 17:16:18 +0800
committerJamin Lin <jamin_lin@aspeedtech.com>2025-07-07 13:58:52 +0800
commit80768e454d548a7f7f53374a3a0ff8ec4bbae778 (patch)
treea44fdfa838ed794fb004d7b9505771d11af0e2cb /ast27x0/include/io.h
parentd6e3386709b3e49322a94ffadc2aaab9944ab77b (diff)
downloadvbootrom-80768e454d548a7f7f53374a3a0ff8ec4bbae778.zip
vbootrom-80768e454d548a7f7f53374a3a0ff8ec4bbae778.tar.gz
vbootrom-80768e454d548a7f7f53374a3a0ff8ec4bbae778.tar.bz2
ast27x0: Initialize and enable SSP/TSP using SCU with reserved-memory from DTB
This commit adds support for bringing up the SSP and TSP co-processors on AST2700. The initialization and control logic are performed via SCU register programming. Memory layout for firmware regions is retrieved from reserved-memory nodes in the SPL device tree. Features included: - Add find_fmc_image() to locate FMC v2 image and extract payload range. - Load and validate SPL DTB located after FMC payload. - Parse reserved-memory nodes for SSP, TSP, ATF, OP-TEE, and IPC regions. - Define struct mem_region and reserved_mem_info for memory layout data. - Implement ssp_init() and ssp_enable() for SSP SCU setup and launch. - Implement tsp_init() and tsp_enable() for TSP SCU setup and launch. - Extend load_other_fit_images() to detect "sspfw" and "tspfw" images. - Enable SSP/TSP after loading firmware from FIT image. - Add SCU register definitions in struct ast2700_scu0. Note: DTB is only used to retrieve memory layout for reserved regions. The SSP and TSP initialization and activation are done via SCU registers. Code adapted from: https://github.com/AspeedTech-BMC/u-boot/blob/aspeed-master-v2023.10/board/aspeed/ibex_ast2700/ssp_tsp.c Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Diffstat (limited to 'ast27x0/include/io.h')
-rw-r--r--ast27x0/include/io.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/ast27x0/include/io.h b/ast27x0/include/io.h
index fab6546..6813940 100644
--- a/ast27x0/include/io.h
+++ b/ast27x0/include/io.h
@@ -27,4 +27,12 @@
#define writel(value, addr) (*(volatile unsigned int *)(addr) = (unsigned int)(value))
#define writeq(value, addr) (*(volatile unsigned long long *)(addr) = (unsigned long long)(value))
+#define BITS_PER_LONG (sizeof(unsigned long) * 8)
+#define GENMASK(h, l) \
+ (((~0UL) >> (BITS_PER_LONG - ((h) - (l) + 1))) << (l))
+
+#define BIT(x) (1UL << (x))
+
+#define ALIGN_UP(x, align) (((x) + ((align) - 1)) & ~((align) - 1))
+
#endif /* __AST27X0_INCLUDE_IO_H__ */