X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fstaging%2Fldir.git;a=blobdiff_plain;f=target%2Flinux%2Fbcm63xx%2Fpatches-5.15%2F367-MIPS-BCM63XX-add-support-for-loading-DTB.patch;fp=target%2Flinux%2Fbcm63xx%2Fpatches-5.15%2F367-MIPS-BCM63XX-add-support-for-loading-DTB.patch;h=16015a0041aa950707b559a9245933bd991ff6f5;hp=0000000000000000000000000000000000000000;hb=2317a7426ed95978e7f4feaebb00bc909ffced34;hpb=0f14619e301059848761eb6c973c0bb85f211b94 diff --git a/target/linux/bcm63xx/patches-5.15/367-MIPS-BCM63XX-add-support-for-loading-DTB.patch b/target/linux/bcm63xx/patches-5.15/367-MIPS-BCM63XX-add-support-for-loading-DTB.patch new file mode 100644 index 0000000000..16015a0041 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.15/367-MIPS-BCM63XX-add-support-for-loading-DTB.patch @@ -0,0 +1,119 @@ +From 26546e5499d98616322fb3472b977e2e86603f3a Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Tue, 24 Jun 2014 10:57:51 +0200 +Subject: [PATCH 45/48] MIPS: BCM63XX: add support for loading DTB + +Signed-off-by: Jonas Gorski +--- + arch/mips/bcm63xx/boards/Kconfig | 4 ++++ + arch/mips/bcm63xx/boards/board_common.c | 34 +++++++++++++++++++++++++++++++ + arch/mips/bcm63xx/prom.c | 6 ++++++ + 3 files changed, 44 insertions(+) + +--- a/arch/mips/bcm63xx/boards/Kconfig ++++ b/arch/mips/bcm63xx/boards/Kconfig +@@ -2,6 +2,10 @@ + menu "Board support" + depends on BCM63XX + ++config BOARD_BCM63XX_DT ++ bool "Device Tree boards (experimential)" ++ select USE_OF ++ + config BOARD_BCM963XX + bool "Generic Broadcom 963xx boards" + select SSB +--- a/arch/mips/bcm63xx/boards/board_common.c ++++ b/arch/mips/bcm63xx/boards/board_common.c +@@ -10,11 +10,14 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include + #include + #include ++#include + #include + #include + #include +@@ -125,8 +128,23 @@ void __init board_setup(void) + /* make sure we're running on expected cpu */ + if (bcm63xx_get_cpu_id() != board.expected_cpu_id) + panic("unexpected CPU for bcm963xx board"); ++ ++#if CONFIG_OF ++ if (initial_boot_params) ++ __dt_setup_arch(initial_boot_params); ++#endif + } + ++#if CONFIG_OF ++void __init device_tree_init(void) ++{ ++ if (!initial_boot_params) ++ return; ++ ++ unflatten_and_copy_device_tree(); ++} ++#endif ++ + static struct gpio_led_platform_data bcm63xx_led_data; + + static struct platform_device bcm63xx_gpio_leds = { +@@ -135,6 +153,13 @@ static struct platform_device bcm63xx_gp + .dev.platform_data = &bcm63xx_led_data, + }; + ++#if CONFIG_OF ++static struct of_device_id of_ids[] = { ++ { /* filled at runtime */ }, ++ { .compatible = "simple-bus" }, ++ { }, ++}; ++#endif + /* + * third stage init callback, register all board devices. + */ +@@ -142,6 +167,15 @@ int __init board_register_devices(void) + { + int usbh_ports = 0; + ++#if CONFIG_OF ++ if (of_have_populated_dt()) { ++ snprintf(of_ids[0].compatible, sizeof(of_ids[0].compatible), ++ "brcm,bcm%x", bcm63xx_get_cpu_id()); ++ ++ of_platform_populate(NULL, of_ids, NULL, NULL); ++ } ++#endif ++ + if (board.has_uart0) + bcm63xx_uart_register(0); + +--- a/arch/mips/bcm63xx/prom.c ++++ b/arch/mips/bcm63xx/prom.c +@@ -8,6 +8,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -22,6 +23,12 @@ + void __init prom_init(void) + { + u32 reg, mask; ++ void *fdt = get_fdt(); ++ ++#if CONFIG_OF ++ if (fdt) ++ early_init_dt_verify(fdt); ++#endif + + bcm63xx_cpu_init(); +