Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MIPS: JZ4770: Add initial device-tree support
  • Loading branch information
pcercuei committed Jan 21, 2015
1 parent 64e7f66 commit b1384b7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/mips/Kconfig
Expand Up @@ -283,6 +283,8 @@ config MACH_JZ4770
select JZSOC
select JZRISC
select PINCTRL
select BUILTIN_DTB
select USE_OF
select CPU_SUPPORTS_CPUFREQ
select MIPS_EXTERNAL_TIMER

Expand Down
12 changes: 12 additions & 0 deletions arch/mips/boot/dts/jz4770.dtsi
@@ -0,0 +1,12 @@
/ {
#address-cells = <1>;
#size-cells = <1>;
compatible = "ingenic,jz4770";

cpuintc: cpuintc@0 {
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-controller;
compatible = "mti,cpu-interrupt-controller";
};
};
19 changes: 19 additions & 0 deletions arch/mips/jz4770/setup.c
Expand Up @@ -26,6 +26,8 @@
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/ioport.h>
#include <linux/of_fdt.h>
#include <linux/of_platform.h>
#include <linux/tty.h>
#include <linux/serial.h>
#include <linux/serial_core.h>
Expand All @@ -39,6 +41,7 @@
#include <asm/mipsregs.h>
#include <asm/reboot.h>
#include <asm/pgtable.h>
#include <asm/prom.h>
#include <asm/time.h>
#include <asm/page.h>

Expand Down Expand Up @@ -179,6 +182,7 @@ void __init plat_mem_setup(void)
iomem_resource.end = 0xffffffff;

jz_reset_init();
__dt_setup_arch(__dtb_start);

jz_soc_setup();
jz_serial_setup();
Expand All @@ -205,3 +209,18 @@ void __init jz4770_reserve_unsafe_for_dma(void)
break;
}
}

void __init device_tree_init(void)
{
if (!initial_boot_params)
return;

unflatten_and_copy_device_tree();
}

static int __init populate_machine(void)
{
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
return 0;
}
arch_initcall(populate_machine);

0 comments on commit b1384b7

Please sign in to comment.