base-files: reduce IPv6 ULA prefix generation to a single call
[openwrt/staging/stintel.git] / package / boot / uboot-mvebu / patches / 0001-arm-mvebu-Espressobin-move-FDT-fixup-into-a-separate.patch
1 From 8621f6d22a9589651c6f25742294dd19a26db430 Mon Sep 17 00:00:00 2001
2 From: Robert Marko <robert.marko@sartura.hr>
3 Date: Thu, 3 Aug 2023 13:34:13 +0200
4 Subject: [PATCH 1/3] arm: mvebu: Espressobin: move FDT fixup into a separate
5 function
6
7 Currently, Esspresobin FDT is being fixed up directly in ft_board_setup()
8 which makes it hard to add support for any other board to be fixed up.
9
10 So, lets just move the FDT fixup code to a separate function and call it
11 if compatible matches, there should be no functional change.
12
13 Signed-off-by: Robert Marko <robert.marko@sartura.hr>
14 ---
15 board/Marvell/mvebu_armada-37xx/board.c | 14 +++++++++-----
16 1 file changed, 9 insertions(+), 5 deletions(-)
17
18 --- a/board/Marvell/mvebu_armada-37xx/board.c
19 +++ b/board/Marvell/mvebu_armada-37xx/board.c
20 @@ -359,18 +359,14 @@ int last_stage_init(void)
21 #endif
22
23 #ifdef CONFIG_OF_BOARD_SETUP
24 -int ft_board_setup(void *blob, struct bd_info *bd)
25 +static int espressobin_fdt_setup(void *blob)
26 {
27 -#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
28 int ret;
29 int spi_off;
30 int parts_off;
31 int part_off;
32
33 /* Fill SPI MTD partitions for Linux kernel on Espressobin */
34 - if (!of_machine_is_compatible("globalscale,espressobin"))
35 - return 0;
36 -
37 spi_off = fdt_node_offset_by_compatible(blob, -1, "jedec,spi-nor");
38 if (spi_off < 0)
39 return 0;
40 @@ -455,6 +451,14 @@ int ft_board_setup(void *blob, struct bd
41 return 0;
42 }
43
44 + return 0;
45 +}
46 +
47 +int ft_board_setup(void *blob, struct bd_info *bd)
48 +{
49 +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
50 + if (of_machine_is_compatible("globalscale,espressobin"))
51 + return espressobin_fdt_setup(blob);
52 #endif
53 return 0;
54 }