Skip to content

Commit b5c2fcb

Browse files
committed
kboot/isp: Pass ctrr_size to FDT
Still needed to fill out the fw bootargs. Signed-off-by: Eileen Yoon <eyn@gmx.com>
1 parent 4511899 commit b5c2fcb

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/isp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,15 @@ static void isp_ctrr_init_t6000(u64 base, const struct dart_tunables *config, u3
8383
static bool isp_initialized = false;
8484
static u64 heap_phys, heap_iova, heap_size, heap_top;
8585

86-
int isp_get_heap(u64 *phys, u64 *iova, u64 *size)
86+
int isp_get_heap(u64 *phys, u64 *iova, u64 *size, u64 *top)
8787
{
8888
if (!isp_initialized)
8989
return -1;
9090

9191
*phys = heap_phys;
9292
*iova = heap_iova;
9393
*size = heap_size;
94+
*top = heap_top;
9495
return 0;
9596
}
9697

src/isp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
#include "types.h"
77

88
int isp_init(void);
9-
int isp_get_heap(u64 *phys, u64 *iova, u64 *size);
9+
int isp_get_heap(u64 *phys, u64 *iova, u64 *size, u64 *top);
1010

1111
#endif

src/kboot.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,15 +1795,15 @@ static int dt_set_isp_fwdata(void)
17951795
const char *fdt_path = "isp";
17961796
int ret = 0;
17971797

1798-
u64 phys, iova, size;
1798+
u64 phys, iova, size, top;
17991799

18001800
int fdt_node = fdt_path_offset(dt, fdt_path);
18011801
if (fdt_node < 0) {
18021802
printf("FDT: '%s' not found\n", fdt_path);
18031803
return 0;
18041804
}
18051805

1806-
if (isp_get_heap(&phys, &iova, &size)) {
1806+
if (isp_get_heap(&phys, &iova, &size, &top)) {
18071807
const char *status = fdt_getprop(dt, fdt_node, "status", NULL);
18081808

18091809
if (!status || strcmp(status, "disabled")) {
@@ -1843,6 +1843,12 @@ static int dt_set_isp_fwdata(void)
18431843
if (ret < 0)
18441844
bail("FDT: couldn't add 'isp-heap' reserved mem: %d\n", ret);
18451845

1846+
fdt_node = fdt_path_offset(dt, fdt_path);
1847+
if (fdt_node < 0)
1848+
return fdt_node;
1849+
if (fdt_appendprop_u64(dt, fdt_node, "apple,isp-ctrr-size", top))
1850+
bail("FDT: couldn't append to 'apple,isp-ctrr-size'\n");
1851+
18461852
return 0;
18471853
}
18481854

0 commit comments

Comments
 (0)