1*2874c5fdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 2571b7e69SPaul Burton /* 3571b7e69SPaul Burton * Copyright (C) 2016 Imagination Technologies 4fb615d61SPaul Burton * Author: Paul Burton <paul.burton@mips.com> 5571b7e69SPaul Burton */ 6571b7e69SPaul Burton 7571b7e69SPaul Burton #ifndef __MIPS_ASM_YAMON_DT_H__ 8571b7e69SPaul Burton #define __MIPS_ASM_YAMON_DT_H__ 9571b7e69SPaul Burton 10f41d2430SPaul Burton #include <linux/types.h> 11f41d2430SPaul Burton 12f41d2430SPaul Burton /** 13f41d2430SPaul Burton * struct yamon_mem_region - Represents a contiguous range of physical RAM. 14f41d2430SPaul Burton * @start: Start physical address. 15f41d2430SPaul Burton * @size: Maximum size of region. 16f41d2430SPaul Burton * @discard: Length of additional memory to discard after the region. 17f41d2430SPaul Burton */ 18f41d2430SPaul Burton struct yamon_mem_region { 19f41d2430SPaul Burton phys_addr_t start; 20f41d2430SPaul Burton phys_addr_t size; 21f41d2430SPaul Burton phys_addr_t discard; 22f41d2430SPaul Burton }; 23f41d2430SPaul Burton 24571b7e69SPaul Burton /** 25571b7e69SPaul Burton * yamon_dt_append_cmdline() - Append YAMON-provided command line to /chosen 26571b7e69SPaul Burton * @fdt: the FDT blob 27571b7e69SPaul Burton * 28571b7e69SPaul Burton * Write the YAMON-provided command line to the bootargs property of the 29571b7e69SPaul Burton * /chosen node in @fdt. 30571b7e69SPaul Burton * 31571b7e69SPaul Burton * Return: 0 on success, else -errno 32571b7e69SPaul Burton */ 33571b7e69SPaul Burton extern __init int yamon_dt_append_cmdline(void *fdt); 34571b7e69SPaul Burton 35571b7e69SPaul Burton /** 36571b7e69SPaul Burton * yamon_dt_append_memory() - Append YAMON-provided memory info to /memory 37571b7e69SPaul Burton * @fdt: the FDT blob 38f41d2430SPaul Burton * @regions: zero size terminated array of physical memory regions 39571b7e69SPaul Burton * 40571b7e69SPaul Burton * Generate a /memory node in @fdt based upon memory size information provided 41f41d2430SPaul Burton * by YAMON in its environment and the @regions array. 42571b7e69SPaul Burton * 43571b7e69SPaul Burton * Return: 0 on success, else -errno 44571b7e69SPaul Burton */ 45f41d2430SPaul Burton extern __init int yamon_dt_append_memory(void *fdt, 46f41d2430SPaul Burton const struct yamon_mem_region *regions); 47571b7e69SPaul Burton 48571b7e69SPaul Burton /** 49571b7e69SPaul Burton * yamon_dt_serial_config() - Append YAMON-provided serial config to /chosen 50571b7e69SPaul Burton * @fdt: the FDT blob 51571b7e69SPaul Burton * 52571b7e69SPaul Burton * Generate a stdout-path property in the /chosen node of @fdt, based upon 53571b7e69SPaul Burton * information provided in the YAMON environment about the UART configuration 54571b7e69SPaul Burton * of the system. 55571b7e69SPaul Burton * 56571b7e69SPaul Burton * Return: 0 on success, else -errno 57571b7e69SPaul Burton */ 58571b7e69SPaul Burton extern __init int yamon_dt_serial_config(void *fdt); 59571b7e69SPaul Burton 60571b7e69SPaul Burton #endif /* __MIPS_ASM_YAMON_DT_H__ */ 61