Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/arch/mips/jz4740/prom.c b/arch/mips/jz4740/prom.c
- index 5a93f38..562b6d3 100644
- --- a/arch/mips/jz4740/prom.c
- +++ b/arch/mips/jz4740/prom.c
- @@ -17,6 +17,9 @@
- #include <linux/kernel.h>
- #include <linux/init.h>
- #include <linux/string.h>
- +#include <linux/bootmem.h>
- +#include <linux/of_platform.h>
- +#include <linux/of_fdt.h>
- #include <linux/serial_reg.h>
- @@ -44,6 +47,22 @@ static __init void jz4740_init_cmdline(int argc, char *argv[])
- *dst = 0;
- }
- +void __init device_tree_init(void)
- +{
- + unsigned long base, size;
- +
- + if (!initial_boot_params)
- + return;
- +
- + base = virt_to_phys((void *)initial_boot_params);
- + size = be32_to_cpu(initial_boot_params->totalsize);
- +
- + /* Before we do anything, lets reserve the dt blob */
- + reserve_bootmem(base, size, BOOTMEM_DEFAULT);
- +
- + unflatten_device_tree();
- +}
- +
- void __init prom_init(void)
- {
- jz4740_init_cmdline((int)fw_arg0, (char **)fw_arg1);
- @@ -66,3 +85,16 @@ void prom_putchar(char c)
- writeb(c, UART_REG(UART_TX));
- }
- +
- +static const struct of_device_id __initdata of_ids[] = {
- + { .compatible = "simple-bus", },
- + {},
- +};
- +
- +static int __init plat_of_setup(void)
- +{
- + if (!of_have_populated_dt())
- + return 0;
- + return of_platform_bus_probe(NULL, of_ids, NULL);
- +}
- +arch_initcall(plat_of_setup);
- diff --git a/arch/mips/jz4740/setup.c b/arch/mips/jz4740/setup.c
- index 76eafcb..12c049b 100644
- --- a/arch/mips/jz4740/setup.c
- +++ b/arch/mips/jz4740/setup.c
- @@ -17,8 +17,11 @@
- #include <linux/init.h>
- #include <linux/io.h>
- #include <linux/kernel.h>
- +#include <linux/of_platform.h>
- +#include <linux/of_fdt.h>
- #include <asm/bootinfo.h>
- +#include <asm/mips-boards/generic.h>
- #include <asm/mach-jz4740/base.h>
- @@ -27,7 +30,6 @@
- #define JZ4740_EMC_SDRAM_CTRL 0x80
- -
- static void __init jz4740_detect_mem(void)
- {
- void __iomem *jz_emc_base;
- @@ -53,6 +55,7 @@ void __init plat_mem_setup(void)
- {
- jz4740_reset_init();
- jz4740_detect_mem();
- + __dt_setup_arch(&__dtb_start);
- }
- const char *get_system_type(void)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement