diff --git a/buildroot-external/barebox-env/init/global_bootargs b/buildroot-external/barebox-env/init/global_bootargs index a6643cbad..f2cf669cb 100644 --- a/buildroot-external/barebox-env/init/global_bootargs +++ b/buildroot-external/barebox-env/init/global_bootargs @@ -2,3 +2,4 @@ global linux.bootargs.zram="zram.enabled=1 zram.num_devices=3" global linux.bootargs.apparmor="apparmor=1 security=apparmor" +global linux.bootargs.misc="rootwait" diff --git a/buildroot-external/board/rpi2/barebox-env/init/rpi_dt b/buildroot-external/board/rpi2/barebox-env/init/rpi_dt new file mode 100644 index 000000000..a53c77a6f --- /dev/null +++ b/buildroot-external/board/rpi2/barebox-env/init/rpi_dt @@ -0,0 +1,4 @@ +#!/bin/sh + +memcpy -d /tmp/rpi.dtb 0x02008000 0 0x8000 +oftree -f -l /tmp/rpi.dtb diff --git a/buildroot-external/board/rpi2/barebox-env/overlay/barebox-state-rpi.dtbo b/buildroot-external/board/rpi2/barebox-env/overlay/barebox-state-rpi.dtbo index 3ceea4acc..e8eefc5b7 100644 Binary files a/buildroot-external/board/rpi2/barebox-env/overlay/barebox-state-rpi.dtbo and b/buildroot-external/board/rpi2/barebox-env/overlay/barebox-state-rpi.dtbo differ diff --git a/buildroot-external/board/rpi2/post-image.sh b/buildroot-external/board/rpi2/post-image.sh index e8b0599d1..f1d52a18b 100755 --- a/buildroot-external/board/rpi2/post-image.sh +++ b/buildroot-external/board/rpi2/post-image.sh @@ -27,6 +27,7 @@ cp -r ${BINARIES_DIR}/rpi-firmware/overlays ${BOOT_DATA}/ # Update Boot options ( echo "kernel=barebox.bin" + echo "device_tree_address=0x02008000" echo "disable_splash=1" echo "dtparam=audio=on" echo "enable_uart=1" diff --git a/buildroot-external/patches/barebox/0003-drivers-of-bugfix-partition-fixups.patch b/buildroot-external/patches/barebox/0003-drivers-of-bugfix-partition-fixups.patch new file mode 100644 index 000000000..82937ab1e --- /dev/null +++ b/buildroot-external/patches/barebox/0003-drivers-of-bugfix-partition-fixups.patch @@ -0,0 +1,34 @@ +From cf05dfaa34d8502041aa2354f3b8c97ca4d250c9 Mon Sep 17 00:00:00 2001 +From: Pascal Vizeli +Date: Thu, 7 Jun 2018 17:36:00 +0000 +Subject: [PATCH 1/1] drivers: of: bugfix partition fixups + +If we load a new device tree for linux kernel with a diferent layout, +the fixup of partition going into endless loop. Exactly the of_find_property +function will never come back on a invalid device_node. + +My patch check, if the device will exists on device tree before we run the +fixup. + +Signed-off-by: Pascal Vizeli +--- + drivers/of/partition.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/of/partition.c b/drivers/of/partition.c +index aa6e601b7..17e420964 100644 +--- a/drivers/of/partition.c ++++ b/drivers/of/partition.c +@@ -140,6 +140,9 @@ static int of_partition_fixup(struct device_node *root, void *ctx) + if (!cdev->device_node) + return -EINVAL; + ++ if (!of_find_node_by_path(cdev->device_node->full_name)) ++ return -EINVAL; ++ + list_for_each_entry(partcdev, &cdev->partitions, partition_entry) { + if (partcdev->flags & DEVFS_PARTITION_FROM_TABLE) + continue; +-- +2.17.1 + diff --git a/fdt/barebox-state-rpi.dtbo b/fdt/barebox-state-rpi.dtbo index 3ceea4acc..e8eefc5b7 100644 Binary files a/fdt/barebox-state-rpi.dtbo and b/fdt/barebox-state-rpi.dtbo differ diff --git a/fdt/barebox-state-rpi.dtso b/fdt/barebox-state-rpi.dtso index 4da58a623..733e0c108 100644 --- a/fdt/barebox-state-rpi.dtso +++ b/fdt/barebox-state-rpi.dtso @@ -5,13 +5,6 @@ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; fragment@0 { - target = <&sdhci>; - __overlay__ { - status = "disabled"; - }; - }; - - fragment@1 { target = <&sdhost>; __overlay__ { status = "okay"; @@ -20,7 +13,7 @@ #size-cells = <1>; compatible = "fixed-partitions"; - backend_state_sdhost: partition@22100000 { + backend_state: partition@22100000 { label = "state"; reg = <0x22100000 0x800000>; }; @@ -28,10 +21,64 @@ }; }; - fragment@2 { - target = <&state>; + + fragment@1 { + target-path = "/"; __overlay__ { - backend = <&backend_state_sdhost>; + state: state { + #address-cells = <1>; + #size-cells = <1>; + magic = <0xef98423f>; + compatible = "barebox,state"; + backend = <&backend_state>; + backend-type = "raw"; + backend-stridesize = <4048>; + + bootstate { + #address-cells = <1>; + #size-cells = <1>; + + system0 { + #address-cells = <1>; + #size-cells = <1>; + remaining_attempts@0 { + reg = <0x0 0x4>; + type = "uint32"; + default = <3>; + }; + priority@4 { + reg = <0x4 0x4>; + type = "uint32"; + default = <20>; + }; + }; + system1 { + #address-cells = <1>; + #size-cells = <1>; + remaining_attempts@8 { + reg = <0x8 0x4>; + type = "uint32"; + default = <0>; + }; + priority@c { + reg = <0xc 0x4>; + type = "uint32"; + default = <10>; + }; + }; + last_chosen@10 { + reg = <0x10 0x4>; + type = "uint32"; + }; + }; + }; + }; + }; + + fragment@3 { + target-path = "/aliases"; + __overlay__ { + state = "/state"; }; }; }; diff --git a/fdt/rpi-dwc.dtbo b/fdt/rpi-dwc.dtbo deleted file mode 100644 index 3f7b691d4..000000000 Binary files a/fdt/rpi-dwc.dtbo and /dev/null differ diff --git a/fdt/rpi-dwc.dtso b/fdt/rpi-dwc.dtso deleted file mode 100644 index 6e5b61a5f..000000000 --- a/fdt/rpi-dwc.dtso +++ /dev/null @@ -1,23 +0,0 @@ -/dts-v1/; -/plugin/; - -/ { - compatible = "brcm,bcm2708"; - - fragment@0 { - target = <&usb>; - #address-cells = <1>; - #size-cells = <1>; - __overlay__ { - compatible = "brcm,bcm2835-usb"; - reg = <0x7e980000 0x10000>; - interrupts = <1 9>; - dr_mode = "otg"; - g-np-tx-fifo-size = <32>; - g-rx-fifo-size = <256>; - g-tx-fifo-size = <512 512 512 512 512 256 256>; - status = "okay"; - }; - }; -}; - diff --git a/fdt/rpi-v3d.dtbo b/fdt/rpi-v3d.dtbo deleted file mode 100644 index b598d50b9..000000000 Binary files a/fdt/rpi-v3d.dtbo and /dev/null differ diff --git a/fdt/rpi-v3d.dtso b/fdt/rpi-v3d.dtso deleted file mode 100644 index 4ad0b70c9..000000000 --- a/fdt/rpi-v3d.dtso +++ /dev/null @@ -1,108 +0,0 @@ -/dts-v1/; -/plugin/; - -/ { - compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; - - fragment@0 { - target = <&i2c2>; - - __overlay__ { - status = "okay"; - }; - }; - - fragment@1 { - target = <&fb>; - - __overlay__ { - status = "disabled"; - }; - }; - - fragment@2 { - target = <&pixelvalve0>; - - __overlay__ { - interrupts = <0x2 0xd>; - status = "okay"; - }; - }; - - fragment@3 { - target = <&pixelvalve1>; - - __overlay__ { - interrupts = <0x2 0xe>; - status = "okay"; - }; - }; - - fragment@4 { - target = <&pixelvalve2>; - - __overlay__ { - interrupts = <0x2 0xa>; - status = "okay"; - }; - }; - - fragment@5 { - target = <&hvs>; - - __overlay__ { - interrupts = <0x2 0x1>; - status = "okay"; - }; - }; - - fragment@6 { - target = <&hdmi>; - - __overlay__ { - interrupts = <0x2 0x8 0x2 0x9>; - status = "okay"; - }; - }; - - fragment@7 { - target = <&v3d>; - - __overlay__ { - interrupts = <0x1 0xa>; - status = "okay"; - }; - }; - - fragment@8 { - target = <&vc4>; - - __overlay__ { - status = "okay"; - }; - }; - - fragment@9 { - target-path = "/soc/dma"; - - __overlay__ { - brcm,dma-channel-mask = <0x7f35>; - }; - }; - - fragment@10 { - target = <&clocks>; - - __overlay__ { - claim-clocks = <0x22 0x23 0xf 0x10>; - }; - }; - - fragment@11 { - target = <&vec>; - - __overlay__ { - status = "okay"; - }; - }; -}; diff --git a/scripts/update-dtb.sh b/scripts/update-dtb.sh index 983d2ac42..dfeac5700 100755 --- a/scripts/update-dtb.sh +++ b/scripts/update-dtb.sh @@ -8,9 +8,3 @@ cp -f fdt/barebox-state-efi.dtb buildroot-external/board/ova/ dtc -@ -I dts -O dtb -o fdt/barebox-state-rpi.dtbo fdt/barebox-state-rpi.dtso cp -f fdt/barebox-state-rpi.dtbo buildroot-external/board/rpi2/barebox-env/overlay/ -dtc -@ -I dts -O dtb -o fdt/rpi-v3d.dtbo fdt/rpi-v3d.dtso -#cp -f fdt/rpi-v3d.dtbo buildroot-external/board/rpi2/barebox-env/overlay/ - -dtc -@ -I dts -O dtb -o fdt/rpi-dwc.dtbo fdt/rpi-dwc.dtso -#cp -f fdt/rpi-dwc.dtbo buildroot-external/board/rpi2/barebox-env/overlay/ -