summaryrefslogtreecommitdiffstats
path: root/pbl/fdt.c
Commit message (Collapse)AuthorAgeFilesLines
* PBL: fdt: fix /memory parsing when #address-cells != #size-cellsAhmad Fatoum2022-05-311-1/+1
| | | | | | | | | | | Due to a typo, this code assumed so far ignored #size-cells and assumed it to be equal to #address-cells. This breaks using the barebox-dt-2nd.img with some 64-bit device trees like the Raspberry Pi's. Fixes: ffb0344b7410 ("ARM: Add generic device tree 2nd stage support") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220530074102.632341-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* PBL: fdt: factor reg property parsing into helperAhmad Fatoum2022-02-231-8/+15
| | | | | | | | | | | Instead of duplicating the loop for each of base and size, move it into a helper function. This may come in handy later when extending the function, e.g. to have the generic-dt-2nd image take /reserved-memory entries into account and not rely on CONFIG_OPTEE_SIZE. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220220124736.3052502-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: add dedicated header for printf/printkAhmad Fatoum2021-11-011-1/+1
| | | | | | | | | | | | Including <stdio.h> for printf is a bit problematic, because it pulls in other headers for <console.h>, which includes quite a few more headers as well. To make it easier to share code between barebox and host tools make <printk.h> the new minimal header for printf and move the extra logging stuff into <linux/printk.h>. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030141739.2207431-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* PBL: fdt: implement fdt_device_get_match_dataAhmad Fatoum2021-05-031-0/+35
| | | | | | | | | | | | | Currently, the generic DT image can't properly have a PBL console, because it's only known at runtime what system we are running on. As we already parse the FDT in the PBL to get the memory regions, we could extract the board compatible as well and determine which UART to use. Add a helper to achieve this. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210410110638.2106658-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pbl: provide externally visible fdt_find_memAhmad Fatoum2021-02-221-0/+70
of_find_mem can be used for generic DT images for other architectures as well. To support this, move the definition, so it can be used by others in the future. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>