summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-04-22 19:57:25 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2020-04-22 19:57:25 +0200
commit759656ad4cc778b6cff47296b718cd388e762adc (patch)
tree488c0bb38c300ec2d2e38160a704499e551aee27
parent77048feb25e6d3334a5c3e0942f65c17da426548 (diff)
downloadplan9front-759656ad4cc778b6cff47296b718cd388e762adc.tar.xz
bcm, bcm64: dancing to the drum of the linux clowns for device tree memory size detection (thanks kenji)
looks like linux changed the device tree names for the memory node: https://github.com/raspberrypi/linux/commit/4b17654f51fd87c42cda3217b0863e6aa1df49b9#diff-ac03c9402b807c11d42edc9e8d03dfc7 this fixes the memory size detection with latest firmware on raspberry pi4-b (4GB) for kenji.
-rw-r--r--sys/src/9/bcm/bootargs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/src/9/bcm/bootargs.c b/sys/src/9/bcm/bootargs.c
index efb0183b5..aac14c501 100644
--- a/sys/src/9/bcm/bootargs.c
+++ b/sys/src/9/bcm/bootargs.c
@@ -89,7 +89,8 @@ beget4(uchar *p)
static void
devtreeprop(char *path, char *key, void *val, int len)
{
- if(strcmp(path, "/memory") == 0 && strcmp(key, "reg") == 0){
+ if((strcmp(path, "/memory") == 0 || strcmp(path, "/memory@0") == 0)
+ && strcmp(key, "reg") == 0){
if(findconf("*maxmem") < 0 && len > 0 && (len % (3*4)) == 0){
uvlong top;
uchar *p = val;